:root {
  --floor: #0c0c0e;
  --surface: #151518;
  --panel: #1a1a20;
  --raised: #222228;
  --line: #2a2a32;
  --platinum: #e8eef4;
  --mute: #9aa3ad;
  --flame: #e85d04;
  --flame-soft: #ff8a3d;
  --slag: #8b2e1f;
  --hit: #3d9a6a;
  --miss: #d4523a;
  --serif: "Noto Serif SC", "Songti SC", "STSong", serif;
  --sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --mono: "IBM Plex Mono", "SF Mono", Menlo, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

section[id] {
  scroll-margin-top: 72px;
}

body {
  margin: 0;
  color: var(--platinum);
  background: var(--floor);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-link {
  color: var(--flame-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}

button {
  font-family: inherit;
  cursor: pointer;
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: rgba(232, 93, 4, 0.12);
  padding: 0.05em 0.35em;
  border: 1px solid var(--line);
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 5;
  opacity: 0.1;
  background-image: url("images/texture.webp");
  background-size: 480px auto;
  mix-blend-mode: overlay;
}

.skip {
  position: absolute;
  left: -999px;
}

.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 60;
  background: var(--panel);
  padding: 8px 12px;
  border: 1px solid var(--flame);
}

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 28px;
  background: rgba(12, 12, 14, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.brand small {
  display: block;
  font-family: var(--mono);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--mute);
}

.seal {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--flame);
  color: var(--flame);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--flame);
  color: var(--flame);
  padding: 6px 12px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 18px;
  font-size: 14px;
  align-items: center;
}

.nav-links a {
  color: var(--mute);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}

.nav-links a.is-active,
.nav-links a:hover {
  color: var(--platinum);
  border-bottom-color: var(--flame);
}

.nav-links .live {
  border: 1px solid var(--flame);
  color: var(--flame);
  padding: 6px 12px;
}

.nav-links .live:hover {
  background: var(--flame);
  color: var(--floor);
  border-bottom-color: var(--flame);
}

.hero {
  position: relative;
  min-height: min(92vh, 920px);
  display: grid;
  align-items: end;
  overflow: hidden;
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(12, 12, 14, 0.15) 0%, rgba(12, 12, 14, 0.55) 48%, rgba(12, 12, 14, 0.94) 100%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  padding: 8vh 8vw 10vh;
  width: min(980px, 100%);
  max-width: 100%;
}

.kicker,
.vlabel {
  letter-spacing: 0.2em;
  font-size: 12px;
  color: var(--flame-soft);
  margin: 0 0 12px;
  font-family: var(--mono);
  text-transform: uppercase;
}

.vlabel.light {
  color: var(--flame-soft);
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.12;
  margin: 0 0 16px;
}

h1 {
  font-size: clamp(40px, 7vw, 84px);
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(28px, 4vw, 44px);
}

h3 {
  font-size: 22px;
}

.lead {
  font-size: 18px;
  max-width: min(42em, 100%);
  color: rgba(232, 238, 244, 0.86);
  overflow-wrap: break-word;
}

.disclaimer {
  margin: 18px 0 0;
  font-size: 12px;
  color: var(--mute);
  font-family: var(--mono);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0;
  max-width: 100%;
}

.chip {
  border: 1px solid rgba(232, 238, 244, 0.28);
  padding: 4px 10px;
  font-size: 12px;
  letter-spacing: 0.08em;
  font-family: var(--mono);
  flex-shrink: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border: 1px solid currentColor;
  font-size: 14px;
  border-radius: 0;
}

.btn-fill {
  background: var(--flame);
  color: var(--floor);
  border-color: var(--flame);
}

.btn-ghost {
  background: transparent;
  color: inherit;
}

.wrap {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 88px 0;
}

.wrap.tight {
  padding-bottom: 24px;
}

.section-head {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  margin-bottom: 40px;
  align-items: start;
}

.section-head p:last-child {
  color: var(--mute);
  margin: 0;
}

