/* ============================================================
   di-donna.org — design tokens
   Concept: neuroelectric. Analog neural signal (cyan) meets
   digital hardware (violet) across a deep-violet connectome.
   Palette drawn from the connectome brain scan.
   ============================================================ */

:root {
  --void:       #1f1839;   /* page background — matches the connectome brain scan */
  --void-2:     #241d42;   /* secondary bg for gradients */
  --panel:      #271f47;   /* raised panels */
  --panel-2:    #2f2655;   /* lighter panel / hover */
  --hairline:   #3c3062;   /* dividers, borders */
  --text:       #efeafb;   /* cool off-white */
  --muted:      #a99fc6;   /* secondary text */
  --violet:     #b388ff;   /* hardware — digital signal */
  --magenta:    #e879f9;   /* accent highlight */
  --synapse:    #5eead4;   /* wetware — neural signal */
  --amber:      #f0abfc;   /* soft glow accent */

  /* legacy aliases so older rules keep working */
  --graphite:   var(--void);
  --copper:     var(--violet);

  --glow-violet: 0 0 40px -8px rgba(179, 136, 255, 0.45);
  --glow-synapse: 0 0 40px -8px rgba(94, 234, 212, 0.4);

  --font-display: "Syne", system-ui, sans-serif;
  --font-body:    "IBM Plex Sans", system-ui, sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, monospace;

  --maxw: 1100px;
  --pad: clamp(1.25rem, 4vw, 3rem);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--void);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ============ site background video ============ */

.site-bg {
  position: fixed;
  inset: 0;
  z-index: -10;
  overflow: hidden;
  background: var(--void);
}
.site-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
}
/* violet veil + gradient glows keep text readable and on-theme */
.site-bg-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1200px 900px at 50% 120%, rgba(232, 121, 249, 0.10), transparent 60%),
    color-mix(in srgb, var(--void) 62%, transparent);
}
@media (prefers-reduced-motion: reduce) {
  .site-bg-video { display: none; }
}

/* gallery page: neon circuit traces, tinted violet, in place of the terminal
   video. The gif's own frame delays are slowed to 2 fps; no positional drift. */
.site-bg-circuit {
  position: absolute;
  inset: 0;
  background: url("../assets/circuit.gif") 0 0 / 760px auto repeat;
  filter: grayscale(1) sepia(1) hue-rotate(212deg) saturate(3.2) brightness(0.8);
  opacity: 0.16;
}
@media (prefers-reduced-motion: reduce) {
  .site-bg-circuit { background-image: url("../assets/circuit.png"); }
}

.mono { font-family: var(--font-mono); }

::selection { background: var(--violet); color: var(--void); }

a { color: inherit; }

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

/* ============ header ============ */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem var(--pad);
  background: color-mix(in srgb, var(--void) 72%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(90deg, transparent, var(--hairline) 20%, var(--hairline) 80%, transparent) 1;
  transition: background 240ms ease;
}

.wordmark {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
}
.wordmark .tld { color: var(--copper); }

.site-header nav { display: flex; gap: 1.75rem; }

.site-header nav a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: color 160ms ease;
}
.site-header nav a:hover { color: var(--text); }
.site-header nav a[aria-current="page"] {
  color: var(--synapse);
}

/* ============ hero ============ */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
}

/* connectome brain — the custom asset from the original site */
.hero-brain {
  position: absolute;
  left: 50%;
  top: 37%;
  width: clamp(540px, 78%, 1150px);
  aspect-ratio: 828 / 268;
  transform: translate(-50%, -44%);
  z-index: -3;
  pointer-events: none;
  /* rendered at full opacity, unfiltered, so the gif's base color is exactly
     var(--void) and merges seamlessly with the hero::before backdrop */
  background: url("../assets/brain-dark.gif") center / 100% 100% no-repeat;
  animation: brain-breathe 12s ease-in-out infinite;
}
@keyframes brain-breathe {
  0%, 100% { transform: translate(-50%, -44%) scale(1); }
  50%      { transform: translate(-50%, -44%) scale(1.02); }
}

