/* ==========================================================================
   MathMint — marketing site
   Brand tokens mirror the app's theme (src/theme/colors.ts) and the Home
   screen's two mode gradients, so the site and the product look related.
   ========================================================================== */

:root {
  --indigo-100: #eef0fe;
  --indigo-300: #818cf8;
  --indigo-500: #6366f1;
  --indigo-600: #4f46e5;
  --indigo-700: #4b42d6;

  --green-400: #3ed18e;
  --green-600: #1fa968;
  --green-700: #158a55;

  --amber: #f5a623;
  --star: #fcd34d;

  --bg: #f3f4fb;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --border: #e5e7eb;

  --text: #111827;
  --text-2: #4b5563;
  --text-3: #9ca3af;

  --riddle-grad: linear-gradient(135deg, #7a72ff 0%, #5a50e8 65%, #4b42d6 100%);
  --cross-grad: linear-gradient(135deg, #3ed18e 0%, #1fa968 65%, #158a55 100%);

  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 26px;

  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.04), 0 4px 12px rgba(17, 24, 39, 0.05);
  --shadow: 0 12px 32px rgba(17, 24, 39, 0.08);
  --shadow-lg: 0 24px 60px rgba(79, 70, 229, 0.18);

  --wrap: 1120px;
  --font: 'Fredoka', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-2: #334155;
    --border: #334155;

    --text: #f1f5f9;
    --text-2: #cbd5e1;
    --text-3: #94a3b8;

    --indigo-500: #818cf8;
    --indigo-600: #6366f1;
    --indigo-100: #1e2545;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);
  }
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

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

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0;
}

/* Keyboard users must always be able to see where they are. */
:focus-visible {
  outline: 3px solid var(--indigo-500);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

.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;
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 21px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.03em;
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  object-fit: contain;
}

.brand span {
  color: var(--indigo-500);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 15px;
  font-weight: 500;
}

.nav__links a {
  color: var(--text-2);
}

.nav__links a:hover {
  color: var(--indigo-500);
  text-decoration: none;
}

@media (max-width: 720px) {
  .nav__links {
    gap: 18px;
    font-size: 14px;
  }
  .nav__links .nav__hide-sm {
    display: none;
  }
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 14px 26px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
}

.btn--primary {
  background: var(--indigo-500);
  color: #fff;
  box-shadow: 0 10px 24px rgba(99, 102, 241, 0.35);
}

.btn--primary:hover {
  background: var(--indigo-600);
  box-shadow: 0 16px 32px rgba(99, 102, 241, 0.42);
}

.btn--ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.btn--ghost:hover {
  border-color: var(--indigo-500);
  color: var(--indigo-500);
}

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

/* Soft brand glow behind the headline. */
.hero::before {
  content: '';
  position: absolute;
  top: -280px;
  left: 50%;
  width: 900px;
  height: 620px;
  transform: translateX(-50%);
  background: radial-gradient(
    ellipse at center,
    rgba(99, 102, 241, 0.22) 0%,
    rgba(99, 102, 241, 0) 68%
  );
  pointer-events: none;
}

.hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 56px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 15px;
  border-radius: 999px;
  background: var(--indigo-100);
  color: var(--indigo-600);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 22px;
}

.hero h1 {
  font-size: clamp(2.5rem, 5.2vw, 3.9rem);
  font-weight: 600;
  margin-bottom: 20px;
}

