/* OtoVIS section. Everything is namespaced under .ovs and resets what it relies on,
   so it can be dropped into another site without touching that site's styles. */
.ovs {
  --ovs-ink: #051a20;
  --ovs-paper: #f1fafb;
  --ovs-soft: #a9c2c5;
  --ovs-faint: #7d9a9e;
  --ovs-cyan: #51c0d3;      /* the "Oto" in the OtoVIS logo */
  --ovs-cyan-deep: #2ea3c0;
  --ovs-line: rgba(255, 255, 255, .16);
  --ovs-wrap: 1200px;
  --ovs-ease: cubic-bezier(.22, 1, .36, 1);
  --ovs-inset: 0px;         /* set by the script: how far the card sits in from the edges */
  --ovs-radius: 0px;

  position: relative;
  isolation: isolate;
  overflow: clip;
  background: var(--ovs-ink);
  color: var(--ovs-paper);
  font-family: "Roboto", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  clip-path: inset(var(--ovs-inset) var(--ovs-inset) 0 var(--ovs-inset) round var(--ovs-radius) var(--ovs-radius) 0 0);
}
.ovs *, .ovs *::before, .ovs *::after { box-sizing: border-box; }
.ovs :where(h2, h3, p, ul) { margin: 0; padding: 0; }
.ovs :where(ul) { list-style: none; }
.ovs :where(img, video) { display: block; max-width: none; }
.ovs :where(a) { color: inherit; }
.ovs [hidden] { display: none !important; }
.ovs :focus-visible { outline: 2px solid var(--ovs-cyan); outline-offset: 3px; border-radius: 6px; }

/* ---------- the film ---------- */
.ovs-film { position: absolute; inset: 0; z-index: 0; background: var(--ovs-ink); }
.ovs-video, .ovs-still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
.ovs-scrim {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(0deg, rgba(5, 26, 32, .92) 0%, rgba(5, 26, 32, .7) 15%, rgba(5, 26, 32, 0) 36%);
}
/* Only when the anatomy starts to reach under the words. */
@media (max-width: 1240px) {
  .ovs-scrim {
    background:
      linear-gradient(90deg, rgba(5, 26, 32, .86) 0%, rgba(5, 26, 32, .55) 38%, rgba(5, 26, 32, 0) 62%),
      linear-gradient(0deg, rgba(5, 26, 32, .92) 0%, rgba(5, 26, 32, .7) 15%, rgba(5, 26, 32, 0) 36%);
  }
}

/* ---------- anatomy labels that track the film ---------- */
.ovs-labels { position: absolute; inset: 0; pointer-events: none; }
.ovs-label {
  position: absolute; left: 0; top: 0; width: 0; height: 0;
  opacity: 0; transition: opacity .35s linear;
  will-change: transform;
}
.ovs-label.is-on { opacity: 1; }
.ovs-label::before {   /* the anchor dot */
  content: ""; position: absolute; left: -3.5px; top: -3.5px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--ovs-paper); box-shadow: 0 0 0 4px rgba(81, 192, 211, .3);
}
.ovs-label-line {
  position: absolute; left: 0; top: 0; height: 1px; width: var(--len); background: rgba(241, 250, 251, .72);
  transform-origin: 0 50%; transform: rotate(var(--ang));
}
.ovs-label-text {
  position: absolute; left: var(--tx); top: var(--ty); transform: translate(var(--ax), -50%);
  white-space: nowrap; font-size: 14px; font-weight: 500; letter-spacing: .005em; color: var(--ovs-paper);
  padding: 4px 11px; border-radius: 999px; background: rgba(5, 26, 32, .82);
}

/* the name of the procedure on screen */
.ovs-shotcap {
  position: absolute; right: max(24px, calc((100% - var(--ovs-wrap)) / 2)); bottom: clamp(92px, 7vw, 116px);
  font-size: 15px; font-weight: 500; color: var(--ovs-paper); text-shadow: 0 1px 10px rgba(5, 26, 32, .9);
  opacity: 0; transition: opacity .35s linear; pointer-events: none;
}
.ovs-shotcap.is-on { opacity: 1; }

