/* ============================================================
   DESIGN TOKENS & CSS VARIABLES
   ============================================================ */
:root {
  --navy: #0f1f35;
  --navy-mid: #162840;
  --blue-bright: #2d8fce;
  --blue-light: #4eb3e8;
  --cream: #e8e0d0;
  --cream-dim: rgba(232, 224, 208, 0.12);
  --glass-bg: rgba(15, 31, 53, 0.42);
  --glass-border: rgba(78, 179, 232, 0.18);
  --glass-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  --text-primary: #e8e0d0;
  --text-secondary: rgba(232, 224, 208, 0.60);
  --text-accent: #4eb3e8;

  /* Parallax speed multipliers — tweak freely */
  --bg-parallax-speed: 0.25;
  /* background moves slower */
  --drop-parallax-speed: 0.55;
  /* droplet layer moves faster */

  /* Content max width */
  --content-max: 900px;

  /* Easing */
  --ease-glass: cubic-bezier(0.23, 1, 0.32, 1);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Syne', sans-serif;
  background: var(--navy);
  color: var(--text-primary);
  overflow-x: hidden;
  cursor: default;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 48px;
  /* Subtle glass navbar that appears after scrolling */
  transition: background 0.5s var(--ease-glass);
}

.navbar.scrolled {
  background: rgba(10, 20, 35, 0.72);
  backdrop-filter: blur(10px) saturate(140%);
  border-bottom: 1px solid var(--glass-border);
}

/* Nav links — text only, hover animated border */
.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
}

.nav-links a {
  position: relative;
  text-decoration: none;
  color: var(--text-secondary);
  font-family: 'Syne', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 10px;
  transition: color 0.3s;
}

/* Animated border on hover — draws in from corners */
.nav-links a::before,
.nav-links a::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid transparent;
  transition: border-color 0.3s, clip-path 0.4s var(--ease-glass);
}

.nav-links a::before {
  clip-path: inset(0 100% 100% 0);
  border-color: var(--blue-light);
}

.nav-links a::after {
  clip-path: inset(100% 0 0 100%);
  border-color: var(--blue-light);
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-links a:hover::before {
  clip-path: inset(0 0 50% 0);
}

.nav-links a:hover::after {
  clip-path: inset(50% 0 0 0);
}

/* Logo — top RIGHT */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.nav-logo img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(45, 143, 206, 0.45));
  transition: filter 0.3s, transform 0.3s var(--ease-glass);
}

/* ============================================================
   LOGO HOVER PANEL
   ============================================================ */
.nav-logo-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

/* The two-button panel that appears on logo hover */
.logo-controls {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  pointer-events: auto;
  transform: translateY(-6px);
  transition: opacity 0.25s var(--ease-glass), transform 0.25s var(--ease-glass), visibility 0.25s;
  z-index: 200;
  visibility: hidden;
}

