/* Otherwrite public landing v3, direction C "one-choice teaser" (owner pick 2026-10-14).
   Ported from design-assets/landing-v3/c-one-choice-teaser.html + shared.css (Lisa).
   Tokens sit between the two live worlds: night = dragon/moon --bg, ember = dragon --gold, paper = dragon --ink.
   Fonts are local-only stacks on purpose: no remote font files, so the page needs no font origin. */
:root {
  color-scheme: dark;
  --ow-night: #11152a;
  --ow-night-deep: #0b0e1e;
  --ow-surface: #1a1f3a;
  --ow-line: #343b63;
  --ow-paper: #fff4de;
  --ow-body: #d9dcea;
  --ow-muted: #b3b8d8;
  --ow-ember: #f2a93b;
  --ow-ember-hi: #ffc266;
  --ow-on-ember: #1c1530;
  --ow-dawn: #f6b38a;
  --ow-moon: #f4d58d;
  --ow-scrim: 17, 21, 42;
  --ow-display: "Mitr", "Noto Sans Thai", Thonburi, "Leelawadee UI", sans-serif;
  --ow-title: "Chonburi", "Mitr", Thonburi, serif;
  --ow-text: "Anuphan", "Noto Sans Thai", Thonburi, "Leelawadee UI", sans-serif;
  --ow-radius: 14px;
  --ow-shell: min(1240px, calc(100% - 48px));
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ow-night);
  color: var(--ow-body);
  font: 400 17px/1.75 var(--ow-text);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--ow-ember); color: var(--ow-on-ember); }
img { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 4px; }
:focus-visible { outline: 3px solid var(--ow-paper); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { color: var(--ow-paper); font-family: var(--ow-display); font-weight: 500; text-wrap: balance; }

.skip { position: absolute; left: 12px; top: -60px; padding: 10px 16px; background: var(--ow-paper); color: var(--ow-on-ember); border-radius: 8px; z-index: 20; }
.skip:focus { top: 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.nowrap { white-space: nowrap; }
.shell { width: var(--ow-shell); margin-inline: auto; }

/* Header: never animated, so the header Login never shifts. */
.site-header { position: relative; z-index: 5; }
.site-header .shell { display: flex; align-items: center; justify-content: space-between; min-height: 76px; gap: 16px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ow-paper); font: 500 21px/1 var(--ow-display); letter-spacing: .01em; text-decoration: none; }
.wordmark svg { width: 30px; height: 30px; flex: none; }
.nav { display: flex; align-items: center; gap: 28px; }
.navlink { color: var(--ow-body); font-size: 15px; text-decoration: none; padding: 10px 0; }
.navlink:hover { color: var(--ow-paper); text-decoration: underline; }
.header-login { white-space: nowrap; }

/* Buttons: colour-only transitions (no transform), so Login buttons never move. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 26px; border-radius: 999px; font: 500 17px/1 var(--ow-display); text-decoration: none; border: 2px solid transparent; transition: background-color .2s ease, border-color .2s ease; }
.btn-primary { background: var(--ow-ember); color: var(--ow-on-ember); }
.btn-primary:is(:hover, :focus-visible) { background: var(--ow-ember-hi); }
.btn-ghost { border-color: rgba(255, 244, 222, .55); color: var(--ow-paper); }
.btn-ghost:is(:hover, :focus-visible) { border-color: var(--ow-paper); background: rgba(255, 244, 222, .08); }
.btn-sm { min-height: 44px; padding: 0 20px; font-size: 15px; }
.access { color: var(--ow-muted); font-size: 15px; line-height: 1.6; }

/* ---- Scene: the first viewport IS a scene; the visitor makes one choice ---- */
.scene { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: min(100svh - 76px, 824px); }
.scene-text { padding: 36px clamp(32px, 5vw, 88px) 48px max(24px, calc((100vw - 1240px) / 2)); display: flex; flex-direction: column; justify-content: center; }
.scene-art { position: relative; margin: 0; overflow: hidden; }
.scene-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 30% 28%; }
.scene-art figcaption { position: absolute; left: 24px; bottom: 22px; padding: 6px 14px; border-radius: 999px; background: rgba(var(--ow-scrim), .82); color: var(--ow-paper); font: 400 14px/1.5 var(--ow-display); }

.scene h1 { font-size: clamp(40px, 4.1vw, 62px); line-height: 1.3; letter-spacing: -.01em; }
.scene h1 span { color: var(--ow-ember); display: block; }
.world-line { color: var(--ow-moon); font: 400 16px/1.5 var(--ow-display); margin-top: 10px; }
.prose { margin: 20px 0 26px; color: var(--ow-paper); font-size: 19px; line-height: 1.9; max-width: 33em; }

fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 12px; color: var(--ow-body); font: 400 16px/1.5 var(--ow-display); }
.choices { display: grid; gap: 10px; max-width: 36em; }
.choice { position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: center; gap: 14px; min-height: 58px; padding: 10px 18px; border: 2px solid var(--ow-line); border-radius: 12px; background: var(--ow-surface); color: var(--ow-paper); font-size: 17px; line-height: 1.5; cursor: pointer; transition: border-color .2s ease, background-color .2s ease; }
.choice:hover { border-color: rgba(255, 244, 222, .55); }
.choice input { appearance: none; -webkit-appearance: none; width: 22px; height: 22px; margin: 0; border: 2px solid var(--ow-muted); border-radius: 50%; display: grid; place-items: center; }
.choice input::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--ow-ember); transform: scale(0); transition: transform .25s cubic-bezier(.16, 1, .3, 1); }
.choice input:checked { border-color: var(--ow-ember); }
.choice input:checked::after { transform: scale(1); }
/* Only hide the native ring where :has() can draw the ring on the label instead. */
@supports selector(:has(*)) {
  .choice input:focus-visible { outline: none; }
}
.choice:has(input:checked) { border-color: var(--ow-ember); background: #242a4a; }
.choice:has(input:focus-visible) { outline: 3px solid var(--ow-paper); outline-offset: 3px; }

/* Sample consequence. Two separate rules on purpose: a selector list containing :has() is dropped whole
   by browsers without :has(), so the data-choice fallback (set by motion.js) must stand alone. */
.outcomes { max-width: 36em; }
.outcome { display: none; margin-top: 18px; padding: 18px 20px; border-radius: 12px; background: rgba(244, 213, 141, .1); border: 1px solid rgba(244, 213, 141, .35); }
.outcome-tag { margin-bottom: 6px; color: var(--ow-muted); font: 400 14px/1.5 var(--ow-display); }
.outcome-text { color: var(--ow-paper); font-size: 17px; line-height: 1.85; }
.outcome-after { margin-top: 8px; color: var(--ow-moon); font: 400 16px/1.5 var(--ow-display); }
.scene:has(input[value="1"]:checked) .outcome[data-outcome="1"],
.scene:has(input[value="2"]:checked) .outcome[data-outcome="2"],
.scene:has(input[value="3"]:checked) .outcome[data-outcome="3"] { display: block; animation: rise .5s cubic-bezier(.16, 1, .3, 1) both; }
.scene[data-choice="1"] .outcome[data-outcome="1"],
.scene[data-choice="2"] .outcome[data-outcome="2"],
.scene[data-choice="3"] .outcome[data-outcome="3"] { display: block; animation: rise .5s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.dock { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 22px; }
.dock .access { max-width: 22em; }

/* ---- After the scene ---- */
.zoom { padding-block: 110px 40px; }
.zoom .shell { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 56px; align-items: start; }
.zoom h2 { font-size: clamp(32px, 3.2vw, 46px); line-height: 1.35; }
.cols { display: grid; gap: 22px; }
.cols p { font-size: 18px; }
.cols strong { color: var(--ow-paper); font-weight: 500; }

/* The sliding card must never make the page scroll sideways (motion rule 4). */
.worlds { padding-block: 80px 40px; overflow-x: hidden; overflow-x: clip; }
.card { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); border-radius: var(--ow-radius); overflow: hidden; background: var(--ow-surface); border: 1px solid var(--ow-line); }
.card figure { margin: 0; min-height: 420px; position: relative; overflow: hidden; }
.card figure img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 40%; }
.copy { padding: 44px 44px 40px; display: flex; flex-direction: column; justify-content: center; }
.copy h2 { font: 400 clamp(34px, 3vw, 46px)/1.35 var(--ow-title); }
.kind { color: var(--ow-dawn); font: 400 16px/1.5 var(--ow-display); margin: 2px 0 16px; }
.prompt { color: var(--ow-paper); font-size: 18px; line-height: 1.85; margin-bottom: 18px; }
.q { color: var(--ow-body); margin-bottom: 22px; }
/* Two world cards: the gap lives on the shell, not on the card. The long off-script title steps down a size. */
.worlds .shell { display: grid; gap: 32px; }
.copy h2.title-long { font-size: clamp(27px, 2.4vw, 34px); line-height: 1.45; }
.textlink { align-self: flex-start; display: inline-flex; align-items: center; min-height: 44px; color: var(--ow-paper); font: 500 17px/1 var(--ow-display); text-decoration: underline; text-decoration-color: var(--ow-dawn); text-decoration-thickness: 2px; }

