@import url("./tokens.css");

* { box-sizing: border-box; }
::selection { background: var(--accent); color: var(--accent-ink); }
html { -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: var(--t-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* A 32px graph rule, only just visible. This is what stops a large cream
   area reading as blank paper. */
body {
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: var(--gs) var(--gs);
  background-position: -1px -1px;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* The graph rule carries on through the ink sections as a faint slate blue,
   fading out partway down so the dark ground still reads as dark. Behind
   the content: the layer is a pseudo-element, the containers sit above. */
.section--dark { position: relative; }
.section--dark::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--grid-dark) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-dark) 1px, transparent 1px);
  background-size: var(--gs) var(--gs);
  background-position: -1px -1px;
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 82%);
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}
.section--dark > .container { position: relative; }

.serif { font-family: "Instrument Serif", "Times New Roman", serif; font-weight: 400; }
.mono  { font-family: "JetBrains Mono", ui-monospace, monospace; }

.container {
  max-width: var(--max); margin: 0 auto;
  padding-left:  calc(var(--gutter) + env(safe-area-inset-left, 0px));
  padding-right: calc(var(--gutter) + env(safe-area-inset-right, 0px));
}
.measure   { max-width: var(--measure); }
.dim       { color: var(--ink-dim); }

h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: var(--lh-heading); text-wrap: balance; }
h1 { font-size: var(--t-h1); }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); }
p  { margin: 0; }

.lead { font-size: var(--t-lead); line-height: var(--lh-lead); color: var(--ink-dim); max-width: var(--measure); text-wrap: pretty; }
/* Orphan control on every description-length block; balance on the one-line
   questions so a two-line wrap splits evenly. */
.block-head p, .card p, .work-card__body p, .engagement p, .person p,
.svc__main p, .tile__label, .faq__item p, .case__body p { text-wrap: pretty; }
.faq__item summary { text-wrap: balance; }
.eyebrow {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: var(--t-micro);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

/* Buttons — colour and border only on hover, never scale */
.btn, .btn-ghost {
  display: inline-flex; align-items: center; gap: var(--s-2);
  min-height: 48px; padding: 0 var(--s-6);
  font-size: var(--t-body); font-weight: 500;
  text-decoration: none; cursor: pointer;
  transition: background var(--d-hover) var(--ease-out),
              color var(--d-hover) var(--ease-out),
              border-color var(--d-hover) var(--ease-out),
              transform var(--d-hover) var(--ease-out);
}
.btn { background: var(--accent); color: var(--accent-ink); border: 1.5px solid var(--accent); }
.btn:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line-3); }
.btn-ghost:hover { border-color: var(--ink); }
/* Press: 70ms down (heard you), 120ms back (responding). Never a scale. */
.btn:active, .btn-ghost:active { transform: translateY(1px); transition-duration: 70ms; }
.btn:active { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn-ghost:active { border-color: var(--ink); background: var(--surface); }
.btn:focus-visible, .btn-ghost:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.section--dark .btn:focus-visible,
.section--dark .btn-ghost:focus-visible { outline-color: var(--accent-soft); }

/* Nav */
.site-nav {
  position: sticky; top: 0; z-index: 80;
  border-bottom: 1px solid var(--line);
  background: rgba(239,234,224,0.88);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
/* Reading progress: a rust hairline riding the nav's bottom edge. The JS
   sets --scroll-p on the root element; with scripts blocked it stays at 0 and the
   line simply never appears. */
.site-nav::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--accent);
  transform: scaleX(var(--scroll-p, 0)); transform-origin: left center;
}
.site-nav__links a:not(.btn)[data-active] {
  color: var(--accent-deep);
  text-decoration-color: currentColor;
}
/* padding-block, NOT the `padding` shorthand — this element also carries
   .container, and a shorthand here resets its horizontal gutter to 0,
   knocking the whole header 32px out of line with every content block. */
.site-nav__inner { display: flex; align-items: center; justify-content: space-between;
                   padding-top: var(--s-5); padding-bottom: var(--s-5); }
.site-nav__links { display: flex; align-items: center; gap: var(--s-7); }
/* :not(.btn) matters — a bare `.site-nav__links a` rule outranks `.btn`
   (0,1,1 vs 0,1,0) and would repaint the CTA's label. Its hover colour is
   --accent-deep, which is also .btn:hover's background, so the button's
   text would disappear into its own fill. */
