@font-face {
  font-family: "Comfortaa";
  src: url("assets/Comfortaa.ttf") format("truetype");
  font-weight: 300 700;
  font-display: swap;
}

@font-face {
  font-family: "Nunito Sans";
  src: url("assets/NunitoSans.ttf") format("truetype");
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --cream: #f4f0e9;
  --sage-deep: #173b2b;
  --sage: #4e8b63;
  --sage-light: #a7d6ad;
  --amber-deep: #6e3c0d;
  --amber: #d79c25;
  --amber-light: #ffe08a;
  --shadow: rgba(3, 10, 8, 0.72);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: #0d1813;
}

body {
  font-family: "Nunito Sans", sans-serif;
  color: var(--cream);
}

button {
  font: inherit;
}

.scene {
  position: relative;
  min-height: 100svh;
  isolation: isolate;
  overflow: hidden;
  opacity: 1;
  transition: opacity 520ms ease;
}

.scene.is-leaving {
  opacity: 0;
}

.scene__image {
  position: absolute;
  z-index: -4;
  inset: -4%;
  background-image: url("assets/first-person-autumn-v3-glass-ferns.png");
  background-position: center center;
  background-size: cover;
  transform: scale(1.045) translate3d(0, 0, 0);
  transform-origin: 60% 60%;
  transition: transform 1800ms cubic-bezier(.2, .72, .2, 1), filter 1200ms ease;
  will-change: transform;
}

.scene__shade {
  position: absolute;
  z-index: -3;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 58% 60% at 19% 34%, rgba(4, 15, 11, 0.5) 0%, rgba(5, 18, 14, 0.22) 52%, transparent 78%),
    linear-gradient(90deg, rgba(3, 13, 10, 0.32) 0%, transparent 52%),
    linear-gradient(0deg, rgba(2, 9, 7, 0.34) 0%, transparent 37%);
}

.hero-copy {
  position: absolute;
  z-index: 5;
  top: clamp(56px, 10vh, 116px);
  left: clamp(30px, 5.4vw, 108px);
  max-width: min(88vw, 1320px);
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.78), 0 1px 2px rgba(0, 0, 0, 0.92);
}

.eyebrow {
  margin: 0 0 14px;
  font-size: clamp(12px, 1vw, 16px);
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(232, 240, 226, 0.88);
  opacity: 0;
  animation: reveal-copy 900ms 220ms ease forwards;
}

h1 {
  margin: 0;
  font-family: "Comfortaa", sans-serif;
  font-size: clamp(36px, 4.15vw, 76px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.035em;
  white-space: nowrap;
  color: #fffaf1;
  opacity: 0;
  transform: translateY(12px);
  animation: reveal-copy 1100ms 420ms cubic-bezier(.2, .75, .25, 1) forwards;
}

.step-message {
  min-height: 1.6em;
  margin: 22px 0 0;
  padding-left: 17px;
  border-left: 3px solid rgba(255, 222, 138, 0.74);
  font-size: clamp(18px, 1.45vw, 27px);
  font-weight: 650;
  letter-spacing: 0.01em;
  color: rgba(255, 250, 239, 0.96);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 520ms ease, transform 520ms ease;
}

.step-message.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.actions {
  position: absolute;
  z-index: 6;
  left: clamp(30px, 5.4vw, 108px);
  top: clamp(370px, 55vh, 610px);
  display: flex;
  align-items: center;
  gap: clamp(18px, 2vw, 34px);
}

.glass-button {
  position: relative;
  display: grid;
  grid-template-columns: 54px auto;
  align-items: center;
  gap: 10px;
  min-width: clamp(210px, 17vw, 286px);
  min-height: 82px;
  padding: 11px 27px 11px 16px;
  overflow: hidden;
  border-radius: 28px 17px 31px 20px / 22px 28px 18px 30px;
  border: 2px solid rgba(255, 255, 255, 0.48);
  color: #f8f4ea;
  cursor: pointer;
  opacity: 0;
  transform: translateY(18px) scale(.97);
  backdrop-filter: blur(7px) saturate(1.3);
  -webkit-backdrop-filter: blur(7px) saturate(1.3);
  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.58),
    inset 0 -12px 22px rgba(8, 17, 13, 0.32),
    inset 9px 0 18px rgba(255, 255, 255, 0.08),
    0 18px 38px rgba(0, 0, 0, 0.32),
    0 0 28px rgba(255, 222, 138, 0.1);
  transition: transform 360ms cubic-bezier(.2, .8, .2, 1), box-shadow 360ms ease, border-color 360ms ease;
}

.glass-button::before,
.glass-button::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.glass-button::before {
  inset: 5px;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.23);
  box-shadow: inset 0 0 22px rgba(255, 255, 255, 0.12);
}

.glass-button::after {
  top: 7px;
  right: 18px;
  left: 70px;
  height: 23%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  filter: blur(7px);
}

.glass-button--first {
  background:
    radial-gradient(circle at 78% 23%, rgba(202, 241, 192, 0.31), transparent 33%),
    linear-gradient(145deg, rgba(82, 145, 101, 0.86), rgba(22, 67, 47, 0.9) 54%, rgba(14, 45, 33, 0.92));
  animation: reveal-button 900ms 1850ms cubic-bezier(.2, .8, .2, 1) forwards;
}

.glass-button--next {
  background:
    radial-gradient(circle at 78% 23%, rgba(255, 239, 164, 0.42), transparent 34%),
    linear-gradient(145deg, rgba(224, 165, 31, 0.9), rgba(142, 83, 15, 0.91) 58%, rgba(83, 45, 8, 0.94));
  animation: reveal-button 900ms 2250ms cubic-bezier(.2, .8, .2, 1) forwards;
}

