:root {
  /* Light palette */
  --bg-color: rgb(239, 245, 255);
  --bg-color-alt: rgb(208, 216, 228);
  --text-color: rgb(57, 74, 102);
  --hearts-muted-color: rgba(57, 74, 102, 0.22);
  --window-bg: rgb(223, 232, 246);
  --window-bg-alt: rgb(232, 240, 252);
  --window-border-color: rgba(0, 0, 0, 0.08);
  --masked-circle-bg: rgb(245, 249, 255);
  --masked-window-bg: rgb(32, 49, 78);
  --button-bg: rgb(18, 18, 18);
  --button-text: rgb(239, 245, 255);
  --circle-bg-opacity: 0.5;
  --circle-shadow-white: rgba(255, 255, 255, 0.3);
  --circle-shadow-white-outline: rgb(211, 224, 244);

  /* Breathing circle sizing (base) */
  --mask-circle-min: 111.5px;
  --mask-circle-max: 223px;
  --circle-min: 112.5px;
  --circle-max: 225px;

  /* Intro timing */
  --windows-intro-duration: 700ms;
  --windows-intro-stagger: 100ms;
  /* 6 windows → duration + (5 * stagger) */
  --windows-intro-total: calc(var(--windows-intro-duration) + (5 * var(--windows-intro-stagger)));

  /* Circle intro animation */
  --circle-intro-duration: 1200ms;
  --circle-intro-start-x: 0px;
  --circle-intro-start-y: 0px;

  /* Container overlay */
  --container-overlay-opacity: 0.05;
  --stat-number-shadow: 1.5px 1.5px 1px rgba(0,0,0,0.05);

  /* Dark-mode glow + window-edge shine (driven by --circle-offset-x/y) */
  --shine-orb-size: 100vh;
  --shine-orb-opacity: 0;
  --window-shine-opacity: 0;
  --window-shine-border: 1px;
  --shine-color-1: rgba(120, 170, 255, 0.55);
  --shine-color-2: rgba(40, 120, 255, 0.18);
}

[data-theme="dark"] {
  /* Dark palette */
  --bg-color: rgb(6, 6, 6);
  --bg-color-alt: rgb(12, 12, 12);
  --text-color: rgb(109, 109, 109);
  --hearts-muted-color: rgba(109, 109, 109, 0.22);
  --window-bg: rgb(12, 12, 12);
  --window-bg-alt: rgb(6, 6, 6);
  --window-border-color: rgba(255, 255, 255, 0.08);
  --masked-circle-bg: rgb(8, 13, 24);
  --masked-window-bg: rgb(51, 72, 110);
  --button-bg: rgb(228, 237, 252);
  --button-text: rgb(10, 16, 28);
  --circle-bg-opacity: 0.2;
  --circle-shadow-white: rgba(255, 255, 255, 0.3);
  --circle-shadow-white-outline: rgb(13, 22, 38);
  --container-overlay-opacity: 0.10;
  --stat-number-shadow: 1.5px 1.5px 1px rgba(0,0,0,0.3);

  /* Enable the background glow + border shine in dark mode */
  --shine-orb-opacity: 0.18;
  --window-shine-opacity: .3;
}

body {
  background-color: var(--bg-color);
  font-family: 'SF Pro Display', 'Inter', 'Helvetica Neue', sans-serif;
  margin: 0;
  transition: background-color 0.3s ease;
  position: relative;
}

/* Dark-mode “light orb” behind everything (100vh circle that follows the breathing circle).
   On .container so it scrolls with the hero and relates to the top part. */
.container::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--shine-orb-size);
  height: var(--shine-orb-size);
  transform: translate(-50%, -50%)
    translate3d(var(--circle-offset-x, 0px), var(--circle-offset-y, 0px), 0);
  background-image: radial-gradient(
    circle at 50% 50%,
    rgba(120, 170, 255, 0.35) 0%,
    rgba(40, 120, 255, 0.12) 22%,
    rgba(0, 0, 0, 0) 62%
  );
  filter: blur(36px);
  opacity: var(--shine-orb-opacity);
  pointer-events: none;
  z-index: 0;
}


.container {
  width: 100%;
  height: 100vh;
  min-height: 1000px;
  position: relative;
  overflow: hidden;
  padding: 20px;
  box-sizing: border-box;
}

.container-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('./noise.png');
  background-size: 250px 250px;
  background-position: 0 0;
  background-repeat: repeat;
  z-index: 1;
  opacity: var(--container-overlay-opacity);
  mix-blend-mode: multiply;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.container-caption {
  position: absolute;
  bottom: 0;
  white-space: nowrap;
  left: 50%;
  z-index: 10000;
  font-size: 13px;
  color: var(--text-color);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
  transform: translateX(-50%) translateY(100%);
  background-color: var(--bg-color-alt);
  padding: 9px 50px 12px 50px;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  cursor: pointer;
}

[data-theme="dark"] .container-caption {
  box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.15) inset;
}


@media (max-width: 768px) {
  .container-caption {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    margin-top: 20px;
    text-align: center;
  }
}

.container-caption svg.container-caption-arrow {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  margin-left: 4px;
  vertical-align: -5px;
}

