/* ════════════════════════════════════════════════════════════════════
   Arrow Puzzle — marketing site
   The token names and values mirror www/css/style.css and www/js/themes.js
   so the page reads as the same product. Six themes live on [data-theme];
   demo.js reads --pal-* for the board colours, so the palette has exactly
   one source of truth: this file.
   ════════════════════════════════════════════════════════════════════ */

/* ---------- fonts (the app's own cuts, OFL, self-hosted) ---------- */
@font-face {
  font-family: 'Baloo 2'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url('/assets/fonts/baloo2-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Baloo 2'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url('/assets/fonts/baloo2-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Nunito'; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url('/assets/fonts/nunito-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Nunito'; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url('/assets/fonts/nunito-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- theme: Classic (default) ---------- */
:root {
  --bg: linear-gradient(160deg, #1b1b3a 0%, #2d2b55 45%, #1e3a5f 100%);
  --text: #fff;
  --text-dim: rgba(255, 255, 255, .68);
  --accent: #ffb03a;
  --accent-ink: #2a1a00;
  --accent-glow: rgba(255, 176, 58, .45);
  --btn-top: #7c5cff; --btn-bot: #5a3de0; --btn-shadow: #3d2aa0;
  --sheet-a: #34346a; --sheet-b: #26264e;
  --panel-bg: rgba(255, 255, 255, .06);
  --panel-border: rgba(255, 255, 255, .13);
  --pill-bg: rgba(0, 0, 0, .32);
  --pill-border: rgba(255, 255, 255, .14);
  --divider: rgba(255, 255, 255, .1);
  --board-fill: rgba(255, 255, 255, .05);
  --board-stroke: rgba(255, 255, 255, .13);
  --aurora-1: #4ce0d2; --aurora-2: #b06cff; --aurora-3: #38b6ff;
  --aurora-alpha: .34;
  --stars: .5;
  --ground: rgba(120, 190, 255, .13);
  --pal-1: #ff5c7a; --pal-2: #ffb03a; --pal-3: #3ddc84; --pal-4: #38b6ff;
  --pal-5: #b06cff; --pal-6: #4ce0d2; --pal-7: #f5d442; --pal-8: #ff6cc1;
  --head: #ffffff;

  /* Accent colours are tuned to sit on the board, not to be read as small
     text — on the light Candy theme the raw accent falls under 3:1. Blending
     towards --text darkens it on light themes and lightens it on dark ones,
     so one token stays legible in all six. Resolved lazily, so a theme
     override of --accent/--text automatically re-resolves this too. */
  --accent-text: color-mix(in srgb, var(--accent) 55%, var(--text));

  --font-display: 'Baloo 2', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  --radius: 22px;
  --radius-sm: 14px;
  --shell: min(1180px, 100% - 2.5rem);
  --dur: .28s;
}

[data-theme="neon"] {
  --bg: linear-gradient(160deg, #05060f 0%, #0a0d1f 60%, #120a24 100%);
  --text: #eaffff;
  --text-dim: rgba(234, 255, 255, .64);
  --accent: #00d9ff; --accent-ink: #001c23; --accent-glow: rgba(0, 217, 255, .5);
  --btn-top: #4d7cff; --btn-bot: #2b48d9; --btn-shadow: #16247f;
  --sheet-a: #141a38; --sheet-b: #0a0d1f;
  --panel-bg: rgba(0, 217, 255, .06);
  --panel-border: rgba(0, 217, 255, .2);
  --pill-bg: rgba(2, 8, 24, .58); --pill-border: rgba(0, 217, 255, .25);
  --divider: rgba(0, 217, 255, .14);
  --board-fill: rgba(80, 220, 255, .04); --board-stroke: rgba(80, 220, 255, .26);
  --aurora-1: #ff2975; --aurora-2: #00d9ff; --aurora-3: #c651ff;
  --aurora-alpha: .3; --stars: .18;
  --ground: rgba(0, 217, 255, .16);
  --pal-1: #ff2975; --pal-2: #ffd319; --pal-3: #2bff88; --pal-4: #00d9ff;
  --pal-5: #c651ff; --pal-6: #2bfff4; --pal-7: #f8ff2b; --pal-8: #ff2bd6;
  --head: #eaffff;
}

[data-theme="candy"] {
  --bg: linear-gradient(160deg, #fde7f0 0%, #e8e4fb 55%, #dff2fb 100%);
  --text: #4a3559;
  --text-dim: rgba(74, 53, 89, .84);
  --accent: #f77fae; --accent-ink: #3d1226; --accent-glow: rgba(247, 127, 174, .5);
  --btn-top: #f77fae; --btn-bot: #e0568f; --btn-shadow: #a83a68;
  --sheet-a: #fff6fb; --sheet-b: #f0e9fc;
  --panel-bg: rgba(255, 255, 255, .62);
  --panel-border: rgba(120, 90, 160, .22);
  --pill-bg: rgba(255, 255, 255, .72); --pill-border: rgba(120, 90, 160, .24);
  --divider: rgba(120, 90, 160, .2);
  --board-fill: rgba(120, 90, 160, .07); --board-stroke: rgba(120, 90, 160, .2);
  --aurora-1: #f9a8d4; --aurora-2: #c4b5fd; --aurora-3: #a5e8f7;
  --aurora-alpha: .5; --stars: 0;
  --ground: rgba(247, 127, 174, .16);
  --pal-1: #ec5f92; --pal-2: #ef8f4c; --pal-3: #46b869; --pal-4: #3aa4e0;
  --pal-5: #9a6ae8; --pal-6: #2fb5a6; --pal-7: #cfa61f; --pal-8: #e065b8;
  --head: #ffffff;
}

[data-theme="wood"] {
  --bg: linear-gradient(160deg, #3b2a1e 0%, #57402c 50%, #33241a 100%);
  --text: #fff3e0;
  --text-dim: rgba(255, 243, 224, .68);
  --accent: #e9a13b; --accent-ink: #2e1c05; --accent-glow: rgba(233, 161, 59, .45);
  --btn-top: #b07a4a; --btn-bot: #8a5730; --btn-shadow: #5a381c;
  --sheet-a: #57402c; --sheet-b: #3b2a1e;
  --panel-bg: rgba(255, 220, 170, .08);
  --panel-border: rgba(255, 220, 170, .2);
  --pill-bg: rgba(25, 15, 8, .45); --pill-border: rgba(255, 220, 170, .2);
  --divider: rgba(255, 220, 170, .14);
  --board-fill: rgba(255, 220, 170, .08); --board-stroke: rgba(255, 220, 170, .2);
  --aurora-1: #e9a13b; --aurora-2: #7fb069; --aurora-3: #c9884c;
  --aurora-alpha: .22; --stars: .12;
  --ground: rgba(233, 161, 59, .12);
  --pal-1: #e2574c; --pal-2: #e9a13b; --pal-3: #7fb069; --pal-4: #5da9c9;
  --pal-5: #a97bc9; --pal-6: #5dc9b8; --pal-7: #d8c14e; --pal-8: #d873b0;
  --head: #fff3e0;
}

[data-theme="ocean"] {
  --bg: linear-gradient(170deg, #03253f 0%, #054569 55%, #032a3f 100%);
  --text: #eafcff;
  --text-dim: rgba(234, 252, 255, .66);
  --accent: #5bc9ff; --accent-ink: #00202f; --accent-glow: rgba(91, 201, 255, .45);
  --btn-top: #2b8cb8; --btn-bot: #176d94; --btn-shadow: #0c455f;
  --sheet-a: #0a4a6b; --sheet-b: #053050;
  --panel-bg: rgba(140, 230, 255, .07);
  --panel-border: rgba(140, 230, 255, .18);
  --pill-bg: rgba(2, 20, 35, .5); --pill-border: rgba(140, 230, 255, .2);
  --divider: rgba(140, 230, 255, .14);
  --board-fill: rgba(140, 230, 255, .06); --board-stroke: rgba(140, 230, 255, .19);
  --aurora-1: #5bfff0; --aurora-2: #5bc9ff; --aurora-3: #c08aff;
  --aurora-alpha: .26; --stars: .1;
  --ground: rgba(91, 201, 255, .16);
  --pal-1: #ff7e8a; --pal-2: #ffc46b; --pal-3: #5be3a0; --pal-4: #5bc9ff;
  --pal-5: #c08aff; --pal-6: #5bfff0; --pal-7: #ffe45b; --pal-8: #ff8ade;
  --head: #eafcff;
}

[data-theme="penguin"] {
  --bg: linear-gradient(165deg, #060b1e 0%, #0b1a33 45%, #0e2b45 78%, #123a52 100%);
  --text: #eafcff;
  --text-dim: rgba(234, 252, 255, .66);
  --accent: #7de8ff; --accent-ink: #00212b; --accent-glow: rgba(125, 232, 255, .45);
  --btn-top: #3e8fc9; --btn-bot: #2468a0; --btn-shadow: #123f66;
  --sheet-a: #12294a; --sheet-b: #0a1830;
  --panel-bg: rgba(170, 235, 255, .06);
  --panel-border: rgba(170, 235, 255, .18);
  --pill-bg: rgba(4, 12, 28, .55); --pill-border: rgba(170, 235, 255, .22);
  --divider: rgba(170, 235, 255, .14);
  --board-fill: rgba(170, 235, 255, .085); --board-stroke: rgba(170, 235, 255, .3);
  --aurora-1: #59f0e0; --aurora-2: #7d9cff; --aurora-3: #b98aff;
  --aurora-alpha: .3; --stars: .55;
  --ground: rgba(170, 235, 255, .2);
  --pal-1: #ff6b8d; --pal-2: #ffb54d; --pal-3: #54e8a1; --pal-4: #4dc9ff;
  --pal-5: #b98aff; --pal-6: #59f0e0; --pal-7: #ffe066; --pal-8: #ff85d0;
  --head: #f4feff;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-body);
  font-size: clamp(16px, 15px + .25vw, 18px);
  line-height: 1.6;
  color: var(--text);
  background: #1b1b3a;
  overflow-x: hidden;
  transition: color var(--dur) ease;
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.08; margin: 0; font-weight: 800; letter-spacing: -.01em; }
p { margin: 0; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: fixed; top: -100px; left: 1rem; z-index: 100;
  padding: .7rem 1.1rem; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-weight: 800; text-decoration: none;
}
.skip:focus { top: 1rem; }

.ic { width: 1.15em; height: 1.15em; fill: currentColor; flex: none; }

/* ---------- sky ---------- */
.sky { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bg); transition: background var(--dur) ease; }
.sky__stars {
  position: absolute; inset: -20%;
  opacity: var(--stars);
  transition: opacity var(--dur) ease;
  background-image:
    radial-gradient(1.4px 1.4px at 20% 18%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 68% 12%, #fff, transparent),
    radial-gradient(1.6px 1.6px at 44% 34%, #fff, transparent),
    radial-gradient(1px 1px at 82% 44%, #fff, transparent),
    radial-gradient(1.3px 1.3px at 12% 58%, #fff, transparent),
    radial-gradient(1.1px 1.1px at 92% 72%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 34% 78%, #fff, transparent),
    radial-gradient(1px 1px at 58% 62%, #fff, transparent);
  background-size: 620px 620px;
  animation: twinkle 9s ease-in-out infinite alternate;
}
.sky__ribbon {
  position: absolute; left: -25%; width: 150%; height: 46vh;
  filter: blur(48px);
  opacity: var(--aurora-alpha);
  transition: opacity var(--dur) ease, background var(--dur) ease;
  border-radius: 50%;
  will-change: transform;
}
.sky__ribbon--a { top: -12vh; background: radial-gradient(60% 100% at 30% 50%, var(--aurora-1), transparent 70%); animation: drift 26s ease-in-out infinite alternate; }
.sky__ribbon--b { top: 8vh;   background: radial-gradient(55% 100% at 70% 50%, var(--aurora-2), transparent 70%); animation: drift 34s ease-in-out infinite alternate-reverse; }
.sky__ribbon--c { top: 34vh;  background: radial-gradient(50% 100% at 45% 50%, var(--aurora-3), transparent 72%); animation: drift 41s ease-in-out infinite alternate; }
.sky__ground {
  position: absolute; left: 0; right: 0; bottom: 0; height: 34vh;
  background: linear-gradient(to top, var(--ground), transparent);
  transition: background var(--dur) ease;
}
@keyframes drift {
  from { transform: translate3d(-6%, 0, 0) rotate(-3deg) scaleY(.9); }
  to   { transform: translate3d(8%, 4vh, 0) rotate(4deg) scaleY(1.15); }
}
@keyframes twinkle { from { opacity: calc(var(--stars) * .55); } to { opacity: var(--stars); } }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 1rem;
  width: var(--shell); margin: 0 auto;
  padding: .7rem 0;
}
.topbar::before {
  content: ''; position: absolute; inset: 0 -50vw;
  background: color-mix(in srgb, var(--sheet-b) 62%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--divider);
  z-index: -1;
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; font-family: var(--font-display); font-weight: 800; }
.brand__icon { width: 38px; height: 38px; border-radius: 11px; box-shadow: 0 3px 10px rgba(0, 0, 0, .35); }
.brand__name { font-size: 1.08rem; }
.topnav { display: flex; gap: 1.3rem; margin-left: auto; font-weight: 700; font-size: .95rem; }
.topnav a { text-decoration: none; color: var(--text-dim); transition: color .18s ease; }
.topnav a:hover { color: var(--text); }
.topbar__cta { margin-left: auto; }
.topnav + .topbar__cta { margin-left: 0; }
@media (max-width: 820px) { .topnav { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  font-family: var(--font-display); font-weight: 800; text-decoration: none;
  padding: .78rem 1.3rem; border: 0; cursor: pointer;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--btn-top), var(--btn-bot));
  color: #fff;
  box-shadow: 0 4px 0 var(--btn-shadow), 0 8px 18px rgba(0, 0, 0, .28);
  transition: transform .12s ease, box-shadow .12s ease, filter .18s ease;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--btn-shadow), 0 4px 10px rgba(0, 0, 0, .28); }
.btn--accent {
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 72%, #000));
  color: var(--accent-ink);
  box-shadow: 0 4px 0 color-mix(in srgb, var(--accent) 45%, #000), 0 10px 26px var(--accent-glow);
}
.btn--accent:active { box-shadow: 0 1px 0 color-mix(in srgb, var(--accent) 45%, #000), 0 5px 14px var(--accent-glow); }
.btn--lg { padding: 1rem 1.7rem; font-size: 1.08rem; }
.btn--sm { padding: .5rem .95rem; font-size: .9rem; border-radius: 11px; }
.btn--ghost {
  background: var(--panel-bg); color: var(--text);
  border: 1px solid var(--panel-border); box-shadow: none;
}
.btn--ghost:active { transform: translateY(1px); box-shadow: none; }

.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: var(--font-display); font-weight: 700; font-size: .88rem;
  padding: .45rem .85rem; border-radius: 999px; cursor: pointer;
  color: var(--text); background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  transition: transform .12s ease, border-color .18s ease, background .18s ease;
}
.chip:hover { border-color: var(--accent); }
.chip:active { transform: scale(.96); }

.pill {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .34rem .8rem; border-radius: 999px; font-size: .84rem; font-weight: 700;
  background: var(--pill-bg); border: 1px solid var(--pill-border);
}
.pill--count b { font-family: var(--font-display); color: var(--accent-text); }

.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .82rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 1rem;
}
.eyebrow .dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }

/* ---------- hero ---------- */
.hero {
  width: var(--shell); margin: 0 auto;
  display: grid; grid-template-columns: 1fr min(46%, 470px);
  gap: clamp(2rem, 5vw, 4.5rem); align-items: center;
  padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(2rem, 5vw, 4rem);
}
.hero h1 { font-size: clamp(3rem, 9vw, 5.6rem); margin-bottom: 1.4rem; }
.hero h1 .grad {
  background: linear-gradient(100deg, var(--pal-4), var(--pal-5) 40%, var(--pal-1) 75%, var(--pal-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { font-size: clamp(1.02rem, 1.4vw, 1.16rem); color: var(--text-dim); max-width: 34rem; }
.cta-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: 1.8rem 0 1.4rem; }
.cta-row--center { justify-content: center; }
.cta-note { font-size: .9rem; color: var(--text-dim); font-weight: 700; }
.trustline { display: flex; flex-wrap: wrap; gap: .5rem .9rem; list-style: none; padding: 0; margin: 0; font-size: .88rem; color: var(--text-dim); }
.trustline li { display: flex; align-items: center; gap: .55rem; }
.trustline li + li::before { content: ''; width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .5; }
.hero__head h1 { margin-bottom: 1.4rem; }
/* Narrow layout drops to one column and slips the board between the headline
   and the pitch: the hook stays above the fold, the copy explains it right
   after. `display: contents` promotes both copy halves to grid items so they
   can be ordered around the board. */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 1.8rem; }
  .hero__copy { display: contents; }
  .hero__head { order: 1; }
  .hero__play { order: 2; max-width: 440px; width: 100%; margin: 0 auto; }
  .hero__rest { order: 3; }
  .hero h1 { margin-bottom: 0; }
}

/* ---------- the playable demo ---------- */
.demo__frame {
  position: relative;
  border-radius: var(--radius);
  padding: .9rem;
  background: linear-gradient(165deg, color-mix(in srgb, var(--sheet-a) 82%, transparent), color-mix(in srgb, var(--sheet-b) 88%, transparent));
  border: 1px solid var(--panel-border);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .08);
  transition: background var(--dur) ease, border-color var(--dur) ease;
}
.demo__hud { display: flex; align-items: center; gap: .6rem; margin-bottom: .7rem; }
.demo__hud .pill--label { flex: 1; min-width: 0; justify-content: flex-start; color: var(--text-dim); }
.demo__hud .pill--label[data-tone="bad"] { color: color-mix(in srgb, var(--pal-1) 62%, var(--text)); border-color: color-mix(in srgb, var(--pal-1) 55%, transparent); }
.demo__hud .pill--label[data-tone="good"] { color: color-mix(in srgb, var(--pal-3) 62%, var(--text)); border-color: color-mix(in srgb, var(--pal-3) 55%, transparent); }

.demo__stage { position: relative; border-radius: var(--radius-sm); overflow: hidden; }
.demo__svg {
  display: block; width: 100%; height: auto; aspect-ratio: 1;
  background: var(--board-fill);
  border: 1px solid var(--board-stroke);
  border-radius: var(--radius-sm);
  touch-action: manipulation;
  transition: background var(--dur) ease, border-color var(--dur) ease;
}
.demo__tools { display: flex; gap: .5rem; margin-top: .7rem; }
.demo__caption { margin-top: .8rem; font-size: .84rem; color: var(--text-dim); text-align: center; }

/* board pieces (SVG) */
.cells { pointer-events: none; }
.cell--a { fill: color-mix(in srgb, var(--text) 7%, transparent); }
.cell--b { fill: color-mix(in srgb, var(--text) 4%, transparent); }
.arrow { cursor: pointer; }
/* A fat invisible copy of the path so the tap target is finger-sized.
   `pointer-events: stroke` hits regardless of paint, which a transparent
   stroke would otherwise fail under the default `visiblePainted`. */
.arrow__hit { fill: none; stroke: transparent; pointer-events: stroke; }
.arrow__body, .arrow__gloss, .arrow__head, .arrow__tail { pointer-events: none; }
.fx { pointer-events: none; }
.arrow__body { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.arrow__gloss { fill: none; stroke-linecap: round; stroke-linejoin: round; opacity: .38; }
.arrow__head { stroke: none; }
.arrow--free .arrow__body { filter: drop-shadow(0 0 2.2px currentColor); }
.arrow--hint { animation: hintPulse 1.05s ease-in-out 3; transform-box: fill-box; transform-origin: center; }
.arrow--leaving { pointer-events: none; }
.arrow--blocked { animation: nudge .34s ease; transform-box: fill-box; transform-origin: center; }
.arrow--blocker .arrow__body { animation: blockerFlash .55s ease; }
.spark { pointer-events: none; }

@keyframes hintPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes nudge {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-1.4px, 0); }
  60% { transform: translate(1.4px, 0); }
}
@keyframes blockerFlash { 0%, 100% { stroke: currentColor; } 50% { stroke: var(--head); } }

.demo__win {
  position: absolute; inset: 0; z-index: 3;
  display: grid; place-items: center; padding: 1rem;
  background: color-mix(in srgb, var(--sheet-b) 78%, transparent);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fadeUp .32s ease both;
}
.demo__win[hidden] { display: none; }
.demo__win-card { text-align: center; max-width: 22rem; }
.demo__win-title { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; margin-bottom: .5rem; }
.demo__win-text { color: var(--text-dim); font-size: .95rem; margin-bottom: 1.1rem; }
.demo__win-row { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- sections ---------- */
.band { width: var(--shell); margin: 0 auto; padding: clamp(3rem, 8vw, 6rem) 0; }
.band--flush { width: 100%; }
.band--flush .section-title, .band--flush .section-sub { width: var(--shell); margin-inline: auto; }
.section-title { font-size: clamp(1.9rem, 4.4vw, 3rem); text-align: center; }
.section-sub { text-align: center; color: var(--text-dim); margin-top: .8rem; }

.rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.2rem; list-style: none; padding: 0; margin: 2.5rem 0 0; counter-reset: r; }
.rule {
  position: relative; padding: 1.6rem 1.4rem 1.4rem;
  background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: var(--radius);
  transition: background var(--dur) ease, border-color var(--dur) ease, transform .2s ease;
}
.rule:hover { transform: translateY(-3px); }
.rule__n {
  display: grid; place-items: center; width: 2.2rem; height: 2.2rem; margin-bottom: .9rem;
  font-family: var(--font-display); font-weight: 800; font-size: 1.1rem;
  border-radius: 50%; color: var(--accent-ink); background: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}
.rule h3 { font-size: 1.2rem; margin-bottom: .45rem; }
.rule p { color: var(--text-dim); font-size: .95rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.1rem; margin-top: 2.5rem; }
.card {
  position: relative; overflow: hidden;
  padding: 1.5rem 1.4rem;
  background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: var(--radius);
  transition: transform .2s ease, border-color .2s ease;
}
.card::after {
  content: ''; position: absolute; inset: auto -30% -60% -30%; height: 60%;
  background: radial-gradient(closest-side, var(--tint, var(--accent)), transparent);
  opacity: .22; pointer-events: none;
}
.card--campaign { --tint: var(--pal-5); }
.card--daily { --tint: var(--pal-2); }
.card--zen { --tint: var(--pal-3); }
.card--art { --tint: var(--pal-1); }
.card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--tint) 55%, transparent); }
.card__emoji { font-size: 1.8rem; display: block; margin-bottom: .7rem; }
.card h3 { font-size: 1.28rem; margin-bottom: .5rem; }
.card p { color: var(--text-dim); font-size: .95rem; }
.card__meta { margin-top: .9rem !important; font-size: .82rem !important; font-weight: 700; color: color-mix(in srgb, var(--tint) 52%, var(--text)) !important; }

.band--split {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 5rem); align-items: center;
}
.split__copy h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); margin-bottom: 1.1rem; }
.split__copy h2 em { font-style: normal; color: var(--accent-text); }
.split__copy p { color: var(--text-dim); margin-bottom: 1rem; }
.split__copy .btn { margin-top: .6rem; }
.split__media { position: relative; display: flex; justify-content: center; align-items: flex-end; gap: 0; min-height: 420px; }
@media (max-width: 860px) {
  .band--split { grid-template-columns: 1fr; }
  .split__media { min-height: 0; }
}

.phone {
  margin: 0; border-radius: 26px; overflow: hidden;
  border: 1px solid var(--panel-border);
  background: var(--sheet-b);
  box-shadow: 0 22px 50px rgba(0, 0, 0, .42);
}
.phone img { border-radius: inherit; }
.phone figcaption {
  padding: .55rem .8rem; font-size: .82rem; font-weight: 700; text-align: center;
  color: var(--text-dim); background: var(--panel-bg);
}
.phone--tilt { width: min(64%, 300px); transform: rotate(-3deg); z-index: 2; }
.phone--behind { width: min(50%, 230px); transform: rotate(6deg) translate(-14%, 6%); opacity: .92; }

.gallery {
  display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 2.5rem max(1.25rem, calc((100vw - var(--shell)) / 2)) 1.5rem;
  scrollbar-width: none;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery .phone { flex: 0 0 min(66vw, 250px); scroll-snap-align: center; }

.mechs { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .9rem; list-style: none; padding: 0; margin: 2.5rem 0 0; }
.mech {
  display: grid; grid-template-columns: auto 1fr; gap: .2rem .9rem; align-items: center;
  padding: 1rem 1.2rem; border-radius: var(--radius-sm);
  background: var(--panel-bg); border: 1px solid var(--panel-border);
}
.mech span { grid-row: span 2; font-size: 1.6rem; }
.mech b { font-family: var(--font-display); font-size: 1.04rem; }
.mech i { font-style: normal; font-size: .86rem; color: var(--text-dim); }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.1rem; margin-top: 2.5rem; }
.fact { padding: 1.4rem; border-radius: var(--radius); background: var(--panel-bg); border: 1px solid var(--panel-border); }
.fact h3 { font-size: 1.08rem; margin-bottom: .5rem; display: flex; gap: .55rem; align-items: center; }
.fact p { color: var(--text-dim); font-size: .93rem; }

/* ---------- themes ---------- */
.themes { display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem; margin-top: 2.5rem; }
.swatch {
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  width: 6.4rem; padding: 1rem .5rem .8rem; cursor: pointer;
  border-radius: var(--radius-sm); color: var(--text);
  background: var(--panel-bg); border: 1px solid var(--panel-border);
  font-family: var(--font-display); font-weight: 700;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.swatch:hover { transform: translateY(-3px); }
.swatch__chip {
  display: grid; place-items: center; width: 2.6rem; height: 2.6rem; font-size: 1.3rem;
  border-radius: 50%; background: var(--pill-bg); border: 1px solid var(--pill-border);
}
.swatch__name { font-size: .9rem; }
.swatch[aria-checked="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  box-shadow: 0 0 26px var(--accent-glow);
}
.themes__blurb { text-align: center; margin-top: 1.6rem; color: var(--text-dim); font-size: 1.02rem; min-height: 1.6em; }

/* ---------- closer + footer ---------- */
.closer { text-align: center; }
.closer__icon { width: 118px; height: 118px; margin: 0 auto 1.4rem; border-radius: 30px; box-shadow: 0 18px 40px rgba(0, 0, 0, .45); }
.closer h2 { font-size: clamp(1.7rem, 4vw, 2.7rem); }

.foot {
  width: var(--shell); margin: 0 auto; padding: 2.5rem 0 3.5rem;
  border-top: 1px solid var(--divider);
  display: grid; gap: 1.4rem; align-items: center;
  grid-template-columns: auto 1fr;
}
.foot__brand { display: flex; align-items: center; gap: .8rem; }
.foot__brand img { width: 44px; height: 44px; border-radius: 13px; }
.foot__brand div { display: flex; flex-direction: column; line-height: 1.35; }
.foot__brand b { font-family: var(--font-display); }
.foot__brand span { font-size: .85rem; color: var(--text-dim); }
.foot__links { display: flex; flex-wrap: wrap; gap: 1.2rem; justify-content: flex-end; font-weight: 700; font-size: .92rem; }
.foot__links a { text-decoration: none; color: var(--text-dim); }
.foot__links a:hover { color: var(--accent-text); }
/* No extra opacity here — --text-dim is already the dimmed step, and stacking
   the two drops the fine print under 4.5:1 on the light Candy theme. */
.foot__legal { grid-column: 1 / -1; font-size: .78rem; color: var(--text-dim); }
@media (max-width: 700px) {
  .foot { grid-template-columns: 1fr; }
  .foot__links { justify-content: flex-start; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .sky__ribbon, .sky__stars { animation: none; }
}