.site-nav__links a:not(.btn) {
  color: var(--ink); font-size: var(--t-body);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 6px;
  text-decoration-thickness: 1.5px;
  transition: color var(--d-hover) var(--ease-out),
              text-decoration-color 200ms var(--ease-out);
}
.site-nav__links a:not(.btn):hover { color: var(--accent-deep); }
.wordmark { font-size: var(--t-lead); font-weight: 600; letter-spacing: -0.01em; text-decoration: none; color: var(--ink); }
.wordmark span { color: var(--accent-deep); }
.wordmark { display: inline-flex; align-items: center; gap: 0; }
.logo-mark { display: block; flex-shrink: 0; margin-inline-end: var(--s-3); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: var(--s-8) 0 var(--s-5); background: var(--bg-2); }
.site-footer__grid { display: flex; gap: var(--s-7) var(--s-10); flex-wrap: wrap; }
.site-footer__grid > .site-footer__col:first-child { flex: 0 1 300px; max-width: 40ch; margin-right: auto; }
.site-footer__col { display: flex; flex-direction: column; gap: var(--s-2); }
.site-footer__col > .eyebrow { margin-block-end: var(--s-2); }
.site-footer__col a { color: var(--ink); text-decoration: none; font-size: var(--t-body); }
.site-footer__col a:hover { color: var(--accent-deep); }
.site-footer__legal { margin-top: var(--s-7); padding-top: var(--s-4); border-top: 1px solid var(--line); }

section { padding: var(--s-12) 0; border-bottom: 1px solid var(--line); }

/* ============================================================
   Task 4 — Hero, direction A
   ============================================================ */
.hero {
  /* One clean screen: fills the viewport minus the nav, centres its grid,
     and the next section starts exactly at the fold instead of one peeking
     line above it. Falls back to padding-only on very short viewports. */
  min-height: calc(100svh - 89px);
  display: flex;
  align-items: center;
  padding: var(--s-9) 0;
  border-bottom: 1px solid var(--line);
}
.hero > .container { width: 100%; }
.hero__kicker { display: block; margin-bottom: var(--s-5); }
.hero__title {
  font-size: var(--t-display);
  line-height: var(--lh-display);
  letter-spacing: -0.03em;
  font-weight: 600;
  max-width: 13ch;
}
.hero__title em { font-family: "Instrument Serif", serif; font-style: italic; font-weight: 400; color: var(--accent); }
.hero .lead { margin-top: var(--s-8); }
.hero__actions { display: flex; gap: var(--s-3); margin-top: var(--s-9); flex-wrap: wrap; }

/* ============================================================
   Task 5 — Problem and before/after blocks
   ============================================================ */
.block-head { margin-bottom: var(--s-9); }
.block-head h2 { font-size: var(--t-h2); max-width: 20ch; }
.block-head .eyebrow { display: block; margin-bottom: var(--s-4); }
.block-head p { margin-top: var(--s-5); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-6); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-6); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: var(--s-7);
  transition: border-color var(--d-hover) var(--ease-out), background var(--d-hover) var(--ease-out);
}
@media (hover: hover) {
  .card:hover { border-color: var(--line-3); background: var(--surface-2); }
}
.card h3 { font-size: var(--t-lead); letter-spacing: -0.01em; }
.card p { margin-top: var(--s-3); color: var(--ink-dim); }

/* ============================================================
   Task 6 — Proof strip and the placeholder guard
   ============================================================ */
[data-placeholder] {
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-bottom: 2px dashed var(--accent);
  padding: 0 0.2em;
}

.proof { background: var(--bg-2); }
.proof__figure { font-size: var(--t-h2); line-height: 1; font-weight: 600; letter-spacing: -0.02em; overflow-wrap: break-word; }
.proof__label { margin-top: var(--s-4); }
.proof__client { margin-top: var(--s-2); }

/* ============================================================
   Task D2 — The proof mosaic.
   Six tiles, six grounds, asymmetric spans (4/2, 2/4, 3/3 — each
   row sums to the full 6-column grid, so auto-placement never
   wraps mid-row). Three tiles carry the real (still-placeholder)
   client figures; three carry facts already stated elsewhere on
   the page (studio shape, company registration, engagement model)
   rather than invented numbers.

   Tile text is fully opaque --accent-ink, not the dark section's
   translucent 72%/60% cream — that translucency fails AA on four
   of the six tile grounds (see tests/contrast.test.ts). Sitting
   inside #proof (a --section--dark ground), the tiles read as
   colour against black, not against cream.
   ============================================================ */
