/* ==========================================================================
   PivBO website. Design tokens mirror pivbo/pivbo.html (#page-home).
   When the in-app landing changes (colors, fonts, feature card copy,
   coffeeware messaging), mirror the change here too.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

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

:root {
  --bg: #0a0c0f;
  --bg2: #111418;
  --bg3: #181d23;
  --border: #1f2833;
  --text: #e8f0f8;
  --muted: #8899aa;
  --accent: #00d4aa;
  --accent2: #ff6b35;
  --green: #26a69a;
  --red: #ef5350;
  --yellow: #f5c842;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    Helvetica, Arial, sans-serif;
  --display: 'Space Grotesk', 'Inter', sans-serif;
}

[data-theme='light'] {
  --bg: #f5f7fa;
  --bg2: #ffffff;
  --bg3: #e8ecf0;
  --border: #d0d7dd;
  --text: #1a1f2e;
  --muted: #5a6775;
  --accent: #00a885;
  --accent2: #e55a2b;
  --green: #1a7f64;
  --red: #c53030;
  --yellow: #c99005;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: none;
}

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

/* =========================================================================
   Top nav
   ========================================================================= */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(10, 12, 15, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

[data-theme='light'] .nav {
  background: rgba(245, 247, 250, 0.85);
}

.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--accent);
  line-height: 1;
}

.nav-brand:hover {
  color: var(--yellow);
}

.nav-brand img {
  width: 24px;
  height: 24px;
}

.nav-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1 1 auto;
}

/* On narrow viewports the nav links wrap underneath the brand and
   shove the hero down. Hide them entirely below 720px; users can
   reach Features/Download/Docs/FAQ via the page itself, or the
   GitHub button via direct URL. Brand + Coffee + theme toggle stay. */
@media (max-width: 720px) {
  .nav-links { display: none; }
}

.nav-link {
  padding: 7px 12px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.nav-link:hover {
  color: var(--text);
  background: var(--bg2);
}

.nav-link.soon::after {
  content: 'soon';
  margin-left: 6px;
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(245, 200, 66, 0.12);
  color: var(--yellow);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  vertical-align: 1px;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  background: #ffd6b8;
  color: #7a4a2a !important;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid rgba(212, 165, 106, 0.25);
  box-shadow: 0 2px 6px rgba(255, 200, 170, 0.25);
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  letter-spacing: 0.2px;
}

.nav-cta:hover {
  transform: translateY(-1px);
  background: #ffe0c8;
  color: #5a3518 !important;
  box-shadow: 0 4px 10px rgba(255, 200, 170, 0.4);
}

[data-theme='light'] .nav-cta {
  background: #fde3cf;
  border-color: rgba(184, 130, 47, 0.3);
}

[data-theme='light'] .nav-cta:hover {
  background: #fbd2af;
}

.theme-toggle {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
}

.theme-toggle .icon-sun {
  display: none;
}

[data-theme='light'] .theme-toggle .icon-moon {
  display: none;
}

[data-theme='light'] .theme-toggle .icon-sun {
  display: block;
}

/* =========================================================================
   Hero
   ========================================================================= */
.hero {
  position: relative;
  padding: 96px 24px 72px;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(0, 212, 170, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 170, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 10%, transparent 70%);
  -webkit-mask-image: radial-gradient(
    ellipse at center,
    black 10%,
    transparent 70%
  );
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
      ellipse at 20% 0%,
      rgba(0, 212, 170, 0.12),
      transparent 50%
    ),
    radial-gradient(
      ellipse at 80% 100%,
      rgba(255, 107, 53, 0.08),
      transparent 50%
    );
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 0 auto;
  animation: heroIn 0.7s ease-out both;
}

