:root {
  --bg: #04060b;
  --panel: rgba(255, 255, 255, 0.028);
  --panel-hi: rgba(255, 255, 255, 0.055);
  --line: rgba(122, 162, 247, 0.14);
  --line-hi: rgba(122, 162, 247, 0.34);
  --text: #e8edf7;
  --dim: #97a3ba;
  --blue: #3d8bfd;
  --blue-soft: #6faaff;
  --blue-glow: rgba(61, 139, 253, 0.28);
  --radius: 16px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --nav-ease: cubic-bezier(0.16, 1, 0.3, 1);
  /* Matches queensnuclear.ca: no hold-off at all. That nav feels deliberate
     because the transition itself is a slow 0.65s on the ease curve, not
     because it waits before starting. */
  --hover-delay: 0s;
  --head-h: clamp(5.5rem, 13vh, 8rem);
}

* { box-sizing: border-box; }

/* The scroll container is <main>, NOT html/body. Snap on html while body has
   overflow-x:hidden makes body the scroller and silently kills snapping. */
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
}

body {
  font-family: var(--font);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* No scroll-behavior:smooth here — JS runs its own faster animation. */
.snap {
  height: 100%;
  overflow-y: scroll;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.snap::-webkit-scrollbar { display: none; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3 { margin: 0; line-height: 1.12; font-weight: 600; letter-spacing: -0.02em; }
p { margin: 0; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 300;
  background: var(--blue); color: #04060b; font-weight: 600;
  padding: 0.75rem 1.25rem; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

a:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--blue-soft); outline-offset: 4px; border-radius: 6px;
}

/* ============ Animated background ============ */

.bg { position: fixed; inset: 0; z-index: -1; background: var(--bg); overflow: hidden; }

.bg__grid {
  position: absolute; inset: -50%;
  background-image:
    linear-gradient(to right, rgba(122,162,247,0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(122,162,247,0.055) 1px, transparent 1px);
  background-size: 64px 64px;
  animation: grid-drift 40s linear infinite;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 20%, transparent 78%);
}
@keyframes grid-drift { from { transform: translate3d(0,0,0); } to { transform: translate3d(64px,64px,0); } }

.bg__glow { position: absolute; border-radius: 50%; filter: blur(90px); will-change: transform; }
.bg__glow--a {
  width: 46vw; height: 46vw; min-width: 340px; min-height: 340px; top: -10vh; left: -8vw;
  background: radial-gradient(circle, rgba(61,139,253,0.22), transparent 68%);
  animation: float-a 22s ease-in-out infinite alternate;
}
.bg__glow--b {
  width: 40vw; height: 40vw; min-width: 300px; min-height: 300px; bottom: -12vh; right: -6vw;
  background: radial-gradient(circle, rgba(38,96,200,0.2), transparent 68%);
  animation: float-b 26s ease-in-out infinite alternate;
}
@keyframes float-a { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(8vw,10vh,0) scale(1.14); } }
@keyframes float-b { from { transform: translate3d(0,0,0) scale(1.1); } to { transform: translate3d(-9vw,-8vh,0) scale(1); } }

.bg__vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 100% 80% at 50% 50%, transparent 40%, rgba(4,6,11,0.85) 100%);
}

/* ============ Dot nav ============ */

/* Collapsed to a rail of dots; the whole rail expands into a labelled glass
   pill on hover. Easing matches the QNET notch nav. */