/* solid backdrop in the gif's base color — fills the hero so the video
   background never shows through at the top */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -4;
  background: var(--void);
  pointer-events: none;
}

/* violet vignette + floor glow over the brain */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(120% 80% at 50% 8%, transparent 40%, var(--void) 92%),
    linear-gradient(to bottom, transparent 55%, var(--void) 100%);
  pointer-events: none;
}

#trace {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.9;
}

.hero-inner {
  text-align: center;
  padding: 0 var(--pad);
  position: relative;
  top: -7vh;   /* lift the content block toward the header */
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--violet);
  margin-bottom: 1.25rem;
}

/* hero eyebrow pinned near the top, just below the fixed header */
.hero-eyebrow {
  position: absolute;
  top: 4.25rem;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  white-space: nowrap;
  z-index: 1;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.2rem, 11vw, 8rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  background: linear-gradient(105deg, var(--synapse) 0%, var(--text) 34%, var(--text) 52%, var(--violet) 78%, var(--magenta) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  animation: hue-drift 9s ease-in-out infinite;
  text-shadow: 0 0 60px rgba(179, 136, 255, 0.15);
}
@keyframes hue-drift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .hero h1 { animation: none; }
}

.hero-sub {
  margin-top: 1.5rem;
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--muted);
  white-space: nowrap;
  margin-inline: auto;
}
@media (max-width: 600px) {
  .hero-sub { white-space: normal; max-width: 34ch; }
}

.hero-poles {
  display: flex;
  justify-content: space-between;
  width: min(680px, 82vw);
  margin: 3rem auto 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.pole-analog  { color: var(--synapse); }
.pole-digital { color: var(--copper); }

/* cascade of right-pointing chevrons flowing analog → digital, spanning the screen */
.flow-arrows {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  height: 22px;
  margin-top: 1.5rem;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}
.flow-arrows i {
  position: absolute;
  inset: 0;
  display: block;
  background: linear-gradient(90deg, var(--synapse) 0%, var(--violet) 55%, var(--magenta) 100%);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='22' viewBox='0 0 26 22'%3E%3Cpath d='M8 5 L15 11 L8 17' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") repeat-x left center / 26px 22px;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='22' viewBox='0 0 26 22'%3E%3Cpath d='M8 5 L15 11 L8 17' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") repeat-x left center / 26px 22px;
  animation: arrow-flow 0.85s linear infinite;
  filter: drop-shadow(0 0 6px rgba(179, 136, 255, 0.35));
}
@keyframes arrow-flow {
  to { -webkit-mask-position: 26px center; mask-position: 26px center; }
}
@media (prefers-reduced-motion: reduce) {
  .flow-arrows i { animation: none; }
}

.scroll-hint {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  text-decoration: none;
  color: var(--muted);
  font-size: 0.8rem;
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, 6px); }
}
@media (prefers-reduced-motion: reduce) {
  .scroll-hint { animation: none; }
}

/* ============ sections ============ */

main > section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(4rem, 9vw, 7rem) var(--pad);
  border-top: 1px solid var(--hairline);
}
main > section.hero {
  max-width: none;
  padding: 0;
  border-top: none;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.section-label::before {
  content: "";
  width: 26px;
  height: 2px;
  background: linear-gradient(90deg, var(--violet), var(--synapse));
  border-radius: 2px;
  flex: 0 0 auto;
}

/* ---- about ---- */

.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
}

.about-copy p {
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  line-height: 1.75;
}
.about-copy p + p { margin-top: 1.25rem; }

.spec-sheet {
  border: 1px solid var(--hairline);
  background:
    linear-gradient(180deg, var(--panel-2), var(--panel));
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 50px -30px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255,255,255,0.03);
}
.spec-sheet::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--synapse), var(--violet), var(--magenta));
  opacity: 0.85;
}
.spec-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
}
.spec-row + .spec-row { border-top: 1px solid var(--hairline); }