.mosaic {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--s-4);
}
.tile {
  padding: var(--s-7);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 200px;
  color: var(--accent-ink);
}
.tile--wide { grid-column: span 4; min-height: 240px; }
.tile--half { grid-column: span 3; }
.tile--third { grid-column: span 2; }

.tile__figure { font-size: var(--t-h2); line-height: 1; font-weight: 600; letter-spacing: -0.02em; overflow-wrap: break-word; }
.tile__label { margin-top: var(--s-3); }
.tile__client { margin-top: var(--s-5); }

/* Opaque, unlike .section--dark .eyebrow's translucent cream — see the
   comment above and tests/contrast.test.ts for why translucency is unsafe
   here specifically. Three classes deep so this outranks .section--dark
   .eyebrow (two classes) regardless of source order — #proof is itself a
   .section--dark, so without the extra specificity the later, more general
   rule would quietly win the cascade and put 60%-translucent cream back on
   four of the six tiles. */
.mosaic .tile .eyebrow { color: var(--accent-ink); }

.tile--rust  { background: var(--tile-rust); }
.tile--moss  { background: var(--tile-moss); }
.tile--slate { background: var(--tile-slate); }
.tile--plum  { background: var(--tile-plum); }
.tile--clay  { background: var(--tile-clay); }
.tile--olive { background: var(--tile-olive); }

@media (max-width: 900px) {
  .mosaic { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile--wide, .tile--half, .tile--third { grid-column: span 1; }
}
@media (max-width: 560px) {
  .mosaic { grid-template-columns: 1fr; }
}

/* ============================================================
   Task 7 — Work cards and engagements
   ============================================================ */
.section-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s-6); margin-bottom: var(--s-9); }
/* The row owns the spacing here, so the head inside it must not add its own.
   A scoped rule rather than an inline style — inline styles do not survive
   the CSS-Modules extraction in Task 11. */
.section-head-row .block-head { margin-bottom: 0; }

.work-card { display: block; text-decoration: none; color: var(--ink); border: 1px solid var(--line); background: var(--surface);
             transition: border-color var(--d-hover) var(--ease-out); }
.work-card:hover { border-color: var(--accent); }
.work-card:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.work-card:hover .work-card__more { color: var(--accent-deep); }
.work-card__media { aspect-ratio: 4 / 3; background: var(--bg-2); border-bottom: 1px solid var(--line);
                    display: flex; align-items: center; justify-content: center; }
.work-card__body { padding: var(--s-6); }
.work-card__body h3 { font-size: var(--t-lead); margin-top: var(--s-3); }
.work-card__body h3 + p { margin-top: var(--s-3); }
.work-card__more { margin-top: var(--s-5); transition: color var(--d-hover) var(--ease-out); }

.engagement { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); padding: var(--s-7); }
.engagement--lead { border: 2px solid var(--ink); background: var(--surface-2); }
.engagement h3 { font-size: var(--t-h3); }
.engagement p { margin-top: var(--s-4); color: var(--ink-dim); }
.engagement__price { margin-top: auto; padding-top: var(--s-6); border-top: 1px solid var(--line); display: flex; align-items: baseline; gap: var(--s-3); flex-wrap: wrap; row-gap: var(--s-2); }
.engagement__price .eyebrow { white-space: nowrap; }
.engagement__price strong { font-size: var(--t-lead); font-weight: 600; white-space: nowrap; }

/* ============================================================
   Task 8 — The process rail
   ============================================================ */
.rail { background: var(--bg-2); }
/* tabindex="0" in the markup makes this scroll region reachable by keyboard.
   Without it the later cards are mouse-only: the track is 1680px wide inside a
   1136px container, and nothing within it is focusable. */
