/* y2kplayer.app 4.0: components. Each one is named in docs/site/SYSTEM.md with its rules.
   The language is the store set's: big white words, the payoff word on a green plate tilted -2deg,
   one world behind one real phone, one idea per picture. */

/* =========================================================== logotype */
.logo {
  display: inline-flex; align-items: center; gap: 0.6em;
  min-height: var(--tap); padding-inline: var(--sp-1);
  color: var(--text); text-decoration: none;
  font-family: var(--font-display); font-weight: 900;
  font-size: 0.9375rem; letter-spacing: var(--track-logo); text-transform: uppercase;
  white-space: nowrap; border-radius: var(--r-sm);
}
.logo img { width: 2.1em; height: 2.1em; flex: none; }
.logo span { margin-right: calc(-1 * var(--track-logo)); }   /* tracking must not push the box */

/* =========================================================== header: one for every page */
.hdr {
  position: relative; z-index: 40;
  padding-top: env(safe-area-inset-top);
  background: linear-gradient(to bottom, rgb(28 8 64 / .92), rgb(28 8 64 / .78));
  -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.hdr__in {
  display: grid; align-items: center; gap: var(--sp-2) var(--sp-4);
  grid-template-columns: 1fr; grid-template-areas: "logo" "nav";
  padding-block: var(--sp-2);
}
.hdr .logo { grid-area: logo; justify-self: start; }
.hdr__nav { grid-area: nav; min-width: 0; }
.hdr__nav ul {
  display: flex; gap: var(--sp-1); list-style: none; padding: 0;
  overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
  margin-inline: calc(-1 * var(--sp-1));
}
.hdr__nav ul::-webkit-scrollbar { display: none; }
.hdr__nav li { flex: none; }
@media (max-width: 420px) { .hdr__nav ul { -webkit-mask-image: linear-gradient(to right, #000 82%, transparent); mask-image: linear-gradient(to right, #000 82%, transparent); } }
.hdr__nav a {
  display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap); min-width: var(--tap); padding: 0 var(--sp-3);
  color: var(--text-2); font-weight: 700; font-size: var(--fs-2); text-decoration: none; white-space: nowrap;
  border-radius: var(--r-pill); position: relative;
  transition: background-color var(--dur-2) var(--ease-out), color var(--dur-2);
}
.hdr__nav a:hover { background: rgb(255 255 255 / .1); color: var(--text); }
.hdr__nav a[aria-current="page"] { color: var(--text); }
.hdr__nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: var(--sp-3); right: var(--sp-3); bottom: 6px; height: 4px;
  border-radius: 4px; background: var(--plate);
}
.hdr .hdr__cta { grid-area: cta; display: none; }
@media (min-width: 768px) {
  .hdr { position: sticky; top: 0; }
  .hdr__in { grid-template-columns: auto 1fr auto; grid-template-areas: "logo nav cta"; min-height: var(--header-h); padding-block: 0; }
  .hdr__nav ul { justify-content: center; overflow: visible; margin: 0; }
  .hdr__nav a { font-size: var(--fs-3); }
  /* the header's button appears only once the page's own call has scrolled away: one store control on screen at a time */
  .hdr .hdr__cta { display: inline-flex; visibility: hidden; opacity: 0; transform: translateY(-6px) scale(.96);
    transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-3) var(--ease-pop), visibility 0s linear var(--dur-2); }
  .hdr[data-cta="on"] .hdr__cta { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
}

/* =========================================================== buttons */
.btn {
  --btn-h: 56px;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55em;
  min-height: var(--btn-h); padding: 0 1.5em;
  border-radius: var(--r-pill); border: 2px solid transparent;
  font-family: var(--font-display); font-weight: 900; font-size: var(--fs-4); line-height: 1.1;
  text-decoration: none; text-align: center; white-space: nowrap;
  transition: transform var(--dur-2) var(--ease-pop), box-shadow var(--dur-2) var(--ease-out), background-color var(--dur-2), color var(--dur-2);
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn--sm { --btn-h: 44px; font-size: var(--fs-2); padding: 0 1.15em; }
.btn--lg { --btn-h: 64px; font-size: var(--fs-5); padding: 0 1.6em; }
.btn--block { display: flex; width: 100%; }
.btn svg { width: 1.1em; height: 1.1em; flex: none; }

/* primary = the store button: the plate, pressed like a key */
.btn--primary {
  background: var(--plate); color: var(--plate-ink);
  box-shadow: 0 6px 0 var(--plate-press), 0 18px 34px -10px rgb(30 215 96 / .55);
}
.btn--primary:hover, .btn--primary.is-hover { background: var(--plate-hi); transform: translateY(-2px) rotate(-1deg); box-shadow: 0 8px 0 var(--plate-press), 0 24px 40px -10px rgb(30 215 96 / .65); }
.btn--primary:active, .btn--primary.is-active { transform: translateY(5px); box-shadow: 0 1px 0 var(--plate-press), 0 8px 18px -8px rgb(30 215 96 / .5); transition-duration: 60ms; }
.btn--sm.btn--primary { box-shadow: 0 4px 0 var(--plate-press), 0 12px 24px -10px rgb(30 215 96 / .5); }

/* secondary: a white outline on the world */
.btn--secondary { background: rgb(255 255 255 / .06); color: var(--text); border-color: var(--text); }
.btn--secondary:hover, .btn--secondary.is-hover { background: var(--text); color: var(--ground); transform: translateY(-2px); }
.btn--secondary:active, .btn--secondary.is-active { transform: translateY(2px); background: rgb(255 255 255 / .85); color: var(--ground); }

/* quiet: words with a line and an arrow */
.btn--quiet { --btn-h: 44px; padding: 0 0.25em; color: var(--text); font-family: var(--font-body); font-weight: 700; font-size: var(--fs-3);
  text-decoration: underline; text-decoration-color: var(--plate); text-decoration-thickness: 3px; text-underline-offset: 0.3em; }
.btn--quiet::after { content: "\2192"; transition: transform var(--dur-2) var(--ease-pop); }
.btn--quiet:hover::after, .btn--quiet.is-hover::after { transform: translateX(4px); }

.btn.is-focus { outline: 3px solid var(--text); outline-offset: 3px; box-shadow: 0 0 0 7px rgb(30 215 96 / .55); }
.btn[aria-disabled="true"], .btn:disabled { background: #3A2A5C; color: #D9D0EA; border-color: transparent; box-shadow: none; transform: none; cursor: not-allowed; }
.btn.is-loading { pointer-events: none; }
.btn.is-loading::before {
  content: ""; width: 1em; height: 1em; border-radius: 50%; border: 3px solid currentColor; border-right-color: transparent;
  animation: spin 800ms linear infinite;
}
@keyframes spin { to { transform: rotate(1turn); } }

/* =========================================================== the App Store badge (Apple's artwork, unaltered) */
.badge { display: inline-flex; padding: 10px; margin: -10px; border-radius: 12px; }   /* clear space = a quarter of its height */
.badge img { height: 48px; width: auto; }                                              /* never under 40 px tall */

/* =========================================================== the plate headline */
.plate-head {
  --hard: color-mix(in srgb, var(--deep, var(--ground)) 70%, black);
  font-family: var(--font-display); font-weight: 900; color: var(--text);
  /* a plate word never breaks, so the size also answers to its column: 13 % of the container's width at most */
  font-size: min(var(--plate-size, var(--fs-8)), 13cqi); line-height: var(--lh-tight); letter-spacing: -0.01em;
  text-shadow: var(--shadow-hard);
}
.plate-head .line { display: block; }
.plate {
  display: inline-block; position: relative;
  margin: 0.08em 0 0.06em; padding: 0.02em 0.22em 0.08em;
  background: var(--plate); color: var(--plate-ink); text-shadow: none;
  border-radius: var(--r-plate);
  transform: rotate(var(--tilt));
  box-shadow: 0 0.06em 0 var(--plate-press), 0 0.25em 0.5em -0.2em rgb(0 0 0 / .45);
}
.plate--flat { transform: none; }
.plate--right { --tilt: 2deg; }
@media (prefers-reduced-motion: no-preference) {
  .js .plate-head[data-reveal] { opacity: 1; transform: none; }
  .js .plate-head[data-reveal] .line { opacity: 0; transform: translateY(0.3em); }
  .js .plate-head[data-reveal] .plate { opacity: 0; transform: scale(.4) rotate(-14deg); }
  .js .plate-head[data-reveal].is-in .line { opacity: 1; transform: none; transition: opacity var(--dur-3) var(--ease-out), transform var(--dur-4) var(--ease-pop); }
  .js .plate-head[data-reveal].is-in .line:nth-child(2) { transition-delay: 60ms; }
  .js .plate-head[data-reveal].is-in .plate { opacity: 1; transform: rotate(var(--tilt)); transition: opacity 160ms 180ms, transform 620ms 180ms var(--ease-pop); }
  .plate-head .plate:hover { animation: wiggle 520ms var(--ease-out); }
}
@keyframes wiggle { 0%,100% { transform: rotate(var(--tilt)); } 25% { transform: rotate(calc(var(--tilt) - 4deg)) scale(1.04); } 60% { transform: rotate(calc(var(--tilt) + 2deg)); } }

.lede { font-size: var(--fs-4); line-height: 1.45; color: var(--text-2); max-width: 36ch; }

/* =========================================================== promises (slide 1's band) and chips (slide 10's plates) */
.promises { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); list-style: none; padding: 0; }
.tick {
  display: inline-flex; align-items: center; gap: 0.45em;
  color: var(--text); font-weight: 800; font-size: var(--fs-3); font-family: var(--font-display);
}
.tick::before {
  content: ""; flex: none; width: 1.3em; height: 1.3em; border-radius: 50%;
  background: var(--plate) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%23062C16' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 76% no-repeat;
}
.promises--big .tick { font-size: var(--fs-4); }

.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); list-style: none; padding: 0; }
.chip {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0.15em 0.75em;
  background: var(--plate); color: var(--plate-ink); border-radius: var(--r-sm);
  font-family: var(--font-display); font-weight: 900; font-size: var(--fs-2); line-height: 1.2;
}
.chips li:nth-child(3n+1) .chip { transform: rotate(-1.5deg); }
.chips li:nth-child(3n+2) .chip { transform: rotate(1deg); }

/* the sticker: a tiny tilted plate for one word ("New", "Free", "Pro") */
.sticker {
  display: inline-flex; align-items: center; justify-content: center; padding: 0.3em 0.7em;
  background: var(--text); color: var(--ground); border-radius: var(--r-pill);
  font-family: var(--font-display); font-weight: 900; font-size: var(--fs-2); line-height: 1;
  transform: rotate(-6deg); box-shadow: 0 4px 0 rgb(0 0 0 / .35);
}
.sticker--plate { background: var(--plate); color: var(--plate-ink); }
@media (prefers-reduced-motion: no-preference) { .sticker--bob { animation: bob 3.2s var(--ease-in-out) infinite; } }
@keyframes bob { 0%,100% { transform: rotate(-6deg) translateY(0); } 50% { transform: rotate(-3deg) translateY(-6px); } }

/* =========================================================== the phone: a real screenshot or a short loop */
.phone {
  --w: 300px;
  container-type: inline-size;
  position: relative; width: var(--w); max-width: 100%; aspect-ratio: 1000 / 2093; flex: none;   /* the screen inside the 3.2cqw bezel is exactly 393 : 852 */
  /* the phone's own size is not its own container (cqw would read the viewport): % radius, and the screen inset in cqw from inside */
  border-radius: 15% / 7.17%;
  background: linear-gradient(145deg, #5B5470, #1A1626 38%, #2D2840 62%, #0D0B14);
  /* the world's light behind the phone, in the world's own hue (design-moves 6): a shadow, so it follows the phone's shape and tilt */
  box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / .28), inset 0 0 0 4px #0B0911, var(--shadow-3),
    0 0 90px 12px color-mix(in srgb, var(--glow, var(--plate)) 42%, transparent);
}
.phone__screen {
  position: absolute; inset: 3.2cqw; overflow: hidden; border-radius: 12cqw; background: #000;
}
.phone__screen > img, .phone__screen > video { width: 100%; height: 100%; object-fit: cover; }
.phone__screen::after {   /* the island */
  content: ""; position: absolute; top: 2.6cqw; left: 50%; width: 30cqw; height: 8.6cqw; translate: -50% 0;
  background: #000; border-radius: 99px;
}
.phone--lean { transform: perspective(1400px) rotateY(-16deg) rotateX(6deg) rotateZ(-5deg); }
.phone--lean-r { transform: perspective(1400px) rotateY(16deg) rotateX(6deg) rotateZ(5deg); }
@media (prefers-reduced-motion: no-preference) {
  .phone--float { animation: float 6s var(--ease-in-out) infinite; }
  .phone--lean.phone--float { animation-name: float-lean; }
}
@keyframes float { 0%,100% { translate: 0 0; } 50% { translate: 0 -12px; } }
@keyframes float-lean { 0%,100% { translate: 0 0; rotate: 0deg; } 50% { translate: 0 -14px; rotate: 0.6deg; } }

/* =========================================================== the world: one claim, one picture, its own world */
.world {
  --deep: var(--ground); --glow: var(--plate);
  position: relative; isolation: isolate; overflow: clip;
  background: var(--deep); color: var(--text-2);
  padding-block: var(--section-y) 0;
}
.world__bg { position: absolute; inset: 0; z-index: -2; }
.world__bg img { width: 100%; height: 100%; object-fit: cover; }
.world::before {   /* the slides' veil: the world's deep tone under the words, the world itself below them */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--deep) 94%, transparent) 0%, color-mix(in srgb, var(--deep) 86%, transparent) 34%, color-mix(in srgb, var(--deep) 40%, transparent) 62%, transparent 82%);
}
.world .lede, .world .hero__fine { text-shadow: 0 1px 2px var(--deep), 0 0 18px var(--deep); }
.world__in { display: grid; gap: var(--sp-10); justify-items: center; text-align: center; }
.world__words { display: grid; gap: var(--sp-5); justify-items: center; width: 100%; max-width: 34rem; container-type: inline-size; }
.world__words .promises, .world__words .chips { justify-content: center; }
.world__words .plate-head { --plate-size: var(--fs-7); }
.world__pic { position: relative; display: flex; justify-content: center; width: 100%; margin-bottom: calc(-1 * var(--phone-bleed, 18%)); }
.world__pic .phone { --w: clamp(240px, 70vw, 360px); }
@media (min-width: 900px) {
  .world { padding-block: var(--section-y); }
  .world::before { background: linear-gradient(to right, color-mix(in srgb, var(--deep) 92%, transparent) 0%, color-mix(in srgb, var(--deep) 70%, transparent) 38%, transparent 70%); }
  .world--flip::before { background: linear-gradient(to left, color-mix(in srgb, var(--deep) 92%, transparent) 0%, color-mix(in srgb, var(--deep) 70%, transparent) 38%, transparent 70%); }
  .world__in { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; justify-items: start; text-align: left; gap: clamp(32px, 6vw, 120px); }
  .world__words { justify-items: start; }
  .world__words .promises, .world__words .chips { justify-content: flex-start; }
  .ftr__close .world__words .promises { justify-content: center; }
  .world--flip .world__words { order: 2; }
  .world__pic { margin-bottom: 0; }
  .world__pic .phone { --w: clamp(280px, 26vw, 380px); }
}
/* the ten worlds of the set */
.world[data-world="promise"]  { --deep: var(--w-promise-deep); --glow: var(--w-promise-glow); }
.world[data-world="speed"]    { --deep: var(--w-speed-deep);   --glow: var(--w-speed-glow); }
.world[data-world="viz"]      { --deep: var(--w-viz-deep);     --glow: var(--w-viz-glow); }
.world[data-world="vocal"]    { --deep: var(--w-vocal-deep);   --glow: var(--w-vocal-glow); }
.world[data-world="sky"]      { --deep: var(--w-sky-deep);     --glow: var(--w-sky-glow); }
.world[data-world="stars"]    { --deep: var(--w-video-deep);   --glow: var(--w-video-glow); }
.world[data-world="rings"]    { --deep: var(--w-themes-deep);  --glow: var(--w-themes-glow); }
.world[data-world="eclipse"]  { --deep: var(--w-edit-deep);    --glow: var(--w-edit-glow); }
.world[data-world="rain"]     { --deep: var(--w-rain-deep);    --glow: var(--w-rain-glow); }
.world[data-world="keywords"] { --deep: var(--w-keys-deep);    --glow: var(--w-keys-glow); }

