:root {
  --bg: #0b1220;
  --bg-elev: #121a2a;
  --panel: #152033;
  --text: #e8eef6;
  --muted: #8b9bb0;
  --brand: #0f766e;
  --brand-2: #14b8a6;
  --brand-soft: rgba(15, 118, 110, 0.22);
  --line: rgba(255, 255, 255, 0.08);
  --danger: #f07167;
  --radius: 14px;
  --font-display: "Outfit", "Noto Sans SC", sans-serif;
  --font-body: "Noto Sans SC", "Segoe UI", sans-serif;
  --max: 1080px;
  --header-h: 64px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  background:
    radial-gradient(1100px 520px at 12% -8%, rgba(20, 184, 166, 0.16), transparent 55%),
    radial-gradient(900px 480px at 92% 8%, rgba(56, 189, 248, 0.08), transparent 50%),
    linear-gradient(180deg, #0d1524 0%, var(--bg) 38%, #090e18 100%);
  background-attachment: fixed;
}

img { max-width: 100%; display: block; }
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, .brand-mark {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.wrap {
  width: min(var(--max), calc(100% - 40px));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  background: transparent;
  transition: background .25s ease, border-color .25s ease, backdrop-filter .25s ease;
}
.site-header.scrolled {
  background: rgba(11, 18, 32, 0.86);
  border-bottom-color: var(--line);
  backdrop-filter: blur(12px);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  width: min(var(--max), calc(100% - 40px));
}
.logo {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  margin-right: auto;
}
.logo:hover { text-decoration: none; }
.logo-main {
  font-family: var(--font-display);
  font-weight: 750;
  font-size: 1.15rem;
}
.logo-sub {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--brand-2);
  font-weight: 650;
}
.nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav a {
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 550;
}
.nav a:hover,
.nav a.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}
.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
}

/* Hero */
.hero {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(105deg, rgba(11, 18, 32, 0.55) 0%, rgba(11, 18, 32, 0.82) 48%, rgba(11, 18, 32, 0.92) 100%),
    radial-gradient(ellipse 80% 60% at 70% 40%, rgba(15, 118, 110, 0.35), transparent 60%),
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 18px,
      rgba(255, 255, 255, 0.015) 18px,
      rgba(255, 255, 255, 0.015) 19px
    );
}
.hero-inner {
  padding: 72px 0 88px;
  max-width: 720px;
}
.brand-mark {
  font-size: clamp(2.8rem, 7vw, 4.4rem);
  margin: 0 0 18px;
  color: #fff;
}
.brand-mark span {
  display: block;
  font-size: 0.28em;
  letter-spacing: 0.22em;
  color: var(--brand-2);
  font-weight: 650;
  margin-bottom: 10px;
}
.hero-lead {
  margin: 0 0 28px;
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 34em;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 12px 22px;
  font-weight: 650;
  font-size: 0.95rem;
  font-family: inherit;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), #0d9488);
  color: #fff;
  box-shadow: 0 10px 28px rgba(15, 118, 110, 0.35);
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
  color: var(--text);
}

/* Sections */
.section {
  padding: 72px 0;
  border-top: 1px solid var(--line);
}
.section-kicker {
  color: var(--brand-2);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  font-weight: 650;
  text-transform: uppercase;
  margin: 0 0 10px;
}
.section h2 {
  margin: 0 0 14px;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
}
.section-lead {
  margin: 0 0 28px;
  color: var(--muted);
  max-width: 40em;
}

.pitch {
  display: grid;
  gap: 48px;
}
.pitch-block h3 {
  margin: 0 0 10px;
  font-size: 1.35rem;
}
.pitch-block p {
  margin: 0 0 12px;
  color: var(--muted);
  max-width: 36em;
}

