/* ============================================================================
   Grafly — Landing page
   Styled to strictly follow the Grafly app design system:
   - Exact semantic color tokens (constants/colors.ts), dark + light
   - Radius scale 12 / 20 / 32 / 100 (colors.radius)
   - Teshrin typography (the app aliases Nunito → Teshrin at load time)
   - Signature "chunky" 3D depth (GraflyButton / home depth-tiles)
   - Wave-pattern ambient wash (HomeBackdrop)
   ========================================================================== */

@font-face {
  font-family: "Teshrin";
  src: url("assets/fonts/Teshrin_Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Teshrin";
  src: url("assets/fonts/Teshrin_Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Teshrin";
  src: url("assets/fonts/Teshrin_Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Teshrin";
  src: url("assets/fonts/Teshrin_Black.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* ── Design tokens ──────────────────────────────────────────────────────────
   Mirrors constants/colors.ts. Brand hexes never appear in markup — only here. */
:root {
  /* Brand */
  --cyan: #00a4fa;
  --cyan-deep: #0078bb;
  --lime: #e3ed43;
  --pink: #ff7bd0;
  --pink-deep: #bc4090;
  --navy: #21263f;
  --navy-deep: #181c30;
  --off-white: #f5f6fa;

  /* Semantic — light (default) */
  --background: #f5f6fa;
  --foreground: #21263f;
  --card: #ffffff;
  --card-foreground: #21263f;
  --primary: #00a4fa;
  --primary-foreground: #ffffff;
  --primary-deep: #0078bb;
  --accent: #e3ed43;
  --accent-foreground: #21263f;
  --secondary: #e8ebf5;
  --muted: #eceef5;
  --muted-foreground: #646a88;
  --border: #dde1ee;
  --input: #ffffff;
  --success: #12b870;
  --warning: #a36e00;
  --destructive: #dc2a3a;

  /* Radius scale (colors.radius) */
  --r-sm: 12px;
  --r-md: 20px;
  --r-lg: 32px;
  --r-full: 100px;

  /* 3D depth offsets (GraflyButton DEPTH = 5, home tiles = 7) */
  --depth-btn: 5px;
  --depth-tile: 7px;

  /* Elevation */
  --shadow: 0 4px 24px rgba(33, 38, 63, 0.08);
  --shadow-hover: 0 18px 48px rgba(33, 38, 63, 0.16);
  --shadow-pop: 0 24px 60px rgba(33, 38, 63, 0.2);

  /* Legacy aliases kept for the legal pages (terms / privacy) */
  --bg: var(--background);
  --fg: var(--foreground);

  --font: "Teshrin", "Inter", system-ui, -apple-system, sans-serif;
}

html.dark {
  --background: #21263f;
  --foreground: #dee0ed;
  --card: #2d3355;
  --card-foreground: #dee0ed;
  --secondary: #353b5a;
  --muted: #353b5a;
  --muted-foreground: #969cbc;
  --border: #3a4068;
  --input: #2d3355;
  --success: #22dd88;
  --warning: #ffb800;

  --shadow: 0 4px 24px rgba(0, 0, 0, 0.32);
  --shadow-hover: 0 18px 48px rgba(0, 0, 0, 0.46);
  --shadow-pop: 0 24px 60px rgba(0, 0, 0, 0.5);
}

/* ── Reset / base ───────────────────────────────────────────────────────────*/
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font);
  font-weight: 500;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 240ms ease, color 240ms ease;
}

body.no-scroll {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.shell {
  width: min(100% - 40px, 1200px);
  margin-inline: auto;
}

/* Phosphor-ish line icons (inline SVG hydrated by script.js) */
.ico {
  width: 1em;
  height: 1em;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-store-icon {
  width: 20px;
  height: 20px;
  display: block;
  flex: 0 0 auto;
  fill: currentColor;
}

/* ── Ambient wave-pattern wash (HomeBackdrop) ───────────────────────────────*/
.pattern {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("assets/pattern/wave_pattern.png");
  background-repeat: repeat;
  background-size: 340px auto;
  opacity: 0.05;
}

/* On colored fills the pattern reads as a soft tonal texture */
.pattern--on-color {
  opacity: 0.14;
  mix-blend-mode: soft-light;
  background-size: 300px auto;
}

/* Page-level ambient field behind the hero */
.ambient {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.ambient::before,
.ambient::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(10px);
}

.ambient::before {
  top: -160px;
  inset-inline-end: -120px;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, color-mix(in srgb, var(--primary) 26%, transparent), transparent 68%);
}

.ambient::after {
  top: 38%;
  inset-inline-start: -160px;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 24%, transparent), transparent 68%);
}

/* ── 3D depth button (GraflyButton) ─────────────────────────────────────────
   A shadow layer sits DEPTH px below the face; the face presses down to meet
   it on :active — the app's signature chunky press. */
.btn {
  position: relative;
  display: inline-flex;
  margin-bottom: var(--depth-btn);
  border: 0;
  background: transparent;
  border-radius: var(--r-full);
  cursor: pointer;
  --btn-face: var(--primary);
  --btn-shadow: var(--cyan-deep);
  --btn-text: #ffffff;
}

.btn::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: var(--depth-btn);
  bottom: calc(var(--depth-btn) * -1);
  border-radius: var(--r-full);
  background: var(--btn-shadow);
  z-index: 0;
}

.btn__face {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px 28px;
  border-radius: var(--r-full);
  background: var(--btn-face);
  color: var(--btn-text);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.1px;
  white-space: nowrap;
  transition: transform 90ms cubic-bezier(0.33, 0, 0.2, 1);
}

.btn:active .btn__face,
.btn:focus-visible .btn__face {
  transform: translateY(var(--depth-btn));
}

.btn:focus-visible {
  outline: none;
}

.btn:focus-visible .btn__face {
  box-shadow: 0 0 0 3px var(--background), 0 0 0 6px color-mix(in srgb, var(--primary) 55%, transparent);
}

.btn--accent {
  --btn-face: var(--accent);
  --btn-shadow: #b6bf1f;
  --btn-text: var(--accent-foreground);
}

.btn--navy {
  --btn-face: var(--navy);
  --btn-shadow: var(--navy-deep);
  --btn-text: #ffffff;
}

.btn--light {
  --btn-face: #ffffff;
  --btn-shadow: #c9cee0;
  --btn-text: var(--navy);
}

.btn--sm .btn__face {
  padding: 10px 18px;
  font-size: 14px;
}

.btn .brand-store-icon {
  margin-top: -1px;
}

/* Store badge button (App Store / Google Play) */
.store-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

/* ── Header / navigation ────────────────────────────────────────────────────*/
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 60;
  transition: background 220ms ease, box-shadow 220ms ease, backdrop-filter 220ms ease;
}

