/* =====================================================================
   Derek Ike — Portfolio
   Engineering blueprint, seen through frosted glass.
   ===================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Background */
  --navy-deep: #0a0c12;
  --navy: #11141c;
  --navy-abyss: #05060a;
  --bg-gradient: radial-gradient(135% 120% at 50% -12%, #12151d 0%, #0a0c12 52%, #050609 100%);

  /* Glass — defined, sleek: sharp translucency, crisp edge, subtle depth + top highlight */
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-bg-2: rgba(161, 191, 228, 0.08);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-blur: 18px;
  --glass-radius: 14px;
  --glass-shadow: 0 12px 44px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.14);

  /* Text & lines (light on black) */
  --text: #F4F8FF;
  --text-2: #BFDBFE;
  --accent: #a1bfe4;
  --brass: #C79A4B;
  --rule: rgba(161, 191, 228, 0.20);
  --rule-strong: rgba(161, 191, 228, 0.40);

  /* Type */
  --font-display: "Helvetica Neue", "Helvetica", Arial, system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", monospace;

  /* Scale */
  --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.94rem);
  --step-0: clamp(1rem, 0.95rem + 0.25vw, 1.15rem);
  --step-1: clamp(1.33rem, 1.2rem + 0.6vw, 1.7rem);
  --step-2: clamp(1.77rem, 1.5rem + 1.3vw, 2.6rem);
  --step-3: clamp(2.36rem, 1.9rem + 2.3vw, 4rem);
  --step-4: clamp(3.15rem, 2.3rem + 4.3vw, 6.5rem);

  /* Layout */
  --gutter: clamp(1.25rem, 4vw, 5rem);
  --maxw: 1400px;
  --nav-h: 76px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.68;
  color: var(--text);
  background: #07080c;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
em { font-style: italic; color: var(--text); }
::selection { background: var(--accent); color: #0a0c12; }

/* ---------- Blueprint background ---------- */
.blueprint {
  position: fixed; inset: 0; z-index: -2;
  background: radial-gradient(135% 120% at 50% -12%, #12151d 0%, #0a0c12 52%, #050609 100%);
  overflow: hidden;
}
/* Blueprint grid retired — deep dark backdrop. Elements kept so motion JS stays safe. */
.grid-layer { display: none; }
.grid-fine { display: none; }
.vignette {
  position: absolute; inset: 0;
  background: radial-gradient(120% 92% at 50% -8%, transparent 44%, rgba(0,0,0,0.55) 100%);
}

/* ---------- Shared type helpers ---------- */
.display { font-family: var(--font-display); font-weight: 400; line-height: 1.05; letter-spacing: -0.012em; }
.mono { font-family: var(--font-mono); font-weight: 400; letter-spacing: 0.14em; text-transform: uppercase; font-size: var(--step--1); }
.fig {
  font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.18em;
  font-size: var(--step--1); color: var(--text-2);
  display: inline-flex; align-items: center; gap: 0.6em;
}
.fig span { color: rgba(244,248,255,0.5); }

/* ---------- Glass panel ---------- */
.glass {
  background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.035));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(130%);
  backdrop-filter: blur(var(--glass-blur)) saturate(130%);
  border: 1px solid var(--glass-border);
  border-radius: var(--glass-radius);
  box-shadow: var(--glass-shadow);
}
.panel { padding: clamp(1.5rem, 3vw, 2.6rem); }
.panel-kicker { color: var(--text-2); margin-bottom: 1.1rem; }
.glass .lead { font-size: var(--step-1); line-height: 1.4; font-family: var(--font-display); font-weight: 400; margin-bottom: 1rem; }
.glass p + p { margin-top: 0.85rem; color: rgba(244,248,255,0.80); }

/* ---------- Footer mark (CSS mask → brand navy) ---------- */
.mark {
  display: inline-block;
  background-color: var(--accent);
  -webkit-mask: var(--src) center / contain no-repeat;
  mask: var(--src) center / contain no-repeat;
}
.mono-mark { width: 23px; height: 33px; }
.word-mark { width: 150px; height: 22px; }

/* ---------- Header lockup — light brand marks on the dark page ---------- */
/* DI monogram baked near-white, wordmark in its original light blue: both read on black. */
.logo-wrap {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 2px 3px; border-radius: 8px;
  background: transparent; border: 1px solid transparent;
  transition: background .3s ease, border-color .3s ease;
}
.brand-di, .brand-wordmark { width: auto; display: block; }
.brand-di { height: 33px; }
.brand-wordmark { height: 22px; }

/* JS measures the page background; on this dark theme the light marks read directly,
   so the wrap stays clear. On a light page it would add a subtle chip instead. */
.lockup.bg-dark .logo-wrap { background: transparent; }
.lockup.bg-light .logo-wrap { background: rgba(10, 12, 18, 0.06); }

