/* ---------------------------------------------------------------
   Design system: "instrument panel" - gunmetal ground, one live
   amber accent (like a panel indicator lamp), steel-blue structure,
   condensed nameplate display type + monospace register data.
----------------------------------------------------------------*/

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --panel: #eef1f4;
  --panel-raised: #ffffff;
  --ink: #1b232c;
  --muted: #4d5a68;
  --line: #d3dae1;
  --accent: #f5a623;
  --accent-ink: #1b140a;
  --steel: #3b4a6b;
  --grid-line: rgba(59, 74, 107, 0.08);

  --font-display: "Barlow Condensed", sans-serif;
  --font-body: "IBM Plex Sans", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --panel: #12161b;
    --panel-raised: #181d24;
    --ink: #e7ecf1;
    --muted: #92a0b0;
    --line: #2a323c;
    --accent-ink: #1b140a;
    --grid-line: rgba(245, 166, 35, 0.06);
  }
}

:root[data-theme="dark"] {
  --panel: #12161b;
  --panel-raised: #181d24;
  --ink: #e7ecf1;
  --muted: #92a0b0;
  --line: #2a323c;
  --accent-ink: #1b140a;
  --grid-line: rgba(245, 166, 35, 0.06);
}

* {
  box-sizing: border-box;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--panel);
  color: var(--ink);
  line-height: 1.6;
  transition: background-color 0.4s ease, color 0.4s ease;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 32px 32px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  text-wrap: balance;
  letter-spacing: 0.01em;
}

a {
  color: var(--steel);
  transition: color 0.3s ease;
}

a:hover {
  color: var(--accent);
}

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin: 0 0 6px 0;
}

/* ---------------- Top bar ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
  background: color-mix(in srgb, var(--panel) 85%, transparent);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.wordmark img {
  border-radius: 4px;
}

.wordmark:hover {
  color: var(--ink);
}

.topbar nav {
  display: flex;
  gap: 28px;
  font-size: 0.95rem;
}

.topbar nav a {
  color: var(--ink);
  text-decoration: none;
}

.topbar nav a:hover {
  color: var(--accent);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ---------------- Theme toggle ---------------- */

#theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.4s ease;
  flex-shrink: 0;
}

#theme-toggle.icon-sun {
  background: var(--accent);
}

#theme-toggle.icon-moon {
  background: var(--steel);
}

#theme-toggle svg {
  width: 18px;
  height: 18px;
  stroke: #ffffff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------------- Layout shell ---------------- */

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 72px 0;
}

section h2 {
  font-size: 2rem;
  margin: 0 0 32px 0;
}

/* ---------------- Hero ---------------- */

.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero-copy h1 {
  font-size: 3.2rem;
  line-height: 1.05;
  margin: 0 0 20px 0;
}

.hero-copy p {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 46ch;
  margin: 0 0 28px 0;
}

.cta-row {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 4px;
  font-family: var(--font-body);
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn svg {
  flex-shrink: 0;
}

.btn-block {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-bottom: 12px;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover {
  color: var(--accent-ink);
  box-shadow: 0 6px 20px rgba(245, 166, 35, 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-secondary:hover {
  color: var(--ink);
  border-color: var(--steel);
}

.badge-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge-row img {
  display: block;
  height: 20px;
}

.panel-card {
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.panel-card img {
  display: block;
  width: 100%;
}

/* ---------------- Features ---------------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  padding: 24px;
}

.feature-card h3 {
  font-size: 1.4rem;
  margin: 0 0 12px 0;
}

.feature-card ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.feature-card li {
  margin-bottom: 8px;
}

/* ---------------- Compare ---------------- */

.compare-table-wrap {
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.compare-table th,
.compare-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  white-space: nowrap;
}

.compare-table th:first-child,
.compare-table td:first-child {
  text-align: left;
  white-space: normal;
  color: var(--ink);
}

.compare-table thead th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.compare-table tbody td {
  color: var(--muted);
}

.compare-table tbody tr:last-child td {
  border-bottom: none;
}

.compare-table .compare-highlight {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--ink);
  font-weight: 600;
}

.compare-legend {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 12px 0 0 0;
}

/* ---------------- Changelog ---------------- */

.changelog-intro {
  color: var(--muted);
  max-width: 60ch;
  margin: -12px 0 40px 0;
}

.changelog-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.changelog-card {
  padding: 28px 32px;
}

.changelog-card h3 {
  font-size: 1.6rem;
  margin: 0 0 16px 0;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.version-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}

.version-tag.is-current {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}

.version-tag.is-upcoming {
  color: var(--steel);
  border-color: var(--steel);
}

.changelog-sub {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 20px 0 8px 0;
}

.changelog-card ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.changelog-card li {
  margin-bottom: 8px;
}

/* ---------------- Documentation ---------------- */

.doc-intro {
  color: var(--muted);
  max-width: 60ch;
  margin: -12px 0 40px 0;
}

.doc-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  align-items: start;
}

.doc-sidebar {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.doc-search {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-raised);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  padding: 9px 8px 9px 12px;
  margin-bottom: 14px;
}

.doc-search-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--muted);
}

.doc-search-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.doc-search input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
}

