/* === Base Theme: Force Light Mode === */
:root {
  color-scheme: light !important;

  --color-arc-blue: rgb(65,128,255);
  --color-arc-grey: rgb(145, 145, 145);

  /* Industrial-style palette variants */
  --color-arc-text: #111111;
  --color-arc-muted: #4b5563;      /* Secondary text color */
  --color-arc-border: #e5e7eb;     /* Subtle border color */
  --color-arc-blue-soft: rgba(81,127,247,0.12); /* Soft accent background */
  --header-offset: 58px;   /* Desktop */
  --panel-gap: 18px;       /* Panel spacing buffer */

}
/* Force light tokens when OS prefers dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --pico-background-color: #ffffff !important;
    --pico-color: #111111 !important;
    --pico-card-background-color: #ffffff !important;
    --pico-muted-color: #444444 !important;
    --pico-muted-border-color: #e6e6e6 !important;
  }
}

/* Mobile: header is taller */
@media (max-width: 600px) {
  :root { --header-offset: 74px; }
}

/* Safety fallback for base page colors */
html, body {
  background-color: #ffffff !important;
  color: var(--color-arc-muted) !important;
}

nav {
  border-top: none;
  border-bottom: 1px solid var(--color-arc-border);
}

/* === Navigation Links === */
.nav-link {
  position: relative;
  padding-left: 0.35rem;
  color: var(--color-arc-muted) ;
  text-decoration: none;
  font-weight: 500;
  font-size: 1.1rem;
}

/* Icon-only link: keep it optically centered and remove text offset markers. */
.nav-link.nav-icon {
  padding-left: 0;
}

.nav-link.nav-icon::before {
  display: none;
}

/* Left indicator bar */
.nav-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 1.4em;              
  transform: translateY(-50%);
  background-color: transparent;
  border-radius: 2px;
}

/* Hover and focus states */
.nav-link:hover,
.nav-link:focus-visible {
  color: var(--color-arc-text) ;
}

.nav-link:hover::before,
.nav-link:focus-visible::before {
  background-color: var(--color-arc-blue);
}

.nav-link:hover,
.nav-link:focus-visible {
  text-decoration: none;
}

.center {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

h1 {
  color: var(--color-arc-blue);
  font-weight: 500;
  letter-spacing: 0.02em;
}

h2 {
  color: var(--color-arc-text);
  border-left: 4px solid var(--color-arc-blue);
  padding-left: 0.6rem;
  font-weight: 500;
}

h3 {
  margin-top: 1.75rem;
}

.card {
  padding: 1.25rem;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(2px);
  border: 1px solid rgba(17,17,17,0.08);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.04);
}

.badge-arc {
  display: inline-block;
  background: var(--color-arc-blue-soft);
  color: var(--color-arc-blue);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
}

.hero-image {
  margin-top: 0.25rem;  /* ~12px */
  margin-bottom: 1rem;
}

.hero-image img {
  border-radius: 12px;
  border: none;
}

.hero-caption {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
  color: var(--color-arc-muted);
  text-align: center;        /* Center alignment */
}

.hero-caption-accent {
  color: var(--color-arc-blue);
  font-weight: 500;          /* Medium weight */
}

.figure-caption {
  margin-top: 0.75rem;
  margin-bottom: 2rem;
  text-align: center;
  font-size: 1.3rem;
  color: var(--color-arc-muted);
}

.figure-caption span {
  color: var(--color-arc-blue);
  font-weight: 500;
}

.rounded-only {
  border-radius: 12px;
}

.lead {
  font-size: 1.05rem;
  color: var(--color-arc-muted);
  max-width: 46rem;
  font-weight: 400;
}

.container {
  max-width: 1100px;
}

/* Spacing between cards: keep vertical rhythm consistent across card blocks */
article.card,
section.card {
  margin-bottom: 1.6rem;
}

/* Avoid extra space after the last block in main */
main.container > :last-child {
  margin-bottom: 0;
}

/* === Typography === */

body {
  font-weight: 400;
}

a {
  color: var(--color-arc-blue);
  text-decoration: none;
  font-weight: 500;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

/* === Institution Logos === */
.team-institutions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
  align-items: center;
  margin: 2rem 0;
}

/* Each logo gets a consistent "slot" */
.logo-cell {
  height: 92px;                 /* Tunable range: 80-110px */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.5rem;
}

/* The logo scales within its slot without distortion */
.logo-cell img {
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

/* === Institution Logos Banner === */
.team-institutions-banner {
  margin: 2rem auto 2.5rem;
  max-width: 1000px;   /* Visual ratio aligned with the 4-portrait layout */
}

.team-institutions-banner img {
  display: block;
  width: 100%;
  height: auto;
}

/* === Team Grid === */
.team-people {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 columns on desktop */
  gap: 1.75rem;
  margin: 2.5rem 0;
  text-align: center;
}

.person img {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 0.75rem;
}

.person p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-arc-text);
  line-height: 1.4;
}

.person p strong {
  display: inline-block;
  font-weight: 700;
  margin-bottom: 0.15rem;
  color: var(--color-arc-text)
}

.team-title {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}

.team-flags {
  height: 0.9em;
  width: auto;
  display: block;
}

.pub-list {
  margin-top: 1rem;
  padding-left: 1.1rem;
}

.pub-item {
  margin-bottom: 1.25rem;
}

.pub-venue {
  color: var(--color-arc-muted);
}

.pub-links {
  margin-top: 0.25rem;
  font-size: 0.95rem;
  color: var(--color-arc-muted);
}

.pub-links a {
  color: var(--color-arc-blue);
  text-decoration: none;
  font-weight: 500;
}

.pub-links a:hover,
.pub-links a:focus-visible {
  text-decoration: underline;
}

.pub-sep {
  margin: 0 0.4rem;
  color: var(--color-arc-grey);
}

.pub-note {
  margin-top: 0.25rem;
  font-size: 0.9rem;
  color: var(--color-arc-muted);
}

.pub-outreach .pub-item {
  font-size: 0.95rem;
  color: var(--color-arc-muted);
  margin-bottom: 0.6rem;
}

.pub-outreach a {
  color: var(--color-arc-blue);
  text-decoration: none;
}

.pub-outreach a:hover {
  text-decoration: underline;
}

