/* CHIT · chit.digital
   Warm cream paper, espresso ink, Chiti's midnight indigo for the voice, Chiti's cyan for life.
   One serif for what CHIT says, one grotesk for the interface. */
:root {
  --paper: #fbf8f3; --paper-2: #f5efe6; --paper-3: #ece3d5;
  --ink: #16140f; --ink-2: rgba(22, 20, 15, .62); --ink-3: rgba(22, 20, 15, .4); --line: rgba(22, 20, 15, .09); --line-2: rgba(22, 20, 15, .15);
  --indigo: #283079; --indigo-2: #4a55c4; --cyan: #3fd6e8; --cyan-ink: #0e7f8c; --blush: #f3a6b6;
  --ok: #23885a; --ok-soft: #dff2e7; --warn: #b77812; --warn-soft: #f8ecd2;
  --glass: rgba(255, 253, 249, .62); --glass-line: rgba(255, 255, 255, .75);
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Geist", "Inter", system-ui, -apple-system, sans-serif;
  --mono: "Geist Mono", ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1); --ease-io: cubic-bezier(.65, 0, .35, 1);
  --shadow-1: 0 1px 1px rgba(40, 28, 10, .04), 0 2px 8px rgba(40, 28, 10, .05);
  --shadow-2: 0 1px 2px rgba(40, 28, 10, .05), 0 14px 36px -8px rgba(40, 28, 10, .14);
  --shadow-3: 0 2px 4px rgba(40, 28, 10, .05), 0 34px 90px -24px rgba(40, 28, 10, .3);
  --gutter: clamp(18px, 4.4vw, 56px); --max: 1180px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; scroll-behavior: smooth; }
