/* ── Reset ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ── Ion Icons Base ── */
ion-icon {
  font-size: inherit;
  color: inherit;
  vertical-align: middle;
  pointer-events: none;
}

/* ── Font Faces ── */
@font-face {
  font-family: 'OpenDyslexic';
  src: url('assets/fonts/OpenDyslexic-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'OpenDyslexic';
  src: url('assets/fonts/OpenDyslexic-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ── Rainbow border custom property ── */
@property --rainbow-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

/* ── Tokens (Light default) ── */
:root {
  --bg: #F7F4F1;
  --surface: #FFF6EC;
  --border: #7A6854;
  --accent: #B55100;
  --accent-secondary: #9A4500;
  --text: #111827;
  --text-secondary: #374151;
  --text-muted: #4B5563;
  --text-inverse: #FFFFFF;
  --success: #15803D;
  --danger: #B91C1C;

  /* Scene banner colours - light */
  --sun-color: #CC7E68;
  --sun-opacity: 0.55;
  --moon-color: #D4D8E0;
  --moon-opacity: 0;
  --cloud1: #FFFFFF;
  --cloud2: #EBE7E1;
  --cloud3: #D8D2CA;
  --cloud4: #D5CFC8;

  /* Neomorphic shadows */
  --neu-low: 0 1px 3px rgba(0,0,0,0.06), 0 -1px 2px rgba(255,255,255,0.4);
  --neu-medium: 0 2px 8px rgba(0,0,0,0.1), 0 -2px 4px rgba(255,255,255,0.5);
  --neu-high: 0 4px 16px rgba(0,0,0,0.14), 0 -2px 6px rgba(255,255,255,0.5);

  --font: 'Outfit', system-ui, -apple-system, sans-serif;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;

  /* Typography scale — Major-third (≈1.2×) ratio
     xs=Caption  sm=Subhead  md=Body  lg=Title3  xl=Title2  xxl=Title1 */
  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-md: 16px;
  --fs-lg: 20px;
  --fs-xl: 24px;
  --fs-xxl: 32px;
  --lh-tight: 1.2;
  --lh-normal: 1.4;
  --lh-relaxed: 1.6;
  --ls-tighter: -0.5px;
  --ls-tight: -0.25px;
  --ls-none: 0px;
  --ls-wide: 0.5px;

  /* Rarity / resource tokens — light */
  --rarity-common: #4B5563;
  --rarity-uncommon: #0F766E;
  --rarity-rare: #1D4ED8;
  --rarity-epic: #6D28D9;
  --rarity-legendary: #B45309;
  --color-xp: #B8860B;
  --color-ember: #B8860B;
  --color-streak: #9A3412;
  --raid-streak: #9A3412;
}

/* System dark (no manual override) */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg: #152E2E;
    --surface: #1E3A3A;
    --border: #5E8E8E;
    --accent: #F1C766;
    --accent-secondary: #E0B44F;
    --text: #F5ECD9;
    --text-secondary: #DDD2BB;
    --text-muted: #B7C8C2;
    --text-inverse: #152E2E;
    --success: #4ADE80;
    --danger: #FF7575;

    --sun-color: #CC7E68;
    --sun-opacity: 0;
    --moon-color: #D4D8E0;
    --moon-opacity: 0.9;
    --cloud1: #8090A0;
    --cloud2: #5D6E7C;
    --cloud3: #3A4C58;
    --cloud4: #1A1E24;

    --neu-low: 0 1px 3px rgba(0,0,0,0.25);
    --neu-medium: 0 2px 8px rgba(0,0,0,0.35);
    --neu-high: 0 4px 16px rgba(0,0,0,0.45);

    --rarity-common: #B7C8C2;
    --rarity-uncommon: #2DD4BF;
    --rarity-rare: #5DA9FF;
    --rarity-epic: #C084FC;
    --rarity-legendary: #F1C766;
    --color-xp: #F1C766;
    --color-ember: #F1C766;
    --color-streak: #FF8A4C;
    --raid-streak: #FF9A5C;
  }

}

/* Manual dark override */
html[data-theme="dark"] {
  --bg: #152E2E;
  --surface: #1E3A3A;
  --border: #5E8E8E;
  --accent: #F1C766;
  --accent-secondary: #E0B44F;
  --text: #F5ECD9;
  --text-secondary: #DDD2BB;
  --text-muted: #B7C8C2;
  --text-inverse: #152E2E;
  --success: #4ADE80;
  --danger: #FF7575;

  --sun-color: #CC7E68;
  --sun-opacity: 0;
  --moon-color: #D4D8E0;
  --moon-opacity: 0.9;
  --cloud1: #8090A0;
  --cloud2: #5D6E7C;
  --cloud3: #3A4C58;
  --cloud4: #1A1E24;

  --neu-low: 0 1px 3px rgba(0,0,0,0.25);
  --neu-medium: 0 2px 8px rgba(0,0,0,0.35);
  --neu-high: 0 4px 16px rgba(0,0,0,0.45);

  --rarity-common: #B7C8C2;
  --rarity-uncommon: #2DD4BF;
  --rarity-rare: #5DA9FF;
  --rarity-epic: #C084FC;
  --rarity-legendary: #F1C766;
  --color-xp: #F1C766;
  --color-ember: #F1C766;
  --color-streak: #FF8A4C;
  --raid-streak: #FF9A5C;
}

/* Manual light override */
html[data-theme="light"] {
  --bg: #F7F4F1;
  --surface: #FFF6EC;
  --border: #7A6854;
  --accent: #B55100;
  --accent-secondary: #9A4500;
  --text: #111827;
  --text-secondary: #374151;
  --text-muted: #4B5563;
  --text-inverse: #FFFFFF;
  --success: #15803D;
  --danger: #B91C1C;

  --sun-color: #CC7E68;
  --sun-opacity: 0.55;
  --moon-color: #D4D8E0;
  --moon-opacity: 0;
  --cloud1: #FFFFFF;
  --cloud2: #EBE7E1;
  --cloud3: #D8D2CA;
  --cloud4: #D5CFC8;

  --neu-low: 0 1px 3px rgba(0,0,0,0.06), 0 -1px 2px rgba(255,255,255,0.4);
  --neu-medium: 0 2px 8px rgba(0,0,0,0.1), 0 -2px 4px rgba(255,255,255,0.5);
  --neu-high: 0 4px 16px rgba(0,0,0,0.14), 0 -2px 6px rgba(255,255,255,0.5);

  --rarity-common: #4B5563;
  --rarity-uncommon: #0F766E;
  --rarity-rare: #1D4ED8;
  --rarity-epic: #6D28D9;
  --rarity-legendary: #B45309;
  --color-xp: #B8860B;
  --color-ember: #B8860B;
  --color-streak: #9A3412;
  --raid-streak: #9A3412;
}

/* Dyslexia font — OpenDyslexic is naturally wider/taller, scale down */
html[data-font="dyslexia"] {
  --font: 'OpenDyslexic', system-ui, sans-serif;
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-md: 14px;
  --fs-lg: 17px;
  --fs-xl: 21px;
  --fs-xxl: 28px;
}

html[data-font="dyslexia"][data-size="m"] {
  --fs-xs: 12px; --fs-sm: 14px; --fs-md: 16px;
  --fs-lg: 20px; --fs-xl: 24px; --fs-xxl: 32px;
}

html[data-font="dyslexia"][data-size="l"] {
  --fs-xs: 14px; --fs-sm: 17px; --fs-md: 19px;
  --fs-lg: 24px; --fs-xl: 29px; --fs-xxl: 38px;
}

/* Font-size scale overrides */
html[data-size="m"] {
  --fs-xs: 14px; --fs-sm: 17px; --fs-md: 19px;
  --fs-lg: 24px; --fs-xl: 29px; --fs-xxl: 38px;
}
html[data-size="l"] {
  --fs-xs: 18px; --fs-sm: 21px; --fs-md: 24px;
  --fs-lg: 30px; --fs-xl: 36px; --fs-xxl: 48px;
}
html[data-size="m"] #size-toggle .size-label { font-size: 16px; }
html[data-size="l"] #size-toggle .size-label { font-size: 18px; }

/* ── Base ── */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Smooth theme transitions on key elements */
body,
.toolbar,
.feature-card,
.journey-block,
.store-badge,
.footer,
.track-node,
.scene-banner,
.hero-icon,
.picker-avatar,
.phone-frame {
  transition: background-color 0.4s, color 0.3s, border-color 0.3s;
}

.container {
  margin: 0 auto;
  padding: 0 24px;
  justify-content: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 1200px;
}

/* ── Skip Link ── */
.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 999;
  padding: 8px 16px;
  background: var(--accent);
  color: var(--text-inverse);
  font-family: var(--font);
  font-weight: 700;
  font-size: var(--fs-sm);
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.skip-link:focus {
  left: 50%;
  transform: translateX(-50%);
  top: 8px;
}

/* ── Scene Banner (Full-Width Strip) ── */
.scene-banner {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.scene-banner--backdrop {
  position: absolute;
  inset: 0;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}


.scene-layer {
  position: absolute;
  top: 0;
  bottom: 0;
  height: 100%;
}

.scene-layer--sky {
  left: 0;
  right: 0;
  width: 100%;
}

/* Cloud layers oversized to prevent gaps during drift animation */
.scene-layer--cloud1,
.scene-layer--cloud2,
.scene-layer--cloud3,
.scene-layer--cloud4 {
  left: -5%;
  width: 110%;
}

.scene-sun,
.scene-moon {
  transition: opacity 0.6s ease;
  transform-origin: center;
}

.scene-sun {
  animation: scene-bob 6s ease-in-out infinite;
}

.scene-moon {
  animation: scene-bob 7s ease-in-out infinite;
}

/* Cloud drift — parallax: far layers slow, near layers faster */
.scene-layer--cloud1 { animation: scene-drift-slow 20s ease-in-out infinite alternate; }
.scene-layer--cloud2 { animation: scene-drift-med 16s ease-in-out infinite alternate; }
.scene-layer--cloud3 { animation: scene-drift-fast 12s ease-in-out infinite alternate; }
.scene-layer--cloud4 { animation: scene-drift-near 14s ease-in-out infinite alternate; }

@keyframes scene-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes scene-drift-slow {
  0% { transform: translateX(-1%); }
  100% { transform: translateX(1%); }
}

@keyframes scene-drift-med {
  0% { transform: translateX(0.8%); }
  100% { transform: translateX(-0.8%); }
}

@keyframes scene-drift-fast {
  0% { transform: translateX(-1.2%); }
  100% { transform: translateX(1.2%); }
}

@keyframes scene-drift-near {
  0% { transform: translateX(1%); }
  100% { transform: translateX(-1%); }
}

.scene-word {
  text-align: center;
  margin-top: 12px;
}

.scene-word-text {
  font-family: var(--font);
  font-weight: 700;
  font-size: var(--fs-sm);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 1;
  transition: opacity 0.5s ease;
}

.scene-word-text.fading {
  opacity: 0;
}

/* ── Sticky Toolbar ── */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 30%, transparent);
  box-shadow: var(--neu-low);
}

