:root {
  --ink: #171521;
  --muted: #686478;
  --paper: #f7f4ed;
  --paper-deep: #eee9de;
  --night: #11101b;
  --night-soft: #1a1827;
  --accent: #e99d36;
  --accent-bright: #f4b860;
  --violet: #8b7bf6;
  --line: rgba(23, 21, 33, .15);
  --radius: 18px;
  --shadow: 0 24px 80px rgba(30, 25, 15, .12);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); line-height: 1.55; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input { font: inherit; }
.shell { width: min(1160px, calc(100% - 40px)); margin-inline: auto; }

.nav-wrap { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid rgba(255,255,255,.08); background: rgba(17,16,27,.88); backdrop-filter: blur(16px); color: #fff; }
.nav { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 750; letter-spacing: -.02em; }
.brand-mark { width: 28px; display: grid; gap: 4px; }
.brand-mark i { display: block; height: 3px; border-radius: 4px; background: var(--accent-bright); }
.brand-mark i:nth-child(2) { width: 72%; }
.brand-mark i:nth-child(3) { width: 46%; }
.nav-links { display: flex; gap: 30px; color: rgba(255,255,255,.7); font-size: .92rem; }
.nav-links a:hover { color: #fff; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent; font-weight: 700; transition: transform .2s ease, border-color .2s ease, background .2s ease; }
.button:hover { transform: translateY(-2px); }
.button-primary { background: var(--accent-bright); color: #1d160b; }
.button-ghost { border-color: rgba(255,255,255,.24); color: #fff; background: rgba(255,255,255,.04); }
.button-small { min-height: 40px; padding: 0 17px; font-size: .9rem; }

.hero { width: 100%; max-width: none; min-height: 770px; padding: 118px max(40px, calc((100vw - 1160px)/2)) 72px; color: #fff; background:
  radial-gradient(circle at 77% 26%, rgba(139,123,246,.26), transparent 27%),
  radial-gradient(circle at 22% 86%, rgba(233,157,54,.16), transparent 26%),
  linear-gradient(145deg, #11101b 0%, #171426 58%, #0f0e17 100%);
  overflow: hidden; position: relative;
}
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .2; background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px); background-size: 72px 72px; mask-image: linear-gradient(to bottom, black, transparent 75%); }
.hero > * { position: relative; z-index: 1; }
.eyebrow, .section-label { text-transform: uppercase; font-weight: 760; letter-spacing: .15em; font-size: .74rem; }
.eyebrow { display: flex; align-items: center; gap: 10px; color: var(--accent-bright); }
.eyebrow span { width: 28px; height: 2px; background: currentColor; }
.hero h1 { margin: 24px 0 26px; max-width: 900px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(4.1rem, 9vw, 8.7rem); line-height: .86; letter-spacing: -.065em; font-weight: 500; }
.hero h1 em { color: var(--accent-bright); font-weight: 400; }
.hero-copy { max-width: 730px; margin: 0; color: rgba(255,255,255,.72); font-size: clamp(1.08rem, 2vw, 1.35rem); }
.hero-actions { display: flex; gap: 12px; margin-top: 38px; flex-wrap: wrap; }
.headline-stats { display: grid; grid-template-columns: repeat(3, 1fr); max-width: 920px; margin-top: 82px; border-top: 1px solid rgba(255,255,255,.16); }
.headline-stats article { padding: 25px 28px 0 0; }
.headline-stats strong { display: block; font-family: Georgia, serif; font-size: clamp(2.4rem, 5vw, 4.2rem); line-height: 1; font-weight: 500; color: #fff; }
.headline-stats span { display: block; margin-top: 8px; max-width: 190px; color: rgba(255,255,255,.58); font-size: .91rem; }
.scope-note { margin: 24px 0 0; color: rgba(255,255,255,.42); font-size: .75rem; }

.section { padding: 110px 0; }
.section-label { color: #8b6132; margin-bottom: 34px; }
.split-heading { display: grid; grid-template-columns: 1.2fr .8fr; gap: clamp(40px, 8vw, 120px); align-items: end; }
.split-heading h2, .citation-grid h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.6rem, 5.2vw, 5.3rem); line-height: .98; letter-spacing: -.045em; font-weight: 500; }
.split-heading p { margin: 0; color: var(--muted); font-size: 1.04rem; }

.cost-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 16px; align-items: center; margin-top: 64px; }
.flow-card { min-height: 180px; padding: 27px; border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; justify-content: space-between; background: rgba(255,255,255,.3); }
.flow-card > span { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; }
.flow-card strong { font-family: Georgia, serif; font-size: 1.55rem; line-height: 1.1; }
.flow-card small { color: var(--muted); }
.flow-card.muted { background: var(--paper-deep); }
.flow-card.accent { color: #fff; background: var(--night); border-color: var(--night); }
.flow-card.accent > span, .flow-card.accent small { color: rgba(255,255,255,.6); }
.flow-arrow { color: #a69e90; font-size: 1.4rem; }

.paper-figure { margin: 64px 0 0; padding: 24px; border-radius: calc(var(--radius) + 8px); background: #fff; box-shadow: var(--shadow); }
.paper-figure img { width: 100%; border-radius: 9px; }
.paper-figure figcaption { margin-top: 14px; color: var(--muted); font-size: .83rem; text-align: center; }
.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 28px; }
.method-grid article { padding: 27px; border-top: 2px solid var(--ink); background: rgba(255,255,255,.36); }
.method-grid span { font: 700 .74rem/1 ui-monospace, monospace; color: #96621c; }
.method-grid h3 { margin: 28px 0 10px; font-size: 1.15rem; }
.method-grid p { margin: 0; color: var(--muted); font-size: .92rem; }
.results-figure { max-width: 880px; margin-inline: auto; }

.explorer-section { background: var(--night); color: #fff; }
.explorer-section .section-label { color: var(--accent-bright); }
.explorer-section .split-heading p { color: rgba(255,255,255,.62); }
.explorer-grid { display: grid; grid-template-columns: 360px 1fr; gap: 24px; margin-top: 58px; }
.calculator, .chart-panel { border: 1px solid rgba(255,255,255,.11); border-radius: var(--radius); background: var(--night-soft); }
.calculator { padding: 26px; display: grid; gap: 18px; }
.calculator label { display: grid; grid-template-columns: 1fr auto; gap: 7px; color: rgba(255,255,255,.7); font-size: .84rem; }
.calculator label span { color: rgba(255,255,255,.42); font-family: Georgia, serif; }
.calculator input { grid-column: 1 / -1; width: 100%; padding: 11px 12px; border: 1px solid rgba(255,255,255,.12); border-radius: 9px; color: #fff; background: rgba(0,0,0,.2); outline: none; }
.calculator input:focus { border-color: var(--accent-bright); }
.calculator-note { margin: 3px 0 0; color: rgba(255,255,255,.4); font-size: .74rem; }
.calculator-note.error { color: #ff9a91; }
.chart-panel { padding: 26px; min-width: 0; }
.metric-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.metric-row article { padding: 16px; border-radius: 12px; background: rgba(255,255,255,.05); }
.metric-row span, .metric-row small { display: block; color: rgba(255,255,255,.5); }
.metric-row span { font-size: .72rem; letter-spacing: .12em; font-weight: 750; }
.metric-row strong { display: block; margin: 7px 0 2px; font-family: Georgia, serif; font-size: 2rem; color: var(--accent-bright); }
.metric-row small { font-size: .76rem; }
#payback-chart { width: 100%; height: auto; border-radius: 10px; background: rgba(0,0,0,.12); }
.chart-legend { display: flex; justify-content: center; gap: 28px; padding-top: 15px; color: rgba(255,255,255,.56); font-size: .78rem; }
.chart-legend span::before { content: ""; display: inline-block; width: 17px; height: 3px; margin-right: 8px; vertical-align: middle; border-radius: 3px; }
.baseline-key::before { background: var(--violet); }
.router-key::before { background: var(--accent-bright); }

.try-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 58px; }
.try-grid article { min-height: 320px; display: flex; flex-direction: column; padding: 27px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.34); }
.try-grid article > span { color: #8b6132; text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; font-weight: 750; }
.try-grid h3 { margin: 22px 0 16px; font-family: Georgia, serif; font-size: 1.8rem; }
.try-grid p { color: var(--muted); font-size: .9rem; }
.try-grid pre { margin: 0 0 20px; padding: 15px; overflow-x: auto; border-radius: 10px; color: #d6d1e8; background: var(--night); font-size: .7rem; white-space: pre-wrap; }
.try-grid a { margin-top: auto; color: #774c14; font-weight: 700; }
.try-grid .featured { color: #fff; background: var(--night); border-color: var(--night); }
.try-grid .featured > span { color: var(--accent-bright); }
.try-grid .featured p { color: rgba(255,255,255,.62); }
.try-grid .featured .button { color: #1d160b; align-self: flex-start; }

.citation-section { padding: 110px 0; color: #fff; background: #262238; }
.citation-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 70px; align-items: start; }
.citation-section .section-label { color: var(--accent-bright); }
.citation-box { min-width: 0; position: relative; }
.citation-box pre { margin: 0; padding: 26px; overflow-x: auto; border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius); color: #d8d3e8; background: rgba(0,0,0,.18); font-size: .73rem; white-space: pre-wrap; }
.copy-button { position: absolute; right: 12px; top: 12px; border: 1px solid rgba(255,255,255,.15); border-radius: 999px; padding: 7px 12px; color: #fff; background: #38334f; cursor: pointer; }
.footer { min-height: 100px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: .84rem; }
.footer div { display: flex; gap: 24px; }
.footer a:hover { color: var(--ink); }

@media (max-width: 820px) {
  .nav-links { display: none; }
  .hero { min-height: auto; padding-top: 92px; }
  .headline-stats, .method-grid, .try-grid { grid-template-columns: 1fr; }
  .headline-stats article { display: grid; grid-template-columns: 150px 1fr; align-items: center; border-bottom: 1px solid rgba(255,255,255,.1); padding: 20px 0; }
  .headline-stats span { margin: 0; }
  .split-heading, .citation-grid { grid-template-columns: 1fr; gap: 28px; }
  .cost-flow { grid-template-columns: 1fr; }
  .flow-arrow { transform: rotate(90deg); justify-self: center; }
  .explorer-grid { grid-template-columns: 1fr; }
  .section { padding: 80px 0; }
}

@media (max-width: 520px) {
  .shell { width: min(100% - 26px, 1160px); }
  .nav { height: 64px; }
  .nav .button { display: none; }
  .hero { padding-inline: 20px; }
  .hero h1 { font-size: 3.65rem; }
  .headline-stats article { grid-template-columns: 120px 1fr; }
  .headline-stats strong { font-size: 2.5rem; }
  .paper-figure { padding: 10px; }
  .metric-row { grid-template-columns: 1fr; }
  .chart-panel { padding: 14px; }
  .footer { flex-direction: column; justify-content: center; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button { transition: none; }
}
