/* ---------- Tokens ---------- */
:root {
  --paper: #f2eee4;
  --ink: #141412;
  --ink-2: #5c584e;
  --rule: rgba(20, 20, 18, 0.18);
  --moss: #4b5c20;
  --img-bg: #d9d4c6;

  --f-display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --f-sans: "Inter Tight", system-ui, sans-serif;
  --f-serif: "Instrument Serif", Georgia, serif;

  --gutter: 16px;
  --max: 1360px;
  --label: 0.6875rem; /* 11px mono labels */
}
/* Case-study pages: B's mood */
.theme-dark {
  --paper: #0e0f0c;
  --ink: #ece8dd;
  --ink-2: #9b978b;
  --rule: rgba(236, 232, 221, 0.16);
  --moss: #a4b96c;
  --img-bg: #1b1d17;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.55 var(--f-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--moss); outline-offset: 3px; }
::selection { background: var(--moss); color: var(--paper); }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 10; }
.skip:focus { left: var(--gutter); }

.label, .mono {
  font-family: var(--f-mono);
  font-size: var(--label);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.label { color: var(--ink-2); }
.accent { color: var(--moss); }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding-top: 14px; padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.topbar a { text-decoration: none; }
.topbar nav { display: flex; gap: 14px; }
.topbar nav a:hover, .topbar a:hover { color: var(--moss); }

/* ---------- Home: hero ---------- */
.hero { padding-top: 28px; padding-bottom: 28px; }
.hero__name {
  font-family: var(--f-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(4.25rem, 24vw, 15rem);
  line-height: 0.82;
  letter-spacing: -0.01em;
  margin: 14px 0 22px;
}
.hero__bio { max-width: 34em; font-size: 1.0625rem; margin: 0; }

/* Slate: key/value rows, call-sheet style */
.slate { margin: 28px 0 0; border-top: 1px solid var(--rule); }
.slate > div {
  display: grid; grid-template-columns: 7.5rem 1fr; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--rule);
}
.slate dt { font-family: var(--f-mono); font-size: var(--label); text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-2); padding-top: 2px; }
.slate dd { margin: 0; }

/* ---------- Numbers ---------- */
.section { padding-top: 44px; padding-bottom: 44px; }
.section__head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  border-bottom: 1px solid var(--ink); padding-bottom: 8px; margin-bottom: 4px;
}
.section__head h2 { font-family: var(--f-mono); font-size: var(--label); font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; margin: 0; }

.stats { display: grid; grid-template-columns: 1fr 1fr; margin: 0; padding: 0; list-style: none; }
.stats li { padding: 16px 0 18px; border-bottom: 1px solid var(--rule); }
.stats li:nth-child(odd) { padding-right: 12px; border-right: 1px solid var(--rule); }
.stats li:nth-child(even) { padding-left: 12px; }
.stat__n {
  display: block;
  font-family: var(--f-display); font-weight: 800;
  font-size: clamp(3.5rem, 17vw, 7.5rem); line-height: 0.9;
  font-variant-numeric: tabular-nums;
}
.stat__l { display: block; margin-top: 6px; }

/* ---------- Running order (cues) ---------- */
.cues { list-style: none; margin: 0; padding: 0; }
.cue { border-bottom: 1px solid var(--rule); }
.cue a {
  display: grid; gap: 14px;
  padding: 20px 0 24px;
  text-decoration: none;
}
.cue__top { display: flex; justify-content: space-between; gap: 12px; }
.cue__title {
  font-family: var(--f-display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(2.5rem, 12vw, 5rem); line-height: 0.88; margin: 0;
}
.cue__meta { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.cue__role { color: var(--moss); }
.cue__go { display: inline-flex; gap: 8px; align-items: center; }
.cue__go::after { content: "→"; transition: transform 0.25s ease; }
.cue a:hover .cue__go::after, .cue a:focus-visible .cue__go::after { transform: translateX(6px); }
.cue a:hover .cue__title { color: var(--moss); }

/* ---------- Figures & captions ---------- */
figure { margin: 0; }
.frame { background: var(--img-bg); overflow: hidden; }
.frame img { width: 100%; transition: transform 0.6s ease; }
.cue a:hover .frame img { transform: scale(1.02); }
figcaption {
  display: flex; justify-content: space-between; gap: 12px;
  padding-top: 8px;
  font-family: var(--f-mono); font-size: var(--label); text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--ink-2);
}
figcaption .credit { color: var(--ink); white-space: nowrap; }

/* ---------- Skills ---------- */
.depts { margin: 0; }
.depts > div { padding: 14px 0; border-bottom: 1px solid var(--rule); display: grid; gap: 6px; }
.depts dt { font-family: var(--f-mono); font-size: var(--label); text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-2); }
.depts dd { margin: 0; }