/* === Footer === */
.site-footer {
  margin-top: 0rem;
  padding-top: 1.5rem;
  padding-bottom: 2rem;
  border-top: 1px solid var(--color-arc-border);
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-arc-muted);
  line-height: 1.5;
}
/* === Body Text Color === */
p,
li,
dt,
dd {
  color: var(--color-arc-muted);
}

/* === Mobile: reduce captions under images === */
@media (max-width: 600px) {
  .hero-caption {
    font-size: 1.1rem;
  }

  .figure-caption {
    font-size: 1rem;
  }
}

@media (max-width: 600px) {
  .team-people {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

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

article strong {
  font-weight: 500;
  color: #2a2a2a;
}

/* === Hero Slider === */
.hero-slider {
  position: relative;
  overflow: hidden;
}

.hero-slider img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity 1s ease;
}

.hero-slider img.active {
  opacity: 1;
  position: relative;
}

/* === Institutional Support Block === */
.institution-logos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem;
  align-items: center;
  justify-items: center;
  margin: 1.5rem 0 1.25rem;
}

.institution-logos img {
 max-height: 60px;     /* Key size constraint */
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: 0.85;
}

/* CNRS logo benefits from slightly higher opacity */
.institution-logos img[alt="CNRS"] {
  opacity: 0.95;
}

/* Mobile */
@media (max-width: 600px) {
  .institution-logos {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem 1.5rem;
  }
}

.institution-logos img.logo-epfl {
  max-height: 37px;
}

.institution-logos img.logo-insa {
  max-height: 40px;
}

.institution-logos img.logo-inria {
  max-height: 37px;
}

/* Center the last row when there are 2 items (desktop 4-col layout) */
@media (min-width: 901px) {
  .team-people > .person:nth-last-child(2) { grid-column: 2; }
  .team-people > .person:last-child { grid-column: 3; }
}

/* === Technology Transfer Block === */
.tech-transfer {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  align-items: start;
  margin-top: 0.75rem;
}

.tech-transfer p {
  margin: 0;
}

.support-logo img {
  height: 44px;
  width: auto;
  max-width: 260px;
  opacity: 0.9;
}

/* Contact line */
.tech-contact {
  margin: 0.75rem 0 1rem;
  color: var(--color-arc-muted);
  font-size: 0.95rem;
}

.tech-contact a {
  word-break: normal;
  overflow-wrap: anywhere; /* ok for emails */
}

.tech-contact a:hover {
  text-decoration: underline;
}

/* === Technology Transfer Media === */
.tech-transfer-media {
  display: grid;
  grid-template-columns: 1fr 320px; /* Narrow right column for logo */
  gap: 1rem;
  align-items: center;
  margin-top: 1rem;
}

/* Video wrapper */
.video-wrapper {
  position: relative;
  width: 100%;
  max-width: 700px; /* Keep wide video area; avoid former 500px cap */
  aspect-ratio: 16 / 9;
  background: #000000;
  border-radius: 8px;
  overflow: hidden;
}

.video-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Logo right column */
.tech-transfer-side {
  display: flex;
  align-items: center;
  justify-content: center; /* Center within side column */
}

.satt-logo {
  height: 72px;   /* Typical range: 56-72px */
  width: auto;
  opacity: 0.9;
}

/* Label above video (optional) */
.tech-transfer-label {
  font-size: 0.9rem;
  color: var(--color-arc-muted);
  margin: 0 0 0.5rem;
}

/* Mobile: stack */
@media (max-width: 800px) {
  .tech-transfer-media {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .satt-logo {
    height: 48px;
    margin-top: 0.75rem;
  }
}

/* Conceptual illustration block */
.concept-figure {
  margin: 1rem auto;
  max-width: 420px;          /* Intentionally constrained */
  text-align: center;
}

.concept-figure img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  filter: grayscale(100%) contrast(1) opacity(0.9);
}

.concept-figure figcaption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--color-arc-muted);
}

.figure-caption-principle {
  max-width: 800px;   /* Wider than the image */
  font-size: 1rem;
  color: var(--color-arc-muted);
  text-align: center;
  margin-top: 0rem;
}

.figure-caption-principle strong,
.figure-caption-principle span {
  color: var(--color-arc-text);
  font-weight: 500;
}

/* ========== Navbar: Scroll Reveal + Centered Menu ========== */

/* Fixed header, hidden by default */
#header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;

  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;

  /* Show animation: faster */
  transition:
    transform 320ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 200ms ease;

  will-change: transform, opacity;
}

/* Fallback: keep header visible when JavaScript is unavailable. */
html.no-js #header {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Hide animation: slower upward exit */
#header:not(.is-visible) {
  transition:
    transform 560ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 320ms ease;
}

#header.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
#header::before {
  content: "";
  position: absolute;
 inset: 6px 12px;              /* Horizontal and vertical inset */
  border-radius: 14px;          /* Rounded corners */

  /* glassy but subtle */
  background: rgba(250, 252, 255, 0.9);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);

  /* very soft separation */
  border-bottom: 1px solid rgba(17,17,17,0.06);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 8px 24px rgba(0,0,0,0.04);
    
}
/* ---- Pico Overrides (remove default top band spacing) ---- */
/* Pico often adds default header/container spacing */
body > header#header,
header#header {
  margin: 0;
  padding: 0;
}
header#header > .container {
  padding-top: 0;
  padding-bottom: 0;
}

/* Keep content above the decorative ::before layer */
#header .container,
#navigation {
  position: relative;
}

/* Navigation layout: logo | menu */
#navigation {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
  

  /* Compact height without forcing a fixed value */
  min-height: 50px;
  padding: 4px 0;

  /* Override global nav border for this component */
  border: 0;
  margin: 0;
}

#navigation .nav-brand {
  grid-column: 1;
  justify-self: start;
}

@media (min-width: 601px) {
  #navigation .nav-brand {
    margin-left: 7px;
  }
}

/* Reset default list spacing from Pico */
#navigation .nav-menu {
  grid-column: 2;
  margin: 0;
  padding: 0 8px 0 0;
  list-style: none;

  justify-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 2.2vw, 42px);
  width: 100%;
  max-width: 100%;

  overflow-x: visible;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
#navigation .nav-menu::-webkit-scrollbar { display: none; }

#navigation .nav-menu > li { margin: 0; padding: 0; }
#navigation .nav-menu > li:first-child.nav-separator { display: none; }
#navigation .nav-menu > li.nav-separator + li.nav-lang { margin-left: 0; }

