/* =========================================================
   Mitchell Douglas — site styles
   ========================================================= */

:root {
  --bg: #000;
  --fg: #ececf4;
  --muted: #8b8ba3;
  --line: rgba(255, 255, 255, 0.09);
  --panel: rgba(8, 8, 14, 0.72);

  --magenta: #ff2bd6;
  --cyan: #00e5ff;
  --red: #ff2646;
  --gold: #ffc43c;
  --violet: #965aff;

  --display: 'Monoton', 'Arial Black', sans-serif;
  --sans: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;

  --gutter: clamp(16px, 4vw, 40px);
  --radius: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { background: var(--bg); color-scheme: dark; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

/* Faint CRT scanlines over everything */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}

/* ---------- laser canvas & overlays ---------- */
#lasers {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  transition: opacity 2.5s ease;
}
body.revealed #lasers { opacity: 0.6; }

#sweep {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  z-index: 40;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(90deg, transparent, var(--magenta) 20%, #fff 50%, var(--cyan) 80%, transparent);
  box-shadow: 0 0 18px 4px rgba(255, 43, 214, 0.6), 0 0 40px 8px rgba(0, 229, 255, 0.35);
}
#sweep.go { animation: sweep 0.7s cubic-bezier(0.5, 0, 0.2, 1); }
@keyframes sweep {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(100vh); opacity: 0; }
}

/* ---------- site shell ---------- */
.site {
  position: relative;
  z-index: 2;
  opacity: 0;
  visibility: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body.revealed .site { opacity: 1; visibility: visible; transition: opacity 1.2s ease 0.15s; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px var(--gutter);
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.55));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.logo {
  font-family: var(--display);
  font-size: 1.7rem;
  line-height: 1;
  text-decoration: none;
  color: #fff;
  text-shadow: 0 0 6px #fff, 0 0 16px var(--magenta);
  margin-right: auto;
}

.site-header nav ul { display: flex; gap: 4px; list-style: none; }
.site-header nav a {
  position: relative;
  display: block;
  padding: 8px 14px;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.2s;
}
.site-header nav a:hover { color: #fff; }
.site-header nav a[aria-current='page'] { color: #fff; }
.site-header nav a[aria-current='page']::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--magenta), var(--cyan));
  box-shadow: 0 0 10px var(--magenta), 0 0 14px var(--cyan);
}