.dot-nav {
  position: fixed; right: 1.5rem; top: 50%; transform: translateY(-50%);
  z-index: 90;
  display: flex; flex-direction: column; gap: 0.2rem;
  padding: 0.5rem;
  border-radius: 26px;
  border: 1px solid transparent;
  background: transparent;
  /* 0.3s delay so a cursor merely passing by doesn't pop it open; collapses
     immediately on leave (no delay on the base rule). */
  transition: background 0.65s var(--nav-ease), border-color 0.65s var(--nav-ease),
              padding 0.65s var(--nav-ease), box-shadow 0.65s var(--nav-ease);
}
.dot-nav:hover, .dot-nav:focus-within { transition-delay: var(--hover-delay); }
.dot-nav:hover a, .dot-nav:focus-within a { transition-delay: var(--hover-delay); }
.dot-nav:hover, .dot-nav:focus-within {
  background: rgba(12, 16, 24, 0.82);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-color: rgba(255, 255, 255, 0.1);
  padding: 0.7rem 0.85rem 0.7rem 0.7rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.dot-nav a {
  display: flex; align-items: center;
  gap: 0; height: 26px; padding: 0 0.35rem;
  border-radius: 999px;
  transition: gap 0.65s var(--nav-ease), padding 0.65s var(--nav-ease),
              background 0.3s ease;
}
.dot-nav:hover a, .dot-nav:focus-within a { gap: 0.65rem; padding: 0 0.9rem 0 0.4rem; }
.dot-nav:hover a:hover { background: rgba(255, 255, 255, 0.07); }

.dot-nav__dot {
  width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%;
  border: 1.5px solid rgba(232, 237, 247, 0.42);
  transition: all 0.35s var(--nav-ease);
}
.dot-nav a:hover .dot-nav__dot { border-color: var(--blue-soft); transform: scale(1.3); }
.dot-nav a.active .dot-nav__dot {
  border-color: var(--blue); background: var(--blue);
  box-shadow: 0 0 0 4px var(--blue-glow);
}

.dot-nav__label {
  max-width: 0; opacity: 0; overflow: hidden; white-space: nowrap;
  font-size: 0.76rem; font-weight: 500; letter-spacing: 0.02em;
  color: var(--dim);
  transition: max-width 0.65s var(--nav-ease), opacity 0.4s ease, color 0.3s ease;
}
.dot-nav:hover .dot-nav__label, .dot-nav:focus-within .dot-nav__label {
  max-width: 130px; opacity: 1;
}
.dot-nav a:hover .dot-nav__label { color: var(--text); }
.dot-nav a.active .dot-nav__label { color: var(--text); font-weight: 600; }

/* Labels fan out one after another rather than all at once */
.dot-nav:hover a:nth-child(1) .dot-nav__label { transition-delay: 0.02s; }
.dot-nav:hover a:nth-child(2) .dot-nav__label { transition-delay: 0.05s; }
.dot-nav:hover a:nth-child(3) .dot-nav__label { transition-delay: 0.08s; }
.dot-nav:hover a:nth-child(4) .dot-nav__label { transition-delay: 0.11s; }
.dot-nav:hover a:nth-child(5) .dot-nav__label { transition-delay: 0.14s; }
.dot-nav:hover a:nth-child(6) .dot-nav__label { transition-delay: 0.17s; }

/* ============ Top bar ============
   Hidden over the hero, then the name and a shrunken headshot slide in at the
   top right once you scroll past it. */

.topbar {
  position: fixed; top: 0; right: 0; z-index: 95;
  display: flex; align-items: center; gap: 0.9rem;
  padding: 1.1rem clamp(1.1rem, 3vw, 2rem);
  opacity: 0;
  transform: translateY(-24px);
  pointer-events: none;
  transition: opacity 0.7s var(--nav-ease), transform 0.7s var(--nav-ease);
}
.topbar.is-visible { opacity: 1; transform: none; pointer-events: auto; }

.topbar__id {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.32rem 0.9rem 0.32rem 0.32rem;
  border-radius: 999px;
  background: rgba(10, 14, 22, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: border-color 0.3s ease, background 0.3s ease;
}
.topbar__id:hover { border-color: var(--line-hi); background: rgba(14, 20, 32, 0.9); }

.topbar__avatar {
  width: 30px; height: 30px; border-radius: 50%; overflow: hidden; flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.topbar__avatar img { width: 100%; height: 100%; object-fit: cover; }

.topbar__name { font-size: 0.82rem; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }

.topbar__contact {
  display: inline-flex; align-items: center; gap: 0.5rem;
  min-height: 40px; padding: 0.5rem 1.1rem; border-radius: 999px;
  font-size: 0.84rem; font-weight: 600; color: var(--text);
  background: rgba(10, 14, 22, 0.78);
  border: 1px solid var(--line-hi);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: all 0.25s var(--ease);
}
.topbar__contact svg { width: 15px; height: 15px; fill: #fff; transition: fill 0.25s ease; }
.topbar__contact:hover {
  background: var(--blue); border-color: var(--blue); color: #fff;
  transform: translateY(-2px); box-shadow: 0 10px 26px var(--blue-glow);
  transition-delay: var(--hover-delay);
}
.topbar__id:hover { transition-delay: var(--hover-delay); }
.topbar__links { display: flex; align-items: center; gap: 0.45rem; }

/* ============ Icon links ============ */

.iconlink {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  color: var(--dim);
  background: rgba(10, 14, 22, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: all 0.28s var(--ease);
}
.iconlink svg { width: 17px; height: 17px; fill: currentColor; }
.iconlink--lg { width: 46px; height: 46px; }
.iconlink--lg svg { width: 19px; height: 19px; }

.iconlink:hover {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
  transform: translateY(-3px);
  box-shadow: 0 10px 26px var(--blue-glow);
  transition-delay: var(--hover-delay);
}

/* ============ Org links (QNET on its own slides) ============ */

.orglinks {
  display: flex; align-items: center; gap: 0.5rem;
  margin-top: 0.4rem; padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.orglinks__label {
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--dim); margin-right: 0.2rem;
}
.orglinks .iconlink { width: 36px; height: 36px; }
.orglinks .iconlink svg { width: 15px; height: 15px; }

/* ============ Sections ============ */

.section {
  position: relative;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem clamp(1.25rem, 5vw, 5rem);
  overflow: hidden;
}

/* Horizontal sections are edge to edge: the track fills the whole slide and the
   heading floats on top of it. */
.section--h { padding: 0; }

.section__inner {
  width: 100%; max-width: 1080px; margin: 0 auto; min-height: 0;
  display: flex; flex-direction: column; justify-content: center;
}
.section__inner--center { text-align: center; align-items: center; }

.section__head { flex: 0 0 auto; margin-bottom: clamp(1rem, 2.5vh, 1.75rem); }

.section--h .section__head {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  margin: 0; pointer-events: none;
  padding: clamp(1.75rem, 4.5vh, 3rem) clamp(1.25rem, 5vw, 5rem) 1.5rem;
  background: linear-gradient(to bottom, rgba(4,6,11,0.92), rgba(4,6,11,0.55) 60%, transparent);
}

.eyebrow {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--blue-soft); margin-bottom: 0.6rem;
}
.section h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }

/* ============ Hero ============ */

.hero {
  max-width: 720px; margin: 0 auto; text-align: center;
  display: flex; flex-direction: column; align-items: center;
}

/* flex:0 0 auto keeps the avatar from being squashed into an oval when the
   column runs short on vertical space. */
.hero__avatar {
  flex: 0 0 auto;
  width: clamp(88px, 9vw, 116px);
  height: clamp(88px, 9vw, 116px);
  margin-bottom: 1.5rem;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--line-hi);
  box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 0 0 6px rgba(61,139,253,0.07);
}
.hero__avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.badge {
  display: inline-flex; align-items: center; gap: 0.55rem; flex: 0 0 auto;
  font-size: 0.76rem; font-weight: 500; color: var(--text);
  background: rgba(61,139,253,0.09); border: 1px solid var(--line-hi);
  padding: 0.42rem 0.9rem; border-radius: 999px; margin-bottom: 1.1rem;
}
.badge__dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--blue); flex: 0 0 auto;
  box-shadow: 0 0 0 3px var(--blue-glow); animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 3px var(--blue-glow); }
  50% { box-shadow: 0 0 0 7px rgba(61,139,253,0.06); }
}

