@property --card-rotation-progress {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

@property --radial-progress {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

:where(h3) {
  margin-block-end: var(--size-3);
}

/*.container {*/
/*  max-width: 80rem;*/
/*  padding-inline: var(--size-5);*/
/*  margin-block: 2rem;*/
/*  margin-inline: auto;*/
/*}*/

.hero {
  container-type: inline-size;
  min-height: 60vh;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--size-5);

  .hero__title {
    font-size: var(--font-size-fluid-3);
    text-align: center;

    background-image: var(--gradient-10);
    background-clip: text;
    color: transparent;

    @container (width > 40rem) {
      font-size: calc(var(--font-size-8) * 1.5);
    }
  }

  .hero__payoff {
    font-size: var(--font-size-fluid-1);
    text-align: center;
    font-weight: var(--font-weight-9);
  }
}

.grid-center {
  display: grid;
  place-items: center;
}

.section {
  container-type: inline-size;
  position: relative;

  .section__title {
    margin-block: 0 var(--size-fluid-2);
  }
}

.calendar-container {
  overflow: hidden;
  position: relative;
  perspective: 1000px;
}

.calendar-wide {
  transform-style: preserve-3d;
  width: 100%;
  aspect-ratio: 2/1;

  animation: calendarLargeAppear 1ms linear, calendarLargeFadeIn 1s ease-out;
  animation-timeline: scroll(root), auto;
  animation-range: -10% 20%;
}

.calendar-mobile {
  width: 22rem;
  aspect-ratio: 1/1.5;
  position: absolute;
  inset: auto 5% 3% auto;
  z-index: 1;
  opacity: 0;

  animation: calendarSmallAppear 1ms cubic-bezier(0.17, 0.67, 0.34, 1.36)
    forwards;
  animation-timeline: scroll(root);
  animation-range: 5% 25%;
}

.calendar {
  width: 100%;
  aspect-ratio: 1/1.5;
  object-fit:cover;

  background: var(--blue-1);
  border-radius: var(--radius-3);
  border: 4px solid var(--gray-0);
  box-shadow: var(--shadow-3);

  @container (width > 40rem) {
    width: 100%;
    height: 100%;
    aspect-ratio: initial;
  }
}

.panel {
  box-shadow: var(--shadow-3);
  background: var(--gray-1);

  border-radius: var(--radius-3);
  color: var(--gray-8);

  code {
    color: var(--text-1);
  }
}

.panel--no-overflow {
  overflow: clip;
}

.panel__content {
  padding: var(--size-fluid-4);
}

.divider-v {
  display: grid;
  gap: var(--size-fluid-6);
}

.split-h {
  display: grid;
  gap: 1rem;

  @container (width > 48.7rem) {
    grid-template-columns: repeat(2, 1fr);
  }
}

.cards {
  container-type: inline-size;

  position: relative;
  height: 50vh;
  width: min(100%, 350px);

  clip-path: polygon(-50% -50%, 400% -50%, 150% 100%, -80% 100%);

  margin-inline: auto;
  margin-block-start: -20%;
}

.card {
  --index: sibling-index();
  --count: sibling-count();

  --angle-min: -45;
  --angle-max: 45;
  --angle-diff: calc(var(--angle-max) - var(--angle-min));
  --angle-step: calc(var(--angle-diff) / (var(--count) + 1));
  --angle: calc(var(--angle-min) + var(--angle-step) * var(--index));
  --angle-deg: calc((var(--angle) * var(--card-rotation-progress)) * 1deg);

  width: 100%;

  position: absolute;
  transform-origin: bottom center;
  rotate: var(--angle-deg);
  translate: 0 50%;

  animation: cardUp 1ms ease-out both, cardRotate 1ms ease-out forwards;
  animation-timeline: view(block);
  animation-range: entry 100% contain 50%;
}

.popup-container {
  display: grid;
  gap: 1rem;

  @container (width > 40rem) {
    grid-template-columns: repeat(3, 1fr);
  }
}

.cover-image {
  clip-path: shape(
    from 100% 0,
    line to 90% 0%,
    curve to 90% 100% with 50% 10% / 50% 90%,
    line to 100% 100%,
    close
  );

  animation: imageShape 1ms linear forwards;
  animation-timeline: view(block);
  animation-range: entry 60% contain 35%;
}

.review {
  --index: sibling-index();
  --count: sibling-count();

  --entry-start: 20%;
  --entry-step: calc((100% - var(--entry-start)) / (var(--count) + 1));
  --entry: calc(var(--entry-start) + var(--index) * var(--entry-step));

  background: var(--gray-1);
  width: 100%;
  border-radius: var(--radius-3);
  padding: var(--size-fluid-4);

  color: var(--gray-8);

  animation: reviewUp 1ms ease-out both;
  animation-timeline: view(block);
  animation-range: entry var(--entry) contain 50%;

  h3 {
    font-size: var(--font-size-fluid-1);
    margin-block-end: var(--size-fluid-3);
  }
}
/*
.spinner {
  --progress: calc(var(--radial-progress) * 360deg);
  --border-width: 10px;

  position: relative;

  width: 10rem;
  aspect-ratio: 1/1;
  border-radius: 50%;
  border: 10px solid var(--gray-0);

  display: grid;
  place-items: center;

  box-shadow: var(--shadow-3);

  animation: radialProgress 1ms ease-out forwards;
  animation-timeline: view(block);
  animation-range: entry 100% contain 90%;
}

.spinner__progress {
  position: absolute;
  inset: 0;

  border-radius: 50%;

  width: 100%;
  aspect-ratio: 1;
  background: conic-gradient(
    from 0deg,
    #8b5cf6 0deg,
    #8b5cf6 var(--progress, 0deg),
    transparent var(--progress, 0deg)
  );

  mask: radial-gradient(
    circle,
    transparent 0,
    transparent calc(50% - 5px),
    black calc(50% - var(--border-width)),
    black 100%
  );
}

.spinner::before {
  --progress-fixed: calc(var(--radial-progress) * 100);
  counter-reset: variable var(--progress-fixed);
  content: "" counter(variable) "%";

  position: relative;
  z-index: 10;

  font-size: 1.5rem;
  font-weight: var(--font-weight-7);
}

.footer {
  height: 50dvh;
}

p + p {
  margin-block: var(--size-fluid-2) 0;
}*/

@keyframes calendarLargeAppear {
  from {
    transform: translateZ(-40rem) rotateX(45deg);
  }
  to {
    transform: translateZ(0rem) rotateX(0deg);
  }
}

@keyframes calendarLargeFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes calendarSmallAppear {
  from {
    opacity: 0;
    transform: translateX(50%);
  }
  to {
    opacity: 1;
    transform: translateX(0%);
  }
}

@keyframes cardUp {
  from {
    translate: 0 80%;
  }
  to {
    translate: 0 20%;
  }
}

@keyframes cardRotate {
  from {
    --card-rotation-progress: 0;
  }
  to {
    --card-rotation-progress: 1;
  }
}

@keyframes radialProgress {
  from {
    --radial-progress: 0;
  }
  to {
    --radial-progress: 1;
  }
}

@keyframes imageShape {
  50% {
    clip-path: shape(
      from 100% 0,
      line to 50% 0%,
      curve to 50% 100% with -10% 10% / -10% 90%,
      line to 100% 100%,
      close
    );
  }

  100% {
    clip-path: shape(
      from 100% 0,
      line to 0% 0%,
      curve to 0% 100% with 0% 0% / 0% 100%,
      line to 100% 100%,
      close
    );
  }
}

@keyframes reviewUp {
  from {
    translate: 0 40%;
  }
  to {
    translate: 0 0%;
  }
}