/* Agint's front door. Two looks on one flow: india (default: Cormorant, marigold) and dream (Instrument Serif, pale gold).
   Motion is transform and opacity only; prefers-reduced-motion turns it off. */
:root {
  --latin-display: 'Cormorant Garamond';
  --display: 'Cormorant Garamond', serif;
  --body: 'Instrument Sans', system-ui, sans-serif;
  --accent: #f2aa33;
  --accent-2: #ffd27a;
  --accent-ink: #1d1206;
  --ink: #fbf5e8;
  --ink-2: rgba(251, 245, 232, .8);
  --ink-3: rgba(251, 245, 232, .62);
  --line: rgba(251, 245, 232, .26);
  --glass: rgba(9, 12, 26, .42);
  --glass-2: rgba(255, 255, 255, .08);
  --paper: #fffaf1;
  --paper-ink: #2a1d12;
  --paper-ink-2: #5c4a38;
  --mark: #f2aa33;
  --mark-eye: #0d1530;
  --display-weight: 300;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
html[data-look="dream"] {
  --latin-display: 'Instrument Serif';
  --accent: #f1d593;
  --accent-2: #fff0c6;
  --accent-ink: #10231d;
  --mark: #f1d593;
  --mark-eye: #0c2a22;
  --display-weight: 400;
}
html[data-tone="light"] {
  --ink: #2a1d12;
  --ink-2: rgba(42, 29, 18, .82);
  --ink-3: rgba(42, 29, 18, .62);
  --line: rgba(42, 29, 18, .2);
  --glass: rgba(255, 250, 240, .72);
  --glass-2: rgba(42, 29, 18, .05);
  --accent: #b8661a;
  --accent-ink: #fffaf1;
  --mark: #b8661a;
  --mark-eye: #fffaf1;
  color-scheme: light;
}
html[data-look="dream"][data-tone="light"] { --accent: #1f5a49; --mark: #1f5a49; --accent-ink: #fffaf1; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0b1024; color: var(--ink); }
html[data-look="dream"], html[data-look="dream"] body { background: #04161a; }
body { font-family: var(--body); font-size: 17px; line-height: 1.5; overflow: hidden; overscroll-behavior: none; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
body::after { content: ""; position: fixed; inset: 0; background: #0b1024; z-index: 50; pointer-events: none; transition: opacity .9s ease; }
html.ready body::after { opacity: 0; }
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 3px; border-radius: 12px; }
[tabindex="-1"]:focus { outline: none; }
.display, .stat b, .paper .num, .count { font-variant-numeric: lining-nums tabular-nums; }
.paper .num { font-family: 'Instrument Serif', var(--display); font-weight: 400; }
.stat b { font-family: 'Instrument Sans', system-ui, sans-serif !important; font-weight: 400 !important; letter-spacing: -.04em !important; font-variant-numeric: lining-nums proportional-nums; }
html[data-tone="light"] :focus-visible { outline-color: var(--accent); }

/* ------------------------------------------------------------------ art */
#j-art { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.backdrop { position: absolute; inset: 0; opacity: 1; transform: scale(1); transition: opacity 1.4s var(--ease), transform 2.6s var(--ease); will-change: opacity, transform; }
.backdrop.enter { opacity: 0; transform: scale(1.07); }
.backdrop.leave { opacity: 0; transition: opacity 1.3s ease; }
.a-layer { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.a-paint { animation: kenburns 46s ease-in-out infinite alternate; transform-origin: 50% 60%; will-change: transform; }
.a-svg { width: 100%; height: 100%; display: block; }
.a-grain { inset: -50%; width: 200%; height: 200%; background: url(art/grain.png) repeat; background-size: 220px; opacity: .14; mix-blend-mode: overlay; animation: grain .9s steps(5) infinite; }
.a-canvas { background: url(art/canvas.png) repeat; background-size: 420px; opacity: .22; mix-blend-mode: soft-light; }
.a-vignette { background: radial-gradient(ellipse 85% 75% at 50% 48%, transparent 45%, rgba(4, 4, 14, .5) 100%); }
html[data-tone="light"] .a-vignette { background: radial-gradient(ellipse 90% 80% at 50% 50%, transparent 55%, rgba(120, 80, 30, .14) 100%); }
html[data-tone="light"] .a-grain { opacity: .1; }
.a-breathe { transform-box: view-box; transform-origin: 800px 190px; animation: breathe 7s ease-in-out infinite; }
.a-weft { animation: weft 6.5s cubic-bezier(.5, 0, .5, 1) infinite; }
.a-bob { animation: bob 6s ease-in-out infinite; }
.a-beam { transform-box: view-box; transform-origin: 1184px 366px; animation: beam 9s ease-in-out infinite alternate; }
.a-birds { animation: birds 30s linear infinite; }
.a-ripple { animation: ripple 3.2s ease-in-out infinite; }
.a-ripple:nth-child(2n) { animation-delay: -1.4s; }
@keyframes kenburns { from { transform: scale(1.0) translate3d(0, 0, 0); } to { transform: scale(1.06) translate3d(-1%, -1%, 0); } }
@keyframes grain { 0% { transform: translate(0, 0); } 20% { transform: translate(-6%, 3%); } 40% { transform: translate(4%, -5%); } 60% { transform: translate(-3%, -2%); } 80% { transform: translate(5%, 4%); } 100% { transform: translate(0, 0); } }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: .92; } 50% { transform: scale(1.035); opacity: 1; } }
@keyframes weft { 0% { transform: translateX(0); } 50% { transform: translateX(1900px); } 100% { transform: translateX(0); } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(5px) rotate(.4deg); } }
@keyframes beam { from { transform: rotate(-7deg); } to { transform: rotate(6deg); } }
@keyframes birds { from { transform: translateX(-60px); } to { transform: translateX(120px); } }
@keyframes ripple { 0%, 100% { opacity: .15; } 50% { opacity: .6; } }

/* ------------------------------------------------------------------ chrome */
.bar { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(14px + var(--top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); pointer-events: none; }
.bar > * { pointer-events: auto; }
.round { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: var(--glass); color: var(--ink); display: grid; place-items: center; cursor: pointer;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: transform .3s var(--ease), background .3s; flex: none; }
.round:hover { transform: translateY(-1px); }
.round[hidden] { display: grid; visibility: hidden; }
.round svg { width: 20px; height: 20px; }
#j-back svg { transform: rotate(180deg); }
[dir="rtl"] #j-back svg { transform: none; }
.pill-wrap { position: relative; display: flex; justify-content: center; min-width: 0; }
.pill { display: inline-flex; align-items: center; gap: 9px; min-height: 40px; padding: 7px 16px 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--glass); color: var(--ink);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); cursor: pointer; font-size: 14px; position: relative; overflow: hidden; max-width: 58vw; }
.pl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); flex: none; }
.pl-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-count { color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pl-bar { position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.pl-bar i { position: absolute; inset: 0; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); transition: transform .8s var(--ease); }
[dir="rtl"] .pl-bar i { transform-origin: 100% 50%; }
.menu { position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); min-width: 220px; padding: 8px; border-radius: 18px; background: rgba(10, 12, 26, .92); border: 1px solid rgba(255, 255, 255, .14);
  display: grid; gap: 2px; box-shadow: 0 20px 60px rgba(0, 0, 0, .4); color: #fbf5e8; }
.menu[hidden] { display: none; }
.menu button { min-height: 44px; padding: 10px 14px; border: 0; border-radius: 12px; background: transparent; text-align: start; cursor: pointer; font-size: 15px; }
.menu button:hover:not([disabled]), .menu button[aria-current] { background: rgba(255, 255, 255, .08); }
.menu button[disabled] { opacity: .4; cursor: default; }
.menu .menu-out { display: flex; align-items: center; min-height: 44px; padding: 10px 14px; margin-top: 4px; border-top: 1px solid rgba(255, 255, 255, .12); border-radius: 0 0 12px 12px; color: inherit; text-decoration: none; font-size: 15px; }
.menu .menu-out:hover { background: rgba(255, 255, 255, .08); }
.langbtn { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 16px 0 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--glass); color: var(--ink);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); cursor: pointer; font-size: 14px; flex: none; max-width: 34vw; }
.langbtn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.langbtn svg { width: 18px; height: 18px; flex: none; }

