@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,400;8..60,500;8..60,600&display=swap');

/* ========================================
   Base & Reset
   ======================================== */

* {
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html {
  background-color: #0a090d;
  scroll-behavior: smooth;
}

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  color: #e0e0e0;
  background-color: #0f0f0f;
  
  /* Default accent colors (homepage) */
  --accent-primary: #a855f7;
  --accent-secondary: #c084fc;
  --accent-light: #f5e6ff;
  --accent-link: #7ab8e8;
  --accent-link-hover: #a0d4f8;
}

/* Projects page: teal/cool blue accent color theme */
body.page-projects {
  --accent-primary: #14b8a6;
  --accent-secondary: #5eead4;
  --accent-light: #ccfbf1;
  --accent-link: #22d3ee;
  --accent-link-hover: #67e8f9;
}

/* Projects listing page: background from .page-bg (color #080c0c) */
body.page-projects-listing {
  background-color: transparent;
}

body.page-projects-listing main {
  position: relative;
  z-index: 1;
}

/* Project detail pages: background from .page-bg (color #080a0f) */
body.page-projects:not(.page-projects-listing) {
  background-color: transparent;
}

body.page-projects:not(.page-projects-listing) main {
  position: relative;
  z-index: 1;
}

/* Shared fixed background on all pages (separate layer to avoid scroll shake) */
.page-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  pointer-events: none;
  background-color: #060508;
  background-image:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0.22) 35%, rgba(0, 0, 0, 0.35) 100%),
    linear-gradient(
      165deg,
      rgba(6, 5, 8, 0.88) 0%,
      rgba(18, 12, 28, 0.82) 25%,
      rgba(22, 16, 36, 0.78) 50%,
      rgba(18, 12, 28, 0.82) 75%,
      rgba(6, 5, 8, 0.88) 100%
    ),
    url('../assets/background.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Home: GIF covers full viewport; fades out when past hero to reveal static bg underneath */
body.page-home .page-bg {
  background-color: #040306;
  background-image:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0.28) 35%, rgba(0, 0, 0, 0.42) 100%),
    linear-gradient(
      165deg,
      rgba(5, 4, 7, 0.9) 0%,
      rgba(14, 10, 24, 0.86) 25%,
      rgba(18, 14, 32, 0.82) 50%,
      rgba(14, 10, 24, 0.86) 75%,
      rgba(5, 4, 7, 0.9) 100%
    ),
    url('../assets/background.gif');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  transform: translateZ(0);
  transition: opacity 1.4s ease;
}

/* Once scrolled past hero, fade out GIF so only static background is visible */
body.page-home.past-hero .page-bg {
  opacity: 0;
  pointer-events: none;
}

/* Narrative pages: same purplish overlay, background-blur2.png (darker) */
body[data-narrative] .page-bg {
  background-color: #060508;
  background-image:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.35) 35%, rgba(0, 0, 0, 0.48) 100%),
    linear-gradient(
      165deg,
      rgba(6, 5, 8, 0.92) 0%,
      rgba(18, 12, 28, 0.88) 25%,
      rgba(22, 16, 36, 0.86) 50%,
      rgba(18, 12, 28, 0.88) 75%,
      rgba(6, 5, 8, 0.92) 100%
    ),
    url('../assets/background-blur2.png');
}

/* Projects listing: static background-blur.png first; GIF fades in on top once loaded (see .page-bg-gif) */
body.page-projects-listing .page-bg {
  background-color: #050d08;
  background-image:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.14) 0%, rgba(0, 0, 0, 0.28) 35%, rgba(0, 0, 0, 0.4) 100%),
    linear-gradient(
      165deg,
      rgba(5, 18, 7, 0.91) 0%,
      rgba(6, 20, 8, 0.89) 12%,
      rgba(7, 22, 9, 0.87) 25%,
      rgba(8, 24, 10, 0.85) 38%,
      rgba(9, 26, 11, 0.85) 50%,
      rgba(7, 22, 9, 0.87) 62%,
      rgba(6, 20, 8, 0.89) 75%,
      rgba(5, 18, 7, 0.91) 88%,
      rgba(4, 16, 6, 0.93) 100%
    ),
    url('../assets/background-blur.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  transition: opacity 1.4s ease;
}

/* Projects listing: GIF overlay — visible only after preload; longer transition, fades out when past intro */
body.page-projects-listing .page-bg-gif {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  pointer-events: none;
  background-color: #050d08;
  background-image:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.14) 0%, rgba(0, 0, 0, 0.28) 35%, rgba(0, 0, 0, 0.4) 100%),
    linear-gradient(
      165deg,
      rgba(5, 18, 7, 0.91) 0%,
      rgba(6, 20, 8, 0.89) 12%,
      rgba(7, 22, 9, 0.87) 25%,
      rgba(8, 24, 10, 0.85) 38%,
      rgba(9, 26, 11, 0.85) 50%,
      rgba(7, 22, 9, 0.87) 62%,
      rgba(6, 20, 8, 0.89) 75%,
      rgba(5, 18, 7, 0.91) 88%,
      rgba(4, 16, 6, 0.93) 100%
    ),
    url('../assets/background-slow.gif');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 8.5s ease;
}

body.page-projects-listing.gif-ready .page-bg-gif {
  opacity: 1;
}

/* After first load in session: show GIF immediately, no long fade */
body.page-projects-listing.gif-ready.gif-no-transition .page-bg-gif {
  transition: none;
}

body.page-projects-listing.past-intro .page-bg,
body.page-projects-listing.past-intro .page-bg-gif {
  opacity: 0;
  pointer-events: none;
}

/* Static background layer (visible after scroll past intro) */
body.page-projects-listing .page-projects-listing-section-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -2;
  pointer-events: none;
  background-color: #060a0a;
  background-image:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.14) 0%, rgba(0, 0, 0, 0.28) 35%, rgba(0, 0, 0, 0.4) 100%),
    linear-gradient(
      165deg,
      rgba(5, 18, 7, 0.91) 0%,
      rgba(6, 20, 8, 0.89) 12%,
      rgba(7, 22, 9, 0.87) 25%,
      rgba(8, 24, 10, 0.85) 38%,
      rgba(9, 26, 11, 0.85) 50%,
      rgba(7, 22, 9, 0.87) 62%,
      rgba(6, 20, 8, 0.89) 75%,
      rgba(5, 18, 7, 0.91) 88%,
      rgba(4, 16, 6, 0.93) 100%
    ),
    url('../assets/background-blur.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

/* Project detail pages: darker dark blue overlay over background image */
body.page-projects:not(.page-projects-listing) .page-bg {
  background-color: #080a0f;
  background-image:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0.4) 35%, rgba(0, 0, 0, 0.5) 100%),
    linear-gradient(
      165deg,
      rgba(10, 13, 18, 0.94) 0%,
      rgba(11, 14, 20, 0.92) 12%,
      rgba(12, 15, 22, 0.9) 25%,
      rgba(13, 16, 24, 0.9) 38%,
      rgba(14, 17, 26, 0.9) 50%,
      rgba(12, 15, 22, 0.9) 62%,
      rgba(11, 14, 18, 0.92) 75%,
      rgba(10, 13, 18, 0.94) 88%,
      rgba(8, 10, 15, 0.96) 100%
    ),
    url('../assets/background-blur2.png');
}

body.page-home,
body.page-projects-listing,
body.page-projects:not(.page-projects-listing),
body[data-narrative] {
  background-color: transparent;
}

body.page-home main {
  position: relative;
  z-index: 1;
}

