/* ============================================================
   LUMINOUS UNIVERSITY · RSD & ADHD — the course, dressed as the house.
   Haute Lumière, after L'Accord: cream paper, pine ink, gold only as a mark.
   Radius zero. Hairline rules. Shadow only as distance.
   Cormorant for every voice; Manrope only for furniture.
   One curve, three durations. The room opens in the hour's own light.
   ============================================================ */

/* The house type, served from this Worker — a phone asks no third party for anything. */
@font-face { font-family: "Cormorant Garamond"; src: url("/_hl/fonts/cormorant.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("/_hl/fonts/cormorant-italic.woff2") format("woff2"); font-weight: 300 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/_hl/fonts/manrope.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }

/* ── the registers, values exactly as the house tokens declare them ── */
:root,
html[data-register="daylight"] {
  --paper: #FAF8F3; --paper-2: #F3EFE6; --ink: #0C1E16; --ink-soft: #334A3F;
  --text-body: #334A3F; --muted: #5C7065; --gold: #C5A059; --gold-d: #9A7A3A;
  --rule: #E1E7E2; --desk: #D6DAD4; --veil: 12,30,22;
  --photo-grade: saturate(1.04) contrast(1.03) brightness(1.01);
}
html[data-register="aurora"] {
  --paper: #F4F9FD; --paper-2: #E9F2FA; --ink: #17283A; --ink-soft: #3A5062;
  --text-body: #3A5062; --muted: #4E6B87; --gold: #B7A667; --gold-d: #93813C;
  --rule: #D2E5F2; --desk: #C3D9EC; --veil: 20,42,64;
  --photo-grade: sepia(.14) hue-rotate(165deg) saturate(1.07) brightness(1.03) contrast(1.01);
}
html[data-register="dusk"] {
  --paper: #FBF4EA; --paper-2: #F4E8DA; --ink: #33201A; --ink-soft: #5A3C2E;
  --text-body: #5A3C2E; --muted: #7A5B4C; --gold: #D69A4C; --gold-d: #B0713C;
  --rule: #EDDFCE; --desk: #E0CDB8; --veil: 51,32,26;
  --photo-grade: sepia(.16) saturate(1.24) contrast(1.07) brightness(1.02);
}
html[data-register="vespers"] {
  --paper: #3A2E22; --paper-2: #463829; --ink: #F2E3C8; --ink-soft: #DCC9A6;
  --text-body: #DCC9A6; --muted: #C0AB8A; --gold: #D9AE6A; --gold-d: #C79753;
  --rule: #55432F; --desk: #241C14; --veil: 36,28,20;
  --photo-grade: sepia(.55) saturate(.85) contrast(1.02);
}
html[data-register="midnight"] {
  --paper: #111620; --paper-2: #171E2A; --ink: #EFE8D8; --ink-soft: #CFC7B4;
  --text-body: #CFC7B4; --muted: #8E97A6; --gold: #D9B472; --gold-d: #C39A56;
  --rule: #2A3140; --desk: #080B11; --veil: 5,8,14;
  --photo-grade: contrast(1.14) brightness(.9) saturate(1.04);
}
html[data-register="nocturne"] {
  --paper: #0E1712; --paper-2: #131F18; --ink: #EDE6D2; --ink-soft: #C9C2AA;
  --text-body: #C9C2AA; --muted: #7E8C80; --gold: #C7A468; --gold-d: #AC8B4C;
  --rule: #243128; --desk: #070B08; --veil: 7,13,9;
  --photo-grade: sepia(.14) hue-rotate(75deg) saturate(.82) contrast(1.13) brightness(.87);
}

:root {
  --on-photo: #FBF8F0;          /* type laid on a photograph, whatever the hour */
  --photo-veil: 12,30,22;       /* the plate veil is always pine — it protects the type, not the register */
  --font-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-sans: "Manrope", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --ease: cubic-bezier(.165,.84,.44,1);
  --dur-fast: 200ms; --dur-base: 400ms; --dur-slow: 700ms;
  --tap-min: 44px;
  --s1: 4px; --s2: 8px; --s3: 14px; --s4: 22px; --s5: 34px; --s6: 52px; --s7: 74px;
  --safe-t: env(safe-area-inset-top, 0px); --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-l: env(safe-area-inset-left, 0px);
  --shadow-plate: 0 16px 38px -20px rgba(var(--veil),.42);
}
@media (prefers-reduced-motion: reduce) {
  :root { --dur-fast: 0ms; --dur-base: 0ms; --dur-slow: 0ms; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--paper); }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-serif); font-size: 1.0625rem; line-height: 1.68;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  transition: background var(--dur-slow) var(--ease), color var(--dur-slow) var(--ease);
}
h1, h2, h3, p, ol, ul, figure, blockquote { margin: 0; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 1px solid var(--gold-d); outline-offset: 3px; }
::selection { background: rgba(var(--veil), .14); }