.site-header.scrolled {
  background: color-mix(in srgb, var(--background) 80%, transparent);
  box-shadow: 0 1px 0 var(--border), 0 8px 30px rgba(33, 38, 63, 0.06);
  backdrop-filter: blur(22px) saturate(150%);
}

.nav {
  position: relative;
  z-index: 2;
  width: min(100% - 40px, 1200px);
  height: 74px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  transition: height 220ms ease;
}

.site-header.scrolled .nav {
  height: 62px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.brand-mark-wrap {
  position: relative;
  flex: 0 0 auto;
}

.brand-mark {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: var(--r-sm);
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.brand:hover .brand-mark {
  transform: rotate(-8deg) scale(1.08);
}

.brand-dot {
  position: absolute;
  top: -2px;
  inset-inline-end: -2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--background);
}

.brand-wordmark {
  width: 104px;
  height: auto;
}

html.dark .brand-wordmark {
  filter: brightness(0) invert(1);
}

.brand-fallback {
  display: none;
  color: var(--primary);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.4px;
}

.nav-links {
  margin: 0;
  padding: 5px;
  list-style: none;
  display: flex;
  gap: 2px;
  border-radius: var(--r-full);
  background: color-mix(in srgb, var(--foreground) 5%, transparent);
  border: 1px solid var(--border);
}

.nav-links a {
  display: block;
  padding: 8px 16px;
  border-radius: var(--r-full);
  font-size: 14px;
  font-weight: 700;
  color: var(--muted-foreground);
  transition: background 160ms ease, color 160ms ease;
}

.nav-links a:hover {
  color: var(--foreground);
}

.nav-links a.active {
  color: var(--primary-foreground);
  background: var(--primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-toggle,
.icon-button {
  height: 40px;
  border: 0;
  border-radius: var(--r-full);
  background: transparent;
  color: var(--foreground);
  cursor: pointer;
  transition: background 160ms ease;
}

.lang-toggle {
  padding: 0 13px;
  border: 2px solid var(--primary);
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.lang-toggle .muted {
  margin-inline: 4px;
  opacity: 0.35;
}

.lang-toggle span.dim {
  opacity: 0.32;
}

.icon-button {
  width: 40px;
  display: inline-grid;
  place-items: center;
  font-size: 20px;
}

.icon-button:hover,
.lang-toggle:hover {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}

.mobile-toggle {
  display: none;
}

.mobile-menu {
  width: min(100% - 24px, 520px);
  margin: 0 auto 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow-hover);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px) scale(0.98);
  transform-origin: top center;
  transition: opacity 180ms ease, transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.mobile-menu[hidden] {
  display: none;
}

.mobile-menu.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.mobile-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: var(--r-md);
  font-weight: 700;
  opacity: 0;
  transform: translateY(-6px);
  transition: background 160ms ease, color 160ms ease, opacity 180ms ease,
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.mobile-menu.is-open a {
  opacity: 1;
  transform: translateY(0);
}

.mobile-menu.is-open a:nth-child(1) { transition-delay: 45ms; }
.mobile-menu.is-open a:nth-child(2) { transition-delay: 75ms; }
.mobile-menu.is-open a:nth-child(3) { transition-delay: 105ms; }
.mobile-menu.is-open a:nth-child(4) { transition-delay: 135ms; }

.mobile-menu a:hover {
  background: var(--primary);
  color: var(--primary-foreground);
}

/* ── Pills / badges ─────────────────────────────────────────────────────────*/
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.1px;
  background: color-mix(in srgb, var(--primary) 13%, transparent);
  color: var(--primary);
}

.pill .ico { stroke-width: 2.6; }

.pill--accent {
  background: color-mix(in srgb, var(--accent) 28%, transparent);
  color: var(--accent-foreground);
}

.pill--on-color {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  backdrop-filter: blur(8px);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--primary-deep);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

html.dark .eyebrow {
  color: var(--primary);
}

/* ── Hero ───────────────────────────────────────────────────────────────────*/
.hero {
  position: relative;
  padding: 132px 0 72px;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 48px;
}

.hero-copy h1 {
  margin: 0 0 20px;
  font-size: clamp(40px, 5.4vw, 66px);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: -1.4px;
  white-space: pre-line;
}

[dir="rtl"] .hero-copy h1 {
  line-height: 1.14;
  letter-spacing: -0.4px;
}

.hero-copy h1 .grad {
  color: var(--primary);
}

.hero-copy p.lead {
  max-width: 460px;
  margin: 0 0 30px;
  font-size: clamp(17px, 1.4vw, 19px);
  line-height: 1.5;
  color: var(--muted-foreground);
}

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 26px;
}

.hero-trust span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted-foreground);
}