.rail__track:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.rail__track {
  display: flex; gap: var(--s-5);
  overflow-x: auto; padding-bottom: var(--s-4);
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.rail__track::-webkit-scrollbar { display: none; }
.rail__item { min-width: 320px; scroll-snap-align: start; background: var(--surface); }
.rail__item .eyebrow { display: block; margin-bottom: var(--s-3); }

/* Vertical timeline on phones — no sideways scroll on a small screen */
@media (max-width: 720px) {
  .rail__track {
    flex-direction: column; overflow-x: visible; gap: 0;
    scroll-snap-type: none;
    border-left: 1px solid var(--line-2); padding-left: var(--s-5);
  }
  .rail__item { min-width: 0; background: transparent; border: 0; padding: 0 0 var(--s-7) 0; }
}

/* ============================================================
   Task 9 — Studio, FAQ and the booking form
   ============================================================ */
.person { display: flex; gap: var(--s-6); border: 1px solid var(--line); background: var(--surface); padding: var(--s-6); }
.person__photo { width: 160px; height: 200px; flex-shrink: 0; background: var(--bg-2); border: 1px solid var(--line);
                 display: flex; align-items: center; justify-content: center; text-align: center; }
.person h3 { font-size: var(--t-lead); }
.person h3 + .eyebrow { display: block; margin-top: var(--s-2); }
.person p { margin-top: var(--s-3); color: var(--ink-dim); }
.person a {
  display: inline-block; margin-top: var(--s-5); color: var(--accent-deep);
  text-decoration: underline; text-decoration-color: transparent;
  text-underline-offset: 4px;
  transition: text-decoration-color var(--d-hover) var(--ease-out);
}
.person a:hover { text-decoration-color: currentColor; }

.faq { max-width: 900px; border-top: 1px solid var(--line); }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__item summary { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-5);
                     padding: var(--s-6) 0; cursor: pointer; list-style: none;
                     font-size: var(--t-lead); font-weight: 600; letter-spacing: -0.01em;
                     transition: color var(--d-hover) var(--ease-out); }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: "+";
  font-family: "JetBrains Mono", monospace;
  color: var(--ink-dim);
  display: inline-block;
  transition: transform 240ms var(--ease-out), color var(--d-hover) var(--ease-out);
}
/* The + repeats so the glyph holds while the rotation turns it into a close mark. */
.faq__item[open] summary::after { content: "+"; transform: rotate(45deg); }
@supports (interpolate-size: allow-keywords) {
  :root { interpolate-size: allow-keywords; }
  .faq__item[open] p { animation: none; }   /* the box carries the motion now */
  .faq__item::details-content {
    block-size: 0;
    overflow: hidden;
    opacity: 0;
    transition:
      block-size 260ms var(--ease-out),
      opacity 180ms var(--ease-out),
      content-visibility 260ms allow-discrete;
  }
  .faq__item[open]::details-content { block-size: auto; opacity: 1; }
}
.faq__item summary:hover { color: var(--accent-deep); }
.faq__item p { padding: 0 0 var(--s-6); color: var(--ink-dim); max-width: var(--measure); }

.book { background: var(--ink); color: var(--surface-2); border-bottom: 0; }
.book h2 { color: var(--surface-2); max-width: 18ch; }
.book .lead { color: rgba(251,247,238,0.72); }
.book .eyebrow { color: rgba(251,247,238,0.60); }
.book__form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); max-width: 720px; margin-top: var(--s-9); }
.field { display: flex; flex-direction: column; gap: var(--s-2); }
.field--wide { grid-column: span 2; }
.field label { font-family: "JetBrains Mono", monospace; font-size: var(--t-micro); letter-spacing: 0.1em;
               text-transform: uppercase; color: rgba(251,247,238,0.60); }
.field input, .field textarea {
  background: transparent; border: 1px solid rgba(251,247,238,0.45);
  color: var(--surface-2); font-family: inherit; font-size: var(--t-body);
  min-height: 48px; padding: var(--s-3) var(--s-4);
  transition: border-color var(--d-hover) var(--ease-out);
}
.field textarea { min-height: 120px; resize: vertical; }
/* A border-colour swap alone is a weak focus indicator. Match the outline
   treatment used on .btn, .work-card and .rail__track. */
.field input:focus-visible, .field textarea:focus-visible {
  outline: 2px solid var(--accent-soft); outline-offset: 2px; border-color: var(--accent);
}
.book__submit { margin-top: var(--s-6); }
.book__note { margin-top: var(--s-6); }