/* ---------- content over the film ---------- */
.ovs-content {
  position: relative; z-index: 1;
  width: min(var(--ovs-wrap), 100% - 48px); margin-inline: auto;
  height: clamp(680px, 56.25vw, 100vh);
  min-height: 680px;
  padding: clamp(40px, 5vw, 72px) 0 clamp(28px, 3vw, 40px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto 1fr;
  pointer-events: none;
}
.ovs-content a, .ovs-content button { pointer-events: auto; }

.ovs-head { max-width: 520px; }
.ovs-title { font: inherit; font-size: 13px; font-weight: 400; line-height: 1.3; letter-spacing: 0; color: var(--ovs-faint); }
.ovs-logo { display: block; width: clamp(170px, 17vw, 244px); margin-top: 20px; border-radius: 6px; }
.ovs-logo img { width: 100%; height: auto; }

.ovs-chapters { display: grid; align-self: start; max-width: 560px; margin-top: clamp(28px, 3vw, 44px); transition: height .5s var(--ovs-ease); }
.ovs-chapter { grid-area: 1 / 1; align-self: start; visibility: hidden; }
.ovs-chapter.is-active { visibility: visible; }
.ovs-headline {
  font: inherit; font-size: clamp(42px, 5.2vw, 76px); font-weight: 700; line-height: 1.02; letter-spacing: -.032em; color: #fff;
  text-wrap: balance;
}
.ovs-body { margin-top: 18px; font-size: clamp(17px, 1.45vw, 20px); line-height: 1.5; color: var(--ovs-soft); max-width: 25em; }

/* The copy arrives the way the film does: wiped on, left to right, behind a line of cyan. */
.ovs-chapter.is-active .ovs-headline { animation: ovs-wipe .8s var(--ovs-ease) both; }
.ovs-chapter.is-active .ovs-body { animation: ovs-wipe .8s var(--ovs-ease) .09s both; }
@keyframes ovs-wipe {
  from { clip-path: inset(-.2em 100% -.2em 0); }
  to { clip-path: inset(-.2em -.2em -.2em 0); }
}

.ovs-action { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-top: 26px; }
.ovs-cta {
  display: inline-flex; align-items: center; padding: 14px 26px; border-radius: 999px;
  background: var(--ovs-cyan); color: #04222a;
  font-family: "Qanelas Soft", "Roboto", Arial, sans-serif; font-weight: 800; font-size: 16px; line-height: 1.2;
  text-transform: uppercase; letter-spacing: .04em; text-decoration: none;
  transition: transform .2s var(--ovs-ease), background .2s;
}
.ovs-cta:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) {
  .ovs-cta:hover { background: #79d3e2; transform: translateY(-1px); }
}
.ovs-runs { font-size: 15px; color: var(--ovs-soft); }

.ovs-nav { display: flex; align-self: end; align-items: flex-end; gap: 20px; margin-top: clamp(28px, 3.4vw, 48px); }
.ovs-tabs { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ovs-tab {
  display: block; width: 100%; padding: 0 0 2px; border: 0; background: none; cursor: pointer; text-align: left;
  font: inherit; font-size: 16px; font-weight: 500; color: var(--ovs-faint); transition: color .25s;
}
.ovs-tab[aria-current="true"] { color: var(--ovs-paper); }
@media (hover: hover) and (pointer: fine) { .ovs-tab:hover { color: var(--ovs-paper); } }
.ovs-rail { display: block; height: 2px; margin-bottom: 11px; background: var(--ovs-line); overflow: hidden; border-radius: 2px; }
.ovs-rail i { display: block; height: 100%; background: var(--ovs-cyan); transform: scaleX(var(--p, 0)); transform-origin: 0 50%; }
.ovs-toggle {
  flex: none; width: 44px; height: 44px; margin-bottom: -6px; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--ovs-line); border-radius: 50%; background: rgba(255, 255, 255, .05); color: var(--ovs-paper); transition: background .2s;
}
.ovs-toggle path { fill: currentColor; }
.ovs-toggle[data-state="playing"] .ovs-icon-play,
.ovs-toggle[data-state="paused"] .ovs-icon-pause { display: none; }
@media (hover: hover) and (pointer: fine) { .ovs-toggle:hover { background: rgba(255, 255, 255, .14); } }

/* ---------- reduced motion and stills ---------- */
.ovs.is-still .ovs-chapter.is-active .ovs-headline,
.ovs.is-still .ovs-chapter.is-active .ovs-body { animation: none; }
.ovs.is-still .ovs-toggle { display: none; }
.ovs.is-still .ovs-label { transition: none; }

/* ---------- narrow screens: the film gets its own square above the words ---------- */
@media (max-width: 860px), (max-aspect-ratio: 1/1) {
  .ovs { display: flex; flex-direction: column; }
  .ovs-content { display: contents; }
  .ovs-head, .ovs-chapters, .ovs-action, .ovs-nav { position: relative; z-index: 1; width: calc(100% - 40px); margin-inline: auto; }
  .ovs-head { order: 1; max-width: none; padding-top: 56px; }
  .ovs-film { order: 2; position: relative; inset: auto; width: 100%; aspect-ratio: 1 / 1; margin-top: 8px; }
  .ovs-video, .ovs-still { object-position: 84% 50%; }
  .ovs-shotcap { right: 20px; bottom: 12px; font-size: 13px; }
  .ovs-scrim { background: linear-gradient(180deg, var(--ovs-ink) 0%, rgba(5, 26, 32, 0) 14%, rgba(5, 26, 32, 0) 84%, var(--ovs-ink) 100%); }
  .ovs-label-text { font-size: 12px; padding: 3px 8px; }
  .ovs-nav { order: 3; margin-top: 4px; gap: 12px; align-items: center; align-self: auto; }
  .ovs-tabs { gap: 10px; }
  .ovs-tab { font-size: 15px; }
  .ovs-toggle { margin-bottom: 0; }
  .ovs-chapters { order: 4; margin-top: 30px; max-width: none; align-self: auto; }
  .ovs-chapter { align-self: start; }
  .ovs-headline { font-size: clamp(36px, 10vw, 56px); }
  .ovs-action { order: 5; margin-top: 26px; padding-bottom: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .ovs { clip-path: none; }
  .ovs-chapter.is-active .ovs-headline, .ovs-chapter.is-active .ovs-body { animation: none; }
  .ovs-label { transition: none; }
  .ovs-chapters { transition: none; }
}
