/* ============================================================
   GrassGreen (G&G) — Official Documentation & Homepage Stylesheet
   Strict Palette: Deep matte black, noble dark green, emerald accent
   Rule: No raster images, no emojis, pure vector SVGs & 60 FPS performance
   ============================================================ */

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

:root {
  --bg-deep:        #09090b;
  --bg-surface:     #0c0f0d;
  --bg-card:        rgba(12, 15, 13, 0.72);
  --bg-card-hover:  rgba(16, 21, 18, 0.88);
  --green-dark:     #15803d;
  --green-mid:      #166534;
  --green-bright:   #22c55e;
  --green-glow:     #4ade80;
  --text-primary:   #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-dim:       #71717a;
  --border-subtle:  rgba(34, 197, 94, 0.16);
  --border-card:    rgba(34, 197, 94, 0.10);
  --border-active:  rgba(34, 197, 94, 0.45);
  --font-mono:      'JetBrains Mono', 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  --font-sans:      'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-xs:      4px;
  --radius-sm:      6px;
  --radius-md:      12px;
  --radius-lg:      18px;
  --blur:           12px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  max-width: 100vw;
  min-height: 100vh;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
  background: rgba(34, 197, 94, 0.22);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(34, 197, 94, 0.45);
}

a {
  color: var(--green-bright);
  text-decoration: none;
  transition: color 0.18s ease;
}
a:hover {
  color: var(--green-glow);
}

svg {
  display: block;
  flex-shrink: 0;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Header --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(9, 9, 11, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.25s ease,
              box-shadow 0.25s ease,
              backdrop-filter 0.25s ease;
}

.site-header.scrolled {
  background: rgba(9, 9, 11, 0.90);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom-color: rgba(34, 197, 94, 0.28);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.6);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.header-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
  text-decoration: none;
}
.header-brand svg {
  width: 36px;
  height: 36px;
}
.header-brand-text {
  display: flex;
  flex-direction: column;
}
.header-brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  line-height: 1.1;
}
.header-brand-tag {
  font-size: 0.6875rem;
  color: var(--green-bright);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.header-nav a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.18s ease;
  font-weight: 500;
}
.header-nav a:hover,
.header-nav a.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Sponsor / Donate Button */
.btn-sponsor {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--green-bright);
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.32);
  border-radius: var(--radius-sm);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-sponsor::before {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 70%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(74, 222, 128, 0.28) 50%,
    transparent 100%
  );
  transform: skewX(-25deg);
  animation: sponsorShimmer 4.5s ease-in-out infinite;
  pointer-events: none;
}
.btn-sponsor:hover {
  background: rgba(34, 197, 94, 0.18);
  border-color: var(--green-bright);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.35);
  transform: translateY(-1px);
}
.btn-sponsor svg {
  width: 15px;
  height: 15px;
  stroke: var(--green-bright);
  fill: rgba(34, 197, 94, 0.25);
  transition: transform 0.25s ease, fill 0.25s ease, stroke 0.25s ease;
  animation: sponsorHeartPulse 2.6s ease-in-out infinite;
}
.btn-sponsor:hover svg {
  stroke: #ffffff;
  fill: var(--green-bright);
  animation: sponsorHeartPulseHover 0.75s ease-in-out infinite;
}

@keyframes sponsorHeartPulse {
  0%, 100% {
    transform: scale(1);
  }
  14% {
    transform: scale(1.18);
  }
  28% {
    transform: scale(1);
  }
  42% {
    transform: scale(1.14);
  }
  70% {
    transform: scale(1);
  }
}

@keyframes sponsorHeartPulseHover {
  0%, 100% {
    transform: scale(1.05);
  }
  50% {
    transform: scale(1.28);
  }
}

@keyframes sponsorShimmer {
  0%, 70% {
    left: -120%;
  }
  100% {
    left: 220%;
  }
}

.btn-github {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  transition: all 0.18s ease;
}
.btn-github:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}
.btn-github svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}
.github-stars {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--green-bright);
  background: rgba(34, 197, 94, 0.10);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(34, 197, 94, 0.2);
}
.github-stars svg {
  width: 11px;
  height: 11px;
  fill: currentColor;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}
