/* ==========================================================================
   PCPDL — Design System (Épuré & Moderne 2026)
   ========================================================================== */

:root {
  /* Light & Dark Raw Tokens */
  --bg-light: #fafafa;
  --bg-dark: #090a0f;

  --surface-light: #ffffff;
  --surface-dark: #11131c;

  --surface-elevated-light: #f3f4f6;
  --surface-elevated-dark: #171a26;

  --surface-glass-light: rgba(255, 255, 255, 0.82);
  --surface-glass-dark: rgba(15, 17, 26, 0.80);

  --ink-light: #0f172a;
  --ink-dark: #f8fafc;

  --muted-light: #525e75;
  --muted-dark: #94a3b8;

  --subtle-light: #8592a6;
  --subtle-dark: #64748b;

  --line-light: #e2e8f0;
  --line-dark: #1e2336;

  --line-strong-light: #cbd5e1;
  --line-strong-dark: #2e3650;

  --primary-light: #2563eb;
  --primary-dark: #60a5fa;

  --primary-strong-light: #1d4ed8;
  --primary-strong-dark: #3b82f6;

  --primary-soft-light: #eff6ff;
  --primary-soft-dark: rgba(59, 130, 246, 0.14);

  --accent-ai-light: #6d28d9;
  --accent-ai-dark: #a78bfa;

  --accent-ai-soft-light: #f5f3ff;
  --accent-ai-soft-dark: rgba(139, 92, 246, 0.14);

  --discord-light: #5865F2;
  --discord-dark: #7289da;

  --success-light: #059669;
  --success-dark: #34d399;

  --success-soft-light: #ecfdf5;
  --success-soft-dark: rgba(16, 185, 129, 0.12);

  --warning-light: #b45309;
  --warning-dark: #fbbf24;

  --warning-soft-light: #fffbeb;
  --warning-soft-dark: rgba(245, 158, 11, 0.12);

  --danger-light: #dc2626;
  --danger-dark: #f87171;

  --danger-soft-light: #fef2f2;
  --danger-soft-dark: rgba(239, 68, 68, 0.12);

  /* Default fallback values (Light) */
  --bg: var(--bg-light);
  --surface: var(--surface-light);
  --surface-elevated: var(--surface-elevated-light);
  --surface-glass: var(--surface-glass-light);
  --ink: var(--ink-light);
  --muted: var(--muted-light);
  --subtle: var(--subtle-light);
  --line: var(--line-light);
  --line-strong: var(--line-strong-light);
  --primary: var(--primary-light);
  --primary-strong: var(--primary-strong-light);
  --primary-soft: var(--primary-soft-light);
  --accent-ai: var(--accent-ai-light);
  --accent-ai-soft: var(--accent-ai-soft-light);
  --discord: var(--discord-light);
  --success: var(--success-light);
  --success-soft: var(--success-soft-light);
  --warning: var(--warning-light);
  --warning-soft: var(--warning-soft-light);
  --danger: var(--danger-light);
  --danger-soft: var(--danger-soft-light);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 12px 32px -8px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 24px 48px -12px rgba(15, 23, 42, 0.12);

  /* Fallback for browsers without light-dark() support */
  @media (prefers-color-scheme: dark) {
    --bg: var(--bg-dark);
    --surface: var(--surface-dark);
    --surface-elevated: var(--surface-elevated-dark);
    --surface-glass: var(--surface-glass-dark);
    --ink: var(--ink-dark);
    --muted: var(--muted-dark);
    --subtle: var(--subtle-dark);
    --line: var(--line-dark);
    --line-strong: var(--line-strong-dark);
    --primary: var(--primary-dark);
    --primary-strong: var(--primary-strong-dark);
    --primary-soft: var(--primary-soft-dark);
    --accent-ai: var(--accent-ai-dark);
    --accent-ai-soft: var(--accent-ai-soft-dark);
    --discord: var(--discord-dark);
    --success: var(--success-dark);
    --success-soft: var(--success-soft-dark);
    --warning: var(--warning-dark);
    --warning-soft: var(--warning-soft-dark);
    --danger: var(--danger-dark);
    --danger-soft: var(--danger-soft-dark);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 12px 32px -8px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, 0.65);
  }

  /* Modern light-dark() automatic resolution */
  @supports (color: light-dark(white, black)) {
    --bg: light-dark(var(--bg-light), var(--bg-dark));
    --surface: light-dark(var(--surface-light), var(--surface-dark));
    --surface-elevated: light-dark(var(--surface-elevated-light), var(--surface-elevated-dark));
    --surface-glass: light-dark(var(--surface-glass-light), var(--surface-glass-dark));
    --ink: light-dark(var(--ink-light), var(--ink-dark));
    --muted: light-dark(var(--muted-light), var(--muted-dark));
    --subtle: light-dark(var(--subtle-light), var(--subtle-dark));
    --line: light-dark(var(--line-light), var(--line-dark));
    --line-strong: light-dark(var(--line-strong-light), var(--line-strong-dark));
    --primary: light-dark(var(--primary-light), var(--primary-dark));
    --primary-strong: light-dark(var(--primary-strong-light), var(--primary-strong-dark));
    --primary-soft: light-dark(var(--primary-soft-light), var(--primary-soft-dark));
    --accent-ai: light-dark(var(--accent-ai-light), var(--accent-ai-dark));
    --accent-ai-soft: light-dark(var(--accent-ai-soft-light), var(--accent-ai-soft-dark));
    --discord: light-dark(var(--discord-light), var(--discord-dark));
    --success: light-dark(var(--success-light), var(--success-dark));
    --success-soft: light-dark(var(--success-soft-light), var(--success-soft-dark));
    --warning: light-dark(var(--warning-light), var(--warning-dark));
    --warning-soft: light-dark(var(--warning-soft-light), var(--warning-soft-dark));
    --danger: light-dark(var(--danger-light), var(--danger-dark));
    --danger-soft: light-dark(var(--danger-soft-light), var(--danger-soft-dark));
  }

  /* MANDATORY: Viewport-wide native UI theming + <meta> override synchronization */
  color-scheme: light dark;
  accent-color: var(--primary);

  &:has(> head > meta[name="color-scheme"][content="dark"]) {
    color-scheme: dark;
  }
  &:has(> head > meta[name="color-scheme"][content="light"]) {
    color-scheme: light;
  }

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* Cross-Document & Group View Transitions */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
}