.start { padding-block: 100px; }
.start h2 { font-size: clamp(30px, 3vw, 40px); margin-bottom: 36px; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; margin: 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; padding-top: 22px; border-top: 1px solid var(--ow-line); }
.steps li::before { content: counter(s); display: block; margin-bottom: 10px; color: var(--ow-ember); font: 500 32px/1 var(--ow-display); }
.steps h3 { font-size: 21px; line-height: 1.4; margin-bottom: 6px; }
.steps p { color: var(--ow-body); font-size: 16px; }

.closer { border-top: 1px solid var(--ow-line); background: var(--ow-night-deep); }
/* minmax(0, 1fr): an implicit auto track grows to the widest nowrap heading and drags the 100%-wide phone button past the shell. */
.closer .shell { padding-block: 80px; text-align: center; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 14px; }
.closer h2 { font-size: clamp(32px, 3.6vw, 52px); line-height: 1.35; }

.site-footer { border-top: 1px solid var(--ow-line); }
.site-footer .shell { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; min-height: 92px; color: var(--ow-muted); font-size: 14px; }
.footer-brand { display: inline-flex; align-items: center; min-height: 44px; color: var(--ow-paper); text-decoration: none; }

/* 404 page */
.not-found-page { min-height: 100svh; display: grid; place-items: center; }
.not-found { width: min(560px, calc(100% - 40px)); display: grid; gap: 16px; padding-block: 48px; }
.not-found h1 { font-size: clamp(32px, 6vw, 44px); line-height: 1.3; }
.eyebrow { color: var(--ow-moon); font: 400 15px/1.5 var(--ow-display); }
.button-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

/* Decorative moon shards over the hero art (aria-hidden). Positions live here, not in style= attributes,
   so the page stays CSP-clean without 'unsafe-inline'. */
