@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,700&family=Manrope:wght@400;500;600;700&display=swap");

:root {
  --bg: #10160f;
  --bg-elev: #171e16;
  --fg: #eef3ea;
  --muted: #9aab94;
  --faint: #6d7c68;
  --accent: #b8e03a;
  --accent-ink: #14200a;
  --line: #2a3528;
  --warn: #e8c47c;
  --max: 72rem;
  --prose: 42rem;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --radius: 0.35rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--fg);
  background:
    radial-gradient(900px 480px at 8% -8%, #2a3a28 0%, transparent 55%),
    radial-gradient(700px 420px at 100% 0%, #1a2818 0%, transparent 50%),
    var(--bg);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); }
img { max-width: 100%; height: auto; }

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}
.top-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 1.2rem;
  color: var(--fg);
  text-decoration: none;
}
nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.1rem;
  align-items: center;
}
nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
}
nav a:hover { color: var(--accent); }

.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--accent);
  z-index: 40;
  transform-origin: left;
}

main { max-width: var(--max); margin: 0 auto; padding: 1rem 1.5rem 4rem; }

.hero {
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 2.75rem;
  max-width: 40rem;
  animation: rise 0.7s var(--ease) both;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 0.85rem;
}
h1, .article h1 {
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 5.5vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin: 0 0 1rem;
  font-weight: 700;
}
.lede {
  color: var(--muted);
  font-size: 1.12rem;
  margin: 0 0 1.6rem;
  max-width: 36rem;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.8rem 1.15rem;
  border-radius: var(--radius);
  transition: transform 0.2s var(--ease), background 0.2s, color 0.2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--line);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin: 2.5rem 0 1rem;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: -0.02em;
  margin: 0;
}
.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1rem;
}
.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  padding: 1.35rem 1.3rem 1.4rem;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
  text-decoration: none;
  color: inherit;
  animation: rise 0.7s var(--ease) both;
}
.card:nth-child(2) { animation-delay: 0.08s; }
.card:nth-child(3) { animation-delay: 0.16s; }
.card:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  transform: translateY(-2px);
}
.card .meta {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
  font-weight: 600;
}
.card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  flex: 1;
}
.card .more {
  margin-top: 0.4rem;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
}

.strip {
  margin: 2.75rem 0 0;
  padding: 1.35rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(120deg, #1a2418, #141a13);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.strip p { margin: 0; color: var(--muted); max-width: 36rem; }
.strip strong { color: var(--fg); }

footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
}
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--accent); }

/* Article layout */
.article-wrap {
  display: grid;
  grid-template-columns: minmax(0, var(--prose)) 14rem;
  gap: 2.5rem;
  align-items: start;
  padding-top: 1.5rem;
}
@media (max-width: 900px) {
  .article-wrap { grid-template-columns: 1fr; }
  .toc { display: none; }
}

.article-header { margin-bottom: 1.75rem; animation: rise 0.65s var(--ease) both; }
.article-header .meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  color: var(--faint);
  font-size: 0.85rem;
  margin-bottom: 0.85rem;
}
.article {
  font-size: 1.05rem;
  color: color-mix(in srgb, var(--fg) 94%, var(--muted));
}
.article > * + * { margin-top: 1.05rem; }
.article h2 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: -0.02em;
  margin-top: 2.2rem;
  scroll-margin-top: 5rem;
}
.article h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-top: 1.6rem;
}
.article p, .article li { color: color-mix(in srgb, var(--fg) 88%, var(--muted)); }
.article ul, .article ol { padding-left: 1.2rem; }
.article li + li { margin-top: 0.35rem; }
.article table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  overflow-x: auto;
  display: block;
}
.article th, .article td {
  border: 1px solid var(--line);
  padding: 0.65rem 0.75rem;
  text-align: left;
  vertical-align: top;
}
.article th { background: var(--bg-elev); color: var(--fg); }
.article .callout {
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-elev));
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
}
.article .callout strong { color: var(--fg); }
.article .cta-box {
  margin: 2rem 0;
  padding: 1.35rem 1.35rem 1.45rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-elev);
}
.article .cta-box h3 {
  margin: 0 0 0.45rem;
  font-size: 1.25rem;
}
.article .cta-box p { margin: 0 0 1rem; color: var(--muted); }
.disclosure {
  font-size: 0.88rem;
  color: var(--faint);
  border-left: 3px solid var(--warn);
  padding: 0.55rem 0 0.55rem 0.9rem;
  margin: 1.25rem 0 1.75rem;
}
.related {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.related h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 1rem;
}

.toc {
  position: sticky;
  top: 4.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.toc strong {
  display: block;
  color: var(--fg);
  margin-bottom: 0.65rem;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.toc a {
  display: block;
  color: var(--muted);
  text-decoration: none;
  padding: 0.28rem 0;
  border-left: 2px solid var(--line);
  padding-left: 0.7rem;
}
.toc a:hover { color: var(--accent); border-left-color: var(--accent); }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

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