.hero-animation {
  --bg: var(--_triomics---colors--bone, #efede6);
  --ink: var(--_triomics---colors--obsidian, #11130f);
  --muted: var(--_triomics---colors--bone-600, #666562);
  --accent: var(--_triomics---colors--tangerine, #fa5928);
  --border-color: var(--_triomics---stroke--light, #cbc8be);
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border-color);
  box-sizing: border-box;
  font-family: var(--font-family--mono, "Sohne Mono", "IBM Plex Mono", ui-monospace, Menlo, monospace);
  /* Enable both cqw and cqh units inside this component. */
  container-type: size;
}

.hero-canvas-host,
.hero-canvas-host canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.hero-trackers {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  z-index: 4;
  overflow: visible;
}

.hero-trackers .trk-node {
  fill: none;
  stroke: rgba(17, 17, 17, 0.55);
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}

.hero-trackers .trk-link {
  fill: none;
  stroke: rgba(17, 17, 17, 0.35);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

/* HTML labels live in their own host so they're never affected by the
   SVG's preserveAspectRatio="none" stretch. */
.hero-tracker-labels-host {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  overflow: visible;
  opacity: 0;
  transition: opacity 600ms ease-out;
}

.hero-tracker-label {
  position: absolute;
  top: 0;
  left: 0;
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 9px;
  background: var(--ink);
  color: var(--bg);
  font-size: 9.5px;
  line-height: 1;
  letter-spacing: 0.14em;
  white-space: nowrap;
  transform: translate3d(0, 0, 0);
  transition: opacity 500ms ease;
}

.hero-patient-portrait {
  position: absolute;
  top: 0;
  right: 0;
  width: 70cqh;
  height: 70cqh;
  aspect-ratio: 1 / 1;
  z-index: 5;
  pointer-events: none;
}

.hero-patient-portrait-img-wrap {
  position: absolute;
  top: -1px;
  right: -1px;
  bottom: 1px;
  left: 1px;
  overflow: hidden;
}

.hero-patient-portrait-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: left top;
  transform: scale(0, 0);
  transition: transform 520ms cubic-bezier(0.7, 0.04, 0.25, 1);
  filter: grayscale(1) contrast(1.05);
  border: 1px solid var(--border-color);
  box-sizing: border-box;
}

.hero-patient-portrait.swap .hero-patient-portrait-img-wrap img {
  transform: scale(0, 0);
}

.hero-patient-portrait.shown .hero-patient-portrait-img-wrap img {
  transform: scale(1, 1);
}

.hero-patient-portrait.shown.swap .hero-patient-portrait-img-wrap img {
  transform: scale(0, 0);
}

.hero-patient-portrait-mark {
  position: absolute;
  width: var(--hero-mark-size, 26px);
  height: var(--hero-mark-size, 26px);
  top: 0;
  left: 1px;
  background: var(--ink);
}

.hero-patient-portrait-accent {
  position: absolute;
  width: calc(var(--hero-mark-size, 26px) * 0.538);
  height: calc(var(--hero-mark-size, 26px) * 0.538);
  top: var(--hero-mark-size, 26px);
  left: var(--hero-mark-size, 26px);
  background: var(--accent);
}

.hero-patient-select {
  position: absolute;
  top: 0;
  right: calc(70cqh - 2px);
  z-index: 5;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--ink);
}

.hero-patient-trigger {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border-color);
  border-top: none;
  box-sizing: border-box;
  padding: 7px 10px;
  cursor: pointer;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
}

.hero-patient-select.open .hero-patient-trigger {
  border-bottom: none;
}

.hero-patient-trigger-label {
  color: var(--muted);
}

.hero-patient-trigger-value {
  color: var(--ink);
  position: relative;
  overflow: hidden;
  display: inline-block;
  height: 1em;
  line-height: 1em;
}

.hero-patient-trigger-value-inner {
  display: block;
  transform: translateY(0);
  transition: transform 360ms cubic-bezier(0.7, 0.04, 0.25, 1);
}

.hero-patient-trigger-value-next {
  position: absolute;
  top: 100%;
  left: 0;
  white-space: nowrap;
}

.hero-patient-trigger-value.swapping .hero-patient-trigger-value-inner,
.hero-patient-trigger-value.swapping .hero-patient-trigger-value-next {
  transform: translateY(-100%);
}

.hero-patient-trigger-caret {
  position: relative;
  width: 10px;
  height: 10px;
  margin-left: 2px;
  transform: rotate(180deg);
  transition: transform 220ms ease;
}

.hero-patient-trigger-caret::before,
.hero-patient-trigger-caret::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 1px;
  background: var(--ink);
  transform-origin: 0 50%;
}

.hero-patient-trigger-caret::before {
  transform: translate(-1px, -2px) rotate(45deg);
}

.hero-patient-trigger-caret::after {
  transform: translate(-1px, -2px) rotate(135deg);
}

.hero-patient-select.open .hero-patient-trigger-caret {
  transform: rotate(0deg);
}

.hero-patient-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1;
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--bg);
  border: 1px solid var(--border-color);
  box-sizing: border-box;
  box-shadow: 0 8px 24px rgba(17, 17, 17, 0.06);
  opacity: 0;
  transform: translateY(-100%);
  pointer-events: none;
  transition:
    transform 220ms cubic-bezier(0.7, 0.04, 0.25, 1),
    opacity 180ms ease;
}