/* ============================================================
   Task 10 — Responsive pass and reveal motion
   ============================================================ */

/* Reveal — 16px rise + fade, once, never re-triggering.
   The <noscript> block in index.html reverses the hidden default: without JS
   the only path from opacity:0 to opacity:1 is the observer, which would leave
   most of the page permanently invisible. */
.reveal { opacity: 0; transform: translateY(16px);
          transition: opacity var(--d-reveal) var(--ease-out), transform var(--d-reveal) var(--ease-out); }
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  /* The blanket !important below is a deliberate sitewide policy — every
     transition and animation, not just .reveal, must collapse under reduced
     motion. But !important beats specificity outright, so without a matching
     !important here the universal rule wins over this one (0,1,0 loses to
     0,0,0 only when both sides are !important does specificity get to
     arbitrate again), leaving .reveal's computed transition-duration at
     0.01ms instead of 0s — invisible to the eye, but not what "disabled"
     means to a test or a screen-reader user who has this setting on for a
     reason. */
  .reveal { opacity: 1; transform: none; transition-duration: 0s !important; }
  *, *::before, *::after, ::backdrop { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

@media (max-width: 960px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  /* The desktop nav is 321px of links plus a wordmark, which does not fit a
     390px viewport and overflows the document by 49px. Drop the text links and
     keep the wordmark and the CTA — the conversion path survives, and the three
     links are all reachable from the footer. A hamburger drawer needs focus
     trapping and escape handling, so it belongs in the Next build, not here. */
  .site-nav__links a:not(.btn) { display: none; }
  .site-nav__links { gap: 0; }

  section { padding: var(--s-11) 0; }
  .hero { padding: var(--s-11) 0 var(--s-10); }
  .hero__title { max-width: none; }
  .hero__facts { gap: var(--s-4); flex-direction: column; }
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn, .hero__actions .btn-ghost { justify-content: center; }

  .grid-2, .grid-3, .book__form { grid-template-columns: 1fr; }
  .field--wide { grid-column: auto; }

  .section-head-row { flex-direction: column; align-items: flex-start; }
  .person { flex-direction: column; }
  .person__photo { width: 100%; height: 220px; }

}

/* ============================================================
   Task D1 — Section rhythm and the restored heading accent.
   No two adjacent sections share a ground; the two dark blocks
   (proof, book) bracket the page.
   ============================================================ */
.section--tint { background: var(--bg-2); }
.section--dark { background: var(--ink); color: var(--surface-2); }
.section--dark h2 { color: var(--surface-2); }
.section--dark .dim,
.section--dark .body { color: rgba(251,247,238,0.72); }
.section--dark .eyebrow { color: rgba(251,247,238,0.60); }
.section--dark .card { background: rgba(251,247,238,0.05); border-color: rgba(251,247,238,0.14); }

.accent-word {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}
.section--dark .accent-word { color: var(--accent-soft); }


/* ============================================================
   Flow diagrams — the work-card media slots. Three mono nodes
   wired left to right; the hot node is the moment the system
   pays for itself. Stands in for screenshots without pretending
   to be one.
   ============================================================ */
.work-card__media { position: relative; overflow: hidden; background: var(--surface-2); }
.flow { position: relative; display: flex; align-items: center; gap: var(--s-2); padding: 0 var(--s-4); }
.flow__node {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: var(--t-micro);
  letter-spacing: 0.06em;
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--line-3);
  background: var(--surface);
  color: var(--ink-dim);
  white-space: nowrap;
}
.flow__node + .flow__node { margin-inline-start: var(--s-6); position: relative; }
.flow__node + .flow__node::before {
  content: "";
  position: absolute; top: 50%; inset-inline-end: 100%;
  width: var(--s-6); height: 1.5px; margin-inline-end: 1px;
  background: var(--line-3);
}
.flow__node--hot {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
  transition: background var(--d-hover) var(--ease-out),
              border-color var(--d-hover) var(--ease-out);
}
.work-card:hover .flow__node--hot { background: var(--accent-deep); border-color: var(--accent-deep); }

/* FAQ answers ease open instead of snapping. */
.faq__item[open] p { animation: faq-in 240ms var(--ease-out); }
@keyframes faq-in { from { opacity: 0; transform: translateY(-4px); } }

/* Footer's flatline-to-beat rule. */
.ecg--footer { margin-bottom: var(--s-6); }