/* Mid-width desktops/laptops: shrink typography and spacing to keep full menu visible. */
@media (max-width: 1360px) and (min-width: 601px) {
  #navigation .nav-menu {
    gap: clamp(10px, 1.45vw, 24px);
    padding: 0 6px;
  }

  #navigation .nav-menu > li {
    flex: 0 1 auto;
    min-width: 0;
  }

  #navigation .nav-link {
    font-size: clamp(0.9rem, 1.08vw, 1.06rem);
  }
}

/* Language switcher dropdown */
#navigation .lang-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
}

#navigation .nav-lang {
  display: inline-flex;
  align-items: flex-end;
}

#navigation .lang-switcher > summary.lang-toggle {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  vertical-align: middle;
  cursor: pointer;
  list-style: none;
  user-select: none;
  color: var(--color-arc-blue);
  font-weight: 600;
  line-height: 1.1;
  margin: 0;
  padding: 0;
  padding-left: 0;
  -webkit-appearance: none;
  appearance: none;
  transform: translateY(0.15em);
}

#navigation .lang-switcher > summary.lang-toggle .icon-globe {
  width: 0.92em;
  height: 0.92em;
  display: block;
  flex: 0 0 auto;
  color: currentColor;
  transform: translateY(3px);
}

#navigation .lang-switcher > summary.lang-toggle::-webkit-details-marker {
  display: none;
}

#navigation .lang-switcher > summary.lang-toggle::marker {
  content: none;
  font-size: 0;
}

#navigation .lang-switcher > summary.lang-toggle::before {
  display: none;
}

#navigation .lang-switcher > summary.lang-toggle::after {
  content: none !important;
  display: none !important;
  background: none !important;
}

#navigation .lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 1200;

  display: none;
  flex-direction: row;
  align-items: center;
  gap: 4px;

  margin: 0;
  padding: 4px 6px;
  min-width: fit-content;
  width: max-content;
  list-style: none;

  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#navigation .lang-switcher[open] .lang-menu {
  display: flex;
}

#navigation .lang-menu a {
  display: block;
  padding: 2px 6px;
  color: var(--color-arc-text);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  border-radius: 6px;
}

#navigation .lang-menu a:hover,
#navigation .lang-menu a:focus-visible {
  color: var(--color-arc-text);
  background: rgba(81,127,247,0.10);
}

#navigation .lang-menu a.is-current,
#navigation .lang-menu a[aria-current="page"] {
  color: var(--color-arc-blue);
  background: rgba(81,127,247,0.10);
}

/* On hero video: non-active language options in white for contrast. */
#header.on-hero #navigation .lang-menu a {
  color: rgba(255, 255, 255, 0.95);
}

#header.on-hero #navigation .lang-menu a.is-current,
#header.on-hero #navigation .lang-menu a[aria-current="page"] {
  color: var(--color-arc-blue);
}

#header.on-hero .lang-toggle {
  color: rgba(255,255,255,0.92);
}

#header.on-hero .lang-toggle:hover,
#header.on-hero .lang-toggle:focus-visible {
  color: #ffffff;
}

/* On home hero video only, render the globe in white for contrast. */
#header.on-hero .lang-toggle .icon-globe {
  color: rgba(255, 255, 255, 0.95);
}

/* Logo */
.nav-brand {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;

  transition: transform 160ms ease, filter 160ms ease, background 160ms ease;
}
.nav-brand img {
  width: 34px;
  height: 34px;
  display: block;
}
.nav-brand:hover {
  transform: translateY(-1px);
  filter: brightness(1.06) drop-shadow(0 0 10px rgba(81,127,247,0.30));
  background: rgba(81,127,247,0.06);
}

/* Keyboard focus visibility */
.nav-link:focus-visible,
.nav-brand:focus-visible {
  outline: 2px solid rgba(81,127,247,0.65);
  outline-offset: 2px;
}

@media (max-width: 600px) {

  /* Single-row mobile navbar */
  #navigation {
    display: flex;
    align-items: center;
    gap: 2px;

    min-height: 70px;
    padding: 2px 0;
    width: 100%;
  }

  /* Logo */
  .nav-brand {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
  }
  .nav-brand img {
    width: 30px;
    height: 30px;
  }

  /* Menu fills remaining horizontal space */
  #navigation .nav-menu {
    flex: 1 1 auto;
    min-width: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    margin: 0;
    padding: 0 4px;
    list-style: none;
    gap: clamp(0.08rem, 0.6vw, 0.28rem);
    overflow: visible;
  }

  /* Flex manages item sizing */
  #navigation .nav-menu > li {
    margin: 0;
    padding: 0;
    flex: 0 1 auto;
  }

  #navigation .nav-menu > li.nav-separator + li.nav-lang {
    margin-left: 0;
  }

  /* Compact link styling */
  #navigation .nav-link {
    position: relative;
    display: inline-block;

    font-size: clamp(0.68rem, 2.05vw, 0.86rem);
    white-space: nowrap;
    line-height: 1.1;

    padding-left: 0.2rem; /* Space for left indicator bar */
  }

  /* Blue indicator on active/focus states */
  #navigation .nav-link::before {
    background-color: transparent;
    height: 1em;
  }
  #navigation .nav-link:active::before,
  #navigation .nav-link:focus-visible::before {
    background-color: var(--color-arc-blue);
  }

  #navigation .lang-switcher > summary.lang-toggle {
    transform: translateY(0.264em);
  }

  #navigation .lang-switcher > summary.lang-toggle .icon-globe {
    transform: translateY(1px);
  }

  #navigation .nav-lang {
    position: relative;
    z-index: 1300;
  }

  #navigation .lang-menu {
    right: 0;
    left: auto;
  }
}

/* === Hero Overlay Navbar === */

/* On hero: transparent overlay with light text */
#header.on-hero::before{
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  border-bottom: 0; /* No bottom line */
}

/* Disable global nav border while on hero */
#header.on-hero nav{
  border-bottom: 0;
}

/* Light navigation links on hero */
#header.on-hero .nav-link{
  color: rgba(255,255,255,0.92);
}
#header.on-hero .nav-link:hover,
#header.on-hero .nav-link:focus-visible{
  color: #ffffff;
}

/* Left indicator bar becomes light on hover/focus */
#header.on-hero .nav-link::before{
  background-color: transparent;
}
#header.on-hero .nav-link:hover::before,
#header.on-hero .nav-link:focus-visible::before{
  background-color: rgba(255,255,255,0.90);
}