.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-mono);
}
.lang-btn.active {
  background: var(--green-dark);
  color: #ffffff;
}

.header-hamburger {
  display: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 8px;
  cursor: pointer;
  color: var(--text-primary);
}
.header-hamburger svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

/* --- Hero Section --- */
.hero {
  min-height: calc(100vh - 68px);
  margin-top: 68px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 72px 0 60px;
}

.hero-glow-bg {
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(21, 128, 61, 0.13) 0%, rgba(9, 9, 11, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  text-align: center;
  max-width: 880px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: 999px;
  font-size: 0.78125rem;
  font-family: var(--font-mono);
  color: var(--green-bright);
  margin-bottom: 24px;
}
.hero-pill svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
}

.hero h1 {
  font-size: clamp(2.1rem, 4.8vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: #ffffff;
  margin-bottom: 18px;
}

.hero-sub {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 34px;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}
.hero-sub .dot-sep {
  display: inline-block;
  margin: 0 10px;
  color: var(--green-bright);
  opacity: 0.6;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 34px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 28px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #ffffff;
  background: var(--green-dark);
  border: 1px solid var(--green-bright);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 18px rgba(22, 101, 52, 0.35);
}
.btn-primary:hover {
  background: var(--green-mid);
  border-color: var(--green-glow);
  box-shadow: 0 6px 26px rgba(34, 197, 94, 0.28);
  color: #ffffff;
  transform: translateY(-1px);
}
.btn-primary svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 26px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-secondary:hover {
  border-color: var(--green-bright);
  background: rgba(34, 197, 94, 0.07);
  color: #ffffff;
  transform: translateY(-1px);
}
.btn-secondary svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

/* Quickstart Console Widget */
.terminal-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 100%;
}

.terminal-modes {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
  max-width: 100%;
  overflow-x: auto;
}

.term-mode-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.term-mode-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}
.term-mode-btn.active {
  background: var(--green-dark);
  color: #ffffff;
  border-color: var(--green-bright);
}

.terminal-bar {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  font-family: var(--font-mono);
  font-size: 0.84375rem;
  max-width: 100%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.terminal-prompt {
  color: var(--green-bright);
  user-select: none;
  font-weight: 700;
}
.terminal-cmd {
  color: var(--text-primary);
  white-space: nowrap;
  overflow-x: auto;
}
.btn-copy-term {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xs);
  color: var(--text-dim);
  cursor: pointer;
  padding: 5px 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.71875rem;
  transition: all 0.15s ease;
  font-family: var(--font-sans);
}
.btn-copy-term:hover {
  color: var(--green-bright);
  border-color: var(--green-bright);
  background: rgba(34, 197, 94, 0.1);
}
.btn-copy-term svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
}

/* --- Section Heading --- */
.section-head {
  text-align: center;
  margin-bottom: 50px;
}
.section-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--green-bright);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  background: rgba(34, 197, 94, 0.08);
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(34, 197, 94, 0.2);
}
.section-head h2 {
  font-size: clamp(1.6rem, 3.2vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #ffffff;
  margin-bottom: 12px;
}
.section-head p {
  color: var(--text-secondary);
  font-size: 0.96875rem;
  max-width: 640px;
  margin: 0 auto;
}

/* --- Code Showcase Section --- */
.code-section {
  padding: 70px 0 90px;
  position: relative;
}

.code-window-frame {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
}

.code-window-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0f1310;
  border-bottom: 1px solid var(--border-card);
  padding: 0 16px;
  min-height: 48px;
  gap: 12px;
}

.code-tabs-nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
}

.code-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-dim);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.code-tab-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
}
.code-tab-btn:hover {
  color: var(--text-secondary);
}
.code-tab-btn.active {
  color: var(--green-bright);
  border-bottom-color: var(--green-bright);
  background: rgba(34, 197, 94, 0.05);
}

.code-actions-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.code-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 500;
  transition: all 0.15s ease;
}
.code-copy-btn:hover {
  color: #ffffff;
  border-color: var(--green-bright);
  background: rgba(34, 197, 94, 0.1);
}
.code-copy-btn svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
}