.hero h1 {
  font-size: clamp(2.6rem, 7vw, 4.8rem); font-weight: 700; letter-spacing: -0.035em;
  margin-bottom: 0.8rem;
  background: linear-gradient(180deg, #ffffff 25%, #9fb8e6 130%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__role { font-size: clamp(0.98rem, 1.5vw, 1.14rem); max-width: 42ch; margin-bottom: 0.9rem; }
.hero__bio { color: var(--dim); font-size: clamp(0.9rem, 1.2vw, 1rem); max-width: 52ch; margin-bottom: 1.8rem; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.7rem; justify-content: center; align-items: center; }
.btn__icon { width: 16px; height: 16px; fill: currentColor; margin-right: 0.5rem; flex: 0 0 auto; }
.hero__loc {
  margin-top: 1.6rem; font-size: 0.74rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--dim);
}

.scroll-cue {
  position: absolute; left: 50%; bottom: 1.6rem; transform: translateX(-50%);
  width: 24px; height: 38px; border: 1.5px solid var(--line-hi); border-radius: 999px;
  display: flex; justify-content: center; padding-top: 7px;
}
.scroll-cue span { width: 3px; height: 7px; border-radius: 999px; background: var(--blue); animation: cue 1.7s ease-in-out infinite; }
@keyframes cue {
  0% { opacity: 0; transform: translateY(0); }
  35% { opacity: 1; }
  100% { opacity: 0; transform: translateY(13px); }
}

/* ============ Buttons ============ */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0.8rem 1.55rem; border-radius: 999px;
  font-size: 0.92rem; font-weight: 600; transition: all 0.25s var(--ease);
}
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover {
  transform: translateY(-3px); box-shadow: 0 12px 30px var(--blue-glow);
  transition-delay: var(--hover-delay);
}
.btn--ghost { border: 1px solid var(--line-hi); color: var(--text); background: rgba(10,14,22,0.5); }
.btn--ghost:hover {
  border-color: var(--blue); color: var(--blue-soft); transform: translateY(-3px);
  transition-delay: var(--hover-delay);
}