/* Keep language indicator in ARC blue on all header states. */
#header.on-hero .lang-toggle,
#header.on-hero .lang-toggle:hover,
#header.on-hero .lang-toggle:focus-visible,
#header.scrolled .lang-toggle,
#header.scrolled .lang-toggle:hover,
#header.scrolled .lang-toggle:focus-visible {
  color: var(--color-arc-blue);
}

/* Improve logo contrast on video background */
#header.on-hero .nav-brand{
  background: transparent;
}
#header.on-hero .nav-brand img{
  filter: brightness(0) invert(1); /* Useful when source logo is dark */
}

/* After hero: restore translucent light header */
#header.scrolled::before{
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  border-bottom: 1px solid rgba(0,0,0,0.00);
}
#header.scrolled .nav-link{
  color: inherit;
}

#header.scrolled .nav-brand img{
  filter: none;
}

/* --- Full-bleed section even inside .container --- */
.hero-video-fullscreen{
  position: relative;
  height: 100svh;
  min-height: 100svh;
  overflow: hidden;

  /* Full width viewport even if parent is .container */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

/* Background layer */
.hero-video-bg{
  position: absolute;
  inset: 0;
  background: #000;
}

/* TRUE "cover" for YouTube iframe (no black bars) */
/* Full-screen cover mode for embedded video */
.hero-video-html{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  width: 100vw;
  height: 56.25vw;      /* 9/16 of viewport width */
  min-width: 177.78vh;  /* 16/9 of viewport height */
  min-height: 100%;

  object-fit: cover;
  border: 0;
  pointer-events: none;

}

.hero-video-overlay{
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(0,0,0,0.35), rgba(0,0,0,0.15) 35%, rgba(0,0,0,0.35));
}

.hero-video-fallback{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}

/* === Hero Text Block === */
.hero-video-fullscreen .hero-video-content{
  position: relative;
  z-index: 2;
  height: 100%;
  display: grid;
  align-content: center;         /* Vertical centering */
  justify-items: start;          /* Left alignment */
  padding: clamp(70px, 10vh, 120px) clamp(16px, 5vw, 72px);
}

/* Main hero heading */
.hero-video-fullscreen .hero-caption{
  margin: 0;
  max-width: 18ch;
  color: #fff;
  text-shadow: 0 2px 14px rgba(0,0,0,0.55);
  font-size: clamp(2.0rem, 4.5vw, 4.2rem);
  line-height: 1.02;
  text-align: left;
}

/* Accent color intentionally set to near-white for hero readability */
.hero-video-fullscreen .hero-caption-accent{
  color: rgba(255,255,255,0.92);
  font-weight: 600;
}

/* === Hero Scroll Button === */
.hero-scroll{
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 3;

  width: 44px;
  height: 44px;
  border-radius: 999px;

  display: grid;
  place-items: center;

  color: rgba(255,255,255,0.92);
  text-decoration: none;

  border: 1px solid rgba(255,255,255,0.55);
  background: rgba(0,0,0,0.18);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.hero-scroll:hover,
.hero-scroll:focus-visible{
  transform: translateX(-50%) translateY(-2px);
  background: rgba(0,0,0,0.28);
  border-color: rgba(255,255,255,0.85);
  outline: none;
}

.hero-scroll span{
  font-size: 0;
  width: 14px;
  height: 14px;
  display: block;
  position: relative;
}

.hero-scroll span::before{
  content: "";
  position: absolute;
  left: 50%;
  top: 45%;
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translate(-50%, -50%) rotate(45deg);
}

/* Subtle bounce animation */
@media (prefers-reduced-motion: no-preference) {
  .hero-scroll{
    animation: heroScrollBounce 1.6s ease-in-out infinite;
  }
  @keyframes heroScrollBounce{
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%      { transform: translateX(-50%) translateY(4px); }
  }
}

/* === Fixed Header Offset === */

main.container{
  padding-top: var(--header-offset);
}

/* === Home Page Header Offset Override === */
.page-home main.container{
  padding-top: 0;
}

/* Special case: first card under the fixed navbar */
.card-first{
  /* Tuned offset for first in-depth card */
  margin-top: 10px;
  scroll-margin-top: calc(var(--header-offset) + 24px);
}

/* In-depth anchors under fixed navbar */
#partnership,
#tech-transfer,
#team,
#publications{
  scroll-margin-top: var(--header-offset);
}

/* Mobile */
@media (max-width: 600px){
  .card-first{
    margin-top: -18px;
    scroll-margin-top: var(--header-offset);
  }

  #partnership,
  #tech-transfer,
  #team,
  #publications{
    scroll-margin-top: calc(var(--header-offset) - 18px);
  }
}