.code-window-content {
  padding: 24px 28px;
  overflow-x: auto;
  background: #090b0a;
}
.code-window-content pre {
  font-family: var(--font-mono);
  font-size: 0.84375rem;
  line-height: 1.7;
  color: #e4e4e7;
  tab-size: 4;
}

.code-snippet-panel {
  display: none;
}
.code-snippet-panel.active {
  display: block;
  animation: codeTabSlide 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes codeTabSlide {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Syntax highlight tokens */
.tok-dir      { color: #4ade80; font-weight: 600; }  /* !GrassGreen! directives */
.tok-kw       { color: #86efac; font-weight: 600; }  /* take, int, return, for, if */
.tok-fn       { color: #6ee7b7; }                     /* main, start_time, lerp */
.tok-str      { color: #fde047; }                     /* "strings" */
.tok-num      { color: #fdba74; }                     /* 10, 3.14 */
.tok-com      { color: #71717a; font-style: italic; }/* // comments */
.tok-op       { color: #e4e4e7; }                     /* <<, >>, +, = */
.tok-pipe     { color: #38bdf8; font-weight: 600; }  /* gout, gin, endl */

/* --- Architecture & Core Highlights --- */
.arch-section {
  padding: 90px 0;
  border-top: 1px solid var(--border-subtle);
  position: relative;
}

.arch-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.arch-card {
  background: var(--bg-card);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 34px 30px;
  transition: all 0.22s ease;
  position: relative;
}
.arch-card:hover {
  border-color: var(--border-active);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.arch-card-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(34, 197, 94, 0.09);
  border: 1px solid rgba(34, 197, 94, 0.22);
  border-radius: var(--radius-md);
  margin-bottom: 22px;
  color: var(--green-bright);
}
.arch-card-icon svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
}

.arch-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #ffffff;
  margin-bottom: 12px;
}

.arch-card p {
  font-size: 0.90625rem;
  color: var(--text-secondary);
  line-height: 1.62;
}

.arch-card-specs {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.spec-badge {
  font-family: var(--font-mono);
  font-size: 0.71875rem;
  color: var(--green-bright);
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: var(--radius-xs);
  padding: 3px 8px;
}

/* --- Standard Library Catalog --- */
.stdlib-section {
  padding: 90px 0;
  border-top: 1px solid var(--border-subtle);
}

.stdlib-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.stdlib-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  flex: 1;
  max-width: 440px;
}
.stdlib-search-box svg {
  width: 17px;
  height: 17px;
  color: var(--text-dim);
  stroke: currentColor;
}
.stdlib-search-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  width: 100%;
}
.stdlib-search-input::placeholder {
  color: var(--text-dim);
}

.stdlib-count-pill {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-dim);
}
.stdlib-count-pill span {
  color: var(--green-bright);
  font-weight: 700;
}

.stdlib-grid {
  columns: 3 340px;
  column-gap: 20px;
}

.lib-card {
  break-inside: avoid;
  margin-bottom: 20px;
  background: var(--bg-card);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 22px;
  cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  display: block;
  width: 100%;
  box-sizing: border-box;
}
.lib-card:hover {
  border-color: var(--border-active);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}
.lib-card.expanded {
  border-color: var(--green-bright);
  background: rgba(16, 21, 18, 0.95);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.lib-card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}
.lib-card-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: var(--radius-sm);
  color: var(--green-bright);
  flex-shrink: 0;
}
.lib-card-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}
.lib-card-info {
  flex: 1;
}
.lib-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.lib-card-title h4 {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--green-bright);
}
.lib-card-expand-icon {
  color: var(--text-dim);
  transition: transform 0.2s ease;
}
.lib-card.expanded .lib-card-expand-icon {
  transform: rotate(180deg);
  color: var(--green-bright);
}
.lib-card-expand-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}
.lib-card-doc-ref {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.lib-card-desc {
  font-size: 0.859375rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 14px;
}

.lib-card-fn-list {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.38s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.28s ease,
              margin-top 0.28s ease,
              padding-top 0.28s ease;
  margin-top: 0;
  padding-top: 0;
  border-top: 1px solid transparent;
}
.lib-card.expanded .lib-card-fn-list {
  max-height: 900px;
  opacity: 1;
  margin-top: 14px;
  padding-top: 14px;
  border-top-color: rgba(255, 255, 255, 0.06);
}

.fn-entry {
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 0.78125rem;
}
.fn-entry:last-child {
  border-bottom: none;
}
.fn-code {
  font-family: var(--font-mono);
  color: var(--green-bright);
  display: block;
  font-weight: 600;
  margin-bottom: 2px;
}
.fn-desc {
  color: var(--text-secondary);
  line-height: 1.45;
}

/* --- Roadmap v4.0 (The Evolution) --- */
.roadmap-section {
  padding: 90px 0;
  border-top: 1px solid var(--border-subtle);
}

.roadmap-filter-bar {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.roadmap-filter-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  color: var(--text-dim);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-mono);
}
.roadmap-filter-btn:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.18);
}
.roadmap-filter-btn.active {
  background: var(--green-dark);
  color: #ffffff;
  border-color: var(--green-bright);
}

