/* ============================================
   Case study reading surface
   ----------------------------------------------------------------
   Deliberately self-contained. The game's styles.css sets
   `html, body { overflow: hidden }` and a canvas-first layout;
   fighting that from here would be worse than restating the tokens
   these pages actually need.

   TYPE. Literata for prose, Inter for micro-labels only.
   Newsreader was the first choice and was WRONG: it is Tier 2 on
   AI_SLOP_PREVENTION's banned list, which exists precisely because
   it is what gets reached for after being told not to use Inter.
   Literata is built for long-form screen reading, is variable with
   optical sizing, and its sturdier strokes hold up light-on-dark
   where Newsreader's higher contrast thins out.
   Inter is Tier 1 banned as a BODY face. It survives here only on
   micro-labels — dt, meta tags, eyebrows — where no running text
   sits. Any sentence belongs in Literata. Watch that boundary.
   ============================================ */

:root {
  /* Inherited from the island so the two surfaces read as one place */
  --bg: #1a1a2e;
  --text: #e8e8e0;
  --dim: #8888a0;
  --accent: #7dd956;

  --bg-raised: #21213a;
  --rule: rgba(232, 232, 224, 0.18);

  --font-read: 'Literata', Georgia, 'Times New Roman', serif;
  --font-ui: 'Inter', -apple-system, system-ui, sans-serif;

  /* 1.25 scale off an 18px base. Flat hierarchy is a named AI tell;
     every step is at least a quarter larger than the last. */
  --t-xs: 0.78rem;
  --t-sm: 0.9rem;
  --t-base: 1.125rem;
  --t-lead: 1.4rem;
  --t-h3: 1.75rem;
  --t-h2: clamp(1.9rem, 1.2rem + 2vw, 2.2rem);
  /* Capped at 3.25rem, not 4rem. This is a case study, not a landing
     hero: inside a 65ch measure, 64px broke the headline into four
     ragged lines. */
  --t-h1: clamp(2.2rem, 1.4rem + 3vw, 3.25rem);

  /* Spacing scale. A page whose copy sells pulling 30 scattered colour
     values into one shared set should not itself run on magic numbers. */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 2.5rem;
  --s-8: 3.5rem;

  --measure: 65ch;
  --gutter: clamp(1.25rem, 5vw, 2rem);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-read);
  font-size: var(--t-base);
  /* 1.65 leading, loosened a touch because light-on-dark reads tighter */
  line-height: 1.65;
  font-weight: 400;
  font-optical-sizing: auto;
  /* No text-rendering override. optimizeLegibility causes 30-second delays on
     long mobile text; optimizeSpeed is the opposite extreme and disables
     kerning and ligatures, which is the letter-fitting this serif was chosen
     for. The default gives kerning without the mobile penalty. No
     -webkit-font-smoothing either: it thins strokes, and a serif on a dark
     ground does not need thinning. */
}

/* ── Chrome ─────────────────────────────────────────────── */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 20;
  padding: var(--s-3) var(--s-4);
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-ui);
  font-size: var(--t-sm);
  border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-3) var(--gutter);
  font-family: var(--font-ui);
  font-size: var(--t-sm);
  background: rgba(26, 26, 46, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
}
/* Opaque fallback where blur is unsupported or the visitor asked for
   less transparency. Never animated — backdrop-filter recomposites
   every frame. */