/* ============ Nav ============ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--gutter);
  transition: background .4s ease, backdrop-filter .4s ease, border-color .4s ease, height .3s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  height: 62px;
  background: rgba(10,12,18,0.6);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(130%);
  backdrop-filter: blur(var(--glass-blur)) saturate(130%);
  border-bottom: 1px solid var(--rule);
}
.lockup { display: inline-flex; align-items: center; gap: 12px; }
.lockup .logo-wrap { transition: opacity .3s, background .3s ease, border-color .3s ease; }
.nav-links { display: flex; gap: clamp(1.4rem, 3vw, 2.8rem); }
.nav-links a {
  font-family: var(--font-display); font-size: var(--step-0); font-weight: 500;
  letter-spacing: 0.01em; position: relative; padding: 4px 0; color: rgba(244,248,255,0.82);
  transition: color .25s;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0;
  background: #a1bfe4; transition: width .3s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active::after, .nav-links a:hover::after { width: 100%; }
.nav-toggle { display: none; }

/* ============ Hero ============ */
.hero {
  position: relative; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: var(--nav-h) var(--gutter) 8vh;
  overflow: hidden;
}
.hero-media { position: absolute; inset: 0; z-index: -1; }
.hero-embed {
  width: 100%; height: 100%; border: 0; display: block;
  opacity: 0; transition: opacity 1.2s ease;
  pointer-events: none;          /* decorative auto-rotating background — never hijacks scroll/clicks */
}
.hero-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(7,8,12,0.35) 0%, rgba(7,8,12,0.12) 42%, rgba(7,8,12,0.92) 100%),
    radial-gradient(64% 54% at 50% 46%, rgba(7,8,12,0.32), transparent 72%);
}
.hero-inner { max-width: var(--maxw); width: 100%; margin: 0 auto; text-align: center; }
.hero-fig { margin-bottom: clamp(1rem, 3vh, 2rem); }
.hero-fig .tick { color: var(--brass); letter-spacing: 0; }
.hero-title {
  font-size: clamp(1.05rem, 5.4vw, 4.4rem); font-weight: 400; text-transform: uppercase;
  letter-spacing: 0.012em; line-height: 1.04; margin-bottom: clamp(1rem, 3vh, 1.8rem);
  text-shadow: 0 2px 28px rgba(0,0,0,0.75), 0 0 6px rgba(0,0,0,0.55);
}
/* Headline: a dot-matrix particle canvas is the authoritative hero text.
   The real text stays in the DOM for screen readers but is visually hidden
   BY DEFAULT (at paint time) — not only after JS adds .canvas-on — so it can
   never flash before the deferred script initialises the canvas (FOUC fix).
   The reduced-motion / no-JS / no-canvas fallbacks below re-reveal it. */
.hero-title .line { display: block; white-space: nowrap; }
.hero-title-text {
  /* visually hidden, still readable by screen readers */
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.hero-canvas { display: none; pointer-events: none; }
.hero-title.canvas-on .hero-canvas {
  display: block; width: 100%; height: clamp(3rem, 11vw, 7rem); margin: 0 auto;
}
/* Fallbacks — show the real headline whenever the particle canvas is NOT used.
   Reduced-motion is handled at paint time (no particle animation ever runs);
   .show-static is added by JS when a 2D canvas context is unavailable. */
@media (prefers-reduced-motion: reduce) {
  .hero-title-text {
    position: static; width: auto; height: auto; margin: 0;
    overflow: visible; clip: auto; display: block;
  }
}
.hero-title.show-static .hero-title-text {
  position: static; width: auto; height: auto; margin: 0;
  overflow: visible; clip: auto; display: block;
}
.hero-title .char, .hero-tag .char {
  display: inline-block;
  visibility: hidden;          /* untyped letters reserve width → no layout jitter */
  position: relative;
}
.hero-title .char.typed, .hero-tag .char.typed { visibility: visible; }
/* zero-width caret element; the bar is drawn via ::after so it never shifts the text */
.hero-title .caret, .hero-tag .caret {
  display: inline-block; width: 0; height: 1em; position: relative; vertical-align: baseline;
}
.hero-title .caret::after, .hero-tag .caret::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 0.07em; height: 0.74em; border-radius: 1px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(161, 191, 228, 0.55);
  animation: caretBlink 1.05s step-end infinite;
}
.hero-title .caret.done::after, .hero-tag .caret.done::after {
  animation: none; opacity: 0; transition: opacity .55s ease;
}
@keyframes caretBlink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }

.hero-sub {
  font-family: var(--font-display); font-weight: 400;
  font-size: var(--step-1); max-width: 32ch; color: var(--text);
  margin: 0 auto clamp(1.4rem, 4vh, 2.4rem); line-height: 1.4;
  text-shadow: 0 1px 18px rgba(0,0,0,0.8), 0 0 4px rgba(0,0,0,0.6);
}
.hero-tag {
  color: var(--text-2);
  white-space: nowrap;                 /* always a single line */
  font-size: min(1.35vw, 1.3rem);      /* scales with viewport so the long line never wraps/clips */
  letter-spacing: 0.04em;
  line-height: 1.5;
  margin: 0.2rem auto 0;
  opacity: 0;                          /* hidden until the typing starts (JS adds .is-typing) */
  text-shadow: 0 1px 16px rgba(0,0,0,0.8), 0 0 4px rgba(0,0,0,0.55);
}
.hero-tag.is-typing { opacity: 1; }

/* Hero content fades in only after the headline finishes (JS adds .hero-revealed) */
.hero-sub, .scroll-cue { opacity: 0; transition: opacity 1s ease; }
.hero.hero-revealed .hero-embed { opacity: 1; }
.hero.hero-revealed .hero-sub,
.hero.hero-revealed .scroll-cue { opacity: 1; }
.scroll-cue {
  position: absolute; left: 50%; bottom: 3vh; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--text-2); font-size: 0.7rem;
}
.scroll-cue svg { stroke: var(--accent); stroke-width: 1.4; fill: none; }
.cue-line { stroke-dasharray: 34; animation: cueDraw 2.2s ease-in-out infinite; }
.cue-arrow { stroke: var(--accent); }
@keyframes cueDraw { 0%,100%{ stroke-dashoffset: 34; } 50%{ stroke-dashoffset: 0; } }