::view-transition {
  pointer-events: none;
}

.tuto-card {
  view-transition-class: tuto-item;
}

::view-transition-group(.tuto-item) {
  animation-duration: 0.35s;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

/* Base Reset & Typography */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font: 16px/1.65 var(--font-sans);
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  position: relative;
}

/* Subtle Architectural Grid Background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    radial-gradient(circle at 50% 0%, var(--primary-soft), transparent 55%),
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 100% 100%, 48px 48px, 48px 48px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 25%, transparent 100%);
  opacity: 0.55;
}

h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
  color: var(--ink);
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.035em;
}

p, li, blockquote {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input {
  font: inherit;
}

/* Scroll Progress Bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent-ai));
  width: 0%;
  z-index: 100;
  transition: width 0.1s linear;
}

/* ==========================================================================
   Navigation Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 68px;
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.site-header.is-scrolled {
  box-shadow: var(--shadow-sm);
}

.nav-container {
  max-width: 1200px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  object-fit: cover;
  display: block;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.25);
  transition: transform 0.2s ease;
}

.brand:hover .brand-logo {
  transform: scale(1.05);
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--ink);
  color: var(--bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
  transition: transform 0.2s ease;
}

.brand:hover .brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  object-fit: cover;
  display: block;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.25);
  transition: transform 0.2s ease;
}

.brand:hover .brand-logo {
  transform: scale(1.05);
}

.brand-mark {
  transform: scale(1.05);
}

.brand-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-elevated);
  border: 1px solid var(--line);
  color: var(--muted);
  letter-spacing: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.15s ease, background-color 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-link:hover, .nav-link.active {
  color: var(--ink);
  background: var(--surface-elevated);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cmd-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.cmd-trigger:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.cmd-trigger kbd {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--surface-elevated);
  border: 1px solid var(--line);
  color: var(--muted);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.icon-btn:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  background: var(--surface-elevated);
}

/* Theme toggle icons visibility */
.theme-icon-dark { display: none; }
.theme-icon-light { display: block; }

