/* Case-study pages. Same field, ink and type as the home page, set for long reading. */
@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --field: #2D5FA8;
  --field-deep: #1F4C8F;
  --ink: #FFFFFF;
  --ink-soft: rgba(255, 255, 255, 0.78);
  --rule: rgba(255, 255, 255, 0.28);
  --sun: #FFD25A;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; }
html { background: var(--field); }
body {
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: clamp(20px, 4vw, 48px) clamp(20px, 5vw, 72px);
  background: var(--field);
  color: var(--ink);
  font-family: "Archivo", system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--sun); color: #13213A; }
a { color: inherit; text-underline-offset: 4px; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 4px; border-radius: 4px; }

/* ── Top and bottom lines (as on the home page) ── */
.top {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  font-size: 15px; font-weight: 500; color: var(--ink-soft);
}
.name { color: var(--ink); font-weight: 800; font-stretch: 112%; letter-spacing: -0.01em; font-size: 18px; text-decoration: none; }
.top a:not(.name) { text-decoration: none; }
.top a:not(.name):hover { color: var(--ink); text-decoration: underline; }
.foot {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-top: 18px; border-top: 1px solid var(--rule);
  font-size: 14px; color: var(--ink-soft);
}

main { width: 100%; max-width: 1200px; padding: clamp(40px, 8vh, 96px) 0; }

/* ── Headings ── */
.kicker { font-size: 15px; font-weight: 600; color: var(--ink-soft); letter-spacing: 0.02em; }
h1 {
  margin-top: 12px;
  font-size: clamp(32px, 6.4vw, 96px);
  line-height: 0.95;
  font-weight: 850;
  font-stretch: 118%;
  letter-spacing: -0.035em;
  max-width: 16ch;
  text-wrap: balance;
}
.lede {
  margin-top: clamp(20px, 3vh, 32px);
  max-width: 52ch;
  font-size: clamp(19px, 1.9vw, 24px);
  line-height: 1.45;
  color: var(--ink-soft);
  text-wrap: pretty;
}

/* ── Facts row: role, time, stack, link ── */
.facts {
  margin-top: clamp(32px, 5vh, 56px);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 20px 32px;
  padding: 20px 0; border-block: 1px solid var(--rule);
}
.facts dt { font-size: 13px; font-weight: 600; color: var(--ink-soft); letter-spacing: 0.04em; text-transform: uppercase; }
.facts dd { margin-top: 4px; font-size: 16px; font-weight: 500; }

/* ── Body copy ── */
.story { margin-top: clamp(40px, 7vh, 80px); max-width: 66ch; }
.story h2 {
  margin-top: 56px;
  font-size: clamp(24px, 2.6vw, 32px); line-height: 1.15;
  font-weight: 800; font-stretch: 112%; letter-spacing: -0.02em;
}
.story h2:first-child { margin-top: 0; }
.story p, .story ul, .story ol { margin-top: 16px; color: var(--ink-soft); text-wrap: pretty; }
.story strong { color: var(--ink); font-weight: 650; }
.story li + li { margin-top: 6px; }

/* Screenshots run wider than the text column. */
.shot { margin: 40px 0; max-width: 1200px; }
.story .shot { width: min(1200px, calc(100vw - 2 * clamp(20px, 5vw, 72px))); }
.shot img { display: block; width: 100%; height: auto; border-radius: 12px; box-shadow: 0 20px 50px -24px rgba(10, 25, 55, 0.7); }
.shot figcaption { margin-top: 10px; font-size: 14px; color: var(--ink-soft); }

