@import url('tokens.css');

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
}

a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  color: var(--color-primary);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding-inline: 40px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 18px;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-mark {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--color-surface-dark);
  overflow: hidden;
  flex: none;
}
.logo-mark span {
  position: absolute;
  top: 6px;
  font: 800 24px/1 var(--font-body);
  letter-spacing: -2px;
}
.logo-mark span:first-child { left: 5px; color: var(--color-accent); }
.logo-mark span:last-child { left: 13px; color: var(--color-primary); mix-blend-mode: screen; }

.logo-text {
  font: 500 20px/1 var(--font-display);
  color: var(--color-text);
}

.site-nav {
  display: flex;
  gap: 32px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-muted);
  flex-wrap: wrap;
}

/* Base (desktop) state — must come before the mobile media query below,
   not after: an unguarded rule placed later in the file wins the cascade
   over an earlier media-query rule regardless of which actually matches
   the current viewport. (This is also why the nav links didn't show up
   in the dropdown the first time — the other copy of this rule, further
   down near .avatar-dropdown, was silently overriding the one below.) */
.dropdown-site-nav {
  display: none;
}

/* Same ordering requirement as .dropdown-site-nav above — base state
   before the media query, not after. */
.mobile-sign-in {
  display: none;
}

@media (max-width: 640px) {
  /* Nav always lives behind a toggle on mobile now — the hamburger
     (anonymous) or the avatar dropdown (logged in), never inline. */
  .site-nav {
    display: none;
  }
  .nav-toggle-wrap {
    display: block;
    position: relative;
  }
  .dropdown-site-nav {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 6px;
    padding-bottom: 6px;
  }
  /* Logo + hamburger + Sign in + Get my score don't fit on one row at
     phone width — Sign in moves into the hamburger's dropdown instead
     (see .mobile-sign-in below), "Get my score" is the one CTA that
     needs to stay visible inline. */
  .header-actions .btn-nav {
    display: none;
  }
  .mobile-sign-in {
    display: block;
  }
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Hidden on desktop (.site-nav shows inline there) — the mobile media
   query above flips this to display:block. */
.nav-toggle-wrap {
  display: none;
}

.nav-toggle {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: none;
  background: var(--color-bg);
  color: var(--color-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-menu {
  position: relative;
}

.avatar-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: none;
  background: var(--color-surface-dark);
  color: var(--color-text-inverse);
  font: 700 13px var(--font-body);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: none;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  padding: 6px;
}

.avatar-dropdown a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-text);
}

.avatar-dropdown a:hover {
  background: var(--color-bg);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  font-weight: 800;
  text-align: center;
  transition: background-color 0.15s ease;
}

.btn-nav {
  font-size: 14px;
  font-weight: 600;
  padding: 10px 14px;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  font-size: 17px;
  padding: 18px 34px;
}
.btn-primary:hover {
  background: var(--color-primary-hover);
  color: #fff;
}

.btn-dark {
  background: var(--color-surface-dark);
  color: var(--color-text-inverse);
  font-size: 14px;
  font-weight: 700;
  padding: 10px 18px;
}
.btn-dark:hover {
  background: var(--color-surface-dark-card);
  color: var(--color-text-inverse);
}

/* ---------- Hero ---------- */

.hero {
  padding: 96px 40px 80px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
}

.kicker {
  font: 500 12px/1 var(--font-mono);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-primary);
}
.kicker.on-dark {
  color: var(--color-accent);
}

.hero h1 {
  margin: 0;
  max-width: 860px;
  font: 400 clamp(40px, 6vw, 72px) / 1.05 var(--font-display);
  letter-spacing: -1.5px;
  text-wrap: pretty;
}
.hero h1 em {
  color: var(--color-primary);
}

.hero-subhead {
  margin: 0;
  max-width: 600px;
  font-size: 19px;
  line-height: 1.55;
  color: var(--color-muted);
  text-wrap: pretty;
}

.hero-fineprint {
  font-size: 13px;
  color: var(--color-muted);
}

/* ---------- Score card ---------- */

.score-card {
  margin-top: 36px;
  width: 100%;
  max-width: 560px;
  padding: 28px 32px;
  border-radius: var(--radius-lg);
  background: var(--color-surface-dark);
  color: var(--color-text-inverse);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 24px;
  align-items: end;
  text-align: left;
  box-shadow: 0 30px 60px -30px rgba(11, 18, 32, 0.5);
}