.glass-button__leaf {
  position: relative;
  z-index: 2;
  width: 54px;
  height: 54px;
  object-fit: contain;
  filter: drop-shadow(0 5px 7px rgba(0, 0, 0, 0.34));
  transform: rotate(-18deg);
}

.glass-button--next .glass-button__leaf {
  transform: rotate(14deg);
}

.glass-button__label {
  position: relative;
  z-index: 2;
  font-family: "Nunito Sans", sans-serif;
  font-size: clamp(19px, 1.42vw, 25px);
  font-weight: 800;
  letter-spacing: 0.015em;
  text-shadow:
    0 2px 1px rgba(0, 0, 0, 0.58),
    0 -1px 0 rgba(255, 255, 255, 0.23),
    0 0 12px rgba(255, 255, 255, 0.13);
}

.glass-button:hover,
.glass-button:focus-visible,
.glass-button[aria-pressed="true"] {
  transform: translateY(-5px) scale(1.02);
  border-color: rgba(255, 255, 255, 0.78);
  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.68),
    inset 0 -13px 24px rgba(4, 16, 10, 0.34),
    0 22px 44px rgba(0, 0, 0, 0.38),
    0 0 38px rgba(255, 231, 154, 0.24);
}

.glass-button:focus-visible {
  outline: 3px solid rgba(244, 240, 233, 0.94);
  outline-offset: 6px;
}

.leaves {
  position: absolute;
  z-index: 3;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  perspective: 900px;
}

.leaf {
  position: absolute;
  top: -18vh;
  left: var(--x);
  width: var(--size);
  height: var(--size);
  object-fit: contain;
  opacity: var(--alpha);
  filter: blur(var(--blur)) drop-shadow(0 6px 7px rgba(0, 0, 0, 0.25));
  animation: leaf-fall var(--duration) var(--delay) linear infinite;
  transform-origin: 50% 45%;
  will-change: transform;
}

.leaf[data-depth="near"] {
  z-index: 3;
}

.leaf[data-depth="mid"] {
  z-index: 2;
}

.leaf[data-depth="far"] {
  z-index: 1;
}

.scene.state-first .scene__image {
  transform: scale(1.1) translate3d(-1.2%, -2.4%, 0);
}

.scene.state-first .leaf {
  animation-play-state: paused;
}

.scene.state-next .scene__image {
  transform: scale(1.18) translate3d(-3.5%, -4.2%, 0);
  filter: saturate(1.05) brightness(1.04);
}

.scene.state-next .leaf {
  animation: leaf-clear 1350ms cubic-bezier(.18, .75, .3, 1) forwards;
}

.proof-note {
  position: absolute;
  z-index: 8;
  right: 22px;
  bottom: 16px;
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .55);
  text-shadow: 0 1px 4px rgba(0, 0, 0, .85);
}

@keyframes reveal-copy {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes reveal-button {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes leaf-fall {
  0% {
    transform: translate3d(0, -12vh, 0) rotateX(var(--rx)) rotateY(var(--ry)) rotateZ(var(--rz));
  }
  33% {
    transform: translate3d(calc(var(--drift) * .42), 38vh, 70px) rotateX(calc(var(--rx) + 140deg)) rotateY(calc(var(--ry) - 90deg)) rotateZ(calc(var(--rz) + 120deg));
  }
  67% {
    transform: translate3d(calc(var(--drift) * -.18), 79vh, -40px) rotateX(calc(var(--rx) + 260deg)) rotateY(calc(var(--ry) + 110deg)) rotateZ(calc(var(--rz) + 230deg));
  }
  100% {
    transform: translate3d(var(--drift), 128vh, 20px) rotateX(calc(var(--rx) + 390deg)) rotateY(calc(var(--ry) + 260deg)) rotateZ(calc(var(--rz) + 360deg));
  }
}

@keyframes leaf-clear {
  to {
    opacity: 0;
    transform: translate3d(calc(var(--drift) * 3), -48vh, 420px) rotateX(540deg) rotateY(-420deg) rotateZ(520deg) scale(1.2);
  }
}

@media (max-width: 1100px) {
  h1 {
    font-size: clamp(34px, 4vw, 46px);
  }

  .actions {
    top: auto;
    bottom: 12vh;
  }

  .glass-button {
    min-width: 220px;
  }
}

@media (max-width: 760px) {
  html,
  body {
    overflow: auto;
  }

  .scene {
    min-height: 100svh;
  }

  .scene__image {
    inset: -2%;
    background-position: 64% center;
  }

  .scene__shade {
    background:
      linear-gradient(180deg, rgba(4, 14, 10, .68) 0%, rgba(4, 14, 10, .2) 48%, rgba(4, 14, 10, .54) 100%),
      linear-gradient(90deg, rgba(3, 12, 8, .24), transparent 85%);
  }

  .hero-copy {
    top: 52px;
    left: 24px;
    right: 24px;
    max-width: none;
  }

  h1 {
    max-width: 12ch;
    font-size: clamp(37px, 10.5vw, 56px);
    line-height: 1.06;
    white-space: normal;
  }

  .step-message {
    max-width: 18ch;
    font-size: 19px;
  }

  .actions {
    left: 24px;
    right: 24px;
    bottom: 7vh;
    display: grid;
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .glass-button {
    width: min(100%, 320px);
    min-width: 0;
    min-height: 68px;
    grid-template-columns: 44px auto;
    border-radius: 24px 15px 25px 18px / 18px 23px 16px 25px;
  }

  .glass-button__leaf {
    width: 44px;
    height: 44px;
  }

  .proof-note {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }

  .leaf {
    display: none;
  }
}
