/* Nished marketing site — dark-first, mirrors the app's theme palette. */

:root {
  --bg: #0F0F14;
  --surface: #1A1A24;
  --surface-deep: #15151F;
  --text: #E8E8ED;
  --muted: #6B6B7B;
  --border: #2A2A3A;
  --violet: #A78BFA;
  --violet-deep: #7C3AED;
  --xp-1: #8B5CF6;
  --xp-2: #6366F1;
  --amber: #FBBF24;
  --orange: #F97316;
  --freeze: #0EA5E9;
  --radius: 14px;
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-mono: "Spline Sans Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 350;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Subtle grain so large dark areas don't band */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

.mono { font-family: var(--font-mono); }

h1, h2, h3 { font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }

em { font-style: normal; }

h1 em, h2 em {
  background: linear-gradient(100deg, var(--violet) 20%, var(--xp-2) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

a { color: var(--violet); text-decoration: none; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: 600 1rem var(--font-display);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.btn-primary {
  background: linear-gradient(120deg, var(--violet-deep), var(--xp-2));
  color: #fff;
  box-shadow: 0 0 24px rgba(124, 58, 237, 0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 36px rgba(124, 58, 237, 0.55);
}

.btn-ghost {
  border-color: var(--border);
  color: var(--text);
  background: rgba(26, 26, 36, 0.5);
}
.btn-ghost:hover { border-color: var(--violet); }

.btn-sm { padding: 0.55rem 1.1rem; font-size: 0.9rem; }

/* ============ Header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.8rem clamp(1.2rem, 5vw, 4rem);
  background: rgba(15, 15, 20, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font: 700 1.25rem var(--font-display);
  color: var(--text);
  letter-spacing: -0.02em;
}
.brand img { border-radius: 9px; }

.site-header nav { display: flex; gap: 1.8rem; }
.site-header nav a {
  color: var(--muted);
  font-size: 0.95rem;
  transition: color 0.2s ease;
}
.site-header nav a:hover { color: var(--text); }

/* ============ Hero ============ */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  padding: clamp(4rem, 9vh, 7rem) clamp(1.2rem, 6vw, 6rem) clamp(4rem, 8vh, 6rem);
  max-width: 1280px;
  margin: 0 auto;
}

.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
}
.hero-glow-violet {
  width: 560px; height: 560px;
  top: -180px; left: -140px;
  background: rgba(124, 58, 237, 0.22);
}
.hero-glow-amber {
  width: 420px; height: 420px;
  bottom: -160px; right: -80px;
  background: rgba(249, 115, 22, 0.10);
}

.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--violet);
  margin-bottom: 1.4rem;
}
.eyebrow .ipa { color: var(--muted); }

.hero h1 {
  font-size: clamp(2.6rem, 5.6vw, 4.4rem);
  font-stretch: 95%;
  margin-bottom: 1.4rem;
}

.lede {
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 34rem;
  margin-bottom: 2.2rem;
}
.lede strong { color: var(--text); font-weight: 600; }

.cta-row { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-bottom: 2.6rem; }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem;
  list-style: none;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}
.hero-stats li { display: flex; align-items: center; gap: 0.5rem; }

.stat-dot { width: 8px; height: 8px; border-radius: 50%; }
.dot-violet { background: var(--violet); box-shadow: 0 0 8px var(--violet); }
.dot-amber { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.dot-cyan { background: var(--freeze); box-shadow: 0 0 8px var(--freeze); }

/* ============ Phone mockup ============ */
.phone-wrap { display: flex; justify-content: center; perspective: 1400px; }

.phone {
  position: relative;
  width: min(320px, 86vw);
  border-radius: 42px;
  padding: 12px;
  background: linear-gradient(160deg, #2A2A3A, #15151F 60%);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.6),
    0 0 80px rgba(124, 58, 237, 0.18);
  transform: rotate(2.5deg);
}

.phone-notch {
  position: absolute;
  top: 22px; left: 50%;
  transform: translateX(-50%);
  width: 86px; height: 22px;
  border-radius: 12px;
  background: #0A0A0F;
  z-index: 2;
}

.phone-screen {
  background: var(--bg);
  border-radius: 32px;
  padding: 3.4rem 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  overflow: hidden;
}

.hud {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem 0.9rem;
}
.hud-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  margin-bottom: 0.55rem;
}
.hud-level { color: var(--violet); letter-spacing: 0.08em; }
.hud-streak { color: var(--amber); }
.hud-sub { font-size: 0.62rem; color: var(--muted); margin-top: 0.45rem; letter-spacing: 0.06em; }

.xpbar {
  height: 8px;
  border-radius: 99px;
  background: var(--surface-deep);
  border: 1px solid var(--border);
  overflow: hidden;
}
.xpbar-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--xp-1), var(--xp-2));
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.7);
  animation: xp-fill 1.4s cubic-bezier(0.22, 1, 0.36, 1) 0.5s forwards;
}