/* From first section down: same purple overlay as hero, static background image */
body.page-home .page-home-section-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -2;
  pointer-events: none;
  background-color: #040306;
  background-image:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0.28) 35%, rgba(0, 0, 0, 0.42) 100%),
    linear-gradient(
      165deg,
      rgba(5, 4, 7, 0.9) 0%,
      rgba(14, 10, 24, 0.86) 25%,
      rgba(18, 14, 32, 0.82) 50%,
      rgba(14, 10, 24, 0.86) 75%,
      rgba(5, 4, 7, 0.9) 100%
    ),
    url('../assets/background-blur.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

body.page-home main > * {
  position: relative;
  z-index: 1;
}

/* Home page: glassy section box for intro only (below hero) */
body.page-home #intro .container {
  background-color: rgba(24, 20, 32, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 2.25rem 1.5rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

/* Home page: from Featured Projects down, no section container background */
body.page-home #featured .container,
body.page-home #featured ~ .section .container {
  background-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 2.25rem 1.5rem;
}

/* Home page: keep glassy project cards */
body.page-home .project-card {
  background-color: rgba(28, 24, 36, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12);
}

body.page-home .project-card:hover,
body.page-home .project-card:focus-visible {
  background-color: rgba(48, 38, 62, 0.55);
  border-color: rgba(168, 85, 247, 0.15);
}

/* Projects listing: no background on intro header (heading + description + nav) */
body.page-projects .projects-intro .container {
  background-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 2.25rem 1.5rem;
}

/* Projects page: no background for project category sections */
body.page-projects .project-category .container {
  background-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

/* Projects page: glassy project cards with teal accent */
body.page-projects .project-card {
  background-color: rgba(20, 28, 28, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(94, 234, 212, 0.08);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12);
}

body.page-projects .project-card:hover,
body.page-projects .project-card:focus-visible {
  background-color: rgba(24, 36, 36, 0.55);
  border-color: rgba(94, 234, 212, 0.15);
  box-shadow: 0 4px 20px rgba(20, 184, 166, 0.1);
}

/* Home page: keep glassy timeline nodes */
body.page-home .timeline-node {
  background-color: rgba(28, 24, 36, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12);
}

body.page-home .timeline-node:hover {
  background-color: rgba(48, 38, 62, 0.55);
  border-color: rgba(168, 85, 247, 0.15);
}

/* Home page: keep glassy post cards */
body.page-home .post-card {
  background-color: rgba(28, 24, 36, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12);
}

body.page-home .post-card-link:hover .post-card,
body.page-home .post-card-link:focus-visible .post-card {
  background-color: rgba(48, 38, 62, 0.55);
  border-color: rgba(168, 85, 247, 0.15);
}

/* ========================================
   Layout
   ======================================== */

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

body > .container {
  padding-top: 2rem;
}

/* ========================================
   Sticky Navigation
   ======================================== */

.nav-sticky {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background-color: rgba(10, 9, 13, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

main {
  padding-top: 3.5rem;
}

/* Centered navbar container: same max-width band centered on all viewports */
.nav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem 1.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

.nav-logo {
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  margin-left: 7.25rem;
}

.nav-sticky ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1rem;
}

.nav-sticky a {
  color: #a0a0a0;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s ease;
}

.nav-sticky a:hover,
.nav-sticky a.active {
  color: #fff;
}

@media (max-width: 768px) {
  .nav-logo {
    margin-left: 0;
  }
}

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

.section {
  padding: 1.25rem 0;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 1.5rem;
  color: #fff;
  letter-spacing: -0.02em;
}

/* Contact section: scroll-to offset so nav "Contact" lands a bit higher (matches scroll-arrow offset) */
#contact {
  scroll-margin-top: 45px;
}

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

/* Hero: full viewport, name + subtitle centered in middle of screen */
.hero {
  position: relative;
  min-height: calc(100vh - 3.5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  overflow: hidden;
}

/* Home page: very soft purple glow behind hero text, blends into background */
body.page-home .hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse 100% 80% at 50% 45%,
    rgba(168, 85, 247, 0.07) 0%,
    rgba(168, 85, 247, 0.03) 35%,
    transparent 65%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  max-width: 720px;
  padding: 0 1.5rem;
  margin-top: -1.25rem;
}

.hero-name {
  font-size: clamp(3rem, 14vw, 6rem);
  font-weight: 600;
  margin: 0 0 0.5rem;
  /* Periodic gradient: first and second halves match so loop is seamless */
  background: linear-gradient(90deg, var(--accent-light) 0%, var(--accent-secondary) 12.5%, var(--accent-primary) 25%, var(--accent-secondary) 37.5%, var(--accent-light) 50%, var(--accent-secondary) 62.5%, var(--accent-primary) 75%, var(--accent-secondary) 87.5%, var(--accent-light) 100%);
  background-size: 200% 100%;
  background-position: 100% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.03em;
  line-height: 1.1;
  text-align: center;
  /* Fade at edges so wave fades in from left and out to right, hiding loop reset */
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 10%, black 90%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, black 10%, black 90%, transparent 100%);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-name {
    animation: hero-name-gradient-wave 8s linear infinite;
  }
}

/* One direction only: right to left, then seamless reset (no bounce) */
@keyframes hero-name-gradient-wave {
  0% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero-subtitle {
  font-size: 1.1rem;
  color: #888;
  margin: 0;
  font-weight: 400;
}

/* Scroll-down arrow: delayed fade-in, smooth scroll to next section */
.scroll-arrow {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: 2.75rem;
  height: 2.75rem;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, color 0.2s ease;
}

.scroll-arrow:hover,
.scroll-arrow:focus-visible {
  color: rgba(255, 255, 255, 0.85);
}

.scroll-arrow:focus {
  outline: none;
}

.scroll-arrow:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 4px;
  border-radius: 4px;
}

.scroll-arrow--visible {
  opacity: 0.6;
  pointer-events: auto;
}

.scroll-arrow--visible:hover,
.scroll-arrow--visible:focus-visible {
  opacity: 0.9;
}

.scroll-arrow-icon {
  display: block;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid currentColor;
  margin-top: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .scroll-arrow {
    transition: none;
  }
}

/* First section below hero: offset for sticky nav when scrolling into view */
#intro {
  scroll-margin-top: 3.5rem;
}

/* Intro section (tagline + CTA + photo, below hero) */
.intro-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.5rem;
}

.intro-content {
  flex: 1;
  min-width: 0;
}