/* ------------------------------------------------------------------ scenes */
#j-scenes { position: fixed; inset: 0; z-index: 5; }
.scene { position: absolute; inset: 0; transition: opacity .6s var(--ease), transform .7s var(--ease); }
.scene.out { opacity: 0; transform: translateY(-3.5vh) scale(.985); pointer-events: none; }
.scene.out-back { opacity: 0; transform: translateY(3.5vh) scale(.985); pointer-events: none; }
.scene.kind-nar::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 62% 52% at 50% 50%, rgba(4, 6, 18, .5), rgba(4, 6, 18, .12) 62%, transparent 80%); }
.ch-keep.scene::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 70% 62% at 50% 48%, rgba(4, 6, 18, .55), rgba(4, 6, 18, .2) 70%, transparent 90%); }
.content { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; scrollbar-width: thin;
  padding: calc(84px + var(--top)) max(16px, env(safe-area-inset-right)) calc(36px + var(--bottom)) max(16px, env(safe-area-inset-left));
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, transparent calc(58px + var(--top)), #000 calc(86px + var(--top))); mask-image: linear-gradient(to bottom, transparent 0, transparent calc(58px + var(--top)), #000 calc(86px + var(--top))); }
.inner { min-height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.scene.low .inner { justify-content: flex-end; padding-top: clamp(190px, 27vh, 300px); }
.scene.low .stat b { font-size: clamp(48px, 5vw, 72px); }
.scene.low.kind-nar::before { background: radial-gradient(ellipse 66% 50% at 50% 66%, rgba(4, 6, 18, .55), rgba(4, 6, 18, .14) 62%, transparent 82%); }
.rise { opacity: 0; transform: translate3d(0, 28px, 0); }
.from-back .rise { transform: translate3d(0, -20px, 0); }
.scene.in .rise { opacity: 1; transform: none; transition: opacity .9s var(--ease), transform 1.1s var(--ease); transition-delay: calc(var(--i, 0) * 110ms + 260ms); }
.scene.instant.in .rise { transition-duration: .35s; transition-delay: calc(var(--i, 0) * 30ms); }

.stack { width: 100%; max-width: 1040px; display: flex; flex-direction: column; gap: 18px; }
.stack.center { align-items: center; text-align: center; }
.center-text { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.brand { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 6px; font-family: var(--body); font-weight: 600; font-size: 18px; letter-spacing: .02em; }
.mark { width: 26px; height: 26px; color: var(--mark); flex: none; }
.kicker { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--accent-2); }
html[data-tone="light"] .kicker { color: var(--accent); }
.display { margin: 0; font-family: var(--display); font-weight: var(--display-weight); font-size: clamp(40px, 6.2vw, 96px); line-height: 1.02; letter-spacing: -.012em; text-wrap: balance; max-width: 16ch;
  text-shadow: 0 2px 30px rgba(0, 0, 0, .25); }
.display.xl { font-size: clamp(44px, 7.4vw, 116px); max-width: 15ch; }
.display.md { font-size: clamp(34px, 4.6vw, 66px); max-width: 20ch; }
.display.sm { font-size: clamp(28px, 2.8vw, 40px); max-width: 22ch; line-height: 1.08; }
html[data-tone="light"] .display { text-shadow: none; }
.lede { margin: 0; font-size: clamp(17px, 1.45vw, 21px); line-height: 1.55; color: var(--ink-2); max-width: 40ch; text-wrap: pretty; }
.lesson { display: inline-flex; align-items: flex-start; gap: 12px; margin: 6px 0 0; max-width: 34ch; text-align: start; padding: 14px 20px 14px 16px; border-radius: 18px; background: rgba(8, 10, 24, .56); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .14); font-family: var(--display); font-style: italic; font-size: clamp(20px, 1.8vw, 26px); line-height: 1.3; color: var(--ink); }
.lesson .mark { width: 24px; height: 24px; margin-top: 4px; }
.stat { display: flex; align-items: baseline; gap: 14px; margin: 4px 0 0; color: var(--ink-2); font-size: 15px; max-width: 30ch; text-align: start; }
.stat b { font-family: var(--display); font-weight: var(--display-weight); font-size: clamp(56px, 6vw, 88px); line-height: 1; color: var(--accent-2); font-variant-numeric: tabular-nums; min-width: 1.2em; text-align: end; }
.fine { margin: 0; font-size: 15px; color: var(--ink-3); }
.hint { position: absolute; left: 0; right: 0; bottom: calc(18px + var(--bottom)); margin: 0; text-align: center; font-size: 13px; color: var(--ink-3); letter-spacing: .04em; }
.scene.in .hint { transition-delay: 1.8s; }
.quiet { color: var(--ink-3); font-size: 15px; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line); min-height: 44px; display: inline-flex; align-items: center; padding: 0 8px; }
.quiet:hover { color: var(--ink); }
.quiets { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 10px; margin: 0; }  /* skip the story / sign in: one quiet row, wraps on a phone */
.link { color: var(--accent-2); font-weight: 500; text-underline-offset: 3px; }