.team__list a:hover, .ecard:hover { transition-delay: var(--hover-delay); }

/* ============ Full-bleed horizontal slides ============ */

.htrack {
  position: absolute;
  inset: 0;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  /* x only. `overscroll-behavior: contain` also blocks the VERTICAL chain, which
     traps the page inside the first horizontal section. */
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.htrack::-webkit-scrollbar { display: none; }

.hpanel {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
  display: flex;
  align-items: center;
}

/* --- slide-in transition: background eases out of a slow zoom while the
   content staggers up. Driven by .is-active, set in script.js. --- */

.hpanel__bg--art img,
.hpanel__fit {
  transform: scale(1.04);
  transition: transform 1.5s var(--nav-ease), opacity 0.4s ease;
}
.hpanel.is-active .hpanel__bg--art img,
.hpanel.is-active .hpanel__fit { transform: scale(1); }

.hpanel__content > * {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--nav-ease), transform 0.7s var(--nav-ease);
}
.hpanel.is-active .hpanel__content > * { opacity: 1; transform: none; }

.hpanel.is-active .hpanel__content > *:nth-child(1) { transition-delay: 0.05s; }
.hpanel.is-active .hpanel__content > *:nth-child(2) { transition-delay: 0.11s; }
.hpanel.is-active .hpanel__content > *:nth-child(3) { transition-delay: 0.17s; }
.hpanel.is-active .hpanel__content > *:nth-child(4) { transition-delay: 0.23s; }
.hpanel.is-active .hpanel__content > *:nth-child(5) { transition-delay: 0.29s; }
.hpanel.is-active .hpanel__content > *:nth-child(6) { transition-delay: 0.35s; }
.hpanel.is-active .hpanel__content > *:nth-child(7) { transition-delay: 0.41s; }

