/* ==========================================================================
   Asma Hachaichi — portfolio
   Plain CSS, no build step. Sections:
   1. Tokens   2. Base   3. Layout and shared pieces   4. Navigation
   5. Hero     6. Flagship (datalint-mcp)   7. Cards and sections
   8. Project pages   9. Motion   10. Reduced motion and print
   ========================================================================== */

/* Fonts: two open-source variable fonts stored in the repo (licences alongside
   them in assets/fonts). Latin subset only; other characters use the fallbacks. */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/space-grotesk-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* 1. Tokens ----------------------------------------------------------------
   Two themes. Dark is the default look; light applies when the visitor's
   system asks for it, or when they pick it with the switch in the menu
   (which sets data-theme on <html>).

   Colours that are also used translucently have a "-rgb" twin holding the
   bare channels, used as rgba(var(--violet-rgb), 0.2).

   The hero terminal and the screenshot viewer stay dark in both themes, so
   they are listed next to :root and always get the dark values. */
:root {
  --radius: 18px;
  --radius-sm: 10px;
  --wrap: 1160px;
  --gutter: clamp(20px, 5vw, 40px);
  --nav-h: 64px;

  --font-display: "Space Grotesk", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Dark theme */
:root,
.term,
.lightbox {
  --bg: #07061a;
  --navy: #0f0c29;
  --violet: #8b5cf6;
  --accent: #a78bfa;
  --accent-soft: #c4b5fd;
  --mint: #5eead4;
  --amber: #fcd34d;
  --text: #edecfb;
  --text-strong: #fff;
  --muted: #b7b4d6;
  --dim: #9390b8;
  --on-accent: #fff;

  --violet-rgb: 139, 92, 246;
  --glow-rgb: 139, 92, 246;
  --accent-rgb: 167, 139, 250;
  --accent-soft-rgb: 196, 181, 253;
  --indigo-rgb: 48, 43, 99;
  --mint-rgb: 94, 234, 212;
  --amber-rgb: 252, 211, 77;
  --ink-rgb: 7, 6, 26;
  --tint-rgb: 255, 255, 255;

  --line: rgba(var(--accent-rgb), 0.16);
  --line-strong: rgba(var(--accent-rgb), 0.4);
  --surface: rgba(var(--tint-rgb), 0.035);
  --surface-2: rgba(var(--tint-rgb), 0.065);
  --card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.018));
  --panel-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  --panel-solid: #0c0a25;
  --card-shadow: none;
  --btn-from: #7340ee; /* white text on both ends is at least 4.5:1 */
  --btn-to: #8455f3;
  --grad-from: #fff;
  --selection-bg: rgba(139, 92, 246, 0.5);
  --selection-text: #fff;

  /* Read by the hero animation in site.js. */
  --canvas-line-rgb: 167, 139, 250;
  --canvas-pointer-rgb: 196, 181, 253;
  --canvas-node-rgb: 196, 181, 253;
  --canvas-node-alpha: 0.75;
  --canvas-pulse-core-rgb: 237, 233, 254;
  --canvas-pulse-rgb: 167, 139, 250;

  color-scheme: dark;
}