.module-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}
.module-row {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 18px;
  align-items: baseline;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.module-row .name {
  font-family: var(--font-display);
  font-weight: 650;
  color: #fff;
}
.module-row .desc { color: var(--muted); margin: 0; }
.module-row .more {
  color: var(--brand-2);
  font-weight: 600;
  white-space: nowrap;
}

.download-box {
  padding: 28px 0 8px;
}
.download-box .dl-meta {
  margin: 0 0 16px;
  color: var(--text);
  font-size: 1.05rem;
}
.download-box ol,
.download-box ul {
  color: var(--muted);
  padding-left: 1.2em;
}
.download-box code,
.prose code {
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 0.88em;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
  color: #c5e7e2;
}

/* Feature / guide content */
.page-hero {
  padding: 48px 0 28px;
}
.page-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 4vw, 2.8rem);
}
.page-hero p {
  margin: 0;
  color: var(--muted);
  max-width: 40em;
}

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 8px;
}
.toc a {
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.85rem;
  text-decoration: none;
}
.toc a:hover {
  color: var(--text);
  border-color: rgba(20, 184, 166, 0.45);
  background: var(--brand-soft);
}

.feature-block,
.guide-step {
  padding: 36px 0;
  border-top: 1px solid var(--line);
}
.feature-block h2,
.guide-step h2 {
  margin: 0 0 12px;
  font-size: 1.45rem;
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.feature-block h3 {
  margin: 22px 0 8px;
  font-size: 1.05rem;
  color: #d7e4f2;
}
.feature-block ul,
.guide-step ul,
.guide-step ol {
  margin: 0;
  padding-left: 1.2em;
  color: var(--muted);
}
.feature-block li,
.guide-step li { margin: 6px 0; }
.shot {
  margin: 16px 0 8px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #070b12;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}
.shot img { width: 100%; height: auto; }
.shot figcaption {
  padding: 8px 12px 10px;
  color: var(--muted);
  font-size: 13px;
}
.hero-shot {
  margin-top: 28px;
}
.guide-step p { color: var(--muted); margin: 0 0 12px; }
.guide-step .note {
  margin-top: 14px;
  padding: 12px 14px;
  border-left: 3px solid var(--brand);
  background: rgba(15, 118, 110, 0.12);
  color: #c9ddd9;
  border-radius: 0 10px 10px 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer strong { color: var(--text); }

/* Motion */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.in {
  opacity: 1;
  transform: none;
}
.hero-inner.reveal { transition-delay: .05s; }

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    right: 20px;
    left: 20px;
    flex-direction: column;
    background: rgba(15, 22, 36, 0.96);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  }
  .nav.open { display: flex; }
  .module-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .hero-inner { padding: 48px 0 64px; }
}

/* Download extract-code modal */
.modal[hidden] { display: none !important; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 18, 0.72);
  backdrop-filter: blur(6px);
}
.modal-panel {
  position: relative;
  width: min(400px, 100%);
  padding: 28px 24px 22px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(21, 32, 51, 0.98), rgba(14, 22, 36, 0.98));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.modal-panel h3 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}
.modal-lead {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.95rem;
}
.code-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.code-row code {
  flex: 1;
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 1.45rem;
  letter-spacing: 0.18em;
  text-align: center;
  padding: 14px 12px;
  border-radius: 10px;
  border: 1px solid rgba(20, 184, 166, 0.35);
  background: rgba(15, 118, 110, 0.16);
  color: #9fe8dc;
  user-select: all;
}
.code-row .btn {
  padding: 12px 16px;
  flex-shrink: 0;
}
.copy-hint {
  min-height: 1.5em;
  margin: 0 0 16px;
  font-size: 0.92rem;
  color: var(--muted);
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity .18s ease, transform .18s ease, color .18s ease;
}
.copy-hint.show {
  opacity: 1;
  transform: none;
}
.copy-hint.ok { color: #5eead4; }
.copy-hint.err { color: var(--danger); }
.code-row .btn.copied {
  border-color: rgba(20, 184, 166, 0.55);
  background: rgba(15, 118, 110, 0.28);
  color: #9fe8dc;
}
.modal-actions {
  margin-top: 4px;
}