.hero-photo {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 12px;
  flex-shrink: 0;
  filter: grayscale(30%) contrast(0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-tagline {
  font-size: 1.1rem;
  color: #b0b0b0;
  width: 100%;
  margin: 0 0 2rem;
  line-height: 1.65;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero-cta a:not(.contact-icon-link) {
  color: var(--accent-link);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.35rem 0;
  transition: color 0.15s ease;
}

.hero-cta a:not(.contact-icon-link):hover {
  color: var(--accent-link-hover);
}

/* Intro CTA uses same icon+label chips as Contact section */
.hero-cta.contact-header-icons {
  gap: 0.75rem;
}

/* ========================================
   Narrative Timeline / My Path
   ======================================== */

/* Wrapper for edge fades (hint that more content is scrollable) */
.timeline-marquee-wrap {
  position: relative;
}

/* Minimal hint that timeline is scrollable and cards are clickable */
.timeline-hint {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.35);
  margin: -0.5rem 0 1rem;
  letter-spacing: 0.02em;
}

/* Marquee viewport: scrollable, scrollbar hidden, start with first card centered */
.timeline-marquee {
  overflow-x: auto;
  overflow-y: visible;
  padding: 1.5rem 1.5rem 2rem;
  padding-left: max(1.5rem, calc(50% - 150px));
  touch-action: pan-x pan-y pinch-zoom;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overflow-anchor: none;
}

.timeline-marquee::-webkit-scrollbar {
  display: none;
}

/* When reduced motion: static, single set, user can scroll horizontally */
@media (prefers-reduced-motion: reduce) {
  .timeline-marquee {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
  }

  .timeline-marquee .timeline-track {
    animation: none;
  }

  .timeline-marquee .timeline-set-duplicate {
    display: none;
  }
}

/* Pause animation on hover/focus - handled via JS (timeline-track-paused) to avoid scroll jump */
.timeline-track-paused {
  animation-play-state: paused;
}

.timeline-track {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  width: max-content;
  will-change: transform;
  animation: timeline-marquee 550s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .timeline-track {
    will-change: auto;
  }
}

@keyframes timeline-marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* Extended track (12 sets): animate 50% = 6 sets for seamless loop */
.timeline-track-extended {
  animation: timeline-marquee-extended 540s linear infinite;
}

@keyframes timeline-marquee-extended {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* Each set (original + duplicate) takes equal space */
.timeline-set {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 0.25rem;
  flex-shrink: 0;
}

.timeline {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 0.25rem;
}

.timeline-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.timeline-item:nth-of-type(2) {
  margin-top: 1.5rem;
}

.timeline-item:nth-of-type(3) {
  margin-top: 3rem;
}

.timeline-item:nth-of-type(4) {
  margin-top: 4.5rem;
}

.timeline-item:nth-of-type(5) {
  margin-top: 6rem;
}

.timeline-item:last-child {
  margin-right: 9rem;
}

.timeline-node {
  flex: 0 0 280px;
  min-width: 260px;
  display: block;
  position: relative;
  z-index: 1;
  text-decoration: none;
  color: inherit;
  background-color: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  padding: 1rem 1rem;
  transition: transform 200ms ease, border-color 0.2s ease, background-color 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

/* First card: "Origin" label (small, low-key) */
.timeline-item:first-child .timeline-node::before {
  content: "Origin";
  position: absolute;
  top: -0.5rem;
  left: 0.5rem;
  font-size: 0.5rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(200, 180, 220, 0.7);
  background: rgba(60, 40, 80, 0.25);
  padding: 0.12rem 0.35rem;
  border-radius: 2px 2px 0 0;
  border: 1px solid rgba(168, 85, 247, 0.15);
  border-bottom: none;
  pointer-events: none;
  z-index: 1;
}

/* Last card: "Now" label (small, low-key) */
.timeline-item:last-child .timeline-node::before {
  content: "Now";
  position: absolute;
  top: -0.5rem;
  right: 0.5rem;
  left: auto;
  font-size: 0.5rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(200, 180, 220, 0.7);
  background: rgba(60, 40, 80, 0.25);
  padding: 0.12rem 0.35rem;
  border-radius: 2px 2px 0 0;
  border: 1px solid rgba(168, 85, 247, 0.15);
  border-bottom: none;
  pointer-events: none;
  z-index: 1;
}

.timeline-node:focus {
  outline: none;
}

.timeline-node:focus-visible {
  outline: 2px solid rgba(122, 184, 232, 0.6);
  outline-offset: 2px;
}

.timeline-node:hover {
  border-color: #404040;
  background-color: #1e1e1e;
}

@media (hover: hover) {
  .timeline-node:hover {
    transform: scale(1.02);
  }
}

.timeline-node-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
  color: #fff;
  letter-spacing: -0.01em;
  line-height: 1.35;
}


.timeline-node-subtitle {
  font-size: 0.8rem;
  color: #888;
  margin: 0 0 0.5rem;
  line-height: 1.4;
}

.timeline-node-note {
  font-size: 0.75rem;
  color: #666;
  margin: 0;
  font-style: italic;
  line-height: 1.4;
}

/* Line between narrative cards: visible connector with stepped path */
.timeline-connector {
  flex-shrink: 0;
  width: 3rem;
  margin-top: 0.5rem;
  color: #404040;
  align-self: center;
}

.timeline-connector-line {
  width: 100%;
  height: auto;
  display: block;
}

/* Mobile: marquee stays horizontal (swipe/scroll when reduced motion) */
@media (max-width: 720px) {
  .timeline-marquee .timeline-set,
  .timeline-marquee .timeline {
    flex-direction: row;
    gap: 0.25rem;
  }

  .timeline-marquee .timeline-item {
    flex-direction: row;
    margin-top: 0 !important;
  }

  .timeline-marquee .timeline-node {
    min-width: 240px;
  }

}

/* ========================================
   Narrative detail pages
   ======================================== */

/* Narrative pages: background from .page-bg (color #060508), same purple vibe as main page */
body[data-narrative] {
  background-color: transparent;
  --accent-primary: #a855f7;
  --accent-secondary: #c084fc;
  --accent-light: #f5e6ff;
  --accent-link: #a78bfa;
  --accent-link-hover: #c4b5fd;
}

body[data-narrative] main {
  position: relative;
  z-index: 1;
  background-color: rgba(24, 20, 32, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 2.25rem 1.5rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.narrative-page {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

.narrative-back-wrap {
  margin: 0 0 1.5rem;
}

.narrative-back {
  display: inline-block;
  color: var(--accent-link);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s ease;
}

.narrative-back:hover,
.narrative-back:focus-visible {
  color: var(--accent-link-hover);
}

.narrative-back:focus {
  outline: none;
}

.narrative-back:focus-visible {
  outline: 2px solid rgba(122, 184, 232, 0.6);
  outline-offset: 2px;
  border-radius: 2px;
}

body[data-narrative] .narrative-back:focus-visible {
  outline-color: rgba(167, 139, 250, 0.6);
}

.narrative-header {
  margin-bottom: 2rem;
}

.narrative-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.narrative-header-logos {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.narrative-header-logos .narrative-header-logo-link {
  flex: 0 0 auto;
  display: inline-block;
}

.narrative-title {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: #fff;
  letter-spacing: -0.02em;
}

.narrative-title-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  display: inline-block;
  transform: scale(1);
  transition: transform 0.16s ease;
  transform-origin: left center;
}

.narrative-title-link:hover,
.narrative-title-link:focus-visible {
  transform: scale(1.02);
}

.narrative-title-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.1em;
  height: 1px;
  background: currentColor;
  opacity: 0.8;
  transform: scaleX(0);
  transition: transform 0.16s ease;
  transform-origin: right;
}

.narrative-title-link:hover::after,
.narrative-title-link:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

.narrative-title-link-gallery {
  transform: none;
  transition: color 0.2s ease;
}

.narrative-title-link-gallery:hover,
.narrative-title-link-gallery:focus-visible {
  color: var(--accent-link);
  transform: none;
}

.narrative-title-link-gallery:focus {
  outline: none;
}

.narrative-title-link:focus {
  outline: none;
}

.narrative-header-logo-link {
  flex-shrink: 0;
  display: block;
  cursor: pointer;
  transform: scale(1);
  transition: transform 0.2s ease;
}

.narrative-header-logo-link:hover,
.narrative-header-logo-link:focus-visible {
  transform: scale(1.05);
}

.narrative-header-logo-link:focus {
  outline: none;
}

.narrative-header-logo-link:focus-visible {
  outline: 2px solid rgba(122, 184, 232, 0.6);
  outline-offset: 2px;
  border-radius: 8px;
}

body[data-narrative] .narrative-header-logo-link:focus-visible {
  outline-color: rgba(167, 139, 250, 0.6);
}

.narrative-header-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  display: block;
}

@media (max-width: 600px) {
  .narrative-header-logo {
    width: 44px;
    height: 44px;
  }
}

.narrative-desc {
  font-size: 1rem;
  color: #a0a0a0;
  line-height: 1.6;
  margin: 0;
}

/* Narrative pages: refined, lowkey text styling */
body[data-narrative] .narrative-page,
body[data-narrative] .narrative-back,
body[data-narrative] .narrative-title,
body[data-narrative] .narrative-desc,
body[data-narrative] .narrative-section h2,
body[data-narrative] .narrative-section p,
body[data-narrative] .narrative-section li,
body[data-narrative] .narrative-section a,
body[data-narrative] .narrative-intro-text,
body[data-narrative] .narrative-key-takeaway,
body[data-narrative] .narrative-key-takeaway-label,
body[data-narrative] .narrative-dated-label,
body[data-narrative] .narrative-dated-body p,
body[data-narrative] .narrative-placeholder {
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body[data-narrative] .narrative-title {
  font-weight: 600;
  letter-spacing: -0.015em;
  color: rgba(255, 255, 255, 0.96);
}

body[data-narrative] .narrative-desc,
body[data-narrative] .narrative-intro-text,
body[data-narrative] .narrative-section p,
body[data-narrative] .narrative-dated-body p,
body[data-narrative] .narrative-placeholder {
  color: #b8b4ae;
  line-height: 1.72;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.012em;
}

body[data-narrative] .narrative-section h2 {
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.88);
}

body[data-narrative] .narrative-section li,
body[data-narrative] .narrative-section li strong {
  color: #b8b4ae;
  line-height: 1.7;
}

body[data-narrative] .narrative-key-takeaway,
body[data-narrative] .narrative-key-takeaway-label {
  color: #9a958c;
  font-size: 0.9rem;
  font-style: italic;
  letter-spacing: 0.01em;
}

body[data-narrative] .narrative-dated-label {
  color: #8a857c;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.narrative-content {
  margin-bottom: 2.5rem;
}

.narrative-section {
  margin-bottom: 1.5rem;
}

.narrative-section h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}

.narrative-section p,
.narrative-placeholder {
  font-size: 0.95rem;
  color: #a0a0a0;
  line-height: 1.6;
  margin: 0;
}

.narrative-intro {
  margin-bottom: 2.5rem;
}

.narrative-intro-text {
  font-size: 0.95rem;
  color: #b0b0b0;
  line-height: 1.65;
  margin: 0 0 1rem;
}

.narrative-intro-text:last-of-type {
  margin-bottom: 1.25rem;
}

.narrative-key-takeaway {
  font-size: 0.875rem;
  color: #888;
  line-height: 1.5;
  margin: 0;
  border-left: 2px solid rgba(255, 255, 255, 0.35);
  padding-left: 0.75rem;
}

.narrative-key-takeaway-label {
  color: #777;
}

/* Dated narrative sections: timeline labels on left, vertical guide line (reusable across narrative pages) */
.narrative-dated {
  margin-bottom: 2.5rem;
}

.narrative-dated-block {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 2.25rem;
}

.narrative-dated-block:last-of-type {
  margin-bottom: 0;
}

.narrative-dated-block::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.12);
}

.narrative-dated-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.6rem;
}

