/* RAI Studio shared landing + optional setup wizard.
   Storyboard look: paper, ink, one violet accent (the heroine's colour).
   The CSP forbids inline styles and remote fonts, so everything lives here
   and type relies on system faces. Light and dark follow the device. */
:root {
  color-scheme: light dark;
  --paper: #f4efe6;
  --paper-2: #ebe4d6;
  --card: #fbf8f2;
  --ink: #17151c;
  --ink-2: #56525f;
  --line: #d6cdbc;
  --accent: #5a36d6;
  --accent-ink: #ffffff;
  --accent-soft: #e6defb;
  --error: #a8241b;
  --screen: #0c0d12;
  --shadow: var(--ink);
  --radius: 6px;
  --serif: Georgia, "Times New Roman", "Noto Serif", "DejaVu Serif", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Consolas, "DejaVu Sans Mono", monospace;
  /* Names the account navigation stylesheet still reads. */
  --gold: var(--accent);
  --gold-light: var(--accent);
  --text: var(--ink);
  --muted: var(--ink-2);
  --panel: var(--card);
  --panel-raised: var(--paper-2);
  --bg: var(--paper);
  font-family: var(--sans);
  font-synthesis: none;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121118;
    --paper-2: #1b1924;
    --card: #1a1822;
    --ink: #f3eee4;
    --ink-2: #b1acbb;
    --line: #37333f;
    --accent: #a992ff;
    --accent-ink: #15121f;
    --accent-soft: #2a2444;
    --error: #ffb4a8;
    --shadow: #a992ff;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-size: 17px; line-height: 1.6; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex="-1"]:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 3px;
}
[hidden] { display: none !important; }
h1, h2, h3, p, figure, ol, dl, dd { margin-top: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -.015em; text-wrap: balance; }
p { text-wrap: pretty; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 100; padding: 12px 18px; background: var(--accent); color: var(--accent-ink); border-radius: var(--radius); }
.skip-link:focus { top: 16px; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }

.page-shell { max-width: 1200px; margin: auto; padding: 0 40px; }
main > section { padding: 88px 0; border-top: 1.5px solid var(--ink); }
main > section.hero { border-top: 0; }

/* Header */
.site-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 84px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
.brand b { font-weight: 400; letter-spacing: .22em; font-size: 13px; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; background: var(--ink); color: var(--paper); font-family: var(--serif); font-size: 22px; font-weight: 700; letter-spacing: 0; border-radius: 4px; }
.header-right { display: flex; align-items: center; gap: 12px; }
.environment { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin-right: 8px; }

/* Shared pieces */
.eyebrow, .frame-label, .value-number { font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin: 0 0 18px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 52px; padding: 13px 22px; border: 1.5px solid var(--ink); border-radius: var(--radius); font-size: 16px; font-weight: 650; line-height: 1.3; transition: transform .12s, box-shadow .12s, background .12s; }
.button-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 4px 4px 0 var(--ink); }
.button-primary:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.button-primary:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--ink); }
.button-quiet { background: transparent; color: var(--ink); }
.button-quiet:hover { background: var(--paper-2); }
.text-link { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 5px; min-height: 44px; }
.text-link:hover { color: var(--accent); }
.text-link span { text-decoration: none; }
.inline-button { border: 0; background: none; padding: 0; color: var(--accent); font-size: inherit; line-height: inherit; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.inline-button:hover { color: var(--ink); }
.section-heading { max-width: 760px; margin-bottom: 44px; }
h2 { font-size: clamp(29px, 3.5vw, 44px); line-height: 1.12; margin-bottom: 0; }
.section-cta { margin: 36px 0 0; }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 64px; align-items: center; padding: 48px 0 96px; }
.hero > * { min-width: 0; }
.hero .eyebrow { display: flex; align-items: center; gap: 10px; }
.hero .eyebrow > span { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; flex: none; }
h1 { font-size: clamp(38px, 5vw, 64px); line-height: 1.05; letter-spacing: -.025em; margin-bottom: 24px; }
h1 em { font-style: italic; color: var(--accent); }
.hero-description { font-size: 19px; line-height: 1.55; max-width: 560px; margin-bottom: 14px; }
.hero-job { max-width: 560px; color: var(--ink-2); margin-bottom: 30px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; }
.hero-note { font-size: 14px; color: var(--ink-2); margin: 20px 0 0; max-width: 480px; }

