@layer reset, base, components, layout, utilities;

@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  html {
    scroll-behavior: smooth;
  }

  body,
  h1,
  h2,
  h3,
  p,
  ul {
    margin: 0;
  }

  ul {
    padding: 0;
    list-style: none;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  button {
    font: inherit;
  }

  img,
  video {
    display: block;
    max-width: 100%;
  }
}

@layer base {
  :root {
    --radius: 1rem;
    --black: 222 56% 4%;
    --page: 218 62% 7%;
    --page-deep: 231 64% 5%;
    --surface: 214 54% 14%;
    --surface-strong: 217 58% 18%;
    --white: 196 100% 97%;
    --white-soft: 198 92% 92%;
    --white-muted: 198 70% 80%;
    --white-subtle: 202 42% 64%;
    --white-faint: 206 32% 52%;
    --graphite: 215 42% 14%;
    --graphite-soft: 216 43% 20%;
    --mist: 190 88% 88%;
    --accent-cyan: 187 100% 58%;
    --accent-violet: 264 100% 72%;
    --accent-magenta: 316 100% 66%;
    --accent-gold: 39 100% 64%;
    --accent-cyan-rgb: 41 226 255;
    --accent-violet-rgb: 170 120 255;
    --accent-gold-rgb: 255 188 77;
  }

  body {
    min-height: 100vh;
    overflow-x: hidden;
    color: hsl(var(--white));
    background:
      radial-gradient(circle at 10% -10%, hsl(var(--accent-cyan) / 0.22), transparent 32rem),
      radial-gradient(circle at 88% 8%, hsl(var(--accent-violet) / 0.2), transparent 34rem),
      linear-gradient(135deg, hsl(var(--page-deep)), hsl(var(--page)) 48%, hsl(225 58% 9%));
    font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 400;
    line-height: 1.6;
    text-rendering: geometricPrecision;
  }

  body.has-lightbox {
    overflow: hidden;
  }

  body::selection {
    color: hsl(var(--page-deep));
    background: hsl(var(--accent-cyan) / 0.9);
  }

  h1,
  h2,
  h3 {
    color: hsl(var(--white));
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.055em;
  }

  h1 em,
  h1 i,
  h1 .italic,
  h2 em,
  h2 i,
  h2 .italic,
  h3 em,
  h3 i,
  h3 .italic {
    font-family: "Source Serif 4", Georgia, serif;
    font-style: italic;
    font-weight: 400;
    color: hsl(var(--accent-cyan));
    text-shadow: 0 0 32px hsl(var(--accent-cyan) / 0.22), 0 0 48px hsl(var(--accent-violet) / 0.16);
    letter-spacing: -0.04em;
  }

  p {
    color: hsl(var(--white-muted) / 0.76);
  }

  :focus-visible {
    outline: 2px solid hsl(var(--accent-cyan) / 0.95);
    outline-offset: 4px;
  }
}

