/* ============================================================
   Attrakto — Website Styles
   Tokens sourced from docs/design-system/tokens.md
   ============================================================ */

/* Custom Properties
   ------------------------------------------------------------ */
:root {
  /* Backgrounds */
  --bg:             #1E1E1E;   /* color.bg.app */
  --surface:        #242424;   /* color.bg.surface */
  --surface-modal:  #2A2A2A;   /* color.bg.modal */
  --account-bg:     #111111;   /* color.bg.accountButton */

  /* Borders */
  --border:         rgba(255, 255, 255, 0.09);   /* color.border.subtle */
  --border-medium:  rgba(255, 255, 255, 0.14);   /* color.border.medium */

  /* Text */
  --text:           #FFFFFF;
  --text-muted:     rgba(255, 255, 255, 0.58);   /* color.text.muted */
  --text-dim:       rgba(255, 255, 255, 0.52);   /* color.text.dim — min 4.5:1 on #1E1E1E */

  /* Brand */
  --green:          #009245;   /* color.action */
  --green-dark:     #007538;   /* color.action.pressed */
  --orange:         #E8762E;   /* color.premium */
  --danger:         #D94F3D;   /* color.danger — Repulsor fill */

  /* Fonts */
  --font-heading:   'Suez One', Georgia, serif;
  --font-body:      'DM Sans', system-ui, -apple-system, sans-serif;
  --font-numeric:   'Red Rose', 'DM Sans', system-ui, sans-serif;   /* text.numeric */

  /* Spacing */
  --sp-xs:   8px;
  --sp-sm:   16px;
  --sp-md:   32px;
  --sp-lg:   64px;
  --sp-xl:   96px;
  --sp-2xl:  140px;

  --max-width:     1080px;
  --radius:        8px;
  --radius-lg:     14px;
  --radius-xl:     20px;
}

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

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; height: auto; display: block; }

/* Typography
   ------------------------------------------------------------ */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.18;
  color: var(--text);
}

h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); letter-spacing: -0.015em; }
h3 { font-size: 1.15rem; letter-spacing: -0.01em; }

p { color: var(--text-muted); line-height: 1.75; }
strong { color: var(--text); font-weight: 500; }

/* Layout
   ------------------------------------------------------------ */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--sp-md);
}

/* Navigation
   ------------------------------------------------------------ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(30, 30, 30, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  /* Green highlight line — matches app navBarHighlight */
  box-shadow: inset 0 -2px 0 var(--green);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--sp-md);
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  transition: opacity 180ms ease;
}
.nav-logo img { display: block; height: 32px; width: auto; }
.nav-logo:hover { opacity: 0.72; }

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--orange);
  transition: opacity 180ms ease;
}
.nav-link:hover { opacity: 0.8; }

/* ============================================================
   Balls stage — top and bottom bands. Text never sits on balls.
   Hero and CTA dark containers float ON these areas.
   ============================================================ */
.balls-stage {
  position: relative;
  overflow: hidden;
}

.balls-stage--top {
  padding-top: 58px;    /* clear fixed nav */
  padding-bottom: 180px; /* wave is 120px + 60px of visible balls above it */
}

.balls-stage--bottom {
  padding-bottom: var(--sp-2xl);
}

.balls-bg {
  position: absolute;
  inset: 0;
  background-image: url('/img/balls.jpg');
  background-size: cover;
  background-position: center center;
  pointer-events: none;
}

/* Wave bridge — standalone element between last section and bottom balls stage.
   Contains balls bg + SVG arch that creates the convex return to balls. */
.wave-bridge {
  position: relative;
  height: 120px;
  overflow: hidden;
}

.wave-bridge svg {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
}

/* ============================================================
   Wave dividers — arch SVG at section bottoms
   ============================================================ */
.wave-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  line-height: 0;
}

.wave-bottom svg {
  display: block;
  width: 100%;
  height: 120px;
}

/* ============================================================
   Content sections — dark and light
   ============================================================ */
.section-dark {
  position: relative;
  background: var(--bg);
  padding: var(--sp-xl) 0 calc(var(--sp-xl) + 120px);
}

.section-light {
  position: relative;
  background: #FFFFFF;
  padding: var(--sp-xl) 0 calc(var(--sp-xl) + 120px);
  color: #1E1E1E;
}