/* ---------- Contact ---------- */
.contact__big {
  display: inline-block;
  font-family: var(--f-display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(1.75rem, 9vw, 5.5rem); line-height: 0.95;
  text-decoration: none; overflow-wrap: anywhere;
  margin: 18px 0 20px;
}
.contact__big:hover { color: var(--moss); }
.contact__links { display: flex; flex-wrap: wrap; gap: 10px 20px; }
.contact__links a { text-underline-offset: 3px; }

.footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
  padding-top: 16px; padding-bottom: 28px; border-top: 1px solid var(--rule);
}

/* ---------- Case study ---------- */
.case-hero { padding-top: 28px; padding-bottom: 24px; }
.case-title {
  font-family: var(--f-sans); font-weight: 600;
  font-size: clamp(3.25rem, 17vw, 11rem); line-height: 0.88; letter-spacing: -0.045em;
  margin: 14px 0 0;
}
.case-title em { font-family: var(--f-serif); font-style: italic; font-weight: 400; letter-spacing: -0.02em; }
.case-lede { font-size: 1.125rem; max-width: 30em; margin: 18px 0 0; color: var(--ink); }

.bleed { margin: 0 0 8px; }
.bleed .frame img { width: 100%; max-height: 88vh; object-fit: cover; }
.bleed figcaption { padding-left: var(--gutter); padding-right: var(--gutter); max-width: var(--max); margin: 0 auto; }

.sheet { list-style: none; margin: 0; padding: 0; counter-reset: row; }
.sheet > li { display: grid; gap: 8px; padding: 18px 0 20px; border-bottom: 1px solid var(--rule); }
.sheet__k { font-family: var(--f-mono); font-size: var(--label); text-transform: uppercase; letter-spacing: 0.04em; color: var(--moss); }
.sheet__v { font-size: 1.0625rem; max-width: 36em; }
.sheet__v p { margin: 0; }
.sheet__v ul { margin: 0; padding-left: 1.1em; }
.sheet__v li + li { margin-top: 4px; }

.gallery { display: grid; gap: 28px; }

.next {
  display: block; text-decoration: none;
  padding-top: 28px; padding-bottom: 36px; border-top: 1px solid var(--rule);
}
.next__t { display: block; font-family: var(--f-sans); font-weight: 600; letter-spacing: -0.04em; font-size: clamp(2.25rem, 11vw, 6rem); line-height: 0.95; margin-top: 8px; }
.next__t em { font-family: var(--f-serif); font-weight: 400; }
.next:hover .next__t { color: var(--moss); }

/* ---------- Motion (JS adds .js; reduced motion opts out) ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.js [data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .frame img, .cue__go::after { transition: none; }
}

/* ---------- ≥ 720px ---------- */
@media (min-width: 720px) {
  :root { --gutter: 32px; }
  .hero { padding-top: 48px; padding-bottom: 40px; }
  .slate { display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .stats li, .stats li:nth-child(odd), .stats li:nth-child(even) { padding: 18px 16px 20px; border-right: 1px solid var(--rule); }
  .stats li:first-child { padding-left: 0; }
  .stats li:last-child { border-right: 0; }
  .depts { display: grid; grid-template-columns: repeat(2, 1fr); column-gap: 32px; }
  .sheet > li { grid-template-columns: 12rem 1fr; gap: 24px; }
  .gallery { grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
  .gallery .wide { grid-column: 1 / -1; }
}

/* ---------- ≥ 1080px ---------- */
@media (min-width: 1080px) {
  .cue a {
    grid-template-columns: 6rem 1fr 15rem 20rem;
    align-items: start; gap: 24px;
    padding: 24px 0 28px;
  }
  .cue__top { flex-direction: column; justify-content: flex-start; }
  .cue__title { font-size: clamp(3rem, 5.5vw, 5.5rem); }
  .case-hero { padding-top: 56px; padding-bottom: 40px; }
  .case-head { display: grid; grid-template-columns: 1fr 22rem; gap: 48px; align-items: end; }
}

/* Cue thumbnails share one crop so the running order stays even */
.cue .frame { aspect-ratio: 3 / 2; }
.cue .frame img { height: 100%; object-fit: cover; object-position: center 60%; }

/* Three portraits in a row on wide screens */
@media (min-width: 1080px) {
  .gallery--3 { grid-template-columns: repeat(3, 1fr); }
}
.slate--flush { margin-top: 0; }

/* Links inside sheet text */
.sheet__v a { color: var(--moss); text-underline-offset: 3px; }

/* Contact prompt before the next cue */
.cta { display: grid; gap: 10px; justify-items: start; }
.cta__mail {
  font-family: var(--f-sans); font-weight: 600; letter-spacing: -0.03em;
  font-size: clamp(1.6rem, 8vw, 3.5rem); line-height: 1; text-decoration: none;
  overflow-wrap: anywhere;
}
.cta__mail:hover { color: var(--moss); }

/* Tighter mobile rhythm */
@media (max-width: 719px) {
  .section { padding-top: 32px; padding-bottom: 32px; }
  .slate > div { grid-template-columns: 5.75rem 1fr; }
}