/* buttons and chips */
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 8px; }
.actions.center, .center .actions { justify-content: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 26px; border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  font-family: var(--body); font-weight: 600; font-size: 16px; text-decoration: none; transition: transform .35s var(--ease), box-shadow .35s var(--ease), opacity .3s; }
.btn .arr { width: 20px; height: 20px; transition: transform .35s var(--ease); }
[dir="rtl"] .btn .arr { transform: scaleX(-1); }
.btn:hover .arr { transform: translateX(3px); }
[dir="rtl"] .btn:hover .arr { transform: scaleX(-1) translateX(3px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 30px -10px rgba(242, 170, 51, .55); }
html[data-look="dream"] .btn.primary { box-shadow: 0 10px 30px -10px rgba(241, 213, 147, .45); }
.btn.primary:hover { transform: translateY(-2px); }
.btn.primary[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.big { min-height: 60px; padding: 0 34px; font-size: 18px; }
.btn.ghost { background: var(--glass-2); border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: var(--ink-3); }
.btn.small { min-height: 44px; padding: 0 18px; font-size: 15px; }
.chip { min-height: 44px; padding: 9px 17px; border-radius: 999px; border: 1px solid var(--line); background: var(--glass-2); cursor: pointer; font-size: 16px; line-height: 1.25;
  transition: background .25s, color .25s, border-color .25s, transform .3s var(--ease); }
.chip:hover { border-color: var(--ink-3); transform: translateY(-1px); }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip.small { min-height: 44px; padding: 6px 14px; font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.langs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 640px; margin-top: 6px; }
.chip.lang { background: rgba(8, 10, 24, .3); }
.chip.lang.on { background: var(--accent); }
.chip.more { border-style: dashed; }

/* ------------------------------------------------------------------ arrival and story */
.arrival { gap: 16px; }
.arrival .display { margin: 4px 0 6px; }
.arrival .actions { margin-top: 14px; }
.story { gap: 20px; }
.story .lede { max-width: 42ch; }
.story.now .display { max-width: 14ch; }

/* ------------------------------------------------------------------ you: a conversation */
.form { max-width: 640px; gap: 16px; }
.says-wrap { margin-bottom: 4px; }
.says { display: flex; align-items: flex-start; gap: 14px; }
.says .who { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .08); border: 1px solid var(--line); flex: none; }
.bubble { margin: 0; padding: 16px 22px; border-radius: 24px 24px 24px 8px; background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .14);
  font-family: var(--display); font-weight: 400; font-size: clamp(23px, 2.4vw, 32px); line-height: 1.25; }