/* ── Close: back to the one action ── */
.next { margin-top: clamp(56px, 9vh, 112px); display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; }
.mail {
  display: inline-flex; align-items: center; min-height: 56px; padding: 0 26px; border-radius: 999px;
  background: var(--ink); color: #13213A; text-decoration: none;
  font-size: 18px; font-weight: 650; letter-spacing: -0.01em;
  box-shadow: 0 10px 30px -12px rgba(10, 25, 55, 0.55);
  transition: transform 220ms var(--ease);
}
.mail:hover { transform: translateY(-2px); }
.back { font-size: 15px; font-weight: 500; color: var(--ink-soft); }
.back:hover { color: var(--ink); }

/* ── Work index: one row per case study ── */
.list { margin-top: clamp(40px, 7vh, 80px); list-style: none; padding: 0; border-top: 1px solid var(--rule); }
/* Each row leads with the work itself; the words explain it. */
.list a {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 16px clamp(24px, 4vw, 56px); align-items: center;
  padding: clamp(28px, 4vw, 44px) 0; border-bottom: 1px solid var(--rule); text-decoration: none;
}
.list .thumb { display: block; overflow: hidden; border-radius: 12px; aspect-ratio: 16 / 10; background: var(--field-deep); box-shadow: 0 20px 50px -24px rgba(10, 25, 55, 0.7); }
.list .thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top left; transition: scale 500ms var(--ease); }
.list a:hover .thumb img { scale: 1.03; }
.list .text { display: grid; gap: 10px; align-content: center; }
.list .t { font-size: clamp(24px, 2.8vw, 38px); font-weight: 800; font-stretch: 112%; letter-spacing: -0.02em; line-height: 1.12; text-wrap: balance; }
.list .d { color: var(--ink-soft); max-width: 44ch; text-wrap: pretty; }
.list .y { font-size: 15px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.list a:hover .t { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
@media (max-width: 760px) { .list a { grid-template-columns: 1fr; } }

@media (max-width: 560px) {
  .top .where { display: none; }
  .mail { width: 100%; justify-content: center; text-align: center; padding-block: 12px; line-height: 1.35; }
}

/* A phone screenshot stays phone-sized instead of running the full width. */
.story .shot.shot-phone { width: auto; max-width: 360px; }

/* ── Media ─────────────────────────────────────
   The work is the argument, so screens run wide and come early. */
.hero-media { margin-top: clamp(40px, 6vh, 64px); }
.hero-media img, .hero-media video {
  display: block; width: 100%; height: auto; border-radius: 14px;
  background: var(--field-deep);
  box-shadow: 0 30px 70px -30px rgba(10, 25, 55, 0.75);
}
.hero-media figcaption, .gallery figcaption, .phones figcaption { margin-top: 12px; font-size: 14px; color: var(--ink-soft); max-width: 70ch; }

.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 28px; margin: 48px 0; }
.gallery figure { margin: 0; }
.gallery .span { grid-column: 1 / -1; }
.gallery img { display: block; width: 100%; height: auto; border-radius: 12px; box-shadow: 0 20px 50px -24px rgba(10, 25, 55, 0.7); }

/* Phone screens sit side by side at phone size, never stretched. */
.phones { display: flex; flex-wrap: wrap; gap: 28px; margin: 48px 0; align-items: flex-start; }
.phones figure { margin: 0; width: min(300px, 100%); }
.phones figure.doc { width: min(420px, 100%); }
.phones img { display: block; width: 100%; height: auto; border-radius: 22px; box-shadow: 0 20px 50px -24px rgba(10, 25, 55, 0.7); }

/* The story column stays readable; media breaks out to the page width. */
.story > .gallery, .story > .phones { max-width: 1200px; width: min(1200px, calc(100vw - 2 * clamp(20px, 5vw, 72px))); }

.story h3 { margin-top: 28px; font-size: 19px; font-weight: 750; letter-spacing: -0.01em; color: var(--ink); }
.story h3 + p { margin-top: 6px; }
.facts dd b { font-weight: 750; font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
  .gallery { grid-template-columns: 1fr; gap: 28px; }
  .phones figure { width: calc(50% - 14px); }
  .phones figure.doc { width: 100%; }
}