.narrative-dated-body p {
  font-size: 0.95rem;
  color: #b0b0b0;
  line-height: 1.65;
  margin: 0 0 0.85rem;
}

.narrative-dated-body p:last-child {
  margin-bottom: 0;
}

/* Right-side bracket ] takeaway block (reusable: add .narrative-dated-emphasis-purple for purple accent) */
.narrative-dated-emphasis {
  position: relative;
  padding-right: 1rem;
}

.narrative-dated-emphasis::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 0.5rem;
  border-right: 2px solid rgba(200, 175, 130, 0.5);
  border-top: 2px solid rgba(200, 175, 130, 0.5);
  border-bottom: 2px solid rgba(200, 175, 130, 0.5);
}

.narrative-dated-emphasis p:last-child {
  margin-bottom: 0;
}

.narrative-dated-emphasis-purple.narrative-dated-emphasis::after {
  border-right-color: rgba(168, 85, 247, 0.5);
  border-top-color: rgba(168, 85, 247, 0.5);
  border-bottom-color: rgba(168, 85, 247, 0.5);
}

/* Gallery narrative: justified text for readability */
body[data-narrative="gallery"] .narrative-intro-text {
  text-align: justify;
  hyphens: auto;
  line-height: 1.7;
}

body[data-narrative="gallery"] .narrative-key-takeaway {
  text-align: justify;
  hyphens: auto;
}

/* SFU narrative: justified text for readability */
body[data-narrative="sfu"] .narrative-dated-body p,
body[data-narrative="sfu"] .narrative-content .narrative-section p {
  text-align: justify !important;
  hyphens: auto;
  line-height: 1.7;
}

/* Synkron narrative: justified text for readability */
body[data-narrative="synkron"] .narrative-dated-body p,
body[data-narrative="synkron"] .narrative-content .narrative-section p {
  text-align: justify !important;
  hyphens: auto;
  line-height: 1.65;
}

/* Next — ML / Data / Software roles: glass card, hover glow, content hierarchy */
body[data-narrative="next"] .next-roles-main {
  transition: box-shadow 0.35s ease, border-color 0.35s ease;
}

