/* =========================================================
   Shourya Vuddemarri · Robotics Portfolio — project pages
   Same design language as the home page: black stage, red plates,
   Unbounded display type, mono labels.
   ========================================================= */

:root {
  --bg: #070708;
  --bg-2: #0d0d0f;
  --surface: rgba(14, 14, 16, 0.84);
  --surface-solid: #111113;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f3f0ec;
  --text-2: #c9c6c2;
  --muted: #8f8e93;
  --red: #e4162c;
  --red-2: #ff3347;
  --plate: #c4112a;
  --red-soft: rgba(228, 22, 44, 0.12);
  --red-line: rgba(255, 51, 71, 0.6);

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --radius-lg: 20px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.85);
  --shadow-red: 0 18px 50px -22px rgba(228, 22, 44, 0.55);
  --container: 1240px;
  --gutter: clamp(16px, 4vw, 48px);
  --header-h: 72px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

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

/* Red floor glow + faint measuring grid, as on the home page stage */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}
body::before {
  z-index: -2;
  background:
    radial-gradient(120% 70% at 50% 118%, rgba(228, 22, 44, 0.16), transparent 60%),
    radial-gradient(700px 420px at 92% -6%, rgba(228, 22, 44, 0.1), transparent 64%),
    var(--bg);
}
body::after {
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 96px 96px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 78%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 78%);
}

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

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

p a,
li a {
  color: var(--red-2);
  text-decoration: underline;
  text-decoration-color: rgba(255, 51, 71, 0.45);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s, color 0.2s;
}
p a:hover,
li a:hover {
  color: #fff;
  text-decoration-color: var(--red-2);
}

b,
strong {
  color: var(--text);
  font-weight: 600;
}

code {
  font-family: var(--font-mono);
  font-size: 0.84em;
  padding: 0.12em 0.42em;
  border-radius: 6px;
  color: #ffe7ea;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
}

::selection {
  background: var(--red);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--red-2);
  outline-offset: 3px;
  border-radius: 6px;
}
.site-footer :focus-visible {
  outline-color: #fff;
}

svg {
  flex: none;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 200;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff;
  color: #000;
  font: 600 14px var(--font-body);
  transition: top 0.2s;
}
.skip-link:focus {
  top: 12px;
}

/* =========================
   Header + nav
   ========================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
}
/* the blur lives on a pseudo-element so the full-screen mobile menu can be position: fixed */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(7, 7, 8, 0.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s;
}
.site-header.is-scrolled::before {
  background: rgba(7, 7, 8, 0.86);
  border-bottom-color: var(--border);
}

.header-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.logo-mark {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font: 800 14px/1 var(--font-display);
  letter-spacing: -0.02em;
  color: #fff;
  background: var(--red);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 6px 24px -8px rgba(228, 22, 44, 0.8);
}
/* four corner screws */
.logo-mark::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 5px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 27px 0 0 rgba(255, 255, 255, 0.75), 0 27px 0 rgba(255, 255, 255, 0.75), 27px 27px 0 rgba(255, 255, 255, 0.75);
}
.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.logo-text b {
  font: 600 14px var(--font-display);
  letter-spacing: -0.01em;
}
.logo-text span {
  font: 500 10.5px var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.site-nav a {
  position: relative;
  padding: 10px 12px;
  border-radius: 8px;
  font: 500 12px/1 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-2);
  transition: color 0.2s;
}
.site-nav a .n {
  margin-right: 6px;
  color: var(--red-2);
}
.site-nav a:hover,
.site-nav a.is-active {
  color: #fff;
}
.site-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 3px;
  height: 1px;
  background: var(--red-2);
}
.site-nav a.nav-cta {
  margin-left: 10px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 18px;
  border-radius: 999px;
  font: 600 13px/1 var(--font-body);
  letter-spacing: 0.01em;
  text-transform: none;
  color: #fff;
  background: var(--red);
  box-shadow: 0 10px 30px -12px rgba(228, 22, 44, 0.9);
  transition: background 0.25s, transform 0.25s var(--ease);
}
.site-nav a.nav-cta:hover {
  background: var(--red-2);
  transform: translateY(-2px);
}
.site-nav a.nav-cta::after {
  display: none;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.3s var(--ease);
}
.nav-open .nav-toggle span:first-child {
  transform: translateY(3.25px) rotate(45deg);
}
.nav-open .nav-toggle span:last-child {
  transform: translateY(-3.25px) rotate(-45deg);
}

