/* Shared styles — index, case studies, 404.
   Direction: monochrome. No accent colour anywhere; hierarchy comes from
   inversion, hairlines, size/weight contrast, and wide-tracked uppercase.
   Space Grotesk carries display, Geist Mono carries everything else. */

/* Variable fonts — one file spans each family's weight range. */
@font-face {
  font-family: "Space Grotesk";
  src: url("assets/fonts/space-grotesk-var.woff2") format("woff2-variations"),
       url("assets/fonts/space-grotesk-var.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("assets/fonts/geist-mono-var.woff2") format("woff2-variations"),
       url("assets/fonts/geist-mono-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg:     #000000;
  --panel:  #0d0d0d;
  --fg:     #ffffff;
  --body:   #c2c2c2;
  --dim:    #8c8c8c;
  --faint:  #606060;
  --line:   #242424;
  /* Kept for parity with the token set; in monochrome it equals --fg and is
     used only on inverted surfaces, never as a hue. */
  --acc:    #ffffff;

  --disp: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* No-JS / first paint: follow the system. */
@media (prefers-color-scheme: light) {
  :root {
    --bg:     #ffffff;
    --panel:  #f4f4f4;
    --fg:     #000000;
    --body:   #3a3a3a;
    --dim:    #6a6a6a;
    --faint:  #8a8a8a;
    --line:   #dcdcdc;
    --acc:    #000000;
  }
}

/* INVERT overrides the system in both directions. */
:root[data-theme="dark"] {
  --bg: #000000; --panel: #0d0d0d; --fg: #ffffff; --body: #c2c2c2;
  --dim: #8c8c8c; --faint: #606060; --line: #242424; --acc: #ffffff;
}
:root[data-theme="light"] {
  --bg: #ffffff; --panel: #f4f4f4; --fg: #000000; --body: #3a3a3a;
  --dim: #6a6a6a; --faint: #8a8a8a; --line: #dcdcdc; --acc: #000000;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* Focus is visible and identical for mouse and keyboard — with no accent
   colour to lean on, the outline has to do the work. */
:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 0 90px; }
.wrap.sub { max-width: 780px; padding: 26px 24px 92px; }

/* ---------- shared chrome ---------- */
.lbl {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 6px;
}

.sechead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}
.sechead h2 {
  font-family: var(--disp);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--fg);
  margin: 0;
}
.sechead p {
  color: var(--dim);
  font-size: 12.5px;
  margin: 0;
  max-width: 330px;
  text-align: right;
}

/* ---------- index: nav ---------- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 30px;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: var(--disp);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.nav .links { display: flex; gap: 22px; }
.nav .links a {
  color: var(--dim);
  font-size: 12.5px;
  text-decoration: none;
}
.nav .links a:hover { color: var(--fg); }

/* The one inverted surface — this is how emphasis works without colour. */
.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 6px 15px;
  color: var(--body);
}
.btn:hover { border-color: var(--fg); color: var(--fg); }
.btn.solid {
  background: var(--fg);
  border-color: var(--fg);
  color: var(--bg);
}
.btn.solid:hover { opacity: 0.82; color: var(--bg); }

/* ---------- index: hero ---------- */
.hero {
  margin: 28px 30px 0;
  padding: 56px 28px;
  border: 1px solid var(--line);
  background: var(--panel);
  text-align: center;
}
.hero .status {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 16px;
}
.hero h1 {
  font-family: var(--disp);
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.04em;
  margin: 0 0 14px;
}
.hero .lede {
  color: var(--body);
  font-size: 14px;
  max-width: 46ch;
  margin: 0 auto 20px;
}

/* ---------- index: sections ---------- */
.band { padding: 46px 30px 0; }

.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.card {
  display: block;
  border: 1px solid var(--line);
  padding: 13px;
  text-decoration: none;
  transition: border-color 0.16s ease, transform 0.16s ease;
}
.card:hover { border-color: var(--fg); transform: translateY(-2px); }
.card .shot {
  height: 220px;
  margin-bottom: 13px;
  background: var(--panel);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  overflow: hidden;
}

/* Phone captures are 202x440, so 220px tall is the largest that stays sharp on
   a 2x display — never scale them past this. Four fit the card's 488px of inner
   width (4 x 101 + gaps); a fifth would overflow. */
.card .shot.phones img { height: 220px; width: auto; display: block; }

/* Wide stills have no such ceiling, so they fill the frame instead of floating
   in the middle of it. */
.card .shot.fill img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}

/* No capture exists for these two, so the frame carries the stack instead of an
   empty box pretending to be an image. */
.card .shot.empty {
  flex-direction: column;
  gap: 7px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}
