/* =====================================================================
   The AlloSphere Research Facility - LIGHT theme (allosphere6)
   Concept A: cinematic full-bleed hero CAROUSEL over a clean white site,
   with a contained gallery carousel for featured projects.
   Built on Bootstrap 5.3. Colors tuned for WCAG AA contrast on white.
   ===================================================================== */

:root {
  --bg:        #ffffff;
  --bg-2:      #f4f7fb;   /* alternating section background */
  --bg-3:      #e9eef7;   /* media / placeholder background */
  --surface:   #ffffff;
  --surface-2: #f4f7fb;
  --border:    rgba(15, 27, 45, 0.12);
  --border-2:  rgba(15, 27, 45, 0.22);

  --text:      #0f1b2d;   /* near-navy body text (~15:1 on white) */
  --muted:     #33414f;   /* secondary text (AA) */
  --muted-2:   #4c5a6e;   /* tertiary text (AA) */

  /* Accents. Light blue is decorative / for dark backgrounds; text & links on
     white use the darker blues so they meet contrast requirements. */
  --blue-light:  #38bdf8;
  --blue-dark:   #2563eb;
  --blue-strong: #1d4ed8;
  --navy:        #0b2545;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow:    0 18px 50px rgba(15, 27, 45, 0.12);
  --shadow-sm: 0 6px 22px rgba(15, 27, 45, 0.08);
  --maxw: 1200px;

  /* White masthead heights: tall at rest (shows the full stacked lockup),
     compact once scrolled (shows the small horizontal lockup). --header-h is
     the value in-page anchors offset against = the compact/pinned height. */
  --header-rest: 120px;
  --header-compact: 52px;
  --header-h: var(--header-compact);
}

@media (max-width: 991.98px) {
  :root { --header-rest: 140px; }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .navbar-brand {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

a { color: var(--blue-dark); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--blue-strong); }

.text-grad { color: var(--blue-dark); -webkit-text-fill-color: var(--blue-dark); }

/* Visible focus indicator for keyboard users (accessibility) */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.nav-link:focus-visible,
.carousel-control-prev:focus-visible,
.carousel-control-next:focus-visible,
.carousel-indicators [data-bs-target]:focus-visible,
.carousel-toggle:focus-visible {
  outline: 3px solid var(--blue-strong);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip-link {
  position: absolute; top: 8px; left: 8px; z-index: 2000;
  background: var(--blue-dark); color: #ffffff; padding: .55rem 1rem; border-radius: 8px; font-weight: 600;
}

/* ===== Header / Nav: white masthead that shrinks to a compact bar on scroll ===== */
.site-header {
  position: sticky; top: 0; z-index: 1030;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  transition: box-shadow .3s ease, border-color .3s ease;
}
.site-header.scrolled { box-shadow: var(--shadow-sm); }

.site-header .navbar { padding: .65rem 0; transition: padding .25s ease; }
.site-header.scrolled .navbar { padding: .4rem 0; }

/* Brand: full stacked lockup at rest -> compact horizontal mark once scrolled.
   The accessible home name is the visually-hidden span; both images are
   decorative (alt="") so the logo isn't announced twice across the swap. */
.navbar-brand { display: inline-flex; align-items: center; line-height: 0; }
.brand-full { display: block; width: auto; height: clamp(60px, 9vw, 92px); }
.brand-compact { display: none; width: auto; height: 36px; }
.site-header.scrolled .brand-full { display: none; }
.site-header.scrolled .brand-compact { display: block; }

/* Nav links are dark-on-white in every state (the header is always white now) */
.site-header .nav-link {
  color: var(--text); font-weight: 600; padding: .4rem .9rem; position: relative;
}
.site-header .nav-link:hover,
.site-header .nav-link.active { color: var(--blue-dark); }
.site-header .nav-link:hover::after,
.site-header .nav-link.active::after {
  content: ""; position: absolute; left: .9rem; right: .9rem; bottom: .05rem; height: 2px;
  background: var(--blue-dark); border-radius: 2px;
}

.navbar-toggler {
  border: 1px solid var(--border-2); color: var(--text); font-size: 1.4rem; padding: .25rem .55rem;
}
.navbar-toggler:focus { box-shadow: none; }

/* Masthead site nav: ☰ Site toggle (all breakpoints) */
.site-nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-left: auto;
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: .95rem;
  font-weight: 600;
  padding: .45rem .85rem;
  border-radius: 6px;
  line-height: 1;
}
.site-nav-toggle-icon {
  font-size: 1.15rem;
  line-height: 1;
}

/* Site menu panel — card dropdown on desktop, inline collapse on mobile */
@media (min-width: 992px) {
  .site-header .container-fluid.container-xl { position: relative; }
  .site-header .site-nav-menu {
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    z-index: 1040;
    min-width: 13rem;
    margin-top: .35rem;
    padding: .5rem .35rem;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
  }
  .site-header .site-nav-menu .navbar-nav {
    align-items: stretch !important;
  }
  .site-header .site-nav-menu .nav-link {
    border-radius: 6px;
    padding: .45rem .85rem;
  }
  .site-header .site-nav-menu .nav-link:hover::after,
  .site-header .site-nav-menu .nav-link.active::after { display: none; }
}

@media (max-width: 991.98px) {
  /* Open mobile panel is always a light card, so links must read dark */
  .site-header .site-nav-menu,
  .navbar-collapse {
    background: #ffffff; margin-top: .75rem; padding: 1rem;
    border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow);
  }
  .site-header .nav-link { color: var(--text); text-shadow: none; }
  .site-header .nav-link:hover,
  .site-header .nav-link.active { color: var(--blue-dark); }
  .site-header .nav-link:hover::after,
  .site-header .nav-link.active::after { display: none; }
}