/* Light section text overrides */
.section-light h2,
.section-light h3      { color: #1E1E1E; }
.section-light p       { color: rgba(30, 30, 30, 0.62); }
.section-light .section-eyebrow { color: rgba(30, 30, 30, 0.62); }  /* min 4.5:1 on #fff */
.section-light .section-tagline { color: var(--orange); }
.section-light .section-body    { color: rgba(30, 30, 30, 0.62); }
.section-light .level-micro     { color: rgba(30, 30, 30, 0.62); }

/* Pricing cards on white */
.section-light .pricing-card {
  background: #F5F5F5;
  border-color: rgba(0, 0, 0, 0.10);
}
.section-light .pricing-card--premium {
  background: linear-gradient(160deg, rgba(232, 118, 46, 0.08) 0%, #F5F5F5 55%);
  border-color: rgba(232, 118, 46, 0.35);
}
.section-light .pricing-price        { color: #1E1E1E; }
.section-light .pricing-features li  { color: rgba(30, 30, 30, 0.62); }
.section-light .pricing-features li::before { color: rgba(30, 30, 30, 0.3); }
.section-light .pricing-card--premium .pricing-features li::before { color: var(--orange); }
.section-light .pricing-micro        { color: rgba(30, 30, 30, 0.62); }
.section-light .pricing-tier         { color: rgba(30, 30, 30, 0.62); }
.section-light .pricing-card--premium .pricing-tier { color: var(--orange); }

/* Accent heading — orange on both dark and light */
.heading-accent { color: var(--orange); }

/* Spacing between subsections within one section */
.subsection + .subsection { margin-top: var(--sp-xl); }

/* ============================================================
   Hero section — dark rectangle floating on balls background.
   Sits inside .balls-stage--top; balls visible above it.
   ============================================================ */
.section-hero {
  position: relative;
  z-index: 1;
  background: var(--bg);
  text-align: center;
  margin: 52px clamp(16px, 4vw, 56px) 0;        /* balls top + sides; flush at bottom */
  padding: var(--sp-md) 0 var(--sp-md);
  border-radius: 20px;                           /* all corners rounded */
}

.hero-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--sp-md) var(--sp-md);
}

/* h1 wraps the logo image — reset heading chrome */
.hero-logo-heading {
  font-size: inherit;
  font-family: inherit;
  font-weight: inherit;
  line-height: 1;
  letter-spacing: 0;
  margin-bottom: var(--sp-md);
}

.hero-logo {
  width: 300px;
  max-width: 70vw;
  height: auto;
}

.hero-sub {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.76);
  margin-bottom: var(--sp-md);
  line-height: 1.65;
}

/* ── Screenshot fan ─────────────────────────────────────────── */
.hero-fan {
  display: block;
  width: 960px;
  max-width: calc(100% - var(--sp-lg) * 2);
  height: auto;
  margin: var(--sp-md) auto;
}

.hero-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: var(--sp-xl);
}

/* Final CTA — dark container floating on bottom balls stage */
.section-cta {
  position: relative;
  z-index: 1;
  background: var(--bg);
  text-align: center;
  padding: var(--sp-xl) 0;
  border-radius: 20px;                         /* all corners rounded, balls show around */
  margin: 52px clamp(16px, 4vw, 56px);         /* balls visible on all sides */
}
.section-cta h2 { max-width: 560px; margin: 0 auto var(--sp-sm); }
.section-cta .section-body { max-width: 400px; margin: 0 auto var(--sp-lg); }
.cta-actions { display: flex; justify-content: center; }

/* ============================================================
   Buttons
   ============================================================ */
.btn-appstore {
  display: inline-block;
  transition: opacity 180ms ease, transform 180ms ease;
  text-decoration: none;
  line-height: 0;
}
.btn-appstore:hover { opacity: 0.88; transform: translateY(-1px); }
.appstore-badge { height: 52px; width: auto; display: block; }

.btn-green {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--green);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.925rem;
  font-weight: 500;
  padding: 13px 26px;
  border-radius: var(--radius);
  transition: background 180ms ease, transform 180ms ease;
  text-decoration: none;
}
.btn-green:hover { background: var(--green-dark); transform: translateY(-1px); }

/* ============================================================
   Sections
   ============================================================ */
.section {
  padding: var(--sp-xl) 0;
  border-top: 1px solid var(--border);
}

/* Elevated surface — #242424, alternates with default #1E1E1E */
.section--surface {
  background: var(--surface);
}

.section-eyebrow {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: var(--sp-md);
}

.section h2 { margin-bottom: var(--sp-sm); max-width: 580px; }