/* The whole room is one container; every size below scales off it, never off the window. */
#app { container-type: inline-size; min-height: 100svh; }
.view { opacity: 0; transition: opacity var(--dur-base) var(--ease); }
.view.shown { opacity: 1; }

/* ── the column ──────────────────────────────────────────── */
.leaf {
  max-width: 38em; margin: 0 auto;
  padding: var(--s6) calc(var(--safe-r) + var(--s4)) calc(var(--safe-b) + var(--s7)) calc(var(--safe-l) + var(--s4));
}
section.part { border-top: 1px solid var(--rule); padding: var(--s5) 0 var(--s4); }
section.part.first { border-top: 0; padding-top: 0; }

/* ── furniture: Manrope, tracked, never read aloud ───────── */
.kicker, .label, .meta, .text-button, .folio {
  font-family: var(--font-sans); text-transform: uppercase; font-weight: 600;
}
.kicker { font-size: .625rem; letter-spacing: .32em; color: var(--muted); margin: 0 0 var(--s3); display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.kicker.gold, .label.gold { color: var(--gold-d); }
.label { font-size: .594rem; letter-spacing: .3em; color: var(--muted); margin: 0 0 var(--s1); display: block; }
.meta { font-size: .594rem; letter-spacing: .24em; color: var(--muted); font-weight: 500; }
.folio { font-size: .594rem; letter-spacing: .2em; color: var(--muted); font-variant-numeric: lining-nums tabular-nums; font-weight: 500; }
.sep { color: var(--gold-d); }

/* ── the voice: Cormorant ─────────────────────────────────── */
.display { font-weight: 300; font-size: clamp(2.5rem, 12cqi, 5.4rem); line-height: 1; letter-spacing: .005em; margin: 0 0 var(--s4); color: var(--ink); }
.display em { font-style: italic; color: var(--gold-d); }
.deck { font-style: italic; font-size: clamp(1.2rem, 3.6cqi, 1.5rem); line-height: 1.42; color: var(--ink-soft); max-width: 30em; margin: 0 0 var(--s4); }
.body { font-size: 1.0625rem; line-height: 1.7; color: var(--text-body); margin: 0 0 var(--s3); hyphens: auto; }
.note { font-style: italic; font-size: .95rem; line-height: 1.5; color: var(--muted); margin: var(--s1) 0 0; }
.section-head { font-weight: 300; font-size: clamp(1.75rem, 6cqi, 2.4rem); line-height: 1.1; margin: 0 0 var(--s3); color: var(--ink); }
.quiet { font-style: italic; font-size: clamp(1.2rem, 4cqi, 1.45rem); line-height: 1.4; color: var(--ink); }

/* ── the monogram: a circle through a line, stroked in gold ── */
.monogram { display: block; width: 26px; height: 26px; color: var(--gold); }
.monogram circle, .monogram line { fill: none; stroke: currentColor; stroke-width: .8; }
.rule-mark { display: flex; align-items: center; gap: var(--s3); margin: var(--s5) 0; color: var(--gold); }
.rule-mark::before, .rule-mark::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

/* ── the one button: a tracked word, no fill ──────────────── */
.text-button {
  appearance: none; -webkit-appearance: none; background: transparent; border: 0; border-radius: 0;
  min-height: var(--tap-min); min-width: var(--tap-min); padding: 0 var(--s3);
  font-size: .625rem; letter-spacing: .28em; color: var(--ink); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); white-space: nowrap;
  transition: opacity var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
  text-decoration: none;
}
.text-button:hover { opacity: .72; }
.text-button:active { opacity: .55; }
.text-button.gold { color: var(--gold-d); }
.text-button.quiet-btn { color: var(--muted); }
.text-button.framed { border: 1px solid var(--ink); padding: 0 var(--s4); min-height: 52px; }
.text-button.framed.gold { border-color: var(--gold-d); }
.text-button[disabled], .text-button[aria-busy="true"] { opacity: .45; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; margin: var(--s4) 0 0; }
.actions.flush { margin: 0; }