/* ============ Section frame ============ */
section { position: relative; }
.cards, .row-heading, .project, .about, .contact {
  max-width: var(--maxw); margin: 0 auto;
  padding-left: var(--gutter); padding-right: var(--gutter);
}

/* ---------- Projects overview cards ---------- */
.cards { padding-top: clamp(4.5rem, 11vh, 8rem); padding-bottom: clamp(2.5rem, 6vh, 4.5rem); }
.cards-head { margin-bottom: clamp(1.8rem, 4vh, 2.8rem); }
.cards-head .fig { display: block; margin-bottom: 1rem; }
.cards-head h2 { font-size: var(--step-3); margin-bottom: 0.7rem; }
.cards-sub { color: var(--text-2); max-width: 52ch; }

.cards-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 2vw, 1.6rem);
}
.pcard {
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(255,255,255,0.09), rgba(255,255,255,0.035));
  box-shadow: 0 10px 30px rgba(0,0,0,0.42), inset 0 1px 0 rgba(255,255,255,0.12);
  border: 1px solid var(--glass-border);
  border-radius: 18px; overflow: hidden;
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(130%); backdrop-filter: blur(var(--glass-blur)) saturate(130%);
  color: var(--text);
  transition: transform .45s cubic-bezier(.2, .7, .2, 1), border-color .3s, box-shadow .45s, background .3s;
}
.pcard-img { display: block; aspect-ratio: 16 / 11; overflow: hidden; background: rgba(255, 255, 255, 0.03); }
.pcard-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.pcard-body { display: block; padding: 1.05rem 1.2rem 1.3rem; }
.pcard-title { display: block; font-size: var(--step-1); font-weight: 400; letter-spacing: -0.012em; line-height: 1.15; }
.pcard-cat { display: block; color: var(--text-2); margin-top: 0.45rem; letter-spacing: 0.08em; }
.pcard:hover, .pcard:focus-visible {
  transform: translateY(-6px);
  border-color: rgba(161,191,228,0.45);
  box-shadow: var(--glass-shadow);
  background: linear-gradient(180deg, rgba(255,255,255,0.13), rgba(255,255,255,0.05));
}
.pcard:hover .pcard-img img, .pcard:focus-visible .pcard-img img { transform: scale(1.06); }
.pcard:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (max-width: 980px) { .cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .cards-grid { grid-template-columns: 1fr; } }

/* ============ Project sections ============ */
.project { padding-top: clamp(4rem, 9vh, 7rem); padding-bottom: clamp(4rem, 9vh, 7rem); }
.project-head { margin-bottom: clamp(2rem, 5vh, 3.4rem); }
.project-head .fig { display: inline-flex; margin-bottom: 1rem; }
.project-head h2 { font-size: var(--step-3); margin-bottom: 0.7rem; }
.project-head .meta, .meta { color: var(--text-2); }

.project-body {
  display: grid; grid-template-columns: 1.25fr 0.9fr; gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: stretch;
}
.project[data-flip] .project-body { grid-template-columns: 0.9fr 1.25fr; }
.project[data-flip] .media { order: 2; }
.project[data-flip] .panel { order: 1; }

