/* ── Design tokens ─────────────────────────────────────────────── */
:root {
  --bg: #fafbfc;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3f4f6;
  --surface-3: #e9eaee;
  --border: #e2e4e9;
  --border-strong: #d0d3da;
  --text: #0f1216;
  --text-secondary: #3d4450;
  --muted: #5f6673;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff6ff;
  --accent-glow: rgb(37 99 235 / 0.15);
  --violet: #7c3aed;
  --good: #047857;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-xs: 0 1px 2px rgb(0 0 0 / 0.04);
  --shadow-sm: 0 1px 3px rgb(0 0 0 / 0.06), 0 4px 12px rgb(0 0 0 / 0.04);
  --shadow-md: 0 4px 6px rgb(0 0 0 / 0.04), 0 10px 24px rgb(0 0 0 / 0.06);
  --shadow-lg: 0 8px 16px rgb(0 0 0 / 0.06), 0 24px 48px rgb(0 0 0 / 0.08);
  --shadow-glow: 0 0 0 3px var(--accent-glow);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "SF Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --grain-opacity: 0.04;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0c10;
    --bg-elevated: #12151b;
    --surface: #161a22;
    --surface-2: #1e232d;
    --surface-3: #272d39;
    --border: #2a3040;
    --border-strong: #3a4155;
    --text: #f0f2f5;
    --text-secondary: #c4c9d4;
    --muted: #8b92a5;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-soft: rgb(59 130 246 / 0.12);
    --accent-glow: rgb(59 130 246 / 0.25);
    --good: #34d399;
    --shadow-xs: 0 1px 2px rgb(0 0 0 / 0.2);
    --shadow-sm: 0 1px 3px rgb(0 0 0 / 0.3), 0 4px 12px rgb(0 0 0 / 0.2);
    --shadow-md: 0 4px 6px rgb(0 0 0 / 0.25), 0 10px 24px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 8px 16px rgb(0 0 0 / 0.3), 0 24px 48px rgb(0 0 0 / 0.35);
    --grain-opacity: 0.05;
    color-scheme: dark;
  }
}

/* ── Base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
/* An element with the hidden attribute stays hidden even when a class sets display. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
html, body { margin: 0; padding: 0; }
body {
  font: 15.5px/1.6 var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--accent-hover); }
::selection { background: var(--accent-soft); color: var(--text); }

/* Ambient page-wide gradient wash */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(ellipse 80% 50% at 15% -10%, var(--accent-glow), transparent 55%),
    radial-gradient(ellipse 55% 40% at 90% 110%, color-mix(in srgb, var(--violet) 12%, transparent), transparent 55%),
    var(--bg);
  pointer-events: none;
}

/* Optional grain / noise texture overlay */
.grain {
  position: fixed; inset: 0; z-index: 9999;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 140px 140px;
}

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff;
  padding: 10px 14px; border-radius: 0 0 10px 0; z-index: 10000;
  font-weight: 600;
}
.skip:focus { left: 0; }

button, .btn {
  font: inherit; cursor: pointer; outline: none;
  transition: all 0.25s var(--ease);
}
:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* ── Hero ──────────────────────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(56px, 9vw, 96px) 0 clamp(40px, 6vw, 64px);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
}
.hero-inner { position: relative; z-index: 1; }