/* ── the bar: four words, iconless, outside the page ──────── */
.bar {
  position: sticky; top: 0; z-index: 15;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
  padding: calc(var(--safe-t) + var(--s1)) calc(var(--safe-r) + var(--s3)) var(--s1) calc(var(--safe-l) + var(--s3));
  background: var(--paper); border-bottom: 1px solid var(--rule);
  transition: background var(--dur-slow) var(--ease);
}
.bar .home { font-family: var(--font-serif); font-size: 1.05rem; letter-spacing: .02em; text-transform: none; font-weight: 400; color: var(--ink); padding-left: 0; }
.bar .home i { font-style: italic; color: var(--gold-d); }
.bar nav { display: flex; gap: 0; }
.bar nav .text-button[aria-current="page"] { color: var(--gold-d); }
.bar.over-photo { position: fixed; left: 0; right: 0; background: transparent; border-bottom-color: transparent; }
.bar.over-photo .home, .bar.over-photo .text-button { color: var(--on-photo); }
.bar.over-photo.scrolled { background: var(--paper); border-bottom-color: var(--rule); }
.bar.over-photo.scrolled .home, .bar.over-photo.scrolled .text-button { color: var(--ink); }
.bar.over-photo.scrolled nav .text-button[aria-current="page"] { color: var(--gold-d); }

/* ── the cover ────────────────────────────────────────────── */
.cover { min-height: calc(100svh - 54px); display: flex; flex-direction: column; justify-content: center; padding-top: var(--s7); padding-bottom: var(--s6); }
.cover .monogram { margin: 0 0 var(--s5); }
.cover .display { max-width: 9em; }
.progress { margin: var(--s5) 0 0; }
.progress .line { height: 1px; background: var(--rule); position: relative; margin: var(--s2) 0 0; }
.progress .line i { position: absolute; left: 0; top: 0; height: 1px; width: 0; background: var(--gold); transition: width var(--dur-slow) var(--ease); }
.progress .count { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); }
.progress .count .num { font-size: 1.6rem; font-weight: 300; font-variant-numeric: lining-nums; color: var(--ink); }

/* hairline cells: the gaps are the rules */
.cells { display: grid; grid-template-columns: 1fr; gap: 1px; background: var(--rule); border: 1px solid var(--rule); margin: 0 0 var(--s4); }
@container (min-width: 520px) { .cells.two { grid-template-columns: 1fr 1fr; } .cells.three { grid-template-columns: repeat(3, 1fr); } }
.cell { background: var(--paper); padding: var(--s3) var(--s3) var(--s4); transition: background var(--dur-slow) var(--ease); }
.cell .v { font-size: clamp(1.9rem, 7cqi, 2.6rem); font-weight: 300; line-height: 1.05; font-variant-numeric: lining-nums; color: var(--ink); display: block; margin: 0 0 var(--s1); }
.cell p { font-size: 1.02rem; line-height: 1.6; color: var(--text-body); }
.cell a.cell-link { text-decoration: none; display: block; }

