/* VÆRA public site — shared design tokens, lifted directly from the app's
   own VaeraTheme.swift / Rarity+Display.swift / League.swift so the site
   reads as the same product, not a reskin. */
:root {
  color-scheme: light dark;

  --bg: #F5F5F6;
  --surface: #FFFFFF;
  --surface-elevated: #EFEFF1;

  --card-top: #1C1C1F;
  --card-bottom: #08080A;

  --text-primary: #111113;
  --text-secondary: #6B6B70;
  --text-tertiary: #A0A0A5;

  --accent: #3B82F6;
  --accent-soft: rgba(59, 130, 246, 0.12);

  --positive: #1F9254;
  --negative: #D64545;
  --warning: #C97A1E;

  --divider: rgba(0, 0, 0, 0.08);

  --rarity-common: #6B6B70;
  --rarity-uncommon: #1F9254;
  --rarity-rare: #3B82F6;
  --rarity-epic: #9B59F6;
  --rarity-legendary: #E8A93B;
  --rarity-mythic: #E23B6E;

  --league-bronze: #B87333;
  --league-silver: #B3B3B3;
  --league-gold: #D9A621;
  --league-emerald: #33BF73;
  --league-master: #994DE6;
  --league-champion: #F2598C;

  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-pill: 999px;

  --shadow-subtle: 0 6px 14px rgba(0, 0, 0, 0.16);
  --shadow-card: 0 12px 24px rgba(0, 0, 0, 0.28);

  --space-xxs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-xxl: 48px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E0E10;
    --surface: #1A1A1D;
    --surface-elevated: #222226;
    --text-primary: #F2F2F3;
    --text-secondary: #A0A0A8;
    --text-tertiary: #6B6B72;
    --divider: rgba(255, 255, 255, 0.1);
    --accent-soft: rgba(59, 130, 246, 0.18);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  z-index: 100;
}
.skip-link:focus { left: 24px; top: 24px; }

/* ---------- Nav ---------- */
.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(--divider);
}
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: 0.02em; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8.4px;
  background: linear-gradient(180deg, var(--card-top), var(--card-bottom));
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-subtle);
  flex-shrink: 0;
}
.brand-mark img { width: 16px; height: 16px; }

.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
  font-size: 14px; font-weight: 500; color: var(--text-secondary);
  transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--text-primary); }
.nav-cta { display: flex; align-items: center; gap: 12px; }

.nav-toggle { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  font-family: var(--font);
  font-size: 16px; font-weight: 600;
  padding: 14px 26px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--text-primary);
  color: var(--bg);
  box-shadow: var(--shadow-subtle);
}
.btn-primary:hover { opacity: 0.88; }
@media (prefers-color-scheme: dark) { .btn-primary { color: #0E0E10; } }
.btn-secondary {
  background: var(--surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--divider);
}
.btn-secondary:hover { background: var(--surface); }
.btn-sm { padding: 10px 20px; font-size: 14px; }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */
.hero {
  padding: 96px 0 64px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: var(--surface-elevated);
  border: 1px solid var(--divider);
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  margin-bottom: 24px;
}
.hero h1 {
  font-size: clamp(34px, 5.2vw, 58px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 20px;
}
.hero p.lede {
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 46ch;
  margin: 0 0 32px;
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 20px; }
.hero-note { font-size: 13px; color: var(--text-tertiary); }

/* ---------- Manifesto ---------- */
.manifesto {
  padding: 12px 0 88px;
}
.manifesto blockquote {
  margin: 0;
  padding: 44px clamp(20px, 5vw, 64px);
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg, var(--card-top), var(--card-bottom));
  color: #fff;
  text-align: center;
  box-shadow: var(--shadow-card);
}
.manifesto p {
  font-size: clamp(19px, 2.6vw, 27px);
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}
.manifesto p:last-child { margin-bottom: 0; color: rgba(255,255,255,0.55); font-weight: 700; }

/* ---------- Focus card mock ---------- */
.card-mock {
  position: relative;
  aspect-ratio: 1.586 / 1;
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg, var(--card-top), var(--card-bottom));
  box-shadow: var(--shadow-card);
  padding: clamp(20px, 3.2vw, 30px);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.card-mock::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 15% -10%, rgba(255,255,255,0.10), transparent 55%);
  pointer-events: none;
}
.card-mock-top { display: flex; align-items: flex-start; justify-content: space-between; }
.card-mock-label { font-size: 12px; font-weight: 600; letter-spacing: 0.1em; color: rgba(255,255,255,0.65); text-transform: uppercase; }
.card-mock-mark { width: 26px; height: 26px; opacity: 0.95; }
.card-mock-balance { font-size: clamp(30px, 4.4vw, 42px); font-weight: 800; letter-spacing: -0.02em; }
.card-mock-balance small { font-size: 0.4em; font-weight: 600; color: rgba(255,255,255,0.55); margin-left: 6px; }
.card-mock-bottom { display: flex; align-items: flex-end; justify-content: space-between; }
.card-mock-id { font-size: 12px; letter-spacing: 0.08em; color: rgba(255,255,255,0.4); font-variant-numeric: tabular-nums; }
.card-mock-wordmark { font-size: 13px; font-weight: 800; letter-spacing: 0.16em; color: rgba(255,255,255,0.85); }

/* ---------- Section scaffolding ---------- */
section { padding: 88px 0; }
.section-head { max-width: 640px; margin: 0 0 48px; }
.section-kicker {
  font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 12px;
}
.section-head h2 {
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
  line-height: 1.15;
}
.section-head p {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}
.section-alt { background: var(--surface); border-top: 1px solid var(--divider); border-bottom: 1px solid var(--divider); }

