/* Boardgammon landing — tokens from design/design-foundations.md */

:root {
  --bg-surface: #F8F1E5;
  --bg-surface-elevated: #FFFFFF;
  --bg-surface-muted: #EFE5D2;
  --ink-primary: #2A1810;
  --ink-secondary: #5C4934;
  --ink-tertiary: #8A7560;
  --brand-primary: #6B4226;
  --brand-primary-hover: #5A3720;
  --brand-accent: #B8860B;
  --divider: #DBC9AB;
  --shadow-soft: rgba(42, 24, 16, 0.10);
  --shadow-strong: rgba(42, 24, 16, 0.20);

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 80px;

  --font-serif: 'Lora', Georgia, 'Times New Roman', serif;
  --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-surface: #1A1108;
    --bg-surface-elevated: #2A1C12;
    --bg-surface-muted: #3A2B1F;
    --ink-primary: #F0E4D0;
    --ink-secondary: #C9B89C;
    --ink-tertiary: #957E61;
    --brand-primary: #C19A6B;
    --brand-primary-hover: #A78758;
    --brand-accent: #D4AF37;
    --divider: #4A382A;
    --shadow-soft: rgba(0, 0, 0, 0.40);
    --shadow-strong: rgba(0, 0, 0, 0.65);
  }
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink-primary);
  background: var(--bg-surface);
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(184, 134, 11, 0.05) 0%, transparent 60%),
    radial-gradient(ellipse 80% 50% at 50% 100%, rgba(107, 66, 38, 0.06) 0%, transparent 60%);
  pointer-events: none;
  z-index: -1;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-md);
  background: var(--ink-primary);
  color: var(--bg-surface);
  padding: var(--space-sm) var(--space-md);
  border-radius: 4px;
  text-decoration: none;
  font-size: 14px;
  z-index: 100;
  transition: top 0.15s ease;
}
.skip-link:focus { top: var(--space-md); outline: 2px solid var(--brand-accent); }

.topbar {
  display: flex;
  align-items: center;
  padding: var(--space-lg) var(--space-xl);
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.brand {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 600;
  font-size: 20px;
  color: var(--ink-primary);
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: color 0.15s ease;
}
.brand:hover { color: var(--brand-primary); }

.hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl) var(--space-xl);
}

.page-shell {
  flex: 1;
  padding: var(--space-lg) var(--space-xl) var(--space-3xl);
}

.message {
  max-width: 640px;
  width: 100%;
  text-align: center;
}

.wordmark {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(56px, 12vw, 120px);
  line-height: 1.0;
  letter-spacing: -0.025em;
  color: var(--brand-primary);
  margin-bottom: var(--space-2xl);
}

.tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(20px, 3vw, 28px);
  line-height: 1.35;
  color: var(--ink-primary);
  margin-bottom: var(--space-lg);
}

.subtagline {
  font-size: clamp(15px, 1.6vw, 17px);
  line-height: 1.6;
  color: var(--ink-secondary);
  max-width: 520px;
  margin: 0 auto var(--space-2xl);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px 14px;
  margin-bottom: var(--space-xl);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--divider);
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-secondary);
  letter-spacing: 0.02em;
  box-shadow: 0 1px 2px var(--shadow-soft);
}
.status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-accent);
  flex-shrink: 0;
  animation: pulse 2.5s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0   rgba(184, 134, 11, 0.45); }
  70%  { box-shadow: 0 0 0 10px rgba(184, 134, 11, 0); }
  100% { box-shadow: 0 0 0 0   rgba(184, 134, 11, 0); }
}