.hero-trust .ico {
  color: var(--success);
  stroke-width: 3;
}

/* Hero phone stage */
.hero-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 540px;
}

.hero-stage .glow-disc {
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 28%, rgba(255, 255, 255, 0.9), transparent 26%),
    linear-gradient(150deg, var(--primary) 0%, var(--cyan-deep) 100%);
  box-shadow: var(--shadow-pop), 0 0 0 18px color-mix(in srgb, var(--primary) 12%, transparent);
}

/* Realistic phone mockup */
.phone {
  position: relative;
  width: 268px;
  height: 558px;
  border-radius: 46px;
  padding: 9px;
  background: linear-gradient(160deg, #2b3052, #14182b);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.32), inset 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.phone__screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 38px;
  background: var(--background);
}

.phone__screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.phone__island {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  width: 92px;
  height: 26px;
  border-radius: var(--r-full);
  background: #05070f;
}

.hero-phone {
  position: relative;
  z-index: 2;
  transform: rotate(-3deg);
  transition: transform 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-stage:hover .hero-phone {
  transform: rotate(-1deg) translateY(-6px);
}

[dir="rtl"] .hero-phone {
  transform: rotate(3deg);
}

[dir="rtl"] .hero-stage:hover .hero-phone {
  transform: rotate(1deg) translateY(-6px);
}

/* Floating app-style chips around the phone */
.float-chip {
  position: absolute;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 15px;
  border-radius: var(--r-full);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-hover);
  font-size: 14px;
  font-weight: 800;
  color: var(--foreground);
  animation: float-y 4.6s ease-in-out infinite;
}

.float-chip img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.float-chip--streak {
  top: 60px;
  inset-inline-start: -6px;
}

.float-chip--xp {
  bottom: 96px;
  inset-inline-end: -10px;
  animation-delay: 1.1s;
}

.float-chip--xp .dot {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-foreground);
}