/* Light theme. The same values appear twice because plain CSS cannot share a
   block between a media query and a selector: once for "the system asks for
   light and the visitor has not chosen dark", once for "the visitor chose
   light". Keep the two blocks identical. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f4fd;
    --navy: #ebe6fb;
    --violet: #7c3aed;
    --accent: #6d28d9;
    --accent-soft: #5b21b6;
    --mint: #0f766e;
    --amber: #92400e;
    --text: #1a1638;
    --text-strong: #0f0c29;
    --muted: #4a4668;
    --dim: #625e80;
    --on-accent: #fff;

    --violet-rgb: 124, 58, 237;
    --glow-rgb: 167, 139, 250;
    --accent-rgb: 109, 40, 217;
    --accent-soft-rgb: 91, 33, 182;
    --indigo-rgb: 221, 214, 254;
    --mint-rgb: 15, 118, 110;
    --amber-rgb: 180, 83, 9;
    --ink-rgb: 243, 240, 253;
    --tint-rgb: 109, 40, 217;

    --line: rgba(var(--accent-rgb), 0.18);
    --line-strong: rgba(var(--accent-rgb), 0.42);
    --surface: rgba(var(--tint-rgb), 0.04);
    --surface-2: rgba(var(--tint-rgb), 0.08);
    --card-bg: #fff;
    --panel-bg: #fff;
    --panel-solid: #fff;
    --card-shadow: 0 1px 2px rgba(26, 22, 56, 0.05), 0 12px 32px -20px rgba(26, 22, 56, 0.28);
    --btn-from: #6d28d9;
    --btn-to: #7c3aed;
    --grad-from: #1a1638;
    --selection-bg: rgba(124, 58, 237, 0.22);
    --selection-text: #0f0c29;

    --canvas-line-rgb: 109, 40, 217;
    --canvas-pointer-rgb: 124, 58, 237;
    --canvas-node-rgb: 124, 58, 237;
    --canvas-node-alpha: 0.5;
    --canvas-pulse-core-rgb: 109, 40, 217;
    --canvas-pulse-rgb: 167, 139, 250;

    color-scheme: light;
  }
}

:root[data-theme="light"] {
  --bg: #f6f4fd;
  --navy: #ebe6fb;
  --violet: #7c3aed;
  --accent: #6d28d9;
  --accent-soft: #5b21b6;
  --mint: #0f766e;
  --amber: #92400e;
  --text: #1a1638;
  --text-strong: #0f0c29;
  --muted: #4a4668;
  --dim: #625e80;
  --on-accent: #fff;

  --violet-rgb: 124, 58, 237;
  --glow-rgb: 167, 139, 250;
  --accent-rgb: 109, 40, 217;
  --accent-soft-rgb: 91, 33, 182;
  --indigo-rgb: 221, 214, 254;
  --mint-rgb: 15, 118, 110;
  --amber-rgb: 180, 83, 9;
  --ink-rgb: 243, 240, 253;
  --tint-rgb: 109, 40, 217;

  --line: rgba(var(--accent-rgb), 0.18);
  --line-strong: rgba(var(--accent-rgb), 0.42);
  --surface: rgba(var(--tint-rgb), 0.04);
  --surface-2: rgba(var(--tint-rgb), 0.08);
  --card-bg: #fff;
  --panel-bg: #fff;
  --panel-solid: #fff;
  --card-shadow: 0 1px 2px rgba(26, 22, 56, 0.05), 0 12px 32px -20px rgba(26, 22, 56, 0.28);
  --btn-from: #6d28d9;
  --btn-to: #7c3aed;
  --grad-from: #1a1638;
  --selection-bg: rgba(124, 58, 237, 0.22);
  --selection-text: #0f0c29;

  --canvas-line-rgb: 109, 40, 217;
  --canvas-pointer-rgb: 124, 58, 237;
  --canvas-node-rgb: 124, 58, 237;
  --canvas-node-alpha: 0.5;
  --canvas-pulse-core-rgb: 109, 40, 217;
  --canvas-pulse-rgb: 167, 139, 250;

  color-scheme: light;
}

/* 2. Base ------------------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Page-wide glow. A fixed pseudo-element is cheaper than background-attachment: fixed. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 600px at 85% -10%, rgba(var(--glow-rgb), 0.2), transparent 60%),
    radial-gradient(700px 500px at -10% 30%, rgba(var(--indigo-rgb), 0.55), transparent 65%),
    radial-gradient(800px 600px at 60% 110%, rgba(var(--indigo-rgb), 0.45), transparent 60%),
    var(--bg);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: var(--accent-soft);
  text-decoration-color: rgba(var(--accent-soft-rgb), 0.4);
  text-underline-offset: 0.2em;
  transition: color 0.2s, text-decoration-color 0.2s;
}

a:hover {
  color: var(--text-strong);
  text-decoration-color: currentColor;
}

img,
video,
svg {
  max-width: 100%;
}

img,
video {
  display: block;
  height: auto;
}

code,
pre,
kbd {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection {
  background: var(--selection-bg);
  color: var(--selection-text);
}

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

.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--btn-from);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

/* 3. Layout and shared pieces ---------------------------------------------- */
.wrap {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
}