/* =========================
   Buttons + small UI
   ========================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: 600 14px/1 var(--font-body);
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s, border-color 0.25s, color 0.25s, box-shadow 0.25s;
}
.btn svg {
  width: 17px;
  height: 17px;
}
.btn.primary {
  background: var(--red);
  color: #fff;
  box-shadow: 0 10px 30px -12px rgba(228, 22, 44, 0.9);
}
.btn.primary:hover {
  background: var(--red-2);
  transform: translateY(-2px);
}
.btn.ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--border-strong);
}
.btn.ghost:hover {
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}
.btn.black {
  background: #0a0a0b;
  color: #fff;
}
.btn.black:hover {
  background: #000;
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -14px rgba(0, 0, 0, 0.8);
}
.btn.line {
  border-color: rgba(255, 255, 255, 0.62);
  color: #fff;
}
.btn.line:hover {
  border-color: #fff;
  background: rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font: 500 12px/1.2 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red-2);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
}

/* =========================
   Project hero
   ========================= */
.project-hero {
  padding: clamp(36px, 6vw, 76px) 0 clamp(24px, 4vw, 44px);
}
.back-link {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  margin-bottom: 34px;
  padding: 0 16px 0 12px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.02);
  font: 500 11.5px/1 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-2);
  transition: color 0.2s, border-color 0.2s;
}
.back-link svg {
  width: 15px;
  height: 15px;
  color: var(--red-2);
  transition: transform 0.25s var(--ease);
}
.back-link:hover {
  color: #fff;
  border-color: var(--red-line);
}
.back-link:hover svg {
  transform: translateX(-3px);
}

.project-title {
  max-width: 24ch;
  margin: 0 0 26px;
  font: 700 clamp(30px, 4.6vw, 62px)/1.04 var(--font-display);
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.meta-chips {
  list-style: none;
  margin: 0 0 26px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.meta-chips li {
  padding: 9px 12px;
  border-radius: 999px;
  font: 500 12px/1 var(--font-mono);
  color: var(--text-2);
  background: rgba(7, 7, 8, 0.6);
  border: 1px solid var(--border-strong);
}
.meta-chips li.gold {
  color: #000;
  background: var(--plate);
  border-color: var(--plate);
  font-weight: 600;
}
.meta-chips li.silver {
  color: #fff;
  background: #1b1b1e;
  border-color: rgba(255, 51, 71, 0.45);
}
.project-lede {
  max-width: 68ch;
  margin: 0;
  color: var(--text-2);
  font-size: clamp(16px, 1.3vw, 18.5px);
  line-height: 1.75;
}
.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.project-section {
  padding: clamp(20px, 3.5vw, 36px) 0;
}
.block-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 20px;
  font: 600 12px/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red-2);
}
.block-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-strong);
}
.block-title .count {
  color: var(--muted);
}

/* =========================
   Key results: the red plate
   ========================= */
.stats {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: hidden;
  border-radius: 22px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--plate);
  box-shadow: 0 30px 70px -40px rgba(228, 22, 44, 0.75);
}
.stats.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.stat {
  position: relative;
  padding: 22px 22px 24px;
  background: var(--plate);
}
.stat::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.07) 0 1px, transparent 1px 48px);
  pointer-events: none;
}
.stat-value {
  position: relative;
  font: 700 clamp(22px, 2.2vw, 32px)/1.08 var(--font-display);
  letter-spacing: -0.02em;
  color: #000;
}
.stat-label {
  position: relative;
  margin-top: 10px;
  color: #fff;
  font-size: 13.5px;
  line-height: 1.5;
}
.stats.compact .stat {
  padding: 20px 20px 22px;
}

/* =========================
   Videos
   ========================= */