.shards { position: absolute; inset: 0; pointer-events: none; }
.shards i { position: absolute; left: var(--x); top: var(--y); width: var(--s); height: var(--s); border-radius: 2px; background: linear-gradient(135deg, #fff4de, var(--ow-moon) 55%, rgba(244, 213, 141, .2)); box-shadow: 0 0 14px rgba(244, 213, 141, .55); opacity: .85; transform: rotate(var(--r)); }
.shards i:nth-child(1) { --x: 14%; --y: 10%; --s: 9px; --r: 20deg; --v: 260; --dx: -12px; }
.shards i:nth-child(2) { --x: 31%; --y: 22%; --s: 6px; --r: 45deg; --v: 420; --dx: 8px; }
.shards i:nth-child(3) { --x: 52%; --y: 7%; --s: 11px; --r: 12deg; --v: 200; --dx: -6px; }
.shards i:nth-child(4) { --x: 68%; --y: 18%; --s: 7px; --r: 60deg; --v: 380; --dx: 14px; }
.shards i:nth-child(5) { --x: 83%; --y: 30%; --s: 5px; --r: 30deg; --v: 520; --dx: -10px; }
.shards i:nth-child(6) { --x: 22%; --y: 40%; --s: 5px; --r: 70deg; --v: 480; --dx: 10px; }
.shards i:nth-child(7) { --x: 60%; --y: 36%; --s: 8px; --r: 5deg; --v: 300; --dx: -14px; }
.shards i:nth-child(8) { --x: 44%; --y: 52%; --s: 4px; --r: 38deg; --v: 560; --dx: 6px; }
.shards i:nth-child(9) { --x: 76%; --y: 48%; --s: 6px; --r: 52deg; --v: 340; --dx: -8px; }

@media (max-width: 760px) {
  :root { --ow-shell: calc(100% - 40px); }
  body { font-size: 16px; }
  .site-header .shell { min-height: 64px; }
  .navlink { display: none; }
  .btn { width: 100%; }
  .btn-sm { width: auto; }
  .scene { grid-template-columns: 1fr; min-height: 0; }
  .scene-art { order: -1; aspect-ratio: 4 / 3; }
  .scene-art img { object-position: 22% 22%; }
  .scene-art figcaption { left: 14px; bottom: 12px; font-size: 13px; }
  .scene-text { padding: 26px 20px 0; }
  .scene h1 { font-size: clamp(32px, 9vw, 38px); }
  .prose { font-size: 17px; margin: 14px 0 22px; }
  .choice { font-size: 16px; }
  /* Sticky Login dock: always reachable while reading the scene on a phone. */
  .dock { position: sticky; bottom: 0; z-index: 4; margin: 20px -20px 0; padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); background: rgba(11, 14, 30, .96); border-top: 1px solid var(--ow-line); }
  .dock .access { font-size: 14px; }
  .zoom { padding-block: 64px 20px; }
  .zoom .shell { grid-template-columns: 1fr; gap: 18px; }
  .worlds { padding-block: 48px 20px; }
  .card { grid-template-columns: 1fr; }
  .card figure { min-height: 0; aspect-ratio: 16 / 10; }
  .copy { padding: 26px 22px 28px; }
  .worlds .shell { gap: 24px; }
  .copy h2.title-long { font-size: clamp(24px, 7vw, 28px); }
  .start { padding-block: 64px; }
  .steps { grid-template-columns: 1fr; gap: 24px; }
  .closer .shell { padding-block: 56px; }
  .site-footer .shell { flex-direction: column; align-items: flex-start; justify-content: center; padding-block: 22px; }
}

/* ---- Scroll motion (ux_review.md "Landing C scroll motion spec", M1-M7) ----
   Transform + opacity only. Path 1: CSS scroll-driven animations, only when motion is allowed and supported.
   Path 2 (no animation-timeline): html.io-motion + motion.js drive the same end states.
   Hero copy, choices, the dock and the header are never animated. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    /* M1 hero art: slow push-in while the first 100vh scrolls away */
    .scene-art img { will-change: transform; animation: art-push linear both; animation-timeline: scroll(root block); animation-range: 0px 100vh; }
    /* M2 shards fall faster than the art (parallax), each at its own speed */
    .shards i { will-change: transform; animation: shard-fall linear both; animation-timeline: scroll(root block); animation-range: 0px 100vh; }
    /* M3 reveals rise + fade as each block enters; every range ends by entry 100% (rule 5) */
    [data-reveal] { animation: reveal-rise linear both; animation-timeline: view(); animation-range: entry 0% entry 100%; }
    /* M4 Apple-style settle */
    [data-reveal="settle"] { animation-name: reveal-settle; }
    /* M5 dragon card slides in from the right */
    [data-reveal="slide"] { animation-name: reveal-slide; }
    /* M7 staggered steps */
    .steps li:nth-child(1) { animation-range: entry 0% entry 80%; }
    .steps li:nth-child(2) { animation-range: entry 10% entry 90%; }
    .steps li:nth-child(3) { animation-range: entry 20% entry 100%; }
    /* M6 dragon art pushes out inside the moving frame */
    .card figure img { animation: card-art linear both; animation-timeline: view(); animation-range: entry 0% exit 0%; }
  }
}
@keyframes art-push { to { transform: scale(1.12) translateY(-3%); } }
@keyframes shard-fall { to { transform: translate3d(var(--dx), calc(var(--v) * 1px), 0) rotate(calc(var(--r) + 140deg)); opacity: .15; } }
@keyframes reveal-rise { from { opacity: 0; transform: translateY(32px); } to { opacity: 1; transform: none; } }
@keyframes reveal-settle { from { opacity: 0; transform: translateY(24px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes reveal-slide { from { opacity: 0; transform: translateX(min(96px, 12vw)); } to { opacity: 1; transform: none; } }
@keyframes card-art { from { transform: scale(1.12); } to { transform: scale(1); } }

/* Path 2 fallback. motion.js adds html.io-motion only when motion is allowed and timelines are missing,
   so without the script every block stays fully visible. */
html.io-motion .scene-art img { transform: scale(calc(1 + .12 * var(--p, 0))) translateY(calc(-3% * var(--p, 0))); }
html.io-motion .shards i { transform: translate3d(calc(var(--dx) * var(--p, 0)), calc(var(--v) * 1px * var(--p, 0)), 0) rotate(calc(var(--r) + 140deg * var(--p, 0))); opacity: calc(.85 - .7 * var(--p, 0)); }
html.io-motion [data-reveal] { opacity: 0; transform: translateY(32px); transition: opacity .8s cubic-bezier(.16, 1, .3, 1), transform .8s cubic-bezier(.16, 1, .3, 1); transition-delay: var(--d, 0s); }
html.io-motion [data-reveal="settle"] { transform: translateY(24px) scale(.92); }
html.io-motion [data-reveal="slide"] { transform: translateX(min(96px, 12vw)); transition-duration: 1s; }
html.io-motion [data-reveal].in { opacity: 1; transform: none; }
html.io-motion .cols p:nth-child(2),
html.io-motion .steps li:nth-child(2) { --d: .12s; }
html.io-motion .steps li:nth-child(3) { --d: .24s; }

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