:root {
  --bg: #f7f5f0;
  --panel: #fdfbf6;
  --ink: #15201d;
  --ink-soft: #2a3833;
  --muted: #5d6864;
  --line: #e2dccd;
  --accent: #1c5b50;
  --accent-strong: #103c34;
  --accent-soft: #d9e8de;
  --code-bg: #11211d;
  --code-ink: #e8efea;
  --code-key: #7fc9b2;
  --shadow: 0 14px 36px rgb(20 32 28 / 8%);
  --sidebar-width: 280px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent-strong);
  text-decoration-color: rgb(28 91 80 / 30%);
  text-underline-offset: 3px;
}

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

code,
pre,
table td:first-child {
  font-family: "JetBrains Mono", "SFMono-Regular", "Cascadia Code", monospace;
  font-feature-settings: "ss02";
}

:not(pre) > code {
  background: rgb(28 91 80 / 8%);
  border-radius: 5px;
  color: var(--accent-strong);
  font-size: 0.86em;
  padding: 1px 6px;
}

.menu-toggle {
  display: none;
}

/* ---------- Sidebar ---------- */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  overflow-y: auto;
  padding: 26px 18px 36px 22px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgb(253 251 246 / 96%), rgb(247 245 240 / 96%));
  backdrop-filter: blur(18px);
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgb(28 91 80 / 18%);
  border-radius: 99px;
}

.brand {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 4px 6px 22px;
  text-decoration: none;
}

.brand-mark {
  color: var(--ink);
  font-family: "Fraunces", "Iowan Old Style", Georgia, serif;
  font-size: 2.1rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-group {
  border-radius: 10px;
}

.nav-group > summary {
  border-radius: 8px;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  list-style: none;
  padding: 8px 28px 8px 10px;
  position: relative;
  user-select: none;
}

.nav-group > summary::-webkit-details-marker {
  display: none;
}

.nav-group > summary::after {
  border-right: 1.5px solid currentcolor;
  border-top: 1.5px solid currentcolor;
  content: "";
  height: 6px;
  opacity: 0.55;
  position: absolute;
  right: 12px;
  top: 14px;
  transform: rotate(135deg);
  transition: transform 160ms ease;
  width: 6px;
}

.nav-group[open] > summary::after {
  transform: rotate(-45deg);
  top: 17px;
}

.nav-group > summary:hover {
  background: rgb(28 91 80 / 6%);
  color: var(--accent-strong);
}

.nav-group > a {
  border-radius: 7px;
  color: var(--muted);
  display: block;
  font-size: 0.86rem;
  margin-left: 10px;
  padding: 5px 10px;
  text-decoration: none;
}

.nav-group > a:hover {
  background: rgb(28 91 80 / 5%);
  color: var(--accent-strong);
}

.nav-group > a.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 600;
}

/* ---------- Content ---------- */

.content {
  margin-left: var(--sidebar-width);
  max-width: 920px;
  padding: 52px clamp(28px, 6vw, 72px) 96px;
}

.section {
  scroll-margin-top: 24px;
  margin-bottom: 72px;
}

.hero {
  min-height: min(72vh, 720px);
  display: grid;
  align-content: center;
  padding-top: 12px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p,
ol,
ul {
  margin-top: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 22px;
  font-family: "Fraunces", "Iowan Old Style", Georgia, serif;
  font-size: clamp(2.8rem, 6.4vw, 5.4rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
}

h2 {
  margin-bottom: 12px;
  font-family: "Fraunces", "Iowan Old Style", Georgia, serif;
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

h3 {
  margin-bottom: 6px;
  font-size: 1.02rem;
  font-weight: 600;
}

p {
  max-width: 70ch;
  color: var(--ink-soft);
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.86rem;
}

ul,
ol {
  color: var(--ink-soft);
  margin-bottom: 16px;
  max-width: 70ch;
  padding-left: 1.1rem;
}

ul li,
ol li {
  margin-bottom: 4px;
}

.hero-copy {
  max-width: 720px;
  font-size: clamp(1.05rem, 1.6vw, 1.22rem);
}

.hero-actions,
.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0 10px;
}

.button,
.link-row a {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--accent-strong);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 9px 16px;
  text-decoration: none;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.button:hover,
.link-row a:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fefcf6;
}

.button.primary:hover {
  background: var(--accent-strong);
}

.signal-grid,
.card-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 30px;
}

.onramp-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 30px 0 6px;
}

.onramp {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  display: grid;
  gap: 6px;
  padding: 18px;
  text-decoration: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.onramp:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.onramp-tag {
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.onramp strong {
  color: var(--ink);
  font-size: 1rem;
}

.onramp-copy {
  color: var(--muted);
  font-size: 0.88rem;
}

.whynow {
  background: linear-gradient(180deg, rgb(28 91 80 / 6%), rgb(28 91 80 / 2%));
  border: 1px solid var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 14px;
  margin-top: 28px;
  padding: 22px 24px;
}

.whynow .eyebrow {
  margin-bottom: 8px;
}

.whynow h3 {
  font-family: "Fraunces", "Iowan Old Style", Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 10px;
}

.whynow p {
  color: var(--ink-soft);
  margin-bottom: 8px;
  max-width: 65ch;
}

.whynow p:last-child {
  margin-bottom: 0;
}

.signal-grid article,
.card,
.module-list article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}

.signal-grid article {
  display: grid;
  gap: 6px;
}

.signal-grid strong {
  font-size: 0.96rem;
}

.signal-grid span,
.card p,
.module-list span {
  color: var(--muted);
  font-size: 0.88rem;
}

.section-heading {
  margin-bottom: 18px;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: 28px;
  align-items: start;
}

.code-card {
  background: var(--code-bg);
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.code-card pre {
  margin: 0;
  overflow-x: auto;
  padding: 20px 22px;
}

.code-card code {
  color: var(--code-ink);
  font-size: 0.84rem;
  line-height: 1.55;
}

.copy-button {
  background: rgb(255 255 255 / 6%);
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 999px;
  color: var(--code-ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 5px 10px;
  position: absolute;
  right: 10px;
  top: 10px;
  transition: background 140ms ease;
}

.copy-button:hover {
  background: rgb(255 255 255 / 12%);
}

.card {
  padding: 18px;
}

.card h3 {
  color: var(--accent-strong);
}

.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 16px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

td {
  color: var(--ink-soft);
  font-size: 0.92rem;
}

tr:last-child td {
  border-bottom: 0;
}

.module-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.module-list article {
  display: grid;
  gap: 4px;
}

.module-list strong {
  color: var(--accent-strong);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.92rem;
}

.footer-section {
  margin-bottom: 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
  .menu-toggle {
    background: var(--accent);
    border: 0;
    border-radius: 999px;
    bottom: 16px;
    box-shadow: var(--shadow);
    color: #fefcf6;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 11px 18px;
    position: fixed;
    right: 16px;
    z-index: 20;
  }

  .sidebar {
    transform: translateX(-104%);
    transition: transform 180ms ease;
    z-index: 15;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .content {
    margin-left: 0;
    padding-top: 36px;
  }

  .hero {
    min-height: auto;
    padding-top: 56px;
  }

  .signal-grid,
  .card-grid,
  .onramp-grid,
  .module-list,
  .two-column {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .content {
    padding-inline: 18px;
  }

  .sidebar {
    width: min(86vw, var(--sidebar-width));
  }

  .code-card pre {
    padding: 18px 14px;
  }
}
