/* ================================
   Zerikc — home
   ================================ */

@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: block;
  src: url(../fonts/inter-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: block;
  src: url(../fonts/inter-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: block;
  src: url(../fonts/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #0a0a0b;
  --bg-2: #131315;
  --text: #ededea;
  --dim: #85858a;
  --line: rgba(237, 237, 234, .14);
  --line-2: rgba(237, 237, 234, .3);
  --ink: #0a0a0b;
  --pad: clamp(20px, 3.6vw, 56px);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.76, 0, .24, 1);
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --stack-shadow: rgba(30, 20, 40, .28);
  --bg: #f2f1ee;
  --bg-2: #e9e8e4;
  --text: #0e0e10;
  --dim: #626268;
  --line: rgba(14, 14, 16, .14);
  --line-2: rgba(14, 14, 16, .32);
  --ink: #f2f1ee;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }   /* keeps the width the same while the loader locks scrolling, so the hero never jumps */
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.55 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden; }
html.is-loading, html.is-loading body { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; font-weight: inherit; }
::selection { background: var(--text); color: var(--bg); }
:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; line-height: 1.4; }
.dim { color: var(--dim); }
.skip { position: fixed; left: 12px; top: -60px; z-index: 300; padding: 10px 16px; background: var(--text); color: var(--bg); }
.skip:focus { top: 12px; }
.label { color: var(--dim); margin-bottom: 28px; }

/* ---------- loader ---------- */
.loader { position: fixed; inset: 0; z-index: 250; background: var(--bg); display: flex; flex-direction: column; justify-content: space-between; padding: var(--pad);
  transition: transform 1s var(--ease-io); }
.loader-top { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.loader-num { font-size: clamp(90px, 22vw, 340px); font-weight: 700; letter-spacing: -.06em; line-height: .8; display: flex; align-items: flex-start; font-variant-numeric: tabular-nums; }
.loader-num small { font-size: .22em; margin-top: .08em; letter-spacing: 0; font-weight: 500; }
.loader.done { transform: translateY(-100%); pointer-events: none; }
html:not(.js) .loader, html.skip-loader .loader { display: none; }

/* ---------- cursor ---------- */
.cursor, .peek { display: none; }
@media (hover: hover) and (pointer: fine) {
  .js .cursor { will-change: transform; display: grid; position: fixed; left: 0; top: 0; z-index: 400; pointer-events: none; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
    background: #fff; mix-blend-mode: difference; place-items: center; transition: width .35s var(--ease), height .35s var(--ease), margin .35s var(--ease), opacity .3s; opacity: 0; }
  .cursor.on { opacity: 1; }
  .cursor.big { width: 76px; height: 76px; margin: -38px 0 0 -38px; }
  .cursor.big.has-label { width: 92px; height: 92px; margin: -46px 0 0 -46px; }
  .cursor span { font-family: var(--mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: #000; opacity: 0; transition: opacity .2s; white-space: nowrap; }
  .cursor.has-label span { opacity: 1; }
  .peek { display: block; position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; width: 160px; height: 160px; margin: -80px 0 0 -80px; border-radius: 34px; overflow: hidden;
    opacity: 0; transform: scale(.6); transition: opacity .3s, transform .45s var(--ease); box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .6); }
  .peek.on { opacity: 1; }
  .peek img { width: 100%; height: 100%; object-fit: cover; }
  .cursor-on body, .cursor-on a, .cursor-on button, .cursor-on input { cursor: none; }
}

/* ---------- top bar ---------- */
.bar { position: fixed; top: 0; left: 0; right: 0; z-index: 120; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 18px var(--pad); color: var(--text); }
.bar::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: calc(100% + 34px); z-index: -1; pointer-events: none; background: linear-gradient(color-mix(in srgb, var(--bg) 88%, transparent), color-mix(in srgb, var(--bg) 55%, transparent) 55%, transparent); }
.bar-brand { font-weight: 600; font-size: 17px; letter-spacing: -.02em; }
.bar-brand sup { font-size: 10px; margin-left: 2px; }
.bar-nav { display: flex; gap: 6px; }
.bar-nav a { position: relative; padding: 8px 14px; font-size: 14px; font-weight: 500; }
.bar-nav a sup { font-family: var(--mono); font-size: 10px; margin-left: 3px; opacity: .7; }
.bar-nav a::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ease); }
.bar-nav a.active::after { transform: scaleX(1); transform-origin: left; }
@media (hover: hover) { .bar-nav a:hover::after { transform: scaleX(1); transform-origin: left; } }
.bar-tools { display: flex; gap: 8px; justify-self: end; }
.chip { height: 34px; min-width: 34px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 99px; font-family: var(--mono); font-size: 12px; letter-spacing: .04em; display: grid; place-items: center; text-align: center; transition: background .3s, color .3s; }
@media (hover: hover) { .chip:hover { background: var(--text); color: var(--bg); } }
.bar-menu { display: none; }
.menu-ico { display: block; width: 14px; height: 8px; border-top: 2px solid currentColor; border-bottom: 2px solid currentColor; }
.motion-ico { display: block; width: 10px; height: 12px; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }
#motionBtn[aria-pressed="true"] .motion-ico { width: 0; height: 0; margin-left: 2px; border: 0; border-left: 10px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.theme-dot { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid currentColor; background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.progress { position: fixed; left: 0; top: 0; height: 2px; width: 100%; background: var(--text); transform-origin: 0 50%; transform: scaleX(0); z-index: 130; }