/* ---------- Loop diagram ---------- */
.loop {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  align-items: stretch;
}
.loop-step {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--radius-md);
  padding: 20px 14px;
  text-align: center;
  box-shadow: var(--shadow-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
}
.loop-step .n {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.loop-step .label { font-size: 13px; font-weight: 700; letter-spacing: 0.02em; }
.loop-arrow {
  display: flex; align-items: center; justify-content: center;
  color: var(--text-tertiary); font-size: 18px;
}

/* ---------- Feature grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--radius-md);
  padding: 26px 24px;
  box-shadow: var(--shadow-subtle);
}
.feature-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--surface-elevated);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  font-size: 20px;
}
.feature-card h3 { font-size: 17px; font-weight: 700; margin: 0 0 8px; }
.feature-card p { font-size: 14px; line-height: 1.55; color: var(--text-secondary); margin: 0; }

/* ---------- Rankings ---------- */
.league-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.league-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 16px 10px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--divider);
  box-shadow: var(--shadow-subtle);
  font-size: 14px; font-weight: 700;
}
.league-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.league-chip .arrow { color: var(--text-tertiary); font-weight: 400; margin-left: 2px; }

.rankings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 12px;
}
.rankings-grid .feature-card { text-align: left; }

/* ---------- Rarity ---------- */
.rarity-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-top: 28px;
}
.rarity-chip {
  border-radius: var(--radius-md);
  padding: 20px 14px;
  text-align: center;
  border: 1px solid var(--divider);
  background: var(--surface);
}
.rarity-swatch {
  width: 100%; height: 6px; border-radius: 4px; margin-bottom: 14px;
}
.rarity-chip .name { font-size: 13px; font-weight: 700; }

/* ---------- Plus ---------- */
.plus-panel {
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg, var(--card-top), var(--card-bottom));
  color: #fff;
  padding: clamp(32px, 5vw, 56px);
  box-shadow: var(--shadow-card);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}
.plus-panel h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 800; margin: 0 0 12px; letter-spacing: -0.01em; }
.plus-panel > div > p { color: rgba(255,255,255,0.6); font-size: 15px; line-height: 1.6; margin: 0 0 28px; }
.plus-list { list-style: none; margin: 0 0 32px; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.plus-list li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: rgba(255,255,255,0.85); line-height: 1.5; }
.plus-list .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-top: 7px; flex-shrink: 0; }
.plus-panel .btn-primary { background: #fff; color: #0E0E10; }

/* ---------- Final CTA ---------- */
.final-cta { text-align: center; }
.final-cta h2 { font-size: clamp(26px, 3.6vw, 38px); font-weight: 800; margin: 0 0 16px; letter-spacing: -0.01em; }
.final-cta p { font-size: 16px; color: var(--text-secondary); max-width: 44ch; margin: 0 auto 32px; }
.final-cta .hero-ctas { justify-content: center; }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--divider);
  padding: 48px 0;
}
.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a { font-size: 14px; color: var(--text-secondary); }
.footer-links a:hover { color: var(--text-primary); }
.footer-copy { font-size: 13px; color: var(--text-tertiary); }

/* ---------- Support page ---------- */
.support-hero { text-align: center; padding: 88px 0 48px; }
.support-hero h1 { font-size: clamp(30px, 4.4vw, 44px); font-weight: 800; margin: 0 0 14px; letter-spacing: -0.01em; }
.support-hero p { font-size: 17px; color: var(--text-secondary); max-width: 52ch; margin: 0 auto; }

.faq-nav {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center;
  margin: 36px 0 0;
}
.faq-nav a {
  font-size: 13px; font-weight: 600;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  background: var(--surface-elevated);
  border: 1px solid var(--divider);
}
.faq-nav a:hover { background: var(--surface); }

.faq-category { padding: 48px 0; border-top: 1px solid var(--divider); }
.faq-category:first-of-type { border-top: none; }
.faq-category h2 {
  font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 24px;
}
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 22px;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .chev { color: var(--text-tertiary); transition: transform 0.2s ease; flex-shrink: 0; }
.faq-item[open] summary .chev { transform: rotate(45deg); }
.faq-item .faq-answer { padding: 0 22px 20px; font-size: 14px; line-height: 1.65; color: var(--text-secondary); }

.support-cta {
  text-align: center;
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg, var(--card-top), var(--card-bottom));
  color: #fff;
  padding: 56px 24px;
  box-shadow: var(--shadow-card);
  margin-top: 24px;
}
.support-cta h2 { font-size: clamp(22px, 3vw, 28px); font-weight: 800; margin: 0 0 12px; }
.support-cta p { color: rgba(255,255,255,0.6); font-size: 15px; margin: 0 0 28px; }
.support-cta .btn-primary { background: #fff; color: #0E0E10; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero { padding: 56px 0 40px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .rankings-grid { grid-template-columns: 1fr; }
  .loop { grid-template-columns: repeat(3, 1fr); }
  .loop-arrow.h-only { display: none; }
  .rarity-row { grid-template-columns: repeat(3, 1fr); }
  .plus-panel { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}

@media (max-width: 620px) {
  .wrap { padding: 0 20px; }
  section { padding: 64px 0; }
  .grid { grid-template-columns: 1fr; }
  .loop { grid-template-columns: 1fr; }
  .loop-arrow { transform: rotate(90deg); }
  .rarity-row { grid-template-columns: repeat(2, 1fr); }
  .hero-ctas .btn { width: 100%; }
  .hero-ctas { flex-direction: column; }
  .footer-row { flex-direction: column; align-items: flex-start; }
  .plus-list { gap: 12px; }
}
