/* Landing page: the hero details, the story below the fold (a sky that turns from dusk to
   night and back to a sunrise), the sample stack and the questions. Motion lives in
   motion.js (intro, vignettes) and landing.js (scroll, brush kanji, sample stack). */

/* A returning member waits for the session check before any of the landing shows (motion-boot.js). */
.landing-wait #onboarding, .landing-wait #landingTour { visibility: hidden; }

/* ---------- Hero ---------- */

#railWord { overflow: hidden; }
#railWord i { display: inline-block; font-style: normal; }
.rail-pause { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 1px solid #4a4843; border-radius: 50%; color: #8d8b84; background: transparent; cursor: pointer; }
.rail-pause i { width: 8px; height: 10px; border-right: 2px solid currentColor; border-left: 2px solid currentColor; }
.rail-pause[aria-pressed="true"] i { width: 0; height: 0; border-width: 5px 0 5px 8px; border-style: solid; border-color: transparent transparent transparent currentColor; }
.rail-pause:hover, .rail-pause:focus-visible { border-color: var(--paper); color: var(--paper); }
.rail-pause:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* Words stay inline blocks for good, so the brush intro never re-wraps the headline. */
.intro-copy h1 .t-word { display: inline-block; }

.margin-notes { font-size: 13px; }
.margin-notes a { display: inline-flex; gap: 8px; align-items: center; min-height: 32px; color: inherit; text-decoration: none; transition: color .25s; }
.margin-notes a:hover { color: var(--paper); }
.margin-notes a:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.margin-notes li.is-current { color: var(--paper); }
.margin-notes li.is-current b { color: var(--red); }

.tour-link { display: inline-flex; gap: 8px; align-items: center; min-height: 44px; margin: 14px 0 0 8px; padding-bottom: 3px; border-bottom: 1px solid rgba(239, 75, 63, .6); color: var(--paper); font: italic 15px Georgia, serif; text-decoration: none; }
.tour-link span { color: var(--red); }
.tour-link:hover { color: var(--red); }
.tour-link:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

/* The sun: slow rays, a glow that answers the pointer, ripples on every new word. */
.red-sun { isolation: isolate; }
.red-sun::before { content: ''; position: absolute; inset: -22%; z-index: -1; border-radius: 50%; background: repeating-conic-gradient(from 0deg, rgba(239, 75, 63, .24) 0deg 3deg, transparent 3deg 12deg); -webkit-mask: radial-gradient(circle, transparent 50%, #000 53%, #000 62%, transparent 72%); mask: radial-gradient(circle, transparent 50%, #000 53%, #000 62%, transparent 72%); animation: sun-rays 120s linear infinite; pointer-events: none; }
@keyframes sun-rays { to { transform: rotate(360deg); } }
.onboarding.is-offscreen .red-sun::before { animation-play-state: paused; }
.sun-glow { position: absolute; inset: -35%; z-index: -1; border-radius: 50%; background: radial-gradient(circle, rgba(239, 75, 63, .55) 0%, rgba(239, 75, 63, .18) 40%, transparent 68%); opacity: 0; pointer-events: none; }
.sun-ripple { position: absolute; inset: 0; border: 2px solid rgba(239, 75, 63, .55); border-radius: 50%; pointer-events: none; }

/* ---------- The story ---------- */

.landing-tour { position: relative; max-width: 1180px; margin: 0 auto; padding: 0 0 120px; }
.onboarding.hidden + .landing-tour { display: none; }

/* The sky stays put while the chapters scroll over it; landing.js drives it with the scroll.
   It sticks inside a track as tall as the story, so it lets go exactly where the story ends. */
.sky-track { position: absolute; top: 0; bottom: 0; left: calc(50% - 50vw); z-index: 0; width: 100vw; pointer-events: none; }
.story-sky { position: sticky; top: 0; display: block; width: 100%; height: 100vh; height: 100lvh; overflow: hidden; contain: strict; }
.story-sky > * { position: absolute; display: block; }
.sky-wash { inset: 0; }
.sky-dusk { background: radial-gradient(130% 70% at 72% 82%, rgba(239, 75, 63, .30) 0%, rgba(176, 60, 46, .13) 38%, transparent 70%), linear-gradient(to bottom, transparent 0%, rgba(62, 30, 30, .32) 72%, transparent 100%); }
.sky-night { opacity: 0; background: linear-gradient(to bottom, #0b0c12 0%, #10111a 52%, rgba(16, 17, 26, .82) 80%, rgba(16, 17, 26, .55) 100%); }
.sky-dawn { opacity: 0; background: radial-gradient(120% 62% at 50% 94%, rgba(239, 75, 63, .34) 0%, rgba(232, 140, 110, .11) 42%, transparent 72%); }
.sky-stars { inset: 0 0 34% 0; opacity: 0; background-image:
    radial-gradient(1.4px 1.4px at 6% 14%, rgba(242, 238, 223, .9), transparent),
    radial-gradient(1.2px 1.2px at 14% 38%, rgba(242, 238, 223, .7), transparent),
    radial-gradient(1.6px 1.6px at 23% 8%, rgba(242, 238, 223, .9), transparent),
    radial-gradient(1px 1px at 31% 27%, rgba(242, 238, 223, .6), transparent),
    radial-gradient(1.3px 1.3px at 39% 52%, rgba(242, 238, 223, .7), transparent),
    radial-gradient(1.5px 1.5px at 47% 17%, rgba(242, 238, 223, .85), transparent),
    radial-gradient(1px 1px at 55% 41%, rgba(242, 238, 223, .6), transparent),
    radial-gradient(1.3px 1.3px at 63% 6%, rgba(242, 238, 223, .8), transparent),
    radial-gradient(1.2px 1.2px at 71% 31%, rgba(242, 238, 223, .7), transparent),
    radial-gradient(1.6px 1.6px at 80% 12%, rgba(242, 238, 223, .9), transparent),
    radial-gradient(1px 1px at 88% 46%, rgba(242, 238, 223, .6), transparent),
    radial-gradient(1.4px 1.4px at 95% 22%, rgba(242, 238, 223, .8), transparent); }
.sky-stars::after { content: ''; position: absolute; inset: 0; background-image:
    radial-gradient(1.8px 1.8px at 10% 24%, rgba(242, 238, 223, .95), transparent),
    radial-gradient(1.6px 1.6px at 35% 11%, rgba(242, 238, 223, .9), transparent),
    radial-gradient(1.8px 1.8px at 58% 30%, rgba(242, 238, 223, .95), transparent),
    radial-gradient(1.5px 1.5px at 76% 5%, rgba(242, 238, 223, .9), transparent),
    radial-gradient(1.7px 1.7px at 91% 36%, rgba(242, 238, 223, .95), transparent);
    animation: sky-twinkle 3.4s ease-in-out infinite alternate; }
@keyframes sky-twinkle { from { opacity: .2; } to { opacity: 1; } }
.sky-moon { top: 13%; left: 11%; width: 46px; height: 46px; border-radius: 50%; opacity: 0; box-shadow: inset 11px -5px 0 0 rgba(242, 238, 223, .78); }
.sky-moon::after { content: ''; position: absolute; inset: -70%; border-radius: 50%; background: radial-gradient(circle, rgba(242, 238, 223, .1), transparent 62%); }
.sky-sun { top: 58%; right: 8%; width: clamp(140px, 22vw, 270px); aspect-ratio: 1; border-radius: 50%; background: var(--red); box-shadow: 0 0 90px rgba(239, 75, 63, .32); }
.sky-ridge { left: 0; bottom: -13vh; width: 100%; height: 55vh; }
.ridge-far path { fill: rgba(242, 238, 223, .05); }
.ridge-mid path { fill: #121216; }
.ridge-mid .ridge-snow { fill: rgba(242, 238, 223, .14); }
.ridge-near path { fill: url(#ridgeNearFill); }
.landing-tour:not(.is-live) .sky-stars::after { animation-play-state: paused; }

/* Chapters: a brush kanji in the margin, the text beside it. */
.story-chapter { position: relative; z-index: 1; display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: clamp(28px, 4vw, 64px); padding-top: clamp(100px, 15vh, 160px); }
.chapter-mark { position: relative; align-self: start; justify-self: center; display: grid; justify-items: center; gap: 16px; }
.chapter-kanji { display: block; color: var(--paper); font: 400 112px/1.05 "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif CJK JP", "Noto Serif JP", "MS Mincho", serif; letter-spacing: .04em; writing-mode: vertical-rl; text-shadow: 3px 3px 0 rgba(239, 75, 63, .6); }
.chapter-kanji.is-brushed { line-height: 0; writing-mode: horizontal-tb; text-shadow: none; }
.chapter-kanji svg { display: block; width: 112px; height: auto; overflow: visible; }
.brush-line text { fill: none; stroke: var(--red); stroke-width: 1.4; stroke-linejoin: round; }
.brush-ink text { fill: currentColor; }
.chapter-seal { display: grid; place-items: center; width: 38px; height: 38px; color: var(--paper); background: var(--red); box-shadow: 3px 3px 0 #080808; font: 400 20px/1 "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif CJK JP", "MS Mincho", serif; transform: rotate(-4deg); }
.chapter-body { min-width: 0; }
.chapter-label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin: 0 0 18px; color: var(--red); font-size: 11px; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; }
.chapter-label small { color: #8d8b84; font-size: 10px; letter-spacing: .24em; }
.story-chapter h2, .story-end h2 { max-width: 820px; margin: 0; color: var(--paper); font: 400 clamp(38px, 5vw, 64px)/1.02 Georgia, "Times New Roman", serif; letter-spacing: -.045em; }
/* Chapter links move focus to the heading (tabindex -1) only so screen readers continue from there. */
.story-chapter h2[tabindex="-1"]:focus { outline: none; }
.chapter-lead { max-width: 640px; margin: 20px 0 0; color: #bdb9ae; font: 17px/1.7 Georgia, serif; }
/* Japanese headings wrap between phrases, not inside a word (where the browser knows how; elsewhere as before). */
.landing-tour :is(h2, h3, h4, summary):lang(ja) { word-break: auto-phrase; }
/* Text that sits straight on the sky gets a faint night halo, so it stays legible when it crosses the sun. */
.story-chapter h2, .chapter-label, .chapter-lead, .story-ledger, .night-steps, .story-points, .promise-list, .faq, .helpers-title { text-shadow: 0 0 14px rgba(14, 14, 17, .8); }
.chapter-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 64px); align-items: start; margin-top: 40px; }
.try-split { align-items: center; margin-top: 0; }

.story-ledger { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 980px; margin: 44px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.story-ledger li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; padding: 22px 22px 6px 0; }
.story-ledger li + li { padding-left: 22px; border-left: 1px solid var(--line); }
.story-ledger span { color: var(--red); font: 400 30px/1 "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif CJK JP", "MS Mincho", serif; }
.story-ledger b { display: block; color: var(--paper); font: 400 20px/1.25 Georgia, serif; }
.story-ledger p { margin: 6px 0 0; color: #a9a59b; font: 15px/1.55 Arial, sans-serif; }

/* Mood: a sample mood note whose kanji changes meaning with the preset. */
.mood-demo { position: relative; padding: 26px 26px 24px; }
.mood-demo-top { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 18px; align-items: center; margin: 18px 0 16px; }
.mood-demo .chapter-kanji { color: var(--ink); font-size: 84px; writing-mode: horizontal-tb; text-shadow: 2px 2px 0 rgba(239, 75, 63, .6); }
.mood-demo .chapter-kanji svg { width: 84px; }
.mood-demo .chapter-kanji.is-brushed { text-shadow: none; }
.mood-demo-reading { margin: 0; color: var(--red); font-size: 11px; font-weight: 800; letter-spacing: .2em; }
.mood-demo-line { margin: 8px 0 0; color: var(--ink); font: italic 20px/1.35 Georgia, serif; }
.mood-demo-presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.mood-demo-presets button { min-height: 44px; padding: 0 15px; border: 1px solid #aaa697; border-radius: 22px; color: var(--ink); background: rgba(255, 255, 255, .22); font: italic 15px/1 Georgia, serif; cursor: pointer; transition: background-color .2s, border-color .2s, color .2s; }
.mood-demo-presets button:hover { border-color: var(--red); }
.mood-demo-presets button[aria-pressed="true"] { border-color: var(--red); color: var(--paper); background: var(--red); }
.mood-demo-presets button:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.mood-demo-dials { display: grid; gap: 12px; }
.mood-dial { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 2px 8px; align-items: end; color: #77736a; font: 12px/1.3 Arial, sans-serif; }
.mood-dial b { color: var(--ink); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.mood-dial span:last-of-type { text-align: right; }
.mood-dial i { position: relative; grid-column: 1 / -1; height: 2px; margin: 9px 8px 6px; background: rgba(18, 18, 18, .25); }
.mood-dial em { position: absolute; top: -7px; left: 0; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(239, 75, 63, .18); }
.mood-dial[data-dial="energy"] em { left: 22.5%; }
.mood-dial[data-dial="warmth"] em { left: 87.5%; }
.mood-dial[data-dial="commitment"] em { left: 40%; }
.mood-dial[data-dial="discovery"] em { left: 25%; }

/* A night with AniMood: four stations on a thread that fills in as you scroll. */
.night-steps { position: relative; display: grid; gap: 28px; margin: 0; padding: 0; list-style: none; }
.night-steps::before { content: ''; position: absolute; top: 22px; bottom: 22px; left: 21px; width: 1px; background: var(--line); }
/* The red thread is drawn by landing.js through --thread (0 to 1). */
.night-steps::after { content: ''; position: absolute; top: 22px; bottom: 22px; left: 20px; width: 3px; background: var(--red); transform: scaleY(var(--thread, 0)); transform-origin: 50% 0; }
.night-steps li { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 18px; }
.night-mark { position: relative; z-index: 1; display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--red); border-radius: 50%; color: var(--paper); background: #151518; font: 400 20px/1 "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif CJK JP", "MS Mincho", serif; transition: background-color .3s, color .3s; }
.night-steps li.is-lit .night-mark { background: var(--red); }
.night-steps h3 { margin: 8px 0 6px; color: var(--paper); font: 400 22px/1.2 Georgia, serif; }
.night-steps p { margin: 0; color: #a9a59b; font: 15px/1.6 Arial, sans-serif; }

/* The sample stack. Cards reuse the hanko stamps from motion.css. */
/* One column as wide as the deck: the end sheet's own width must never widen it past the screen. */
.try-deck { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; }
.try-stage { position: relative; width: min(100%, 340px); aspect-ratio: 5 / 7; outline: none; touch-action: pan-y pinch-zoom; }
.try-stage:focus-visible { outline: 2px solid var(--red); outline-offset: 12px; }
.try-placeholder { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 16px; padding: 24px; border: 1px dashed rgba(242, 238, 223, .3); color: #a9a59b; text-align: center; font: italic 16px/1.5 Georgia, serif; }
.try-placeholder p { margin: 0; }
.try-placeholder > span { display: grid; place-items: center; width: 76px; height: 76px; border: 1px solid var(--red); border-radius: 50%; color: var(--red); font: 400 33px "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif CJK JP", "MS Mincho", serif; }
.try-card { position: absolute; inset: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; overflow: hidden; color: var(--ink); background: var(--paper); box-shadow: 9px 9px 0 #080808; cursor: grab; user-select: none; -webkit-user-select: none; touch-action: pan-y pinch-zoom; transform-origin: 50% 110%; }
.try-card.is-behind { pointer-events: none; opacity: .55; transform: translate(12px, 12px) rotate(1.2deg); }
.try-card.is-dragging { cursor: grabbing; }
.try-cover { position: relative; min-height: 0; overflow: hidden; background-color: var(--paper-deep); }
.try-cover img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.try-copy { position: relative; padding: 15px 18px 17px; border-top: 1px solid #aaa697; background: var(--paper); }
.try-meta { margin: 0 0 6px; color: var(--red); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.try-copy h3 { display: -webkit-box; margin: 0; overflow: hidden; color: var(--ink); font: 400 24px/1.08 Georgia, serif; letter-spacing: -.03em; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.try-alt { margin: 4px 0 0; overflow: hidden; color: #6d685e; font: italic 14px/1.3 Georgia, serif; white-space: nowrap; text-overflow: ellipsis; }
.try-reasons { display: flex; flex-wrap: wrap; margin: 9px 0 0; color: #57534c; font: 13px/1.45 Arial, sans-serif; }
.try-reasons span:not(:last-child)::after { content: '/'; margin: 0 6px; color: var(--red); }
.try-count { position: absolute; top: 12px; left: 12px; z-index: 2; padding: 5px 8px; color: var(--paper); background: rgba(18, 18, 18, .8); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
/* The sample's Pass · Save · Tonight is the deck's own bar (decision.css), on a dark backing over the sky. */
.try-actions { width: min(100%, 340px); margin-top: 24px; background: rgba(18, 18, 18, .6); }
.try-action:disabled { cursor: default; }
.try-hint { margin: 14px 0 0; color: #8d8b84; font-size: 12px; text-align: center; }
.try-hint kbd { padding: 1px 5px; border: 1px solid #4a4843; border-radius: 3px; font: 11px Arial, sans-serif; }
/* The closing sheet sits in the flow, so the stage grows with it instead of cutting it off. */
.try-end { position: relative; min-height: 100%; display: grid; align-content: center; gap: 12px; padding: 26px 22px; color: var(--ink); background-color: var(--paper); background-image: repeating-linear-gradient(0deg, transparent 0 27px, rgba(18, 18, 18, .055) 28px); box-shadow: 9px 9px 0 #080808; }
.try-end-mark { display: grid; place-items: center; width: 52px; height: 52px; color: var(--paper); background: var(--red); box-shadow: 4px 4px 0 rgba(18, 18, 18, .25); font: 400 30px/1 "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif CJK JP", "MS Mincho", serif; transform: rotate(-4deg); }
.try-end h3 { margin: 4px 0 0; color: var(--ink); font: 400 27px/1.08 Georgia, serif; letter-spacing: -.03em; }
.try-end p { margin: 0; color: #57534c; font: 15px/1.55 Georgia, serif; }
.try-end-picks { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font: 14px/1.4 Arial, sans-serif; }
.try-end-picks li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.try-end-picks .decision-chip { min-width: 98px; }
.try-end-picks a { color: var(--ink); text-underline-offset: 3px; }
.try-end .try-end-more { margin: 0; padding-top: 10px; border-top: 1px solid rgba(18, 18, 18, .14); color: #6d685e; font: italic 13px/1.5 Georgia, serif; }
.try-end-actions { display: grid; gap: 8px; margin-top: 6px; }
.try-end-actions .primary { display: grid; place-items: center; min-height: 52px; padding: 0 16px; color: var(--paper); background: var(--ink); font-size: 12px; text-decoration: none; }
.try-end-actions .primary:hover { background: var(--red); }
.try-end-actions button { min-height: 44px; border: 1px solid #8a8374; color: var(--ink); background: transparent; font: 14px/1.2 Arial, sans-serif; cursor: pointer; }
.try-end-actions button:hover { border-color: var(--red); color: var(--red); }
.try-end a:focus-visible, .try-end button:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.try-end:focus { outline: none; }
.try-end:focus-visible { outline: 2px solid var(--red); outline-offset: 6px; }

/* Picky helpers and the other paper vignettes. */
.helpers-title { margin: 76px 0 22px; color: var(--paper); font: 400 clamp(26px, 3vw, 36px)/1.12 Georgia, serif; letter-spacing: -.03em; }
/* Three helpers side by side where they fit (each vignette needs about 270 px), stacked on phones. */
.helper-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 26px; }
.tour-step { display: grid; grid-template-rows: 190px auto; overflow: hidden; }
.tour-visual { position: relative; overflow: hidden; border-bottom: 1px solid #aaa697; background: rgba(18, 18, 18, .035); }
.tour-copy { padding: 22px 26px 26px; color: var(--ink); }
.tour-number { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.tour-number span { color: var(--red); font: 400 30px/1 "Yu Mincho", "MS Mincho", serif; }
.tour-number b { color: #8b877d; font: 400 13px/1 Arial, sans-serif; font-weight: 800; letter-spacing: .16em; }
.tour-copy h3, .tour-copy h4 { margin: 12px 0 8px; color: var(--ink); font: 400 26px/1.12 Georgia, serif; letter-spacing: -.03em; }
.tour-copy p { margin: 0; color: #57534c; font: 16px/1.6 Arial, sans-serif; }

/* Vignettes. Without JavaScript or with reduced motion they rest in a readable final state. */
.tv-history { display: grid; align-content: center; gap: 12px; padding: 0 42% 0 28px; }
.tv-row { display: flex; align-items: center; gap: 10px; }
.tv-row em { flex: none; width: 26px; height: 36px; background: #c8bfa8; box-shadow: 2px 2px 0 rgba(18, 18, 18, .2); }
.tv-row:nth-child(2) em { background: var(--red); }
.tv-row:nth-child(3) em { background: #6d685e; }
.tv-row span { flex: 1; height: 6px; border-radius: 3px; background: rgba(18, 18, 18, .18); }
.tv-spine { position: absolute; top: 50%; right: 12%; width: 92px; height: 120px; margin-top: -60px; display: grid; place-items: center; color: var(--paper); background: var(--ink); box-shadow: 6px 6px 0 rgba(18, 18, 18, .25); font: 400 44px/1 "Yu Mincho", "MS Mincho", serif; }

.tv-duel-card { position: absolute; top: 50%; width: 84px; height: 116px; margin-top: -58px; display: grid; border: 1px solid #aaa697; background: var(--paper); box-shadow: 5px 5px 0 rgba(18, 18, 18, .22); }
.tv-duel-card:first-child { left: calc(50% - 112px); z-index: 2; transform: rotate(-3deg); }
.tv-duel-card:last-child { left: calc(50% + 28px); transform: rotate(3deg); }
.tv-duel-card em { margin: 6px; background: linear-gradient(160deg, #ef4b3f, #7b2a3e); }
.tv-duel-card:last-child em { background: linear-gradient(160deg, #3e5a7b, #121212); }
.tv-duel-or { position: absolute; top: 50%; left: 50%; width: 40px; margin: -12px 0 0 -20px; color: #6d685e; font: italic 400 20px/24px Georgia, serif; text-align: center; }
.tv-duel-stamp { position: absolute; top: 16px; left: 50%; margin-left: -22px; width: 44px; padding: 4px 0; border: 2px solid var(--red); border-radius: 4px; color: var(--red); background: rgba(242, 238, 223, .94); font: 400 22px/1 "Yu Mincho", "MS Mincho", serif; text-align: center; transform: rotate(-8deg); }

.tv-pile { position: absolute; bottom: 16px; width: 78px; height: 50px; display: grid; place-items: end center; padding-bottom: 6px; border: 1px dashed #8a8374; color: #57534c; font: italic 13px/1 Georgia, serif; }
.tv-pile b { font-weight: 400; }
.tv-pile.go { left: calc(50% - 131px); }
.tv-pile.keep { left: calc(50% - 39px); }
.tv-pile.done { left: calc(50% + 53px); }
.tv-tidy-card { position: absolute; top: 16px; left: calc(50% - 34px); width: 68px; height: 94px; display: grid; border: 1px solid #aaa697; background: var(--paper); box-shadow: 4px 4px 0 rgba(18, 18, 18, .22); }
.tv-tidy-card em { margin: 5px; background: linear-gradient(160deg, #c8a24a, #6d685e); }

/* Help me choose: one question about time, one answer picked, then a single title from the shelf. */
.tv-choose { display: flex; align-items: center; justify-content: center; gap: 30px; }
.tv-choose-options { display: grid; gap: 8px; }
.tv-choose-options span { min-width: 118px; padding: 7px 12px; border: 1px dashed #8a8374; color: #57534c; font: italic 13px/1.2 Georgia, serif; text-align: center; }
.tv-choose-options .is-picked { border: 1px solid var(--red); color: var(--paper); background: var(--red); box-shadow: 3px 3px 0 rgba(18, 18, 18, .2); }
.tv-choose-card { position: relative; flex: none; width: 74px; height: 102px; display: grid; border: 1px solid #aaa697; background: var(--paper); box-shadow: 5px 5px 0 rgba(18, 18, 18, .22); transform: rotate(3deg); }
.tv-choose-card em { margin: 6px; background: linear-gradient(160deg, #3e5a7b, #121212); }

.tv-match { display: grid; place-items: center; }
.tv-match svg { position: absolute; top: 50%; left: 50%; width: 220px; height: 66px; margin: -33px 0 0 -110px; overflow: visible; }
.tv-match path { fill: none; stroke: var(--red); stroke-width: 2.5; stroke-linecap: round; }
.tv-seal { position: absolute; top: 50%; width: 52px; height: 52px; margin-top: -26px; display: grid; place-items: center; border: 2px solid var(--red); border-radius: 50%; color: var(--ink); background: var(--paper); box-shadow: 3px 3px 0 rgba(18, 18, 18, .25); font: 400 22px/1 Georgia, serif; }
.tv-seal:first-child { left: calc(50% - 105px); }
.tv-match .tv-seal:nth-of-type(2) { left: calc(50% + 53px); }
.tv-chip { position: absolute; bottom: 22px; left: 50%; translate: -50% 0; padding: 5px 10px; border: 1px solid #aaa697; color: var(--ink); background: var(--paper); font: 12px/1.3 Arial, sans-serif; white-space: nowrap; }

/* Notebook: the taste map names the pattern. */
.taste-sheet { grid-template-rows: 150px auto; }
.tour-copy .taste-title { min-height: 2.3em; margin: 14px 0 18px; color: var(--ink); font: italic 400 30px/1.15 Georgia, serif; letter-spacing: -.02em; }
.taste-title span { display: inline-block; }
.taste-bars { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.taste-bars li { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; align-items: center; color: #57534c; font: 13px/1.3 Arial, sans-serif; }
.taste-bars i { position: relative; display: block; height: 10px; overflow: hidden; background: #d7d0bb; }
.taste-bars i b { position: absolute; inset: 0; background: var(--red); transform-origin: 0 50%; }
.taste-bars li:nth-child(2) i b { transform: scaleX(.78); }
.taste-bars li:nth-child(3) i b { transform: scaleX(.56); }
.taste-bars li:nth-child(4) i b { transform: scaleX(.38); }
.tour-copy .taste-note { margin: 16px 0 0; color: #77736a; font: italic 13px/1.5 Georgia, serif; }

/* Wrapped: a sample isekai status window in the colours of the real one (wrapped-anime.css, .wr-status). */
.ls-status { --st-edge: rgba(160, 196, 255, .58); --st-soft: #c9d8f2; --st-gold: #e8c46a; position: relative; align-self: center; padding: 22px 26px 20px; border: 1px solid var(--st-edge); border-radius: 10px; color: #f2f5fb; background: linear-gradient(180deg, #1a2442, #0e1428); box-shadow: inset 0 0 0 4px #0e1428, inset 0 0 0 5px rgba(160, 196, 255, .2), 9px 9px 0 #080808; }
.ls-status::before, .ls-status::after { content: ''; position: absolute; width: 18px; height: 18px; border: 3px solid var(--st-gold); pointer-events: none; }
.ls-status::before { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
.ls-status::after { right: -2px; bottom: -2px; border-left: 0; border-top: 0; border-bottom-right-radius: 8px; }
.ls-status .section-label { padding-bottom: 12px; border-bottom: 1px solid rgba(160, 196, 255, .35); color: #f2f5fb; letter-spacing: .3em; }
.ls-status .section-label b { color: var(--st-gold); letter-spacing: .16em; }
.ls-status-id { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 14px; margin: 16px 0 6px; }
.ls-status-level { display: flex; align-items: baseline; gap: 8px; margin: 0; }
.ls-status-level small { color: var(--st-soft); font: italic 400 22px/1 Georgia, serif; }
.ls-status-level b { font: italic 400 72px/.9 Georgia, serif; letter-spacing: -.04em; }
.ls-status-seal { grid-row: span 2; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 6px; color: var(--paper); background: var(--red); box-shadow: 4px 4px 0 rgba(0, 0, 0, .35); font: 400 34px/1 "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif CJK JP", "MS Mincho", serif; transform: rotate(-6deg); }
.ls-status-class { display: grid; grid-template-columns: 5.6em minmax(0, 1fr); gap: 8px; align-items: baseline; margin: 10px 0 0; }
.ls-status-class small { color: var(--st-soft); font: 800 10px/1.3 Arial, sans-serif; letter-spacing: .16em; text-transform: uppercase; }
.ls-status-class span { overflow: hidden; font: 400 20px/1.25 Georgia, serif; text-overflow: ellipsis; white-space: nowrap; }
.ls-status-stats { display: grid; gap: 11px; margin: 16px 0 0; padding: 16px 0 0; border-top: 1px solid rgba(160, 196, 255, .22); list-style: none; }
.ls-status-stats li { display: grid; grid-template-columns: 7em minmax(0, 1fr) 2.4em; gap: 10px; align-items: center; }
.ls-status-stats span { overflow: hidden; font: 400 16px/1.2 Georgia, serif; text-overflow: ellipsis; white-space: nowrap; }
.ls-status-stats i { position: relative; display: block; height: 8px; overflow: hidden; border-radius: 4px; background: rgba(160, 196, 255, .16); }
.ls-status-stats b { position: absolute; inset: 0; border-radius: 4px; background: linear-gradient(90deg, #5f97f0, #d4e5ff); transform-origin: 0 50%; }
.ls-status-stats li:nth-child(2) b { transform: scaleX(.72); }
.ls-status-stats li:nth-child(3) b { transform: scaleX(.64); }
.ls-status-stats li:nth-child(4) b { transform: scaleX(.49); }
.ls-status-stats em { text-align: right; font: italic 400 18px/1 Georgia, serif; }
.ls-status-note { margin: 18px 0 0; color: var(--st-soft); font: italic 13px/1.5 Georgia, serif; }

.story-points { display: grid; gap: 22px; margin: 34px 0 0; padding: 0; list-style: none; }
.story-points li { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 16px; }
.story-points li > span { display: grid; place-items: center; width: 48px; height: 48px; color: var(--paper); background: #262628; box-shadow: 4px 4px 0 #080808; font: 400 24px/1 "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif CJK JP", "MS Mincho", serif; }
.match-intents li > span { background: var(--red); }
.story-points h3 { margin: 2px 0 6px; color: var(--paper); font: 400 21px/1.2 Georgia, serif; }
.story-points p { margin: 0; color: #a9a59b; font: 15px/1.6 Arial, sans-serif; }

/* House rules. */
.promise-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; max-width: 980px; margin: 36px 0 0; padding: 0; list-style: none; }
.promise-list li { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 14px; align-items: start; padding: 20px 0; border-top: 1px solid var(--line); }
.promise-list span { color: var(--red); font: 400 28px/1 "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif CJK JP", "MS Mincho", serif; }
.promise-list p { margin: 0; color: #d6d2c6; font: 17px/1.5 Georgia, serif; }
.promise-links { display: flex; flex-wrap: wrap; gap: 4px 26px; margin: 18px 0 0; }
.promise-links a, .faq-answer a { color: var(--paper); text-decoration: underline; text-decoration-color: rgba(239, 75, 63, .75); text-underline-offset: 4px; }
.promise-links a { display: inline-flex; align-items: center; min-height: 44px; font: italic 16px Georgia, serif; }
.promise-links a:hover, .faq-answer a:hover { color: var(--red); }
.promise-links a:focus-visible, .faq-answer a:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

/* Questions: native disclosure widgets, so keyboards and screen readers just work. */
.faq { max-width: 820px; margin: 34px 0 0; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { position: relative; display: block; min-height: 64px; padding: 19px 56px 19px 0; color: var(--paper); font: 400 21px/1.3 Georgia, serif; list-style: none; cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before, .faq summary::after { content: ''; position: absolute; top: 50%; right: 14px; width: 18px; height: 2px; margin-top: -1px; background: var(--red); transition: transform .3s ease; }
.faq summary::after { transform: rotate(90deg); }
.faq details[open] > summary::after { transform: rotate(0deg); }
.faq summary:hover { color: #fff; }
.faq summary:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }
.faq-answer { padding: 0 56px 24px 0; }
.faq-answer p { margin: 0; color: #bdb9ae; font: 16px/1.7 Georgia, serif; }

/* The end: the sun comes up again behind the last call. */
.story-end { position: relative; z-index: 1; display: grid; justify-items: center; margin-top: 150px; text-align: center; }
.dawn { position: relative; width: min(78vw, 440px); aspect-ratio: 2 / 1; margin-bottom: 32px; overflow: hidden; border-bottom: 1px solid rgba(242, 238, 223, .45); }
.dawn-sun { position: absolute; top: 0; left: 0; width: 100%; aspect-ratio: 1; display: grid; justify-items: center; border-radius: 50%; background: var(--red); }
/* The glow lives outside the clipped horizon box, so it has no hard edges. */
.story-end::before { content: ''; position: absolute; top: 0; left: 50%; z-index: -1; width: min(100%, 820px); aspect-ratio: 2 / 1; translate: -50% 0; background: radial-gradient(50% 62% at 50% 62%, rgba(239, 75, 63, .22), transparent 72%); pointer-events: none; }
.dawn-sun span { margin-top: 15%; color: rgba(18, 18, 18, .3); font: 400 clamp(52px, 12vw, 92px)/1 "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif CJK JP", "MS Mincho", serif; letter-spacing: .06em; }
.story-end .chapter-label { justify-content: center; margin: 0 0 14px; }
.story-end > p:not(.chapter-label) { max-width: 520px; margin: 18px auto 0; color: #bdb9ae; font: italic 17px/1.6 Georgia, serif; }
.story-end-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 24px; margin-top: 30px; }
.story-end .primary { display: inline-flex; align-items: center; justify-content: center; min-height: 56px; padding: 0 34px; color: var(--ink); background: var(--paper); font-size: 12px; text-decoration: none; }
.story-end .primary:hover { color: var(--paper); background: var(--red); }
.story-end .primary:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.story-end-login { display: inline-flex; align-items: center; min-height: 44px; color: var(--paper); font: italic 16px Georgia, serif; text-decoration: underline; text-decoration-color: rgba(239, 75, 63, .75); text-underline-offset: 4px; }
.story-end-login:hover { color: var(--red); }
.story-end-login:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

@media (max-width: 1100px) {
    .story-chapter { grid-template-columns: 112px minmax(0, 1fr); }
    .chapter-kanji { font-size: 92px; }
    .chapter-kanji svg { width: 92px; }
}

/* Tablets: one column inside each chapter, so the sample stack and the mood note keep their size. */
@media (max-width: 1000px) {
    .chapter-split { grid-template-columns: minmax(0, 1fr); }
    .try-split .try-deck { justify-self: start; width: min(100%, 340px); }
}

@media (max-width: 760px) {
    .margin-notes { font-size: 15px; }
    .margin-notes a { min-height: 44px; }
    .tour-link { order: 6; margin: 0 0 36px; justify-self: start; }
    .landing-tour { padding-bottom: 76px; }
    .sky-sun { top: 63%; right: 4%; width: 132px; }
    .sky-moon { top: 4%; right: 7%; left: auto; width: 30px; height: 30px; box-shadow: inset 7px -3px 0 0 rgba(242, 238, 223, .78); }
    .story-chapter { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 88px; }
    .chapter-mark { justify-self: start; grid-auto-flow: column; align-items: end; gap: 12px; margin-bottom: 22px; }
    .chapter-kanji { font-size: 76px; }
    .chapter-kanji svg { width: 76px; }
    .chapter-seal { width: 32px; height: 32px; font-size: 17px; }
    .story-chapter h2, .story-end h2 { font-size: clamp(34px, 10.5vw, 46px); }
    .chapter-lead { font-size: 16px; }
    .story-ledger { grid-template-columns: minmax(0, 1fr); margin-top: 34px; }
    .story-ledger li { padding: 18px 0 4px; }
    .story-ledger li + li { padding-left: 0; border-top: 1px solid var(--line); border-left: 0; }
    .chapter-split { grid-template-columns: minmax(0, 1fr); gap: 36px; margin-top: 30px; }
    .try-split { gap: 28px; }
    .mood-demo { padding: 22px 18px 20px; }
    .mood-demo-top { grid-template-columns: 70px minmax(0, 1fr); gap: 14px; }
    .mood-demo .chapter-kanji { font-size: 66px; }
    .mood-demo .chapter-kanji svg { width: 66px; }
    .mood-demo-line { font-size: 18px; }
    .helpers-title { margin-top: 60px; }
    .helper-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .tour-step { grid-template-rows: 170px auto; }
    .taste-sheet { grid-template-rows: 140px auto; }
    .tour-copy { padding: 18px 18px 20px; }
    .tour-copy h3, .tour-copy h4 { font-size: 23px; }
    .tour-copy .taste-title { font-size: 25px; }
    .taste-bars li { grid-template-columns: 100px minmax(0, 1fr); }
    .tv-choose { gap: 22px; }
    .ls-status { padding: 20px 18px 18px; }
    .ls-status-level b { font-size: 60px; }
    .ls-status-seal { width: 56px; height: 56px; font-size: 30px; }
    .ls-status-stats li { grid-template-columns: 6.4em minmax(0, 1fr) 2.2em; }
    .promise-list { grid-template-columns: minmax(0, 1fr); }
    .faq summary { min-height: 60px; padding: 17px 44px 17px 0; font-size: 19px; }
    .faq summary::before, .faq summary::after { right: 8px; }
    .faq-answer { padding-right: 0; }
    .story-end { margin-top: 120px; }
    .story-end-actions { flex-direction: column; align-items: stretch; width: 100%; }
    .story-end .primary { width: 100%; }
    .story-end-login { justify-content: center; }
}

/* Touch-first devices: no keys, and no swipe up (swipe.js touchFirst() asks the same question). */
@media (hover: none), (pointer: coarse) {
    .try-keys { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .red-sun::before { animation: none; }
    .sky-stars::after { animation: none; opacity: .7; }
}
