/* Nece's laboratory frontispiece. Scoped to the existing header and hero. */
:root {
  --sc-canvas: var(--paper);
  --sc-surface: var(--paper-2);
  --sc-ink: var(--ink);
  --sc-ink-soft: var(--muted);
  --sc-accent: var(--accent);
  --sc-accent-ink: var(--accent-ink);
  --sc-font-display: var(--font-sans);
  --sc-font-text: var(--font-sans);
}
.site-header .nav { min-height: 5rem; }
.site-header .logo { height: 1.75rem; }
.site-header .nav-cta { padding: .9em 1.2em; }
.site-header .nav-toggle { min-height: 44px; }
.site-header .btn:active, .hero--lab .btn:active { transform: translateY(1px); }
.hero--lab { overflow: clip; isolation: isolate; }
.hero--lab::before { display: none; }
.hero--lab .hero-inner {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  min-height: min(740px, calc(100svh - 160px));
  gap: 0;
  align-items: center;
  padding-block: 2rem;
}
.hero--lab .hero-copy {
  position: relative;
  z-index: 2;
  grid-column: 1;
  gap: 0;
  margin-block: 1rem;
  width: max-content;
  max-width: 115%;
}
.hero--lab .eyebrow { font-size: .75rem; letter-spacing: .14em; margin-bottom: 2rem; }
.hero--lab h1 {
  margin: 0;
  font-size: clamp(3.25rem, 5.75vw, 6rem);
  font-weight: 500;
  font-stretch: normal;
  line-height: 1.04;
  letter-spacing: -.04em;
  text-wrap: initial;
}
.hero--lab .hero-title-second { color: var(--accent-text); font-weight: 400; font-style: italic; }
.hero--lab .lede {
  font-size: clamp(1rem, 1.15vw, 1.1875rem);
  line-height: 1.65;
  max-width: 43ch;
  margin-top: 2rem;
}
.hero--lab .cta-row { align-items: center; gap: 1.75rem; margin-top: 2rem; }
.hero--lab .btn { min-height: 48px; padding: 1rem 1.35rem; font-size: .875rem; gap: 1.5rem; }
.hero-work-link {
  display: inline-flex;
  align-items: center;
  gap: .9rem;
  min-height: 48px;
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
  text-underline-offset: 5px;
}
.hero-work-link:hover { text-decoration: underline; }
.hero-work-link:active { transform: translateY(1px); }
.lab-scene {
  grid-column: 2;
  position: relative;
  z-index: 1;
  width: 100%;
  height: min(620px, calc(100svh - 230px));
  margin-left: 0;
  aspect-ratio: 600 / 660;
}
.lab-scene::before {
  content: '';
  position: absolute;
  inset: 7% -3% 10% 2%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 55% 50%, #e9eddf 0%, #edf0e7 48%, transparent 72%);
  pointer-events: none;
}
.lab-registration {
  position: absolute;
  inset: 7% 0 9%;
  background-image: radial-gradient(#a5b199 .85px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse, #000 15%, transparent 65%);
  opacity: .6;
}
.lab-diagram { position: relative; width: 100%; height: 100%; overflow: visible; }
.lab-diagram [data-lab-glass], .lab-diagram [data-lab-liquid] { transform-box: view-box; }
.lab-guide { opacity: .75; }
.hero-footnote {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line);
  padding-block: 1.25rem;
  font-size: .75rem;
  color: var(--muted);
}
.hero-footnote a { display: flex; align-items: center; gap: 1rem; padding-block: .5rem; text-decoration: none; color: var(--ink); }
.hero-footnote a:hover { text-decoration: underline; text-underline-offset: 4px; }
/* Complete static content is the default; movement never gates the copy. */
.hero--lab [data-sc-cue] { opacity: 1 !important; transform: none !important; }
@media (min-width: 1600px) {
  .hero--lab .hero-inner { min-height: 780px; }
  .hero--lab h1 { font-size: 6rem; }
}
@media (min-width: 821px) and (max-height: 720px) {
  .hero--lab .hero-inner { min-height: 550px; padding-block: 2rem; }
  .lab-scene { width: 94%; margin-left: 4%; }
  .hero--lab h1 { font-size: clamp(3rem, 5.6vw, 5.5rem); }
}
@media (max-width: 1100px) and (min-width: 821px) {
  .hero--lab h1 { font-size: 5.6vw; }
  .hero--lab .lede { max-width: 36ch; }
  .hero--lab .cta-row { gap: 1rem; }
}
@media (max-width: 820px) {
  .site-header .nav { min-height: 4.5rem; }
  .site-header .logo { height: 1.5rem; }
  .hero--lab .hero-inner {
    grid-template-columns: 1fr;
    padding-top: 3rem;
    padding-bottom: 0;
    min-height: auto;
  }
  .hero--lab .hero-copy { grid-column: 1; margin: 0; width: 100%; max-width: 100%; }
  .hero--lab .eyebrow { margin-bottom: 1.5rem; }
  .hero--lab h1 { font-size: clamp(2.3rem, 6.9vw, 3.6rem); font-stretch: normal; letter-spacing: -.04em; }
  .hero--lab .lede { max-width: 46ch; font-size: 1rem; line-height: 1.6; margin-top: 1.25rem; }
  .hero--lab .cta-row { margin-top: 1.5rem; gap: 1.25rem; flex-wrap: nowrap; }
  .hero--lab .cta-row .btn { flex: none; font-size: .8125rem; padding: .9rem 1rem; gap: .75rem; }
  .hero-work-link { font-size: .8125rem; gap: .5rem; }
  .lab-scene { grid-column: 1; height: auto; width: min(100%, 400px); margin: -1.5rem auto -1.5rem; aspect-ratio: 600 / 490; }
  .lab-diagram { width: 100%; height: 100%; object-fit: contain; }
  .lab-scene::before { inset: 10% 0; }
  .hero-footnote { padding-block: .75rem; font-size: .75rem; }
  .hero-footnote p { max-width: 22ch; }
}
@media (max-width: 390px) {
  .hero--lab .hero-inner { padding-top: 2rem; }
  .hero--lab h1 { font-size: 10.05vw; }
  .hero--lab .cta-row { gap: 1rem; }
  .lab-scene { max-width: 310px; margin-block: -1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .hero--lab [data-sc-parallax], .hero--lab [data-lab-bit] { transform: none !important; }
  .hero--lab .btn:active, .hero-work-link:active { transform: none; }
}

@media (max-width: 820px) {
  html:not(.js) .site-header .nav { padding-block: 1rem; }
  html:not(.js) .site-header .nav-toggle { display: none; }
  html:not(.js) .site-header .nav-links { display: flex; flex-direction: row; flex-wrap: wrap; justify-content: space-between; padding-bottom: .5rem; }
  html:not(.js) .site-header .nav-links a { padding: .5rem 0; font-size: .875rem; }
}
@media (prefers-reduced-motion: reduce) { .hero--lab [data-lab-bit] { opacity: 0 !important; } }

/* A live experiment: bubbles rise through the compound and break at its surface. */
.lab-bubble {
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
  animation: lab-bubble-rise var(--duration, 4s) linear infinite;
  animation-delay: var(--delay, 0s);
  animation-play-state: paused;
}
.lab-meniscus {
  transform-box: view-box;
  transform-origin: 300px 400px;
  animation: lab-surface 5s ease-in-out infinite;
  animation-play-state: paused;
}
.lab-scene[data-lab-active="true"] .lab-bubble,
.lab-scene[data-lab-active="true"] .lab-meniscus { animation-play-state: running; }
.mark-bubble {
  opacity: .8;
  animation: mark-bubble-rise 3.4s linear infinite;
  animation-delay: -1.5s;
}
.mark-bubble--second { animation-duration: 4.2s; animation-delay: -3s; }
html[data-page-hidden="true"] .mark-bubble { animation-play-state: paused; }
@keyframes lab-bubble-rise {
  0% { opacity: 0; transform: translate(0, 0) scale(.7); }
  12% { opacity: .65; }
  78% { opacity: .8; }
  94%, 100% { opacity: 0; transform: translate(var(--drift, 6px), -101px) scale(1.15); }
}
@keyframes lab-surface {
  0%, 100% { transform: translateY(0) scaleY(1); }
  50% { transform: translateY(2px) scaleY(.86); }
}
@keyframes mark-bubble-rise {
  0% { opacity: 0; transform: translateY(0); }
  20%, 70% { opacity: .9; }
  100% { opacity: 0; transform: translateY(-85px); }
}
@media (prefers-reduced-motion: reduce) {
  .lab-bubble, .lab-meniscus, .mark-bubble { animation: none; transform: none; }
  .lab-bubble { opacity: .5; }
}

/* Plain document links keep both language versions usable without JavaScript. */
.language-switch { display: inline-flex; align-items: center; gap: .25rem; flex: none; }
.language-switch a, .language-switch span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 32px;
  padding-inline: .25rem;
  font-family: var(--font-sans);
  font-size: .75rem;
  line-height: 1;
  text-decoration: none;
}
.language-switch a { color: var(--muted); }
.language-switch a:hover { color: var(--accent-text); text-decoration: underline; text-underline-offset: .4rem; }
.language-switch a:active { transform: translateY(1px); }
.language-current { color: var(--accent-text); font-weight: 500; }
@media (max-width: 820px) {
  .site-header .language-switch { margin-left: auto; }
  .site-header .nav-toggle { margin-left: 0; }
}