.hero h1 em {
  font-style: normal;
  background: var(--riddle-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lede {
  font-size: 19px;
  color: var(--text-2);
  max-width: 33rem;
  margin: 0 0 32px;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
}

.hero__note {
  font-size: 14px;
  color: var(--text-3);
  margin: 0;
}

/* Phone mockup */
.mock {
  position: relative;
  justify-self: center;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 9 / 17.5;
  border-radius: 42px;
  padding: 12px;
  background: linear-gradient(160deg, #2a2f45, #12141f);
  box-shadow: var(--shadow-lg);
}

.mock__screen {
  height: 100%;
  border-radius: 32px;
  background: var(--bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 26px 16px 16px;
}

.mock__brand {
  text-align: center;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
}

.mock__brand span {
  color: var(--indigo-500);
}

.mock__strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
}

.mock__lvl {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: var(--indigo-500);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  flex: none;
}

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

.mock__stat {
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 9px 4px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.mock__stat small {
  display: block;
  font-size: 8.5px;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0.03em;
}

.mock__card {
  flex: 1;
  border-radius: 20px;
  padding: 16px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 0;
}

.mock__card--riddle {
  background: var(--riddle-grad);
}

.mock__card--cross {
  background: var(--cross-grad);
}

.mock__card b {
  font-size: 15px;
  font-weight: 600;
}

.mock__card small {
  display: block;
  font-size: 11px;
  opacity: 0.82;
}

.mock__emoji {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
  font-size: 19px;
  margin-bottom: 10px;
}

.mock__track {
  height: 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.25);
  overflow: hidden;
}

.mock__track i {
  display: block;
  height: 100%;
  background: #fff;
  border-radius: 4px;
}

@media (max-width: 900px) {
  .hero {
    padding: 56px 0 48px;
  }
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 44px;
    text-align: center;
  }
  .hero__lede {
    margin-left: auto;
    margin-right: auto;
  }
  .hero__cta {
    justify-content: center;
  }
}

/* ==========================================================================
   Stat band
   ========================================================================== */
.band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 96px;
}

.band__cell {
  background: var(--surface);
  padding: 28px 16px;
  text-align: center;
}

.band__n {
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.03em;
  background: var(--riddle-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.band__l {
  font-size: 13.5px;
  color: var(--text-3);
  font-weight: 500;
}

@media (max-width: 620px) {
  .band {
    grid-template-columns: repeat(2, 1fr);
  }
  .band__n {
    font-size: 28px;
  }
}

/* ==========================================================================
   Sections
   ========================================================================== */
.section {
  padding-bottom: 96px;
}

.section__head {
  max-width: 42rem;
  margin: 0 auto 48px;
  text-align: center;
}

.section__head h2 {
  font-size: clamp(1.85rem, 3.4vw, 2.5rem);
  font-weight: 600;
  margin-bottom: 14px;
}

.section__head p {
  font-size: 18px;
  color: var(--text-2);
  margin: 0;
}

.kicker {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--indigo-500);
  margin-bottom: 12px;
}

/* ---- Mode cards (the two game modes) ---- */
.modes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.mode {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 38px 34px;
  color: #fff;
  box-shadow: var(--shadow);
}

.mode--riddle {
  background: var(--riddle-grad);
}

.mode--cross {
  background: var(--cross-grad);
}

/* Highlight blob, echoing the app card's own decoration. */
.mode::after {
  content: '';
  position: absolute;
  right: -60px;
  top: -80px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

.mode__icon {
  width: 62px;
  height: 62px;
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.35);
  display: grid;
  place-items: center;
  font-size: 30px;
  margin-bottom: 22px;
}

.mode h3 {
  font-size: 27px;
  font-weight: 600;
  margin-bottom: 10px;
}

.mode p {
  color: rgba(255, 255, 255, 0.88);
  margin: 0 0 22px;
  font-size: 16px;
}

.mode ul {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
  font-size: 15.5px;
}

.mode li {
  padding-left: 27px;
  margin-bottom: 9px;
  color: rgba(255, 255, 255, 0.94);
}

.mode li::before {
  content: '✓';
  position: absolute;
  left: 0;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
}

@media (max-width: 860px) {
  .modes {
    grid-template-columns: 1fr;
  }
  .mode {
    padding: 32px 26px;
  }
}

/* ---- Feature grid ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 26px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--indigo-300);
  box-shadow: var(--shadow);
}

.card__icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: var(--indigo-100);
  display: grid;
  place-items: center;
  font-size: 24px;
  margin-bottom: 18px;
}

.card h3 {
  font-size: 19px;
  font-weight: 600;
  margin-bottom: 8px;
}

.card p {
  margin: 0;
  color: var(--text-2);
  font-size: 15.5px;
}

@media (max-width: 940px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 620px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Split feature (progression) ---- */
.split {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 56px;
  align-items: center;
}

.split h2 {
  font-size: clamp(1.75rem, 3.2vw, 2.3rem);
  font-weight: 600;
  margin-bottom: 16px;
}

.split > div > p {
  color: var(--text-2);
  font-size: 17px;
}

.steps {
  list-style: none;
  padding: 0;
  margin: 26px 0 0;
  counter-reset: step;
}

.steps li {
  position: relative;
  counter-increment: step;
  padding-left: 52px;
  margin-bottom: 22px;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--indigo-500);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 600;
}

.steps b {
  display: block;
  font-weight: 600;
  font-size: 17px;
}

.steps span {
  color: var(--text-2);
  font-size: 15.5px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
}

.panel__row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 0;
  border-bottom: 1px solid var(--border);
}