.cta {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  background: var(--brand-primary);
  color: #FFFFFA;
  border: 1px solid var(--brand-primary);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 2px var(--shadow-soft), 0 4px 14px var(--shadow-soft);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.btn-primary:hover {
  background: var(--brand-primary-hover);
  border-color: var(--brand-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px var(--shadow-soft), 0 8px 24px var(--shadow-strong);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 3px;
}

.foot {
  text-align: center;
  padding: var(--space-xl);
  font-size: 13px;
  color: var(--ink-tertiary);
  border-top: 1px solid var(--divider);
}
.foot a {
  color: var(--ink-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}
.foot a:hover { color: var(--brand-accent); }
.foot .sep { margin: 0 var(--space-sm); color: var(--ink-tertiary); }

.legal-article {
  max-width: 860px;
  margin: 0 auto;
}

.legal-header {
  padding: var(--space-lg) 0 var(--space-xl);
  border-bottom: 1px solid var(--divider);
  margin-bottom: var(--space-xl);
}

.legal-eyebrow {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-tertiary);
  margin-bottom: var(--space-sm);
}

.legal-header h1 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(36px, 6vw, 56px);
  line-height: 1.08;
  color: var(--brand-primary);
  margin-bottom: var(--space-md);
}

.legal-meta {
  font-size: 14px;
  color: var(--ink-tertiary);
  margin-bottom: var(--space-lg);
}

.legal-intro {
  max-width: 720px;
  color: var(--ink-secondary);
  font-size: 17px;
  line-height: 1.7;
  margin-bottom: var(--space-lg);
}

.legal-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  font-size: 14px;
}

.legal-jump a,
.legal-section a {
  color: var(--brand-primary);
  text-decoration: underline;
  text-decoration-color: rgba(107, 66, 38, 0.25);
  text-underline-offset: 3px;
}

.legal-jump a:hover,
.legal-section a:hover {
  color: var(--brand-primary-hover);
}

.legal-section {
  padding: var(--space-xl) 0;
  border-bottom: 1px solid var(--divider);
}

.legal-section:last-child {
  border-bottom: 0;
}

.legal-section h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 28px;
  line-height: 1.2;
  margin-bottom: var(--space-md);
}

.legal-section h3 {
  font-size: 18px;
  font-weight: 600;
  margin: var(--space-lg) 0 var(--space-sm);
}

.legal-section p {
  color: var(--ink-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-md);
}

.legal-list {
  padding-left: 20px;
  color: var(--ink-secondary);
  line-height: 1.7;
}

.legal-list li + li {
  margin-top: var(--space-sm);
}

.legal-list-numbered {
  list-style: decimal;
}

.legal-note {
  font-size: 14px;
  color: var(--ink-tertiary);
}

.legal-note code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 13px;
}

/* ─────────────────────────────────────────────────────────────────────
   Home landing — hero, benefits, social proof, download/waitlist.
   Reuses the warm-walnut tokens above; every value is a var() so dark
   mode flips automatically.
   ───────────────────────────────────────────────────────────────────── */

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-accent);
  font-weight: 600;
  margin-bottom: var(--space-md);
}

/* Top bar with nav (home only) */
.topbar--home {
  justify-content: space-between;
  max-width: 1140px;
}
.topnav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}
.topnav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}
.topnav-link:hover { color: var(--brand-primary); }
.topnav-cta {
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-primary);
  text-decoration: none;
  padding: 8px 16px;
  border: 1px solid var(--divider);
  border-radius: 999px;
  background: var(--bg-surface-elevated);
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.topnav-cta:hover {
  border-color: var(--brand-accent);
  color: var(--brand-primary-hover);
  transform: translateY(-1px);
}
@media (max-width: 560px) {
  .topnav-link { display: none; }
}

/* Hero */
.hero--home {
  min-height: calc(100svh - 88px);
  align-items: center;
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-3xl);
}
.hero-grid {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: var(--space-3xl);
}
.hero-copy { max-width: 560px; }
.hero--home .wordmark {
  font-size: clamp(46px, 7vw, 86px);
  margin-bottom: var(--space-sm);
}
.hero-copy .tagline { margin-bottom: var(--space-md); }
.hero-copy .subtagline { margin: 0 0 var(--space-lg); max-width: 520px; }