.hero-patient-select.open .hero-patient-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.hero-patient-option {
  padding: 8px 12px;
  cursor: pointer;
  color: var(--ink);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-patient-option:not(:last-child) {
  border-bottom: 1px solid var(--border-color);
}

.hero-patient-option:hover {
  background: rgba(17, 17, 17, 0.06);
}

.hero-patient-option.selected {
  background: var(--ink);
  color: var(--bg);
}

.hero-patient-option-meta {
  color: var(--muted);
}

.hero-patient-option.selected .hero-patient-option-meta {
  color: rgba(239, 237, 230, 0.65);
}

.hero-mode-toggle {
  position: absolute;
  right: 0;
  bottom: 0;
  display: flex;
  background: var(--bg);
  box-shadow: 0 0 0 1px rgba(17, 17, 17, 0.08);
  z-index: 3;
  isolation: isolate;
  font-size: 11px;
  letter-spacing: 0.14em;
  transition: opacity 600ms ease;
}

.hero-mode-toggle:not(.active) {
  opacity: 0.42;
}

.hero-mode-toggle.active {
  border-top: 1px solid var(--border-color);
  border-left: 1px solid var(--border-color);
  border-bottom: 0;
  border-right: 0;
  box-shadow: none;
}

.hero-mode-indicator {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--ink);
  z-index: 0;
  opacity: 0;
  transition:
    transform 520ms cubic-bezier(0.7, 0.04, 0.25, 1),
    width 520ms cubic-bezier(0.7, 0.04, 0.25, 1),
    opacity 520ms cubic-bezier(0.7, 0.04, 0.25, 1);
}

.hero-mode-toggle.active .hero-mode-indicator {
  opacity: 1;
}

.hero-mode-btn {
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 8px 12px;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
  transition: color 520ms cubic-bezier(0.7, 0.04, 0.25, 1);
}

.hero-mode-toggle.active .hero-mode-btn.active {
  color: var(--bg);
}

@media (max-width: 768px) {
  .hero-animation {
    height: auto;
    aspect-ratio: 7 / 5;
  }

  .hero-patient-portrait {
    width: 33cqw;
    height: 33cqw;
  }

  .hero-patient-portrait-mark {
    left: 0;
  }

  .hero-patient-select {
    right: 33cqw;
    font-size: 8.5px;
  }

  .hero-patient-trigger {
    gap: 6px;
    padding: 6px 8px;
  }

  .hero-mode-toggle {
    left: 0;
    width: 100%;
    box-shadow: none;
  }

  .hero-mode-toggle.active {
    border-left: 0;
  }

  .hero-mode-btn {
    flex: 1;
    padding: 8px 4px;
    font-size: 8.5px;
    text-align: center;
  }
}

@media (max-width: 479px) {
  .hero-animation {
    aspect-ratio: 1 / 1;
  }
}