.grid-3,
.grid-2 {
  display: grid;
  gap: 16px;
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.card {
  background: var(--panel);
  border: 1px solid #3a3a44;
  padding: 22px;
  min-height: 220px;
}

.stamp {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--flame-soft);
  border: 1px solid var(--flame);
  padding: 2px 8px;
  margin-bottom: 10px;
  font-family: var(--mono);
}

.card ul {
  margin: 0;
  padding-left: 1.1em;
}

.card li {
  margin: 0.35em 0;
}

.band {
  background: var(--surface);
  border-block: 1px solid var(--line);
  padding-bottom: 48px;
}

.step {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto 56px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  align-items: center;
}

.step.reverse {
  direction: rtl;
}

.step.reverse > * {
  direction: ltr;
}

.step figure {
  margin: 0;
  border: 1px solid var(--line);
  overflow: hidden;
}

.step img {
  width: 100%;
  height: 320px;
  object-fit: cover;
}

.idx {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--flame-soft);
  margin-bottom: 8px;
}

.step-copy p,
.step-copy li {
  color: var(--mute);
}

.workbench {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.workbench .col {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 16px;
  min-height: 240px;
}

.workbench header {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--mute);
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.hit-flag {
  font-family: var(--mono);
  font-size: 18px;
  color: var(--miss);
  margin: 0 0 12px;
}

.hit-flag.ok {
  color: var(--hit);
}

.dual {
  display: grid;
  gap: 10px;
}

.dual span {
  display: block;
  font-size: 11px;
  color: var(--mute);
}

.dual strong {
  font-family: var(--mono);
  font-size: 16px;
}

.bench-btn {
  margin-top: 16px;
  width: 100%;
  color: var(--platinum);
  border-color: var(--line);
  font-size: 12px;
}

.timeline {
  position: relative;
  height: 8px;
  margin: 28px 8px 48px;
  background: linear-gradient(90deg, var(--flame) 0%, var(--flame-soft) 65%, var(--raised) 65%);
}

.timeline i {
  position: absolute;
  top: -6px;
  width: 2px;
  height: 20px;
  background: var(--platinum);
  transform: translateX(-50%);
}

.timeline i.warn {
  background: var(--miss);
}

.timeline b {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-family: var(--mono);
  color: var(--mute);
  white-space: nowrap;
}

.tiny {
  font-size: 12px;
  color: var(--mute);
  margin: 12px 0 0;
}

.digest {
  margin: 0;
  padding-left: 1.1em;
  font-size: 13px;
  color: var(--mute);
}

.rule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.rule-table th,
.rule-table td {
  border: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

.rule-table th {
  background: var(--panel);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.rule-table td:first-child {
  color: var(--flame-soft);
  font-family: var(--mono);
  width: 88px;
}

.io {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: stretch;
}

.arrow {
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 28px;
  color: var(--flame);
  border: 1px solid var(--line);
  width: 56px;
}

.fold-note {
  margin-top: 28px;
  color: var(--mute);
  font-size: 14px;
}

.footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.footer-inner {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 36px 0 48px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  color: var(--mute);
  font-size: 14px;
}

.footer a {
  color: var(--flame-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 980px) {
  .section-head,
  .step,
  .workbench,
  .grid-3,
  .grid-2,
  .io,
  .footer-inner {
    grid-template-columns: 1fr;
    display: grid;
  }

  .hero {
    min-height: min(100svh, 760px);
    height: auto;
    overflow: visible;
    align-items: end;
  }

  .nav {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .hero-inner {
    padding: 72px 16px 36px;
    width: 100%;
  }

  h1 {
    font-size: clamp(28px, 9vw, 40px);
    overflow-wrap: anywhere;
  }

  .lead {
    font-size: 15px;
  }

  .chip {
    font-size: 11px;
    padding: 3px 8px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .nav-toggle {
    display: inline-flex !important;
    z-index: 51;
    flex-shrink: 0;
    margin-left: auto;
    background: var(--flame);
    color: var(--floor);
    border-color: var(--flame);
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    right: 12px;
    left: 12px;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 12px;
    gap: 10px;
  }

  .nav-links.open {
    display: flex;
  }

  .step.reverse {
    direction: ltr;
  }

  .arrow {
    width: 100%;
    height: 48px;
  }
}
