/* ============================================================================
   DAYTABLE — PUBLIC LANDING
   Self-contained styles for the unauthenticated landing page (Track L). No web
   fonts (system serif/sans/mono stacks only), no external assets, sub-100KB.
   Four variant namespaces: .ld1- (Table d'Hôte / paper menu card),
   .ld2- (Rhythm Board / dark hardware page), .ld3- (Enough for Today / essay),
   .ld4- (The Quiet Hours / vertical hour-ruler spine).
   Shared chrome uses .ld- . Each variant carries its OWN palette so it renders
   the same regardless of the household skin; the footer swatches choose the
   skin the guest sandbox opens in (they rewrite the /try CTAs' ?skin=).
   Reduced-motion: all entrance/ambient animation is gated on
   (prefers-reduced-motion: no-preference).
   ========================================================================== */

/* ---- shared reset-ish + chrome ---- */
/* NB: no blanket `.ld-body a { color: inherit }` — an element+class selector
   like that (specificity 0,1,1) silently beats every class-based link/button
   colour below (0,1,0), so each variant sets its own link colours explicitly. */
.ld-body { margin: 0; }
/* The hero card (V1) and tablet (V2) are themselves <a> elements; keep their
   inner content in the variant's own ink rather than default browser blue,
   without a blanket `.ld-body a` rule (see note above about specificity). */
.ld1-shot, .ld1-shot *, .ld2-tablet, .ld2-tablet * { color: inherit; text-decoration: none; }

