/* Home page: the lab coat opens, the view dives inside, then a scroll tour
   of the app. Motion is layered: a grounded shadow under the floating
   coat, light falling across the panels as they swing, a circular reveal
   for the move inside, and staggered rises for the words and cards. */
.home {
  max-width: none;
  padding: 0;
}
.stage {
  --size: min(70vw, 320px);
  position: relative;
  cursor: pointer;
  min-height: calc(100svh - 68px);
  display: grid;
  place-items: center;
  /* Extra room below balances the 68px header above, so the coat sits in
     the middle of the screen rather than of the space under the header. */
  padding: 24px 16px 92px;
  overflow: hidden;
  background: var(--page);
  isolation: isolate;
}
/* The coat's lining, grown from the centre to fill the stage. */
.lining-layer {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    120% 80% at 50% 30%,
    #26524b 0%,
    var(--ink) 55%,
    #0f2a27 100%
  );
  clip-path: circle(0% at 50% calc(50% - 34px));
  transition: clip-path 1s cubic-bezier(0.65, 0, 0.25, 1);
  z-index: 0;
}
.stage.zoom .lining-layer {
  clip-path: circle(145% at 50% calc(50% - 34px));
}
/* The line on the lining, between the doors opening and the dive. It is
   centred on the coat: the stage's content sits 34px above its box centre
   because of the padding that balances the header. */
/* Confetti behind the line, above the coat. It fades with the hand-off. */
.confetti {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.6s ease;
}
.stage.done .confetti {
  opacity: 0;
}
.hook {
  position: absolute;
  left: 50%;
  top: calc(50% - 34px);
  translate: -50% -50%;
  z-index: 3;
  margin: 0;
  /* Sized to the coat, so it fits the chest of the lining; it grows with
     the reveal. */
  width: calc(var(--size) * 0.6);
  color: #fff;
  text-align: center;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
/* "Your white coat journey" on one line inside the chest, "starts here."
   larger beneath it. */
.hook .line {
  display: block;
  white-space: nowrap;
  font-size: calc(var(--size) * 0.052);
  letter-spacing: -0.01em;
}
.hook .line.accent {
  font-size: calc(var(--size) * 0.088);
  margin-top: 0.08em;
  pointer-events: none;
  transition:
    transform 1.9s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease;
}
/* The words are never still: a slow drift while they sit on the chest,
   which the zoom then picks up without a hold. */
.stage.brand .hook {
  transform: scale(1.07);
  transition-duration: 1.6s;
  transition-timing-function: cubic-bezier(0.2, 0.6, 0.3, 1);
}
.hook .w {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.5em);
  filter: blur(8px);
  transition:
    opacity 0.55s ease,
    transform 0.85s cubic-bezier(0.2, 0.7, 0.2, 1),
    filter 0.55s ease;
  transition-delay: calc(var(--i) * 90ms);
}
.hook .accent {
  color: var(--lime);
}
.stage.brand .hook .w {
  opacity: 1;
  transform: none;
  filter: blur(0);
}
.stage.zoom .hook {
  transform: scale(2.1);
  transition-duration: 2.3s;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}
@media (min-width: 700px) {
  .stage.zoom .hook {
    transform: scale(2.85);
  }
}
/* The words leave the way they came: lifting and blurring away one after
   another while the single growth curve carries on underneath, so the
   hand-off never changes speed. */
.stage.done .hook .w {
  opacity: 0;
  transform: translateY(-0.45em);
  filter: blur(10px);
  transition:
    opacity 0.6s ease,
    transform 0.9s cubic-bezier(0.4, 0, 0.6, 1),
    filter 0.6s ease;
  transition-delay: calc(var(--i) * 55ms);
}
.closed-view {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 26px;
  perspective: 1500px;
}
.coat-wrap {
  position: relative;
  width: var(--size);
}
.shadow {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -30px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    rgba(24, 63, 59, 0.38),
    rgba(24, 63, 59, 0) 70%
  );
  animation: shadow 4.2s ease-in-out infinite;
  transition: opacity 0.5s ease;
}
/* The coat from the app icon, in two halves that swing open like doors. */
.coat {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 484 / 537;
  filter: drop-shadow(0 18px 28px rgba(24, 63, 59, 0.22));
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  transform-style: preserve-3d;
  animation: float 4.2s ease-in-out infinite;
  transition:
    transform 1s cubic-bezier(0.65, 0, 0.25, 1),
    opacity 0.45s ease 0.45s;
  -webkit-tap-highlight-color: transparent;
}
.coat:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 14px;
  border-radius: 24px;
}
/* The lining, coat-shaped, seen once the doors open. */
.coat .back {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 50% 42%,
    #2f6a5f 0%,
    var(--ink) 55%,
    #0f2a27 100%
  );
  -webkit-mask: url("coat-mask.png") center / 100% 100% no-repeat;
  mask: url("coat-mask.png") center / 100% 100% no-repeat;
}
.half {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  overflow: hidden;
  transition: transform 1.5s cubic-bezier(0.3, 1.12, 0.45, 1);
  will-change: transform;
  transform-style: preserve-3d;
}
.half img {
  position: absolute;
  top: 0;
  width: 200%;
  height: 100%;
  display: block;
  backface-visibility: hidden;
}
/* The lining on the back of each door, seen once it has swung past
   edge-on. */