/* Desktop: give the masthead an explicit height so the collapse can ANIMATE
   (height can't transition from an intrinsic/auto value). The navbar fills the
   header and vertically centers the logo/nav, so the swap stays centered while
   the height eases. On mobile we keep the intrinsic height so the expanding
   site menu isn't clipped by a fixed height. */
@media (min-width: 992px) {
  .site-header {
    height: var(--header-rest);
    transition: height .25s ease, box-shadow .3s ease, border-color .3s ease;
  }
  .site-header.scrolled { height: var(--header-compact); }
  .site-header .navbar,
  .site-header.scrolled .navbar { height: 100%; padding-top: 0; padding-bottom: 0; }
}

/* ===== Cinematic hero carousel ===== */
.hero { position: relative; }
.hero-carousel,
.hero-carousel .carousel-inner,
.hero-carousel .carousel-item {
  height: calc(100vh - var(--header-rest));
  height: calc(100svh - var(--header-rest)); /* fill the viewport minus the masthead, address-bar aware */
  min-height: 560px;
}
.hero-carousel .carousel-item img,
.hero-carousel .carousel-item video {
  width: 100%; height: 100%; object-fit: cover; object-position: center;
  display: block; background: #05060a;
}
/* Slow "Ken Burns" drift on whichever slide is showing. Start at scale(1) so the
   image doesn't snap/jump the instant it becomes active, then drift gently. */
.hero-carousel .carousel-item img { transform-origin: center; will-change: transform; }
.hero-carousel .carousel-item.active img { animation: kenburns 14s ease-out both; }
@keyframes kenburns {
  from { transform: scale(1); }
  to   { transform: scale(1.12); }
}

/* Legibility scrim so white hero text + nav stay AA over any slide */
.hero-scrim {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg,
    rgba(4, 12, 28, 0.62) 0%,
    rgba(4, 12, 28, 0.28) 28%,
    rgba(4, 12, 28, 0.40) 70%,
    rgba(4, 12, 28, 0.72) 100%);
}

.hero-content {
  position: absolute; inset: 0; z-index: 3;
  display: flex; align-items: flex-end;   /* anchor copy to the lower-left of the photo */
  padding-top: clamp(1.5rem, 5vh, 3rem); padding-bottom: clamp(4.5rem, 12vh, 8rem);
  pointer-events: none;            /* let carousel controls stay clickable */
}
.hero-content .container { max-width: 980px; }
.hero-content a, .hero-content .btn { pointer-events: auto; }

