:root {
  scrollbar-gutter: stable;
  --atmosphere: 14 29 49;
  --atmosphere-glow: 38 76 112;
  --deep-space: 7 17 34;
  --deep-glow: 20 56 94;
  --gradient-space: 16 26 43;
  --gradient-glow: 32 63 94;
}
:root.light {
  --atmosphere: 232 243 255;
  --atmosphere-glow: 184 220 250;
  --deep-space: 11 27 52;
  --deep-glow: 29 70 117;
  --gradient-space: 250 252 255;
  --gradient-glow: 222 239 253;
}
main section:is(#home, #about, #doctor-journey) { --environment: var(--atmosphere); --environment-glow: var(--atmosphere-glow); }
#imaging { --environment: var(--deep-space); --environment-glow: var(--deep-glow); }
main section:is(#workflow, #professionals, #features, #security, #contact) { --environment: var(--gradient-space); --environment-glow: var(--gradient-glow); }
main section:is(#home, #about, #doctor-journey, #imaging, #workflow, #professionals, #features, #security, #contact) {
  isolation: isolate;
  border-color: transparent;
  background:
    radial-gradient(ellipse at var(--wave-x, 73%) var(--wave-y, 62%), rgb(var(--environment-glow) / .66), transparent 66%),
    rgb(var(--environment));
}
#imaging, :root.light #imaging {
  --surface-container-low: 20 34 57;
  --surface-container: 23 39 62;
  --surface-container-high: 35 54 80;
  --on-surface: 226 237 254;
  --on-surface-variant: 183 202 226;
  --primary: 155 204 255;
  --tertiary: 114 216 248;
  --outline-variant: 76 107 144;
  color-scheme: dark;
  color: rgb(var(--on-surface));
}
main section[data-chapter]::after { display: none; }
.story-seam {
  position: absolute;
  z-index: -1;
  inset: -1px 0 auto;
  width: 100%;
  height: clamp(45px, 9vw, 132px);
  pointer-events: none;
  color: rgb(var(--chapter-color) / .54);
  background: linear-gradient(to bottom, rgb(var(--from-environment, var(--environment)) / .96), transparent);
}
.story-seam svg { display: block; width: 100%; height: 100%; overflow: visible; color: inherit; }
.story-seam path { fill: none; stroke: currentColor; stroke-width: 1; vector-effect: non-scaling-stroke; }
.story-seam path:nth-child(2) { opacity: .44; }
.story-seam path:nth-child(3) { opacity: .26; }
.story-seam path { stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--seam-progress, .85)); }
.story-seam circle { fill: currentColor; opacity: var(--seam-progress, .85); }
.story-seam.to-imaging { --from-environment: var(--atmosphere); }
.story-seam.to-workflow { --from-environment: var(--deep-space); }
.story-seam.to-workflow svg { color: #75b8f0d0; }
.workspace-seam { position: relative; height: 26px; margin: -7px 0 -9px; z-index: 0; background: none; }

.shared-anatomy {
  --viewer-size: min(540px, 100vw);
  position: fixed;
  inset: 0 auto auto 0;
  z-index: 34;
  width: var(--viewer-size);
  height: var(--viewer-size);
  transform-origin: center;
  transform: translate3d(-120vw, -120vh, 0);
  outline: 0;
  touch-action: pan-y;
  pointer-events: none;
  visibility: hidden;
  contain: layout paint;
}
.shared-anatomy.is-positioned { visibility: visible; }
.shared-anatomy.is-interactive { pointer-events: auto; cursor: grab; }
.shared-anatomy.is-interactive:active { cursor: grabbing; }
.shared-anatomy:focus-visible { outline: 2px solid #a8d5ff; outline-offset: -4px; border-radius: 20px; }
.shared-anatomy canvas { width: 100%; height: 100%; display: block; }
.shared-anatomy.is-expanded { z-index: 72; }
#imaging:has(.is-expanded) { z-index: 60; }
.anatomy-trail[inert] { visibility: hidden; }
.anatomy-slot img { transition: opacity .48s ease; }
.anatomy-story-live .anatomy-slot img { opacity: 0; pointer-events: none; }
.anatomy-story-live .trail-model { position: relative; }
.anatomy-story-live .trail-model:focus-visible { z-index: 1; }
.trail-view-icon { display: none; position: absolute; inset: 0; place-items: center; color: #d1eaff; font-size: 20px; }
.anatomy-story-live .trail-model:not([data-model-here]) .trail-view-icon { display: grid; }
.anatomy-story-live .anatomy-trail { z-index: 32; position: fixed; }
.anatomy-story-live .site-toast { z-index: 103; }
.tooth-tooltip {
  position: fixed;
  z-index: 74;
  max-width: min(220px, 48vw);
  padding: 7px 10px;
  border: 1px solid #8ac7ff68;
  border-radius: 8px;
  background: #101e34f5;
  box-shadow: 0 6px 21px #03081266;
  color: #eaf5ff;
  font-size: 11px;
  line-height: 1.4;
  pointer-events: none;
}
.tooth-tooltip small { display: block; color: #aac9e6; font-size: 10px; }
.hero-stage {
  background:
    radial-gradient(ellipse at 48% 43%, #759cca55 0, transparent 58%),
    linear-gradient(150deg, #203d5b, #102037 66%);
}
:root.light .hero-stage {
  color: #244e76;
  background:
    radial-gradient(ellipse at 43% 39%, #fff 2%, #def0fb 46%, transparent 80%),
    linear-gradient(140deg, #eef8ff, #b9d8ef);
}
:root.light .hero-stage .stage-meta a { color: #224f81; }
.hero-stage .stage-meta { z-index: 3; }
.stage-meta a, .story-visual a { position: relative; z-index: 35; }
.anatomy-markers {
  position: absolute;
  inset: 0;
  color: #c2deff;
  pointer-events: none;
}
:root.light .anatomy-markers { color: #2d5d87; }
.anatomy-markers span {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 600;
}
.anatomy-markers span::before { content: ""; width: 20px; height: 1px; opacity: .62; background: currentColor; }
.anatomy-markers span:nth-child(1) { top: 29%; right: 7%; }
.anatomy-markers span:nth-child(2) { top: 50%; left: 5%; }
.anatomy-markers span:nth-child(3) { bottom: 22%; right: 7%; }
.hero-visual .viewer-footer { gap: 9px; }
.hero-visual .dental-controls { gap: 5px; }
.hero-visual .dental-controls button { min-width: 39px; padding-inline: 8px; }
.hero-visual .dental-controls [data-command="spin"] { min-width: 64px; }
.hero-visual .viewer-hint { flex: 1 1 105px; }
.stitch-hero[data-in-view] .anatomy-orbit i,
[data-story-active] .story-visual::after { animation: story-embers 5s ease-in-out infinite alternate; }
@keyframes story-embers { 0% { opacity: .3; } 100% { opacity: .85; } }

.story-frame { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) clamp(235px, 24vw, 335px); gap: clamp(20px, 3vw, 40px); align-items: start; }
.story-content { min-width: 0; width: 100%; }
.story-visual {
  position: relative;
  min-width: 0;
  padding: 12px;
  margin-top: 6px;
  isolation: isolate;
  border-radius: 18px;
  border: 1px solid rgb(var(--outline-variant) / .42);
  background: radial-gradient(ellipse at 50% 53%, rgb(var(--chapter-color) / .14), transparent 72%), rgb(var(--surface) / .57);
  box-shadow: 0 15px 42px #0a2b5a12;
}
.story-visual.is-sticky { position: sticky; top: max(116px, calc(50svh - 190px)); }
.story-visual::after {
  content: "";
  position: absolute;
  inset: 12% 9% 14%;
  z-index: -1;
  border: 1px dashed rgb(var(--chapter-color) / .4);
  border-radius: 50%;
  transform: rotate(-19deg);
  pointer-events: none;
}
.story-visual .anatomy-slot {
  width: 100%;
  aspect-ratio: 1.04;
  display: grid;
  place-items: center;
  min-height: 0;
}
.story-visual .anatomy-slot img { width: 82%; height: 82%; object-fit: contain; }
.story-visual figcaption {
  position: relative;
  min-height: 34px;
  padding: 5px;
  color: rgb(var(--on-surface-variant));
  font-size: 11px;
  line-height: 1.45;
}
.story-visual figcaption strong { display: block; color: rgb(var(--on-surface)); font-size: 12px; }
.story-visual-note { color: rgb(var(--on-surface-variant)); }
.story-content > .grid { min-width: 0; }
.scene-keyboard:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  padding: 0;
  margin: -1px;
  clip-path: inset(50%);
  white-space: nowrap;
}
.dental-controls .scene-keyboard:not(:focus) { min-width: 0; min-height: 0; padding: 0; }
.scene-keyboard:focus { padding: 6px 10px; border-radius: 6px; background: rgb(var(--surface-container-high)); }
.story-workspace { max-width: 1280px; margin: clamp(24px, 4vw, 55px) auto 0; }
@media (min-width: 1120px) {
  #about .story-content > .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #doctor-journey .story-content > .grid:first-of-type { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #workflow .story-content > .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #imaging .imaging-layout { grid-template-columns: minmax(240px, 1fr) minmax(0, 2.3fr); }
  #imaging .imaging-stage { grid-column: 2; grid-row: 1; }
  #imaging .imaging-sidebar { grid-column: 1; grid-row: 1; }
  #contact .story-frame { align-items: center; }
  #contact .story-content { align-items: flex-start; text-align: left; }
  #contact .story-content > .flex { justify-content: flex-start; }
}
@media (max-width: 1119px) {
  .story-frame { display: block; }
  .story-visual { display: none; }
  #contact .story-visual { display: block; width: min(100%, 390px); margin: 24px auto 0; }
}
@media (max-width: 640px) {
  .shared-anatomy { --viewer-size: min(350px, 100vw); }
  .anatomy-markers span { font-size: 8px; }
  .anatomy-markers span::before { width: 8px; }
  .anatomy-markers span:nth-child(1), .anatomy-markers span:nth-child(3) { right: 3%; }
  .anatomy-markers span:nth-child(2) { left: 3%; }
  .hero-visual .viewer-hint { flex: 1 0 100%; }
  .hero-visual .dental-controls { justify-content: center; }
  .hero-visual .dental-controls button { min-width: 34px; min-height: 41px; padding-inline: 6px; }
  .anatomy-orbit i:nth-child(n+2) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .story-seam path { stroke-dashoffset: 0; }
  .story-visual::after, .anatomy-orbit i { animation: none !important; }
}
