@tailwind base;
@tailwind components;
@tailwind utilities;

/* Base styles */
@layer base {
  :root {
    --radius: 0.5rem;
    --font-mono: "JetBrains Mono", "Fira Code", monospace;

    /* Light mode colors */
    --primary: #2563eb;
    --primary-rgb: 37 99 235;
    --primary-light: rgba(37 99 235 / 0.14);
    --primary-dark: #1d4ed8;

    --secondary: #f97316;
    --secondary-rgb: 249 115 22;
    --secondary-light: rgba(249 115 22 / 0.14);

    --bg: #eef3f8;
    --bg-rgb: 238 243 248;
    --bg-secondary: #e2e8f0;
    --bg-tertiary: #cbd5e1;
    --terminal-bg: #f8fbff;

    --text: #0f172a;
    --text-rgb: 15 23 42;
    --text-secondary: #475569;
    --text-tertiary: #5f6f86;
    --terminal-text: #0f172a;
    --title-color: #0f172a;
    --button-text: #0f172a;

    --border-color: #d6e0ea;
    --border-color-rgb: 214 224 234;
    --terminal-border: #d6e0ea;

    --tag-bg: #edf3f8;
    --tag-text: #0f172a;

    --header-bg: rgba(244 248 252 / 0.92);
    --code-bg: #eef3f8;

    --success: #10b981;
    --success-rgb: 16 185 129;
    --success-light: #d1fae5;
    --success-dark: #065f46;

    --warning: #f59e0b;
    --warning-rgb: 245 158 11;
    --warning-light: #fef3c7;
    --warning-dark: #92400e;

    --danger: #ef4444;
    --danger-rgb: 239 68 68;
    --danger-light: #fee2e2;
    --danger-dark: #991b1b;

    --gray-light: #f3f4f6;
    --gray-dark: #374151;

    --btn-close: #ff5f56;
    --btn-minimize: #ffbd2e;
    --btn-expand: #27c93f;
  }

  html {
    scroll-behavior: smooth;
  }

  body {
    @apply bg-bg text-text antialiased;
    font-family:
      system-ui,
      -apple-system,
      BlinkMacSystemFont,
      "Segoe UI",
      Roboto,
      sans-serif;
  }
}

/* Dark mode via class */
html.dark {
  --primary: #00ff9d;
  --primary-rgb: 0 255 157;
  --primary-light: #00ff9d33;
  --primary-dark: #00b8ff;

  --secondary: #00b8ff;
  --secondary-rgb: 0 184 255;
  --secondary-light: #00b8ff33;

  --bg: #0a0e17;
  --bg-rgb: 10 14 23;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --terminal-bg: #0d1117;

  --text: #e6e6e6;
  --text-rgb: 230 230 230;
  --text-secondary: #d1d5db;
  --text-tertiary: #9ca3af;
  --terminal-text: #e6e6e6;
  --title-color: #ffffff;
  --button-text: #e6e6e6;

  --border-color: rgba(255 255 255 / 0.1);
  --border-color-rgb: 255 255 255;
  --terminal-border: rgba(255 255 255 / 0.1);

  --tag-bg: #161b22;
  --tag-text: #e6e6e6;

  --header-bg: rgba(22 27 34 / 0.9);
  --code-bg: #161b22;

  --success-light: #064e3b;
  --success-dark: #d1fae5;

  --warning-light: #78350f;
  --warning-dark: #fef3c7;

  --danger-light: #7f1d1d;
  --danger-dark: #fee2e2;

  --gray-light: #1f2937;
  --gray-dark: #e5e7eb;
}

/* System preference dark mode */
@media (prefers-color-scheme: dark) {
  :root:not(.light):not(.dark) {
    --primary: #00ff9d;
    --primary-rgb: 0 255 157;
    --primary-light: #00ff9d33;
    --primary-dark: #00b8ff;

    --secondary: #00b8ff;
    --secondary-rgb: 0 184 255;
    --secondary-light: #00b8ff33;

    --bg: #0a0e17;
    --bg-rgb: 10 14 23;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --terminal-bg: #0d1117;

    --text: #e6e6e6;
    --text-rgb: 230 230 230;
    --text-secondary: #d1d5db;
    --text-tertiary: #9ca3af;
    --terminal-text: #e6e6e6;
    --title-color: #ffffff;
    --button-text: #e6e6e6;

    --border-color: rgba(255 255 255 / 0.1);
    --border-color-rgb: 255 255 255;
    --terminal-border: rgba(255 255 255 / 0.1);

    --tag-bg: #161b22;
    --tag-text: #e6e6e6;

    --header-bg: rgba(22 27 34 / 0.9);
    --code-bg: #161b22;

    --success-light: #064e3b;
    --success-dark: #d1fae5;

    --warning-light: #78350f;
    --warning-dark: #fef3c7;

    --danger-light: #7f1d1d;
    --danger-dark: #fee2e2;

    --gray-light: #1f2937;
    --gray-dark: #e5e7eb;
  }
}