/* Animated gradient mesh */
.mesh { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.blob {
  position: absolute; border-radius: 50%;
  filter: blur(72px); opacity: 0.55;
  will-change: transform;
}
.b1 {
  width: clamp(280px, 45vw, 520px); height: clamp(280px, 45vw, 520px);
  top: -30%; left: -8%;
  background: radial-gradient(circle, rgb(37 99 235 / 0.45), transparent 68%);
  animation: drift1 17s ease-in-out infinite alternate;
}
.b2 {
  width: clamp(240px, 40vw, 460px); height: clamp(240px, 40vw, 460px);
  top: -18%; right: -6%;
  background: radial-gradient(circle, rgb(124 58 237 / 0.38), transparent 68%);
  animation: drift2 21s ease-in-out infinite alternate;
}
.b3 {
  width: clamp(220px, 36vw, 420px); height: clamp(220px, 36vw, 420px);
  bottom: -34%; left: 28%;
  background: radial-gradient(circle, rgb(6 182 212 / 0.3), transparent 68%);
  animation: drift3 19s ease-in-out infinite alternate;
}
.b4 {
  width: clamp(180px, 30vw, 360px); height: clamp(180px, 30vw, 360px);
  bottom: -24%; right: 12%;
  background: radial-gradient(circle, rgb(59 130 246 / 0.32), transparent 68%);
  animation: drift1 23s ease-in-out infinite alternate-reverse;
}
@keyframes drift1 {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(70px, 46px) scale(1.14); }
}
@keyframes drift2 {
  from { transform: translate(0, 0) scale(1.05); }
  to { transform: translate(-60px, 54px) scale(0.94); }
}
@keyframes drift3 {
  from { transform: translate(0, 0) scale(0.96); }
  to { transform: translate(48px, -42px) scale(1.12); }
}

/* Hero entrance choreography */
.hero .wrap > * { animation: fadeUp 0.7s var(--ease) backwards; }
.hero .eyebrow { animation-delay: 0.05s; }
.hero h1 { animation-delay: 0.13s; }
.hero .tagline { animation-delay: 0.22s; }
.hero .intro { animation-delay: 0.3s; }
.hero .links { animation-delay: 0.38s; }
.hero .stats { animation-delay: 0.5s; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 14px; padding: 6px 14px;
  text-transform: uppercase; letter-spacing: 0.12em;
  font-size: 11.5px; font-weight: 700; color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 80%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: 999px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  animation: pulse 2.2s ease-in-out infinite;
}
.hero h1 {
  margin: 0;
  font-size: clamp(38px, 7.5vw, 64px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero h1 {
    background: linear-gradient(105deg, var(--text) 25%, var(--accent) 72%, var(--violet) 105%);
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
  }
}
.tagline {
  margin: 16px 0 0;
  font-size: clamp(17px, 2.8vw, 21px);
  font-weight: 500;
  color: var(--text-secondary);
  max-width: 60ch;
  letter-spacing: -0.01em;
}
.intro { margin: 12px 0 0; color: var(--muted); max-width: 64ch; }

.links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 12px;
  border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 85%, transparent);
  color: var(--text); text-decoration: none; font-size: 14.5px; font-weight: 600;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-xs);
}
.btn:hover {
  background: var(--surface-2); border-color: var(--border-strong);
  transform: translateY(-2px); box-shadow: var(--shadow-sm);
  color: var(--text);
}
.btn:active { transform: translateY(0) scale(0.98); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 62%, var(--violet)));
  color: #fff; border-color: transparent;
  box-shadow: 0 2px 10px var(--accent-glow), inset 0 1px 0 rgb(255 255 255 / 0.18);
}
.btn.primary:hover {
  color: #fff; filter: brightness(1.07);
  box-shadow: 0 6px 22px var(--accent-glow), inset 0 1px 0 rgb(255 255 255 / 0.22);
  transform: translateY(-2px);
}

/* Stat tiles with count-up numbers */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 34px 0 0;
  max-width: 620px;
}
.stat {
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  min-width: 0;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}
@media (hover: hover) {
  .stat:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
    box-shadow: var(--shadow-md), 0 8px 24px var(--accent-glow);
  }
}
.stat dt {
  font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700;
}
.stat dd { margin: 4px 0 0; }
.stat-num {
  font-size: 28px; font-weight: 800; letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .stat-num {
    background: linear-gradient(120deg, var(--text) 20%, var(--accent) 90%);
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
  }
}
.stat-sub {
  margin: 3px 0 0; font-size: 12px; color: var(--muted);
  line-height: 1.45; word-break: break-word;
}