/* ── the contents: a fashion index in roman numerals ──────── */
.chapter { border-top: 1px solid var(--rule); padding: var(--s6) 0 var(--s4); }
.chapter-head { display: grid; grid-template-columns: auto 1fr; gap: var(--s1) var(--s4); align-items: baseline; margin: 0 0 var(--s4); }
.chapter-head .roman { font-family: var(--font-serif); font-weight: 300; font-style: italic; font-size: clamp(2.4rem, 10cqi, 3.6rem); line-height: .9; color: var(--gold-d); }
.chapter-head h2 { font-weight: 300; font-size: clamp(1.7rem, 6.2cqi, 2.4rem); line-height: 1.08; color: var(--ink); }
.chapter-head .meta { grid-column: 2; }
.before { margin: 0 0 var(--s4); padding: var(--s3) 0 var(--s3) var(--s4); border-left: 1px solid var(--gold); }
.before .quiet { margin: var(--s1) 0 0; }

.rows { list-style: none; padding: 0; margin: 0; }
.row a {
  display: grid; grid-template-columns: 2.6em 1fr auto; gap: var(--s3); align-items: center;
  min-height: 64px; padding: var(--s3) 0; border-top: 1px solid var(--rule); text-decoration: none;
  transition: opacity var(--dur-fast) var(--ease);
}
.row:last-child a { border-bottom: 1px solid var(--rule); }
.row a:hover { opacity: .72; }
.row a:active { opacity: .55; }
.row .folio { align-self: start; padding-top: .55em; }
.row .t { font-size: 1.22rem; line-height: 1.25; color: var(--ink); display: block; }
.row .p { font-style: italic; font-size: .95rem; line-height: 1.4; color: var(--muted); display: block; margin-top: 2px; }
.row .end { display: flex; align-items: center; gap: var(--s3); }
.row .thumb { width: 44px; height: 56px; overflow: hidden; background: var(--paper-2); flex: none; }
.row .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0%; display: block; filter: var(--photo-grade); }
/* hl-ok: an 8px completion mark — the lit star, not a badge */
.mark { width: 8px; height: 8px; flex: none; border: 1px solid var(--muted); opacity: .6; transform: rotate(45deg); }
/* hl-ok: an 8px completion mark, lit — a mark, never a fill */
.mark.lit { background: var(--gold); border-color: var(--gold); opacity: 1; }

/* ── the exercise page ────────────────────────────────────── */
.ex { display: block; }
.plate { position: relative; margin: 0; overflow: hidden; background: var(--desk); height: 82svh; min-height: 420px; }
.plate img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 0%;
  transform-origin: 50% 0%; /* the drift grows away from the crown: the top of a head is never cut */
  filter: var(--photo-grade);
  opacity: 0; transition: opacity var(--dur-slow) var(--ease);
  animation: drift 32s var(--ease) infinite alternate;
}
.plate img.in { opacity: 1; }
@keyframes drift {
  from { transform: scale(1.01) translate3d(0, 0, 0); }
  to   { transform: scale(1.08) translate3d(-1.6%, 0, 0); }
}
@media (prefers-reduced-motion: reduce) { .plate img { animation: none; transform: none; } }
.plate .veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(var(--photo-veil),.38) 0%, rgba(var(--photo-veil),0) 22%, rgba(var(--photo-veil),0) 46%, rgba(var(--photo-veil),.74) 100%); pointer-events: none; }
.plate .over { position: absolute; left: 0; right: 0; bottom: 0; padding: var(--s5) calc(var(--safe-r) + var(--s4)) var(--s5) calc(var(--safe-l) + var(--s4)); color: var(--on-photo); }
.plate .over .kicker { color: var(--on-photo); opacity: .86; }
.plate .over .kicker .sep { color: var(--on-photo); }
.plate .over h1 { font-weight: 300; font-size: clamp(2.3rem, 10.5cqi, 4.6rem); line-height: 1.02; color: var(--on-photo); max-width: 11em; }

/* No picture yet: a designed plate, set in type — never a broken image. */
.plate.bare { background: var(--paper-2); height: auto; min-height: 50svh; display: flex; align-items: flex-end; }
.plate.bare .veil { display: none; }
.plate.bare .over { position: relative; color: var(--ink); }
.plate.bare .over .kicker { color: var(--muted); opacity: 1; }
.plate.bare .over .kicker .sep { color: var(--gold-d); }
.plate.bare .over h1 { color: var(--ink); }
.plate.bare .ghost {
  position: absolute; top: calc(var(--s7) + var(--safe-t)); right: calc(var(--s4) + var(--safe-r));
  font-family: var(--font-serif); font-style: italic; font-weight: 300; line-height: .8;
  font-size: clamp(7rem, 42cqi, 16rem); color: var(--gold); opacity: .32; pointer-events: none;
}
.plate.bare .monogram { position: absolute; top: calc(var(--s7) + var(--safe-t)); left: calc(var(--s4) + var(--safe-l)); }