.score-card .label {
  font: 500 11px/1 var(--font-mono);
  letter-spacing: 2px;
  color: var(--color-accent);
}
.score-card .label.muted {
  color: rgba(248, 250, 252, 0.6);
}

.score-card .score {
  font: 400 72px/1 var(--font-display);
  letter-spacing: -2px;
}

.score-card .level {
  font: 400 56px/1 var(--font-display);
  color: var(--color-accent);
}

.score-card .meta {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(248, 250, 252, 0.12);
  font-size: 13px;
  color: rgba(248, 250, 252, 0.7);
  flex-wrap: wrap;
  gap: 8px;
}
.score-card .meta strong.success { color: var(--color-success); }
.score-card .meta strong { color: var(--color-text-inverse); }

/* ---------- Section shells ---------- */

.section {
  padding: 88px 40px;
  scroll-margin-top: 80px;
}
.section.on-white {
  background: #fff;
  border-top: 1px solid var(--color-border);
}
.section.on-dark {
  background: var(--color-surface-dark);
  color: var(--color-text-inverse);
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 56px;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
}

.section-intro {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.section-intro h1,
.section-intro h2 {
  margin: 0;
  font: 400 clamp(32px, 4vw, 46px) / 1.1 var(--font-display);
  letter-spacing: -1px;
  text-wrap: pretty;
}

.section-intro p {
  margin: 0;
  font-size: 17px;
  line-height: 1.6;
  color: var(--color-muted);
  text-wrap: pretty;
}
.on-dark .section-intro p {
  color: rgba(248, 250, 252, 0.7);
}

/* ---------- Feature list (Why section) ---------- */

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feature-item {
  padding: 24px;
  border-radius: var(--radius-md);
  background: var(--color-tint);
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.feature-item strong { display: block; margin-bottom: 4px; font-size: 17px; }
.feature-item span { font-size: 15px; line-height: 1.55; color: var(--color-muted); }

/* .feature-item span (above) has higher specificity than a bare
   .feature-num class, and this badge is itself a <span> — needs the
   parent-scoped selector below to actually win and stay white instead of
   being overridden to the muted grey meant for the description text. */
.feature-item .feature-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

/* ---------- Benefit cards (What you get) ---------- */

.benefit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.benefit-card {
  padding: 26px;
  border-radius: var(--radius-md);
  background: var(--color-surface-dark-card);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.benefit-card strong { font-size: 17px; }
.benefit-card > span,
.benefit-card p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: rgba(248, 250, 252, 0.72);
}

.benefit-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.benefit-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

/* Sits on .benefit-card's own blue-800 background — --color-accent's blue
   border/text barely contrasts against it (same bug as the app's .feat-card
   .badge). White reads clearly against the dark card instead. */
.premium-badge {
  font: 500 11px/1 var(--font-body);
  color: #fff;
  border: 1px solid #fff;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

/* ---------- Early access ---------- */

.early-access-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 48px;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.eyebrow-badge {
  align-self: flex-start;
  font: 500 11px/1 var(--font-mono);
  letter-spacing: 2px;
  padding: 7px 10px;
  border-radius: var(--radius-pill);
  background: var(--color-surface-dark);
  color: var(--color-accent);
}

.signup-card {
  padding: 36px;
  border-radius: var(--radius-lg);
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-md);
}

.checklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 15px;
  color: var(--color-muted);
}

.checklist-item {
  display: flex;
  gap: 12px;
  align-items: center;
}

.check-mark {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-success);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex: none;
}

/* ---------- Privacy ---------- */

.privacy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
}

.privacy-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.privacy-item strong { font-size: 16px; }
.privacy-item span { font-size: 14.5px; line-height: 1.55; color: var(--color-muted); }

/* ---------- Footer ---------- */

.site-footer {
  margin-top: auto;
  padding: 40px;
  border-top: 1px solid var(--color-border);
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  font-size: 13px;
  color: var(--color-muted);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.footer-brand .logo { color: var(--color-text); }
.footer-brand .logo-mark { width: 28px; height: 28px; }
.footer-brand .logo-mark span { font-size: 18px; top: 5px; }
.footer-brand .logo-mark span:first-child { left: 3px; }
.footer-brand .logo-mark span:last-child { left: 10px; }
.footer-brand .logo-text { font-size: 16px; }
.footer-brand p {
  margin: 0;
  max-width: 280px;
  line-height: 1.5;
}

.footer-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-column strong { color: var(--color-text); }

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