@supports not (backdrop-filter: blur(1px)) {
  .topbar { background: var(--bg); }
}
@media (prefers-reduced-transparency: reduce) {
  .topbar { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

.back,
.topbar-home {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 44px;              /* touch target */
  padding: 0 var(--s-1);
  color: var(--dim);
  text-decoration: none;
  transition: color 160ms cubic-bezier(0.23, 1, 0.32, 1);
}
.back:hover, .back:focus-visible,
.topbar-home:hover, .topbar-home:focus-visible { color: var(--text); }
.back svg { flex: none; }

/* A name, not an initialism. A recruiter arriving cold from a LinkedIn
   link has never seen the island and "VH" tells them nothing. */
.topbar-home { font-weight: 500; letter-spacing: 0.01em; }

/* ── Layout ─────────────────────────────────────────────── */

.wrap { max-width: var(--measure); margin-inline: auto; padding-inline: var(--gutter); }

/* NOTE: there is deliberately no ".wide" escape hatch. A child of .wrap
   cannot exceed .wrap's 65ch measure, because its own percentage widths
   resolve against that capped parent. A wide artifact has to be a SIBLING
   of .wrap, outside it, not a class applied inside it. */

/* ── Hero: the whole story in miniature, for the 30-second reader ── */

/* padding-BLOCK, not the padding shorthand: the shorthand would reset the
   inline padding .wrap sets, and the hero would sit a gutter to the left of
   every paragraph under it. */
.hero { padding-block: clamp(3rem, 10vw, 6rem) var(--s-7); }

.eyebrow {
  font-family: var(--font-ui);
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: 0.1em;         /* loosened, as all-caps must be */
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s-5);
}

h1 {
  font-size: var(--t-h1);
  line-height: 1.08;
  letter-spacing: -0.025em;      /* tighten as it grows */
  font-weight: 500;              /* one step down: light-on-dark reads heavier */
  text-wrap: balance;
  margin-bottom: var(--s-5);
}

.standfirst {
  font-size: var(--t-lead);
  line-height: 1.45;
  color: var(--text);
  opacity: 0.88;
  text-wrap: pretty;
  margin-bottom: var(--s-7);
}

/* The scanner's answer: role, scope, shipped — before any narrative */
.facts {
  display: grid;
  /* 14rem forces TWO columns inside the 65ch measure, so four facts land as
     a clean 2x2. At 11rem it made three columns and stranded the fourth. */
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: var(--s-5) var(--s-6);
  padding-block: var(--s-6);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
/* One column on a phone. Two columns of ~150px strand the third fact on
   its own row AND squeeze each value into four ragged words. */
@media (max-width: 34rem) {
  .facts { grid-template-columns: 1fr; gap: var(--s-4); }
}
.facts dt {
  font-family: var(--font-ui);
  font-size: var(--t-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: var(--s-1);
}
/* Literata, not Inter: these are sentences. Inter's licence here is
   micro-labels only. And at body size, not 14px — this is the block a
   30-second reader actually reads. */
.facts dd { font-size: var(--t-base); line-height: 1.45; }

/* ── Prose ──────────────────────────────────────────────── */

section { padding-block: clamp(2.5rem, 7vw, 4rem); }

/* The hero already pays for space below the facts rule. Without this, its
   bottom padding and the first section's top padding stack into a gap that
   reads as a missing element rather than as breathing room. */
.hero + section { padding-top: clamp(1.5rem, 4vw, 2.25rem); }

h2 {
  font-size: var(--t-h2);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 500;
  text-wrap: balance;
  margin-bottom: var(--s-5);
}

/* Uppercase Inter at 14px on a serif page is already unmistakably a
   different register. It does not ALSO need the accent — the accent's job
   is actions, and it cannot mark them if it is spent on labels. */
h3 {
  font-family: var(--font-ui);
  font-size: var(--t-sm);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  opacity: 0.72;
  margin: var(--s-7) 0 var(--s-3);
}

/* 1.85rem ≈ 33px, which must EXCEED the 29.7px leading inside a paragraph.
   At the old 1.4rem the gap between paragraphs was smaller than the gap
   between lines, and a thousand words read as one undifferentiated block. */
p { text-wrap: pretty; margin-bottom: 1.85rem; }
p:last-child { margin-bottom: 0; }

em { font-style: italic; }
/* 500, not 600. Light-on-dark irradiation makes bold bloom out of the
   paragraph instead of sitting inside it. */
strong { font-weight: 500; }

/* A held line. Once per piece, never more, and it must carry something the
   reader has not already been given. No side stripe: AI_SLOP_PREVENTION
   Ban 1 is borders wider than 1px, and the size, italic and space already
   do the work. */
.pull {
  font-size: var(--t-h3);
  line-height: 1.3;
  letter-spacing: -0.015em;
  font-weight: 400;
  font-style: italic;
  color: var(--text);
  margin-block: var(--s-8);
  text-wrap: pretty;
}
/* On a phone --t-h3 equals the h2 floor, so the held line reads as another
   heading rather than as a quote. */
@media (max-width: 34rem) {
  .pull { font-size: var(--t-lead); }
}

/* ── Artifact placeholders ──────────────────────────────── */
/* Honest and designed, rather than a broken image. Keep these RARE —
   five identical dashed boxes down one page stop reading as intent and
   start reading as a page that is not finished. */

.artifact {
  margin-block: var(--s-7);
  border: 1px dashed var(--rule);
  border-radius: 10px;
  background: var(--bg-raised);
  min-height: clamp(11rem, 28vw, 18rem);
  display: grid;
  place-content: center;
  gap: var(--s-2);
  text-align: center;
  padding: var(--s-6);
  font-family: var(--font-ui);
}
/* Padding blocks margin collapse, so a section ending in an artifact was
   getting 6.5rem of trailing space where a section ending in a paragraph
   got 4rem. Same page, two rhythms. */
section > .artifact:last-child { margin-block-end: 0; }

.artifact-label {
  font-size: var(--t-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  opacity: 0.7;
}
.artifact-desc {
  font-size: var(--t-sm);
  color: var(--text);
  opacity: 0.62;
  max-width: 32ch;
  margin-inline: auto;
}

/* ── Coming soon ────────────────────────────────────────── */

.soon {
  min-height: 68vh;
  display: grid;
  align-content: center;
  padding-block: clamp(3rem, 10vw, 6rem) var(--s-7);
}
.soon-note {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  /* justify-self, not align-self: .soon is a grid, so the inline axis is
     what stops the pill stretching the full column width. */
  justify-self: start;
  font-family: var(--font-ui);
  font-size: var(--t-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--accent);
  padding: var(--s-1) var(--s-3);
  border-radius: 999px;
  margin-bottom: var(--s-6);
}
.soon-covers {
  margin-top: var(--s-7);
  padding-top: var(--s-6);
  border-top: 1px solid var(--rule);
}
.soon-covers h2 { font-size: var(--t-h3); margin-bottom: var(--s-4); }
.soon-covers ul { list-style: none; }
.soon-covers li {
  padding-left: var(--s-5);
  position: relative;
  margin-bottom: var(--s-3);
  color: var(--text);
  opacity: 0.85;
}
.soon-covers li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.55;
}
/* Same double-padding stack the hero had: .soon's bottom padding plus
   .next's top padding left ~160px of nothing with a hairline floating
   in it. */
.soon + .next { padding-top: var(--s-6); }

/* ── Footer / next ──────────────────────────────────────── */

.next {
  border-top: 1px solid var(--rule);
  padding-block: clamp(2.5rem, 7vw, 4rem) clamp(3rem, 9vw, 5rem);
}
.next-label {
  font-family: var(--font-ui);
  font-size: var(--t-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: var(--s-5);
}
.next-list { list-style: none; display: grid; gap: var(--s-2); }
.next-list a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
  min-height: 44px;
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--rule);
  /* The accent marks ACTIONS. It is the only thing on the page it marks. */
  color: var(--accent);
  text-decoration: none;
  font-size: var(--t-lead);
  letter-spacing: -0.01em;
  transition: color 160ms cubic-bezier(0.23, 1, 0.32, 1);
}
.next-list a:hover, .next-list a:focus-visible { color: var(--text); }
.next-list .meta {
  font-family: var(--font-ui);
  font-size: var(--t-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
  flex: none;
}

.contact {
  margin-top: var(--s-7);
  font-size: var(--t-base);
  color: var(--text);
  opacity: 0.85;
}
/* inline-block + padding so the tap target clears 44px. Inline links at
   0.9rem were ~22px tall, and on the placeholder pages "Email me" is the
   single most important action on the page. */
.contact a {
  display: inline-block;
  padding-block: var(--s-2);
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.contact a:hover, .contact a:focus-visible { color: var(--text); }

/* ── Focus ──────────────────────────────────────────────── */
/* No border-radius here: it would apply to the ELEMENT, not the outline,
   deforming any rounded control the instant it received focus. Browsers
   already follow the element's own radius when drawing an outline. */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