/* ---------- hero ---------- */
.hero { min-height: 100svh; padding: 110px var(--pad) var(--pad); display: flex; flex-direction: column; justify-content: space-between; position: relative; }
.hero-top { display: flex; justify-content: space-between; gap: 20px; color: var(--dim); }
.mega { font-size: min(28vw, 56svh); line-height: .82; letter-spacing: -.055em; font-weight: 800; display: flex; justify-content: center; margin: 0 -.02em; white-space: nowrap; user-select: none; }
.mega .ch { display: inline-block; overflow: hidden; padding: .06em .055em .1em 0; margin-right: -.055em; font-variation-settings: normal; font-weight: 800; }
.js .mega .ch { transform: translateY(105%); }
.js.ready .mega .ch { transform: none; transition: transform 1.2s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.hero-bottom { display: grid; grid-template-columns: 1.3fr auto 1fr; gap: 24px; align-items: end; }
.hero-lead { max-width: 30ch; font-size: clamp(18px, 1.7vw, 26px); line-height: 1.25; letter-spacing: -.02em; font-weight: 500; }
.hero-scroll { display: flex; flex-direction: column; align-items: center; gap: 14px; color: var(--dim); }
.hero-scroll-line { width: 1px; height: 54px; background: var(--line-2); position: relative; overflow: hidden; }
.hero-scroll-line::after { content: ''; position: absolute; inset: 0; background: var(--text); transform: translateY(-100%); animation: drip 2.2s var(--ease-io) infinite; }
@keyframes drip { 60%, 100% { transform: translateY(100%); } }
.hero-count { display: flex; align-items: flex-end; gap: 14px; justify-self: end; text-align: right; }
.hero-count strong { font-size: clamp(56px, 7vw, 110px); line-height: .8; letter-spacing: -.06em; font-weight: 700; }
.hero-count span { color: var(--dim); max-width: 12ch; text-align: left; }
.js .hero-top, .js .hero-bottom { clip-path: inset(0 0 100% 0); transform: translateY(18px); }   /* revealed from the baseline, like the big letters (clip, not opacity, so the text is never half-faded) */
.js.ready .hero-top, .js.ready .hero-bottom { clip-path: inset(-12px -8px -12px -8px); transform: none; transition: clip-path 1s var(--ease) .75s, transform 1s var(--ease) .75s; }
.js.skip-loader.ready .hero-top, .js.skip-loader.ready .hero-bottom { transition-delay: .15s; }

/* ---------- statement ---------- */
.statement { padding: clamp(100px, 16vw, 240px) var(--pad); }
.statement-text { font-size: clamp(28px, 4.9vw, 78px); line-height: 1.06; letter-spacing: -.04em; font-weight: 600; max-width: 22ch; margin-left: auto; }
.statement-text .w { opacity: .5; transition: opacity .25s linear; }   /* unread words stay above WCAG AA (4.5:1) in both themes */
:root[data-theme="light"] .statement-text .w:not(.on) { opacity: .56; }
.statement-text .w.on { opacity: 1; }
@media (max-width: 900px) { .statement-text { margin-left: 0; max-width: none; } }

/* ---------- headings ---------- */
.h-xl { font-size: clamp(44px, 8.4vw, 150px); line-height: .92; letter-spacing: -.055em; font-weight: 700; }
.h-lg { font-size: clamp(36px, 6vw, 100px); line-height: .95; letter-spacing: -.05em; font-weight: 700; }
.line { display: block; overflow: hidden; padding: 0 0 .1em; margin-bottom: -.1em; }
.line > .wd { display: inline-block; transform: translateY(105%); transition: transform 1.1s var(--ease); transition-delay: calc(var(--i) * 50ms); }
[data-split].in .line > .wd { transform: none; }
html:not(.js) .line > .wd { transform: none; }

/* ---------- work / chapters ---------- */
.work { padding-top: clamp(40px, 6vw, 100px); }
.work-head { padding: 0 var(--pad) clamp(60px, 8vw, 120px); }
.chapters { position: relative; }
.chapter { position: sticky; top: var(--stick, 0px); min-height: calc(100svh + var(--dwell, 12svh)); display: flex; align-items: center; padding: clamp(80px, 9vw, 130px) var(--pad) calc(clamp(40px, 5vw, 70px) + var(--dwell, 12svh));
  background:
    radial-gradient(1000px 700px at 84% 16%, color-mix(in srgb, var(--c) 36%, transparent), transparent 62%),
    radial-gradient(820px 620px at 4% 104%, color-mix(in srgb, var(--c2, var(--c)) 26%, transparent), transparent 66%),
    linear-gradient(165deg, color-mix(in srgb, var(--c) 17%, var(--bg)), color-mix(in srgb, var(--c2, var(--c)) 7%, var(--bg)) 70%);
  border-radius: 28px 28px 0 0; transition: border-radius .3s var(--ease); box-shadow: inset 0 1px 0 color-mix(in srgb, var(--c) 42%, transparent), 0 -26px 70px -14px var(--stack-shadow, rgba(0, 0, 0, .6));
  transform-origin: 50% 0; will-change: transform; overflow: hidden; isolation: isolate; }
.chapter::before { content: ''; position: absolute; right: 0; top: 50%; width: 52%; aspect-ratio: 1; transform: translateY(-50%); border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--c) 34%, transparent), transparent 68%); pointer-events: none; }
.chapter::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: url(../images/noise.png?v=2) 0 0 / 128px 128px; }
.chapter.is-pinned { border-radius: 0; }
.chapter.is-receding { border-radius: 28px; }
.chapter-shade { position: absolute; inset: 0; z-index: 2; background: var(--bg); opacity: 0; pointer-events: none; border-radius: inherit; }
.chapter-body { position: relative; z-index: 1; will-change: transform; width: 100%; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: clamp(30px, 5vw, 90px); align-items: center; }
.chapter-meta { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.num { font-family: var(--mono); font-size: 12px; color: var(--c); letter-spacing: .06em; }
.chapter-icon { width: 44px; height: 44px; border-radius: 11px; border: 1px solid var(--line); }
.tag { color: var(--dim); }
.chapter-title { font-size: clamp(64px, 12.5vw, 230px); line-height: .84; letter-spacing: -.07em; font-weight: 800; margin-left: -.04em; padding-bottom: .06em; }
.chapter-lead { margin-top: clamp(20px, 3vw, 36px); max-width: 44ch; font-size: clamp(17px, 1.5vw, 22px); line-height: 1.35; letter-spacing: -.01em; }
.facts { margin-top: 28px; max-width: 520px; border-top: 1px solid var(--line); }
.facts li { padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 15px; display: flex; gap: 12px; align-items: baseline; }
.facts li::before { content: ''; flex: none; width: 6px; height: 6px; background: var(--c); border-radius: 50%; transform: translateY(-1px); }
.chapter-foot { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; }
.store img { height: 42px; width: auto; transition: transform .5s var(--ease); }
@media (hover: hover) { .store:hover img { transform: translateY(-3px); } }

/* toki: why + live codes */
.chapter-note { margin-top: 14px; font-size: 11px; }
.chapter-link { font-size: 14px; font-weight: 500; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.chapter-why { margin-top: 22px; max-width: 56ch; display: grid; gap: 10px; font-size: 15px; line-height: 1.5; color: color-mix(in srgb, var(--text) 74%, transparent); }
.chapter-why p { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: 12px; align-items: baseline; }
.chapter-why .mono { color: var(--c); }
@media (max-width: 700px) { .chapter-why p { grid-template-columns: 1fr; gap: 2px; } }
.otp { margin-top: 26px; max-width: 640px; }
.otp[hidden] { display: none; }
.otp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.otp-item { position: relative; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "who ring" "code code"; gap: 10px 8px; align-items: center; padding: 14px 14px 12px; border: 1px solid var(--line-2); border-radius: 16px; background: color-mix(in srgb, var(--bg) 52%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: border-color .3s, background .3s, transform .5s var(--ease); }
@media (hover: hover) { .otp-item:hover { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, transparent); } }
.otp-who { grid-area: who; min-width: 0; display: grid; }
.otp-who b { font-size: 13px; font-weight: 600; }
.otp-who i { font-style: normal; font-size: 11px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.otp-code { grid-area: code; font-size: clamp(22px, 2.4vw, 30px); letter-spacing: .08em; text-transform: none; font-weight: 600; font-variant-numeric: tabular-nums; }
.otp-ring { grid-area: ring; width: 22px; height: 22px; transform: rotate(-90deg); }
.otp-ring circle { fill: none; stroke-width: 3; }
.otp-ring .trk { stroke: var(--line-2); }
.otp-ring .bar { stroke: var(--k, var(--c)); stroke-dasharray: 100; stroke-linecap: round; }
.otp.low .otp-ring .bar { stroke: #ff6b5c; }
.otp.low .otp-code { color: #ff6b5c; }
.otp-hint { margin-top: 12px; color: var(--dim); }
.otp.copied .otp-msg { color: var(--c); }
@media (max-width: 700px) {
  .otp-grid { grid-template-columns: 1fr; gap: 8px; }
  .otp-item { grid-template-columns: 1fr auto auto; grid-template-areas: "who code ring"; padding: 10px 14px; }
}

/* windly: the weather follows the phone (sky tint + particles over the whole card) */
@property --s1 { syntax: '<color>'; inherits: false; initial-value: rgba(255, 200, 90, .5); }
@property --s2 { syntax: '<color>'; inherits: false; initial-value: rgba(89, 178, 255, .4); }
#windly { --s1: rgba(255, 200, 90, .5); --s2: rgba(89, 178, 255, .4); }
#windly[data-wx="sun"] { --s1: rgba(255, 200, 90, .55); --s2: rgba(89, 178, 255, .4); }
#windly[data-wx="rain"] { --s1: rgba(70, 92, 130, .6); --s2: rgba(52, 68, 98, .55); }
#windly[data-wx="night"] { --s1: rgba(30, 44, 98, .65); --s2: rgba(15, 26, 58, .6); }
#windly[data-wx="snow"] { --s1: rgba(200, 216, 240, .6); --s2: rgba(150, 175, 210, .4); }
#floralia { --s1: rgba(176, 128, 255, .6); --s2: rgba(255, 150, 215, .4); }
#floralia[data-p="1"] { --s1: rgba(255, 90, 140, .55); --s2: rgba(200, 40, 95, .4); }
#floralia[data-p="2"] { --s1: rgba(255, 170, 205, .55); --s2: rgba(160, 225, 185, .35); }
#floralia[data-p="3"] { --s1: rgba(176, 128, 255, .6); --s2: rgba(255, 150, 215, .4); }
#floralia[data-p="4"] { --s1: rgba(150, 135, 225, .5); --s2: rgba(110, 130, 200, .4); }
.chapter-sky { position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .8; transition: --s1 1.1s ease, --s2 1.1s ease;
  background: radial-gradient(120% 80% at 82% 0%, var(--s1), transparent 62%), linear-gradient(180deg, var(--s2), transparent 75%); }
:root[data-theme="dark"] .chapter-sky { opacity: .7; }
/* secondary text must stay readable on every mood (WCAG AA) */
:root[data-theme="dark"] #windly, :root[data-theme="dark"] #floralia { --dim: #b2b2b8; }
:root[data-theme="light"] #windly[data-wx="rain"], :root[data-theme="light"] #windly[data-wx="night"] { --dim: #2a2f3a; }
.chapter-fx { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; }
/* a blurred backdrop over a canvas that animates would be re-blurred every frame: use a plain translucent fill here */
#windly .modes { -webkit-backdrop-filter: none; backdrop-filter: none; background: color-mix(in srgb, var(--bg) 80%, transparent); }
.wx-now { color: var(--text); }
.wx-now::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: var(--c); animation: wxdot 2.4s ease-in-out infinite; vertical-align: 1px; }
@keyframes wxdot { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .chapter-sky { transition: none; } .wx-now::before { animation: none; } }

/* floralia: a cycle ring */
.cyc { margin-top: 26px; max-width: 640px; display: grid; gap: 12px; }
.cyc-main { display: grid; grid-template-columns: 176px minmax(0, 1fr); gap: 26px; align-items: center; padding: 16px 20px; border: 1px solid var(--line-2); border-radius: 18px; background: color-mix(in srgb, var(--bg) 52%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.cyc-ring { width: 176px; height: 176px; touch-action: none; cursor: grab; }
.cyc-ring circle.arc { fill: none; stroke-width: 9; }
.cyc-ring .a1 { stroke: var(--c); }
.cyc-ring .a2 { stroke: color-mix(in srgb, var(--c) 36%, transparent); }
.cyc-ring .a3 { stroke: var(--c2); }
.cyc-ring .a4 { stroke: color-mix(in srgb, var(--c2) 34%, transparent); }
.cyc-mark { transform-origin: 60px 60px; transition: transform .45s var(--ease); }
.cyc-mark circle { fill: var(--text); stroke: var(--bg); stroke-width: 3; }
.cyc-info { display: grid; gap: 4px; min-width: 0; }
.cyc-phase { color: var(--c); }
.cyc-day { font-size: clamp(40px, 5vw, 64px); line-height: 1; font-weight: 700; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.cyc-day small { font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--dim); margin-right: 4px; }
.cyc-note { font-size: 14px; color: color-mix(in srgb, var(--text) 74%, transparent); }
.cyc-range { width: 100%; accent-color: var(--c); }
.cyc-hint { color: var(--dim); }
@media (max-width: 700px) { .cyc-main { grid-template-columns: 120px minmax(0, 1fr); gap: 16px; padding: 14px; } .cyc-ring { width: 120px; height: 120px; } }
@media (prefers-reduced-motion: reduce) { .cyc-mark { transition: none; } }

/* device stages */
.stage { position: relative; justify-self: end; width: min(100%, 560px); display: flex; flex-direction: column; align-items: center; gap: 18px; transition: padding-bottom .6s var(--ease); --ch: clamp(380px, 64svh, 620px); }
.modes { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line-2); border-radius: 99px; background: color-mix(in srgb, var(--bg) 55%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.modes button { padding: 8px 16px; border-radius: 99px; font-size: 13px; font-weight: 500; color: var(--dim); transition: background .35s, color .35s; white-space: nowrap; }
@media (hover: hover) { .modes button:hover { color: var(--text); } }
.modes button[aria-selected="true"] { background: var(--c); color: #06101a; }
.canvas { position: relative; width: 100%; height: var(--ch); perspective: 1500px; transition: height .6s var(--ease); }
.mode { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transform: scale(.94) translateY(10px); pointer-events: none; transition: opacity .22s ease, transform .3s ease; }
.mode.active { opacity: 1; transform: none; pointer-events: auto; transition: opacity .5s var(--ease) .24s, transform .8s var(--ease) .24s; }
.devs { position: relative; width: 100%; height: 100%; display: grid; place-items: center; transform: rotateY(var(--ry, 0deg)) rotateX(var(--rx, 0deg)); transition: transform .5s var(--ease); }
.dev { position: relative; isolation: isolate; height: 100%; max-width: 100%; aspect-ratio: var(--ar); }
/* The shadow is a static box-shadow behind the screen, not a filter on the whole device: a drop-shadow filter would be re-blurred every frame the screenshots cross-fade */
.dev::before { content: ''; position: absolute; z-index: -1; left: var(--l); top: var(--t); width: var(--w); height: var(--h); border-radius: var(--r); box-shadow: 0 45px 55px -14px rgba(0, 0, 0, .5); pointer-events: none; }
.dev .hole { position: absolute; left: var(--l); top: var(--t); width: var(--w); height: var(--h); overflow: hidden; isolation: isolate; }
.dev .bezel { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; user-select: none; }
.hole img.shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; opacity: 0; transition: opacity 0s linear .7s; }
.hole img.shot.on { opacity: 1; z-index: 1; transition: opacity .7s var(--ease); }

.dev.front { z-index: 2; }
.dev.back { position: absolute; z-index: 1; height: 84%; left: 0; top: 8%; opacity: .5; transform: rotate(-7deg) scale(.96); }
.dev.back::before { box-shadow: 0 30px 40px -12px rgba(0, 0, 0, .4); }
.dev.cut { height: 120%; align-self: start; }
.dev.cut::before { display: none; }
.dev.cut .hole img.shot { height: auto; bottom: auto; }
.canvas.cutbox { overflow: hidden; }
.canvas.cutbox { -webkit-mask-image: linear-gradient(#000 74%, transparent 97%); mask-image: linear-gradient(#000 74%, transparent 97%); }
.dev.tv, .dev.mac { width: 100%; height: auto; max-height: 100%; }
.dev.ipad { height: auto; width: min(100%, calc(var(--ch) * .7718)); }
.dev.watch { position: absolute; z-index: 5; right: 1%; bottom: 3%; width: 31%; height: auto; }
.dev.watch::before { box-shadow: 0 30px 30px -10px rgba(0, 0, 0, .6); }

.scene { background: radial-gradient(120% 90% at 20% 0%, #8ccbff 0%, #3f86d8 45%, #1b4a99 100%) !important; }
.menubar { position: absolute; left: 0; right: 0; top: 0; height: 5.4%; min-height: 10px; z-index: 3; display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding: 0 3%; background: rgba(0, 0, 0, .42); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: #fff; font-size: clamp(7px, .9vw, 11px); font-weight: 600; }
.menubar i { width: 1.4em; height: .8em; border: 1.5px solid #fff; border-radius: 3px; opacity: .85; }
.scene img.shot { object-fit: initial; inset: auto; width: auto; height: auto; border-radius: 8px; box-shadow: 0 20px 30px -8px rgba(0, 0, 0, .45); }
.scene img.pop { right: 6%; top: 8%; height: 88%; transform: translateY(10px); }
.scene img.win { left: 50%; top: 53%; height: 84%; transform: translate(-50%, -46%); }
.scene img.pop.on { transform: none; }
.scene img.win.on { transform: translate(-50%, -50%); }

.pagers { width: 100%; min-height: 34px; }
@media (min-width: 1001px) { .stage.multi .pagers { min-height: 76px; } }
.pager { display: none; flex-wrap: wrap; justify-content: center; gap: 6px 4px; }
.pager.active { display: flex; }
.pager button { display: inline-flex; gap: 8px; align-items: baseline; padding: 7px 12px; border-radius: 99px; border: 1px solid transparent; font-family: var(--mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--dim); transition: color .3s, border-color .3s, background .3s; white-space: nowrap; }
.pager button b { font-weight: 500; opacity: .6; }
@media (hover: hover) { .pager button:hover { color: var(--text); } }
.pager button[aria-current="true"] { color: var(--text); border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }

/* ---------- next ---------- */
.next { padding: clamp(100px, 14vw, 200px) var(--pad) 0; background: var(--bg); position: relative; z-index: 2; }
.next-head { margin-bottom: clamp(40px, 6vw, 90px); }
.rows { border-top: 1px solid var(--line-2); }
.row { border-bottom: 1px solid var(--line-2); }
.row-btn { width: 100%; display: grid; grid-template-columns: 56px minmax(0, 1.4fr) minmax(0, 1fr) auto 40px; gap: 18px; align-items: center; padding: clamp(22px, 3vw, 40px) 0; transition: padding .5s var(--ease), color .3s; }
@media (hover: hover) { .row-btn:hover { padding-left: 16px; } }
.row-name { font-size: clamp(34px, 6vw, 96px); letter-spacing: -.055em; line-height: 1; font-weight: 700; }
.row-n, .row-cat { color: var(--dim); }
.pill { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line-2); white-space: nowrap; }
.pill.beta { color: #ffb84d; border-color: color-mix(in srgb, #ffb84d 50%, transparent); }
:root[data-theme="light"] .pill.beta { color: #9a5b00; border-color: color-mix(in srgb, #9a5b00 45%, transparent); }
.pill.wip { color: var(--dim); }
.row-plus { position: relative; width: 24px; height: 24px; justify-self: end; }
.row-plus::before, .row-plus::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1.5px; background: currentColor; transition: transform .5s var(--ease); }
.row-plus::after { transform: rotate(90deg); }
.row.open .row-plus::after { transform: rotate(0); }
.row-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .6s var(--ease); }
.row.open .row-panel { grid-template-rows: 1fr; }
.row-panel > div { overflow: hidden; display: flex; flex-wrap: wrap; align-items: center; gap: 20px 40px; justify-content: space-between; padding-left: 74px; }
.row-panel p { max-width: 56ch; color: var(--dim); font-size: 17px; padding-bottom: 30px; }
.row-panel .store { padding-bottom: 30px; }

/* ---------- about ---------- */
.about { padding: clamp(100px, 14vw, 200px) var(--pad) 0; background: var(--bg); position: relative; z-index: 2; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(30px, 6vw, 100px); align-items: end; }
.about-copy { display: grid; gap: 20px; max-width: 52ch; font-size: clamp(17px, 1.5vw, 21px); line-height: 1.45; letter-spacing: -.01em; }
.about-copy p:last-child { color: var(--dim); }
.numbers { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: clamp(70px, 9vw, 140px); border-top: 1px solid var(--line-2); }
.number { padding: 28px 24px 28px 0; border-right: 1px solid var(--line); }
.number + .number { padding-left: 24px; }
.number:last-child { border-right: 0; }
.number strong { display: block; font-size: clamp(54px, 8vw, 136px); letter-spacing: -.07em; line-height: .9; font-weight: 700; font-variant-numeric: tabular-nums; }
.number span { display: block; margin-top: 16px; color: var(--dim); }
.stack { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: clamp(50px, 6vw, 90px); padding-top: 24px; border-top: 1px solid var(--line-2); }
.stack-col h3 { color: var(--dim); margin-bottom: 14px; }
.stack-col li { font-size: 20px; letter-spacing: -.02em; padding: 3px 0; font-weight: 500; }

/* ---------- contact ---------- */
.contact { padding: clamp(120px, 16vw, 240px) var(--pad) clamp(60px, 8vw, 120px); background: var(--bg); position: relative; z-index: 2; }
.mail { display: inline-flex; align-items: center; gap: clamp(12px, 2vw, 32px); margin-top: clamp(40px, 6vw, 90px); font-size: clamp(28px, 6.6vw, 118px); letter-spacing: -.055em; font-weight: 700; line-height: 1;
  padding-bottom: .12em; position: relative; will-change: transform; max-width: 100%; }
.mail span { overflow-wrap: anywhere; position: relative; }
.mail span::after { content: ''; position: absolute; left: 0; right: 0; bottom: -.1em; height: 3px; background: currentColor; transform: scaleX(1); transform-origin: left; transition: transform .8s var(--ease); }
@media (hover: hover) { .mail:hover span::after { transform: scaleX(0); transform-origin: right; } }
.mail svg { width: .7em; height: .7em; flex: none; transition: transform .6s var(--ease); }
@media (hover: hover) { .mail:hover svg { transform: translate(8px, -8px) rotate(0); } }
.contact-note { margin-top: 28px; color: var(--dim); font-size: 17px; }
.foot { display: flex; flex-wrap: wrap; gap: 14px 32px; justify-content: space-between; align-items: center; padding: 22px var(--pad) 28px; border-top: 1px solid var(--line); background: var(--bg); position: relative; z-index: 2; color: var(--dim); }
.foot-nav { display: flex; gap: 26px; flex-wrap: wrap; }
.foot a { transition: color .3s; }
@media (hover: hover) { .foot a:hover { color: var(--text); } }
.foot-friends a { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }

/* ---------- reveal ---------- */
.js .fade { opacity: 0; transform: translateY(40px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: calc(var(--d, 0) * 90ms); }
.js .fade.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .chapter { min-height: 0; padding-bottom: calc(clamp(40px, 5vw, 70px) + var(--dwell, 60svh)); border-radius: 22px 22px 0 0; }
  .chapter::before { top: 38%; width: 80%; }
  .chapter-body { grid-template-columns: minmax(0, 1fr); }
  .stage { justify-self: center; width: min(100%, 520px); }
  .dev.mac, .dev.tv { width: calc(100% + 2 * var(--pad)); max-width: none; max-height: none; }
  .about-grid { grid-template-columns: 1fr; align-items: start; }
  .numbers { grid-template-columns: 1fr 1fr; }
  .number:nth-child(2) { border-right: 0; }
  .number:nth-child(n+3) { border-top: 1px solid var(--line); }
  .number:nth-child(3) { padding-left: 0; }
  .stack { grid-template-columns: 1fr 1fr; row-gap: 36px; }
}
@media (max-width: 700px) {
  .bar { grid-template-columns: auto 1fr; padding-block: 12px; }
  .bar-nav { display: none; position: absolute; top: calc(100% - 4px); right: var(--pad); min-width: 190px; padding: 8px; flex-direction: column; gap: 0; border: 1px solid var(--line-2); border-radius: 18px; background: var(--bg); }
  .bar.menu-open .bar-nav { display: flex; }
  .bar-nav a { padding: 12px; font-size: 16px; }
  .bar-nav a::after { display: none; }
  .bar-menu { display: grid; }
  .hero { padding-top: 90px; }
  .hero-bottom { grid-template-columns: 1fr auto; }
  .hero-scroll { display: none; }
  .hero-platforms { display: none; }
  .row-btn { grid-template-columns: 34px minmax(0, 1fr) 24px; grid-template-areas: "n name plus" ". pill ."; gap: 8px 12px; align-items: center; }
  .row-n { grid-area: n; } .row-name { grid-area: name; font-size: clamp(34px, 10vw, 52px); } .row-btn .pill { grid-area: pill; justify-self: start; } .row-plus { grid-area: plus; }
  .row-cat { display: none; }
  .row-panel > div { padding-left: 46px; }
  .stage { --ch: clamp(340px, 58svh, 520px); }
  .pager { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; }
}
@media (pointer: coarse) {
  html { scroll-behavior: auto; }
  .chapter { will-change: auto; }   /* on phones the cards stack with native sticky only: no per-frame JS scale, no oversized compositor layers */
  .chapter-body { will-change: auto; }
  .chip { height: 44px; min-width: 44px; }
  .bar-brand { position: relative; }
  .bar-brand::after { content: ''; position: absolute; inset: -10px -8px; }
  .modes button { padding: 12px 16px; }
  .pager button { padding: 11px 12px; }
  .foot a { display: inline-block; padding: 10px 0; }
  .mail { padding-block: .12em; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0ms !important; }
  .js .fade, .js .hero-top, .js .hero-bottom { opacity: 1; transform: none; clip-path: none; }
  .js .mega .ch, .line > .wd { transform: none; }
  .statement-text .w { opacity: 1; }
  .loader { display: none; }
}
/* the same, when the visitor pauses the animations with the header switch */
html.no-motion { scroll-behavior: auto; }
html.no-motion *, html.no-motion *::before, html.no-motion *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0ms !important; }
html.no-motion.js .fade, html.no-motion.js .hero-top, html.no-motion.js .hero-bottom { opacity: 1; transform: none; clip-path: none; }
html.no-motion.js .mega .ch, html.no-motion .line > .wd { transform: none; }
html.no-motion .statement-text .w { opacity: 1; }
html.no-motion .loader { display: none; }