/* each degree splits at the same point: "Degree," / "University" —
   except on wide screens, where the full line fits unbroken */
.edu-line {
  display: block;
}
.edu-line + .edu-line {
  margin-top: 0.5rem;
}
/* wide screens: enough column for unbroken degree lines */
@media (min-width: 1200px) {
  .edu-line br { display: none; }
  .about-grid { grid-template-columns: 1fr 1.1fr; }
}

.spec-row dt {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--copper);
  padding-top: 0.2em;
}
.spec-row dd {
  font-size: 0.92rem;
  color: var(--text);
}

/* ---- experience timeline ---- */

.timeline {
  list-style: none;
  position: relative;
  margin-left: 0.5rem;
  padding-left: 2rem;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--synapse), var(--violet) 55%, var(--magenta));
  opacity: 0.55;
}

.tl-item {
  position: relative;
  padding-bottom: 2.75rem;
}
.tl-item:last-child { padding-bottom: 0; }

.tl-marker {
  position: absolute;
  left: -2.55rem;
  top: 0.4rem;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--void);
  border: 2px solid var(--violet);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--violet) 16%, transparent), 0 0 14px -2px var(--violet);
  transition: border-color 240ms ease, box-shadow 240ms ease, transform 240ms ease;
}
.tl-item:hover .tl-marker {
  border-color: var(--synapse);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--synapse) 20%, transparent), 0 0 16px -1px var(--synapse);
  transform: scale(1.15);
}

.tl-body {
  display: flex;
  align-items: flex-start;
  gap: 1.1rem;
}
.tl-content {
  flex: 1 1 auto;
  min-width: 0;
}
.tl-logo {
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  object-fit: contain;
  background: #fbfaff;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 7px;
  box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.7);
  transition: transform 240ms ease, box-shadow 240ms ease;
}
.tl-item:hover .tl-logo {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px -10px rgba(179, 136, 255, 0.6);
}
/* OpenAI ships a white mark — give it a dark chip instead of a light one */
.tl-logo--invert { background: #0b0b12; border-color: #26222f; }

/* CNE is a full-bleed square tile — let it fill the chip (no white margin) */
.tl-logo--fill {
  padding: 0;
  background: transparent;
  border-color: transparent;
  object-fit: cover;
}

/* wide / text marks (Parsa) read small when boxed — give them more room */
.tl-logo--wide { padding: 2px; }

/* marks that work directly on the dark theme (TED, NeuroMorpho) — square chip
   stays, but transparent inside, and slightly larger */
.tl-logo--bare {
  background: transparent;
  padding: 2px;
  width: 56px;
  height: 56px;
}
@media (max-width: 540px) {
  .tl-logo--bare { width: 46px; height: 46px; }
}
@media (max-width: 540px) {
  .tl-logo { width: 42px; height: 42px; }
}

.tl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.9rem;
  margin-bottom: 0.6rem;
}
.tl-head h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  letter-spacing: -0.01em;
}
.tl-org {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--violet);
}
.tl-date {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-left: auto;
  white-space: nowrap;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 0.15em 0.7em;
}

.tl-body p {
  color: #d6cfeb;   /* brighter than --muted: readable over the video backdrop */
  max-width: 60ch;
  font-size: 0.98rem;
}

.tl-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}
.tl-tags li {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: #bfb4dc;   /* a step brighter than --muted */
  border: 1px solid var(--hairline);
  border-radius: 3px;
  padding: 0.25em 0.7em;
  background: var(--panel);
}

/* ---- affiliations ---- */

.logo-strip {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2.5rem;
}
.logo-strip li { flex: 0 1 auto; }