.caption { font-style: italic; font-size: .95rem; line-height: 1.5; color: var(--muted); padding: var(--s3) calc(var(--safe-r) + var(--s4)) 0 calc(var(--safe-l) + var(--s4)); max-width: 38em; margin: 0 auto; }
.caption::before { content: "— "; color: var(--gold-d); font-style: normal; }

.ex .leaf { padding-top: var(--s5); }
.ex .deck { font-size: clamp(1.35rem, 4.4cqi, 1.7rem); color: var(--ink); }

/* At a desk the plate stands beside the page, 1 : 1.05, and stays while the page reads. */
@container (min-width: 960px) {
  .ex { display: grid; grid-template-columns: 1fr 1.05fr; align-items: start; }
  .ex .plate-col { position: sticky; top: 0; height: 100svh; }
  .ex .plate { height: 100svh; }
  .ex .plate.bare { height: 100svh; }
  .ex .caption { position: absolute; left: 0; right: 0; bottom: 0; max-width: none; margin: 0; padding: 0 var(--s6) var(--s4); color: var(--on-photo); opacity: .82; }
  .ex .caption::before { color: var(--on-photo); }
  .bar.over-photo nav .text-button { color: var(--ink); }
  .bar.over-photo nav .text-button[aria-current="page"] { color: var(--gold-d); }
  .ex .plate.bare .monogram { left: var(--s6); }
  .ex .plate.bare .ghost { right: var(--s6); }
  .ex .text-col .leaf { padding-top: calc(var(--s7) + var(--s4)); margin: 0; max-width: 40em; padding-left: var(--s6); padding-right: var(--s6); }
  .ex .plate .over { padding: var(--s6); padding-bottom: calc(var(--s6) + var(--s5)); }
}

/* ── Ava's reading: a word, a hairline, a time ────────────── */
.player { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: var(--s2) 0; margin: 0 0 var(--s5); }
.player .top { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s3); align-items: center; }
.player .who { font-style: italic; font-size: 1.02rem; color: var(--ink-soft); line-height: 1.3; }
.player .time { font-family: var(--font-sans); font-size: .625rem; letter-spacing: .14em; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.player .play { padding-left: 0; color: var(--gold-d); min-width: 5.6em; justify-content: flex-start; }
.player .track { position: relative; height: 22px; }
.player .track input { position: absolute; inset: 0; }
.player.idle .track { opacity: .5; }
.player.in-question { border: 0; margin: var(--s2) 0 0; padding: 0; }

input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: var(--tap-min); margin: 0;
  background: transparent; cursor: pointer; touch-action: pan-y;
}
.player .track input[type="range"] { height: 22px; }
input[type="range"]:focus { outline: none; }
input[type="range"]::-webkit-slider-runnable-track { height: 1px; background: var(--ink-soft); }
input[type="range"]::-moz-range-track { height: 1px; background: var(--ink-soft); }
input[type="range"]::-moz-range-progress { height: 1px; background: var(--gold-d); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 10px; height: 22px; margin-top: -11px;
  background: var(--paper); border: 1px solid var(--ink); border-radius: 0;
}
input[type="range"]::-moz-range-thumb { width: 10px; height: 22px; background: var(--paper); border: 1px solid var(--ink); border-radius: 0; }
input[type="range"]:focus-visible::-webkit-slider-thumb { border-color: var(--gold-d); }

/* ── the work: the workbook's own fields ──────────────────── */
.brief .cell .label { margin-bottom: var(--s2); }
.woven { margin: var(--s5) 0; padding: var(--s4) 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); text-align: center; }
.woven .quiet { max-width: 26em; margin: var(--s2) auto 0; }