.half .inner,
.half::after {
  -webkit-mask: url("coat.png") 0 0 / 200% 100% no-repeat;
  mask: url("coat.png") 0 0 / 200% 100% no-repeat;
}
.half.right .inner,
.half.right::after {
  -webkit-mask-position: 100% 0;
  mask-position: 100% 0;
}
.half .inner {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, #1e4a44, #183f3b);
  transform: rotateY(180deg);
  backface-visibility: hidden;
}
.half.left {
  left: 0;
  width: calc(50% + 1px);
  transform-origin: left center;
}
.half.left img {
  left: 0;
}
.half.right {
  left: calc(50% - 1px);
  width: calc(50% + 1px);
  transform-origin: right center;
}
.half.right img {
  right: 0;
}
/* Light leaves the inside face of each door as it turns. */
.half::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0) 20%,
    rgba(0, 0, 0, 0.35) 100%
  );
  opacity: 0;
  transition: opacity 1.1s ease;
}
.half.right::after {
  background: linear-gradient(
    to left,
    rgba(0, 0, 0, 0) 20%,
    rgba(0, 0, 0, 0.35) 100%
  );
}
.coat:hover .half.left,
.coat:focus-visible .half.left {
  transform: rotateY(-12deg);
}
.coat:hover .half.right,
.coat:focus-visible .half.right {
  transform: rotateY(12deg);
}
.stage.open .half.left {
  transform: rotateY(-150deg);
}
.stage.open .half.right {
  transform: rotateY(150deg);
}
.stage.open .half::after {
  opacity: 1;
}
.stage.open .coat {
  animation: none;
}
.stage.open {
  cursor: auto;
}
.stage.open .shadow {
  animation: none;
  opacity: 0;
}
/* Then the view dives into the coat. */
.stage.zoom .coat {
  transform: scale(2.8) translateY(6%);
  opacity: 0;
}
/* Inside the coat. */
.inside {
  position: relative;
  z-index: 1;
  display: none;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  color: #fff;
  text-align: center;
}
.stage.done .closed-view {
  display: none;
}
.stage.done .inside {
  display: block;
}
/* While it enters, the inside floats over the stage so nothing shifts;
   once its entrance is done it settles into the flow. */
.stage.done:not(.settled) .inside {
  position: absolute;
  inset: 0;
  padding: 24px 16px 92px;
  max-width: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;
  overflow: hidden;
}
.stage.done:not(.settled) .inside > * {
  width: 100%;
  max-width: 640px;
}
.stage.done:not(.settled) .inside > .pill,
.stage.done:not(.settled) .inside > .cue {
  width: auto;
}
.inside .pill {
  animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.1s both;
}
.inside h1 {
  font-size: clamp(32px, 6.4vw, 50px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 20px 0 34px;
}
.inside h1 .w {
  display: inline-block;
  animation: word 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(0.2s + var(--i) * 0.07s);
}
.inside h1 .accent {
  color: var(--lime);
}
/* Focus moves here for screen readers after the coat opens; no ring. */
.inside h1:focus {
  outline: none;
}
.features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  text-align: left;
}
.features li {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  animation: card 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(0.55s + var(--n) * 0.11s);
  transition:
    transform 0.4s ease,
    background 0.4s ease;
}
.features li:nth-child(1) {
  --n: 0;
}
.features li:nth-child(2) {
  --n: 1;
}
.features li:nth-child(3) {
  --n: 2;
}
.features li:nth-child(4) {
  --n: 3;
}
.features li:nth-child(5) {
  --n: 4;
}
.features li:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.1);
}
.features .icon {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--lime);
  display: grid;
  place-items: center;
  box-shadow: 0 6px 18px rgba(217, 240, 126, 0.25);
}
/* The app's own tab icons (Ionicons outline), so the site matches it. */
.features .icon svg {
  width: 26px;
  height: 26px;
  color: var(--ink);
  fill: none;
  stroke: currentColor;
  stroke-width: 32;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.features .icon .dots {
  fill: currentColor;
  stroke: none;
}
.features h2 {
  margin: 0 0 2px;
  font-size: 18px;
}
.features p {
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 15px;
  line-height: 1.45;
}
.inside .price {
  margin: 28px 0 0;
  color: rgba(255, 255, 255, 0.74);
  animation: rise 0.7s ease 1.05s both;
}
.cue {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-top: 26px;
  color: var(--lime);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  animation: rise 0.7s ease 1.25s both;
}
.cue svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: nudge 1.8s ease-in-out 1.6s infinite;
}

