:root {
  --bg: #f5f4f0;
  --surface: #ffffff;
  --surface-2: #efeee9;
  --ink: #17181b;
  --ink-2: #55575e;
  --ink-3: #8d8f96;
  --line: #e2e0d9;
  --accent: #e8590c;
  --accent-ink: #ffffff;
  --accent-soft: #fde8db;
  --box: #0f766e;
  --theory: #1c7ed6;
  --theory-soft: #e3f0fc;
  --kamikadze: #c2410c;
  --skyd: #3f6212;
  --radius: 18px;
  --shadow: 0 1px 2px rgb(20 20 20 / 4%), 0 8px 24px -12px rgb(20 20 20 / 12%);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111214;
    --surface: #191a1d;
    --surface-2: #222327;
    --ink: #f1f1ee;
    --ink-2: #b4b5ba;
    --ink-3: #7e8087;
    --line: #2c2d32;
    --accent: #ff7a2f;
    --accent-ink: #111214;
    --accent-soft: #3a2316;
    --box: #2dd4bf;
    --theory: #63b3ff;
    --theory-soft: #172a3d;
    --kamikadze: #ff9b61;
    --skyd: #a3d36b;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 10px 30px -14px rgb(0 0 0 / 60%);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.1; letter-spacing: -0.02em; margin: 0; }
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--ink-3); font-weight: 600; }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar__in { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; }
.brand svg { width: 30px; height: 30px; color: var(--accent); }
.brand em { font-style: normal; font-weight: 500; color: var(--ink-3); margin-left: 6px; }
.nav { display: flex; gap: 4px; }
.nav a {
  text-decoration: none; font-weight: 600; font-size: 15px;
  padding: 8px 12px; border-radius: 999px; color: var(--ink-2);
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav__cta { background: var(--ink); color: var(--bg) !important; }
.nav__cta:hover { background: var(--accent) !important; color: var(--accent-ink) !important; }

/* Hero */
.hero { padding: 56px 0 28px; }
.eyebrow {
  margin: 0 0 14px; font-size: 13px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent);
}
.hero h1 { font-size: clamp(36px, 6vw, 68px); font-weight: 800; max-width: 14ch; }
.lead { font-size: clamp(17px, 2vw, 20px); color: var(--ink-2); max-width: 62ch; margin: 18px 0 0; }
.stats { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.stats div {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 18px; display: flex; align-items: baseline; gap: 8px;
}
.stats b { font-size: 24px; font-weight: 800; }
.stats span { color: var(--ink-2); font-size: 14px; }

/* Sections */
.section { padding: 36px 0; }
.section--tight { padding-top: 0; }
.section__head {
  display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap;
  gap: 12px 24px; margin-bottom: 18px;
}
.section__head h2 { font-size: clamp(26px, 3.4vw, 36px); font-weight: 800; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; font-size: 14px; color: var(--ink-2); }
.legend__item { display: inline-flex; align-items: center; gap: 7px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot--ok { background: var(--ink); }
.dot--theory { background: var(--theory); }

/* Tabs */
.tabs {
  display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none;
}
.tab, .seg__btn {
  font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  padding: 9px 16px; border-radius: 999px;
}
.tab[aria-selected="true"], .seg__btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Table */
.table-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.table-scroll { overflow-x: auto; }
.grid { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; min-width: 560px; }
.grid th, .grid td { padding: 14px 16px; text-align: center; border-bottom: 1px solid var(--line); }
.grid thead th {
  font-size: 13px; font-weight: 700; color: var(--ink-3); text-transform: uppercase;
  letter-spacing: 0.04em; background: var(--surface-2);
}
.grid tbody tr:last-child > * { border-bottom: 0; }
.grid tbody tr:hover { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.grid th[scope="row"], .grid thead th:first-child {
  text-align: left; position: sticky; left: 0; background: inherit; z-index: 1;
}
.grid tbody th[scope="row"] { background: var(--surface); font-weight: 700; white-space: nowrap; }
.grid tbody tr:hover th[scope="row"] { background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
.grid th a { text-decoration: none; display: inline-flex; gap: 8px; align-items: center; }
.grid th a span { color: var(--accent); transition: transform .15s; }
.grid th a:hover span { transform: translateX(3px); }
.grid .num { font-size: 18px; font-weight: 700; }
.grid td small { display: block; font-size: 12px; color: var(--ink-3); }
.grid .is-empty { color: var(--ink-3); opacity: .5; }
.grid .is-theory .num {
  color: var(--theory); background: var(--theory-soft);
  padding: 2px 8px; border-radius: 8px;
}
.table-note { margin: 0; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.hint { font-size: 14px; color: var(--ink-3); margin: 12px 0 0; }
.footnote { color: var(--ink-2); font-size: 14px; }

/* Segmented filter */
.seg { display: flex; gap: 6px; }

/* Model cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.card {
  text-decoration: none; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column; transition: transform .18s, box-shadow .18s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgb(0 0 0 / 5%), 0 18px 40px -18px rgb(0 0 0 / 30%); }
.card[hidden] { display: none; }
.card__media { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.tag {
  position: absolute; top: 12px; left: 12px; font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; background: var(--surface); color: var(--ink);
}
.tag--kamikadze { color: var(--kamikadze); }
.tag--skyd { color: var(--skyd); }
.card__body { padding: 16px 18px 18px; }
.card h3 { font-size: 24px; font-weight: 800; }
.card h3 span { color: var(--ink-3); font-weight: 600; font-size: 18px; }
.chips { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li {
  font-size: 13px; color: var(--ink-2); background: var(--surface-2);
  padding: 4px 10px; border-radius: 8px; white-space: nowrap;
}
.chips b { color: var(--ink); margin-left: 2px; }

/* Model page */
.hero--model { padding-top: 28px; }
.back { display: inline-block; text-decoration: none; color: var(--ink-2); font-weight: 600; margin-bottom: 22px; }
.back:hover { color: var(--accent); }
.hero__row { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.twin {
  text-decoration: none; font-weight: 700; font-size: 15px; padding: 10px 16px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
}
.twin:hover { border-color: var(--accent); color: var(--accent); }
.jump {
  display: flex; gap: 10px; margin-top: 28px; overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: none;
}
.jump__item {
  flex: none; text-decoration: none; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 10px 16px; display: flex; flex-direction: column; min-width: 112px;
}
.jump__item span { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.jump__item b { font-size: 20px; font-weight: 800; }
.jump__item:hover { border-color: var(--accent); }

.variants { display: grid; gap: 20px; padding: 12px 0 40px; }
.variant {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: clamp(18px, 3vw, 28px);
}
.variant__head {
  display: flex; justify-content: space-between; align-items: start; gap: 12px 24px; flex-wrap: wrap;
  padding-bottom: 18px; margin-bottom: 20px; border-bottom: 1px solid var(--line);
}
.variant__label {
  margin: 0 0 6px; font-size: 13px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-3);
}
.variant__label .pill { text-transform: none; letter-spacing: 0; }
.variant__nums { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; font-weight: 800; }
.variant__box { font-size: clamp(28px, 3.4vw, 38px); color: var(--box); }
.variant__count {
  font-size: clamp(22px, 2.6vw, 30px); color: var(--accent);
  padding-left: 16px; border-left: 2px solid var(--line);
}
.variant__count small { font-size: .6em; color: var(--ink-3); font-weight: 700; }
.variant__side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.copylink {
  display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; cursor: pointer;
  color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 50%;
}
.copylink svg { width: 18px; height: 18px; }
.copylink__ok, .copylink.is-done .copylink__icon { display: none; }
.copylink.is-done .copylink__ok { display: block; }
.copylink:hover { color: var(--accent); border-color: var(--accent); }
.copylink.is-done { color: var(--box); border-color: var(--box); }
.variant:target { outline: 3px solid var(--accent); outline-offset: 2px; }
.variant__src { margin: 0; color: var(--ink-3); font-size: 14px; max-width: 32ch; text-align: right; }
.pill {
  font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); margin-left: 6px; vertical-align: 2px;
}
.flow { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 18px; align-items: start; counter-reset: step; }
.flow__text, .flow__sub { grid-column: 1 / -1; margin: 0; }
.flow__text {
  font-size: 17px; padding: 12px 16px; border-left: 3px solid var(--accent);
  background: var(--surface-2); border-radius: 0 10px 10px 0;
}
.flow__text p { margin: 0; }
.step { margin: 0; counter-increment: step; position: relative; }
.step::before {
  content: counter(step); position: absolute; z-index: 1; top: 10px; left: 10px;
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 14px;
}
.step .shot img { aspect-ratio: 4 / 3; object-fit: cover; }
.step figcaption { padding: 10px 2px 0; font-size: 16px; font-weight: 600; }
.step figcaption span { display: block; }
.ln-label { font-weight: 800; margin-top: 6px; }
.ln-label:first-child { margin-top: 0; }
.ln-indent { padding-left: 1.2em; font-weight: 500; }
.flow__sub { font-size: 19px; font-weight: 800; margin-top: 10px; }
.shot {
  padding: 0; border: 0; background: var(--surface-2); border-radius: 12px; overflow: hidden;
  cursor: zoom-in; display: block; width: 100%;
}
.shot img { width: 100%; transition: transform .25s; }
.shot:hover img { transform: scale(1.03); }

.pager { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 56px; }
.pager a {
  text-decoration: none; font-weight: 800; font-size: 18px; padding: 14px 20px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column;
}
.pager a:hover { border-color: var(--accent); }
.pager small { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.pager__next { text-align: right; margin-left: auto; }

/* Donate */
.donate { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.donate a {
  display: flex; flex-direction: column; gap: 4px; height: 100%; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.donate a:hover { border-color: var(--accent); }
.donate__label { font-weight: 800; font-size: 19px; }
.donate__url { color: var(--accent); font-weight: 600; word-break: break-all; }
.donate__note { color: var(--ink-3); font-size: 14px; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--ink-3); font-size: 14px; }
.footer__in { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; }
.footer p { margin: 0; }
.footer a { color: var(--ink-2); font-weight: 700; text-decoration: none; }

/* Lightbox */
.lightbox {
  border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh;
  width: 100vw; height: 100vh; margin: 0;
}
.lightbox::backdrop { background: rgb(8 8 10 / 92%); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox img { max-width: min(96vw, 1600px); max-height: 86vh; border-radius: 10px; object-fit: contain; }
.lightbox__cap { position: fixed; bottom: 16px; left: 0; right: 0; text-align: center; color: #ddd; margin: 0; font-weight: 600; }
.lightbox__btn {
  position: fixed; border: 0; cursor: pointer; font: 700 28px/1 system-ui; color: #fff;
  background: rgb(255 255 255 / 12%); width: 48px; height: 48px; border-radius: 50%;
}
.lightbox__btn:hover { background: rgb(255 255 255 / 24%); }
.lightbox__close { top: 16px; right: 16px; font-size: 20px; }
.lightbox__prev { left: 16px; top: 50%; translate: 0 -50%; }
.lightbox__next { right: 16px; top: 50%; translate: 0 -50%; }

@media (max-width: 640px) {
  .brand em { display: none; }
  .nav a { padding: 8px 10px; font-size: 14px; }
  .hero { padding-top: 36px; }
  .variant__src { text-align: left; }
  .variant__side { align-items: flex-start; }
  .grid th, .grid td { padding: 12px 10px; }
  .lightbox__prev, .lightbox__next { top: auto; bottom: 52px; translate: none; }
}