/* === Section Scroll Button === */
.section-scroll{
  display: grid;
  place-items: center;
  margin: 18px auto 0;

  width: 44px;
  height: 44px;
  border-radius: 999px;

  color: var(--color-arc-muted);
  text-decoration: none;

  border: 1px solid var(--color-arc-border);
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.section-scroll:hover,
.section-scroll:focus-visible{
  transform: translateY(-2px);
  background: rgba(255,255,255,0.95);
  border-color: rgba(81,127,247,0.35);
  outline: none;
}

.section-scroll span{
  font-size: 24px;
  line-height: 1;
  transform: translateY(-1px);
}

@media (prefers-reduced-motion: no-preference) {
  .section-scroll{
    animation: heroScrollBounce 1.6s ease-in-out infinite;
  }
}

html{
  scroll-behavior: smooth;
}

.section-scroll--up{
  margin: 0 auto 18px;  /* Top anchor position */
}

.section-scroll--up:hover,
.section-scroll--up:focus-visible{
  transform: translateY(2px); /* Reverse direction for upward control */
}

@media (prefers-reduced-motion: no-preference) {
  .section-scroll--up{
    animation-direction: reverse; /* Reverse animation direction */
  }
}

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

.overview-grid{
  display: grid;
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;

  gap: clamp(28px, 3vw, 48px);
  align-items: start;
  justify-items: stretch;
}

/* Item */
.overview-pair{
  margin: 0;
  width: 100%;
}

/* Two thumbnails */
.overview-pair .pair{
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(10px, 1.2vw, 16px);
}

/* Square thumbnails */
.overview-pair img{
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 20px;
  display: block;
}

/* Caption */
.figure-caption--tight{
  margin-top: 0.6rem;
  margin-bottom: 0;

  font-size: clamp(1.05rem, 1.3vw, 1.3rem);
  line-height: 1.15;

  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mobile / portrait: 1 item per row, full width */
@media (max-width: 700px){
  .overview-grid{
    grid-template-columns: 1fr;
  }
  .overview-pair{
    max-width: none; /* Fill available width on small screens */
  }
}

/* Desktop: 3 items on row 1 + 2 centered on row 2 */
@media (min-width: 901px){
  .overview-grid{
    /* 6 columns: each pair takes 2 columns => 3 items per row */
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  /* each pair spans 2 columns */
  .overview-grid > .overview-pair{
    grid-column: span 2;
    max-width: none; /* let grid define the width */
  }

  /* Row 2 centered: place #4 on columns 2-3, #5 on columns 4-5 */
  .overview-grid > .overview-pair:nth-child(4){ grid-column: 2 / span 2; }
  .overview-grid > .overview-pair:nth-child(5){ grid-column: 4 / span 2; }
}

/* === Home Fullscreen Panels === */
.page-home #Overview,
.page-home #Gallery{
  height: 100svh;
  min-height: 100svh;

  padding-top: calc(var(--header-offset) + 12px);
  padding-bottom: 24px;

  display: grid;
  align-content: center;

  padding-left: clamp(12px, 4vw, 24px);
  padding-right: clamp(12px, 4vw, 24px);
}

/* Optional: panel-by-panel scroll snap */
@media (min-width: 701px){
  body{ scroll-snap-type: y mandatory; }
  #top-video, #Overview, #Gallery{ scroll-snap-align: start; } 
}

/* Desktop only: Overview full-bleed */
@media (min-width: 901px){
  .page-home #Overview{
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
  }

  .page-home #Overview .overview-grid{
    max-width: 1600px;
    margin-inline: auto;
    padding-inline: clamp(16px, 4vw, 48px);
  }
}

/* Mobile: normal width, no overflow trick */
@media (max-width: 700px){
  .page-home #Overview{
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .page-home #Overview .overview-grid{
    padding-inline: 0; /* Optional for consistent edge alignment */
  }
}

.hero-scroll.is-hidden{
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px);
}

/* === Overview Title === */
.overview-title{
  margin: 0 0 clamp(20px, 4vh, 40px);
  text-align: center;

  font-size: clamp(1.8rem, 3.5vw, 2.6rem); /* Larger fluid title scale */
  font-weight: 600;

  color: var(--color-arc-blue); /* ARC primary blue */

  border-left: none;   /* Override global h2 left-border style */
  padding-left: 0;
}

/* Subtle decorative accent below the title */
.overview-title::after{
  content: "";
  display: block;
  width: 72px;
  height: 3px;
  margin: 14px auto 0;
  background: var(--color-arc-blue);
  border-radius: 2px;
  opacity: 0.9;
}

/* Mobile: make hero truly full-screen (avoid 100svh being too small) */
@media (max-width: 700px) and (orientation: portrait){
  .hero-video-fullscreen{
    height: 100dvh;
    min-height: 100dvh;
  }
}

/* Fallback if dvh not supported */
@supports not (height: 100dvh){
  @media (max-width: 700px) and (orientation: portrait){
    .hero-video-fullscreen{
      height: 100vh;
      min-height: 100vh;
    }
  }
}

/* === Mobile Panel Flow === */
@media (max-width: 700px){

  /* stop snap on mobile */
  body{ scroll-snap-type: none; }

  /* hero stays full screen */
  .hero-video-fullscreen{
    height: 100dvh;
    min-height: 100dvh;
  }

  /* Overview/Gallery: no forced 100vh => no overlap */
  .page-home #Overview,
  .page-home #Gallery{
    height: auto;
    min-height: 0;
    align-content: start; /* instead of center */
    background: #fff;                /* Ensure solid panel background in this mode */
  }
}

/* === Tablet Panel Flow === */
@media (max-width: 1024px){

  body{ scroll-snap-type: none; }

  /* Overview/Gallery: no forced 100vh => no overlap */
  .page-home #Overview,
  .page-home #Gallery{
    height: auto;
    min-height: 0;
    align-content: start;
    background: #fff;
  }
}

.title-dark{
  color: var(--color-arc-text);  /* Slightly softer than pure black */
  font-weight: 600;
}

.title-accent{
  color: var(--color-arc-blue);
  font-weight: 600;
}

/* === ARC Background === */
html, body{
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(65,128,255,0.08), transparent 60%),
    radial-gradient(900px 500px at 85% 35%, rgba(65,128,255,0.05), transparent 62%),
    linear-gradient(180deg, #fbfcff 0%, #f6f7fb 100%);
  background-attachment: fixed;
}

/* Separator only between Overview and Gallery */
.page-home #Gallery{
  border-top: 1px solid rgba(17,17,17,0.08);
}

/* === Mobile/Tablet Background Behavior === */
@media (max-width: 1024px){

  /* 1) background paper */
  html, body{
    background:
      radial-gradient(900px 500px at 15% 10%, rgba(65,128,255,0.08), transparent 60%),
      radial-gradient(900px 500px at 85% 35%, rgba(65,128,255,0.05), transparent 62%),
      linear-gradient(180deg, #fbfcff 0%, #f6f7fb 100%);
    background-attachment: fixed;
  }

  /* 2) panels should NOT paint a big white rectangle */
  .page-home #Overview,
  .page-home #Gallery,
  .gallery-panel{
    background: transparent;
  }

  /* 3) keep content blocks readable */
  article.card, .card{
    background: rgba(255,255,255,0.96);
    border-color: rgba(17,17,17,0.08);
  }
}

/* Reset figure wrapper spacing */
.hero-slider-wrap .hero-image{
  margin: 0;                        /* Remove residual bottom spacing */
}

/* Slider itself does not need radius */
.hero-slider{
  position: relative;
  overflow: hidden;                 /* Kept for safety; wrapper already clips */
  border-radius: 0;                 /* Intentional */
}

.gallery-controls-mobile {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin-top: 0.85rem;
}

.gallery-controls-mobile .gallery-dots {
  margin-top: 0;
}

.gallery-controls-mobile .gallery-nav-btn {
  display: none;
}

.gallery-pause-toggle-desktop-overlay {
  display: none;
}

.gallery-fullscreen-toggle-desktop {
  display: none;
}

.gallery-fullscreen-toggle-mobile {
  display: none;
}

.gallery-fullscreen-toggle-mobile.is-hidden {
  display: none !important;
}

.gallery-nav-desktop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 140ms ease;
}