.hero-mascot {
  position: absolute;
  z-index: 5;
  bottom: -6px;
  inset-inline-end: 4px;
  width: 116px;
  height: auto;
  filter: drop-shadow(0 16px 26px rgba(33, 38, 63, 0.28));
  animation: float-y 3.6s ease-in-out infinite;
}

@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}

/* ── Generic section ────────────────────────────────────────────────────────*/
.section {
  position: relative;
  padding: 92px 0;
}

.section-heading {
  max-width: 680px;
  margin: 0 auto 52px;
  text-align: center;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(32px, 4.4vw, 52px);
  line-height: 1.04;
  font-weight: 900;
  letter-spacing: -1px;
}

.section-heading p {
  margin: 16px auto 0;
  max-width: 540px;
  font-size: 17px;
  line-height: 1.5;
  color: var(--muted-foreground);
}

/* ── Stat depth-tiles (home daily-goal / rank language) ─────────────────────*/
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* The 3D tile: shadow layer + raised face (radius 26 like home) */
.tile {
  position: relative;
  margin-bottom: var(--depth-tile);
  --tile-shadow: var(--cyan-deep);
}

.tile::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: var(--depth-tile);
  bottom: calc(var(--depth-tile) * -1);
  border-radius: 26px;
  background: var(--tile-shadow);
  z-index: 0;
}

.tile__face {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border-radius: 26px;
  padding: 24px;
}

.stat-tile .tile__face {
  min-height: 158px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
}

.stat-tile .stat-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  font-size: 22px;
}

.stat-tile .stat-num {
  font-size: 50px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -2px;
}

.stat-tile .stat-label {
  font-size: 14px;
  font-weight: 800;
  opacity: 0.92;
}

.tile--cyan { --tile-shadow: var(--cyan-deep); }
.tile--cyan .tile__face { background: var(--primary); }
.tile--cyan .stat-icon { background: var(--accent); color: var(--accent-foreground); }