@keyframes heroIn {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-icon {
  width: 84px;
  height: 84px;
  margin: 0 auto 14px;
  display: block;
  filter: drop-shadow(0 6px 18px rgba(0, 212, 170, 0.28));
  animation: iconIn 0.8s ease-out both;
}

@keyframes iconIn {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.hero-eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}

.hero-title {
  font-family: var(--display);
  font-size: 72px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.05;
  background: linear-gradient(
    135deg,
    var(--accent) 0%,
    var(--yellow) 70%,
    var(--accent2) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 12px;
  display: inline-block;
  position: relative;
}

.hero-title-beta {
  position: absolute;
  top: 2px;
  right: -66px;
  transform: rotate(-14deg);
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  padding: 3px 10px;
  border: 2px solid var(--yellow);
  border-radius: 6px;
  color: var(--yellow);
  background: rgba(245, 200, 66, 0.1);
  letter-spacing: 3px;
  line-height: 1;
  text-transform: uppercase;
  -webkit-text-fill-color: var(--yellow);
}

.hero-coffee {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--muted);
  max-width: 640px;
  margin: 10px auto 20px;
  line-height: 1.7;
}

.hero-coffee strong {
  color: var(--text);
  font-weight: 700;
}

.hero-coffee .coffeeware-link {
  color: var(--accent);
  border-bottom: 1px dashed rgba(0, 212, 170, 0.4);
}

.hero-coffee .coffeeware-link:hover {
  color: var(--yellow);
}

.hero-tagline {
  font-family: var(--sans);
  font-size: 16px;
  color: var(--muted);
  max-width: 620px;
  margin: 0 auto 30px;
  line-height: 1.7;
}

.hero-ctas {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg2);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s,
    color 0.15s;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.btn.primary {
  background: var(--accent);
  color: #04110d;
  border-color: var(--accent);
}

.btn.primary:hover {
  background: var(--yellow);
  border-color: var(--yellow);
  color: #151208;
}

.btn.orange {
  background: #b8531d;
  border-color: #b8531d;
  color: #fff3e8;
}

.btn.orange:hover {
  background: #d06628;
  border-color: #d06628;
  color: #fff8ee;
}

.btn svg {
  width: 14px;
  height: 14px;
}

@media (max-width: 680px) {
  .hero {
    padding: 64px 18px 48px;
  }
  .hero-title {
    font-size: 44px;
  }
  .hero-title-beta {
    font-size: 11px;
    right: -46px;
    top: 0;
    padding: 2px 7px;
  }
}

/* =========================================================================
   Section: features (mirrors the 4 home cards)
   ========================================================================= */
.section {
  padding: 72px 24px;
  max-width: 1180px;
  margin: 0 auto;
}

.section-head {
  text-align: center;
  margin-bottom: 44px;
}

.section-kicker {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.section-title {
  font-family: var(--display);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
  margin-bottom: 12px;
}

.section-lede {
  font-family: var(--sans);
  font-size: 15px;
  color: var(--muted);
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.7;
}

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

@media (max-width: 1180px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .cards {
    grid-template-columns: 1fr;
  }
}

.card {
  position: relative;
  background: linear-gradient(180deg, var(--bg2), var(--bg3));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 26px 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease,
    box-shadow 0.25s ease;
}

.card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent),
    transparent
  );
  opacity: 0;
  transition: opacity 0.25s ease;
}

.card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: 0 14px 36px rgba(0, 212, 170, 0.18),
    0 0 0 1px rgba(0, 212, 170, 0.25);
}

.card:hover::after {
  opacity: 1;
}

.card.duel:hover {
  border-color: var(--accent2);
  box-shadow: 0 14px 36px rgba(255, 107, 53, 0.2),
    0 0 0 1px rgba(255, 107, 53, 0.3);
}

.card.duel:hover::after {
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent2),
    transparent
  );
}

.card-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--accent);
  margin-bottom: 4px;
  transition: transform 0.2s;
}

.card:hover .card-icon {
  transform: scale(1.06);
}

.card.duel .card-icon {
  color: var(--accent2);
}

.card-icon svg {
  width: 28px;
  height: 28px;
}

