/* FrontLang Web Documentation Stylesheet
   Designed and Owned by FrontTerrain
   Independent, statically-typed, indentation-based programming language built in Rust
*/

html, body {
  overflow-x: clip !important;
}

:root {
  --fl-ember: #f97316;
  --fl-ember-glow: rgba(249, 115, 22, 0.2);
  --fl-ember-dark: #ea580c;
  --fl-ember-subtle: rgba(249, 115, 22, 0.1);
  --fl-cyan: #06b6d4;
  --fl-cyan-glow: rgba(6, 182, 212, 0.2);
  --fl-purple: #8b5cf6;
  --fl-emerald: #10b981;
}

[data-theme="dark"] {
  --fl-ember: #fb923c;
  --fl-ember-glow: rgba(251, 146, 60, 0.25);
  --fl-ember-dark: #f97316;
  --fl-ember-subtle: rgba(251, 146, 60, 0.14);
  --fl-cyan: #38bdf8;
  --fl-cyan-glow: rgba(56, 189, 248, 0.25);
  --fl-purple: #a855f7;
  --fl-emerald: #34d399;
}

/* FrontLang Hero */
.fl-hero-brand {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.fl-hero-logo {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 4px 18px var(--fl-ember-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.fl-hero-logo:hover {
  transform: scale(1.05) rotate(3deg);
  box-shadow: 0 8px 24px var(--fl-ember-glow);
}

.fl-hero-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.fl-stat-pill {
  display: flex;
  flex-direction: column;
  padding: 0.85rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.fl-stat-pill .val {
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.2;
}

.fl-stat-pill .lbl {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Architecture Pipeline Interactive Flow */
.arch-flow-wrapper {
  margin: 2.5rem 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.arch-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 1rem 0;
}

.arch-node {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  padding: 1rem 1.4rem;
  text-align: center;
  border-radius: var(--radius-md);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 140px;
  cursor: pointer;
  position: relative;
}

.arch-node:hover,
.arch-node.active {
  border-color: var(--fl-ember);
  background: var(--surface);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--fl-ember-glow);
}

.arch-node-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fl-ember);
  display: block;
  margin-bottom: 0.35rem;
}

.arch-node-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  display: block;
}

.arch-arrow {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 1.25rem;
  padding: 0 0.5rem;
  user-select: none;
}

.arch-detail-card {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  color: var(--text-secondary);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.arch-detail-card .icon {
  font-size: 1.4rem;
  color: var(--fl-ember);
  flex-shrink: 0;
  margin-top: 0.1rem;
}

/* Documentation Layout */
.docs-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 3.5rem;
  align-items: start;
}

.docs-sidebar {
  position: -webkit-sticky;
  position: sticky;
  top: 4.8rem;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.9rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  z-index: 20;
}

.docs-sidebar::-webkit-scrollbar {
  width: 5px;
}

.docs-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.docs-sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
}

.docs-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}

.docs-search {
  margin-bottom: 0.5rem;
  position: relative;
}

.docs-search input {
  width: 100%;
  padding: 0.45rem 0.75rem 0.45rem 2rem;
  font-size: 0.78rem;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  outline: none;
  transition: all 0.18s ease;
}

.docs-search input:focus {
  border-color: var(--fl-ember);
  box-shadow: 0 0 0 2px var(--fl-ember-subtle);
}

.docs-search-icon {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.88rem;
  pointer-events: none;
}

.docs-sidebar a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.32rem 0.65rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  border-left: 2px solid transparent;
  transition: all 0.18s ease;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.docs-sidebar a:hover,
.docs-sidebar a.active {
  color: var(--text);
  border-left-color: var(--fl-ember);
  background: var(--surface-hover);
  font-weight: 600;
}

.docs-sidebar a .badge-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.docs-sidebar-title {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  padding: 0.35rem 0.65rem 0.15rem;
  margin-top: 0.45rem;
}

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

/* Documentation Content Sections */
.docs-content {
  min-width: 0;
}

.doc-section {
  padding-top: 3.5rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 3rem;
}

.doc-section:first-child {
  padding-top: 0;
}

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

.doc-section h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.doc-section h3 {
  font-size: 1.35rem;
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
}