/* ============================================================
   Print — the page as a one-sheet. Chrome, canvas and theatre
   go; the words and the numbers stay.
   ============================================================ */
@media print {
  body { background: #fff; }
  .site-nav, .hero__heart, .intro, .ecg, .hero__actions,
  .work-card__media, .rail__readout, .book__form { display: none !important; }
  section { padding: var(--s-8) 0; border-bottom: 1px solid #ccc; }
  .reveal, [data-motion] * { opacity: 1 !important; transform: none !important; filter: none !important; }
  a { color: inherit; text-decoration: none; }
  .section--dark, .book { background: #fff; color: #000; }
  .section--dark h2, .book h2 { color: #000; }
}


/* ============================================================
   Last-mile craft
   ============================================================ */

/* Skip link — invisible until it's the thing you asked for. */
.skip-link {
  position: absolute; top: var(--s-3); left: calc(var(--s-3) + env(safe-area-inset-left, 0px)); z-index: 100;
  padding: var(--s-3) var(--s-5);
  background: var(--ink); color: var(--surface-2);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: var(--t-micro); letter-spacing: 0.1em; text-transform: uppercase;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus-visible { transform: none; outline: 2px solid var(--accent); outline-offset: 3px; }

/* The four problem cards carry their own index — the page reads as a
   runbook, so its items get numbered like one. Pure CSS, no markup. */
/* ============================================================
   The fix ledger — Alex's ask: the four symptoms as one detailed
   table, not four loose cards. Index / the symptom / what we
   build for it, sharing the services ledger's grammar.
   ============================================================ */
.fix { display: flex; flex-direction: column; background: var(--surface);
       border: 1px solid var(--line-2); padding: 0 var(--s-7); }
.fix__row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: var(--s-6);
  align-items: start;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-2);
  padding: var(--s-7) 0;
}
.fix__row:last-child { border-bottom: 0; }
.fix__index { padding-top: var(--s-1); color: var(--accent-deep); }
.fix__what h3 { font-size: var(--t-lead); letter-spacing: -0.01em; }
.fix__what p { margin-top: var(--s-3); color: var(--ink-dim); max-width: 46ch; }
.fix__build {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: var(--t-micro);
  letter-spacing: 0.04em;
  line-height: 1.7;
  color: var(--accent-deep);
  padding-top: var(--s-1);
}
@media (max-width: 900px) {
  .fix__row { grid-template-columns: 1fr; gap: var(--s-4); }
  .fix__index { padding-top: 0; }
}

/* One resting beat from the logo when the wordmark is hovered — the same
   940ms period the heart itself beats at. */
@keyframes logo-beat {
  0%, 100% { transform: scale(1); }
  10% { transform: scale(0.95); }
  22% { transform: scale(1.05); }
  34% { transform: scale(0.99); }
  46% { transform: scale(1.02); }
}
.logo-mark.is-beating { animation: logo-beat 940ms var(--ease-out); }

/* The lead engagement's tag reads in brand, not in grey. */
.engagement--lead > .eyebrow { color: var(--accent-deep); display: block; margin-bottom: var(--s-3); }

.faq__item summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }


/* ============================================================
   The fix line — each symptom card ends by naming the thing we
   actually build for it. Mono, rust, unmissable.
   ============================================================ */
.card__fix {
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px dashed var(--line-2);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: var(--t-micro);
  letter-spacing: 0.04em;
  color: var(--accent-deep);
}

/* ============================================================
   Services — the old site's "five things we do exceptionally
   well", rebuilt as bordered ledger rows: index / what / you get.
   ============================================================ */
.svc { border-top: 1px solid var(--line-2); }
.svc__row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1.2fr) minmax(0, 1fr);
  gap: var(--s-6);
  align-items: start;
  padding: var(--s-7) 0;
  border-bottom: 1px solid var(--line-2);
}
.svc__index { padding-top: var(--s-1); color: var(--accent-deep); }
.svc__main h3 { font-size: var(--t-h3); letter-spacing: -0.02em; }
.svc__main p { margin-top: var(--s-3); max-width: 44ch; }
.svc__chips { list-style: none; margin: 0; padding: var(--s-1) 0 0; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.svc__chips li {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: var(--t-micro);
  letter-spacing: 0.04em;
  color: var(--ink-dim);
  border: 1px solid var(--line-2);
  background: var(--surface);
  padding: var(--s-1) var(--s-3);
  white-space: nowrap;
}
@media (max-width: 900px) {
  .svc__row { grid-template-columns: 1fr; gap: var(--s-4); }
  .svc__index { padding-top: 0; }
}

/* Rail deliverables — the old site's per-step checklist, kept mono. */
.rail__list { list-style: none; margin: var(--s-5) 0 0; padding: var(--s-4) 0 0; border-top: 1px dashed var(--line-2);
              display: flex; flex-direction: column; gap: var(--s-2); }
.rail__list li {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: var(--t-micro);
  letter-spacing: 0.04em;
  color: var(--ink-dim);
}
.rail__list li::before { content: "+ "; color: var(--accent-deep); }

/* ============================================================
   The founder note — the old site's "Hi, I'm Luke" letter,
   kept as a letter: wide, quiet, signed.
   ============================================================ */
.note {
  border: 1px solid var(--line-2);
  border-inline-start: 3px solid var(--accent);
  background: var(--surface);
  padding: var(--s-8);
  margin-top: var(--s-8);
}
.note > p:first-child { font-size: var(--t-lead); line-height: var(--lh-lead); color: var(--ink); max-width: 62ch; }
.note__sig { margin-top: var(--s-6); display: flex; align-items: baseline; gap: var(--s-4); flex-wrap: wrap; }
.note__sig .serif { font-size: var(--t-h3); font-style: italic; }


/* Real photos in the person cards. The slight desaturate pulls two very
   different lighting situations toward the same temperature. */
.person__photo img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 15%;
  display: block;
  filter: saturate(0.82) contrast(1.03);
}

