/* PylotOS Official Website & Documentation Stylesheet
 * Built strictly on PylotOS 2B-2 Brand Tokens (docs/assets/brand/BRAND.md).
 */

:root {
  --pylot-bg: #0b1120;
  --pylot-bg-elevated: #0f172a;
  --pylot-surface: #1e293b;
  --pylot-surface-hover: #26344b;
  --pylot-border: #334155;
  --pylot-cyan: #38bdf8;
  --pylot-cyan-dim: #0284c7;
  --pylot-gold: #f59e0b;
  --pylot-gold-hi: #fbbf24;
  --pylot-white: #f8fafc;
  --pylot-text: #cbd5e1;
  --pylot-muted: #94a3b8;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --font-display: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
}

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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  margin: 0;
  background-color: var(--pylot-bg);
  color: var(--pylot-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--pylot-cyan);
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

a:hover {
  color: #7dd3fc;
}

code,
pre {
  font-family: var(--font-mono);
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(11, 17, 32, 0.84);
  border-bottom: 1px solid rgba(51, 65, 85, 0.7);
}

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

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-link img {
  height: 38px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--pylot-text);
  font-size: 0.94rem;
  font-weight: 600;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--pylot-white);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.94rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--pylot-cyan), #0ea5e9);
  color: #06101f;
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.24);
}

.btn-primary:hover {
  color: #06101f;
  box-shadow: 0 12px 28px rgba(56, 189, 248, 0.34);
}

.btn-secondary {
  background: var(--pylot-surface);
  color: var(--pylot-white);
  border-color: var(--pylot-border);
}

.btn-secondary:hover {
  background: var(--pylot-surface-hover);
  color: var(--pylot-white);
}

.btn-gold {
  background: rgba(245, 158, 11, 0.14);
  color: var(--pylot-gold-hi);
  border-color: rgba(245, 158, 11, 0.45);
}

.btn-gold:hover {
  background: rgba(245, 158, 11, 0.24);
  color: var(--pylot-gold-hi);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.86rem;
}

/* Container & Sections */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 76px 0;
}

.section-header {
  margin-bottom: 36px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--pylot-cyan);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.section-title {
  margin: 14px 0 10px;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--pylot-white);
  line-height: 1.2;
}

.section-lead {
  margin: 0;
  max-width: 720px;
  color: var(--pylot-muted);
  font-size: 1.05rem;
}

/* Hero Section */
.hero {
  position: relative;
  overflow: hidden;
  padding: 82px 0 74px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.65);
  background:
    radial-gradient(circle at 22% 38%, rgba(56, 189, 248, 0.16), transparent 46%),
    radial-gradient(circle at 84% 20%, rgba(245, 158, 11, 0.12), transparent 42%),
    linear-gradient(180deg, #0b1120 0%, #0f172a 100%);
}

.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(51, 65, 85, 0.25) 1px, transparent 1px),
    linear-gradient(90deg, rgba(51, 65, 85, 0.25) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(ellipse at center, black 35%, transparent 80%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 48px;
}

.hero h1 {
  margin: 18px 0 16px;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 4.6vw, 3.6rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--pylot-white);
}

.hero h1 .accent-gold {
  color: var(--pylot-gold);
}

.hero h1 .accent-cyan {
  color: var(--pylot-cyan);
}

.hero-subtitle {
  margin: 0 0 28px;
  font-size: 1.12rem;
  color: var(--pylot-text);
  max-width: 600px;
}

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

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 0.83rem;
  color: var(--pylot-muted);
}

.stat-pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--pylot-border);
}

.stat-pill strong {
  color: var(--pylot-white);
}

.hero-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.mascot-stage {
  width: 280px;
  height: 280px;
  border-radius: 32px;
  background: radial-gradient(circle at 50% 45%, rgba(56, 189, 248, 0.18), rgba(15, 23, 42, 0.92) 70%);
  border: 1px solid rgba(56, 189, 248, 0.28);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.mascot-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.45));
}

.terminal-card {
  width: 100%;
  max-width: 472px;
  background: #070c17;
  border: 1px solid var(--pylot-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  background: var(--pylot-surface);
  border-bottom: 1px solid var(--pylot-border);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--pylot-muted);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-red { background: #ef4444; }
.dot-gold { background: var(--pylot-gold); }
.dot-cyan { background: var(--pylot-cyan); }

.terminal-card pre {
  margin: 0;
  padding: 14px 16px;
  font-size: 0.77rem;
  line-height: 1.6;
  color: #e2e8f0;
  overflow-x: auto;
}

.t-prompt { color: var(--pylot-gold); }
.t-cmd { color: var(--pylot-cyan); }
.t-comment { color: #64748b; }

/* Feature Cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 20px;
}

.card {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.78), rgba(15, 23, 42, 0.9));
  border: 1px solid var(--pylot-border);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.card:hover {
  border-color: rgba(56, 189, 248, 0.55);
  transform: translateY(-2px);
}

.card-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  margin-bottom: 12px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--pylot-cyan);
}

.card-badge.gold {
  background: rgba(245, 158, 11, 0.14);
  color: var(--pylot-gold-hi);
}

.card h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--pylot-white);
}

.card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--pylot-muted);
}

/* Interactive Boards Table */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.filter-btn {
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--pylot-surface);
  border: 1px solid var(--pylot-border);
  color: var(--pylot-text);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.filter-btn.active,
.filter-btn:hover {
  background: rgba(56, 189, 248, 0.16);
  border-color: var(--pylot-cyan);
  color: var(--pylot-white);
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--pylot-border);
  background: rgba(15, 23, 42, 0.85);
}

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

th,
td {
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.65);
}

th {
  background: rgba(30, 41, 59, 0.85);
  color: var(--pylot-white);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: rgba(30, 41, 59, 0.42);
}

.chip-tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
}