.ld-expired {
  text-align: center;
  font: 500 14px/1.4 var(--font);
  padding: 10px 16px;
  background: #2a2016; color: #f0e6d2;
}
.ld-expired a { color: #e9b45a; text-underline-offset: 2px; }

/* variant picker overlay (?pick=1) — fixed, unobtrusive */
.ld-pick {
  position: fixed; right: 14px; bottom: 14px; z-index: 50;
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px; border-radius: 999px;
  background: rgba(20,14,8,.9); color: #f0e6d2;
  font: 600 12px/1 var(--font);
  box-shadow: 0 6px 24px rgba(0,0,0,.3);
}
.ld-pick-label { opacity: .6; text-transform: uppercase; letter-spacing: .08em; margin-right: 2px; }
/* CX r4 tap targets: 24px links fell well short of --tap-min. 36px visible +
   an invisible ::after hit zone grown to --tap-min (the app.css hit-zone
   idiom) keeps the pill compact while every tap lands. */
.ld-pick a {
  display: grid; place-items: center; width: 36px; height: 36px;
  position: relative;
  border-radius: 999px; text-decoration: none; color: inherit; opacity: .7;
}
.ld-pick a::after {
  content: ""; position: absolute;
  inset: calc((36px - var(--tap-min)) / 2);
}
.ld-pick a.on { background: #e9b45a; color: #2a2016; opacity: 1; }

/* ============================================================================
   V1 — "TABLE D'HÔTE"  (a real bistro menu card, on warm paper)
   ========================================================================== */
.ld1-body {
  /* V1's own paper palette — deliberately independent of skin tokens */
  --pa: #efe6d0;        /* paper */
  --pa-edge: #e6d9bd;   /* paper shadowed edge */
  --ink: #2c2115;       /* espresso ink */
  --ink-soft: #6d5c47;  /* muted ink */
  /* CX r4 contrast (computed; worst backdrops = page body #efe6d0, card
     gradient stop #f6efdb, door tiles #f3ecde): ink-faint #b7a988 was 2.0:1 on
     the card — the course labels, "estd" line and "left for another day" were
     decorative-only. #726447 computes ≥4.66:1 on all three. Teal and coral
     carry TEXT (served / door CTA / docs link), so they hold ≥4.5:1 too:
     teal 4.45→5.3, white-on-coral 3.66→5.0. */
  --ink-faint: #726447; /* faint ink — course labels, estd */
  --rule: #c9b78f;      /* leader/divider hairline */
  --teal: #38705f;      /* person A */
  --coral: #a5542f;     /* person B */
  --serif: Georgia, "Iowan Old Style", "Times New Roman", ui-serif, serif;
  /* NB: never `background-attachment: fixed` on these page gradients — a
     fixed gradient paints only one viewport-height, and full-page renders and
     many mobile browsers fall back to WHITE below the fold, silently killing
     text contrast. Solid background-color underneath as a hard fallback. */
  background-color: var(--pa);
  background-image:
    radial-gradient(120% 90% at 50% -10%, #f5eeda 0%, var(--pa) 46%, var(--pa-edge) 100%);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.ld1-wrap { max-width: 664px; margin: 0 auto; padding: 0 20px 72px; }

/* header chrome */
.ld1-top {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 26px 2px 30px;
}
.ld1-mark {
  font: 600 17px/1 var(--serif); letter-spacing: .01em;
}
.ld1-mark b { font-weight: 700; }
.ld1-topnav { display: flex; gap: 18px; font-size: 13.5px; }
.ld1-topnav a { color: var(--ink-soft); text-decoration: none; }
.ld1-topnav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* hero headline */
.ld1-hero { text-align: center; margin: 6px 0 30px; }
.ld1-h1 {
  font: 400 clamp(34px, 7vw, 52px)/1.04 var(--serif);
  letter-spacing: -.01em; margin: 0 0 16px;
}
.ld1-h1 em { font-style: italic; }
.ld1-sub {
  max-width: 34em; margin: 0 auto;
  font-size: 16.5px; line-height: 1.6; color: var(--ink-soft);
}

/* THE HERO SHOT — a real screenshot of the app's day view (not a mockup).
   Captured by tests/DailyMenu.E2E/screenshot-landing.ts against a seeded demo
   day (regen: `cd tests/DailyMenu.E2E && npm run screenshot:landing`). Framed
   like a dark tablet resting on the paper page. width/height attrs on the img
   reserve the box before the bytes arrive (no layout shift). */
.ld1-shot {
  display: block; text-decoration: none;
  margin: 32px auto 0; max-width: 632px;
  border-radius: 10px; overflow: hidden;
  border: 1px solid rgba(44,33,21,.55);
  background: #0c0b09;
  box-shadow:
    0 18px 44px -22px rgba(58,42,20,.5),
    0 2px 6px rgba(58,42,20,.14);
}
.ld1-shot:hover { box-shadow: 0 26px 60px -24px rgba(58,42,20,.55), 0 2px 6px rgba(58,42,20,.16); }
.ld1-shot:focus-visible { outline: 2px solid var(--teal); outline-offset: 4px; }
.ld1-shot-img { display: block; width: 100%; height: auto; }
.ld1-shot-cap {
  text-align: center; font-size: 13px; color: var(--ink-soft);
  margin: 10px auto 18px;
}

.ld1-eyebrow {
  font: 600 11px/1 var(--font); letter-spacing: .3em; text-transform: uppercase;
  color: var(--ink-faint); margin: 0 0 14px;
}
.ld1-dot {
  flex: none; width: 8px; height: 8px; border-radius: 999px;
  align-self: center; margin-right: 8px;
  box-shadow: 0 0 0 2px rgba(255,255,255,.6);
}
.ld1-dot.a { background: var(--teal); }
.ld1-dot.b { background: var(--coral); }
/* primary CTA row under the screenshot */
.ld1-cta {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 8px auto 6px;
  font: 600 16px/1 var(--font);
  color: #fbf6e9; background: var(--ink);
  padding: 14px 24px; border-radius: 999px; text-decoration: none;
  box-shadow: 0 10px 24px -12px rgba(44,33,21,.8);
}
.ld1-cta:hover { background: #3a2c1b; }
.ld1-cta:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.ld1-cta-row { text-align: center; margin-top: 18px; }
.ld1-cta-sub { display: block; margin-top: 12px; font-size: 13.5px; color: var(--ink-soft); }

/* body sections */
.ld1-sec { margin: 60px 0 0; }
.ld1-sec-h {
  font: 400 26px/1.15 var(--serif); margin: 0 0 16px; letter-spacing: -.005em;
}
.ld1-p { font-size: 16.5px; line-height: 1.68; color: #453626; margin: 0 0 14px; max-width: 40em; }
.ld1-pull {
  font: italic 400 22px/1.4 var(--serif);
  border-left: 2px solid var(--coral); padding: 4px 0 4px 20px;
  margin: 26px 0; color: var(--ink);
}

/* set for two — teal/coral split */
.ld1-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.ld1-two-col { padding: 18px 20px; border-radius: 8px; background: rgba(255,255,255,.42); border: 1px solid var(--pa-edge); }
.ld1-two-col .who { display: flex; align-items: center; gap: 8px; font: 600 13px/1 var(--font); letter-spacing: .04em; margin-bottom: 8px; }
.ld1-two-col .who .ld1-dot { margin: 0; }
.ld1-two-col p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--ink-soft); }

/* journal peek */
.ld1-journal { margin-top: 18px; }
.ld1-pre {
  font: 13px/1.6 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  background: #2c2115; color: #ecdfc6;
  border-radius: 8px; padding: 18px 20px; overflow-x: auto;
  white-space: pre; box-shadow: 0 14px 34px -20px rgba(44,33,21,.7);
}
.ld1-pre .h { color: #e9b45a; }
.ld1-pre .a { color: #7fc3af; }
.ld1-pre .b { color: #e39468; }
.ld1-cap { font-size: 13px; color: var(--ink-soft); margin-top: 10px; }

/* ---- V1 doors (shared markup, .ld1- scope) ---- */
.ld1-doors { margin: 62px 0 0; }
.ld1-doors-h { font: 400 26px/1.15 var(--serif); margin: 0 0 18px; }
.ld1-doors-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.ld1-door {
  min-width: 0; /* let the docker <code> scroll instead of blowing out the track */
  padding: 24px 22px; border-radius: 10px;
  background: rgba(255,255,255,.5); border: 1px solid var(--pa-edge);
  display: flex; flex-direction: column;
}
.ld1-door-eyebrow { font: 600 11px/1 var(--font); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 10px; }
.ld1-door-lede { font-size: 15px; line-height: 1.55; color: var(--ink-soft); margin: 0 0 16px; }
.ld1-dockerline { display: flex; align-items: stretch; gap: 6px; margin-bottom: 14px; }
.ld1-docker {
  flex: 1 1 auto; min-width: 0; overflow-x: auto; white-space: nowrap;
  font: 12.5px/1.5 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  background: #2c2115; color: #ecdfc6; border-radius: 7px; padding: 10px 12px;
}
.ld1-copy {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  background: var(--ink); color: #fbf6e9; border: 0; border-radius: 7px;
  padding: 0 12px; cursor: pointer; font: 600 12px/1 var(--font);
}
.ld1-copy:hover { background: #3a2c1b; }
.ld1-door-link { margin-top: auto; color: var(--teal); font: 600 14px/1 var(--font); text-decoration: none; }
.ld1-door-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.ld1-door-cta {
  display: inline-flex; align-self: flex-start; margin-bottom: 10px;
  background: var(--coral); color: #fff5ee; text-decoration: none;
  padding: 12px 18px; border-radius: 999px; font: 600 15px/1 var(--font);
}
.ld1-door-cta:hover { filter: brightness(1.05); }
.ld1-door-note { font-size: 12.5px; color: var(--ink-soft); }

/* footer */
.ld1-foot { margin-top: 54px; padding-top: 22px; border-top: 1px solid var(--rule); text-align: center; }
.ld1-swatches { display: flex; justify-content: center; gap: 10px; margin-bottom: 18px; }
.ld-swatch {
  width: 22px; height: 22px; border-radius: 999px;
  position: relative;
  border: 1px solid rgba(0,0,0,.35);
  box-shadow: 0 0 0 1px rgba(255,255,255,.28); /* keeps the dot defined on dark pages too */
  cursor: pointer; padding: 0; background-clip: padding-box;
}
/* CX r4 tap targets: the 22px dot stays, the hit zone grows to --tap-min via
   an invisible ::after (app.css hit-zone idiom). */
.ld-swatch::after {
  content: ""; position: absolute;
  inset: calc((22px - var(--tap-min)) / 2);
}
.ld-swatch[aria-current="true"] { outline: 2px solid var(--ink); outline-offset: 2px; }
.ld1-foot-credit { font-size: 14px; color: var(--ink-soft); }
.ld1-foot-credit a { color: var(--ink); text-underline-offset: 2px; }
.ld1-foot-links { margin-top: 10px; font-size: 13px; color: var(--ink-soft); display: flex; gap: 10px; justify-content: center; }
.ld1-foot-links a { color: var(--ink-soft); text-decoration: none; }
.ld1-foot-links a:hover { color: var(--ink); }

/* staggered menu-line fade-in (reduced-motion safe) */
@media (max-width: 560px) {
  .ld1-two, .ld1-doors-grid { grid-template-columns: 1fr; }
  .ld1-top { padding-top: 20px; }
}

/* ============================================================================
   V2 — "THE RHYTHM BOARD"  (dark, hardware-forward, wall-first)
   ========================================================================== */
.ld2-body {
  --bg2: #0e0f11; --panel: #16181b; --panel2: #1c1f23;
  /* CX r4 contrast: faint2 #5f666e was 3.0–3.3:1 on the panels (hour labels,
     door note) — #828a93 computes ≥5.0:1 on every V2 surface it sits on. */
  --ink2: #e8eaed; --soft2: #9aa1a9; --faint2: #828a93;
  --line2: rgba(255,255,255,.08); --line2-h: rgba(255,255,255,.16);
  --teal2: #5bb4a0; --coral2: #e0895f; --amber2: #e9b45a;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  /* Solid color + non-fixed gradient: see the .ld1-body note — `fixed` here
     left everything below the first viewport on a white fallback, which is
     exactly the "invisible section headings" bug. */
  background-color: var(--bg2);
  background-image: radial-gradient(120% 80% at 50% -8%, #17191d 0%, var(--bg2) 60%);
  background-repeat: no-repeat;
  color: var(--ink2); font-family: var(--font); -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
.ld2-wrap { max-width: 1000px; margin: 0 auto; padding: 0 22px 84px; }

.ld2-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 2px 8px; flex-wrap: wrap; }
.ld2-mark { font: 700 17px/1 var(--font); letter-spacing: .01em; }
.ld2-mark span { color: var(--amber2); }
.ld2-topright { display: flex; align-items: center; gap: 14px; }
.ld2-dockerpill {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line2); border-radius: 999px;
  padding: 7px 12px; font: 12.5px/1 var(--mono); color: var(--soft2);
}
.ld2-dockerpill:hover { border-color: var(--line2-h); color: var(--ink2); }
.ld2-dockerpill .lbl { color: var(--amber2); font-family: var(--font); font-weight: 600; font-size: 11px; }
.ld2-signin { color: var(--soft2); text-decoration: none; font-size: 13.5px; }
.ld2-signin:hover { color: var(--ink2); }

.ld2-hero { text-align: center; margin: 30px 0 8px; }
.ld2-h1 { font: 700 clamp(30px, 6vw, 46px)/1.06 var(--font); letter-spacing: -.02em; margin: 0 0 16px; }
.ld2-sub { max-width: 40em; margin: 0 auto; color: var(--soft2); font-size: 16px; line-height: 1.6; }

/* the tablet on a shelf — signature */
.ld2-stage { margin: 40px auto 8px; max-width: 760px; }
.ld2-tablet {
  position: relative; background: #050607; border: 1px solid #2a2e33;
  border-radius: 20px; padding: 14px;
  box-shadow: 0 40px 90px -40px rgba(0,0,0,.9), 0 2px 0 rgba(255,255,255,.05) inset;
}
.ld2-screen {
  background: var(--bg2); border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line2);
}
.ld2-screen-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line2); }
.ld2-screen-date { font: 600 14px/1 var(--font); }
.ld2-screen-date b { color: var(--amber2); }
.ld2-clock { font: 600 14px/1 var(--mono); color: var(--soft2); }
.ld2-board { position: relative; padding: 6px 0; }
.ld2-hourrow { display: grid; grid-template-columns: 54px 1fr; align-items: stretch; min-height: 42px; border-top: 1px solid var(--line2); }
.ld2-hourrow:first-child { border-top: 0; }
.ld2-hourlabel { font: 600 12px/1 var(--mono); color: var(--faint2); padding: 12px 0 0 14px; }
.ld2-cell { display: flex; align-items: center; gap: 8px; padding: 6px 14px; flex-wrap: wrap; }
.ld2-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--panel2); border: 1px solid var(--line2); border-radius: 999px;
  padding: 5px 11px 5px 8px; font: 500 13px/1 var(--font);
}
.ld2-chip .cdot { width: 7px; height: 7px; border-radius: 999px; }
.ld2-chip.a { border-color: rgba(91,180,160,.35); } .ld2-chip.a .cdot { background: var(--teal2); }
.ld2-chip.b { border-color: rgba(224,137,95,.35); } .ld2-chip.b .cdot { background: var(--coral2); }
.ld2-chip.done { opacity: .5; } .ld2-chip.done .txt { text-decoration: line-through; }
.ld2-now { position: relative; }
.ld2-now .ld2-hourlabel { color: var(--amber2); }
.ld2-nowline { position: absolute; left: 54px; right: 0; top: 0; height: 2px; background: var(--amber2); box-shadow: 0 0 10px var(--amber2); }
.ld2-nowdot { position: absolute; left: 50px; top: -3px; width: 8px; height: 8px; border-radius: 999px; background: var(--amber2); }
.ld2-shelf { height: 12px; margin: 0 40px; background: linear-gradient(180deg, #1a1d21, #0b0c0e); border-radius: 0 0 6px 6px; box-shadow: 0 22px 40px -22px rgba(0,0,0,.8); }
.ld2-stagenote { text-align: center; margin-top: 16px; color: var(--soft2); font-size: 13.5px; }

@media (prefers-reduced-motion: no-preference) {
  .ld2-now .ld2-hourlabel { animation: ld2-breathe 6s ease-in-out infinite; }
  @keyframes ld2-breathe { 0%,100% { opacity: .7; } 50% { opacity: 1; } }
}

.ld2-cta { display: inline-flex; align-items: center; gap: 8px; background: var(--amber2); color: #17120a; text-decoration: none; padding: 14px 22px; border-radius: 10px; font: 700 15px/1 var(--font); box-shadow: 0 14px 30px -14px rgba(233,180,90,.6); }
.ld2-cta:hover { filter: brightness(1.05); }
.ld2-ctarow { text-align: center; margin: 26px 0 0; }
.ld2-ghost { display: inline-block; margin-left: 14px; color: var(--soft2); text-decoration: none; font-size: 14px; border-bottom: 1px dashed var(--line2-h); padding-bottom: 2px; }
.ld2-ghost:hover { color: var(--ink2); }

.ld2-sec { margin: 66px 0 0; }
.ld2-sec-h { font: 700 24px/1.1 var(--font); letter-spacing: -.01em; margin: 0 0 20px; }
.ld2-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.ld2-step { background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; padding: 18px; }
.ld2-step-n { font: 700 12px/1 var(--mono); color: var(--amber2); letter-spacing: .1em; margin-bottom: 12px; }
.ld2-step-h { font: 600 15px/1.2 var(--font); margin: 0 0 8px; }
.ld2-step-p { font-size: 14px; line-height: 1.55; color: var(--soft2); margin: 0 0 12px; }
.ld2-vignette { display: flex; flex-direction: column; gap: 6px; }
.ld2-vchip { display: inline-flex; align-items: center; gap: 7px; background: var(--panel2); border: 1px solid var(--line2); border-radius: 999px; padding: 5px 10px 5px 8px; font: 500 12.5px/1 var(--font); align-self: flex-start; }
.ld2-vchip .cdot { width: 6px; height: 6px; border-radius: 999px; }
.ld2-vchip.a .cdot { background: var(--teal2); } .ld2-vchip.b .cdot { background: var(--coral2); }
.ld2-vchip.done { opacity: .5; } .ld2-vchip.done .txt { text-decoration: line-through; }

.ld2-wall { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.ld2-wall-p { font-size: 15px; line-height: 1.62; color: var(--soft2); }
.ld2-yaml { font: 12.5px/1.6 var(--mono); background: #0a0b0d; border: 1px solid var(--line2); border-radius: 10px; padding: 16px; overflow-x: auto; color: #cdd3d9; white-space: pre; }
.ld2-yaml .k { color: var(--amber2); } .ld2-yaml .s { color: var(--teal2); }

.ld2-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ld2-two-col { background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; padding: 18px; }
.ld2-two-col .who { display: flex; align-items: center; gap: 8px; font: 600 13px/1 var(--font); margin-bottom: 8px; }
.ld2-two-col .who .cdot { width: 8px; height: 8px; border-radius: 999px; }
.ld2-two-col.a .cdot { background: var(--teal2); } .ld2-two-col.b .cdot { background: var(--coral2); }
.ld2-two-col p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--soft2); }

/* spec-sheet doors */
.ld2-doors { margin: 66px 0 0; }
.ld2-doors-h { font: 700 24px/1.1 var(--font); margin: 0 0 20px; }
.ld2-doors-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ld2-door { min-width: 0; background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; padding: 22px; display: flex; flex-direction: column; }
.ld2-door-eyebrow { font: 700 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--amber2); margin-bottom: 12px; }
.ld2-door-lede { font-size: 14.5px; line-height: 1.55; color: var(--soft2); margin: 0 0 16px; }
.ld2-dockerline { display: flex; gap: 6px; margin-bottom: 14px; }
.ld2-docker { flex: 1 1 auto; min-width: 0; overflow-x: auto; white-space: nowrap; font: 12.5px/1.5 var(--mono); background: #0a0b0d; border: 1px solid var(--line2); color: #cdd3d9; border-radius: 8px; padding: 10px 12px; }
.ld2-copy { flex: none; display: inline-flex; align-items: center; gap: 6px; background: var(--panel2); border: 1px solid var(--line2-h); color: var(--ink2); border-radius: 8px; padding: 0 12px; cursor: pointer; font: 600 12px/1 var(--font); }
.ld2-copy:hover { border-color: var(--amber2); }
.ld2-door-link { margin-top: auto; color: var(--amber2); font: 600 14px/1 var(--font); text-decoration: none; }
.ld2-door-cta { display: inline-flex; align-self: flex-start; margin-bottom: 10px; background: var(--amber2); color: #17120a; text-decoration: none; padding: 11px 16px; border-radius: 8px; font: 700 14px/1 var(--font); }
.ld2-door-note { font-size: 12.5px; color: var(--faint2); }

.ld2-foot { margin-top: 54px; padding-top: 22px; border-top: 1px solid var(--line2); text-align: center; }
.ld2-swatches { display: flex; justify-content: center; gap: 10px; margin-bottom: 18px; }
.ld2-swatches .ld-swatch { border-color: rgba(255,255,255,.18); }
.ld2-swatches .ld-swatch[aria-current="true"] { outline-color: var(--amber2); }
.ld2-foot-credit { font-size: 14px; color: var(--soft2); }
.ld2-foot-credit a { color: var(--ink2); }
.ld2-foot-links { margin-top: 10px; font-size: 13px; display: flex; gap: 10px; justify-content: center; color: var(--faint2); }
.ld2-foot-links a { color: var(--soft2); text-decoration: none; }

@media (max-width: 720px) {
  .ld2-steps { grid-template-columns: 1fr; }
  .ld2-wall, .ld2-two, .ld2-doors-grid { grid-template-columns: 1fr; }
  .ld2-tablet { padding: 10px; }
  /* CTA and its ghost link each get their own line so they don't collide */
  .ld2-ghost { display: block; margin: 12px 0 0; }
}

/* ============================================================================
   V3 — "ENOUGH FOR TODAY"  (quiet essay, near-white, 65ch measure)
   ========================================================================== */
.ld3-body {
  /* CX r4 contrast: faint3 #9b9587 was 3.0:1 on the white door cards →
     #767061 (4.9:1 on #fff); coral3 carried white CTA text at 3.9:1 →
     #a5542f (5.4:1, matches V1's corrected coral). */
  --paper3: #faf8f4; --ink3: #23201b; --soft3: #6a6357; --faint3: #767061;
  --rule3: #e4ded2; --teal3: #3f7d6e; --coral3: #a5542f;
  --serif3: Georgia, "Iowan Old Style", ui-serif, serif;
  background: var(--paper3); color: var(--ink3); font-family: var(--serif3);
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}
.ld3-wrap { max-width: 65ch; margin: 0 auto; padding: 0 24px 96px; }
.ld3-top { display: flex; justify-content: space-between; align-items: baseline; padding: 26px 0 40px; font-family: var(--font); }
.ld3-mark { font: 600 16px/1 var(--font); }
.ld3-top a { color: var(--soft3); text-decoration: none; font-size: 13.5px; margin-left: 16px; }
.ld3-top a:hover { color: var(--ink3); }
.ld3-h1 { font: 400 clamp(34px, 7vw, 50px)/1.08 var(--serif3); letter-spacing: -.01em; margin: 0 0 22px; }
.ld3-lede { font-size: 20px; line-height: 1.6; color: var(--ink3); margin: 0 0 8px; }
.ld3-p { font-size: 18.5px; line-height: 1.72; margin: 0 0 22px; }
.ld3-p.first::first-letter { font-size: 3.1em; line-height: .8; float: left; padding: 6px 10px 0 0; color: var(--coral3); font-weight: 400; }
.ld3-sec-h { font: 400 24px/1.2 var(--serif3); margin: 44px 0 16px; }
.ld3-fig { margin: 28px 0; }
.ld3-fig-inner { background: #fff; border: 1px solid var(--rule3); border-radius: 8px; padding: 16px 18px; box-shadow: 0 12px 30px -22px rgba(40,30,15,.5); }
.ld3-fline { display: flex; align-items: baseline; gap: 8px; font-size: 16px; line-height: 1.7; padding: 2px 0; }
.ld3-fline .fdot { width: 7px; height: 7px; border-radius: 999px; align-self: center; }
.ld3-fline .fdot.a { background: var(--teal3); } .ld3-fline .fdot.b { background: var(--coral3); }
.ld3-fline .fh { margin-left: auto; color: var(--soft3); font-variant-numeric: tabular-nums; font-size: 14px; }
.ld3-fline .skip { color: var(--soft3); }
.ld3-fcap { font: italic 400 15px/1.5 var(--serif3); color: var(--soft3); margin-top: 10px; }
.ld3-figmono { font: 13px/1.6 ui-monospace, Menlo, Consolas, monospace; background: #23201b; color: #ece3d0; border-radius: 8px; padding: 16px; white-space: pre; overflow-x: auto; }
.ld3-figmono .h { color: #d99a3f; } .ld3-figmono .a { color: #7fc3af; } .ld3-figmono .b { color: #e39468; }
@media (prefers-reduced-motion: no-preference) {
  /* Progressive enhancement only: the pre-reveal state must stay fully
     legible even if the IntersectionObserver never fires — a mild
     desaturation/opacity delta, never grey-on-grey text. */
  .ld3-fig { opacity: .75; filter: saturate(.6); transition: opacity .7s ease, filter .7s ease; }
  .ld3-fig.in { opacity: 1; filter: none; }
}
.ld3-close { margin: 48px 0 0; }
.ld3-cta { display: inline-flex; align-items: center; gap: 8px; background: var(--ink3); color: var(--paper3); text-decoration: none; padding: 14px 24px; border-radius: 999px; font: 600 16px/1 var(--font); }
.ld3-cta:hover { background: #3a352c; }
.ld3-docker { margin-top: 18px; font: 13px/1.6 ui-monospace, Menlo, Consolas, monospace; background: #23201b; color: #ece3d0; border-radius: 8px; padding: 12px 14px; overflow-x: auto; white-space: nowrap; }
.ld3-sig { margin-top: 26px; font: italic 400 17px/1.5 var(--serif3); color: var(--soft3); }
/* V3 reuses the shared doors partial but styles it minimally */
.ld3-doors { margin: 48px 0 0; }
.ld3-doors-h { font: 400 24px/1.2 var(--serif3); margin: 0 0 16px; }
.ld3-doors-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ld3-door { min-width: 0; border: 1px solid var(--rule3); border-radius: 8px; padding: 18px; display: flex; flex-direction: column; background: #fff; }
.ld3-door-eyebrow { font: 600 11px/1 var(--font); letter-spacing: .16em; text-transform: uppercase; color: var(--faint3); margin-bottom: 10px; }
.ld3-door-lede { font: 15px/1.5 var(--font); color: var(--soft3); margin: 0 0 14px; }
.ld3-dockerline { display: flex; gap: 6px; margin-bottom: 12px; }
.ld3-docker { flex: 1 1 auto; min-width: 0; margin-top: 0; }
.ld3-copy { flex: none; display: inline-flex; align-items: center; gap: 6px; background: var(--ink3); color: var(--paper3); border: 0; border-radius: 8px; padding: 0 12px; cursor: pointer; font: 600 12px/1 var(--font); }
.ld3-door-link { margin-top: auto; color: var(--teal3); font: 600 14px/1 var(--font); text-decoration: none; }
.ld3-door-cta { display: inline-flex; align-self: flex-start; margin-bottom: 8px; background: var(--coral3); color: #fff; text-decoration: none; padding: 11px 16px; border-radius: 999px; font: 600 14px/1 var(--font); }
.ld3-door-note { font: 12.5px/1.4 var(--font); color: var(--faint3); }
.ld3-foot { margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--rule3); font-family: var(--font); }
.ld3-swatches { display: flex; gap: 10px; margin-bottom: 16px; }
/* CX r4: the shared selected-ring colour is var(--ink) — a skins.css token
   that is near-WHITE for dark skins, i.e. invisible on V3's near-white essay
   page. Pin V3's ring to its own ink. */
.ld3-swatches .ld-swatch[aria-current="true"] { outline-color: var(--ink3); }
.ld3-foot-credit { font-size: 14px; color: var(--soft3); }
.ld3-foot-credit a { color: var(--ink3); }
.ld3-foot-links { margin-top: 10px; font-size: 13px; display: flex; gap: 10px; color: var(--faint3); }
.ld3-foot-links a { color: var(--soft3); text-decoration: none; }
@media (max-width: 560px) { .ld3-doors-grid { grid-template-columns: 1fr; } }

/* ============================================================================
   V4 — "THE QUIET HOURS"  (a vertical hour ruler 06:00→22:00 as the page spine)
   Signature: a sticky left-rail ruler the reader scrolls DOWN THROUGH, hours
   ticking past while value props dock at the hours where they matter. Palette
   is dusk-to-lamplight — deep warm slate ground, ivory ink, brass "now" line —
   deliberately warmer and quieter than V2's cool charcoal. Motion is only a
   tiny IntersectionObserver lighting the active hour; no scroll-jacking. Mobile
   (≤700) and reduced-motion collapse the rail to inline hour chips (plain flow).
   ========================================================================== */
.ld4-body {
  --ink4: #12100c;        /* deep warm near-black ground */
  --ground4: #17140f;     /* rail / gradient anchor */
  --panel4: #1e1a13;      /* docked-card surface */
  --panel4h: #262117;     /* card hover / nowline surface */
  --paper4: #ece3d2;      /* ivory ink */
  --soft4: #a99f8b;       /* muted ink */
  --faint4: #6f665420;    /* (unused alpha placeholder) */
  /* CX r4 contrast: #756b57 was 3.3:1 on the docked cards (cadence chip,
     "left for another day", door note) — #9b9077 computes ≥5.0:1 on every
     V4 surface it sits on (panel, nowcard, pre, body). */
  --faint4c: #9b9077;     /* faint ink — ticks, captions */
  --line4: rgba(236,227,210,.10);
  --line4h: rgba(236,227,210,.20);
  --brass4: #d9a441;      /* lamplight — the now line + major hours */
  --teal4: #56b6a4;       /* person A */
  --coral4: #e08a5f;      /* person B */
  --serif4: Georgia, "Iowan Old Style", "Times New Roman", ui-serif, serif;
  --mono4: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  /* Solid ground first (see .ld1-body note — never background-attachment:fixed;
     it drops white below the fold and kills contrast on full-page renders). */
  background-color: var(--ink4);
  background-image:
    radial-gradient(120% 70% at 15% -6%, #1d1913 0%, var(--ink4) 52%),
    linear-gradient(180deg, #14110c 0%, var(--ink4) 30%, #100e0a 100%);
  background-repeat: no-repeat;
  color: var(--paper4);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.ld4-wrap { max-width: 940px; margin: 0 auto; padding: 0 24px 84px; }

/* header chrome */
.ld4-top { display: flex; justify-content: space-between; align-items: baseline; padding: 26px 0 8px; }
.ld4-mark { font: 600 17px/1 var(--font); letter-spacing: .01em; color: var(--paper4); }
.ld4-mark b { font-weight: 700; color: var(--brass4); }
.ld4-topnav { display: flex; gap: 18px; font-size: 13.5px; }
.ld4-topnav a { color: var(--soft4); text-decoration: none; }
.ld4-topnav a:hover { color: var(--paper4); text-decoration: underline; text-underline-offset: 3px; }

/* hero — quiet contemplative serif, brass eyebrow reading as a clock span */
.ld4-hero { padding: 48px 0 40px; max-width: 30em; }
.ld4-eyebrow {
  font: 600 12px/1 var(--mono4); letter-spacing: .22em; text-transform: uppercase;
  color: var(--brass4); margin-bottom: 22px; font-variant-numeric: tabular-nums;
}
.ld4-h1 { font: 400 clamp(36px, 6.4vw, 58px)/1.06 var(--serif4); letter-spacing: -.015em; margin: 0 0 22px; }
.ld4-h1 em { font-style: italic; color: var(--brass4); }
.ld4-sub { font-size: 17px; line-height: 1.66; color: var(--soft4); margin: 0 0 26px; max-width: 34em; }
.ld4-scroll-hint {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--paper4); text-decoration: none;
  font: 600 13px/1 var(--font); letter-spacing: .02em;
  padding: 10px 14px; border: 1px solid var(--line4h); border-radius: 999px;
}
.ld4-scroll-hint:hover { border-color: var(--brass4); color: var(--brass4); }
.ld4-scroll-hint:focus-visible { outline: 2px solid var(--brass4); outline-offset: 3px; }
@media (prefers-reduced-motion: no-preference) {
  .ld4-scroll-hint svg { animation: ld4-nudge 2.4s ease-in-out infinite; }
}
@keyframes ld4-nudge { 0%,100% { transform: translateY(0); } 50% { transform: translateY(3px); } }

/* ---- the day: sticky ruler rail + scrolling hour-docked stack ---- */
/* THE SPINE. Each dock is a 2-column grid: a fixed gutter (the ruler) + the
   value-prop body. The gutter draws the continuous vertical line with its left
   border, so consecutive docks form ONE unbroken spine; the hour tick + label
   sit at the gutter's top, exactly level with the section's heading. No
   absolute positioning, no scroll math — the ruler and the day are the same
   object. */
.ld4-day { margin-top: 8px; }
.ld4-dock {
  display: grid; grid-template-columns: 132px 1fr; align-items: start;
  scroll-margin-top: 24px;
}
.ld4-gutter {
  position: relative; align-self: stretch;
  border-left: 2px solid var(--line4h);
  padding: 4px 0 56px 26px; margin-left: 26px;
}
.ld4-dock.last .ld4-gutter {
  /* the spine fades out at the close of the day rather than hard-stopping */
  border-image: linear-gradient(180deg, var(--line4h) 0 55%, transparent) 1;
}
/* the tick: a short horizontal mark biting out of the spine at the hour */
.ld4-tick { position: absolute; left: -2px; top: 12px; display: block; width: 22px; height: 2px; }
.ld4-tick-mark { position: absolute; inset: 0; background: var(--faint4c); transition: background .35s ease, width .35s ease; }
.ld4-tick { width: 22px; }
.ld4-tick-label {
  display: block; margin-top: 22px; font: 700 15px/1 var(--mono4);
  letter-spacing: .04em; color: var(--soft4); font-variant-numeric: tabular-nums;
  transition: color .35s ease;
}
.ld4-tick-word { display: block; margin-top: 8px; font: 600 11px/1 var(--font); letter-spacing: .18em; text-transform: uppercase; color: var(--faint4c); }
/* the amber now line at 12:00 — the ruler's brightest moment */
.ld4-tick.now { width: 40px; }
.ld4-tick.now .ld4-tick-mark { background: var(--brass4); box-shadow: 0 0 12px 0 rgba(217,164,65,.55); }
.ld4-now-tag { display: block; margin-top: 20px; font: 700 10px/1 var(--mono4); letter-spacing: .2em; text-transform: uppercase; color: var(--brass4); }
.ld4-dock.now .ld4-tick-label { color: var(--brass4); }
@media (prefers-reduced-motion: no-preference) {
  .ld4-tick.now .ld4-tick-mark { animation: ld4-pulse 6s ease-in-out infinite; }
}
@keyframes ld4-pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }
/* the close tick is a filled node — the day comes to rest */
.ld4-tick.close { width: 22px; }
.ld4-tick.close .ld4-tick-mark { background: var(--brass4); }
/* IntersectionObserver lights the hour whose section is centred in view */
.ld4-tick.active .ld4-tick-mark { background: var(--brass4); width: 30px; }
.ld4-tick.now.active .ld4-tick-mark { width: 40px; }
.ld4-dock:hover .ld4-tick-label { color: var(--paper4); }

.ld4-dock-body { min-width: 0; padding: 2px 0 40px; }
.ld4-dock.last .ld4-dock-body { padding-bottom: 8px; }

/* the inline hour chip: hidden on desktop (the gutter shows the hour), shown
   on mobile where the gutter collapses */
.ld4-hourchip {
  display: none; align-items: baseline; gap: 10px; margin-bottom: 14px;
  font-family: var(--mono4);
}
.ld4-hourchip-time { font: 700 13px/1 var(--mono4); letter-spacing: .06em; color: var(--brass4); font-variant-numeric: tabular-nums; }
.ld4-hourchip-word { font: 600 11px/1 var(--font); letter-spacing: .16em; text-transform: uppercase; color: var(--faint4c); }
.ld4-hourchip.now .ld4-hourchip-time { color: var(--brass4); }

.ld4-dock-h { font: 400 clamp(23px, 3.4vw, 30px)/1.18 var(--serif4); letter-spacing: -.01em; margin: 0 0 14px; max-width: 18em; }
.ld4-dock-p { font-size: 16px; line-height: 1.68; color: var(--soft4); margin: 0 0 22px; max-width: 34em; }

/* the little day-card vignettes */
.ld4-card {
  background: var(--panel4); border: 1px solid var(--line4); border-radius: 12px;
  padding: 8px 18px; max-width: 30em;
  box-shadow: 0 18px 44px -30px rgba(0,0,0,.8);
}
.ld4-line { display: flex; align-items: baseline; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line4); }
.ld4-line:last-child { border-bottom: 0; }
.ld4-dot { flex: none; width: 8px; height: 8px; border-radius: 999px; align-self: center; }
.ld4-dot.a { background: var(--teal4); }
.ld4-dot.b { background: var(--coral4); }
.ld4-name { color: var(--paper4); font-size: 15px; }
.ld4-line.muted .ld4-name, .ld4-line.done .ld4-name { color: var(--soft4); }
.ld4-cadence { font: 500 11px/1 var(--font); letter-spacing: .02em; color: var(--faint4c); border: 1px solid var(--line4h); border-radius: 999px; padding: 4px 8px; }
.ld4-when { margin-left: auto; font: 500 13px/1 var(--mono4); color: var(--soft4); font-variant-numeric: tabular-nums; flex: none; }
.ld4-skip { margin-left: auto; font: italic 400 12.5px/1 var(--serif4); color: var(--faint4c); flex: none; }
/* the amber now line inside the 12:00 card */
.ld4-nowcard { background: var(--panel4h); }
.ld4-nowline { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.ld4-nowline::before, .ld4-nowline::after { content: ""; height: 2px; background: var(--brass4); flex: 1; opacity: .55; }
.ld4-nowline span { font: 700 10px/1 var(--mono4); letter-spacing: .18em; text-transform: uppercase; color: var(--brass4); flex: none; }

/* both people, one evening */
.ld4-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 34em; }
.ld4-two-col { background: var(--panel4); border: 1px solid var(--line4); border-radius: 12px; padding: 18px; }
.ld4-two-col .who { display: flex; align-items: center; gap: 8px; font: 600 13px/1 var(--font); margin-bottom: 8px; color: var(--paper4); }
.ld4-two-col p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--soft4); }

/* the day, filed as markdown at close */
.ld4-journal { max-width: 34em; }
.ld4-pre {
  font: 13px/1.65 var(--mono4); white-space: pre; overflow-x: auto;
  background: #100d09; border: 1px solid var(--line4); border-radius: 12px;
  padding: 18px 20px; margin: 0; color: #d6cdba;
}
.ld4-pre .h { color: var(--brass4); }
.ld4-pre .a { color: var(--teal4); }
.ld4-pre .b { color: var(--coral4); }
.ld4-pre .dim { color: var(--faint4c); font-style: italic; }

/* primary CTA row after the day closes */
.ld4-cta-row { text-align: center; margin: 20px 0 0; }
.ld4-cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brass4); color: #17120a; text-decoration: none;
  padding: 14px 26px; border-radius: 999px; font: 700 15px/1 var(--font);
}
.ld4-cta:hover { background: #e6b451; }
.ld4-cta:focus-visible { outline: 2px solid var(--paper4); outline-offset: 3px; }
.ld4-cta-sub { display: block; margin-top: 14px; font-size: 13.5px; color: var(--soft4); }

/* ---- V4 doors (shared markup, .ld4- scope) — dark spec-sheet tiles ---- */
.ld4-doors { margin: 72px 0 0; }
.ld4-doors-h { font: 400 26px/1.15 var(--serif4); margin: 0 0 20px; }
.ld4-doors-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ld4-door { min-width: 0; background: var(--panel4); border: 1px solid var(--line4); border-radius: 12px; padding: 22px; display: flex; flex-direction: column; }
.ld4-door-eyebrow { font: 700 11px/1 var(--mono4); letter-spacing: .18em; text-transform: uppercase; color: var(--brass4); margin-bottom: 12px; }
.ld4-door-lede { font-size: 14.5px; line-height: 1.55; color: var(--soft4); margin: 0 0 16px; }
.ld4-dockerline { display: flex; gap: 6px; margin-bottom: 14px; }
.ld4-docker { flex: 1 1 auto; min-width: 0; overflow-x: auto; white-space: nowrap; font: 12.5px/1.5 var(--mono4); background: #100d09; border: 1px solid var(--line4); color: #cdc5b3; border-radius: 8px; padding: 10px 12px; }
.ld4-copy { flex: none; display: inline-flex; align-items: center; gap: 6px; background: var(--panel4h); border: 1px solid var(--line4h); color: var(--paper4); border-radius: 8px; padding: 0 12px; cursor: pointer; font: 600 12px/1 var(--font); }
.ld4-copy:hover { border-color: var(--brass4); }
.ld4-door-link { margin-top: auto; color: var(--brass4); font: 600 14px/1 var(--font); text-decoration: none; }
.ld4-door-cta { display: inline-flex; align-self: flex-start; margin-bottom: 10px; background: var(--brass4); color: #17120a; text-decoration: none; padding: 11px 16px; border-radius: 999px; font: 700 14px/1 var(--font); }
.ld4-door-note { font-size: 12.5px; color: var(--faint4c); }

.ld4-foot { margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--line4); text-align: center; }
.ld4-swatches { display: flex; justify-content: center; gap: 10px; margin-bottom: 18px; }
.ld4-swatches .ld-swatch { border-color: rgba(236,227,210,.18); }
.ld4-swatches .ld-swatch[aria-current="true"] { outline-color: var(--brass4); }
.ld4-foot-credit { font-size: 14px; color: var(--soft4); }
.ld4-foot-credit a { color: var(--paper4); }
.ld4-foot-links { margin-top: 10px; font-size: 13px; display: flex; gap: 10px; justify-content: center; color: var(--faint4c); }
.ld4-foot-links a { color: var(--soft4); text-decoration: none; }

/* ---- graceful degradation: collapse the rail, show inline hour chips ---- */
/* Graceful degradation: the gutter/ruler collapses; each section stacks in
   plain flow and wears its hour as an inline chip instead. */
@media (max-width: 700px) {
  .ld4-wrap { padding: 0 20px 72px; }
  .ld4-dock { display: block; }
  .ld4-gutter { display: none; }
  .ld4-dock-body { padding: 0; }
  .ld4-hourchip { display: flex; }
  .ld4-dock { padding: 34px 0; border-top: 1px solid var(--line4); }
  .ld4-dock:first-child { border-top: 0; padding-top: 8px; }
  .ld4-two { grid-template-columns: 1fr; }
  .ld4-doors-grid { grid-template-columns: 1fr; }
}
/* reduced-motion: no ambient pulse/nudge; the spine is layout, not motion, so
   it stays — nothing moves on its own. */
@media (prefers-reduced-motion: reduce) {
  .ld4-scroll-hint svg, .ld4-tick.now .ld4-tick-mark { animation: none; }
}
