/* Case study pages.
   Same tokens, type scale and monospace voice as the homepage — the homepage
   is one self-contained file, so these are restated here rather than shared. */

:root {
  --paper: #faf9f6;
  --ink:   #111111;
  --accent:#1f2bff;
  --muted: #9a958c;
  --line:  #e2ded4;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ---------- shell ---------- */

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 2.5rem 2rem 6rem;
}

/* Media breaks out past the text column once there is room for it. */
@media (min-width: 1000px) {
  .bleed {
    width: min(1180px, calc(100vw - 5rem));
    margin-left: 50%;
    transform: translateX(-50%);
  }
}

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: baseline;
  margin: 0 0 3.5rem;
}
.topbar .home {
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--ink);
}
.topbar .home:hover { color: var(--accent); }
.topbar .here {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-left: auto;
}

/* ---------- head ---------- */

.kicker {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.6rem;
}

h1 {
  font-size: clamp(2rem, 6vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 1.25rem;
}

p.standfirst {
  font-size: 1.15rem;
  line-height: 1.5;
  max-width: 52ch;
  margin: 0 0 2.25rem;
}

/* client / role / year strip */
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  margin: 0 0 2.5rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 0.78rem;
}
.meta div { min-width: 0; }
.meta dt {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.15rem;
}
.meta dd { margin: 0; }

/* ---------- sections ---------- */

section { margin: 0 0 4rem; }

h2 {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
  margin: 0 0 1.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
}

h3 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
}

p {
  font-size: 0.95rem;
  max-width: 60ch;
  margin: 0 0 1.25rem;
}
p:last-child { margin-bottom: 0; }

a { color: var(--accent); }
a:hover { text-decoration: none; }

ul.plain { list-style: none; padding: 0; margin: 0 0 1.25rem; font-size: 0.95rem; }
ul.plain li { padding-left: 1.2rem; position: relative; margin-bottom: 0.4rem; }
ul.plain li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--muted);
}

/* ---------- process steps ---------- */

.step { margin: 0 0 3rem; }
.step:last-child { margin-bottom: 0; }
.step-n {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin: 0 0 0.35rem;
}

/* ---------- figures ---------- */

figure { margin: 1.75rem 0; }
figure img, figure video {
  display: block;
  width: 100%;
  height: auto;
  background: #efece4;
  border: 1px solid var(--line);
}
figcaption {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.6rem;
  max-width: 62ch;
  line-height: 1.5;
}

/* ---------- video embeds ---------- */

.embed {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  background: #efece4;
}
.embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* ---------- quoted social post ---------- */

.post {
  border: 1px solid var(--line);
  background: #fff;
  padding: 1rem 1.15rem 1.15rem;
  max-width: 460px;
  margin: 1.75rem 0;
}
.post-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.75rem; }
.post-head img { width: 34px; height: 34px; border-radius: 50%; display: block; flex: 0 0 auto; }
.post-name { font-size: 0.82rem; font-weight: 700; line-height: 1.3; }
.post-handle { font-size: 0.72rem; color: var(--muted); line-height: 1.3; }
.post-text { font-size: 0.9rem; margin: 0 0 0.85rem; }
.post-photo {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  margin-bottom: 0.75rem;
  background: #efece4;
}
.post-meta { font-size: 0.72rem; color: var(--muted); }
.post-meta a { color: var(--muted); }
.post-meta a:hover { color: var(--accent); }

/* side-by-side media */
.pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.75rem 0;
}
.pair figure { margin: 0; }

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin: 1.75rem 0;
}
.grid-3 img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid var(--line);
}

/* portrait media shouldn't run full-bleed tall */
figure.portrait { max-width: 380px; }
figure.portrait video, figure.portrait img { aspect-ratio: auto; }

/* ---------- todo markers ---------- */

