/* ============================================
   Terminal Theme
   Agent-first dark mode design
   Optimized for LLM parsing + power users
   ============================================ */

/* Theme activation - Dark by default */
.terminal-theme {
  /* Dark palette - Slate tones */
  --color-bg: #0F172A;
  --color-fg: #E2E8F0;
  --color-muted: #94A3B8;
  --color-faded: #64748B;

  /* Surfaces - subtle elevation */
  --color-surface: #1E293B;
  --color-surface-hover: #334155;
  --color-border: #334155;

  /* Accent - Cyan for high visibility */
  --color-accent: #22D3EE;
  --color-accent-hover: #06B6D4;
  --color-accent-subtle: rgba(34, 211, 238, 0.15);

  /* Secondary accent */
  --color-accent-2: #A78BFA;

  /* Code highlighting palette - softer contrast */
  --code-bg: #1E293B;
  --code-fg: #CBD5E1;
  --code-comment: #64748B;
  --code-keyword: #F472B6;
  --code-string: #34D399;
  --code-function: #60A5FA;
  --code-number: #FBBF24;

  /* Status colors */
  --color-ok: #4ADE80;
  --color-warn: #FBBF24;
  --color-bad: #F87171;

  /* Typography - ALL monospace */
  --font-mono: "JetBrains Mono", "Fira Code", "SF Mono", "Cascadia Code", "Noto Sans Mono", monospace;

  /* Tighter scale for density */
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-lg: 1rem;
  --text-xl: 1.125rem;
  --text-2xl: 1.375rem;
  --text-3xl: 1.75rem;

  /* Apply base styles */
  background-color: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-mono);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  letter-spacing: 0.01em;
  transition: var(--theme-transition);
}

/* Light mode variant (inverted) */
.terminal-theme.-no-dark-theme {
  --color-bg: #F8FAFC;
  --color-fg: #0F172A;
  --color-muted: #475569;
  --color-faded: #94A3B8;
  --color-surface: #F1F5F9;
  --color-surface-hover: #E2E8F0;
  --color-border: #CBD5E1;
  --color-accent: #0891B2;
  --color-accent-hover: #0E7490;
  --color-accent-subtle: rgba(8, 145, 178, 0.1);
  --code-bg: #1E293B;
  --code-fg: #E2E8F0;
}

/* ============================================
   Layout: Dense Information Architecture
   ============================================ */

.terminal-theme .container {
  max-inline-size: 56rem;
  margin-inline: auto;
  padding-inline: var(--space-6);
}

/* Section dividers with labels */
.terminal-theme .section,
.terminal-theme #features-list,
.terminal-theme #intro-to-hyperscript {
  border-block-end: 1px solid var(--color-border);
  padding-block: var(--space-6);
}

/* Section headers with gradient line */
.terminal-theme .section-header,
.terminal-theme #features-list h2 {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-block-end: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.terminal-theme .section-header::after,
.terminal-theme #features-list h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--color-border), transparent);
}

/* ============================================
   Hero: Command-line Style
   ============================================ */

.terminal-theme #intro-to-hyperscript {
  padding-block: var(--space-8);
}

.terminal-theme #intro-to-hyperscript h1 {
  font-size: var(--text-3xl);
  font-weight: 400;
  line-height: var(--leading-tight);
  margin-block-end: var(--space-2);
  color: var(--color-accent);
}

.terminal-theme #intro-to-hyperscript h1::before {
  content: "# ";
  color: var(--color-faded);
}

.terminal-theme #intro-to-hyperscript > div > p {
  color: var(--color-muted);
  font-size: var(--text-base);
}

.terminal-theme #intro-to-hyperscript > div > p::before {
  content: "# ";
  color: var(--color-faded);
}

/* ============================================
   Features: Dense Grid
   ============================================ */

.terminal-theme #features-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-inline-size: 56rem;
  margin-inline: auto;
  padding-block: var(--space-4);
}

.terminal-theme #features-list h2 {
  text-align: center;
  margin-block: var(--space-6);
}

.terminal-theme #features-list > div {
  padding: var(--space-4);
  margin-block: var(--space-3);
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  border-inline-start: 2px solid var(--color-accent);
}

.terminal-theme #features-list > div h3,
.terminal-theme #features-list > div strong {
  display: block;
  font-size: var(--text-base);
  color: var(--color-accent);
  margin-block-end: var(--space-2);
}