.doc-search input::placeholder {
  color: var(--muted);
}

.doc-search-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  min-width: 2.6em;
  text-align: right;
}

.doc-search-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-left: 4px;
  border-left: 1px solid var(--line);
}

.doc-search button {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
}

.doc-search button:hover:not(:disabled) {
  background: var(--grid-line);
  color: var(--accent);
}

.doc-search button:disabled {
  opacity: 0.3;
  cursor: default;
}

.doc-search button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.doc-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.doc-nav a {
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--muted);
  border-left: 2px solid transparent;
}

.doc-nav a:hover {
  color: var(--ink);
  background: var(--grid-line);
}

.doc-nav a.is-active {
  color: var(--ink);
  background: var(--grid-line);
  border-left-color: var(--accent);
  font-weight: 600;
}

.doc-content {
  min-width: 0;
}

.doc-hit {
  background: color-mix(in srgb, var(--accent) 35%, transparent);
  color: var(--ink);
  border-radius: 2px;
  scroll-margin-top: 96px;
}

.doc-hit.is-current {
  background: var(--accent);
  color: var(--accent-ink);
}

.doc-section {
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 88px;
}

.doc-section:last-child {
  border-bottom: none;
}

.doc-section h2 {
  font-size: 1.6rem;
  margin: 0 0 16px 0;
}

.doc-section h3 {
  font-size: 1.1rem;
  margin: 24px 0 10px 0;
}

.doc-section p,
.doc-section li {
  color: var(--muted);
}

.doc-section ul,
.doc-section ol {
  padding-left: 22px;
}

.doc-section li {
  margin-bottom: 6px;
}

.doc-section code {
  font-family: var(--font-mono);
  background: var(--grid-line);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.92em;
  color: var(--ink);
}

.doc-section pre {
  font-family: var(--font-mono);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  font-size: 0.9rem;
  color: var(--ink);
}

.doc-section table {
  border-collapse: collapse;
  margin: 8px 0;
  width: 100%;
}

.doc-section td {
  border: 1px solid var(--line);
  padding: 6px 12px;
  vertical-align: top;
  color: var(--muted);
}

/* ---------------- Screenshots ---------------- */

.shot-stack {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.shot-stack figure {
  margin: 0;
  display: flex;
  flex-direction: column;
}

.shot-stack img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top;
  cursor: zoom-in;
  transition: opacity 0.2s ease;
}

.shot-stack img:hover {
  opacity: 0.85;
}

/* ---------------- Lightbox ---------------- */

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8, 10, 13, 0.9);
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.lightbox.is-open {
  display: flex;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 28px;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 2.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 8px;
}

/* ---------------- Download ---------------- */

.download-sub {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0 0 28px 0;
}

.platform-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.platform-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.platform-tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.platform-tab:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.soon-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--muted);
}

.download-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
}

.download-card {
  padding: 28px;
}

.download-card h3 {
  font-size: 1.3rem;
  margin: 0 0 20px 0;
}

.download-note {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 12px 0 0 0;
}

.req-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.req-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--muted);
}

.req-list li::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='12' fill='%233b4a6b'/%3E%3Cpath d='M7 12.5l3 3 7-7' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

/* ---------------- Scroll reveal ---------------- */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------------- Footer ---------------- */

footer {
  border-top: 1px solid var(--line);
  padding: 24px 0 48px 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

/* ---------------- Responsive ---------------- */

@media (max-width: 800px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .shot-stack {
    grid-template-columns: 1fr;
  }

  .download-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    font-size: 2.4rem;
  }

  .topbar nav {
    gap: 16px;
    font-size: 0.85rem;
  }

  .doc-layout {
    grid-template-columns: 1fr;
  }

  .doc-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .doc-search {
    position: static;
  }

  .doc-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