/* Book promises — the three things the old site said above the fold of
   its form, kept mono and unmissable. */
.book__promises {
  list-style: none; margin: var(--s-6) 0 0; padding: 0;
  display: flex; flex-direction: column; gap: var(--s-2);
}
.book__promises li {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: var(--t-micro);
  letter-spacing: 0.06em;
  color: rgba(251,247,238,0.72);
}
.book__promises li::before { content: "+ "; color: var(--accent); }

/* Ledger rows breathe on hover like everything else on the page. */
.svc__row { transition: background var(--d-hover) var(--ease-out); }
@media (hover: hover) {
  .svc__row:hover { background: var(--surface); }
}


/* Match the page's own furniture (Firefox; WebKit keeps its overlay bars). */
html { scrollbar-color: var(--line-3) transparent; }

/* ============================================================
   Case dialogs — the work cards open their story in place.
   Native <dialog>: focus, Esc and inerting come free.
   ============================================================ */
.case {
  border: 1px solid var(--line-2);
  border-top: 3px solid var(--accent);
  background: var(--surface-2);
  color: var(--ink);
  padding: var(--s-8);
  max-width: min(560px, calc(100vw - 2 * var(--gutter)));
  width: 100%;
  max-height: calc(100dvh - 2 * var(--s-6));
  overflow-y: auto;
}
/* Hidden-then-shown only when JS is present to open them at all — the
   no-JS page must never carry an opacity-0 element (motion.js sets the
   attribute; without it dialogs stay display:none and fully opaque). */
html[data-motion-ready] .case {
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 160ms var(--ease-out),
    transform 160ms var(--ease-out),
    overlay 160ms var(--ease-out) allow-discrete,
    display 160ms var(--ease-out) allow-discrete;
}
html[data-motion-ready] .case[open] { opacity: 1; transform: none; transition-duration: 240ms; }
@starting-style {
  html[data-motion-ready] .case[open] { opacity: 0; transform: translateY(10px); }
}
html[data-motion-ready] .case::backdrop {
  background: rgba(14,16,19,0.55);
  opacity: 0;
  transition:
    opacity 160ms linear,
    overlay 160ms linear allow-discrete,
    display 160ms linear allow-discrete;
}
html[data-motion-ready] .case[open]::backdrop { opacity: 1; transition-duration: 200ms; }
@starting-style {
  html[data-motion-ready] .case[open]::backdrop { opacity: 0; }
}
.case h3 { font-size: var(--t-h3); margin-top: var(--s-3); letter-spacing: -0.02em; }
.case__body h4 { margin: var(--s-6) 0 var(--s-2); color: var(--accent-deep); }
.case__body p { color: var(--ink-dim); max-width: var(--measure); }
.case .svc__chips { margin-top: var(--s-6); padding-top: var(--s-5); border-top: 1px dashed var(--line-2); }
.case__close {
  display: flex; align-items: center;
  width: max-content;
  margin-inline-start: auto;
  margin-block-end: var(--s-4);
  appearance: none; -webkit-appearance: none;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-1);
  cursor: pointer;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: var(--t-micro); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-dim); padding-inline: var(--s-3);
  min-height: 48px;
}
.case__close:hover { color: var(--ink); }
.case__close:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }


