/*
 * styles.css — GOLDENMOUTH experience proof-of-concept.
 * Provenance: original to this cycle; non-canonical; non-commercial.
 * Local only: system fonts, no external assets. Palette per docs/10.
 */

:root {
  --honey: #e8a33d;
  --amber-deep: #c8742a;
  --gold: #f4d27a;
  --gold-deep: #b8860b;
  --sea: #123138;
  --sea-deep: #0a171c;
  --ink: #08161b;
  --salt: #f3ecdd;
  --tarnish: #6e6a4f;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--salt); font-family: var(--sans); --text-scale: 1; }
body { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; overflow: hidden; }

/* 100dvh tracks the *visible* viewport on mobile (dynamic URL bars); 100vh is the
   fallback for older engines. Without dvh, content can sit under the browser chrome. */
.viewport { position: relative; flex: 1; overflow: hidden; height: 100vh; height: 100dvh; }

/* The single unobtrusive control — quiet until the reader reaches for it. */
.menu-btn {
  position: fixed; top: max(0.9rem, env(safe-area-inset-top)); right: max(0.9rem, env(safe-area-inset-right));
  width: 2.6rem; height: 2.6rem; border-radius: 50%; z-index: 30; cursor: pointer;
  background: rgba(8,16,17,0.42); border: 1px solid rgba(243,236,221,0.18);
  backdrop-filter: blur(6px); transition: background .25s, border-color .25s, opacity .4s;
  display: flex; align-items: center; justify-content: center; opacity: 0.62;
}
.menu-btn:hover, .menu-btn:focus-visible { opacity: 1; border-color: var(--gold-deep); background: rgba(8,16,17,0.7); }
.menu-glyph, .menu-glyph::before, .menu-glyph::after {
  content: ""; display: block; width: 4px; height: 4px; border-radius: 50%; background: var(--salt); position: relative;
}
.menu-glyph::before { position: absolute; top: -7px; } .menu-glyph::after { position: absolute; top: 7px; }

.menu-scrim { position: fixed; inset: 0; background: rgba(4,10,11,0.55); z-index: 35; backdrop-filter: blur(2px); }
.menu {
  position: fixed; z-index: 36; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(24rem, 92vw); background: #0c1a1c; border: 1px solid #23302f; border-radius: 18px;
  padding: 1.4rem 1.3rem 1.1rem; box-shadow: 0 30px 80px rgba(0,0,0,0.55);
}
.menu-title { font-family: var(--serif); font-size: 1.15rem; margin: 0 0 1rem; color: var(--gold); letter-spacing: 0.03em; }
.menu-group { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 0.9rem; }
.menu-item {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%;
  font-family: var(--sans); font-size: 0.98rem; color: #ece4d3; text-align: left;
  background: transparent; border: 0; border-radius: 10px; padding: 0.7rem 0.6rem; cursor: pointer;
}
.menu-item:hover, .menu-item:focus-visible { background: #12252624; background: rgba(232,163,61,0.10); outline: none; }
.menu-item:focus-visible { box-shadow: 0 0 0 2px var(--gold); }
.switch { width: 2.2rem; height: 1.2rem; border-radius: 999px; background: #2a3a39; position: relative; transition: background .2s; flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 1rem; height: 1rem; border-radius: 50%; background: var(--salt); transition: transform .2s; }
[role="switch"][aria-checked="true"] .switch { background: var(--honey); }
[role="switch"][aria-checked="true"] .switch::after { transform: translateX(1rem); }
.menu-stepper { cursor: default; }
.stepper { display: flex; gap: 0.3rem; }
.stepper button { font-size: 0.85rem; color: #ece4d3; background: #14262766; border: 1px solid #2a3a39; border-radius: 8px; padding: 0.3rem 0.6rem; cursor: pointer; }
.stepper button:focus-visible { outline: 2px solid var(--gold); }
.menu-note { font-size: 0.74rem; color: #8f978b; line-height: 1.5; margin: 0.4rem 0.2rem 1rem; }
.menu-close {
  width: 100%; font-family: var(--serif); font-size: 0.95rem; color: var(--ink); background: var(--gold);
  border: 0; border-radius: 12px; padding: 0.75rem; cursor: pointer;
}
.menu-close:focus-visible { outline: 3px solid var(--salt); outline-offset: 2px; }
.stage, .fx { position: absolute; inset: 0; }
.fx { pointer-events: none; z-index: 15; }

/* The scene itself does NOT scroll. It stacks two full-viewport layers:
     .art-layer  — the illustration, held still;
     .scroller   — a transparent scroll container ON TOP of it, covering every pixel.
   Because the scroller covers the whole viewport, a wheel or touch drag anywhere —
   including over the artwork — scrolls the text. Because the art is a SIBLING of the
   scroller rather than a child, it cannot scroll away.
   (Do not "pin" the art with position:fixed inside the scroller: an ancestor with
   will-change/transform makes fixed behave as absolute, so it scrolls with content —
   that is exactly the bug this structure replaces.) */
.scene {
  position: absolute; inset: 0;
  display: block;
  will-change: opacity, transform;
}
.art-layer { position: absolute; inset: 0; overflow: hidden; z-index: 0; }
.scroller {
  position: absolute; inset: 0; z-index: 5;
  overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  touch-action: pan-y;              /* never let touch panning be swallowed */
  display: flex; flex-direction: column;
}
.art-layer .art { position: absolute; inset: -4% ; width: 108%; height: 108%; display: block; }
.art-layer [data-depth] { transition: transform 0.5s cubic-bezier(.16,1,.3,1); will-change: transform; }

/* Foreground text plate — a warm scrim that keeps text readable over any art.
   Flows inside .scroller. (Regression guard: tests/layout-guard.test.js.) */
/* The plate flows inside the scrolling scene. `margin-top: auto` bottom-anchors it
   when the scene is short, and collapses to 0 when the content is tall — so nothing
   is ever pushed above the top edge out of reach (the failure mode of centring with
   flex/`align-items: center`). */
.plate {
  position: relative; z-index: 10; width: 100%;
  margin-top: auto;
  background: linear-gradient(to top, #05100fF2 0%, #05100fdd 42%, #05100f88 72%, transparent 100%);
  padding: clamp(1.25rem, 4vh, 2.5rem) clamp(1.15rem, 5vw, 3rem) clamp(1.1rem, 3vh, 1.8rem);
}
.plate-inner { max-width: 40rem; margin: 0 auto; }
/* A quiet but visible scrollbar: the reader must be able to tell there is more. */
.scroller::-webkit-scrollbar { width: 10px; }
.scroller::-webkit-scrollbar-thumb { background: rgba(232,163,61,0.34); border-radius: 999px; }
.scroller::-webkit-scrollbar-track { background: transparent; }
.scroller { scrollbar-width: thin; scrollbar-color: rgba(232,163,61,0.34) transparent; }
.scene-title:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; border-radius: 6px; }
.kicker { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.24em; color: var(--honey); margin: 0 0 0.5rem; }
.scene-title { font-family: var(--serif); font-weight: 600; font-size: calc(clamp(1.5rem, 3.6vw, 2.1rem) * var(--text-scale)); line-height: 1.12; margin: 0 0 0.75rem; }
.scene-text { font-family: var(--serif); font-size: calc(clamp(1.02rem, 2.4vw, 1.16rem) * var(--text-scale)); line-height: 1.7; color: #ece4d3; }
.scene-text p { margin: 0 0 0.7rem; max-width: 34rem; }
.scene-text p:last-child { margin-bottom: 0; }
.art-desc { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } /* SR-only narrative alt */

/* ── Choices ────────────────────────────────────────────────────────────────
   Design basis (docs/03-interface-research-and-polish.md):
   • Film FUI: read instantly, and make the reader feel capable. Nothing decorative.
   • 2026 premium direction: depth from LIGHT, not chrome — refraction, specular
     edges, and tactile response (press sinks, releases with weight).
   The light responds to the pointer (--mx/--my set in reader.js), so a choice feels
   like a lit surface rather than a rectangle. All of it collapses under reduced motion. */
.choices { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1.1rem; max-width: 34rem; }
.choice {
  position: relative; isolation: isolate; overflow: hidden;
  font-family: var(--sans); font-size: clamp(0.95rem, 2.2vw, 1.02rem); line-height: 1.45;
  text-align: left; color: #f6efdf; cursor: pointer;
  padding: 0.8rem 1.05rem; border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255,240,214,0.045), rgba(255,240,214,0) 62%),
    rgba(20,17,11,0.72);
  border: 1px solid rgba(232,163,61,0.20);
  box-shadow:
    inset 0 1px 0 rgba(255,244,222,0.055),          /* specular top edge (glass) */
    0 1px 0 rgba(0,0,0,0.35),
    0 8px 22px -16px rgba(0,0,0,0.85);
  backdrop-filter: blur(3px);
  transition:
    transform .26s cubic-bezier(.2,.9,.25,1),
    border-color .28s ease, box-shadow .28s ease, background-color .28s ease;
}
/* Pointer-tracked warm light: the "refraction" that makes the surface feel real. */
.choice::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: radial-gradient(14rem circle at var(--mx, 50%) var(--my, 50%),
              rgba(232,163,61,0.20), rgba(232,163,61,0.05) 42%, transparent 68%);
  opacity: 0; transition: opacity .3s ease;
}
/* A gold hairline that draws along the leading edge — the "you may act" cue. */
.choice::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; z-index: -1;
  background: linear-gradient(180deg, transparent, var(--honey), transparent);
  transform: scaleY(0); transform-origin: center;
  transition: transform .34s cubic-bezier(.2,.9,.25,1);
}
.choice:hover, .choice:focus-visible {
  border-color: rgba(232,163,61,0.55);
  background-color: rgba(27,22,13,0.86);
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255,244,222,0.10),
    0 1px 0 rgba(0,0,0,0.35),
    0 18px 34px -20px rgba(0,0,0,0.95),
    0 0 0 1px rgba(232,163,61,0.06);
}
.choice:hover::before, .choice:focus-visible::before { opacity: 1; }
.choice:hover::after, .choice:focus-visible::after { transform: scaleY(1); }
/* Tactile press: sinks quickly, returns with weight. */
.choice:active {
  transform: translateY(1px) scale(0.994);
  transition-duration: .07s;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,244,222,0.04);
}
.choice:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* --- FX: gild bloom + continuity token (keep transition) --- */
.bloom {
  position: absolute; left: 58%; top: 46%; width: 40vmax; height: 40vmax; transform: translate(-50%, -50%) scale(0.2);
  border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, #fff2cf 0%, var(--gold) 30%, var(--honey) 55%, transparent 72%);
  transition: transform 860ms cubic-bezier(.16,1,.3,1), opacity 860ms cubic-bezier(.16,1,.3,1); mix-blend-mode: screen;
}
.bloom.on { transform: translate(-50%, -50%) scale(1.4); opacity: 0.75; }
.token {
  position: absolute; left: 58%; top: 46%; width: 3.2rem; height: 3.2rem; transform: translate(-50%, -50%);
  border-radius: 50%; opacity: 0; background: radial-gradient(circle, #fff2cf, var(--honey) 70%, transparent);
  transition: left 820ms cubic-bezier(.16,1,.3,1), top 820ms cubic-bezier(.16,1,.3,1), opacity 820ms ease;
}
.token.on { left: 40%; top: 60%; opacity: 0.9; } /* travels toward the chest-glow of the "keep" scene */

/* Ambient motion (gated by reduced-motion). */
@keyframes breathe { 0%,100% { opacity: 0.72; } 50% { opacity: 1; } }
.glow-breathe { animation: breathe 7s ease-in-out infinite; animation-delay: var(--d, 0s); transform-box: fill-box; transform-origin: center; }
@keyframes drift { 0% { transform: translateY(0); opacity: 0.15; } 50% { opacity: 0.6; } 100% { transform: translateY(-40px); opacity: 0; } }
.mote { animation: drift 9s linear infinite; animation-delay: var(--m, 0s); }
@keyframes sway { 0%,100% { transform: translateX(0); } 50% { transform: translateX(3px); } }
.chain { animation: sway 6s ease-in-out infinite; animation-delay: var(--c, 0s); }

/* Responsive: on wide screens, seat the plate to the left third (cinematic). */
@media (min-width: 900px) {
  /* The scene still scrolls as a whole; the plate becomes a side column inside it.
     `margin: auto 0` centres it vertically when short and collapses to 0 when tall,
     so tall scenes scroll from the top instead of being clipped out of reach. */
  .scroller { flex-direction: row; align-items: flex-start; }
  .plate {
    width: min(54%, 44rem); flex: none;
    margin: auto 0;
    background: linear-gradient(to right, #05100fF7 0%, #05100fe6 60%, #05100f66 88%, transparent 100%);
  }
}

/* Reduced motion: kill all ambient + transition movement; keep meaning via colour/opacity. */
@media (prefers-reduced-motion: reduce) {
  .glow-breathe, .mote, .chain { animation: none !important; }
  .art-layer [data-depth] { transition: none !important; transform: none !important; }
  .bloom, .token { display: none !important; }
  .scene, .choice { transition: opacity 150ms linear !important; }
}
:root.reduce-motion .glow-breathe,
:root.reduce-motion .mote,
:root.reduce-motion .chain { animation: none !important; }
:root.reduce-motion .art-layer [data-depth] { transition: none !important; transform: none !important; }
:root.reduce-motion .bloom, :root.reduce-motion .token { display: none !important; }
:root.reduce-motion .scene, :root.reduce-motion .choice { transition: opacity 150ms linear !important; }

@media (prefers-contrast: more) {
  .plate { background: #04100e; }
  .choice { background: #000; border-color: var(--gold); }
}

/* Higher-contrast reading mode (menu toggle). Raises text-plate opacity and choice contrast
   without adding any new visible element — the story art still leads. */
:root[data-contrast="high"] .plate {
  background: linear-gradient(to top, #020807 0%, #020807 62%, #020807cc 84%, #02080766 100%);
}
:root[data-contrast="high"] .scene-text { color: #fffdf7; }
:root[data-contrast="high"] .choice { background: #000; border-color: var(--gold); color: #fffdf7; }
:root[data-contrast="high"] .menu-btn { opacity: 1; border-color: var(--gold); }
@media (min-width: 900px) {
  :root[data-contrast="high"] .plate { background: linear-gradient(to right, #020807 0%, #020807 64%, #02080788 90%, transparent 100%); }
}

/* ---- Sprint-1 reader additions ---- */

/* Screen-reader-only narrative illustration description. */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Flare: the sacrifice transition (burning the ledger). Warmer, faster, harder. */
.bloom.flare {
  background: radial-gradient(circle, #fffdf5 0%, #ffd489 26%, #e8632b 52%, transparent 74%);
  transition-duration: 900ms;
}
.bloom.flare.on { transform: translate(-50%, -50%) scale(1.9); opacity: 0.9; }

/* Contextual resume card — shown only when a verified save exists. */
.resume-card {
  position: fixed; z-index: 36; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(26rem, 92vw); background: #0c1a1c; border: 1px solid #23302f; border-radius: 18px;
  padding: 1.5rem 1.4rem 1.2rem; box-shadow: 0 30px 80px rgba(0,0,0,0.55);
}
.resume-card h2 { font-family: var(--serif); font-size: 1.2rem; margin: 0 0 0.4rem; color: var(--gold); }
.resume-card p { font-size: 0.9rem; color: #b9b1a0; margin: 0 0 1.1rem; }
.resume-actions { display: flex; flex-direction: column; gap: 0.5rem; }
.menu-item.quiet { justify-content: center; color: #b9b1a0; font-size: 0.9rem; }
.menu-item.quiet:hover { color: var(--salt); }

/* ── Premium surface pass ───────────────────────────────────────────────────
   "Liquid glass": depth from layered light and refraction rather than borders and
   fills. Applied only to the contextual layer (menu, resume, the one control), so
   the reading surface stays calm. See docs/03-interface-research-and-polish.md. */

.menu, .resume-card {
  background:
    linear-gradient(180deg, rgba(255,244,222,0.055), rgba(255,244,222,0) 42%),
    rgba(10,22,24,0.86);
  border: 1px solid rgba(243,236,221,0.10);
  backdrop-filter: blur(26px) saturate(135%);
  -webkit-backdrop-filter: blur(26px) saturate(135%);
  box-shadow:
    inset 0 1px 0 rgba(255,244,222,0.10),
    0 40px 90px -30px rgba(0,0,0,0.85),
    0 2px 10px rgba(0,0,0,0.35);
}

/* Menu items: weighted press, warm wash on hover. */
.menu-item {
  position: relative; border-radius: 11px;
  transition: background-color .22s ease, transform .16s cubic-bezier(.2,.9,.25,1), color .22s ease;
}
.menu-item:hover, .menu-item:focus-visible { background: rgba(232,163,61,0.12); }
.menu-item:active { transform: scale(0.985); transition-duration: .06s; }

.menu-close {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, #f7dc94, var(--gold) 55%, #e0b95c);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.45), 0 8px 20px -12px rgba(232,163,61,0.7);
  transition: transform .18s cubic-bezier(.2,.9,.25,1), box-shadow .22s ease, filter .22s ease;
}
.menu-close:hover { filter: brightness(1.05); box-shadow: inset 0 1px 0 rgba(255,255,255,0.5), 0 12px 26px -12px rgba(232,163,61,0.85); }
.menu-close:active { transform: translateY(1px) scale(0.99); transition-duration: .06s; }

/* The single control: a small piece of refractive glass that warms on approach. */
.menu-btn {
  background:
    linear-gradient(180deg, rgba(255,244,222,0.10), rgba(255,244,222,0) 60%),
    rgba(8,16,17,0.42);
  backdrop-filter: blur(10px) saturate(130%);
  -webkit-backdrop-filter: blur(10px) saturate(130%);
  box-shadow: inset 0 1px 0 rgba(255,244,222,0.14), 0 6px 18px -10px rgba(0,0,0,0.8);
  transition: opacity .35s ease, transform .22s cubic-bezier(.2,.9,.25,1),
              border-color .25s ease, box-shadow .25s ease, background-color .25s ease;
}
.menu-btn:hover, .menu-btn:focus-visible { transform: scale(1.06); }
.menu-btn:active { transform: scale(0.96); transition-duration: .06s; }

/* Stepper buttons: same tactile language, smaller. */
.stepper button {
  transition: transform .16s cubic-bezier(.2,.9,.25,1), border-color .2s ease, background-color .2s ease;
}
.stepper button:hover { border-color: var(--gold-deep); background: rgba(232,163,61,0.14); }
.stepper button:active { transform: scale(0.94); transition-duration: .05s; }

/* Toggle switches: satisfying snap. */
.switch, .switch::after { transition: background-color .24s ease, transform .28s cubic-bezier(.34,1.4,.5,1); }

/* Reduced motion: keep the LIGHT (which carries meaning), drop the MOVEMENT. */
@media (prefers-reduced-motion: reduce) {
  .choice, .menu-item, .menu-close, .menu-btn, .stepper button { transition: background-color .12s linear, border-color .12s linear !important; }
  .choice:hover, .choice:focus-visible, .choice:active,
  .menu-btn:hover, .menu-btn:focus-visible, .menu-btn:active,
  .menu-item:active, .menu-close:active, .stepper button:active { transform: none !important; }
  .choice::after { transition: none !important; }
  .switch, .switch::after { transition: none !important; }
}
:root.reduce-motion .choice, :root.reduce-motion .menu-item,
:root.reduce-motion .menu-close, :root.reduce-motion .menu-btn,
:root.reduce-motion .stepper button { transition: background-color .12s linear, border-color .12s linear !important; }
:root.reduce-motion .choice:hover, :root.reduce-motion .choice:focus-visible,
:root.reduce-motion .choice:active, :root.reduce-motion .menu-btn:hover,
:root.reduce-motion .menu-btn:active, :root.reduce-motion .menu-item:active,
:root.reduce-motion .menu-close:active, :root.reduce-motion .stepper button:active { transform: none !important; }
:root.reduce-motion .choice::after { transition: none !important; }

/* High contrast: strip translucency, keep the tactile press. */
:root[data-contrast="high"] .choice {
  background: #000; border-color: var(--gold); box-shadow: none; backdrop-filter: none;
}
:root[data-contrast="high"] .choice::before { display: none; }
:root[data-contrast="high"] .menu, :root[data-contrast="high"] .resume-card {
  background: #020807; backdrop-filter: none; border-color: var(--gold);
}


/* ── "More below" cue ───────────────────────────────────────────────────────
   The only signal that a scene continues past the fold. Sits on the scene (which
   does not scroll), so it holds the bottom edge; fades away once the reader has
   reached the end. Non-interactive, and it never covers a choice — it sits in the
   plate's own gradient, which is already empty space. */
.more-cue {
  position: absolute; left: 0; right: 0; bottom: 0; height: 4.25rem; z-index: 20;
  pointer-events: none; display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 0.55rem;
  background: linear-gradient(to top, rgba(5,16,15,0.92), rgba(5,16,15,0.45) 45%, transparent);
  opacity: 0; transition: opacity .35s ease;
}
.more-cue.on { opacity: 1; }
.more-cue-mark {
  width: 1.15rem; height: 1.15rem; border-right: 2px solid var(--honey); border-bottom: 2px solid var(--honey);
  transform: rotate(45deg) translateY(-0.18rem); border-radius: 2px; opacity: 0.9;
  animation: cue-drift 2.4s ease-in-out infinite;
}
@keyframes cue-drift {
  0%, 100% { transform: rotate(45deg) translate(0, -0.18rem); opacity: 0.55; }
  50%      { transform: rotate(45deg) translate(0.12rem, -0.06rem); opacity: 1; }
}
@media (min-width: 900px) {
  /* Desktop: the cue belongs under the text column, not the artwork. */
  .more-cue { right: auto; width: min(54%, 44rem); }
}
@media (prefers-reduced-motion: reduce) { .more-cue-mark { animation: none; opacity: 0.95; } }
:root.reduce-motion .more-cue-mark { animation: none; opacity: 0.95; }
:root[data-contrast="high"] .more-cue { background: linear-gradient(to top, #020807, rgba(2,8,7,0.6) 50%, transparent); }

/* ---------------------------------------------------------------------------
   Language-specific typography (SC-S1-04).
   The serif stack is Latin-only; CJK falls back to something arbitrary and ugly
   without this. CJK also has no inter-word spaces, so it needs looser leading to
   stay readable and must break anywhere rather than only at spaces.
   --------------------------------------------------------------------------- */
:lang(zh), :lang(ja), :lang(ko) {
  --font-story: "Songti SC", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif CJK SC",
                "Noto Serif JP", "Noto Serif KR", "Source Han Serif", serif;
  line-height: 1.95;
  letter-spacing: 0.02em;
}
:lang(zh) .plate p, :lang(ja) .plate p, :lang(ko) .plate p {
  line-break: strict;
  overflow-wrap: anywhere;
  text-align: justify;
}
/* Thai has no spaces either, but does have its own line-breaking rules. */
:lang(th) { line-height: 2.0; word-break: break-word; }
/* French wants a thin space before high punctuation; never break before it. */
:lang(fr) .plate p { hyphens: auto; }

/* ---------------------------------------------------------------------------
   The covenant page (reader/covenant.html). Generated from ops/covenant.js.
   Deliberately plain: a promise page that looks like marketing reads like it.
   --------------------------------------------------------------------------- */
.covenant { max-width: 40rem; margin: 0 auto; padding: 3rem 1.25rem 5rem; }
.covenant h1 { font-size: 1.75rem; margin: 0 0 1.5rem; }
.covenant h2 { font-size: 1.25rem; margin: 3rem 0 1rem; }
.covenant .lede { font-size: 1.0625rem; line-height: 1.7; opacity: .9; }
.covenant .lines, .covenant .bounds { list-style: none; padding: 0; margin: 2rem 0 0; }
.covenant .lines > li { padding: 1.125rem 0; border-top: 1px solid currentColor; border-color: color-mix(in srgb, currentColor 18%, transparent); }
.covenant .promise { margin: 0 0 .5rem; font-size: 1.0625rem; line-height: 1.6; }
.covenant .rule { margin: 0; font-size: .8125rem; line-height: 1.55; opacity: .58; }
.covenant .tag { text-transform: uppercase; letter-spacing: .08em; font-size: .6875rem; opacity: .8; margin-right: .375rem; }
.covenant .bounds > li { padding: .5rem 0; line-height: 1.6; }
.covenant .close { margin-top: 2.5rem; line-height: 1.7; }
.covenant .meta { margin-top: 2rem; font-size: .75rem; opacity: .5; }

/* The root landing page. A front door, not a sales page. */
.landing { max-width: 40rem; margin: 0 auto; padding: 3rem 1.25rem 4rem; }
.landing h1 { font-size: 1.75rem; margin: 0 0 1rem; }
.landing .lede { line-height: 1.7; opacity: .88; margin-bottom: 2.5rem; }
.landing .story { margin-bottom: 2.25rem; }
.landing .story h2 { font-size: 1.0625rem; letter-spacing: .04em; text-transform: uppercase;
                     opacity: .62; margin: 0 0 .75rem; }
.landing .story ul { list-style: none; padding: 0; margin: 0; }
.landing .story li { margin: 0 0 .5rem; }
.landing .story a { display: block; padding: .75rem .9rem; border: 1px solid currentColor;
                    border-radius: .5rem; text-decoration: none; color: inherit; line-height: 1.45; }
.landing .story a:hover, .landing .story a:focus-visible { opacity: .78; }
.landing .also { margin-top: 2.5rem; line-height: 1.7; }
.landing .foot { margin-top: 2.5rem; font-size: .8125rem; opacity: .6; }