.blocks { margin: var(--s5) 0 0; }
.field { margin: 0 0 var(--s5); }
.field-label { font-size: 1.15rem; line-height: 1.35; color: var(--ink); margin: 0 0 var(--s2); }
.field-num { font-family: var(--font-sans); font-size: .594rem; letter-spacing: .24em; color: var(--gold-d); font-weight: 600; display: block; margin: 0 0 var(--s1); }
.field-note { font-style: italic; color: var(--muted); font-size: 1.02rem; line-height: 1.55; margin: 0 0 var(--s5); padding-left: var(--s4); border-left: 1px solid var(--rule); }

textarea.block-input {
  -webkit-appearance: none; appearance: none; display: block; width: 100%;
  font-family: var(--font-serif); font-size: 1.2rem; line-height: 34px; color: var(--ink);
  border: 0; border-radius: 0; padding: 0 0 2px;
  /* ruled like a page: one hairline per line of writing */
  background: transparent repeating-linear-gradient(180deg, transparent 0, transparent 33px, var(--rule) 33px, var(--rule) 34px);
  background-attachment: local;
  resize: vertical; min-height: 68px;
  transition: background-color var(--dur-fast) var(--ease);
}
textarea.block-input:focus { outline: none; background-color: rgba(var(--veil), .025); }
textarea.block-input::placeholder { color: var(--muted); font-style: italic; opacity: .7; }

.scale-row { display: grid; grid-template-columns: 1fr; gap: var(--s1); }
.scale-ends { display: flex; justify-content: space-between; gap: var(--s3); }
.scale-end { font-style: italic; font-size: .92rem; color: var(--muted); line-height: 1.3; }
.scale-end:last-child { text-align: right; }
.scale-wrap { display: grid; grid-template-columns: 1fr auto; gap: var(--s3); align-items: center; }
.scale-val { font-size: 1.7rem; font-weight: 300; font-variant-numeric: lining-nums tabular-nums; color: var(--gold-d); min-width: 1.4em; text-align: right; }

.check-row { display: grid; grid-template-columns: var(--tap-min) 1fr; align-items: center; min-height: var(--tap-min); font-size: 1.1rem; line-height: 1.35; color: var(--ink); cursor: pointer; }
.check-row input { -webkit-appearance: none; appearance: none; margin: 0; width: 18px; height: 18px; border: 1px solid var(--ink-soft); border-radius: 0; background: transparent; position: relative; cursor: pointer; justify-self: start; }
.check-row input[type="radio"] { border-radius: 0; }
.check-row input:checked::after { content: ""; position: absolute; inset: 4px; background: var(--ink); }
.check-row input:focus-visible { outline: 1px solid var(--gold-d); outline-offset: 3px; }

.cols-row { display: grid; grid-template-columns: 1fr; gap: var(--s4); }
@container (min-width: 520px) { .cols-row { grid-template-columns: 1fr 1fr; } }
.col-label { font-family: var(--font-sans); font-size: .594rem; letter-spacing: .24em; text-transform: uppercase; font-weight: 600; color: var(--muted); margin: 0 0 var(--s1); }

.clinician { margin: var(--s5) 0; padding: var(--s4); background: var(--paper-2); }
.clinician p { font-size: 1.02rem; line-height: 1.6; color: var(--text-body); margin: var(--s2) 0 0; }

.keep { border-top: 1px solid var(--rule); padding: var(--s5) 0 0; margin: var(--s5) 0 0; }
.keep .choice { border-top: 1px solid var(--rule); }
.keep .choice:last-of-type { border-bottom: 1px solid var(--rule); }
.keep .choice .check-row { padding: var(--s2) 0; }
.keep .choice .note { margin: 0 0 var(--s2) var(--tap-min); }

input[type="email"] {
  -webkit-appearance: none; appearance: none; border-radius: 0; width: 100%; min-height: var(--tap-min);
  background: transparent; border: 0; border-bottom: 1px solid var(--ink-soft); color: var(--ink);
  font-family: var(--font-serif); font-size: 1.25rem; padding: var(--s1) 0; margin: var(--s2) 0;
}
input[type="email"]::placeholder { color: var(--muted); font-style: italic; }
input[type="email"]:focus { outline: none; border-bottom-color: var(--gold-d); }
.keep .therapist { margin-left: var(--tap-min); padding-bottom: var(--s2); }