.film { margin: 0; padding: 14px; background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--radius); box-shadow: 8px 8px 0 var(--shadow); scroll-margin-top: 24px; }
.film-topline { display: flex; justify-content: space-between; gap: 10px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 12px; }
.film-topline > span:first-child { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.film-topline i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.film-frame { aspect-ratio: 16 / 9; overflow: hidden; background: var(--screen); border-radius: 3px; }
.film video { display: block; width: 100%; height: 100%; object-fit: contain; }
.film figcaption { display: flex; flex-direction: column; gap: 2px; padding-top: 14px; font-size: 15px; font-weight: 600; }
.film-caption-small { font-size: 14px; font-weight: 400; color: var(--ink-2); }
.demo-details { padding-top: 12px; overflow-wrap: anywhere; }
.demo-details p { font-size: 14px; line-height: 1.55; color: var(--ink-2); margin-bottom: 12px; }
.demo-watch { width: 100%; min-height: 48px; font-size: 15px; }
.demo-details .demo-attribution { font-size: 12px; margin: 12px 0 0; }
.demo-attribution a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* When it is needed */
.moment-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.moment { padding: 24px 24px 26px; background: var(--card); border: 1.5px dashed var(--ink-2); border-radius: var(--radius); }
.moment-when { font-family: var(--mono); font-size: 13px; line-height: 1.5; color: var(--ink-2); margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1.5px dashed var(--line); }
.moment h3 { font-size: 24px; line-height: 1.18; margin-bottom: 12px; }
.moment p:last-child { font-size: 16px; color: var(--ink-2); margin: 0; }

/* Usual way vs studio */
.compare-table { border: 1.5px solid var(--ink); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.compare-row { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1fr) minmax(0, 1fr); border-top: 1.5px solid var(--line); }
.compare-row:first-child { border-top: 0; }
.compare-row > * { padding: 20px 22px; font-size: 16px; line-height: 1.5; }
.compare-row > * + * { border-left: 1.5px solid var(--line); }
.compare-head > * { font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); background: var(--paper-2); padding-block: 13px; }
.compare-head > :last-child { color: var(--accent); }
.compare-row strong { font-family: var(--serif); font-size: 20px; font-weight: 400; line-height: 1.25; }
.compare-row .was { color: var(--ink-2); }
.compare-row .now { background: var(--accent-soft); }

/* How it works */
.strip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1.5px solid var(--ink); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.frame { padding: 22px 22px 26px; border-left: 1.5px solid var(--ink); min-width: 0; }
.frame:first-child { border-left: 0; }
.frame .frame-label { display: block; margin-bottom: 14px; }
.pic { display: block; width: 100%; aspect-ratio: 3 / 2; margin-bottom: 18px; padding: 10px; background: var(--paper-2); border-radius: 3px; color: var(--accent); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.frame h3 { font-size: 21px; line-height: 1.2; margin-bottom: 10px; }
.frame p { font-size: 15px; line-height: 1.5; color: var(--ink-2); margin: 0; }

.taste { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 0; margin-top: 28px; border: 1.5px solid var(--ink); border-radius: var(--radius); overflow: hidden; }
.taste-you { padding: 26px; background: var(--card); display: flex; flex-direction: column; justify-content: center; }
.taste-line { font-family: var(--serif); font-style: italic; font-size: clamp(22px, 2.4vw, 30px); line-height: 1.25; margin: 0; }
.taste-task { padding: 26px; background: var(--ink); color: var(--paper); }
.taste-task .frame-label { color: var(--paper); opacity: .75; }
.taste-task dl { margin: 0; display: grid; gap: 10px; font-family: var(--mono); font-size: 13.5px; line-height: 1.5; }
.taste-task dl > div { display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 12px; }
.taste-task dt { opacity: .65; }
.taste-task dd { margin: 0; }
.taste-note { grid-column: 1 / -1; margin: 0; padding: 12px 26px; font-size: 14px; color: var(--ink-2); background: var(--paper-2); border-top: 1.5px solid var(--ink); }

/* Studio entry: the main action; credits are a separate, quieter pill. */
.hero-actions .studio-entry { min-height: 72px; padding: 18px 30px; font-size: 20px; }
.button-balance { min-height: 56px; padding: 13px 22px; background: var(--paper-2); color: var(--ink); border-radius: 999px; font-size: 15px; }
.button-balance:hover { background: var(--accent-soft); }
.hero-note .inline-link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }

/* How to start: onboarding happens inside the Studio, led by Rai. */
.start-steps { list-style: none; counter-reset: start; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.start-steps li { counter-increment: start; display: flex; flex-direction: column; gap: 6px; padding: 22px 24px 24px; background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--radius); }
.start-steps li::before { content: counter(start); width: 36px; height: 36px; display: grid; place-items: center; margin-bottom: 10px; background: var(--accent); color: var(--accent-ink); border-radius: 50%; font-family: var(--mono); font-size: 15px; font-weight: 600; }
.start-steps strong { font-family: var(--serif); font-size: 22px; font-weight: 400; line-height: 1.2; }
.start-steps span { font-size: 15px; color: var(--ink-2); }
.start-cta { margin: 32px 0 0; }
.start-cta .button { min-height: 64px; padding: 16px 30px; font-size: 18px; }

/* Optional connections and human help: closed unless asked for. */
.setup-options { border-top: 1.5px solid var(--ink); }
.setup-options > summary { display: flex; align-items: center; min-height: 72px; font-size: 16px; font-weight: 600; color: var(--ink-2); cursor: pointer; list-style: none; }
.setup-options > summary::-webkit-details-marker { display: none; }
.setup-options[open] > summary { color: var(--accent); }
.local-info { max-width: 720px; margin: 0 0 8px; color: var(--ink-2); font-size: 15px; }
main .setup-options > section.onboarding { border-top: 0; padding-top: 40px; }

/* What if */
.fear-list { max-width: 860px; border-top: 1.5px solid var(--ink); }
.fear-list details { border-bottom: 1.5px solid var(--ink); }
.fear-list summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 64px; padding: 14px 0; font-family: var(--serif); font-size: 22px; line-height: 1.25; cursor: pointer; list-style: none; }
.fear-list summary::-webkit-details-marker { display: none; }
.fear-list summary::after { content: "+"; flex: none; width: 32px; height: 32px; display: grid; place-items: center; border: 1.5px solid var(--ink); border-radius: 50%; font-family: var(--sans); font-size: 20px; line-height: 1; }
.fear-list details[open] summary::after { content: "–"; background: var(--ink); color: var(--paper); }
.fear-list details p { max-width: 680px; margin: 0 0 22px; color: var(--ink-2); }

/* After */
main > section.after { text-align: center; padding: 96px 0; }
.after h2 { max-width: 860px; margin: 0 auto 18px; }
.after > p:last-child { font-size: 19px; color: var(--ink-2); margin: 0; }