/* Per-slide caption: lower-left, on the bottom control row (left of the centred
   indicators), white, no shadow. The text crossfades as slides change. */
.hero-caption {
  position: absolute; left: 0; right: 0; bottom: 1rem; z-index: 5;
  pointer-events: none;
}
.hero-caption .container { max-width: 980px; }
.hero-caption-text {
  margin: 0; max-width: min(58%, 26rem);
  color: #ffffff; font-size: .85rem; font-weight: 500; letter-spacing: .04em;
  opacity: 0; transition: opacity .85s ease;
}
.hero-caption-text.is-visible { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .hero-caption-text { transition: none; } }

/* Terminal-style tagline that types out once on first load.
   Pinned near the top of the hero, a masthead-height gap below the masthead
   (so the top gap mirrors the masthead height), left-aligned with the title. */
.hero-terminal-wrap {
  position: absolute; left: 0; right: 0; top: var(--header-rest); z-index: 3;
  pointer-events: none;
}
.hero-terminal-wrap .container { max-width: 980px; }

/* Hidden until JS activates it (so it appears AFTER the title settles). */
.hero-terminal {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  font-size: clamp(.82rem, 1.5vw, 1.05rem); font-weight: 600; letter-spacing: .06em;
  color: #ffffff; text-shadow: 0 1px 12px rgba(0, 0, 0, 0.45);
  min-height: 1.5em; margin: 0 0 1.1rem;
  opacity: 0; transition: opacity .6s ease;
}
.hero-terminal.is-active { opacity: 1; }
/* blinking white block caret, shown while the line is active */
.hero-terminal.is-active::after {
  content: "\258B"; margin-left: .1em; color: #ffffff;
  animation: caretBlink 1.06s steps(1) infinite;
}
.hero-terminal.is-done { opacity: 0; }   /* fade the line away before the video plays */
@keyframes caretBlink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .hero-terminal { transition: none; }
  .hero-terminal.is-active::after { content: none; }  /* no caret, no blink */
}