@layer components {
  .liquid-glass,
  .liquid-glass-strong {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.012));
    background-blend-mode: luminosity;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
    isolation: isolate;
  }

  .liquid-glass {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.16), 0 14px 36px rgba(0, 0, 0, 0.26);
  }

  .liquid-glass-strong {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.018));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow:
      0 18px 70px rgba(0, 0, 0, 0.35),
      inset 0 1px 1px rgba(255, 255, 255, 0.2);
  }

  .liquid-glass::before,
  .liquid-glass-strong::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: inherit;
    padding: 1.4px;
    pointer-events: none;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
  }

  .liquid-glass::before {
    background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.5) 0%,
      rgba(255, 255, 255, 0.14) 20%,
      transparent 45%,
      transparent 60%,
      rgba(255, 255, 255, 0.12) 82%,
      rgba(255, 255, 255, 0.34) 100%
    );
  }

  .liquid-glass-strong::before {
    background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.6) 0%,
      rgba(255, 255, 255, 0.2) 20%,
      transparent 45%,
      transparent 60%,
      rgba(255, 255, 255, 0.16) 82%,
      rgba(255, 255, 255, 0.42) 100%
    );
  }

  .liquid-glass > *,
  .liquid-glass-strong > * {
    position: relative;
    z-index: 3;
  }

  .icon {
    width: 1.1rem;
    height: 1.1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .button,
  .contact-link,
  .nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
  }

  .button {
    min-height: 3.15rem;
    padding: 0.85rem 1.15rem;
    color: hsl(var(--white));
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: -0.01em;
  }

  .button-primary {
    background: linear-gradient(135deg, hsl(var(--accent-cyan) / 0.28), hsl(var(--accent-violet) / 0.3) 56%, hsl(var(--accent-gold) / 0.2));
    box-shadow: 0 0 32px hsl(var(--accent-cyan) / 0.18);
  }

  .button-secondary {
    color: hsl(var(--white-soft) / 0.88);
  }

  .interactive {
    transform-origin: center;
    transition: transform 220ms ease, color 220ms ease, opacity 220ms ease, background 220ms ease;
  }

  .interactive:hover {
    transform: scale(1.05);
  }

  .icon-button,
  .social-link,
  .card-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: linear-gradient(135deg, hsl(var(--accent-cyan) / 0.18), hsl(var(--accent-violet) / 0.14));
    box-shadow: inset 0 1px 0 hsl(var(--white) / 0.14), 0 0 20px hsl(var(--accent-cyan) / 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .icon-button {
    color: hsl(var(--white));
    cursor: pointer;
    border: none;
  }

  .social-link {
    color: hsl(var(--white));
    transition: color 220ms ease, transform 220ms ease;
  }

  .social-link:hover {
    color: hsl(var(--accent-cyan));
  }

  .eyebrow,
  .section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: fit-content;
    color: hsl(var(--accent-cyan) / 0.88);
    font-size: 0.74rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }

  .eyebrow {
    padding: 0.55rem 0.72rem;
  }
}