.tile--pink { --tile-shadow: var(--pink-deep); }
.tile--pink .tile__face { background: var(--pink); }
.tile--pink .stat-icon { background: rgba(255, 255, 255, 0.28); color: #fff; }

.tile--navy { --tile-shadow: var(--navy-deep); }
.tile--navy .tile__face { background: var(--navy); }
.tile--navy .stat-icon { background: var(--primary); color: #fff; }

/* ── Feature cards (Why Grafly) ─────────────────────────────────────────────*/
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.feature-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 220px;
  padding: 28px;
  border-radius: var(--r-lg);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 200ms ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.feature-card.span-2 {
  grid-column: span 2;
}

.feature-card .chip {
  position: relative;
  z-index: 1;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--accent) 92%, transparent);
  color: var(--accent-foreground);
  font-size: 26px;
}

.feature-card .chip .ico { stroke-width: 2.3; }

.feature-card h3 {
  position: relative;
  z-index: 1;
  margin: 0 0 6px;
  font-size: 21px;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: -0.4px;
}

.feature-card p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--muted-foreground);
  line-height: 1.55;
}

.feature-card .pattern { opacity: 0.04; }

/* ── Gallery (Inside the app) ───────────────────────────────────────────────*/
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 320px;
  gap: 18px;
}

.gallery-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 320px;
  padding: 28px;
  border-radius: var(--r-lg);
  color: var(--g-fg);
  background: var(--g-bg);
  box-shadow: var(--shadow);
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 220ms ease;
}

.gallery-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.gallery-card.featured {
  grid-column: span 6;
  grid-row: span 2;
}

.gallery-card.tall {
  grid-column: span 3;
}

.gallery-card.wide {
  grid-column: span 6;
  min-height: 0;
}

.gallery-label {
  position: absolute;
  z-index: 3;
  top: 28px;
  inset-inline-start: 28px;
  inset-inline-end: 28px;
}

.gallery-label span {
  display: inline-flex;
  align-items: center;
  margin-bottom: 10px;
  padding: 6px 12px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  color: var(--g-fg);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.gallery-label strong {
  display: block;
  font-size: clamp(24px, 2.6vw, 36px);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: -0.6px;
  text-wrap: balance;
}

.gallery-card .pattern--on-color { z-index: 0; }

.gallery-phone {
  position: relative;
  z-index: 1;
  padding: 6px;
  border-radius: 34px;
  background: linear-gradient(160deg, #2b3052, #14182b);
  box-shadow: 0 22px 40px rgba(0, 0, 0, 0.28), inset 0 0 0 1.5px rgba(255, 255, 255, 0.08);
}

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

.gallery-card.featured .gallery-phone {
  width: 252px;
  margin-bottom: -52px;
  transform: perspective(1000px) rotateY(-5deg) rotateX(3deg);
}

.gallery-card.tall .gallery-phone {
  width: 152px;
  margin-bottom: -134px;
  transform: perspective(900px) rotateZ(var(--tilt, 0deg));
}

.gallery-card.tall .gallery-label strong {
  font-size: clamp(20px, 2.1vw, 27px);
}

.gallery-card.wide {
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
}

.gallery-card.wide .gallery-label {
  position: relative;
  inset: auto;
  flex: 1;
}

.gallery-card.wide .gallery-phone {
  width: 150px;
  margin-bottom: -78px;
  transform: rotate(6deg);
  flex: 0 0 auto;
}

[dir="rtl"] .gallery-card.wide .gallery-phone {
  transform: rotate(-6deg);
}

/* ── Mini-games (Try it) ────────────────────────────────────────────────────*/
.games-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.game-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 260px;
  padding: 28px;
  border-radius: var(--r-lg);
  color: var(--gc-fg);
  background: var(--gc-bg);
  box-shadow: var(--shadow);
}

.game-card h3 {
  position: relative;
  z-index: 1;
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.4px;
}

.game-card > div > p {
  position: relative;
  z-index: 1;
  margin: 0;
  line-height: 1.5;
  opacity: 0.82;
}

.game-demo {
  position: relative;
  z-index: 1;
  margin-top: auto;
}

.instruction {
  margin-bottom: 12px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.74;
}

/* Color Match */
.color-match-demo {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(33, 38, 63, 0.08);
  backdrop-filter: blur(8px);
}

.color-target {
  width: 76px;
  height: 76px;
  padding: 8px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(188, 64, 144, 0.2);
}

.color-target span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 15px;
  background: var(--target-color);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5);
}

