/* Default: Midnight — dark tech glass */
:root,
[data-theme="midnight"] {
  --bg: #0a0c10;
  --bg-elevated: #12151c;
  --bg-card: #161a24;
  --border: #252b3a;
  --border-hover: #3d4660;
  --border-width: 1px;
  --text: #e8ecf4;
  --text-muted: #8b95a8;
  --accent: #5eead4;
  --accent-dim: #2dd4bf33;
  --accent-secondary: #a78bfa;
  --github: #f0f6fc;
  --itch: #fa5c5c;
  --vercel: #ffffff;
  --pages: #3fb950;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 8px 28px rgba(0, 0, 0, 0.45);
  --font: "DM Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --grid-line: rgba(94, 234, 212, 0.03);
  --brand-gradient: linear-gradient(135deg, var(--text) 40%, var(--accent) 100%);
  --card-featured-bg: linear-gradient(145deg, var(--bg-card) 0%, #121820 100%);
  --filter-active-fg: var(--bg);
  --toggle-track: #1a1f2b;
  --toggle-thumb: var(--accent);
}

/* Neo-brutalism — hard edges, offset shadows, flat ink */
[data-theme="brutal"] {
  --bg: #fff7e0;
  --bg-elevated: #ffe566;
  --bg-card: #ffffff;
  --border: #0a0a0a;
  --border-hover: #0a0a0a;
  --border-width: 3px;
  --text: #0a0a0a;
  --text-muted: #3a3a3a;
  --accent: #ff3d71;
  --accent-dim: #ff3d7133;
  --accent-secondary: #0066ff;
  --github: #0a0a0a;
  --itch: #ff3d71;
  --vercel: #0a0a0a;
  --pages: #00a86b;
  --radius: 0;
  --radius-sm: 0;
  --radius-pill: 0;
  --shadow: 5px 5px 0 #0a0a0a;
  --shadow-hover: 8px 8px 0 #0a0a0a;
  --font: "Space Grotesk", "DM Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, monospace;
  --grid-line: rgba(10, 10, 10, 0.08);
  --brand-gradient: none;
  --card-featured-bg: #ffe566;
  --filter-active-fg: #ffffff;
  --toggle-track: #0a0a0a;
  --toggle-thumb: #ffe566;
}

/* Frutiger Aero — glossy sky optimism */
[data-theme="aero"] {
  --bg: #9ad7ff;
  --bg-elevated: rgba(255, 255, 255, 0.55);
  --bg-card: rgba(255, 255, 255, 0.72);
  --border: rgba(255, 255, 255, 0.85);
  --border-hover: #ffffff;
  --border-width: 2px;
  --text: #0b3d66;
  --text-muted: #2a628c;
  --accent: #ff7eb6;
  --accent-dim: #ff7eb655;
  --accent-secondary: #1e90ff;
  --github: #0b3d66;
  --itch: #ff4d8d;
  --vercel: #0b3d66;
  --pages: #18a86b;
  --radius: 22px;
  --radius-sm: 16px;
  --radius-pill: 999px;
  --shadow: 0 10px 30px rgba(30, 100, 180, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  --shadow-hover: 0 16px 40px rgba(30, 100, 180, 0.35), inset 0 1px 0 #fff;
  --font: "Outfit", "DM Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --grid-line: rgba(255, 255, 255, 0.35);
  --brand-gradient: linear-gradient(180deg, #ffffff 0%, #7ec8ff 55%, #ff9ed2 100%);
  --card-featured-bg: linear-gradient(160deg, rgba(255, 255, 255, 0.9), rgba(180, 230, 255, 0.75));
  --filter-active-fg: #ffffff;
  --toggle-track: #4aa8e8;
  --toggle-thumb: #ffffff;
}

/* Liquid Glass — frosted refractive panels */
[data-theme="glass"] {
  --bg: #0e1424;
  --bg-elevated: rgba(255, 255, 255, 0.08);
  --bg-card: rgba(255, 255, 255, 0.1);
  --border: rgba(255, 255, 255, 0.22);
  --border-hover: rgba(255, 255, 255, 0.4);
  --border-width: 1px;
  --text: #f4f7ff;
  --text-muted: #a9b4d0;
  --accent: #8ec5ff;
  --accent-dim: #8ec5ff44;
  --accent-secondary: #c4b5fd;
  --github: #f4f7ff;
  --itch: #fb7185;
  --vercel: #ffffff;
  --pages: #4ade80;
  --radius: 20px;
  --radius-sm: 14px;
  --radius-pill: 999px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  --shadow-hover: 0 14px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  --font: "Outfit", "DM Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --grid-line: rgba(142, 197, 255, 0.08);
  --brand-gradient: linear-gradient(120deg, #ffffff 10%, #8ec5ff 50%, #e9d5ff 100%);
  --card-featured-bg: rgba(255, 255, 255, 0.14);
  --filter-active-fg: #0e1424;
  --toggle-track: rgba(255, 255, 255, 0.15);
  --toggle-thumb: #8ec5ff;
}

/* Y2K Chrome — metallic neon plastic */
[data-theme="chrome"] {
  --bg: #12061f;
  --bg-elevated: #1d0b33;
  --bg-card: linear-gradient(145deg, #2a1548, #12061f 60%, #001a33);
  --border: #f0abfc;
  --border-hover: #67e8f9;
  --border-width: 2px;
  --text: #f8fafc;
  --text-muted: #d8b4fe;
  --accent: #22d3ee;
  --accent-dim: #22d3ee44;
  --accent-secondary: #f472b6;
  --github: #e2e8f0;
  --itch: #fb7185;
  --vercel: #ffffff;
  --pages: #4ade80;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --shadow: 0 0 0 1px #f0abfc, 0 0 24px rgba(34, 211, 238, 0.35), 0 8px 0 #f472b6;
  --shadow-hover: 0 0 0 1px #67e8f9, 0 0 36px rgba(244, 114, 182, 0.45), 0 10px 0 #22d3ee;
  --font: "Orbitron", "Space Grotesk", system-ui, sans-serif;
  --mono: "Share Tech Mono", "JetBrains Mono", ui-monospace, monospace;
  --grid-line: rgba(244, 114, 182, 0.15);
  --brand-gradient: linear-gradient(110deg, #e2e8f0, #67e8f9 35%, #f472b6 70%, #c084fc);
  --card-featured-bg: linear-gradient(145deg, #3b1d63, #12061f 55%, #003049);
  --filter-active-fg: #12061f;
  --toggle-track: #3b0764;
  --toggle-thumb: #22d3ee;
}

/* Clay — soft play-dough forms */
[data-theme="clay"] {
  --bg: #efe6ff;
  --bg-elevated: #ffd6e8;
  --bg-card: #fff7fb;
  --border: #d8c4f0;
  --border-hover: #c4a8e8;
  --border-width: 0;
  --text: #3d2a55;
  --text-muted: #7a6494;
  --accent: #7c6cff;
  --accent-dim: #7c6cff33;
  --accent-secondary: #ff7eb6;
  --github: #3d2a55;
  --itch: #ff6b9d;
  --vercel: #3d2a55;
  --pages: #3ecf8e;
  --radius: 28px;
  --radius-sm: 20px;
  --radius-pill: 999px;
  --shadow:
    10px 10px 24px rgba(140, 110, 180, 0.28),
    -8px -8px 20px rgba(255, 255, 255, 0.9),
    inset 0 2px 4px rgba(255, 255, 255, 0.85);
  --shadow-hover:
    14px 14px 28px rgba(140, 110, 180, 0.34),
    -10px -10px 22px rgba(255, 255, 255, 0.95),
    inset 0 2px 4px rgba(255, 255, 255, 0.9);
  --font: "Fredoka", "Outfit", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --grid-line: rgba(124, 108, 255, 0.08);
  --brand-gradient: linear-gradient(135deg, #7c6cff, #ff7eb6);
  --card-featured-bg: #fff0f8;
  --filter-active-fg: #ffffff;
  --toggle-track: #d8c4f0;
  --toggle-thumb: #7c6cff;
}

/* Terminal — phosphor hacker console */
[data-theme="terminal"] {
  --bg: #020803;
  --bg-elevated: #06140a;
  --bg-card: #041008;
  --border: #1f8f3a;
  --border-hover: #39ff14;
  --border-width: 1px;
  --text: #39ff14;
  --text-muted: #1f8f3a;
  --accent: #39ff14;
  --accent-dim: #39ff1422;
  --accent-secondary: #b8ff80;
  --github: #39ff14;
  --itch: #39ff14;
  --vercel: #39ff14;
  --pages: #39ff14;
  --radius: 0;
  --radius-sm: 0;
  --radius-pill: 0;
  --shadow: 0 0 12px rgba(57, 255, 20, 0.25);
  --shadow-hover: 0 0 22px rgba(57, 255, 20, 0.45);
  --font: "Share Tech Mono", "IBM Plex Mono", ui-monospace, monospace;
  --mono: "Share Tech Mono", "IBM Plex Mono", ui-monospace, monospace;
  --grid-line: rgba(57, 255, 20, 0.08);
  --brand-gradient: none;
  --card-featured-bg: #06140a;
  --filter-active-fg: #020803;
  --toggle-track: #06140a;
  --toggle-thumb: #39ff14;
}

/* Lego — chunky brick plastic */
[data-theme="lego"] {
  --bg: #f2f2f2;
  --bg-elevated: #d6e4ff;
  --bg-card: #ffe400;
  --border: #1a1a1a;
  --border-hover: #1a1a1a;
  --border-width: 3px;
  --text: #1a1a1a;
  --text-muted: #3d3d3d;
  --accent: #e3000b;
  --accent-dim: #e3000b33;
  --accent-secondary: #0055a5;
  --github: #1a1a1a;
  --itch: #e3000b;
  --vercel: #1a1a1a;
  --pages: #00af4d;
  --radius: 6px;
  --radius-sm: 4px;
  --radius-pill: 4px;
  --shadow: 4px 4px 0 #1a1a1a;
  --shadow-hover: 7px 7px 0 #1a1a1a;
  --font: "Fredoka", "Space Grotesk", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --grid-line: rgba(26, 26, 26, 0.08);
  --brand-gradient: none;
  --card-featured-bg: #e3000b;
  --filter-active-fg: #ffffff;
  --toggle-track: #0055a5;
  --toggle-thumb: #ffe400;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  transition: background-color 0.25s ease, color 0.25s ease;
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 20%, transparent 70%);
  transition: opacity 0.25s ease;
}

[data-theme="brutal"] .bg-grid {
  background-size: 32px 32px;
  mask-image: none;
  opacity: 1;
}

.container {
  width: min(1120px, 100% - 2rem);
  margin-inline: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header */

.site-header {
  padding: 3rem 0 2rem;
  border-bottom: var(--border-width) solid var(--border);
  overflow: visible;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 0.75rem;
  overflow: visible;
}

.theme-toggle-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding-top: 3.25rem;
  overflow: visible;
}

.styles-bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.45rem);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  max-width: min(17rem, 75vw);
  padding: 0.55rem 0.55rem 0.55rem 0.8rem;
  color: var(--filter-active-fg, #04110f);
  background: var(--accent);
  border: var(--border-width) solid var(--border);
  border-radius: 1.15rem 1.15rem 1.15rem 0.35rem;
  box-shadow: var(--shadow);
  transform: translateX(-50%);
  cursor: pointer;
  user-select: none;
  animation: styles-bubble-bounce 1.35s ease-in-out infinite;
}

.styles-bubble[hidden] {
  display: none !important;
}

.styles-bubble--gone {
  animation: styles-bubble-out 0.22s ease forwards;
  pointer-events: none;
}

.styles-bubble__text {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.styles-bubble__dismiss {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  opacity: 0.7;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.styles-bubble__dismiss:hover {
  opacity: 1;
  background: color-mix(in srgb, #000 12%, transparent);
}

.styles-bubble__tail {
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-right: var(--border-width) solid var(--border);
  border-bottom: var(--border-width) solid var(--border);
  transform: translateX(-50%) rotate(45deg);
}

[data-theme="brutal"] .styles-bubble,
[data-theme="lego"] .styles-bubble,
[data-theme="terminal"] .styles-bubble {
  border-radius: 0;
  box-shadow: 4px 4px 0 var(--border);
}

[data-theme="brutal"] .styles-bubble__tail,
[data-theme="lego"] .styles-bubble__tail,
[data-theme="terminal"] .styles-bubble__tail {
  border-radius: 0;
}

[data-theme="clay"] .styles-bubble {
  border: none;
}

[data-theme="midnight"] .styles-bubble,
[data-theme="glass"] .styles-bubble,
[data-theme="chrome"] .styles-bubble,
[data-theme="terminal"] .styles-bubble {
  color: var(--bg);
}

@keyframes styles-bubble-bounce {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-8px);
  }
  55% {
    transform: translateX(-50%) translateY(-2px);
  }
}

@keyframes styles-bubble-out {
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(6px) scale(0.92);
  }
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-eyebrow {
  margin: 0 0 0.25rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.brand-name {
  margin: 0;
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: var(--text);
}

[data-theme="brutal"] .brand-name {
  -webkit-text-fill-color: var(--text);
  background: none;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.brand-bio {
  margin: 0.5rem 0 0;
  max-width: 48ch;
  color: var(--text-muted);
}

[data-theme="brutal"] .brand-eyebrow {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  background: var(--bg-elevated);
  border: var(--border-width) solid var(--border);
  box-shadow: 3px 3px 0 var(--border);
  color: var(--text);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.75rem 0.45rem 0.5rem;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  background: var(--bg-elevated);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: none;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--border-hover);
}

.theme-toggle:active {
  transform: translate(1px, 1px);
}

[data-theme="brutal"] .theme-toggle {
  box-shadow: 3px 3px 0 var(--border);
}

[data-theme="brutal"] .theme-toggle:active {
  box-shadow: 1px 1px 0 var(--border);
}

.theme-toggle__track {
  position: relative;
  width: 3.4rem;
  height: 1.15rem;
  background: var(--toggle-track);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-pill);
  flex-shrink: 0;
  overflow: hidden;
}

.theme-toggle__thumb {
  position: absolute;
  top: 50%;
  left: 2px;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--toggle-thumb);
  border: 1px solid var(--border);
  transform: translateY(-50%);
  transition: left 0.25s cubic-bezier(0.34, 1.4, 0.64, 1), border-radius 0.2s ease;
}

[data-theme="brutal"] .theme-toggle__thumb,
[data-theme="terminal"] .theme-toggle__thumb {
  border-radius: 0;
}

.theme-toggle__copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
  min-width: 5.25rem;
  line-height: 1.15;
}

.theme-toggle__hint {
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  opacity: 0.65;
}

.theme-toggle__label {
  text-align: left;
  font-weight: 700;
}

.header-links {
  display: flex;
  gap: 0.75rem;
}

.header-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  background: var(--bg-elevated);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.12s;
}

.header-link svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.header-link:hover {
  border-color: var(--border-hover);
  background: var(--bg-card);
}

[data-theme="brutal"] .header-link {
  font-weight: 700;
  box-shadow: 3px 3px 0 var(--border);
}

[data-theme="brutal"] .header-link:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--border);
}

/* Stats */

.stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 2rem 0 1.5rem;
}

.stat-pill {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-elevated);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius);
  box-shadow: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