@media (prefers-color-scheme: dark) {
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .theme-icon-light {
    display: none;
  }
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .theme-icon-dark {
    display: block;
  }
}

:root:has(> head > meta[name="color-scheme"][content="dark"]) .theme-icon-light {
  display: none;
}
:root:has(> head > meta[name="color-scheme"][content="dark"]) .theme-icon-dark {
  display: block;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
}

.btn-primary:hover {
  opacity: 0.92;
  box-shadow: var(--shadow-sm);
}

.btn-ai {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.28);
}

.btn-ai:hover {
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
  transform: translateY(-1px);
}

.btn-discord {
  background: #5865F2;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(88, 101, 242, 0.25);
}

.btn-discord:hover {
  background: #4752c4;
  transform: translateY(-1px);
}

.btn-outline {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.btn-outline:hover {
  border-color: var(--line-strong);
  background: var(--surface-elevated);
}

.btn-lg {
  height: 44px;
  padding: 0 20px;
  font-size: 15px;
  border-radius: 10px;
}

.btn-sm {
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

/* ==========================================================================
   Main Container & Hero (Landing Page)
   ========================================================================== */
.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.hero {
  padding: 76px 0 56px;
  text-align: center;
  max-width: 820px;
  margin: 0 auto;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.status-pill:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-soft);
}

.hero h1 {
  font-size: clamp(38px, 6vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.045em;
  margin-bottom: 20px;
}

.hero h1 .gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--accent-ai));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  font-size: clamp(17px, 2vw, 20px);
  color: var(--muted);
  max-width: 620px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 780px;
  margin: 48px auto 0;
  padding: 18px 24px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.stat-item {
  text-align: center;
}

.stat-item strong {
  display: block;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.stat-item span {
  font-size: 12px;
  color: var(--muted);
}

/* ==========================================================================
   Section Headers
   ========================================================================== */
.section-block {
  padding: 52px 0;
  scroll-margin-top: 76px;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.section-eyebrow {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.section-header h2 {
  font-size: clamp(26px, 3.5vw, 34px);
  line-height: 1.15;
}

.section-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 15px;
  max-width: 540px;
}

/* ==========================================================================
   AI Showcase Section (https://ai.pcpdl.live)
   ========================================================================== */
.ai-showcase {
  position: relative;
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 0;
}

.ai-showcase::before {
  content: "";
  position: absolute;
  top: -120px;
  right: -120px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-ai-soft), transparent 70%);
  pointer-events: none;
}

.ai-copy {
  padding: clamp(28px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--accent-ai-soft);
  color: var(--accent-ai);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.ai-copy h2 {
  font-size: clamp(26px, 3.5vw, 36px);
  line-height: 1.12;
  margin-bottom: 14px;
}

.ai-copy p {
  color: var(--muted);
  font-size: 16px;
  margin: 0 0 24px;
}

.ai-prompts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 28px;
}

.ai-prompt-btn {
  text-align: left;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.ai-prompt-btn:hover, .ai-prompt-btn.active {
  border-color: var(--accent-ai);
  background: var(--accent-ai-soft);
}

.ai-prompt-btn span.arrow {
  color: var(--accent-ai);
  font-weight: 700;
}

.ai-terminal {
  background: #0d1017;
  color: #e2e8f0;
  border-left: 1px solid var(--line);
  padding: clamp(24px, 3.5vw, 38px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color-scheme: dark;
}

.ai-terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 20px;
}

.window-dots {
  display: flex;
  gap: 6px;
}

.window-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: block;
}