.hero-slider:hover .gallery-nav-desktop,
.hero-slider:focus-within .gallery-nav-desktop {
  opacity: 1;
}

.gallery-nav-btn {
  pointer-events: auto;
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  color: rgba(116, 126, 140, 0.13);
  border: 1px solid currentColor;
  background: rgba(116, 126, 140, 0.13);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(1px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.09);
  transition: background-color 120ms ease, transform 120ms ease;
}

.gallery-nav-btn-desktop {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
}

.gallery-nav-prev-overlay {
  left: 0.75rem;
}

.gallery-nav-next-overlay {
  right: 0.75rem;
}

.gallery-nav-btn > svg {
  width: 16px;
  height: 16px;
  display: block;
  stroke: currentColor;
  stroke-width: 2.4;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gallery-pause-toggle-desktop-overlay svg rect {
  fill: currentColor;
  stroke: none;
}

.gallery-pause-toggle-desktop-overlay svg path {
  fill: currentColor;
  stroke: none;
}

.gallery-nav-btn:active {
  background: rgba(116, 126, 140, 0.24);
  border-color: rgba(116, 126, 140, 0.24);
  box-shadow: 0 0 0 3px rgba(6, 92, 173, 0.22), 0 1px 5px rgba(0, 0, 0, 0.12);
  transform: scale(0.98);
}

.gallery-nav-btn-desktop:active {
  transform: translateY(-50%) scale(0.98);
}

.gallery-nav-btn:focus,
.gallery-nav-btn:focus-visible,
.gallery-nav-btn:focus-within {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(6, 92, 173, 0.2), 0 1px 4px rgba(0, 0, 0, 0.09) !important;
}

.gallery-nav-btn-desktop:hover,
.gallery-nav-btn-desktop:focus-visible {
  color: rgba(116, 126, 140, 0.5);
  background: rgba(116, 126, 140, 0.3);
  border-color: rgba(116, 126, 140, 0.5);
  box-shadow: 0 0 0 3px rgba(6, 92, 173, 0.24), 0 2px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-50%) scale(1.06);
}

.gallery-pause-toggle-desktop-overlay:hover,
.gallery-pause-toggle-desktop-overlay:focus-visible {
  color: rgba(116, 126, 140, 0.45);
  background: rgba(116, 126, 140, 0.28);
  border-color: rgba(116, 126, 140, 0.45);
}

.gallery-pause-toggle-desktop-overlay.is-active {
  color: rgba(6, 92, 173, 0.82);
  background: rgba(6, 92, 173, 0.14);
  border-color: rgba(6, 92, 173, 0.55);
  box-shadow: 0 0 0 3px rgba(6, 92, 173, 0.2), 0 1px 4px rgba(0, 0, 0, 0.09);
}

.gallery-pause-toggle-desktop-overlay:active {
  transform: translateX(-50%) scale(0.98);
}

.gallery-fullscreen-toggle-desktop:hover,
.gallery-fullscreen-toggle-desktop:focus-visible {
  color: rgba(116, 126, 140, 0.5);
  background: rgba(116, 126, 140, 0.3);
  border-color: rgba(116, 126, 140, 0.5);
  box-shadow: 0 0 0 3px rgba(6, 92, 173, 0.24), 0 2px 8px rgba(0, 0, 0, 0.15);
}

.gallery-fullscreen-toggle-desktop.is-active {
  color: rgba(6, 92, 173, 0.82);
  background: rgba(6, 92, 173, 0.14);
  border-color: rgba(6, 92, 173, 0.55);
  box-shadow: 0 0 0 3px rgba(6, 92, 173, 0.2), 0 1px 4px rgba(0, 0, 0, 0.09);
}

.gallery-nav-btn.is-key-active {
  color: rgba(6, 92, 173, 0.88);
  background: rgba(6, 92, 173, 0.2);
  border-color: rgba(6, 92, 173, 0.66);
  box-shadow: 0 0 0 3px rgba(6, 92, 173, 0.28), 0 1px 6px rgba(0, 0, 0, 0.14);
}

.gallery-dots.gallery-dots-fullscreen {
  display: none;
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 3;
  margin-top: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.is-gallery-fullscreen .gallery-dots.gallery-dots-fullscreen {
  display: inline-flex;
}

#Gallery.is-gallery-fullscreen {
  --fs-controls-bottom-safe: max(10px, calc(env(safe-area-inset-bottom, 0px) + 8px));
  --fs-pause-bottom: calc(var(--fs-controls-bottom-safe) + 20px);
}

#Gallery.is-gallery-fullscreen .hero-slider {
  cursor: default !important;
  background: #000 !important;
  width: 100%;
  height: 100%;
  border-radius: 0;
  overflow: hidden;
}

#Gallery.is-gallery-fullscreen .hero-slider-wrap {
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  background: #000 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0;
  overflow: hidden !important;
}

#Gallery.is-gallery-fullscreen,
#Gallery.is-gallery-fullscreen:fullscreen,
#Gallery.is-gallery-fullscreen .hero-image {
  background: #000 !important;
}

.hero-slider-wrap:fullscreen,
.hero-slider-wrap:-webkit-full-screen,
.hero-slider-wrap:fullscreen .hero-slider,
.hero-slider-wrap:-webkit-full-screen .hero-slider,
.hero-slider-wrap:fullscreen .hero-image,
.hero-slider-wrap:-webkit-full-screen .hero-image {
  background: #000 !important;
}

#Gallery.is-gallery-fullscreen .hero-slider img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
}

#Gallery.is-gallery-fullscreen .hero-slider img.active {
  position: absolute;
  inset: 0;
}

.is-gallery-fullscreen .gallery-dots.gallery-dots-fullscreen .gallery-dot {
  width: 12px;
  height: 12px;
  min-width: 12px;
  min-height: 12px;
  max-width: 12px;
  max-height: 12px;
}

#Gallery.is-gallery-fullscreen .gallery-dots.gallery-dots-fullscreen {
  bottom: calc(var(--fs-pause-bottom) / 2);
}