.container-caption svg.container-caption-corner {
  width: 20px;
  height: 20px;
  position: absolute;
  bottom: 0;
  left: -20px;
  path {
    fill: var(--bg-color-alt);
    transition: fill 0.3s ease;
  }
  &:nth-of-type(2) {
    left: auto;
    right: -20px;
    scale: -1 1;
  }
}

.container-caption.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  transition: opacity 0.3s ease 1s, transform 0.3s ease 1s, background-color 0.3s ease;
}


.container-caption:hover {
  .container-caption-text {
    transform: translateY(20px);
  }
  
}

/* 100vh section below the hero for scroll-driven parallax; content sits here */
.parallax-spacer {
  width: 100%;
  height: 100vh;
  min-height: 900px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-color-alt);
  transition: background-color 0.3s ease;
  position: relative;
  overflow: hidden;
}

.parallax-spacer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('./noise.png');
  background-size: 250px 250px;
  background-position: 0 0;
  background-repeat: repeat;
  z-index: 0;
  opacity: var(--container-overlay-opacity);
  mix-blend-mode: multiply;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

/* Breathing exercise split layout */
.breathing-exercise {
  display: flex;
  width: 100%;
  max-width: 1200px;
  gap: 60px;
  align-items: center;
  justify-content: center;
  padding: 40px;
  position: relative;
  z-index: 1;
}

.breathing-ticker {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 200px;
  opacity: 0;
  transition: opacity 1s ease;
  margin-top: 50px;
}

.parallax-spacer.in-view .breathing-ticker {
  opacity: 1;
}

.ticker-line {
  color: var(--text-color);
  font-size: 24px;
  line-height: 1.4;
  text-align: center;
  transition: opacity 100ms ease, color 100ms ease, transform 100ms ease;
  font-weight: 400;
  transform: translateY(0);
}

.ticker-line.active {
  opacity: 1;
  color: var(--text-color);
}

.ticker-line.next {
  opacity: 0.5;
  color: var(--text-color);
}

.ticker-line.dimmed {
  opacity: 0.25;
  color: var(--text-color);
}

.ticker-line:nth-of-type(1) {
  opacity: 0;
}

.breathing-circle-container {
  flex: 1;
  max-width: 500px;
  aspect-ratio: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  border-radius: 20px;
  background-color: var(--bg-color-alt);
  transition: background-color 0.3s ease, opacity 1s ease;
  isolation: isolate;
  opacity: 0;
}

.parallax-spacer.in-view .breathing-circle-container{
  opacity: 1;
}

.breathing-circle-container::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: linear-gradient(to right, rgba(120, 139, 191, 0.3), rgba(97, 102, 117, 0.3));
  padding: 1px;
  -webkit-mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  z-index: 1;
}

.breathing-circle-container .caption {
  position: absolute;
  bottom: -2rem;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  display: table;
  white-space: nowrap;
  z-index: 2;
  transition: opacity 0.3s ease;
  font-size: 13px;
  color: var(--text-color);
}

.breathing-circle,
.breathing-instruction,
.restart-button {
  position: relative;
  z-index: 2;
}

.breathing-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--bg-color-alt);
  background-image: radial-gradient(circle at 25% 25%, rgba(160, 185, 255, 0.219) 0%, rgba(2, 48, 98, 0.055) 70%);
  backdrop-filter: blur(17px);
  -webkit-backdrop-filter: blur(17px);
  box-shadow: 5px 10px 10px 0 rgba(0, 0, 0, 0.05), 2px 4px 5px 0 rgba(0, 0, 0, 0.05), 1px 1.5px 1.5px 0 var(--circle-shadow-white) inset, -1.5px -1.5px 1.5px 0 var(--circle-shadow-white) inset, 0 0 3px 1px var(--circle-shadow-white-outline);
  transition: background-color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease 500ms;
  will-change: width, height, opacity;
  opacity: 0;
}

[data-theme="dark"] .breathing-circle {
  background-color: rgba(255, 255, 255, 0.169);
}

.parallax-spacer.in-view .breathing-circle {
  opacity: 1;
  width: 80px;
  height: 80px;
}


.breathing-instruction {
  margin-top: 30px;
  color: var(--text-color);
  font-size: 18px;
  font-weight: 400;
  text-transform: lowercase;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.in-view .breathing-instruction.visible {
  opacity: 1;
}

.breathing-instruction-wrapper {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  /* opacity: 0;
  transition: opacity 1s ease; */
}


.parallax-spacer.in-view .breathing-instruction-wrapper {
  opacity: 1;
}


.restart-button {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0.6;
  transition: opacity 0.2s ease, transform 0.3s ease;
  z-index: 10;
}

.restart-button:hover {
  opacity: 1;
  transform: rotate(180deg);
}

.restart-button:active {
  transform: rotate(180deg) scale(0.9);
}

.restart-button svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 768px) {
  .parallax-spacer {
    padding-inline: 16px;
    box-sizing: border-box;
  }

  .breathing-exercise {
    flex-direction: column;
    gap: 40px;
    padding: 20px;
  }

  .breathing-ticker {
    min-height: auto;
  }

  .ticker-line {
    font-size: 20px;
  }

  .breathing-circle-container {
    max-width: 100%;
    width: 100%;
    max-width: 400px;

    &::before {
      border-radius: 0;
      border-right: none;
      border-left: none;
    }
  }
}


.header-controls {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1000;
}