/* --- backgrounds --- */

.hpanel__bg { position: absolute; inset: 0; overflow: hidden; background: #060911; }
.hpanel__bg img { width: 100%; height: 100%; object-fit: cover; }

/* Generated artwork is composed for the frame, so it fills it. */
.hpanel__bg--art img { object-fit: cover; object-position: center; }

/* Real photos are never cropped: the whole frame is shown on the right, with a
   blurred copy of itself filling the space behind so there are no dead bars. */
.hpanel__bg--photo { background: #05080f; }
/* NOTE: these selectors must out-specify `.hpanel__bg img { object-fit: cover }`
   above, or the contain never applies and every photo renders cropped. */
.hpanel__bg img.hpanel__blur {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  filter: blur(46px) saturate(0.6) brightness(0.3);
  transform: scale(1.2);
}
.hpanel__bg img.hpanel__fit {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  object-position: 88% center;
}

.hpanel__bg--pattern {
  background:
    radial-gradient(ellipse 70% 60% at 78% 30%, rgba(61,139,253,0.16), transparent 62%),
    linear-gradient(140deg, #070c16 10%, #0a1120 55%, #060910 100%);
}
.hpanel__bg--pattern::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(122,162,247,0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(122,162,247,0.07) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(ellipse 80% 70% at 70% 40%, #000 10%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 70% 40%, #000 10%, transparent 75%);
}
.hpanel__bg--accent {
  background:
    radial-gradient(ellipse 65% 60% at 75% 35%, rgba(61,139,253,0.3), transparent 62%),
    linear-gradient(140deg, #081326 0%, #0a1224 55%, #060b16 100%);
}

/* YouTube background: scale the 16:9 iframe until it covers the slide */
.hpanel__bg--video iframe {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 100vw; height: 56.25vw;
  min-height: 100%; min-width: 177.78vh;
  border: 0; pointer-events: none;
}

.hpanel__scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(to right, rgba(4,6,11,0.96) 0%, rgba(4,6,11,0.86) 34%, rgba(4,6,11,0.2) 60%, rgba(4,6,11,0.08) 100%),
    linear-gradient(to bottom, rgba(4,6,11,0.6) 0%, transparent 26%, transparent 68%, rgba(4,6,11,0.7) 100%);
}

/* --- content over the background --- */

.hpanel__content {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 640px;
  margin-left: max(clamp(1.25rem, 5vw, 5rem), calc((100% - 1240px) / 2));
  padding: calc(var(--head-h) + 0.5rem) clamp(1.25rem, 5vw, 2rem) 5rem 0;
  max-height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.hpanel__content::-webkit-scrollbar { display: none; }

.hpanel__meta {
  font-size: 0.73rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--blue-soft);
}
.hpanel__meta a { color: var(--blue-soft); }
.hpanel__meta a:hover { text-decoration: underline; }

/* The employer is the headline; the job title sits beneath it in accent blue. */
.hpanel__org {
  font-size: clamp(1.6rem, 3.8vw, 2.7rem);
  font-weight: 700;
  letter-spacing: -0.032em;
  line-height: 1.06;
  color: #fff;
  margin-bottom: -0.3rem;
}
.hpanel__org a { color: #fff; }
.hpanel__org a:hover { color: var(--blue-soft); }

.hpanel__content h3 {
  font-size: clamp(0.98rem, 1.5vw, 1.18rem);
  font-weight: 600;
  letter-spacing: 0.005em;
  color: var(--blue-soft);
}

/* Project slides have no employer line, so the project name takes the big type. */
.hpanel__content > .hpanel__meta + h3 {
  font-size: clamp(1.6rem, 3.8vw, 2.7rem);
  font-weight: 700;
  letter-spacing: -0.032em;
  line-height: 1.06;
  color: #fff;
}

.hpanel__sub { font-size: 0.85rem; color: var(--dim); }

.hpanel__content > p { font-size: clamp(0.88rem, 1.15vw, 0.98rem); color: var(--dim); }
.hpanel__content strong { color: var(--text); font-weight: 600; }
.hpanel__content .chips { margin-top: 0.2rem; }

/* Progress rail pinned to the bottom of the slide */

.hrail {
  position: absolute; z-index: 6; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: 0.85rem;
  padding: 1.5rem clamp(1.25rem, 5vw, 5rem) 1.5rem;
  background: linear-gradient(to top, rgba(4,6,11,0.9), transparent);
  pointer-events: none;
}
.hrail > * { pointer-events: auto; }
.hrail__count { font-size: 0.74rem; font-weight: 600; letter-spacing: 0.1em; color: var(--dim); white-space: nowrap; }
.hrail__bars { display: flex; gap: 0.4rem; flex: 1 1 auto; max-width: 460px; }
.hrail__bars button {
  flex: 1 1 auto; height: 3px; border: 0; padding: 0; cursor: pointer; border-radius: 999px;
  background: rgba(232,237,247,0.2); transition: background 0.25s var(--ease);
}
.hrail__bars button.active { background: var(--blue); }
.hrail__hint { font-size: 0.74rem; color: var(--dim); white-space: nowrap; }

/* ============ Photo strip ============ */

.shots { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }

.shots__btn {
  width: 92px; padding: 0; cursor: pointer;
  border: 0; background: none;
  display: flex; flex-direction: column; gap: 0.32rem;
  font: inherit; color: var(--dim); text-align: left;
  transition: color 0.3s var(--ease), transform 0.4s var(--nav-ease);
}
.shots__btn img {
  width: 100%; height: 60px; object-fit: cover;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  opacity: 0.6;
  transition: opacity 0.4s var(--nav-ease), border-color 0.4s var(--nav-ease),
              box-shadow 0.4s var(--nav-ease);
}
.shots__btn span {
  font-size: 0.62rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  line-height: 1.25; white-space: normal;
}
.shots__btn:hover { color: var(--text); transform: translateY(-4px); }
.shots__btn:hover img { opacity: 1; border-color: var(--line-hi); }
.shots__btn.is-active { color: var(--blue-soft); }
.shots__btn.is-active img {
  opacity: 1; border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-glow);
}

/* Crossfade when the strip swaps the slide background */
.hpanel__bg img.is-swapping { opacity: 0; }

/* ============ Team credits ============ */

.team {
  margin-top: 0.4rem; padding-top: 0.9rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem 0.85rem;
}
.team__label {
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--dim);
}
.team__list { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.team__list a, .team__plain {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: 0.78rem; font-weight: 500;
  padding: 0.25rem 0.75rem 0.25rem 0.25rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  transition: all 0.22s var(--ease);
}
.team__plain { color: var(--dim); }
.team__list img, .team__initials {
  width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex: 0 0 auto;
}
.team__initials {
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(61,139,253,0.18); color: var(--blue-soft);
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.04em;
}
.team__list a:hover {
  border-color: var(--blue);
  background: rgba(61,139,253,0.14);
  color: #fff;
  transform: translateY(-2px);
}

/* ============ Chips ============ */

.chips { display: flex; flex-wrap: wrap; gap: 0.42rem; }
.chips li {
  position: relative;
  font-size: 0.73rem; font-weight: 500; color: var(--text);
  background: rgba(61,139,253,0.14); border: 1px solid var(--line);
  padding: 0.28rem 0.68rem; border-radius: 999px; white-space: nowrap;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease);
}

/* A skill used elsewhere lights up and names the other places it shows up. */
.chips li.has-links { cursor: help; }
.chips li.has-links:hover {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  transition-delay: var(--hover-delay);
}

/* Lives on <body>, not inside the chip: every slide ancestor has overflow
   hidden, which was clipping it. Fixed positioning + JS collision handling
   keeps it fully on screen. */
.chip-pop {
  position: fixed; top: 0; left: 0;
  width: max-content; min-width: 180px; max-width: min(320px, calc(100vw - 24px));
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  background: rgba(8, 12, 20, 0.97);
  border: 1px solid var(--line-hi);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  white-space: normal;
  opacity: 0; pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--nav-ease);
  z-index: 200;
}
.chip-pop.below { transform: translateY(-6px); }
.chip-pop.is-open { opacity: 1; transform: translateY(0); }
.chip-pop__title {
  display: block;
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--blue-soft); margin-bottom: 0.4rem;
}
.chip-pop ul { display: grid; gap: 0.28rem; margin: 0; padding: 0; list-style: none; }
.chip-pop li {
  display: block;
  font-size: 0.74rem; font-weight: 500; color: var(--text);
  padding-left: 0.85rem; position: relative; white-space: normal;
  background: none; border: 0; border-radius: 0;
}
.chip-pop li::before {
  content: ""; position: absolute; left: 0; top: 0.5em;
  width: 4px; height: 4px; border-radius: 50%; background: var(--blue);
}

/* ============ Education ============ */

.edu { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.35rem; }
.ecard {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.35rem, 3vh, 2rem); transition: all 0.3s var(--ease);
}
.ecard:hover { background: var(--panel-hi); border-color: var(--line-hi); transform: translateY(-5px); }
.ecard h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); margin: 0.5rem 0 0.35rem; color: #fff; font-weight: 600; }