@keyframes xp-fill { to { width: var(--xp, 68%); } }

.day-label {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 0.3rem 0.2rem 0;
}

.task {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 0.8rem;
  font-size: 0.88rem;
}

.check {
  flex: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--muted);
  position: relative;
}
.check.checked, .task.done .check {
  border-color: var(--violet-deep);
  background: var(--violet-deep);
}
.check.checked::after, .task.done .check::after {
  content: "";
  position: absolute;
  left: 5px; top: 2px;
  width: 5px; height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.task-body { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.task-body small { font-size: 0.6rem; color: var(--muted); letter-spacing: 0.05em; }
.task.done .task-body { color: var(--muted); }

.prio {
  flex: none;
  margin-left: auto;
  width: 9px; height: 9px;
  border-radius: 50%;
}
.p-red   { background: #EF4444; box-shadow: 0 0 7px #EF4444; }
.p-amber { background: var(--amber); box-shadow: 0 0 7px var(--amber); }
.p-green { background: #34D399; box-shadow: 0 0 7px #34D399; }
.p-blue  { background: var(--freeze); box-shadow: 0 0 7px var(--freeze); }

/* Looping demo: second task checks itself, pops confetti, floats XP */
.task.demo .check { animation: demo-check 7s ease infinite; }
.task.demo .tick {
  position: absolute;
  left: 4px; top: 1px;
  width: 5px; height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  opacity: 0;
  animation: demo-tick 7s ease infinite;
}
.task.demo .task-title { animation: demo-fade 7s ease infinite; }

@keyframes demo-check {
  0%, 28% { border-color: var(--muted); background: transparent; }
  34%, 86% { border-color: var(--violet-deep); background: var(--violet-deep); }
  94%, 100% { border-color: var(--muted); background: transparent; }
}
@keyframes demo-tick {
  0%, 30% { opacity: 0; }
  36%, 86% { opacity: 1; }
  92%, 100% { opacity: 0; }
}
@keyframes demo-fade {
  0%, 30% { color: var(--text); }
  38%, 86% { color: var(--muted); }
  96%, 100% { color: var(--text); }
}

.xp-float {
  position: absolute;
  right: 2rem; top: 50%;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--violet);
  text-shadow: 0 0 10px rgba(167, 139, 250, 0.8);
  opacity: 0;
  pointer-events: none;
  animation: xp-float 7s ease infinite;
}
@keyframes xp-float {
  0%, 32% { opacity: 0; transform: translateY(0); }
  38% { opacity: 1; }
  54%, 100% { opacity: 0; transform: translateY(-26px); }
}

.confetti { position: absolute; left: 1.1rem; top: 50%; pointer-events: none; }
.confetti i {
  position: absolute;
  width: 5px; height: 5px;
  border-radius: 1px;
  opacity: 0;
  animation: confetti-pop 7s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}
.confetti i:nth-child(1) { background: var(--violet); --tx: -26px; --ty: -30px; }
.confetti i:nth-child(2) { background: var(--amber);  --tx: 22px;  --ty: -34px; }
.confetti i:nth-child(3) { background: var(--freeze); --tx: 34px;  --ty: -12px; }
.confetti i:nth-child(4) { background: var(--xp-2);   --tx: -34px; --ty: -8px; }
.confetti i:nth-child(5) { background: var(--orange); --tx: 14px;  --ty: -42px; border-radius: 50%; }
.confetti i:nth-child(6) { background: var(--violet); --tx: -14px; --ty: -44px; border-radius: 50%; }
.confetti i:nth-child(7) { background: var(--amber);  --tx: 40px;  --ty: -26px; }
.confetti i:nth-child(8) { background: var(--freeze); --tx: -40px; --ty: -20px; }
@keyframes confetti-pop {
  0%, 31% { opacity: 0; transform: translate(0, 0) rotate(0deg); }
  33% { opacity: 1; }
  52%, 100% { opacity: 0; transform: translate(var(--tx), var(--ty)) rotate(220deg); }
}

.quest-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.2rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius);
  border: 1px solid rgba(167, 139, 250, 0.35);
  background: rgba(124, 58, 237, 0.10);
  font-size: 0.72rem;
}
.quest-label { color: var(--violet); font-size: 0.58rem; letter-spacing: 0.12em; }
.quest-progress { margin-left: auto; color: var(--amber); }

/* ============ Sections ============ */
.section {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(4rem, 9vh, 7rem) clamp(1.2rem, 5vw, 3rem);
}

.kicker {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: var(--violet);
  margin-bottom: 0.9rem;
}

.section h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.8rem);
  margin-bottom: 1rem;
  max-width: 38rem;
}

.section-lede {
  color: var(--muted);
  max-width: 38rem;
  margin-bottom: 2.6rem;
}