html.lenis, html.lenis body { height: auto; scroll-behavior: auto; }
body { font-family: var(--sans); font-size: 16px; line-height: 1.55; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
svg { display: block; }
::selection { background: #cdeff3; color: var(--ink); }
:focus-visible { outline: 2px solid var(--indigo-2); outline-offset: 3px; border-radius: 10px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: calc(var(--max) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--mono); }
.muted { color: var(--ink-3); }

/* ---------- atmosphere ---------- */
.aura { position: fixed; inset: 0; z-index: -3; overflow: hidden; background: radial-gradient(120% 80% at 50% 0%, #fffdf9 0%, var(--paper) 55%, var(--paper-2) 100%); }
.aura i { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55; will-change: transform; }
.aura i:nth-child(1) { width: 46vmax; height: 46vmax; left: 50%; top: 38%; margin: -23vmax 0 0 -23vmax; background: radial-gradient(circle, #d9f5f8 0%, transparent 65%); animation: drift1 22s var(--ease-io) infinite alternate; }
.aura i:nth-child(2) { width: 38vmax; height: 38vmax; left: 8%; top: 60%; background: radial-gradient(circle, #fde3e6 0%, transparent 65%); opacity: .45; animation: drift2 26s var(--ease-io) infinite alternate; }
.aura i:nth-child(3) { width: 40vmax; height: 40vmax; right: -6%; top: -8%; background: radial-gradient(circle, #fff0d6 0%, transparent 65%); animation: drift3 30s var(--ease-io) infinite alternate; }
@keyframes drift1 { to { transform: translate(6vw, -5vh) scale(1.08); } }
@keyframes drift2 { to { transform: translate(10vw, -12vh) scale(1.15); } }
@keyframes drift3 { to { transform: translate(-8vw, 10vh) scale(.92); } }
.grain { position: fixed; inset: -50%; z-index: 80; pointer-events: none; opacity: .04; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); animation: grain 1s steps(6) infinite; }
@keyframes grain { 0%, 100% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); } 60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } }
#stage { position: fixed; inset: 0; z-index: -1; }
#stage canvas { width: 100% !important; height: 100% !important; display: block; }
.no-webgl #stage { background: url(/assets/chiti-poster.png) no-repeat; background-size: min(46vh, 70vw) auto; background-position: 50% 92%; }

/* ---------- type ---------- */
.display { font-family: var(--serif); font-weight: 400; font-size: clamp(3.2rem, 8.4vw, 7.6rem); line-height: .92; letter-spacing: -.035em; }
.display.sm { font-size: clamp(3rem, 7.4vw, 6.4rem); }
.h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.5rem, 5.6vw, 4.8rem); line-height: .96; letter-spacing: -.03em; }
.h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.2rem, 4.2vw, 3.6rem); line-height: 1; letter-spacing: -.025em; }
em { font-style: italic; color: var(--indigo); }
.lede { font-size: clamp(1.04rem, 1.35vw, 1.2rem); line-height: 1.55; color: var(--ink-2); letter-spacing: -.006em; max-width: 36ch; }
.chapter { font-family: var(--mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); display: flex; align-items: center; gap: 12px; }
.chapter b { color: var(--cyan-ink); font-weight: 500; }
.chapter::after { content: ""; height: 1px; width: 44px; background: currentColor; opacity: .5; }

/* words rise out of a mask */
[data-split] .w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .02em .1em; margin: 0 -.02em -.1em; }
[data-split] .w > span { display: inline-block; transform: translateY(108%) rotate(5deg); transform-origin: 0 100%; transition: transform 1.3s var(--ease); transition-delay: calc(var(--i) * 55ms + var(--d0, 0ms)); }
[data-split].in .w > span { transform: none; }
.js .rise, .js .reveal { opacity: 0; transform: translateY(18px); filter: blur(6px); transition: opacity .9s var(--ease), transform .9s var(--ease), filter .9s var(--ease); transition-delay: var(--d, 0ms); }
.js .rise.in, .js .reveal.in { opacity: 1; transform: none; filter: none; }
.fallback .rise, .fallback .reveal, .calm .rise, .calm .reveal { opacity: 1 !important; transform: none !important; filter: none !important; }
.fallback [data-split] .w > span, .calm [data-split] .w > span { transform: none !important; }

/* ---------- buttons ---------- */
.btn { --bg: var(--ink); --fg: var(--paper); position: relative; display: inline-flex; align-items: center; gap: 10px; height: 50px; padding: 0 24px; border-radius: 999px; background: var(--bg); color: var(--fg); font-weight: 500; font-size: .95rem; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; isolation: isolate; transition: transform .5s var(--ease), box-shadow .5s var(--ease); box-shadow: 0 1px 0 rgba(255, 255, 255, .14) inset, 0 12px 28px -10px rgba(22, 20, 15, .5); }
.btn::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(130px circle at var(--mx, 50%) var(--my, 50%), rgba(120, 235, 248, .35), transparent 62%); opacity: 0; transition: opacity .4s; z-index: -1; }
.btn:hover::before { opacity: 1; }
.btn:active { scale: .97; }
.btn .arrow { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .14); transition: transform .4s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }
.btn.ghost { --bg: var(--glass); --fg: var(--ink); box-shadow: 0 0 0 1px var(--line-2) inset; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.btn.ghost::before { background: radial-gradient(130px circle at var(--mx, 50%) var(--my, 50%), rgba(63, 214, 232, .18), transparent 62%); }
.btn.sm { height: 40px; padding: 0 8px 0 18px; font-size: .875rem; }

/* ---------- nav ---------- */
.nav { position: fixed; top: 14px; left: 50%; z-index: 50; width: min(calc(100% - 24px), 880px); height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 9px 0 20px; border-radius: 999px; background: var(--glass); backdrop-filter: saturate(1.6) blur(20px); -webkit-backdrop-filter: saturate(1.6) blur(20px); box-shadow: 0 0 0 1px var(--glass-line) inset, var(--shadow-2); transform: translate(-50%, 0); transition: transform .7s var(--ease); }
.js .nav { transform: translate(-50%, -140%); }
.js .nav.in { transform: translate(-50%, 0); }
.nav.hide { transform: translate(-50%, -140%) !important; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-family: var(--sans); font-weight: 600; font-size: 1.02rem; letter-spacing: .14em; }
.brand svg { width: 20px; height: 20px; color: var(--indigo); transition: transform .9s var(--ease); }
.brand:hover svg { transform: rotate(90deg); }
.brand.small { font-size: .82rem; } .brand.small svg { width: 16px; height: 16px; }
.nav-links { display: flex; gap: 2px; }
.nav-links a { padding: 8px 15px; border-radius: 999px; font-size: .9rem; color: var(--ink-2); transition: color .25s, background .25s; }
.nav-links a:hover { color: var(--ink); background: var(--line); }
@media (max-width: 720px) { .nav-links { display: none; } .nav { padding-left: 18px; } }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100svh; display: flex; flex-direction: column; align-items: center; text-align: center; padding: clamp(118px, 17vh, 176px) var(--gutter) 0; }
.hero .display { margin-top: 24px; max-width: 17ch; font-size: clamp(3.1rem, 7vw, 6.6rem); }
@media (max-width: 860px) { br.wide { display: none; } .hero .display { max-width: 11ch; } }
.hero .lede { margin: 24px auto 0; max-width: 34ch; text-align: center; }
.hero .ctas { display: flex; gap: 10px; margin-top: 30px; flex-wrap: wrap; justify-content: center; }
.status { display: inline-flex; align-items: center; gap: 10px; height: 36px; padding: 0 16px 0 13px; border-radius: 999px; font-size: .82rem; color: var(--ink-2); background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 0 0 1px var(--glass-line) inset, var(--shadow-1); }
.status b { font-weight: 600; color: var(--ink); }
.status .sep { width: 1px; height: 14px; background: var(--line-2); }
#status-text { display: inline-block; min-width: 22ch; text-align: left; transition: opacity .35s, transform .35s var(--ease); }
#status-text.out { opacity: 0; transform: translateY(-6px); }
.live { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); }
.live::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; background: var(--cyan); animation: pulse 1.9s var(--ease) infinite; }
@keyframes pulse { from { transform: scale(.4); opacity: .6; } to { transform: scale(1.7); opacity: 0; } }
@media (max-width: 520px) { #status-text { min-width: 0; } }
.has-chiti .cue { display: none; }
.cue { position: absolute; bottom: 24px; left: 50%; width: 24px; height: 38px; margin-left: -12px; border-radius: 14px; box-shadow: 0 0 0 1.3px var(--ink-3) inset; }
.cue span { position: absolute; left: 50%; top: 8px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 3px; background: var(--ink-2); animation: cue 2s var(--ease-io) infinite; }
@keyframes cue { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(12px); opacity: 0; } 100% { opacity: 0; } }