.todo {
  display: block;
  font-size: 0.78rem;
  line-height: 1.5;
  color: #8a6d00;
  background: #fdf6df;
  border-left: 2px solid #d8b400;
  padding: 0.6rem 0.85rem;
  margin: 0 0 1.25rem;
  max-width: 60ch;
}
.todo::before {
  content: "TODO — ";
  font-weight: 700;
  letter-spacing: 0.08em;
}

/* ---------- facts strip (result numbers) ---------- */

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem 2rem;
  margin-top: 1.5rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.facts div { min-width: 0; }
.facts b {
  display: block;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.facts span {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.3rem;
}

/* ---------- links out ---------- */

.links { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; margin: 1.5rem 0 0; }
.links a {
  font-size: 0.85rem;
  color: var(--ink);
  text-decoration: none;
  position: relative;
  padding-bottom: 3px;
}
.links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}
.links a:hover { color: var(--accent); }
.links a:hover::after { transform: scaleX(1); }

/* ---------- credits ---------- */

.credits { font-size: 0.85rem; }
.credits div { margin-bottom: 0.5rem; }
.credits .who { color: var(--muted); }

/* ---------- next / footer ---------- */

.next {
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
  margin-top: 5rem;
}
.next-label {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1rem;
}
.next ul { list-style: none; padding: 0; margin: 0; }
.next li { margin-bottom: 0.6rem; }
.next a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  border-bottom: 1px solid transparent;
}
.next a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.next .sub { color: var(--muted); font-size: 0.78rem; }
.next .all { margin-top: 1.25rem; }
.next .all a { font-size: 0.85rem; color: var(--muted); }
.next .all a:hover { color: var(--accent); }

/* ---------- index page ---------- */

.case-list { list-style: none; padding: 0; margin: 0; }
.case-list li { border-bottom: 1px solid var(--line); }
.case-list a {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.25rem;
  align-items: start;
  padding: 1.5rem 0;
  text-decoration: none;
  color: var(--ink);
}
.case-list img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #efece4;
  border: 1px solid var(--line);
}
.case-list a:hover .t { color: var(--accent); }
.case-list a:hover img { filter: contrast(1.05); }
.case-list .t { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; }
.case-list .d { font-size: 0.85rem; color: var(--muted); max-width: 60ch; margin-top: 0.2rem; }
.case-list .c { font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.3rem; }
@media (max-width: 640px) {
  .case-list a { grid-template-columns: 1fr; gap: 0.75rem; }
}

@media (max-width: 640px) {
  .wrap { padding: 2rem 1.25rem 4rem; }
  .topbar { margin-bottom: 2.5rem; }
  .topbar .here { margin-left: 0; width: 100%; }
}

/* =====================================================================
   v2 shell: full-screen opening, per-case accent and theme, sticky
   chapters, big numbers, next-case handoff. Additive; pages opt in.
   ===================================================================== */

:root[data-theme="dark"] {
  --paper: #0b0b0b;
  --ink:   #f2efe8;
  --muted: #8d897f;
  --line:  #262624;
}
:root[data-theme="dark"] figure img,
:root[data-theme="dark"] figure video,
:root[data-theme="dark"] .embed { background: #151515; }

/* ---------- opening screen ---------- */

.hero-full {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  background: #000;
  color: #fff;
}
.hero-full .hero-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-full::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,.45) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,0) 45%, rgba(0,0,0,.78) 100%);
  pointer-events: none;
}
.hero-full > * { position: relative; z-index: 1; }
.hero-full .hero-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1.75rem clamp(1.25rem, 4vw, 3rem);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}
.hero-full .hero-top a { color: #fff; text-decoration: none; }
.hero-full .hero-top a:hover { color: var(--accent); }
.hero-full .hero-top .here {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,.6);
}
.hero-full .hero-text {
  padding: 0 clamp(1.25rem, 4vw, 3rem) clamp(2rem, 5vh, 4rem);
  max-width: 1400px;
}
.hero-full .kicker { color: var(--accent); margin-bottom: 0.9rem; }
.hero-full h1 {
  font-size: clamp(3rem, 11vw, 9rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
  margin: 0 0 1.25rem;
  color: #fff;
}
.hero-full .standfirst {
  color: rgba(255,255,255,.88);
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  max-width: 44ch;
  margin: 0;
}
.hero-full .scroll-cue {
  position: absolute;
  right: clamp(1.25rem, 4vw, 3rem);
  bottom: clamp(2rem, 5vh, 4rem);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,.6);
  animation: cue 2.4s ease-in-out infinite;
}
@keyframes cue { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .hero-full .scroll-cue { animation: none; } }