.hero-eyebrow {
  text-transform: uppercase; letter-spacing: .2em; font-size: .8rem; font-weight: 600;
  color: rgba(255, 255, 255, 0.88); margin-bottom: 1.1rem;
}
.hero-title {
  font-size: clamp(2.6rem, 7vw, 5.2rem); line-height: 1.02; font-weight: 700;
  margin: 0 0 1.3rem; letter-spacing: -0.02em; color: #ffffff;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}
.hero-content .text-grad { color: var(--blue-light); -webkit-text-fill-color: var(--blue-light); }
.hero-lead {
  font-size: clamp(1.05rem, 2vw, 1.3rem); color: rgba(255, 255, 255, 0.92);
  max-width: 620px; margin-bottom: 2rem; text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
/* Tertiary "Plan a visit" accent: a light text link beside the hero buttons */
.hero-content .hero-link {
  color: #ffffff; font-weight: 600; padding: .35rem .25rem;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}
.hero-content .hero-link:hover { color: var(--blue-light); }
/* On the dark hero, the secondary button is a glass outline rather than white */
.hero-content .btn-outline-light {
  background: rgba(255, 255, 255, 0.08); color: #ffffff; border: 1px solid rgba(255, 255, 255, 0.7);
}
.hero-content .btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.18); color: #ffffff; border-color: #ffffff;
}

/* Scroll cue */
.scroll-cue {
  position: absolute; bottom: 64px; left: 50%; transform: translateX(-50%); z-index: 4;
  width: 26px; height: 42px; border: 2px solid rgba(255, 255, 255, 0.7); border-radius: 14px;
  display: flex; justify-content: center;
}
.scroll-cue span {
  width: 4px; height: 8px; background: #ffffff; border-radius: 2px; margin-top: 7px;
  animation: scrollPulse 1.8s ease-in-out infinite;
}
@keyframes scrollPulse { 0%,100% { opacity: 0; transform: translateY(0); } 50% { opacity: 1; transform: translateY(8px); } }

/* ===== Carousel chrome (shared) ===== */
.carousel-indicators { margin-bottom: .9rem; }
.carousel-control-prev, .carousel-control-next { width: 8%; }

/* Hero prev/next: sit below the right-side section rail (wide screens) */
.hero-carousel .carousel-control-prev,
.hero-carousel .carousel-control-next { opacity: 1; z-index: 5; }
@media (min-width: 1200px) {
  .hero-carousel .carousel-control-prev,
  .hero-carousel .carousel-control-next {
    top: calc(50% + 6.25rem);
    bottom: auto;
    height: 3.5rem;
    align-items: flex-start;
  }
}
.hero-carousel .carousel-control-prev-icon,
.hero-carousel .carousel-control-next-icon {
  width: 56px; height: 56px; background-size: 42% 42%;
  border-radius: 50%; background-color: rgba(7, 22, 45, 0.55);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  transition: background-color .2s ease, transform .2s ease;
}
.hero-carousel .carousel-control-prev:hover .carousel-control-prev-icon,
.hero-carousel .carousel-control-next:hover .carousel-control-next-icon,
.hero-carousel .carousel-control-prev:focus-visible .carousel-control-prev-icon,
.hero-carousel .carousel-control-next:focus-visible .carousel-control-next-icon {
  background-color: rgba(37, 99, 235, 0.9); transform: scale(1.06);
}
@media (prefers-reduced-motion: reduce) {
  .hero-carousel .carousel-control-prev-icon,
  .hero-carousel .carousel-control-next-icon { transition: none; }
  .hero-carousel .carousel-control-prev:hover .carousel-control-prev-icon,
  .hero-carousel .carousel-control-next:hover .carousel-control-next-icon { transform: none; }
}

/* Pause / play control (WCAG 2.2.2 - users can stop moving content) */
.carousel-toggle {
  position: absolute; right: 16px; bottom: 14px; z-index: 5;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.7); background: rgba(7, 22, 45, 0.55);
  color: #fff; font-size: 1.05rem; display: grid; place-items: center; cursor: pointer;
  transition: background .2s ease;
}
.carousel-toggle:hover { background: rgba(7, 22, 45, 0.82); }