.card-title {
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.card-desc {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
  flex: 1;
  min-height: 84px;
}

/* =========================================================================
   Coffeeware strip
   ========================================================================= */
.coffee {
  padding: 72px 24px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(
    180deg,
    rgba(255, 214, 184, 0.04),
    rgba(255, 214, 184, 0.01)
  );
}

.coffee-inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.coffee-kicker {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.coffee-title {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  letter-spacing: -0.3px;
}

.coffee-body {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 22px;
}

.coffee-body strong {
  color: var(--text);
  font-weight: 700;
}

.kofi-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  background: #ffd6b8;
  color: #7a4a2a !important;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid rgba(212, 165, 106, 0.25);
  box-shadow: 0 2px 8px rgba(255, 200, 170, 0.3);
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  letter-spacing: 0.2px;
}

.kofi-btn:hover {
  transform: translateY(-1px);
  background: #ffe0c8;
  color: #5a3518 !important;
  box-shadow: 0 4px 14px rgba(255, 200, 170, 0.45);
}

.kofi-btn .mug {
  font-size: 16px;
}

[data-theme='light'] .kofi-btn {
  background: #fde3cf;
  border-color: rgba(184, 130, 47, 0.3);
}

[data-theme='light'] .kofi-btn:hover {
  background: #fbd2af;
}

.coffee-footnote {
  margin-top: 14px;
  font-family: var(--sans);
  font-size: 11px;
  color: var(--muted);
  opacity: 0.7;
  letter-spacing: 0.2px;
}

/* =========================================================================
   Download section: OS cards + build-from-source block
   ========================================================================= */
.release-line {
  margin-top: 16px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.3px;
}

.release-line strong {
  color: var(--accent);
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.release-line-sep {
  margin: 0 8px;
  opacity: 0.5;
}

.release-line a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(136, 153, 170, 0.4);
}

.release-line a:hover {
  color: var(--text);
}

.dl-notice {
  margin: 18px 0 22px;
  padding: 12px 16px;
  background: rgba(245, 200, 66, 0.07);
  border: 1px solid rgba(245, 200, 66, 0.28);
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
}

.dl-notice strong {
  color: var(--yellow);
}

.dl-notice a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(0, 212, 170, 0.45);
}

.dl-notice a:hover {
  color: var(--text);
  text-decoration-color: currentColor;
}

/* Tabbed download panel: 4 tabs (Windows / macOS / Linux / Container)
   driven by hidden radio inputs so tab switching works without JS.
   Each panel is a 2-column grid (Package manager / Direct download)
   with numbered steps under the right column. */
.dl-tabs {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.dl-tabs > input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.dl-tab-bar {
  display: flex;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}

.dl-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-right: 1px solid var(--border);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.dl-tab-btn:last-of-type {
  border-right: none;
}

.dl-tab-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.dl-tab-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

#dl-tab-windows:checked   ~ .dl-tab-bar label[for="dl-tab-windows"],
#dl-tab-macos:checked     ~ .dl-tab-bar label[for="dl-tab-macos"],
#dl-tab-linux:checked     ~ .dl-tab-bar label[for="dl-tab-linux"],
#dl-tab-container:checked ~ .dl-tab-bar label[for="dl-tab-container"] {
  color: var(--accent);
  background: var(--bg2);
  border-bottom-color: var(--accent);
}

.dl-tabs > input:focus-visible ~ .dl-tab-bar label[for] {
  /* fall-through; specific rules below override per-tab */
}

#dl-tab-windows:focus-visible   ~ .dl-tab-bar label[for="dl-tab-windows"],
#dl-tab-macos:focus-visible     ~ .dl-tab-bar label[for="dl-tab-macos"],
#dl-tab-linux:focus-visible     ~ .dl-tab-bar label[for="dl-tab-linux"],
#dl-tab-container:focus-visible ~ .dl-tab-bar label[for="dl-tab-container"] {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.dl-panel {
  display: none;
  padding: 22px 24px;
}

#dl-tab-windows:checked   ~ .dl-panel[data-panel="windows"],
#dl-tab-macos:checked     ~ .dl-panel[data-panel="macos"],
#dl-tab-linux:checked     ~ .dl-panel[data-panel="linux"],
#dl-tab-container:checked ~ .dl-panel[data-panel="container"] {
  display: block;
}

.dl-panel-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 28px;
  align-items: stretch;
}