/* ── Controls / filter panel ───────────────────────────────────── */
main { padding: 32px 0 8px; }

.controls {
  display: grid; gap: 16px;
  margin-bottom: 20px;
  padding: 18px 20px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.search label {
  display: block; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin-bottom: 7px;
}
.search-field { position: relative; }
.search input {
  width: 100%; min-width: 0;
  padding: 12px 44px 12px 42px;
  font: inherit; color: var(--text);
  border: 1.5px solid var(--border); border-radius: 12px;
  background: var(--surface);
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 14px center;
  background-size: 16px 16px;
  transition: border-color 0.25s var(--ease), box-shadow 0.35s var(--ease), background-color 0.25s var(--ease);
}
@media (prefers-color-scheme: dark) {
  .search input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b92a5' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
  }
}
.search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.search input::placeholder { color: var(--muted); opacity: 0.75; }
.search input:hover { border-color: var(--border-strong); }
.search input:focus {
  outline: none;
  border-color: var(--accent);
  background-color: var(--bg-elevated);
  box-shadow: var(--shadow-glow), 0 4px 18px var(--accent-glow);
}
.search input:focus-visible { outline: none; }
.kbd {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  font: 600 11px/1 var(--mono);
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 7px;
  pointer-events: none;
  opacity: 0.85;
  transition: opacity 0.25s var(--ease);
}
.search-field:focus-within .kbd { opacity: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit; font-size: 13.5px; font-weight: 600;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-secondary);
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
    border-color 0.25s var(--ease), transform 0.25s var(--ease-bounce),
    box-shadow 0.25s var(--ease);
}
.chip .n {
  color: var(--muted); font-variant-numeric: tabular-nums;
  font-weight: 700; font-size: 12px;
  transition: color 0.25s var(--ease), opacity 0.25s var(--ease);
}
.chip:hover {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  color: var(--accent);
  transform: translateY(-1px);
}
.chip:hover .n { color: var(--accent); }
.chip:active { transform: scale(0.96); }
.chip[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 62%, var(--violet)));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 12px var(--accent-glow), inset 0 1px 0 rgb(255 255 255 / 0.16);
}
.chip[aria-pressed="true"] .n { color: inherit; opacity: 0.8; }
.chip[aria-pressed="true"]:hover {
  filter: brightness(1.06);
  color: #fff;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 62%, var(--violet)));
}

.count {
  margin: 0 0 16px; color: var(--muted);
  font-size: 12.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
}

/* ── Project cards ─────────────────────────────────────────────── */
.cards {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  view-transition-name: projects;
}
.card {
  position: relative;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 22px 20px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
  display: flex; flex-direction: column; gap: 11px;
  overflow: hidden;
  animation: cardIn 0.55s var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 45ms);
  transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease),
    border-color 0.3s var(--ease);
}
.card::before {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--violet), transparent);
  opacity: 0; transition: opacity 0.35s var(--ease);
}
@media (hover: hover) {
  .card:hover {
    transform: translateY(-5px);
    border-color: color-mix(in srgb, var(--accent) 32%, var(--border));
    box-shadow: var(--shadow-lg), 0 14px 40px var(--accent-glow);
  }
  .card:hover::before { opacity: 1; }
}
/* No flex-wrap here: the language pill stays pinned to the top right whatever the
   title's length, instead of dropping to a second line only on the long ones. */