.video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.video-card {
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface-solid);
  border: 1px solid var(--border);
}
.video-card video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}
.video-card figcaption {
  padding: 16px 18px 18px;
  border-top: 1px solid var(--border);
}
.video-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font: 600 15.5px/1.3 var(--font-display);
  letter-spacing: -0.01em;
}
.video-title svg {
  width: 15px;
  height: 15px;
  color: var(--red-2);
}
.video-desc {
  margin: 6px 0 0;
  color: var(--text-2);
  font-size: 14px;
}

/* =========================
   Gallery
   ========================= */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 16px;
}
.gallery-grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.gallery-item {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  overflow: hidden;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: zoom-in;
  border-radius: 18px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  transition: transform 0.35s var(--ease), border-color 0.3s, box-shadow 0.3s;
}
.gallery-item:hover {
  transform: translateY(-6px);
  border-color: var(--red-line);
  box-shadow: var(--shadow-red);
}
.gallery-media,
.gallery-caption {
  display: block;
}
.gallery-media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #1a1a1d;
}
.gallery-grid.wide .gallery-media {
  aspect-ratio: 16 / 9;
}
.gallery-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.gallery-item:hover .gallery-media img {
  transform: scale(1.04);
}
.gallery-item.is-figure .gallery-media {
  background: #f4f4f2;
}
.gallery-item.is-figure .gallery-media img {
  object-fit: contain;
  padding: 8px;
}
.gallery-item.is-figure:hover .gallery-media img {
  transform: scale(1.02);
}
.zoom-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--red);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.25s, transform 0.25s var(--ease);
}
.zoom-icon svg {
  width: 15px;
  height: 15px;
}
.gallery-item:hover .zoom-icon,
.gallery-item:focus-visible .zoom-icon {
  opacity: 1;
  transform: none;
}
.gallery-caption {
  padding: 13px 15px 15px;
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.55;
  border-top: 1px solid var(--border);
}

/* =========================
   Written content
   ========================= */
.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.content-col {
  display: grid;
  gap: 16px;
  min-width: 0;
}
.content-card {
  min-width: 0;
  padding: clamp(22px, 3vw, 30px);
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.content-card.full {
  grid-column: 1 / -1;
}
.content-card h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  font: 600 17px/1.3 var(--font-display);
  letter-spacing: -0.01em;
}
.content-card h3::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(228, 22, 44, 0.18);
}
.content-card p {
  margin: 0 0 12px;
  color: var(--text-2);
}
.content-card p:last-child {
  margin-bottom: 0;
}
.content-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.content-card ul + p,
.content-card p + ul {
  margin-top: 14px;
}
.content-card li {
  position: relative;
  padding-left: 22px;
  color: var(--text-2);
}
.content-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.78em;
  width: 10px;
  height: 2px;
  background: var(--red-2);
}
.content-card ul.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.content-card ul.chips li {
  padding: 8px 11px;
  border-radius: 8px;
  font: 500 12px/1.3 var(--font-mono);
  color: #ffe7ea;
  background: rgba(228, 22, 44, 0.14);
  border: 1px solid rgba(228, 22, 44, 0.3);
}
.content-card ul.chips li::before {
  display: none;
}

/* Numbered pipeline steps */
.content-card ol.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
  counter-reset: step;
}
.content-card ol.steps li {
  position: relative;
  padding-left: 40px;
  color: var(--text-2);
  counter-increment: step;
}
.content-card ol.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 1px;
  width: 28px;
  height: 24px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font: 600 11px/1 var(--font-mono);
  color: #fff;
  background: var(--red);
}