.timeline-container {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding-left: 36px;
}
.timeline-container::before {
  content: '';
  position: absolute;
  top: 12px;
  bottom: 20px;
  left: 11px;
  width: 2px;
  background: linear-gradient(to bottom, var(--green-bright) 0%, var(--green-mid) 70%, rgba(21, 128, 61, 0.2) 100%);
}

.timeline-item {
  position: relative;
  padding-bottom: 32px;
}
.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -32px;
  top: 5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-deep);
  border: 2px solid var(--green-bright);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}
.timeline-dot::after {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--green-bright);
  border-radius: 50%;
}

.timeline-card {
  background: var(--bg-card);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  transition: all 0.2s ease;
}
.timeline-card:hover {
  border-color: var(--border-active);
  background: var(--bg-card-hover);
}

.timeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.timeline-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.timeline-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--green-bright);
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: 4px;
  padding: 2px 7px;
}
.timeline-card h4 {
  font-size: 0.984375rem;
  font-weight: 700;
  color: #ffffff;
}

.timeline-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--green-bright);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(34, 197, 94, 0.08);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(34, 197, 94, 0.2);
}
.timeline-status svg {
  width: 10px;
  height: 10px;
  stroke: currentColor;
}

.timeline-body {
  font-size: 0.859375rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.timeline-body ul {
  list-style: none;
  margin-top: 8px;
  padding-left: 0;
}
.timeline-body li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 4px;
}
.timeline-body li::before {
  content: '›';
  position: absolute;
  left: 2px;
  color: var(--green-bright);
  font-weight: 700;
}

/* --- Documentation Section --- */
.docs-section {
  padding: 90px 0;
  border-top: 1px solid var(--border-subtle);
}

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

.doc-quick-card {
  background: var(--bg-card);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}
.doc-quick-card:hover {
  border-color: var(--border-active);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}
.doc-quick-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: var(--radius-sm);
  color: var(--green-bright);
  margin-bottom: 16px;
}
.doc-quick-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
}
.doc-quick-card h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
}
.doc-quick-card p {
  font-size: 0.859375rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 16px;
  flex: 1;
}
.doc-quick-link {
  font-size: 0.8125rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green-bright);
}
.doc-quick-link svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  transition: transform 0.15s ease;
}
.doc-quick-link:hover svg {
  transform: translateX(3px);
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: #060706;
  padding: 56px 0 32px;
}

.footer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 36px;
  flex-wrap: wrap;
  margin-bottom: 44px;
}

.footer-brand-wrap {
  max-width: 380px;
}
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  color: #ffffff;
}
.footer-logo svg {
  width: 32px;
  height: 32px;
}
.footer-logo-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.footer-desc {
  font-size: 0.859375rem;
  color: var(--text-dim);
  line-height: 1.6;
}

.footer-col-group {
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
}
.footer-col h5 {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  margin-bottom: 14px;
  font-family: var(--font-mono);
}
.footer-col ul {
  list-style: none;
}
.footer-col li {
  margin-bottom: 8px;
}
.footer-col a {
  font-size: 0.84375rem;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}