.toolbar-actions {
  display: flex;
  gap: 8px;
}

.toolbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-family: var(--font);
  font-size: var(--fs-sm);
  font-weight: 700;
  transition: background-color 0.2s, border-color 0.2s;
  position: relative;
}

.toolbar-btn:hover {
  background: color-mix(in srgb, var(--accent) 15%, var(--surface));
}

#font-toggle.active {
  border-color: var(--accent);
  color: var(--accent);
}

/* Sun/moon icon crossfade */
.icon-sun, .icon-moon {
  position: absolute;
  transition: opacity 0.3s ease;
  font-size: 20px;
}

.icon-moon { opacity: 0; }

html[data-theme="dark"] .icon-sun { opacity: 0; }
html[data-theme="dark"] .icon-moon { opacity: 1; }

/* System dark without manual override */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]):not([data-theme="dark"]) .icon-sun { opacity: 0; }
  html:not([data-theme="light"]):not([data-theme="dark"]) .icon-moon { opacity: 1; }
}

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 24px 24px 16px;
  position: relative;
}

.hero-title-row {
  position: relative;
  display: inline-block;
}

.hero-cat {
  width: 45px;
  height: 50px;
  image-rendering: pixelated;
  position: absolute;
  top: 40px;
  z-index: 2;
}

.hero-cat--left {
  left: 10px;
}

.hero-cat--right {
  right: 10px;
}