.doc-section h4 {
  font-size: 1.1rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.doc-section p {
  margin-bottom: 1.25rem;
  font-size: 1rem;
  line-height: 1.7;
}

/* Feature Grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 1.75rem 0;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: all 0.22s ease;
  box-shadow: var(--shadow-sm);
}

.feature-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.feature-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin-bottom: 1.25rem;
}

.feature-card h3 {
  font-size: 1.15rem;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.92rem;
  margin-bottom: 0;
  color: var(--text-secondary);
}

/* Callout Boxes */
.fl-callout {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-left: 4px solid var(--fl-ember);
  padding: 1.25rem 1.5rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 1.5rem 0;
}

.fl-callout.info {
  border-left-color: var(--fl-cyan);
}

.fl-callout.tip {
  border-left-color: var(--fl-emerald);
}

.fl-callout-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.fl-callout p {
  margin-bottom: 0;
  font-size: 0.92rem;
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.fl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  text-align: left;
}

.fl-table th {
  background: var(--surface-subtle);
  color: var(--text);
  font-weight: 700;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.fl-table td {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

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

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

.fl-table code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--surface-subtle);
  padding: 0.2rem 0.45rem;
  color: var(--fl-ember);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

/* Code Blocks & Tabs */
.code-block {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  overflow: hidden;
  margin: 1.25rem 0;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.code-block-header {
  background: rgba(255, 255, 255, 0.04);
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--code-border);
}

.code-block-lang {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.code-block-copy {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  padding: 0.3rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.18s ease;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.code-block-copy:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}

.code-block-copy.copied {
  color: #34d399;
  border-color: #34d399;
}

.code-block pre {
  padding: 1.25rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--code-text);
  overflow-x: auto;
  margin: 0;
  background: transparent;
  border: none;
}

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

/* Syntax Highlighting */
.syn-kw { color: #f97316; font-weight: 600; } /* Keywords: let, fn, return, if, etc */
.syn-fn { color: #60a5fa; font-weight: 600; } /* Function names */
.syn-typ { color: #38bdf8; font-weight: 600; } /* Types: Int, Float, String, etc */
.syn-str { color: #34d399; } /* Strings */
.syn-num { color: #fbbf24; } /* Numbers */
.syn-cm { color: #64748b; font-style: italic; } /* Comments */
.syn-op { color: #f43f5e; } /* Operators */
.syn-meta { color: #c084fc; font-weight: 600; } /* Toml/CLI keys */

/* Terminal Window */
.terminal-window {
  background: #090d16;
  border: 1px solid #1e293b;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  margin: 1.5rem 0;
}

.terminal-header {
  background: #0f172a;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #1e293b;
  position: relative;
}

.terminal-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  margin-right: 7px;
  display: inline-block;
}

.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

.terminal-title {
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  margin-left: auto;
  margin-right: auto;
  user-select: none;
}

.terminal-body {
  padding: 1.25rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.7;
  color: #e2e8f0;
  overflow-x: auto;
}

.cmd-line {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.cmd-prompt {
  color: #38bdf8;
  font-weight: 700;
  user-select: none;
}

.cmd-name {
  color: #f97316;
  font-weight: 600;
}

.cmd-desc {
  color: #94a3b8;
}

/* Interactive Playground Simulator */
.playground-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  margin: 2rem 0;
}

.playground-header {
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.playground-presets {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.playground-preset-btn {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.18s ease;
}

.playground-preset-btn:hover,
.playground-preset-btn.active {
  border-color: var(--fl-ember);
  color: var(--fl-ember);
  background: var(--fl-ember-subtle);
}

.playground-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.playground-run-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--fl-ember);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px var(--fl-ember-glow);
}

.playground-run-btn:hover {
  background: var(--fl-ember-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--fl-ember-glow);
}

.playground-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 380px;
}

.playground-editor {
  background: var(--code-bg);
  border-right: 1px solid var(--code-border);
  padding: 1.25rem;
  position: relative;
}

.playground-editor textarea {
  width: 100%;
  height: 100%;
  min-height: 340px;
  background: transparent;
  border: none;
  color: var(--code-text);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.7;
  resize: vertical;
  outline: none;
  white-space: pre;
}

.playground-output {
  background: #090d16;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.playground-output-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.playground-terminal-screen {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.65;
  color: #34d399;
  white-space: pre-wrap;
  word-break: break-all;
}

/* VS Code Download Card */
.vscode-card {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.06) 0%, rgba(59, 130, 246, 0.06) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: center;
  gap: 2rem;
  margin: 2rem 0;
}

.vscode-icon-box {
  width: 80px;
  height: 80px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.vscode-icon-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Installation Tabs */
.install-tabs-wrapper {
  margin: 1.25rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.install-tabs-header {
  display: flex;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
  padding: 0.35rem 0.5rem;
  gap: 0.35rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.install-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.install-tab-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.install-tab-btn.active {
  color: var(--fl-ember);
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.install-tab-pane {
  display: none;
  padding: 0;
}

.install-tab-pane.active {
  display: block;
}

.install-tab-pane .code-block {
  margin: 0;
  border: none;
  border-radius: 0;
}

/* Mobile Documentation Navigation Bar (Hidden by default on Desktop) */
.docs-mobile-bar {
  display: none;
}

.docs-sidebar-mobile-header {
  display: none;
}

.docs-sidebar-backdrop {
  display: none;
}

.docs-back-to-top {
  display: none;
}

@media (max-width: 1024px) and (min-width: 769px) {
  .docs-layout {
    grid-template-columns: 220px 1fr;
    gap: 2rem;
  }
  .docs-sidebar {
    position: sticky;
    top: 5rem;
    align-self: start;
  }
}

@media (max-width: 768px) {
  .docs-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  /* Mobile Sticky Docs Quick Bar */
  .docs-mobile-bar {
    display: block;
    position: -webkit-sticky;
    position: sticky;
    top: 60px;
    z-index: 850;
    background: var(--bg-translucent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 0.65rem 0;
    margin-bottom: 1.5rem;
  }

  .docs-mobile-toc-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
  }

  .docs-mobile-toc-toggle:hover {
    border-color: var(--fl-ember);
    background: var(--surface-hover);
  }

  .docs-mobile-toc-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 80%;
  }

  .docs-mobile-toc-label strong {
    color: var(--fl-ember);
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .docs-mobile-arrow {
    font-size: 1.1rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
  }

  .docs-mobile-toc-toggle[aria-expanded="true"] .docs-mobile-arrow {
    transform: rotate(180deg);
  }

  /* Slide-Out Drawer Sidebar on Mobile */
  .docs-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 320px;
    max-width: 86vw;
    height: 100dvh;
    max-height: 100dvh;
    background: var(--bg);
    border-right: 1px solid var(--border);
    border-radius: 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 1200;
    padding: 1.25rem 1rem;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .docs-sidebar.is-open {
    transform: translateX(0);
  }

  .docs-sidebar-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
  }

  .docs-sidebar-mobile-close {
    font-size: 1.4rem;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: color 0.15s ease;
  }

  .docs-sidebar-mobile-close:hover {
    color: var(--text);
  }

  .docs-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1150;
    opacity: 0;
    transition: opacity 0.25s ease;
  }

  .docs-sidebar-backdrop.is-open {
    display: block;
    opacity: 1;
  }

  /* Floating Back to Top Button on Mobile */
  .docs-back-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.25rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    z-index: 800;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

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

  .docs-back-to-top:hover {
    background: var(--fl-ember);
    color: #ffffff;
    border-color: var(--fl-ember);
  }

  /* Playground Mobile Adjustments */
  .playground-body {
    grid-template-columns: 1fr;
  }

  .playground-editor {
    border-right: none;
    border-bottom: 1px solid var(--code-border);
    padding: 1rem;
  }

  .playground-editor textarea {
    min-height: 240px;
    font-size: 0.82rem;
  }

  .playground-output {
    padding: 1rem;
  }

  .playground-terminal-screen {
    font-size: 0.8rem;
    max-height: 240px;
    overflow-y: auto;
  }

  .playground-presets {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding-bottom: 0.35rem;
  }

  .playground-preset-btn {
    flex-shrink: 0;
  }

  .vscode-card {
    grid-template-columns: 1fr;
    text-align: left;
    gap: 1.5rem;
    padding: 1.5rem;
  }

  .doc-section {
    padding-top: 2.75rem;
    padding-bottom: 2.5rem;
  }

  .doc-section h2 {
    font-size: 1.65rem;
    flex-wrap: wrap;
  }

  .doc-section h3 {
    font-size: 1.2rem;
  }

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

  .table-wrapper {
    margin: 1.25rem 0;
    border-radius: var(--radius-md);
  }

  .fl-table th, .fl-table td {
    padding: 0.75rem 0.9rem;
    font-size: 0.84rem;
  }
}

@media (max-width: 640px) {
  .fl-hero-brand {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
  }

  .fl-hero-logo {
    width: 52px;
    height: 52px;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-buttons a {
    width: 100%;
    text-align: center;
  }

  .arch-flow-wrapper {
    padding: 1.25rem;
  }

  .arch-flow {
    flex-direction: column;
    width: 100%;
  }

  .arch-node {
    width: 100%;
    min-width: auto;
    padding: 0.85rem 1rem;
  }

  .arch-arrow {
    transform: rotate(90deg);
    padding: 0.25rem 0;
  }

  .code-block pre {
    padding: 1rem 1.15rem;
    font-size: 0.82rem;
  }

  .typography-stage, .gui-preview-board {
    padding: 1.25rem;
  }

  .fl-callout {
    padding: 1rem 1.15rem;
  }
}

@media (max-width: 480px) {
  .hero-buttons a {
    padding: 0.65rem 1rem;
    font-size: 0.88rem;
  }

  .doc-section h2 {
    font-size: 1.45rem;
  }

  .playground-header {
    padding: 0.75rem 1rem;
  }

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

/* Typography & GUI Showcase Styles */
.typography-stage {
  background: #090d16;
  border: 1px solid #1e293b;
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin: 1.5rem 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.typography-sample {
  padding: 1.25rem 0;
  border-bottom: 1px solid #1e293b;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.typography-sample:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.typography-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--fl-ember);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.typography-render {
  color: #f8fafc;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.gui-preview-board {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}

.gui-mock-window {
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.gui-mock-switch {
  display: inline-flex;
  align-items: center;
  width: 52px;
  height: 28px;
  background: var(--fl-ember);
  border-radius: 9999px;
  padding: 3px;
  position: relative;
  box-shadow: 0 2px 8px var(--fl-ember-glow);
}

.gui-mock-switch-thumb {
  width: 22px;
  height: 22px;
  background: #ffffff;
  border-radius: 50%;
  transform: translateX(24px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.gui-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
}
