/* ==========================================================================
   Dice Roller - Random Dice: landing page styles
   Brand colors come from the app itself:
   - the eight dice panel colors are dicePalette in lib/src/dice.dart;
   - the icon badge gradients are the option tiles in lib/src/settings_page.dart;
   - the deep indigo and the yellow "sticker" come from the Play Store art.
   Mobile first. Light sections follow the device's light or dark mode;
   the hero, showcase, ideas, screenshots, call to action and footer are
   always dark, like the store art.
   ========================================================================== */

:root {
  /* The app's dice colors (dicePalette). White dots keep at least 3.5:1 on
     each; text on color uses the deeper shades below instead. */
  --orange: #ea580c;
  --purple: #9333ea;
  --blue: #2563eb;
  --green: #059669;
  --pink: #db2777;
  --sky: #0284c7;
  --red: #dc2626;
  --teal: #0d9488;

  --night: #1a0a4c;
  --night-deep: #110633;
  --on-night: #ffffff;
  --on-night-soft: #d9d1f5;
  --sticker-top: #ffe35a;
  --sticker-bottom: #fcc41c;
  --sticker-ink: #2b0f5f;

  --bg: #f7f4fb;
  --surface: #ffffff;
  --tint: #efe8fa;
  --ink: #1f1a2e;
  --muted: #5b5566;
  --line: #e4dcf0;
  --link: #7e22ce;
  --primary: #7e22ce;
  --focus: #7e22ce;
  --shadow-sm: 0 1px 2px rgb(30 16 70 / 0.06), 0 6px 16px rgb(30 16 70 / 0.06);
  --shadow-md: 0 2px 6px rgb(30 16 70 / 0.08), 0 18px 40px rgb(30 16 70 / 0.14);

  --reel: linear-gradient(90deg,
    var(--orange) 0 12.5%, var(--purple) 0 25%, var(--blue) 0 37.5%, var(--green) 0 50%,
    var(--pink) 0 62.5%, var(--sky) 0 75%, var(--red) 0 87.5%, var(--teal) 0);
  --rays: conic-gradient(#c026d3, #db2777, #ea580c, #f59e0b, #0d9488, #0284c7, #2563eb, #7c3aed, #c026d3);

  --radius: 20px;
  --radius-lg: 28px;
  --container: 1180px;
  --gutter: 20px;
  --header-h: 64px;
  --font: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0b1e;
    --surface: #1a1530;
    --tint: #140f28;
    --ink: #eee9f7;
    --muted: #b8aecb;
    --line: #2e2745;
    --link: #d8b4fe;
    --primary: #c084fc;
    --focus: #d8b4fe;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.3), 0 6px 16px rgb(0 0 0 / 0.2);
    --shadow-md: 0 2px 6px rgb(0 0 0 / 0.35), 0 18px 40px rgb(0 0 0 / 0.35);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

img, svg, canvas { display: block; }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--link); text-underline-offset: 0.15em; }
:where(ul[role="list"], ol[role="list"]) { list-style: none; margin: 0; padding: 0; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip-link {
  position: absolute; left: 12px; top: -100px; z-index: 100;
  padding: 10px 16px; border-radius: 12px;
  background: var(--sticker-top); color: var(--sticker-ink); font-weight: 700;
}
.skip-link:focus { top: 12px; }

.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }

.icon {
  width: 1.25em; height: 1.25em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.icon--sm { width: 1em; height: 1em; }
.icon--lg { width: 1.6em; height: 1.6em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6em;
  min-height: 48px; padding: 0.7em 1.35em;
  border: 1.5px solid transparent; border-radius: 999px;
  font: inherit; font-size: 1rem; font-weight: 700; line-height: 1.1;
  text-decoration: none; cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background-color 0.2s, border-color 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn--sm { min-height: 40px; padding: 0.5em 1.05em; font-size: 0.92rem; }
.btn--lg { min-height: 58px; padding: 0.75em 1.6em; font-size: 1.06rem; }

/* Yellow like the sticker in the store art, for Google Play on dark backgrounds. */
.btn--play {
  background: linear-gradient(180deg, var(--sticker-top), var(--sticker-bottom));
  color: var(--sticker-ink);
  box-shadow: 0 8px 22px rgb(252 196 28 / 0.28), inset 0 -2px 0 rgb(120 70 0 / 0.18);
}
.btn--play:hover { box-shadow: 0 12px 30px rgb(252 196 28 / 0.4), inset 0 -2px 0 rgb(120 70 0 / 0.18); }

.btn--ghost { color: #fff; border-color: rgb(255 255 255 / 0.35); background: rgb(255 255 255 / 0.06); }
.btn--ghost:hover { border-color: rgb(255 255 255 / 0.7); background: rgb(255 255 255 / 0.12); }

.btn--linkedin { background: #0a66c2; color: #fff; }
.btn--linkedin:hover { background: #0958a8; }

.btn__stack { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.btn__stack small { font-size: 0.66rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; }

/* The yellow highlight on one word of a headline, from the store art. */
.sticker {
  display: inline-block;
  padding: 0 0.2em 0.05em;
  border-radius: 0.2em;
  background: linear-gradient(180deg, var(--sticker-top), var(--sticker-bottom));
  color: var(--sticker-ink);
  transform: rotate(-2.5deg);
  box-shadow: 0 0.06em 0 #d99a00, 0 0.2em 0.5em rgb(0 0 0 / 0.28);
  white-space: nowrap;
}

/* ---------- Dice tiles ----------
   A die face in white dots on one of the app's colors. The pips are the
   app's pip layout, never stretched, skewed or cropped. */
.die {
  --size: 44px;
  display: inline-grid; place-items: center; flex: none;
  width: var(--size); height: var(--size);
  border-radius: 24%;
  background: var(--c, var(--purple));
  background: linear-gradient(145deg, color-mix(in srgb, var(--c, var(--purple)) 82%, #fff), var(--c, var(--purple)) 60%);
  color: #fff;
  box-shadow: inset 0 -3px 0 rgb(0 0 0 / 0.14), 0 6px 14px rgb(0 0 0 / 0.16);
}
.die svg { width: 100%; height: 100%; fill: currentColor; filter: drop-shadow(0 1px 1px rgb(0 0 0 / 0.22)); }
.die--xs { --size: 28px; box-shadow: inset 0 -2px 0 rgb(0 0 0 / 0.14); }
.die--sm { --size: 40px; }
.die--md { --size: 56px; }

/* ---------- Icon badges: the option tiles of the app's Settings ---------- */
.icon-badge {
  --light: #ae4bff; --dark: #6a0afa;
  display: inline-grid; place-items: center;
  width: 50px; height: 50px; border-radius: 14px;
  background: linear-gradient(135deg, var(--light), var(--dark));
  color: #fff;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--dark) 30%, transparent);
}
.icon-badge .icon { width: 26px; height: 26px; }
.icon-badge--orange { --light: #ffb000; --dark: #ff7300; }
.icon-badge--purple { --light: #ae4bff; --dark: #6a0afa; }
.icon-badge--blue { --light: #1b8bff; --dark: #005ef8; }
.icon-badge--green { --light: #14e69b; --dark: #00b67a; }
.icon-badge--pink { --light: #ff45b8; --dark: #f7069d; }
.icon-badge--cyan { --light: #1ecaff; --dark: #008fff; }
.icon-badge--red { --light: #ff5034; --dark: #ff1f1f; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  color: #fff;
  background: rgb(26 10 76 / 0.88);
  -webkit-backdrop-filter: saturate(1.3) blur(14px);
  backdrop-filter: saturate(1.3) blur(14px);
  border-bottom: 1px solid rgb(255 255 255 / 0.08);
  --focus: var(--sticker-top);
}
/* A strip of the eight dice colors, like the reel of panels in a roll. */
.site-header::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--reel); }
.site-header__inner { display: flex; align-items: center; gap: 16px; min-height: var(--header-h); }
/* 320px phones: the logo and the button only just fit, so tighten them
   rather than let their text wrap. */
@media (max-width: 359px) {
  .site-header__inner { gap: 10px; }
  .site-header .btn--sm { padding-inline: 0.85em; }
  .site-header .btn--sm .icon { display: none; }
}

.brand { display: inline-flex; align-items: center; gap: 10px; margin-right: auto; color: inherit; text-decoration: none; }
.brand__icon { width: 38px; height: 38px; border-radius: 11px; box-shadow: 0 2px 10px rgb(0 0 0 / 0.3); }
.brand__name { display: flex; flex-direction: column; font-size: 1.02rem; font-weight: 700; line-height: 1.1; }
.brand__name span { font-size: 0.78rem; font-weight: 500; letter-spacing: 0.02em; opacity: 0.8; }

.site-nav { display: none; }
@media (min-width: 1000px) {
  .site-nav { display: block; }
  .site-nav ul { display: flex; gap: 2px; margin: 0; padding: 0; list-style: none; }
  .site-nav a {
    display: block; padding: 8px 13px; border-radius: 999px;
    color: rgb(255 255 255 / 0.85); font-size: 0.95rem; font-weight: 500; text-decoration: none;
  }
  .site-nav a:hover { color: #fff; background: rgb(255 255 255 / 0.1); }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(36px, 7vw, 88px) 0 clamp(56px, 8vw, 104px);
  color: var(--on-night);
  background:
    radial-gradient(ellipse 70% 60% at 75% 45%, rgb(123 47 224 / 0.55), rgb(123 47 224 / 0) 65%),
    linear-gradient(180deg, #1a0a4c 0%, #221058 60%, #2b1466 100%);
  --focus: var(--sticker-top);
}
.hero__grid { position: relative; z-index: 1; display: grid; gap: 48px; align-items: center; }
@media (min-width: 960px) {
  .hero__grid { grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: 56px; }
}

.app-badge {
  display: inline-flex; align-items: center; gap: 12px;
  margin-bottom: 22px; padding: 6px 18px 6px 6px;
  border: 1px solid rgb(255 255 255 / 0.14); border-radius: 999px;
  background: rgb(255 255 255 / 0.08);
}
.app-badge img { width: 44px; height: 44px; border-radius: 12px; }
.app-badge strong { display: block; font-size: 0.98rem; line-height: 1.2; }
.app-badge > span > span { display: block; font-size: 0.82rem; color: var(--on-night-soft); }

.hero__title { display: flex; flex-direction: column; gap: 16px; }
.hero__title-main { font-size: clamp(2.9rem, 9vw, 5.1rem); font-weight: 800; line-height: 1.02; letter-spacing: -0.035em; }
.hero__title-sub { max-width: 28ch; font-size: clamp(1.22rem, 2.6vw, 1.62rem); font-weight: 600; line-height: 1.3; color: #ede7ff; }
.hero__lead { max-width: 54ch; margin-top: 18px; font-size: clamp(1.03rem, 1.6vw, 1.15rem); color: var(--on-night-soft); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero__facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 26px 0 0; padding: 0; list-style: none; font-size: 0.96rem; color: #e4dcff; }
.hero__facts li { display: inline-flex; align-items: center; gap: 6px; }
.hero__facts .icon { color: var(--sticker-top); }

.sparkle { position: absolute; z-index: 0; width: 18px; height: 18px; color: #fff; pointer-events: none; animation: twinkle 4.5s ease-in-out infinite; }
.sparkle--1 { top: 9%; left: 5%; }
.sparkle--2 { top: 16%; right: 6%; width: 26px; height: 26px; color: var(--sticker-top); animation-delay: -1.2s; }
.sparkle--3 { bottom: 8%; left: 38%; width: 14px; height: 14px; color: var(--sticker-top); animation-delay: -2.4s; }
.sparkle--4 { bottom: 12%; right: 4%; width: 22px; height: 22px; animation-delay: -3.3s; }
@keyframes twinkle { 0%, 100% { opacity: 0.9; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.75); } }

/* ---------- Live roll preview ---------- */
.hero__demo { position: relative; display: flex; justify-content: center; }

/* Rainbow rays behind the dice, as in the store art. Shown only where
   masks can be combined; elsewhere the plain glow is enough. */
.hero__demo::before,
.cta__rays {
  content: ""; position: absolute; left: 50%; top: 44%; z-index: 0;
  width: min(900px, 200%); aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: var(--rays);
  opacity: 0.5;
  pointer-events: none;
  display: none;
}
@supports ((mask-composite: intersect) or (-webkit-mask-composite: source-in)) {
  .hero__demo::before,
  .cta__rays {
    display: block;
    -webkit-mask-image:
      repeating-conic-gradient(#000 0deg 3.2deg, transparent 3.2deg 9deg),
      radial-gradient(closest-side, transparent 18%, #000 38%, transparent 84%);
    -webkit-mask-composite: source-in;
    mask-image:
      repeating-conic-gradient(#000 0deg 3.2deg, transparent 3.2deg 9deg),
      radial-gradient(closest-side, transparent 18%, #000 38%, transparent 84%);
    mask-composite: intersect;
  }
}

.demo { position: relative; z-index: 1; width: min(100%, 440px); }

.demo__stage {
  position: relative; display: block;
  width: 100%; aspect-ratio: 4 / 5;
  margin: 0; padding: 0; border: 0; border-radius: 32px;
  overflow: hidden;
  background: var(--purple);
  cursor: pointer;
  box-shadow: 0 30px 70px rgb(8 2 30 / 0.55), inset 0 0 0 1px rgb(255 255 255 / 0.12);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.demo__stage:focus-visible { outline: 3px solid var(--sticker-top); outline-offset: 5px; }

/* Until the preview has drawn (or without JavaScript): the app's first
   screen, a single white dot over purple. A die is half the panel wide and
   a pip is 9% of the die across, so the dot is 9% of the panel. */
.demo__stage::before {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 9%; aspect-ratio: 1; border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 5px rgb(0 0 0 / 0.18);
}
.demo__stage.is-ready::before { display: none; }
.demo__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.demo__hint {
  position: absolute; left: 50%; bottom: 18px;
  display: none; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  background: rgb(12 4 36 / 0.4);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fff; font-size: 0.9rem; font-weight: 600; white-space: nowrap;
  transform: translateX(-50%);
  transition: opacity 0.3s;
}
.js .demo__hint { display: inline-flex; }
.demo__stage.is-rolling .demo__hint { opacity: 0; }

.demo__status { min-height: 1.6em; margin-top: 16px; font-size: 1.05rem; font-weight: 600; text-align: center; color: #fff; }
.demo__note { margin-top: 4px; font-size: 0.88rem; text-align: center; color: var(--on-night-soft); }

/* ---------- Sections ---------- */
.section { position: relative; padding: clamp(64px, 9vw, 112px) 0; }
.section--tint { background: var(--tint); }
.section--dark {
  color: var(--on-night);
  background: linear-gradient(180deg, #1a0a4c, #241062);
  --focus: var(--sticker-top);
}

.section-head { max-width: 740px; margin: 0 auto clamp(36px, 5vw, 56px); text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
  font-size: 0.82rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--primary);
}
/* Three panel colors, a little piece of the reel. */
.eyebrow::before { content: ""; width: 24px; height: 5px; border-radius: 3px; background: linear-gradient(90deg, var(--orange) 0 33%, var(--purple) 0 66%, var(--blue) 0); }
.section--dark .eyebrow { color: var(--sticker-top); }
.section-head h2 { font-size: clamp(2rem, 4.6vw, 3.1rem); font-weight: 800; letter-spacing: -0.03em; }
.lead { margin-top: 16px; font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--muted); }
.section--dark .lead { color: var(--on-night-soft); }

.note { max-width: 680px; margin: 36px auto 0; font-size: 0.97rem; text-align: center; color: var(--muted); }
.section--dark .note { color: var(--on-night-soft); }

/* Cards on light sections share one look. */
.intro-card, .feature-card, .use-card, .step, .faq-group, .dev-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.intro-card, .feature-card, .use-card, .step { position: relative; padding: 26px 24px 24px; }
.intro-card h3, .feature-card h3, .use-card h3, .step h3 { margin-top: 18px; font-size: 1.2rem; }
.intro-card p, .feature-card p, .use-card p, .step p { margin-top: 8px; color: var(--muted); }

/* ---------- For creators ---------- */
.intro__grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .intro__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .intro__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- Showcase tour ---------- */
.tour__layout { display: grid; gap: 24px; }
@media (min-width: 960px) {
  .tour__layout { grid-template-columns: 330px minmax(0, 1fr); gap: 44px; align-items: start; }
}
.tour__tabs {
  display: flex; gap: 10px;
  margin: 0 calc(var(--gutter) * -1);
  padding: 4px var(--gutter) 10px;
  overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
}
.tour__tabs::-webkit-scrollbar { display: none; }
@media (min-width: 960px) { .tour__tabs { flex-direction: column; margin: 0; padding: 0; overflow: visible; } }
.tour__tab {
  display: flex; align-items: center; gap: 14px; flex: none;
  min-height: 64px; padding: 10px 18px 10px 10px;
  border: 1px solid rgb(255 255 255 / 0.12); border-radius: 18px;
  background: rgb(255 255 255 / 0.05);
  color: #fff; font: inherit; text-align: left;
  cursor: pointer; scroll-snap-align: start;
  transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.tour__tab:hover { background: rgb(255 255 255 / 0.1); }
.tour__tab[aria-selected="true"] {
  border-color: rgb(255 227 90 / 0.75);
  background: rgb(255 255 255 / 0.14);
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.25);
}
.tour__tab-text strong { display: block; font-size: 1rem; line-height: 1.25; }
.tour__tab-text span { display: block; font-size: 0.85rem; color: var(--on-night-soft); }

.tour__panel {
  display: grid; gap: 24px; justify-items: center; align-items: center;
  padding: 24px;
  border: 1px solid rgb(255 255 255 / 0.1); border-radius: var(--radius-lg);
  background: rgb(255 255 255 / 0.05);
}
.tour__panel[hidden] { display: none; }
/* Without JavaScript every panel shows, one under the other. */
html:not(.js) .tour__panel + .tour__panel { margin-top: 16px; }
@media (min-width: 720px) {
  .tour__panel { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); justify-items: start; gap: 36px; padding: 32px; }
}
.tour__shot { width: min(100%, 300px); border-radius: 24px; box-shadow: 0 24px 60px rgb(0 0 0 / 0.45); }
.tour__text h3 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); font-weight: 800; }
.tour__text p { margin-top: 12px; font-size: 1.08rem; color: var(--on-night-soft); }

.swatches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; margin: 22px 0 0; padding: 0; list-style: none; }
@media (min-width: 480px) { .swatches { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.swatches li { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; }
.swatches li::before { content: ""; flex: none; width: 22px; height: 22px; border-radius: 7px; background: var(--c); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.25); }
.face-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }

/* ---------- Features ---------- */
.feature-grid, .use-grid, .idea-grid { display: grid; gap: 16px; }
@media (min-width: 640px) {
  .feature-grid, .use-grid, .idea-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .feature-grid, .use-grid, .idea-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
}
.feature-card, .use-card { transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease); }
.feature-card:hover, .use-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.palette-strip { display: block; height: 10px; margin-top: 16px; border-radius: 6px; background: var(--reel); }

/* ---------- Use cases ---------- */
.use-card { overflow: hidden; background: linear-gradient(150deg, color-mix(in srgb, var(--c) 12%, var(--surface)), var(--surface) 55%); }
/* The feature and use-case lists leave a short last row on wider screens,
   so they wrap as flex rows and center that row instead of leaving empty
   cells. Widths and gaps match the grid above: one, two, then three across. */
.feature-grid, .use-grid { display: flex; flex-wrap: wrap; justify-content: center; }
.feature-grid > li, .use-grid > li { flex: 0 1 100%; }
@media (min-width: 640px) { .feature-grid > li, .use-grid > li { flex-basis: calc((100% - 16px) / 2); } }
@media (min-width: 1024px) { .feature-grid > li, .use-grid > li { flex-basis: calc((100% - 40px) / 3); } }

/* ---------- How it works ---------- */
.steps { display: grid; gap: 16px; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) {
  .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
  /* A chevron between the steps. */
  .step:not(:last-child)::after {
    content: ""; position: absolute; top: 48px; right: -21px;
    width: 12px; height: 12px;
    border-top: 3px solid var(--primary); border-right: 3px solid var(--primary);
    border-radius: 2px;
    transform: rotate(45deg); opacity: 0.55;
  }
}

/* ---------- Creator ideas ---------- */
.idea-card {
  padding: 24px;
  border: 1px solid rgb(255 255 255 / 0.12); border-radius: var(--radius);
  background: rgb(255 255 255 / 0.06);
  transition: background-color 0.2s, transform 0.25s var(--ease);
}
.idea-card:hover { background: rgb(255 255 255 / 0.1); transform: translateY(-3px); }
.idea-card h3 { font-size: 1.22rem; }
.idea-card p:not(.tags) { margin-top: 8px; color: var(--on-night-soft); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tags span { padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; background: rgb(255 227 90 / 0.14); color: var(--sticker-top); }
.tags span + span { background: rgb(255 255 255 / 0.1); color: #e4dcff; }

/* ---------- FAQ ---------- */
.faq__groups { display: grid; gap: 20px; align-items: start; }
@media (min-width: 1024px) { .faq__groups { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; } }
.faq-group { padding: 8px 22px 10px; }
.faq-group__title { display: flex; align-items: center; gap: 12px; padding: 16px 0 14px; font-size: 1.15rem; font-weight: 800; }
.faq-item { border-top: 1px solid var(--line); }
.faq-item h4 { font-size: inherit; }
.faq-item__q {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: 100%; min-height: 56px; padding: 14px 0;
  border: 0; background: none;
  color: var(--ink); font: inherit; font-size: 1.04rem; font-weight: 600; line-height: 1.4; text-align: left;
  cursor: pointer;
}
.faq-item__q:hover { color: var(--primary); }
.faq-item__q .icon { color: var(--primary); transition: transform 0.25s var(--ease); }
.faq-item__q[aria-expanded="true"] .icon { transform: rotate(180deg); }
.faq-item__a { padding: 0 0 18px; color: var(--muted); }
.faq-item__a p { max-width: 65ch; }

/* ---------- Screenshots ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
@media (min-width: 900px) { .gallery-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 22px; } }
.shot {
  display: block; overflow: hidden;
  border-radius: 20px;
  box-shadow: 0 18px 40px rgb(0 0 0 / 0.4);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.shot:hover { transform: translateY(-6px); box-shadow: 0 26px 50px rgb(0 0 0 / 0.5); }
.shot img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; }
.shot__caption { margin-top: 12px; font-size: 0.95rem; font-weight: 600; line-height: 1.35; text-align: center; color: #ede7ff; }

.lightbox {
  width: 100%; max-width: none; height: 100%; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: transparent; color: #fff;
  overflow: hidden;
  --focus: var(--sticker-top);
}
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: rgb(10 4 30 / 0.9); }
.lightbox__figure { display: flex; flex-direction: column; align-items: center; gap: 14px; margin: 0; padding: 64px 16px 88px; }
.lightbox__img {
  width: auto; max-width: min(92vw, 560px);
  max-height: calc(100vh - 170px); max-height: calc(100dvh - 170px);
  border-radius: 20px; box-shadow: 0 30px 80px rgb(0 0 0 / 0.6);
}
.lightbox__caption { font-weight: 600; text-align: center; }
.lightbox__btn {
  position: fixed; display: grid; place-items: center;
  width: 48px; height: 48px;
  border: 1px solid rgb(255 255 255 / 0.25); border-radius: 999px;
  background: rgb(255 255 255 / 0.12); color: #fff;
  cursor: pointer;
}
.lightbox__btn:hover { background: rgb(255 255 255 / 0.22); }
.lightbox__close { top: 16px; right: 16px; }
.lightbox__prev { bottom: 20px; left: calc(50% - 60px); }
.lightbox__next { bottom: 20px; right: calc(50% - 60px); }
@media (min-width: 760px) {
  .lightbox__figure { padding-bottom: 32px; }
  .lightbox__img { max-height: calc(100vh - 120px); max-height: calc(100dvh - 120px); }
  .lightbox__prev, .lightbox__next { top: 50%; bottom: auto; transform: translateY(-50%); }
  .lightbox__prev { left: 24px; }
  .lightbox__next { right: 24px; }
}

/* ---------- Call to action ---------- */
.cta {
  position: relative; overflow: hidden;
  padding: clamp(72px, 10vw, 124px) 0;
  color: var(--on-night); text-align: center;
  background:
    radial-gradient(ellipse 60% 70% at 50% 42%, rgb(123 47 224 / 0.7), rgb(123 47 224 / 0) 70%),
    linear-gradient(160deg, #2a0f6b, #1a0a4c 60%, #110633);
  --focus: var(--sticker-top);
}
.cta__rays { top: 46%; width: 1500px; opacity: 0.4; }
.cta__inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.cta__icon { width: 96px; height: 96px; margin-bottom: 26px; border-radius: 26px; box-shadow: 0 18px 40px rgb(0 0 0 / 0.45); }
.cta h2 { max-width: 15ch; font-size: clamp(2.2rem, 5.6vw, 3.7rem); font-weight: 800; line-height: 1.12; letter-spacing: -0.03em; }
.cta p { max-width: 50ch; margin-top: 18px; font-size: 1.12rem; color: var(--on-night-soft); }
.cta__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 32px; }

.die--float { position: absolute; z-index: 0; --size: 58px; animation: bob 7s ease-in-out infinite; }
.die--f1 { top: 12%; left: 7%; rotate: -12deg; }
.die--f2 { top: 16%; right: 8%; --size: 68px; rotate: 10deg; animation-delay: -2s; }
.die--f3 { bottom: 12%; left: 12%; --size: 48px; rotate: 8deg; animation-delay: -4s; }
.die--f4 { bottom: 10%; right: 11%; --size: 54px; rotate: -8deg; animation-delay: -5.5s; }
@media (max-width: 719px) {
  .die--float { --size: 40px; opacity: 0.8; }
  .die--f2 { --size: 44px; }
  .die--f1 { top: 5%; left: 5%; }
  .die--f2 { top: 6%; right: 5%; }
  .die--f3 { bottom: 4%; left: 6%; }
  .die--f4 { bottom: 5%; right: 6%; }
}
@keyframes bob { 50% { translate: 0 -10px; } }

/* ---------- Company & developer ---------- */
/* The column may not grow past the screen: the email address, which can't
   wrap at a space, would otherwise push the page sideways on small phones. */
.dev-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; max-width: 940px; margin: 0 auto; }
@media (min-width: 760px) { .dev-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; } }
.dev-card { display: flex; align-items: flex-start; gap: 18px; padding: 26px 24px; }
.dev-card__body { min-width: 0; }
.dev-card__links a { overflow-wrap: anywhere; }
/* On the narrowest phones the avatar sits above the text, so the address
   gets the card's full width. */
@media (max-width: 399px) { .dev-card { flex-direction: column; gap: 14px; } }
.dev-card__avatar {
  display: grid; place-items: center; flex: none;
  width: 56px; height: 56px; border-radius: 16px;
  background: linear-gradient(135deg, #ae4bff, #6a0afa);
  color: #fff; font-size: 1.1rem; font-weight: 800; letter-spacing: 0.04em;
}
.dev-card__avatar .icon { width: 28px; height: 28px; }
.dev-card__avatar--initials { background: linear-gradient(135deg, #1b8bff, #005ef8); }
.dev-card__role { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--primary); }
.dev-card__name { margin-top: 4px; font-size: 1.3rem; }
.dev-card__body > p:not(.dev-card__role) { margin-top: 8px; color: var(--muted); }
.dev-card__links { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 16px; }
.text-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  padding: 60px 0 28px;
  background: var(--night-deep); color: var(--on-night-soft);
  --focus: var(--sticker-top);
}
.site-footer::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--reel); }
.site-footer__top { display: grid; gap: 36px; }
@media (min-width: 640px) { .site-footer__top { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .site-footer__top { grid-template-columns: 1.5fr 1fr 1fr 1.3fr; gap: 40px; } }
.site-footer .brand { color: #fff; margin-right: 0; }
.site-footer__brand p { max-width: 34ch; margin: 16px 0 20px; }
.site-footer h2 { margin-bottom: 14px; font-size: 0.85rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #fff; }
.site-footer ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.site-footer__col a, .site-footer__bottom a { display: inline-flex; align-items: center; gap: 8px; color: #e4dcff; text-decoration: none; }
.site-footer__col a:hover, .site-footer__bottom a:hover { color: #fff; text-decoration: underline; }
.site-footer__col .icon { color: var(--sticker-top); }
.site-footer__bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px;
  margin-top: 44px; padding-top: 22px;
  border-top: 1px solid rgb(255 255 255 / 0.1);
  font-size: 0.93rem;
}

/* ---------- Reveal on scroll (only once main.js has set it up) ---------- */
.reveal-on [data-reveal] { transition: opacity 0.7s var(--ease) var(--delay, 0ms), transform 0.7s var(--ease) var(--delay, 0ms); }
.reveal-on [data-reveal]:not(.is-visible) { opacity: 0; transform: translateY(18px); }

/* ---------- Less motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  .btn:hover, .feature-card:hover, .use-card:hover, .idea-card:hover, .shot:hover { transform: none; }
  .reveal-on [data-reveal]:not(.is-visible) { opacity: 1; transform: none; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .hero__demo, .sparkle, .cta__rays, .die--float, .lightbox, .tour__tabs { display: none !important; }
  .hero, .section--dark, .cta, .site-footer { background: none; color: #000; }
  .tour__panel[hidden] { display: grid; }
}