.section {
  padding-block: clamp(72px, 10vw, 128px);
  position: relative;
}

.section + .section {
  border-top: 1px solid rgba(var(--accent-rgb), 0.08);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: clamp(0.68rem, 2.9vw, 0.8125rem);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent));
}

.section-head {
  max-width: 760px;
  margin-bottom: clamp(36px, 5vw, 56px);
}

.section-head h2 {
  margin-top: 14px;
  font-size: clamp(2rem, 4.6vw, 3.1rem);
}

.section-head p {
  margin-top: 18px;
  color: var(--muted);
  font-size: 1.125rem;
}

.grad {
  background: linear-gradient(100deg, var(--grad-from) 0%, var(--accent-soft) 45%, var(--violet) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s, background-color 0.25s, border-color 0.25s, color 0.25s;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.btn-primary {
  background: linear-gradient(120deg, var(--btn-from), var(--btn-to));
  color: var(--on-accent);
  box-shadow: 0 10px 30px -12px rgba(var(--violet-rgb), 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-primary:hover {
  color: var(--on-accent);
  transform: translateY(-2px);
  box-shadow: 0 16px 38px -12px rgba(var(--violet-rgb), 1), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--text-strong);
  transform: translateY(-2px);
}

.btn .arrow {
  transition: transform 0.25s var(--ease);
}

.btn:hover .arrow {
  transform: translateX(3px);
}

/* Chips and tags */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(var(--violet-rgb), 0.08);
  color: var(--accent-soft);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.3;
  white-space: nowrap;
}

.tag-private,
.tag-public {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tag-private {
  border: 1px solid rgba(var(--amber-rgb), 0.35);
  color: var(--amber);
  background: rgba(var(--amber-rgb), 0.07);
}

.tag-public {
  border: 1px solid rgba(var(--mint-rgb), 0.35);
  color: var(--mint);
  background: rgba(var(--mint-rgb), 0.07);
}

.tag-private svg,
.tag-public svg {
  width: 12px;
  height: 12px;
}

/* Cards */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(22px, 2.6vw, 30px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
  transition: transform 0.35s var(--ease), border-color 0.35s, box-shadow 0.35s;
}

/* Pointer-following glow; --mx / --my are set by site.js on hover. */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(var(--glow-rgb), 0.2), transparent 62%);
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}

.card > * {
  position: relative;
}

@media (hover: hover) {
  .card:hover {
    transform: translateY(-4px);
    border-color: var(--line-strong);
    box-shadow: 0 22px 50px -28px rgba(var(--violet-rgb), 0.7);
  }

  .card:hover::before {
    opacity: 1;
  }
}

.card:focus-within {
  border-color: var(--line-strong);
}

.card h3 {
  font-size: 1.25rem;
}

.card p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 1rem;
}

.card .chips {
  margin-top: auto;
  padding-top: 20px;
}

/* A heading link that makes its whole card clickable. */
.stretch {
  color: inherit;
  text-decoration: none;
}

.stretch::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}

.stretch:focus-visible {
  outline: none;
}

.stretch:focus-visible::after {
  outline: 2px solid var(--accent-soft);
  outline-offset: 3px;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ext {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--dim);
  transition: transform 0.25s var(--ease), color 0.25s;
}

.card:hover .ext,
.repo:hover .ext {
  color: var(--accent-soft);
  transform: translate(2px, -2px);
}

/* 4. Navigation ------------------------------------------------------------ */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  background: rgba(var(--ink-rgb), 0.72);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.12);
}

.nav-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: var(--nav-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.brand img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.brand i {
  font-style: normal;
  color: var(--accent);
}

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

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 13px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s, background-color 0.2s;
}

.nav-links a:hover,
.nav-links a[aria-current="true"] {
  color: var(--text-strong);
  background: rgba(var(--accent-rgb), 0.12);
}