/* ============ Feature cards ============ */
.feature-grid, .game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.1rem;
  margin-top: 2.4rem;
}
/* Tighter minimum so all four game cards sit on one row at desktop widths */
.game-grid { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(167, 139, 250, 0.5);
  box-shadow: 0 10px 40px rgba(124, 58, 237, 0.15);
}

.card h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.card p { color: var(--muted); font-size: 0.95rem; }

.card-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 1.1rem;
}
.card-icon svg { width: 22px; height: 22px; }
.icon-violet { background: rgba(124, 58, 237, 0.15); color: var(--violet); }
.icon-amber  { background: rgba(251, 191, 36, 0.12); color: var(--amber); }
.icon-cyan   { background: rgba(14, 165, 233, 0.12); color: var(--freeze); }

/* ============ Gamification section ============ */
.section-game {
  /* Inset panel: keep side gaps on narrow screens so the border never touches the viewport edge */
  width: min(1180px, calc(100% - 1.6rem));
  background: var(--surface-deep);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.6);
  overflow: hidden;
}

.game-glow {
  position: absolute;
  inset: 20% 30%;
  background: rgba(124, 58, 237, 0.10);
  filter: blur(140px);
  pointer-events: none;
}

.game-xp {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem 1.5rem;
  margin-bottom: 1.1rem;
}
.game-xp-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  margin-bottom: 0.8rem;
}
.game-xp-head span:first-child { color: var(--violet); }
.game-xp-head span:last-child { color: var(--muted); }

.xpbar-lg { height: 14px; }
.game-xp .xpbar-fill { animation-play-state: paused; }
.game-xp.in .xpbar-fill { animation-play-state: running; }

/* Accent edges tie each game card to its mechanic's color */
.card-streak { border-top: 2px solid var(--orange); }
.card-freeze { border-top: 2px solid var(--freeze); }
.card-quest, .card-confetti { border-top: 2px solid var(--violet-deep); }

/* ============ Privacy ============ */
.privacy-panel {
  background: linear-gradient(150deg, var(--surface), var(--surface-deep));
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.6);
  padding: clamp(2rem, 5vw, 3.6rem);
  box-shadow: 0 0 70px rgba(14, 165, 233, 0.07);
}

.privacy-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  list-style: none;
}
.privacy-list li {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--freeze);
  border: 1px solid rgba(14, 165, 233, 0.35);
  border-radius: 99px;
  padding: 0.45rem 0.95rem;
  background: rgba(14, 165, 233, 0.07);
}

/* ============ Download ============ */
.section-download { text-align: center; }
.section-download h2, .section-download .section-lede { margin-left: auto; margin-right: auto; }

.store-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2.6rem;
}

.store-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1.5rem 0.8rem 1.2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  opacity: 0.75;
  cursor: default;
}
.store-badge svg { width: 28px; height: 28px; }
.store-badge-text { display: flex; flex-direction: column; text-align: left; line-height: 1.25; }
.store-badge-text small { font-size: 0.68rem; color: var(--muted); }
.store-badge-text strong { font-size: 1.05rem; }

.soon-tag {
  position: absolute;
  top: -9px; right: 12px;
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  color: var(--amber);
  background: var(--bg);
  border: 1px solid rgba(251, 191, 36, 0.5);
  border-radius: 99px;
  padding: 0.15rem 0.55rem;
}

.btn-testflight { margin-top: 1.6rem; }

/* ============ Footer ============ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 3rem clamp(1.2rem, 5vw, 3rem) 3.4rem;
  text-align: center;
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font: 700 1.1rem var(--font-display);
  margin-bottom: 0.7rem;
}
.footer-brand img { border-radius: 7px; }
.footer-tag { color: var(--muted); margin-bottom: 1.2rem; }
.footer-meta { font-size: 0.65rem; letter-spacing: 0.14em; color: var(--muted); }

/* ============ Scroll reveal ============ */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.in { opacity: 1; transform: none; }

/* Stagger siblings inside grids for a cascading entrance */
.feature-grid .reveal:nth-child(2), .game-grid .reveal:nth-child(2) { transition-delay: 0.08s; }
.feature-grid .reveal:nth-child(3), .game-grid .reveal:nth-child(3) { transition-delay: 0.16s; }
.feature-grid .reveal:nth-child(4), .game-grid .reveal:nth-child(4) { transition-delay: 0.24s; }
.feature-grid .reveal:nth-child(5) { transition-delay: 0.32s; }
.feature-grid .reveal:nth-child(6) { transition-delay: 0.4s; }

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 3rem; }
  .hero-copy { display: flex; flex-direction: column; align-items: center; }
  .cta-row, .hero-stats { justify-content: center; }
  .phone { transform: rotate(0deg); }
  .site-header nav { display: none; }
}

@media (max-width: 520px) {
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .xpbar-fill { width: var(--xp, 68%); }
}