.hero-icon {
  height: 0.85em;
  width: auto;
  vertical-align: baseline;
  margin: 0 -2px;
  position: relative;
  z-index: 1;
}

.hero-title-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
}

/* Rainbow border container */
.rainbow-border-box {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  overflow: hidden;
}

/* Inner background fill to create border-only effect */
.rainbow-border-box::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: calc(var(--radius-md) - 3px);
  background: var(--bg);
  z-index: 0;
  transition: background-color 0.4s;
}

@keyframes rainbow-spin {
  to { --rainbow-angle: 360deg; }
}

.hero-title {
  position: relative;
  z-index: 1;
  font-size: clamp(48px, 10vw, 80px);
  font-weight: 900;
  letter-spacing: -1px;
  white-space: nowrap;
  color: var(--text);
  line-height: 1.1;
}

/* Floating arrows */
.arrow-float {
  position: absolute;
  z-index: 1;
  color: rgba(255, 215, 0, 0.5);
  font-size: 20px;
  font-weight: 700;
  bottom: 0;
  animation: arrow-rise 2s ease-out infinite;
  opacity: 0;
  will-change: transform;
}

.arrow-float:nth-child(1) { left: 8%; animation-delay: 0s; }
.arrow-float:nth-child(2) { left: 24%; animation-delay: 0.3s; }
.arrow-float:nth-child(3) { left: 42%; animation-delay: 0.7s; }
.arrow-float:nth-child(4) { left: 58%; animation-delay: 0.15s; }
.arrow-float:nth-child(5) { left: 76%; animation-delay: 0.55s; }
.arrow-float:nth-child(6) { left: 90%; animation-delay: 0.9s; }

@keyframes arrow-rise {
  0% {
    transform: translateY(0);
    opacity: 0.6;
  }
  100% {
    transform: translateY(-60px);
    opacity: 0;
  }
}

.hero-tagline {
  font-size: clamp(18px, 3.5vw, 24px);
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: var(--lh-relaxed);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Hero XP Bar ── */
.hero-xp {
  display: flex;
  align-items: center;
  height: 44px;
  background: #47556918;
  border-radius: 9999px;
  margin: 12px auto 4px;
  max-width: 420px;
  width: 100%;
  position: relative;
  overflow: hidden;
}

:root[data-theme="dark"] .hero-xp,
:root:not([data-theme]) .hero-xp {
  background: rgba(0,0,0,0.25);
}

:root[data-theme="light"] .hero-xp {
  background: #47556918;
}

/* Level badge — flush left, full height, tier color bg */
.hero-xp-badge {
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 4px;
  background: #475569;
  flex-shrink: 0;
  z-index: 3;
}

.hero-xp-badge-lv {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
  line-height: 1;
}

.hero-xp-badge-num {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

/* Inner area — flex:1 pushes numbers/embers to the right */
.hero-xp-inner {
  flex: 1;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* Progress fill — absolute within inner */
.hero-xp-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: #475569;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 1;
}

/* Flash overlay — white flash on level-up */
.hero-xp-flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.08s ease-out;
}

.hero-xp-flash.active {
  opacity: 0.5;
}

/* XP numbers — above fill */
.hero-xp-numbers {
  display: flex;
  align-items: baseline;
  padding: 0 12px;
  z-index: 3;
  flex-shrink: 0;
  white-space: nowrap;
}

.hero-xp-current {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.hero-xp-slash {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.75);
  line-height: 1;
}

.hero-xp-needed {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.75);
  line-height: 1;
}

/* Light mode XP text — darkened tier color for contrast */
:root[data-theme="light"] .hero-xp-current {
  color: #1e2a35;
}
:root[data-theme="light"] .hero-xp-slash,
:root[data-theme="light"] .hero-xp-needed {
  color: #14202b;
}

/* Separator */
.hero-xp-sep {
  width: 1px;
  height: 50%;
  margin: 0 2px;
  background: rgba(255,255,255,0.25);
  flex-shrink: 0;
  z-index: 3;
}

:root[data-theme="light"] .hero-xp-sep {
  background: rgba(0,0,0,0.15);
}

/* Embers */
.hero-xp-embers {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 12px 0 8px;
  flex-shrink: 0;
  z-index: 3;
  white-space: nowrap;
}

.hero-xp-embers ion-icon {
  font-size: 14px;
  color: #E67E22;
}

.hero-xp-embers span {
  font-size: 12px;
  font-weight: 700;
  color: #E67E22;
  line-height: 1;
}