/* ===== Gallery carousel (Projects) ===== */
.gallery-carousel { max-width: 980px; margin: 0 auto; position: relative; }
.gallery-frame {
  position: relative; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.gallery-carousel .carousel-item img {
  display: block; width: 100%; height: clamp(280px, 50vw, 540px);
  object-fit: cover; object-position: center; background: var(--bg-3);
}
.gallery-cap {
  position: absolute; inset: auto 0 0 0; z-index: 2; padding: 1.6rem 1.6rem 1.5rem;
  background: linear-gradient(180deg, transparent, rgba(7, 17, 32, 0.92));
}
.gallery-cap h3 { color: #ffffff; font-size: clamp(1.1rem, 2.4vw, 1.5rem); margin: .5rem 0 .35rem; }
.gallery-cap p { color: rgba(255, 255, 255, 0.88); margin: 0; max-width: 640px; }
.gallery-tag {
  display: inline-block; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  font-weight: 700; color: #ffffff; background: var(--blue-dark); padding: .2rem .6rem; border-radius: 999px;
}
/* Round arrow buttons centred on the framed image */
.gallery-carousel .carousel-control-prev,
.gallery-carousel .carousel-control-next {
  width: 48px; height: 48px; top: 50%; bottom: auto; transform: translateY(-50%); opacity: 1;
  background: rgba(11, 37, 69, 0.62); border: 1px solid rgba(255, 255, 255, 0.55); border-radius: 50%;
  transition: background .2s ease;
}
.gallery-carousel .carousel-control-prev { left: 14px; }
.gallery-carousel .carousel-control-next { right: 14px; }
.gallery-carousel .carousel-control-prev:hover,
.gallery-carousel .carousel-control-next:hover { background: rgba(11, 37, 69, 0.9); }
.gallery-carousel .carousel-control-prev-icon,
.gallery-carousel .carousel-control-next-icon { width: 1.4rem; height: 1.4rem; }
/* Dark indicators sit below the frame on the light background */
.gallery-carousel .carousel-indicators { position: static; margin: 1.25rem 0 0; }
.gallery-carousel .carousel-indicators [data-bs-target] {
  width: 10px; height: 10px; border-radius: 50%; background: var(--blue-dark);
  border: 0; opacity: .35;
}
.gallery-carousel .carousel-indicators .active { opacity: 1; }

/* ===== Layout helpers ===== */
.section { padding: clamp(3.5rem, 8vw, 7rem) 0; position: relative; }
/* In-page anchors land flush under the fixed header. We tuck the target a few px
   behind the bar (subtracting from the header height) so no sliver of the previous
   section shows in the gap. The hidden few px are just empty section padding. */
.section, #contact-info { scroll-margin-top: var(--header-h); }
.section-alt { background: var(--bg-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section-head { margin-bottom: clamp(2rem, 4vw, 3.5rem); }
.section-eyebrow {
  text-transform: uppercase; letter-spacing: .22em; font-size: .78rem; font-weight: 700;
  color: var(--blue-dark); margin-bottom: .9rem;
}
.section-title { font-size: clamp(1.8rem, 4vw, 2.85rem); line-height: 1.1; margin-bottom: 1rem; }
.lead-muted { color: var(--muted); font-size: 1.12rem; }
.text-muted-2 { color: var(--muted-2); }

.eyebrow {
  text-transform: uppercase; letter-spacing: .2em; font-size: .8rem;
  color: var(--muted-2); margin-bottom: 1.2rem;
}

/* ===== Buttons ===== */
.btn { font-weight: 600; border-radius: 999px; padding: .7rem 1.5rem; transition: all .25s ease; }
.btn-lg { padding: .85rem 1.9rem; }
.btn-glow {
  background: var(--blue-dark); color: #ffffff; border: none;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.32);
}
.btn-glow:hover { background: var(--blue-strong); color: #ffffff; transform: translateY(-2px); box-shadow: 0 12px 30px rgba(37, 99, 235, 0.42); }
/* Flat variant: dark-blue button with white text, but no glow shadow */
.btn-glow.btn-flat,
.btn-glow.btn-flat:hover { box-shadow: none; }
/* Extra-small button size (smaller than Bootstrap's btn-sm) */
.btn-xs { padding: .25rem .65rem; font-size: .78rem; border-radius: .3rem; }
/* Blue outline button: brand-blue border + text, fills blue on hover */
.btn-outline-blue { border: 1px solid var(--blue-dark); color: var(--blue-dark); background: transparent; }
.btn-outline-blue:hover { background: var(--blue-dark); color: #ffffff; border-color: var(--blue-dark); }

/* Click-to-play video facade: shows a poster + play badge, loads the embed only on click */
.yt-facade {
  width: 100%; height: 100%; display: block; padding: 0; border: 0; cursor: pointer;
  background-color: #10233b; background-size: cover; background-position: center;
  border-radius: var(--radius-sm); overflow: hidden;
}
.yt-facade::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(15, 27, 45, .35), rgba(15, 27, 45, 0) 60%);
}
.yt-facade-play { position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center; }
.yt-facade-play i {
  display: flex; align-items: center; justify-content: center;
  width: 4.2rem; height: 4.2rem; border-radius: 50%; color: #fff; font-size: 2.2rem;
  background: rgba(15, 27, 45, .55); transition: background .2s ease, transform .2s ease;
}
.yt-facade:hover .yt-facade-play i,
.yt-facade:focus-visible .yt-facade-play i { background: var(--blue-dark); transform: scale(1.06); }
.ratio > video { width: 100%; height: 100%; object-fit: cover; background: #10233b; border-radius: var(--radius-sm); }
.btn-outline-light { border: 1px solid var(--border-2); color: var(--text); background: #ffffff; }
.btn-outline-light:hover { background: var(--surface-2); color: var(--text); border-color: var(--blue-dark); transform: translateY(-2px); }

.link-arrow { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; }
.link-arrow i { transition: transform .25s ease; }
.link-arrow:hover i { transform: translateX(4px); }

/* ===== Media frames ===== */
.media-frame {
  position: relative; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow);
}
.media-frame img { display: block; width: 100%; }
.media-frame.portrait { max-width: 420px; }

/* ===== Stats ===== */
.stat-row { margin-top: 3.5rem; }
.stat {
  text-align: center; padding: 1.6rem 1rem; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm);
}
.stat-num {
  display: block; font-family: "Space Grotesk", sans-serif; font-weight: 700;
  font-size: clamp(2.2rem, 5vw, 3.2rem); line-height: 1; color: var(--blue-dark);
}
.stat-label { display: block; margin-top: .6rem; color: var(--muted-2); font-size: .9rem; letter-spacing: .03em; }

/* ===== Pillars ===== */
.pillar {
  height: 100%; padding: 2rem; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm);
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.pillar:hover { transform: translateY(-6px); border-color: var(--border-2); box-shadow: var(--shadow); }
.pillar-icon {
  width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center;
  font-size: 1.6rem; color: var(--blue-dark); background: rgba(37, 99, 235, 0.10);
  border: 1px solid rgba(37, 99, 235, 0.18); margin-bottom: 1.2rem;
}
.pillar h3 { font-size: 1.3rem; margin-bottom: .6rem; }
.pillar p { color: var(--muted); margin: 0; }

/* ===== Research area cards ===== */
.area-card {
  position: relative; height: 100%; padding: 2.2rem 2rem 2rem;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); box-shadow: var(--shadow-sm);
  overflow: hidden; transition: border-color .3s ease, transform .3s ease, box-shadow .3s ease;
}
.area-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--blue-dark);
  transform: scaleY(0); transform-origin: top; transition: transform .35s ease;
}
.area-card:hover { transform: translateY(-4px); border-color: var(--border-2); box-shadow: var(--shadow); }
.area-card:hover::before { transform: scaleY(1); }
.area-index {
  font-family: "Space Grotesk", sans-serif; font-size: 2.4rem; font-weight: 700;
  color: transparent; -webkit-text-stroke: 1px var(--border-2); display: block; margin-bottom: .8rem;
}
.area-card h3 { font-size: 1.35rem; margin-bottom: .6rem; }
.area-card p { color: var(--muted); margin: 0; }

/* ===== Facility spec list ===== */
.spec-list { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.spec-list li {
  display: flex; align-items: center; gap: .85rem; padding: .65rem 0;
  border-bottom: 1px solid var(--border); color: var(--muted);
}
.spec-list li:last-child { border-bottom: none; }
.spec-list i {
  color: var(--blue-dark); font-size: 1.1rem; width: 28px; height: 28px; display: grid; place-items: center;
  background: rgba(37, 99, 235, 0.08); border: 1px solid var(--border); border-radius: 8px;
}

/* ===== Director ===== */
.director-quote {
  font-family: "Space Grotesk", sans-serif; font-size: clamp(1.2rem, 2.4vw, 1.55rem);
  line-height: 1.45; color: var(--text); border-left: 3px solid var(--blue-dark);
  padding-left: 1.3rem; margin: 1.4rem 0;
}

/* ===== Visit cards & CTA ===== */
.visit-card {
  height: 100%; padding: 2rem; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm);
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.visit-card:hover { transform: translateY(-5px); border-color: var(--border-2); box-shadow: var(--shadow); }
.visit-card h3 { font-size: 1.25rem; margin-bottom: .6rem; }
.visit-card p { color: var(--muted); }
.member-photo {
  width: 96px; height: 96px; border-radius: var(--radius-sm); object-fit: cover; object-position: center;
  display: block; margin-bottom: 1rem; border: 2px solid var(--border-2); background: var(--bg-3);
}
.news-list { margin: 0 0 1rem; padding-left: 1.1rem; color: var(--muted); }
.news-list li { margin-bottom: .5rem; }
.news-list li:last-child { margin-bottom: 0; }
.visit-cta {
  display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; justify-content: space-between;
  padding: clamp(1.8rem, 4vw, 2.8rem); border-radius: var(--radius);
  border: 1px solid rgba(37, 99, 235, 0.2); background: rgba(37, 99, 235, 0.06);
}
.visit-cta h3 { font-size: clamp(1.3rem, 3vw, 1.8rem); margin-bottom: .3rem; }

/* ===== Footer ===== */
.site-footer { padding: 4rem 0 2rem; border-top: 1px solid var(--border); background: var(--bg-2); }
.footer-head { font-size: 1rem; letter-spacing: .05em; margin-bottom: 1rem; color: var(--text); }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { padding: .3rem 0; color: var(--muted-2); }
.footer-links a {
  color: var(--muted); position: relative; display: inline-block; font-weight: 600;
}
.footer-links a:hover,
.footer-links a:focus-visible { color: var(--blue-dark); }
.footer-links a:hover::after,
.footer-links a:focus-visible::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -.05rem; height: 2px;
  background: var(--blue-dark); border-radius: 2px;
}
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; text-align: center;
  margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border);
  color: var(--muted-2); font-size: .9rem;
}