.nav-logo-wrapper:hover .logo-controls {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.nav-logo-wrapper:hover .nav-logo img {
  filter: drop-shadow(0 0 14px rgba(78, 179, 232, 0.75));
  transform: scale(1.06);
}

.ctrl-btn {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 9px 16px;
  background: rgba(15, 31, 53, 0.72);
  color: var(--cream);
  border: 1px solid var(--glass-border);
  border-radius: 3px;
  cursor: pointer;
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  transition: border-color 0.25s, color 0.25s, background 0.25s, transform 0.2s;
  display: flex;
  align-items: center;
  gap: 7px;
}

.ctrl-btn:hover {
  border-color: var(--blue-light);
  color: var(--blue-light);
  transform: translateX(3px);
}

.ctrl-btn .ctrl-icon {
  font-size: 0.85rem;
  line-height: 1;
}

/* Active state badge */
.ctrl-btn.active {
  border-color: var(--blue-bright);
  color: var(--blue-light);
  background: rgba(45, 143, 206, 0.18);
}

/* ============================================================
   HERO SECTION — 3-LAYER PARALLAX SYSTEM
   ============================================================ */
.hero {
  position: relative;
  width: 100%;
  min-height: max(640px, 100vh);
  overflow: hidden;
}

/* ---- LAYER 1: BACKGROUND ---- */
/* Static or very slow-moving; the "outside world" seen through glass */
.hero__bg {
  position: absolute;
  inset: -20% 0;
  /* oversized so parallax doesn't show edges */
  background: url('imgs/rain_background.jpeg') center center / cover no-repeat;
  will-change: transform;
  filter: none;
  z-index: 0;
  pointer-events: none;
  contain: layout style paint;
  backface-visibility: hidden;
  transition: transform 0.08s linear;
}

/* ---- LAYER 2: DROPLET GLASS LAYER ---- */
/* Same image, but moves at a DIFFERENT scroll speed.
   Masking confines the wet-glass effect to left/right edges only. */
.hero__droplets {
  position: absolute;
  inset: -20% 0;
  background: url('imgs/rain_background.jpeg') center center / cover no-repeat;
  will-change: transform;

  /* Slightly brighter + high-contrast to separate from bg layer */
  filter: brightness(0.85) contrast(1.15) saturate(1.1);

  /* MASKING: droplet layer visible only on left/right ~28% of screen.
     Center fades away, keeping the content zone clean. */
  -webkit-mask-image: linear-gradient(to right,
      rgba(0, 0, 0, 0.92) 0%,
      rgba(0, 0, 0, 0.70) 12%,
      rgba(0, 0, 0, 0.00) 28%,
      rgba(0, 0, 0, 0.00) 72%,
      rgba(0, 0, 0, 0.70) 88%,
      rgba(0, 0, 0, 0.92) 100%);
  mask-image: linear-gradient(to right,
      rgba(0, 0, 0, 0.92) 0%,
      rgba(0, 0, 0, 0.70) 12%,
      rgba(0, 0, 0, 0.00) 28%,
      rgba(0, 0, 0, 0.00) 72%,
      rgba(0, 0, 0, 0.70) 88%,
      rgba(0, 0, 0, 0.92) 100%);

  z-index: 1;
  pointer-events: none;
  contain: layout style paint;
  backface-visibility: hidden;
  transition: transform 0.08s linear;
}

/* Glass sheen between bg and droplet layer */
.hero__glass-sheen {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: transparent;
  pointer-events: none;
}

.hero > .section-inner {
  position: relative;
  z-index: 10;
  padding-top: 120px;
  padding-bottom: 96px;
}

/* ---- LAYER 3: CONTENT ---- */
.hero__content {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px 40px 24px;
}

.hero__eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 0.70rem;
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--blue-light);
  margin-bottom: 20px;
  opacity: 0;
  animation: fadeUp 0.9s var(--ease-glass) 0.2s forwards;
}

.hero__title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(3.2rem, 7vw, 6.2rem);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--cream);
  max-width: 720px;
  opacity: 0;
  animation: fadeUp 1s var(--ease-glass) 0.4s forwards;
}

.hero__title em {
  font-style: italic;
  color: var(--blue-light);
}

.hero__subtitle {
  margin-top: 24px;
  font-family: 'Syne', sans-serif;
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  font-weight: 400;
  color: var(--text-secondary);
  max-width: 480px;
  line-height: 1.75;
  opacity: 0;
  animation: fadeUp 1s var(--ease-glass) 0.6s forwards;
}

.hero__cta-group {
  margin-top: 44px;
  display: flex;
  gap: 16px;
  opacity: 0;
  animation: fadeUp 1s var(--ease-glass) 0.8s forwards;
}

.btn-primary {
  font-family: 'Syne', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 14px 36px;
  background: var(--blue-bright);
  color: #fff;
  border: 1px solid var(--blue-bright);
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.3s, box-shadow 0.3s, transform 0.2s;
}

.btn-primary:hover {
  background: var(--blue-light);
  box-shadow: 0 0 28px rgba(78, 179, 232, 0.4);
  transform: translateY(-2px);
}

.btn-ghost {
  font-family: 'Syne', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 14px 36px;
  background: transparent;
  color: var(--cream);
  border: 1px solid var(--glass-border);
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 0.3s, color 0.3s, transform 0.2s;
}

.btn-ghost:hover {
  border-color: var(--blue-light);
  color: var(--blue-light);
  transform: translateY(-2px);
}

/* Scroll cue */
.hero__scroll-cue {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0;
  animation: fadeIn 1s ease 1.4s forwards;
}

.hero__scroll-cue span {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--blue-light), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

/* ============================================================
   SECTION SHARED STYLES
   ============================================================ */
section {
  position: relative;
  z-index: 20;
}

.section-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 32px;
}

.section-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--blue-light);
  margin-bottom: 16px;
}

.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 300;
  line-height: 1.15;
  color: var(--cream);
}

/* ============================================================
   ABOUT / INTRO STRIP
   ============================================================ */
.about-strip {
  background: var(--navy-mid);
  border-top: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
  padding: 80px 0;
  content-visibility: auto;
  contain-intrinsic-size: auto 400px;
}

.about-strip .section-inner {
  display: grid;
  grid-template-columns: 100%;
  gap: 64px;
  align-items: center;
  justify-content: center;
}