.section-body {
  font-size: 1.02rem;
  max-width: 560px;
  margin-bottom: var(--sp-md);
}

.section-tagline {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  color: var(--text);
  margin-top: var(--sp-md);
}

/* Orange heading variant — How it Works */
.section--gold h2 { color: var(--orange); }
.section--gold .section-tagline { color: var(--orange); }

/* ============================================================
   How it Works — Green action cards (matches app home screen cards)
   ============================================================ */
.moves-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-sm);
  margin: var(--sp-lg) 0 0;
}

.move-card {
  background: var(--green-dark);
  border-radius: var(--radius-lg);
  padding: var(--sp-md);
  transition: background 200ms ease, transform 200ms ease;
}
.move-card:hover { background: #005a2b; transform: translateY(-2px); }

.move-card h3 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: #FFFFFF;
  margin-bottom: 10px;
}

.move-card p {
  font-size: 0.925rem;
  line-height: 1.62;
  color: rgba(255, 255, 255, 0.92);
}

/* ============================================================
   Daily Puzzle
   ============================================================ */

#daily-heading { margin-bottom: var(--sp-md); }

.daily-body-row {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-lg);
}

.daily-body-text {
  flex: 1 1 0;
  min-width: 0;
}

.daily-body-text p + p { margin-top: var(--sp-sm); }

.daily-leaderboard-img {
  width: 280px;
  flex-shrink: 0;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid rgba(0, 0, 0, 0.10);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
}

/* ============================================================
   Calm by Design
   ============================================================ */
.calm-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: var(--sp-md);
  max-width: 500px;
}

.calm-feature {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.925rem;
  color: var(--text-muted);
  line-height: 1.62;
}

.section-light .calm-feature { color: rgba(30, 30, 30, 0.62); }

.calm-feature::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  margin-top: 8px;
}

/* ============================================================
   Pricing
   ============================================================ */
.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-sm);
  margin-top: var(--sp-lg);
  max-width: 680px;
}

.pricing-card {
  background: var(--surface-modal);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: var(--sp-md);
}

.pricing-card--premium {
  border-color: rgba(232, 118, 46, 0.40);
  background: linear-gradient(160deg, rgba(232, 118, 46, 0.07) 0%, var(--surface-modal) 55%);
}

.pricing-tier {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.pricing-card--premium .pricing-tier { color: var(--orange); }

/* RedRose for pricing numbers — matches app text.numeric */
.pricing-price {
  font-family: var(--font-numeric);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--sp-md);
  line-height: 1;
}

.pricing-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pricing-features li {
  font-size: 0.875rem;
  color: var(--text-muted);
  display: flex;
  align-items: flex-start;
  gap: 9px;
  line-height: 1.52;
}

.pricing-features li::before {
  content: '—';
  color: var(--text-dim);
  flex-shrink: 0;
  font-size: 0.78rem;
  margin-top: 2px;
}

.pricing-card--premium .pricing-features li::before {
  content: '+';
  color: var(--orange);
  font-weight: 700;
}

.pricing-micro {
  margin-top: var(--sp-md);
  font-size: 0.82rem;
  color: var(--text-dim);
}

.pricing-cta {
  margin-top: var(--sp-lg);
  display: flex;
  justify-content: center;
}

/* ============================================================
   Level Play
   ============================================================ */
.level-micro {
  margin-top: var(--sp-sm);
  font-size: 0.875rem;
  color: var(--text-dim);
}

.level-body-row {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-lg);
}

.level-play-img {
  width: 280px;
  flex-shrink: 0;
  height: auto;
  border-radius: var(--radius);
  margin-top: var(--sp-md);
  border: 1px solid rgba(0, 0, 0, 0.10);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
}

.streaks-body-row {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-lg);
}

.streaks-body-text {
  flex: 1 1 0;
  min-width: 0;
}

.streaks-profile-img {
  width: 320px;
  flex-shrink: 0;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.30);
}

.level-body-text {
  flex: 1 1 0;
  min-width: 0;
}

.level-body-text p + p { margin-top: var(--sp-sm); }


/* ============================================================
   Footer
   ============================================================ */
.footer {
  border-top: 1px solid var(--border);
  padding: var(--sp-lg) 0;
  background: var(--account-bg);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--sp-md);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-md);
}

.footer-logo {
  display: flex;
  align-items: center;
  margin-right: auto;
  transition: opacity 180ms ease;
}
.footer-logo img { display: block; height: 28px; width: auto; }
.footer-logo:hover { opacity: 0.72; }