.nav-links .nav-cta {
  margin-left: 8px;
  border: 1px solid var(--line-strong);
  color: var(--text);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.nav-toggle svg {
  width: 20px;
  height: 20px;
}

/* Theme switch: System, Light, Dark. Three native radio buttons, so arrow keys
   work and screen readers announce which one is selected. It only works with
   JavaScript, so it only shows with it. Its space is reserved from first paint:
   the menu does not move when scripts load. */
.nav-theme {
  display: none;
}

.js .nav-theme {
  display: block;
  margin-left: 8px;
}

.theme-switch {
  position: relative;
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.theme-switch label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, background-color 0.2s;
}

.theme-switch label:hover {
  color: var(--text-strong);
  background: var(--surface-2);
}

.theme-switch svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.theme-switch input:focus-visible + label {
  outline: 2px solid var(--accent-soft);
  outline-offset: 2px;
}

/* Icons only on wide screens; the words stay available to screen readers. */
.theme-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* The selected option follows the data-theme attribute that the script in
   <head> sets before first paint, so it is never drawn in the wrong place. */
:root:not([data-theme]) .theme-switch label[for="theme-system"],
:root[data-theme="light"] .theme-switch label[for="theme-light"],
:root[data-theme="dark"] .theme-switch label[for="theme-dark"] {
  background: var(--btn-from);
  color: var(--on-accent);
}

/* Just above the phone layout the menu is at its tightest: give it some slack
   so a wider fallback font cannot push the switch off the edge. */
@media (min-width: 901px) and (max-width: 1040px) {
  .nav-links a {
    padding: 0 10px;
  }

  .theme-switch label {
    width: 28px;
  }
}

/* Scroll progress, where scroll-driven animations are supported. */
.progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 2px;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--violet), var(--accent-soft));
}

@supports (animation-timeline: scroll()) {
  .progress {
    animation: grow linear both;
    animation-timeline: scroll(root block);
  }

  @keyframes grow {
    to {
      transform: scaleX(1);
    }
  }
}

@media (max-width: 900px) {
  /* Without JavaScript the links stay visible as one scrollable row. */
  .nav-in {
    flex-wrap: wrap;
    row-gap: 0;
  }

  .nav-links {
    overflow-x: auto;
    width: 100%;
    padding-bottom: 8px;
    scrollbar-width: none;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .js .nav-toggle {
    display: inline-flex;
  }

  .js .nav nav {
    position: absolute;
    inset: 100% 0 auto 0;
    display: none;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }

  .js .nav.open nav {
    display: block;
  }

  .js .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    width: min(100% - 2 * var(--gutter), var(--wrap));
    margin-inline: auto;
    padding-block: 12px 18px;
    overflow: visible;
  }

  .js .nav-links a {
    display: flex;
    min-height: 48px;
    padding: 0 14px;
    border-radius: 12px;
    font-size: 1.05rem;
  }

  .js .nav-links .nav-cta {
    margin: 8px 0 0;
    justify-content: center;
  }

  .js .nav-theme {
    margin: 8px 0 0;
  }

  .theme-switch {
    padding: 4px;
    border-radius: 12px;
  }

  .theme-switch label {
    flex: 1;
    width: auto;
    height: 44px;
    border-radius: 9px;
    font-size: 1rem;
  }

  .theme-text {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
  }
}

/* 5. Hero ------------------------------------------------------------------ */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-top: calc(var(--nav-h) + clamp(48px, 9vw, 104px));
  padding-bottom: clamp(64px, 9vw, 112px);
  min-height: min(100svh, 920px);
  display: flex;
  align-items: center;
}

.hero-bg,
.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* Static layer: gradient plus a faint grid. This is the whole background when
   JavaScript is off or motion is reduced. */
.hero-bg {
  background:
    radial-gradient(60% 55% at 78% 30%, rgba(var(--glow-rgb), 0.28), transparent 70%),
    radial-gradient(50% 60% at 10% 80%, rgba(var(--indigo-rgb), 0.7), transparent 70%),
    linear-gradient(180deg, var(--navy), var(--bg) 85%);
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(var(--accent-rgb), 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--accent-rgb), 0.07) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(75% 70% at 60% 35%, #000, transparent 78%);
  mask-image: radial-gradient(75% 70% at 60% 35%, #000, transparent 78%);
}

.hero-canvas {
  opacity: 0.9;
  -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.3), #000 60%);
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.3), #000 60%);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.hero h1 {
  margin-top: 18px;
  font-size: clamp(2.75rem, 7.4vw, 5.25rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1;
}