.window-dots i:nth-child(1) { background: #ef4444; }
.window-dots i:nth-child(2) { background: #f59e0b; }
.window-dots i:nth-child(3) { background: #10b981; }

.ai-terminal-url {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 10px;
  border-radius: 6px;
}

.ai-chat-box {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: auto 0;
}

.chat-bubble {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.55;
}

.chat-user {
  align-self: flex-end;
  background: #1e293b;
  color: #f8fafc;
  border-bottom-right-radius: 4px;
  max-width: 85%;
}

.chat-bot {
  align-self: flex-start;
  background: rgba(124, 58, 237, 0.14);
  border: 1px solid rgba(167, 139, 250, 0.25);
  color: #e2e8f0;
  border-bottom-left-radius: 4px;
  max-width: 95%;
}

.chat-bot strong {
  color: #c4b5fd;
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.chat-bot code {
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.35);
  padding: 2px 6px;
  border-radius: 4px;
  color: #93c5fd;
  font-size: 12.5px;
}

.ai-terminal-footer {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #94a3b8;
}

/* ==========================================================================
   Downloads Grid (#telechargements)
   ========================================================================== */
.downloads-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.dl-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.dl-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.dl-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.dl-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dl-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--surface-elevated);
  border: 1px solid var(--line);
  color: var(--muted);
}

.dl-card h3 {
  font-size: 19px;
  margin-bottom: 8px;
}

.dl-card p {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 18px;
}

.dl-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--subtle);
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 7px 10px;
  border-radius: 8px;
  margin-bottom: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dl-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dl-actions .btn-primary {
  flex: 1;
}

/* ==========================================================================
   Tutorials Filter & Cards Grid (#tutoriels)
   ========================================================================== */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-pill {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-pill:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.filter-pill.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.search-input-wrap {
  display: block;
  position: relative;
  min-width: 250px;
}

.search-input-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--subtle);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

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

.tuto-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  min-height: 255px;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.tuto-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px circle at var(--mouse-x, 50%) var(--mouse-y, 0%), var(--primary-soft), transparent 45%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.tuto-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.tuto-card:hover::after {
  opacity: 0.7;
}

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

.tuto-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}

.tuto-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface-elevated);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.tuto-tag {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-elevated);
  color: var(--muted);
  border: 1px solid var(--line);
}

.tuto-tag.featured-tag {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: transparent;
}

.tuto-tag.risk-tag {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: transparent;
}

.tuto-card h3 {
  font-size: 18px;
  line-height: 1.3;
  margin-bottom: 8px;
}

.tuto-card p {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 20px;
  flex-grow: 1;
}

.tuto-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.tuto-duration {
  color: var(--subtle);
  font-weight: 500;
}

.tuto-read {
  font-weight: 600;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tuto-read span {
  color: var(--primary);
  transition: transform 0.2s ease;
}

.tuto-card:hover .tuto-read span {
  transform: translateX(4px);
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  color: var(--muted);
}

/* ==========================================================================
   Discord Community Hub & Redesigned Live Widget (1flexible Founder)
   ========================================================================== */
.discord-hub {
  position: relative;
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}

.discord-hub::before {
  content: "";
  position: absolute;
  bottom: -140px;
  left: -120px;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(88, 101, 242, 0.12), transparent 70%);
  pointer-events: none;
}

.discord-hub-copy {
  padding: clamp(28px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.discord-hub-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(88, 101, 242, 0.12);
  color: var(--discord);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.discord-hub-copy h2 {
  font-size: clamp(26px, 3.5vw, 36px);
  line-height: 1.12;
  margin-bottom: 14px;
}

.discord-hub-copy p {
  color: var(--muted);
  font-size: 16px;
  margin: 0 0 24px;
}

/* Bento Live Counters */
.discord-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.discord-metric-box {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.discord-metric-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.pulse-dot-green {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-soft);
}

.pulse-dot-blurple {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--discord);
  box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.16);
}