/* Onboarding with Rai */
.onboarding { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 64px; align-items: start; scroll-margin-top: 16px; }
.onboarding-intro h2 { margin-bottom: 18px; }
.onboarding-intro > p:not(.eyebrow) { color: var(--ink-2); max-width: 400px; }
.next-steps { list-style: none; counter-reset: next; margin: 34px 0 0; padding: 0; display: grid; gap: 18px; max-width: 400px; }
.next-steps li { counter-increment: next; display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 14px; }
.next-steps li::before { content: counter(next); grid-row: span 2; width: 36px; height: 36px; display: grid; place-items: center; border: 1.5px solid var(--ink); border-radius: 50%; font-family: var(--mono); font-size: 14px; }
.next-steps strong { font-weight: 650; }
.next-steps span { font-size: 15px; color: var(--ink-2); }

.wizard-card { min-width: 0; padding: 26px; background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--radius); box-shadow: 8px 8px 0 var(--shadow); }
.rai-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.rai-avatar { flex: none; width: 52px; height: 52px; border: 1.5px solid var(--ink); border-radius: 50%; background: #1b1730 center / cover no-repeat url("data:image/webp;base64,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"); }
.rai-name { margin: 0; display: flex; flex-direction: column; line-height: 1.3; }
.rai-name strong { font-family: var(--serif); font-size: 22px; font-weight: 400; }
.rai-name span { font-size: 13px; color: var(--ink-2); }
.progress-top { display: flex; justify-content: space-between; gap: 14px; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.progress-top > span:first-child { color: var(--accent); font-weight: 600; }
.progress-bars { display: flex; gap: 6px; margin: 10px 0 22px; }
.progress-bars i { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.progress-bars i.active { background: var(--accent); }
.rai-log { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.rai-log li { max-width: 100%; padding: 8px 14px; background: var(--accent-soft); border-radius: 16px 16px 4px 16px; font-size: 14px; line-height: 1.4; }
.rai-log span { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin-right: 8px; }
.rai-log strong { font-weight: 600; }
.rai-say { padding: 18px 20px; margin-bottom: 18px; background: var(--paper-2); border-radius: 4px 18px 18px 18px; }
.rai-reply { font-size: 15px; line-height: 1.5; color: var(--ink-2); margin-bottom: 12px; }
.step h3, .success h3 { font-size: 26px; line-height: 1.18; margin: 0 0 8px; }
.step-description { font-size: 15px; line-height: 1.5; color: var(--ink-2); margin: 0; }
.choice-list { border: 0; margin: 0; padding: 0; display: grid; gap: 10px; min-width: 0; }
.choice { position: relative; display: flex; align-items: center; gap: 14px; min-height: 68px; padding: 14px 16px; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); cursor: pointer; transition: border-color .12s, background .12s; }
.choice:hover { border-color: var(--ink); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 3px; }
.choice > input { position: absolute; opacity: 0; width: 1px; height: 1px; inset: 50% auto auto 16px; }
.choice-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; flex: 1; min-width: 0; }
.choice-copy strong { font-size: 17px; font-weight: 650; line-height: 1.3; }
.choice-copy small { font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.radio-indicator { flex: none; width: 22px; height: 22px; border: 1.5px solid var(--ink-2); border-radius: 50%; }
.choice:has(input:checked) .radio-indicator { border: 7px solid var(--accent); background: var(--accent-ink); }
.rai-pick { padding: 2px 8px; margin-bottom: 4px; background: var(--accent); color: var(--accent-ink); border-radius: 3px; font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.availability { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.wizard-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 22px; }
.wizard-actions .button-primary { min-width: 180px; }
.wizard-footnote { font-size: 13px; text-align: right; color: var(--ink-2); margin: 16px 0 0; }
.field { margin-top: 18px; }
.field label { display: block; font-size: 15px; font-weight: 650; margin-bottom: 6px; }
.optional { font-weight: 400; font-size: 13px; color: var(--ink-2); margin-left: 6px; }
.field input, .field textarea { display: block; width: 100%; padding: 12px 14px; font-size: 16px; background: var(--paper); border: 1.5px solid var(--ink-2); border-radius: var(--radius); }
.field textarea { resize: vertical; min-height: 96px; max-height: 320px; }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-2); opacity: .8; }
.field input[aria-invalid="true"] { border-color: var(--error); }
.field-hint { font-size: 13px; line-height: 1.5; color: var(--ink-2); margin: 6px 0 0; }
.counter { display: flex; justify-content: space-between; gap: 14px; }
.counter > span:last-child { flex: none; font-family: var(--mono); }
.consent { display: flex; align-items: flex-start; gap: 12px; margin-top: 18px; font-size: 15px; line-height: 1.5; cursor: pointer; }
.consent input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); }
.field-error { font-size: 14px; line-height: 1.5; color: var(--error); margin: 8px 0 0; }
.submit-error { padding: 10px 14px; border: 1.5px solid var(--error); border-radius: var(--radius); }
.notice { margin: 18px 0 0; padding: 14px 16px; border: 1.5px dashed var(--ink-2); border-radius: var(--radius); font-size: 14px; line-height: 1.55; }
.notice p { margin-bottom: 8px; }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.selection-summary { margin: 18px 0; padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--accent-soft); font-size: 15px; line-height: 1.6; }
.selection-summary p { margin: 0; }
.selection-summary strong { font-weight: 650; }
.success { padding: 6px 0; }
.success-mark { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 22px; background: var(--accent); color: var(--accent-ink); border: 1.5px solid var(--ink); border-radius: 50%; font-size: 24px; }
.success .eyebrow { margin-bottom: 10px; }
.success > p:not(.eyebrow) { font-size: 16px; color: var(--ink-2); }
.lead-reference { overflow-wrap: anywhere; }
.lead-reference strong { color: var(--ink); font-family: var(--mono); font-weight: 600; }