.panel__row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.panel__row:first-child {
  padding-top: 0;
}

.panel__badge {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 21px;
  background: var(--surface-2);
  flex: none;
}

.panel__row b {
  display: block;
  font-size: 16px;
  font-weight: 600;
}

.panel__row span {
  font-size: 14px;
  color: var(--text-3);
}

.panel__val {
  margin-left: auto;
  font-weight: 600;
  color: var(--indigo-500);
  font-size: 16px;
}

@media (max-width: 860px) {
  .split {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

/* ---- CTA ---- */
.cta {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 68px 32px;
  text-align: center;
  background: var(--riddle-grad);
  color: #fff;
  box-shadow: var(--shadow-lg);
}

.cta h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.6rem);
  font-weight: 600;
  margin-bottom: 14px;
}

.cta p {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.9);
  max-width: 34rem;
  margin: 0 auto 30px;
}

.cta .btn--ghost {
  background: #fff;
  color: var(--indigo-700);
  border-color: transparent;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  border-top: 1px solid var(--border);
  padding: 46px 0 40px;
  margin-top: 96px;
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  align-items: center;
  justify-content: space-between;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  font-size: 15px;
}

.footer__links a {
  color: var(--text-2);
}

.footer__copy {
  width: 100%;
  font-size: 14px;
  color: var(--text-3);
  margin: 22px 0 0;
}

/* ==========================================================================
   Legal pages (privacy / terms)
   ========================================================================== */
.legal {
  padding: 56px 0 0;
}

.legal__head {
  max-width: 46rem;
  margin-bottom: 40px;
}

.legal__head h1 {
  font-size: clamp(2.1rem, 4.4vw, 3rem);
  font-weight: 600;
  margin-bottom: 12px;
}

.legal__updated {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text-3);
  font-weight: 500;
}

.legal__body {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 56px;
  align-items: start;
}

.toc {
  position: sticky;
  top: 92px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.toc h2 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 14px;
}

.toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 14.5px;
}

.toc li {
  margin-bottom: 9px;
}

.toc a {
  color: var(--text-2);
}

.toc a:hover {
  color: var(--indigo-500);
  text-decoration: none;
}

.legal article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 40px 40px;
  box-shadow: var(--shadow-sm);
}

.legal section {
  padding-top: 30px;
  scroll-margin-top: 92px;
}

.legal h2 {
  font-size: 21px;
  font-weight: 600;
  margin-bottom: 12px;
}

.legal p {
  color: var(--text-2);
  margin: 0 0 14px;
}

.legal ul {
  margin: 0 0 14px;
  padding-left: 0;
  list-style: none;
}

.legal ul li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 9px;
  color: var(--text-2);
}

.legal ul li::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--indigo-500);
}

.callout {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--indigo-100);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin-top: 8px;
}

.callout p {
  margin: 0;
  color: var(--text-2);
  font-size: 15.5px;
}

.callout strong {
  color: var(--text);
}

@media (max-width: 900px) {
  .legal__body {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .toc {
    position: static;
  }
  .legal article {
    padding: 8px 24px 30px;
  }
}

/* Respect reduced-motion preferences. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
