/* ============================================================
   Sii Language — Design System v3.0.0
   Style:   Warm Dark Luxury + Developer-tool Aesthetic
   Fonts:   Cormorant Garamond (display) + DM Mono (body/code)
   Colors:  Deep Warm Black + Cyan-Blue accent
   ============================================================ */

/* ---- Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,500;0,700;1,300&family=DM+Mono:wght@300;400&display=swap');

/* ---- Design Tokens ---- */
:root {
  --bg: #0b0b0b;
  --surface: #141414;
  --surface-raised: #1c1c1c;
  --accent: #4ec4d8;
  --accent-dim: rgba(78, 196, 216, 0.15);
  --accent-glow: rgba(78, 196, 216, 0.04);
  --text-primary: #f0ece4;
  --text-muted: #7a7570;
  --text-dim: #4a4744;
  --border: #2a2725;
  --border-light: rgba(42, 39, 37, 0.5);
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-mono: 'DM Mono', 'Courier New', monospace;
  --radius: 0px;
  --radius-sm: 0px;
  --max-w: 1200px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);

  /* Code highlight */
  --code-kw: #5eb8cc;
  --code-fn: #4ec4d8;
  --code-var: #f0ece4;
  --code-ty: #3aa8bd;
  --code-cm: #4a4744;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
  position: relative;
}

/* ── Grain Overlay ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.035;
  pointer-events: none;
  z-index: 9999;
}

img, svg {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--text-primary);
}

/* ---- Typography ---- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin-bottom: 1.5rem;
}

h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.3rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

h4 {
  font-size: 1.05rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 400;
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--surface-raised);
  padding: 0.2em 0.5em;
  color: var(--accent);
}

pre {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 1.5rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

pre code {
  background: none;
  padding: 0;
  color: var(--text-primary);
  font-size: 0.82rem;
  line-height: 1.75;
}

/* ---- Focus States (Accessibility) ---- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ═══════════════════════════
   LAYOUT
   ═══════════════════════════ */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2.5rem;
}

/* ═══════════════════════════
   NAVIGATION
   ═══════════════════════════ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1.5rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(to bottom, var(--bg) 60%, transparent);
  transition: background 0.4s ease;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.nav-logo img {
  height: 28px;
  width: auto;
}

.nav-logo span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  position: relative;
  transition: color 0.3s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.3s ease;
}

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

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* Nav CTA button */
.nav-cta {
  padding: 0.5rem 1.25rem !important;
  border: 1px solid var(--accent) !important;
  color: var(--accent) !important;
  font-weight: 400 !important;
  transition: all 0.3s ease !important;
}

.nav-cta:hover {
  background: var(--accent-dim) !important;
  color: var(--text-primary) !important;
}

.nav-cta::after {
  display: none !important;
}

/* Theme toggle */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.4rem 0.7rem;
  font-size: 0.9rem;
  line-height: 1;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

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

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: 0.2s;
}

/* ═══════════════════════════
   SECTIONS COMMON
   ═══════════════════════════ */
section, .section {
  padding: 8rem 0;
  position: relative;
}

.section-alt {
  background: var(--surface);
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--accent);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.section-label::before {
  content: '';
  width: 2rem;
  height: 1px;
  background: var(--accent);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  font-weight: 300;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 2rem;
}

.section-subtitle {
  color: var(--text-muted);
  max-width: 560px;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.8;
  margin-bottom: 3rem;
}

.section-divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin: 0;
  border: none;
}

.section-centered {
  text-align: center;
}

.section-centered .section-subtitle {
  margin-left: auto;
  margin-right: auto;
}