.dl-or-divider {
  position: relative;
  width: 1px;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dl-or-divider span {
  position: absolute;
  background: var(--bg2);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  padding: 6px 0;
  line-height: 1;
}

.dl-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.dl-col .pkg-cmd {
  align-self: flex-start;
}

.dl-btn {
  width: 100%;
  max-width: 320px;
  padding: 10px 16px;
  font-size: 13px;
  justify-content: center;
}

.dl-btn svg {
  width: 16px;
  height: 16px;
}

.dl-btn span {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.2px;
}

.dl-cmd-block {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.5;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  white-space: pre-wrap;
  overflow-x: auto;
  margin: 0;
  user-select: all;
}

.dl-hint {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

.dl-panel-footnote {
  margin: 18px 0 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.6;
}

.dl-panel-footnote strong {
  color: var(--text);
  font-weight: 600;
}

.dl-panel-footnote code {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text);
  background: var(--bg3);
  padding: 1px 5px;
  border-radius: 3px;
}

.dl-hint code {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text);
  background: var(--bg3);
  padding: 1px 5px;
  border-radius: 3px;
}

.dl-hint strong {
  color: var(--text);
  font-weight: 600;
}

.dl-steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 4px 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
}

.dl-steps li {
  counter-increment: step;
  position: relative;
  padding-left: 24px;
}

.dl-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.dl-steps code {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text);
  background: var(--bg3);
  padding: 1px 5px;
  border-radius: 3px;
}

.dl-steps strong {
  color: var(--text);
  font-weight: 600;
}

.dl-steps a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 760px) {
  .dl-tab-btn span {
    display: none;
  }
  .dl-tab-btn {
    padding: 12px 8px;
  }
  .dl-panel {
    padding: 18px 16px;
  }
  .dl-panel-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  /* On mobile the columns stack, so flatten the divider into a
     horizontal line with OR centered. */
  .dl-or-divider {
    width: auto;
    height: 1px;
    align-self: stretch;
  }
}

/* Legacy 2x2 grid kept stub-empty for any inherited references; the
   live layout uses .dl-tabs above. */
.os-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

@media (max-width: 720px) {
  .os-grid {
    grid-template-columns: 1fr;
  }
}

/* Tighter Download section: left-aligned, single-row header, smaller
   title. The full-width centered title block looked like a content
   island floating in dead space; inlining the version next to it
   pulls the eye straight to the cards below. */
#download {
  padding-top: 28px;
  padding-bottom: 36px;
}

.section-head.download-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 16px;
  text-align: left;
  margin-bottom: 14px;
}

.section-head.download-head .section-title {
  font-size: 24px;
  margin-bottom: 0;
}

.section-head.download-head .release-line {
  margin-top: 0;
}

.os-card {
  position: relative;
  background: linear-gradient(180deg, var(--bg2), var(--bg3));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease,
    box-shadow 0.25s ease;
}

.os-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent),
    transparent
  );
  opacity: 0;
  transition: opacity 0.25s ease;
}

.os-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 14px 36px rgba(0, 212, 170, 0.18),
    0 0 0 1px rgba(0, 212, 170, 0.25);
}

.os-card:hover::after {
  opacity: 1;
}

.os-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.os-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--accent);
  flex: 0 0 auto;
}

.os-icon svg {
  width: 26px;
  height: 26px;
}

.os-name {
  font-family: var(--sans);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
  line-height: 1.15;
}

.os-sub {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.os-dl-btn {
  justify-content: center;
  width: 100%;
}

.os-filename {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.2px;
  margin-top: -8px;
  word-break: break-all;
}

.os-steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.os-steps li {
  counter-increment: step;
  position: relative;
  padding-left: 32px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.os-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
}

.os-steps code,
.os-filename code,
.release-line code,
.source-block code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 1px 6px;
  border-radius: 4px;
}

.os-steps strong {
  color: var(--text);
  font-weight: 600;
}

.os-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px -20px;
  padding: 0 20px;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--muted);
}

.os-divider::before,
.os-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.os-subhead {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--muted);
}

.pkg-note {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 128px;
  justify-content: center;
}

.pkg-soon {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.2px;
}

.pkg-soon em {
  font-style: normal;
  color: var(--yellow);
  font-weight: 600;
}

.pkg-cmd {
  display: block;
  padding: 14px 16px;
  background: rgba(0, 212, 170, 0.08);
  border: 1.5px solid var(--accent);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
  letter-spacing: 0.3px;
  user-select: all;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.pkg-cmd:hover {
  background: rgba(0, 212, 170, 0.14);
  border-color: var(--accent);
}

.pkg-hint {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
  text-align: center;
}

.pkg-hint + .pkg-hint {
  margin-top: -2px;
}

.pkg-hint code {
  background: transparent;
  border: 0;
  padding: 0;
  font-size: 11px;
  color: var(--text);
}

.os-coming {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 18px 10px 12px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: rgba(245, 200, 66, 0.04);
}

.os-coming-badge {
  display: inline-block;
  padding: 4px 12px;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--yellow);
  background: rgba(245, 200, 66, 0.12);
  border: 1px solid rgba(245, 200, 66, 0.35);
  border-radius: 999px;
  margin-bottom: 12px;
}