/* Chiti's speech bubble, placed over its head by main.js */
.bubble { position: fixed; left: 0; top: 0; z-index: 2; pointer-events: none; max-width: 230px; padding: 10px 15px; border-radius: 18px 18px 18px 5px; background: var(--ink); color: var(--paper); font-size: .9rem; font-weight: 500; line-height: 1.35; box-shadow: var(--shadow-2); opacity: 0; transform-origin: 0 100%; transition: opacity .35s var(--ease); will-change: transform; }
.bubble.on { opacity: 1; }
.bubble.on span { display: inline-block; animation: pop .6s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes pop { from { scale: .7; } to { scale: 1; } }

/* ---------- story ---------- */
.story { position: relative; height: 420vh; height: 420svh; }
.sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.beats { list-style: none; position: absolute; left: var(--gutter); top: 50%; width: min(540px, calc(100vw - var(--gutter) * 2)); transform: translateY(-50%); height: 560px; }
.beat { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 18px; opacity: 0; visibility: hidden; transform: translateY(30px); filter: blur(8px); transition: opacity .8s var(--ease), transform .9s var(--ease), filter .8s var(--ease), visibility 0s .8s; }
.beat.on { opacity: 1; visibility: visible; transform: none; filter: none; transition-delay: .12s, .12s, .12s, 0s; }
.beat.past { transform: translateY(-30px); }
.beat .lede { margin-bottom: 8px; }
.progress { position: absolute; left: var(--gutter); bottom: 34px; display: flex; gap: 6px; }
.progress i { width: 34px; height: 2px; border-radius: 2px; background: var(--line-2); overflow: hidden; position: relative; }
.progress i::after { content: ""; position: absolute; inset: 0; background: var(--ink); transform: scaleX(var(--p, 0)); transform-origin: 0 50%; }

.card { border-radius: 24px; padding: 18px 18px 16px; background: var(--glass); backdrop-filter: saturate(1.5) blur(22px); -webkit-backdrop-filter: saturate(1.5) blur(22px); box-shadow: 0 0 0 1px var(--glass-line) inset, var(--shadow-3); }
.card-hd { display: flex; justify-content: space-between; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-family: var(--mono); margin-bottom: 12px; }
.composer-text { min-height: 58px; font-size: 1.08rem; line-height: 1.45; color: var(--ink); padding: 4px 4px 0; }
.caret { display: inline-block; width: 2px; height: 1.15em; margin-left: 2px; vertical-align: -3px; background: var(--cyan-ink); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.composer-row { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px; border-radius: 999px; font-size: .78rem; color: var(--ink-2); background: rgba(255, 255, 255, .7); box-shadow: 0 0 0 1px var(--line) inset; }
.chip .mic { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 4px rgba(63, 214, 232, .2); }
.send { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--paper); transition: background .4s, transform .4s var(--ease); }
.composer.sent .send { background: var(--indigo-2); transform: scale(1.08); }
.steps { list-style: none; display: grid; gap: 2px; }
.steps li { display: grid; grid-template-columns: 62px 1fr 18px; align-items: center; gap: 10px; padding: 9px 6px; border-top: 1px solid var(--line); font-size: .92rem; opacity: .25; transform: translateX(-6px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.steps li:first-child { border-top: 0; }
.steps li.on { opacity: 1; transform: none; }
.steps em { font-style: normal; font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.tick { width: 18px; height: 18px; border-radius: 50%; background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 9.4 7.6 12 13 6.6' fill='none' stroke='%23fbf8f3' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--cyan-ink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.proof { display: flex; gap: 13px; align-items: flex-start; padding: 13px 12px; border-radius: 16px; }
.proof + .proof { margin-top: 8px; }
.proof i { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 600; font-size: .86rem; color: #fff; }
.proof b { display: block; font-weight: 600; font-size: .98rem; }
.proof span { font-size: .88rem; color: var(--ink-2); }
.proof.ok { background: var(--ok-soft); } .proof.ok i { background: var(--ok); } .proof.ok b { color: #145e3b; }
.proof.warn { background: var(--warn-soft); opacity: .7; } .proof.warn i { background: var(--warn); } .proof.warn b { color: #7a4f0a; }
.receipt .proof.ok { animation: none; }
.beat.on .receipt .proof.ok { animation: stamp .9s .5s cubic-bezier(.34, 1.56, .64, 1) both; }
@keyframes stamp { from { transform: scale(.92); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 860px) {
  .beats { top: auto; bottom: max(28px, env(safe-area-inset-bottom)); transform: none; height: 54svh; }
  .beat { justify-content: flex-end; gap: 12px; }
  .beat .lede { font-size: 1rem; margin-bottom: 2px; }
  .card { padding: 14px; }
  .steps li { padding: 7px 4px; font-size: .86rem; }
  .progress { left: auto; right: var(--gutter); bottom: auto; top: 88px; }
}

/* ---------- trust ---------- */
.trust { position: relative; padding: clamp(120px, 20vh, 200px) 0 clamp(40px, 6vh, 70px); }
.trust .h1 { margin-top: 20px; max-width: 13ch; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: clamp(40px, 7vh, 72px); }
.tile { position: relative; padding: 26px 24px 26px; border-radius: 26px; background: var(--glass); backdrop-filter: saturate(1.4) blur(18px); -webkit-backdrop-filter: saturate(1.4) blur(18px); box-shadow: 0 0 0 1px var(--glass-line) inset, var(--shadow-2); transition: transform .6s var(--ease), box-shadow .6s var(--ease); }
.tile:hover { transform: translateY(-4px); box-shadow: 0 0 0 1px var(--glass-line) inset, var(--shadow-3); }
.tile .glyph { display: block; width: 40px; height: 40px; color: var(--indigo); margin-bottom: 34px; }
.tile .glyph svg { width: 100%; height: 100%; }
.tile h3 { font-family: var(--serif); font-weight: 400; font-size: 1.7rem; line-height: 1.05; letter-spacing: -.015em; }
.tile p { margin-top: 10px; color: var(--ink-2); font-size: .98rem; max-width: 26ch; }
@media (max-width: 860px) { .tiles { grid-template-columns: 1fr; } .tile .glyph { margin-bottom: 20px; } }

/* ---------- join ---------- */
.join { position: relative; min-height: 92svh; display: flex; align-items: flex-start; padding: clamp(100px, 15vh, 150px) 0 120px; text-align: center; }
.join .wrap { display: flex; flex-direction: column; align-items: center; }
.join .lede { margin: 22px auto 0; text-align: center; max-width: 40ch; }
.signup { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 32px; width: min(100%, 470px); padding: 6px; border-radius: 999px; background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 0 0 1px var(--glass-line) inset, var(--shadow-2); }
.signup input { flex: 1 1 180px; min-width: 0; height: 50px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; font-size: 1rem; outline: none; }
.signup input::placeholder { color: var(--ink-3); }
.signup:focus-within { box-shadow: 0 0 0 1px var(--glass-line) inset, 0 0 0 2px rgba(74, 85, 196, .35), var(--shadow-2); }
.form-note { min-height: 1.4em; margin-top: 14px; font-size: .9rem; color: var(--ink-2); }
.form-note.ok { color: var(--ok); } .form-note.err { color: #b3261e; }
@media (max-width: 520px) { .signup { border-radius: 28px; } .signup .btn { width: 100%; justify-content: center; } }

/* ---------- footer ---------- */
.foot { position: relative; padding: 26px 0 32px; border-top: 1px solid var(--line); font-size: .85rem; }
.foot-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.foot a:hover { color: var(--ink); }

/* ---------- plain pages (privacy, 404) ---------- */
.page { max-width: 680px; margin: 0 auto; padding: 150px var(--gutter) 100px; }
.page h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.6rem, 6vw, 4.2rem); line-height: 1; letter-spacing: -.03em; margin-bottom: 26px; }
.page h2 { font-family: var(--serif); font-weight: 400; font-size: 1.7rem; margin: 34px 0 8px; }
.page p, .page li { color: var(--ink-2); margin-top: 10px; }
.page ul { padding-left: 20px; }

@media (prefers-reduced-motion: reduce) {
  .aura i, .grain, .cue span, .live::after { animation: none; }
}