/* ═══════════════════════════
   ANIMATIONS
   ═══════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

/* ═══════════════════════════
   HERO SECTION
   ═══════════════════════════ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem 5rem;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--bg) 0%, var(--surface) 40%, var(--bg) 60%, var(--bg) 100%);
}

.hero::after {
  content: '';
  position: absolute;
  top: 20%;
  right: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  border: 1px solid rgba(78, 196, 216, 0.25);
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.2s forwards;
}

.hero-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(78, 196, 216, 0.5);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 300;
  line-height: 1.05;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.4s forwards;
}

.hero h1 span {
  color: var(--accent);
  font-style: italic;
}

.hero .hero-tagline {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.5vw, 2rem);
  font-weight: 300;
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.6s forwards;
}

.hero-sub {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 2.5rem;
  line-height: 1.9;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.8s forwards;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.8s ease 1s forwards;
}

.hero-scroll {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  animation: fadeUp 0.8s ease 1.3s forwards;
}

.hero-scroll span {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  writing-mode: vertical-rl;
}

.hero-scroll-line {
  width: 1px;
  height: 40px;
  background: var(--text-dim);
  position: relative;
  overflow: hidden;
}

.hero-scroll-line::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--accent);
  animation: scrollLine 2s ease infinite;
}

@keyframes scrollLine {
  0% { top: -100%; }
  100% { top: 100%; }
}

/* ═══════════════════════════
   BUTTONS
   ═══════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  padding: 1rem 2rem;
  cursor: pointer;
  transition: all 0.4s ease;
  text-decoration: none;
  border: none;
}

.btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-primary {
  color: var(--bg);
  background: var(--accent);
  border: 1px solid var(--accent);
}

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

.btn-outline {
  color: var(--text-primary);
  border: 1px solid var(--border);
  background: transparent;
}

.btn-outline:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}

.btn-cta {
  color: var(--text-primary);
  border: 1px solid var(--border);
  background: transparent;
  transition: all 0.4s ease;
}

.btn-cta:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
  letter-spacing: 0.25em;
}

/* ═══════════════════════════
   CARDS GRID
   ═══════════════════════════ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  max-width: var(--max-w);
  margin: 0 auto;
}

.card {
  padding: 2.5rem;
  border: 1px solid var(--border);
  background: var(--bg);
  position: relative;
  overflow: hidden;
  transition: border-color 0.4s ease, transform 0.4s ease;
  text-align: left;
}

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

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

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

.card-icon {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 300;
  color: var(--accent);
  margin-bottom: 1.5rem;
  opacity: 0.8;
}

.card h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.card p {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.8;
}

/* Feature icons (CSS-only) */
.feat-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 300;
  color: var(--accent);
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
}

.card:hover .feat-icon {
  border-color: var(--accent);
  transition: border-color 0.4s ease;
}

/* ═══════════════════════════
   CODE SHOWCASE
   ═══════════════════════════ */
.code-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  max-width: 800px;
  margin: 0 auto;
}

.code-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

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

