/* Ayam Labs - design tokens */
:root {
  --bg: #08090a;
  --bg-soft: #0c0e10;
  --bg-raised: #111417;
  --line: #1e2328;
  --line-bright: #2f363d;
  --text: #e9ecef;
  --text-dim: #b3bac1;
  --muted: #7d868f;
  --accent: #ff6a2b;
  --accent-soft: rgba(255, 106, 43, 0.12);
  --ok: #6ee7a8;
  --warn: #ffcc66;
  --bad: #ff7b72;
  --radius: 3px;
  --max: 1120px;
  --font-display: "Sora", ui-sans-serif, system-ui, sans-serif;
  --font-body: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 72px 72px;
  background-position: center top;
}

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; margin: 0; }
h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1rem; color: var(--text-dim); }

.mono { font-family: var(--font-mono); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--accent); display: inline-block; }

/* header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(8, 9, 10, 0.86); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.site-header .inner { display: flex; align-items: center; justify-content: space-between; height: 62px; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; font-size: 1rem; }
.brand .mark { width: 20px; height: 20px; display: grid; place-items: center; border: 1px solid var(--accent); color: var(--accent); font-family: var(--font-mono); font-size: 11px; }
.nav { display: flex; align-items: center; gap: 22px; font-size: 0.88rem; color: var(--muted); }
.nav a { color: var(--muted); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
@media (max-width: 760px) { .nav { display: none; } }

/* hero */
.hero { padding: clamp(56px, 9vw, 104px) 0 clamp(40px, 6vw, 72px); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }
.hero h1 { margin: 18px 0 20px; }
.hero .lede { font-size: clamp(1rem, 1.6vw, 1.12rem); color: var(--text-dim); max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border: 1px solid var(--line-bright); background: var(--bg-raised); color: var(--text); font-size: 0.9rem; font-family: var(--font-body); border-radius: var(--radius); cursor: pointer; transition: border-color 160ms ease, background 160ms ease, transform 160ms ease; }
.btn:hover { border-color: var(--accent); color: var(--text); transform: translateY(-1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #140a05; font-weight: 600; }
.btn-primary:hover { background: #ff7d47; color: #140a05; }
.btn-sm { padding: 7px 12px; font-size: 0.8rem; }

/* terminal */
.terminal { border: 1px solid var(--line-bright); background: #060708; border-radius: var(--radius); overflow: hidden; font-family: var(--font-mono); font-size: 0.78rem; }
.terminal .bar { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; }
.terminal .bar i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-bright); display: inline-block; }
.terminal .body { padding: 14px; overflow-x: auto; line-height: 1.65; }
.terminal .body pre { margin: 0; font-family: inherit; white-space: pre-wrap; overflow-wrap: anywhere; }
.terminal .body pre + pre { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.terminal .body .dim { color: var(--text-dim); }
.tok-key { color: #79c0ff; }
.tok-str { color: #a5d6a7; }
.tok-num { color: #ffab70; }
.tok-bool { color: #d2a8ff; }
.tok-null { color: var(--muted); }
.tok-cmd { color: var(--accent); }

/* sections */
section { padding: clamp(44px, 7vw, 80px) 0; border-bottom: 1px solid var(--line); }
section:last-of-type { border-bottom: none; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; margin-bottom: 30px; flex-wrap: wrap; }
.section-head h2 { max-width: 30ch; }
.section-num { font-family: var(--font-mono); font-size: 0.74rem; color: var(--accent); letter-spacing: 0.12em; }

/* product registry */
.registry { border-top: 1px solid var(--line); }
.registry-row { display: grid; grid-template-columns: 44px minmax(0, 1.6fr) minmax(0, 1.5fr) 120px 120px 28px; align-items: center; gap: 18px; padding: 20px 4px; border-bottom: 1px solid var(--line); transition: background 160ms ease, padding 160ms ease; }
.registry-row:hover { background: var(--bg-soft); padding-left: 12px; }
.registry-row .idx { font-family: var(--font-mono); font-size: 0.74rem; color: var(--muted); }
.registry-row .pname { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; }
.registry-row .pdesc { font-size: 0.88rem; color: var(--muted); line-height: 1.45; }
.registry-row .pprice { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-dim); }
.registry-row .parrow { color: var(--muted); font-family: var(--font-mono); text-align: right; }
@media (max-width: 900px) {
  .registry-row { grid-template-columns: 32px 1fr; row-gap: 6px; }
  .registry-row .pdesc, .registry-row .pprice, .registry-row .parrow { grid-column: 2; }
}

.status-dot { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); }
.status-dot i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 3px rgba(125, 134, 143, 0.14); }
.status-dot[data-state="ok"] i { background: var(--ok); box-shadow: 0 0 0 3px rgba(110, 231, 168, 0.14); }
.status-dot[data-state="bad"] i { background: var(--bad); box-shadow: 0 0 0 3px rgba(255, 123, 114, 0.14); }

/* feature grid */
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.grid-3 > div { background: var(--bg); padding: 24px; }
@media (max-width: 820px) { .grid-3 { grid-template-columns: 1fr; } }
.grid-3 h3 { margin-bottom: 8px; }
.grid-3 p { font-size: 0.9rem; margin: 0; }

/* endpoint table */
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th { text-align: left; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 10px 12px; border-bottom: 1px solid var(--line-bright); }
td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--text-dim); }
tr:hover td { background: var(--bg-soft); }
.method { font-family: var(--font-mono); font-size: 0.72rem; padding: 3px 7px; border: 1px solid var(--line-bright); border-radius: 2px; color: var(--text-dim); white-space: nowrap; }
.method.get { color: #79c0ff; border-color: #1f3a52; }
.method.post { color: var(--accent); border-color: #4a2418; }
.path { font-family: var(--font-mono); font-size: 0.82rem; color: var(--text); white-space: nowrap; }

/* code block */
.code-block { position: relative; border: 1px solid var(--line); border-radius: var(--radius); background: #060708; overflow: hidden; }
.code-block .cb-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.code-block pre { margin: 0; padding: 14px; overflow-x: auto; font-family: var(--font-mono); font-size: 0.78rem; line-height: 1.7; color: #c9d1d9; }
.copy-btn { background: transparent; border: 1px solid var(--line-bright); color: var(--muted); font-family: var(--font-mono); font-size: 0.68rem; padding: 3px 8px; border-radius: 2px; cursor: pointer; }
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }

/* pricing */
.pricing { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.pricing > div { background: var(--bg); padding: 22px 20px; }
.pricing .tier { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.pricing .price { font-family: var(--font-display); font-size: 1.9rem; margin: 8px 0 2px; }
.pricing .req { font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-dim); }
.pricing .sub { font-size: 0.8rem; color: var(--muted); margin-top: 8px; }
.pricing .featured { background: var(--bg-raised); box-shadow: inset 0 2px 0 var(--accent); }
@media (max-width: 820px) { .pricing { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* faq */
details { border-bottom: 1px solid var(--line); padding: 16px 0; }
details summary { cursor: pointer; font-family: var(--font-display); font-size: 1rem; list-style: none; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; color: var(--accent); font-family: var(--font-mono); font-size: 1.1rem; }
details[open] summary::after { content: "-"; }
details p { margin: 12px 0 0; font-size: 0.92rem; }

/* footer */
.site-footer { padding: 44px 0 60px; font-size: 0.85rem; color: var(--muted); }
.site-footer .cols { display: flex; flex-wrap: wrap; gap: 40px; justify-content: space-between; }
.site-footer a { color: var(--text-dim); }
.site-footer .fine { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 0.78rem; line-height: 1.6; max-width: 70ch; }

/* utility */
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.stats { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 26px; }
@media (max-width: 560px) { .stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 26px; } }
.tag { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line-bright); padding: 3px 7px; border-radius: 2px; }
.reveal { opacity: 1; transform: none; }
html.js .reveal { opacity: 0; transform: translateY(10px); transition: opacity 420ms ease, transform 420ms ease; }
html.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { html.js .reveal { opacity: 1; transform: none; } }
.note { border-left: 2px solid var(--accent); padding: 12px 16px; background: var(--accent-soft); font-size: 0.88rem; color: var(--text-dim); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