[dir="rtl"] .bubble { border-radius: 24px 24px 8px 24px; }
.said { display: flex; justify-content: flex-end; }
.bubble.me { background: var(--accent); color: var(--accent-ink); border-color: transparent; border-radius: 24px 24px 8px 24px; font-family: var(--body); font-size: 16px; font-weight: 500; padding: 10px 18px; opacity: .92; }
[dir="rtl"] .bubble.me { border-radius: 24px 24px 24px 8px; }
.field { display: block; }
.input { width: 100%; min-height: 54px; padding: 14px 18px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255, 255, 255, .07); color: var(--ink); font-size: 18px; resize: vertical; }
.input::placeholder { color: var(--ink-3); }
.input:focus { outline: none; border-color: var(--accent-2); background: rgba(255, 255, 255, .1); }
.input.big { min-height: 80px; font-family: var(--display); font-size: clamp(30px, 3.4vw, 44px); text-align: center; border-width: 0 0 1px; border-radius: 0; background: transparent; padding: 10px 6px; }
.input.big:focus { background: transparent; border-color: var(--accent-2); }
.tones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tone { text-align: start; display: flex; flex-direction: column; gap: 8px; padding: 18px 20px; min-height: 128px; border-radius: 20px; border: 1px solid var(--line); background: rgba(255, 255, 255, .06); cursor: pointer;
  transition: border-color .3s, background .3s, transform .35s var(--ease); }
.tone:hover { transform: translateY(-2px); border-color: var(--ink-3); }
.tone b { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-2); font-weight: 600; }
.tone span { font-family: var(--display); font-size: 21px; line-height: 1.3; }
.tone.on { border-color: var(--accent); background: rgba(242, 170, 51, .14); }
html[data-look="dream"] .tone.on { background: rgba(241, 213, 147, .12); }
.step-no { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 6px 0 2px; font-weight: 500; }
.step-no b { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-size: 13px; flex: none; }
.ask { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 16px 18px; border-radius: 18px; border: 1px dashed var(--line); background: rgba(255, 255, 255, .05); }
.ask p { margin: 0; flex: 1 1 260px; font-size: 16px; color: var(--ink-2); }

