@font-face {
  font-family: "Cera Round Pro";
  src: url("assets/fonts/CeraRoundPro-Bold.otf") format("opentype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Cera Round Pro";
  src: url("assets/fonts/CeraRoundPro-Regular.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Cera Round Pro";
  src: url("assets/fonts/CeraRoundPro-Medium.otf") format("opentype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Graphik";
  src: url("assets/fonts/Graphik-Regular.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
:root {
  --film-bg: #d9d8da;
  --page-gutter: 5%;
  --accent-purple: #666bc2;
  --accent-purple-hover: #555bb0;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scrollbar-width: none;
  overscroll-behavior: none;
}
body {
  margin: 0;
  overflow-x: clip;
  overscroll-behavior: none;
  background: var(--film-bg);
  color: #172c43;
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  cursor: pointer;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent-purple);
  outline-offset: 6px;
}
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding-inline: var(--page-gutter);
  z-index: 20;
  pointer-events: none;
}
header a {
  pointer-events: auto;
}
.menu-toggle { display: none; }
.top-menu {
  margin-inline: auto;
  width: max-content;
  pointer-events: auto;
  font-family: "Cera Round Pro", Arial, sans-serif;
  font-weight: 500;
  font-size: 16px;
}
.top-menu ul {
  display: flex;
  align-items: center;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.top-menu span {
  display: block;
  padding-block: 10px;
  white-space: nowrap;
  cursor: default;
  transition: color 160ms ease;
}
.top-menu span:hover {
  color: var(--accent-purple);
}
.header-cta {
  flex: none;
  padding: 14px 20px;
  border-radius: 999px;
  background: var(--accent-purple);
  color: white;
  font-family: "Cera Round Pro", Arial, sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
  transition: background 160ms ease;
}
.header-cta:hover { background: var(--accent-purple-hover); }
.logo {
  font-size: 28px;
  letter-spacing: -1.7px;
  font-weight: 700;
}
.logo span {
  font-size: 10px;
  vertical-align: top;
  position: relative;
  top: 5px;
  left: 3px;
}
.story {
  height: calc(100svh + 560svh * var(--story-scale, 1));
  touch-action: pan-y pinch-zoom;
}
.sticky {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
}
.stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #d9d8da;
}
.stage { container-type: size; }
.visual {
  --area-w: 100cqw;
  --area-x: 0px;
  --area-h: 90cqh;
  --area-y: 5cqh;
  --visible-width: 1;
  --crop-left: 0;
  --frame-width: min(
    calc(var(--area-w) / var(--visible-width)),
    calc(var(--area-h) * 16 / 9)
  );
}
.visual[data-chapter="1"],
.visual[data-chapter="2"],
.visual[data-chapter="3"],
.visual[data-chapter="4"] {
  --area-w: 66cqw;
  --area-x: 34cqw;
}
.visual[data-chapter="5"] {
  --area-w: calc(66cqw + 34cqw * var(--return, 0));
  --area-x: calc(34cqw * (1 - var(--return, 0)));
}
.visual {
  display: block;
  position: absolute;
  width: var(--frame-width);
  height: calc(var(--frame-width) * 9 / 16);
  left: calc(
    var(--area-x) +
      (var(--area-w) - var(--frame-width) * var(--visible-width)) / 2 -
      var(--frame-width) * var(--crop-left)
  );
  top: calc(var(--area-y) + (var(--area-h) - var(--frame-width) * 9 / 16) / 2);
  /* Feather only the frame boundary, using the same mask from first paint. */
  mask-image:
    linear-gradient(to right, transparent, black 5%, black 95%, transparent),
    linear-gradient(to bottom, transparent, black 9%, black 91%, transparent);
  mask-composite: intersect;
}
.opening-mode .sequence-scene,
.return-scene {
  filter: url(#opening-detail);
}
.scene,
.syringe-assembly,
.syringe-plunger,
.frame-layer,
.scene img,
.syringe-window {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.scene img { object-fit: fill; display: block; }
.scene { display: none; }
.mode-sequence .sequence-scene,
.mode-contact .contact-scene,
.mode-injection .injection-scene,
.mode-delivery .injection-scene,
.mode-finale .injection-scene,
.mode-family .family-scene { display: block; }
.visual.mode-family {
  inset: 0;
  width: 100%;
  height: 100%;
  mask: none;
}
.family-scene picture {
  position: absolute;
  inset: 0;
  mask-image:
    linear-gradient(to right, transparent, black 14%, black 86%, transparent),
    linear-gradient(to bottom, transparent, black 20%, black 78%, transparent),
    radial-gradient(ellipse 83% 80% at 50% 54%, black 48%, transparent 100%);
  mask-composite: intersect;
}
.family-scene img { object-fit: cover; }
.stage[data-kind="family"] .shade { display: none; }
.visual[hidden], .scene[hidden] { display: none; }
html::-webkit-scrollbar { display: none; }
.contact-scene { overflow: hidden; }
.contact-skin {
  mask-image: radial-gradient(ellipse 74% 80% at 48% 48%, black 28%, transparent 80%);
  filter: blur(0.5px);
}
.contact-device {
  transform: translate(calc(9% * (1 - var(--approach, 0))), calc(-16% * (1 - var(--approach, 0))));
  will-change: transform;
}
.contact-shadow {
  position: absolute;
  left: 43%;
  top: 63%;
  width: 11%;
  height: 5%;
  border-radius: 50%;
  background: #683b25;
  filter: blur(10px);
  opacity: calc(var(--approach, 0) * 0.2);
  transform: rotate(43deg);
}
.syringe-window {
  clip-path: url(#injection-interior);
}
.syringe-assembly {
  opacity: 0.93;
  transform: translate(calc(-3.2% * var(--needle-depth, 0)), calc(5.7% * var(--needle-depth, 0)));
  will-change: transform;
}
.syringe-needle {
  clip-path: polygon(0 0, 39% 0, 55.7% 38.6%, 61.3% 50.6%, 100% 100%, 0 100%);
}
.syringe-detail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.piston-motion {
  transform: translateX(calc(-520px * var(--piston, 0)));
  will-change: transform;
}
.mode-finale {
  transform: translate(calc(-10.5% * var(--return, 0)), calc(-6cqh * var(--return, 0))) scale(calc(1 - 0.18 * var(--return, 0)));
}
.filter-definitions {
  position: absolute;
  pointer-events: none;
}
@media (max-width: 1200px) {
  header {
    height: 100px;
    flex-wrap: wrap;
    align-content: center;
    row-gap: 2px;
  }
  .top-menu {
    order: 2;
    position: static;
    transform: none;
    width: 100%;
    margin-left: 0;
    padding-left: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .header-cta {
    order: 1;
    margin-left: auto;
    padding: 12px 16px;
  }
  .top-menu::-webkit-scrollbar {
    display: none;
  }
  .top-menu ul {
    width: max-content;
    margin-inline: auto;
    gap: 16px;
  }
}
@media (max-width: 760px) {
  header {
    height: 72px;
    flex-wrap: nowrap;
    gap: 8px;
  }
  .header-cta { padding: 12px 14px; }
  .menu-toggle {
    display: flex;
    flex: 0 0 40px;
    order: 3;
    height: 44px;
    padding: 11px 8px;
    flex-direction: column;
    justify-content: space-between;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #172c43;
    pointer-events: auto;
  }
  .menu-toggle span {
    display: block;
    height: 2px;
    width: 24px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 180ms, opacity 180ms;
  }
  .menu-toggle:hover { color: var(--accent-purple); }
  .menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(10px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-10px) rotate(-45deg); }
  .top-menu {
    display: none;
    position: absolute;
    top: 72px;
    left: var(--page-gutter);
    right: var(--page-gutter);
    width: auto;
    padding: 14px 24px;
    border-radius: 24px;
    background: rgb(247 247 249 / 97%);
    box-shadow: 0 14px 40px rgb(23 44 67 / 12%);
    max-height: calc(100svh - 90px);
    overflow: auto;
  }
  header.menu-open .top-menu { display: block; }
  .top-menu ul { flex-direction: column; align-items: stretch; width: auto; gap: 0; }
  .top-menu span { padding-block: 11px; }
  .visual,
  .visual[data-chapter] {
    --area-w: 100cqw;
    --area-x: 0px;
    --area-h: 49cqh;
    --area-y: 40cqh;
    --visible-width: 1;
    --crop-left: 0;
  }
  .visual:not([data-chapter]),
  .visual[data-chapter="0"] {
    --visible-width: 0.73;
    --crop-left: 0.27;
  }
  .visual[data-chapter="5"] {
    --area-y: calc(40cqh + 4cqh * var(--return, 0));
    --area-h: calc(49cqh - 19cqh * var(--return, 0));
    --visible-width: calc(1 - 0.27 * var(--return, 0));
    --crop-left: calc(0.27 * var(--return, 0));
  }
  .mode-finale {
    transform: scale(calc(1 - 0.02 * var(--return, 0)));
  }
}

.shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--film-bg), transparent 40%);
  pointer-events: none;
  z-index: 2;
}
.copy {
  position: absolute;
  z-index: 2;
  top: 28%;
  left: var(--page-gutter);
  width: 31%;
  pointer-events: none;
  will-change: opacity, transform;
}
h1 {
  font-family: "Cera Round Pro", Arial, sans-serif;
  font-size: clamp(48px, 5.4vw, 87px);
  line-height: 0.92;
  font-weight: 700;
  letter-spacing: -0.035em;
  margin: 0 0 26px;
}
.title-line {
  white-space: nowrap;
}
h1 em {
  font-style: normal;
  color: inherit;
}
.copy > p {
  font-family: "Graphik", Arial, sans-serif;
  font-size: 18px;
  color: #344b61;
  line-height: 1.5;
  max-width: 380px;
  margin: 0;
}
.copy.family-copy {
  left: 6%;
  top: 19%;
  width: 88%;
  text-align: center;
}
.family-copy h1 {
  font-size: clamp(48px, 5.2vw, 80px);
  line-height: 0.98;
  max-width: 1100px;
  margin: 0 auto;
}
.bottom {
  position: absolute;
  left: var(--page-gutter);
  right: var(--page-gutter);
  bottom: max(28px, env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  z-index: 4;
}
.chapters {
  pointer-events: none;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 8px 10px;
  background: transparent;
  border: 0;
}
.chapter-step {
  position: relative;
  flex: none;
  width: 20px;
  height: 24px;
  border: 0;
  background: none;
  padding: 0;
  border-radius: 999px;
}
.chapter-track {
  position: absolute;
  left: 6px;
  right: 6px;
  height: 8px;
  top: 8px;
  border-radius: 999px;
  background: #8f9dae;
  opacity: 0.55;
  transition: opacity 180ms;
}
.chapter-progress {
  position: absolute;
  top: 16px;
  left: 0;
  height: 8px;
  width: 8px;
  border-radius: 999px;
  background: var(--accent-purple);
  transform: translateX(16px);
  pointer-events: none;
  will-change: transform, width;
}
.finale {
  --cta: 0;
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(104px, calc(env(safe-area-inset-bottom) + 88px));
  display: flex;
  justify-content: center;
  z-index: 3;
  opacity: var(--cta);
  transform: translateY(calc(18px * (1 - var(--cta))));
}
.configuration-button {
  padding: 21px 38px;
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 24%);
  background: var(--accent-purple);
  color: white;
  font-family: "Cera Round Pro", Arial, sans-serif;
  font-weight: 500;
  font-size: 18px;
  line-height: 1.2;
  box-shadow: 0 10px 28px rgb(102 107 194 / 20%), inset 0 1px 0 rgb(255 255 255 / 18%);
  transition: background 180ms, box-shadow 180ms, transform 180ms;
}
.configuration-button:hover {
  background: var(--accent-purple-hover);
  box-shadow: 0 12px 32px rgb(102 107 194 / 30%);
  transform: translateY(-2px);
}
.configuration-button:active { transform: translateY(0); }
.finale.family-cta { animation: family-cta-enter 600ms 280ms cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes family-cta-enter {
  from { opacity: 0; transform: translateY(32px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-height: 570px) and (min-width: 761px) {
  .copy { top: 23%; }
  h1 { font-size: 52px; }
  .copy > p { font-size: 16px; }
}
#load-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (max-width: 760px) {
  :root {
    --page-gutter: 6%;
  }
  header {
    height: 72px;
  }
  .logo {
    font-size: 24px;
  }
  .story {
    height: calc(100svh + 490svh * var(--story-scale, 1));
  }
  .copy {
    top: 15%;
    width: 88%;
  }
  h1 {
    font-size: 44px;
    line-height: 0.92;
    margin-bottom: 17px;
    max-width: 350px;
  }
  .copy > p {
    font-size: 16px;
    max-width: 350px;
  }
  .bottom {
    bottom: max(20px, env(safe-area-inset-bottom));
  }
  .configuration-button { font-size: 16px; padding: 20px 30px; }
  .copy.family-copy { top: 20%; }
  .family-scene picture {
    mask-image:
      linear-gradient(to right, transparent, black 7%, black 93%, transparent),
      linear-gradient(to bottom, transparent, black 18%, black 80%, transparent),
      radial-gradient(ellipse 100% 80% at 50% 54%, black 55%, transparent 100%);
  }
  .family-copy h1 { font-size: clamp(42px, 10.5vw, 66px); max-width: none; }
  .shade {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
  .finale.family-cta { animation: none; }
}