/* =========================================================== the hero (built from slide 1) */
.hero { padding-block: clamp(32px, 6vw, 88px) 0; min-height: min(100svh, 980px); display: grid; align-content: start; }
.hero .world__words { max-width: 40rem; }
.hero .plate-head { --plate-size: var(--fs-8); }
.hero__actions { display: grid; gap: var(--sp-3); justify-items: center; }
.hero__fine { font-size: var(--fs-2); color: var(--text-2); }
.hero .world__pic { --phone-bleed: 30%; }
.hero .phone { --w: clamp(250px, 74vw, 400px); }
.hero__sparkle { position: absolute; z-index: 2; }
@media (min-width: 900px) {
  .hero { min-height: min(100svh, 920px); align-content: center; padding-block: var(--sp-16); }
  .hero__actions { justify-items: start; }
  .hero .world__pic { --phone-bleed: 0%; }
  .hero .phone { --w: clamp(300px, 28vw, 420px); }
}

/* =========================================================== the visualizer wall */
.wall {
  --cols: 3; position: relative; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: clamp(8px, 1.6vw, 20px); list-style: none; padding: 0;
}
.wall li { aspect-ratio: 3 / 4; border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-2); outline: 2px solid rgb(255 255 255 / .14); outline-offset: -2px; }
.wall li:nth-child(odd) { rotate: -2deg; } .wall li:nth-child(3n) { rotate: 1.5deg; }
.wall img { width: 100%; height: 100%; object-fit: cover; }
@media (prefers-reduced-motion: no-preference) {
  .wall li { animation: drift 7s var(--ease-in-out) infinite; animation-delay: calc(var(--i, 0) * -0.9s); }
}
@keyframes drift { 0%,100% { translate: 0 0; } 50% { translate: 0 -8px; } }
.wall__phone { position: absolute; left: 50%; top: 50%; translate: -50% -50%; z-index: 2; }
.wall__phone .phone { --w: clamp(150px, 34vw, 260px); }
.wall li:nth-child(10) { display: none; }   /* nine on phones: three full rows */
@media (min-width: 768px) { .wall { --cols: 5; } .wall li:nth-child(10) { display: block; } }