/* Education keeps normal body-sized type. It must not inherit the oversized
   .hpanel__org treatment used for employer names on the slides. */
.ecard__meta {
  font-size: 0.73rem; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--blue-soft);
}
.ecard__degree { font-size: 0.95rem; color: var(--text); font-weight: 500; }
.ecard__loc { font-size: 0.85rem; color: var(--dim); margin-top: 0.2rem; }
.ticks { display: grid; gap: 0.5rem; margin-top: 1.1rem; }
.ticks li { position: relative; padding-left: 1.25rem; font-size: 0.88rem; color: var(--dim); }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: 0.62em; width: 5px; height: 5px;
  border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 3px var(--blue-glow);
}

/* ============ End bar ============ */

.endbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.1rem;
  margin-top: clamp(1.75rem, 5vh, 3rem);
  padding: 1.1rem clamp(1.1rem, 3vw, 1.75rem);
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.028);
  transition: border-color 0.4s var(--nav-ease), background 0.4s var(--nav-ease),
              transform 0.4s var(--nav-ease);
}
.endbar:hover {
  border-color: var(--line-hi);
  background: rgba(61, 139, 253, 0.08);
  transform: translateY(-3px);
  transition-delay: var(--hover-delay);
}
.endbar__label {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--dim);
}
.endbar__mail {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: clamp(0.9rem, 1.4vw, 1.05rem); font-weight: 600; color: #fff;
}
.endbar__mail svg { width: 16px; height: 16px; fill: var(--blue-soft); }
.endbar__top {
  display: inline-flex; align-items: center; gap: 0.4rem;
  margin-left: auto;
  font-size: 0.76rem; font-weight: 600; color: var(--dim);
  transition: color 0.3s ease;
}
.endbar__top svg { width: 14px; height: 14px; transition: transform 0.4s var(--nav-ease); }
.endbar:hover .endbar__top { color: var(--blue-soft); }
.endbar:hover .endbar__top svg { transform: translateY(-3px); }

