:root {
  --bg: 31 17% 8%;
  --panel: 32 17% 11%;
  --panel-2: 34 15% 15%;
  --ink: 42 34% 92%;
  --muted: 36 12% 66%;
  --line: 36 17% 23%;
  --sand: 40 96% 58%;
  --sand-light: 44 100% 70%;
  --ember: 21 82% 55%;
  --water: 191 62% 54%;
  --max: 1180px;
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: hsl(var(--ink));
  background:
    radial-gradient(circle at 10% -10%, hsl(var(--sand) / .12), transparent 30rem),
    radial-gradient(circle at 90% 10%, hsl(var(--ember) / .08), transparent 26rem),
    hsl(var(--bg));
  line-height: 1.65;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .17;
  background-image: linear-gradient(hsl(var(--line) / .35) 1px, transparent 1px), linear-gradient(90deg, hsl(var(--line) / .35) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

a { color: inherit; }
img { max-width: 100%; display: block; }
button { font: inherit; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 1rem;
  z-index: 20;
  background: hsl(var(--sand));
  color: hsl(var(--bg));
  padding: .65rem 1rem;
  border-radius: .5rem;
}
.skip-link:focus { left: 1rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid hsl(var(--line) / .8);
  background: hsl(var(--bg) / .88);
  backdrop-filter: blur(18px);
}

.nav-shell {
  width: min(var(--max), calc(100% - 2rem));
  min-height: 72px;
  margin: auto;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
  font-weight: 900;
  letter-spacing: .08em;
}
.brand-mark {
  width: 34px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid hsl(var(--sand) / .55);
  border-radius: 9px;
  color: hsl(var(--sand));
  background: hsl(var(--sand) / .08);
  box-shadow: inset 0 0 0 3px hsl(var(--bg));
}

.nav-links { display: flex; align-items: center; gap: .2rem; margin-left: auto; }
.nav-links a {
  padding: .55rem .8rem;
  color: hsl(var(--muted));
  text-decoration: none;
  border-radius: .5rem;
  font-size: .93rem;
  font-weight: 700;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] { color: hsl(var(--ink)); background: hsl(var(--panel-2)); }
.nav-links .nav-cta { color: hsl(var(--bg)); background: hsl(var(--sand)); }
.nav-links .nav-cta:hover { color: hsl(var(--bg)); background: hsl(var(--sand-light)); }
.nav-toggle { display: none; margin-left: auto; border: 1px solid hsl(var(--line)); background: hsl(var(--panel)); color: hsl(var(--ink)); border-radius: .6rem; padding: .45rem .7rem; }

main { position: relative; }
.container { width: min(var(--max), calc(100% - 2rem)); margin-inline: auto; }
.section { padding: 5.5rem 0; }
.section-tight { padding: 3.5rem 0; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin: 0 0 1rem;
  color: hsl(var(--sand));
  font-size: .77rem;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 1.8rem; height: 2px; background: currentColor; }

h1, h2, h3 { margin: 0; line-height: 1.08; letter-spacing: -.035em; }
h1 { font-size: clamp(3.2rem, 7vw, 6.4rem); max-width: 10ch; }
h2 { font-size: clamp(2rem, 4vw, 3.6rem); }
h3 { font-size: 1.2rem; }
p { color: hsl(var(--muted)); }
.lead { font-size: clamp(1.08rem, 2vw, 1.32rem); max-width: 63ch; }
.kicker { color: hsl(var(--ink)); font-weight: 800; }
.sand-text { color: hsl(var(--sand)); }

.hero { min-height: 720px; display: grid; align-items: center; padding: 5rem 0; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: 4rem; align-items: center; }
.hero-copy p { max-width: 60ch; }
.actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 2rem; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: .7rem 1.05rem;
  border: 1px solid hsl(var(--line));
  border-radius: .65rem;
  text-decoration: none;
  font-weight: 850;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.button:hover { transform: translateY(-2px); border-color: hsl(var(--sand) / .6); }
.button-primary { color: hsl(var(--bg)); background: hsl(var(--sand)); border-color: hsl(var(--sand)); }
.button-secondary { background: hsl(var(--panel)); }

.topic-tabs {
  display: flex;
  gap: .55rem;
  flex-wrap: wrap;
  margin-top: 2.1rem;
}
.topic-tabs a {
  padding: .5rem .75rem;
  border: 1px solid hsl(var(--line));
  border-radius: .55rem;
  background: hsl(var(--panel) / .8);
  color: hsl(var(--muted));
  text-decoration: none;
  font-size: .82rem;
  font-weight: 850;
}
.topic-tabs a:hover { color: hsl(var(--ink)); border-color: hsl(var(--sand) / .6); }
.topic-tabs a:first-child { color: hsl(var(--bg)); background: hsl(var(--sand)); border-color: hsl(var(--sand)); }

.site-search {
  display: grid;
  grid-template-columns: 1fr auto;
  max-width: 650px;
  margin-top: 1rem;
  border: 1px solid hsl(var(--line));
  border-radius: .75rem;
  overflow: hidden;
  background: hsl(var(--panel));
  box-shadow: 0 18px 45px #0003;
}
.site-search input {
  min-width: 0;
  padding: .9rem 1rem;
  border: 0;
  outline: 0;
  color: hsl(var(--ink));
  background: transparent;
  font: inherit;
}
.site-search input:focus { box-shadow: inset 0 0 0 2px hsl(var(--sand) / .55); }
.site-search button {
  padding: .7rem 1.25rem;
  border: 0;
  color: hsl(var(--bg));
  background: hsl(var(--sand));
  font-weight: 900;
  cursor: pointer;
}
.site-search button:hover { background: hsl(var(--sand-light)); }
.search-note { min-height: 1.4rem; margin: .4rem 0 0; font-size: .78rem; }

.hero-art { position: relative; display: grid; place-items: center; min-height: 500px; }
.hero-art::before,
.hero-art::after { content: ""; position: absolute; border-radius: 50%; }
.hero-art::before { width: 420px; height: 420px; border: 1px solid hsl(var(--sand) / .25); box-shadow: 0 0 100px hsl(var(--sand) / .12); }
.hero-art::after { width: 330px; height: 330px; border: 1px dashed hsl(var(--sand) / .35); animation: spin 28s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hero-emblem { position: relative; z-index: 2; width: min(390px, 88%); border-radius: 28px; box-shadow: 0 40px 90px #0008; transform: rotate(1.5deg); }
.pixel { position: absolute; width: 14px; height: 14px; background: hsl(var(--sand)); box-shadow: 26px 34px hsl(var(--ember)), -34px 68px hsl(var(--sand-light)), 65px -44px hsl(var(--water)); opacity: .7; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-block: 1px solid hsl(var(--line)); }
.stat { padding: 1.4rem; border-right: 1px solid hsl(var(--line)); }
.stat:last-child { border-right: 0; }
.stat strong { display: block; color: hsl(var(--sand)); font-size: 1.25rem; }
.stat span { color: hsl(var(--muted)); font-size: .86rem; }

.section-head { display: flex; justify-content: space-between; gap: 2rem; align-items: end; margin-bottom: 2.3rem; }
.section-head p { max-width: 48ch; margin-bottom: .2rem; }
.grid { display: grid; gap: 1rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  position: relative;
  overflow: hidden;
  padding: 1.5rem;
  border: 1px solid hsl(var(--line));
  border-radius: 1rem;
  background: linear-gradient(145deg, hsl(var(--panel-2) / .72), hsl(var(--panel) / .95));
}
.card::after { content: ""; position: absolute; inset: auto -20% -70% 30%; height: 180px; background: hsl(var(--sand) / .08); filter: blur(50px); }
.card > * { position: relative; z-index: 1; }
.card-link { display: block; text-decoration: none; transition: transform .18s ease, border-color .18s ease; }
.card-link:hover { transform: translateY(-4px); border-color: hsl(var(--sand) / .55); }
.card p { margin-bottom: 0; }
.card-label { color: hsl(var(--sand)); font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 900; }
.card-number { font-size: 2.2rem; font-weight: 950; color: hsl(var(--sand) / .25); }
.card-arrow { color: hsl(var(--sand)); font-weight: 900; }
.status { display: inline-flex; padding: .2rem .55rem; border-radius: 99px; background: hsl(var(--line)); color: hsl(var(--muted)); font-size: .72rem; font-weight: 800; }
.status-live { background: hsl(var(--sand) / .12); color: hsl(var(--sand-light)); }

.process { display: grid; grid-template-columns: repeat(5, 1fr); gap: .65rem; align-items: stretch; }
.process-step { padding: 1.15rem; border: 1px solid hsl(var(--line)); border-radius: .8rem; background: hsl(var(--panel)); }
.process-step small { display: block; color: hsl(var(--sand)); font-weight: 900; margin-bottom: .35rem; }

.cta-panel { padding: clamp(2rem, 6vw, 4.5rem); border: 1px solid hsl(var(--sand) / .35); border-radius: 1.3rem; background: linear-gradient(120deg, hsl(var(--sand) / .1), hsl(var(--panel))); }

.page-hero { padding: 6rem 0 3.5rem; border-bottom: 1px solid hsl(var(--line)); }
.page-hero h1 { font-size: clamp(2.8rem, 6vw, 5.5rem); max-width: 14ch; }
.breadcrumbs { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.4rem; color: hsl(var(--muted)); font-size: .88rem; }
.breadcrumbs a { text-decoration: none; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 4rem; align-items: start; }
.article { max-width: 780px; }
.article h2 { margin-top: 3.3rem; font-size: 2rem; }
.article h3 { margin-top: 2rem; }
.article p, .article li { color: hsl(var(--muted)); }
.article strong { color: hsl(var(--ink)); }
.article li + li { margin-top: .5rem; }
.article a { color: hsl(var(--sand-light)); }
.toc { position: sticky; top: 100px; padding: 1.2rem; border-left: 1px solid hsl(var(--line)); }
.toc strong { display: block; margin-bottom: .7rem; }
.toc a { display: block; padding: .3rem 0; color: hsl(var(--muted)); text-decoration: none; font-size: .9rem; }
.toc a:hover { color: hsl(var(--sand)); }
.callout { margin: 1.8rem 0; padding: 1rem 1.15rem; border-left: 3px solid hsl(var(--sand)); background: hsl(var(--sand) / .07); border-radius: 0 .7rem .7rem 0; }
.callout p { margin: 0; }
.recipe { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; margin: 1.3rem 0; }
.recipe span { padding: .55rem .7rem; border: 1px solid hsl(var(--line)); border-radius: .55rem; background: hsl(var(--panel)); font-weight: 800; }
.recipe b { color: hsl(var(--sand)); }
.checklist { list-style: none; padding: 0; }
.checklist li { padding-left: 1.7rem; position: relative; }
.checklist li::before { content: "✓"; position: absolute; left: 0; color: hsl(var(--sand)); font-weight: 900; }

.site-footer { border-top: 1px solid hsl(var(--line)); padding: 3.5rem 0 2rem; background: hsl(var(--panel) / .45); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 3rem; }
.footer-grid h3 { margin-bottom: .8rem; }
.footer-grid p { max-width: 50ch; }
.footer-links a { display: block; color: hsl(var(--muted)); text-decoration: none; padding: .25rem 0; }
.footer-links a:hover { color: hsl(var(--sand)); }
.fine-print { margin-top: 2.5rem; padding-top: 1.2rem; border-top: 1px solid hsl(var(--line)); color: hsl(var(--muted)); font-size: .8rem; }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-links { display: none; position: absolute; top: 64px; left: 1rem; right: 1rem; padding: .8rem; flex-direction: column; align-items: stretch; border: 1px solid hsl(var(--line)); border-radius: .8rem; background: hsl(var(--panel)); }
  .nav-links.open { display: flex; }
  .hero { min-height: auto; }
  .hero-grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero-art { min-height: 390px; }
  .hero-art::before { width: 330px; height: 330px; }
  .hero-art::after { width: 260px; height: 260px; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .process { grid-template-columns: repeat(2, 1fr); }
  .article-layout { grid-template-columns: 1fr; }
  .toc { position: static; border-left: 0; border-top: 1px solid hsl(var(--line)); order: -1; }
}

@media (max-width: 620px) {
  .section { padding: 4rem 0; }
  .hero { padding: 3.6rem 0; }
  .hero-grid { gap: 1rem; }
  .hero-art { min-height: 320px; }
  .hero-art::before { width: 270px; height: 270px; }
  .hero-art::after { width: 220px; height: 220px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid hsl(var(--line)); }
  .section-head { align-items: start; flex-direction: column; }
  .grid-3, .grid-4, .process, .footer-grid { grid-template-columns: 1fr; }
  .actions .button { width: 100%; }
  .site-search { grid-template-columns: 1fr; }
  .site-search button { min-height: 46px; }
  .page-hero { padding-top: 4rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