.logo-strip img {
  height: clamp(52px, 7vw, 76px);
  width: auto;
  filter: grayscale(1) brightness(1.5) contrast(0.8);
  opacity: 0.5;
  transition: filter 240ms ease, opacity 240ms ease, transform 240ms ease;
}
.logo-strip img:hover {
  filter: none;
  opacity: 1;
  transform: translateY(-3px);
}

/* ---- gallery teaser ---- */

.teaser-inner {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  min-height: clamp(230px, 30vw, 320px);   /* room to show the whole laptop clip */
  padding: clamp(1.75rem, 4vw, 2.75rem);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background:
    radial-gradient(120% 160% at 100% 0%, rgba(179, 136, 255, 0.10), transparent 55%),
    linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: 0 24px 60px -40px rgba(0,0,0,0.9);
}
.teaser-inner p {
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  margin: 0;
  position: relative;
  z-index: 1;
}
.teaser-inner .btn { position: relative; z-index: 1; }

/* the ~2s purple-laptop clip, looping slowly along the card's right edge */
.teaser-vid {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(46%, 420px);
  object-fit: cover;
  object-position: 50% 40%;   /* frame the whole laptop, not just the keyboard */
  opacity: 0.3;               /* idle: dim still frame */
  transition: opacity 500ms ease;
  -webkit-mask-image: linear-gradient(to left, #000 55%, transparent);
          mask-image: linear-gradient(to left, #000 55%, transparent);
  pointer-events: none;
}
.teaser-vid.is-live { opacity: 0.65; }  /* cursor nearby: playing */
@media (prefers-reduced-motion: reduce) {
  .teaser-vid { display: none; }
}

/* ---- contact ---- */

.contact {
  position: relative;
  overflow: hidden;
}
/* soundwave asset from the original site, as a faint backdrop */
.contact::after {
  content: "";
  position: absolute;
  right: -4%;
  bottom: -8%;
  width: min(460px, 60%);
  aspect-ratio: 353 / 170;
  background: url("../assets/soundwave-white.png") right bottom / contain no-repeat;
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}
.contact-inner { position: relative; z-index: 1; }

.contact-inner h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  margin-bottom: 0.75rem;
}
.contact-inner > p { color: var(--muted); margin-bottom: 2rem; }

.contact-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-decoration: none;
  color: var(--void);
  background: linear-gradient(120deg, var(--synapse), var(--violet) 55%, var(--magenta));
  background-size: 180% 100%;
  padding: 0.85em 1.6em;
  border-radius: 6px;
  font-weight: 500;
  box-shadow: var(--glow-violet);
  transition: background-position 320ms ease, transform 160ms ease, box-shadow 240ms ease;
}
.btn:hover {
  background-position: 100% 50%;
  transform: translateY(-2px);
  box-shadow: 0 0 44px -6px rgba(232, 121, 249, 0.5);
}

.icon-link {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  color: var(--muted);
  transition: color 160ms ease, border-color 160ms ease;
}
.icon-link:hover {
  color: var(--synapse);
  border-color: var(--synapse);
}

/* ============ footer ============ */

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  max-width: var(--maxw);
  margin: 0 auto;
  /* slim: keeps the top hairline below the background video's blinking
     terminal prompt (~83% of frame height) at any viewport size */
  padding: 1rem var(--pad) 1.2rem;
  border-top: 1px solid var(--hairline);
  font-size: 0.8rem;
  color: var(--muted);
}
.footer-sig { font-size: 0.72rem; letter-spacing: 0.12em; }