.turn { display: grid; grid-template-columns: 1fr; gap: 1px; background: var(--rule); border: 1px solid var(--rule); margin: var(--s6) 0 0; }
@container (min-width: 520px) { .turn { grid-template-columns: 1fr 1fr; } }
.turn a { background: var(--paper); padding: var(--s4); text-decoration: none; display: block; min-height: 96px; transition: opacity var(--dur-fast) var(--ease), background var(--dur-slow) var(--ease); }
.turn a:hover { opacity: .72; }
.turn a.next { text-align: right; }
.turn .t { font-size: 1.2rem; line-height: 1.3; color: var(--ink); display: block; margin-top: var(--s1); }

/* ── the journal ──────────────────────────────────────────── */
.entries { list-style: none; padding: 0; margin: 0; }
.entry { border-top: 1px solid var(--rule); }
.entry:last-child { border-bottom: 1px solid var(--rule); }
.entry a { display: block; padding: var(--s4) 0; text-decoration: none; transition: opacity var(--dur-fast) var(--ease); }
.entry a:hover { opacity: .72; }
.entry .head { display: flex; justify-content: space-between; gap: var(--s3); align-items: baseline; flex-wrap: wrap; }
.entry .t { font-size: 1.35rem; line-height: 1.25; color: var(--ink); display: block; margin: var(--s1) 0; }
.entry .excerpt { font-style: italic; color: var(--text-body); font-size: 1.05rem; line-height: 1.55; display: block; }
.entry .state { display: inline-flex; align-items: center; gap: var(--s2); }

.empty { text-align: left; padding: var(--s6) 0; }
.empty .monogram { margin: 0 0 var(--s4); }

/* ── skeleton: the shape of the page before the words arrive ── */
.sk { display: block; background: var(--paper-2); height: 1em; margin: 0 0 var(--s2); }
.sk.lg { height: 3.4rem; width: 70%; margin-bottom: var(--s4); }
.sk.md { height: 1.2rem; width: 86%; }
.sk.sm { height: .8rem; width: 40%; }

/* ── the line at the foot: what happened to what you kept ─── */
.notice {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--paper);
  border-top: 1px solid var(--rule);
  padding: var(--s3) calc(var(--safe-r) + var(--s4)) calc(var(--safe-b) + var(--s3)) calc(var(--safe-l) + var(--s4));
  font-family: var(--font-serif); font-style: italic; font-size: 1.02rem; line-height: 1.4; color: var(--ink-soft);
  opacity: 0; transition: opacity var(--dur-base) var(--ease); pointer-events: none; text-align: center;
}
.notice.shown { opacity: 1; }

/* ── the colophon ─────────────────────────────────────────── */
.colophon { border-top: 1px solid var(--rule); margin-top: var(--s6); padding-top: var(--s4); display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.colophon .note { margin: 0; }

.sync-row { display: grid; grid-template-columns: 1fr auto; gap: var(--s3); align-items: end; }
.sync-row input[type="email"] { margin: 0; }

@media print {
  .bar, .notice, .player, .actions, .turn { display: none !important; }
  .plate img { animation: none; }
}

/* A wide photograph shows whole: the frame takes its shape, the title sits beneath on paper. */
.plate.land { height: auto; min-height: 0; background: var(--paper-2); }
.plate.land img { position: relative; inset: auto; height: auto; display: block; object-fit: contain; }
.plate.land .veil { display: none; }
.plate.land .over { position: relative; color: var(--ink); }
.plate.land .over .kicker, .plate.land .over .kicker .sep { color: var(--muted); opacity: 1; }
.plate.land .over h1 { color: var(--ink); }
@media (min-width: 960px) {
  .ex .plate.land { height: 100svh; display: flex; flex-direction: column; justify-content: center; }
  .ex .plate.land img { max-height: 70svh; }
}
