/* ——— Aurèle de Bosset — Swiss Editorial ——— */

:root {
  --paper: #fafaf7;
  --ink: #111111;
  --red: #d92b2b;
  --green: #2f6b45;
  --muted: #5c5c56;
  --faint: #8a8a82;
  --rule: #dcdcd4;
  --card: #ffffff;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --sans: 'Archivo', 'Helvetica Neue', Helvetica, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* faint engineering-grid backdrop */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(17,17,17,0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(17,17,17,0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  z-index: 0;
}

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 28px;
  position: relative;
  z-index: 1;
}

a { color: inherit; }

::selection { background: var(--red); color: #fff; }

/* ——— nav ——— */
nav {
  border-bottom: 2px solid var(--ink);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 10;
}

nav .container {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 20px;
  padding-bottom: 14px;
}

.nav-name {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 22px;
}

.nav-links a {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.15s;
}

.nav-links a:hover { color: var(--red); }
.nav-links a.active { color: var(--ink); border-bottom: 2px solid var(--red); padding-bottom: 2px; }

/* ——— hero ——— */
.hero { padding: 84px 0 56px; }

.hero h1 {
  font-size: clamp(40px, 7vw, 64px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.02;
  text-wrap: balance;
}

.hero h1 .accent { color: var(--red); }

.hero .lede {
  margin-top: 24px;
  font-size: 18px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 58ch;
}

.hero .meta {
  margin-top: 26px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--faint);
}

/* ——— sections ——— */
section { padding: 44px 0; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 8px;
  margin-bottom: 26px;
}

.section-head h2 {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.section-head .index {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
}

.prose {
  font-size: 17px;
  line-height: 1.7;
  max-width: 62ch;
  color: #2a2a26;
}

.prose + .prose { margin-top: 16px; }
.prose strong { font-weight: 700; }
.prose a { color: var(--ink); text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.prose a:hover { color: var(--red); }

/* ——— numbers ——— */
.numbers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--ink);
  background: var(--ink);
  gap: 1px;
}

.number-cell {
  background: var(--card);
  padding: 22px 20px 18px;
}

.number-cell .value {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--red);
}

.number-cell .label {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}

/* ——— work CTA (index) ——— */
.work-cta {
  display: block;
  border: 2px solid var(--ink);
  background: var(--card);
  padding: 28px 30px;
  text-decoration: none;
  transition: background 0.15s;
  position: relative;
}

.work-cta:hover { background: #fff6f5; }

.work-cta .kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red);
}

.work-cta h3 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-top: 6px;
}

.work-cta p { color: var(--muted); margin-top: 6px; max-width: 56ch; }

.work-cta .go {
  position: absolute;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 30px;
  font-weight: 800;
  color: var(--red);
  transition: transform 0.15s;
}

.work-cta:hover .go { transform: translateY(-50%) translateX(5px); }

/* ——— press list ——— */
.press-item {
  display: flex;
  gap: 20px;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  transition: background 0.12s;
}

.press-item:hover { background: rgba(217,43,43,0.035); }

.press-item .tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
  width: 110px;
  flex-shrink: 0;
}

.press-item .title { font-weight: 600; font-size: 15px; }

.press-item .src {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  margin-left: auto;
  flex-shrink: 0;
}

/* ——— timeline ——— */
.timeline-item {
  display: flex;
  gap: 26px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}

.timeline-item:last-child { border-bottom: none; }

.timeline-date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  width: 110px;
  flex-shrink: 0;
  padding-top: 3px;
}

.timeline-content h3 { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }

.timeline-content .org { font-size: 14px; font-weight: 600; color: var(--red); }
.timeline-content .org a { color: inherit; text-decoration: none; }
.timeline-content .org a:hover { text-decoration: underline; }

.timeline-content p {
  font-size: 14px;
  color: var(--muted);
  margin-top: 5px;
  max-width: 60ch;
}

/* ——— work page: intro ——— */
.work-intro { padding: 72px 0 40px; }

.work-intro h1 {
  font-size: clamp(34px, 6vw, 52px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.work-intro .lede { margin-top: 18px; font-size: 17px; color: var(--muted); max-width: 60ch; line-height: 1.65; }

.work-intro .meta {
  margin-top: 22px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--faint);
}

/* ——— case-study rows ——— */
.case {
  display: flex;
  gap: 28px;
  padding: 34px 0;
  border-bottom: 1px solid var(--rule);
}

.case .num {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--red);
  line-height: 1;
  width: 58px;
  flex-shrink: 0;
}

.case .body { flex: 1; }

.case .kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}

.case h3 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-top: 4px;
  line-height: 1.15;
}

.case h3 a { text-decoration: none; }
.case h3 a:hover { color: var(--red); }

.case .desc { margin-top: 10px; font-size: 15.5px; line-height: 1.65; color: #2a2a26; max-width: 62ch; }

.case .how {
  margin-top: 12px;
  padding-left: 14px;
  border-left: 3px solid var(--red);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 60ch;
}

.case .stack {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
}

.status { color: var(--green); font-weight: 600; }
.status::before { content: '● '; }

/* ——— grouped cards ——— */
.groups {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.group {
  border: 1px solid var(--rule);
  background: var(--card);
  padding: 20px 22px;
}

.group h3 {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.group ul { list-style: none; }

.group li { padding: 7px 0; font-size: 14px; line-height: 1.5; }

.group li strong { font-weight: 700; }

.group li .d { color: var(--muted); }

.group li .m {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--faint);
  margin-top: 2px;
}

/* ——— footer ——— */
footer {
  border-top: 2px solid var(--ink);
  margin-top: 40px;
  padding: 30px 0 70px;
}

footer .container {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
}

footer p { font-family: var(--mono); font-size: 12px; color: var(--faint); }

footer a { color: var(--ink); text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 3px; }
footer a:hover { color: var(--red); }

/* ——— motion ——— */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero, .work-intro, section, .case { animation: rise 0.5s ease-out both; }
section:nth-of-type(2) { animation-delay: 0.06s; }
section:nth-of-type(3) { animation-delay: 0.12s; }
section:nth-of-type(4) { animation-delay: 0.18s; }
section:nth-of-type(5) { animation-delay: 0.24s; }
.case:nth-of-type(2) { animation-delay: 0.06s; }
.case:nth-of-type(3) { animation-delay: 0.12s; }
.case:nth-of-type(4) { animation-delay: 0.18s; }

@media (prefers-reduced-motion: reduce) {
  .hero, .work-intro, section, .case { animation: none; }
}

/* ——— responsive ——— */
@media (max-width: 640px) {
  .hero { padding: 56px 0 40px; }
  .numbers { grid-template-columns: 1fr 1fr; }
  .groups { grid-template-columns: 1fr; }
  .case { flex-direction: column; gap: 10px; }
  .case .num { width: auto; }
  .timeline-item { flex-direction: column; gap: 4px; }
  .timeline-date { width: auto; }
  .press-item { flex-wrap: wrap; gap: 6px 14px; }
  .press-item .src { display: none; }
  .work-cta .go { display: none; }
  .nav-links { gap: 14px; }
}