.media { position: relative; }
.media-fig {
  position: relative; height: 100%; min-height: 280px;
  border-radius: var(--glass-radius); overflow: hidden;
  border: 1px solid var(--rule);
  background: rgba(255,255,255,0.03);
}
.media-fig img, .media-fig video { width: 100%; height: 100%; object-fit: cover; }
.media-fig.drawing { background: #f6f7f2; }
.media-fig.drawing img { object-fit: contain; padding: 4%; }
.media-fig.portrait { height: auto; min-height: 0; aspect-ratio: 1074 / 1400; max-width: 440px; margin-inline: auto; }
/* Dashboard leading photo: match the render's own aspect so the full exploded view shows (zoomed out, no side crop) */
#penn-electric-racing-dashboard .media-fig { height: auto; min-height: 0; aspect-ratio: 1800 / 1292; }
.media-cap {
  position: absolute; left: 12px; bottom: 10px; color: #fff;
  background: rgba(8,12,22,0.66); padding: 4px 9px; border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.14);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.media-cap.center { position: static; display: block; text-align: center; background: none; margin-top: 0.9rem; }

.panel { display: flex; flex-direction: column; justify-content: flex-start; }
.panel h3.sm { font-size: var(--step-2); margin: 0.5rem 0; }
.panel .fig { margin-bottom: 0.4rem; }
.panel .meta { margin-bottom: 1.1rem; }

/* ---------- Stats / dimension lines ---------- */
.stats {
  margin-top: 1.8rem; display: flex; flex-direction: column; gap: 1.15rem;
  border-top: 1px solid var(--rule); padding-top: 1.4rem;
}
.stat { position: relative; padding-left: 1.6rem; }
.stat::before {
  content: ""; position: absolute; left: 0; top: 2px; bottom: 2px; width: 1px;
  background: linear-gradient(var(--rule-strong), transparent);
}
.stat::after {
  content: ""; position: absolute; left: -2px; top: 2px; width: 5px; height: 1px;
  background: var(--accent);
}
.stat-num {
  display: block; font-family: var(--font-display); font-weight: 600;
  font-size: var(--step-2); line-height: 1; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.stat-num.nocount { color: var(--brass); }
.stat-label { display: block; font-size: var(--step--1); color: var(--text-2); margin-top: 0.35rem; letter-spacing: 0.01em; text-transform: none; font-family: var(--font-body); }

/* ============ Galleries ============ */
.gallery {
  margin-top: clamp(1.5rem, 4vh, 2.6rem);
  display: grid; gap: clamp(0.6rem, 1.2vw, 1rem);
  grid-template-columns: repeat(4, 1fr);
  grid-auto-flow: dense;
}
.gallery.quad { grid-template-columns: repeat(4, 1fr); }
.shot {
  position: relative; overflow: hidden; border-radius: var(--glass-radius);
  border: 1px solid var(--rule); background: rgba(255,255,255,0.03);
  aspect-ratio: 4 / 3; cursor: pointer;
}
.shot.wide { grid-column: span 2; grid-row: span 2; aspect-ratio: 16 / 11; }
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s cubic-bezier(.2,.7,.2,1), filter .5s; }
.shot:hover img { transform: scale(1.06); filter: brightness(1.06); }
.shot figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: #fff; padding: 0.9rem 0.8rem 0.6rem;
  background: linear-gradient(transparent, rgba(8,16,38,0.82));
  transform: translateY(8px); opacity: 0; transition: opacity .35s, transform .35s;
}
.shot:hover figcaption { opacity: 1; transform: translateY(0); }
.shot.has-video .play {
  position: absolute; inset: 0; margin: auto; width: 56px; height: 56px;
  display: grid; place-items: center; border-radius: 50%;
  background: rgba(0,0,0,0.55); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: transform .3s, background .3s;
}
.shot.has-video .play svg { fill: #fff; margin-left: 3px; }
.shot.has-video:hover .play { transform: scale(1.12); background: rgba(191,219,254,0.25); }

/* ---------- Flagship scrub stage ---------- */
.flagship-stage {
  display: grid; grid-template-columns: 1.35fr 0.85fr; gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: stretch;
}
.scrub-stage {
  position: relative; border-radius: var(--glass-radius); overflow: hidden;
  border: 1px solid var(--rule); background: #0c0e14;
  min-height: 360px; aspect-ratio: 16 / 10;
}
.scrub-video { width: 100%; height: 100%; object-fit: cover; }
.scrub-img { width: 100%; height: 100%; object-fit: cover; object-position: center bottom; display: block; }
.scrub-overlay { position: absolute; inset: 0; pointer-events: none; }
.scrub-cap { position: absolute; left: 14px; bottom: 12px; color: var(--text-2); }
.crosshair { position: absolute; width: 18px; height: 18px; opacity: 0.7; }
.crosshair::before, .crosshair::after { content: ""; position: absolute; background: var(--accent); }
.crosshair::before { left: 50%; top: 0; bottom: 0; width: 1px; transform: translateX(-0.5px); }
.crosshair::after { top: 50%; left: 0; right: 0; height: 1px; transform: translateY(-0.5px); }
.crosshair.tl { left: 10px; top: 10px; } .crosshair.tr { right: 10px; top: 10px; }
.crosshair.bl { left: 10px; bottom: 10px; } .crosshair.br { right: 10px; bottom: 10px; }
.sticky-panel { align-self: start; position: sticky; top: calc(var(--nav-h) + 14px); }

/* ============ Row heading (tier 2) ============ */
.row-heading { padding-top: clamp(4rem, 10vh, 7rem); padding-bottom: 1rem; text-align: left; }
.row-heading .fig { display: block; margin-bottom: 1rem; }
.row-heading h2 { font-size: var(--step-3); margin-bottom: 0.6rem; }
.row-heading .row-sub, .row-sub { color: var(--text-2); max-width: 46ch; }

.project.compact { padding-top: clamp(2.5rem, 6vh, 4rem); padding-bottom: clamp(2.5rem, 6vh, 4rem); }
.project.compact .project-body { grid-template-columns: 1fr 1fr; }
.project.compact[data-flip] .project-body { grid-template-columns: 1fr 1fr; }
.loop-video { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Autoplay video gallery (plays on scroll-in, pauses on scroll-out) ---------- */
.video-gallery-label { display: block; color: var(--text-2); margin: clamp(2rem, 5vh, 3.2rem) 0 1rem; }
.video-gallery {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: clamp(0.6rem, 1.2vw, 1rem);
}
.vshot {
  position: relative; overflow: hidden; border-radius: var(--glass-radius);
  border: 1px solid var(--rule); background: rgba(255, 255, 255, 0.03);
  aspect-ratio: 16 / 10;
}
.vshot video { width: 100%; height: 100%; object-fit: cover; display: block; }
.vshot figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: #fff; padding: 0.9rem 0.8rem 0.6rem; pointer-events: none;
  background: linear-gradient(transparent, rgba(8, 16, 38, 0.82));
}
@media (max-width: 560px) { .video-gallery { grid-template-columns: 1fr; } }

/* ---- Thesio: full-width walkthrough video (controls) + detail panel ---- */
.video-wide { aspect-ratio: 16 / 9; height: auto; min-height: 0; }
.video-wide video { object-fit: contain; background: #05070d; }
/* Lead clip: nudge the cover crop so the phone sits off the right edge with a small gap */
#thesio .project-body .media-fig video { object-position: 32.5% center; }
.thesio-extra { margin-top: clamp(1.4rem, 3vh, 2.2rem); }
.thesio-extra .kicker-sep { margin-top: 1.6rem; }
/* App UI gallery — pre-framed phone mockups (transparent), shown 3:4 with full-frame contain */
.ui-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(0.8rem, 2vw, 1.6rem); margin-top: clamp(1.2rem, 3vh, 2rem); }
.ui-cell { display: flex; flex-direction: column; gap: 0.7rem; margin: 0; }
.ui-cell img { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; background: rgba(255,255,255,0.03); border: 1px solid var(--rule); border-radius: var(--glass-radius); }
.ui-cap { color: var(--text-2); font-size: var(--step--1); line-height: 1.42; text-align: center; }
@media (max-width: 640px) { .ui-gallery { grid-template-columns: repeat(2, 1fr); } }

/* ---- VAWT: technical figure + equation flow (KaTeX-rendered) ---- */
/* VAWT technical breakdown: a woven two-column mosaic of figures and equation
   cards rather than a single vertical stack. Wide elements span the full width. */
.vawt-flow { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(0.9rem, 2vw, 1.5rem); align-items: start; margin-top: clamp(1.1rem, 3vh, 1.8rem); }
.vawt-flow > .vawt-pair, .vawt-flow > .vawt-eq:last-child { grid-column: 1 / -1; }
.vawt-flow > .vawt-fig { align-items: stretch; }
.vawt-flow > .vawt-fig img, .vawt-flow > .vawt-fig .ui-cap, .vawt-pair .vawt-fig img { max-width: 100%; }
@media (max-width: 760px) { .vawt-flow { grid-template-columns: 1fr; } }
.vawt-fig { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 0.7rem; }
/* Compact: cap the figure size so images stay small and several fit comfortably on screen */
.vawt-fig img { width: 100%; max-width: 360px; height: auto; display: block; border: 1px solid var(--rule); border-radius: var(--glass-radius); background: #f6f7f2; }
.vawt-fig .ui-cap { max-width: 360px; }
.vawt-pair { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(0.8rem, 2vw, 1.4rem); align-items: start; justify-items: center; }
.vawt-eq p { margin-bottom: 0.7rem; }
.vawt-eq p:last-child { margin-bottom: 0; }
.vawt-eq .math-block { margin: 0.9rem 0; overflow-x: auto; overflow-y: hidden; }
.vawt-eq .katex { color: var(--text); }
.vawt-eq .katex-display { margin: 0.5em 0; }
@media (max-width: 640px) { .vawt-pair { grid-template-columns: 1fr; } }

/* ---- Water Jet Tower: equation panels (rounded glass), portrait hero clip, wide data strip ---- */
/* .eq-panel reuses the .glass.panel look; these rules just format the KaTeX math inside it */
.eq-panel p { margin-bottom: 0.7rem; }
.eq-panel p:last-child { margin-bottom: 0; }
.eq-panel .math-block { margin: 0.9rem 0; overflow-x: auto; overflow-y: hidden; }
.eq-panel .katex { color: var(--text); }
.eq-panel .katex-display { margin: 0.5em 0; }
/* portrait CAD-render hero video shown whole (no crop), centered and sized down */
.media-fig.water-hero { height: auto; min-height: 0; aspect-ratio: 1044 / 1746; max-width: 460px; margin-inline: auto; }
/* portrait rocket render hero shown whole, centered */
.media-fig.rocket-hero { height: auto; min-height: 0; aspect-ratio: 820 / 1218; max-width: 320px; margin-inline: auto; }
/* Butane leading render enlarged for prominence (scoped so the Iapyx gripper video keeps its size) */
#butane-rocket .media-fig.rocket-hero { max-width: 460px; }
/* full-width nozzle-sizing table strip */
.wt-strip { margin: clamp(1.4rem, 3vh, 2.2rem) auto 0; display: flex; flex-direction: column; gap: 0.7rem; align-items: center; }
.wt-strip img { width: 100%; max-width: 1000px; height: auto; display: block; border: 1px solid var(--rule); border-radius: var(--glass-radius); background: #f6f7f2; }
/* inline COMSOL/code snippets inside equation panels */
.eq-panel code { font-family: var(--font-mono); font-size: 0.85em; background: rgba(255,255,255,0.06); border: 1px solid var(--rule); padding: 0.08em 0.36em; border-radius: 5px; }

/* ---- CFD project: figure galleries (landscape plots/contours, natural aspect) ---- */
.cfd-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(0.8rem, 2vw, 1.4rem); margin-top: clamp(1.1rem, 3vh, 1.8rem); align-items: start; }
.cfd-cell { margin: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.cfd-cell img { width: 100%; height: auto; display: block; border: 1px solid var(--rule); border-radius: var(--glass-radius); background: #f6f7f2; }
.cfd-figure { margin: clamp(1.2rem, 3vh, 2rem) auto 0; display: flex; flex-direction: column; gap: 0.7rem; align-items: center; }
.cfd-figure img { width: 100%; max-width: 760px; height: auto; display: block; border: 1px solid var(--rule); border-radius: var(--glass-radius); background: #f6f7f2; }
@media (max-width: 640px) { .cfd-grid { grid-template-columns: 1fr; } }

/* ---- Project Iapyx: data tables, interactive hand embed, layout helpers ---- */
/* Data-table "charts": clean white cards, black data text, royal-blue headers */
.table-wrap { overflow-x: auto; margin-top: 1.1rem; background: #ffffff; border: 1px solid #dfe5ee; border-radius: 10px; }
.data-table { width: 100%; border-collapse: collapse; font-size: var(--step--1); min-width: 480px; background: #ffffff; }
.data-table th, .data-table td { text-align: left; padding: 0.6rem 0.85rem; border-bottom: 1px solid #e7ecf3; vertical-align: top; line-height: 1.45; }
.data-table thead th { color: #1d4ed8; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; border-bottom: 1px solid #d6deea; }
.data-table tbody td { color: #1f2430; }
.data-table tbody td:first-child { color: #0b1220; white-space: nowrap; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.iapyx-embed { aspect-ratio: 16 / 9; min-height: 0; height: auto; background: #04060a; }
.iapyx-embed iframe { width: 100%; height: 100%; border: 0; display: block; }
/* leading/hero interactive robot-hand embed (next to the description) */
.media-fig.iapyx-hero-embed { aspect-ratio: 4 / 5; min-height: 0; height: auto; max-width: 560px; margin-inline: auto; background: #04060a; overflow: hidden; }
/* View-only 3D embed: pointer-events:none lets the cursor pass through to the page,
   so the custom cursor keeps following over the rectangle (no freeze / native-cursor
   flash) and the iframe receives no drag events. Mirrors the .hero-embed pattern. */
.media-fig.iapyx-hero-embed iframe { width: 100%; height: 100%; border: 0; display: block; pointer-events: none; }
.cfd-cell-wide { grid-column: 1 / -1; }
.iapyx-pair { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(0.6rem, 1.5vw, 1rem); margin-top: 1.1rem; }
@media (max-width: 640px) { .iapyx-pair { grid-template-columns: 1fr; } }
/* two-column market/business sections: narrative card + chart card, side by side */
.iapyx-cols { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(0.9rem, 2vw, 1.6rem); margin-top: clamp(1.1rem, 3vh, 1.8rem); align-items: start; }
.iapyx-cols .panel { justify-content: flex-start; }
.iapyx-cols .data-table { min-width: 0; }
.iapyx-cols .data-table td:first-child { white-space: normal; }
@media (max-width: 900px) { .iapyx-cols { grid-template-columns: 1fr; } }

/* ============ Density reduction: technical project sections ============ */
/* CFD, VAWT, Hydrostatic Thrust Tower, Water-Butane Rocket, Iapyx.
   Non-leading figures shrink so several fit per screen, and equation/
   explanatory panels read as compact rounded chips beside their figure. */
/* Leading rows (those holding the .lead summary) and any video/3D media keep
   their full original size; only supporting still figures shrink. */
#butane-rocket .project-body:not(:has(.lead)),
#iapyx .project-body:not(:has(.lead)) {
  align-items: start; gap: clamp(1rem, 2.4vw, 1.9rem);
}
#butane-rocket .project-body:not(:has(.lead)) .media-fig:not(:has(video)),
#iapyx .project-body:not(:has(.lead)) .media-fig:not(:has(video)) {
  height: clamp(200px, 25vw, 310px); min-height: 0;
}

/* Reduced mosaic galleries (CFD + Hydrostatic Thrust Tower): images and info boxes interleaved */
.cfd-mosaic, .wt-mosaic { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(0.9rem, 2vw, 1.5rem); align-items: start; margin-top: clamp(1.1rem, 3vh, 1.8rem); }
@media (max-width: 760px) { .cfd-mosaic, .wt-mosaic { grid-template-columns: 1fr; } }
/* compact rounded info box for bullets (reuses the glass panel look) */
.info-box { padding: clamp(1rem, 2vw, 1.4rem) clamp(1.1rem, 2.2vw, 1.6rem); border-radius: 14px; }
.info-box .panel-kicker { margin-bottom: 0.6rem; }
.info-box .course-list { margin: 0.2rem 0 0; }
.info-box .course-list li { margin: 0.55rem 0; }
.info-box p { margin: 0; font-size: var(--step--1); line-height: 1.55; }
/* standalone full-width figures stop dominating the column */
.cfd-figure, .wt-strip { max-width: 540px; margin-inline: auto; }
/* pack the velocity / drag sweeps denser so many tiles fit per screen */
#cfd-project .cfd-grid { grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); }
#iapyx .cfd-grid img { max-width: 340px; margin-inline: auto; }
/* equation / explanatory panels: compact, rounded, lighter */
.eq-panel, .vawt-eq {
  padding: clamp(0.85rem, 1.7vw, 1.2rem) clamp(0.95rem, 1.9vw, 1.4rem);
  border-radius: 14px;
}
.eq-panel .panel-kicker, .vawt-eq .panel-kicker { margin-bottom: 0.5rem; }
.eq-panel p, .vawt-eq p { font-size: var(--step--1); margin-bottom: 0.5rem; line-height: 1.5; }
.eq-panel .math-block, .vawt-eq .math-block { margin: 0.55rem 0; }
.eq-panel .katex, .vawt-eq .katex { font-size: 0.9em; }

/* Stirling Engine: leading description as a light card with black text */
#stirling-engine .sticky-panel { background: #f4f5f2; border-color: #d9ddd2; }
#stirling-engine .sticky-panel .lead,
#stirling-engine .sticky-panel p { color: #0b0d10; }
#stirling-engine .sticky-panel .panel-kicker { color: #6b5526; }
#stirling-engine .sticky-panel .stat-num { color: #0b0d10; }
#stirling-engine .sticky-panel .stat-label { color: #3a3f47; }

/* ---------- Huey device frames (iPad / tablet) ---------- */
.device-row { display: flex; gap: clamp(0.6rem, 1.6vw, 1.3rem); justify-content: center; align-items: flex-end; }
.device {
  position: relative;
  display: block; padding: 11px; border-radius: 20px;   /* even tablet bezel + smaller corners */
  background: linear-gradient(160deg, #2a2a2e, #121214);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 18px 50px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.08);
  flex: 1 1 0; max-width: 250px;
}
.device::before {                                        /* front camera (top-center, iPad portrait) */
  content: ""; position: absolute; top: 4px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: rgba(255,255,255,0.22);
}
.device-row .device:nth-child(2) { transform: translateY(-16px); }
.device img { border-radius: 11px; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }

/* Full iPad-frame gallery (all remaining app screens) */
.device-gallery {
  margin-top: clamp(1.4rem, 3.5vh, 2.4rem);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: clamp(1.3rem, 2.8vw, 2.1rem) clamp(0.9rem, 2vw, 1.5rem);
  align-items: start;
}
.dev-cell { display: flex; flex-direction: column; align-items: center; gap: 0.7rem; margin: 0; }
.dev-cell .device { flex: none; width: 100%; max-width: none; }
.dev-cell figcaption {
  color: var(--text-2); text-align: center; font-size: 0.58rem;
  letter-spacing: 0.1em; line-height: 1.45;
}

/* ============ About ============ */
.about { padding-top: clamp(5rem, 12vh, 9rem); padding-bottom: clamp(4rem, 9vh, 7rem); }
.about-grid { display: grid; grid-template-columns: 0.6fr 1.4fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.about-portrait .media-fig { aspect-ratio: 1 / 1; min-height: 0; max-width: 320px; border-radius: 20px; position: sticky; top: calc(var(--nav-h) + 14px); }
.about-body .fig { display: block; margin-bottom: 1rem; }
.about-body h2 { font-size: var(--step-3); margin-bottom: 1.2rem; }
.about-lead { font-family: var(--font-display); font-weight: 400; font-size: var(--step-1); line-height: 1.45; margin-bottom: 2rem; max-width: 42ch; }
.spec-sheet { padding: clamp(1.4rem, 3vw, 2.2rem); }
.spec-title { color: var(--text-2); border-bottom: 1px solid var(--rule); padding-bottom: 0.9rem; margin-bottom: 0.4rem; }
.spec div { display: grid; grid-template-columns: 92px 1fr; gap: 1rem; align-items: baseline; padding: 0.7rem 0; border-bottom: 1px solid var(--rule); }
.spec div:last-child { border-bottom: 0; }
.spec dt { color: var(--brass); }
.spec dd { color: rgba(244,248,255,0.86); font-size: var(--step-0); }

/* ---- Coursework (by semester) ---- */
.coursework-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1.2rem, 3vw, 2.2rem); margin-top: 1.1rem; align-items: start; }
.term-title { font-family: var(--font-display); font-weight: 600; font-size: var(--step-1); color: var(--text); margin-bottom: 0.65rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--rule); }
.course-list { list-style: disc; padding-left: 1.15rem; }
.course-list li { font-size: var(--step-0); color: rgba(244,248,255,0.86); line-height: 1.42; margin: 0.34rem 0; }
.course-list li::marker { color: var(--brass); }
.course-list .c-code { color: var(--brass); font-size: var(--step--1); letter-spacing: 0.02em; margin-right: 0.3rem; }
.course-list .c-note { color: var(--text-2); font-size: var(--step--1); }
/* STAR-style leading summaries: uppercase Situation/Task/Action/Result labels */
.star-list { margin-top: 0.2rem; }
.star-list li { margin: 0.5rem 0; }
.star-list .c-code { text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; margin-right: 0.45rem; }

/* ============ Contact ============ */
.contact { padding-top: clamp(3rem, 7vh, 5rem); padding-bottom: clamp(5rem, 11vh, 8rem); display: flex; justify-content: flex-end; }
.title-block { width: min(560px, 100%); padding: clamp(1.6rem, 3vw, 2.6rem); }
.tb-head { display: flex; justify-content: space-between; align-items: center; color: var(--text-2); border-bottom: 1px solid var(--rule); padding-bottom: 0.9rem; }
.tb-rev { color: var(--brass); }
.title-block h2 { font-size: var(--step-2); margin: 1.2rem 0 0.6rem; }
.contact-sub { color: var(--text-2); margin-bottom: 1.6rem; max-width: 40ch; }
.tb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; }
.tb-cell { padding: 1.1rem 1.2rem; background: rgba(255,255,255,0.03); display: flex; flex-direction: column; gap: 0.45rem; transition: background .3s; }
.tb-cell:hover { background: rgba(161,191,228,0.10); }
.tb-label { color: var(--text-2); }
.tb-value { font-family: var(--font-display); font-size: var(--step-1); }
.tb-value .arrow { color: var(--accent); }
/* LinkedIn icon link */
.tb-cell .li-icon { width: 30px; height: 30px; display: block; fill: var(--accent); transition: fill .25s, transform .25s; }
.tb-cell:hover .li-icon, .tb-cell:focus-visible .li-icon { fill: var(--text); transform: translateY(-1px); }
/* Email shown as an image (no scrapable text / mailto) */
.tb-email { gap: 0.6rem; }
.email-img { display: block; height: 30px; width: auto; border-radius: 5px; box-shadow: 0 1px 6px rgba(0,0,0,0.35); }

/* ============ Footer ============ */
.footer {
  max-width: var(--maxw); margin: 0 auto; padding: 2.2rem var(--gutter) 3rem;
  display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap;
  border-top: 1px solid var(--rule); color: var(--text-2);
}
.mono-mark.sm { width: 17px; height: 24px; background-color: var(--text); }
.footer p { flex: 1; min-width: 240px; }
.back-top { color: var(--text-2); transition: color .25s; }
.back-top:hover { color: var(--text); }

/* ============ Lightbox ============ */
.lightbox {
  position: fixed; inset: 0; z-index: 200; display: none;
  align-items: center; justify-content: center;
  background: rgba(7,14,32,0.86); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  padding: clamp(1rem, 5vw, 4rem);
}
.lightbox.open { display: flex; }
.lb-stage { max-width: 92vw; max-height: 82vh; display: grid; place-items: center; }
.lb-stage img, .lb-stage video { max-width: 92vw; max-height: 82vh; border-radius: 8px; border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow); }
.lb-close { position: absolute; top: 22px; right: 26px; color: #fff; background: none; border: 1px solid rgba(255,255,255,0.3); border-radius: 8px; padding: 8px 12px; cursor: pointer; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); font-size: 2.4rem; color: #fff; background: none; border: none; cursor: pointer; padding: 0 1rem; opacity: 0.7; transition: opacity .25s; }
.lb-nav:hover { opacity: 1; }
.lb-prev { left: 1vw; } .lb-next { right: 1vw; }
.lb-cap { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,0.7); }

/* ============ Reveal animations ============ */
.reveal-up { opacity: 0; transform: translateY(28px); }
.is-in { opacity: 1; transform: none; transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1); }
/* hero title now fades in via the .hero-title .line keyframes above */

/* ============ Responsive ============ */
@media (max-width: 980px) {
  .project-body, .project[data-flip] .project-body,
  .project.compact .project-body, .flagship-stage, .about-grid {
    grid-template-columns: 1fr;
  }
  .coursework-grid { grid-template-columns: 1fr; }
  .project[data-flip] .media, .project[data-flip] .panel { order: 0; }
  .sticky-panel, .about-portrait .media-fig { position: static; }
  .shot.wide { grid-column: span 2; grid-row: span 1; aspect-ratio: 16/9; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .about-portrait .media-fig { min-height: 0; max-width: 320px; margin-inline: auto; }
}

@media (max-width: 640px) {
  :root { --glass-blur: 12px; }
  .nav-links {
    position: fixed; inset: 0 0 auto auto; top: 0; height: 100svh; width: min(78vw, 320px);
    flex-direction: column; justify-content: center; gap: 1.6rem; padding: 2rem 2.4rem;
    background: rgba(10,12,18,0.92); -webkit-backdrop-filter: blur(20px) saturate(130%); backdrop-filter: blur(20px) saturate(130%);
    border-left: 1px solid var(--rule);
    transform: translateX(100%); transition: transform .4s cubic-bezier(.4,0,.1,1);
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links a { font-size: var(--step-2); }
  .brand-di { height: 27px; }
  .brand-wordmark { height: 18px; }
  .nav-toggle {
    display: inline-flex; flex-direction: column; gap: 6px; background: none; border: none;
    cursor: pointer; padding: 8px; z-index: 101;
  }
  .nav-toggle span { width: 26px; height: 2px; background: var(--text); transition: transform .3s, opacity .3s; }
  .nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .gallery, .gallery.quad { grid-template-columns: 1fr 1fr; }
  .shot.wide { grid-column: span 2; }
  .contact { justify-content: stretch; }
  .tb-grid { grid-template-columns: 1fr; }
  .device-row .device:nth-child(2) { transform: none; }
  .spec div { grid-template-columns: 72px 1fr; gap: 0.7rem; }
  .device-row { flex-wrap: wrap; }
}

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal-up { opacity: 1; transform: none; }
  .hero-title .char, .hero-tag .char { visibility: visible; }
  .hero-title .caret, .hero-tag .caret { display: none; }
  .hero-tag { opacity: 1; }
  .hero-embed { display: none; }
}

/* ============ Custom cursor — inverting circle (mouse devices only) ============ */
:root {
  --cursor-size: 34px;
  --cursor-press-scale: 0.78;
  --cursor-trans: 110ms;
}
#custom-cursor { display: none; }

@media (hover: hover) and (pointer: fine) {
  /* hide the native cursor only once JS activates the custom one */
  html.has-custom-cursor, html.has-custom-cursor * { cursor: none !important; }

  #custom-cursor {
    display: block;
    position: fixed; left: 0; top: 0; z-index: 9000;   /* high (above content); pointer-events:none keeps it non-blocking */
    width: var(--cursor-size); height: var(--cursor-size);
    margin: calc(var(--cursor-size) / -2) 0 0 calc(var(--cursor-size) / -2); /* centre on the pointer */
    border-radius: 50%;
    background: #fff;
    mix-blend-mode: difference;                        /* visual negative of whatever is behind it */
    pointer-events: none;                              /* never blocks interaction */
    opacity: 0;
    /* soft feathered edge so it reads over varied backgrounds without a hard clip */
    -webkit-mask: radial-gradient(circle, #000 60%, rgba(0, 0, 0, 0.45) 82%, transparent 100%);
            mask: radial-gradient(circle, #000 60%, rgba(0, 0, 0, 0.45) 82%, transparent 100%);
    /* Position via the independent `translate` property (fed by --cx/--cy from JS).
       It is intentionally NOT transitioned → the cursor follows the pointer with
       zero trailing. Only `scale` (hover/press) and opacity are smoothed. Both
       translate & scale are compositor-only properties (no layout/paint). */
    translate: var(--cx, -120px) var(--cy, -120px);
    scale: 1;
    transition: scale var(--cursor-trans) ease, opacity 0.2s ease;
    will-change: translate, scale;
  }
  #custom-cursor.visible { opacity: 1; }
  /* hovering an interactive element: grow (keeps the inversion) */
  #custom-cursor.over-clickable { scale: 1.55; }
  /* pressed: shrink noticeably (overrides hover) */
  #custom-cursor.pressed { scale: var(--cursor-press-scale); }

  /* reduced-motion: drop the transform smoothing/trailing (instant follow) */
  @media (prefers-reduced-motion: reduce) {
    #custom-cursor { transition: opacity 0.2s ease; }
  }
}