.color-options .instruction { color: rgba(33, 38, 63, 0.62); }

.swatches,
.palette-wells {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.swatch,
.palette-well {
  width: 44px;
  height: 44px;
  border: 2px solid rgba(33, 38, 63, 0.16);
  border-radius: 13px;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.swatch:hover { transform: scale(1.06); }

.swatch.selected {
  transform: scale(1.12);
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px currentColor, 0 12px 22px rgba(33, 38, 63, 0.18);
}

.color-result {
  min-height: 20px;
  margin: 12px 0 0;
  font-size: 13px;
  font-weight: 900;
}

.palette-well {
  width: 52px;
  height: 52px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 16px;
}

/* Contrast tuner */
.contrast-text {
  margin-bottom: 12px;
  font-size: 17px;
  font-weight: 800;
}

.range {
  width: 100%;
  accent-color: var(--accent);
}

/* Drag match */
.match-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.match-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.match-option {
  min-height: 38px;
  padding: 9px 12px;
  border: 2px solid transparent;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.18);
  color: inherit;
  font-size: 13px;
  font-weight: 800;
  text-align: start;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}

.match-option.selected {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.4);
}

.match-option.matched {
  background: rgba(34, 221, 136, 0.34);
  cursor: default;
}

/* ── Courses (depth cards, app CourseCard language) ─────────────────────────*/
.courses-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.course-card .tile__face {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  padding: 24px;
  color: var(--cc-fg);
}

.course-card .pattern--on-color { z-index: 0; }

.course-num {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.24);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
}

.course-num img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.course-card h3 {
  position: relative;
  z-index: 1;
  margin: 20px 0 10px;
  font-size: 27px;
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: -0.6px;
}

.course-card p {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  opacity: 0.86;
}

.course-progress {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding-top: 18px;
}

.course-progress .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
}

.course-progress .bar {
  height: 8px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.28);
  overflow: hidden;
}

.course-progress .bar span {
  display: block;
  height: 100%;
  border-radius: var(--r-full);
}

/* ── Testimonial ────────────────────────────────────────────────────────────*/
.testimonial {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 44px;
  min-height: 300px;
  padding: 52px;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--pink-deep) 0%, var(--pink) 100%);
  color: #fff;
  box-shadow: var(--shadow);
}

.testimonial blockquote {
  position: relative;
  z-index: 1;
  flex: 1;
  margin: 0;
}

.testimonial p {
  margin: 0 0 22px;
  font-size: clamp(24px, 3vw, 40px);
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: -0.6px;
}

.testimonial footer {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  opacity: 0.95;
}

.testimonial footer::before {
  content: "";
  width: 30px;
  height: 2px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.66);
}

.testimonial-mascot {
  position: relative;
  z-index: 1;
  width: 188px;
  height: auto;
  flex: 0 0 auto;
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.26));
  animation: float-y 3.8s ease-in-out infinite;
}

/* ── FAQ ────────────────────────────────────────────────────────────────────*/
.faq-layout {
  display: grid;
  grid-template-columns: 1fr 1.7fr;
  align-items: start;
  gap: 18px;
}

.faq-mascot-card {
  position: relative;
  overflow: hidden;
  display: grid;
  justify-items: center;
  align-content: center;
  text-align: center;
  min-height: 360px;
  padding: 36px 28px;
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, var(--primary) 0%, var(--cyan-deep) 100%);
  color: #fff;
  box-shadow: var(--shadow);
}