/* ============ Reveal ============ */

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-d="1"] { transition-delay: 0.05s; }
.reveal[data-d="2"] { transition-delay: 0.1s; }
.reveal[data-d="3"] { transition-delay: 0.15s; }
.reveal[data-d="4"] { transition-delay: 0.2s; }
.reveal[data-d="5"] { transition-delay: 0.25s; }

/* ============ Responsive ============ */

@media (max-width: 900px) {
  .dot-nav { display: none; }
  .topbar { padding: 0.7rem 0.9rem; gap: 0.5rem; }
  .topbar__name { display: none; }
  .topbar__id { padding: 0.28rem; }
  .topbar .topbar__contact { display: none; }
  .shots__btn { width: 76px; }
  .shots__btn img { height: 50px; }

  /* Touch gets an ordinary flowing page. Snap is off entirely: combined with
     variable-height sections it fights the user more than it helps.

     The original bug was that a vertical swipe landed on .hpanel__content,
     which had its own overflow-y, so the swipe scrolled that instead of the
     page and only a swipe from the very bottom moved to the next slide. The
     fix is that nothing here scrolls vertically except the page itself.

     Do NOT reach for `touch-action: pan-x` on .htrack to solve this. It does
     not hand vertical gestures to the ancestor, it cancels them outright, so
     vertical swipes over the carousel do nothing at all. */
  .snap { scroll-snap-type: none; }

  .section {
    height: auto;
    min-height: 100svh;
    overflow: visible;
    padding: 3.5rem 1.1rem 4.5rem;
  }

  .section--h { padding: 0 0 2.5rem; }

  /* Heading joins the flow rather than floating over an absolute track. */
  .section--h .section__head {
    position: relative;
    background: none;
    padding: 4.5rem 1.1rem 1.1rem;
  }

  /* The carousel becomes a plain vertical stack on touch. A horizontal
     overflow container sitting over the whole slide keeps capturing vertical
     swipes no matter how its height is tuned, so on mobile it stops being a
     scroll container at all: display block, overflow visible, no snap. Panels
     become stacked cards. Nothing here scrolls except the page. */
  .htrack {
    position: relative;
    inset: auto;
    display: block;
    overflow: visible;
    scroll-snap-type: none;
    height: auto;
    min-height: 0;
    padding: 0 1.1rem;
  }

  .hpanel {
    display: block;
    width: 100%;
    height: auto;
    min-height: 62svh;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid var(--line);
    margin-bottom: 1rem;
    scroll-snap-align: none;
    scroll-snap-stop: normal;
  }

  /* Stacked panels are all on screen at once, so nothing waits on .is-active. */
  .hpanel__content > * { opacity: 1; transform: none; }
  .hpanel__bg--art img, .hpanel__bg img.hpanel__fit { transform: none; }

  .hrail { display: none; }

  .hpanel__content {
    max-width: none;
    margin-left: 0;
    padding: 1.4rem 1.1rem 1.6rem;
    gap: 0.65rem;
    max-height: none;
    overflow: visible;
    justify-content: center;
  }

  .hpanel__scrim {
    background:
      linear-gradient(to bottom, rgba(4,6,11,0.88) 0%, rgba(4,6,11,0.8) 45%, rgba(4,6,11,0.92) 100%);
  }
  .hpanel__org { font-size: 1.75rem; }
  .hpanel__content > .hpanel__meta + h3 { font-size: 1.75rem; }
  .hpanel__content h3 { font-size: 1rem; }

  .hero__avatar { width: 84px; height: 84px; margin-bottom: 1.1rem; }
  .badge { font-size: 0.66rem; padding: 0.34rem 0.68rem; }
  .scroll-cue { display: none; }

  .chip-pop { display: none; }
}

/* Touch devices never get the header mail button, whatever the width.
   Email is already in the hero and the end bar. */
@media (hover: none) {
  .topbar .topbar__contact { display: none; }
  .chip-pop { display: none; }
}

/* ============ Reduced motion ============ */

@media (prefers-reduced-motion: reduce) {
  .snap, .htrack { scroll-snap-type: none; }
  .bg__grid, .bg__glow, .badge__dot, .scroll-cue span { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hpanel__content > * { opacity: 1; transform: none; transition: none; }
  .hpanel__bg--art img, .hpanel__fit { transform: none; transition: none; }
  .hpanel__blur { transform: scale(1.2); transition: none; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