.hero .lead {
  margin-top: 24px;
  max-width: 34em;
  color: var(--muted);
  font-size: clamp(1.1rem, 1.7vw, 1.3rem);
  line-height: 1.55;
}

.hero .lead strong {
  color: var(--text);
  font-weight: 600;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.social {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 15px 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-decoration: none;
  transition: transform 0.25s var(--ease), border-color 0.25s, color 0.25s, background-color 0.25s;
}

.social svg {
  width: 18px;
  height: 18px;
}

.social:hover {
  color: var(--text-strong);
  border-color: var(--line-strong);
  background: var(--surface-2);
  transform: translateY(-2px);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 26px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 0 rgba(var(--mint-rgb), 0.6);
  animation: ping 2.4s ease-out infinite;
}

@keyframes ping {
  70%,
  100% {
    box-shadow: 0 0 0 9px rgba(var(--mint-rgb), 0);
  }
}

/* Terminal */
.term {
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: rgba(var(--ink-rgb), 0.94);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 40px 90px -40px rgba(var(--violet-rgb), 0.75), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  overflow: hidden;
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.term-bar i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(var(--accent-rgb), 0.3);
}

.term-bar i:first-child {
  background: rgba(var(--accent-rgb), 0.75);
}

.term-bar span {
  margin-left: 8px;
}

.term-body {
  margin: 0;
  padding: 18px 18px 20px;
  font-family: var(--font-mono);
  font-size: clamp(0.72rem, 1.05vw, 0.84rem);
  line-height: 1.7;
  color: #d6d3f0;
}

.term-body .tl {
  display: block;
  min-height: 1.7em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.term-body .wait,
.term-body .rest {
  visibility: hidden;
}

.t-prompt {
  color: var(--accent);
}

.t-user {
  color: #fff;
}

.t-tool {
  color: var(--accent-soft);
}

.t-dim {
  color: var(--dim);
}

.t-key {
  color: #93c5fd;
}

.t-num {
  color: var(--amber);
}

.t-str {
  color: var(--mint);
}

.t-warn {
  color: var(--amber);
}

/* Out of flow, so the caret never changes how the typed text wraps. */
.caret {
  position: absolute;
  width: 0.55em;
  height: 1.15em;
  margin: 0.28em 0 0 1px;
  background: var(--accent-soft);
  animation: blink 1.05s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.term-body .show {
  animation: line-in 0.3s var(--ease) both;
}

@keyframes line-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

.term-note {
  margin-top: 12px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero {
    min-height: 0;
  }
}

/* 6. Flagship (datalint-mcp) ----------------------------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  overflow: hidden;
}

.stat {
  padding: clamp(20px, 2.6vw, 30px);
  background: var(--panel-solid);
}

.stat b {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4.6vw, 3.25rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.stat b small {
  font-size: 0.5em;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--dim);
}

.stat dd {
  margin: 0;
}

.stat dd > span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.4;
}

.num {
  display: inline-block;
  text-align: left;
}

.evals-copy p + p {
  margin-top: 14px;
}

.evals-copy p {
  color: var(--muted);
}

.evals-copy p strong {
  color: var(--text);
}

.evals-result {
  margin-top: 22px;
  padding: 14px 16px;
  border-left: 2px solid var(--mint);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgba(var(--mint-rgb), 0.06);
  color: var(--text);
  font-size: 0.98rem;
}

.matrix {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(var(--ink-rgb), 0.55);
  overflow: hidden;
}

.matrix-head,
.matrix li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px 54px;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
}

.matrix-head {
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.matrix-head span:not(:first-child) {
  text-align: center;
}

.matrix li + li {
  border-top: 1px solid rgba(var(--accent-rgb), 0.08);
}

.matrix code {
  display: block;
  color: var(--text);
  font-size: 0.82rem;
}

.matrix small {
  display: block;
  margin-top: 2px;
  color: var(--dim);
  font-size: 0.8rem;
  line-height: 1.4;
}

.run {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid rgba(var(--mint-rgb), 0.4);
  background: rgba(var(--mint-rgb), 0.1);
  color: var(--mint);
}

.run svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 900px) {

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {

  .matrix-head,
.matrix li {
    grid-template-columns: minmax(0, 1fr) 38px 38px;
    gap: 6px;
    padding-inline: 12px;
  }
}

/* 7. Cards and sections ---------------------------------------------------- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: linear-gradient(140deg, rgba(var(--violet-rgb), 0.3), rgba(var(--indigo-rgb), 0.3));
  color: var(--accent-soft);
}

.icon svg {
  width: 22px;
  height: 22px;
}

/* What I do: one row per capability, the claim on the left and the work that backs it on the right. */
.stats-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 20px;
}

.caps {
  display: grid;
  gap: 20px;
}

.cap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(20px, 4vw, 56px);
  align-items: start;
}

.cap .icon {
  margin-bottom: 18px;
}

.cap-proof {
  align-self: stretch;
  padding-left: clamp(20px, 3.2vw, 44px);
  border-left: 1px solid var(--line);
}

.cap-proof h4 {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cap-proof .bullets {
  margin-top: 14px;
  gap: 10px;
}

/* Expandable detail inside a work card. It sits above the card's stretched link so it can be clicked. */
.more {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(var(--ink-rgb), 0.35);
}

.more summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 8px 16px;
  color: var(--accent-soft);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  cursor: pointer;
  list-style: none;
}

.more summary::-webkit-details-marker {
  display: none;
}

.more summary::after {
  content: "+";
  color: var(--dim);
  font-size: 1.15rem;
  line-height: 1;
}

.more[open] summary::after {
  content: "\2212";
}

.more summary:hover {
  color: var(--text-strong);
}

.more-body {
  padding: 2px 16px 16px;
}

.more-body > p {
  font-size: 0.95rem;
}

.more-body .matrix {
  margin-top: 18px;
}

/* With the detail open, the neighbouring card keeps its own height. */
.work-featured:has(.more[open]) {
  align-items: start;
}

/* Selected work */
.work-featured {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.work-featured .card {
  padding: clamp(26px, 3.2vw, 38px);
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(var(--glow-rgb), 0.2), transparent 60%),
    var(--card-bg);
}

.work-featured h3 {
  font-size: clamp(1.4rem, 2.4vw, 1.75rem);
}

.kicker {
  margin-bottom: 14px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bullets {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.bullets li {
  position: relative;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.97rem;
  line-height: 1.5;
}

.bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--violet);
  transform: rotate(45deg);
}

.card-links {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.subhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: clamp(40px, 5vw, 60px) 0 20px;
}

.subhead h3 {
  font-size: 1.35rem;
}

.subhead p,
.subhead a {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.subhead a {
  color: var(--accent-soft);
}

/* Public repositories */
.repos {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
}

.repo {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) auto auto;
  gap: 8px 24px;
  align-items: center;
  padding: 18px clamp(18px, 2.6vw, 28px);
  transition: background-color 0.25s;
}

.repo + .repo {
  border-top: 1px solid rgba(var(--accent-rgb), 0.1);
}

.repo:hover {
  background: rgba(var(--violet-rgb), 0.08);
}

.repo h4 {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.repo p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.repo .stretch::after {
  border-radius: 0;
}

/* Toolkit */
.toolkit {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.toolkit .card h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.toolkit .chips {
  margin-top: 18px;
  padding-top: 0;
  gap: 9px;
}

.toolkit .chip {
  min-height: 34px;
  padding: 4px 14px;
  background: rgba(var(--tint-rgb), 0.04);
  color: var(--text);
  font-size: 0.85rem;
  transition: transform 0.25s var(--ease), border-color 0.25s, background-color 0.25s;
}

.toolkit .chip:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: rgba(var(--violet-rgb), 0.16);
}

/* About */
.about {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
}

.portrait {
  position: relative;
  width: min(100%, 320px);
}

.portrait::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 26px;
  padding: 1px;
  background: linear-gradient(140deg, var(--accent-soft), rgba(var(--violet-rgb), 0.1) 45%, var(--violet));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
  z-index: 1;
}

.portrait::after {
  content: "";
  position: absolute;
  inset: 12% -8% -8% 12%;
  z-index: -1;
  border-radius: 26px;
  background: radial-gradient(closest-side, rgba(var(--glow-rgb), 0.45), transparent);
  filter: blur(26px);
}

.portrait img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 25px;
  background: var(--navy);
}