.faq-mascot-card img {
  position: relative;
  z-index: 1;
  width: 168px;
  height: auto;
  margin-bottom: 16px;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.25));
  animation: float-y 4s ease-in-out infinite;
}

.faq-mascot-card h3 {
  position: relative;
  z-index: 1;
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.4px;
}

.faq-mascot-card p {
  position: relative;
  z-index: 1;
  margin: 0;
  opacity: 0.9;
}

.faq-card {
  padding: 12px 32px;
  border-radius: var(--r-lg);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
  border-bottom: 0;
}

.faq-question {
  width: 100%;
  min-height: 68px;
  padding: 20px 0;
  border: 0;
  background: transparent;
  color: var(--foreground);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  text-align: start;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.2px;
  cursor: pointer;
}

.faq-question:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 48%, transparent);
  outline-offset: 4px;
  border-radius: var(--r-sm);
}

.faq-icon {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 16px;
  transition: transform 260ms ease, background 260ms ease;
}

.faq-item.open .faq-icon {
  background: var(--accent);
  color: var(--accent-foreground);
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-4px);
  transition: max-height 380ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease,
    transform 320ms ease;
}

.faq-answer-inner {
  margin: 0;
  padding: 0 0 22px;
  color: var(--muted-foreground);
  line-height: 1.65;
}

.faq-item.open .faq-answer {
  opacity: 1;
  transform: translateY(0);
}

/* ── Footer ─────────────────────────────────────────────────────────────────*/
.footer {
  padding: 40px 0 36px;
}

.footer-cta {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  min-height: 280px;
  margin-bottom: 20px;
  padding: 52px;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--navy) 0%, #2d3355 100%);
  color: #fff;
  box-shadow: var(--shadow);
}

.footer-cta .eyebrow {
  color: var(--accent);
}

.footer-cta h2 {
  margin: 0 0 24px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: -0.8px;
}

.footer-cta .pattern--on-color { opacity: 0.1; }

.footer-mascot {
  position: relative;
  z-index: 1;
  width: 220px;
  height: auto;
  flex: 0 0 auto;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.4));
  animation: float-y 3.6s ease-in-out infinite;
}

.footer-links {
  display: grid;
  grid-template-columns: 1.5fr 2.5fr;
  gap: 40px;
  padding: 40px;
  border-radius: var(--r-lg);
  background: var(--card);
  border: 1px solid var(--border);
}

.footer-brand img {
  width: 124px;
  height: auto;
  margin-bottom: 16px;
}

html.dark .footer-brand img {
  filter: brightness(0) invert(1);
}

.footer-brand p {
  max-width: 300px;
  margin: 0 0 18px;
  line-height: 1.6;
  color: var(--muted-foreground);
}

.socials {
  display: flex;
  gap: 8px;
}

.socials a {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--foreground) 7%, transparent);
  font-size: 17px;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.socials a:hover {
  color: #fff;
  background: var(--primary);
  transform: translateY(-2px);
}

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

.footer-column h3 {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.footer-column ul {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 11px;
  list-style: none;
}

.footer-column a {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted-foreground);
  transition: color 140ms ease;
}

.footer-column a:hover {
  color: var(--foreground);
}

.footer-bottom {
  grid-column: 1 / -1;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted-foreground);
}

.footer-bottom p {
  margin: 0;
}

/* ── Reveal on scroll ───────────────────────────────────────────────────────*/
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 600ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .float-chip,
  .hero-mascot,
  .testimonial-mascot,
  .footer-mascot,
  .faq-mascot-card img {
    animation: none !important;
  }
}