.footer-col a:hover {
  color: var(--green-bright);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 26px;
  font-size: 0.8125rem;
  color: var(--text-dim);
  flex-wrap: wrap;
  gap: 16px;
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Toast Notification */
.toast-notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f1712;
  border: 1px solid var(--green-bright);
  color: var(--text-primary);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-family: var(--font-mono);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translateY(120%);
  opacity: 0;
  transition: all 0.25s ease;
  pointer-events: none;
}
.toast-notice.show {
  transform: translateY(0);
  opacity: 1;
}
.toast-notice svg {
  width: 16px;
  height: 16px;
  stroke: var(--green-bright);
}

/* --- Localization Visibility Rules --- */
[data-lang="en"] [data-i18n-ru],
[data-lang="ru"] [data-i18n-en] {
  display: none !important;
}

/* --- Universal Focus for Keyboard, Remote & Accessibility --- */
:focus-visible {
  outline: 2px solid var(--green-bright);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

/* ============================================================
   Comprehensive Multi-Device Responsiveness (Mobile, Tablet, Desktop, 4K TV)
   ============================================================ */

/* --- 1. Large 4K Monitors & Smart TVs (>= 2560px) --- */
@media (min-width: 2560px) {
  html {
    font-size: 20px;
  }
  .container {
    max-width: 1720px;
    padding: 0 40px;
  }
  .hero-glow-bg {
    width: 1300px;
    height: 800px;
  }
  .arch-grid {
    gap: 32px;
  }
  .stdlib-grid {
    columns: 3 420px;
    column-gap: 24px;
  }
  .timeline-container {
    max-width: 1100px;
  }
}

/* --- 2. 2K & Ultrawide Displays (1600px - 2559px) --- */
@media (min-width: 1600px) and (max-width: 2559px) {
  html {
    font-size: 17px;
  }
  .container {
    max-width: 1440px;
    padding: 0 32px;
  }
  .stdlib-grid {
    columns: 3 380px;
    column-gap: 22px;
  }
}

/* --- 3. Laptops & Small Desktops (961px - 1200px) --- */
@media (min-width: 961px) and (max-width: 1200px) {
  .container {
    padding: 0 24px;
  }
  .stdlib-grid {
    columns: 3 310px;
    column-gap: 18px;
  }
}

/* --- 4. Tablets & iPad (Portrait and Landscape: 769px - 960px) --- */
@media (max-width: 960px) {
  .header-nav {
    display: none;
  }
  .header-hamburger {
    display: block;
  }

  .header-nav.mobile-active {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(9, 9, 11, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 32px 28px;
    gap: 12px;
    z-index: 999;
    overflow-y: auto;
  }
  .header-nav.mobile-active a {
    font-size: 1.25rem;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
  }

  .arch-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }
  .stdlib-grid {
    columns: 2 300px;
    column-gap: 16px;
  }
  .docs-quick-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }
  .footer-col-group {
    gap: 36px;
  }
}