.os-coming-note {
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.65;
  max-width: 260px;
}

.os-tip {
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.55;
  padding: 8px 10px;
  background: rgba(245, 200, 66, 0.06);
  border: 1px solid rgba(245, 200, 66, 0.18);
  border-radius: 6px;
}

.os-tip a {
  color: var(--yellow);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(245, 200, 66, 0.4);
}

.os-tip a:hover {
  color: var(--text);
}

.os-open-note {
  margin-top: 22px;
  text-align: center;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
}

/* ----- Run from source ----- */
.source-block {
  margin-top: 36px;
  background: linear-gradient(180deg, var(--bg2), var(--bg3));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 28px;
}

.source-head {
  margin-bottom: 20px;
}

.source-head .section-kicker {
  margin-bottom: 6px;
  color: var(--yellow);
}

.source-title {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.2px;
}

.source-lede {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
  max-width: 640px;
}

.code-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  color: var(--text);
  line-height: 1.65;
  overflow-x: auto;
  margin-bottom: 14px;
}

.code-block code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.code-comment {
  color: var(--muted);
  opacity: 0.8;
}

.source-footnote {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  max-width: 680px;
}

/* =========================================================================
   Docs & FAQ: shared accordion (native <details>)
   ========================================================================= */
.docs-section,
.faq-section {
  max-width: 880px;
}

.accordion {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.accordion-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.accordion-item[open] {
  border-color: rgba(0, 212, 170, 0.35);
}

.accordion-summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: background 0.15s ease;
  user-select: none;
}

.accordion-summary::-webkit-details-marker {
  display: none;
}

.accordion-summary:hover {
  background: var(--bg3);
}

.accordion-item[open] .accordion-summary {
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}

.accordion-title {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.1px;
}

.accordion-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: var(--muted);
  transition: transform 0.2s ease, color 0.15s ease;
  flex: 0 0 auto;
}

.accordion-chevron svg {
  width: 16px;
  height: 16px;
}

.accordion-item[open] .accordion-chevron {
  transform: rotate(180deg);
  color: var(--accent);
}

.accordion-body {
  padding: 16px 22px 20px;
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.75;
}

.accordion-body p {
  margin-bottom: 10px;
}

.accordion-body p:last-child {
  margin-bottom: 0;
}

.accordion-body ul,
.accordion-body ol {
  padding-left: 22px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.accordion-body ul:last-child,
.accordion-body ol:last-child {
  margin-bottom: 0;
}

.accordion-body li {
  line-height: 1.65;
}

.accordion-body strong {
  color: var(--text);
  font-weight: 600;
}

.accordion-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(0, 212, 170, 0.35);
}

.accordion-body a:hover {
  color: var(--yellow);
}

.accordion-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 1px 6px;
  border-radius: 4px;
}

.accordion-body em {
  font-style: italic;
  color: var(--text);
}

/* FAQ-specific tint: warmer accent on the open border */
.faq-item[open] {
  border-color: rgba(245, 200, 66, 0.4);
}

.faq-item[open] .accordion-chevron {
  color: var(--yellow);
}

/* =========================================================================
   Footer
   ========================================================================= */
.footer {
  padding: 36px 24px 48px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  align-items: center;
  justify-content: space-between;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
}

.footer-links {
  display: inline-flex;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--muted);
}

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

.footer-disclaimer {
  font-size: 11px;
  opacity: 0.8;
  max-width: 520px;
  line-height: 1.6;
}

/* =========================================================================
   Back-to-top button
   ========================================================================= */
.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: var(--bg2);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, color 0.15s,
    border-color 0.15s, background 0.15s;
  z-index: 45;
}

.to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.to-top:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--bg3);
}

.to-top svg {
  width: 18px;
  height: 18px;
}

[data-theme='light'] .to-top {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}