/* Speaker sound toggle — muted by default */
.sound-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.sound-btn:hover { color: #fff; border-color: rgba(255, 255, 255, 0.3); }
.sound-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sound-btn .spk { fill: currentColor; }
.sound-btn .spk-waves { display: none; }
.sound-btn.playing { color: #fff; border-color: var(--cyan); box-shadow: 0 0 14px rgba(0, 229, 255, 0.35); }
.sound-btn.playing .spk-waves { display: inline; }
.sound-btn.playing .spk-mute { display: none; }

main {
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(24px, min(6vw, 5vh), 72px) var(--gutter) 80px;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 24px var(--gutter);
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.7);
  font-family: var(--mono);
  font-size: 0.75rem;
  align-items: center;
}
.muted { color: var(--muted); }

/* Footer contact: name · email · social icons */
.footer-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.footer-sep { color: var(--muted); }
.footer-email { color: var(--cyan); text-decoration: none; }
.footer-email:hover { text-decoration: underline; text-underline-offset: 3px; text-shadow: 0 0 10px rgba(0, 229, 255, 0.6); }
.footer-social { display: flex; gap: 8px; margin-left: 4px; }
.footer-social a {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--muted);
  transition: color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.footer-social a:hover { color: #fff; border-color: var(--cyan); box-shadow: 0 0 12px rgba(0, 229, 255, 0.4); }
.footer-social svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.footer-social svg .dot, .footer-social svg.filled { fill: currentColor; stroke: none; }

/* ---------- page entrance animation ---------- */
body.revealed .page > * { animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
body.revealed .page > *:nth-child(2) { animation-delay: 0.12s; }
body.revealed .page > *:nth-child(3) { animation-delay: 0.24s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(24px); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}

/* ---------- shared type ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.6);
  margin-bottom: 18px;
}

.title {
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.lede { font-size: clamp(1.1rem, 2vw, 1.3rem); color: #cfcfe0; max-width: 60ch; }

.page-head { margin-bottom: clamp(32px, 5vw, 56px); }
.page-head .btn { margin-top: 24px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.5);
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.btn:hover { border-color: var(--cyan); box-shadow: 0 0 18px rgba(0, 229, 255, 0.35); transform: translateY(-2px); }
.btn-primary { border-color: var(--magenta); box-shadow: 0 0 16px rgba(255, 43, 214, 0.3), inset 0 0 14px rgba(255, 43, 214, 0.15); }
.btn-primary:hover { border-color: var(--magenta); box-shadow: 0 0 28px rgba(255, 43, 214, 0.6), inset 0 0 18px rgba(255, 43, 214, 0.25); }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 28px);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.panel-title {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--magenta);
  margin-bottom: 20px;
}

.plain { list-style: none; display: grid; gap: 10px; color: #cfcfe0; }
.plain li { padding-left: 18px; position: relative; }
.plain li::before { content: '▸'; position: absolute; left: 0; color: var(--cyan); }

/* ---------- HOME ---------- */
/* Home: sized by screen height as well as width, so the three cards show without scrolling */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: clamp(20px, 4vh, 44px);
}
.hero .eyebrow { margin-bottom: clamp(10px, 2vh, 18px); }

.name {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.5rem, min(10.5vw, 12vh), 8rem);
  line-height: 1.08;
  color: #fff;
  margin-bottom: 28px;
}
.name .line { display: block; white-space: nowrap; }
.name .line:nth-child(1) { text-shadow: 0 0 4px #fff, 0 0 16px var(--magenta), 0 0 40px var(--magenta); }
.name .line:nth-child(2) { text-shadow: 0 0 4px #fff, 0 0 16px var(--cyan), 0 0 40px var(--cyan); }
.char { display: inline-block; opacity: 0; }
body.revealed .char { opacity: 1; animation: neon 1.4s calc(var(--i) * 70ms + 0.3s) both; }
body.revealed .name .line:nth-child(2) .char { animation-delay: calc(var(--i) * 70ms + 0.75s); }
@keyframes neon {
  0% { opacity: 0; filter: blur(10px); }
  8% { opacity: 1; filter: none; }
  12% { opacity: 0.15; }
  18% { opacity: 1; }
  24% { opacity: 0.35; }
  30%, 100% { opacity: 1; }
}

/* ---------- dancing avatar ---------- */
.hero-id {
  display: flex;
  align-items: center;
  gap: clamp(10px, 3vw, 40px);
  margin-bottom: clamp(14px, 3vh, 28px);
}
.hero-id .name { margin-bottom: 0; }

.avatar {
  /* EDIT: make the avatar look like you */
  --av-skin: #d2a57b;  /* olive-leaning fair */
  --av-hair: #5b3a22;  /* brown */
  --av-shirt: #ff7a1a; /* orange */
  --av-pants: #3b679e; /* denim */
  --av-shoe: #f2f2f7;
  --av-lens: #0a0a10;
  --av-line: var(--magenta);

  position: relative;
  flex: 0 0 auto;
  width: clamp(70px, 18vw, 170px);
  aspect-ratio: 160 / 300;
}
/* Stage in the top bar between the logo and the nav */
.bar-stage {
  position: relative;
  flex: 1 1 auto;
  align-self: stretch;
  min-width: 0;
  margin: -14px clamp(8px, 2vw, 24px);
}
.avatar { z-index: 11; }
/* In the bar his soles sit exactly on the header's bottom edge (the svg has 13/160 of its width below the soles). */
.avatar.in-bar { position: absolute; left: 0; width: 34px; bottom: calc(34px * -13 / 160); }

.avatar svg {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 0 4px rgba(255, 43, 214, 0.7)) drop-shadow(0 0 12px rgba(0, 229, 255, 0.3));
}
.avatar svg :is(rect, circle, path) { stroke: var(--av-line); stroke-width: 1.6; stroke-linejoin: round; }
.avatar .skin { fill: var(--av-skin); }
.avatar .hair { fill: var(--av-hair); }
.avatar .shirt { fill: var(--av-shirt); }
.avatar .pants { fill: var(--av-pants); }
.avatar .shoe { fill: var(--av-shoe); }
.avatar .lens { fill: var(--av-lens); }
.avatar .ln { fill: none; stroke-linecap: round; }
.avatar line.o { stroke: var(--av-line); }
.avatar line.skin { stroke: var(--av-skin); }
.avatar line.shirt { stroke: var(--av-shirt); }
.avatar line.pants { stroke: var(--av-pants); }
.avatar svg .glint { fill: none; stroke: rgba(255, 255, 255, 0.75); stroke-width: 1.2; stroke-linecap: round; }
.avatar .detail { fill: none; stroke: #1a0f0a; stroke-width: 2; stroke-linecap: round; }

/* Spotlight + floor glow, pulsing on the beat */
.avatar::before,
.avatar::after { content: ''; position: absolute; pointer-events: none; }
.avatar::before { opacity: calc(0.4 + 0.6 * var(--pulse, 0)); inset: -10% -40% 0; background: radial-gradient(ellipse at 50% 100%, rgba(255, 43, 214, 0.22), transparent 65%); }
.avatar::after { opacity: calc(0.45 + 0.55 * var(--pulse, 0)); left: 0; right: 0; bottom: -4%; height: 9%; border-radius: 50%; background: radial-gradient(ellipse, rgba(0, 229, 255, 0.55), transparent 70%); }

.tagline { font-size: clamp(1.15rem, 2.4vw, 1.5rem); color: #d6d6e6; max-width: 40ch; margin-bottom: clamp(18px, 3.5vh, 36px); }
.cta { display: flex; flex-wrap: wrap; gap: 14px; }

.highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.highlight {
  padding: clamp(16px, 2.6vh, 24px) 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.hl-num { font-family: var(--mono); font-size: 0.75rem; color: var(--magenta); letter-spacing: 0.2em; }
.highlight h3 { font-size: 1.15rem; margin: 10px 0 6px; }
.highlight p { color: var(--muted); font-size: 0.98rem; }

/* ---------- CV ---------- */
.cv-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
.cv-side { display: grid; gap: 20px; }

.timeline { list-style: none; position: relative; display: grid; gap: 30px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--magenta), var(--cyan));
  box-shadow: 0 0 10px rgba(255, 43, 214, 0.6);
}
.timeline > li { position: relative; padding-left: 30px; }
.timeline > li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #000;
  border: 2px solid var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}
.timeline.compact { gap: 18px; }
.when { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.12em; color: var(--cyan); }
.timeline h4 { font-size: 1.2rem; margin-top: 4px; }
.where { color: var(--muted); font-size: 0.95rem; margin-bottom: 10px; }
.timeline ul { padding-left: 18px; color: #cfcfe0; display: grid; gap: 6px; }
.timeline ul li::marker { color: var(--magenta); }

.chips, .tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(0, 229, 255, 0.35);
  background: rgba(0, 229, 255, 0.06);
  font-family: var(--mono);
  font-size: 0.78rem;
}

/* ---------- CV: cloud / terminal theme ---------- */
.cv-tech { position: relative; }
/* Faint blueprint grid behind the page */
.cv-tech::before {
  content: '';
  position: absolute;
  inset: -40px calc(var(--gutter) * -1) 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 229, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.35) 60%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.35) 60%, transparent 100%);
}