/* Floating +XP badge */
.hero-xp-float {
  position: absolute;
  top: -28px;
  right: 60px;
  font-size: 13px;
  font-weight: 800;
  color: var(--success, #15803D);
  background: rgba(21,128,61,0.15);
  padding: 2px 8px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  z-index: 10;
  transform: translateY(6px) scale(0.5);
  transition: opacity 0.25s, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hero-xp-float.active {
  opacity: 1;
  transform: translateY(-4px) scale(1);
}

.hero-xp-float.dismiss {
  opacity: 0;
  transform: translateY(-14px) scale(0.9);
  transition: opacity 0.4s, transform 0.4s;
}

/* Power-up arrows */
.hero-xp-arrows {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}

.hero-xp-arrows .xp-arrow {
  position: absolute;
  bottom: -12px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,215,0,0.85);
  text-shadow: 0 0 4px rgba(0,0,0,0.5);
  opacity: 0;
  animation: xp-arrow-rise 1.4s ease-out forwards;
}

@keyframes xp-arrow-rise {
  0%   { opacity: 0; transform: translateY(0) scale(0.8); }
  15%  { opacity: 0.9; transform: translateY(-2px) scale(1); }
  100% { opacity: 0; transform: translateY(-28px) scale(0.6); }
}

/* Rainbow glow on level-up (3.5s cycle matching app) */
.hero-xp.levelup {
  animation: xp-rainbow-flash 3.5s ease-out;
}

@keyframes xp-rainbow-flash {
  0%   { box-shadow: 0 0 0 0 rgba(255,107,107,0.6); }
  20%  { box-shadow: 0 0 16px 4px rgba(254,202,87,0.4); }
  40%  { box-shadow: 0 0 16px 4px rgba(72,219,251,0.4); }
  60%  { box-shadow: 0 0 16px 4px rgba(255,159,243,0.4); }
  80%  { box-shadow: 0 0 16px 4px rgba(84,160,255,0.4); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hero-xp-fill.rainbow {
  background: linear-gradient(90deg, #FF6B6B, #FECA57, #48DBFB, #FF9FF3, #54A0FF, #5F27CD) !important;
  background-size: 300% 100% !important;
  animation: xp-rainbow-sweep 0.6s linear;
}

@keyframes xp-rainbow-sweep {
  0%   { background-position: 100% 0; }
  100% { background-position: 0% 0; }
}

/* Responsive */
@media (max-width: 600px) {
  .hero-xp {
    max-width: 320px;
    height: 38px;
  }
  .hero-xp-badge {
    padding: 0 10px;
    gap: 3px;
  }
  .hero-xp-badge-lv { font-size: 10px; }
  .hero-xp-badge-num { font-size: 11px; }
  .hero-xp-current,
  .hero-xp-slash,
  .hero-xp-needed,
  .hero-xp-embers span { font-size: 10px; }
  .hero-xp-embers ion-icon { font-size: 12px; }
  .hero-xp-numbers { padding: 0 8px; }
  .hero-xp-embers { padding: 0 8px 0 6px; }
  .hero-cat {
    width: 36px;
    height: 36px;
    top: 30px;
  }
}

@media (max-width: 380px) {
  .hero-xp {
    max-width: 280px;
  }
  .hero-xp-embers {
    display: none;
  }
  .hero-xp-sep {
    display: none;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hero-xp-fill { transition: none; }
  .hero-xp-float { transition: none; }
  .hero-xp-flash { transition: none; }
  .hero-xp.levelup { animation: none; }
  .hero-xp-fill.rainbow { animation: none; }
  .hero-xp-arrows .xp-arrow { animation: none; opacity: 0; }
  .levelup-overlay { transition: none; }
}

.hero-sub {
  font-size: clamp(20px, 4vw, 28px);
  font-weight: 600;
  color: var(--accent);
  margin-top: 8px;
}

/* Store badges */
.store-badges {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: var(--text);
  color: var(--text-inverse);
  border-radius: 9999px;
  font-size: var(--fs-sm);
  font-weight: 500;
  box-shadow: var(--neu-low);
  text-decoration: none;
  transition: background-color 0.3s, color 0.3s, transform 0.2s;
}

.store-badge:hover {
  transform: translateY(-1px);
}

.store-badge svg {
  flex-shrink: 0;
}

/* ── Section shared ── */
.section-title {
  font-size: clamp(28px, 5vw, 36px);
  font-weight: 800;
  line-height: var(--lh-tight);
  text-align: center;
  margin-bottom: 16px;
  letter-spacing: var(--ls-tighter);
}

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: var(--fs-md);
  line-height: var(--lh-relaxed);
  margin-bottom: 8px;
}

/* ── Character Picker ── */
.characters {
  position: relative;
  overflow: hidden;
  padding: 60px 0 60px;
}

.characters .container {
  position: relative;
  z-index: 2;
}

.picker-viewport {
  position: relative;
  overflow: hidden;
  padding: 32px 0;
}

.picker-track {
  display: flex;
  align-items: center;
  gap: 16px;
  will-change: transform;
  transition: transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.picker-item {
  position: relative;
  flex-shrink: 0;
  width: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.55);
  opacity: 0.3;
  transition: transform 0.5s ease, opacity 0.5s ease;
}

.picker-item[data-offset="0"] {
  transform: scale(1.45);
  opacity: 1;
  z-index: 2;
}

.picker-item[data-offset="1"] {
  transform: scale(0.75);
  opacity: 0.55;
  z-index: 1;
}

.picker-item[data-offset="2"] {
  transform: scale(0.6);
  opacity: 0.35;
}

.picker-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.picker-item[data-offset="0"] .picker-avatar {
  box-shadow: var(--neu-medium);
}

.picker-avatar img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.picker-frame {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

/* Brackets */
.picker-brackets {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  pointer-events: none;
  z-index: 3;
}

.bracket {
  width: 8px;
  height: 55%;
  border: 1.5px solid color-mix(in srgb, var(--accent) 50%, transparent);
}

.bracket-left {
  border-right: none;
  border-radius: 4px 0 0 4px;
}

.bracket-right {
  border-left: none;
  border-radius: 0 4px 4px 0;
}

.bracket-spacer {
  width: 107px; /* 68 * 1.45 + 8 */
}

/* ── App Preview ── */
.preview {
  padding: 60px 24px;
}

/* ── Phone Gallery (track-based carousel) ── */
.phone-gallery {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 32px auto 0;
  position: relative;
  width: 100%;
}

.phone-gallery-stage {
  overflow: hidden;
  flex: 1;
  min-width: 0;
  padding: 20px 0;
}

.phone-track {
  display: flex;
  gap: 16px;
  transition: transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
  will-change: transform;
}

.phone-track.no-transition {
  transition: none !important;
}

/* Arrows */
.phone-gallery-arrow {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 18px;
  transition: background 0.2s, transform 0.2s;
  z-index: 2;
}

.phone-gallery-arrow:hover {
  background: var(--accent);
  color: #fff;
  transform: scale(1.1);
}

/* Phone frame — fixed width, scale/opacity animate on cards */
.phone-frame {
  flex-shrink: 0;
  width: 280px;
  position: relative;
  background: #1a1a1a;
  border-radius: 28px;
  padding: 5px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.25);
  opacity: 0.3;
  transform: scale(0.8);
  filter: blur(1px);
  transition: transform 0.5s ease, opacity 0.5s ease, filter 0.5s ease;
  cursor: pointer;
}

/* Floating shadow */
.phone-frame::before {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 15%;
  right: 15%;
  height: 16px;
  background: radial-gradient(ellipse, rgba(0,0,0,0.25) 0%, transparent 70%);
  border-radius: 50%;
  z-index: -1;
}

.phone-frame img {
  width: 100%;
  height: auto;
  border-radius: 24px;
  display: block;
}

/* Active center card */
.phone-frame.active {
  opacity: 1;
  transform: scale(1);
  filter: none;
}

/* Adjacent peek cards */
.phone-frame.adjacent {
  opacity: 0.6;
  transform: scale(0.88);
  filter: none;
}

/* Android notch (default) */
.phone-notch {
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 16px;
  background: #1a1a1a;
  border-radius: 0 0 10px 10px;
  z-index: 2;
}

/* iOS variant — silver frame + Dynamic Island */
.phone-frame[data-phone="ios"] {
  background: #c0c0c4;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.phone-frame[data-phone="ios"] .phone-notch {
  width: 32px;
  height: 10px;
  background: #1a1a1a;
  border-radius: 20px;
  top: 12px;
}

/* Caption */
.phone-caption {
  text-align: center;
  max-width: 480px;
  margin: 16px auto 0;
  min-height: 60px;
}

.phone-caption.fade-in {
  animation: caption-fade 0.4s ease-out;
}

@keyframes caption-fade {
  0%   { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}

.phone-caption-title {
  font-size: clamp(16px, 3vw, 20px);
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.phone-caption-desc {
  font-size: clamp(13px, 2.5vw, 15px);
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Dots */
.phone-gallery-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.phone-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: var(--border);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, transform 0.2s;
}

.phone-dot.active {
  background: var(--accent);
  transform: scale(1.4);
}

/* ── Phone Gallery Responsive ── */
@media (max-width: 768px) {
  .phone-gallery { gap: 4px; }
  .phone-gallery-arrow { width: 28px; height: 28px; font-size: 14px; }
  .phone-frame { width: clamp(160px, 45vw, 200px); border-radius: 22px; padding: 4px; }
  .phone-frame img { border-radius: 19px; }
  .phone-track { gap: 10px; }
  .phone-notch { width: 50px; height: 12px; top: 4px; }
  .phone-frame[data-phone="ios"] .phone-notch { width: 22px; height: 7px; top: 9px; }
}

/* ── Features ── */
.features {
  padding: 40px 24px;
}

/* ── Feature Carousel ── */
.feature-carousel {
  position: relative;
  overflow: hidden;
  padding: 16px 0;
  width: 100%;
  -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
  mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
}

.feature-carousel-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
  will-change: transform;
  touch-action: pan-y;
  cursor: grab;
}

.feature-carousel-track.dragging {
  cursor: grabbing;
  transition: none;
}

.feature-card {
  position: relative;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--border) 20%, transparent);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  box-shadow: var(--neu-medium);
  overflow: hidden;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.4s, border-color 0.3s;
}

/* Gradient accent top bar */
.feature-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--neu-high);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}

/* Carousel-specific overrides for feature cards */
.feature-carousel .feature-card {
  flex-shrink: 0;
  opacity: 0.35;
  transform: scale(0.85);
  filter: blur(1px);
  transition: transform 0.5s ease, opacity 0.5s ease, filter 0.5s ease, background-color 0.4s, border-color 0.3s, box-shadow 0.2s ease;
}

.feature-carousel .feature-card.active {
  opacity: 1;
  transform: scale(1);
  filter: none;
}

.feature-carousel .feature-card.adjacent {
  opacity: 0.7;
  transform: scale(0.93);
  filter: none;
}

.feature-carousel .feature-card:hover {
  box-shadow: var(--neu-medium);
  border-color: color-mix(in srgb, var(--border) 20%, transparent);
}

.feature-carousel .feature-card.active:hover {
  transform: scale(1.02);
  box-shadow: var(--neu-high);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}

/* Carousel dots */
.feature-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.carousel-dot {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: transform 0.2s;
}

.carousel-dot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: color-mix(in srgb, var(--border) 15%, transparent);
  transition: background 0.3s, border-color 0.3s, transform 0.2s;
}

