/* Motion layer: live peptavi.com design with 3D and scroll motion added on top.
   Everything here is additive. Live components (buttons, header, type, colors) are untouched.
   prefers-reduced-motion turns all of it off at the end of this file. */

:root {
  --ease-out:cubic-bezier(.22, 1, .36, 1);
  --ease-io:cubic-bezier(.66, 0, .34, 1);
  --navy:#141b3f;
  --navy-2:#1b2450;
}

/* Scroll progress, pinned to the top edge above the header. */
.ScrollBar {
  position:fixed;
  inset:0 0 auto;
  height:2px;
  z-index:200;
  background:var(--brand);
  transform-origin:0 50%;
  transform:scaleX(var(--sp, 0));
  pointer-events:none
}

/* ---------- Hero ---------- */
.Hero-hero {
  position:relative;
  isolation:isolate
}

.Aurora {
  position:absolute;
  inset:0;
  z-index:-1;
  overflow:hidden;
  pointer-events:none
}

.Aurora i {
  position:absolute;
  width:46vw;
  aspect-ratio:1;
  border-radius:50%;
  filter:blur(70px);
  opacity:.55;
  will-change:transform
}

.Aurora i:nth-child(1) {
  background:radial-gradient(circle, #c9d1ff 0, #c9d1ff00 70%);
  top:-18%;
  right:-6%;
  animation:Aurora-a 18s ease-in-out infinite alternate
}

.Aurora i:nth-child(2) {
  background:radial-gradient(circle, #dfe4ff 0, #dfe4ff00 70%);
  bottom:-30%;
  left:-12%;
  animation:Aurora-b 22s ease-in-out infinite alternate
}

.Aurora i:nth-child(3) {
  background:radial-gradient(circle, #b9c4ff 0, #b9c4ff00 70%);
  width:30vw;
  top:30%;
  left:38%;
  opacity:.35;
  animation:Aurora-c 15s ease-in-out infinite alternate
}

@keyframes Aurora-a { to { transform:translate(-120px, 90px) scale(1.15) } }
@keyframes Aurora-b { to { transform:translate(160px, -80px) scale(1.2) } }
@keyframes Aurora-c { to { transform:translate(-90px, -60px) scale(.85) } }

/* ---------- Page-open cascade ----------
   One motion (a short fade-up), one speed, in reading order from top to bottom:
   headline lines, subtitle, buttons, fine print, the vials (with their card and strand), the note, the program tiles.
   It animates only opacity and translate, which the browser runs off the main thread, so it stays smooth while the
   3D scene loads. */
/* Starts at 1% opacity, not 0: browsers do not count fully transparent text as painted, which made the headline's
   measured paint time (LCP) wait for the shine sweep at 1.4 s. Visually identical. */
@keyframes Cascade { from { opacity:.01; translate:0 16px } }

.Hero-title .Rise-line {
  display:block;
  font-size:1em;
  line-height:inherit
}

.Hero-title .Rise-in {
  display:block;
  font-size:1em;
  line-height:inherit;
  animation:Cascade .8s var(--ease-out) both
}

.Hero-title .Rise-line:nth-child(2) .Rise-in { animation-delay:.07s }
.Hero-title .Rise-line:nth-child(3) .Rise-in { animation-delay:.14s }

.Rise-fade { animation:Cascade .8s var(--ease-out) var(--d, .3s) both }

.Hero-note { animation:Cascade .8s var(--ease-out) .62s both }
.HeroTiles-tiles > li { animation:Cascade .8s var(--ease-out) .68s both }
.HeroTiles-tiles > li:nth-child(2) { animation-delay:.74s }
.HeroTiles-tiles > li:nth-child(3) { animation-delay:.8s }
.HeroTiles-tiles > li:nth-child(4) { animation-delay:.86s }

.Shine {
  background:linear-gradient(100deg, var(--brand) 0 42%, #a9b6ff 50%, var(--brand) 58% 100%);
  background-size:250% 100%;
  background-position:100% 0;
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
  animation:Shine 6s ease-in-out 1.4s infinite
}

/* One sweep every 6 s. The light starts fully hidden left of the text (100%) and ends fully hidden to its
   right (0%). Going further would bring the repeated background tile's light into view: a second pass that
   then rested at the end of the line. */
@keyframes Shine {
  0% { background-position:100% 0 }
  27%, 100% { background-position:0% 0 }
}

.Hero-stage {
  position:relative
}

/* Peptide chain: a strand of residues coiling like an alpha helix, drawn by app.js on a canvas.
   It replaced an earlier ring graphic that read too close to another brand's mark. */
.Chain {
  position:absolute;
  pointer-events:none
}

.Chain canvas {
  width:100%;
  height:100%;
  display:block
}

.Hero-chain {
  /* The open band above the vials (the carousel sits below it). */
  top:-18%;
  left:-10%;
  right:-6%;
  height:42%;
  z-index:0;
  animation:Cascade .8s var(--ease-out) .56s both
}

@keyframes Fade-in { from { opacity:0 } }

.HeroVials-stage {
  z-index:1;
  transition:opacity .8s var(--ease-out), translate .8s var(--ease-out)
}

/* Hidden from the very first paint until app.js adds .is-shown, in the vials' cascade slot, once the 3D scene has its
   first frame. They appear once, already in 3D, with no photo-to-3D swap. Fail-safe: if the script never runs,
   the stage fades in by itself after 2.2 s. */
.HeroVials-stage:not(.is-shown) { opacity:0; translate:0 16px; animation:Stage-failsafe .8s var(--ease-out) 2.2s forwards }

@keyframes Stage-failsafe { to { opacity:1; translate:none } }

@keyframes Float-in { from { opacity:0; translate:0 40px } }

.Hero3D-canvas {
  position:absolute;
  inset:-6% -4% -2%;
  width:108%;
  height:108%;
  opacity:0;
  transition:opacity .6s ease;
  touch-action:pan-y
}

.HeroVials-stage.is-3d .Hero3D-canvas { opacity:1 }
.Hero3D-canvas.is-grabbable { cursor:grab }
.HeroVials-stage.is-dragging .Hero3D-canvas { cursor:grabbing }

.HeroVials-stage .HeroVials-vial { transition:opacity .6s ease }
.HeroVials-stage.is-3d .HeroVials-vial { opacity:0; animation-play-state:paused; pointer-events:none }

/* Floating glass note beside the vials. */
.FloatCard {
  position:absolute;
  right:-3%;
  top:-2%;
  z-index:2;
  display:grid;
  grid-template-columns:auto 1fr;
  column-gap:10px;
  row-gap:2px;
  align-items:center;
  max-width:236px;
  padding:14px 16px;
  border-radius:16px;
  background:#ffffffb3;
  border:1px solid #ffffffe6;
  box-shadow:var(--shadow-float);
  -webkit-backdrop-filter:blur(14px) saturate(1.4);
  backdrop-filter:blur(14px) saturate(1.4);
  animation:Cascade .8s var(--ease-out) .56s both, Bob 7s ease-in-out 1.7s infinite
}

.FloatCard-dot {
  width:8px;
  height:8px;
  border-radius:50%;
  background:var(--brand);
  animation:Pulse 2.2s ease-out infinite
}

.FloatCard-k {
  font-size:13px;
  font-weight:600;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--brand)
}

.FloatCard-v {
  grid-column:2;
  font-size:14px;
  line-height:1.4;
  color:var(--ink)
}

@keyframes Bob { 50% { transform:translateY(-8px) } }
@keyframes Pulse {
  0% { box-shadow:0 0 0 0 #4c63e6aa }
  100% { box-shadow:0 0 0 10px #4c63e600 }
}

.Hero-note { position:relative; z-index:2 }

@media (max-width:1023px) {
  .FloatCard { right:2%; top:2% }
}

@media (max-width:768px) {
  .FloatCard {
    position:relative;
    inset:auto;
    justify-self:center;
    margin-top:-8px;
    max-width:none
  }
  .Hero-chain { left:-4%; right:-4% }
}

/* ---------- Scroll reveals (added by app.js to content below the fold) ---------- */
.fx-reveal {
  opacity:0;
  transform:translateY(18px)
}

/* The transition lives on the revealed state only, so content hides instantly at load and arrives quickly on scroll. */
.fx-reveal.is-in {
  opacity:1;
  transform:none;
  transition:opacity .55s var(--ease-out), transform .55s var(--ease-out);
  transition-delay:var(--rd, 0s)
}

/* Program photos drift against the scroll inside their frames. */
.ProgramBand-band .Frame-photo {
  scale:1.12;
  translate:0 var(--par, 0px);
  will-change:translate
}

/* ---------- Treatment shelf: 3D tilt on cards, drag to scroll ---------- */
.ShelfBrowser-rail { cursor:grab }
.ShelfBrowser-rail.is-dragging { cursor:grabbing; scroll-snap-type:none; user-select:none }
.ShelfBrowser-rail.is-dragging a { pointer-events:none }

.MedicineCard-card {
  transform:perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition:border-color .2s, transform .5s var(--ease-out), box-shadow .5s var(--ease-out)
}

.MedicineCard-card.is-tilting {
  transition:border-color .2s, transform .12s linear, box-shadow .5s var(--ease-out);
  box-shadow:0 30px 60px -30px #1b245047
}

.ShelfBrowser-rail.is-swiping .MedicineCard-card {
  transition:border-color .2s, transform .16s linear, box-shadow .5s var(--ease-out)
}

/* Touch screens keep :hover on the last thing tapped, which left one card outlined and its vial lifted. */
@media (hover:none) {
  .MedicineCard-card:hover { border-color:var(--line) }
  .MedicineCard-card:hover:not(.is-centered) .MedicineCard-render { transform:none }
}

.MedicineCard-render {
  transition:transform .5s var(--ease-out)
}

.MedicineCard-card:hover .MedicineCard-render,
.MedicineCard-card.is-centered .MedicineCard-render {
  transform:translateY(-6px) scale(1.04) rotate(-2deg)
}

/* ---------- The Peptavi Standard: pinned, scroll-lit heading ---------- */
.Scene {
  height:215vh;
  margin:calc(var(--space) * -1) 0 var(--space);
  background:var(--navy)
}

.Scene-pin {
  position:sticky;
  top:0;
  height:100vh;
  display:grid;
  place-items:center;
  overflow:hidden;
  isolation:isolate;
  color:#fff;
  background:radial-gradient(60% 55% at 50% 50%, #2a3a9a 0, #1b2450 55%, var(--navy) 100%)
}

.Scene-chain {
  inset:0;
  z-index:-1
}

.Scene-title {
  max-width:18ch;
  padding:0 var(--pad-x);
  text-align:center;
  font-size:clamp(36px, 6vw, 84px);
  line-height:1.04;
  letter-spacing:-.025em;
  color:#fff;
  /* --e runs 0 to 1 as the panel scrolls up into view: the heading fades in as it arrives, before the panel pins. */
  opacity:clamp(0, (var(--e, 0) - .38) * 4, 1);
  translate:0 calc((1 - clamp(0, (var(--e, 0) - .38) * 3, 1)) * 32px)
}

.Scene-title .whisper {
  display:block;
  margin-bottom:18px;
  font-size:clamp(16px, 1.4vw, 20px);
  letter-spacing:0;
  color:#aab6ff
}

.Scrub-w {
  color:#ffffff38;
  transition:color .25s ease
}

.Scrub-w.is-lit { color:#fff }

.Standard-lead {
  font-size:clamp(20px, 1.7vw, 24px);
  line-height:1.45;
  color:var(--ink)
}

/* ---------- How it works: a path draws through the steps ---------- */
.Path { position:relative }

.Path-svg {
  /* Covers the whole steps block; app.js routes the line through each step's dot, wherever the layout puts them. */
  position:absolute;
  left:0;
  top:0;
  width:100%;
  height:100%;
  overflow:visible;
  pointer-events:none
}

.Path-base {
  fill:none;
  stroke:var(--line);
  stroke-width:2;
  stroke-dasharray:4 7
}

.Path-fill {
  fill:none;
  stroke:var(--brand);
  stroke-width:2.5;
  stroke-linecap:round
}

.Path .PointGrid-grid { border-top-color:transparent }

.Path .PointGrid-steps { padding-top:56px }

.Path .PointGrid-cell { position:relative }

.Path .PointGrid-cell:before {
  content:"";
  position:absolute;
  left:0;
  top:-38px;
  width:18px;
  height:18px;
  border-radius:50%;
  background:var(--paper);
  border:2px solid var(--line);
  box-sizing:border-box;
  transition:background .4s, border-color .4s, box-shadow .4s, transform .4s var(--ease-out)
}

.Path .PointGrid-cell.is-on:before {
  background:var(--brand);
  border-color:var(--brand);
  box-shadow:0 0 0 6px #4c63e626;
  transform:scale(1.1)
}

.Path .PointGrid-cell .PointGrid-n { transition:color .4s }
.Path .PointGrid-cell:not(.is-on) .PointGrid-n { color:#4c63e666 }

/* Tablets and phones: the dot sits beside each step's number and the line runs down through them
   (a vertical timeline on phones, winding 1-2-3-4 through the 2x2 grid on tablets). */
@media (max-width:1023px) {
  .Path .PointGrid-steps { padding-top:32px }
  .Path .PointGrid-cell { padding-left:38px }
  .Path .PointGrid-cell:before { top:5px }
}

/* ---------- Header over dark sections ----------
   The header is translucent white, which turns muddy gray when a navy section passes underneath. While one does
   (app.js sets the class), the bar goes solid white. */
.SiteHeader-bar { transition:background-color .2s ease }
.is-over-ink .SiteHeader-bar { background-color:#fff }

/* ---------- Page-to-page ----------
   Moving between pages cross-fades instead of flashing (browsers without support just navigate as before). */
@media (prefers-reduced-motion:no-preference) {
  @view-transition { navigation:auto }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration:.18s }
}

/* ---------- Closing panel ---------- */
.ClosingCta-panel {
  position:relative;
  isolation:isolate;
  overflow:hidden
}

.Aurora-ink i:nth-child(1) {
  background:radial-gradient(circle, #3b4ec4 0, #3b4ec400 70%);
  opacity:.8;
  width:60%;
  top:-40%;
  right:-10%
}

.Aurora-ink i:nth-child(2) {
  background:radial-gradient(circle, #2c3a9e 0, #2c3a9e00 70%);
  opacity:.8;
  width:55%;
  bottom:-50%;
  left:-10%
}

.ClosingCta-chain {
  inset:auto 0 0;
  height:30%;
  z-index:-1;
  -webkit-mask-image:linear-gradient(to bottom, transparent, #000 45%);
  mask-image:linear-gradient(to bottom, transparent, #000 45%)
}

/* ---------- Reduced motion: the live site, still. ---------- */
@media (prefers-reduced-motion:reduce) {
  .Aurora i, .Shine, .FloatCard, .FloatCard-dot, .HeroVials-stage, .Hero-chain, .Hero-note, .HeroTiles-tiles > li { animation:none }
  .Hero-title .Rise-in, .Rise-fade { animation:none; transform:none; translate:none; opacity:1 }
  .HeroVials-stage:not(.is-shown) { opacity:1; translate:none; animation:none }
  .Shine { color:var(--brand); background:none }
  .fx-reveal { opacity:1; transform:none; transition:none }
  .ProgramBand-band .Frame-photo { scale:1; translate:none }
  .MedicineCard-card { transform:none }
  .Scene { height:auto; margin-top:calc(var(--space) * -1) }
  .Scene-pin { position:relative; height:auto; padding:var(--space) 0 calc(var(--space) + 210px) }
  .Scene-title { opacity:1; translate:none }
  .Scrub-w { color:#fff }
  .ScrollBar { display:none }
}