[data-theme="brutal"] .stat-pill {
  box-shadow: var(--shadow);
}

[data-theme="brutal"] .stat-pill:nth-child(2) { background: #7afcff; }
[data-theme="brutal"] .stat-pill:nth-child(3) { background: #ff9f1c; }
[data-theme="brutal"] .stat-pill:nth-child(4) { background: #b8f25a; }

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

[data-theme="brutal"] .stat-value {
  color: var(--text);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Controls */

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-btn {
  padding: 0.4rem 0.9rem;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s, transform 0.12s, box-shadow 0.12s;
}

.filter-btn:hover {
  color: var(--text);
  border-color: var(--border-hover);
}

.filter-btn.active {
  color: var(--filter-active-fg);
  background: var(--accent);
  border-color: var(--accent);
}

[data-theme="brutal"] .filter-btn {
  font-weight: 700;
  background: var(--bg-card);
  color: var(--text);
  box-shadow: 3px 3px 0 var(--border);
}

[data-theme="brutal"] .filter-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--border);
}

[data-theme="brutal"] .filter-btn.active {
  background: var(--accent);
  border-color: var(--border);
  color: #fff;
}

[data-theme="brutal"] .filter-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--border);
}

.search-wrap input {
  width: min(260px, 100%);
  padding: 0.5rem 1rem;
  font-family: var(--font);
  font-size: 0.875rem;
  color: var(--text);
  background: var(--bg-elevated);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-wrap input:focus {
  border-color: var(--accent);
}

[data-theme="brutal"] .search-wrap input {
  background: var(--bg-card);
  box-shadow: 3px 3px 0 var(--border);
}

[data-theme="brutal"] .search-wrap input:focus {
  border-color: var(--border);
  box-shadow: 5px 5px 0 var(--accent);
}

.search-wrap input::placeholder {
  color: var(--text-muted);
}

/* Sections */

.section-title {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.featured-section {
  margin-bottom: 2.5rem;
}

.featured-grid .project-card {
  border-color: var(--accent-dim);
  background: var(--card-featured-bg);
}

.featured-grid .project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--accent) 0%, transparent 50%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

[data-theme="brutal"] .featured-grid .project-card::before {
  display: none;
}

[data-theme="brutal"] .featured-grid .project-card {
  border-color: var(--border);
}

[data-theme="brutal"] .section-title {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  background: var(--accent);
  color: #fff;
  border: var(--border-width) solid var(--border);
  box-shadow: 3px 3px 0 var(--border);
}

/* Project grid */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius);
  box-shadow: none;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

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