/* ── Responsive ─────────────────────────────────────────────────────────────*/
@media (max-width: 1080px) {
  .courses-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 960px) {
  .hero {
    padding-top: 116px;
  }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    text-align: center;
  }
  .hero-copy {
    order: 2;
  }
  .hero-copy .pill,
  .hero-copy .store-row,
  .hero-copy .hero-trust {
    justify-content: center;
  }
  .hero-copy p.lead {
    margin-inline: auto;
  }
  .hero-stage {
    order: 1;
    min-height: 480px;
  }
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .feature-card.span-2 {
    grid-column: span 2;
  }
  .gallery-grid {
    grid-auto-rows: auto;
  }
  .gallery-card.featured,
  .gallery-card.tall,
  .gallery-card.wide {
    grid-column: span 6;
    grid-row: auto;
    min-height: 360px;
  }
  .faq-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .shell,
  .nav {
    width: min(100% - 28px, 1200px);
  }
  .nav-links,
  .brand-wordmark {
    display: none;
  }
  .brand-fallback,
  .mobile-toggle {
    display: inline-grid;
  }
  .site-header.scrolled,
  .site-header.menu-open {
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }
  .site-header.scrolled .nav,
  .site-header.menu-open .nav {
    margin-top: 8px;
    padding-inline: 14px;
    border-radius: var(--r-full);
    background: color-mix(in srgb, var(--background) 88%, transparent);
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px) saturate(150%);
  }
  .stats-row {
    grid-template-columns: 1fr;
  }
  .feature-grid,
  .games-grid,
  .courses-grid {
    grid-template-columns: 1fr;
  }
  .feature-card.span-2 {
    grid-column: auto;
  }
  .gallery-card.featured,
  .gallery-card.tall,
  .gallery-card.wide {
    grid-column: span 12;
  }
  .gallery-card.wide {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    min-height: 300px;
  }
  .gallery-card.wide .gallery-phone {
    align-self: center;
    transform: rotate(0);
  }
  .testimonial,
  .footer-cta {
    flex-direction: column;
    align-items: flex-start;
    text-align: start;
    padding: 32px;
  }
  .testimonial-mascot,
  .footer-mascot {
    align-self: center;
  }
  .footer-links {
    grid-template-columns: 1fr;
    padding: 28px;
  }
  .footer-columns {
    grid-template-columns: repeat(3, 1fr);
  }
  .footer-bottom {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .section {
    padding: 64px 0;
  }
  .hero-copy h1 {
    font-size: clamp(34px, 11vw, 46px);
    letter-spacing: -1px;
  }
  .store-row {
    width: 100%;
  }
  .store-row .btn {
    flex: 1;
  }
  .phone {
    width: 230px;
    height: 480px;
  }
  .footer-columns {
    grid-template-columns: 1fr 1fr;
  }
  .feature-card,
  .game-card,
  .testimonial,
  .footer-cta {
    padding: 24px;
  }
}

/* ============================================================================
   Coming-soon / waitlist page (kept intact — shares tokens above)
   ========================================================================== */
.coming-soon-body {
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  background: var(--background);
}

.coming-soon-page {
  position: relative;
  height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
  isolation: isolate;
}

.coming-soon-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 18% 12%, rgba(227, 237, 67, 0.44), transparent 30%),
    radial-gradient(circle at 86% 18%, rgba(255, 123, 208, 0.32), transparent 28%),
    radial-gradient(circle at 50% 92%, rgba(0, 164, 250, 0.28), transparent 34%),
    linear-gradient(145deg, #f9fbff 0%, var(--off-white) 42%, #eaf7ff 100%);
}

.coming-soon-card {
  width: 100%;
  max-width: 1000px;
  padding: clamp(28px, 5vw, 58px);
  display: grid;
  grid-template-columns: minmax(0, 650px) minmax(250px, 330px);
  align-items: center;
  gap: 10px;
  border-radius: var(--r-lg);
  background:
    radial-gradient(circle at 82% 18%, rgba(227, 237, 67, 0.72), transparent 28%),
    linear-gradient(135deg, color-mix(in srgb, var(--cyan) 88%, #fff) 0%, #00a1f5 52%, #0086d3 100%);
  color: var(--navy);
  box-shadow: 0 28px 80px rgba(33, 38, 63, 0.18);
}