.gallery-pause-indicator {
  position: absolute;
  left: 50%;
  bottom: 0.4rem;
  transform: translateX(-50%);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.gallery-pause-indicator svg {
  width: 20px;
  height: 20px;
  display: block;
}

.gallery-pause-indicator svg rect {
  fill: rgba(255, 255, 255, 0.86);
}

.gallery-pause-indicator.is-visible {
  display: inline-flex;
}

#Gallery.is-gallery-fullscreen .gallery-pause-indicator {
  bottom: var(--fs-pause-bottom);
}

.hero-slider-wrap{
  border-radius: 14px;
  overflow: hidden;
  background: #fff;

  border: 1px solid rgba(17,17,17,0.06);

  box-shadow:
    0 10px 28px rgba(0,0,0,0.12),
    0 2px 6px rgba(6, 92, 173, 0.05);
}

.gallery-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.85rem;
}

.gallery-dot {
  width: 10px;
  height: 10px;
  min-width: 10px;
  min-height: 10px;
  max-width: 10px;
  max-height: 10px;
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
  padding: 0;
  display: inline-block;
  flex: 0 0 auto;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  border-radius: 50%;
  border: 0;
  background: var(--color-arc-grey);
  opacity: 0.9;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease, background-color 120ms ease;
}

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

.gallery-dot.is-active {
  background: var(--color-arc-blue);
  opacity: 1;
  transform: scale(1.05);
}

.gallery-dot.is-active.is-paused {
  box-shadow: 0 0 0 3px rgba(6, 92, 173, 0.25);
  transform: scale(1.1);
}

.gallery-dot:hover,
.gallery-dot:focus-visible {
  opacity: 0.95;
}

.gallery-dot:focus-visible {
  outline: 2px solid rgba(65, 128, 255, 0.45);
  outline-offset: 2px;
}

@media (hover: none) and (pointer: coarse) {
  #Gallery.is-gallery-fullscreen {
    --fs-controls-bottom-safe: max(5px, calc(env(safe-area-inset-bottom, 0px) + 4px));
    --fs-pause-bottom: calc(var(--fs-controls-bottom-safe) + 20px);
  }

  #Gallery.is-gallery-fullscreen .gallery-dots.gallery-dots-fullscreen {
    bottom: 2px !important;
  }

  #Gallery.is-gallery-fullscreen .hero-slider-wrap {
    border: 1px solid rgba(17, 17, 17, 0.06) !important;
    box-shadow:
      0 10px 28px rgba(0, 0, 0, 0.12),
      0 2px 6px rgba(6, 92, 173, 0.05) !important;
    border-radius: 14px !important;
    background: #fff !important;
    width: min(96vw, 1920px) !important;
    height: min(94vh, 1080px) !important;
    margin: auto;
    overflow: visible !important;
  }

  #Gallery.is-gallery-fullscreen .hero-slider {
    background:
      radial-gradient(900px 500px at 15% 10%, rgba(65,128,255,0.08), transparent 60%),
      radial-gradient(900px 500px at 85% 35%, rgba(65,128,255,0.05), transparent 62%),
      linear-gradient(180deg, #fbfcff 0%, #f6f7fb 100%) !important;
    border-radius: 14px;
    overflow: hidden;
  }

  #Gallery.is-gallery-fullscreen,
  #Gallery.is-gallery-fullscreen:fullscreen,
  #Gallery.is-gallery-fullscreen .hero-image,
  .hero-slider-wrap:fullscreen,
  .hero-slider-wrap:-webkit-full-screen,
  .hero-slider-wrap:fullscreen .hero-slider,
  .hero-slider-wrap:-webkit-full-screen .hero-slider,
  .hero-slider-wrap:fullscreen .hero-image,
  .hero-slider-wrap:-webkit-full-screen .hero-image {
    background:
      radial-gradient(900px 500px at 15% 10%, rgba(65,128,255,0.08), transparent 60%),
      radial-gradient(900px 500px at 85% 35%, rgba(65,128,255,0.05), transparent 62%),
      linear-gradient(180deg, #fbfcff 0%, #f6f7fb 100%) !important;
  }

  .gallery-controls-mobile .gallery-nav-btn {
    display: inline-flex;
  }

  .gallery-fullscreen-toggle-mobile {
    display: inline-flex;
  }

  .is-gallery-fullscreen .gallery-controls-mobile {
    display: none;
  }

  .gallery-pause-toggle-desktop-overlay {
    display: none;
  }

  .gallery-nav-desktop {
    display: none;
  }

  .gallery-fullscreen-toggle-desktop {
    display: none;
  }

  .is-gallery-fullscreen .gallery-nav-desktop {
    display: block;
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease;
  }

  .is-gallery-fullscreen.show-fs-controls .gallery-nav-desktop {
    opacity: 1;
    pointer-events: auto;
  }

  .is-gallery-fullscreen .gallery-fullscreen-toggle-desktop {
    display: inline-flex;
    position: absolute;
    right: 0.65rem;
    top: 0.65rem;
    z-index: 3;
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease;
  }

  .is-gallery-fullscreen.show-fs-controls .gallery-fullscreen-toggle-desktop {
    opacity: 1;
    pointer-events: auto;
  }

  .gallery-dot:focus-visible {
    outline: none;
    box-shadow: none;
  }
}

@media (hover: hover) and (pointer: fine) {
  .gallery-pause-toggle-desktop-overlay {
    display: inline-flex;
    position: absolute;
    left: 50%;
    bottom: -0.18rem;
    transform: translateX(-50%);
    z-index: 3;
    opacity: 0;
    transition: opacity 140ms ease, transform 120ms ease, background-color 120ms ease;
  }

  .hero-slider:hover .gallery-pause-toggle-desktop-overlay,
  .hero-slider:focus-within .gallery-pause-toggle-desktop-overlay {
    opacity: 1;
  }

  .is-gallery-fullscreen .gallery-pause-toggle-desktop-overlay {
    opacity: 0;
    bottom: calc(var(--fs-controls-bottom-safe) + 22px);
  }

  .is-gallery-fullscreen.show-fs-controls .gallery-pause-toggle-desktop-overlay {
    opacity: 1;
  }

  .gallery-fullscreen-toggle-desktop {
    display: inline-flex;
    position: absolute;
    right: 0.65rem;
    top: 0.65rem;
    z-index: 3;
    opacity: 0;
    transition: opacity 140ms ease, transform 120ms ease, background-color 120ms ease;
  }

  .hero-slider:hover .gallery-fullscreen-toggle-desktop,
  .hero-slider:focus-within .gallery-fullscreen-toggle-desktop {
    opacity: 1;
  }

  .is-gallery-fullscreen .gallery-nav-desktop {
    opacity: 0 !important;
    pointer-events: none;
  }

  .is-gallery-fullscreen.show-fs-controls .gallery-nav-desktop {
    opacity: 1 !important;
    pointer-events: auto;
  }

  .is-gallery-fullscreen .gallery-fullscreen-toggle-desktop {
    opacity: 0 !important;
    pointer-events: none;
  }

  .is-gallery-fullscreen.show-fs-controls .gallery-fullscreen-toggle-desktop {
    opacity: 1 !important;
    pointer-events: auto;
  }

  .is-gallery-fullscreen .gallery-pause-toggle-desktop-overlay {
    opacity: 0 !important;
    pointer-events: none;
  }

  .is-gallery-fullscreen.show-fs-controls .gallery-pause-toggle-desktop-overlay {
    opacity: 1 !important;
    pointer-events: auto;
  }
}