.card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card header h2 { flex: 1 1 auto; min-width: 0; }
.card header .lang { flex: 0 0 auto; margin-top: 2px; }
.card h2 {
  margin: 0; font-size: 17.5px; font-weight: 700;
  letter-spacing: -0.015em; line-height: 1.3;
}
.lang {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em;
  padding: 4px 10px; border-radius: 999px;
  white-space: nowrap;
  color: var(--lang-color, var(--accent));
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--lang-color, var(--accent)) 17%, transparent),
    color-mix(in srgb, var(--lang-color, var(--accent)) 6%, transparent));
  border: 1px solid color-mix(in srgb, var(--lang-color, var(--accent)) 30%, transparent);
}
.card .summary { margin: 0; color: var(--muted); font-size: 14.5px; }
.card ul.points {
  margin: 0; padding-left: 18px;
  display: grid; gap: 6px; font-size: 14px;
  color: var(--text-secondary);
}
.card ul.points li::marker { color: var(--accent); }
.card ul.points li { padding-left: 2px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tags li {
  font: 500 11.5px/1 var(--mono);
  padding: 5px 9px; border-radius: 7px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
@media (hover: hover) {
  .tags li:hover {
    background: var(--accent-soft); color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
  }
}
.card .actions {
  margin-top: auto; padding-top: 10px;
  display: flex; flex-wrap: wrap; gap: 8px;
  border-top: 1px solid var(--border);
}
.card .actions a { font-size: 13.5px; padding: 8px 15px; border-radius: 10px; }
.card .meta {
  margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.card .meta img.ci { height: 20px; width: auto; max-width: 100%; }

.empty { color: var(--muted); padding: 8px 0 16px; }
.linkish {
  font: inherit; color: var(--accent); background: none;
  border: 0; padding: 0; cursor: pointer; text-decoration: underline;
  text-underline-offset: 3px; font-weight: 600;
  transition: color 0.2s var(--ease);
}
.linkish:hover { color: var(--accent-hover); }

mark {
  background: linear-gradient(180deg, transparent 52%, color-mix(in srgb, var(--accent) 38%, transparent) 52%);
  color: inherit; border-radius: 2px; padding: 0 1px;
  font-weight: 600;
}

/* ── Footer ────────────────────────────────────────────────────── */
.foot {
  position: relative;
  margin-top: 56px; padding: 36px 20px 56px;
  color: var(--muted); font-size: 13.5px;
  text-align: center; letter-spacing: 0.01em;
}
.foot::before {
  content: "";
  position: absolute; top: 0; left: 50%;
  transform: translateX(-50%);
  width: min(340px, 70%); height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--violet), transparent);
  opacity: 0.55;
}
.foot p { margin: 0; }
.foot a {
  color: var(--text-secondary); font-weight: 600;
  text-underline-offset: 3px;
}
.foot a:hover { color: var(--accent); text-decoration: underline; }

/* ── Animations ────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* View Transitions on filter changes */
::view-transition-old(projects),
::view-transition-new(projects) {
  animation-duration: 0.4s;
  animation-timing-function: var(--ease);
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.3s;
  animation-timing-function: var(--ease);
}

/* ── Reduced motion ────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .controls { padding: 16px; }
  .stats { max-width: none; }
}
@media (max-width: 480px) {
  .hero { padding: 40px 0 32px; }
  .cards { grid-template-columns: 1fr; }
  .stats { gap: 10px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
  .stat { padding: 12px 14px; }
  .stat-num { font-size: 24px; }
  .blob { filter: blur(52px); opacity: 0.5; }
  .card { padding: 18px 18px 16px; }
  .links .btn { flex: 1 1 auto; }
}
@media (max-width: 380px) {
  .wrap { padding: 0 16px; }
  .controls { padding: 14px; border-radius: var(--radius); }
  .chip { font-size: 13px; padding: 6px 12px; }
  .eyebrow { font-size: 10.5px; padding: 5px 12px; }
}

/* a still of each demo's 3D header across the top of its card */
.card .shot { display: block; margin: -22px -22px 16px; aspect-ratio: 640 / 260; overflow: hidden; border-radius: var(--radius-lg) var(--radius-lg) 0 0; border-bottom: 1px solid var(--border); background: #0b0d12; }
.card .shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; transform: scale(1.001); transition: transform .7s var(--ease), filter .5s var(--ease); }
@media (hover: hover) { .card:hover .shot img { transform: scale(1.05); } }
@media (prefers-reduced-motion: reduce) { .card .shot img { transition: none; } .card:hover .shot img { transform: none; } }

/* ── Category colours (scripts/palette.js) ─────────────────────── */
.card, .chip .dot { --cat: var(--c-l, var(--accent)); }
@media (prefers-color-scheme: dark) { .card, .chip .dot { --cat: var(--c-d, var(--accent)); } }
.card::before { background: linear-gradient(90deg, transparent, var(--cat), var(--violet), transparent); }
.card .cat {
  margin: 0; display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted);
}
.card .cat::before, .chip .dot {
  content: ""; flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%;
  background: var(--cat); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cat) 20%, transparent);
}
.chip .dot { display: inline-block; margin-right: 7px; vertical-align: 1px; }
@media (prefers-color-scheme: dark) {
  .card .cat::before, .chip .dot { box-shadow: 0 0 10px color-mix(in srgb, var(--cat) 70%, transparent); }
}
/* a missing CI badge (offline, blocked) no longer shifts the cards below it */
.card .meta { min-height: 20px; }