@media (min-width: 1025px) {
  .about-strip .section-inner {
    max-width: 100vw;
  }

  .about-strip .section-inner>div {
    width: 75vw;
    margin: 0 auto;
  }
}

.about-strip p {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text-secondary);
}

.about-strip p+p {
  margin-top: 20px;
}

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.stat-card {
  background: var(--cream-dim);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  padding: 24px;
  backdrop-filter: blur(8px);
}

.stat-card__number {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.8rem;
  font-weight: 300;
  color: var(--blue-light);
  line-height: 1;
}

.stat-card__label {
  margin-top: 8px;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* ============================================================
   PROJECTS SECTION
   ============================================================ */
.projects-section {
  padding: 120px 0 80px;
  background: transparent;
  position: relative;
  overflow: hidden;
}

/* ---- PROJECTS BG LAYER ---- */
.projects__bg {
  position: absolute;
  inset: -120px 0;
  background: url('imgs/rain_background.jpeg') center center / cover no-repeat;
  will-change: transform;
  filter: brightness(0.55) saturate(0.75);
  z-index: 0;
  contain: layout style paint;
  backface-visibility: hidden;
  transition: transform 0.08s linear;
}

/* ---- PROJECTS DROPLET LAYER ---- */
.projects__droplets {
  position: absolute;
  inset: -120px 0;
  background: url('imgs/rain_background.jpeg') center center / cover no-repeat;
  will-change: transform;
  filter: brightness(0.85) contrast(1.15) saturate(1.1);
  -webkit-mask-image: linear-gradient(to right,
      rgba(0, 0, 0, 0.92) 0%,
      rgba(0, 0, 0, 0.70) 12%,
      rgba(0, 0, 0, 0.00) 28%,
      rgba(0, 0, 0, 0.00) 72%,
      rgba(0, 0, 0, 0.70) 88%,
      rgba(0, 0, 0, 0.92) 100%);
  mask-image: linear-gradient(to right,
      rgba(0, 0, 0, 0.92) 0%,
      rgba(0, 0, 0, 0.70) 12%,
      rgba(0, 0, 0, 0.00) 28%,
      rgba(0, 0, 0, 0.00) 72%,
      rgba(0, 0, 0, 0.70) 88%,
      rgba(0, 0, 0, 0.92) 100%);
  z-index: 1;
  backface-visibility: hidden;
  transition: transform 0.08s linear;
}

/* Dark navy overlay to keep cards legible against the rain bg */
.projects__overlay {
  position: absolute;
  inset: 0;
  background: transparent;
  z-index: 2;
  pointer-events: none;
}

/* Lift all projects content above the background layers */
.projects-section .section-inner {
  position: relative;
  z-index: 10;
}

.projects-header {
  margin-bottom: 56px;
}

/* Project carousel */
.projects-grid {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 34px 2px 34px;
}

.projects-grid::-webkit-scrollbar {
  display: none;
}

/* Wrapper for the carousel track and edge controls */
.projects-grid-wrapper {
  position: relative;
  width: 125%;
  margin-left: -12.5%;
  margin-top: -86px;
  padding-top: 34px;
  padding-bottom: 34px;
}

.project-carousel-btn {
  position: absolute;
  top: 50%;
  z-index: 12;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  background: rgba(8, 16, 28, 0.72);
  color: var(--cream);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  transform: translateY(-50%);
  transition: border-color 0.25s, color 0.25s, opacity 0.25s, transform 0.25s;
}

.project-carousel-btn span {
  display: block;
  font-family: 'Syne', sans-serif;
  font-size: 2.2rem;
  line-height: 1;
  transform: translateY(-2px);
}

.project-carousel-btn:hover,
.project-carousel-btn:focus-visible {
  border-color: rgba(78, 179, 232, 0.55);
  color: var(--blue-light);
  outline: none;
  transform: translateY(-50%) scale(1.05);
}

.project-carousel-btn:disabled {
  cursor: default;
  opacity: 0.35;
  transform: translateY(-50%);
}

.project-carousel-btn--prev {
  left: clamp(-72px, -6vw, 8px);
}

.project-carousel-btn--next {
  right: clamp(-72px, -6vw, 8px);
}

/* ---- FROSTED GLASS CARD ---- */
.project-card {
  position: relative;
  display: grid;
  flex: 0 0 calc((100% - 48px) / 3);
  min-height: 500px;
  grid-template-rows: auto minmax(190px, 1fr) auto auto auto;
  row-gap: 0;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  padding: 28px;
  backdrop-filter: blur(10px) saturate(130%);
  -webkit-backdrop-filter: blur(10px) saturate(130%);
  box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(78, 179, 232, 0.08);
  transition:
    transform 0.38s var(--ease-glass),
    box-shadow 0.38s var(--ease-glass),
    border-color 0.3s;
  overflow: hidden;
  scroll-snap-align: start;
  contain: layout style paint;
}

/* Inner glass sheen line at top */
.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 12px;
  right: 12px;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(78, 179, 232, 0.35), transparent);
}

