.context-hero {
  position: relative;
  display: grid;
  min-height: 100svh;
  overflow: hidden;
  background: var(--background);
}

.context-hero-copy {
  position: relative;
  z-index: 1;
  align-self: center;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 100px 36px;
  text-align: center;
  pointer-events: none;
  text-shadow: 0 0 8px var(--background), 0 0 16px var(--background);
}

.context-hero-eyebrow {
  margin: 0 0 25px;
  color: #536578;
  font: 500 12px/1.5 Arial, sans-serif;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.context-hero .context-hero-headline {
  margin: 0;
  color: #0b1f3a;
  font: 400 clamp(40px, 5.5vw, 76px)/1.12 Cambria, Georgia, serif;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.context-hero .context-hero-headline span {
  display: block;
}

.context-hero .context-hero-headline span + span {
  margin-top: 6px;
  color: #0a7a76;
}

.context-hero-description {
  max-width: 620px;
  margin: 28px auto 0;
  color: #415564;
  font: 400 17px/1.7 Calibri, "Segoe UI", Arial, sans-serif;
  text-wrap: pretty;
}

@media (max-width: 600px) {
  .context-hero-copy { padding: 80px 24px; }
  .context-hero-eyebrow { max-width: 260px; margin: 0 auto 24px; font-size: 11px; }
  .context-hero .context-hero-headline { font-size: clamp(35px, 8.6vw, 48px); }
  .context-hero .context-hero-headline span + span { margin-top: 14px; }
  .context-hero-description { max-width: 360px; margin-top: 25px; font-size: 16px; line-height: 1.65; }
}

.context-hero {
  --entrance-bottom: 40px;
  --copy-travel: calc(50svh - 67px);
  --copy-end-scale: 0.3;
  --copy-morph-duration: 2000ms;
  --copy-morph-easing: cubic-bezier(0.45, 0, 0.2, 1);
}

.context-hero[data-revealed="true"] .context-hero-copy {
  animation: context-copy-settle var(--copy-morph-duration) var(--copy-morph-easing) both, context-copy-dissolve 750ms ease-in-out 800ms both;
  transform-origin: center;
  will-change: transform, opacity;
}

@keyframes context-copy-settle {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(0, var(--copy-travel), 0) scale(var(--copy-end-scale)); }
}

@keyframes context-copy-dissolve {
  from { opacity: 1; }
  to { opacity: 0; }
}

.context-hero-entrance {
  position: absolute;
  z-index: 3;
  bottom: max(var(--entrance-bottom), env(safe-area-inset-bottom));
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.context-hero-enter {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  padding: 0 28px;
  border-radius: 7px;
  color: #fff;
  font: 500 17px/1.3 Calibri, "Segoe UI", Arial, sans-serif;
  text-decoration: none;
  pointer-events: auto;
}

.context-hero-enter::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  background: #0a7a76;
  transition: background 180ms ease;
}

.context-hero-enter:hover::before { background: #096b68; }
.context-hero-enter:focus-visible { outline: 3px solid #0b1f3a; outline-offset: 5px; }

/* The outgoing copy and incoming button share one center, path, and clock. */
[data-entrance="morph"] .context-hero-enter {
  animation: context-entrance-travel var(--copy-morph-duration) var(--copy-morph-easing) both, context-entrance-enable 1350ms step-end both;
  will-change: transform;
}

[data-entrance="morph"] .context-hero-enter::before {
  animation: context-entrance-appear 850ms ease-in-out 950ms both;
}

[data-entrance="morph"] .context-hero-enter > span {
  animation: context-entrance-appear 650ms ease-in-out 1350ms both;
}

@keyframes context-entrance-travel {
  from { transform: translate3d(0, calc(-1 * var(--copy-travel)), 0); }
  to { transform: translate3d(0, 0, 0); }
}

/* Do not turn a second click on the fading headline into early navigation. */
@keyframes context-entrance-enable {
  from { pointer-events: none; }
  to { pointer-events: auto; }
}

@keyframes context-entrance-appear {
  from { opacity: 0; }
  to { opacity: 1; }
}

[data-entrance="fallback"] .context-hero-enter {
  animation: context-entrance-label 650ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes context-entrance-label {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Keyboard users can discover the reveal without a permanent instruction. */
.context-hero-reveal-trigger {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.context-hero-reveal-trigger:focus-visible {
  z-index: 4;
  width: auto;
  height: auto;
  padding: 10px 16px;
  clip-path: none;
  border-radius: 6px;
  background: #0a7a76;
  color: #fff;
  outline: 3px solid #0b1f3a;
  outline-offset: 4px;
  font: 500 15px/1.4 Arial, sans-serif;
}

@media (max-width: 600px) {
  .context-hero { --entrance-bottom: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .context-hero[data-revealed="true"] .context-hero-copy { animation: none; opacity: 0; }
  .context-hero-enter,
  .context-hero-enter::before,
  .context-hero-enter > span { animation: none !important; transition: none; }
}

/* Integration: retain the prototype palette inside the intro only. */
.context-hero {
  --background: oklch(0.975 0.006 180);
  --field-ink: #b4c3d0;
  --field-accent: #0a7a76;
  --sig-note: #0b1f3a;
  --sig-lab: #0a7a76;
  --sig-med: #3f9580;
  --sig-imaging: #24566a;
  --sig-vitals: #86c5b3;
  --sig-genomics: #9eafc0;
  position: fixed;
  inset: 0;
  z-index: 50;
  height: 100svh;
  min-height: 0;
}
.context-hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.context-hero-reveal-trigger { border: 0; }
.context-hero-enter { border: 0; cursor: pointer; background: transparent; }
.intro-pending, .intro-active { overflow: hidden; }
.intro-pending .site-content { visibility: hidden; }
.intro-active .site-content { visibility: hidden; }
.intro-entering .site-content { visibility: visible; }
.site-content { background: var(--paper); }
/* Reserve the scrollbar space before entry so text does not shift at the end. */
html { scrollbar-gutter: stable; }
.intro-entering .context-hero, .intro-entering .site-content { will-change: transform, opacity; }
