:root {
  --bg: #1c1c1c;
  --bg-2: #242424;
  --panel: #2b2b2b;
  --line: #3a3a3a;
  --text: #ececec;
  --muted: #b4b4b4;
  --yellow: #f2c200;
  --yellow-ink: #1c1c1c;
  --paper: #f6f4ee;
  --paper-ink: #1f1f1f;
  --danger: #ff8a3d;
  --radius: 10px;
  --wrap: 1160px;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--sans); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--yellow); text-underline-offset: 3px; }
a:hover { color: #ffd84a; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.05; letter-spacing: .01em; text-transform: uppercase; margin: 0 0 .5em; }
h1 { font-size: clamp(2.4rem, 5.5vw, 4.2rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); margin-top: 1.4em; }
p { margin: 0 0 1em; }
code, pre { font-family: var(--mono); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 99; background: var(--yellow); color: var(--yellow-ink); padding: 8px 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.eyebrow { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .18em; color: var(--yellow); font-size: .95rem; margin-bottom: .6em; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 46em; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: .55em; background: var(--yellow); color: var(--yellow-ink); font-family: var(--display); font-weight: 800; font-size: 1.15rem; text-transform: uppercase; letter-spacing: .06em; text-decoration: none; padding: .7em 1.25em; border-radius: 6px; border: 2px solid var(--yellow); cursor: pointer; transition: transform .12s, background .12s; }
.btn:hover { background: #ffd84a; color: var(--yellow-ink); transform: translateY(-1px); }
.btn span { font-weight: 600; opacity: .8; }
.btn-ghost { background: transparent; color: var(--yellow); }
.btn-ghost:hover { background: rgba(242, 194, 0, .1); color: #ffd84a; }
.btn-sm { font-size: .95rem; padding: .45em .9em; }
.btn-lg { font-size: 1.35rem; padding: .75em 1.4em; }
.buy-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.2em 0; }
.buy-row.center { justify-content: center; }

/* header */
.bar { position: sticky; top: 0; z-index: 20; background: rgba(28, 28, 28, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.bar-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.3rem; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.brand b { color: var(--yellow); }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; background: var(--yellow); color: var(--yellow-ink); font-weight: 800; border-radius: 4px; }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; padding: 8px 10px; font-weight: 500; font-size: .95rem; }
.nav a:hover { color: var(--text); }
.bar-cta { flex: none; margin-left: auto; }
@media (max-width: 900px) {
  .bar-in { flex-wrap: wrap; row-gap: 0; padding-top: 10px; }
  .nav { order: 3; width: 100%; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; gap: 0; margin: 0 -10px; scrollbar-width: none; }
  .nav a { flex: none; padding: 12px 10px; }
}
@media (max-width: 420px) {
  .bar-in { column-gap: 10px; }
  .brand { font-size: 1rem; gap: 8px; }
  .brand-mark { width: 30px; height: 30px; }
  .bar-cta { font-size: .85rem; padding: .5em .75em; }
}

/* hero */
.hero { background: radial-gradient(ellipse at 75% 30%, #2f2a14 0, transparent 55%), linear-gradient(var(--bg-2), var(--bg)); border-bottom: 1px solid var(--line); background-size: auto; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(#ffffff08 1px, transparent 1px), linear-gradient(90deg, #ffffff08 1px, transparent 1px); background-size: 40px 40px; pointer-events: none; }
.hero-in { position: relative; display: grid; grid-template-columns: 1.25fr .75fr; gap: 48px; align-items: center; padding-top: 64px; padding-bottom: 64px; }
.hero h1 span { display: block; color: var(--yellow); }
.hero-sub { font-size: 1.25rem; color: var(--text); max-width: 34em; }
.hero-tag { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 1.4rem; color: var(--yellow); }
.hero-note { color: var(--muted); font-size: .95rem; }
.hero-cover img { width: 100%; max-width: 380px; margin-left: auto; border-radius: 4px; box-shadow: 0 30px 60px rgba(0, 0, 0, .55), 0 0 0 1px #ffffff14; transform: perspective(1200px) rotateY(-8deg); }
@media (max-width: 760px) {
  .hero-in { grid-template-columns: 1fr; gap: 28px; padding-top: 36px; padding-bottom: 40px; }
  .hero-cover { order: -1; }
  .hero-cover img { max-width: 230px; margin: 0 auto; transform: none; }
}

.stats { background: var(--yellow); color: var(--yellow-ink); }
.stats-in { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding-top: 22px; padding-bottom: 22px; text-align: center; }
.stats b { display: block; font-family: var(--display); font-size: 2.6rem; font-weight: 800; line-height: 1; }
.stats span { font-weight: 600; font-size: .9rem; }
@media (max-width: 640px) { .stats-in { grid-template-columns: repeat(3, 1fr); row-gap: 18px; } }

section.wrap { padding-top: 40px; padding-bottom: 8px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; padding-top: 64px !important; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.ticks { list-style: none; padding: 0; margin: 0 0 1em; }
.ticks li { position: relative; padding-left: 28px; margin-bottom: .6em; }
.ticks li::before { content: ''; position: absolute; left: 0; top: .5em; width: 12px; height: 12px; background: var(--yellow); }

/* sample page */
.sample { margin: 0; }
.sample-page { background: var(--paper); color: var(--paper-ink); padding: 26px 28px; border-radius: 4px; box-shadow: 0 20px 50px rgba(0, 0, 0, .45); font-size: .92rem; }
.sp-h { font-family: Georgia, serif; font-size: 1.35rem; border-bottom: 2px solid var(--paper-ink); padding-bottom: 6px; }
.sample-page ul { padding-left: 18px; }
.sample-page svg { width: 100%; height: auto; margin: 6px 0 10px; }
.sample-page svg text { font: 10px var(--sans); fill: #555; }
.ln-dash { stroke: #888; stroke-dasharray: 4 3; }
.ln-faint { stroke: #bbb; }
.ln-path { fill: none; stroke: #1f1f1f; stroke-width: 1.6; }
.sample-page pre { background: #e9e6dc; padding: 10px 12px; border-radius: 3px; overflow-x: auto; font-size: .85rem; margin: 0 0 12px; }
.sp-watch { border-left: 4px solid var(--paper-ink); background: #e9e6dc; padding: 8px 12px; }
.sp-rel { font-size: .8rem; letter-spacing: .08em; margin: 0; }
.sample .more { display: inline-block; margin-top: 14px; }

.band { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 56px; padding: 40px 0; }
.who { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.who div { border-top: 3px solid var(--yellow); padding-top: 12px; }
.who b { display: block; font-family: var(--display); font-size: 1.5rem; text-transform: uppercase; }
.who span { color: var(--muted); }
@media (max-width: 760px) { .who { grid-template-columns: 1fr 1fr; } }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin: 1.2em 0; }
.card { display: flex; flex-direction: column; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--yellow); transform: translateY(-2px); color: var(--text); }
.card strong { font-size: 1.05rem; }
.card span:last-child { color: var(--muted); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.code-tag { display: inline-block; align-self: flex-start; font-family: var(--mono); font-weight: 600; background: var(--yellow); color: var(--yellow-ink); padding: 1px 8px; border-radius: 4px; font-size: .95em; }
h1 .code-tag { font-size: .8em; padding: 0 .25em; vertical-align: .08em; }
.tools-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* editions */
.editions { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 1em; }
.edition { display: grid; grid-template-columns: 160px 1fr; gap: 22px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.ed-hc { border-color: #5a4a10; }
.edition img { border-radius: 3px; box-shadow: 0 12px 26px rgba(0, 0, 0, .5); }
.price { font-family: var(--display); font-size: 2.6rem; font-weight: 800; line-height: 1; margin-bottom: .4em; }
@media (max-width: 860px) { .editions { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .edition { grid-template-columns: 1fr; } .edition img { max-width: 160px; } }

/* faq */
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 1.05rem; padding: 12px 28px 12px 0; position: relative; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 4px; top: 8px; font-size: 1.5rem; color: var(--yellow); }
.faq details[open] summary::after { content: '–'; }
.faq details p { color: var(--muted); }

.cta-final { text-align: center; background: linear-gradient(var(--bg), #2a240c); padding: 72px 0; margin-top: 56px; border-top: 1px solid var(--line); }
.cta-final p { color: var(--muted); font-size: 1.15rem; }

/* breadcrumbs + code pages */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 18px 20px 0; margin: 0; font-size: .9rem; color: var(--muted); }
.crumbs { padding: 0; }
.crumbs li + li::before { content: '›'; margin-right: 6px; color: #777; }
.crumbs a { color: var(--muted); }
.code-page { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; padding-top: 20px; }
.code-head { border-bottom: 3px solid var(--yellow); margin-bottom: 1.4em; padding-bottom: .6em; }
.meta { color: #9a9a9a; font-size: .9rem; }
.meta a { color: #9a9a9a; }
.code-main h2 { font-size: 1.65rem; }
.code-side { position: relative; }
.code-side .buybox { position: sticky; top: 90px; flex-direction: column; }
.code-side .buybox img { max-width: 170px; }
@media (max-width: 960px) { .code-page { grid-template-columns: 1fr; } .code-side .buybox { position: static; flex-direction: row; } }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .97rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--panel); font-family: var(--display); text-transform: uppercase; letter-spacing: .08em; font-size: .95rem; }
tbody tr:last-child td { border-bottom: 0; }
td code { color: var(--yellow); font-weight: 600; white-space: nowrap; }
table.codes tr.has { background: #2a2717; }
table.codes tr:target { outline: 2px solid var(--yellow); }
.more { white-space: nowrap; font-weight: 600; }

.codeblock { position: relative; background: #121212; border: 1px solid var(--line); border-left: 4px solid var(--yellow); border-radius: var(--radius); }
.codeblock pre { margin: 0; padding: 18px 20px; overflow-x: auto; font-size: .95rem; line-height: 1.7; color: #e8e8e8; }
.copy { position: absolute; top: 8px; right: 8px; background: var(--panel); color: var(--muted); border: 1px solid var(--line); border-radius: 5px; font: 600 .78rem var(--sans); padding: 4px 10px; cursor: pointer; }
.copy:hover { color: var(--text); }

.watch { background: #2e2012; border: 1px solid #6b3f17; border-left: 6px solid var(--danger); border-radius: var(--radius); padding: 16px 20px; margin: 2em 0 1em; }
.watch-h { font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--danger); font-size: 1.25rem; margin-bottom: .3em; }
.watch p:last-child { margin: 0; }

.chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { display: inline-block; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 4px 14px; font-family: var(--mono); font-weight: 600; text-decoration: none; }
.chips a:hover { border-color: var(--yellow); }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 2.5em 0 1.5em; }
.pager a { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--text); }
.pager a:hover { border-color: var(--yellow); }
.pager small { display: block; color: var(--muted); }
.pager .next { text-align: right; }

.buybox { display: flex; gap: 22px; align-items: flex-start; background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--yellow); border-radius: var(--radius); padding: 22px; margin: 2em 0; }
.buybox img { width: 140px; flex: none; border-radius: 3px; box-shadow: 0 10px 24px rgba(0, 0, 0, .5); }
.buybox-h { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: 1.6rem; line-height: 1.05; }
.buybox p { color: var(--muted); }
.buybox .buy-row { margin-bottom: 0; }
.buybox .btn { font-size: 1rem; }
@media (max-width: 560px) { .buybox, .code-side .buybox { flex-direction: column; } .buybox img { width: 120px; } }

.hub-head { padding-top: 24px !important; }
.filter input { width: 100%; max-width: 440px; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; font: 1rem var(--sans); }
.filter input:focus { outline: 2px solid var(--yellow); border-color: transparent; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.formula { list-style: none; padding: 0; }
.formula li { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; font-family: var(--mono); font-size: .93rem; }
.formula b { color: var(--yellow); font-family: var(--sans); }
.prose { max-width: 760px; }

/* calculator */
.calc { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px !important; margin-top: 24px; }
.calc-in { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.calc label { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; color: var(--muted); font-weight: 500; }
.calc input { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; font: 1.05rem var(--mono); }
.calc-out { display: grid; gap: 12px; }
.calc-out div { background: var(--bg); border: 1px solid var(--line); border-left: 4px solid var(--yellow); border-radius: 8px; padding: 12px 16px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.calc-out small { width: 100%; color: var(--muted); }
.calc-out b { font-family: var(--display); font-size: 2.2rem; line-height: 1; color: var(--yellow); }
@media (max-width: 760px) { .calc { grid-template-columns: 1fr; } .calc-in { grid-template-columns: 1fr; } }

/* cheat sheet */
.sheet { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.cs { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 18px; font-size: .9rem; }
.cs li { break-inside: avoid; padding: 2px 0; border-bottom: 1px dotted var(--line); }
.cs b { font-family: var(--mono); color: var(--yellow); display: inline-block; min-width: 3.4em; }
.sheet-foot { grid-column: 1 / -1; color: var(--muted); font-size: .85rem; }
@media (max-width: 760px) { .sheet { grid-template-columns: 1fr; } .cs { columns: 1; } }

/* footer */
.foot { margin-top: 64px; background: #151515; border-top: 1px solid var(--line); padding: 44px 0 24px; color: var(--muted); font-size: .95rem; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 28px; }
.foot-grid a:not(.btn) { display: block; color: var(--muted); text-decoration: none; padding: 3px 0; }
.foot-grid a:not(.btn):hover { color: var(--text); }
.foot-brand { font-family: var(--display); font-weight: 800; font-size: 1.4rem; text-transform: uppercase; color: var(--text); }
.foot-brand b { color: var(--yellow); }
.foot-h { font-family: var(--display); text-transform: uppercase; letter-spacing: .12em; color: var(--text); font-weight: 700; }
.fine { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 18px; font-size: .82rem; color: #8a8a8a; }
.fine-inline { font-size: .82rem; color: #8a8a8a; }
@media (max-width: 760px) {
  .foot-grid { grid-template-columns: 1fr 1fr; } .foot-grid > div:first-child { grid-column: 1 / -1; }
  /* 44px-ish tap targets on touch screens */
  .foot-grid a:not(.btn) { padding: 11px 0; }
  .crumbs a, .meta a { display: inline-block; padding: 10px 0; }
  .crumbs ol { padding-top: 6px; align-items: center; }
  .copy { padding: 8px 14px; }
}

:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

@media print {
  .bar, .foot, .crumbs, .noprint, .noprint-head, .buybox, .copy { display: none !important; }
  body { background: #fff; color: #000; font-size: 10pt; }
  .sheet { grid-template-columns: 1fr 1fr; gap: 10px; }
  .sheet h2 { font-size: 13pt; margin: 0 0 4px; color: #000; }
  .cs { font-size: 7.5pt; columns: 2; }
  .cs b { color: #000; }
  .cs li { border-color: #ccc; padding: 0; }
  .sheet-foot { color: #444; }
  section.wrap { padding: 0; }
  a { color: #000; }
}