/* ============ scroll reveal ============ */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 700ms cubic-bezier(.2,.7,.2,1), transform 700ms cubic-bezier(.2,.7,.2,1);
}
.reveal.in {
  opacity: 1;
  transform: none;
}
/* staggered cascade for timeline entries */
.tl-item:nth-child(2).in { transition-delay: 80ms; }
.tl-item:nth-child(3).in { transition-delay: 160ms; }
.tl-item:nth-child(4).in { transition-delay: 240ms; }
.tl-item:nth-child(5).in { transition-delay: 320ms; }
.tl-item:nth-child(6).in { transition-delay: 400ms; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ============ gallery page ============ */

.gallery-page {
  max-width: var(--maxw);
  margin: 0 auto;
  /* bottom padding reserves room for the soundwave so it never overlays
     the photo grid, at any viewport width */
  padding: calc(4.5rem + var(--pad)) var(--pad) calc(2.5rem + min(460px, 70vw) * 0.482);
}

.gallery-page { position: relative; }
/* soundwave signature above the footer, mirroring the home contact section */
.gallery-page::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1rem;
  width: min(460px, 60%);
  aspect-ratio: 353 / 170;
  background: url("../assets/soundwave-white.png") right bottom / contain no-repeat;
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

.gallery-head {
  margin-bottom: 3rem;
  position: relative;
  isolation: isolate;
}
/* checkerboard texture from the original site, anchored to the very top of
   the page and fading out downward */
.gallery-head::before {
  content: "";
  position: absolute;
  inset: calc(-4.5rem - var(--pad)) calc(50% - 50vw) -1.5rem;
  z-index: -1;
  background: url("../assets/texture.jpg") top center / 340px auto repeat;
  opacity: 0.14;
  filter: hue-rotate(-24deg) saturate(0.8);
  -webkit-mask-image: linear-gradient(to bottom, #000 20%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 20%, transparent 100%);
  pointer-events: none;
}
.gallery-head h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 8vw, 5rem);
  text-transform: uppercase;
  line-height: 1;
}

.masonry {
  columns: 3;
  column-gap: 1rem;
}
@media (max-width: 900px) { .masonry { columns: 2; } }
@media (max-width: 560px) { .masonry { columns: 1; } }

.masonry img,
.masonry video {
  width: 100%;
  display: block;
  margin-bottom: 1rem;
  border-radius: 4px;
  border: 1px solid var(--hairline);
  cursor: zoom-in;
  break-inside: avoid;
  transition: transform 200ms ease, border-color 200ms ease;
}
.masonry img:hover,
.masonry video:hover {
  transform: scale(1.015);
  border-color: var(--violet);
  box-shadow: 0 0 30px -6px rgba(179, 136, 255, 0.5);
}
@media (prefers-reduced-motion: reduce) {
  .masonry img:hover,
  .masonry video:hover { transform: none; }
}

/* video tiles: wrapper carries a play badge so videos are recognizable */
.masonry .vid {
  position: relative;
  break-inside: avoid;
  cursor: zoom-in;
}
.masonry .vid video { margin-bottom: 0; }
.masonry .vid::after {
  content: "";
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background:
    var(--void) center / 12px 12px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 1.5 L10.5 6 L2 10.5 Z' fill='%23efeafb'/%3E%3C/svg%3E");
  border: 1px solid var(--hairline);
  opacity: 0.85;
  pointer-events: none;
  transition: opacity 200ms ease;
}
.masonry .vid:hover::after { opacity: 1; border-color: var(--violet); }