.footer-nav { display: flex; gap: var(--sp-md); }

.footer-nav a {
  font-size: 0.84rem;
  color: var(--text-muted);
  transition: color 180ms ease;
}
.footer-nav a:hover { color: var(--text); }

.footer-copy { width: 100%; font-size: 0.78rem; color: var(--text-dim); }

/* ============================================================
   Support Page
   ============================================================ */
.page-header { padding: calc(58px + var(--sp-xl)) 0 var(--sp-lg); }
.page-header h1 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); margin-bottom: var(--sp-xs); }
.page-header p { font-size: 1.05rem; max-width: 480px; }

.support-form { max-width: 520px; padding-bottom: var(--sp-2xl); }
.form-group { margin-bottom: var(--sp-md); }

.form-group label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 7px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 11px var(--sp-sm);
  outline: none;
  transition: border-color 180ms ease;
  -webkit-appearance: none;
}

.form-group input:focus,
.form-group textarea:focus { border-color: var(--green); }

.form-group textarea { min-height: 140px; resize: vertical; line-height: 1.65; }

.btn-submit {
  background: var(--green);
  color: #fff;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  padding: 13px 32px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease;
}
.btn-submit:hover { background: var(--green-dark); transform: translateY(-1px); }

.form-note { margin-top: var(--sp-sm); font-size: 0.82rem; color: var(--text-dim); }

/* ============================================================
   Legal Pages
   ============================================================ */
.legal-header {
  padding: calc(58px + var(--sp-xl)) 0 var(--sp-md);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-lg);
}

.legal-header h1 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); margin-bottom: 8px; }
.legal-meta { font-size: 0.84rem; color: var(--text-dim); }
.legal-body { padding-bottom: var(--sp-2xl); }

.legal-body h2 {
  font-size: 1.15rem;
  color: var(--text);
  margin-top: var(--sp-lg);
  margin-bottom: var(--sp-sm);
}

.legal-body p { margin-bottom: var(--sp-sm); }

.legal-body ul {
  list-style: disc;
  padding-left: var(--sp-md);
  margin-bottom: var(--sp-sm);
  color: var(--text-muted);
}

.legal-body ul li { margin-bottom: 6px; font-size: 0.95rem; }

.legal-body a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ============================================================
   Entrance Animations — easeOutCubic, 500ms, 120ms stagger
   CSS-only: content is always visible (no JS dependency).
   ============================================================ */
@keyframes revealUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.reveal {
  animation: revealUp 500ms cubic-bezier(0.33, 1, 0.68, 1) both;
}

.reveal-delay-1 { animation-delay: 120ms; }
.reveal-delay-2 { animation-delay: 240ms; }
.reveal-delay-3 { animation-delay: 360ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; }
}

/* ============================================================
   Responsive
   ============================================================ */
/* ── Tablet: stack screenshot rows before they get too cramped ── */
@media (max-width: 900px) {
  .daily-body-row,
  .level-body-row,
  .streaks-body-row {
    flex-direction: column;
    gap: var(--sp-md);
  }

  /* Level Play: image goes above text on tablet/mobile */
  .level-body-row { flex-direction: column; }

  .daily-leaderboard-img,
  .level-play-img,
  .streaks-profile-img {
    width: 100%;
    max-width: 420px;
  }

  /* Daily game image stays natural order (text above, image below on mobile
     is fine since the text introduces it); level play image stays on top */
}

@media (max-width: 700px) {
  :root {
    --sp-lg:  48px;
    --sp-xl:  72px;
    --sp-2xl: 100px;
  }

  .section-hero { margin: 32px 12px 0; border-radius: 14px; }
  .section-cta  { border-radius: 14px; margin: 32px 12px; }

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

  .pricing-grid { grid-template-columns: 1fr; max-width: 100%; }

  .footer-inner { flex-direction: column; align-items: flex-start; gap: var(--sp-sm); }
  .footer-logo { margin-right: 0; }
  .footer-nav { flex-direction: column; gap: 10px; }

  .section-cta { text-align: left; }
  .section-cta .section-body { text-align: left; }
  .section-cta .cta-actions { justify-content: flex-start; }

  .daily-leaderboard-img,
  .level-play-img,
  .streaks-profile-img {
    max-width: 100%;
  }

  .hero-fan { max-width: 100%; }

  .calm-features { max-width: 100%; }
}