/* Footer and dialog */
footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; padding: 24px 0 calc(28px + env(safe-area-inset-bottom)); border-top: 1.5px solid var(--ink); font-size: 14px; color: var(--ink-2); }
footer > span:first-child { font-family: var(--mono); letter-spacing: .12em; color: var(--ink); }
footer a, footer button { min-height: 44px; display: inline-flex; align-items: center; }
footer a { text-decoration: underline; text-underline-offset: 3px; }
dialog { width: calc(100% - 32px); max-width: 560px; padding: 28px; background: var(--card); color: var(--ink); border: 1.5px solid var(--ink); border-radius: var(--radius); box-shadow: 8px 8px 0 var(--shadow); }
dialog::backdrop { background: #000a; }
dialog h2 { font-size: 28px; margin-bottom: 16px; }
dialog > p { font-size: 15px; }
.dialog-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dialog-header .eyebrow { margin: 10px 0 16px; }
.close-button { width: 44px; height: 44px; display: grid; place-items: center; background: transparent; border: 1.5px solid var(--ink); border-radius: var(--radius); font-size: 24px; line-height: 1; }

/* Film credits page (welcome/credits.html) shares this sheet. */
main > section.possibilities { padding: 56px 0 88px; }
.possibilities .hero-description { margin-bottom: 36px; }
#credits-title { overflow-wrap: anywhere; }
.value-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.value-card { min-width: 0; padding: 24px; background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--radius); }
.value-card h2 { font-size: clamp(24px, 2.6vw, 34px); margin: 0 0 14px; overflow-wrap: anywhere; }
.value-card p { font-size: 15px; line-height: 1.55; color: var(--ink-2); margin-bottom: 12px; overflow-wrap: anywhere; }
.value-card .text-link { font-size: 15px; min-height: 0; }
.card-line { display: none; }
main > section.closing { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 32px; padding: 48px 0; }
.closing p { flex: 1 1 260px; margin: 0; font-family: var(--serif); font-size: 28px; line-height: 1.2; }

.telegram-mode .site-header { min-height: 68px; }
.telegram-mode .hero { padding-top: 28px; }