.chip-esp32 { background: rgba(56, 189, 248, 0.14); color: var(--pylot-cyan); }
.chip-esp32s3 { background: rgba(245, 158, 11, 0.16); color: var(--pylot-gold-hi); }
.chip-esp32c6 { background: rgba(168, 85, 247, 0.18); color: #d8b4fe; }

.ref-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
  font-size: 0.72rem;
  font-weight: 700;
}

/* Callout / Flasher Banner */
.flasher-panel {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 28px;
  align-items: center;
  padding: 32px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 90% 20%, rgba(245, 158, 11, 0.14), transparent 50%),
    linear-gradient(135deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.96));
  border: 1px solid var(--pylot-border);
}

.boot-previews {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.boot-frame {
  background: #050810;
  border: 2px solid var(--pylot-border);
  border-radius: 12px;
  padding: 8px;
  text-align: center;
}

.boot-frame img {
  display: block;
  border-radius: 6px;
  max-width: 100%;
  height: auto;
}

.boot-frame span {
  display: block;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--pylot-muted);
}

/* Documentation Layout */
.docs-shell {
  max-width: 1220px;
  margin: 0 auto;
  padding: 28px 24px 64px;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}

.docs-sidebar {
  position: sticky;
  top: 76px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--pylot-border);
  border-radius: var(--radius-md);
  padding: 18px;
}

.docs-search {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--pylot-border);
  background: var(--pylot-bg);
  color: var(--pylot-white);
  font-size: 0.88rem;
  margin-bottom: 14px;
}

.docs-search:focus {
  outline: none;
  border-color: var(--pylot-cyan);
}

.sidebar-group {
  margin: 14px 0 6px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pylot-gold);
}

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

.sidebar-list li {
  margin: 2px 0;
}

.sidebar-list a {
  display: block;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--pylot-text);
  font-size: 0.9rem;
  font-weight: 500;
}

.sidebar-list a:hover {
  background: rgba(30, 41, 59, 0.75);
  color: var(--pylot-white);
}

.sidebar-list a.active {
  background: rgba(56, 189, 248, 0.16);
  color: var(--pylot-cyan);
  font-weight: 700;
}

.doc-article {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--pylot-border);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  min-width: 0;
}

.doc-article h1 {
  margin-top: 0;
  font-family: var(--font-display);
  font-size: 2.1rem;
  color: var(--pylot-white);
  border-bottom: 1px solid var(--pylot-border);
  padding-bottom: 14px;
}

.doc-article h2 {
  margin-top: 34px;
  font-family: var(--font-display);
  font-size: 1.45rem;
  color: var(--pylot-white);
}

.doc-article h3 {
  margin-top: 24px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--pylot-gold-hi);
}

.doc-article p code,
.doc-article li code,
.doc-article td code {
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid rgba(51, 65, 85, 0.8);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.86em;
  color: #e0f2fe;
}

.doc-article pre {
  background: #070c17;
  border: 1px solid var(--pylot-border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.55;
  color: #e2e8f0;
}

.doc-article blockquote {
  margin: 18px 0;
  padding: 12px 18px;
  border-left: 4px solid var(--pylot-cyan);
  background: rgba(56, 189, 248, 0.08);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--pylot-text);
}

.doc-article blockquote.alert-warning {
  border-left-color: var(--pylot-gold);
  background: rgba(245, 158, 11, 0.1);
}

.doc-article hr {
  border: none;
  border-top: 1px solid var(--pylot-border);
  margin: 28px 0;
}

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

.doc-article li {
  margin: 6px 0;
}

.doc-article .table-wrap {
  margin: 20px 0;
}

/* Footer */
.site-footer {
  border-top: 1px solid rgba(51, 65, 85, 0.7);
  padding: 36px 0 46px;
  color: var(--pylot-muted);
  font-size: 0.88rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-disclaimer {
  margin-top: 14px;
  font-size: 0.8rem;
  color: #64748b;
}

@media (max-width: 920px) {
  .hero-inner,
  .flasher-panel,
  .docs-shell {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    position: static;
  }

  .doc-article {
    padding: 24px 20px;
  }
}