.project-card:hover {
  transform: translateY(-6px) scale(1.015);
  border-color: rgba(78, 179, 232, 0.40);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}


.card-number {
  grid-row: 1;
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  color: var(--blue-light);
  opacity: 0.7;
  margin-bottom: 20px;
}

.project-card>img,
.project-card-media {
  grid-row: 2;
  width: min(80%, 220px);
  aspect-ratio: 1 / 1;
  align-self: center;
  justify-self: center;
  margin-bottom: 22px;
}

.project-card-media {
  border: 1px dashed rgba(78, 179, 232, 0.32);
  border-radius: 4px;
  background: transparent;
  overflow: hidden;
}

.project-card>img {
  display: block;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
}

.project-card-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.card-title {
  grid-row: 3;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.45rem;
  font-weight: 400;
  line-height: 1.25;
  color: var(--cream);
  margin-bottom: 12px;
}

.card-desc {
  grid-row: 4;
  font-size: 0.84rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.card-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.tech-tag {
  font-family: 'DM Mono', monospace;
  font-size: 0.63rem;
  letter-spacing: 0.10em;
  padding: 5px 10px;
  border: 1px solid var(--glass-border);
  border-radius: 2px;
  color: var(--blue-light);
  background: rgba(45, 143, 206, 0.07);
}

/* ---- VIEW PROJECT BUTTON ---- */
.btn-view-project {
  grid-row: 5;
  font-family: 'Syne', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  display: block;
  width: 100%;
  text-align: center;
  padding: 11px 28px;
  background: var(--blue-bright);
  color: #fff;
  border: 1px solid var(--blue-bright);
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.3s, box-shadow 0.3s, transform 0.2s;
  align-self: end;
}

.btn-view-project:hover {
  background: var(--blue-light);
  box-shadow: 0 0 24px rgba(78, 179, 232, 0.35);
  transform: translateY(-2px);
}

/* ---- FROSTED FADE OVERLAY ---- */
/* Sits below the Show More button, above the hidden cards */
.projects-fade-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 180px;
  background: linear-gradient(to bottom,
      transparent 0%,
      rgba(15, 31, 53, 0.65) 40%,
      rgba(15, 31, 53, 0.95) 100%);
  pointer-events: none;
  transition: opacity 0.55s var(--ease-glass);
  border-radius: 0 0 6px 6px;
}

.projects-fade-overlay.hidden {
  opacity: 0;
}

/* ---- SHOW MORE BUTTON ---- */
.show-more-wrap {
  text-align: center;
  margin-top: 40px;
}

.btn-show-more {
  position: relative;
  font-family: 'Syne', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: transparent;
  color: var(--cream);
  border: 1px solid var(--glass-border);
  border-radius: 2px;
  padding: 14px 40px;
  cursor: pointer;
  transition: border-color 0.3s, color 0.3s, transform 0.25s;
  backdrop-filter: blur(8px);
}

.btn-show-more:hover {
  border-color: var(--blue-light);
  color: var(--blue-light);
  transform: translateY(-2px);
}

.btn-show-more.hidden {
  display: none;
}

/* ============================================================
   GALLERY SECTION
   ============================================================ */
.gallery-section {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.gallery__bg {
  position: absolute;
  inset: -20% 0;
  background: url('imgs/rain_background.jpeg') center center / cover no-repeat;
  will-change: transform;
  filter: none;
  z-index: 0;
  pointer-events: none;
  contain: layout style paint;
  backface-visibility: hidden;
  transition: transform 0.08s linear;
}

.gallery__droplets {
  position: absolute;
  inset: -20% 0;
  background: url('imgs/rain_background.jpeg') center center / cover no-repeat;
  will-change: transform;
  filter: brightness(0.85) contrast(1.15) saturate(1.1);
  -webkit-mask-image: linear-gradient(to right,
      rgba(0, 0, 0, 0.92) 0%,
      rgba(0, 0, 0, 0.70) 12%,
      rgba(0, 0, 0, 0.00) 28%,
      rgba(0, 0, 0, 0.00) 72%,
      rgba(0, 0, 0, 0.70) 88%,
      rgba(0, 0, 0, 0.92) 100%);
  mask-image: linear-gradient(to right,
      rgba(0, 0, 0, 0.92) 0%,
      rgba(0, 0, 0, 0.70) 12%,
      rgba(0, 0, 0, 0.00) 28%,
      rgba(0, 0, 0, 0.00) 72%,
      rgba(0, 0, 0, 0.70) 88%,
      rgba(0, 0, 0, 0.92) 100%);
  z-index: 1;
  pointer-events: none;
  contain: layout style paint;
  backface-visibility: hidden;
  transition: transform 0.08s linear;
}

.gallery__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: transparent;
  pointer-events: none;
}