/* Separates stacked project sections inside a modal body.
   Bootstrap sets hr { opacity: .25 }, so we override that and use a stronger line. */
.modal-section-divider {
  margin: 1.3rem 0 1.5rem 0; border: 0; border-top: 1px solid var(--border-2);
  opacity: 1; color: var(--border-2);
}

/* ===== Back to top ===== */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 1040;
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--border-2);
  background: #ffffff; color: var(--text); font-size: 1.2rem; box-shadow: var(--shadow-sm);
  display: grid; place-items: center; cursor: pointer; opacity: 0; visibility: hidden;
  transform: translateY(12px); transition: all .3s ease;
}
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { border-color: var(--blue-dark); color: var(--blue-dark); }

/* ===== Media gallery (FancyBox-powered thumbnail grid) ===== */
.media-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
@media (min-width: 576px) { .media-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 992px) { .media-grid { grid-template-columns: repeat(4, 1fr); } }

.media-thumb {
  position: relative; display: block; overflow: hidden; cursor: pointer;
  aspect-ratio: 4 / 3; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-3); box-shadow: var(--shadow-sm);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.media-thumb:hover, .media-thumb:focus-visible {
  transform: translateY(-4px); border-color: var(--border-2); box-shadow: var(--shadow); outline: none;
}
.media-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }

/* Hover scrim with zoom/expand affordance */
.media-thumb .media-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; opacity: 0; transition: opacity .25s ease;
  background: linear-gradient(to top, rgba(15, 27, 45, .5), rgba(15, 27, 45, 0) 60%);
}
.media-thumb:hover .media-overlay,
.media-thumb:focus-visible .media-overlay { opacity: 1; }
.media-thumb .media-overlay i { font-size: 1.6rem; filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .5)); }

/* Video tiles: persistent play badge */
.media-thumb.is-video .media-play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.media-thumb.is-video .media-play i {
  font-size: 3rem; line-height: 1; color: #fff; border-radius: 50%;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, .55));
}

/* Caption strip on hover/focus */
.media-thumb .media-caption {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  padding: .55rem .7rem; color: #fff; font-size: .82rem; line-height: 1.3;
  background: linear-gradient(to top, rgba(15, 27, 45, .78), rgba(15, 27, 45, 0));
  opacity: 0; transition: opacity .25s ease;
}
.media-thumb:hover .media-caption,
.media-thumb:focus-visible .media-caption { opacity: 1; }

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .hero-carousel .carousel-item.active img { animation: none; transform: none; }
  .scroll-cue span { animation: none; }
}