.code-dot:nth-child(1) { background: #3a5a6a; }
.code-dot:nth-child(2) { background: #5a8a9a; }
.code-dot:nth-child(3) { background: #4a4744; }

.code-filename {
  margin-left: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.code-body {
  padding: 1.5rem;
}

.code-body pre {
  margin: 0;
  background: none;
  border: none;
  padding: 0;
}

.code-body pre code {
  font-size: 0.82rem;
  line-height: 1.75;
}

/* Syntax highlighting */
.code-kw { color: #5eb8cc; }         /* declaration: func, let, const, class, crob */
.code-kw-flow { color: #d88a9a; }   /* control flow: if, else, forloop, while, break, continue */
.code-kw-ret { color: #d4a860; }    /* return: back */
.code-kw-mod { color: #a0c8d8; }    /* module keywords: share, cite, from, as */
.code-kw-lit { color: #c8a86e; }    /* literals: true, false */
.code-fn { color: #4ec4d8; }        /* user-defined functions */
.code-fn-stdlib { color: #6ac8a0; } /* stdlib / built-in: print, readLine, jsonParse */
.code-fn-method { color: #c0a0d8; } /* method calls: .length(), .toInt(), .toString() */
.code-var { color: #f0ece4; }       /* variables & parameters: n, nums, i */
.code-ty { color: #3aa8bd; }         /* primitive types: int, void, bool, string */
.code-ty-gen { color: #5ea8c8; }    /* generic/container types: arr */
.code-cm { color: #555250; font-style: italic; }   /* comments */
.code-num { color: #c8a86e; }       /* numeric literals: 1, 42, 3.14 */
.code-str { color: #8cb896; }       /* string literals: "Hello" */
.code-op { color: #8a8a8a; }        /* operators: =, +, *, <, <= */
.code-mod { color: #9aa8d8; }       /* module paths: sii.io, sii.db */
.code-punct { color: #6a6a6a; }     /* punctuation: ; , . ( ) [ ] { } */

/* ═══════════════════════════
   CTA SECTION
   ═══════════════════════════ */
.cta-section {
  padding: 8rem 0;
  background: var(--surface);
  text-align: center;
}

.cta-section h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 300;
  margin-bottom: 0.75rem;
}

.cta-section .section-subtitle {
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 2.5rem;
}

.cta-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ═══════════════════════════
   DOCS / GUIDE LAYOUT
   ═══════════════════════════ */
.docs-layout {
  display: flex;
  max-width: var(--max-w);
  margin: 100px auto 0;
  gap: 3rem;
  padding: 3rem 2.5rem;
}

/* Sidebar */
.docs-sidebar {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: 100px;
  align-self: flex-start;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 0.5rem;
}

.docs-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.docs-sidebar .sidebar-section {
  margin-top: 0.6rem;
}

.docs-sidebar .sidebar-section:first-child {
  margin-top: 0;
}

.docs-sidebar .sidebar-section-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 0.3rem 0.75rem 0.15rem;
}

.docs-sidebar a {
  display: block;
  padding: 0.35rem 0.75rem;
  font-size: 0.88rem;
  color: var(--text-dim);
  transition: all 0.2s;
  border-left: 2px solid transparent;
  font-family: var(--font-mono);
  font-weight: 400;
}

.docs-sidebar a:hover,
.docs-sidebar a.active {
  color: var(--text-primary);
  background: var(--surface);
  border-left-color: var(--accent);
}

.docs-sidebar a.sub {
  font-size: 0.75rem;
  padding-left: 1.5rem;
}

/* Content */
.docs-content {
  flex: 1;
  min-width: 0;
  max-width: 780px;
}

.docs-content h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 300;
  margin-bottom: 1rem;
}

.docs-content h2 {
  scroll-margin-top: 100px;
  padding-top: 0.25rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
  font-size: 1.8rem;
}

.docs-content h3 {
  scroll-margin-top: 100px;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 500;
}

.docs-content h4 {
  scroll-margin-top: 100px;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
}

.docs-content p {
  line-height: 1.9;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-muted);
}

.docs-content ul, .docs-content ol {
  margin: 0 0 1.5rem 1.5rem;
  color: var(--text-muted);
  line-height: 1.9;
  font-size: 0.9rem;
  font-weight: 400;
}

.docs-content li {
  margin-bottom: 0.35rem;
}

.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
}

.docs-content th, .docs-content td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.docs-content th {
  font-weight: 400;
  color: var(--accent);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.docs-content td {
  color: var(--text-muted);
  font-weight: 400;
}

.docs-content td code {
  font-size: 0.82em;
}

.docs-content tr:hover td {
  background: var(--surface);
}

/* Callout blocks */
.callout {
  border-left: 3px solid var(--accent);
  background: var(--surface);
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
}

.callout-title {
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 0.4rem;
  font-family: var(--font-display);
  font-size: 1rem;
}

.callout p {
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  font-weight: 400;
}

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

.callout-warn {
  border-left-color: #e8a840;
}

.callout-warn .callout-title {
  color: #e8a840;
}

.callout-tip {
  border-left-color: #7a9a6a;
}

.callout-tip .callout-title {
  color: #7a9a6a;
}

/* In-page TOC */
.docs-toc {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.docs-toc h3 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin: 0 0 1rem;
  font-weight: 300;
}

.docs-toc ol {
  columns: 2;
  column-gap: 2rem;
  margin: 0;
  padding: 0;
  list-style-position: inside;
}

.docs-toc li {
  margin-bottom: 0.35rem;
  break-inside: avoid;
}

.docs-toc a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}

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

/* ═══════════════════════════
   DOWNLOAD TABLE
   ═══════════════════════════ */
.dl-table {
  width: 100%;
  max-width: 800px;
  margin: 0 auto 2rem;
  border-collapse: collapse;
}

.dl-table th, .dl-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.dl-table th {
  font-weight: 400;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.dl-table td {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
}

.dl-table tr:hover td {
  background: var(--surface);
}

.dl-table .dl-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--accent);
  font-weight: 400;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.dl-table .dl-link:hover {
  color: var(--text-primary);
}

.dl-table .dl-size {
  color: var(--text-dim);
  font-size: 0.8rem;
}

.dl-table .dl-disabled {
  color: var(--text-dim);
  cursor: default;
  text-decoration: none;
}

.dl-table .dl-disabled:hover {
  color: var(--text-dim);
}

/* Platform badges */
.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2em 0.65em;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* Download page layout */
.dl-main {
  max-width: var(--max-w);
  margin: 100px auto 0;
  padding: 3rem 2.5rem;
}

.dl-main h1 {
  text-align: center;
  margin-bottom: 0.5rem;
}

.dl-main .dl-desc {
  text-align: center;
  color: var(--text-dim);
  margin-bottom: 3rem;
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.8;
}

.dl-main h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 300;
  margin-bottom: 1.5rem;
  margin-top: 3rem;
}

.dl-main h2:first-of-type {
  margin-top: 0;
}

.dl-main h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

/* ═══════════════════════════
   CHANGELOG
   ═══════════════════════════ */
.changelog {
  max-width: 700px;
  margin: 100px auto 0;
  padding: 3rem 2.5rem;
}

.changelog h1 {
  text-align: center;
  margin-bottom: 3rem;
}

.changelog-entry {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.changelog-entry:first-child {
  border-top: 1px solid var(--border);
}

.changelog-entry:last-child {
  border-bottom: none;
}

.changelog-version {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--accent);
  font-size: 1.3rem;
}

.changelog-date {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-left: 1rem;
}

.changelog-entry ul {
  margin: 0.75rem 0 0 1.2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.9;
}

.changelog-entry li {
  margin-bottom: 0.35rem;
}

.changelog-entry a {
  color: var(--accent);
}

.changelog-entry a:hover {
  color: var(--text-primary);
}

/* ═══════════════════════════
   FOOTER
   ═══════════════════════════ */
.footer {
  padding: 3rem 2.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--max-w);
  margin: 0 auto;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.footer p {
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  font-family: var(--font-mono);
  margin-bottom: 0;
}

.footer a {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  text-decoration: none;
  transition: color 0.3s ease;
}

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

.footer-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

/* ═══════════════════════════
   RESPONSIVE
   ═══════════════════════════ */
@media (max-width: 900px) {
  .nav {
    padding: 1rem 1.5rem;
  }

  .container {
    padding: 0 1.5rem;
  }

  section, .section {
    padding: 5rem 0;
  }

  .nav-links {
    gap: 1.5rem;
  }

  .nav-links a {
    font-size: 0.65rem;
  }

  .hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .docs-layout {
    flex-direction: column;
    gap: 1.5rem;
    padding: 2rem 1.5rem;
  }

  .docs-sidebar {
    width: 100%;
    position: static;
    max-height: none;
  }

  .docs-sidebar nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.3rem;
  }

  .docs-sidebar a {
    border-left: none;
    border-bottom: 2px solid transparent;
    font-size: 0.82rem;
    padding: 0.3rem 0.55rem;
  }

  .docs-sidebar a.sub {
    padding-left: 0.55rem;
  }

  .docs-sidebar a.active {
    border-left: none;
    border-bottom-color: var(--accent);
  }

  .docs-sidebar .sidebar-section {
    width: 100%;
    margin-top: 0.25rem;
  }

  .docs-sidebar .sidebar-section-title {
    margin-top: 0.5rem;
  }

  .docs-toc ol {
    columns: 1;
  }

  .footer {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .footer-inner {
    flex-direction: column;
    gap: 1rem;
  }

  .dl-main {
    padding: 2rem 1.5rem;
  }

  .changelog {
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    gap: 1rem;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  .hero {
    min-height: auto;
    padding: 7rem 1rem 4rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

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

  .cta-actions {
    flex-direction: column;
    align-items: center;
  }

  .hero-scroll {
    display: none;
  }

  .dl-table {
    font-size: 0.78rem;
  }

  .dl-table th, .dl-table td {
    padding: 0.6rem 0.5rem;
  }

  pre {
    font-size: 0.75rem;
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 2.2rem;
  }

  .docs-content table {
    font-size: 0.75rem;
  }

  .docs-content th, .docs-content td {
    padding: 0.5rem 0.5rem;
  }
}