.gallery-section > .section-inner {
  position: relative;
  z-index: 10;
  padding-top: 120px;
  padding-bottom: 80px;
}

.gallery-header {
  margin-bottom: 56px;
}

/* Gallery carousel */
.gallery-carousel-wrapper {
  position: relative;
}

.gallery-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 16px 2px 24px;
  width: 100%;
}

.gallery-track::-webkit-scrollbar {
  display: none;
}

.gallery-item {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.38s var(--ease-glass), box-shadow 0.38s var(--ease-glass);
  cursor: pointer;
  flex: 0 0 calc((100% - 40px) / 3);
  min-width: 0;
  scroll-snap-align: start;
}

.gallery-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.gallery-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.gallery-item:hover .gallery-image::after {
  opacity: 1;
}

.gallery-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.3s var(--ease-glass);
}

.gallery-item-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--cream);
  margin-top: 16px;
  margin-bottom: 8px;
}

.gallery-item-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  background: var(--navy-mid);
  border-top: 1px solid var(--glass-border);
  padding: 64px 0 48px;
  position: relative;
  z-index: 20;
  content-visibility: auto;
  contain-intrinsic-size: auto 400px;
}

.footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}

.footer-contact-panel {
  display: contents;
}

.footer-contact-intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.footer-kicker {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--blue-light);
  margin-bottom: 16px;
}

.footer-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.1rem, 4vw, 3.4rem);
  font-weight: 300;
  line-height: 1;
  color: var(--cream);
  margin-bottom: 28px;
}

.footer-contact-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-contact-item {
  display: grid;
  grid-template-columns: 32px auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  text-decoration: none;
  transition: border-color 0.25s, background 0.25s, transform 0.25s;
}

.footer-contact-item:hover {
  border-color: var(--blue-light);
  background: rgba(78, 179, 232, 0.08);
  transform: translateY(-2px);
}

.footer-contact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--blue-light);
}

.footer-contact-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue-light);
}

.footer-contact-value {
  font-size: 0.96rem;
  color: var(--text-primary);
  text-align: right;
  word-break: break-word;
}