/* Components */
@layer components {
  /* Terminal window glow */
  .terminal-window {
    @apply relative overflow-hidden rounded-2xl;
    border: 1px solid
      color-mix(in oklab, var(--primary) 16%, var(--terminal-border));
    box-shadow:
      0 18px 40px rgba(var(--text-rgb), 0.06),
      0 0 0 1px rgba(255, 255, 255, 0.45);
  }

  /* Post card hover effect */
  .post-card {
    @apply relative transition-all duration-300;
  }

  .post-card::before {
    content: "";
    @apply absolute left-0 top-0 bottom-0 w-1 rounded-l opacity-0 transition-opacity duration-300;
    background-color: var(--post-border-color, var(--primary));
  }

  .post-card:hover {
    @apply translate-x-2;
  }

  .post-card:hover::before {
    @apply opacity-100;
  }

  /* ASCII art */
  .ascii-art {
    @apply font-mono text-xs sm:text-sm text-primary whitespace-pre;
  }

  /* Cursor blink */
  .cursor {
    @apply inline-block w-2.5 h-4 align-middle ml-0.5;
    background-color: var(--primary);
    animation: blink 1s infinite;
  }

  /* Theme toggle */
  .theme-toggle {
    @apply transition-all duration-300;
  }

  .theme-toggle i {
    @apply transition-transform duration-300;
  }

  .theme-toggle:hover i {
    @apply rotate-[30deg];
  }

  .terminal-panel {
    @apply rounded-xl border p-5;
    border-color: color-mix(in oklab, var(--primary) 10%, var(--border-color));
    background:
      linear-gradient(
        180deg,
        color-mix(in oklab, var(--terminal-bg) 98%, transparent),
        color-mix(in oklab, var(--header-bg) 92%, transparent)
      ),
      linear-gradient(
        90deg,
        rgba(var(--primary-rgb), 0.035),
        transparent 22%,
        rgba(var(--primary-rgb), 0.02) 78%,
        transparent
      );
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.5),
      0 10px 26px rgba(var(--text-rgb), 0.045);
  }

  .terminal-panel-muted {
    @apply rounded-xl border p-4;
    border-color: color-mix(in oklab, var(--primary) 6%, var(--border-color));
    background: linear-gradient(
      180deg,
      color-mix(in oklab, var(--terminal-bg) 96%, transparent),
      color-mix(in oklab, var(--header-bg) 90%, transparent)
    );
  }

  .terminal-kicker {
    @apply inline-flex items-center gap-2 rounded-md border px-2.5 py-1 text-[10px] font-mono uppercase tracking-[0.28em];
    color: var(--text-tertiary);
    border-color: color-mix(in oklab, var(--primary) 10%, var(--border-color));
    background: color-mix(in oklab, var(--terminal-bg) 96%, transparent);
  }

  .terminal-stat-pill {
    @apply inline-flex items-center gap-2 rounded-md border px-2.5 py-1 text-[11px] font-medium;
    border-color: color-mix(in oklab, var(--primary) 14%, var(--border-color));
    background: color-mix(in oklab, var(--primary) 5%, var(--terminal-bg));
    color: var(--text-secondary);
  }

  .terminal-section-title {
    @apply flex flex-wrap items-center gap-3;
  }

  .terminal-section-icon {
    @apply flex h-10 w-10 items-center justify-center rounded-lg text-base;
    color: var(--primary);
    background: color-mix(in oklab, var(--primary) 8%, var(--terminal-bg));
    border: 1px solid
      color-mix(in oklab, var(--primary) 14%, var(--border-color));
  }

  .terminal-empty {
    @apply rounded-xl border border-dashed px-6 py-10 text-center;
    border-color: color-mix(in oklab, var(--primary) 12%, var(--border-color));
    background: color-mix(in oklab, var(--header-bg) 78%, transparent);
  }

  .terminal-chip {
    @apply inline-flex min-w-0 max-w-full items-center gap-1.5 rounded-md border px-2 py-1 text-[11px] transition-all;
    border-color: color-mix(in oklab, var(--primary) 8%, var(--border-color));
    background: color-mix(in oklab, var(--terminal-bg) 96%, transparent);
    color: var(--text-secondary);
  }

  .terminal-chip:hover {
    border-color: color-mix(in oklab, var(--primary) 20%, var(--border-color));
    color: var(--title-color);
  }

  .terminal-chip--accent {
    border-color: color-mix(
      in oklab,
      rgb(var(--accent-rgb, var(--primary-rgb))) 16%,
      var(--border-color)
    );
    background: linear-gradient(
      180deg,
      color-mix(
        in oklab,
        rgb(var(--accent-rgb, var(--primary-rgb))) 8%,
        var(--terminal-bg)
      ),
      color-mix(
        in oklab,
        rgb(var(--accent-rgb, var(--primary-rgb))) 4%,
        var(--header-bg)
      )
    );
    color: var(--accent-color, var(--primary));
    box-shadow: inset 0 0 0 1px
      rgba(var(--accent-rgb, var(--primary-rgb)), 0.08);
  }

  .terminal-chip--accent:hover {
    border-color: color-mix(
      in oklab,
      rgb(var(--accent-rgb, var(--primary-rgb))) 26%,
      var(--border-color)
    );
    background: linear-gradient(
      180deg,
      color-mix(
        in oklab,
        rgb(var(--accent-rgb, var(--primary-rgb))) 12%,
        var(--terminal-bg)
      ),
      color-mix(
        in oklab,
        rgb(var(--accent-rgb, var(--primary-rgb))) 7%,
        var(--header-bg)
      )
    );
    color: var(--title-color);
  }

  .terminal-stat-pill--accent {
    border-color: color-mix(
      in oklab,
      rgb(var(--accent-rgb, var(--primary-rgb))) 18%,
      var(--border-color)
    );
    background: color-mix(
      in oklab,
      rgb(var(--accent-rgb, var(--primary-rgb))) 8%,
      var(--terminal-bg)
    );
    color: var(--accent-color, var(--primary));
  }

  .terminal-panel-accent {
    border-color: color-mix(
      in oklab,
      rgb(var(--accent-rgb, var(--primary-rgb))) 16%,
      var(--border-color)
    );
    background: linear-gradient(
      180deg,
      color-mix(in oklab, var(--terminal-bg) 98%, transparent),
      color-mix(
        in oklab,
        rgb(var(--accent-rgb, var(--primary-rgb))) 5%,
        var(--header-bg)
      )
    );
    box-shadow:
      0 16px 34px rgba(var(--text-rgb), 0.05),
      inset 0 1px 0 rgba(255, 255, 255, 0.34);
  }

  .terminal-panel-accent:hover {
    border-color: color-mix(
      in oklab,
      rgb(var(--accent-rgb, var(--primary-rgb))) 28%,
      var(--border-color)
    );
    box-shadow:
      0 18px 38px rgba(var(--text-rgb), 0.07),
      inset 0 1px 0 rgba(255, 255, 255, 0.34);
  }

  .terminal-accent-icon {
    color: var(--accent-color, var(--primary));
    border-color: color-mix(
      in oklab,
      rgb(var(--accent-rgb, var(--primary-rgb))) 14%,
      var(--border-color)
    );
    background: color-mix(
      in oklab,
      rgb(var(--accent-rgb, var(--primary-rgb))) 10%,
      var(--terminal-bg)
    );
  }

  .terminal-link-arrow {
    @apply inline-flex items-center gap-2 rounded-full border px-3.5 py-2 text-[11px] font-mono uppercase tracking-[0.14em] transition-all duration-200;
    border-color: color-mix(in oklab, var(--primary) 14%, var(--border-color));
    background: color-mix(in oklab, var(--primary) 6%, var(--terminal-bg));
    color: var(--primary);
  }

  .terminal-link-arrow:hover {
    border-color: color-mix(in oklab, var(--primary) 24%, var(--border-color));
    background: color-mix(in oklab, var(--primary) 10%, var(--terminal-bg));
    color: var(--title-color);
    transform: translateY(-1px);
  }

  .terminal-toolbar-shell {
    @apply relative overflow-hidden rounded-[1.35rem] border p-2.5;
    border-color: color-mix(in oklab, var(--primary) 12%, var(--border-color));
    background:
      linear-gradient(
        180deg,
        color-mix(in oklab, var(--terminal-bg) 97%, transparent),
        color-mix(in oklab, var(--header-bg) 90%, transparent)
      ),
      linear-gradient(
        90deg,
        rgba(var(--primary-rgb), 0.03),
        transparent 20%,
        rgba(var(--primary-rgb), 0.015) 78%,
        transparent
      );
    box-shadow:
      0 18px 40px rgba(var(--text-rgb), 0.055),
      inset 0 1px 0 rgba(255, 255, 255, 0.42);
  }

  .terminal-toolbar-shell::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(
      rgba(var(--primary-rgb), 0.04) 1px,
      transparent 1px
    );
    background-size: 100% 14px;
    opacity: 0.14;
  }

  .terminal-toolbar-shell > * {
    position: relative;
    z-index: 1;
  }

  .terminal-toolbar-module {
    @apply relative flex items-center gap-2.5 rounded-xl border px-3 py-2;
    border-color: color-mix(in oklab, var(--primary) 8%, var(--border-color));
    background: color-mix(in oklab, var(--terminal-bg) 97%, transparent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38);
  }

  .terminal-toolbar-module--compact {
    @apply px-3 py-2;
  }

  .terminal-toolbar-label {
    @apply text-[10px] font-mono uppercase tracking-[0.28em];
    color: var(--text-tertiary);
  }

  .terminal-toolbar-iconbtn {
    @apply inline-flex h-9 w-9 items-center justify-center rounded-xl border transition-all duration-200;
    border-color: color-mix(in oklab, var(--primary) 6%, var(--border-color));
    color: var(--text-secondary);
    background: color-mix(in oklab, var(--header-bg) 84%, transparent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38);
  }

  .terminal-toolbar-iconbtn:hover {
    border-color: color-mix(in oklab, var(--primary) 18%, var(--border-color));
    color: var(--primary);
    background: color-mix(in oklab, var(--primary) 7%, var(--terminal-bg));
    transform: translateY(-1px);
  }

  .terminal-toolbar-iconbtn:focus-visible {
    outline: none;
    border-color: color-mix(in oklab, var(--primary) 28%, var(--border-color));
    box-shadow:
      0 0 0 4px rgba(var(--primary-rgb), 0.09),
      inset 0 1px 0 rgba(255, 255, 255, 0.38);
  }

  .theme-panel {
    @apply overflow-hidden rounded-[1.4rem] border;
    border-color: color-mix(in oklab, var(--primary) 10%, var(--border-color));
    background:
      linear-gradient(
        180deg,
        color-mix(in oklab, var(--terminal-bg) 98%, transparent),
        color-mix(in oklab, var(--header-bg) 92%, transparent)
      ),
      linear-gradient(135deg, rgba(var(--primary-rgb), 0.045), transparent 52%);
    box-shadow:
      0 18px 40px rgba(var(--text-rgb), 0.12),
      inset 0 1px 0 rgba(255, 255, 255, 0.38);
  }

  .theme-option-btn {
    @apply flex w-full items-center gap-3 rounded-2xl border px-3 py-3 text-left transition-all duration-200;
    border-color: color-mix(in oklab, var(--primary) 7%, var(--border-color));
    background: color-mix(in oklab, var(--terminal-bg) 96%, transparent);
    color: var(--text-secondary);
  }

  .theme-option-btn:hover {
    border-color: color-mix(in oklab, var(--primary) 18%, var(--border-color));
    background: color-mix(in oklab, var(--primary) 5%, var(--terminal-bg));
    transform: translateY(-1px);
  }

  .theme-option-btn.is-active {
    border-color: color-mix(in oklab, var(--primary) 22%, var(--border-color));
    background: linear-gradient(
      180deg,
      color-mix(in oklab, var(--primary) 10%, var(--terminal-bg)),
      color-mix(in oklab, var(--primary) 6%, var(--header-bg))
    );
    box-shadow:
      0 10px 24px rgba(var(--text-rgb), 0.05),
      inset 0 0 0 1px rgba(var(--primary-rgb), 0.08);
  }

  .theme-option-icon {
    @apply flex h-10 w-10 shrink-0 items-center justify-center rounded-xl border;
    border-color: color-mix(in oklab, var(--primary) 10%, var(--border-color));
    background: color-mix(in oklab, var(--primary) 7%, var(--terminal-bg));
    color: var(--primary);
  }

  .terminal-console-input {
    @apply min-w-0 flex-1 bg-transparent font-mono text-sm outline-none;
    color: var(--text);
  }

  .terminal-console-input::placeholder {
    color: var(--text-tertiary);
  }

  .terminal-nav-link {
    @apply flex items-center justify-between gap-3 rounded-2xl border px-4 py-3 text-sm font-medium transition-all duration-200;
    border-color: color-mix(in oklab, var(--primary) 8%, var(--border-color));
    color: var(--text-secondary);
    background: linear-gradient(
      180deg,
      color-mix(in oklab, var(--terminal-bg) 97%, transparent),
      color-mix(in oklab, var(--header-bg) 92%, transparent)
    );
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34);
  }

  .terminal-nav-link:hover {
    border-color: color-mix(in oklab, var(--primary) 18%, var(--border-color));
    background: color-mix(in oklab, var(--primary) 5%, var(--terminal-bg));
    color: var(--title-color);
    transform: translateY(-1px);
  }

  .terminal-nav-link.is-active {
    border-color: color-mix(in oklab, var(--primary) 24%, var(--border-color));
    background: color-mix(in oklab, var(--primary) 8%, var(--terminal-bg));
    color: var(--primary);
    box-shadow:
      0 10px 24px rgba(var(--text-rgb), 0.05),
      inset 0 0 0 1px rgba(var(--primary-rgb), 0.08);
  }

  .terminal-filter {
    @apply inline-flex items-center gap-1.5 rounded-md border px-2.5 py-1.5 text-[12px] font-mono transition-all;
    border-color: color-mix(in oklab, var(--primary) 10%, var(--border-color));
    background: color-mix(in oklab, var(--terminal-bg) 97%, transparent);
    color: var(--text-secondary);
    letter-spacing: 0.01em;
  }

  .terminal-filter:hover {
    border-color: color-mix(in oklab, var(--primary) 18%, var(--border-color));
    color: var(--title-color);
    background: color-mix(in oklab, var(--primary) 6%, var(--terminal-bg));
  }

  .terminal-filter.is-active {
    border-color: color-mix(in oklab, var(--primary) 28%, var(--border-color));
    color: var(--primary);
    background: color-mix(in oklab, var(--primary) 9%, var(--terminal-bg));
    box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), 0.08);
  }

  .terminal-action-button {
    @apply inline-flex min-h-[2.35rem] items-center justify-center gap-1.5 rounded-xl border px-3.5 py-2 font-mono text-[11px] uppercase tracking-[0.12em] transition-all duration-200;
    border-color: color-mix(in oklab, var(--primary) 12%, var(--border-color));
    background: linear-gradient(
      180deg,
      color-mix(in oklab, var(--terminal-bg) 98%, transparent),
      color-mix(in oklab, var(--header-bg) 90%, transparent)
    );
    color: var(--text-secondary);
    box-shadow:
      0 10px 24px rgba(var(--text-rgb), 0.035),
      inset 0 1px 0 rgba(255, 255, 255, 0.38);
  }

  .terminal-action-button:hover {
    border-color: color-mix(in oklab, var(--primary) 18%, var(--border-color));
    color: var(--title-color);
    transform: translateY(-1px);
  }

  .terminal-action-button:focus-visible {
    outline: none;
    border-color: color-mix(in oklab, var(--primary) 32%, var(--border-color));
    box-shadow:
      0 0 0 4px rgba(var(--primary-rgb), 0.08),
      0 10px 24px rgba(var(--text-rgb), 0.04),
      inset 0 1px 0 rgba(255, 255, 255, 0.38);
  }

  .terminal-action-button-primary {
    border-color: color-mix(in oklab, var(--primary) 24%, var(--border-color));
    background: linear-gradient(
      180deg,
      color-mix(in oklab, var(--primary) 12%, var(--terminal-bg)),
      color-mix(in oklab, var(--primary) 7%, var(--terminal-bg))
    );
    color: var(--primary);
    box-shadow:
      0 14px 32px rgba(var(--primary-rgb), 0.12),
      inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }

  .terminal-action-button-primary:hover {
    color: var(--title-color);
    background: linear-gradient(
      180deg,
      color-mix(in oklab, var(--primary) 16%, var(--terminal-bg)),
      color-mix(in oklab, var(--primary) 9%, var(--terminal-bg))
    );
  }

  .terminal-action-button-secondary {
    border-color: color-mix(
      in oklab,
      var(--secondary) 22%,
      var(--border-color)
    );
    background: linear-gradient(
      180deg,
      color-mix(in oklab, var(--secondary) 10%, var(--terminal-bg)),
      color-mix(in oklab, var(--secondary) 5%, var(--terminal-bg))
    );
    color: var(--secondary);
  }

  .terminal-action-button-secondary:hover {
    color: var(--title-color);
  }

  .terminal-option-card {
    @apply w-full rounded-2xl border px-4 py-3 text-left text-sm transition-all duration-200;
    border-color: color-mix(in oklab, var(--primary) 10%, var(--border-color));
    background: linear-gradient(
      180deg,
      color-mix(in oklab, var(--terminal-bg) 98%, transparent),
      color-mix(in oklab, var(--header-bg) 92%, transparent)
    );
    color: var(--text-secondary);
    box-shadow:
      0 10px 24px rgba(var(--text-rgb), 0.035),
      inset 0 1px 0 rgba(255, 255, 255, 0.34);
  }

  .terminal-option-card:hover {
    border-color: color-mix(in oklab, var(--primary) 20%, var(--border-color));
    color: var(--title-color);
    transform: translateY(-1px);
  }

  .terminal-copy-button {
    @apply inline-flex items-center gap-1 rounded-full border px-2.5 py-1 text-[11px] font-mono transition-all duration-200;
    border-color: color-mix(in oklab, var(--primary) 16%, var(--border-color));
    background: color-mix(in oklab, var(--primary) 6%, var(--terminal-bg));
    color: var(--primary);
  }

  .terminal-copy-button:hover {
    border-color: color-mix(in oklab, var(--primary) 28%, var(--border-color));
    background: color-mix(in oklab, var(--primary) 10%, var(--terminal-bg));
  }

  .terminal-interactive-card {
    @apply transition-all duration-300;
  }

  .terminal-interactive-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in oklab, var(--primary) 22%, var(--border-color));
    box-shadow: 0 18px 40px rgba(var(--text-rgb), 0.06);
  }

  .terminal-quick-link {
    @apply flex items-center gap-2.5 rounded-xl border px-3 py-2 transition-all duration-200;
    border-color: color-mix(in oklab, var(--primary) 10%, var(--border-color));
    background: linear-gradient(
      180deg,
      color-mix(in oklab, var(--terminal-bg) 98%, transparent),
      color-mix(in oklab, var(--header-bg) 92%, transparent)
    );
    color: var(--text-secondary);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34);
  }

  .terminal-quick-link:hover {
    border-color: color-mix(in oklab, var(--primary) 18%, var(--border-color));
    color: var(--title-color);
    transform: translateY(-1px);
  }

  .terminal-quick-link i:last-child {
    opacity: 0.75;
  }

  .home-hero-shell {
    @apply flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-between;
  }

  .home-hero-shell--panel {
    @apply rounded-[28px] border px-5 py-5 sm:px-6;
    border-color: color-mix(in oklab, var(--primary) 10%, var(--border-color));
    background:
      radial-gradient(
        circle at top right,
        rgba(var(--primary-rgb), 0.1),
        transparent 28%
      ),
      linear-gradient(
        180deg,
        color-mix(in oklab, var(--terminal-bg) 98%, transparent),
        color-mix(in oklab, var(--header-bg) 92%, transparent)
      );
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.34),
      0 18px 42px rgba(var(--text-rgb), 0.04);
  }

  .home-hero-copy {
    @apply min-w-0 space-y-3;
  }

  .home-hero-glance {
    @apply grid gap-2 pt-1 sm:grid-cols-3;
  }

  .home-hero-glance-item {
    @apply flex items-center gap-3 rounded-2xl border px-3 py-3;
    border-color: color-mix(in oklab, var(--primary) 8%, var(--border-color));
    background: color-mix(in oklab, var(--terminal-bg) 88%, transparent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
  }

  .home-hero-glance-icon {
    @apply flex h-9 w-9 shrink-0 items-center justify-center rounded-xl;
    color: var(--primary);
    background: color-mix(in oklab, var(--primary) 10%, var(--terminal-bg));
  }

  .home-hero-meta {
    @apply flex flex-wrap items-center gap-2 lg:max-w-[18rem] lg:justify-end;
  }

  .home-nav-strip {
    @apply flex flex-wrap gap-2;
  }

  .home-nav-pill {
    @apply inline-flex min-w-0 max-w-full items-center gap-2 rounded-full border px-3 py-1.5 text-xs font-mono transition-all duration-200;
    border-color: color-mix(in oklab, var(--primary) 10%, var(--border-color));
    background: color-mix(in oklab, var(--terminal-bg) 97%, transparent);
    color: var(--text-secondary);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }

  .home-nav-pill:hover {
    border-color: color-mix(in oklab, var(--primary) 18%, var(--border-color));
    background: color-mix(in oklab, var(--primary) 5%, var(--terminal-bg));
    color: var(--title-color);
    transform: translateY(-1px);
  }

  .home-taxonomy-shell,
  .home-tag-shell {
    @apply space-y-5;
  }

  .home-discovery-shell {
    @apply space-y-4;
  }

  .home-discovery-head {
    @apply flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between;
  }

  .home-discovery-actions {
    @apply flex flex-wrap items-center gap-2;
  }

  .home-filter-toolbar {
    @apply flex flex-wrap gap-2;
  }

  .home-active-filter-row {
    @apply flex flex-wrap gap-2;
  }

  .home-discovery-grid {
    @apply grid gap-4 xl:grid-cols-[minmax(0,0.9fr)_minmax(0,1.1fr)];
  }

  .home-discovery-panel {
    @apply rounded-2xl border p-4;
    border-color: color-mix(in oklab, var(--primary) 8%, var(--border-color));
    background: linear-gradient(
      180deg,
      color-mix(in oklab, var(--terminal-bg) 98%, transparent),
      color-mix(in oklab, var(--header-bg) 92%, transparent)
    );
  }

  .home-discovery-panel__head {
    @apply mb-3 flex items-center justify-between gap-3;
  }

  .home-taxonomy-head {
    @apply flex flex-col gap-4 lg:flex-row lg:items-end lg:justify-between;
  }

  .home-taxonomy-head--airy {
    @apply lg:items-center;
  }

  .home-taxonomy-copy {
    @apply min-w-0 space-y-3;
  }

  .home-category-grid {
    @apply grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-3;
  }

  .home-category-grid--compact {
    @apply grid-cols-1 sm:grid-cols-2 xl:grid-cols-2;
  }

  .home-category-card {
    @apply flex items-center gap-3 rounded-xl border px-3.5 py-3;
    border-color: color-mix(
      in oklab,
      rgb(var(--accent-rgb, var(--primary-rgb))) 15%,
      var(--border-color)
    );
    background: linear-gradient(
      180deg,
      color-mix(in oklab, var(--terminal-bg) 98%, transparent),
      color-mix(
        in oklab,
        rgb(var(--accent-rgb, var(--primary-rgb))) 5%,
        var(--header-bg)
      )
    );
  }

  .home-category-card.is-active {
    border-color: color-mix(
      in oklab,
      rgb(var(--accent-rgb, var(--primary-rgb))) 30%,
      var(--border-color)
    );
    box-shadow:
      inset 0 0 0 1px rgba(var(--accent-rgb, var(--primary-rgb)), 0.08),
      0 12px 28px rgba(var(--text-rgb), 0.05);
  }

  .home-category-card__icon {
    @apply flex h-9 w-9 shrink-0 items-center justify-center rounded-xl border text-sm;
  }

  .home-category-card__slug {
    @apply truncate text-[10px] uppercase tracking-[0.24em];
    color: var(--text-tertiary);
  }

  .home-tag-shell {
    background:
      radial-gradient(
        circle at top right,
        rgba(var(--primary-rgb), 0.08),
        transparent 26%
      ),
      linear-gradient(
        180deg,
        color-mix(in oklab, var(--terminal-bg) 97%, transparent),
        color-mix(in oklab, var(--header-bg) 90%, transparent)
      );
  }

  .home-tag-cloud {
    @apply flex flex-wrap items-center gap-2;
    align-items: stretch;
  }

  .home-tag-cloud__item {
    @apply inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-xs transition-all duration-200;
    border-color: color-mix(
      in oklab,
      rgb(var(--accent-rgb, var(--primary-rgb))) 16%,
      var(--border-color)
    );
    background: linear-gradient(
      180deg,
      color-mix(
        in oklab,
        rgb(var(--accent-rgb, var(--primary-rgb))) 6%,
        var(--terminal-bg)
      ),
      color-mix(
        in oklab,
        rgb(var(--accent-rgb, var(--primary-rgb))) 2%,
        var(--header-bg)
      )
    );
    color: var(--accent-color, var(--primary));
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.28),
      0 10px 24px rgba(var(--text-rgb), 0.035);
    font-family: var(--font-mono);
  }

  .home-tag-cloud__item:hover {
    border-color: color-mix(
      in oklab,
      rgb(var(--accent-rgb, var(--primary-rgb))) 24%,
      var(--border-color)
    );
    color: var(--title-color);
    transform: translateY(-1px);
  }

  .home-tag-cloud__item.is-active {
    border-color: color-mix(
      in oklab,
      rgb(var(--accent-rgb, var(--primary-rgb))) 28%,
      var(--border-color)
    );
    background: linear-gradient(
      180deg,
      color-mix(
        in oklab,
        rgb(var(--accent-rgb, var(--primary-rgb))) 12%,
        var(--terminal-bg)
      ),
      color-mix(
        in oklab,
        rgb(var(--accent-rgb, var(--primary-rgb))) 6%,
        var(--header-bg)
      )
    );
    box-shadow:
      inset 0 0 0 1px rgba(var(--accent-rgb, var(--primary-rgb)), 0.08),
      0 10px 24px rgba(var(--text-rgb), 0.04);
    color: var(--title-color);
  }

  .home-tag-cloud__hash {
    @apply text-xs;
    color: color-mix(
      in oklab,
      var(--accent-color, var(--primary)) 72%,
      var(--title-color)
    );
  }

  .home-tag-cloud__count {
    @apply rounded-full px-1.5 py-0.5 text-[10px] font-semibold;
    background: rgba(var(--accent-rgb, var(--primary-rgb)), 0.12);
    color: color-mix(
      in oklab,
      var(--accent-color, var(--primary)) 78%,
      var(--title-color)
    );
  }

  .home-popular-rangebar {
    @apply flex flex-wrap gap-2;
  }

  .home-popular-range {
    @apply inline-flex items-center gap-2 rounded-full border px-3 py-1.5 text-xs font-mono transition-all duration-200;
    border-color: color-mix(in oklab, var(--primary) 12%, var(--border-color));
    background: color-mix(in oklab, var(--terminal-bg) 96%, transparent);
    color: var(--text-secondary);
  }

  .home-popular-range:hover {
    border-color: color-mix(in oklab, var(--primary) 22%, var(--border-color));
    background: color-mix(in oklab, var(--primary) 6%, var(--terminal-bg));
    color: var(--title-color);
    transform: translateY(-1px);
  }

  .home-popular-range.is-active {
    border-color: color-mix(in oklab, var(--primary) 28%, var(--border-color));
    background: color-mix(in oklab, var(--primary) 10%, var(--terminal-bg));
    color: var(--title-color);
    box-shadow:
      inset 0 0 0 1px rgba(var(--primary-rgb), 0.08),
      0 10px 24px rgba(var(--text-rgb), 0.04);
  }

  .home-sidebar-stack {
    @apply space-y-4;
  }

  .home-sidebar-grid {
    @apply grid gap-2 sm:grid-cols-2 xl:grid-cols-2;
  }

  .home-sidebar-card {
    @apply rounded-[26px] border;
    position: relative;
    overflow: hidden;
    border-color: color-mix(in oklab, var(--primary) 9%, var(--border-color));
    background:
      radial-gradient(
        circle at top right,
        rgba(var(--primary-rgb), 0.08),
        transparent 30%
      ),
      linear-gradient(
        180deg,
        color-mix(in oklab, var(--terminal-bg) 98%, transparent),
        color-mix(in oklab, var(--header-bg) 92%, transparent)
      );
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.34),
      0 16px 36px rgba(var(--text-rgb), 0.04);
  }

  .home-sidebar-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
      180deg,
      rgba(var(--primary-rgb), 0.035),
      transparent 28%
    );
    opacity: 0.9;
  }

  .home-sidebar-card > * {
    position: relative;
    z-index: 1;
  }

  .home-sidebar-card--quickmenu {
    border-color: color-mix(in oklab, var(--primary) 14%, var(--border-color));
    background:
      radial-gradient(
        circle at top right,
        rgba(var(--primary-rgb), 0.12),
        transparent 32%
      ),
      radial-gradient(
        circle at bottom left,
        rgba(var(--primary-rgb), 0.06),
        transparent 34%
      ),
      linear-gradient(
        180deg,
        color-mix(in oklab, var(--terminal-bg) 99%, transparent),
        color-mix(in oklab, var(--header-bg) 93%, transparent)
      );
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.36),
      0 20px 46px rgba(var(--text-rgb), 0.06);
    backdrop-filter: blur(14px);
  }

  .home-sidebar-card--quickmenu::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: linear-gradient(
      180deg,
      rgba(var(--primary-rgb), 0.88),
      rgba(var(--primary-rgb), 0.16)
    );
    opacity: 0.7;
  }

  .home-sidebar-link {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
  }

  .home-sidebar-link__icon {
    @apply flex h-8 w-8 shrink-0 items-center justify-center rounded-xl;
    color: var(--primary);
    background: color-mix(in oklab, var(--primary) 10%, var(--terminal-bg));
  }

  .home-sidebar-link:hover {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.32),
      0 14px 28px rgba(var(--text-rgb), 0.05);
  }

  .home-sidebar-card--quickmenu .home-sidebar-link {
    border-color: color-mix(in oklab, var(--primary) 12%, var(--border-color));
    background: linear-gradient(
      180deg,
      color-mix(in oklab, var(--terminal-bg) 98%, transparent),
      color-mix(in oklab, var(--header-bg) 91%, transparent)
    );
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.3),
      0 10px 24px rgba(var(--text-rgb), 0.035);
  }

  .home-sidebar-card--quickmenu .home-sidebar-link:hover {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.34),
      0 16px 30px rgba(var(--text-rgb), 0.06);
  }

  .home-sidebar-mini-link {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  }

  .home-sidebar-mini-link__icon {
    @apply flex h-7 w-7 shrink-0 items-center justify-center rounded-lg;
    color: var(--primary);
    background: color-mix(in oklab, var(--primary) 8%, var(--terminal-bg));
  }

  .home-sidebar-mini-link:hover {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.26),
      0 10px 22px rgba(var(--text-rgb), 0.04);
  }

  .home-sidebar-card--quickmenu .home-sidebar-mini-link {
    border-color: color-mix(in oklab, var(--primary) 10%, var(--border-color));
    background: color-mix(in oklab, var(--terminal-bg) 94%, transparent);
  }

  @media (min-width: 1280px) {
    .home-sidebar-card--quickmenu {
      max-height: calc(100vh - 7.5rem);
    }
  }

  .home-sidebar-popular {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
  }

  .home-sidebar-popular__rank {
    @apply inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-[11px] font-semibold;
    color: var(--primary);
    background: color-mix(in oklab, var(--primary) 10%, var(--terminal-bg));
  }

  .home-sidebar-popular__metrics {
    @apply mt-2 flex flex-wrap gap-x-3 gap-y-1 text-[11px];
    color: var(--text-secondary);
  }

  .home-sidebar-popular:hover {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.32),
      0 14px 30px rgba(var(--text-rgb), 0.05);
  }

  .home-sidebar-stat {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
  }

  .home-sidebar-stat--metric {
    background:
      linear-gradient(
        180deg,
        color-mix(in oklab, var(--terminal-bg) 92%, transparent),
        color-mix(in oklab, var(--header-bg) 92%, transparent)
      ),
      linear-gradient(135deg, rgba(var(--primary-rgb), 0.035), transparent 70%);
  }

  .home-sidebar-meta-list {
    @apply divide-y rounded-2xl border;
    border-color: color-mix(in oklab, var(--primary) 9%, var(--border-color));
    background: color-mix(in oklab, var(--terminal-bg) 78%, transparent);
  }

  .home-sidebar-meta-item {
    @apply flex items-center justify-between gap-3 px-4 py-3;
  }

  .home-sidebar-friend {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
  }

  .home-sidebar-friend:hover {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.3),
      0 12px 28px rgba(var(--text-rgb), 0.05);
  }

  .article-floating-action-btn {
    border: 1px solid
      color-mix(in oklab, var(--primary) 10%, var(--border-color));
    background: linear-gradient(
      180deg,
      color-mix(in oklab, var(--terminal-bg) 97%, transparent),
      color-mix(in oklab, var(--header-bg) 91%, transparent)
    );
    color: var(--text-secondary);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.26),
      0 10px 22px rgba(var(--text-rgb), 0.035);
  }

  .article-floating-action-btn:hover {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.3),
      0 14px 28px rgba(var(--text-rgb), 0.05);
  }

  html.dark .home-sidebar-stat,
  html.dark .home-sidebar-stat--metric,
  html.dark .article-floating-action-btn,
  html.dark .terminal-toolbar-iconbtn {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.05),
      0 10px 24px rgba(0, 0, 0, 0.26);
  }

  html.dark .home-sidebar-stat--metric {
    background:
      linear-gradient(
        180deg,
        color-mix(in oklab, var(--terminal-bg) 96%, black 4%),
        color-mix(in oklab, var(--header-bg) 82%, black 18%)
      ),
      linear-gradient(135deg, rgba(var(--primary-rgb), 0.05), transparent 70%);
    border-color: color-mix(in oklab, var(--primary) 12%, var(--border-color));
  }

  html.dark .home-sidebar-meta-list {
    background: color-mix(in oklab, var(--terminal-bg) 92%, black 8%);
  }

  html.dark .article-floating-action-btn {
    background: linear-gradient(
      180deg,
      color-mix(in oklab, var(--terminal-bg) 94%, black 6%),
      color-mix(in oklab, var(--header-bg) 82%, black 18%)
    );
    border-color: color-mix(in oklab, var(--primary) 12%, var(--border-color));
  }

  html.dark .terminal-toolbar-iconbtn {
    background: color-mix(in oklab, var(--terminal-bg) 90%, black 10%);
    border-color: color-mix(in oklab, var(--primary) 10%, var(--border-color));
  }

  @media (prefers-color-scheme: dark) {
    :root:not(.light):not(.dark) .home-sidebar-stat,
    :root:not(.light):not(.dark) .home-sidebar-stat--metric,
    :root:not(.light):not(.dark) .article-floating-action-btn,
    :root:not(.light):not(.dark) .terminal-toolbar-iconbtn {
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 10px 24px rgba(0, 0, 0, 0.26);
    }

    :root:not(.light):not(.dark) .home-sidebar-stat--metric {
      background:
        linear-gradient(
          180deg,
          color-mix(in oklab, var(--terminal-bg) 96%, black 4%),
          color-mix(in oklab, var(--header-bg) 82%, black 18%)
        ),
        linear-gradient(135deg, rgba(var(--primary-rgb), 0.05), transparent 70%);
      border-color: color-mix(
        in oklab,
        var(--primary) 12%,
        var(--border-color)
      );
    }

    :root:not(.light):not(.dark) .home-sidebar-meta-list {
      background: color-mix(in oklab, var(--terminal-bg) 92%, black 8%);
    }

    :root:not(.light):not(.dark) .article-floating-action-btn {
      background: linear-gradient(
        180deg,
        color-mix(in oklab, var(--terminal-bg) 94%, black 6%),
        color-mix(in oklab, var(--header-bg) 82%, black 18%)
      );
      border-color: color-mix(
        in oklab,
        var(--primary) 12%,
        var(--border-color)
      );
    }

    :root:not(.light):not(.dark) .terminal-toolbar-iconbtn {
      background: color-mix(in oklab, var(--terminal-bg) 90%, black 10%);
      border-color: color-mix(
        in oklab,
        var(--primary) 10%,
        var(--border-color)
      );
    }
  }

  @media (max-width: 640px) {
    .home-tag-cloud__item:hover {
      transform: translateY(-1px);
    }
  }

  .terminal-form-label {
    @apply mb-2 block text-xs font-mono uppercase tracking-[0.24em];
    color: var(--text-tertiary);
  }

  .terminal-form-input,
  .terminal-form-textarea {
    @apply w-full rounded-xl border px-3.5 py-2.5 text-sm transition-all outline-none;
    border-color: color-mix(in oklab, var(--primary) 8%, var(--border-color));
    background: linear-gradient(
      180deg,
      color-mix(in oklab, var(--terminal-bg) 97%, transparent),
      color-mix(in oklab, var(--header-bg) 92%, transparent)
    );
    color: var(--text);
    font-family: var(--font-mono);
  }

  .terminal-form-input::placeholder,
  .terminal-form-textarea::placeholder {
    color: var(--text-tertiary);
  }

  .terminal-form-input:focus,
  .terminal-form-textarea:focus {
    border-color: color-mix(in oklab, var(--primary) 38%, var(--border-color));
    box-shadow:
      0 0 0 4px rgba(var(--primary-rgb), 0.08),
      inset 0 0 0 1px rgba(var(--primary-rgb), 0.08);
  }

  .terminal-document {
    @apply rounded-[1.35rem] border px-5 py-6 sm:px-8 sm:py-8;
    border-color: color-mix(in oklab, var(--primary) 10%, var(--border-color));
    background: linear-gradient(
      180deg,
      color-mix(in oklab, var(--terminal-bg) 97%, transparent),
      color-mix(in oklab, var(--header-bg) 92%, transparent)
    );
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.28),
      0 18px 36px rgba(var(--text-rgb), 0.05);
  }

  .terminal-document > *:first-child {
    @apply mt-0;
  }

  .terminal-document h1,
  .terminal-document h2,
  .terminal-document h3,
  .terminal-document h4 {
    color: var(--title-color);
    font-weight: 700;
    letter-spacing: -0.02em;
  }

  .terminal-document h1 {
    @apply mt-0 text-3xl;
  }

  .terminal-document h2 {
    @apply mt-10 border-t pt-6 text-2xl;
    border-color: color-mix(in oklab, var(--primary) 14%, var(--border-color));
  }

  .terminal-document h3 {
    @apply mt-8 text-xl;
  }

  .terminal-document p,
  .terminal-document ul,
  .terminal-document ol,
  .terminal-document blockquote,
  .terminal-document pre,
  .terminal-document table {
    @apply mt-5;
  }

  .terminal-document p,
  .terminal-document li {
    @apply leading-8;
    color: var(--text-secondary);
  }

  .terminal-document ul,
  .terminal-document ol {
    @apply space-y-3 pl-6;
  }

  .terminal-document ul {
    list-style: square;
  }

  .terminal-document ol {
    list-style: decimal;
  }

  .terminal-document li::marker {
    color: var(--primary);
  }

  .terminal-document a {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-color: color-mix(in oklab, var(--primary) 40%, transparent);
    text-underline-offset: 0.22em;
  }

  .terminal-document strong {
    color: var(--title-color);
  }

  .terminal-document code:not(pre code) {
    @apply rounded-md px-1.5 py-0.5 text-[0.92em];
    background: color-mix(in oklab, var(--primary) 10%, var(--header-bg));
    color: var(--primary);
    font-family: var(--font-mono);
  }

  .terminal-document pre,
  .terminal-document .astro-code {
    @apply overflow-x-auto rounded-2xl border p-4;
    border-color: color-mix(in oklab, var(--primary) 16%, var(--border-color));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  }

  .terminal-document blockquote {
    @apply rounded-r-2xl border-l-4 px-5 py-4;
    border-left-color: var(--primary);
    background: color-mix(in oklab, var(--primary) 8%, var(--header-bg));
    color: var(--text);
  }

  .terminal-document hr {
    @apply my-8 border-0 border-t;
    border-color: color-mix(in oklab, var(--primary) 12%, var(--border-color));
  }

  .terminal-document table {
    @apply w-full overflow-hidden rounded-2xl border;
    border-color: var(--border-color);
  }

  .terminal-document th,
  .terminal-document td {
    @apply px-4 py-3 text-left text-sm;
    border-bottom: 1px solid
      color-mix(in oklab, var(--primary) 10%, var(--border-color));
  }

  .terminal-document th {
    background: color-mix(in oklab, var(--primary) 8%, var(--header-bg));
    color: var(--title-color);
  }

  .terminal-document td {
    color: var(--text-secondary);
  }

  .terminal-console-list-item {
    @apply flex items-start justify-between gap-4 rounded-xl border px-4 py-3;
    border-color: color-mix(in oklab, var(--primary) 8%, var(--border-color));
    background: color-mix(in oklab, var(--terminal-bg) 97%, transparent);
  }

  .terminal-subtle-link {
    @apply inline-flex items-center gap-2 rounded-full border px-3.5 py-2 text-sm font-mono transition-all duration-200;
    border-color: color-mix(in oklab, var(--primary) 12%, var(--border-color));
    background: color-mix(in oklab, var(--terminal-bg) 96%, transparent);
    color: var(--primary);
  }

  .terminal-subtle-link:hover {
    border-color: color-mix(in oklab, var(--primary) 22%, var(--border-color));
    background: color-mix(in oklab, var(--primary) 7%, var(--terminal-bg));
    transform: translateY(-1px);
  }

  @media (max-width: 1023px) {
    .terminal-toolbar-shell {
      @apply rounded-[1.2rem] p-2;
    }

    .terminal-quick-link {
      @apply items-start;
    }
  }

  .ui-filter-pill {
    --pill-rgb: var(--primary-rgb);
    --pill-fg: var(--text-secondary);
    @apply inline-flex min-w-0 max-w-full items-center gap-1.5 rounded-md border px-2.5 py-1.5 text-[12px] transition-all;
    border-color: color-mix(
      in oklab,
      rgb(var(--pill-rgb)) 12%,
      var(--border-color)
    );
    background: linear-gradient(
      180deg,
      color-mix(in oklab, rgb(var(--pill-rgb)) 3%, var(--terminal-bg)),
      color-mix(in oklab, rgb(var(--pill-rgb)) 1%, var(--header-bg))
    );
    color: var(--pill-fg);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32);
    font-family: var(--font-mono);
    letter-spacing: 0.01em;
  }

  .ui-filter-pill:hover {
    border-color: color-mix(
      in oklab,
      rgb(var(--pill-rgb)) 18%,
      var(--border-color)
    );
    background: linear-gradient(
      180deg,
      color-mix(in oklab, rgb(var(--pill-rgb)) 5%, var(--terminal-bg)),
      color-mix(in oklab, rgb(var(--pill-rgb)) 3%, var(--header-bg))
    );
    color: var(--title-color);
  }

  .ui-filter-pill.is-active,
  .ui-filter-pill:has(input:checked) {
    border-color: color-mix(
      in oklab,
      rgb(var(--pill-rgb)) 28%,
      var(--border-color)
    );
    background: linear-gradient(
      180deg,
      color-mix(in oklab, rgb(var(--pill-rgb)) 9%, var(--terminal-bg)),
      color-mix(in oklab, rgb(var(--pill-rgb)) 5%, var(--header-bg))
    );
    box-shadow:
      inset 0 0 0 1px rgba(var(--pill-rgb), 0.08),
      0 6px 14px rgba(var(--text-rgb), 0.03);
    color: color-mix(in oklab, rgb(var(--pill-rgb)) 72%, var(--title-color));
  }

  .ui-filter-pill--blue {
    --pill-rgb: 59 130 246;
    --pill-fg: #315ea8;
  }

  .ui-filter-pill--amber {
    --pill-rgb: 217 119 6;
    --pill-fg: #9a5a12;
  }

  .ui-filter-pill--teal {
    --pill-rgb: 13 148 136;
    --pill-fg: #0f766e;
  }

  .ui-filter-pill--violet {
    --pill-rgb: 124 58 237;
    --pill-fg: #6d46c3;
  }

  .ui-filter-pill--neutral {
    --pill-rgb: 100 116 139;
    --pill-fg: var(--text-secondary);
  }

  .ui-filter-pill--accent {
    --pill-rgb: var(--accent-rgb, var(--primary-rgb));
    --pill-fg: var(--accent-color, var(--primary));
  }

  .ui-info-tile {
    --tile-rgb: var(--primary-rgb);
    @apply relative overflow-hidden rounded-2xl border transition-all duration-200;
    border-color: color-mix(
      in oklab,
      rgb(var(--tile-rgb)) 10%,
      var(--border-color)
    );
    background: linear-gradient(
      180deg,
      color-mix(in oklab, var(--terminal-bg) 98%, transparent),
      color-mix(in oklab, rgb(var(--tile-rgb)) 1%, var(--header-bg))
    );
    box-shadow:
      0 14px 30px rgba(var(--text-rgb), 0.04),
      inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }

  .ui-info-tile::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: linear-gradient(
      180deg,
      rgba(var(--tile-rgb), 0.78),
      rgba(var(--tile-rgb), 0.18)
    );
  }

  .ui-info-tile:hover {
    border-color: color-mix(
      in oklab,
      rgb(var(--tile-rgb)) 18%,
      var(--border-color)
    );
    transform: translateY(-1px);
  }

  .ui-info-tile--row {
    @apply flex items-center justify-between gap-3 px-3.5 py-2.5;
  }

  .ui-info-tile--grid {
    @apply flex items-center gap-3 px-3.5 py-3;
  }

  .ui-info-tile--stack {
    @apply px-4 py-4 text-left;
  }

  .ui-info-tile--blue {
    --tile-rgb: 59 130 246;
  }

  .ui-info-tile--amber {
    --tile-rgb: 217 119 6;
  }

  .ui-info-tile--teal {
    --tile-rgb: 13 148 136;
  }

  .ui-info-tile--violet {
    --tile-rgb: 124 58 237;
  }

  .ui-info-tile--neutral {
    --tile-rgb: 100 116 139;
  }

  .paragraph-comments-shell {
    @apply relative;
  }

  .paragraph-comments-toolbar {
    @apply flex flex-col gap-3 rounded-2xl px-4 py-3 sm:flex-row sm:items-center sm:justify-between;
    border: 1px solid
      color-mix(in oklab, var(--primary) 9%, var(--border-color));
  }

  .paragraph-comments-toolbar-copy {
    @apply min-w-0 space-y-1;
  }

  .paragraph-comments-visibility {
    @apply shrink-0;
  }

  .paragraph-comment-paragraph {
    position: relative;
    padding-right: clamp(3rem, 7vw, 4.25rem);
    scroll-margin-top: 8rem;
    transition:
      color 0.2s ease,
      background-color 0.2s ease,
      box-shadow 0.2s ease;
  }

  .paragraph-comment-paragraph.is-comment-focused {
    border-radius: 0.85rem;
    background: color-mix(in oklab, var(--primary) 7%, transparent);
    box-shadow:
      0 0 0 1px color-mix(in oklab, var(--primary) 14%, var(--border-color)),
      0 12px 26px rgba(var(--text-rgb), 0.04);
    padding: 0.35rem 0.6rem;
    margin-left: -0.6rem;
    margin-right: -0.6rem;
  }

  .paragraph-comment-marker {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    min-width: 2rem;
    border-radius: 999px;
    border: 1px solid
      color-mix(in oklab, var(--primary) 16%, var(--border-color));
    background: color-mix(in oklab, var(--terminal-bg) 94%, var(--header-bg));
    color: var(--text-secondary);
    box-shadow: 0 10px 24px rgba(var(--text-rgb), 0.08);
    padding: 0.3rem 0.5rem;
    opacity: 0.34;
    pointer-events: auto;
    transform: translate3d(0, 0, 0);
    transition:
      opacity 0.2s ease,
      transform 0.2s ease,
      border-color 0.2s ease,
      color 0.2s ease,
      background-color 0.2s ease;
  }

  .paragraph-comment-marker-icon {
    @apply text-[11px];
  }

  .paragraph-comment-marker-count {
    @apply text-[10px] font-semibold leading-none;
  }

  [data-paragraph-comments-visible="true"]
    .paragraph-comment-paragraph:hover
    .paragraph-comment-marker,
  [data-paragraph-comments-visible="true"]
    .paragraph-comment-paragraph:focus-within
    .paragraph-comment-marker,
  [data-paragraph-comments-visible="true"]
    .paragraph-comment-marker.has-comments,
  [data-paragraph-comments-visible="true"] .paragraph-comment-marker.is-active {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }

  .paragraph-comment-marker.has-comments,
  .paragraph-comment-marker.is-active {
    border-color: color-mix(in oklab, var(--primary) 24%, var(--border-color));
    color: var(--title-color);
  }

  .paragraph-comment-marker.is-active {
    background: color-mix(in oklab, var(--primary) 8%, var(--terminal-bg));
  }

  .paragraph-comment-marker:hover {
    border-color: color-mix(in oklab, var(--primary) 28%, var(--border-color));
    color: var(--title-color);
  }

  @media (max-width: 768px) {
    .paragraph-comment-marker {
      right: 0.2rem;
      top: -0.8rem;
    }
  }

  @media (hover: none) {
    [data-paragraph-comments-visible="true"] .paragraph-comment-marker {
      opacity: 0.92;
      pointer-events: auto;
      transform: translate3d(0, 0, 0);
    }
  }

  .paragraph-comment-panel {
    @apply mt-4 space-y-5;
  }

  .paragraph-comment-panel-head {
    @apply flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between;
  }

  .paragraph-comment-panel-meta {
    @apply flex flex-wrap items-center gap-2;
  }

  .paragraph-comment-thread {
    @apply space-y-3;
  }

  .paragraph-thread-segment {
    @apply space-y-3;
  }

  .paragraph-thread-segment-label {
    @apply inline-flex items-center rounded-md border px-2 py-1 text-[10px] font-mono uppercase tracking-[0.18em];
    border-color: color-mix(in oklab, var(--primary) 9%, var(--border-color));
    background: color-mix(in oklab, var(--header-bg) 82%, transparent);
    color: var(--text-tertiary);
  }

  .paragraph-thread-item {
    @apply rounded-xl border p-4;
    border-color: color-mix(in oklab, var(--primary) 10%, var(--border-color));
    background: linear-gradient(
      180deg,
      color-mix(in oklab, var(--terminal-bg) 97%, transparent),
      color-mix(in oklab, var(--header-bg) 90%, transparent)
    );
  }

  .paragraph-thread-item.is-reply {
    border-color: color-mix(
      in oklab,
      var(--secondary) 18%,
      var(--border-color)
    );
  }

  .paragraph-thread-item.is-pending {
    border-style: dashed;
    border-color: color-mix(in oklab, var(--warning) 22%, var(--border-color));
    background: linear-gradient(
      180deg,
      color-mix(in oklab, var(--warning) 4%, var(--terminal-bg)),
      color-mix(in oklab, var(--header-bg) 88%, transparent)
    );
  }

  .paragraph-thread-head {
    @apply mb-3 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between;
  }

  .paragraph-thread-quote {
    @apply rounded-lg border-l-2 px-3 py-2 text-xs leading-6;
    border-left-color: color-mix(
      in oklab,
      var(--primary) 34%,
      var(--border-color)
    );
    background: color-mix(in oklab, var(--primary) 6%, var(--header-bg));
    color: var(--text-tertiary);
  }

  .paragraph-comment-form {
    @apply space-y-4;
  }

  .paragraph-comment-reply {
    @apply flex items-center justify-between gap-3 py-3;
  }

  .paragraph-comment-status {
    @apply rounded-xl border px-4 py-3 text-sm;
  }

  .paragraph-comment-status-success {
    border-color: color-mix(in oklab, var(--success) 28%, var(--border-color));
    background: color-mix(in oklab, var(--success) 10%, var(--header-bg));
    color: var(--success);
  }

  .paragraph-comment-status-error {
    border-color: color-mix(in oklab, var(--danger) 28%, var(--border-color));
    background: color-mix(in oklab, var(--danger) 10%, var(--header-bg));
    color: var(--danger);
  }

  .paragraph-comment-status-info {
    border-color: color-mix(in oklab, var(--primary) 28%, var(--border-color));
    background: color-mix(in oklab, var(--primary) 10%, var(--header-bg));
    color: var(--primary);
  }
}

/* Animations */
@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

@keyframes terminal-glow {
  0% {
    box-shadow:
      0 0 8px rgba(var(--primary-rgb), 0.4),
      0 0 20px rgba(var(--primary-rgb), 0.2),
      0 10px 30px rgba(var(--primary-rgb), 0.2);
  }
  100% {
    box-shadow:
      0 0 12px rgba(var(--primary-rgb), 0.5),
      0 0 25px rgba(var(--primary-rgb), 0.3),
      0 10px 30px rgba(var(--primary-rgb), 0.2);
  }
}

/* Smooth theme transitions */
html,
body,
button,
input,
select,
textarea,
a {
  @apply transition-colors duration-300 ease-out;
}