/* Results tables */
.table-scroll {
  overflow-x: auto;
  margin: 2px 0 14px;
}
.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}
.result-table th,
.result-table td {
  padding: 10px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.result-table thead th {
  border-bottom: 2px solid var(--red);
}
.result-table th {
  font: 600 11px/1.3 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.result-table td {
  color: var(--text-2);
}
.result-table td.num {
  font-family: var(--font-mono);
  color: var(--text);
  white-space: nowrap;
}
.result-table tr:last-child td {
  border-bottom: 0;
}
.content-card .fine {
  font-size: 13.5px;
  color: var(--muted);
}

/* Image + text split (single-image projects) */
.project-split {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
  align-items: start;
}
.project-split .gallery-item {
  position: sticky;
  top: calc(var(--header-h) + 16px);
}
.project-split .gallery-media {
  aspect-ratio: auto;
}
.project-split .gallery-media img {
  height: auto;
}

/* =========================
   Robot cards (combat series)
   ========================= */
.robot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 18px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  transition: transform 0.35s var(--ease), border-color 0.3s, box-shadow 0.3s;
}
.project-card:hover {
  transform: translateY(-8px);
  border-color: var(--red-line);
  box-shadow: var(--shadow-red);
}
.project-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #1a1a1d;
}
.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.project-card:hover .project-media img {
  transform: scale(1.05);
}
.project-media.is-figure {
  background: #f4f4f2;
}
.project-media.is-figure img {
  object-fit: contain;
  padding: 8px;
}
.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 20px 20px;
}
.card-body h3 {
  margin: 2px 0 0;
  font: 600 17px/1.28 var(--font-display);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.card-body p {
  margin: 0;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.6;
}
.card-meta {
  font: 500 12px/1.4 var(--font-mono);
  color: var(--muted);
}
.card-body p.card-meta {
  color: var(--muted);
  font-size: 12px;
}
.card-cta {
  margin-top: auto;
  padding-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 600 13px/1 var(--font-body);
  color: var(--red-2);
}
.card-cta svg {
  width: 15px;
  height: 15px;
  transition: transform 0.3s var(--ease);
}
.project-card:hover .card-cta svg {
  transform: translateX(4px);
}
.place {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 7px 10px;
  border-radius: 999px;
  font: 600 11px/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.place svg {
  width: 14px;
  height: 14px;
}
.place.gold {
  color: #000;
  background: var(--plate);
}
.place.silver {
  color: #fff;
  background: #1b1b1e;
  border: 1px solid rgba(255, 51, 71, 0.45);
}

/* =========================
   Prev / next
   ========================= */
.project-pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding-top: clamp(28px, 4vw, 44px);
  padding-bottom: clamp(56px, 8vw, 96px);
}
.pager-link {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 24px 22px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s;
}
.pager-link:hover {
  transform: translateY(-3px);
  border-color: var(--red-line);
  box-shadow: var(--shadow-red);
}
.pager-link.next {
  align-items: flex-end;
  text-align: right;
}
.pager-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 500 11px/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red-2);
}
.pager-label svg {
  width: 14px;
  height: 14px;
}
.pager-title {
  font: 600 16px/1.35 var(--font-display);
  letter-spacing: -0.01em;
}

/* =========================
   Footer: the red contact plate
   ========================= */
.site-footer {
  position: relative;
  overflow: hidden;
  background: var(--plate);
  color: #fff;
}
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.07) 0 1px, transparent 1px 96px);
  pointer-events: none;
}
.footer-cta {
  position: relative;
  padding-top: clamp(56px, 8vw, 104px);
  padding-bottom: clamp(44px, 6vw, 72px);
}
.footer-cta .eyebrow {
  color: #fff;
}
.footer-title {
  margin: 4px 0 0;
  font: 800 clamp(40px, 7.4vw, 112px)/0.9 var(--font-display);
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: #000;
}
.footer-text {
  max-width: 46ch;
  margin: 22px 0 0;
  font-size: clamp(15.5px, 1.25vw, 18px);
  line-height: 1.6;
}
.footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.footer-bar {
  position: relative;
  border-top: 1px solid rgba(0, 0, 0, 0.28);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-top: 22px;
  padding-bottom: 24px;
  font: 500 12px/1.4 var(--font-mono);
  letter-spacing: 0.04em;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}
.footer-links a:hover {
  text-decoration: underline;
}

/* =========================
   Lightbox
   ========================= */