.gallery-note {
  margin-top: 2rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.gallery-note code { color: var(--copper); }

/* ============ lightbox ============ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(10, 12, 15, 0.94);
  backdrop-filter: blur(6px);
}
.lightbox[hidden] { display: none; }

.lightbox img,
.lightbox video {
  max-width: min(92vw, 1200px);
  max-height: 84vh;
  border-radius: 4px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}
.lightbox video { background: #000; }
.lightbox img[hidden],
.lightbox video[hidden] { display: none; }

.lightbox button {
  position: absolute;
  background: none;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  width: 46px;
  height: 46px;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease;
}
.lightbox button:hover { border-color: var(--synapse); color: var(--synapse); }

.lb-close { top: 1.25rem; right: 1.25rem; }
.lb-prev  { left: 1rem;  top: 50%; transform: translateY(-50%); }
.lb-next  { right: 1rem; top: 50%; transform: translateY(-50%); }

.lb-counter {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  color: var(--muted);
}

/* the Everything Inc figure, waving from the footer — black bg dissolves
   via screen blend so only the white figure shows */
.footer-sig {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
}
.footer-figure {
  height: 32px;
  width: 32px;
  object-fit: cover;
  mix-blend-mode: screen;
  opacity: 0.5;
  transition: opacity 240ms ease;
}
.footer-sig:hover .footer-figure { opacity: 0.95; }
@media (prefers-reduced-motion: reduce) {
  .footer-figure { display: none; }
}

/* ============ mobile refinements ============ */

@media (max-width: 640px) {
  /* header: fit all four nav links on one row */
  .site-header { padding: 0.85rem 1rem; }
  .wordmark { font-size: 0.85rem; }
  .site-header nav { gap: 0.9rem; }
  .site-header nav a { font-size: 0.68rem; letter-spacing: 0.04em; }

  /* hero: keep the name inside the viewport */
  .hero h1 { font-size: clamp(2.1rem, 10.5vw, 3rem); }
  .hero-eyebrow { font-size: 0.66rem; letter-spacing: 0.2em; }

  /* brain gif: no more 540px floor overflowing the screen */
  .hero-brain { width: 94%; }

  /* timeline: give text room next to the logo */
  .tl-body { gap: 0.8rem; }
  .tl-date { margin-left: 0; }

  /* soundwaves: keep them from crowding content — reserve a band below the
     contact links so the wave (and its figure) sits fully beneath them */
  .contact { padding-bottom: calc(1.5rem + 70vw * 0.482); }
  .contact::after { width: 70%; opacity: 0.35; bottom: 0; }
  .gallery-page::after { width: 70%; opacity: 0.35; }

  /* spec sheet: larger values on phones; slimmer label column keeps the
     education lines breaking cleanly in two */
  .spec-row { grid-template-columns: 84px 1fr; }
  .spec-row dd { font-size: 1rem; }

  /* affiliations: all five logos stay on a single row */
  .logo-strip { flex-wrap: nowrap; gap: clamp(0.6rem, 3.2vw, 1.5rem); }
  .logo-strip img { height: clamp(36px, 12.5vw, 52px); }

  /* contact: email button + three icons stay on one row */
  .contact-links { flex-wrap: nowrap; gap: 0.6rem; }
  .contact-links .btn { font-size: 0.75rem; padding: 0.75em 1.1em; white-space: nowrap; }
  .icon-link { width: 38px; height: 38px; flex: 0 0 auto; }
  .icon-link svg { width: 18px; height: 18px; }
}

@media (max-width: 640px) {
  /* comfortable reading + spacing on phones */
  main > section { padding-top: 3.25rem; padding-bottom: 3.25rem; }
  .about-copy p { font-size: 1.02rem; line-height: 1.7; }
  .hero-sub { font-size: 0.98rem; }
  .section-label { margin-bottom: 1.75rem; }
  .contact-inner h2 { font-size: clamp(1.9rem, 9vw, 2.6rem); }
}

@media (max-width: 360px) {
  .site-header nav { gap: 0.65rem; }
  .site-header nav a { font-size: 0.62rem; }
  .contact-links .btn { font-size: 0.7rem; padding: 0.7em 0.9em; }
  .icon-link { width: 34px; height: 34px; }
}

/* ============ large / high-res displays (1440p and up) ============
   scale the root so all rem-based type grows, and widen the column */
@media (min-width: 1600px) {
  html { font-size: 17.5px; }
  :root { --maxw: 1260px; }
}
@media (min-width: 2000px) {
  html { font-size: 19px; }
  :root { --maxw: 1360px; }
  .about-copy p { font-size: 1.28rem; }
}
@media (min-width: 2560px) {
  html { font-size: 21px; }
  :root { --maxw: 1500px; }
}