body[data-narrative="next"] .next-roles-main:hover {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2), 0 0 40px rgba(168, 85, 247, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

body[data-narrative="next"] .next-roles-inner {
  max-width: 42rem;
  margin: 0 auto;
}

body[data-narrative="next"] .next-roles-title,
body[data-narrative="next"] .next-roles-subtitle,
body[data-narrative="next"] .next-roles-block-heading,
body[data-narrative="next"] .next-roles-body,
body[data-narrative="next"] .next-roles-pill,
body[data-narrative="next"] .next-roles-contact-link {
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body[data-narrative="next"] .next-roles-title {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  letter-spacing: -0.015em;
  color: rgba(255, 255, 255, 0.96);
}

body[data-narrative="next"] .next-roles-subtitle {
  font-size: 1rem;
  color: #b8b4ae;
  line-height: 1.72;
  margin: 0 0 2rem;
  font-weight: 400;
  letter-spacing: 0.012em;
}

body[data-narrative="next"] .next-roles-content {
  margin-bottom: 0;
}

body[data-narrative="next"] .next-roles-block-heading {
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  margin: 0 0 0.5rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body[data-narrative="next"] .next-roles-body {
  font-size: 1rem;
  color: #b8b4ae;
  line-height: 1.72;
  margin: 0 0 1.5rem;
  font-weight: 400;
  letter-spacing: 0.012em;
}

body[data-narrative="next"] .narrative-section:last-child .next-roles-body {
  margin-bottom: 0;
}

body[data-narrative="next"] .next-roles-pills {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

body[data-narrative="next"] .next-roles-pill {
  display: inline-block;
  font-size: 0.875rem;
  color: #b8b4ae;
  background-color: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-weight: 400;
  letter-spacing: 0.02em;
}

body[data-narrative="next"] .next-roles-contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

body[data-narrative="next"] .next-roles-contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  background-color: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.35);
  border-radius: 6px;
  color: #c4b5fd;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

body[data-narrative="next"] .next-roles-contact-link:hover,
body[data-narrative="next"] .next-roles-contact-link:focus-visible {
  color: #e9d5ff;
  border-color: rgba(167, 139, 250, 0.5);
  background-color: rgba(139, 92, 246, 0.2);
  opacity: 1;
  transform: scale(1.03);
}

body[data-narrative="next"] .next-roles-contact-link:focus {
  outline: none;
}

body[data-narrative="next"] .next-roles-contact-link:focus-visible {
  outline: 2px solid rgba(167, 139, 250, 0.6);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  body[data-narrative="next"] .next-roles-inner {
    padding: 0;
  }

  body[data-narrative="next"] .next-roles-title {
    font-size: 1.5rem;
  }

  body[data-narrative="next"] .next-roles-pills {
    gap: 0.4rem;
  }

  body[data-narrative="next"] .next-roles-pill {
    font-size: 0.8125rem;
    padding: 0.3rem 0.6rem;
  }
}

/* Narrative prev/next: glassy pill buttons matching main page */
.narrative-prev-next {
  display: contents;
}

body[data-narrative] .narrative-btn-prev,
body[data-narrative] .narrative-btn-next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  text-decoration: none;
  background: none;
  border: none;
  border-radius: 0;
  transition: transform 0.2s ease;
  z-index: 50;
}

body[data-narrative] .narrative-btn-prev img,
body[data-narrative] .narrative-btn-next img {
  display: block;
  width: 1.375rem;
  height: 1.375rem;
  object-fit: contain;
  transition: filter 0.2s ease, transform 0.2s ease;
  /* dark purplish, still visible */
  filter: brightness(0) saturate(100%) invert(0.2) sepia(0.4) saturate(2.5) hue-rotate(248deg);
}

body[data-narrative] .narrative-btn-prev:hover img,
body[data-narrative] .narrative-btn-prev:focus-visible img,
body[data-narrative] .narrative-btn-next:hover img,
body[data-narrative] .narrative-btn-next:focus-visible img,
body[data-narrative] .narrative-btn-prev.narrative-btn-key-hover img,
body[data-narrative] .narrative-btn-next.narrative-btn-key-hover img {
  /* slightly lighter dark purple (subtle), bigger on hover or arrow key */
  filter: brightness(0) saturate(100%) invert(0.28) sepia(0.4) saturate(2.2) hue-rotate(248deg);
  transform: scale(1.15);
}

body[data-narrative] .narrative-btn-prev {
  position: fixed;
  left: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
}

body[data-narrative] .narrative-btn-next {
  position: fixed;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
}

body[data-narrative] .narrative-btn-prev:hover,
body[data-narrative] .narrative-btn-prev:focus-visible {
  transform: translateY(-50%) scale(1.02);
}

body[data-narrative] .narrative-btn-next:hover,
body[data-narrative] .narrative-btn-next:focus-visible {
  transform: translateY(-50%) scale(1.02);
}

body[data-narrative] .narrative-btn:focus {
  outline: none;
}

body[data-narrative] .narrative-btn:focus-visible {
  outline: none;
}

body[data-narrative] .narrative-btn-disabled {
  color: #555;
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

/* Mobile: show prev/next in-flow at bottom instead of fixed sides */
@media (max-width: 768px) {
  body[data-narrative] .narrative-prev-next {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.5rem;
  }

  body[data-narrative] .narrative-btn-prev,
  body[data-narrative] .narrative-btn-next {
    position: static;
    transform: none;
  }

  body[data-narrative] .narrative-btn-prev:hover,
  body[data-narrative] .narrative-btn-next:hover,
  body[data-narrative] .narrative-btn-prev:focus-visible,
  body[data-narrative] .narrative-btn-next:focus-visible {
    transform: scale(1.02);
  }
}

/* Legacy bottom-nav styles (non-narrative pages, if any) */
.narrative-btn {
  display: inline-block;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--accent-link);
  background-color: transparent;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.narrative-btn:hover,
.narrative-btn:focus-visible {
  border-color: #4a4a4a;
  color: var(--accent-link-hover);
}

.narrative-btn:focus {
  outline: none;
}

.narrative-btn:focus-visible {
  outline: 2px solid rgba(122, 184, 232, 0.6);
  outline-offset: 2px;
}

.narrative-btn-disabled {
  color: #555;
  border-color: #2a2a2a;
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

/* ========================================
   Gallery Carousel
   ======================================== */

.gallery-carousel {
  margin: 2.5rem 0 3rem;
  padding: 0;
}

.gallery-carousel-viewport {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 2.5rem;
}

.gallery-carousel-viewport:focus,
.gallery-carousel-viewport:focus-visible {
  outline: none;
  box-shadow: none;
}

.gallery-carousel-track {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 480px;
}

.gallery-carousel-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
}

.gallery-carousel-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.gallery-carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

@media (prefers-reduced-motion: no-preference) {
  .gallery-carousel-slide {
    transition: opacity 0.25s ease;
  }
}

.gallery-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: rgba(42, 42, 42, 0.8);
  color: #b0b0b0;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.gallery-carousel-arrow:hover,
.gallery-carousel-arrow:focus-visible {
  opacity: 1;
  color: #fff;
  background-color: rgba(60, 60, 60, 0.9);
}

.gallery-carousel-arrow:focus {
  outline: none;
}

.gallery-carousel-arrow:focus-visible {
  outline: 2px solid rgba(122, 184, 232, 0.6);
  outline-offset: 2px;
}

.gallery-carousel-prev {
  left: 0;
}

.gallery-carousel-next {
  right: 0;
}

@media (min-width: 601px) {
  .gallery-carousel-arrow {
    opacity: 0;
  }

  .gallery-carousel-viewport:hover .gallery-carousel-arrow,
  .gallery-carousel-arrow:focus-visible {
    opacity: 0.6;
  }

  .gallery-carousel-viewport:hover .gallery-carousel-arrow:hover,
  .gallery-carousel-viewport:hover .gallery-carousel-arrow:focus-visible {
    opacity: 1;
  }
}

.gallery-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0;
}

.gallery-carousel-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background-color: #3a3a3a;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.gallery-carousel-dot:hover,
.gallery-carousel-dot:focus-visible {
  background-color: #5a5a5a;
}

.gallery-carousel-dot:focus {
  outline: none;
}

.gallery-carousel-dot:focus-visible {
  outline: 2px solid rgba(122, 184, 232, 0.6);
  outline-offset: 2px;
}

body[data-narrative] .gallery-carousel-arrow:focus-visible {
  outline-color: rgba(167, 139, 250, 0.6);
}

body[data-narrative] .gallery-carousel-dot:focus-visible {
  outline-color: rgba(167, 139, 250, 0.6);
}

.gallery-carousel-dot.active {
  background-color: var(--accent-link);
}

@media (max-width: 600px) {
  .gallery-carousel-viewport {
    padding: 0 1rem;
  }

  .gallery-carousel-track {
    aspect-ratio: auto;
    max-height: none;
  }

  .gallery-carousel-track {
    min-height: 200px;
  }
}

/* ========================================
   Featured Projects
   ======================================== */

.project-cards {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.project-card {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  background-color: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 0.15s ease, background-color 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.project-card:hover,
.project-card:focus-visible {
  border-color: #3a3a3a;
  background-color: #1e1e1e;
}

.project-card:focus {
  outline: none;
}

.project-card:focus-visible {
  outline: 2px solid rgba(122, 184, 232, 0.6);
  outline-offset: 2px;
}

@media (hover: hover) {
  .project-card:hover,
  .project-card:focus-visible {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  }
}

.project-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: #fff;
}

.project-card p {
  font-size: 0.9rem;
  color: #a0a0a0;
  margin: 0 0 0.75rem;
  line-height: 1.5;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.tech-tags span {
  font-size: 0.75rem;
  color: #b0b0b0;
  background-color: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
}

.card-links {
  display: flex;
  gap: 1rem;
}

.card-links a {
  color: var(--accent-link);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.15s ease;
}

.card-links a:hover {
  color: var(--accent-link-hover);
}

.see-all {
  margin: 0;
}

.see-all a {
  color: var(--accent-link);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.15s ease;
}

.see-all a:hover {
  color: var(--accent-link-hover);
}

/* Home page: "See all" and action links — lighter purple so they don’t look visited */
body.page-home .see-all a {
  display: inline-block;
  background: linear-gradient(90deg, #a78bfa 0%, #c4b5fd 25%, #e9d5ff 50%, #c4b5fd 75%, #a78bfa 100%);
  background-size: 200% 100%;
  background-position: 100% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: transform 0.2s ease;
}

body.page-home .see-all a:hover,
body.page-home .see-all a:focus-visible {
  transform: scale(1.02);
}

@media (prefers-reduced-motion: no-preference) {
  body.page-home .see-all a {
    animation: home-link-gradient 2.5s ease-in-out infinite;
  }
}

@keyframes home-link-gradient {
  0%, 100% { background-position: 100% 50%; }
  50% { background-position: 0% 50%; }
}

/* ========================================
   Posts
   ======================================== */

.posts-intro {
  color: #a0a0a0;
  font-size: 0.95rem;
  margin: 0 0 1.5rem;
  line-height: 1.5;
}

.post-cards {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

/* 2 columns on medium screens, 3 on larger */
@media (min-width: 480px) {
  .post-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 720px) {
  .post-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.post-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.post-card-link:focus {
  outline: none;
}

.post-card-link:focus-visible .post-card {
  outline: 2px solid rgba(122, 184, 232, 0.6);
  outline-offset: 2px;
}

.post-card {
  background-color: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 0.15s ease, background-color 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.post-card-link:hover .post-card,
.post-card-link:focus-visible .post-card {
  border-color: #3a3a3a;
  background-color: #1e1e1e;
}

@media (hover: hover) {
  .post-card-link:hover .post-card,
  .post-card-link:focus-visible .post-card {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  }
}

.post-image-wrapper {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  margin: -1.25rem -1.5rem 1rem -1.5rem;
  height: 160px;
}

.post-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.post-card-link:hover .post-card-image {
  transform: scale(1.02);
}

.external-link-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  padding: 6px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  object-fit: contain;
  pointer-events: none;
  opacity: 0.9;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.post-card-link:hover .external-link-icon {
  opacity: 1;
  transform: translateY(-2px);
}

.post-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: #fff;
}

.post-card-description {
  font-size: 0.85rem;
  color: #a0a0a0;
  margin: 0 0 0.75rem;
  line-height: 1.5;
}

.post-card-year {
  display: block;
  font-size: 0.75rem;
  color: #666;
  margin: 0;
}

/* ========================================
   Skills / Tech Stack
   ======================================== */

.skills-intro {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.95rem;
  margin: -0.35rem 0 1.25rem;
  max-width: 28em;
}

.skills-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  width: 100%;
  align-items: start;
}

@media (min-width: 720px) {
  .skills-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    align-items: stretch;
  }
}

@keyframes skill-glow {
  0%, 100% {
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12), 0 0 20px rgba(168, 85, 247, 0.06);
  }
  50% {
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12), 0 0 28px rgba(168, 85, 247, 0.14);
  }
}

.skill-group {
  width: 100%;
  background-color: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 0.15s ease, background-color 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  position: relative;
  display: flex;
  flex-direction: column;
}

@media (min-width: 720px) {
  .skill-group {
    min-height: 100%;
  }
}

/* Home page: same glass style as project cards / post cards */
body.page-home .skill-group {
  background-color: rgba(28, 24, 36, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12);
  animation: skill-glow 4s ease-in-out infinite;
}

body.page-home .skill-group:hover {
  background-color: rgba(48, 38, 62, 0.55);
  border-color: rgba(168, 85, 247, 0.15);
}

@media (hover: hover) {
  body.page-home .skill-group:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), 0 0 24px rgba(168, 85, 247, 0.12);
  }
}

.skill-group h4 {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  margin: 0 0 0.85rem;
  padding-left: 0.15rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

.skills-grid .chips {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem 0.75rem;
  align-content: start;
}

@media (min-width: 720px) {
  .skills-grid .chips {
    gap: 0.5rem 0.85rem;
  }
}

.skills-grid .chips span {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  text-align: center;
}

.skill-group:hover .chips span {
  color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

body.page-home .skill-group:hover .chips span {
  border-color: rgba(168, 85, 247, 0.2);
  background: rgba(168, 85, 247, 0.08);
}

/* ========================================
   Experience / Leadership
   ======================================== */

.experience-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.experience-item.exp-entry {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #252525;
}

.experience-item.exp-entry:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.exp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 0;
}

.exp-left {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  min-width: 0;
}

.exp-logo-link {
  flex: 0 0 auto;
  display: block;
  text-decoration: none;
  cursor: pointer;
  transform: scale(1);
  opacity: 0.95;
  transition: transform 180ms ease, opacity 180ms ease;
}

.exp-logo-link:hover,
.exp-logo-link:focus-visible {
  transform: scale(1.05);
  opacity: 1;
}

.exp-logo-link:focus {
  outline: none;
}

.exp-logo-link:focus-visible {
  outline: 2px solid rgba(122, 184, 232, 0.6);
  outline-offset: 2px;
  border-radius: 10px;
}

.exp-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 10px;
  background: none;
  border: none;
  box-shadow: none;
  display: block;
}

.exp-titleblock {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.exp-role-row {
  margin-bottom: 0.25rem;
}

.exp-role {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: #fff;
}

.exp-minor {
  font-size: 0.9rem;
  font-weight: 500;
  color: #fff;
  margin: 0.15rem 0 0.4rem;
  line-height: 1.5;
  border-left: 2px solid rgba(255, 255, 255, 0.5);
  padding-left: 10px;
}

.exp-company {
  font-size: 0.9rem;
  color: #888;
  margin: 0 0 0.25rem;
  text-decoration: none;
  transition: color 0.15s ease;
  display: inline-block;
  max-width: fit-content;
}

.exp-company:hover,
.exp-company:focus-visible {
  color: #a0a0a0;
  text-decoration: underline;
}

.exp-company:focus {
  outline: none;
}

.exp-company:focus-visible {
  outline: 2px solid rgba(122, 184, 232, 0.6);
  outline-offset: 2px;
  border-radius: 2px;
}

.exp-dates {
  font-size: 0.85rem;
  color: #666;
  text-align: right;
  white-space: nowrap;
  opacity: 0.95;
  flex-shrink: 0;
}

.exp-meta {
  font-size: 0.8rem;
  color: #666;
  margin: 0 0 0.75rem;
  line-height: 1.5;
}

@media (max-width: 700px) {
  .exp-header {
    flex-wrap: wrap;
    gap: 12px;
  }

  .exp-left {
    gap: 16px;
  }

  .exp-logo {
    width: 48px;
    height: 48px;
    border-radius: 8px;
  }

  .exp-dates {
    width: 100%;
    text-align: left;
    white-space: normal;
    order: 3;
    padding-top: 0.25rem;
    border-top: 1px solid #252525;
  }
}

.exp-desc,
ul.exp-desc {
  font-size: 0.9rem;
  color: #a0a0a0;
  margin: 0 0 0.75rem;
  line-height: 1.55;
}

ul.exp-desc {
  padding-left: 1.25rem;
}

ul.exp-desc li {
  margin-bottom: 0.35rem;
}

ul.exp-desc li:last-child {
  margin-bottom: 0;
}

.exp-website {
  font-size: 0.8rem;
  margin: 0 0 0.75rem;
}

.exp-website a {
  color: var(--accent-link);
  text-decoration: none;
  transition: color 0.15s ease;
}

.exp-website a:hover {
  color: var(--accent-link-hover);
}

.exp-skills {
  font-size: 0.8rem;
  color: #888;
  margin: 0;
  line-height: 1.5;
}

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

.edu-entry h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
  color: #fff;
}

.edu-org {
  font-size: 0.9rem;
  color: #888;
  margin: 0 0 0.25rem;
}

.edu-date {
  font-size: 0.85rem;
  color: #666;
  margin: 0;
}

/* ========================================
   Contact
   ======================================== */

/* Contact section: heading and social icons on one row */
.contact-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.contact-header-row .section-title {
  margin-bottom: 0;
}

.contact-header-icons {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.contact-icon-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background-color: rgba(255, 255, 255, 0.04);
  opacity: 0.85;
  text-decoration: none;
  color: #b0b0b0;
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
  cursor: pointer;
}

.contact-icon-link:hover,
.contact-icon-link:focus-visible {
  opacity: 1;
  transform: scale(1.06);
  border-color: rgba(255, 255, 255, 0.18);
  background-color: rgba(255, 255, 255, 0.08);
  color: #e0e0e0;
}

/* Home intro: CTA chips hover – same as skills cards / narrative cards */
body.page-home .contact-icon-link:hover,
body.page-home .contact-icon-link:focus-visible {
  color: rgba(233, 213, 255, 0.95);
  border-color: rgba(168, 85, 247, 0.15);
  background-color: rgba(48, 38, 62, 0.55);
}

.contact-icon-link:focus {
  outline: none;
}

.contact-icon-link:focus-visible {
  outline: 2px solid rgba(122, 184, 232, 0.6);
  outline-offset: 2px;
}

.contact-icon-link img {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}

.contact-icon-label {
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}

/* Contact section: icons only, no label text or pill background */
.contact-icon-link--icon-only {
  padding: 0.25rem;
  border: none;
  border-radius: 0;
  background: none;
}

.contact-icon-link--icon-only:hover,
.contact-icon-link--icon-only:focus-visible {
  border-color: transparent;
  background-color: transparent;
}

/* Contact section header (email, LinkedIn, GitHub): no background or border on hover/focus */
#contact .contact-icon-link--icon-only,
#contact .contact-icon-link--icon-only:hover,
#contact .contact-icon-link--icon-only:focus-visible {
  background: none !important;
  background-color: transparent !important;
  border: none !important;
  border-color: transparent !important;
}

