:root {
  /* Yovahti palette: night + neutral paper; colour carries meaning, never decoration */
  --bg: #F6F7F4; --card: #ECEEEA; --ink: #0F172A; --ink2: #3F4A5C; --mute: #5B6577; --rule: #DDE1DB;
  --brand: #4F46E5; --brand-soft: #A5B4FC; --brand-tint: #EEF0FF;
  --good: #16A34A; --good-ink: #166534; --good-soft: #4ADE80;
  --bad: #DC2626; --bad-ink: #B91C1C; --bad-soft: #F87171; --bad-tint: #FEE2E2;
  --wave: #38BDF8; --sleep: #94A3B8; --sleep-ink: #475569; --moon: #FBBF24;
  --night: #0B1220; --night2: #16213A;
  --ease: cubic-bezier(.22, .9, .24, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--ink); font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }

/* ---------- top bar ---------- */
.bar { position: fixed; inset: 0 0 auto 0; z-index: 20; display: flex; align-items: center; gap: 22px; padding: 16px 28px; font-size: 14px; font-weight: 600; letter-spacing: .02em; pointer-events: none; transition: color .6s var(--ease); }
.bar > * { pointer-events: auto; }
.bar .brand { display: flex; align-items: center; gap: 10px; letter-spacing: .14em; text-transform: uppercase; text-decoration: none; }
.bar .brand svg { width: 22px; height: 22px; }
.bar .sp { flex: 1; }
.bar a.lnk { text-decoration: none; opacity: .75; }
.bar a.lnk:hover { opacity: 1; }
.bar a.cta { text-decoration: none; padding: 8px 14px; border-radius: 999px; background: var(--brand); color: #fff; }
body.dark .bar { color: #E2E8F0; }
body.dark .bar a.cta { background: var(--brand-soft); color: var(--night); }

/* ---------- scrollytelling ---------- */
.scene { position: relative; }
.sticky { position: sticky; top: 0; height: 100vh; overflow: hidden; transition: background .8s var(--ease); }
.scene.dark .sticky { background-color: var(--night); background-image: radial-gradient(120% 90% at 50% 20%, var(--night2), var(--night)); color: #E2E8F0; }
.stage { position: absolute; left: 50%; top: 50%; width: 1600px; height: 900px; transform-origin: center; transform: translate(-50%, -50%); }
.progress { position: fixed; right: 22px; top: 50%; transform: translateY(-50%); z-index: 20; display: flex; flex-direction: column; gap: 10px; }
.progress a { width: 8px; height: 8px; border-radius: 4px; background: var(--rule); transition: all .4s var(--ease); display: block; }
.progress a.on { height: 30px; background: var(--brand); }
body.dark .progress a { background: #24324D; }
body.dark .progress a.on { background: var(--brand-soft); }

/* ---------- type ---------- */
.tag { position: absolute; left: 90px; top: 90px; font-size: 17px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--mute); }
.tag b { color: var(--brand); margin-right: 12px; }
.scene.dark .tag b { color: var(--brand-soft); }
.scene.dark .tag { color: #94A3B8; }
.big { font-weight: 800; letter-spacing: -.04em; line-height: .95; }
.h { font-size: 76px; font-weight: 800; letter-spacing: -.035em; line-height: 1.0; }
.h2 { font-size: 46px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.lbl { font-size: 22px; font-weight: 500; color: var(--ink2); line-height: 1.35; }
.scene.dark .lbl { color: #CBD5E1; }
.cap { font-size: 15px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }
.scene.dark .cap { color: #94A3B8; }
.num { font-variant-numeric: tabular-nums; }
.brand { color: var(--brand); } .good { color: var(--good-ink); } .bad { color: var(--bad-ink); } .sleepc { color: var(--sleep-ink); }
.scene.dark .brand { color: var(--brand-soft); } .scene.dark .good { color: var(--good-soft); } .scene.dark .bad { color: var(--bad-soft); }
.note { position: absolute; left: 90px; bottom: 56px; font-size: 14px; color: var(--mute); max-width: 1100px; }
.scene.dark .note { color: #94A3B8; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; border: 1.5px solid currentColor; margin-right: 8px; }

/* ---------- reveal system (from the Tasehinta deck) ---------- */
.r { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .8s var(--ease); }
.r.in { opacity: 1; transform: none; }
.fade { opacity: 0; transition: opacity .9s var(--ease); }
.fade.in { opacity: 1; }
.draw { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.8s var(--ease); }
.draw.in { stroke-dashoffset: 0; }
.grow { transform: scaleY(0); transform-origin: bottom; transition: transform 1s var(--ease); }
.grow.in { transform: scaleY(1); }
.growx { transform: scaleX(0); transform-origin: left; transition: transform 1.1s var(--ease); }
.growx.in { transform: scaleX(1); }
.pop { opacity: 0; transform: scale(.85) translateY(20px); transition: opacity .6s var(--ease), transform .8s cubic-bezier(.2, 1.4, .4, 1); }
.pop.in { opacity: 1; transform: none; }

/* ---------- isometric pieces ---------- */
.iso { position: absolute; }
.iso img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.float { animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px); } }
.site { position: absolute; }
.site img { position: absolute; inset: 0; width: 100%; transition: opacity .9s var(--ease); }
.site .off { opacity: 0; }
.site.asleep .off { opacity: 1; }
.site.asleep .on { opacity: 0; }
.scene.dark .site img { filter: drop-shadow(0 0 30px rgba(56, 189, 248, .14)); }
.waves { position: absolute; width: 160px; height: 160px; transform: translate(-50%, -50%); pointer-events: none; transition: opacity .6s; }
.waves i { position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--wave); opacity: 0; animation: ping 2.6s var(--ease) infinite; }
.waves i:nth-child(2) { animation-delay: .85s; } .waves i:nth-child(3) { animation-delay: 1.7s; }
@keyframes ping { 0% { transform: scale(.15); opacity: .9; } 100% { transform: scale(1); opacity: 0; } }
.site.asleep .waves { opacity: 0; }
.zzz { position: absolute; font-weight: 800; color: var(--sleep-ink); opacity: 0; transition: opacity .6s; pointer-events: none; }
.scene.dark .zzz { color: #CBD5E1; }
.site.asleep .zzz { opacity: 1; }
.zzz span { position: absolute; animation: zz 3s ease-in infinite; opacity: 0; }
.zzz span:nth-child(2) { animation-delay: 1s; font-size: 1.3em; } .zzz span:nth-child(3) { animation-delay: 2s; font-size: 1.6em; }
@keyframes zz { 0% { transform: translate(0, 0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translate(40px, -90px); opacity: 0; } }
.alarm { position: absolute; width: 120px; height: 120px; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle, rgba(220, 38, 38, .5), rgba(220, 38, 38, 0) 70%); opacity: 0; transition: opacity .5s; animation: pulse 1.2s ease-in-out infinite; pointer-events: none; }
.alarm.in { opacity: 1; }
@keyframes pulse { 50% { transform: translate(-50%, -50%) scale(1.25); } }

/* ---------- cards and pieces ---------- */
.card { background: var(--card); border-radius: 24px; }
.scene.dark .card { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); }
.cal { position: absolute; width: 470px; border-radius: 22px; background: #fff; box-shadow: 0 24px 60px rgba(15, 23, 42, .10); padding: 22px 24px; }
.cal h4 { font-size: 14px; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); margin-bottom: 12px; }
.ev { display: flex; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--rule); }
.ev:first-of-type { border-top: 0; }
.ev .t { font-weight: 800; font-size: 20px; width: 64px; font-variant-numeric: tabular-nums; }
.ev .d { font-size: 16px; line-height: 1.3; color: var(--ink2); }
.ev .d b { color: var(--ink); }
.ev img { width: 54px; }
.ev.hot { background: var(--brand-tint); margin: 0 -24px; padding: 10px 24px; }
.ev.evil { background: var(--bad-tint); margin: 0 -24px; padding: 10px 24px; }
.ev.evil .d b { color: var(--bad-ink); }
.glitch { animation: glitch .25s steps(2) 3; }
@keyframes glitch { 0% { transform: translateX(-3px); } 50% { transform: translateX(3px); } }
.bubble { position: absolute; background: #fff; border-radius: 18px; padding: 14px 18px; font-size: 18px; font-weight: 600; line-height: 1.3; box-shadow: 0 18px 40px rgba(15, 23, 42, .10); }
.bubble:after { content: ""; position: absolute; left: 30px; bottom: -10px; border: 10px solid transparent; border-top-color: #fff; border-bottom: 0; }
.pill { display: inline-flex; align-items: center; gap: 10px; padding: 12px 22px; border-radius: 999px; font-size: 20px; font-weight: 600; }
.row { display: flex; align-items: center; gap: 16px; }
.dot { display: inline-block; width: 14px; height: 14px; border-radius: 7px; }
.mx { border-collapse: separate; border-spacing: 0 10px; font-size: 20px; }
.mx th { font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); text-align: left; font-weight: 600; padding: 0 22px 4px 0; }
.mx td { padding: 10px 22px 10px 0; font-weight: 600; }
.v { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.v i { width: 26px; height: 26px; border-radius: 13px; display: inline-grid; place-items: center; color: #fff; font-style: normal; font-size: 15px; }
.v.ok i { background: var(--good); } .v.bad i { background: var(--bad); } .v.na i { background: #64748B; }
.quote { position: absolute; width: 440px; padding: 26px 28px; }
.quote q { display: block; font-size: 25px; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }
.quote .lbl { font-size: 17px; margin-top: 12px; }
.flow { position: absolute; display: flex; align-items: center; gap: 0; }
.node { width: 200px; text-align: center; }
.node .box { height: 150px; border-radius: 22px; background: #fff; box-shadow: 0 18px 40px rgba(15, 23, 42, .07); display: grid; place-items: center; font-size: 46px; }
.node .lbl { font-size: 17px; margin-top: 12px; font-weight: 600; color: var(--ink); }
.node .cap { margin-top: 4px; font-size: 12px; }
.arrow { width: 70px; height: 4px; background: var(--rule); position: relative; margin-top: -40px; }
.arrow:after { content: ""; position: absolute; right: -2px; top: -6px; border: 8px solid transparent; border-left-color: var(--rule); border-right: 0; }
.arrow i { position: absolute; inset: 0; background: var(--brand); transform: scaleX(0); transform-origin: left; transition: transform .8s var(--ease); }
.arrow.in i { transform: scaleX(1); }
.inv { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.inv div { background: #fff; border-radius: 14px; padding: 12px 16px; font-size: 16px; font-weight: 600; }
.inv b { color: var(--brand); margin-right: 8px; }
.stamp { position: absolute; width: 150px; height: 150px; border-radius: 50%; border: 5px solid var(--good); color: var(--good-ink); display: grid; place-items: center; text-align: center; font-weight: 800; font-size: 18px; letter-spacing: .06em; transform: rotate(-12deg) scale(1.6); opacity: 0; transition: all .5s cubic-bezier(.2, 1.4, .4, 1); }
.stamp.in { opacity: 1; transform: rotate(-12deg) scale(1); }
.stamp.red { border-color: var(--bad); color: var(--bad-ink); }
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 16px 26px; border-radius: 999px; font-size: 20px; font-weight: 700; text-decoration: none; }
.btn.dark { background: var(--ink); color: #fff; }
.btn.line { border: 2px solid var(--ink); color: var(--ink); }
.scroll-hint { position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%); font-size: 14px; letter-spacing: .14em; text-transform: uppercase; color: var(--sleep-ink); animation: hint 2s ease-in-out infinite; }
@keyframes hint { 50% { transform: translate(-50%, 8px); } }
.particles { position: absolute; inset: 0; pointer-events: none; }

/* ---------- small screens: stack instead of scaling to nothing ---------- */
@media (max-aspect-ratio: 4/5) { .progress { display: none; } }
@media (max-width: 760px), (max-height: 560px) {
  .bar { gap: 14px; padding: 12px 16px; font-size: 13px; }
  .bar .brand { gap: 8px; letter-spacing: .1em; }
  .bar a.cta { display: none; }
}
.rotate-note { display: none; }
@media (max-aspect-ratio: 4/5) and (max-width: 820px) {
  .rotate-note { display: flex; position: fixed; left: 12px; right: 12px; bottom: 14px; z-index: 30; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--ink); color: #F1F5F9; font-size: 14px; line-height: 1.4; box-shadow: 0 8px 28px rgba(15, 23, 42, .28); }
  .rotate-note a { color: var(--brand-soft); font-weight: 600; }
  .rotate-note button { flex: none; margin-left: auto; width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: inherit; font-size: 20px; line-height: 1; cursor: pointer; }
  .rotate-note.gone { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { animation: none !important; transition: none !important; }
}

/* ---------- day / night ---------- */
#s1 .sticky { background: linear-gradient(180deg, #CFE6F6 0%, #EEF4F7 55%, #F6F7F4 100%); }
.sky-night { position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 20%, var(--night2), var(--night)); opacity: 0; transition: opacity 1.4s var(--ease); }
#s1.is-night .sky-night { opacity: 1; }
#s1 .stage { color: var(--ink); transition: color 1.2s var(--ease); }
#s1.is-night .stage { color: #E2E8F0; }
#s1.is-night .tag, #s1.is-night .lbl { color: #CBD5E1; }
#s1.is-night .bad { color: var(--bad-soft); }
.daynight img { transition: opacity 1.4s var(--ease); }
.daynight img.night { position: absolute; left: 0; top: 0; width: 100%; opacity: 0; }
.site.daynight img.day { position: absolute; inset: 0; width: 100%; }
#s1.is-night .daynight img.night { opacity: 1; }
#s1.is-night .daynight img.day { opacity: 0; }
.iso.daynight { position: absolute; }
.iso.daynight img.day { position: relative; }
.gl { position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); white-space: nowrap; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; opacity: 0; transition: opacity .6s; }
.gl.quiet { background: #E2E8F0; color: #334155; }
.gl.busy { background: #E0F2FE; color: #075985; }
.lbl-on .gl { opacity: 1; }

#s1.is-night .scroll-hint { color: #94A3B8; }
/* ---------- them vs us ---------- */
.vs-col { position: absolute; top: 230px; width: 680px; }
.vs-head { display: flex; align-items: center; gap: 14px; }
.vs-pill { font-size: 18px; font-weight: 800; padding: 6px 16px; border-radius: 999px; }
.vs-pill.gray { background: #E2E5EA; color: #334155; }
.vs-pill.brand-bg { background: var(--brand); color: #fff; }
.vs-body { display: flex; gap: 22px; margin-top: 16px; align-items: flex-start; }
.vs-art { position: relative; width: 250px; flex: none; }
.vs-art img { width: 250px; display: block; }
.zoom { position: absolute; left: -10px; top: 150px; width: 120px; height: 120px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 10px 30px rgba(15, 23, 42, .18); background-size: 700px auto; background-repeat: no-repeat; background-color: var(--bg); }
.zoom-cap { position: absolute; left: -10px; top: 278px; width: 140px; text-align: center; font-size: 13px; font-weight: 700; color: var(--ink2); }
.vs-steps { list-style: none; counter-reset: st; display: flex; flex-direction: column; gap: 14px; margin-top: 10px; }
.vs-steps li { counter-increment: st; position: relative; padding-left: 44px; font-size: 20px; line-height: 1.3; color: var(--ink2); }
.vs-steps li b { color: var(--ink); }
.vs-steps li:before { content: counter(st); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 15px; background: var(--card); display: grid; place-items: center; font-weight: 800; font-size: 15px; color: var(--ink); }
.vsr { display: grid; grid-template-columns: 250px 1fr 1fr; gap: 26px; align-items: center; padding: 5px 0; }
.vsr .m { font-size: 17px; font-weight: 700; }
.vsr .cell { display: flex; align-items: center; gap: 12px; }
.vsr .vbar { height: 16px; border-radius: 0 5px 5px 0; }
.vsr .val { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- PDF capture (?at=scene:step) ---------- */
body.capture .bar, body.capture .progress, body.capture .scroll-hint { display: none; }
body.capture *, body.capture *::before, body.capture *::after { transition: none !important; animation: none !important; }

/* ---------- keyword highlight + show-don't-tell pieces ---------- */
.k { color: var(--brand); font-weight: 700; }
.scene.dark .k { color: var(--brand-soft); }
.lbl b.good, .lbl b.bad { font-weight: 700; }
.yr { font-size: 64px; font-weight: 800; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.fp { display: flex; height: 92px; border-radius: 16px; overflow: hidden; }
.fp div { display: flex; align-items: center; padding: 0 20px; font-size: 19px; font-weight: 700; color: #fff; white-space: nowrap; }
.trend { display: flex; align-items: flex-end; gap: 46px; height: 300px; }
.trend .col { width: 150px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.trend .tb { width: 100%; border-radius: 14px 14px 4px 4px; background: var(--bad); transition: height 1.2s var(--ease); }
.trend .v { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.code { font-family: "Cascadia Code", Consolas, ui-monospace, monospace; font-size: 15px; line-height: 1.55; background: var(--night); color: #E2E8F0; border-radius: 14px; padding: 16px 18px; white-space: pre; overflow: hidden; }
.code .c { color: #94A3B8; } .code .g { color: var(--good-soft); } .code .x { color: var(--bad-soft); } .code .b { color: var(--brand-soft); }
.chk { font-size: 19px; font-weight: 700; display: flex; flex-direction: column; gap: 8px; }
.chk .good::before { content: "✓ "; } .chk .bad::before { content: "✗ "; }
.lbl b:not(.good):not(.bad), .vs-steps b:not(.good):not(.bad) { color: var(--brand); font-weight: 700; }
.scene.dark .lbl b:not(.good):not(.bad) { color: var(--brand-soft); }
.dial { list-style: none; margin-top: 12px; display: flex; flex-direction: column; gap: 14px; }
.dial li { display: grid; grid-template-columns: 1fr auto; column-gap: 14px; row-gap: 2px; padding: 14px 18px; background: var(--brand-tint); border-radius: 16px; }
.dial .dl { font-size: 21px; font-weight: 800; color: var(--brand); }
.dial .dv { font-size: 28px; font-weight: 800; letter-spacing: -.02em; grid-row: span 2; align-self: center; }
.dial .dd { font-size: 17px; color: var(--ink2); line-height: 1.3; }
.dial .dd b { color: var(--brand); }
.arrow:after { transition: border-color .8s var(--ease); } .arrow.in:after { border-left-color: var(--brand); }
.iface { flex: 1; padding: 24px 26px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: 14px; font-weight: 600; padding: 5px 11px; border-radius: 999px; background: #fff; color: var(--ink2); border: 1.5px solid var(--rule); font-family: "Cascadia Code", Consolas, ui-monospace, monospace; }
.chip.act { border-color: var(--brand); color: var(--brand); }
.chip.bad { border-color: var(--bad-soft); color: var(--bad-ink); background: var(--bad-tint); font-family: inherit; }
.chip.ok { border-color: var(--good-soft); color: var(--good-ink); font-family: inherit; }
