/* WarungAPI — main site stylesheet */
:root {
    --bg: #f2f0eb;
    --surface: #e7e4de;
    --surface-strong: #d7d3cc;
    --text: #201d1d;
    --muted: #686260;
    --line: #aaa5a0;
    --accent: #24d36b;
    --accent-hover: #18bd5b;
    --accent-text: #102417;
    --danger: #e8614f;
    --page: min(100% - 2rem, 1180px);
    --mono: "IBM Plex Mono", monospace;
    --sans: "IBM Plex Sans", sans-serif;
    color-scheme: light;
}
:root[data-theme="dark"] {
    --bg: #181616;
    --surface: #242121;
    --surface-strong: #312d2d;
    --text: #f0ece8;
    --muted: #aaa3a0;
    --line: #504a49;
    --accent: #35dc78;
    --accent-hover: #59e48f;
    --accent-text: #102417;
    color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    -webkit-font-smoothing: antialiased;
    transition: background-color .2s ease, color .2s ease;
}
body.menu-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
code, pre { font-family: var(--mono); }
section { scroll-margin-top: 5rem; }
::selection { background: var(--accent); color: var(--accent-text); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.container { width: var(--page); margin-inline: auto; }
.skip-link {
    position: fixed; z-index: 100; top: .75rem; left: .75rem;
    padding: .75rem 1rem; background: var(--accent); color: var(--accent-text);
    font: 600 .75rem var(--mono); transform: translateY(-180%);
}
.skip-link:focus { transform: translateY(0); }
.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;
}
.kicker {
    display: inline-flex; align-items: center; gap: .55rem; margin: 0;
    color: var(--muted); font: 500 .7rem/1.4 var(--mono);
    letter-spacing: .055em; text-transform: uppercase;
}
.dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--accent) 18%, transparent); animation: pulse-ring 2.4s ease-out infinite; }
.button {
    display: inline-flex; min-height: 3rem; align-items: center; justify-content: center; gap: .8rem;
    padding: .72rem 1rem; border: 1px solid var(--text); background: var(--text); color: var(--bg);
    font: 600 .72rem var(--mono); letter-spacing: .035em; text-transform: uppercase;
    cursor: pointer; transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.button:hover { background: transparent; color: var(--text); }
.button--accent { border-color: var(--accent); background: var(--accent); color: var(--accent-text); }
.button--accent:hover { border-color: var(--accent-hover); background: var(--accent-hover); color: var(--accent-text); }
.button--ghost { background: transparent; color: var(--text); }
.button--ghost:hover { background: var(--text); color: var(--bg); }
.arrow { font-size: 1rem; line-height: 1; transition: transform .18s ease; }

.site-header { position: sticky; z-index: 30; top: 0; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(14px); }
.nav { display: grid; min-height: 4.25rem; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; width: max-content; font: 600 .9rem var(--mono); letter-spacing: -.04em; }
.brand-mark { display: block; width: 2rem; height: 2rem; object-fit: contain; }
.brand-accent { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a { padding-block: .3rem; border-bottom: 1px solid transparent; color: var(--muted); font: 500 .7rem var(--mono); text-transform: uppercase; transition: color .18s ease, border-color .18s ease; }
.nav-links a:hover { border-color: var(--text); color: var(--text); }
.nav-links a[aria-current="page"] { border-color: var(--accent); color: var(--text); }
.nav-actions { display: flex; justify-self: end; align-items: center; gap: .65rem; }
.nav-cta { min-height: 2.55rem; padding: .6rem .85rem; }
.theme-toggle, .menu-toggle {
    min-width: 2.55rem; min-height: 2.55rem; padding: .5rem; border: 1px solid var(--line);
    background: transparent; font: 500 .68rem var(--mono); cursor: pointer;
}
.theme-toggle { display: grid; place-items: center; }
.theme-toggle:hover, .menu-toggle:hover { background: var(--surface); }
.menu-toggle { display: none; }
.menu-toggle-icon { display: grid; place-items: center; }
.menu-toggle-icon--close { display: none; }
.menu-toggle[aria-expanded="true"] .menu-toggle-icon--open { display: none; }
.menu-toggle[aria-expanded="true"] .menu-toggle-icon--close { display: grid; }

.announcement { border-bottom: 1px solid var(--line); background: var(--surface); }
.announcement .container { display: flex; min-height: 2.75rem; align-items: center; justify-content: center; gap: .75rem; text-align: center; font: 500 .7rem var(--mono); }
.announcement strong { padding: .2rem .4rem; background: var(--text); color: var(--bg); font-weight: 500; text-transform: uppercase; }

.hero { padding: clamp(4rem, 9vw, 7.5rem) 0 3rem; }
.hero-inner { max-width: 920px; margin-inline: auto; text-align: center; }
.hero-badge { margin-bottom: 2rem; }
.hero h1 { margin: 0; font: 500 clamp(3rem, 8vw, 6.7rem)/.98 var(--sans); letter-spacing: -.065em; text-wrap: balance; }
.hero h1 span { color: var(--muted); }
.hero-lead { max-width: 680px; margin: 1.75rem auto 0; color: var(--muted); font-size: clamp(1rem, 2vw, 1.22rem); line-height: 1.55; text-wrap: balance; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin-top: 2rem; }
.hero-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.5rem; margin-top: 1.4rem; color: var(--muted); font: .68rem var(--mono); }
.hero-meta span::before { content: "✓"; margin-right: .45rem; color: var(--text); }

.usage { padding: 2rem 0 clamp(5rem, 9vw, 8rem); }
.usage-shell { border: 1px solid var(--line); background: var(--surface); box-shadow: 10px 10px 0 var(--surface-strong); }
.usage-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1rem; border-bottom: 1px solid var(--line); }
.window-dots { display: flex; gap: .35rem; }
.window-dots i { width: .45rem; height: .45rem; border-radius: 50%; background: var(--line); }
.plans-intro { padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1.5rem, 4vw, 3rem) clamp(1.25rem, 3vw, 1.75rem); }
.plans-intro h2 { margin: .8rem 0 0; font: 500 clamp(2rem, 4.5vw, 3.2rem)/1 var(--sans); letter-spacing: -.055em; }
.plans-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.plan-card { display: flex; flex-direction: column; padding: clamp(1.5rem, 3vw, 2rem) clamp(1.25rem, 2.5vw, 2rem) clamp(1.75rem, 3vw, 2.25rem); border-right: 1px solid var(--line); transition: background-color .18s ease; }
.plan-card:last-child { border-right: 0; }
.plan-card:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.plan-name { display: flex; align-items: center; gap: .55rem; margin: 0; color: var(--muted); font: 500 .72rem var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.plan-badge { padding: .16rem .45rem; background: var(--accent); color: var(--accent-text); font: 600 .56rem/1.2 var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.plan-price { margin: .9rem 0 0; font: 500 clamp(2.4rem, 5vw, 3.2rem)/.9 var(--mono); letter-spacing: -.07em; }
.plan-price small { font-size: .72rem; letter-spacing: 0; }
.plan-hook { margin: .8rem 0 0; color: var(--muted); font: 500 .68rem/1.6 var(--mono); }
.plan-hook strong { color: var(--text); font-weight: 600; }
.plan-specs { margin: 1.4rem 0 0; border-top: 1px solid var(--line); }
.spec-row { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.spec-label { color: var(--muted); font: .64rem var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.spec-value { font: 500 .7rem var(--mono); text-align: right; }
.plan-features { display: grid; gap: .5rem; margin: 1.3rem 0 0; padding: 0; list-style: none; }
.plan-features li { color: var(--muted); font-size: .78rem; line-height: 1.5; }
.plan-features li::before { content: "✓"; margin-right: .5rem; color: var(--text); font: 500 .68rem var(--mono); }
.plan-cta { display: inline-block; margin-top: auto; padding-top: 1.75rem; align-self: flex-start; border-bottom: 1px solid currentColor; font: 500 .68rem var(--mono); letter-spacing: .035em; text-transform: uppercase; }
.usage-foot { display: flex; justify-content: space-between; gap: 1rem; padding: .9rem clamp(1.5rem, 4vw, 3rem) 1.1rem; border-top: 1px solid var(--line); color: var(--muted); font: .66rem/1.5 var(--mono); }

.section { padding: clamp(5rem, 10vw, 8rem) 0; border-top: 1px solid var(--line); }
.section-heading { display: grid; grid-template-columns: .55fr 1.45fr; gap: 2rem; margin-bottom: clamp(3rem, 6vw, 5rem); }
.section-heading h2, .section-heading h1 { max-width: 14ch; margin: 0; font: 500 clamp(2.3rem, 5vw, 4.5rem)/1.02 var(--sans); letter-spacing: -.055em; text-wrap: balance; }
.section-heading p:not(.kicker) { max-width: 37rem; margin: 1.2rem 0 0; color: var(--muted); line-height: 1.6; }
main > .section:first-child { border-top: 0; }
.usage--page { padding: clamp(3rem, 6vw, 5rem) 0 clamp(5rem, 9vw, 8rem); }
.plans-intro h1 { margin: .8rem 0 0; font: 500 clamp(2rem, 4.5vw, 3.2rem)/1 var(--sans); letter-spacing: -.055em; }

.explore { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); }
.explore a { padding: 1.5rem; border-right: 1px solid var(--line); transition: background-color .18s ease; }
.explore a:last-child { border-right: 0; }
.explore a:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.explore h3 { margin: 0 0 .5rem; font: 500 1.2rem var(--sans); letter-spacing: -.02em; }
.explore p { margin: 0 0 .9rem; color: var(--muted); font-size: .85rem; line-height: 1.55; }
.explore .arrow { color: var(--muted); }

.benefit-grid { display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid var(--line); }
.benefit { min-height: 220px; padding: 1.5rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.benefit:nth-child(2n) { border-right: 0; }
.benefit:nth-last-child(-n+2) { border-bottom: 0; }
.benefit-index { color: var(--muted); font: .68rem var(--mono); transition: color .18s ease; }
.benefit:hover .benefit-index { color: var(--accent); }
.benefit h3 { margin: 4rem 0 .75rem; font: 500 1.35rem var(--sans); letter-spacing: -.025em; }
.benefit p { max-width: 30rem; margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.6; }

.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.step { padding: 1.5rem 1.5rem 0 0; border-right: 1px solid var(--line); }
.step + .step { padding-left: 1.5rem; }
.step:last-child { border-right: 0; }
.step-number { display: grid; width: 2.25rem; height: 2.25rem; place-items: center; background: var(--text); color: var(--bg); font: .72rem var(--mono); }
.step h3 { margin: 5rem 0 .8rem; font: 500 1.5rem var(--sans); letter-spacing: -.03em; }
.step p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.6; }
.step a { display: inline-block; margin-top: 1rem; border-bottom: 1px solid currentColor; font: 500 .7rem var(--mono); text-transform: uppercase; }

.code-section { background: #201d1d; color: #f2f0eb; }
.code-section .kicker, .code-section .code-copy p { color: color-mix(in srgb, currentColor 66%, transparent); }
.code-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(2rem, 7vw, 6rem); align-items: center; }
.code-copy h2 { margin: 1rem 0; font: 500 clamp(2.5rem, 5vw, 4.5rem)/1 var(--sans); letter-spacing: -.055em; }
.code-copy p { max-width: 30rem; line-height: 1.6; }
.code-panel { min-width: 0; border: 1px solid #5d5755; background: #0f0e0e; color: #f2f0eb; }
.code-bar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .8rem 1rem; border-bottom: 1px solid #5d5755; color: #aaa3a0; font: .68rem var(--mono); text-transform: uppercase; }
.code-panel pre { overflow-x: auto; margin: 0; padding: clamp(1.2rem, 3vw, 2rem); font-size: clamp(.68rem, 1.4vw, .78rem); line-height: 1.75; }
.code-bar-actions { display: flex; align-items: center; gap: .75rem; }
.code-copy-btn {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .32rem .62rem; border: 1px solid #5d5755; background: transparent; color: #aaa3a0;
    font: 500 .6rem var(--mono); letter-spacing: .04em; text-transform: uppercase; cursor: pointer;
    transition: border-color .18s ease, color .18s ease, background-color .18s ease;
}
.code-copy-btn svg { display: block; }
.code-copy-btn:hover { border-color: #f2f0eb; color: #f2f0eb; }
.code-copy-btn:focus-visible { outline: 2px solid #f2f0eb; outline-offset: 2px; }
.code-copy-btn.copied { border-color: var(--accent); background: var(--accent); color: var(--accent-text); }

.models-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
.models-table { width: 100%; min-width: 700px; border-collapse: collapse; }
.models-table th, .models-table td { padding: 1.25rem 1rem; border-bottom: 1px solid var(--line); text-align: left; }
.models-table th { color: var(--muted); font: 500 .66rem var(--mono); text-transform: uppercase; }
.models-table td { font-size: .9rem; }
.models-table td:first-child { padding-left: 0; font: 500 1.1rem var(--mono); }
.models-table tbody tr { transition: background-color .18s ease; }
.models-table tbody tr:hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
.models-table th:first-child { padding-left: 0; }
.model-copy { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; margin-left: .45rem; padding: 0; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; vertical-align: -0.35rem; transition: background-color .18s ease, color .18s ease, border-color .18s ease; }
.model-copy:hover { background: var(--surface); color: var(--text); }
.model-copy:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.model-copy.copied { border-color: var(--accent); color: var(--accent); }
.status { display: inline-flex; align-items: center; gap: .45rem; font: 500 .65rem var(--mono); text-transform: uppercase; }
.status::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: var(--line); }
.status--live::before { background: var(--accent); animation: pulse-ring 2.4s ease-out infinite; }
.models-note { color: var(--muted); font: .66rem/1.6 var(--mono); text-transform: uppercase; }

.faq-list { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-heading { margin: 0; }
.faq-question { display: grid; width: 100%; grid-template-columns: 3rem 1fr auto; align-items: center; gap: 1rem; padding: 1.5rem 0; border: 0; background: none; text-align: left; cursor: pointer; }
.faq-number, .faq-icon { color: var(--muted); font: .7rem var(--mono); }
.faq-label { font: 500 clamp(1.05rem, 2.2vw, 1.4rem) var(--sans); letter-spacing: -.025em; }
.faq-icon { font-size: 1.15rem; transition: transform .18s ease; }
.faq-answer { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .35s ease; }
.faq-answer-inner { min-height: 0; overflow: hidden; }
.js .faq-answer { grid-template-rows: 0fr; }
.js .faq-item.open .faq-answer { grid-template-rows: 1fr; }
.faq-answer p { max-width: 47rem; margin: 0 0 1.5rem 4rem; color: var(--muted); line-height: 1.65; }
.faq-item.open .faq-icon { transform: rotate(45deg); }

.final-cta { padding: clamp(5rem, 11vw, 9rem) 0; border-top: 1px solid var(--line); text-align: center; }
.final-cta h2 { max-width: 900px; margin: 1.2rem auto; font: 500 clamp(2.8rem, 7vw, 6rem)/.98 var(--sans); letter-spacing: -.065em; text-wrap: balance; }
.final-cta p:not(.kicker) { max-width: 590px; margin: 0 auto; color: var(--muted); line-height: 1.6; }
.final-cta .button { margin-top: 2rem; }

.site-footer { padding: 2rem 0; border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 2rem; }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a, .copyright { color: var(--muted); font: .68rem var(--mono); text-transform: uppercase; }
.footer-links a:hover { color: var(--text); }
.copyright { justify-self: end; margin: 0; }

/* ── Motion ─────────────────────────────────────────────────── */
@keyframes hero-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes reveal-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 40%, transparent); }
    70%, 100% { box-shadow: 0 0 0 .55rem color-mix(in srgb, var(--accent) 0%, transparent); }
}
@keyframes caret-blink { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0; } }
@keyframes mark-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: .2; } }

