:root {
  --bg: #07080c;
  --bg-alt: #101218;
  --bg-soft: #161922;
  --text: #f4f5f7;
  --muted: #9aa3b2;
  --accent: #e10600;
  --accent-hover: #ff2a1f;
  --accent-soft: rgba(225, 6, 0, 0.14);
  --border: rgba(255, 255, 255, 0.12);
  --border-soft: rgba(255, 255, 255, 0.08);
  --font-display: "Syne", sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

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

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 max(24px, env(safe-area-inset-right)) 0 max(24px, env(safe-area-inset-left));
}

/* Subtle telemetry grid — same language as landing */
.doc-page {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
}

.doc-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(225, 6, 0, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 36px 36px;
}

.doc-page > header,
.doc-page > main,
.doc-page > footer {
  position: relative;
  z-index: 1;
}

/* HEADER */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 8, 12, 0.96);
  border-bottom: 1px solid var(--border-soft);
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  @media (min-width: 1025px) {
    header {
      background: rgba(7, 8, 12, 0.82);
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
    }
  }
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.logo-mark {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.logo-text em {
  font-style: normal;
  color: var(--text);
}

.logo-text b {
  font-weight: 700;
  color: var(--accent);
}

.header-back {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s;
}

.header-back:hover {
  color: var(--text);
}

/* MAIN */
.doc-main {
  flex: 1 1 auto;
  padding: 48px 0 72px;
}

.doc-layout {
  max-width: 760px;
}

.doc-head {
  margin-bottom: 40px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border-soft);
}

.doc-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.doc-kicker::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--accent);
}

.doc-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.doc-lead {
  margin: 0;
  font-size: 16px;
  color: var(--muted);
  line-height: 1.65;
  max-width: 54ch;
}

.doc-lead a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-style: dotted;
  text-decoration-color: rgba(255, 255, 255, 0.35);
}

.doc-lead a:hover {
  color: #fff;
  text-decoration-color: var(--accent);
}

/* SECTIONS */
.doc-section {
  position: relative;
  padding: 28px 0;
  border-bottom: 1px solid var(--border-soft);
}

.doc-section:last-of-type {
  border-bottom: 0;
}

.doc-section h2 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: clamp(20px, 2.6vw, 26px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.doc-section h3 {
  margin: 22px 0 10px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}

.doc-section p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.doc-section p:last-child {
  margin-bottom: 0;
}

.doc-section strong {
  color: var(--text);
  font-weight: 600;
}

.doc-section ul,
.doc-section ol {
  margin: 0 0 14px;
  padding-left: 1.15em;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.doc-section li {
  margin: 6px 0;
  padding-left: 4px;
}

.doc-section li::marker {
  color: var(--accent);
}

.doc-section a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-style: dotted;
  text-decoration-color: rgba(255, 255, 255, 0.35);
  transition: color 0.2s, text-decoration-color 0.2s;
}

.doc-section a:hover {
  color: #fff;
  text-decoration-color: var(--accent);
}

.doc-section code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  padding: 1px 6px;
}

/* Highlight / registration callout */
.doc-callout {
  margin: 0 0 28px;
  padding: 24px 24px 22px;
  border: 1px solid rgba(225, 6, 0, 0.35);
  background:
    linear-gradient(180deg, rgba(225, 6, 0, 0.1), rgba(16, 18, 24, 0.35));
}

.doc-callout h2 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.doc-callout p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.doc-callout p:last-child {
  margin-bottom: 0;
}

.doc-callout strong {
  color: var(--text);
}

.doc-callout a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(225, 6, 0, 0.55);
}

.doc-callout a:hover {
  color: #fff;
  text-decoration-color: var(--accent);
}

.doc-reg-number {
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-size: clamp(18px, 3vw, 22px);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #fff;
}

.doc-reg-number a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(225, 6, 0, 0.55);
  transition: border-color 0.2s, color 0.2s;
}

.doc-reg-number a:hover {
  color: #fff;
  border-bottom-color: var(--accent);
}

.doc-note {
  margin: 18px 0 0;
  padding: 16px 18px;
  border-left: 2px solid var(--accent);
  background: rgba(255, 255, 255, 0.03);
}

.doc-note p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.doc-note strong {
  color: var(--text);
}

/* FOOTER */
footer {
  padding: 28px 0 36px;
  background: var(--bg);
  font-size: 12px;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.footer-nav a {
  color: var(--muted);
  transition: color 0.2s;
}

.footer-nav a:hover {
  color: var(--text);
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.footer-legal {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.footer-legal a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-style: dotted;
}

.footer-legal a:hover {
  color: var(--text);
}

@media (max-width: 768px) {
  .header-inner {
    padding: 12px 0;
  }

  .logo {
    font-size: 12px;
    gap: 8px;
  }

  .logo-mark {
    width: 24px;
    height: 24px;
  }

  .header-back {
    font-size: 11px;
    letter-spacing: 0.08em;
  }

  .doc-main {
    padding: 32px 0 56px;
  }

  .doc-head {
    margin-bottom: 28px;
    padding-bottom: 20px;
  }

  .doc-kicker {
    font-size: 10px;
    letter-spacing: 0.12em;
  }

  .doc-callout {
    padding: 18px 16px;
  }

  .footer-meta {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media (max-width: 1024px) {
  .doc-page::before {
    opacity: 0.16;
    background-size: 48px 48px;
  }
}