@layer layout {
  .icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
  }

  .video-background {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: hsl(var(--black));
  }

  .video-background video,
  .video-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  .video-background video {
    object-fit: cover;
    filter: saturate(1.18) contrast(1.08) brightness(0.74) hue-rotate(8deg);
    opacity: 0.94;
  }

  .video-overlay {
    background:
      radial-gradient(circle at 18% 10%, hsl(var(--accent-cyan) / 0.24), transparent 32%),
      radial-gradient(circle at 80% 18%, hsl(var(--accent-violet) / 0.22), transparent 30%),
      radial-gradient(circle at 55% 75%, hsl(var(--accent-gold) / 0.08), transparent 36%),
      linear-gradient(180deg, hsl(var(--page-deep) / 0.24), hsl(var(--page) / 0.72) 58%, hsl(var(--black) / 0.88));
  }

  .cursor-glow {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 2;
    width: 18rem;
    height: 18rem;
    pointer-events: none;
    opacity: 0.32;
    transform: translate3d(-50%, -50%, 0);
    border-radius: 999px;
    background: radial-gradient(circle, hsl(var(--accent-cyan) / 0.24), hsl(var(--accent-violet) / 0.14) 36%, transparent 70%);
    filter: blur(22px);
  }

  .site-header {
    position: fixed;
    top: 1rem;
    left: 50%;
    z-index: 20;
    width: min(1120px, calc(100% - 2rem));
    min-height: 4rem;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.72rem 0.8rem 0.72rem 1rem;
  }

  .brand {
    display: inline-flex;
    align-items: center;
    gap: 0.72rem;
    color: hsl(var(--white));
    font-weight: 500;
  }

  .brand-mark {
    display: grid;
    width: 2.25rem;
    height: 2.25rem;
    place-items: center;
    border-radius: 999px;
    background: linear-gradient(135deg, hsl(var(--accent-cyan) / 0.22), hsl(var(--accent-violet) / 0.2));
    color: hsl(var(--white));
    box-shadow: 0 0 24px hsl(var(--accent-cyan) / 0.16);
    letter-spacing: -0.04em;
  }

  .brand-text {
    display: inline-block;
    font-size: 0.9rem;
  }

  .desktop-nav {
    display: flex;
    align-items: center;
    gap: 0.15rem;
  }

  .nav-link {
    min-height: 2.35rem;
    padding: 0 0.78rem;
    color: hsl(var(--white-soft) / 0.72);
    font-size: 0.82rem;
    font-weight: 500;
  }

  .nav-link:hover {
    color: hsl(var(--accent-cyan));
  }

  .menu-toggle {
    display: none;
  }

  .header-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
  }

  .lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2.35rem;
    padding: 0 0.78rem;
    color: hsl(var(--white-soft) / 0.86);
    background: hsl(var(--white) / 0.06);
    border: 1px solid hsl(var(--accent-cyan) / 0.18);
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    transition: transform 220ms ease, color 220ms ease, border-color 220ms ease,
      background 220ms ease, box-shadow 220ms ease;
  }

  .lang-toggle .icon {
    width: 0.95rem;
    height: 0.95rem;
    color: hsl(var(--accent-cyan) / 0.92);
  }

  .lang-toggle:hover,
  .lang-toggle:focus-visible {
    color: hsl(var(--white));
    background: linear-gradient(135deg, hsl(var(--accent-cyan) / 0.22), hsl(var(--accent-violet) / 0.2));
    border-color: hsl(var(--accent-cyan) / 0.46);
    box-shadow: 0 0 22px hsl(var(--accent-cyan) / 0.2);
  }

  html[lang="zh"] body {
    font-family: "Poppins", "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont,
      "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  }

  html[lang="zh"] h1 em,
  html[lang="zh"] h2 em,
  html[lang="zh"] h3 em,
  html[lang="zh"] h1 i,
  html[lang="zh"] h2 i,
  html[lang="zh"] h3 i {
    font-family: "Source Serif 4", "Noto Serif SC", "PingFang SC", "Songti SC", "STSong", Georgia, serif;
  }

  .mobile-nav {
    position: fixed;
    top: 5.6rem;
    left: 1rem;
    right: 1rem;
    z-index: 19;
    display: none;
    grid-template-columns: 1fr;
    gap: 0.25rem;
    padding: 0.6rem;
  }

  .mobile-nav.is-open {
    display: grid;
  }

  .site-shell {
    position: relative;
    z-index: 10;
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 8.6rem 0 4rem;
  }

  .hero {
    min-height: min(720px, calc(100vh - 5rem));
    align-items: center;
    padding: 3rem 0 3rem;
  }

  .section-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.72fr);
    gap: 2rem;
  }

  .hero-copy {
    display: grid;
    gap: 1.4rem;
  }

  .hero h1 {
    max-width: 780px;
    font-size: clamp(2.5rem, 6vw, 5.25rem);
  }

  .hero-lede {
    max-width: 690px;
    font-size: clamp(1rem, 2vw, 1.25rem);
  }

  .hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.78rem;
    margin-top: 0.35rem;
  }

  .hero-panel,
  .content-card,
  .expertise-card,
  .lab-card,
  .timeline-item,
  .info-card,
  .contact-section {
    padding: clamp(1.15rem, 2vw, 1.6rem);
  }

  .hero-panel {
    align-self: center;
    display: grid;
    gap: 1.15rem;
  }

  .panel-topline,
  .timeline-year,
  .number,
  .role {
    color: hsl(var(--accent-cyan) / 0.72);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .hero-panel h2 {
    font-size: clamp(1.8rem, 3vw, 2.6rem);
  }

  .stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.7rem;
  }

  .stats-grid div {
    min-height: 5.4rem;
    padding: 0.9rem;
    border-radius: calc(var(--radius) * 0.75);
    background: linear-gradient(135deg, hsl(var(--accent-cyan) / 0.11), hsl(var(--accent-violet) / 0.09));
    border: 1px solid hsl(var(--white) / 0.06);
  }

  .stats-grid strong {
    display: block;
    color: hsl(var(--accent-gold));
    font-size: 1.6rem;
    font-weight: 500;
    line-height: 1;
  }

  .stats-grid span,
  .quick-list {
    color: hsl(var(--white-muted) / 0.66);
    font-size: 0.78rem;
  }

  .quick-list {
    display: grid;
    gap: 0.42rem;
  }

  .quick-list li {
    padding-left: 1rem;
    position: relative;
  }

  .quick-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.7em;
    width: 0.35rem;
    height: 0.35rem;
    border-radius: 999px;
    background: hsl(var(--accent-cyan) / 0.8);
    box-shadow: 0 0 12px hsl(var(--accent-cyan) / 0.75);
  }

  .content-section {
    padding: 3.2rem 0;
  }

  .section-heading {
    display: grid;
    gap: 1rem;
    align-content: start;
    margin-bottom: 2.6rem;
  }

  .section-heading h2,
  .contact-section h2 {
    max-width: 760px;
    font-size: clamp(2.3rem, 5vw, 4.9rem);
  }

  .content-card {
    display: grid;
    gap: 1rem;
    font-size: 1rem;
  }

  .card-grid {
    display: grid;
    gap: 1rem;
  }

  .three-columns {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .expertise-card {
    min-height: 14rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
  }

  .expertise-card h3,
  .lab-card h3,
  .timeline-content h3,
  .info-card h3 {
    font-size: 1.35rem;
    letter-spacing: -0.035em;
  }

  .tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .tag-list li {
    padding: 0.42rem 0.62rem;
    color: hsl(var(--white-soft) / 0.78);
    background: hsl(var(--accent-cyan) / 0.08);
    border: 1px solid hsl(var(--accent-cyan) / 0.1);
    border-radius: 999px;
    font-size: 0.76rem;
  }

  .software-toolkit {
    margin-top: 1.5rem;
    padding: 2rem 2.2rem;
    display: grid;
    gap: 1.6rem;
  }

  .software-toolkit-heading {
    display: grid;
    gap: 0.5rem;
    max-width: 48rem;
  }

  .software-toolkit-heading h3 {
    font-size: 1.5rem;
    letter-spacing: -0.035em;
  }

  .software-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8.2rem, 1fr));
    gap: 0.85rem;
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .software-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 1rem 0.6rem;
    border-radius: 16px;
    background: linear-gradient(160deg, hsl(var(--white) / 0.05), hsl(var(--white) / 0.015));
    border: 1px solid hsl(var(--white) / 0.08);
    text-align: center;
    transition: transform 260ms ease, border-color 260ms ease, background 260ms ease, box-shadow 260ms ease;
  }

  .software-tile:hover {
    transform: translateY(-3px);
    border-color: hsl(var(--accent-cyan) / 0.35);
    background: linear-gradient(160deg, hsl(var(--accent-cyan) / 0.08), hsl(var(--accent-violet) / 0.06));
    box-shadow: 0 14px 32px -18px hsl(var(--accent-cyan) / 0.55), inset 0 1px 0 hsl(var(--white) / 0.12);
  }

  .software-logo {
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 12px;
    display: block;
    box-shadow: 0 8px 22px -14px hsl(0 0% 0% / 0.75);
  }

  .software-name {
    font-size: 0.82rem;
    font-weight: 500;
    color: hsl(var(--white) / 0.9);
    letter-spacing: -0.01em;
    line-height: 1.25;
  }

  .gallery-section {
    position: relative;
  }

  .gallery-section::before {
    content: "";
    position: absolute;
    inset: 2rem -7vw auto;
    height: 30rem;
    z-index: -1;
    background:
      radial-gradient(circle at 30% 40%, hsl(var(--accent-cyan) / 0.18), transparent 36%),
      radial-gradient(circle at 70% 52%, hsl(var(--accent-magenta) / 0.16), transparent 34%);
    filter: blur(18px);
    opacity: 0.78;
    pointer-events: none;
  }

  .gallery-heading {
    align-items: end;
    margin-bottom: 1.3rem;
  }

  .gallery-intro {
    align-self: end;
    display: grid;
    gap: 1.15rem;
    padding: clamp(1rem, 2vw, 1.35rem);
  }

  .gallery-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .gallery-filter {
    min-height: 2.2rem;
    padding: 0.45rem 0.72rem;
    color: hsl(var(--white-soft) / 0.76);
    background: hsl(var(--white) / 0.05);
    border: 1px solid hsl(var(--accent-cyan) / 0.12);
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: transform 220ms ease, color 220ms ease, border-color 220ms ease, background 220ms ease, box-shadow 220ms ease;
  }

  .gallery-filter:hover,
  .gallery-filter.is-active {
    color: hsl(var(--white));
    background: linear-gradient(135deg, hsl(var(--accent-cyan) / 0.22), hsl(var(--accent-violet) / 0.2));
    border-color: hsl(var(--accent-cyan) / 0.42);
    box-shadow: 0 0 22px hsl(var(--accent-cyan) / 0.18);
    transform: translateY(-2px);
  }

  .gallery-grid {
    display: grid;
    grid-auto-flow: dense;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1rem;
  }

  .gallery-card {
    min-height: 20rem;
    grid-column: span 2;
    position: relative;
    display: grid;
    align-content: end;
    padding: 1rem;
    color: hsl(var(--white));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: calc(var(--radius) * 1.15);
    overflow: hidden;
    isolation: isolate;
    cursor: pointer;
    background: hsl(var(--surface) / 0.5);
    box-shadow:
      0 22px 70px hsl(var(--black) / 0.26),
      inset 0 1px 1px rgba(255, 255, 255, 0.16);
    transform: translateZ(0);
  }

  .gallery-card.is-hidden {
    display: none;
  }

  .gallery-card[data-layout="wide"] {
    grid-column: span 4;
    min-height: 24rem;
  }

  .gallery-card[data-layout="tall"] {
    grid-row: span 2;
    min-height: 41rem;
  }

  .gallery-card::before,
  .gallery-card::after {
    content: "";
    position: absolute;
    pointer-events: none;
  }

  .gallery-card::before {
    inset: 0;
    z-index: 2;
    background:
      linear-gradient(180deg, transparent 24%, hsl(var(--page-deep) / 0.2) 56%, hsl(var(--black) / 0.84)),
      radial-gradient(circle at var(--gallery-x, 50%) var(--gallery-y, 50%), hsl(var(--accent-cyan) / 0.24), transparent 28%);
    opacity: 0.94;
    transition: opacity 260ms ease;
  }

  .gallery-card-frame {
    position: absolute;
    inset: 0;
    z-index: 3;
    border-radius: inherit;
    pointer-events: none;
  }

  .gallery-card-frame::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.4px;
    pointer-events: none;
    background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.6) 0%,
      rgba(255, 255, 255, 0.2) 20%,
      transparent 45%,
      transparent 60%,
      rgba(255, 255, 255, 0.16) 82%,
      rgba(255, 255, 255, 0.42) 100%
    );
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
  }

  .gallery-card::after {
    inset: -1px;
    z-index: 4;
    border-radius: inherit;
    background: linear-gradient(125deg, hsl(var(--accent-cyan) / 0.74), transparent 35%, hsl(var(--accent-violet) / 0.62), transparent 66%, hsl(var(--accent-gold) / 0.66));
    opacity: 0;
    mix-blend-mode: screen;
    transition: opacity 260ms ease;
  }

  .gallery-card:hover::after,
  .gallery-card:focus-visible::after {
    opacity: 0.34;
  }

  .gallery-card:hover .gallery-media,
  .gallery-card:focus-visible .gallery-media {
    transform: scale(1.08);
    filter: saturate(1.2) contrast(1.08);
  }

  .gallery-media {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(0.96) contrast(1.02) brightness(0.86);
    transition: transform 900ms cubic-bezier(0.2, 0.75, 0.2, 1), filter 420ms ease;
  }

  .gallery-card-copy {
    position: relative;
    z-index: 5;
    display: grid;
    gap: 0.52rem;
  }

  .gallery-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .gallery-category,
  .gallery-type {
    width: fit-content;
    color: hsl(var(--accent-cyan) / 0.92);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.13em;
    text-transform: uppercase;
  }

  .gallery-type {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: hsl(var(--accent-gold) / 0.95);
  }

  .gallery-card h3 {
    max-width: 16ch;
    font-size: clamp(1.55rem, 3vw, 2.5rem);
    letter-spacing: -0.055em;
  }

  .gallery-card p {
    max-width: 42rem;
    color: hsl(var(--white-soft) / 0.78);
    font-size: 0.9rem;
  }

  .gallery-card-action {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    width: fit-content;
    margin-top: 0.25rem;
    color: hsl(var(--white));
    font-size: 0.82rem;
    font-weight: 600;
  }

  .gallery-empty {
    grid-column: 1 / -1;
    padding: 1.5rem;
  }

  .gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: none;
    place-items: center;
    padding: clamp(1rem, 3vw, 2rem);
  }

  .gallery-lightbox.is-open {
    display: grid;
  }

  .gallery-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background:
      radial-gradient(circle at 50% 0%, hsl(var(--accent-cyan) / 0.16), transparent 55%),
      hsl(var(--black) / 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  /* Card wraps the artwork: media is contained so the whole image/video
     always fits inside the viewport, and the copy floats over its bottom. */
  .gallery-lightbox-panel {
    position: relative;
    max-width: calc(100vw - 4rem);
    max-height: calc(100vh - 4rem);
    border-radius: clamp(0.8rem, 1.8vw, 1.4rem);
    overflow: hidden;
    background: hsl(var(--black) / 0.55);
    box-shadow:
      0 0 0 1px hsl(var(--white) / 0.08),
      0 40px 110px hsl(var(--black) / 0.7);
  }

  .gallery-lightbox-close {
    position: absolute;
    top: clamp(0.7rem, 1.6vw, 1.1rem);
    right: clamp(0.7rem, 1.6vw, 1.1rem);
    z-index: 6;
  }

  .gallery-lightbox-media {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 100%;
  }

  .gallery-lightbox-media img,
  .gallery-lightbox-media video {
    display: block;
    width: auto;
    height: auto;
    max-width: calc(100vw - 4rem);
    max-height: calc(100vh - 4rem);
  }

  .gallery-lightbox-media .gallery-empty {
    min-width: min(80vw, 22rem);
    min-height: 14rem;
  }

  /* Multi-image stack: vertically scrollable column. Mouse wheel browses
     naturally through each artwork. */
  .gallery-lightbox.is-lightbox-multi .gallery-lightbox-panel {
    width: min(90vw, 56rem);
  }

  .gallery-lightbox-stack {
    width: 100%;
    max-width: calc(100vw - 4rem);
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.4rem;
    scroll-snap-type: y proximity;
    scrollbar-width: thin;
    scrollbar-color: hsl(var(--accent-cyan) / 0.5) transparent;
  }

  .gallery-lightbox-stack::-webkit-scrollbar {
    width: 8px;
  }

  .gallery-lightbox-stack::-webkit-scrollbar-thumb {
    background: hsl(var(--accent-cyan) / 0.45);
    border-radius: 999px;
  }

  .gallery-lightbox-stack::-webkit-scrollbar-track {
    background: transparent;
  }

  .gallery-lightbox-stack img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: none;
    object-fit: contain;
    scroll-snap-align: start;
    border-radius: calc(var(--radius) * 0.6);
    background: hsl(var(--black) / 0.34);
  }

  .gallery-lightbox-count {
    position: absolute;
    top: clamp(0.7rem, 1.6vw, 1.1rem);
    left: clamp(0.7rem, 1.6vw, 1.1rem);
    z-index: 5;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: hsl(var(--accent-cyan));
    background: hsl(var(--black) / 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    pointer-events: none;
  }

  .gallery-lightbox-copy {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4;
    display: grid;
    justify-items: start;
    gap: 0.4rem;
    padding: clamp(0.9rem, 2.4vw, 1.6rem);
    padding-top: clamp(1.6rem, 4vw, 3.2rem);
    background: linear-gradient(
      to top,
      hsl(var(--black) / 0.86) 0%,
      hsl(var(--black) / 0.45) 58%,
      hsl(var(--black) / 0)
    );
  }

  .gallery-lightbox.is-lightbox-video .gallery-lightbox-copy {
    top: 0;
    bottom: auto;
    padding-top: clamp(0.9rem, 2.4vw, 1.6rem);
    padding-bottom: clamp(1.6rem, 4vw, 3.2rem);
    background: linear-gradient(
      to bottom,
      hsl(var(--black) / 0.86) 0%,
      hsl(var(--black) / 0.45) 58%,
      hsl(var(--black) / 0)
    );
  }

  .gallery-lightbox-copy h3 {
    margin: 0;
    max-width: 24ch;
    font-size: clamp(1.35rem, 2.8vw, 2.2rem);
    line-height: 1.12;
    color: hsl(var(--white));
    text-shadow: 0 2px 18px hsl(var(--black) / 0.85);
  }

  #gallery-lightbox-description {
    margin: 0;
    max-width: 58ch;
    color: hsl(var(--white) / 0.85);
    text-shadow: 0 1px 12px hsl(var(--black) / 0.8);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
  }

  .gallery-lightbox-kicker {
    margin: 0;
    color: hsl(var(--accent-cyan));
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-shadow: 0 1px 10px hsl(var(--black) / 0.7);
  }

  #gallery-lightbox-link {
    margin-top: 0.35rem;
  }

  #gallery-lightbox-link[hidden] {
    display: none;
  }

  .lab-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
  }

  .lab-card {
    min-height: 18rem;
    display: grid;
    align-content: space-between;
    gap: 1.5rem;
  }

  .lab-card p {
    font-size: 0.92rem;
  }

  .timeline {
    position: relative;
    display: grid;
    gap: 1rem;
  }

  .timeline::before {
    content: "";
    position: absolute;
    left: 8.2rem;
    top: 1.6rem;
    bottom: 1.6rem;
    width: 1px;
    background: linear-gradient(180deg, transparent, hsl(var(--accent-cyan) / 0.5), hsl(var(--accent-violet) / 0.36), transparent);
    transform-origin: top;
  }

  .timeline-item {
    display: grid;
    grid-template-columns: 8rem 1fr;
    gap: 2rem;
  }

  .timeline-content {
    display: grid;
    gap: 0.5rem;
  }

  .timeline-content h3 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
  }

  /* Company logos: any source color is forced to a clean white
     silhouette so it matches the company-name text on the dark theme. */
  .company-logo {
    height: 1.45rem;
    width: auto;
    max-width: 7rem;
    flex-shrink: 0;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 0.92;
  }

  .stacked-cards {
    display: grid;
    gap: 1rem;
  }

  .info-card {
    display: grid;
    gap: 0.55rem;
  }

  .contact-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.48fr);
    gap: 2rem;
    align-items: end;
    margin: 4rem 0 2rem;
  }

  .contact-actions {
    display: grid;
    gap: 0.75rem;
    justify-items: start;
  }

  .contact-link {
    color: hsl(var(--white-soft) / 0.78);
    font-weight: 500;
  }

  .contact-link:hover {
    color: hsl(var(--accent-cyan));
  }

  .social-row {
    display: flex;
    gap: 0.65rem;
    grid-column: 2;
  }

  .site-footer {
    position: relative;
    z-index: 10;
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 0 0 2rem;
    color: hsl(var(--white-muted) / 0.56);
    font-size: 0.82rem;
  }
}