.footer-bottom {
  max-width: var(--content-max);
  margin: 48px auto 0;
  padding: 24px 32px 0;
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-bottom p {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  opacity: 0.55;
}

/* ============================================================
   LIGHT MODE — cream background, navy lettering
   ============================================================ */

/* Override CSS custom properties */
body.light-mode {
  --text-primary: #0f1f35;
  --text-secondary: rgba(15, 31, 53, 0.60);
  --text-accent: #1a5a8a;
  --glass-bg: rgba(216, 208, 190, 0.60);
  --glass-border: rgba(15, 31, 53, 0.18);
  --glass-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
  --cream-dim: rgba(15, 31, 53, 0.06);
  background: #e8e0d0;
  color: #0f1f35;
  transition: background 0.4s ease, color 0.4s ease;
}

/* Navbar */
body.light-mode .navbar.scrolled {
  background: rgba(232, 224, 208, 0.85);
  border-bottom-color: rgba(15, 31, 53, 0.15);
}

body.light-mode .nav-links a {
  color: rgba(15, 31, 53, 0.60);
}

body.light-mode .nav-links a:hover {
  color: #0f1f35;
}

body.light-mode .nav-links a::before,
body.light-mode .nav-links a::after {
  border-color: #1a5a8a;
}

/* Hero layers — brighter in light mode */
body.light-mode .hero__bg {
  filter: brightness(0.80) saturate(0.85);
}

body.light-mode .hero__droplets {
  filter: brightness(1.05) contrast(1.1) saturate(1.05);
}

body.light-mode .hero__glass-sheen {
  background:
    radial-gradient(ellipse 80% 80% at 50% 50%,
      transparent 50%,
      rgba(232, 224, 208, 0.45) 100%),
    linear-gradient(to right,
      rgba(232, 224, 208, 0.25) 0%,
      rgba(232, 224, 208, 0.00) 22%,
      rgba(232, 224, 208, 0.00) 78%,
      rgba(232, 224, 208, 0.25) 100%);
}

/* Hero text stays cream so it reads against the image */
body.light-mode .hero__title {
  color: #e8e0d0;
}

body.light-mode .hero__eyebrow {
  color: #a8d8f0;
}

body.light-mode .hero__subtitle {
  color: rgba(232, 224, 208, 0.80);
}

body.light-mode .scroll-line {
  background: linear-gradient(to bottom, #a8d8f0, transparent);
}

body.light-mode .hero__scroll-cue span {
  color: rgba(232, 224, 208, 0.70);
}

/* About strip */
body.light-mode .about-strip {
  background: #d8d0c0;
  border-color: rgba(15, 31, 53, 0.15);
}

body.light-mode .about-strip p {
  color: rgba(15, 31, 53, 0.65);
}

body.light-mode .stat-card {
  background: rgba(15, 31, 53, 0.06);
  border-color: rgba(15, 31, 53, 0.14);
}

body.light-mode .stat-card__number {
  color: #1a5a8a;
}

body.light-mode .stat-card__label {
  color: rgba(15, 31, 53, 0.55);
}

/* Section labels and titles */
body.light-mode .section-label {
  color: #1a5a8a;
}

body.light-mode .section-title {
  color: #0f1f35;
}

/* Projects section overlay — lighter in light mode */
body.light-mode .projects__overlay {
  background: rgba(220, 213, 198, 0.60);
}

body.light-mode .projects__bg {
  filter: brightness(0.80) saturate(0.85);
}

body.light-mode .projects__droplets {
  filter: brightness(1.05) contrast(1.1) saturate(1.05);
}

/* Project cards */
body.light-mode .project-card {
  background: rgba(232, 224, 208, 0.70);
  border-color: rgba(15, 31, 53, 0.15);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

body.light-mode .project-card::before {
  background: linear-gradient(to right, transparent, rgba(15, 31, 53, 0.15), transparent);
}

body.light-mode .project-card:hover {
  border-color: rgba(26, 90, 138, 0.45);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.14), 0 0 24px rgba(26, 90, 138, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

body.light-mode .project-carousel-btn {
  background: rgba(232, 224, 208, 0.78);
  color: #0f1f35;
}

body.light-mode .card-number {
  color: #1a5a8a;
}

body.light-mode .project-card-media {
  border-color: rgba(26, 90, 138, 0.28);
}

body.light-mode .card-title {
  color: #0f1f35;
}

body.light-mode .card-desc {
  color: rgba(15, 31, 53, 0.62);
}

body.light-mode .tech-tag {
  color: #1a5a8a;
  border-color: rgba(15, 31, 53, 0.15);
  background: rgba(26, 90, 138, 0.07);
}

body.light-mode .projects-fade-overlay {
  background: linear-gradient(to bottom,
      transparent 0%,
      rgba(220, 213, 198, 0.65) 40%,
      rgba(220, 213, 198, 0.95) 100%);
}

/* Buttons */
body.light-mode .btn-ghost {
  color: #0f1f35;
  border-color: rgba(15, 31, 53, 0.25);
}

body.light-mode .btn-ghost:hover {
  border-color: #1a5a8a;
  color: #1a5a8a;
}

body.light-mode .btn-show-more {
  color: #0f1f35;
  border-color: rgba(15, 31, 53, 0.25);
}

body.light-mode .btn-show-more:hover {
  border-color: #1a5a8a;
  color: #1a5a8a;
}

/* Control buttons */
body.light-mode .ctrl-btn {
  background: rgba(232, 224, 208, 0.88);
  color: #0f1f35;
  border-color: rgba(15, 31, 53, 0.20);
}

body.light-mode .ctrl-btn:hover {
  border-color: #1a5a8a;
  color: #1a5a8a;
}

body.light-mode .ctrl-btn.active {
  border-color: #1a5a8a;
  color: #1a5a8a;
  background: rgba(26, 90, 138, 0.10);
}

/* Gallery section */
body.light-mode .gallery__overlay {
  background:
    radial-gradient(ellipse 80% 80% at 50% 50%,
      transparent 50%,
      rgba(232, 224, 208, 0.45) 100%),
    linear-gradient(to right,
      rgba(232, 224, 208, 0.25) 0%,
      rgba(232, 224, 208, 0.00) 22%,
      rgba(232, 224, 208, 0.00) 78%,
      rgba(232, 224, 208, 0.25) 100%);
}

body.light-mode .gallery__bg {
  filter: brightness(0.80) saturate(0.85);
}

body.light-mode .gallery__droplets {
  filter: brightness(1.05) contrast(1.1) saturate(1.05);
}

body.light-mode .gallery-section .section-label {
  color: #1a5a8a;
}

body.light-mode .gallery-section .section-title {
  color: #0f1f35;
}

body.light-mode .gallery-item-title {
  color: #0f1f35;
}

body.light-mode .gallery-item-desc {
  color: rgba(15, 31, 53, 0.62);
}

/* Footer */
body.light-mode footer {
  background: linear-gradient(180deg, #f1ead6 0%, #e8dfcc 100%);
  border-top: 1px solid rgba(15, 31, 53, 0.12);
}

body.light-mode .footer-kicker {
  color: #1a5a8a;
}

body.light-mode .footer-title {
  color: #0f1f35;
}

body.light-mode .footer-contact-item {
  background: rgba(255, 255, 255, 0.65);
  border-color: rgba(15, 31, 53, 0.12);
  color: #0f1f35;
}

body.light-mode .footer-contact-item:hover {
  background: rgba(45, 143, 206, 0.10);
  border-color: #2d8fce;
}

body.light-mode .footer-contact-icon {
  color: #1a5a8a;
}

body.light-mode .footer-contact-label {
  color: #1a5a8a;
}

body.light-mode .footer-contact-value {
  color: #0f1f35;
}

body.light-mode .footer-bubble-mobile {
  background: rgba(255, 255, 255, 0.96);
  color: #0f1f35;
  box-shadow: 0 18px 40px rgba(15, 31, 53, 0.12);
}

body.light-mode .footer-bubble-mobile::after {
  border-color: transparent transparent rgba(255, 255, 255, 0.96) transparent;
}

body.light-mode .footer-bottom {
  border-top-color: rgba(15, 31, 53, 0.12);
}

body.light-mode .footer-bottom p {
  color: rgba(15, 31, 53, 0.45);
}

body.light-mode .nav-logo img {
  filter: drop-shadow(0 0 8px rgba(26, 90, 138, 0.35));
}

/* ============================================================
   KEYFRAME ANIMATIONS
   ============================================================ */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(22px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes scrollPulse {

  0%,
  100% {
    opacity: 0.3;
    transform: scaleY(1);
  }

  50% {
    opacity: 1;
    transform: scaleY(1.15);
  }
}


@keyframes footerBubbleReveal {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes blinkCursor {

  0%,
  49% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }
}


/* ============================================================
   REDUCED MOTION — disable parallax & animations for a11y
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .hero__bg,
  .hero__droplets,
  .gallery__bg,
  .gallery__droplets,
  .projects__bg,
  .projects__droplets {
    will-change: auto;
    transform: none !important;
  }
}


/* ============================================================
   RESPONSIVE
   ============================================================ */
/* ============================================================
   RESPONSIVE
   ============================================================ */

/* --- LARGE DESKTOPS (Ultra-wide screens) --- */
@media (min-width: 1600px) {
  :root {
    --content-max: 1200px;
  }

  .hero__title {
    font-size: clamp(4rem, 8vw, 7.5rem);
  }
}

/* --- LAPTOPS & STANDARD DESKTOPS --- */
/* Default styles cover 1025px - 1440px range */

/* --- IPADS & TABLETS (Large) --- */
@media (max-width: 1024px) {
  .section-inner {
    padding: 0 48px;
  }

  .hero__content {
    padding-bottom: 120px;
  }

  .projects-grid {
    gap: 20px;
  }

  .project-card {
    flex-basis: calc((100% - 20px) / 2);
  }

  .project-carousel-btn--prev {
    left: -24px;
  }

  .project-carousel-btn--next {
    right: -24px;
  }

  .gallery-item {
    flex: 0 0 calc((100% - 40px) / 3);
  }
}

/* --- SMALL TABLETS & PORTRAIT IPADS --- */
@media (max-width: 900px) {
  .navbar {
    padding: 18px 24px;
  }

  .nav-links {
    gap: 20px;
  }

  .about-strip .section-inner {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .gallery-item {
    flex: 0 0 calc((100% - 20px) / 2);
  }
}

/* --- MOBILE LANDSCAPE & SMALL TABLETS --- */
@media (max-width: 768px) {

  /* Prevent 100vw children from creating a horizontal scrollbar when a scrollbar gutter exists */
  body {
    overflow-x: clip;
  }

  /* Hide desktop nav links on mobile */
  .nav-links {
    display: none;
  }

  .section-inner {
    padding: 0 32px;
  }

  .hero__title {
    font-size: clamp(2.5rem, 8vw, 3.8rem);
  }

  .hero__subtitle {
    font-size: 0.9rem;
    max-width: 400px;
  }

  .about-stats {
    gap: 20px;
  }



  .footer-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-bubble-mobile {
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    width: min(280px, calc(100vw - 64px));
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    color: #12243b;
    box-shadow: 0 18px 40px rgba(7, 14, 24, 0.28);
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px) scale(0.96);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 3;
  }

  .footer-bubble-mobile::after {
    content: '';
    position: absolute;
    top: -10px;
    left: 18px;
    border-width: 0 10px 10px 10px;
    border-style: solid;
    border-color: transparent transparent rgba(255, 255, 255, 0.96) transparent;
  }

  .footer-bubble-mobile.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    animation: footerBubbleReveal 0.38s var(--ease-glass);
  }

  .footer-bubble-mobile-text {
    min-height: 5.3em;
    font-size: 0.84rem;
    line-height: 1.6;
    color: inherit;
  }

  .footer-bubble-mobile-text::after {
    content: '|';
    margin-left: 2px;
    opacity: 0;
  }

  .footer-bubble-mobile.is-typing .footer-bubble-mobile-text::after {
    opacity: 1;
    animation: blinkCursor 0.8s step-end infinite;
  }

  .gallery-carousel-wrapper {
    overflow: hidden;
  }

  .gallery-item {
    flex: 0 0 85%;
    max-width: 85%;
    scroll-snap-align: center;
  }

  .hero > .section-inner {
    padding-top: 16px;
    padding-bottom: 80px;
  }

  /* Projects: full-viewport single-card carousel */
  .projects-grid-wrapper {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    margin-left: 0;
    margin-top: 0;
    padding-top: 80px;
    padding-bottom: 32px;
  }

  .projects-grid {
    gap: 16px;
    margin: 0;
    padding: 16px 24px;
    scroll-padding-inline: 24px;
  }

  /* One card per view — full viewport height, centered in screen */
  .project-card {
    flex-basis: calc(100vw - 48px);
    scroll-snap-align: start;
    min-height: calc(100vh - 250px);
    min-height: calc(100dvh - 250px);
    /* Arrows live in the side gutters, not over the card */
    padding-left: 24px;
    padding-right: 24px;
    align-content: center;
  }

  /* Smaller image so card fits on screen */
  .project-card > img,
  .project-card-media {
    width: min(80%, 220px);
    margin-bottom: 14px;
  }

  /* Prominent arrow buttons overlaid at card edges */
  .project-carousel-btn {
    width: 48px;
    height: 48px;
    border-color: rgba(78, 179, 232, 0.55);
    background: rgba(8, 16, 28, 0.80);
  }

  .project-carousel-btn span {
    font-size: 2.2rem;
  }

  .project-carousel-btn--prev {
    left: 2px;
  }

  .project-carousel-btn--next {
    right: 2px;
  }

}

/* --- MOBILE PORTRAIT (Phones) --- */
@media (max-width: 600px) {

  .footer-inner {
    gap: 96px 20px;
  }

  .footer-brand {
    flex: 1 1 100%;
  }

  .hero__title {
    font-size: clamp(2rem, 8vw, 2.4rem);
    line-height: 1.1;
  }

  .hero__content {
    padding-top: 80px;
  }

  .hero__cta-group {
    flex-direction: column;
    width: 100%;
    max-width: 280px;
    gap: 12px;
  }

  .btn-primary,
  .btn-ghost {
    width: 100%;
    text-align: center;
    padding: 16px 24px;
  }

  .stat-card {
    padding: 20px;
  }

  .stat-card__number {
    font-size: 2.2rem;
  }
}

/* --- SMALL MOBILE (iPhone SE, etc.) --- */
@media (max-width: 480px) {
  .footer-inner {
    gap: 104px 18px;
  }

  .footer-bubble-mobile {
    width: min(250px, calc(100vw - 48px));
  }

  .section-title {
    font-size: 2rem;
  }

  .project-card {
    padding: 20px 24px;
  }

  .card-title {
    font-size: 1.3rem;
  }

  .section-label {
    font-size: 0.62rem;
  }
}

@media (max-width: 360px) {
  .project-card {
    padding-left: 44px;
    padding-right: 44px;
  }

  .project-carousel-btn {
    width: 40px;
    height: 40px;
  }

  .project-carousel-btn span {
    font-size: 1.8rem;
  }
}
