:root {
  --bg: #1a1a1a;
  --panel: #101010;
  --panel-2: #202020;
  --line: #383838;
  --text: #f3f1ed;
  --muted: #888;
  --red: #ff4377;
  --red-soft: rgba(255, 67, 119, .13);
  --mouse-x: 75vw;
  --mouse-y: 15vh;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --shell: min(1240px, calc(100vw - 64px));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 28px; background: var(--bg); }
body { margin: 0; overflow-x: hidden; background: var(--bg); color: var(--text); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
body::before {
  position: fixed; inset: 0; z-index: -2; content: ""; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 32px 32px;
}
body::after {
  position: fixed; inset: 0; z-index: -1; content: ""; pointer-events: none;
  background: radial-gradient(450px circle at var(--mouse-x) var(--mouse-y), rgba(255,67,119,.065), transparent 70%);
}
::selection { background: var(--red); color: white; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input { font: inherit; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }
.shell { width: var(--shell); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 100; top: 10px; left: 10px; padding: 10px 14px; background: var(--red); color: white; font: 700 11px var(--mono); transform: translateY(-150%); }
.skip-link:focus { transform: none; }

.projects-page { padding-block: 48px 110px; }

.featured-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; }
.featured-card { position: relative; overflow: hidden; grid-column: span 6; display: flex; flex-direction: column; border: 1px solid var(--line); background: var(--panel); transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.featured-full { grid-column: span 12; }
.featured-wide { grid-column: span 7; }
.featured-narrow { grid-column: span 5; }
.featured-card:hover { z-index: 1; border-color: var(--red); transform: translate(-3px,-3px); box-shadow: 8px 8px 0 var(--red-soft); }
.card-image { position: relative; height: 350px; display: block; overflow: hidden; border-top: 1px solid var(--line); background: #090909; }
.featured-half .card-image { height: 300px; }
.card-image::after, .project-image::after { position: absolute; inset: 0; content: ""; pointer-events: none; opacity: .12; background: repeating-linear-gradient(to bottom, transparent 0 3px, #000 4px); }
.card-image img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.8); transition: transform .45s cubic-bezier(.2,.7,.2,1), filter .2s ease; }
.featured-full .card-image { height: clamp(360px, 43.7vw, 546px); }
.card-image img.airgapper-art, .project-image img.airgapper-art { object-fit: contain; }
.featured-wide .card-image img { object-position: center 25%; }
.featured-card:hover img { transform: scale(1.025); filter: saturate(1); }
.featured-info { order: -1; min-height: 44px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: #202020; }
.featured-info h2 { margin: 0; overflow: hidden; font: 600 12px/1 var(--mono); white-space: nowrap; text-overflow: ellipsis; }
.featured-info h2 a { text-decoration: none; }
.featured-info p { margin: 0; color: #777; font: 9px var(--mono); }

.project-tools { margin-block: 22px; padding: 9px 12px; display: flex; align-items: center; justify-content: space-between; gap: 14px; background: var(--panel); cursor: text; }
.search { width: auto; min-width: 0; height: 34px; display: flex; flex: 1 1 auto; align-items: center; gap: 9px; color: var(--red); font: 11px var(--mono); cursor: text; }
.search input { min-width: 0; height: 100%; flex: 1; overflow: hidden; border: 0; outline: 0; background: transparent; color: var(--text); font: 10px var(--mono); text-overflow: ellipsis; cursor: text; }
.search input::placeholder { color: #555; }
.filters { display: flex; flex: 0 0 auto; gap: 2px; cursor: default; }
.filter { min-height: 30px; padding: 0 8px; border: 0; background: transparent; color: #6f6f6f; cursor: pointer; font: 9px var(--mono); }
.filter::before { content: "--"; color: #484848; }
.filter:hover { color: var(--text); }
.filter.is-active { background: var(--red-soft); color: var(--red); }

.project-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.project-card { min-width: 0; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); background: var(--panel); color: var(--text); text-decoration: none; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.project-card:hover { z-index: 1; border-color: var(--red); transform: translate(-3px,-3px); box-shadow: 7px 7px 0 var(--red-soft); }
.project-card[hidden] { display: none; }
.project-image { position: relative; aspect-ratio: 16 / 10; display: block; overflow: hidden; border-top: 1px solid var(--line); background: #090909; }
.project-image img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.68) contrast(1.02); transition: transform .4s cubic-bezier(.2,.7,.2,1), filter .2s ease; }
.project-card:hover .project-image img { transform: scale(1.035); filter: saturate(1); }
.project-info { order: -1; min-height: 40px; padding: 0 13px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; background: #202020; }
.project-info strong { overflow: hidden; font: 600 11px/1 var(--mono); white-space: nowrap; text-overflow: ellipsis; }
.project-info small { color: #777; font: 9px var(--mono); }
.empty-state { margin: 30px 0 0; color: var(--muted); font: 11px var(--mono); }

.site-footer { border-top: 1px solid var(--line); background: #101010; }
.footer-main { min-height: 112px; padding-block: 28px; display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.footer-code { width: max-content; color: var(--text); text-decoration: none; font: 700 clamp(26px, 3.4vw, 44px)/1 var(--mono); letter-spacing: -.08em; }
.footer-code span { color: var(--red); }
.footer-code i { display: inline-block; width: .065em; height: .82em; margin-left: .07em; vertical-align: -.06em; background: var(--red); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.footer-links { display: flex; align-items: center; justify-content: space-between; color: #666; font: 10px var(--mono); }
.footer-links nav { display: flex; gap: 24px; }
.footer-links nav a { color: #777; text-decoration: none; }
.footer-links nav a:hover { color: var(--red); }

.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .55s ease, transform .55s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }
.project-grid .reveal:nth-child(3n+2) { transition-delay: .04s; }
.project-grid .reveal:nth-child(3n) { transition-delay: .08s; }

@media (max-width: 960px) {
  :root { --shell: min(760px, calc(100vw - 40px)); }
  .featured-full, .featured-wide, .featured-narrow, .featured-half { grid-column: span 12; }
  .card-image, .featured-half .card-image { height: clamp(290px, 55vw, 430px); }
  .project-grid { grid-template-columns: repeat(2, 1fr); }
  .project-tools { width: 100%; justify-content: space-between; }
  .project-grid .reveal:nth-child(n) { transition-delay: 0s; }
}

@media (max-width: 620px) {
  :root { --shell: calc(100vw - 32px); }
  body::after { display: none; }
  .projects-page { padding-block: 16px 80px; }
  .featured-grid { gap: 14px; }
  .card-image, .featured-half .card-image { height: 235px; }
  .featured-info { min-height: 42px; padding: 0 12px; }
  .featured-info h2 { font-size: 11px; }
  .project-tools { align-items: flex-start; flex-direction: column; gap: 8px; }
  .search { width: 100%; min-width: 0; }
  .filters { overflow-x: auto; }
  .filter { flex: 1 0 auto; }
  .project-grid { grid-template-columns: 1fr; gap: 14px; }
  .project-image { aspect-ratio: 16 / 9; }
  .project-info { min-height: 40px; }
  .footer-main { min-height: 96px; padding-block: 22px; gap: 16px; }
  .footer-code { font-size: 7.2vw; }
  .footer-links nav { gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .footer-code i { animation-duration: 1s !important; animation-iteration-count: infinite !important; }
}