.js .hero-badge { animation: hero-rise .6s ease-out backwards; }
.js .hero h1 { animation: hero-rise .6s ease-out .08s backwards; }
.js .hero-lead { animation: hero-rise .6s ease-out .16s backwards; }
.js .hero-actions { animation: hero-rise .6s ease-out .24s backwards; }
.js .hero-meta { animation: hero-rise .6s ease-out .32s backwards; }

.js [data-reveal] { opacity: 0; }
.js [data-reveal].revealed { animation: reveal-rise .6s ease-out both; }

.code-panel code.typing::after {
    content: ""; display: inline-block; width: .55em; height: 1.05em;
    margin-left: .15em; vertical-align: text-bottom; background: var(--accent);
    animation: caret-blink .9s steps(1) infinite;
}

@media (max-width: 840px) {
    .nav { grid-template-columns: 1fr auto auto; }
    .menu-toggle { display: grid; place-items: center; }
    .nav-cta { display: none; }
    .nav-links { position: fixed; inset: 4.25rem 0 auto; display: flex; align-items: stretch; flex-direction: column; gap: 0; padding: .5rem 1rem 1rem; border-bottom: 1px solid var(--line); background: var(--bg); }
    .js .nav-links { display: none; }
    .js .nav-links.open { display: flex; }
    .nav-links a { padding: 1rem 0; border-bottom: 1px solid var(--line); }
    .section-heading, .code-grid { grid-template-columns: 1fr; }
    .plans-grid { grid-template-columns: 1fr; }
    .plan-card { border-right: 0; border-bottom: 1px solid var(--line); }
    .plan-card:last-child { border-bottom: 0; }
    .usage-foot { flex-direction: column; gap: .35rem; }
    .section-heading { gap: 1.5rem; }
    .steps-grid { grid-template-columns: 1fr; }
    .step, .step + .step { padding: 1.5rem 0 2rem; border-right: 0; border-bottom: 1px solid var(--line); }
    .step:last-child { border-bottom: 0; }
    .step h3 { margin-top: 3rem; }
    .explore { grid-template-columns: 1fr; }
    .explore a { border-right: 0; border-bottom: 1px solid var(--line); }
    .explore a:last-child { border-bottom: 0; }
}
@media (max-width: 580px) {
    :root { --page: min(100% - 1.25rem, 1180px); }
    .models-table { min-width: 620px; }
    .models-table th, .models-table td { padding: .55rem .55rem; }
    .models-table td { font-size: .78rem; }
    .models-table td:first-child { font-size: .88rem; }
    .model-copy { width: 1.3rem; height: 1.3rem; margin-left: .35rem; vertical-align: -0.3rem; }
    .announcement .container { justify-content: flex-start; overflow-x: auto; white-space: nowrap; }
    .hero { padding-top: 3.5rem; }
    .hero h1 { font-size: clamp(2.8rem, 14vw, 4.6rem); }
    .hero-actions { flex-direction: column; }
    .hero-actions .button { width: 100%; }
    .hero-meta { align-items: flex-start; flex-direction: column; padding-left: .5rem; }
    .usage-shell { box-shadow: 5px 5px 0 var(--surface-strong); }
    .benefit-grid { grid-template-columns: 1fr; }
    .benefit, .benefit:nth-child(2n), .benefit:nth-last-child(-n+2) { border-right: 0; border-bottom: 1px solid var(--line); }
    .benefit:last-child { border-bottom: 0; }
    .faq-question { grid-template-columns: 2rem 1fr auto; }
    .faq-answer p { margin-left: 3rem; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-links { flex-wrap: wrap; }
    .copyright { justify-self: start; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