@media (max-width: 1000px) {
  .page-shell { padding: 0 28px; }
  .hero { gap: 40px; }
  .onboarding { gap: 40px; }
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .frame:nth-child(3) { border-left: 0; }
  .frame:nth-child(n + 3) { border-top: 1.5px solid var(--ink); }
  .value-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  body { font-size: 16px; }
  .page-shell { padding: 0 20px; }
  main > section { padding: 56px 0; }
  .site-header { min-height: 68px; }
  .environment { display: none; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 36px; padding: 28px 0 60px; }
  h1 { font-size: clamp(34px, 9.4vw, 46px); }
  .hero-description { font-size: 17px; }
  .hero-actions .button-balance { min-height: 52px; }
  .film { padding: 10px; box-shadow: 6px 6px 0 var(--shadow); }
  .section-heading { margin-bottom: 28px; }
  .moment-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .compare-head { display: none; }
  .compare-row { grid-template-columns: minmax(0, 1fr); border-top-color: var(--ink); }
  .compare-row > * { padding: 14px 18px; }
  .compare-row > * + * { border-left: 0; border-top: 1.5px solid var(--line); }
  .compare-row .was::before, .compare-row .now::before { display: block; margin-bottom: 4px; font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
  .compare-row .was::before { content: "Как обычно"; }
  .compare-row .now::before { content: "В RAI Studio"; color: var(--accent); }
  .taste { grid-template-columns: minmax(0, 1fr); }
  .taste-you, .taste-task { padding: 20px; }
  .taste-note { padding: 12px 20px; }
  .taste-task dl > div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .fear-list summary { font-size: 19px; }
  main > section.after { padding: 64px 0; text-align: left; }
  .onboarding { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .hero-actions .studio-entry { width: 100%; }
  .start-steps { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .start-cta .button { width: 100%; }
  main .setup-options > section.onboarding { padding-top: 20px; }
  .wizard-card { padding: 20px 16px; box-shadow: 6px 6px 0 var(--shadow); }
  .step h3, .success h3 { font-size: 23px; }
  .wizard-actions .button { padding: 12px; gap: 8px; font-size: 15px; }
  .wizard-actions .button-primary { flex: 1; min-width: 0; }
  .wizard-footnote { text-align: left; }
  dialog { padding: 22px 18px; }
}
@media (max-width: 560px) {
  .strip { grid-template-columns: minmax(0, 1fr); }
  .frame { border-left: 0; display: grid; grid-template-columns: 84px minmax(0, 1fr); column-gap: 16px; padding: 18px; }
  .frame + .frame { border-top: 1.5px solid var(--ink); }
  .frame .frame-label { grid-column: 1 / -1; }
  .pic { grid-row: span 2; margin: 0; padding: 6px; align-self: start; }
  .frame h3 { font-size: 20px; margin-bottom: 6px; }
}
@media (max-width: 370px) {
  .page-shell { padding: 0 16px; }
  h1 { font-size: 32px; }
  .wizard-card { padding: 18px 12px; }
  .rai-say { padding: 14px; }
  .choice { padding: 12px; gap: 10px; }
}
@supports (padding: max(0px)) {
  .page-shell { padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
  .site-header { padding-top: env(safe-area-inset-top); }
  @media (min-width: 821px) { .page-shell { padding-left: max(28px, env(safe-area-inset-left)); padding-right: max(28px, env(safe-area-inset-right)); } }
  @media (min-width: 1001px) { .page-shell { padding-left: max(40px, env(safe-area-inset-left)); padding-right: max(40px, env(safe-area-inset-right)); } }
  @media (max-width: 370px) { .page-shell { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Space hero: the studio's home-screen planet as the first screen for new people.
   One dark look in both themes, like the studio hero: it is a view into space. */
main > section.space-hero { position: relative; isolation: isolate; overflow: hidden; display: grid; align-items: center;
  min-height: clamp(520px, 74vh, 700px); margin: 4px 0 8px; padding: 0; border: 0; border-radius: 22px;
  background: #05060b; color: #f3f1fb; }
.space-sky { position: absolute; inset: 0; z-index: -2; }
.space-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, rgba(5,6,11,.82) 0%, rgba(5,6,11,.5) 36%, rgba(5,6,11,0) 62%); }
.space-copy { display: grid; gap: 18px; justify-items: start; max-width: 640px; padding: clamp(28px, 5vw, 64px); }
.space-eyebrow { display: flex; align-items: center; gap: 10px; margin: 0; font-family: var(--mono); font-size: 12px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: #a9abc4; }
.space-eyebrow > span { width: 8px; height: 8px; border-radius: 50%; background: #ff2d55; box-shadow: 0 0 12px #ff2d55; flex: none; }
.space-hero h1 { margin: 0; color: #f3f1fb; font-size: clamp(40px, 5.6vw, 72px); line-height: 1.02; }
.space-lead { margin: 0; max-width: 44ch; font-size: clamp(16px, 1.6vw, 19px); line-height: 1.5; color: rgba(243,241,251,.84); }
.space-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.space-hero .button { border-radius: 999px; }
.space-primary { background: #f3f1fb; color: #0b0c14; border-color: #f3f1fb; }
.space-primary:hover { box-shadow: 0 0 0 4px rgba(255,45,85,.35); }
.space-secondary { background: rgba(255,255,255,.06); color: #f3f1fb; border-color: rgba(255,255,255,.22); }
.space-secondary:hover { border-color: #f3f1fb; }
.space-hero :focus-visible { outline: 2px solid #ff2d55; outline-offset: 3px; }
.hero .hero-title { font-size: clamp(34px, 4.2vw, 56px); line-height: 1.06; letter-spacing: -.025em; margin-bottom: 24px; }
.hero .hero-title em { font-style: italic; color: var(--accent); }
@media (max-width: 720px) {
  main > section.space-hero { align-items: end; min-height: 720px; border-radius: 16px; }
  .space-hero::after { background: linear-gradient(0deg, rgba(5,6,11,.92) 0%, rgba(5,6,11,.7) 38%, rgba(5,6,11,0) 64%); }
  .space-copy { padding: 24px 20px 28px; gap: 14px; }
  .space-hero h1 { font-size: clamp(34px, 9.6vw, 44px); }
}

/* Initial route only. Without JavaScript the existing public cover stays usable. */
.entry-unrouted:not(.entry-general) #general-entry,
.entry-unrouted:is(.entry-general, .entry-routing) .page-shell,
.entry-unrouted:is(.entry-general, .entry-routing) > body > .skip-link,
.entry-leaving :is(.page-shell, .skip-link, #general-entry),
html:not(.entry-routing, .entry-leaving) #entry-pending { display:none !important; }
#entry-pending { margin:0; padding:2rem; font:1rem/1.5 var(--sans); }

:root {
  /* Size against Telegram's settled Mini App viewport, never extending past
     the current edge when it shrinks, or past the browser's visual viewport. */
  --rai-screen-height: min(100dvh, var(--rai-visual-height, 100dvh),
    var(--tg-viewport-stable-height, 100dvh), var(--tg-viewport-height, 100dvh));
  /* The browser and Telegram can both report the same device inset. Telegram's
     content insets additionally leave room for its own controls. */
  --rai-safe-top: calc(max(env(safe-area-inset-top, 0px), var(--tg-safe-area-inset-top, 0px)) + var(--tg-content-safe-area-inset-top, 0px));
  --rai-safe-right: calc(max(env(safe-area-inset-right, 0px), var(--tg-safe-area-inset-right, 0px)) + var(--tg-content-safe-area-inset-right, 0px));
  --rai-safe-bottom: calc(max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px)) + var(--tg-content-safe-area-inset-bottom, 0px));
  --rai-safe-left: calc(max(env(safe-area-inset-left, 0px), var(--tg-safe-area-inset-left, 0px)) + var(--tg-content-safe-area-inset-left, 0px));
}