/* Workflow maps inside the case dialogs — the main line, then the branch
   that explains what happens when the happy path doesn't. */
.map { margin-top: var(--s-6); padding: var(--s-5); border: 1px dashed var(--line-2); background: var(--surface); }
.map .flow { flex-wrap: wrap; row-gap: var(--s-3); padding: 0; }
.map__branch { margin-top: var(--s-4); color: var(--accent-deep); letter-spacing: 0.04em; text-transform: none; }


/* ============================================================
   CTA line: the ask, repeated where a decision has just been made.
   ============================================================ */
.cta-line {
  margin-top: var(--s-9);
  padding: var(--s-6) var(--s-7);
  border: 1px solid var(--line-2);
  background: var(--surface);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-6); flex-wrap: wrap;
}
.cta-line p { font-size: var(--t-lead); letter-spacing: -0.01em; }


/* ============================================================
   Case cards: the card format, with the before and after as
   labelled pairs — no strikethrough, nothing to squint at.
   ============================================================ */
.case-card { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); }
.case-card h3 { font-size: var(--t-h3); letter-spacing: -0.02em; margin-top: var(--s-4); text-wrap: balance; }
.case-card__ba { margin: var(--s-5) 0 0; display: flex; flex-direction: column; gap: var(--s-3); }
.case-card__ba > div { display: grid; grid-template-columns: 44px 1fr; gap: var(--s-3); align-items: baseline; }
.case-card__ba dt {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: var(--t-micro); letter-spacing: 0.1em; text-transform: uppercase;
}
.case-card__ba dd { margin: 0; color: var(--ink-dim); }
.case-card__was dt { color: var(--ink-faint); }
.case-card__now dt { color: var(--accent-deep); }
.case-card__now dd { color: var(--accent-deep); font-weight: 500; }
.case-card__more { margin-top: auto; padding-top: var(--s-6); color: var(--accent-deep); transition: color var(--d-hover) var(--ease-out); }
.case-card:hover .case-card__more { color: var(--accent); }

.book__cal { color: var(--accent-soft); text-decoration: underline; text-underline-offset: 3px; }
.book__cal:hover { color: var(--accent-ink); }




/* ============================================================
   The booking calendar, inline via Cal's own embed. The fallback
   is a designed panel, not an error state: it appears wherever
   third-party frames are blocked (sandboxed previews, no JS,
   content blockers) and carries the same booking link.
   ============================================================ */
/* Copy left, calendar right; stacked in one column on smaller screens. */
.book__grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: var(--s-10); align-items: start; }
.book__grid .block-head { margin-bottom: 0; }
@media (max-width: 960px) {
  .book__grid { grid-template-columns: 1fr; gap: var(--s-8); }
}
.book__embed { margin-top: 0; }
.book__slot { min-height: 560px; }
.book__slot.is-empty { display: none; }
.book__fallback {
  border: 1px solid rgba(251,247,238,0.28);
  background: rgba(251,247,238,0.05);
  padding: var(--s-8);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-6); flex-wrap: wrap;
}
.book__fallback-line { font-size: var(--t-lead); color: rgba(251,247,238,0.72); }
/* Visible by default (no JS can never reveal it); hidden once JS is
   present, re-shown only when the embed is confirmed blocked. */
html[data-motion-ready] .book__fallback { display: none; }
html[data-motion-ready] .book__fallback.is-shown { display: flex; }
html[data-motion-ready] .book__slot { min-height: 560px; }
.book__note { margin-top: var(--s-5); }

/* The page-wide cursor trail. Sits above the paper and below everything you
   can read or click, and never takes a pointer event of its own. */
.cursor-trail {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