[data-theme="brutal"] .project-card {
  box-shadow: var(--shadow);
}

[data-theme="brutal"] .project-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: var(--shadow-hover);
}

[data-theme="brutal"] .card-title {
  text-transform: uppercase;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.card-title-group {
  min-width: 0;
}

.card-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card-tagline {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--accent-secondary);
}

.card-badges {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.badge {
  padding: 0.15rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge-category {
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.badge-status-active { color: #3fb950; background: #3fb95018; }
.badge-status-development { color: #d29922; background: #d2992218; }
.badge-status-inactive { color: var(--text-muted); background: var(--bg-elevated); }
.badge-status-archived { color: #8b949e; background: #8b949e18; }
.badge-private { color: #a78bfa; background: #a78bfa18; }

[data-theme="brutal"] .badge {
  border: 2px solid var(--border);
  font-weight: 700;
}

[data-theme="brutal"] .badge-category {
  background: #fff;
  color: var(--text);
}

[data-theme="brutal"] .badge-status-active {
  color: var(--text);
  background: #b8f25a;
}

[data-theme="brutal"] .badge-status-development {
  color: var(--text);
  background: #ff9f1c;
}

[data-theme="brutal"] .badge-status-inactive,
[data-theme="brutal"] .badge-status-archived {
  color: var(--text);
  background: #d0d0d0;
}

[data-theme="brutal"] .badge-private {
  color: #fff;
  background: #0066ff;
}

.card-description {
  margin: 0;
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.card-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.stack-tag {
  padding: 0.2rem 0.55rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
}

[data-theme="brutal"] .stack-tag {
  border-width: 2px;
  border-radius: 0;
  color: var(--text);
  background: #fff;
}

.card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.7;
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: var(--border-width) solid var(--border);
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: var(--border-width) solid var(--border);
  transition: opacity 0.15s, border-color 0.15s, background 0.15s, transform 0.12s, box-shadow 0.12s;
}

[data-theme="brutal"] .link-btn {
  font-weight: 700;
  box-shadow: 2px 2px 0 var(--border);
}

[data-theme="brutal"] .link-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--border);
}

[data-theme="brutal"] .link-btn--github {
  background: #fff;
  color: var(--text);
}

[data-theme="brutal"] .link-btn--pages {
  background: #b8f25a;
  color: var(--text);
}

[data-theme="brutal"] .link-btn--itch {
  background: #ff3d71;
  color: #fff;
}

[data-theme="brutal"] .link-btn--vercel {
  background: #0a0a0a;
  color: #fff;
}

[data-theme="brutal"] .link-btn--local {
  background: #7afcff;
  color: var(--text);
}

[data-theme="brutal"] .link-btn--download {
  background: var(--accent);
  color: #fff;
  border-color: var(--border);
}

[data-theme="brutal"] .link-btn--disabled {
  box-shadow: none;
  opacity: 0.35;
}

.link-btn svg {
  width: 0.875rem;
  height: 0.875rem;
  fill: currentColor;
}

.link-btn--download {
  color: #04110f;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}
.link-btn--download:hover { background: #7ff5e0; border-color: #7ff5e0; }

.link-btn--github { color: var(--github); background: #21262d; }
.link-btn--github:hover { border-color: #484f58; }

.link-btn--pages { color: var(--pages); background: #3fb95012; }
.link-btn--pages:hover { border-color: var(--pages); }

.link-btn--itch { color: var(--itch); background: #fa5c5c12; }
.link-btn--itch:hover { border-color: var(--itch); }

.link-btn--vercel { color: var(--vercel); background: #ffffff0a; }
.link-btn--vercel:hover { border-color: #888; }

.link-btn--local { color: #79c0ff; background: #388bfd12; font-variant-numeric: tabular-nums; }
.link-btn--local:hover { border-color: #79c0ff; }

.link-btn--local.link-btn--pending {
  opacity: 0.55;
  border-style: dotted;
  cursor: wait;
}

.link-btn--local.link-btn--offline {
  color: var(--text-muted);
  background: transparent;
  opacity: 0.55;
  border-style: dashed;
  cursor: pointer;
}

.link-btn--local.link-btn--offline:hover {
  opacity: 0.85;
  border-color: var(--text-muted);
}

.link-btn--local.link-btn--online {
  color: #79c0ff;
  background: #388bfd18;
}

.link-btn--disabled {
  color: var(--text-muted);
  background: transparent;
  opacity: 0.35;
  pointer-events: none;
  cursor: default;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 3rem;
  text-align: center;
  color: var(--text-muted);
}

/* Footer */

.site-footer {
  margin-top: 4rem;
  padding: 2rem 0;
  border-top: var(--border-width) solid var(--border);
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

[data-theme="brutal"] .site-footer a {
  color: var(--text);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

/* —— Theme polish —— */

[data-theme="aero"] body {
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.85), transparent 35%),
    radial-gradient(circle at 80% 20%, rgba(255, 180, 220, 0.55), transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(80, 170, 255, 0.55), transparent 45%),
    linear-gradient(180deg, #c8ebff 0%, #7ec4ff 45%, #4aa8e8 100%);
}

[data-theme="aero"] .bg-grid {
  background-image:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.55) 0 18px, transparent 19px),
    radial-gradient(circle at 70% 55%, rgba(255, 255, 255, 0.35) 0 28px, transparent 29px),
    radial-gradient(circle at 15% 70%, rgba(255, 255, 255, 0.25) 0 14px, transparent 15px);
  background-size: auto;
  mask-image: none;
}

[data-theme="aero"] .project-card,
[data-theme="aero"] .header-link,
[data-theme="aero"] .stat-pill,
[data-theme="aero"] .theme-toggle,
[data-theme="aero"] .filter-btn,
[data-theme="aero"] .search-wrap input {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

[data-theme="aero"] .brand-name {
  filter: drop-shadow(0 2px 0 rgba(255, 255, 255, 0.8));
}

[data-theme="aero"] .featured-grid .project-card::before {
  display: none;
}

[data-theme="glass"] body {
  background:
    radial-gradient(ellipse 60% 50% at 15% 10%, rgba(100, 160, 255, 0.35), transparent 55%),
    radial-gradient(ellipse 50% 45% at 85% 20%, rgba(200, 140, 255, 0.28), transparent 50%),
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(56, 189, 248, 0.2), transparent 55%),
    #0e1424;
}

[data-theme="glass"] .bg-grid {
  opacity: 0.5;
}

[data-theme="glass"] .project-card,
[data-theme="glass"] .header-link,
[data-theme="glass"] .stat-pill,
[data-theme="glass"] .theme-toggle,
[data-theme="glass"] .filter-btn,
[data-theme="glass"] .search-wrap input,
[data-theme="glass"] .featured-grid .project-card {
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: var(--shadow);
}

[data-theme="glass"] .featured-grid .project-card::before {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.55), transparent 55%);
}

[data-theme="chrome"] body {
  background:
    radial-gradient(circle at 10% 0%, rgba(244, 114, 182, 0.35), transparent 35%),
    radial-gradient(circle at 90% 10%, rgba(34, 211, 238, 0.3), transparent 40%),
    linear-gradient(160deg, #12061f, #000 60%);
}

[data-theme="chrome"] .bg-grid {
  background-size: 24px 24px;
  mask-image: none;
  opacity: 0.7;
}

[data-theme="chrome"] .brand-name {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  filter: drop-shadow(0 0 10px rgba(34, 211, 238, 0.7));
}

[data-theme="chrome"] .project-card {
  background: linear-gradient(145deg, #2a1548, #12061f 60%, #001a33);
  box-shadow: var(--shadow);
}

[data-theme="chrome"] .featured-grid .project-card::before {
  display: none;
}

[data-theme="chrome"] .filter-btn.active,
[data-theme="chrome"] .link-btn--download {
  background: linear-gradient(90deg, #22d3ee, #f472b6);
  border-color: transparent;
  color: #12061f;
}

[data-theme="clay"] body {
  background:
    radial-gradient(circle at 20% 20%, #ffe0ef, transparent 40%),
    radial-gradient(circle at 80% 10%, #ddd6fe, transparent 35%),
    #efe6ff;
}

[data-theme="clay"] .bg-grid {
  opacity: 0.4;
}

[data-theme="clay"] .project-card,
[data-theme="clay"] .stat-pill,
[data-theme="clay"] .header-link,
[data-theme="clay"] .theme-toggle,
[data-theme="clay"] .filter-btn,
[data-theme="clay"] .search-wrap input {
  box-shadow: var(--shadow);
  border: none;
}

[data-theme="clay"] .project-card:hover {
  transform: translateY(-4px) scale(1.01);
}

[data-theme="clay"] .featured-grid .project-card::before {
  display: none;
}

[data-theme="clay"] .badge,
[data-theme="clay"] .stack-tag {
  border: none;
  box-shadow:
    4px 4px 10px rgba(140, 110, 180, 0.2),
    -3px -3px 8px rgba(255, 255, 255, 0.9);
}

[data-theme="terminal"] body {
  background: #020803;
  letter-spacing: 0.02em;
}

[data-theme="terminal"] body::after {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.18) 2px,
    rgba(0, 0, 0, 0.18) 4px
  );
  mix-blend-mode: multiply;
  opacity: 0.35;
}

[data-theme="terminal"] .bg-grid {
  background-size: 16px 16px;
  mask-image: none;
  opacity: 1;
}

[data-theme="terminal"] .brand-name {
  -webkit-text-fill-color: var(--text);
  background: none;
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(57, 255, 20, 0.65);
}

[data-theme="terminal"] .brand-eyebrow::before {
  content: "> ";
}

[data-theme="terminal"] .featured-grid .project-card::before {
  display: none;
}

[data-theme="terminal"] .project-card,
[data-theme="terminal"] .header-link,
[data-theme="terminal"] .stat-pill,
[data-theme="terminal"] .theme-toggle,
[data-theme="terminal"] .filter-btn,
[data-theme="terminal"] .search-wrap input,
[data-theme="terminal"] .link-btn {
  box-shadow: var(--shadow);
  background: #041008;
}

[data-theme="terminal"] .filter-btn.active,
[data-theme="terminal"] .link-btn--download {
  background: #39ff14;
  color: #020803;
  text-shadow: none;
}

[data-theme="terminal"] .badge-status-active,
[data-theme="terminal"] .link-btn--pages,
[data-theme="terminal"] .link-btn--itch,
[data-theme="terminal"] .link-btn--github,
[data-theme="terminal"] .link-btn--vercel,
[data-theme="terminal"] .link-btn--local {
  color: #39ff14;
  background: transparent;
}

[data-theme="lego"] body {
  background:
    radial-gradient(circle at 12% 8%, #ffe400 0 90px, transparent 91px),
    radial-gradient(circle at 88% 12%, #0055a5 0 70px, transparent 71px),
    radial-gradient(circle at 70% 85%, #e3000b 0 110px, transparent 111px),
    #f2f2f2;
}

[data-theme="lego"] .bg-grid {
  background-image: radial-gradient(circle, #1a1a1a 0 5px, transparent 6px);
  background-size: 28px 28px;
  background-position: 10px 10px;
  mask-image: none;
  opacity: 0.12;
}

[data-theme="lego"] .brand-name {
  -webkit-text-fill-color: var(--text);
  background: none;
  text-transform: uppercase;
  letter-spacing: -0.03em;
}

[data-theme="lego"] .brand-eyebrow {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  background: #0055a5;
  color: #fff;
  border: var(--border-width) solid var(--border);
  box-shadow: 3px 3px 0 var(--border);
}

[data-theme="lego"] .project-card,
[data-theme="lego"] .stat-pill,
[data-theme="lego"] .header-link,
[data-theme="lego"] .theme-toggle,
[data-theme="lego"] .filter-btn,
[data-theme="lego"] .search-wrap input,
[data-theme="lego"] .link-btn:not(.link-btn--disabled) {
  box-shadow: var(--shadow);
  position: relative;
}

[data-theme="lego"] .project-card::after {
  content: "";
  position: absolute;
  top: -10px;
  left: 14px;
  right: 14px;
  height: 14px;
  background-image: radial-gradient(circle, currentColor 0 6px, transparent 7px);
  background-size: 22px 14px;
  background-repeat: repeat-x;
  background-position: left center;
  color: inherit;
  opacity: 0.95;
  filter: brightness(0.92);
  pointer-events: none;
}

[data-theme="lego"] .project-card {
  margin-top: 10px;
  padding-top: 1.4rem;
  background: #ffe400;
}

[data-theme="lego"] .featured-grid .project-card {
  background: #e3000b;
  color: #fff;
}

[data-theme="lego"] .featured-grid .project-card .card-tagline,
[data-theme="lego"] .featured-grid .project-card .card-description,
[data-theme="lego"] .featured-grid .project-card .card-meta {
  color: rgba(255, 255, 255, 0.88);
}

[data-theme="lego"] .featured-grid .project-card .stack-tag {
  background: #fff;
  color: #1a1a1a;
  border-color: #1a1a1a;
}

[data-theme="lego"] .featured-grid .project-card::before {
  display: none;
}

[data-theme="lego"] .project-card:nth-child(3n + 2) {
  background: #0055a5;
  color: #fff;
}

[data-theme="lego"] .project-card:nth-child(3n + 2) .card-tagline,
[data-theme="lego"] .project-card:nth-child(3n + 2) .card-description,
[data-theme="lego"] .project-card:nth-child(3n + 2) .card-meta {
  color: rgba(255, 255, 255, 0.88);
}

[data-theme="lego"] .project-card:nth-child(3n + 2) .stack-tag {
  background: #fff;
  color: #1a1a1a;
}

[data-theme="lego"] .project-card:nth-child(3n) {
  background: #00af4d;
}

[data-theme="lego"] .project-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: var(--shadow-hover);
}

[data-theme="lego"] .stat-pill:nth-child(1) { background: #ffe400; }
[data-theme="lego"] .stat-pill:nth-child(2) { background: #e3000b; color: #fff; }
[data-theme="lego"] .stat-pill:nth-child(2) .stat-value,
[data-theme="lego"] .stat-pill:nth-child(2) .stat-label { color: #fff; }
[data-theme="lego"] .stat-pill:nth-child(3) { background: #0055a5; color: #fff; }
[data-theme="lego"] .stat-pill:nth-child(3) .stat-value,
[data-theme="lego"] .stat-pill:nth-child(3) .stat-label { color: #fff; }
[data-theme="lego"] .stat-pill:nth-child(4) { background: #00af4d; }

[data-theme="lego"] .stat-value {
  color: var(--text);
}

[data-theme="lego"] .filter-btn {
  background: #fff;
  font-weight: 700;
}

[data-theme="lego"] .filter-btn.active {
  background: #e3000b;
  border-color: #1a1a1a;
  color: #fff;
}

[data-theme="lego"] .badge {
  border: 2px solid #1a1a1a;
  font-weight: 700;
  background: #fff;
  color: #1a1a1a;
}

[data-theme="lego"] .badge-status-active {
  background: #00af4d;
  color: #fff;
}

[data-theme="lego"] .link-btn--github { background: #fff; color: #1a1a1a; }
[data-theme="lego"] .link-btn--pages { background: #00af4d; color: #fff; }
[data-theme="lego"] .link-btn--itch { background: #e3000b; color: #fff; }
[data-theme="lego"] .link-btn--vercel { background: #1a1a1a; color: #fff; }
[data-theme="lego"] .link-btn--local { background: #0055a5; color: #fff; }
[data-theme="lego"] .link-btn--download { background: #e3000b; color: #fff; border-color: #1a1a1a; }

[data-theme="lego"] .theme-toggle__thumb {
  border-radius: 2px;
}

@media (max-width: 600px) {
  .project-grid {
    grid-template-columns: 1fr;
  }

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

  .search-wrap input {
    width: 100%;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }
}