.carousel-dot.active::after {
  background: var(--accent);
  border-color: var(--accent);
  transform: translate(-50%, -50%) scale(1.2);
}

.feature-icon {
  display: block;
  width: 48px;
  height: 48px;
  padding: 4px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-radius: var(--radius-sm);
  margin: 0 auto 12px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.feature-card h3 {
  font-size: var(--fs-lg);
  font-weight: 700;
  line-height: var(--lh-tight);
  margin-bottom: 6px;
}

.feature-tagline {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 12px;
}

.feature-list {
  list-style: none;
  padding: 0;
  text-align: left;
  display: inline-block;
}

.feature-list li {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: var(--lh-relaxed);
  padding-left: 16px;
  position: relative;
}

.feature-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ── Journey ── */
.journey {
  padding: 60px 24px;
}

/* ── Intro: avatar + lead text ── */
.journey-intro {
  display: flex;
  align-items: center;
  gap: 32px;
  max-width: 720px;
  margin: 0 auto 48px;
}

.journey-avatar {
  width: clamp(100px, 20vw, 140px);
  height: auto;
  aspect-ratio: 1;
  image-rendering: pixelated;
  flex-shrink: 0;
  border-radius: 0;
  border: none;
  box-shadow: none;
  object-fit: contain;
}

.journey-intro-text {
  flex: 1;
  min-width: 0;
}

.journey-intro-lead {
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 700;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 12px;
  text-wrap: pretty;
}

.journey-intro-sub {
  font-size: clamp(13px, 2vw, 15px);
  color: var(--text-secondary);
  line-height: 1.6;
  text-wrap: pretty;
  opacity: 0.75;
  font-weight: 400;
}

/* ── Narrative blocks ── */
.journey-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 720px;
  margin: 0 auto 40px;
}

.journey-block {
  display: flex;
  gap: 20px;
  background: var(--surface);
  border-radius: var(--radius-lg, 16px);
  padding: 28px 32px;
  box-shadow: var(--neu-medium, 0 4px 12px rgba(0,0,0,0.15));
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.journey-block:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.journey-block-accent {
  width: 4px;
  flex-shrink: 0;
  border-radius: 2px;
  background: linear-gradient(to bottom, var(--accent), transparent);
}

.journey-block-body {
  flex: 1;
}

.journey-block h3 {
  font-size: clamp(18px, 3vw, 22px);
  font-weight: 700;
  line-height: var(--lh-tight);
  margin-bottom: 12px;
  color: var(--accent);
}

.journey-block p {
  font-size: clamp(14px, 2.4vw, 17px);
  color: var(--text-secondary);
  line-height: 1.7;
  text-wrap: pretty;
}

.journey-block p + p {
  margin-top: 10px;
}

.journey-block .journey-closing {
  font-weight: 600;
  color: var(--text);
  margin-top: 14px;
  font-size: clamp(15px, 2.5vw, 18px);
  text-wrap: balance;
}

/* ── Launch Track ── */
.launch-track {
  --fill: 66.67%;
  position: relative;
  margin: 32px auto 0;
  max-width: 480px;
  width: 100%;
}

/* ── Connecting bar ── */
.track-bar {
  position: absolute;
  top: 20px; /* center of 40px node */
  left: calc(100% / 8); /* center of first node */
  right: calc(100% / 8); /* center of last node */
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    color-mix(in srgb, var(--border) 30%, transparent) 0 6px,
    transparent 6px 10px
  );
  border-radius: 2px;
  transform: translateY(-50%);
}