.terminal-theme #features-list > div p {
  font-size: var(--text-sm);
  color: var(--color-muted);
  margin: 0;
}


/* ============================================
   Typography: All Monospace
   ============================================ */

.terminal-theme h1,
.terminal-theme h2,
.terminal-theme h3,
.terminal-theme h4,
.terminal-theme p,
.terminal-theme li,
.terminal-theme a {
  font-family: var(--font-mono);
}

.terminal-theme h1 {
  font-size: var(--text-3xl);
  font-weight: 400;
  color: var(--color-accent);
}

.terminal-theme h2 {
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-muted);
}

.terminal-theme h3 {
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--color-accent);
}

.terminal-theme h4 {
  font-size: var(--text-base);
  font-weight: 500;
}

.terminal-theme a {
  color: var(--color-accent);
  text-decoration: none;
  border-block-end: 1px solid currentColor;
  transition: color 0.15s ease;
}

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

/* ============================================
   Code Blocks: The Star
   ============================================ */

.terminal-theme pre,
.terminal-theme pre[class*="language-"] {
  background: var(--code-bg);
  color: var(--code-fg);
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.6;
  position: relative;
}

/* Language label */
.terminal-theme pre[data-language]::before,
.terminal-theme pre[class*="language-"]::before {
  content: attr(data-language);
  position: absolute;
  inset-block-start: var(--space-2);
  inset-inline-end: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-faded);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.terminal-theme code,
.terminal-theme code[class*="language-"] {
  font-family: var(--font-mono);
}

.terminal-theme :not(pre) > code {
  background: var(--color-surface-hover);
  padding: 0.1em 0.3em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  color: var(--color-accent-2);
  font-size: 0.95em;
}

/* Syntax highlighting */
.terminal-theme .token.comment { color: var(--code-comment); }
.terminal-theme .token.keyword { color: var(--code-keyword); }
.terminal-theme .token.string { color: var(--code-string); }
.terminal-theme .token.function { color: var(--code-function); }
.terminal-theme .token.number { color: var(--code-number); }

/* ============================================
   Interactive Elements
   ============================================ */

.terminal-theme button,
.terminal-theme .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-bg);
  background: var(--color-accent);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.terminal-theme button:hover,
.terminal-theme .btn:hover {
  background: var(--color-accent-hover);
}

.terminal-theme button:active,
.terminal-theme .btn:active {
  transform: scale(0.98);
}

.terminal-theme button:focus-visible,
.terminal-theme .btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Demo box */
.terminal-theme .demo-box,
.terminal-theme figure {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

/* ============================================
   Navigation: Minimal
   ============================================ */

.terminal-theme .navbar {
  background: var(--color-bg);
  border-block-end: 1px solid var(--color-border);
}

.terminal-theme .navigation a {
  color: var(--color-fg);
  text-decoration: none;
  font-size: var(--text-sm);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  transition: color 0.15s ease;
}

.terminal-theme .navigation a:hover {
  color: var(--color-accent);
}

/* ============================================
   Forms
   ============================================ */

.terminal-theme input,
.terminal-theme select,
.terminal-theme textarea {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-fg);
  transition: border-color 0.15s ease;
}

.terminal-theme input:focus,
.terminal-theme select:focus,
.terminal-theme textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px var(--color-accent-subtle);
}

/* ============================================
   Status Bar (Footer)
   ============================================ */

.terminal-theme .status-bar,
.terminal-theme .box.warn {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.terminal-theme .box.warn {
  border-color: var(--color-warn);
  color: var(--color-warn);
}

/* ============================================
   Utility Classes
   ============================================ */

/* Numbered items for LLM parsing */
.terminal-theme [data-index]::before {
  content: "[" attr(data-index) "] ";
  color: var(--color-faded);
}

/* Status indicators */
.terminal-theme .status-ok { color: var(--color-ok); }
.terminal-theme .status-warn { color: var(--color-warn); }
.terminal-theme .status-bad { color: var(--color-bad); }

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
  .terminal-theme {
    font-size: var(--text-sm);
  }

  .terminal-theme h1 {
    font-size: var(--text-2xl);
  }

  .terminal-theme .container {
    padding-inline: var(--space-4);
  }
}

/* ============================================
   Print: Light mode
   ============================================ */

@media print {
  .terminal-theme {
    --color-bg: #ffffff;
    --color-fg: #000000;
    --color-surface: #f5f5f5;
    --color-accent: #0891B2;
  }
}
