
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef0f4;
  --ink: #1d2330;
  --muted: #5d6576;
  --line: #e1e4ea;
  --accent: #3b5bdb;
  --accent-ink: #ffffff;
  --accent-2: #e8590c;
  --link: var(--accent);
  --ok: #2b8a3e;
  --warn: #b7791f;
  --danger: #c92a2a;
  --header-bg: var(--surface);
  --header-ink: var(--ink);

  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: var(--font-body);
  --font-num: var(--font-display);
  --step--1: clamp(.8rem, .78rem + .1vw, .86rem);
  --step-0: clamp(1rem, .97rem + .15vw, 1.08rem);
  --step-1: clamp(1.2rem, 1.13rem + .35vw, 1.4rem);
  --step-2: clamp(1.44rem, 1.3rem + .7vw, 1.85rem);
  --step-3: clamp(1.73rem, 1.48rem + 1.25vw, 2.5rem);
  --step-4: clamp(2.07rem, 1.65rem + 2.1vw, 3.4rem);
  --step-5: clamp(2.5rem, 1.8rem + 3.5vw, 4.6rem);
  --display-weight: 700;
  --display-tracking: -0.02em;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px;
  --r-sm: 6px; --r: 12px; --r-lg: 20px; --r-pill: 999px;
  --shadow-1: 0 1px 2px rgb(16 24 40 / .06), 0 1px 3px rgb(16 24 40 / .08);
  --shadow-2: 0 12px 32px -12px rgb(16 24 40 / .28);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur: .18s;
  --max: 1120px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12151c; --surface: #1a1f29; --surface-2: #222836; --ink: #eef1f6; --muted: #a2aab8; --line: #2d3443;
    --header-bg: var(--surface); --header-ink: var(--ink);
    --shadow-1: 0 1px 2px rgb(0 0 0 / .4); --shadow-2: 0 12px 32px -12px rgb(0 0 0 / .6);
    color-scheme: dark;
  }
}
@media (prefers-reduced-motion: reduce) { :root { --dur: 0s; } *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: var(--step-0)/1.55 var(--font-body); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
a { color: var(--link); text-underline-offset: .15em; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; border-radius: var(--r-sm); }
h1, h2, h3 { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); line-height: 1.05; margin: 0 0 .45em; text-wrap: balance; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
p { margin: 0 0 1em; max-width: 68ch; text-wrap: pretty; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 560px; }
.stack > * + * { margin-top: var(--s4); }
.muted { color: var(--muted); }
.small { font-size: var(--step--1); }
.center { text-align: center; }
.center p { margin-inline: auto; }
.section { padding: var(--s7) 0; }
.row { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.spread { display: flex; gap: var(--s3); align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grid { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header & footer */
.site-header { background: var(--header-bg); color: var(--header-ink); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 900; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); min-height: 60px; }
.brand { font-family: var(--font-display); font-weight: var(--display-weight); font-size: var(--step-1); letter-spacing: var(--display-tracking); text-decoration: none; color: inherit; }
.nav { display: flex; gap: var(--s4); align-items: center; font-size: .95rem; overflow-x: auto; scrollbar-width: none; }
.nav a { color: inherit; opacity: .78; text-decoration: none; white-space: nowrap; padding: var(--s2) 0; }
.nav a:hover, .nav a[aria-current="page"] { opacity: 1; }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
@media (max-width: 640px) {
  .site-header { position: static; }
  .site-header .container { flex-wrap: wrap; gap: 0 var(--s4); padding-top: var(--s2); }
  .nav { width: 100%; gap: var(--s4); }
}
.site-footer { border-top: 1px solid var(--line); padding: var(--s5) 0; font-size: var(--step--1); color: var(--muted); }
.site-footer a { color: var(--muted); }
.footer-note { margin: var(--s2) 0 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); padding: 11px 20px; border-radius: var(--r-pill); border: 1px solid transparent; background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 700; line-height: 1.2; text-decoration: none; cursor: pointer; transition: transform var(--dur) var(--ease), filter var(--dur) var(--ease); }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn-lg { padding: 15px 28px; font-size: var(--step-1); }
.btn-block { width: 100%; }

/* Surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s5); box-shadow: var(--shadow-1); }
.badge { display: inline-block; padding: 2px 9px; border-radius: var(--r-pill); font-size: var(--step--1); font-weight: 700; background: var(--surface-2); color: var(--muted); vertical-align: middle; }
.badge-accent { background: var(--accent); color: var(--accent-ink); }
.badge-ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.badge-danger { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.notice { padding: var(--s3) var(--s4); border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); border-left-width: 4px; }
.notice-ok { border-left-color: var(--ok); }
.notice-error { border-left-color: var(--danger); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s3); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s3) var(--s4); }
.stat-label { font-size: var(--step--1); color: var(--muted); }
.stat-value { font-family: var(--font-num); font-size: var(--step-2); font-weight: var(--display-weight); font-variant-numeric: tabular-nums; line-height: 1.1; margin-top: 2px; }
.stat-hint { font-size: var(--step--1); color: var(--muted); margin-top: 2px; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .9rem; font-weight: 700; }
.field input, .field textarea, .field select, select { font: inherit; padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.field input:focus, .field textarea:focus, select:focus { outline: 2px solid var(--link); outline-offset: 1px; }

/* Chips, tables, key/value */
.chips { display: flex; gap: var(--s2); overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 6px 13px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-size: .9rem; white-space: nowrap; }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.data th, table.data td { padding: 11px 13px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th { font-size: var(--step--1); color: var(--muted); font-weight: 600; }
table.data th a { color: inherit; text-decoration: none; }
table.data th a.on { color: var(--ink); text-decoration: underline; }
table.data tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
table.data tr:last-child td { border-bottom: 0; }
table.data td.name { white-space: normal; min-width: 180px; }
table.data td.name a { color: var(--ink); font-weight: 700; text-decoration: none; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr.dim td { opacity: .55; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; align-items: baseline; }
.kv > span { color: var(--muted); font-size: .88rem; }
.warn, .warn a { color: var(--danger); }
pre.stack { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s3); overflow-x: auto; font-size: .8rem; }
.bars { display: flex; gap: 1px; height: 22px; align-items: stretch; overflow: hidden; border-radius: var(--r-sm); }
.bars i { flex: 1; min-width: 2px; background: var(--ok); }
.bars i.bad { background: var(--danger); }

/* Rail: horizontal snap carousel (works without JS; /assets/rail.js adds arrows + autoplay) */
.rail { position: relative; }
.rail-track { display: grid; grid-auto-flow: column; grid-auto-columns: min(78%, 300px); gap: var(--s4); overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; padding: 4px 16px 18px; scrollbar-width: none; overscroll-behavior-x: contain; }
.rail-track::-webkit-scrollbar { display: none; }
.rail-track > * { scroll-snap-align: start; }
.rail-btn { position: absolute; top: 42%; z-index: 2; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 1.3rem; cursor: pointer; box-shadow: var(--shadow-2); display: none; }
.rail-btn.prev { left: 6px; } .rail-btn.next { right: 6px; }
.rail.js .rail-btn { display: block; }
@media (max-width: 640px) { .rail.js .rail-btn { display: none; } }

/* Pricing */
.plan { display: flex; flex-direction: column; gap: var(--s3); position: relative; }
.plan-highlight { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent), var(--shadow-2); }
.plan-flag { position: absolute; top: -12px; left: var(--s5); }
.plan-price { font-family: var(--font-num); font-size: var(--step-3); font-weight: var(--display-weight); line-height: 1; }
.plan-price small { font-family: var(--font-body); font-size: var(--step--1); font-weight: 400; color: var(--muted); }
.plan ul { margin: 0; padding-left: 1.1em; color: var(--muted); }
.plan li + li { margin-top: 4px; }
.plan form, .plan > .btn { margin-top: auto; }
.billing-toggle { display: inline-flex; padding: 4px; border-radius: var(--r-pill); background: var(--surface-2); gap: 4px; }
.billing-toggle a { padding: 6px 14px; border-radius: var(--r-pill); text-decoration: none; color: var(--muted); font-weight: 700; font-size: .92rem; }
.billing-toggle a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

.pricing-hero p { margin-inline: auto; font-size: var(--step-1); }
.plan-fine { margin: var(--s2) auto 0; }
.faq { margin: var(--s6) auto 0; }
.faq details { border-bottom: 1px solid var(--line); padding: var(--s3) 0; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq details p { margin: var(--s2) 0 0; color: var(--muted); }

/* Feedback */
.feedback-row { display: flex; gap: 14px; align-items: flex-start; }
.vote { font: inherit; font-weight: 700; min-width: 48px; padding: 6px 8px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; line-height: 1.2; }
.vote.voted { border-color: var(--link); color: var(--link); }
.vote:disabled { cursor: default; opacity: .7; }
.status { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--muted); }
.status-planned, .status-in_progress { background: color-mix(in srgb, var(--link) 16%, transparent); color: var(--link); }
.status-done { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.admin-note { border-left: 3px solid var(--accent); padding-left: 10px; }
.field textarea { min-height: 90px; }
