/* Chapong design system — energetic: ember orange → magenta. */
:root {
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", var(--font-sans);
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --bg: #fffaf6;
  --bg-alt: #fff1e8;
  --surface: #ffffff;
  --border: #f0dccf;
  --text: #1c1210;
  --text-muted: #5e4a42;
  --accent: #d9400b;          /* AA on white for text */
  --accent-strong: #b8330a;
  --accent-2: #c2185b;
  --accent-contrast: #ffffff;
  --grad: linear-gradient(120deg, #ff5a1f 0%, #ff2f6d 55%, #c2185b 100%);
  --btn-grad: linear-gradient(120deg, #c93a08 0%, #c2185b 100%);
  --code-bg: #1c1210;
  --code-text: #ffe9dc;
  --ok: #157a3d;
  --no: #a2271a;
  --focus: #2563eb;
  --shadow: 0 1px 2px rgba(60, 20, 0, .06), 0 8px 24px rgba(60, 20, 0, .06);
  --radius: 14px;
  --maxw: 1120px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #120b09;
    --bg-alt: #1b110d;
    --surface: #1f1410;
    --border: #3a2620;
    --text: #fbefe9;
    --text-muted: #c9b2a7;
    --accent: #ff7a45;
    --accent-strong: #ff9466;
    --accent-2: #ff5c8d;
    --accent-contrast: #1c0b04;
    --code-bg: #0b0605;
    --code-text: #ffe9dc;
    --ok: #4ade80;
    --no: #ff8a7a;
    --focus: #93c5fd;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 var(--font-sans); -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.2rem, 5.5vw, 4rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
code, pre, kbd { font-family: var(--font-mono); font-size: .9em; }
:not(pre) > code { background: var(--bg-alt); border: 1px solid var(--border); padding: .1em .35em; border-radius: 6px; overflow-wrap: anywhere; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--surface); padding: .6rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; top: 1rem; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }
.muted { color: var(--text-muted); }
.eyebrow { font: 600 .78rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--accent); margin-bottom: 1rem; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.nav { display: flex; align-items: center; gap: 1rem; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font: 700 1.2rem/1 var(--font-display); color: var(--text); text-decoration: none; letter-spacing: -.02em; }
.brand svg { width: 28px; height: 28px; }
.nav-links { display: flex; gap: 1.4rem; margin-left: auto; align-items: center; list-style: none; padding: 0; margin-top: 0; margin-bottom: 0; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-weight: 500; font-size: .95rem; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: .4rem .6rem; font: inherit; cursor: pointer; }
@media (max-width: 760px) {
  .nav-toggle { display: inline-block; }
  .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--bg); border-bottom: 1px solid var(--border); padding: .5rem 16px 1rem; }
  .nav-links.open { display: flex; }
  .nav-links li a { display: block; padding: .7rem 0; }
  .nav-links .btn { margin-top: .5rem; text-align: center; }
}

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .75rem 1.25rem; border-radius: 999px; font-weight: 600; text-decoration: none; border: 1px solid transparent; cursor: pointer; font-size: 1rem; line-height: 1.2; }
.btn-primary { background: var(--btn-grad, var(--grad)); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { color: #fff; filter: brightness(1.07); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { color: var(--text); background: var(--bg-alt); }
.btn-sm { padding: .5rem .95rem; font-size: .9rem; }
.nav-links .btn-primary { color: #fff; }

/* ---------- sections ---------- */
section { padding: 72px 0; }
@media (min-width: 720px) { section { padding: 96px 0; } }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 680px; margin-bottom: 2.5rem; }
.section-head p { color: var(--text-muted); font-size: 1.1rem; }

.hero { padding: 72px 0 64px; position: relative; overflow: hidden; }
@media (min-width: 720px) { .hero { padding: 112px 0 96px; } }
.hero::before { content: ""; position: absolute; inset: -40% -20% auto auto; width: 70vw; height: 70vw; max-width: 820px; max-height: 820px; background: var(--grad); opacity: .14; filter: blur(80px); border-radius: 50%; pointer-events: none; }
.hero-inner { position: relative; display: grid; gap: 48px; align-items: center; }
@media (min-width: 960px) { .hero-inner { grid-template-columns: 1.1fr .9fr; } }
.hero .lede { font-size: clamp(1.1rem, 2vw, 1.3rem); color: var(--text-muted); max-width: 40ch; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.pill { display: inline-flex; gap: .5rem; align-items: center; border: 1px solid var(--border); background: var(--surface); padding: .3rem .8rem; border-radius: 999px; font-size: .85rem; color: var(--text-muted); margin-bottom: 1.4rem; }
.pill b { color: var(--accent); font-weight: 600; }

/* ---------- cards / grid ---------- */
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card h3 { margin-bottom: .4rem; }
.card p { color: var(--text-muted); margin: 0; font-size: .97rem; }
.icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--bg-alt); color: var(--accent); margin-bottom: 1rem; border: 1px solid var(--border); }
.icon svg { width: 22px; height: 22px; }

.steps { counter-reset: step; display: grid; gap: 16px; list-style: none; padding: 0; margin: 0; }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { counter-increment: step; position: relative; padding: 24px; padding-top: 64px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.steps li::before { content: counter(step, decimal-leading-zero); position: absolute; top: 20px; left: 24px; font: 700 1.6rem/1 var(--font-display); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.steps p { color: var(--text-muted); margin: 0; }

/* ---------- code ---------- */
.code { position: relative; background: var(--code-bg); color: var(--code-text); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; }
.code-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,.08); font: 500 .78rem/1 var(--font-mono); color: rgba(255,255,255,.55); }
.code-bar i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.18); display: inline-block; }
.code-bar span { margin-left: 8px; }
.code pre { margin: 0; padding: 18px 20px; overflow-x: auto; line-height: 1.7; font-size: .88rem; }
.code .c { color: rgba(255,255,255,.45); }
.code .p { color: var(--accent); user-select: none; }
.code .s { color: #9ae6b4; }
.code .k { color: #f9a8d4; }
.copy { position: absolute; top: 6px; right: 8px; background: rgba(255,255,255,.08); color: rgba(255,255,255,.75); border: 1px solid rgba(255,255,255,.14); border-radius: 8px; font: 500 .75rem/1 var(--font-sans); padding: .4rem .6rem; cursor: pointer; }
.copy:hover { background: rgba(255,255,255,.16); }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; min-width: 560px; font-size: .95rem; }
th, td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th { font-family: var(--font-display); background: var(--bg-alt); }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tbody th { font-weight: 500; }
.yes { color: var(--ok); font-weight: 600; }
.no { color: var(--no); font-weight: 600; }
.mid { color: var(--text-muted); }

/* ---------- pricing ---------- */
.price-card { display: grid; gap: 24px; align-items: center; }
@media (min-width: 860px) { .price-card { grid-template-columns: 1.3fr 1fr; } }
.price { font: 700 2.4rem/1.1 var(--font-display); margin: .25rem 0 .5rem; }
.todo { display: inline-block; font: 600 .75rem/1.3 var(--font-mono); background: #fff3bf; color: #5c4400; border: 1px dashed #b58b00; padding: .15rem .45rem; border-radius: 6px; vertical-align: middle; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.checklist li { padding-left: 1.7rem; position: relative; }
.checklist li::before { content: ""; position: absolute; left: 0; top: .35em; width: 1rem; height: 1rem; border-radius: 50%; background: var(--grad); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 0a8 8 0 100 16A8 8 0 008 0zm3.7 5.7l-4.5 4.5a1 1 0 01-1.4 0L3.3 7.7a1 1 0 011.4-1.4l1.8 1.8 3.8-3.8a1 1 0 011.4 1.4z'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 0a8 8 0 100 16A8 8 0 008 0zm3.7 5.7l-4.5 4.5a1 1 0 01-1.4 0L3.3 7.7a1 1 0 011.4-1.4l1.8 1.8 3.8-3.8a1 1 0 011.4 1.4z'/%3E%3C/svg%3E") center/contain no-repeat; }
.badge { display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: .2rem .5rem; border-radius: 999px; background: var(--bg-alt); color: var(--accent); border: 1px solid var(--border); vertical-align: middle; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 10px; max-width: 820px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0 20px; }
.faq summary { cursor: pointer; padding: 18px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--text-muted); margin: 0 0 18px; }

/* ---------- CTA band + footer ---------- */
.cta-band { text-align: center; }
.cta-band .hero-ctas { justify-content: center; }
.site-footer { border-top: 1px solid var(--border); padding: 48px 0 40px; font-size: .92rem; color: var(--text-muted); }
.footer-grid { display: grid; gap: 32px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer h4 { font-size: .85rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.site-footer a { color: var(--text-muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }
.footer-base { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; }

/* ---------- docs layout ---------- */
.docs { display: grid; gap: 40px; grid-template-columns: minmax(0, 1fr); padding-top: 48px; padding-bottom: 96px; }
@media (min-width: 960px) { .docs { grid-template-columns: 230px minmax(0, 1fr); } }
.toc { font-size: .93rem; }
@media (min-width: 960px) { .toc { position: sticky; top: 88px; align-self: start; max-height: calc(100vh - 110px); overflow: auto; } }
.toc h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--text-muted); font-family: var(--font-mono); }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; border-left: 1px solid var(--border); }
.toc a { display: block; padding: .3rem .9rem; color: var(--text-muted); text-decoration: none; margin-left: -1px; border-left: 2px solid transparent; }
.toc a:hover, .toc a.active { color: var(--text); border-left-color: var(--accent); }
.prose { max-width: 760px; }
.prose h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.prose h2 { margin-top: 2.6rem; padding-top: .5rem; scroll-margin-top: 84px; font-size: 1.6rem; }
.prose h3 { margin-top: 1.8rem; scroll-margin-top: 84px; }
.prose .code { margin: 1rem 0 1.4rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin: .3rem 0; }
.prose .table-wrap { margin: 1rem 0 1.4rem; }
.prose table { min-width: 480px; }
.note { border: 1px solid var(--border); border-left: 4px solid var(--accent); background: var(--bg-alt); padding: 14px 18px; border-radius: 10px; margin: 1rem 0 1.4rem; }
.note p:last-child { margin: 0; }

/* ---------- 404 ---------- */
.notfound { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 64px 16px; }
.notfound .big { font: 700 clamp(5rem, 18vw, 10rem)/1 var(--font-display); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