/* the v2 page has no .topbar; meta strip becomes the first thing in the column */
.v2 .wrap { padding-top: 3.5rem; }
.v2 .meta { margin-top: 0; }

/* ---------- chapters: sticky picture, scrolling text ---------- */

.chapters { margin: 0 0 4rem; }
.chapter { margin: 0 0 2rem; }
.chapter figure { margin: 0 0 1.25rem; }
.chapter figure img, .chapter figure video { border: 0; }
.chapter .text { padding: 0.5rem 0 2.5rem; }
.chapter .text h3 { font-size: clamp(1.4rem, 2.6vw, 2rem); letter-spacing: -0.03em; line-height: 1.1; margin: 0 0 1rem; }
.chapter .text p { max-width: 46ch; }

@media (min-width: 1000px) {
  .chapters {
    width: min(1280px, calc(100vw - 5rem));
    margin-left: 50%;
    transform: translateX(-50%);
  }
  .chapter {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 5vw, 5rem);
    align-items: start;
    margin: 0 0 4rem;
  }
  .chapter figure { position: sticky; top: 2rem; margin: 0; }
  .chapter .text {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0;
  }
  .chapter:nth-child(even) figure { order: 2; }
  .chapter.wide { display: block; }
  .chapter.wide figure { position: static; }
  .chapter.wide .text { min-height: 0; padding: 1.5rem 0 3rem; }
}

/* ---------- big numbers ---------- */

.facts.big {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem 3rem;
  padding: 2.5rem 0;
  margin-top: 2.5rem;
  margin-bottom: 2.5rem;
}
.facts.big b { font-size: clamp(2.4rem, 4.6vw, 4.4rem); color: var(--accent); white-space: nowrap; }
.facts.big span { font-size: 0.78rem; }

/* ---------- next case handoff ---------- */

.next-case {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  min-height: 62vh;
  margin-top: 5rem;
  padding: clamp(1.5rem, 4vw, 3rem);
  color: #fff;
  text-decoration: none;
  background-color: #000;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.next-case::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.1), rgba(0,0,0,.75));
  transition: background .3s;
}
.next-case:hover::after { background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.6)); }
.next-case > * { position: relative; z-index: 1; }
.next-case .label { font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(255,255,255,.7); margin-bottom: 0.6rem; }
.next-case .title { font-size: clamp(2rem, 6vw, 5rem); font-weight: 700; letter-spacing: -0.04em; line-height: 0.95; }
.next-case .sub { font-size: 0.85rem; color: rgba(255,255,255,.75); margin-top: 0.75rem; }
.v2 .next { margin-top: 2.5rem; }

/* ---------- parts: a case that is really two products ----------
   Each part opens with a rule, the product name at the page's h1 size, and
   the audience as a second line at chapter-heading size. */

.part {
  margin: 6rem 0 2.5rem;
  padding-top: 2.5rem;
  border-top: 2px solid var(--ink);
}
.part h2 {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: clamp(2rem, 6vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-transform: none;
  color: var(--ink);
  border: 0;
  padding: 0;
  margin: 0 0 1.25rem;
}
.part h2 .aud {
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 0.35rem;
}
.part .standfirst { margin-bottom: 2.25rem; }
.part + .chapters { margin-top: 0; }