.track-bar::before,
.track-bar::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--border) 30%, transparent);
  transform: translateY(-50%);
}

.track-bar::before { left: -3px; }
.track-bar::after { right: -3px; }

.track-bar-fill {
  width: var(--fill);
  height: 100%;
  background: linear-gradient(90deg, var(--success), var(--accent));
  border-radius: 2px;
}

/* ── Steps row ── */
.track-steps {
  display: flex;
  justify-content: space-between;
  position: relative;
}

.track-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
  z-index: 1;
}

/* ── Nodes (icons inside) ── */
.track-node {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--border) 30%, transparent);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text-muted);
  transition: all 0.3s ease;
  position: relative;
}

.track-step.done .track-node {
  border-color: var(--success);
  background: var(--surface);
  color: var(--success);
}

.track-step.active .track-node {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent);
  animation: track-breathe 3s ease-in-out infinite;
}

.track-step.future .track-node {
  border: 2px dashed color-mix(in srgb, var(--border) 40%, transparent);
  background: var(--surface);
  color: var(--text-muted);
}

@keyframes track-breathe {
  0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent); }
  50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 0%, transparent); }
}

@media (prefers-reduced-motion: reduce) {
  .track-step.active .track-node {
    animation: none;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent);
  }
}

/* ── Labels below node ── */
.track-label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: center;
}

.track-step.done .track-label { color: var(--text); }
.track-step.active .track-label { color: var(--accent); font-weight: 700; }

/* ── ETA subtitle ── */
.track-eta {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--accent);
  margin-top: 2px;
}

/* ── Toolbar Nav & CTA ── */
.toolbar-brand {
  font-weight: 800;
  font-size: var(--fs-md);
  letter-spacing: 1.5px;
  color: var(--text);
  text-decoration: none;
}

.toolbar-nav {
  display: flex;
  gap: 24px;
}

.toolbar-link {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.toolbar-link:hover {
  color: var(--accent);
}

.toolbar-cta {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-inverse);
  background: var(--accent);
  border-radius: 9999px;
  text-decoration: none;
  box-shadow: var(--neu-low);
  transition: background-color 0.2s, transform 0.2s;
}

.toolbar-cta:hover {
  background: var(--accent-secondary);
  transform: translateY(-1px);
}

/* ── Section CTA ── */
.section-cta {
  text-align: center;
  margin-top: 24px;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--text-inverse);
  background: var(--accent);
  border-radius: 9999px;
  text-decoration: none;
  box-shadow: var(--neu-medium);
  transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.cta-button:hover {
  background: var(--accent-secondary);
  transform: translateY(-2px);
  box-shadow: var(--neu-high);
}

.cta-button ion-icon {
  font-size: 18px;
}

/* ── Waitlist Card ── */
.waitlist-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 32px 24px;
  box-shadow: var(--neu-medium);
  text-align: center;
  max-width: 520px;
  margin: 32px auto 0;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
}