/* --- 5. Large Phones & Phablets (481px - 768px) --- */
@media (max-width: 768px) {
  .hero {
    padding: 48px 0;
    min-height: auto;
  }
  .hero h1 {
    font-size: clamp(1.75rem, 5.5vw, 2.5rem);
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
    gap: 12px;
  }
  .btn-primary, .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  .terminal-widget {
    width: 100%;
  }
  .terminal-modes {
    width: 100%;
    justify-content: center;
  }
  .terminal-bar {
    width: 100%;
    justify-content: space-between;
  }

  .arch-grid {
    grid-template-columns: 1fr;
  }
  .stdlib-grid {
    columns: 1;
    column-gap: 0;
  }
  .docs-quick-grid {
    grid-template-columns: 1fr;
  }

  .stdlib-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .stdlib-search-box {
    max-width: 100%;
    width: 100%;
  }

  .footer-top {
    flex-direction: column;
    gap: 32px;
  }
  .footer-col-group {
    width: 100%;
    justify-content: space-between;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
}

/* --- 6. Standard & Compact Phones (320px - 480px) --- */
@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .header-brand-name {
    font-size: 1.05rem;
  }
  .header-brand-tag {
    display: none;
  }

  /* Compact Sponsor & GitHub buttons on narrow screens: keep icon only */
  .btn-sponsor span {
    display: none;
  }
  .btn-sponsor {
    padding: 6px 9px;
  }

  .btn-github span:not(.github-stars) {
    display: none;
  }
  .btn-github {
    padding: 6px 10px;
    gap: 6px;
  }

  .hero {
    padding: 36px 0;
  }
  .hero h1 {
    font-size: 1.65rem;
    letter-spacing: -0.025em;
  }
  .hero-sub {
    font-size: 0.875rem;
    margin-bottom: 24px;
  }
  .hero-sub .dot-sep {
    margin: 0 6px;
  }

  .hero-pill {
    font-size: 0.71875rem;
    padding: 4px 10px;
    margin-bottom: 18px;
  }

  /* Terminal modes wrapping */
  .terminal-modes {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
  }
  .term-mode-btn {
    flex: 1 1 auto;
    text-align: center;
    font-size: 0.6875rem;
    padding: 4px 8px;
  }

  .terminal-bar {
    font-size: 0.75rem;
    padding: 8px 12px;
    width: 100%;
    gap: 8px;
  }
  .terminal-cmd {
    font-size: 0.75rem;
  }

  /* Code Showcase on mobile */
  .code-section {
    padding: 50px 0 60px;
  }
  .code-window-top {
    flex-direction: column;
    align-items: stretch;
    padding: 10px 12px;
    gap: 8px;
  }
  .code-tabs-nav {
    overflow-x: auto;
    width: 100%;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .code-tabs-nav::-webkit-scrollbar {
    display: none;
  }
  .code-tab-btn {
    font-size: 0.75rem;
    padding: 8px 12px;
  }
  .code-actions-top {
    width: 100%;
    justify-content: flex-end;
  }
  .code-window-content {
    padding: 18px 14px;
  }
  .code-window-content pre {
    font-size: 0.75rem;
    line-height: 1.6;
  }

  /* Key Advantages */
  .arch-section {
    padding: 60px 0;
  }
  .arch-card {
    padding: 24px 20px;
  }
  .arch-card h3 {
    font-size: 1.05rem;
  }

  /* Standard Library */
  .stdlib-section {
    padding: 60px 0;
  }
  .lib-card {
    padding: 18px 16px;
  }
  .lib-card-title h4 {
    font-size: 0.9375rem;
  }
  .fn-code {
    font-size: 0.75rem;
    word-break: break-all;
  }
  .fn-desc {
    font-size: 0.75rem;
  }

  /* Roadmap Timeline */
  .roadmap-section {
    padding: 60px 0;
  }
  .roadmap-filter-bar {
    gap: 6px;
    margin-bottom: 28px;
  }
  .roadmap-filter-btn {
    font-size: 0.71875rem;
    padding: 5px 10px;
  }
  .timeline-container {
    padding-left: 24px;
  }
  .timeline-container::before {
    left: 6px;
  }
  .timeline-dot {
    left: -24px;
    width: 13px;
    height: 13px;
    top: 6px;
  }
  .timeline-dot::after {
    width: 5px;
    height: 5px;
  }
  .timeline-card {
    padding: 16px 14px;
  }
  .timeline-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .timeline-card h4 {
    font-size: 0.90625rem;
  }
  .timeline-body {
    font-size: 0.8125rem;
  }

  /* Docs Quick Hub */
  .docs-section {
    padding: 60px 0;
  }
  .doc-quick-card {
    padding: 20px 18px;
  }

  /* Footer */
  .site-footer {
    padding: 40px 0 24px;
  }
  .footer-col-group {
    flex-direction: column;
    gap: 24px;
  }
}

/* --- 7. Extra Small Foldable Screens (<= 340px) --- */
@media (max-width: 340px) {
  .container {
    padding: 0 10px;
  }
  .header-brand svg {
    width: 28px;
    height: 28px;
  }
  .header-brand-name {
    font-size: 0.95rem;
  }
  .btn-primary, .btn-secondary {
    font-size: 0.8125rem;
    padding: 10px 14px;
  }
  .hero h1 {
    font-size: 1.45rem;
  }
}