.card .shot.empty b {
  display: inline-block;   /* inline padding would not clear the line box */
  font-weight: 400;
  border: 1px solid var(--line);
  padding: 3px 9px;
  margin: 2px;
  color: var(--dim);
  letter-spacing: 0.1em;
}

.card .k {
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}
.card .t {
  display: block;
  font-family: var(--disp);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin: 3px 0 6px;
}
.card p { color: var(--dim); font-size: 12px; margin: 0; }

.grid6 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 11px;
}
.cell { border: 1px solid var(--line); padding: 15px; }
.cell h3 {
  font-family: var(--disp);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 5px;
  color: var(--fg);
}
.cell p { color: var(--dim); font-size: 12px; margin: 0; }

.step {
  display: flex;
  gap: 16px;
  align-items: baseline;
  border: 1px solid var(--line);
  padding: 13px 16px;
  margin-bottom: 8px;
  color: var(--body);
  font-size: 13px;
}
.step em {
  font-family: var(--mono);
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--faint);
  flex: 0 0 auto;
}
.step b { color: var(--fg); font-weight: 500; }

.aside { padding: 46px 30px 0; }
.aside p { color: var(--body); margin: 0 0 12px; max-width: 62ch; font-size: 13px; }

/* ---------- keyboard nav ---------- */
.keys { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.keycap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
}
.keycap .k {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--fg);
  padding: 1px 6px;
}
.keycap:hover { color: var(--fg); }
.keycap:hover .k { border-color: var(--fg); }

.back {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 8px;
}
.back:hover { color: var(--fg); }

/* ---------- case-study prose ---------- */
h1 {
  font-family: var(--disp);
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.035em;
  margin: 24px 0 6px;
}

p { color: var(--body); margin: 0 0 15px; max-width: 62ch; }
p strong { color: var(--fg); font-weight: 500; }

ul { color: var(--body); margin: 0 0 15px; padding-left: 20px; max-width: 62ch; }
li { margin-bottom: 6px; }

.prose h2 {
  font-family: var(--disp);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--fg);
  margin: 42px 0 12px;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 1px 5px;
}

/* No accent colour, so the pull quote leans on a heavier rule and full-strength
   text instead of a coloured bar. */
.pull {
  border-left: 3px solid var(--fg);
  padding: 2px 0 2px 16px;
  margin: 0 0 18px;
  color: var(--fg);
  font-size: 15px;
  max-width: 62ch;
}

table { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 13px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); color: var(--body); }
th {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}
td:first-child { color: var(--fg); }

.award {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 0;
}
.role {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 6px 0 26px;
}
.wrap.sub .award { margin-bottom: 4px; }

.stack { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.stack span {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--dim);
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 2px 7px;
}

/* ---------- media ---------- */
.shots {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 -24px 14px;
  padding: 2px 24px 12px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.shots img {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--panel);
  scroll-snap-align: start;
}
.shots.phones img { height: 190px; }
.shots.wide img   { height: 190px; }

figure { margin: 0 0 14px; }
figure img, figure video {
  width: 100%;
  display: block;
  border: 1px solid var(--line);
  background: var(--panel);
}
figcaption {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  margin-top: 8px;
}

/* ---------- footer ---------- */
footer {
  margin: 46px 30px 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--body);
  font-size: 13px;
}
.wrap.sub footer { margin: 40px 0 0; }
footer a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- responsive ---------- */
@media (max-width: 880px) {
  .grid6 { grid-template-columns: repeat(2, 1fr); }
  .sechead { flex-direction: column; align-items: flex-start; gap: 6px; }
  .sechead p { text-align: left; }
}

@media (max-width: 620px) {
  .cards, .grid6 { grid-template-columns: 1fr; }
  .nav { padding: 13px 20px; }
  .nav .links { display: none; }
  .hero { margin: 20px 20px 0; padding: 40px 20px; }
  .band, .aside { padding: 34px 20px 0; }
  footer { margin: 34px 20px 0; }
  .wrap.sub { padding: 22px 20px 72px; }
  .shots { margin: 0 -20px 14px; padding: 2px 20px 12px; }
  .shots.phones img, .shots.wide img { height: 160px; }
}

/* The four-phone strip is 449px wide with the card's padding, and a 1fr track
   inherits that as its floor — under ~470px it pushed the whole page sideways
   instead of the card getting narrower. Clamp the track, then size the phones
   off the card rather than off a fixed height so they stay in proportion all
   the way down. */
@media (max-width: 480px) {
  .cards { grid-template-columns: minmax(0, 1fr); }
  .card, .card .shot { min-width: 0; }
  /* The frame hugs the phones here — a fixed height would clip them at the top
     of this range, where they are still nearly full size. */
  .card .shot.phones { height: auto; }
  .card .shot.phones img { width: calc((100% - 15px) / 4); height: auto; }
}