/* Live presence pill */
.presence {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 7px 15px;
  margin-bottom: var(--space-xl);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--divider);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-secondary);
  letter-spacing: 0.01em;
  box-shadow: 0 1px 2px var(--shadow-soft);
}
.presence__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3Fae6f;
  flex-shrink: 0;
  animation: pulse-live 2.4s ease-out infinite;
}
.presence[data-state="loading"] .presence__dot,
.presence[data-state="idle"] .presence__dot { background: var(--ink-tertiary); animation: none; }
@keyframes pulse-live {
  0%   { box-shadow: 0 0 0 0   rgba(63, 174, 111, 0.5); }
  70%  { box-shadow: 0 0 0 9px rgba(63, 174, 111, 0); }
  100% { box-shadow: 0 0 0 0   rgba(63, 174, 111, 0); }
}

.cta-row {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 26px;
  background: transparent;
  color: var(--brand-primary);
  border: 1px solid var(--divider);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.btn-secondary:hover {
  border-color: var(--brand-accent);
  color: var(--brand-primary-hover);
  background: var(--bg-surface-elevated);
  transform: translateY(-1px);
}
.btn-secondary:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 3px; }

/* Hero visual — local board.svg in a walnut frame */
.hero-visual { display: flex; justify-content: center; }
.board-frame {
  position: relative;
  width: 100%;
  max-width: 340px;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(160deg, var(--bg-surface-elevated), var(--bg-surface-muted));
  border: 1px solid var(--divider);
  box-shadow: 0 2px 6px var(--shadow-soft), 0 24px 60px var(--shadow-strong);
  transform: rotate(-1.2deg);
}
.board-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 9px;
  box-shadow: 0 1px 3px var(--shadow-strong);
}
.board-glint {
  position: absolute;
  inset: 14px;
  border-radius: 9px;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,0.18) 0%, transparent 38%);
}

/* Trust strip */
.trust-strip {
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
  background: var(--bg-surface-elevated);
}
.trust-list {
  list-style: none;
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--space-md) var(--space-xl);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md) var(--space-2xl);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-secondary);
}
.trust-list li { display: inline-flex; align-items: center; gap: 8px; }
.trust-mark { color: var(--brand-accent); font-size: 11px; }

/* Generic content section */
.section { padding: var(--space-3xl) var(--space-xl); }
.section--muted { background: var(--bg-surface-elevated); }
.section-inner { max-width: 1100px; margin: 0 auto; }
.section-inner--narrow { max-width: 640px; }
.section-head { max-width: 680px; margin: 0 auto var(--space-2xl); text-align: center; }
.section-head h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15;
  color: var(--brand-primary);
  margin-bottom: var(--space-md);
}
.section-sub {
  font-size: clamp(15px, 1.6vw, 17px);
  line-height: 1.6;
  color: var(--ink-secondary);
}

/* Benefits */
.benefits {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}
.benefit {
  padding: var(--space-xl);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--divider);
  border-radius: 16px;
  box-shadow: 0 1px 2px var(--shadow-soft);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.benefit:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px var(--shadow-soft), 0 12px 32px var(--shadow-soft);
  border-color: var(--brand-accent);
}
.benefit-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: var(--space-md);
  border-radius: 14px;
  background: var(--bg-surface-muted);
  color: var(--brand-primary);
}
.benefit h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 21px;
  color: var(--ink-primary);
  margin-bottom: var(--space-sm);
}
.benefit p { color: var(--ink-secondary); line-height: 1.65; font-size: 15px; }
.benefit em { font-style: italic; color: var(--ink-primary); }

