/* Facedown — Web styles, mirroring the post-redesign app design language. */

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

:root {
  /* ── Core palette (mirrors FDColor in ios/Shared/Presentation/FDTokens.swift) ── */
  --bg: rgb(10, 9, 7);
  --bg-secondary: rgb(15, 13, 10);
  --card-bg: rgb(21, 18, 14);
  --card-bg-elevated: rgb(26, 22, 18);
  --card-border: rgba(255, 235, 209, 0.08);
  --card-border-strong: rgba(255, 235, 209, 0.14);

  --text-primary: rgb(245, 239, 230);
  --text-secondary: rgba(245, 239, 230, 0.72);
  --text-tertiary: rgba(245, 239, 230, 0.48);
  --text-quaternary: rgba(245, 239, 230, 0.28);

  /* Warm copper accents */
  --accent: rgb(200, 146, 112);
  --accent-soft: rgb(214, 163, 130);
  --amber: rgb(217, 168, 113);
  --copper-deep: rgb(153, 107, 71);

  /* Glow tokens used by the aurora background + button halos */
  --glow-copper: rgba(217, 145, 78, 0.55);
  --glow-gold:   rgba(243, 191, 96, 0.42);
  --glow-orange: rgba(238, 124, 56, 0.40);

  --max-width: 720px;
  --font-stack: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Iowan Old Style', 'Charter', Georgia, 'Times New Roman', serif;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-stack);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ── Aurora glow — copper/gold/orange radial halos, fixed behind content ── */

body::before,
body::after {
  content: '';
  position: fixed;
  pointer-events: none;
  z-index: -1;
  filter: blur(80px);
  will-change: transform;
}

/* Top copper glow — anchors the logo and hero */
body::before {
  top: -20vh;
  left: 50%;
  transform: translateX(-50%);
  width: 120vw;
  max-width: 1100px;
  height: 720px;
  background:
    radial-gradient(closest-side at 50% 30%, var(--glow-copper) 0%, transparent 70%),
    radial-gradient(closest-side at 30% 55%, var(--glow-orange) 0%, transparent 70%),
    radial-gradient(closest-side at 70% 60%, var(--glow-gold) 0%, transparent 70%);
  opacity: 0.85;
}

/* Lower amber tail — keeps the warmth flowing as you scroll */
body::after {
  top: 55vh;
  left: 50%;
  transform: translateX(-50%);
  width: 110vw;
  max-width: 1000px;
  height: 600px;
  background:
    radial-gradient(closest-side at 50% 50%, var(--glow-orange) 0%, transparent 75%),
    radial-gradient(closest-side at 25% 60%, var(--copper-deep) 0%, transparent 80%);
  opacity: 0.45;
}

/* Faint vignette to settle everything into the dark base */
body > .container::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(120% 80% at 50% 0%, transparent 0%, rgba(10, 9, 7, 0.55) 60%, var(--bg) 100%);
  pointer-events: none;
}

/* ── Layout ── */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px 24px;
}

/* ── Logo header — centered, with glow ── */

.logo-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 0 8px;
}

.logo-header img {
  width: 112px;
  height: auto;
  display: block;
  filter: drop-shadow(0 10px 36px rgba(217, 145, 78, 0.6))
          drop-shadow(0 3px 10px rgba(238, 124, 56, 0.45));
}

.logo-header a {
  display: inline-block;
  line-height: 0;
}

/* ── Brand wordmark ── */

.brand {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  background: linear-gradient(180deg, rgb(232, 184, 130) 0%, rgb(200, 146, 112) 65%, rgb(170, 118, 84) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--accent); /* fallback */
}

/* ── Back link ── */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  margin-bottom: 32px;
  transition: opacity 0.2s ease;
}

.back-link:hover { opacity: 0.75; }

.back-link svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* ── Landing hero ── */

.hero {
  text-align: center;
  padding: 32px 0 48px;
}

.hero-eyebrow {
  display: inline-block;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.875rem;
  color: var(--text-tertiary);
  letter-spacing: 0.2px;
  margin-bottom: 14px;
}

.hero-brand {
  font-size: 3.25rem;
  margin-bottom: 18px;
  letter-spacing: -0.5px;
  line-height: 1;
}