.waitlist-title {
  font-size: var(--fs-lg);
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.waitlist-sub {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: var(--lh-relaxed);
}

.waitlist-form {
  display: flex;
  gap: 8px;
  max-width: 400px;
  margin: 0 auto;
}

.waitlist-input {
  flex: 1;
  padding: 12px 16px;
  font-size: var(--fs-sm);
  font-family: var(--font);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

.waitlist-input:focus {
  border-color: var(--accent);
}

.waitlist-input::placeholder {
  color: var(--text-muted);
}

.waitlist-btn {
  padding: 12px 24px;
  font-size: var(--fs-sm);
  font-weight: 700;
  font-family: var(--font);
  color: var(--text-inverse);
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s;
}

.waitlist-btn:hover {
  background: var(--accent-secondary);
}

.waitlist-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.waitlist-msg {
  font-size: var(--fs-sm);
  margin-top: 12px;
  min-height: 20px;
}

.waitlist-msg--ok { color: var(--success); font-weight: 600; }
.waitlist-msg--err { color: var(--danger); font-weight: 600; }

/* ── Social Proof / Testimonials ── */
.social-proof {
  margin-top: 40px;
}

.social-proof-title {
  font-size: var(--fs-lg);
  font-weight: 700;
  text-align: center;
  margin-bottom: 20px;
  color: var(--text);
}

.testimonials {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.testimonial {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--neu-low);
  border: 1px solid color-mix(in srgb, var(--border) 20%, transparent);
  margin: 0;
}

.testimonial p {
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.testimonial cite {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  font-style: normal;
  font-weight: 600;
}

/* ── Footer ── */
.footer {
  text-align: center;
  padding: 32px 24px;
  border-top: 1px solid var(--border);
}

.footer-brand {
  font-size: var(--fs-md);
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--accent);
}

.footer-copy {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-bottom: 4px;
}

.footer-disclaimer {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  opacity: 0.6;
  font-style: italic;
}

/* ── Desktop Picker Scale-Up ── */
@media (min-width: 768px) {
  .picker-item[data-offset="0"] { transform: scale(1.8); }
  .picker-item[data-offset="1"] { transform: scale(1.0); }
  .picker-item[data-offset="2"] { transform: scale(0.8); }
  .picker-item { transform: scale(0.65); }
  .bracket-spacer { width: 132px; /* 68 * 1.8 + 10 */ }

}

/* ── Responsive ── */
@media (max-width: 768px) {
  .hero {
    padding: 20px 24px 12px;
  }

  /* scene-word now lives under avatars, visible at all sizes */

  .toolbar-nav {
    display: none;
  }

  .testimonials {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .hero {
    padding: 16px 16px 8px;
  }

  .hero-cat {
    width: 32px;
    height: 32px;
    top: -18px;
  }

  .hero-title-wrap {
    gap: 12px;
  }

  .rainbow-border-box {
    padding: 8px 16px;
    gap: 10px;
  }

  .hero-title {
    font-size: clamp(48px, 14vw, 64px);
  }

  .hero-cat {
    width: 44px;
    height: 44px;
    top: -30px;
  }

  .hero-cat--left {
    left: -8px;
  }

  .hero-cat--right {
    right: -8px;
  }

  .features,
  .journey {
    padding: 32px 16px;
  }

  .preview {
    padding: 32px 16px;
  }

  .journey-intro {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }

  .journey-avatar {
    width: 100px;
    height: auto;
  }

  .journey-block {
    padding: 20px 20px;
  }

  .store-badges {
    flex-direction: column;
    align-items: center;
  }

  .rainbow-border-box {
    padding: 8px 12px;
    gap: 8px;
  }

  .waitlist-form {
    flex-direction: column;
  }

  .toolbar {
    padding: 8px 12px;
  }

  .toolbar-brand {
    font-size: var(--fs-sm);
    letter-spacing: 1px;
  }

  .toolbar-actions {
    gap: 4px;
  }

  .toolbar-btn {
    width: 36px;
    height: 36px;
    font-size: var(--fs-xs);
  }

  .toolbar-cta {
    display: none;
  }

  .launch-track {
    margin-top: 24px;
  }

  .track-node {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .track-bar {
    top: 18px; /* center of 36px node */
  }

  .track-label {
    font-size: var(--fs-xs);
  }

  .carousel-dot {
    width: 32px;
    height: 32px;
  }

  .carousel-dot::after {
    width: 10px;
    height: 10px;
  }

  .feature-carousel-dots {
    gap: 2px;
  }

  .hero-cat {
    width: 36px;
    height: 36px;
    top: 30px;
  }

  .characters {
    padding: 12px 0 24px;
  }
}

/* ── Accessibility ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* Focus styles */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Floating CTA (mobile only) ── */
.floating-cta {
  display: none;
}

@media (max-width: 600px) {
  .floating-cta {
    display: flex;
    align-items: center;
    gap: 6px;
    position: fixed;
    bottom: 20px;
    right: 16px;
    z-index: 90;
    padding: 12px 20px;
    font-family: var(--font);
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--text-inverse);
    background: var(--accent);
    border: none;
    border-radius: 9999px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    cursor: pointer;
    transition: opacity 0.3s, transform 0.3s, background-color 0.2s;
  }

  .floating-cta:hover {
    background: var(--accent-secondary);
  }

  .floating-cta.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
  }
}

/* ── Legal Pages ── */
.legal-page {
  padding: 48px 0 64px;
  max-width: 720px;
  margin: 0 auto;
}

.legal-title {
  font-size: var(--fs-xxl);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

.legal-updated {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-bottom: 32px;
}

.legal-section {
  margin-bottom: 28px;
}

.legal-section h2 {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.legal-section h3 {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 12px;
  margin-bottom: 4px;
}

.legal-section p {
  font-size: var(--fs-md);
  color: var(--text-secondary);
  line-height: var(--lh-relaxed);
  margin-bottom: 8px;
}

.legal-section ul {
  padding-left: 20px;
  margin-bottom: 8px;
}

.legal-section li {
  font-size: var(--fs-md);
  color: var(--text-secondary);
  line-height: var(--lh-relaxed);
  margin-bottom: 4px;
}

.legal-section a {
  color: var(--accent);
  text-decoration: underline;
}

/* ── Performance ── */
.journey, .footer {
  content-visibility: auto;
  contain-intrinsic-size: auto 600px;
}

/* ── Quest Carousel ── */
.quest-carousel {
  margin: 32px auto 0;
  max-width: 480px;
}

.quest-carousel-track {
  display: flex;
  overflow: hidden;
  border-radius: var(--radius-md);
}

.quest-card {
  background: var(--surface);
  border: 2px solid color-mix(in srgb, var(--border) 50%, transparent);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--neu-medium);
  flex-shrink: 0;
  width: 100%;
  transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.quest-card[data-rarity="common"]    { border-top: 3px solid var(--rarity-common); }
.quest-card[data-rarity="uncommon"]  { border-top: 3px solid var(--rarity-uncommon); }
.quest-card[data-rarity="rare"]      { border-top: 3px solid var(--rarity-rare); }
.quest-card[data-rarity="epic"]      { border-top: 3px solid var(--rarity-epic); }
.quest-card[data-rarity="legendary"] { border-top: 3px solid var(--rarity-legendary); }

.quest-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.quest-badge {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--border) 20%, transparent);
  color: var(--text-muted);
}
.quest-card[data-rarity="common"]    .quest-badge { color: var(--rarity-common); background: color-mix(in srgb, var(--rarity-common) 15%, transparent); }
.quest-card[data-rarity="uncommon"]  .quest-badge { color: var(--rarity-uncommon); background: color-mix(in srgb, var(--rarity-uncommon) 15%, transparent); }
.quest-card[data-rarity="rare"]      .quest-badge { color: var(--rarity-rare); background: color-mix(in srgb, var(--rarity-rare) 15%, transparent); }
.quest-card[data-rarity="epic"]      .quest-badge { color: var(--rarity-epic); background: color-mix(in srgb, var(--rarity-epic) 15%, transparent); }
.quest-card[data-rarity="legendary"] .quest-badge { color: var(--rarity-legendary); background: color-mix(in srgb, var(--rarity-legendary) 15%, transparent); }

.quest-xp {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--color-xp);
  display: flex;
  align-items: center;
  gap: 4px;
}

.quest-card-body {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quest-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--accent);
  flex-shrink: 0;
}

.quest-card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.quest-card-info strong {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.quest-card-info span {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.quest-action-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}
.quest-action-btn:hover { background: var(--accent); color: #fff; }

.quest-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--border) 35%, transparent);
}

.quest-pill {
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--border) 22%, transparent);
  color: var(--text-muted);
}

.quest-target,
.quest-checklist,
.quest-ember-cost {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 3px;
}
.quest-ember-cost { color: var(--color-ember); font-weight: 700; }

.quest-carousel-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  border: none;
  background: color-mix(in srgb, var(--border) 60%, transparent);
  cursor: pointer;
  padding: 0;
  transition: background 0.25s, width 0.25s;
}
.carousel-dot.active {
  background: var(--accent);
  width: 22px;
}