.cta-button {
  padding: 8px 24px;
  background-color: var(--button-bg);
  color: var(--button-text);
  text-decoration: none;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  pointer-events: auto;
}

.cta-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cta-button:active {
  transform: translateY(0);
}

.theme-toggle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background-color: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background-color 0.3s ease, transform 0.2s ease;
  overflow: hidden;
}

.theme-toggle:hover {
  transform: scale(1.05);
}

.theme-toggle:active {
  transform: scale(0.95);
}

.theme-toggle .icon {
  width: 20px;
  height: 20px;
  position: absolute;
  color: var(--text-color);
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.theme-toggle .sun-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.theme-toggle .moon-icon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

.theme-toggle.dark .sun-icon {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

.theme-toggle.dark .moon-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

h1 {
  color: var(--text-color);
  font-size: 40px;
  line-height: 1;
  margin: 0;
  font-weight: 200;
  transition: color 0.3s ease;
  z-index: 1000;
  position: fixed;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-image: linear-gradient(to right, rgba(120, 139, 191, 0.522), rgba(97, 102, 117, 0.739));
  background-size: 100% 100%;
  background-position: 0 0;
  background-repeat: no-repeat;
  animation: background-position 10s linear infinite;
  animation-direction: alternate;
  animation-timing-function: ease-in-out;
}

.footer {
  color: var(--text-color);
  font-size: 12px;
  transition: color 0.3s ease;
  z-index: 1000;
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  opacity: .5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: calc(100% - 40px);
  svg {
    width: 14px;
    height: 14px;
    vertical-align: -3px;
  }
}

a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

p {
  color: var(--text-color);
  font-size: 20px;
  transition: color 0.3s ease;
}

.window {
  background-color: var(--window-bg);
  position: absolute;
  border-radius: 22px;
  translate: 0 var(--parallax-y, 0);
  transition: background-color 0.3s ease, translate 800ms cubic-bezier(0.2, 0.9, 0.2, 1);
  box-sizing: border-box;

  /* One-time intro animation (applies to both outer + masked-circle windows) */
  animation-duration: var(--windows-intro-duration);
  animation-timing-function: cubic-bezier(0.2, 0.9, 0.2, 1);
  animation-fill-mode: both;
  animation-iteration-count: 1;

  box-shadow: 0 0 0 var(--window-shine-border, 1px) var(--window-border-color) inset;
}

/* Window border-only “shine” layer (masked so only the border gets the gradient) */
.container > .window::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: var(--window-shine-border);
  pointer-events: none;
  opacity: var(--window-shine-opacity);

  /* A large (100vh) gradient that shifts with the same offsets as the circle */
  background-image: radial-gradient(
    circle at 50% 50%,
    var(--shine-color-1) 0%,
    var(--shine-color-2) 22%,
    rgba(0, 0, 0, 0) 62%
  );
  background-size: var(--shine-orb-size) var(--shine-orb-size);
  background-attachment: scroll;
  background-position:
    calc(50% + var(--circle-offset-x, 0px))
    calc(50% + var(--circle-offset-y, 0px));

  /* Keep only the border area (outer minus inner) */
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;

  /* Make it feel like a 3D edge highlight */
  mix-blend-mode: screen;
  z-index: 2;
}

/* --- Hover: lift bento cards slightly --- */
@media (hover: hover) and (pointer: fine) {
  .container > .window:hover {
    translate: 0 calc(var(--parallax-y, 0) - 4px);
  }
}

/* During scroll parallax, skip translate transition so it follows scroll 1:1 */
body.parallax-active .container > .window {
  transition: background-color 0.3s ease;
}
@media (hover: hover) and (pointer: fine) {
  body.parallax-active .container > .window:hover {
    translate: 0 calc(var(--parallax-y, 0) - 4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .container > .window {
    transition: background-color 0.3s ease;
  }

  .container > .window:hover {
    translate: 0 0;
  }
}

.window-1 {
  /* initial configuration */
  /* width: 347px;
  height: 260px;
  transform: translate(calc(-100% + 40px), calc(-100% + 5px)); */
  /* animated configuration */
  width: 509px;
  height: 386px;
  transform: translate(calc(-100% + 40px), calc(-100% + 5px));

  top: 50%;
  left: 50%;
  animation-name: window-1-intro;
  animation-delay: calc(0 * var(--windows-intro-stagger));

  /* --- Window 1 content (toolbar + popover + chevron) --- */
  position: absolute;
  overflow: hidden;

  /* Layout constants */
  --window-1-left-inset: 0px; /* used as the inset reference for toolbar + chevron */
  --window-1-top-inset: 0;

  /* Multiple background images:
     - toolbar at top (inset by --window-1-left-inset / --window-1-top-inset)
     - chevron pointing at the circle in the toolbar (355px from left inset)
     - popover centered */
  background-image:
    url('./popover.png'),
    radial-gradient(
      circle at 50% calc(50% - 20px),
      rgba(0, 132, 255, 0.233) 0%,
      rgba(0, 133, 255, 0.00) 100%
    );
  background-repeat:
    no-repeat,
    no-repeat;
  background-size:
    390px auto,
    100% 100%;
  background-position:
    center calc(50% - 20px),
    center center;

  background-color: transparent;
}

.window-1 .caption {
  position: absolute;
  inset-inline: 0;
  bottom: 30px;
  text-align: center;
  text-wrap: balance;
  box-sizing: border-box;
  color: var(--text-color);
  font-size: 15px;
  line-height: 1.3;
  padding-inline: 40px;
  mix-blend-mode: screen;
}

.window-1 .caption .caption-link {
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.window-1 .toolbar {
  --window-1-toolbar-height: 32px;
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background-image: url('./toolbar.png');
  background-repeat: no-repeat;
  background-size: 509px var(--window-1-toolbar-height);
  background-position: right var(--window-1-left-inset) top var(--window-1-top-inset);
  mix-blend-mode: screen;
  pointer-events: none;
}

/* Don't show the caption inside the masked circle */
.masked-circle-content .window-1::after {
  content: none;
}

/* --- Window content reveal (match stats reveal elegance) --- */
:root {
  --window-content-reveal-duration: 520ms;
  --window-content-reveal-stagger: 80ms;
  --window-content-reveal-offset: 6px;
  /* Start content reveal near the end of each window's intro */
  --window-content-reveal-after-intro: calc(var(--windows-intro-duration) - 180ms);
}

@keyframes window-content-reveal {
  0% {
    opacity: 0;
    transform: translateY(var(--window-content-reveal-offset));
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Window 1: caption fades/slides in */
.window-1 .caption {
  opacity: 0;
  transform: translateY(var(--window-content-reveal-offset));
  animation: window-content-reveal var(--window-content-reveal-duration) ease both;
  animation-delay: calc((0 * var(--windows-intro-stagger)) + var(--window-content-reveal-after-intro));
}

/* Window 2: hearts then bottom copy/cta with a gentle stagger */
.window-2 .pricing-hearts,
.window-2 .pricing-bottom > * {
  opacity: 0;
  transform: translateY(var(--window-content-reveal-offset));
  animation: window-content-reveal var(--window-content-reveal-duration) ease both;
}

.window-2 .pricing-hearts {
  animation-delay: calc((1 * var(--windows-intro-stagger)) + var(--window-content-reveal-after-intro));
}

.window-2 .pricing-bottom > :nth-child(1) {
  animation-delay: calc((1 * var(--windows-intro-stagger)) + var(--window-content-reveal-after-intro) + (0 * var(--window-content-reveal-stagger)));
}
.window-2 .pricing-bottom > :nth-child(2) {
  animation-delay: calc((1 * var(--windows-intro-stagger)) + var(--window-content-reveal-after-intro) + (1 * var(--window-content-reveal-stagger)));
}
.window-2 .pricing-bottom > :nth-child(3) {
  animation-delay: calc((1 * var(--windows-intro-stagger)) + var(--window-content-reveal-after-intro) + (2 * var(--window-content-reveal-stagger)));
}
.window-2 .pricing-bottom > :nth-child(4) {
  animation-delay: calc((1 * var(--windows-intro-stagger)) + var(--window-content-reveal-after-intro) + (3 * var(--window-content-reveal-stagger)));
}

/* Window 3: icon, title, copy */
.window-3 .feature-title,
.window-3 .feature-copy {
  opacity: 0;
  transform: translateY(var(--window-content-reveal-offset));
  animation: window-content-reveal var(--window-content-reveal-duration) ease both;
}

/* --- Apple logo "power on" (single pass: fade + slide + glow) --- */
:root {
  --apple-power-on-duration: 5800ms;
  --apple-power-on-delay: calc((2 * var(--windows-intro-stagger)) + var(--window-content-reveal-after-intro) + 100ms);
}

@keyframes apple-power-on {
  0% {
    opacity: 0;
    transform: translateY(var(--window-content-reveal-offset));
    filter: brightness(0.85) drop-shadow(0 0 0 rgba(0, 133, 255, 0));
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: brightness(1) drop-shadow(0 0 34px rgba(0, 133, 255, 0.33));
  }
}

.window-3 .feature-icon {
  opacity: 0;
  transform: translateY(var(--window-content-reveal-offset));
  filter: brightness(0.85) drop-shadow(0 0 0 rgba(0, 133, 255, 0));
  will-change: opacity, transform, filter;
  animation: apple-power-on var(--apple-power-on-duration) cubic-bezier(0.2, 0.9, 0.2, 1) both;
  animation-delay: var(--apple-power-on-delay);
}
.window-3 .feature-title {
  animation-delay: calc((2 * var(--windows-intro-stagger)) + var(--window-content-reveal-after-intro) + (1 * var(--window-content-reveal-stagger)));
}
.window-3 .feature-copy {
  animation-delay: calc((2 * var(--windows-intro-stagger)) + var(--window-content-reveal-after-intro) + (2 * var(--window-content-reveal-stagger)));
}

@media (prefers-reduced-motion: reduce) {
  .window-1 .caption,
  .window-2 .pricing-hearts,
  .window-2 .pricing-bottom > *,
  .window-3 .feature-title,
  .window-3 .feature-copy {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .window-3 .feature-icon {
    animation: none;
    opacity: 1;
    transform: none;
    filter: brightness(1) drop-shadow(0 0 34px rgba(0, 133, 255, 0.33));
  }
}
.window-2 {
  /* initial configuration */
  /* width: 265px;
  height: 264px;
  transform: translate(calc(-100% + 43px), calc(-100% + 296px)); */
  /* animated configuration */
  width: 265px;
  height: 390px;
  transform: translate(calc(-100% + 43px), calc(-100% + 425px));
  top: 50%;
  left: 50%;
  animation-name: window-2-intro;
  animation-delay: calc(1 * var(--windows-intro-stagger));

  /* content layout only (keep window look unchanged) */
  display: flex;

  &:after {
    content: '';
    height: 100px;
    position: absolute;
    display: block;
    inset-block-start: 0;
    inset-inline: 0;
    background-image: linear-gradient(to bottom, var(--window-bg), transparent);
    z-index: 1;
    pointer-events: none;
    border-start-start-radius: 22px;
    border-start-end-radius: 22px;
  }
}

/* Prefer an animatable overlay: solid color + gradient mask */
@supports ((-webkit-mask-image: linear-gradient(#000, transparent)) or (mask-image: linear-gradient(#000, transparent))) {
  .window-2::after {
    background-image: none;
    background-color: var(--window-bg);
    transition: background-color 0.3s ease;
    -webkit-mask-image: linear-gradient(to bottom, #000, transparent);
    mask-image: linear-gradient(to bottom, #000, transparent);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
  }
}

.pricing-tile {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;

}

.pricing-hearts {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
}

.pricing-hearts svg {
  width: 260px;
  height: auto;
  display: block;
  color: var(--hearts-muted-color, var(--text-color));
  margin-block-start: -5px;
  margin-inline: -51px;
}

.pricing-hearts use {
  opacity: 1;
  cursor: pointer;
  pointer-events: auto;

  /* Hover in immediately; hover out lingers 500ms */
  transition-property: color, opacity;
  transition-duration: 160ms, 160ms;
  transition-timing-function: ease, ease;
  transition-delay: 500ms, 500ms;
}

.pricing-hearts use.is-accent {
  opacity: 1;
  color: var(--text-color);
}

.pricing-hearts use:hover {
  opacity: 1;
  color: var(--text-color);
  transition-delay: 0ms, 0ms;
}

@media (prefers-reduced-motion: reduce) {
  .pricing-hearts use {
    transition: none;
  }
  .pricing-hearts use:hover {
    opacity: 1;
  }
}

.pricing-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
}

.pricing-kicker {
  color: var(--text-color);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.5;
}

.pricing-title {
  color: var(--text-color);
  font-size: 28px;
  line-height: 1.05;
}

.pricing-copy {
  color: var(--text-color);
  font-size: 12px;
  line-height: 1.45;
  opacity: 0.7;
}

.pricing-cta {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 30px;
  border-radius: 20px;
  background-color: var(--button-bg);
  color: var(--button-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.pricing-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25);
}

.pricing-cta:active {
  transform: translateY(0);
  opacity: 0.9;
}

.window-3 {
  /* initial configuration */
  /* width: 308px;
  height: 305px;
  transform: translate(calc(-100% + 373px), calc(-100% + 156px)); */
  /* animated configuration */
  width: 408px;
  height: 305px;
  transform: translate(calc(-100% + 475px), calc(-100% + 156px));
  top: 50%;
  left: 50%;
  
  animation-name: window-3-intro;
  animation-delay: calc(2 * var(--windows-intro-stagger));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.feature-tile {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
}

.feature-icon {
  width: 150px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-icon svg {
  width: 150px;
  height: auto;
  display: block;
}

/* (animation handled on .window-3 .feature-icon for a single-pass reveal) */

.feature-title {
  color: var(--text-color);
  font-size: 34px;
}

.feature-copy {
  color: var(--text-color);
  font-size: 12px;
  line-height: 1.35;
  opacity: 0.55;
  max-width: 260px;
}

.window-4 {
  /* initial configuration */
  /* width: 210px;
  height: 210px;
  top: 50%;
  left: 50%;
  transform: translate(66px, calc(-100% - 170px)); */
  /* animated configuration */
  width: 410px;
  height: 210px;
  transform: translate(66px, calc(-100% - 170px));
  top: 50%;
  left: 50%;
  background-color: var(--window-bg-alt);

  animation-name: window-4-intro;
  animation-delay: calc(3 * var(--windows-intro-stagger));
}

.window-5 {
  /* initial configuration */
  /* width: 250px;
  height: 245px;
  transform: translate(66px, calc(180px)); */
  /* animated configuration */
  width: 405px;
  height: 245px;
  transform: translate(70px, calc(180px));
  top: 50%;
  left: 50%;
  
  background-color: var(--window-bg-alt);

  animation-name: window-5-intro;
  animation-delay: calc(4 * var(--windows-intro-stagger));
}

.window-6 {
  /* initial configuration */
  /* width: 220px;
  height: 220px;
  transform: translate(calc(-100% - 250px), 34px); */
  /* animated configuration */
  width: 220px;
  height: 390px;
  transform: translate(calc(-100% - 250px), 34px);
  top: 50%;
  left: 50%;
  background-color: var(--window-bg-alt);

  animation-name: window-6-intro;
  animation-delay: calc(5 * var(--windows-intro-stagger));
}

/* Window intro keyframes (from initial → animated config) */
@keyframes window-1-intro {
  0% {
    width: 347px;
    height: 260px;
    transform: translate(calc(-100% + 40px), calc(-100% + 5px));
    opacity: 0;
  }
  100% {
    width: 509px;
    height: 386px;
    transform: translate(calc(-100% + 40px), calc(-100% + 5px));
    opacity: 1;
  }
}

@keyframes window-2-intro {
  0% {
    width: 265px;
    height: 264px;
    transform: translate(calc(-100% + 43px), calc(-100% + 296px));
    opacity: 0;
  }
  100% {
    width: 265px;
    height: 390px;
    transform: translate(calc(-100% + 43px), calc(-100% + 425px));
    opacity: 1;
  }
}

@keyframes window-3-intro {
  0% {
    width: 308px;
    height: 305px;
    transform: translate(calc(-100% + 373px), calc(-100% + 156px));
    opacity: 0;
  }
  100% {
    width: 408px;
    height: 305px;
    transform: translate(calc(-100% + 475px), calc(-100% + 156px));
    opacity: 1;
  }
}

@keyframes window-4-intro {
  0% {
    width: 210px;
    height: 210px;
    transform: translate(66px, calc(-100% - 170px));
    opacity: 0;
  }
  100% {
    width: 410px;
    height: 210px;
    transform: translate(66px, calc(-100% - 170px));
    opacity: 1;
  }
}

@keyframes window-5-intro {
  0% {
    width: 250px;
    height: 245px;
    transform: translate(70px, calc(180px));
    opacity: 0;
  }
  100% {
    width: 405px;
    height: 245px;
    transform: translate(70px, calc(180px));
    opacity: 1;
  }
}

@keyframes window-6-intro {
  0% {
    width: 220px;
    height: 220px;
    transform: translate(calc(-100% - 250px), 34px);
    opacity: 0;
  }
  100% {
    width: 220px;
    height: 390px;
    transform: translate(calc(-100% - 250px), 34px);
    opacity: 1;
  }
}

/* --- Stats tiles (windows 4, 5, 6) --- */
.window-4,
.window-5,
.window-6 {
  padding: 14px 14px 12px;
}

.stat-tile {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-number {
  font-size: 70px;
  line-height: 1;
  font-weight: 300;
  background-image: linear-gradient(
    to bottom right,
    rgba(120, 139, 191, 0.8),
    rgba(80, 110, 191, 0.035)
  );
  background-size: 100% 100%;
  text-shadow: var(--stat-number-shadow);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}


.stat-headline {
  color: var(--text-color);
  font-size: 13px;
  line-height: 1.2;
  font-weight: 600;
}

.stat-copy {
  color: var(--text-color);
  font-size: 12px;
  line-height: 1.35;
  opacity: 0.85;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  line-clamp: 6;
  -webkit-line-clamp: 6;
}

.stat-source {
  margin-top: auto;
  color: var(--text-color);
  font-size: 12px;
  line-height: 1.2;
  opacity: 0.55;
  font-weight: 500;
  text-decoration: none;
  display: inline;
}

.stat-source::after {
  content: '';
  display: inline-block;
  width: 0.88em;
  height: 0.88em;
  margin-left: 0.3em;
  vertical-align: -0.08em;
  opacity: 0.55;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%2024%2024%27%3E%3Cpath%20fill%3D%27black%27%20d%3D%27M14%203a1%201%200%201%200%200%202h3.586L10.293%2014.293a1%201%200%200%200%201.414%201.414L21%206.414V10a1%201%200%201%200%202%200V4a1%201%200%200%200-1-1h-8ZM5%205a2%202%200%200%200-2%202v12a2%202%200%200%200%202%202h12a2%202%200%200%200%202-2v-6a1%201%200%201%200-2%200v6H5V7h6a1%201%200%201%200%200-2H5Z%27/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%2024%2024%27%3E%3Cpath%20fill%3D%27black%27%20d%3D%27M14%203a1%201%200%201%200%200%202h3.586L10.293%2014.293a1%201%200%200%200%201.414%201.414L21%206.414V10a1%201%200%201%200%202%200V4a1%201%200%200%200-1-1h-8ZM5%205a2%202%200%200%200-2%202v12a2%202%200%200%200%202%202h12a2%202%200%200%200%202-2v-6a1%201%200%201%200-2%200v6H5V7h6a1%201%200%201%200%200-2H5Z%27/%3E%3C/svg%3E") no-repeat center / contain;
}

.stat-source:hover {
  opacity: 0.75;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.stat-source:focus-visible {
  outline: 2px solid rgba(160, 185, 255, 0.55);
  outline-offset: 3px;
  border-radius: 6px;
}

.stat-headline,
.stat-copy,
.stat-source {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 450ms ease, transform 450ms ease;
}

body.stats-reveal .stat-headline {
  opacity: 1;
}

body.stats-reveal .stat-copy {
  opacity: 0.85;
}

body.stats-reveal .stat-source {
  opacity: 0.55;
}

body.stats-reveal .stat-source:hover {
  opacity: 0.75;
}

body.stats-reveal .stat-source:focus-visible {
  outline: 2px solid rgba(160, 185, 255, 0.55);
  outline-offset: 3px;
  border-radius: 6px;
}

body.stats-reveal .stat-headline,
body.stats-reveal .stat-copy,
body.stats-reveal .stat-source {
  transform: translateY(0);
}


.masked-circle {
  width: 40px;
  height: 40px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  overflow: hidden;
  border-radius: 50%;
  background-color: var(--masked-circle-bg);
  z-index: 1;
  animation: 
    circle-intro-size var(--circle-intro-duration) cubic-bezier(0.25, 0.46, 0.45, 0.94) 2000ms forwards,
    pulse-width 16s ease-in-out calc(var(--windows-intro-total) + var(--circle-intro-duration) + 2000ms) infinite,
    pulse-height 16s ease-in-out calc(var(--windows-intro-total) + var(--circle-intro-duration) + 2000ms) infinite;
  will-change: width, height, transform;
  transition: background-color 0.3s ease;
  pointer-events: none;
  .window {
    background-color: var(--masked-window-bg);
    transition: background-color 0.3s ease;
  }
}

.masked-circle.intro-complete {
  transform: translate(-50%, -50%)
    translate3d(var(--circle-offset-x, 0px), var(--circle-offset-y, 0px), 0);
}

.masked-circle-content {
  position: absolute;
  inset: 0;
  transform: translate3d(
    calc(var(--circle-offset-x, 0px) * -1),
    calc(var(--circle-offset-y, 0px) * -1),
    0
  );
  will-change: transform;
}

.circle {
  width: 40px;
  height: 40px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%)
    translateZ(0)
    translateX(var(--force-repaint, 0px));
  border-radius: 50%;
  background-color: rgba(255, 255, 255, var(--circle-bg-opacity));
  background-image: radial-gradient(circle at 25% 25%, rgba(160, 185, 255, 0.519) 0%, rgba(2, 48, 98, 0.055) 70%);
  backdrop-filter: blur(17px);
  -webkit-backdrop-filter: blur(17px);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  isolation: isolate;
  overflow: hidden;
  z-index: 2;
  box-shadow: 5px 10px 10px 0 rgba(0, 0, 0, 0.05), 2px 4px 5px 0 rgba(0, 0, 0, 0.05), 1px 1.5px 1.5px 0 var(--circle-shadow-white) inset, -1.5px -1.5px 1.5px 0 var(--circle-shadow-white) inset, 0 0 3px 1px var(--circle-shadow-white-outline);
  animation: 
    circle-intro-size-circle var(--circle-intro-duration) cubic-bezier(0.25, 0.46, 0.45, 0.94) 2000ms forwards,
    pulse-width-circle 16s ease-in-out calc(var(--windows-intro-total) + var(--circle-intro-duration) + 2000ms) infinite,
    pulse-height-circle 16s ease-in-out calc(var(--windows-intro-total) + var(--circle-intro-duration) + 2000ms) infinite;
  will-change: width, height, transform;
  contain: layout style paint;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.circle.intro-complete {
  transform: translate(-50%, -50%)
    translate3d(var(--circle-offset-x, 0px), var(--circle-offset-y, 0px), 0)
    translateZ(0)
    translateX(var(--force-repaint, 0px));
}

/* Circle intro animations - movement is handled by JavaScript */

@keyframes circle-intro-size {
  0% {
    width: 40px;
    height: 40px;
  }
  100% {
    width: var(--mask-circle-min);
    height: var(--mask-circle-min);
  }
}

@keyframes circle-intro-size-circle {
  0% {
    width: 40px;
    height: 40px;
  }
  100% {
    width: var(--circle-min);
    height: var(--circle-min);
  }
}

@keyframes pulse-width {
  0% {
    width: var(--mask-circle-min);
  }
  25% {
    width: var(--mask-circle-min);
  }
  50% {
    width: var(--mask-circle-max);
  }
  75% {
    width: var(--mask-circle-max);
  }
  100% {
    width: var(--mask-circle-min);
  }
}

@keyframes pulse-height {
  0% {
    height: var(--mask-circle-min);
  }
  25% {
    height: var(--mask-circle-min);
  }
  50% {
    height: var(--mask-circle-max);
  }
  75% {
    height: var(--mask-circle-max);
  }
  100% {
    height: var(--mask-circle-min);
  }
}

@keyframes pulse-width-circle {
  0% {
    width: var(--circle-min);
  }
  25% {
    width: var(--circle-min);
  }
  50% {
    width: var(--circle-max);
  }
  75% {
    width: var(--circle-max);
  }
  100% {
    width: var(--circle-min);
  }
}

@keyframes pulse-height-circle {
  0% {
    height: var(--circle-min);
  }
  25% {
    height: var(--circle-min);
  }
  50% {
    height: var(--circle-max);
  }
  75% {
    height: var(--circle-max);
  }
  100% {
    height: var(--circle-min);
  }
}

/* --- Very large screens: scale up the bento composition --- */
@media (min-width: 2000px) {
  :root {
    --mask-circle-min: 140px;
    --mask-circle-max: 280px;
    --circle-min: 142px;
    --circle-max: 284px;
  }

  .window-1 {
    width: 640px;
    height: 486px;
    transform: translate(calc(-100% + 60px), calc(-100% + 10px));
    background-size:
      480px auto,
      100% 100%;
  }

  .window-1 .toolbar {
    --window-1-toolbar-height: 40px;
    background-size:
      640px var(--window-1-toolbar-height),
      100% 100%;
  }

  .window-2 {
    width: 340px;
    height: 490px;
    transform: translate(calc(-100% + 55px), calc(-100% + 530px));
  }

  .pricing-hearts svg {
    width: 340px;
    margin-block-start: -10px;
    margin-inline: 0;
  }

  .window-3 {
    width: 510px;
    height: 382px;
    transform: translate(calc(-100% + 590px), calc(-100% + 195px));
  }

  .window-4 {
    width: 512px;
    height: 262px;
    transform: translate(90px, calc(-100% - 215px));
  }

  .window-5 {
    width: 506px;
    height: 306px;
    transform: translate(90px, calc(225px));
  }

  .window-6 {
    width: 275px;
    height: 490px;
    transform: translate(calc(-100% - 310px), 45px);
  }

  /* Match the intro animations to the larger final geometry */
  @keyframes window-1-intro {
    0% {
      width: 434px;
      height: 325px;
      transform: translate(calc(-100% + 60px), calc(-100% + 10px));
      opacity: 0;
    }
    100% {
      width: 640px;
      height: 486px;
      transform: translate(calc(-100% + 60px), calc(-100% + 10px));
      opacity: 1;
    }
  }

  @keyframes window-2-intro {
    0% {
      width: 340px;
      height: 330px;
      transform: translate(calc(-100% + 55px), calc(-100% + 370px));
      opacity: 0;
    }
    100% {
      width: 340px;
      height: 490px;
      transform: translate(calc(-100% + 55px), calc(-100% + 530px));
      opacity: 1;
    }
  }

  @keyframes window-3-intro {
    0% {
      width: 385px;
      height: 382px;
      transform: translate(calc(-100% + 470px), calc(-100% + 195px));
      opacity: 0;
    }
    100% {
      width: 510px;
      height: 382px;
      transform: translate(calc(-100% + 590px), calc(-100% + 195px));
      opacity: 1;
    }
  }

  @keyframes window-4-intro {
    0% {
      width: 262px;
      height: 262px;
      transform: translate(90px, calc(-100% - 215px));
      opacity: 0;
    }
    100% {
      width: 512px;
      height: 262px;
      transform: translate(90px, calc(-100% - 215px));
      opacity: 1;
    }
  }

  @keyframes window-5-intro {
    0% {
      width: 312px;
      height: 306px;
      transform: translate(90px, calc(225px));
      opacity: 0;
    }
    100% {
      width: 506px;
      height: 306px;
      transform: translate(90px, calc(225px));
      opacity: 1;
    }
  }

  @keyframes window-6-intro {
    0% {
      width: 275px;
      height: 275px;
      transform: translate(calc(-100% - 310px), 45px);
      opacity: 0;
    }
    100% {
      width: 275px;
      height: 490px;
      transform: translate(calc(-100% - 310px), 45px);
      opacity: 1;
    }
  }
}

@media (max-width: 768px) {
  
  h1 {
    font-size: 40px;
    position: relative;
    inset: auto;
    margin: 0 0 18px 0;
  }

  .container {
    height: auto;
    min-height: 0;
    overflow: visible;
    /* make room for the fixed header controls */
    padding: 92px 16px 28px;
  }

  .header-controls {
    top: 16px;
    right: 16px;
    left: 16px;
    justify-content: space-between;
  }

  .cta-button {
    padding: 10px 16px;
    text-align: center;
  }

  .container-overlay {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    height: auto;
  }


  /* Mobile layout: stack everything in normal flow */
  .window {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    translate: 0 0 !important;
    width: 100%;
    max-width: 560px;
    height: auto;
    margin: 0 auto 14px;
    animation: none;
  }

  /* Window-specific sizing adjustments */
  .window-1 {
    /* keep the “toolbar + popover” visible while being responsive */
    aspect-ratio: 509 / 386;
    background-position: center calc(50% - 20px) , center center;
    background-size:
      min(78%, 390px) auto,
      100% 100%;
  }

  .window-1 .toolbar {
    --window-1-toolbar-height: 24px;
    background-size:
      100% auto;
  }

  .window-1 .caption {
    padding-inline: 18px;
    font-size: 12px;
  }

  .pricing-hearts svg {
    width: min(260px, 72vw);
    margin-inline: 0;
  }

  /* Disable the center mask/circle on mobile (prevents duplicate window layers) */
  .masked-circle,
  .circle {
    display: none;
  }

  /* Also disable the glow/shine layers on mobile */
  .container::before,
  .container > .window::before {
    display: none;
  }

  /* Content reveal animations: keep everything visible on mobile */
  .window-1 .caption,
  .window-2 .pricing-hearts,
  .window-2 .pricing-bottom > *,
  .window-3 .feature-title,
  .window-3 .feature-copy {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .window-3 .feature-icon {
    animation: none;
    opacity: 1;
    transform: none;
    filter: brightness(1) drop-shadow(0 0 34px rgba(0, 133, 255, 0.33));
  }
}

/* --- Mobile: stacked layout (override desktop bento positioning) --- */
@media (max-width: 768px) {
  .window.window-1,
  .window.window-2,
  .window.window-3,
  .window.window-4,
  .window.window-5,
  .window.window-6 {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    width: 100% !important;
    max-width: 560px;
    height: auto !important;
    margin: 0 auto 14px;
    animation: none !important;
  }

}