.nav-separator{
  width: 1px;
  height: 1.4em;
  background: rgba(17,17,17,0.14);
  align-self: center;
  margin: 0 18px;
  flex: 0 0 auto;
}

#header.on-hero .nav-separator{
  background: rgba(255,255,255,0.35);
}

/* === Navigation Semantic Colors === */

/* Home and in-depth links outside hero state */
#header.scrolled .nav-link.nav-home{
  color: var(--color-arc-blue);
}

#header.scrolled .nav-link.nav-indepth{
  color: var(--color-arc-muted);
}

/* Safety fallback outside hero context (e.g. in-depth page) */
body:not(.page-home) .nav-link.nav-indepth{
  color: var(--color-arc-muted);
}

/* Keep current-language label blue across states. */
#header.on-hero .nav-link.nav-indepth.lang-toggle,
#header.on-hero .nav-link.nav-indepth.lang-toggle:hover,
#header.on-hero .nav-link.nav-indepth.lang-toggle:focus-visible,
#header.scrolled .nav-link.nav-indepth.lang-toggle,
#header.scrolled .nav-link.nav-indepth.lang-toggle:hover,
#header.scrolled .nav-link.nav-indepth.lang-toggle:focus-visible,
body:not(.page-home) .nav-link.nav-indepth.lang-toggle,
body:not(.page-home) .nav-link.nav-indepth.lang-toggle:hover,
body:not(.page-home) .nav-link.nav-indepth.lang-toggle:focus-visible {
  color: var(--color-arc-blue);
}

/* On home hero video, keep only the globe icon white. */
#header.on-hero .nav-link.nav-indepth.lang-toggle .icon-globe {
  color: #ffffff !important;
}

.nav-icon{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2em;
  min-width: 1.2em;
  padding: 0;
  line-height: 1;
}

.icon-home-trap{
  width: 1.15em;
  height: 1.15em;
  display: block;
}

/* Mobile: slightly smaller icon */
@media (max-width: 600px){
  .icon-home-trap{ width: 1.0em; height: 1.0em; }
}

/* Adapt icon colors for hero-on-video context */
#header.on-hero .icon-home-trap{
  --home-left: rgba(255,255,255,0.92);
  --home-right: rgba(255,255,255,0.92); /* Keep blue here if preferred */
}

/* Force align icon/text in nav (especially on mobile where .nav-link is inline-block) */
#navigation .nav-link{
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  line-height: 1.1; /* Matches mobile nav typography */
}

#navigation .icon-home-trap{
  width: 0.95em;
  height: 0.95em;
  display: block;
  flex: 0 0 auto;
  transform: translateY(0.10em);
}

@media (min-width: 601px){
  #navigation .nav-link{
    font-size: clamp(1.02rem, 0.9vw, 1.18rem);
  }

  #navigation .nav-separator{
    margin: 0 clamp(8px, 1.2vw, 16px);
  }
}

@media (max-width: 600px){
  #navigation .icon-home-trap{
    width: 0.95em;
    height: 0.95em;
    transform: translateY(0.08em);
  }
}

@media (max-width: 600px){
  /* Mobile menu label size */
  #navigation .nav-menu a{
    font-size: 0.75rem;
    line-height: 1.1;
  }

  /* Optional: slightly reduce perceived navbar height */
  #navigation{ min-height: 54px; }
}

@media (max-width: 600px) {
  .nav-brand img,
  .nav-brand svg {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 600px){
  .nav-separator{
    height: 1em;          /* Separator line height */
    margin: 0 10px;          /* Separator horizontal spacing */
    transform: translateY(0.15em); /* Fine vertical alignment adjustment */
    opacity: 0.7;           /* Optional softer appearance */
  }
}

/* Portrait mobile: fluid nav typography with consistent spacing */
@media (max-width: 600px) and (orientation: portrait){
  /* On narrow portrait layouts, keep a single Home entry (brand logo). */
  #navigation .nav-link.nav-icon{
    display: none;
  }

  #navigation .nav-menu{
    width: 100%;
    min-width: 0;
    justify-content: space-between;
    gap: clamp(0.12rem, 0.8vw, 0.35rem);
    padding: 0 0.16rem;
    overflow: visible;
  }

  #navigation .nav-menu > li{
    flex: 0 1 auto;
    min-width: 0;
  }

  #navigation .nav-menu a{
    font-size: clamp(0.66rem, 2.36vw, 0.95rem);
    line-height: 1.1;
    white-space: nowrap;
    letter-spacing: -0.01em;
    padding-left: 0.16rem;
  }

  #navigation .nav-separator{
    margin: 0 clamp(0.08rem, 0.5vw, 0.22rem);
    flex: 0 0 1px;
  }
}

/* Final language label baseline alignment */
#navigation .nav-menu > li.nav-lang {
  align-self: flex-end;
}

#navigation .nav-menu > li.nav-lang .lang-toggle {
  transform: none;
  position: relative;
  top: 0.15em;
}

@media (max-width: 600px) {
  #navigation .nav-menu > li.nav-lang .lang-toggle {
    top: 0.12em;
  }
}

/* Hard override: lower the language item baseline in navbar */
#navigation .nav-menu > li.nav-lang {
  transform: translateY(0.14em) !important;
}

@media (max-width: 600px) {
  #navigation .nav-menu > li.nav-lang {
    transform: translateY(0.462em) !important;
  }
}