.discord-metric-box strong {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.discord-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Right Panel: Sleek Native Live Widget */
.discord-live-panel {
  background: var(--bg);
  border-left: 1px solid var(--line);
  padding: clamp(22px, 3vw, 32px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

.dlp-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.dlp-server {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dlp-server-logo {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  object-fit: cover;
  display: block;
  box-shadow: 0 4px 12px rgba(88, 101, 242, 0.25);
}

.dlp-server-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, #5865F2, #4f46e5);
  color: #ffffff;
  font-weight: 800;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(88, 101, 242, 0.25);
}

.dlp-server-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  color: var(--ink);
}

.dlp-verified {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--discord);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dlp-server-sub {
  display: block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--subtle);
}

.dlp-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.dlp-live-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.dlp-directory {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 450px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}

.dlp-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dlp-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dlp-cat-count {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-elevated);
  border: 1px solid var(--line);
  color: var(--muted);
}

/* Staff & Founder Spotlight Cards */
.dlp-founder-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.dlp-founder-card:hover {
  border-color: var(--discord);
  transform: translateY(-1px);
}

.dlp-avatar-box {
  position: relative;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.dlp-founder-monogram {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5865F2, #7c3aed);
  color: #ffffff;
  font-weight: 800;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.02em;
}

.dlp-mono-founder { background: linear-gradient(135deg, #7c3aed, #db2777); }
.dlp-mono-admin   { background: linear-gradient(135deg, #ef4444, #f97316); }
.dlp-mono-host    { background: linear-gradient(135deg, #0ea5e9, #2563eb); }
.dlp-mono-dev     { background: linear-gradient(135deg, #10b981, #059669); }
.dlp-mono-mod     { background: linear-gradient(135deg, #f59e0b, #d97706); }
.dlp-mono-cm      { background: linear-gradient(135deg, #ec4899, #8b5cf6); }
.dlp-mono-helper  { background: linear-gradient(135deg, #3b82f6, #6366f1); }

.dlp-avatar-img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.dlp-avatar-img[hidden] {
  display: none !important;
}

.dlp-status {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--surface);
}

.dlp-status-online { background: #10b981; }
.dlp-status-idle { background: #f59e0b; }
.dlp-status-dnd { background: #ef4444; }

.dlp-user-meta {
  min-width: 0;
  flex: 1;
}

.dlp-user-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dlp-username {
  font-size: 14px;
  color: var(--ink);
  font-weight: 700;
}

.dlp-role-tag,
.dlp-founder-tag,
.dlp-host-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.dlp-role-founder,
.dlp-founder-tag {
  background: var(--accent-ai-soft);
  color: var(--accent-ai);
}

.dlp-role-admin {
  background: var(--danger-soft);
  color: var(--danger);
}

.dlp-role-host,
.dlp-host-tag {
  background: var(--primary-soft);
  color: var(--primary);
}

.dlp-role-dev {
  background: var(--success-soft);
  color: var(--success);
}

.dlp-role-mod {
  background: var(--warning-soft);
  color: var(--warning);
}

.dlp-role-cm {
  background: rgba(236, 72, 153, 0.14);
  color: #db2777;
}

.dlp-role-helper {
  background: rgba(88, 101, 242, 0.14);
  color: var(--discord);
}

.dlp-user-sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dlp-ping-btn {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  background: var(--surface-elevated);
  border: 1px solid var(--line);
  color: var(--ink);
  flex-shrink: 0;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.dlp-ping-btn:hover {
  border-color: var(--line-strong);
}

/* Active Members Grid */
.dlp-members-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.dlp-member-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  min-width: 0;
  transition: border-color 0.15s ease;
}

.dlp-member-chip:hover {
  border-color: var(--line-strong);
}

.dlp-chip-avatar-wrap {
  position: relative;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.dlp-chip-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: var(--surface-elevated);
}

.dlp-chip-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid var(--surface);
}

.dlp-chip-info {
  min-width: 0;
  flex: 1;
}

.dlp-chip-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dlp-chip-game {
  font-size: 10.5px;
  color: var(--subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dlp-foot {
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

.dlp-foot a {
  font-weight: 600;
  color: var(--discord);
}

.dlp-foot a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Tutorial Page Layout (Shared across all 8 guides)
   ========================================================================== */
.layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 800px);
  gap: 56px;
  margin: 0 auto;
  max-width: 1160px;
  padding: 48px 24px 88px;
}

.sidebar {
  position: sticky;
  top: 96px;
  height: fit-content;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 24px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.back-link:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  transform: translateX(-2px);
}

.sidebar-label {
  color: var(--subtle);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin: 0 0 12px;
  text-transform: uppercase;
}

.toc {
  border-left: 1px solid var(--line);
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc a {
  border-left: 2px solid transparent;
  color: var(--muted);
  display: block;
  font-size: 13.5px;
  padding: 6px 0 6px 14px;
  margin-left: -1px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.toc a:hover, .toc a.active {
  border-left-color: var(--primary);
  color: var(--ink);
  font-weight: 600;
}

.side-note {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 24px;
  padding: 14px;
  line-height: 1.5;
}

.side-note strong {
  color: var(--ink);
  display: block;
  margin-bottom: 4px;
}

.side-note a {
  color: var(--primary);
  font-weight: 600;
}

/* Article Content */
.eyebrow {
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

main header h1 {
  font-size: clamp(32px, 4.5vw, 48px);
  letter-spacing: -0.04em;
  line-height: 1.08;
  margin: 10px 0 16px;
}

.intro {
  color: var(--muted);
  font-size: 18px;
  margin: 0;
  max-width: 680px;
}

.meta {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 12px;
  margin-top: 20px;
}

.meta span {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 4px 11px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.meta strong {
  color: var(--ink);
}

.notice {
  align-items: flex-start;
  background: var(--warning-soft);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-lg);
  color: var(--warning);
  display: flex;
  gap: 14px;
  margin: 32px 0;
  padding: 18px 20px;
}

.notice.danger {
  background: var(--danger-soft);
  border-color: rgba(239, 68, 68, 0.35);
  color: var(--danger);
}

.notice-icon {
  font-size: 20px;
  line-height: 1.4;
}

.notice p {
  margin: 0;
  color: var(--ink);
  font-size: 14.5px;
}

.notice strong {
  display: block;
  margin-bottom: 3px;
  color: inherit;
}

.section {
  border-top: 1px solid var(--line);
  margin-top: 38px;
  padding-top: 32px;
  scroll-margin-top: 92px;
}

.section-heading {
  align-items: center;
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.step-number {
  align-items: center;
  background: var(--ink);
  border-radius: 8px;
  color: var(--bg);
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  height: 28px;
  justify-content: center;
  width: 28px;
  flex-shrink: 0;
}

.section h2 {
  font-size: 22px;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.section p {
  margin: 10px 0;
  color: var(--ink);
}

.muted {
  color: var(--muted) !important;
}

ol, ul {
  padding-left: 22px;
}

li {
  margin: 8px 0;
  padding-left: 4px;
}

.flow {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  margin: 18px 0;
  padding: 14px 18px;
}

.code-wrap {
  background: #0d1017;
  border: 1px solid #1e2336;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin: 18px 0;
  overflow: hidden;
  color-scheme: dark;
}

.code-head {
  align-items: center;
  color: #94a3b8;
  display: flex;
  font-size: 12px;
  font-weight: 500;
  justify-content: space-between;
  padding: 10px 14px 10px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.copy {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #f8fafc;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  transition: background-color 0.15s ease;
}

.copy:hover {
  background: rgba(255, 255, 255, 0.16);
}

pre {
  color: #f1f5f9;
  font: 13.5px/1.75 var(--font-mono);
  margin: 0;
  overflow-x: auto;
  padding: 14px 16px;
}

pre code {
  color: inherit;
  background: none;
  padding: 0;
}

code, .inline-code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 5px;
  padding: 2px 6px;
}

.tip {
  background: var(--success-soft);
  border-left: 3px solid var(--success);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink);
  margin: 18px 0;
  padding: 12px 16px;
  font-size: 14.5px;
}

.inline-dl-box {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 72px;
  padding: 36px 0 44px;
  color: var(--muted);
  font-size: 13.5px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--muted);
  transition: color 0.15s ease;
}

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

/* ==========================================================================
   Command Palette Dialog (Ctrl+K)
   ========================================================================== */
.cmd-dialog {
  width: min(580px, calc(100vw - 28px));
  max-height: 85dvh;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  padding: 0;
  box-shadow: var(--shadow-lg);
  margin: max(16px, 6dvh) auto auto;
  overflow: hidden;
  overscroll-behavior: contain;
}

.cmd-dialog::backdrop {
  background: rgba(9, 10, 15, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.cmd-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}

.cmd-input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  outline: none;
}

.cmd-list {
  max-height: min(380px, 60dvh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px;
}

.cmd-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--subtle);
  padding: 8px 10px 4px;
}

.cmd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--ink);
  transition: background-color 0.12s ease;
}

.cmd-item:hover, .cmd-item:focus {
  background: var(--surface-elevated);
  outline: none;
}

.cmd-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.cmd-item-left span:last-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmd-item-sub {
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}

/* ==========================================================================
   Mobile Navigation Drawer & Hamburger Button
   ========================================================================== */
.mobile-menu-btn {
  display: none;
}

.mobile-menu-btn .icon-close {
  display: none;
}

.mobile-menu-btn[aria-expanded="true"] .icon-hamburger {
  display: none;
}

.mobile-menu-btn[aria-expanded="true"] .icon-close {
  display: block;
}

.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
}

.mobile-drawer.is-open {
  display: block;
}

.mobile-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 10, 15, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.mobile-drawer.is-open .mobile-drawer-backdrop {
  opacity: 1;
}

.mobile-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(340px, 86vw);
  height: 100dvh;
  background: var(--surface);
  border-left: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  transform: translateX(100%);
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  box-sizing: border-box;
}

.mobile-drawer.is-open .mobile-drawer-panel {
  transform: translateX(0);
}

.mobile-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.mobile-drawer-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 0;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  background: transparent;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.mobile-nav-link:hover, .mobile-nav-link:active {
  background: var(--surface-elevated);
  color: var(--primary);
}

.mobile-drawer-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* Scroll Reveal Animations */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    translate: 0 16px;
    transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1), translate 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .reveal.is-visible {
    opacity: 1;
    translate: 0 0;
  }
}

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

/* 1. Tablet Landscape & Medium Desktops (<= 960px) */
@media (max-width: 960px) {
  .ai-showcase {
    grid-template-columns: minmax(0, 1fr);
  }
  .ai-terminal {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .discord-hub {
    grid-template-columns: minmax(0, 1fr);
  }
  .discord-live-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .downloads-grid,
  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    padding: 32px 20px 64px;
  }
  .sidebar {
    position: static;
  }
}

/* 2. Tablet Portrait & Small Tablets (<= 768px) */
@media (max-width: 768px) {
  .site-header {
    height: 62px;
  }
  .nav-container {
    padding: 0 18px;
  }
  .nav-links {
    display: none;
  }
  .mobile-menu-btn {
    display: inline-flex;
  }
}

/* 3. Standard Smartphone (<= 680px) */
@media (max-width: 680px) {
  .shell {
    padding: 0 18px;
    width: 100%;
    max-width: 100%;
  }
  .cmd-trigger {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
  }
  .cmd-trigger span,
  .cmd-trigger kbd {
    display: none;
  }
  .hero {
    padding: 36px 0 28px;
  }
  .hero h1 {
    font-size: clamp(26px, 7vw, 38px);
    line-height: 1.15;
  }
  .hero-lead {
    font-size: 15px;
    line-height: 1.5;
    margin: 0 auto 20px;
  }
  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .downloads-grid,
  .cards-grid,
  .dlp-members-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .dl-card,
  .tuto-card {
    min-height: auto;
    padding: 18px 16px;
  }
  .filter-bar {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 12px;
    width: 100%;
    max-width: 100%;
  }
  .filter-pills {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    gap: 8px;
    padding-bottom: 0;
  }
  .filter-pill {
    flex: 1 1 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 38px;
    white-space: nowrap;
    padding: 8px 12px;
    font-size: 13px;
  }
  .search-input-wrap {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .search-input {
    height: 42px;
    font-size: 16px; /* Prevents iOS Safari auto-zoom on focus */
  }
  .ai-copy {
    padding: 24px 18px;
  }
  .ai-terminal-body {
    padding: 16px 14px;
  }
  .discord-hub-copy {
    padding: 24px 18px;
  }
  .discord-live-panel {
    padding: 20px 16px;
  }
  .dlp-directory {
    max-height: 440px;
  }
  .layout {
    padding: 24px 16px 56px;
    gap: 24px;
  }
  main header h1 {
    font-size: clamp(24px, 6vw, 34px);
    line-height: 1.15;
  }
  .intro {
    font-size: 15.5px;
  }
  .notice {
    padding: 14px 16px;
  }
  pre {
    padding: 12px 14px;
    font-size: 12.5px;
  }
  .cmd-dialog {
    width: calc(100vw - 16px);
    margin: max(10px, 3dvh) auto auto;
    border-radius: var(--radius-md);
  }
  .cmd-input {
    font-size: 16px; /* Prevents iOS Safari auto-zoom */
  }
}

/* 4. Compact Mobile (<= 520px) */
@media (max-width: 520px) {
  .nav-container {
    padding: 0 14px;
  }
  .shell {
    padding: 0 14px;
  }
  .brand-badge {
    display: none;
  }
  .nav-actions .btn-ai {
    display: none;
  }
  .status-pill {
    font-size: 11.5px;
    padding: 5px 12px;
    max-width: 100%;
    white-space: normal;
  }
  .hero-actions {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }
  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .stat-box {
    padding: 12px 14px;
  }
  .stat-box strong {
    font-size: 22px;
  }
  .stat-box span {
    font-size: 11.5px;
  }
  .discord-metrics {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .discord-actions {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }
  .discord-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .dl-actions {
    flex-direction: column;
    gap: 8px;
  }
  .dl-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .inline-dl-box {
    flex-direction: column;
    width: 100%;
  }
  .inline-dl-box .btn {
    width: 100%;
    justify-content: center;
  }
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .footer-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
  }
}

/* 5. Ultra-Small Smartphone (<= 380px) */
@media (max-width: 380px) {
  .nav-container {
    padding: 0 10px;
  }
  .shell {
    padding: 0 10px;
  }
  .hero-stats {
    grid-template-columns: 1fr;
  }
  .dlp-top {
    gap: 8px;
  }
  .dlp-server-logo {
    width: 34px;
    height: 34px;
  }
  .dlp-server-title strong {
    font-size: 14px;
  }
  .dlp-live-pill {
    padding: 3px 8px;
    font-size: 11px;
  }
  .dlp-founder-card {
    padding: 10px 8px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .dlp-avatar-box {
    width: 34px;
    height: 34px;
  }
  .dlp-founder-monogram,
  .dlp-avatar-img {
    width: 34px;
    height: 34px;
    font-size: 11px;
  }
  .dlp-username {
    font-size: 13px;
  }
  .dlp-role-tag {
    font-size: 10px;
    padding: 2px 6px;
  }
  .dlp-ping-btn {
    font-size: 11px;
    padding: 4px 7px;
  }
  .dlp-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    font-size: 11px;
  }
}