/* Social proof / trust */
.quote {
  max-width: 760px;
  margin: 0 auto var(--space-2xl);
  text-align: center;
}
.quote blockquote {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(19px, 2.4vw, 26px);
  line-height: 1.45;
  color: var(--ink-primary);
}
.quote figcaption {
  margin-top: var(--space-md);
  font-size: 14px;
  color: var(--ink-tertiary);
  letter-spacing: 0.02em;
}
.proof-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}
.proof-card {
  text-align: center;
  padding: var(--space-lg) var(--space-md);
  background: var(--bg-surface);
  border: 1px solid var(--divider);
  border-radius: 14px;
}
.proof-stat {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(22px, 3vw, 30px);
  color: var(--brand-primary);
  line-height: 1.1;
  margin-bottom: 6px;
}
.proof-label { font-size: 13px; line-height: 1.45; color: var(--ink-secondary); }

/* Download / store badges / waitlist */
.download { text-align: center; }
.store-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}
.store-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  min-width: 200px;
  background: #1A1108;
  color: #F0E4D0;
  border: 1px solid rgba(184, 134, 11, 0.4);
  border-radius: 12px;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.store-badge:hover {
  transform: translateY(-2px);
  border-color: var(--brand-accent);
  box-shadow: 0 8px 24px var(--shadow-strong);
}
.store-badge:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 3px; }
/* UA-aware emphasis: the matching platform's store is floated first and ringed
   (set on the invite / referral landings when a mobile platform is detected). */
.store-badge--primary {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 2px rgba(184, 134, 11, 0.35), 0 8px 24px var(--shadow-strong);
}
.store-badge__logo { flex-shrink: 0; }
.store-badge__text { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.store-badge__top { font-size: 11px; letter-spacing: 0.02em; opacity: 0.85; }
.store-badge__name { font-size: 18px; font-weight: 600; }
.store-badge.is-pending::after {
  content: "Soon";
  position: absolute;
  top: -8px;
  right: -8px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1A1108;
  background: var(--brand-accent);
  border-radius: 999px;
}
.store-note {
  font-size: 13px;
  color: var(--ink-tertiary);
  margin-bottom: var(--space-2xl);
}

.waitlist {
  max-width: 480px;
  margin: 0 auto;
  text-align: left;
}
.field-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-primary);
  margin-bottom: var(--space-sm);
}
.field-row { display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.field {
  flex: 1 1 220px;
  min-width: 0;
  padding: 13px 16px;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink-primary);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--divider);
  border-radius: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field::placeholder { color: var(--ink-tertiary); }
.field:focus {
  outline: none;
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.18);
}
.waitlist .btn-primary { flex: 0 0 auto; }
.form-status {
  min-height: 20px;
  margin-top: var(--space-sm);
  font-size: 14px;
  color: var(--ink-secondary);
}
.form-status--ok { color: #2f8f5b; font-weight: 500; }
.form-status--error, .form-status--error-soft { color: #b5503f; }
.form-status--pending { color: var(--ink-tertiary); }
.form-status a { color: var(--brand-primary); text-decoration: underline; text-underline-offset: 3px; }

/* Home responsive */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--space-2xl); text-align: center; }
  .hero-copy { max-width: 600px; margin: 0 auto; }
  .hero-copy .subtagline { margin-left: auto; margin-right: auto; }
  .cta-row { justify-content: center; }
  .hero-visual { order: -1; }
  .board-frame { max-width: 300px; }
  .benefits { grid-template-columns: 1fr; }
  .proof-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .topbar { padding: var(--space-md) var(--space-lg); }
  .hero { padding: var(--space-lg) var(--space-md); }
  .page-shell { padding: var(--space-md) var(--space-lg) var(--space-2xl); }
  .wordmark { margin-bottom: var(--space-xl); }
  .subtagline { margin-bottom: var(--space-xl); }
  .legal-header h1 { margin-bottom: var(--space-sm); }
  .legal-jump { flex-direction: column; gap: var(--space-sm); }
  .hero--home { min-height: 0; padding-top: var(--space-xl); }
  .hero--home .wordmark { margin-bottom: var(--space-sm); }
  .section { padding: var(--space-2xl) var(--space-lg); }
  .waitlist .btn-primary { width: 100%; }
  .field { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
