:root {
  --ivory: #faf6ee;
  --paper: #ffffff;
  --ink: #1b1d24;
  --ink-soft: #4a4d58;
  --line: #e6dfd0;
  --gold: #b8862b;
  --gold-soft: #f3e6c8;
  --night: #14161c;
  --savant: #3d5afe;
  --fluent: #d9573b;
  --nicely: #1f7a5a;
  --radius: 14px;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font: 17px/1.65 "Inter", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: "Fraunces", Georgia, serif; font-weight: 600; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.4rem, 5.5vw, 4.2rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
em { font-style: italic; color: var(--gold); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(250, 246, 238, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: "Fraunces", Georgia, serif; font-weight: 700; font-size: 1.3rem; }
.logo-mark { width: 30px; height: 30px; }
.nav { display: flex; gap: 26px; align-items: center; }
.nav a { text-decoration: none; font-size: .95rem; color: var(--ink-soft); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav-toggle { display: none; background: none; border: 0; font-size: 1.6rem; cursor: pointer; color: var(--ink); }

/* Buttons */
.btn { display: inline-block; padding: 13px 24px; border-radius: 999px; background: var(--ink); color: var(--ivory); text-decoration: none; font-weight: 600; font-size: .95rem; border: 1px solid var(--ink); }
.btn:hover { background: #000; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--paper); }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

/* Sections */
section { padding: 88px 0; }
.kicker { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 700; color: var(--gold); margin-bottom: 14px; display: block; }
.lead { font-size: 1.2rem; color: var(--ink-soft); max-width: 680px; }
.hero { padding: 110px 0 90px; }
.hero h1 { max-width: 900px; }
.band { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.dark { background: var(--night); color: #ece8df; }
.dark .lead, .dark p { color: #bdb8ad; }
.dark h2, .dark h3 { color: #fff; }

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; }
.dark .card { background: #1e2028; border-color: #2c2f39; }
.card p:last-child { margin-bottom: 0; }
.card .num { font-family: "Fraunces", Georgia, serif; font-size: 2rem; color: var(--gold); line-height: 1; margin-bottom: 12px; display: block; }

/* Product cards */
.product { display: flex; flex-direction: column; text-decoration: none; transition: transform .15s, box-shadow .15s; border-top: 5px solid var(--accent, var(--gold)); }
.product:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(27, 29, 36, .08); }
.product .tag { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.product p { color: var(--ink-soft); flex: 1; }
.product .more { font-weight: 600; margin-top: 12px; }
.savant { --accent: var(--savant); }
.fluent { --accent: var(--fluent); }
.nicely { --accent: var(--nicely); }

/* Product page hero */
.p-hero { padding: 100px 0 70px; border-bottom: 1px solid var(--line); }
.p-hero .badge { display: inline-block; padding: 5px 12px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font-size: .82rem; font-weight: 600; color: var(--accent); margin-bottom: 18px; }
.p-hero h1 em { color: var(--accent); }
.p-hero .domain { color: var(--ink-soft); font-size: .95rem; margin-top: 18px; }

.science { border-left: 3px solid var(--accent, var(--gold)); padding: 4px 0 4px 18px; font-size: .95rem; color: var(--ink-soft); margin-top: 14px; }
.science strong { color: var(--ink); display: block; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 4px; }

.loop { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--paper); }
.loop > div { padding: 28px; border-right: 1px solid var(--line); }
.loop > div:last-child { border-right: 0; }
.loop .when { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }

.pull { font-family: "Fraunces", Georgia, serif; font-size: clamp(1.5rem, 3vw, 2.2rem); line-height: 1.3; max-width: 880px; }

.list-check { list-style: none; padding: 0; margin: 0; }
.list-check li { padding-left: 28px; position: relative; margin-bottom: 10px; }
.list-check li::before { content: "✓"; position: absolute; left: 0; color: var(--accent, var(--gold)); font-weight: 700; }

/* Legal pages */
.legal { padding: 70px 0 100px; }
.legal h1 { font-size: clamp(2rem, 4vw, 3rem); }
.legal h2 { font-size: 1.5rem; margin-top: 2.2em; }
.legal h3 { font-size: 1.1rem; margin-top: 1.6em; font-family: "Inter", system-ui, sans-serif; font-weight: 700; }
.legal ul { padding-left: 1.3em; }
.legal li { margin-bottom: .4em; }
.legal .updated { color: var(--ink-soft); font-size: .95rem; }
.legal table { width: 100%; border-collapse: collapse; margin: 1em 0 1.5em; font-size: .93rem; background: var(--paper); }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 10px 12px; border: 1px solid var(--line); }
.legal th { background: var(--gold-soft); }
.toc { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 26px; margin: 28px 0; }
.toc ol { margin: 0; padding-left: 1.2em; columns: 2; column-gap: 32px; }
.toc a { text-decoration: none; color: var(--ink-soft); }
.callout { background: var(--gold-soft); border-radius: var(--radius); padding: 20px 24px; margin: 1.5em 0; }

/* Footer */
.site-footer { background: var(--night); color: #a9a59b; padding: 64px 0 36px; font-size: .92rem; }
.site-footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.site-footer h4 { color: #fff; font-family: "Inter", system-ui, sans-serif; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 14px; }
.site-footer a { color: #a9a59b; text-decoration: none; display: block; margin-bottom: 8px; }
.site-footer a:hover { color: #fff; }
.site-footer .logo { color: #fff; margin-bottom: 12px; }
.site-footer .fine { border-top: 1px solid #2c2f39; margin-top: 44px; padding-top: 22px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .site-footer .cols { grid-template-columns: 1fr 1fr; }
  .loop { grid-template-columns: 1fr; }
  .loop > div { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 720px) {
  section { padding: 64px 0; }
  .hero { padding: 72px 0 60px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .nav { display: none; position: absolute; top: 68px; left: 0; right: 0; background: var(--ivory); flex-direction: column; align-items: flex-start; padding: 18px 24px; border-bottom: 1px solid var(--line); gap: 14px; }
  .nav.open { display: flex; }
  .nav-toggle { display: block; }
  .toc ol { columns: 1; }
  .site-footer .cols { grid-template-columns: 1fr; }
  .wrap { padding: 0 16px; }
}

/* Home hero map */
.hero-home { position: relative; overflow: hidden; padding: 120px 0 130px; }
.hero-home .wrap { position: relative; }
.hero-home h1 { max-width: 640px; }
.hero-home .lead { max-width: 540px; }
.hero-map { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-home::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, var(--ivory) 0, rgba(250, 246, 238, .9) 38%, rgba(250, 246, 238, 0) 62%); }
.hero-home .wrap { z-index: 2; }
.product .tag .dom { text-transform: none; letter-spacing: 0; font-weight: 600; opacity: .75; }
.route-draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: route 3.4s cubic-bezier(.45, 0, .25, 1) .5s forwards; }
.route-x { opacity: 0; transform-box: fill-box; transform-origin: center; animation: xmark .5s ease-out 3.8s forwards; }
@keyframes route { to { stroke-dashoffset: 0; } }
@keyframes xmark { from { opacity: 0; transform: scale(1.8); } to { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .route-draw { animation: none; stroke-dashoffset: 0; }
  .route-x { animation: none; opacity: 1; }
}
@media (max-width: 720px) {
  .hero-home { display: flex; flex-direction: column; padding-bottom: 0; }
  .hero-home::before { display: none; }
  .hero-home .hero-map { position: relative; order: 2; height: 300px; margin-top: 36px; }
}