.lightbox-open,
.lightbox-open body {
  overflow: hidden;
}
.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox-modal.is-open {
  display: flex;
  animation: lb-in 0.2s ease;
}
@keyframes lb-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 5, 0.92);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.lightbox-inner {
  position: relative;
  z-index: 1;
  width: min(1240px, 100%);
  display: flex;
  align-items: center;
  gap: 14px;
}
.lightbox-media {
  flex: 1;
  min-width: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.lightbox-content {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-content img,
.lightbox-content video {
  max-width: 100%;
  max-height: calc(100vh - 160px);
  max-height: calc(100dvh - 160px);
  border-radius: 12px;
  object-fit: contain;
  background: #111113;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.85);
}
.lightbox-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 6px 14px;
  max-width: 80ch;
  margin: 0;
  text-align: center;
  color: var(--text-2);
  font-size: 14.5px;
}
.lightbox-counter {
  font: 500 12px/1 var(--font-mono);
  color: var(--red-2);
  white-space: nowrap;
}
.lightbox-close,
.lightbox-nav {
  display: grid;
  place-items: center;
  color: var(--text);
  background: rgba(17, 17, 19, 0.9);
  border: 1px solid var(--border-strong);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.lightbox-close:hover,
.lightbox-nav:hover {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 12px;
}
.lightbox-nav {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
}
.lightbox-close svg,
.lightbox-nav svg {
  width: 20px;
  height: 20px;
}
.lightbox-nav[hidden] {
  display: none;
}

/* =========================
   Scroll reveal (only when JS runs)
   ========================= */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--delay, 0ms);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* =========================
   Responsive
   ========================= */
@media (max-width: 1180px) {
  .site-nav a .n {
    display: none;
  }
  .site-nav a {
    padding: 10px 8px;
  }
}

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

@media (max-width: 900px) {
  :root {
    --header-h: 64px;
  }
  .content-grid,
  .project-split {
    grid-template-columns: minmax(0, 1fr);
  }
  .stats,
  .stats.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .project-split .gallery-item {
    position: static;
    max-width: 460px;
  }

  /* full-screen menu, as on the home page */
  .nav-toggle {
    display: inline-flex;
    position: relative;
    z-index: 2;
  }
  .logo {
    position: relative;
    z-index: 2;
  }
  .site-nav {
    position: fixed;
    inset: 0;
    z-index: 1;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 0;
    padding: 96px var(--gutter) 48px;
    background: #070708;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
  }
  .nav-open .site-nav {
    opacity: 1;
    visibility: visible;
  }
  .site-nav a {
    padding: 16px 0;
    border-radius: 0;
    border-bottom: 1px solid var(--border);
    font: 600 26px/1.2 var(--font-display);
    letter-spacing: -0.01em;
    text-transform: none;
    color: #fff;
  }
  .site-nav a .n {
    display: inline;
    margin-right: 14px;
    font: 500 12px var(--font-mono);
    vertical-align: middle;
  }
  .site-nav a.is-active::after {
    display: none;
  }
  .site-nav a.is-active {
    color: var(--red-2);
  }
  .site-nav a.nav-cta {
    margin: 28px 0 0;
    height: 52px;
    justify-content: center;
    border-bottom: 0;
    border-radius: 999px;
    font: 600 16px/1 var(--font-body);
  }
}

@media (max-width: 760px) {
  .video-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .lightbox-modal {
    padding: 16px;
  }
  .lightbox-inner {
    flex-wrap: wrap;
    justify-content: center;
  }
  .lightbox-media {
    order: -1;
    flex-basis: 100%;
  }
  .lightbox-content img,
  .lightbox-content video {
    max-height: calc(100vh - 230px);
    max-height: calc(100dvh - 230px);
  }
}

@media (max-width: 640px) {
  .robot-grid,
  .project-pager,
  .gallery-grid.cols-2 {
    grid-template-columns: minmax(0, 1fr);
  }
  .pager-link.next {
    align-items: flex-start;
    text-align: left;
  }
  .result-table {
    font-size: 13.5px;
  }
  .result-table th,
  .result-table td {
    padding: 8px 6px;
  }
  .stat {
    padding: 16px 16px 18px;
  }
  .stat-label {
    font-size: 12.5px;
  }
  .footer-actions .btn {
    flex: 1 1 auto;
  }
}

@media (max-width: 420px) {
  .logo-text span {
    display: none;
  }
}

@media (max-width: 340px) {
  .stats,
  .stats.three {
    grid-template-columns: minmax(0, 1fr);
  }
  .logo-text {
    display: none;
  }
}

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

@media print {
  body::before,
  body::after,
  .site-header,
  .lightbox-modal,
  .project-pager,
  .footer-cta {
    display: none;
  }
  body {
    background: #fff;
    color: #111;
  }
  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