/* Terminal window */
.term {
  background: rgba(5, 8, 14, 0.85);
  border: 1px solid rgba(0, 229, 255, 0.22);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 24px rgba(0, 229, 255, 0.06);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(0, 229, 255, 0.15);
}
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; flex: none; }
.term-bar i:nth-child(2) { background: #febc2e; }
.term-bar i:nth-child(3) { background: #28c840; }
.term-bar span {
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.term-body { padding: clamp(18px, 3vw, 26px); }

/* Intro terminal */
.term-intro { max-width: 760px; margin-top: 8px; }
.term-intro .term-body { font-family: var(--mono); font-size: 0.9rem; line-height: 1.7; display: grid; gap: 2px; }
.term-intro .out { color: #cfcfe0; margin-bottom: 10px; padding-left: 18px; }
.term-intro .out.hl { color: var(--cyan); text-shadow: 0 0 10px rgba(0, 229, 255, 0.5); }
.prompt { color: var(--green, #46ff96); margin-right: 8px; }
.cursor { display: inline-block; width: 9px; height: 1.1em; vertical-align: text-bottom; background: var(--cyan); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Section labels inside windows, styled as comments */
.cv-group {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: #46ff96;
  opacity: 0.85;
  margin: 4px 0 16px;
}
.term-body .cv-group:not(:first-child) { margin-top: 26px; }
.term-body .cv-group + .chips { margin-top: -6px; }

/* Experience nodes become square "server" nodes on a network line */
.cv-tech .timeline > li::before { border-radius: 3px; transform: rotate(45deg) scale(0.85); }
.cv-tech .when { letter-spacing: 0.06em; }

/* Certification badge */
.cert { display: flex; align-items: center; gap: 14px; }
.cert h4 { font-size: 1.05rem; line-height: 1.3; }
.cert .where { margin-bottom: 0; white-space: nowrap; }
.cert-badge {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  border: 1px solid rgba(255, 153, 0, 0.6);
  background: radial-gradient(circle at 50% 30%, rgba(255, 153, 0, 0.22), rgba(255, 153, 0, 0.04));
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.85rem;
  color: #ffb347;
  box-shadow: 0 0 14px rgba(255, 153, 0, 0.2);
}

.chips-cyan li { border-color: rgba(0, 229, 255, 0.55); background: rgba(0, 229, 255, 0.1); }
.chips-magenta li { border-color: rgba(255, 43, 214, 0.4); background: rgba(255, 43, 214, 0.07); }
.cv-tech .chips li::before { content: '> '; color: var(--muted); }

/* ---------- PROJECTS ---------- */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }

.project {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.project:hover { transform: translateY(-4px); border-color: rgba(255, 43, 214, 0.5); box-shadow: 0 0 36px rgba(255, 43, 214, 0.18); }

.thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
}
div.thumb {
  /* Placeholder art: laser fans in the project's colours */
  background:
    repeating-conic-gradient(from 200deg at 50% 110%, transparent 0 7deg, color-mix(in srgb, var(--a) 70%, transparent) 7deg 7.6deg, transparent 7.6deg 14deg),
    repeating-conic-gradient(from 160deg at 0% 0%, transparent 0 9deg, color-mix(in srgb, var(--b) 55%, transparent) 9deg 9.5deg, transparent 9.5deg 18deg),
    radial-gradient(circle at 50% 110%, color-mix(in srgb, var(--a) 40%, transparent), transparent 60%),
    #050508;
  transition: filter 0.3s ease;
}
.project:hover div.thumb { filter: brightness(1.35) saturate(1.2); }

.project-body { padding: 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.tags li { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--cyan); }
.project h3 { font-size: 1.3rem; }
.project p { color: var(--muted); font-size: 0.98rem; flex: 1; }
.project-links { display: flex; gap: 18px; margin-top: 6px; }
.project-links a {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  border-bottom: 1px solid var(--magenta);
  padding-bottom: 2px;
}
.project-links a:hover { color: var(--magenta); }

/* ---------- ABOUT ---------- */
.about-grid { display: grid; grid-template-columns: minmax(220px, 320px) 1fr; gap: clamp(24px, 4vw, 48px); align-items: start; }

.portrait {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--magenta);
  box-shadow: 0 0 30px rgba(255, 43, 214, 0.45), 0 0 80px rgba(0, 229, 255, 0.2);
}
/* Photo gallery (About page) */
.gallery { margin: 0; display: grid; gap: 12px; outline: none; }
.gallery:focus-visible .gallery-frame { outline: 2px solid var(--cyan); outline-offset: 4px; }
.gallery-frame {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--magenta);
  box-shadow: 0 0 30px rgba(255, 43, 214, 0.45), 0 0 80px rgba(0, 229, 255, 0.2);
  background: #050508;
  touch-action: pan-y;
}
.gallery-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.gallery-img.is-active { opacity: 1; }
/* Slight zoom toward the subject, for photos where he's small in the frame */
.gallery .zoom { transform: scale(1.18); transform-origin: 52% 56%; }

.gallery-nav {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.gallery-nav.prev { left: 10px; }
.gallery-nav.next { right: 10px; }
.gallery-nav:hover { border-color: var(--cyan); box-shadow: 0 0 14px rgba(0, 229, 255, 0.45); background: rgba(0, 0, 0, 0.75); }
.gallery-nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.gallery-count {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: #fff;
}

.gallery-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.gallery-thumbs button {
  padding: 0;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #050508;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.gallery-thumbs button:hover { opacity: 0.85; }
.gallery-thumbs button[aria-current='true'] { opacity: 1; border-color: var(--cyan); box-shadow: 0 0 10px rgba(0, 229, 255, 0.45); }
.gallery-thumbs img { display: block; width: 100%; height: 100%; object-fit: cover; }

div.portrait {
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 40%, rgba(255, 43, 214, 0.25), #000 70%);
  font-family: var(--display);
  font-size: clamp(3rem, 8vw, 5rem);
  color: #fff;
  text-shadow: 0 0 8px #fff, 0 0 24px var(--cyan);
}

.about-body { display: grid; gap: 18px; }
.about-body > p:not(.lede) { color: #cfcfe0; max-width: 65ch; }
.about-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
.contact-links { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .cv-grid, .about-grid { grid-template-columns: 1fr; }
  .portrait { max-width: 220px; }
  .gallery { max-width: 340px; width: 100%; }
}

@media (max-width: 640px) {
  .site-header { flex-wrap: wrap; row-gap: 8px; padding-top: 12px; padding-bottom: 6px; }
  .site-header nav { order: 3; width: 100%; }
  .site-header nav ul { justify-content: space-between; }
  .site-header nav a { padding: 8px 6px; font-size: 0.72rem; letter-spacing: 0.12em; }
  .site-header nav a[aria-current='page']::after { left: 6px; right: 6px; }
  .bar-stage { margin: -12px 8px 0; }
  .footer-sep { display: none; }
  .footer-contact > p { flex-basis: 100%; }
  .avatar.in-bar { width: 28px; bottom: calc(28px * -13 / 160); }
  .about-cols { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: 1fr; }
  .hero { padding-bottom: 16px; }
  .tagline { margin-bottom: 16px; line-height: 1.45; }
  .cta .btn { padding: 10px 18px; }
  .highlights { gap: 8px; }
  .highlight { padding: 11px 16px; }
  .hl-num { display: none; }
  .highlight h3 { margin: 4px 0 2px; font-size: 1.05rem; }
  .highlight p { font-size: 0.92rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