/* ── Hero 3D (scripts/orbit.js) ────────────────────────────────── */
.hero-3d { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 1.4s var(--ease); }
.hero-3d.on { opacity: 1; }
.hero.orbit-top { padding-top: calc(clamp(56px, 9vw, 96px) + 240px); }
.hero-3d canvas { display: block; width: 100% !important; height: 100% !important; }
.hero.orbit-hover, .hero.orbit-hover .hero-inner { cursor: pointer; }
.orbit-tip {
  --c: var(--accent);
  position: absolute; z-index: 3; left: 0; top: 0; pointer-events: none;
  max-width: 280px; padding: 9px 13px 10px; border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid color-mix(in srgb, var(--c) 45%, var(--border));
  box-shadow: var(--shadow-md), 0 0 28px color-mix(in srgb, var(--c) 25%, transparent);
  color: var(--text); font-size: 13px; line-height: 1.35; white-space: nowrap;
  opacity: 0; transform: translate(-50%, calc(-100% - 10px)) scale(0.96);
  transition: opacity 0.16s ease, transform 0.22s var(--ease);
}
.orbit-tip.on { opacity: 1; transform: translate(-50%, calc(-100% - 18px)) scale(1); }
.orbit-tip b { display: block; font-weight: 700; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; }
.orbit-tip span { display: flex; align-items: center; gap: 7px; margin-top: 2px; color: var(--muted); font-size: 12px; }
.orbit-tip span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.orbit-tip small { display: block; margin-top: 5px; color: var(--c); font-size: 11.5px; font-weight: 600; }
.orbit-key {
  position: absolute; z-index: 2; bottom: 22px; left: 75%; width: 380px;
  transform: translateX(-50%); text-align: center;
  opacity: 0; transition: opacity 0.9s var(--ease) 0.5s;
}
.orbit-key.on { opacity: 1; }
.orbit-key p { margin: 0 0 9px; color: var(--muted); font-size: 12px; line-height: 1.45; text-wrap: balance; }
.orbit-cats { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.orbit-cats button {
  --c: var(--accent);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 8px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-secondary);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-size: 12px; font-weight: 600; line-height: 1.4;
}
.orbit-cats button i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.orbit-cats button span { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.orbit-cats button:hover, .orbit-cats button:focus-visible { border-color: var(--c); color: var(--text); }
.orbit-cats button[aria-pressed="true"] { border-color: var(--c); color: var(--text); background: color-mix(in srgb, var(--c) 16%, var(--surface)); }
@media (prefers-reduced-motion: reduce) { .hero-3d, .orbit-tip, .orbit-key { transition: none; } }
@media print { .hero-3d, .orbit-tip, .orbit-key { display: none; } }

/* the result count, with a way back to the full list when filtered */
.count-row { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.count-row .count { margin-bottom: 0; }
.count-row { margin-bottom: 14px; }