/* The tour: each screen in a phone, revealed as it scrolls into view. */
.tour {
  max-width: 1040px;
  margin: 0 auto;
  padding: 72px 16px 24px;
  display: grid;
  gap: 72px;
}
.tour-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: center;
  justify-items: center;
  text-align: center;
}
@media (min-width: 820px) {
  .tour-item {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    text-align: left;
    justify-items: stretch;
  }
  .tour-item:nth-child(even) .phone {
    order: 2;
  }
  .tour-item .copy {
    max-width: 420px;
  }
  .tour-item:nth-child(odd) .copy {
    justify-self: start;
  }
  .tour-item:nth-child(even) .copy {
    justify-self: end;
  }
}
.phone {
  position: relative;
  width: min(68vw, 280px);
  padding: 10px;
  border-radius: 46px;
  background: #0f1f1d;
  box-shadow:
    0 30px 60px -20px rgba(15, 31, 29, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  justify-self: center;
}
/* The screen ends in a home-indicator strip, the colour of the app's tab
   bar, so the frame's rounded corners clip that and not the tab labels. */
.phone img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 36px 36px 0 0;
}
.phone::after {
  content: "";
  display: block;
  height: 26px;
  border-radius: 0 0 36px 36px;
  background: #fcfdf9;
}
.phone .home {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: 34%;
  height: 4px;
  border-radius: 2px;
  background: #0f1f1d;
  translate: -50% 0;
}
.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.tour h2 {
  margin: 0 0 10px;
  font-size: clamp(24px, 3.4vw, 32px);
  line-height: 1.18;
  letter-spacing: -0.02em;
}
.tour .copy p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}
.closing {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 16px 72px;
  text-align: center;
}
.closing h2 {
  font-size: clamp(28px, 5vw, 40px);
  letter-spacing: -0.02em;
  margin: 18px 0 10px;
}
.closing p {
  color: var(--muted);
  font-size: 18px;
  margin: 0;
}
/* Scroll reveals. */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition:
    opacity 0.5s ease-out,
    transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
/* Flat transforms only: Safari rasterises a 3D-tilted layer at a lower
   resolution and can keep that blurry copy, so the phone rises and grows
   without the tilt. */
.reveal .phone {
  transform: translateY(32px) scale(0.95);
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reveal.in {
  opacity: 1;
  transform: none;
}
.reveal.in .phone {
  transform: none;
}
/* A gentle drift on the phones as the page scrolls, where supported. */
@supports (animation-timeline: view()) {
  .reveal.in .phone {
    animation: drift linear both;
    animation-timeline: view();
    animation-range: entry 0% exit 100%;
  }
}

@keyframes float {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -14px;
  }
}
@keyframes shadow {
  0%,
  100% {
    transform: scaleX(1);
    opacity: 1;
  }
  50% {
    transform: scaleX(0.82);
    opacity: 0.6;
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes word {
  from {
    opacity: 0;
    transform: translateY(0.55em);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: blur(0);
  }
}
@keyframes card {
  from {
    opacity: 0;
    transform: translateY(26px) scale(0.97);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: blur(0);
  }
}
@keyframes nudge {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(6px);
  }
}
@keyframes drift {
  from {
    translate: 0 28px;
  }
  to {
    translate: 0 -28px;
  }
}
/* Without JavaScript the content is simply there. */
html:not(.js) .closed-view {
  display: none;
}
html:not(.js) .lining-layer {
  clip-path: none;
}
html:not(.js) .inside {
  display: block;
}
html:not(.js) .reveal {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .coat,
  .coat .back,
  .hook,
  .hook .w,
  .shadow,
  .half,
  .half::after,
  .lining-layer,
  .inside .pill,
  .inside h1 .w,
  .features li,
  .inside .price,
  .cue,
  .cue svg,
  .reveal,
  .reveal .phone {
    animation: none;
    transition: none;
  }
  .reveal,
  .reveal .phone {
    opacity: 1;
    transform: none;
  }
}
