:root {
  --bg: #f3eee6;
  --bg-2: #e7e0d4;
  --card: #fbf7f1;
  --card-2: #fffdf9;
  --ink: #1c1915;
  --soft: #4d463e;
  --muted: #7a7268;
  --line: #d9d0c3;
  --accent: #9a4e32;
  --accent-2: #c46a45;
  --gold: #8a6a32;
  --good: #2f6b4f;
  --shadow: 0 18px 50px rgba(40, 28, 16, 0.08);
  --radius: 18px;
  --font: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
  --display: "Fraunces", "Iowan Old Style", Palatino, Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #07080c;
  --bg-2: #0c0e14;
  --card: #10131b;
  --card-2: #161a24;
  --ink: #ece6db;
  --soft: #c9c1b4;
  --muted: #8f877c;
  --line: #262b36;
  --accent: #d48462;
  --accent-2: #e0a07a;
  --gold: #d7b56a;
  --good: #8dccab;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(900px 420px at 80% -10%, color-mix(in srgb, var(--gold) 12%, transparent), transparent 60%),
    radial-gradient(700px 380px at -10% 20%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input { font: inherit; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }

.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.kicker {
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 10px;
}
h1, h2, h3, .display { font-family: var(--display); font-weight: 520; letter-spacing: -0.03em; line-height: 1.05; }
h1 { font-size: clamp(46px, 7vw, 84px); margin: 0; }
h2 { font-size: clamp(34px, 5vw, 56px); margin: 0 0 14px; }
h3 { font-size: 28px; margin: 0 0 8px; }
.lede { color: var(--soft); font-size: 18px; max-width: 62ch; }

.nav {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-size: 22px; }
.mark {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1.5px solid var(--gold);
  display: grid; place-items: center;
  font-size: 12px; color: var(--gold);
}
.nav-links { display: flex; gap: 18px; align-items: center; }
.nav-links a { text-decoration: none; color: var(--muted); font-size: 14px; }
.nav-links a:hover { color: var(--ink); }
.icon-btn, .btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  cursor: pointer;
}
.icon-btn { width: 40px; height: 40px; }
.btn {
  padding: 12px 18px;
  background: var(--accent);
  color: #1a100c;
  border-color: transparent;
  font-weight: 650;
}
:root[data-theme="light"] .btn, :root:not([data-theme="dark"]) .btn { color: #fffaf6; }
:root[data-theme="dark"] .btn { color: #1a100c; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn:hover { transform: translateY(-1px); }

.hero { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 42px; align-items: center; padding: 54px 0 20px; }
.hero-copy p { color: var(--soft); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0; }
.chip {
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px;
  font-size: 13px; color: var(--soft); background: color-mix(in srgb, var(--card) 80%, transparent);
}
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 22px; }
.stat, .card, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.stat { padding: 14px; }
.stat b { display: block; font-family: var(--display); font-size: 30px; color: var(--accent); }
.stat span { color: var(--muted); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.hero-visual { position: relative; }
.hero-visual img, .frame img { width: 100%; height: 100%; object-fit: cover; border-radius: 24px; }
.hero-visual img { aspect-ratio: 4/3; border: 1px solid var(--line); }
.orbit {
  position: absolute; inset: -14px; border-radius: 28px;
  border: 1px dashed color-mix(in srgb, var(--gold) 55%, transparent);
  animation: spin 36s linear infinite;
  pointer-events: none;
}
.badge {
  position: absolute; left: 16px; bottom: 16px;
  background: color-mix(in srgb, var(--bg) 82%, black);
  border: 1px solid var(--line);
  border-radius: 14px; padding: 10px 12px; font-size: 13px;
}

section { padding: 72px 0; }
.section-head { max-width: 680px; margin-bottom: 28px; }

.picker-card { padding: 22px; }
.wheels { display: grid; grid-template-columns: 1.3fr 0.7fr 0.9fr; gap: 12px; }
.wheel {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 250px;
}
.wheel-label { text-align: center; color: var(--muted); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; padding: 6px 0; }
.wheel-window { position: relative; overflow: hidden; height: 176px; }
.wheel-shade {
  pointer-events: none; position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(var(--bg-2), transparent 28%, transparent 72%, var(--bg-2));
}
.wheel-band {
  pointer-events: none; position: absolute; left: 8px; right: 8px; top: 66px; height: 44px; z-index: 1;
  border-radius: 10px; border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.wheel-track { position: absolute; left: 0; right: 0; top: 66px; will-change: transform; }
.wheel-item {
  height: 44px; display: grid; place-items: center;
  color: var(--muted); cursor: pointer; user-select: none;
  font-family: var(--display); font-size: 20px;
}
.wheel-item.on { color: var(--ink); font-weight: 620; }
.wheel-arrow {
  border: 0; background: transparent; color: var(--soft); cursor: pointer; height: 28px; border-radius: 8px;
}
.wheel-arrow:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--ink); }
.dob-line { text-align: center; margin: 14px 0 4px; font-family: var(--display); font-size: 26px; }
.hint { text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.error { color: var(--accent); text-align: center; min-height: 1.2em; }

.result { margin-top: 22px; display: none; }
.result.show { display: block; animation: rise 0.55s ease both; }
.result-grid, .split, .trio, .month-grid, .timeline { display: grid; gap: 14px; }
.result-grid, .split { grid-template-columns: 1fr 1fr; }
.trio { grid-template-columns: repeat(3, 1fr); margin-top: 14px; }
.panel { padding: 20px; }
.big {
  font-family: var(--display); font-size: clamp(52px, 7vw, 78px); line-height: 0.9; margin: 6px 0;
}
.accent { color: var(--accent); }
.gold { color: var(--gold); }
.muted { color: var(--muted); }
.yearbar { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; margin-top: 12px; }
.yearbar i {
  display: block; text-align: center; font-style: normal; font-size: 11px;
  padding: 8px 2px; border-radius: 8px; border: 1px solid var(--line); color: var(--muted);
}
.yearbar i.done { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--ink); }
.yearbar i.now { background: var(--accent); color: #1a100c; border-color: transparent; }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.month-row, .name-row {
  display: grid; grid-template-columns: 72px 1fr auto; gap: 10px; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px;
}
.struck { opacity: 0.72; }
.struck .tag { color: var(--accent); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.media-split { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 22px; align-items: center; }
.frame { border-radius: 24px; overflow: hidden; border: 1px solid var(--line); }
.frame img { aspect-ratio: 4/3; }
.frame.tall img { aspect-ratio: 3/4; }

.month-grid { grid-template-columns: repeat(2, 1fr); }
.month-card { padding: 18px; }
.month-card header { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.latin { color: var(--gold); font-family: var(--display); font-style: italic; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.fact { padding: 16px; background: var(--card-2); border: 1px solid var(--line); border-radius: 16px; }
.fact b { display: block; font-family: var(--display); font-size: 22px; margin-bottom: 6px; }

.timeline { grid-template-columns: 1fr; }
.event { display: grid; grid-template-columns: 140px 1fr; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.quote {
  margin-top: 22px; padding: 22px; border-left: 3px solid var(--accent);
  background: var(--card); border-radius: 0 16px 16px 0;
  font-family: var(--display); font-size: 26px; line-height: 1.25;
}

footer { border-top: 1px solid var(--line); padding: 36px 0 48px; color: var(--muted); font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 18px; }

.reveal { opacity: 0; transform: translateY(16px); animation: rise 0.7s ease forwards; }
.d1 { animation-delay: 0.08s; } .d2 { animation-delay: 0.16s; } .d3 { animation-delay: 0.24s; }
.rise-in { opacity: 0; transform: translateY(18px); }
.rise-in.in { animation: rise 0.7s ease forwards; }

@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 860px) {
  .hero, .compare, .media-split, .result-grid, .split, .month-grid, .footer-grid, .facts { grid-template-columns: 1fr; }
  .stats, .trio { grid-template-columns: 1fr 1fr; }
  .nav-links a { display: none; }
  .event { grid-template-columns: 1fr; gap: 4px; }
  .wheels { grid-template-columns: 1fr; }
  .wheel { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .rise-in { opacity: 1; transform: none; }
}