.contact-icon-link--icon-only .contact-icon-label {
  display: none;
}

.contact-intro {
  color: #b0b0b0;
  font-size: 1rem;
  margin: 0 0 1.5rem;
  width: 100%;
}

.contact-form {
  max-width: 700px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

.contact-form label {
  font-size: 0.9rem;
  color: #c0c0c0;
  margin-bottom: -0.25rem;
}

.contact-form input,
.contact-form textarea {
  font-family: inherit;
  font-size: 1rem;
  color: #e0e0e0;
  background-color: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: #666;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: #4a4a4a;
  box-shadow: 0 0 0 2px rgba(122, 184, 232, 0.2);
}

/* Home page: glassy contact inputs */
body.page-home .contact-form input,
body.page-home .contact-form textarea {
  background-color: rgba(28, 24, 36, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

body.page-home .contact-form input:focus,
body.page-home .contact-form textarea:focus {
  border-color: rgba(168, 85, 247, 0.5);
  background-color: rgba(36, 32, 44, 0.5);
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.2);
}

.contact-form textarea {
  resize: vertical;
  min-height: 100px;
}

.contact-submit {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: #0f0f0f;
  background-color: var(--accent-link);
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1.25rem;
  cursor: pointer;
  align-self: flex-start;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.contact-submit:hover {
  background-color: var(--accent-link-hover);
  color: #0f0f0f;
}

/* Home page: Send button – solid purple */
body.page-home .contact-submit {
  background-color: #5b21b6;
  border: 1px solid rgba(88, 28, 135, 0.8);
  color: #e9d5ff;
}

body.page-home .contact-submit:hover {
  background-color: #6d28d9;
  border-color: rgba(124, 58, 237, 0.9);
  color: #f5e6ff;
}

body.page-home .contact-form-status a {
  display: inline-block;
  background: linear-gradient(90deg, #a78bfa 0%, #c4b5fd 25%, #e9d5ff 50%, #c4b5fd 75%, #a78bfa 100%);
  background-size: 200% 100%;
  background-position: 100% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: transform 0.2s ease;
}

body.page-home .contact-form-status a:hover,
body.page-home .contact-form-status a:focus-visible {
  transform: scale(1.02);
}

@media (prefers-reduced-motion: no-preference) {
  body.page-home .contact-form-status a {
    animation: home-link-gradient 2.5s ease-in-out infinite;
  }
}

.contact-form-status {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: #b0b0b0;
}

.contact-form-status a {
  color: var(--accent-link);
  text-decoration: none;
}

.contact-form-status a:hover {
  color: var(--accent-link-hover);
}

.contact-privacy {
  font-size: 0.85rem;
  color: #666;
  margin: 0 0 1.5rem;
}

@media (min-width: 900px) {
  .contact-intro {
    max-width: 700px;
  }
}

/* ========================================
   Footer
   ======================================== */

.footer {
  padding: 2rem 0 3rem;
  text-align: center;
}

.footer p {
  margin: 0;
  font-size: 0.85rem;
  color: #666;
}

/* ========================================
   Projects Page
   ======================================== */

/* Projects page intro section with subtle teal glow */
body.page-projects .projects-intro {
  position: relative;
  z-index: 2;
  padding-bottom: 0.5rem;
}

body.page-projects .projects-intro::before {
  content: "";
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse at center, rgba(20, 184, 166, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

@media (prefers-reduced-motion: no-preference) {
  body.page-projects .projects-intro::before {
    animation: projects-glow-pulse 8s ease-in-out infinite;
  }
}

@keyframes projects-glow-pulse {
  0%, 100% {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
  50% {
    opacity: 0.7;
    transform: translateX(-50%) scale(1.05);
  }
}

/* Text scramble reveal: slot-machine style character reveal */
.text-scramble-reveal-inner {
  display: inline;
}

.text-scramble-char {
  display: inline;
}

/* Projects listing: main heading — centered, larger, green gradient wave (projects page only) */
body.page-projects .projects-intro h1 {
  font-size: clamp(2.5rem, 12vw, 4.5rem);
  font-weight: 600;
  margin: 0 0 1.25rem;
  text-align: center;
  letter-spacing: -0.03em;
  line-height: 1.1;
  /* Green-toned gradient (uses page-projects accent vars: teal/green) */
  background: linear-gradient(90deg, var(--accent-light) 0%, var(--accent-secondary) 12.5%, var(--accent-primary) 25%, var(--accent-secondary) 37.5%, var(--accent-light) 50%, var(--accent-secondary) 62.5%, var(--accent-primary) 75%, var(--accent-secondary) 87.5%, var(--accent-light) 100%);
  background-size: 200% 100%;
  background-position: 100% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 10%, black 90%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, black 10%, black 90%, transparent 100%);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

@media (prefers-reduced-motion: no-preference) {
  body.page-projects .projects-intro h1 {
    animation: projects-heading-gradient-wave 8s linear infinite;
  }
}

@keyframes projects-heading-gradient-wave {
  0% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Other pages: default main heading */
main h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 1.5rem;
  color: #fff;
}

.projects-intro-card {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
  padding: 1.5rem 1.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.projects-intro-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 1.25rem;
}

.projects-intro-text {
  font-size: 0.95rem;
  color: #a0a0a0;
  line-height: 1.55;
  margin: 0;
  width: 100%;
}

.projects-info-wrap {
  position: relative;
  flex-shrink: 0;
  z-index: 1;
}

.projects-info-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #666;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.projects-info-trigger:hover,
.projects-info-trigger:focus-visible {
  color: #a0a0a0;
  background-color: #252525;
}

.projects-info-trigger:focus {
  outline: none;
}

.projects-info-trigger:focus-visible {
  outline: 2px solid rgba(122, 184, 232, 0.6);
  outline-offset: 2px;
}

/* Projects page: info icon – same lowkey greenish hover as category tabs, no background square, slightly bigger on hover */
body.page-projects .projects-info-trigger {
  transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

body.page-projects .projects-info-trigger:hover,
body.page-projects .projects-info-trigger:focus-visible {
  color: #666;
  background-color: transparent;
  transform: scale(1.12);
}

body.page-projects .projects-info-trigger:focus-visible {
  outline-color: rgba(20, 184, 166, 0.35);
}

.projects-info-icon {
  display: block;
}

.projects-info-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 100;
  min-width: 320px;
  max-width: 420px;
  padding: 0.75rem 1rem;
  background-color: rgba(8, 18, 12, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

.projects-info-wrap:hover .projects-info-popover,
.projects-info-wrap.is-open .projects-info-popover {
  opacity: 1;
  visibility: visible;
}

.projects-info-popover-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 0.5rem;
}

.projects-info-popover-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.85rem;
  color: #a0a0a0;
  line-height: 1.5;
}

.projects-info-popover-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.projects-info-popover-list li:last-child {
  margin-bottom: 0;
}

.projects-info-popover-note {
  font-size: 0.8rem;
  color: #a0a0a0;
  margin: 0.75rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  line-height: 1.4;
}

body.page-projects-listing .projects-info-popover {
  background-color: rgba(6, 16, 10, 0.92);
  border-color: rgba(255, 255, 255, 0.07);
}

/* Last two rows (icon labels): align left with the rows above */
.projects-info-popover-list li:nth-last-child(1),
.projects-info-popover-list li:nth-last-child(2) {
  margin-left: -0.75em;
}
.projects-info-popover-list li:nth-last-child(1) > :first-child,
.projects-info-popover-list li:nth-last-child(2) > :first-child {
  justify-content: flex-start;
}

/* Fixed-width label column so all descriptions align (same width for pills and icons) */
.projects-info-popover-list li > :first-child {
  width: 7.5em;
  min-width: 7.5em;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.projects-info-popover-list .project-card-label {
  margin-bottom: 0;
  text-align: center;
}

.projects-info-icon-inline {
  font-style: normal;
  flex-shrink: 0;
}

.projects-info-sfu-logo {
  display: block;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  object-fit: contain;
}

.projects-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
}

.projects-nav a {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  color: #888;
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.projects-nav a:hover,
.projects-nav a:focus-visible {
  color: #e0e0e0;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

/* Projects page: category tabs greenish hover – lowkey + subtle scale */
body.page-projects .projects-nav a:hover,
body.page-projects .projects-nav a:focus-visible {
  color: #a7c4c0;
  background: rgba(13, 148, 136, 0.08);
  border-color: rgba(20, 184, 166, 0.15);
  transform: scale(1.02);
}

.projects-nav a.is-active {
  /* No highlight: active tab looks same as others */
  color: #888;
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.08);
}

.projects-nav a.is-active:hover,
.projects-nav a.is-active:focus-visible {
  color: #e0e0e0;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

body.page-projects .projects-nav a.is-active:hover,
body.page-projects .projects-nav a.is-active:focus-visible {
  color: #a7c4c0;
  background: rgba(13, 148, 136, 0.08);
  border-color: rgba(20, 184, 166, 0.15);
  transform: scale(1.02);
}

.projects-nav a:focus {
  outline: none;
}

.projects-nav a:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.35);
  outline-offset: 2px;
}

.project-category {
  padding-top: 2.5rem;
  scroll-margin-top: 4rem;
}

.project-category:first-of-type {
  padding-top: 0;
}

.category-heading {
  font-size: 1rem;
  font-weight: 600;
  color: #c0c0c0;
  margin: 0 0 1rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.projects-page .project-cards {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

@media (max-width: 600px) {
  .projects-page .project-cards {
    grid-template-columns: 1fr;
  }
}

/* Legacy list styles (kept for any other use) */
.projects-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.projects-list li {
  padding: 1rem 0;
  border-bottom: 1px solid #2a2a2a;
}

.projects-list li:last-child {
  border-bottom: none;
}

.project-name {
  font-weight: 600;
  margin: 0 0 0.25rem;
  color: #fff;
}

.project-desc {
  margin: 0 0 0.5rem;
  color: #a0a0a0;
  font-size: 0.95rem;
}

.project-links {
  display: flex;
  gap: 1rem;
}

.project-links a {
  color: var(--accent-link);
  text-decoration: none;
  font-size: 0.9rem;
}

.project-links a:hover {
  color: var(--accent-link-hover);
}

/* ========================================
   Project detail page
   ======================================== */

.project-detail {
  padding-top: 8rem;
}

.project-detail .project-back {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: var(--accent-link);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s ease;
}

.project-detail > p:first-child {
  padding-top: 2rem;
}

.project-detail > p:first-child .project-back {
  margin-bottom: 0;
}

.project-detail .project-back:hover {
  color: var(--accent-link-hover);
}

/* Projects page: teal/green gradient on back link and meta links (match projects theme) */
body.page-projects .project-back {
  background: linear-gradient(90deg, #0d9488 0%, #14b8a6 25%, #5eead4 50%, #14b8a6 75%, #0d9488 100%);
  background-size: 200% 100%;
  background-position: 100% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0.68;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

body.page-projects .project-back:hover,
body.page-projects .project-back:focus-visible {
  opacity: 1;
  transform: scale(1.02);
}

@media (prefers-reduced-motion: no-preference) {
  body.page-projects .project-back {
    animation: projects-link-gradient 2.5s ease-in-out infinite;
  }
}

@keyframes projects-link-gradient {
  0%, 100% { background-position: 100% 50%; }
  50% { background-position: 0% 50%; }
}

body.page-projects .project-detail .project-meta-links a {
  background: linear-gradient(90deg, #0d9488 0%, #14b8a6 25%, #5eead4 50%, #14b8a6 75%, #0d9488 100%);
  background-size: 200% 100%;
  background-position: 100% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: transform 0.2s ease;
}

body.page-projects .project-detail .project-meta-links a:hover,
body.page-projects .project-detail .project-meta-links a:focus-visible {
  transform: scale(1.02);
}

@media (prefers-reduced-motion: no-preference) {
  body.page-projects .project-detail .project-meta-links a {
    animation: projects-link-gradient 2.5s ease-in-out infinite;
  }
}

.project-detail .project-header {
  margin-bottom: 2rem;
}

.project-detail .project-title {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: #fff;
  letter-spacing: -0.02em;
}

.project-detail .project-summary {
  font-size: 1rem;
  color: #a0a0a0;
  line-height: 1.6;
  text-align: justify;
  hyphens: auto;
  margin: 0 0 1.4rem;
}

.project-detail .project-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.project-detail .project-detail-labels {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.project-detail .project-detail-labels .project-card-label {
  margin-bottom: 0;
}

.project-detail .project-detail-labels a {
  display: inline-block;
  transition: transform 180ms ease;
}

.project-detail .project-detail-labels a:hover,
.project-detail .project-detail-labels a:focus-visible {
  transform: scale(1.05);
}

.project-detail .project-meta-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0;
}

.project-detail .project-meta-links a {
  color: var(--accent-link);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s ease;
}

.project-detail .project-meta-links a:hover {
  color: var(--accent-link-hover);
}

.project-detail-section {
  margin-bottom: 2rem;
}

.project-detail-section h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 0.75rem;
  letter-spacing: -0.01em;
}

.project-detail-section p {
  font-size: 0.95rem;
  color: #a0a0a0;
  line-height: 1.6;
  text-align: justify;
  hyphens: auto;
  margin: 0;
}

.project-detail .results-placeholder {
  font-size: 0.9rem;
  color: #666;
  font-style: italic;
  text-align: justify;
  hyphens: auto;
  margin: 0;
}

/* Project page: responsive video embed (16:9) */
/* Project detail: responsive YouTube/video embed — full width, 16:9, no white border */
.project-detail .project-video-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  padding-bottom: 0;
  height: auto;
  min-height: 0;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  border: none;
  overflow: hidden;
  background-color: #1a1a1a;
}

.project-detail .project-video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  border: none;
}

@supports not (aspect-ratio: 16 / 9) {
  .project-detail .project-video-wrapper {
    aspect-ratio: none;
    padding-bottom: 56.25%;
    height: 0;
  }
}

/* Project page: screenshot / figure with caption */
.project-detail .project-screenshot {
  margin: 1.5rem 0;
  padding: 0;
  border: none;
  background: none;
}

.project-detail .project-screenshot img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.project-detail .project-screenshot figcaption {
  margin-top: 0.6rem;
  font-size: 0.875rem;
  color: #888;
  line-height: 1.5;
  text-align: left;
}

.project-detail .project-screenshots-grid {
  display: grid;
  gap: 1.5rem;
  margin-top: 1rem;
}

@media (min-width: 640px) {
  .project-detail .project-screenshots-grid.project-screenshots-grid--2 {
    grid-template-columns: 1fr 1fr;
  }
}

/* Project page: feature list */
.project-detail .project-feature-list {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.95rem;
  text-align: justify;
  hyphens: auto;
  color: #a0a0a0;
  line-height: 1.7;
}

/* Project page: paper links + PDF preview */
.project-detail .paper-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin-top: 1rem;
}

.project-detail .paper-links .project-back {
  margin-bottom: 0;
}

.project-detail .pdf-preview-btn {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--accent-primary);
  background: transparent;
  border: 1px solid var(--accent-primary);
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.project-detail .pdf-preview-btn:hover,
.project-detail .pdf-preview-btn:focus-visible {
  color: #0a090d;
  background: var(--accent-primary);
}

.project-detail .pdf-preview-wrap {
  position: relative;
  margin-top: 1.5rem;
  width: 100%;
  min-height: 480px;
  border-radius: 8px;
  overflow: hidden;
  background: #1a1a1a;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.project-detail .pdf-preview-wrap[hidden] {
  display: none !important;
}

.project-detail .pdf-preview-iframe {
  display: block;
  width: 100%;
  height: 560px;
  min-height: 480px;
  border: none;
}

.project-detail .pdf-preview-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 1.5rem;
  line-height: 1;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.project-detail .pdf-preview-close:hover,
.project-detail .pdf-preview-close:focus-visible {
  background: rgba(0, 0, 0, 0.85);
}

.project-detail .project-feature-list li {
  margin-bottom: 0.5rem;
}

/* Project card: status labels — same shape as tech tags */
.project-card-labels-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.project-card-labels-row .project-card-labels {
  margin-bottom: 0;
}

/* Project card: title and logo on same line (e.g. Group ML card) */
.project-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.project-card-title-row h3 {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.project-card-icon {
  font-style: normal;
  line-height: 1;
  flex-shrink: 0;
}

.project-card-logo {
  display: block;
  height: 1.25rem;
  width: auto;
  flex-shrink: 0;
  margin-left: auto;
}

.project-card-logo-sfu {
  opacity: 0.80;
  border-radius: 4px;
}

.project-card-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.project-card-labels .project-card-label {
  margin-bottom: 0;
}

.project-card-label {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.project-card-demo {
  color: #e8d5f5;
  background-color: #3d2d4a;
}

.project-card-in-progress {
  color: #f5e6d5;
  background-color: #4a3d2d;
}

.project-card-research {
  color: #c8e8f2;
  background-color: #2a4048;
}

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

@media (max-width: 600px) {
  .hero {
    padding: 2rem 1rem 3rem;
  }

  .hero-name {
    font-size: clamp(2.25rem, 12vw, 3.5rem);
  }

  .intro-inner {
    flex-direction: column;
    text-align: center;
  }

  .intro-content {
    order: 2;
  }

  .hero-photo {
    order: 1;
    width: 120px;
    height: 120px;
    margin-bottom: 0.5rem;
  }

  .hero-tagline {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-cta {
    justify-content: center;
  }

  .section {
    padding: 1rem 0;
  }

  .nav-inner {
    padding: 0.875rem 1.25rem;
  }

  .nav-logo {
    font-size: 0.9rem;
    margin-left: 0;
  }

  .contact-form {
    max-width: 100%;
  }

  .contact-submit {
    width: 100%;
    align-self: stretch;
  }
}

/* ========================================
   Scroll reveal animations
   ======================================== */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s ease-out, transform 0.9s ease-out;
}

.reveal.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .reveal.reveal-visible {
    opacity: 1;
    transform: none;
  }
}

/* ========================================
   Type-on-scroll headings
   ======================================== */

.type-on-scroll {
  min-width: 0; /* overridden by JS for layout stability during typing */
}

.type-on-scroll-text,
.type-on-scroll-caret {
  display: inline;
}

.type-on-scroll-caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 1px;
  background: currentColor;
  vertical-align: text-bottom;
  animation: type-on-scroll-caret-blink 1s step-end infinite;
}

.type-on-scroll-done .type-on-scroll-caret {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  .type-on-scroll-caret {
    animation: type-on-scroll-caret-blink 1s step-end infinite;
  }
}

@keyframes type-on-scroll-caret-blink {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0;
  }
}

/* ========================================
   Resume preview modal — minimal, glassy
   ======================================== */

.resume-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0.25s ease, opacity 0.25s ease;
}

.resume-preview-modal.resume-preview-open {
  pointer-events: auto;
  visibility: visible;
  opacity: 1;
}

.resume-preview-backdrop {
  position: absolute;
  inset: 0;
  background: transparent;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
}

.resume-preview-box {
  position: relative;
  width: 100%;
  max-width: 880px;
  max-height: calc(100vh - 3rem);
  background: transparent;
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 0 60px rgba(255, 255, 255, 0.08),
    0 0 120px rgba(255, 255, 255, 0.05),
    0 0 180px rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.resume-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.resume-preview-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.resume-preview-download:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.resume-preview-close {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.75);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 10px;
  transition: color 0.2s ease;
}

.resume-preview-close:hover {
  color: #fff;
}

.resume-preview-close:focus {
  outline: none;
}

.resume-preview-close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.resume-preview-iframe-wrap {
  flex: 1;
  min-height: 70vh;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.resume-preview-iframe {
  width: 100%;
  height: 100%;
  min-height: 70vh;
  border: none;
  background: #fff;
  transform: scale(1.058) translateY(-6%);
  transform-origin: center top;
}