.hero-tagline {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text-primary);
  margin: 0 auto 28px;
  max-width: 520px;
  line-height: 1.3;
  letter-spacing: -0.2px;
}

.hero-tagline em {
  font-style: italic;
  color: var(--accent-soft);
}

.hero-description {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

/* ── Primary CTA — official Apple "Download on the App Store" badge ── */

.hero-cta { margin-top: 12px; }

.hero-cta a {
  display: inline-block;
  text-decoration: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.hero-cta a:hover { transform: translateY(-1px); opacity: 0.92; }
.hero-cta a:active { transform: translateY(0); }

.hero-cta img {
  display: block;
  width: 180px;
  height: auto;
}

/* ── How it works ── */

.how-it-works {
  margin-top: 32px;
  padding: 32px 28px;
  background: linear-gradient(180deg, var(--card-bg-elevated) 0%, var(--card-bg) 100%);
  border: 1px solid var(--card-border);
  border-radius: 22px;
  box-shadow:
    0 1px 0 rgba(255, 235, 209, 0.04) inset,
    0 24px 48px -24px rgba(0, 0, 0, 0.6);
}

.how-it-works h2 {
  font-family: var(--font-serif);
  font-size: 1.375rem;
  font-weight: 500;
  font-style: italic;
  text-align: center;
  margin-bottom: 28px;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.steps {
  list-style: none;
  counter-reset: step;
  max-width: 520px;
  margin: 0 auto;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 44px;
  margin-bottom: 22px;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.7;
}

.steps li:last-child { margin-bottom: 0; }

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(217, 145, 78, 0.18) 0%, rgba(153, 107, 71, 0.10) 100%);
  border: 1px solid var(--card-border-strong);
  color: var(--accent-soft);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(217, 145, 78, 0.18);
}

.steps li strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ── Legal pages ── */

.legal {
  background: linear-gradient(180deg, var(--card-bg-elevated) 0%, var(--card-bg) 100%);
  border: 1px solid var(--card-border);
  border-radius: 22px;
  padding: 40px 32px;
  margin-top: 24px;
  box-shadow:
    0 1px 0 rgba(255, 235, 209, 0.04) inset,
    0 24px 48px -24px rgba(0, 0, 0, 0.6);
}

.legal h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 500;
  font-style: italic;
  margin-bottom: 6px;
  color: var(--text-primary);
  letter-spacing: -0.4px;
}

.legal .effective-date {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  margin-bottom: 36px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.legal h2 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-top: 36px;
  margin-bottom: 12px;
  letter-spacing: -0.2px;
}

.legal p,
.legal ul {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-bottom: 16px;
  line-height: 1.75;
}

.legal ul { padding-left: 22px; }

.legal li {
  margin-bottom: 10px;
}

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

.legal a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(200, 146, 112, 0.3);
  transition: border-color 0.2s ease;
}

.legal a:hover { border-bottom-color: var(--accent); }

/* ── Footer ── */

footer {
  margin-top: 56px;
  padding-top: 28px;
  padding-bottom: 16px;
  text-align: center;
  border-top: 1px solid var(--card-border);
}

footer nav {
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

footer a {
  color: var(--text-tertiary);
  text-decoration: none;
  font-size: 0.8125rem;
  letter-spacing: 0.2px;
  transition: color 0.2s ease;
}

footer a:hover { color: var(--accent); }

footer .copyright {
  color: var(--text-quaternary);
  font-size: 0.75rem;
  letter-spacing: 0.3px;
}

/* ── Responsive ── */

@media (max-width: 480px) {
  .container { padding: 28px 20px 20px; }

  .logo-header { padding: 16px 0 4px; }
  .logo-header img { width: 92px; }

  .hero { padding: 20px 0 32px; }
  .hero-brand { font-size: 2.5rem; }
  .hero-tagline { font-size: 1.25rem; }

  .how-it-works { padding: 28px 22px; }
  .legal { padding: 32px 22px; }
  .legal h1 { font-size: 1.625rem; }

  body::before { height: 560px; filter: blur(60px); }
  body::after { height: 480px; filter: blur(60px); }
}

/* Honor reduced-motion: keep the page still, tone glow down a touch */
@media (prefers-reduced-motion: reduce) {
  body::before { opacity: 0.7; }
  body::after { opacity: 0.35; }
}