.about-copy h2 {
  margin-top: 14px;
  font-size: clamp(2rem, 4.6vw, 3.1rem);
}

.about-copy > p {
  margin-top: 18px;
  color: var(--muted);
  font-size: 1.1rem;
}

.about-copy > p strong {
  color: var(--text);
  font-weight: 600;
}

.facts {
  margin: 28px 0 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(var(--ink-rgb), 0.55);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.6;
}

.facts div {
  display: grid;
  grid-template-columns: 7.5em minmax(0, 1fr);
  gap: 12px;
  padding: 5px 0;
}

.facts dt {
  color: var(--accent);
}

.facts dd {
  margin: 0;
  color: var(--text);
}

/* Earlier work */
.early {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.early .card {
  padding: 0;
  overflow: hidden;
}

.early .thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--navy);
}

.early .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left top;
  opacity: 0.86;
  transition: transform 0.6s var(--ease), opacity 0.4s;
}

.early .card:hover .thumb img {
  transform: scale(1.05);
  opacity: 1;
}

.early .body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 20px 22px 22px;
}

.early h3 {
  font-size: 1.1rem;
}

.early p {
  font-size: 0.93rem;
}

/* Contact */
.contact {
  position: relative;
  overflow: hidden;
  padding: clamp(36px, 6vw, 72px);
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  background:
    radial-gradient(70% 120% at 100% 0%, rgba(var(--glow-rgb), 0.35), transparent 60%),
    radial-gradient(60% 100% at 0% 100%, rgba(var(--indigo-rgb), 0.8), transparent 65%),
    var(--panel-solid);
  text-align: center;
}