/* =========================================================== theme switcher: the same phone, other themes */
.switch { display: grid; gap: var(--sp-8); justify-items: center; }
.switch__stage { position: relative; display: grid; place-items: center; width: 100%; padding-block: var(--sp-6); }
.switch__stage .phone { --w: clamp(220px, 62vw, 320px); }
.switch__screens { position: relative; width: 100%; height: 100%; }
.switch__screens img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.035); transition: opacity var(--dur-3) var(--ease-out), transform var(--dur-4) var(--ease-out); }
.switch__glow { position: absolute; inset: 10% 0; border-radius: 50%; filter: blur(50px); opacity: .65; transition: background-color var(--dur-4); z-index: -1; }
.switch__picks { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-2); border: 0; padding: 0; }
.switch__picks legend { width: 100%; text-align: center; margin-bottom: var(--sp-3); font-weight: 700; color: var(--text); }
.switch__picks input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__picks label {
  display: inline-flex; align-items: center; gap: 0.5em; min-height: var(--tap); padding: 0 1em 0 0.5em;
  border-radius: var(--r-pill); background: var(--surface); border: 2px solid var(--line-strong);
  color: var(--text); font-weight: 800; font-family: var(--font-display); font-size: var(--fs-2); cursor: pointer;
  transition: transform var(--dur-2) var(--ease-pop), background-color var(--dur-2), border-color var(--dur-2);
}
.switch__picks label::before { content: ""; width: 26px; height: 26px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 2px rgb(255 255 255 / .6); }
.switch__picks label:hover { transform: translateY(-2px) rotate(-1.5deg); }
.switch__picks input:checked + label { background: var(--plate); color: var(--plate-ink); border-color: var(--plate); transform: rotate(-2deg); }
.switch__picks input:focus-visible + label { outline: 3px solid var(--text); outline-offset: 3px; }
/* which screen shows: the checked radio decides (no JS needed; JS only auto-plays it until touched) */
.switch:has(input[value="fishbowl"]:checked) img[data-t="fishbowl"],
.switch:has(input[value="posy"]:checked) img[data-t="posy"],
.switch:has(input[value="bijou"]:checked) img[data-t="bijou"],
.switch:has(input[value="inkpop"]:checked) img[data-t="inkpop"],
.switch:has(input[value="mint"]:checked) img[data-t="mint"] { opacity: 1; transform: none; }
.switch:has(input[value="fishbowl"]:checked) .switch__glow { background-color: #3B8BFF; }
.switch:has(input[value="posy"]:checked) .switch__glow { background-color: #FF8A3D; }
.switch:has(input[value="bijou"]:checked) .switch__glow { background-color: #E769F0; }
.switch:has(input[value="inkpop"]:checked) .switch__glow { background-color: #FF3DA8; }
.switch:has(input[value="mint"]:checked) .switch__glow { background-color: #3DDCA0; }
.switch.is-kick .phone { animation: kick 340ms var(--ease-out); }
@keyframes kick { 30% { transform: scale(1.018) rotate(-0.5deg); } 100% { transform: none; } }

/* =========================================================== before / after: segmented control + stage */
.ba { display: grid; gap: var(--sp-6); justify-items: center; width: 100%; }
.seg { display: inline-flex; flex-wrap: wrap; justify-content: center; padding: 5px; gap: 4px; border: 0; border-radius: var(--r-pill); background: rgb(14 4 36 / .86); box-shadow: inset 0 0 0 2px var(--line); }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg label {
  display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 1.1em; border-radius: var(--r-pill);
  color: var(--text); font-weight: 900; font-family: var(--font-display); font-size: var(--fs-3); cursor: pointer;
  transition: background-color var(--dur-2), color var(--dur-2), transform var(--dur-3) var(--ease-pop);
}
.seg label:hover { background: rgb(255 255 255 / .1); }
.seg input:checked + label { background: var(--plate); color: var(--plate-ink); transform: rotate(-2deg) scale(1.04); }
.seg input:focus-visible + label { outline: 3px solid var(--text); outline-offset: 2px; }
.stage {
  position: relative; width: min(100%, 640px); border-radius: var(--r-lg); overflow: hidden;
  background: rgb(10 2 28 / .62); box-shadow: inset 0 0 0 2px var(--line), var(--shadow-2);
  padding: var(--sp-6) var(--sp-5);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.stage__label { display: flex; justify-content: space-between; gap: var(--sp-3); align-items: baseline; color: var(--text); font-weight: 800; font-family: var(--font-display); font-size: var(--fs-4); }
.stage__note { color: var(--text-2); font-size: var(--fs-3); margin-top: var(--sp-3); min-height: 1.55em; }
.wave { display: flex; align-items: center; gap: 3px; height: 112px; margin-top: var(--sp-4); transform-origin: left center; transition: transform var(--dur-4) var(--ease-pop), filter var(--dur-3); }
.wave span { flex: 1 0 4px; height: calc(var(--h) * 1%); min-height: 6%; border-radius: 4px; background: var(--wave, var(--text)); }
.wave--lane { height: 72px; }
/* speed: Slowed stretches the same song wider and lower; Sped up packs it tighter and higher */
.ba--speed .wave { --wave: linear-gradient(to top, var(--w-speed-glow), #fff); }
.ba--speed:has(input[value="slow"]:checked) .wave { transform: scale(1.45, .78); filter: hue-rotate(40deg) saturate(1.3); }
.ba--speed:has(input[value="fast"]:checked) .wave { transform: scale(.72, 1.08); filter: hue-rotate(-60deg) saturate(1.4); }
.ba--speed .note { display: none; }
.ba--speed:has(input[value="slow"]:checked) .note[data-for="slow"],
.ba--speed:has(input[value="orig"]:checked) .note[data-for="orig"],
.ba--speed:has(input[value="fast"]:checked) .note[data-for="fast"] { display: inline; }
.playhead { position: absolute; top: 0; bottom: 0; left: 0; width: 3px; background: var(--plate); box-shadow: 0 0 12px var(--plate); border-radius: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .playhead { animation: sweep var(--sweep, 5s) linear infinite; }
  .ba--speed:has(input[value="slow"]:checked) .playhead { --sweep: 7s; }
  .ba--speed:has(input[value="fast"]:checked) .playhead { --sweep: 3.4s; }
}
@keyframes sweep { from { left: 0; } to { left: calc(100% - 3px); } }
.stage__track { position: relative; overflow: hidden; }
/* vocal separation: one song becomes two lanes */
.lane { position: relative; display: grid; gap: var(--sp-2); transition: transform var(--dur-4) var(--ease-pop), opacity var(--dur-3); }
.lane__name { display: inline-flex; align-items: center; gap: 0.5em; color: var(--text); font-weight: 900; font-family: var(--font-display); font-size: var(--fs-4); }
.lane__name::before { content: ""; width: 0.9em; height: 0.9em; border-radius: 0.25em; background: var(--wave); }
.lane--mix { --wave: #FFFFFF; }
.lane--voc { --wave: var(--lane-vocals); }
.lane--mus { --wave: var(--lane-music); }
.split { position: relative; display: grid; gap: var(--sp-4); }
.split .lane--voc, .split .lane--mus { display: none; }
.ba--vocal:has(input[value="split"]:checked) .lane--mix { display: none; }
.ba--vocal:has(input[value="split"]:checked) .lane--voc,
.ba--vocal:has(input[value="split"]:checked) .lane--mus { display: grid; animation: pop-in var(--dur-4) var(--ease-pop) both; }
.ba--vocal:has(input[value="split"]:checked) .lane--mus { animation-delay: 90ms; }
@keyframes pop-in { from { opacity: 0; transform: translateY(18px) scale(.94); } to { opacity: 1; transform: none; } }

/* =========================================================== cards */
.cards { display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); list-style: none; padding: 0; }
.card {
  position: relative; display: grid; gap: var(--sp-3); align-content: start; height: 100%;
  padding: var(--sp-6); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-2);
  color: var(--text-2); text-decoration: none;
  transition: transform var(--dur-3) var(--ease-pop), box-shadow var(--dur-3);
}
.card h3 { font-size: var(--fs-5); }
.card .sticker { position: absolute; top: calc(-1 * var(--sp-3)); right: var(--sp-4); }
.card--pic .sticker { top: var(--sp-3); }
a.card:hover, .card.is-hover { transform: translateY(-6px) rotate(-1deg); box-shadow: inset 0 0 0 2px var(--plate), 0 26px 50px -18px rgb(30 215 96 / .45); }
.card__go { margin-top: auto; color: var(--text); font-weight: 800; }
.card__go::after { content: " \2192"; }
.card--pic { padding: 0; overflow: hidden; }
.card--pic img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.card--pic .card__body { padding: var(--sp-5) var(--sp-6) var(--sp-6); display: grid; gap: var(--sp-2); }

/* =========================================================== table */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--line); background: var(--surface); }
.table-wrap:focus-visible { outline-offset: 2px; }
.table { width: 100%; border-collapse: collapse; min-width: 30rem; font-size: var(--fs-3); }
.table caption { text-align: left; padding: var(--sp-4) var(--sp-5) 0; color: var(--text); font-weight: 800; font-family: var(--font-display); font-size: var(--fs-4); }
.table th, .table td { text-align: left; padding: var(--sp-3) var(--sp-5); border-bottom: 1px solid var(--line); vertical-align: top; }
.table thead th { color: var(--text-3); font-size: var(--fs-2); font-weight: 700; }
.table tbody th { color: var(--text); font-weight: 800; white-space: nowrap; }
.table tr:last-child > * { border-bottom: 0; }

/* =========================================================== FAQ disclosure */
.faq { display: grid; gap: var(--sp-3); }
.faq details { border-radius: var(--r-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); interpolate-size: allow-keywords; }
.faq details[open] { box-shadow: inset 0 0 0 2px var(--plate); }
.faq summary {
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5); min-height: 60px; cursor: pointer;
  color: var(--text); font-weight: 800; font-family: var(--font-display); font-size: var(--fs-4); line-height: 1.3; border-radius: var(--r-md);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--plate) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 6v12M6 12h12' stroke='%23062C16' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") center / 60% no-repeat;
  transition: transform var(--dur-3) var(--ease-pop);
}
.faq details[open] summary::after { transform: rotate(135deg); }
.faq details::details-content { block-size: 0; overflow: clip; transition: block-size var(--dur-3) var(--ease-out), content-visibility var(--dur-3) allow-discrete; }
.faq details[open]::details-content { block-size: auto; }
.faq .faq__a { padding: 0 var(--sp-5) var(--sp-5); max-width: var(--measure); }

/* =========================================================== the AD SLOT (tool pages): reserved, labelled, lazy */
.ad {
  --ad-h: 250px;                       /* phones: 300 x 250 */
  display: grid; justify-items: center; gap: var(--sp-2);
  margin-block: var(--sp-10);
  contain: layout;
}
.ad__tag { font-size: var(--fs-1); color: var(--text-3); letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700; line-height: 1.2; }
.ad__box {
  width: min(100%, var(--ad-w, 300px)); height: var(--ad-h);   /* height is FIXED: the unit can never push the page */
  border-radius: var(--r-sm); overflow: hidden;
  background: repeating-linear-gradient(135deg, rgb(255 255 255 / .03) 0 12px, transparent 12px 24px), rgb(0 0 0 / .22);
  box-shadow: inset 0 0 0 1px var(--line);
}
.ad__box > ins { display: block; width: 100%; height: 100%; }
@media (min-width: 768px) { .ad { --ad-h: 90px; --ad-w: 728px; } }                  /* tablets: 728 x 90 */
@media (min-width: 1280px) { .ad { --ad-h: 250px; --ad-w: 970px; } }                /* desktop: 970 x 250 */
.ad[data-state="empty-collapsed"] { display: none; }                                 /* only ever while it is below the screen */
.ad__house { display: none; height: 100%; align-items: center; justify-content: center; gap: var(--sp-4); padding: var(--sp-4); text-align: left; }
.ad[data-state="house"] .ad__house { display: flex; }
.ad[data-state="house"] .ad__tag { visibility: hidden; }
.ad__house img { width: 56px; height: 56px; }
.ad__house p { color: var(--text); font-weight: 800; font-family: var(--font-display); font-size: var(--fs-3); line-height: 1.25; }
.ad__house small { display: block; color: var(--text-2); font-weight: 600; font-family: var(--font-body); font-size: var(--fs-2); }
.ad__demo { display: grid; place-items: center; height: 100%; color: var(--text-3); font-size: var(--fs-2); }
/* the rail: wide screens only, in its own column beside the content, never over it */
.ad--rail { --ad-h: 600px; --ad-w: 160px; margin: 0; position: sticky; top: calc(var(--header-h) + var(--sp-6)); }
.with-rails { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-8); }
.with-rails > .ad--rail { display: none; }
@media (min-width: 1600px) { .with-rails { grid-template-columns: 160px minmax(0, 1fr) 160px; align-items: start; } .with-rails > .ad--rail { display: grid; } }
/* never inside the tool */
[data-tool] .ad { display: none !important; }

/* =========================================================== the tool's frame (the tool itself is round 3) */
.tool-frame {
  position: relative; border-radius: var(--r-xl); padding: clamp(16px, 3vw, 32px);
  background: rgb(10 2 28 / .7); box-shadow: inset 0 0 0 2px var(--line-strong), var(--shadow-3);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}

/* =========================================================== the store bar (phones) */
.storebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; align-items: center; gap: var(--sp-3);
  min-height: calc(var(--bar-h) + env(safe-area-inset-bottom));
  padding: var(--sp-3) calc(var(--sp-4) + env(safe-area-inset-right)) calc(var(--sp-3) + env(safe-area-inset-bottom)) calc(var(--sp-4) + env(safe-area-inset-left));
  background: var(--surface); border-top: 1px solid var(--line-strong);
  box-shadow: 0 -12px 30px -10px rgb(8 0 24 / .7);
  transform: translateY(110%); visibility: hidden;
  transition: transform var(--dur-3) var(--ease-out), visibility 0s linear var(--dur-3);
}
.storebar[data-on="true"] { transform: none; visibility: visible; transition-delay: 0s; }
.storebar img { width: 40px; height: 40px; flex: none; }
.storebar__words { flex: 1; min-width: 0; line-height: 1.25; }
.storebar__words strong { display: block; font-family: var(--font-display); font-size: var(--fs-3); }
.storebar__words span { display: block; font-size: var(--fs-1); color: var(--text-2); }
.storebar-space { height: calc(var(--bar-h) + env(safe-area-inset-bottom)); }   /* the bar's room, reserved at the foot of every page */
@media (min-width: 768px) { .storebar, .storebar-space { display: none; } }

/* =========================================================== footer: a close, then the links */
.ftr { position: relative; background: var(--ground-2); }
.ftr__close { padding-block: var(--section-y); padding-bottom: calc(var(--section-y) * .8); }
.ftr__close .world__in { justify-items: center; text-align: center; }
.ftr__close .world__words { justify-items: center; max-width: 44rem; }
.ftr__close::before { background: linear-gradient(to bottom, color-mix(in srgb, var(--deep) 60%, transparent), color-mix(in srgb, var(--deep) 88%, transparent)); }
.ftr__close .cluster { justify-content: center; --cluster: var(--sp-6); }
.ftr__links { display: grid; gap: var(--sp-8) var(--sp-6); grid-template-columns: repeat(2, minmax(0, 1fr)); padding-block: var(--sp-12); border-top: 1px solid var(--line); }
.ftr__links h2 { font-size: var(--fs-3); color: var(--text); margin-bottom: var(--sp-2); }
.ftr__links ul { list-style: none; padding: 0; }
.ftr__links a { display: inline-flex; align-items: center; min-height: var(--tap); min-width: var(--tap); color: var(--text-2); text-decoration: none; font-size: var(--fs-2); }
.ftr__links a:hover { color: var(--text); text-decoration: underline; text-decoration-color: var(--plate); }
@media (min-width: 768px) { .ftr__links { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ftr__legal { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-6); justify-content: space-between; align-items: center; padding-block: var(--sp-6) var(--sp-8); border-top: 1px solid var(--line); font-size: var(--fs-2); color: var(--text-3); }
.ftr__legal a { color: var(--text-2); display: inline-flex; align-items: center; min-height: var(--tap); }

/* =========================================================== section heads between worlds */
.section { padding-block: var(--section-y); }
.section__head { display: grid; gap: var(--sp-4); margin-bottom: var(--sp-10); container-type: inline-size; }
.section__head .plate-head { --plate-size: var(--fs-7); }

/* =========================================================== round 1b: the 3D phone (replaces the flat CSS bezel where a phone is shown big)
   The frame is a REAL render (tools/phone3d.py: the store set's own SceneKit phone, its screen cut out); the app's screen plays UNDER it,
   laid onto the rendered glass by a matrix3d computed from the render's measured corners (components.js / hero.js: fitPhones).
   Without JS the composite still (frame + screen, tools/prep_hero.py) is shown instead. */
.ph3d { position: relative; aspect-ratio: 635 / 1299; height: auto; flex: none; container-type: inline-size; }
.ph3d__in { position: absolute; left: 0; top: 0; width: 635px; height: 1299px; transform-origin: 0 0; transform: scale(var(--s, .4)); }
.ph3d__screen { position: absolute; left: 0; top: 0; width: 393px; height: 852px; transform-origin: 0 0; overflow: hidden; border-radius: 52px; background: #000; }
.ph3d__screen > .scr { position: absolute; inset: 0; opacity: 0; transition: opacity var(--dur-3) var(--ease-out); }
.ph3d__screen > .scr.is-on { opacity: 1; }
.ph3d__screen img, .ph3d__screen video { width: 100%; height: 100%; object-fit: cover; }
.ph3d__screen::after {   /* the glass: one soft sheen, the render's own reflection was cut out with the screen */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(118deg, rgb(255 255 255 / .16) 0%, rgb(255 255 255 / .05) 22%, transparent 23%, transparent 64%, rgb(255 255 255 / .06) 65%, transparent 80%);
}
.ph3d__frame { position: absolute; left: 0; top: 0; width: 635px; height: 1299px; max-width: none; pointer-events: none; }
.ph3d__still { display: none; width: 100%; height: 100%; }
html:not(.js) .ph3d__in { display: none; }
html:not(.js) .ph3d__still { display: block; }
.ph3d--glow::before {   /* the world's light behind the phone */
  content: ""; position: absolute; inset: 12% 4% 8%; border-radius: 40%; z-index: -1;
  background: var(--glow, var(--plate)); opacity: .5; filter: blur(42px);
}
/* a still card phone: one composite image, nothing to fit */
.ph3d-still { display: block; aspect-ratio: 635 / 1299; height: auto; filter: drop-shadow(0 30px 40px rgb(8 0 24 / .55)); }

/* =========================================================== round 1b: the row of worlds (a person sees three ideas without scrolling far)
   A scroll-snap track (works with no JS: swipe, or the arrow keys once focused); dots and arrows are buttons; auto-advance only while the
   row is on screen, and it stops for good at the first touch, wheel, key or focus inside it. */
.row { position: relative; display: grid; gap: var(--sp-5); }
.row__track {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(78vw, 340px); gap: var(--sp-4);
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding: var(--sp-4) var(--gutter) var(--sp-6); scroll-padding-inline: var(--gutter);
}
.row__track::-webkit-scrollbar { display: none; }
.row__card {
  --deep: var(--ground); --glow: var(--plate);
  position: relative; isolation: isolate; overflow: clip; scroll-snap-align: start;
  display: grid; grid-template-rows: auto 1fr; gap: var(--sp-2); min-height: min(132vw, 560px);
  padding: var(--sp-6) var(--sp-5) 0; border-radius: var(--r-lg); background: var(--deep);
  box-shadow: var(--shadow-2), inset 0 0 0 1.5px rgb(255 255 255 / .14);
  container-type: inline-size; text-align: center;
}
.row__card > picture { position: absolute; inset: 0; z-index: -2; }
.row__card > picture img { width: 100%; height: 100%; object-fit: cover; }
.row__card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to bottom, color-mix(in srgb, var(--deep) 88%, transparent), color-mix(in srgb, var(--deep) 40%, transparent) 42%, transparent 70%); }
.row__card .plate-head { --plate-size: 13cqi; font-size: min(var(--plate-size), 52px); }
.row__card .fine { font-size: var(--fs-2); font-weight: 700; color: var(--text); margin-top: var(--sp-2); text-shadow: 0 1px 2px var(--deep); }
.row__card .ph3d-still { width: 74%; justify-self: center; align-self: end; margin-bottom: -22%; }
.row__nav { display: flex; align-items: center; justify-content: center; gap: var(--sp-2); }
.row__dots { display: flex; gap: 8px; padding-inline: var(--sp-2); }      /* progress only (aria-hidden): the arrows are the 44 px controls */
.row__dots i { width: 8px; height: 8px; border-radius: 50%; background: rgb(255 255 255 / .35); transition: transform var(--dur-2) var(--ease-pop), background-color var(--dur-2); }
.row__dots i.is-on { background: var(--plate); transform: scale(1.5); }
.row__arrow { width: var(--tap); height: var(--tap); border-radius: 50%; display: grid; place-items: center; color: var(--text); background: rgb(255 255 255 / .1); border: 1.5px solid var(--line-strong); font-size: 1.2rem; }
.row__arrow:hover { background: var(--text); color: var(--ground); }
@media (min-width: 900px) { .row__track { grid-auto-columns: calc((min(100vw, var(--container) + 2 * var(--gutter)) - 2 * var(--gutter) - 2 * var(--sp-5)) / 3); padding-inline: max(var(--gutter), (100vw - var(--container)) / 2); gap: var(--sp-5); } }
.row__card[data-world="speed"] { --deep: var(--w-speed-deep); --glow: var(--w-speed-glow); }
.row__card[data-world="viz"] { --deep: var(--w-viz-deep); --glow: var(--w-viz-glow); }
.row__card[data-world="vocal"] { --deep: var(--w-vocal-deep); --glow: var(--w-vocal-glow); }
.row__card[data-world="sky"] { --deep: var(--w-sky-deep); --glow: var(--w-sky-glow); }
.row__card[data-world="stars"] { --deep: var(--w-video-deep); --glow: var(--w-video-glow); }
.row__card[data-world="rings"] { --deep: var(--w-themes-deep); --glow: var(--w-themes-glow); }
.row__card[data-world="eclipse"] { --deep: var(--w-edit-deep); --glow: var(--w-edit-glow); }
.row__card[data-world="rain"] { --deep: var(--w-rain-deep); --glow: var(--w-rain-glow); }