/* ── Preview Divider & Sub-heading ── */
.preview-divider {
  height: 1px;
  background: color-mix(in srgb, var(--border) 30%, transparent);
  margin: 36px 0;
}

.preview-sub-heading {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  text-align: center;
}

/* ── Progression Card ── */
.progression-card {
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--neu-low);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.xp-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.xp-strip-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.xp-level {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.xp-title {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.xp-track {
  flex: 1;
  min-width: 80px;
  height: 8px;
  background: color-mix(in srgb, var(--border) 28%, transparent);
  border-radius: 99px;
  overflow: hidden;
}

.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--color-xp));
  border-radius: 99px;
}

.xp-label {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  white-space: nowrap;
}

.tier-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.tier-strip::-webkit-scrollbar { display: none; }

.tier-pill {
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
  padding: 4px 11px;
  border-radius: 99px;
  border: 1.5px solid color-mix(in srgb, var(--tier-color, var(--border)) 55%, transparent);
  color: color-mix(in srgb, var(--tier-color, var(--text-muted)) 80%, var(--text-muted));
  background: color-mix(in srgb, var(--tier-color, var(--border)) 10%, transparent);
  opacity: 0.5;
  flex-shrink: 0;
}

.tier-pill.active {
  opacity: 1;
  border-color: var(--tier-color, var(--accent));
  color: var(--tier-color, var(--accent));
  background: color-mix(in srgb, var(--tier-color, var(--accent)) 16%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tier-color, var(--accent)) 20%, transparent);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 12px 8px;
  background: color-mix(in srgb, var(--border) 12%, transparent);
  border-radius: var(--radius-sm);
  text-align: center;
}

.stat-value {
  font-size: var(--fs-xl);
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  line-height: 1.3;
}

/* ── Heatmap ── */
.heatmap-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.heatmap-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.heatmap-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}
.heatmap-done   { background: var(--success); }
.heatmap-missed { background: var(--danger); opacity: 0.6; }
.heatmap-off    { background: color-mix(in srgb, var(--border) 40%, transparent); }

.heatmap-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.heatmap-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* ── Raid Card ── */
.raid-card {
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--neu-low);
}
.raid-card[data-raid-type="streak"] { border-top: 3px solid var(--raid-streak); }

.raid-card-header {
  padding: 10px 16px;
  background: color-mix(in srgb, var(--raid-streak) 10%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 30%, transparent);
}

.raid-header-text {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.raid-type-label,
.raid-ember-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-sm);
  font-weight: 700;
}
.raid-type-label  { color: var(--raid-streak); }
.raid-ember-label { color: var(--color-ember); }

.raid-card-body {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.raid-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--raid-streak) 15%, transparent);
  color: var(--raid-streak);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.raid-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.raid-info strong { font-size: var(--fs-md); font-weight: 700; color: var(--text); display: block; }
.raid-info > span { font-size: var(--fs-xs); color: var(--text-muted); }

.raid-reward-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-xs);
  color: var(--color-ember);
  font-weight: 600;
}

.raid-checkin-btn {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--raid-streak);
  background: transparent;
  color: var(--raid-streak);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}
.raid-checkin-btn:hover { background: var(--raid-streak); color: #fff; }

.raid-checkin-inset {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--raid-streak) 40%, transparent);
  pointer-events: none;
}

.raid-card-footer {
  padding: 10px 16px;
  border-top: 1px solid color-mix(in srgb, var(--border) 30%, transparent);
}

.raid-avatars {
  display: flex;
  align-items: center;
}

.raid-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  object-fit: cover;
  margin-left: -6px;
}
.raid-avatars .raid-avatar:first-child { margin-left: 0; }

.raid-avatar-more {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text-muted);
  margin-left: 8px;
}

/* ── Journal Card ── */
.journal-card {
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--neu-low);
}

.journal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: color-mix(in srgb, var(--mood-color, var(--accent)) 12%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 30%, transparent);
}

.journal-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.journal-header-actions { display: flex; gap: 4px; }

.journal-action-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--border) 22%, transparent);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
}

.journal-status-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: color-mix(in srgb, var(--border) 30%, transparent);
}

.journal-stat-block {
  background: var(--surface);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.journal-stat-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.journal-stat-badge {
  margin-left: auto;
  font-size: var(--fs-xs);
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--badge-color, var(--accent)) 15%, transparent);
  color: var(--badge-color, var(--accent));
  display: flex;
  align-items: center;
  gap: 3px;
}

.journal-stat-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.journal-stat-icon-box {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1.5px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.journal-stat-title { font-size: var(--fs-sm); font-weight: 700; color: var(--text); display: block; }
.journal-stat-effect { font-size: var(--fs-xs); color: var(--text-muted); display: flex; align-items: center; gap: 3px; }

.journal-section {
  padding: 12px 14px;
  border-top: 1px solid color-mix(in srgb, var(--border) 30%, transparent);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.journal-section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.journal-count-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--success) 16%, transparent);
  color: var(--success);
  margin-left: auto;
}
.journal-count-badge--debuff {
  background: color-mix(in srgb, var(--danger) 16%, transparent);
  color: var(--danger);
}

.journal-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.journal-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--tag-color, var(--accent)) 14%, transparent);
  color: var(--tag-color, var(--accent));
  border: 1px solid color-mix(in srgb, var(--tag-color, var(--accent)) 35%, transparent);
}

.journal-note-block {
  padding: 12px 14px;
  border-top: 1px solid color-mix(in srgb, var(--border) 30%, transparent);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.journal-note-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.journal-note-text {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: 1.55;
  border-left: 3px solid color-mix(in srgb, var(--mood-color, var(--accent)) 50%, transparent);
  padding-left: 10px;
  font-style: normal;
}

.journal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-top: 1px solid color-mix(in srgb, var(--border) 30%, transparent);
  background: color-mix(in srgb, var(--border) 8%, transparent);
}

.journal-footer-left {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}
.journal-footer-label { font-weight: 700; letter-spacing: 0.06em; }

.journal-footer-xp {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--color-xp);
}

/* ── Responsive: Preview additions ── */
@media (max-width: 600px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .journal-status-row { grid-template-columns: 1fr; }
  .quest-carousel { max-width: 100%; }
}