@layer utilities {
  .text-white {
    color: hsl(var(--white));
  }

  .text-white-80 {
    color: hsl(var(--white) / 0.8);
  }

  .text-white-60 {
    color: hsl(var(--white) / 0.6);
  }

  .text-white-50 {
    color: hsl(var(--white) / 0.5);
  }

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

@media (max-width: 980px) {
  .desktop-nav {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .section-grid,
  .contact-section {
    grid-template-columns: 1fr;
  }

  .three-columns,
  .lab-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-card,
  .gallery-card[data-layout="wide"],
  .gallery-card[data-layout="tall"] {
    grid-column: span 1;
    grid-row: auto;
    min-height: 24rem;
  }

  .social-row {
    grid-column: auto;
  }
}

@media (max-width: 680px) {
  .site-header {
    top: 0.75rem;
    width: calc(100% - 1.5rem);
  }

  .brand-text {
    display: none;
  }

  .lang-toggle {
    padding: 0 0.6rem;
    min-height: 2.1rem;
    font-size: 0.74rem;
  }

  .lang-toggle .icon {
    width: 0.85rem;
    height: 0.85rem;
  }

  .site-shell {
    width: min(100% - 1.4rem, 1120px);
    padding-top: 7.6rem;
  }

  .hero {
    padding-top: 2rem;
  }

  .hero h1 {
    font-size: clamp(2.1rem, 11vw, 3.4rem);
  }

  .hero-actions,
  .stats-grid,
  .three-columns,
  .lab-grid,
  .gallery-grid,
  .timeline-item {
    grid-template-columns: 1fr;
  }

  .gallery-card,
  .gallery-card[data-layout="wide"],
  .gallery-card[data-layout="tall"] {
    min-height: 22rem;
  }

  .gallery-card {
    padding: 0.9rem;
  }

  .hero-actions {
    display: grid;
  }

  .timeline::before {
    left: 0.45rem;
  }

  .timeline-item {
    padding-left: 1.25rem;
    gap: 0.6rem;
  }

  .timeline-year {
    order: -1;
  }

  .content-section {
    padding: 2.6rem 0;
  }

  .contact-section {
    margin-top: 2.4rem;
  }
}