.contact h2 {
  margin: 14px auto 0;
  max-width: 16em;
  font-size: clamp(2rem, 5vw, 3.4rem);
}

.contact > p {
  margin: 18px auto 0;
  max-width: 36em;
  color: var(--muted);
  font-size: 1.125rem;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}

.contact .socials {
  justify-content: center;
}

.mail {
  margin-top: 26px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

/* Footer */
.footer {
  padding: 34px 0 44px;
  border-top: 1px solid rgba(var(--accent-rgb), 0.1);
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
}

.footer a {
  color: var(--muted);
}

@media (max-width: 1040px) {
  .early {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .repo {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .repo p {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (max-width: 820px) {
  .stats-3,
  .cap {
    grid-template-columns: minmax(0, 1fr);
  }

  .cap-proof {
    padding: 20px 0 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .work-featured,
.toolkit,
.grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .about {
    grid-template-columns: minmax(0, 1fr);
  }

  .portrait {
    width: min(70%, 260px);
  }
}

@media (max-width: 560px) {
  .early {
    grid-template-columns: minmax(0, 1fr);
  }

  .repo .chip {
    display: none;
  }

  .repo {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .facts div {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .btn {
    width: 100%;
  }
}

/* 8. Project pages --------------------------------------------------------- */
.page-hero {
  padding-top: calc(var(--nav-h) + clamp(40px, 7vw, 80px));
  padding-bottom: clamp(32px, 5vw, 56px);
}

.crumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-decoration: none;
}

.crumb svg {
  width: 16px;
  height: 16px;
  transition: transform 0.25s var(--ease);
}

.crumb:hover svg {
  transform: translateX(-3px);
}

.page-hero h1 {
  margin-top: 18px;
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.page-hero .lead {
  margin-top: 20px;
  max-width: 44em;
  color: var(--muted);
  font-size: 1.15rem;
}

.page-hero .lead + .lead {
  margin-top: 14px;
}

.page-hero .chips {
  margin-top: 26px;
}

.page-body {
  padding-bottom: clamp(64px, 9vw, 112px);
}

.page-body h2 {
  margin: clamp(40px, 6vw, 64px) 0 20px;
  font-size: 1.5rem;
}

.frame {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #05041a;
  overflow: hidden;
  box-shadow: 0 40px 90px -50px rgba(var(--violet-rgb), 0.8);
}

.frame video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #05041a;
}

.shots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.shot {
  margin: 0;
}

.shot a {
  display: block;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  transition: transform 0.35s var(--ease), border-color 0.35s, box-shadow 0.35s;
}

.shot a:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: 0 22px 44px -26px rgba(var(--violet-rgb), 0.8);
}

.shot img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: left top;
}

.shot figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: clamp(48px, 7vw, 80px);
}

.pager a {
  display: block;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.25s var(--ease), border-color 0.25s, background-color 0.25s;
}

.pager a:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.pager small {
  display: block;
  margin-bottom: 4px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pager a:last-child {
  text-align: right;
}

.lightbox {
  width: min(96vw, 1400px);
  max-width: none;
  max-height: 94vh;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #05041a;
  color: var(--text);
  overflow: hidden;
}

.lightbox::backdrop {
  background: rgba(4, 3, 16, 0.86); /* same in both themes */
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.lightbox img {
  width: 100%;
  max-height: calc(94vh - 58px);
  object-fit: contain;
  background: #fff;
}

.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 8px 10px 8px 18px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.lightbox-bar div {
  display: flex;
  gap: 6px;
}

.lightbox button {
  min-width: 40px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.lightbox button:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.notfound {
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: var(--gutter);
}

.notfound h1 {
  font-size: clamp(3rem, 12vw, 7rem);
  font-weight: 700;
}

.notfound p {
  margin: 14px 0 28px;
  color: var(--muted);
}

/* The small label above the heading keeps its violet, as everywhere else. */
.notfound .eyebrow {
  color: var(--accent);
}

@media (max-width: 820px) {
  .shots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .shots,
.pager {
    grid-template-columns: minmax(0, 1fr);
  }

  .pager a:last-child {
    text-align: left;
  }
}

/* 9. Motion ---------------------------------------------------------------- */
/* Reveal-on-scroll only hides content once JavaScript has announced itself
   (the "js" class is set inline in <head>), so the page reads fine without it. */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  .js [data-reveal] {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
    transition-delay: calc(var(--d, 0) * 80ms);
  }

  .js [data-reveal].in {
    opacity: 1;
    transform: none;
  }

  /* Hover transitions on cards should not inherit the reveal delay. */
  .js .card[data-reveal].in {
    transition: opacity 0.7s var(--ease), transform 0.35s var(--ease), border-color 0.35s, box-shadow 0.35s;
    transition-delay: 0s;
  }

  .js .card[data-reveal]:not(.in) {
    transition-delay: calc(var(--d, 0) * 80ms);
  }

  /* Eval matrix: the 16 runs tick in one after another. */
  .js .matrix .run {
    opacity: 0.15;
    transform: scale(0.7);
    transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
    transition-delay: calc(var(--i, 0) * 70ms + 200ms);
  }

  .js .matrix.in .run {
    opacity: 1;
    transform: none;
  }

  .grad-anim {
    background-size: 220% 100%;
    animation: sheen 9s ease-in-out infinite alternate;
  }

  @keyframes sheen {
    to {
      background-position: 100% 0;
    }
  }
}

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

  .caret,
.dot {
    animation: none !important;
  }

  .hero-canvas {
    display: none;
  }

  .btn:hover,
.card:hover,
.social:hover,
.shot a:hover,
.pager a:hover,
.toolkit .chip:hover {
    transform: none;
  }
}

@media print {
  .nav,
.hero-canvas,
.hero-bg {
    display: none !important;
  }

  body {
    background: #fff;
    color: #111;
  }
}