/* ------------------------------------------------------------------ the tools */
.tool { max-width: 1120px; gap: 18px; }
.tool-intro { display: flex; flex-direction: column; gap: 8px; }
.tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: 0 -2px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 15px; color: var(--ink-2); white-space: nowrap; }
.tab.seen { color: var(--ink); }
.tab.on { background: var(--ink); color: #10162e; border-color: var(--ink); }
.tool-body { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px; align-items: center; }
.tool-copy { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.tool-copy p { margin: 0; font-size: 18px; color: var(--ink-2); max-width: 36ch; }
.tool-copy .demo-note { font-size: 13px; }
.mock { position: relative; background: var(--paper); color: var(--paper-ink); border-radius: 24px; padding: 22px; min-height: 360px; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .06);
  display: flex; flex-direction: column; gap: 14px; overflow: hidden; font-size: 15px; }
.seq { opacity: 0; transform: translate3d(0, 12px, 0); transition: opacity .55s var(--ease), transform .7s var(--ease); }
.seq.on { opacity: 1; transform: none; }
.av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #e9dcc4; color: #5c4a38; font-weight: 600; font-size: 14px; flex: none; }
.mock .mark { width: 18px; height: 18px; color: #c47a1c; --mark-eye: #fffaf1; }
html[data-look="dream"] .mock .mark { color: #1f5a49; }
.m-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: #f6eedf; }
.m-row div { display: flex; flex-direction: column; min-width: 0; }
.m-row span { color: var(--paper-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-row .dot { width: 9px; height: 9px; border-radius: 50%; background: #c47a1c; margin-inline-start: auto; flex: none; }
.m-open .q { margin: 0; padding: 0 4px; color: var(--paper-ink-2); }
.m-reply { padding: 14px 16px; border-radius: 16px; border: 1px solid #ead9bc; background: #fff; }
.lbl { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 13px; color: #8a6a44; font-weight: 600; }
.type { margin: 0; min-height: 3em; white-space: pre-line; }
.m-ask { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: #1d1a2e; color: #fbf5e8; margin-top: auto; }
html[data-look="dream"] .m-ask { background: #0f2f27; }
.m-ask span { flex: 1 1 140px; }
.m-ask .btn.primary { background: #f2aa33; color: #1d1206; box-shadow: none; }
html[data-look="dream"] .m-ask .btn.primary { background: #f1d593; color: #10231d; }
.m-ask .done { display: none; color: #b9e6a8; font-weight: 600; }
.mock.yes .m-ask .btn { display: none; }
.mock.yes .m-ask .done { display: inline; }
.said-line { margin: 0; font-family: var(--display); font-style: italic; font-size: 20px; line-height: 1.3; }
.grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; flex: 1; min-height: 200px; }
.col { position: relative; border-radius: 12px; background: #f6eedf; padding-top: 30px; }
.col b { position: absolute; top: 8px; left: 0; right: 0; text-align: center; font-size: 13px; color: var(--paper-ink-2); font-weight: 600; }
.ev { position: absolute; left: 4px; right: 4px; top: calc(30px + var(--y) * .78); height: var(--h); border-radius: 8px; background: #e2d2b4; }
.ev.new { background: #c47a1c; color: #fffaf1; font-size: 13px; font-style: normal; padding: 4px 5px; overflow: hidden; line-height: 1.2; box-shadow: 0 6px 18px -6px rgba(196, 122, 28, .8); }
html[data-look="dream"] .ev.new { background: #1f5a49; }
.ev.new.seq { transform: scale(.6); }
.ev.new.seq.on { transform: none; }
.docs table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.docs th { text-align: start; font-size: 13px; color: var(--paper-ink-2); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid #e6d8bf; }
.docs td { padding: 9px 8px; border-bottom: 1px solid #f0e5d2; }
.docs td:nth-child(n+2), .docs th:nth-child(n+2) { text-align: end; }
.docs .tot td { font-weight: 700; border-bottom: 0; color: #8a4f10; }
.doc { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 14px; background: #f6eedf; }
.doc i { height: 8px; border-radius: 4px; background: #e2d2b4; }
.doc i.short { width: 60%; }
.post .card { position: relative; width: min(100%, 300px); aspect-ratio: 4 / 5; margin: 0 auto; border-radius: 18px; overflow: hidden; padding: 22px; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; color: #fff8ea; }
.post .paint { position: absolute; inset: 0; z-index: 0; background: radial-gradient(circle at 30% 25%, #ffd27a 0, transparent 38%), radial-gradient(circle at 80% 70%, #b8323a 0, transparent 45%), linear-gradient(160deg, #3e4fb8, #1c2470 60%, #120f2e); }
html[data-look="dream"] .post .paint { background: radial-gradient(circle at 70% 25%, #fff0c6 0, transparent 35%), radial-gradient(circle at 20% 80%, #3fa38a 0, transparent 45%), linear-gradient(160deg, #1b6a66, #0c2a22 70%); }
.post .paint::after { content: ""; position: absolute; inset: 0; background: url(art/canvas.png); background-size: 300px; mix-blend-mode: soft-light; opacity: .5; }
.post .card p { position: relative; margin: 0; }
.post .biz { font-size: 13px; letter-spacing: .16em; text-transform: uppercase; opacity: .85; }
.post .head { font-family: var(--display); font-size: 34px; line-height: 1.02; }
.post .sub { font-size: 14px; opacity: .9; }
.room-name { margin: 0; font-weight: 700; }
.faces { display: flex; gap: 8px; }
.faces .av.a1 { background: #d9c2f0; color: #3b2470; } .faces .av.a2 { background: #bfe3d6; color: #164a3a; } .faces .av.a3 { background: #f6d3a8; color: #6a3a10; }
.faces .av.ag { background: #1d1a2e; }
.line { margin: 0; display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; background: #f6eedf; }
.line b { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #e2d2b4; font-size: 13px; flex: none; }
.line.agint { background: #1d1a2e; color: #fbf5e8; }
html[data-look="dream"] .line.agint, html[data-look="dream"] .faces .av.ag { background: #0f2f27; }
.line.agint .mark { color: #f2aa33; --mark-eye: #1d1a2e; margin-top: 2px; }
.voice .orb { width: 132px; height: 132px; margin: 8px auto; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffd27a, #c47a1c 60%, #6e3a12); display: flex; align-items: center; justify-content: center; gap: 5px;
  box-shadow: 0 0 0 14px rgba(196, 122, 28, .12), 0 0 0 30px rgba(196, 122, 28, .06); }
html[data-look="dream"] .voice .orb { background: radial-gradient(circle at 35% 30%, #fff0c6, #3fa38a 60%, #0f2f27); box-shadow: 0 0 0 14px rgba(63, 163, 138, .14), 0 0 0 30px rgba(63, 163, 138, .07); }
.voice .orb i { width: 6px; height: 46px; border-radius: 3px; background: #fffaf1; transform: scaleY(.3); animation: bars 1.1s ease-in-out infinite; }
.voice .orb i:nth-child(2) { animation-delay: -.2s; } .voice .orb i:nth-child(3) { animation-delay: -.5s; } .voice .orb i:nth-child(4) { animation-delay: -.1s; }
.voice .orb i:nth-child(5) { animation-delay: -.7s; } .voice .orb i:nth-child(6) { animation-delay: -.35s; } .voice .orb i:nth-child(7) { animation-delay: -.6s; }
@keyframes bars { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }
.voice .said-line { text-align: center; min-height: 2.6em; }

/* ------------------------------------------------------------------ drafts */
.drafts { max-width: 1240px; gap: 26px; }
.paper-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: start; }
.paper-grid > .rise { min-width: 0; }
.paper { position: relative; background: var(--paper); color: var(--paper-ink); border-radius: 6px; padding: 26px 26px 20px; min-height: 360px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 30px 60px -28px rgba(80, 50, 20, .45), 0 0 0 1px rgba(120, 80, 30, .12); }
.paper::before { content: ""; position: absolute; inset: 8px; border: 1px solid rgba(184, 102, 26, .3); border-radius: 3px; pointer-events: none; box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px rgba(184, 102, 26, .18); }
html[data-look="dream"] .paper::before { border-color: rgba(31, 90, 73, .28); box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px rgba(31, 90, 73, .14); }
.paper header { display: flex; align-items: baseline; gap: 12px; }
.paper .num { font-family: var(--display); font-size: 40px; line-height: 1; color: var(--accent); }
.paper h3 { margin: 0; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--paper-ink-2); font-weight: 600; }
.paper .quote { margin: 0; padding: 10px 14px; border-inline-start: 3px solid rgba(184, 102, 26, .4); background: #f6eedf; border-radius: 0 10px 10px 0; font-size: 15px; color: var(--paper-ink-2); }
[dir="rtl"] .paper .quote { border-radius: 10px 0 0 10px; }
.paper .text { font-family: var(--display); font-size: 20px; line-height: 1.5; white-space: pre-wrap; outline: none; padding: 6px 8px; margin: 0 -8px; border-radius: 8px; flex: 1; overflow-wrap: anywhere; }
html[data-look="india"][data-script="latin"] .paper .text { font-size: 21px; }
.paper .text:focus { background: #fff6e6; box-shadow: 0 0 0 2px rgba(184, 102, 26, .35); }
.tools-row { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 8px; border-top: 1px solid #efe3cf; }
.tools-row .chip { border-color: #e2d2b4; background: #fff; color: var(--paper-ink); }
.tools-row .chip:hover { border-color: #b8661a; }
.paper .err { margin: 0; color: #8a3020; }
.wait { display: flex; flex-direction: column; gap: 14px; padding-top: 8px; }
.ink { position: relative; height: 12px; border-radius: 6px; background: #efe4d0; overflow: hidden; }
.ink.short { width: 55%; }
.ink::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .85), transparent); transform: translateX(-100%); animation: sweep 1.6s ease-in-out infinite; }
.ink:nth-child(2)::after { animation-delay: .15s; } .ink:nth-child(3)::after { animation-delay: .3s; }
@keyframes sweep { to { transform: translateX(100%); } }
.wait-line { margin: auto 0 0; font-family: var(--display); font-style: italic; font-size: 19px; color: var(--paper-ink-2); }
.wait-line.swap { animation: fadein .6s var(--ease); }
.paper.fresh { animation: fadein .8s var(--ease); }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.banner { margin: 0; text-align: center; color: var(--ink-2); font-size: 15px; min-height: 1px; opacity: 0; transition: opacity .4s; }
.banner.on { opacity: 1; }

/* ------------------------------------------------------------------ keep */
.keep { max-width: 760px; gap: 24px; }
.paths { display: grid; gap: 12px; width: 100%; }
.path { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: start; padding: 20px 22px; border-radius: 22px; border: 1px solid var(--line); background: rgba(8, 10, 24, .64); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: var(--ink); text-decoration: none; cursor: pointer; transition: transform .35s var(--ease), border-color .3s, background .3s; font-size: 15px; width: 100%; min-height: 44px; }
.path:hover { transform: translateY(-2px); border-color: var(--ink-3); }
.path b { font-family: var(--display); font-weight: 400; font-size: clamp(24px, 2.4vw, 30px); line-height: 1.1; }
.path span { color: var(--ink-2); max-width: 52ch; }
.path em { font-style: normal; font-size: 14px; color: var(--accent-2); margin-top: 4px; }
.path.best { background: linear-gradient(135deg, rgba(242, 170, 51, .2), rgba(8, 10, 24, .55)); border-color: rgba(242, 170, 51, .55); padding: 24px 24px 22px; }
html[data-look="dream"] .path.best { background: linear-gradient(135deg, rgba(241, 213, 147, .16), rgba(4, 22, 26, .6)); border-color: rgba(241, 213, 147, .5); }
.path .tag { position: absolute; top: 18px; inset-inline-end: 18px; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent); border-radius: 999px; padding: 4px 11px; font-size: 13px; }
.path .g { width: 34px; height: 34px; border-radius: 50%; background: #fff; display: grid; place-items: center; margin-bottom: 4px; }
.path .g svg { width: 20px; height: 20px; }
.quiet-path { background: rgba(8, 10, 24, .45); border-style: dashed; }

/* ------------------------------------------------------------------ language sheet */
.sheet { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; }
.sheet[hidden] { display: none; }
.sheet-bg { position: absolute; inset: 0; background: rgba(4, 6, 16, .6); opacity: 0; transition: opacity .3s; }
.sheet.open .sheet-bg { opacity: 1; }
.sheet-panel { position: relative; width: min(680px, 100%); max-height: calc(100dvh - 32px); overflow: auto; border-radius: 26px; padding: 22px 22px 26px; background: #121528; color: #fbf5e8;
  border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 40px 100px rgba(0, 0, 0, .5); opacity: 0; transform: translateY(24px) scale(.98); transition: opacity .35s var(--ease), transform .45s var(--ease); }
html[data-look="dream"] .sheet-panel { background: #0b211d; }
.sheet.open .sheet-panel { opacity: 1; transform: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-head h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 34px; }
.sheet .round { --line: rgba(255, 255, 255, .2); --glass: rgba(255, 255, 255, .06); --ink: #fbf5e8; font-size: 24px; }
.lg { margin: 18px 0 10px; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: rgba(251, 245, 232, .6); font-weight: 600; }
.lgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.lgrid .chip { --line: rgba(255, 255, 255, .2); --accent-ink: #1d1206; color: #fbf5e8; background: rgba(255, 255, 255, .05); }
.lgrid .chip.on { background: var(--accent); color: var(--accent-ink); }

/* ------------------------------------------------------------------ scripts */
html[data-script="other"] * { letter-spacing: 0 !important; }
html[data-script="other"] .display { line-height: 1.24; }
html[data-script="other"] .kicker, html[data-script="other"] .tone b, html[data-script="other"] .paper h3, html[data-script="other"] .lg { text-transform: none; font-size: 14px; }
html[data-script="other"] .bubble, html[data-script="other"] .lesson { line-height: 1.45; }
html[data-lang="ur"] .display { line-height: 1.9; font-size: clamp(32px, 4.6vw, 72px); font-weight: 400; }
html[data-lang="ur"] .display.xl { font-size: clamp(34px, 5.4vw, 84px); }
html[data-lang="ur"] .display.md { font-size: clamp(28px, 3.6vw, 52px); }
html[data-lang="ur"] body, html[data-lang="ur"] .lede { line-height: 2; }
html[data-lang="ur"] .bubble, html[data-lang="ur"] .lesson, html[data-lang="ur"] .paper .text, html[data-lang="ur"] .tone span { line-height: 2.1; font-size: 19px; font-style: normal; }
html[data-lang="ar"] .display { line-height: 1.35; font-weight: 400; }
html[data-lang="ar"] .lesson, html[data-lang="ar"] .said-line, html[data-lang="ar"] .wait-line { font-style: normal; }
html[data-lang="ja"] .display, html[data-lang="zh"] .display { line-height: 1.3; font-weight: 300; font-size: clamp(34px, 5vw, 80px); max-width: 18em; }
html[data-lang="ja"] .display.xl, html[data-lang="zh"] .display.xl { font-size: clamp(36px, 5.6vw, 88px); }
html[data-lang="ja"] .display.md, html[data-lang="zh"] .display.md { font-size: clamp(28px, 3.8vw, 54px); }
html[data-lang="ja"] .lesson, html[data-lang="zh"] .lesson, html[data-lang="ja"] .said-line, html[data-lang="zh"] .said-line { font-style: normal; }
html[data-lang="ja"] .lede, html[data-lang="zh"] .lede { max-width: 30em; line-break: strict; }
html[data-lang="ta"] .display, html[data-lang="ml"] .display, html[data-lang="te"] .display, html[data-lang="kn"] .display { font-size: clamp(32px, 4.8vw, 76px); }
html[data-lang="ta"] .display.xl, html[data-lang="ml"] .display.xl, html[data-lang="te"] .display.xl, html[data-lang="kn"] .display.xl { font-size: clamp(34px, 5.4vw, 86px); }
html[data-script="other"] .display { max-width: 20ch; }
html[data-script="other"] .lesson, html[data-script="other"] .wait-line, html[data-script="other"] .said-line { font-style: normal; }

/* ------------------------------------------------------------------ small screens */
@media (max-width: 900px) {
  .tool-body { grid-template-columns: 1fr; gap: 18px; }
  .paper-grid { grid-template-columns: 1fr; max-width: 640px; margin: 0 auto; width: 100%; }
  .paper { min-height: 0; }
  .mock { min-height: 0; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .bar { gap: 8px; }
  .pill { padding: 6px 12px 6px 10px; font-size: 13px; gap: 7px; }
  .langbtn { padding: 0 12px 0 10px; font-size: 13px; }
  .tones { grid-template-columns: 1fr; }
  .tone { min-height: 0; }
  .lesson { padding: 12px 16px 12px 14px; }
  .stat { gap: 10px; font-size: 14px; }
  .mock { padding: 16px; border-radius: 20px; }
  .grid { min-height: 180px; }
  .post .head { font-size: 28px; }
  .paper { padding: 22px 20px 18px; }
  .paper .text { font-size: 19px; }
  .path .tag { position: static; margin-bottom: 4px; }
  .hint { display: none; }
  .input.big { font-size: 30px; }
}
@media (max-height: 700px) and (min-width: 561px) {
  .display.xl { font-size: clamp(40px, 6vw, 84px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .rise, .seq { opacity: 1 !important; transform: none !important; }
  .backdrop.enter { transform: none; }
}

/* Japanese and Chinese: break between phrases, not inside words; tighter proportional kana */
html[data-lang="ja"] .display, html[data-lang="ja"] .lede, html[data-lang="ja"] .bubble, html[data-lang="ja"] .lesson,
html[data-lang="zh"] .display, html[data-lang="zh"] .lede, html[data-lang="zh"] .bubble, html[data-lang="zh"] .lesson { word-break: auto-phrase; font-feature-settings: "palt"; }

/* the lesson and the number sit side by side when there is room */
.pair { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px 28px; }
.pair .lesson { margin: 0; }
.scene.low .display { font-size: clamp(38px, 5.2vw, 80px); }
.scene.low .story { gap: 16px; }

/* no visible scrollbars: the pages still scroll with a wheel, a touchpad, a finger or the keys */
html, body, * { scrollbar-width: none; }
*::-webkit-scrollbar { width: 0; height: 0; background: transparent; }
