@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=DM+Mono:wght@400;500&display=swap');

:root {
  --cream: #fff4dc;
  --dark: #3e2717;
  --gold: #e5b650;
  --bronze: #8b541b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: 'DM Mono', monospace;
}

body {
  background: #ebd3ab;
  color: var(--dark);
}

button {
  font: inherit;
}

.stage {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(18px, 4vw, 42px);
  background: linear-gradient(180deg, #d2a960, #ffe9b8 47%, #dcb16d);
}

.sky-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -6;
  filter: sepia(.78) saturate(1.1) contrast(.88) brightness(1.12);
  opacity: .68;
  transform: scale(1.08);
}

.sky-tint {
  position: absolute;
  inset: 0;
  z-index: -5;
  background:
    linear-gradient(180deg, rgba(255, 249, 230, .5), rgba(254, 219, 148, .12) 41%, rgba(212, 143, 66, .34)),
    radial-gradient(ellipse at 50% 52%, rgba(255, 244, 202, .55), transparent 66%);
  pointer-events: none;
}

.sunburst {
  position: absolute;
  z-index: -4;
  left: 50%;
  top: 48%;
  width: 110vmax;
  height: 110vmax;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 249, 207, .4) 0deg 4deg, rgba(221, 151, 46, .02) 7deg 18deg);
  mask-image: radial-gradient(circle, transparent 0 9%, #000 22% 49%, transparent 70%);
  opacity: 0;
  animation: beams 10s ease-in-out both;
}

.sun-core {
  position: absolute;
  z-index: -3;
  left: 50%;
  top: 50%;
  width: 85vmin;
  height: 85vmin;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 255, 234, .98) 0%, rgba(255, 237, 159, .85) 19%, rgba(255, 198, 75, .5) 44%, transparent 72%);
  filter: blur(22px);
  opacity: 0;
  animation: core 10s ease-out both;
}

.grain {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: .08;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

.topline,
.bottomline {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: clamp(9px, 1.2vw, 12px);
  font-weight: 500;
  letter-spacing: .11em;
  text-shadow: 0 1px 8px #fff8;
}

.topline {
  border-bottom: 1px solid #60432380;
  padding-bottom: 14px;
}

.bottomline {
  border-top: 1px solid #60432380;
  padding-top: 14px;
  margin-bottom: 18px;
}

.reaction {
  z-index: 1;
  position: relative;
  display: flex;
  align-items: center;
  flex-direction: column;
  text-align: center;
  justify-content: center;
  flex: 1;
  padding: 35px 0 24px;
}

.prelude {
  font-size: clamp(9px, 1.2vw, 12px);
  letter-spacing: .26em;
  opacity: 0;
  animation: gentle 1.4s 1.2s ease-out forwards;
}

.hero-word {
  overflow: visible;
  max-width: 100%;
}

h1 {
  margin: 12px 0 3px;
  /* color: #7e4d18; */
  color: #ffd;
  font: 900 clamp(67px, 16vw, 290px)/.99 'Archivo Black', Impact, sans-serif;
  letter-spacing: -.09em;
  padding-right: .09em;
  transform: scale(.78) translateY(22px);
  opacity: 0;
  filter: blur(18px);
  text-shadow: 0 1px 0 #ffdf8e, 0 0 36px #ffd36a;
  animation: arrival 10s both, glow 3s 4s ease-in-out infinite alternate;
}

.prereaction{
  font-size: clamp(21px, 5vw, 100px);
  font-weight: 1;
  position: relative;
  top: clamp(25px, 3.8vw, 70px);
  text-align: left;
}

h1 span {
  color: #be5539;
}

.subtitle {
  position: relative;
  display: inline-block;
  background: #e6bc68;
  color: #4c301b;
  padding: 10px 15px;
  transform: rotate(-2deg) translateY(12px);
  font-size: clamp(9px, 1.4vw, 14px);
  letter-spacing: .09em;
  font-weight: 500;
  opacity: 0;
  animation: subtitle 1.2s 3.2s ease-out forwards;
  box-shadow: 4px 6px 0 #93611a30;
}
.subtitle span {
  font-size: clamp(12px, 1.4vw, 20px);
  font-weight: 1000;
}

.description {
  font-size: clamp(10px, 1.4vw, 13px);
  letter-spacing: .08em;
  margin-top: 22px;
  opacity: 0;
  animation: gentle 1.2s 4s forwards;
}

.replay {
  margin-top: 24px;
  padding: 9px 14px;
  background: #ffefcbad;
  color: #4e331e;
  border: 1px solid #78552a75;
  cursor: pointer;
  letter-spacing: .08em;
  font-size: 10px;
  opacity: 0;
  animation: gentle 1s 5s forwards;
  transition: background .2s, transform .2s;
}

.replay:hover {
  background: #ffefa6;
  transform: translateY(-2px);
}

.replay:focus-visible {
  outline: 3px solid #803d1e;
  outline-offset: 3px;
}

.credit {
  z-index: 3;
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  color: #573e29b8;
  font-size: 8px;
  text-decoration: none;
}

@keyframes core {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(.15);
  }

  22% {
    opacity: .12;
  }

  43% {
    opacity: .95;
    transform: translate(-50%, -50%) scale(1);
  }

  75%,
  100% {
    opacity: .75;
    transform: translate(-50%, -50%) scale(1.1);
  }
}

@keyframes beams {
  0%,
  12% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-10deg) scale(.2);
  }

  40% {
    opacity: .82;
  }

  70%,
  100% {
    opacity: .54;
    transform: translate(-50%, -50%) rotate(12deg) scale(1);
  }
}

@keyframes arrival {
  0%,
  18% {
    opacity: 0;
    filter: blur(18px);
    transform: scale(.8) translateY(28px);
  }

  36% {
    opacity: 1;
    filter: blur(0);
    transform: scale(1) translateY(0);
  }

  100% {
    opacity: 1;
    filter: blur(0);
    transform: scale(1) translateY(0);
  }
}

@keyframes glow {
  from {
    text-shadow: 0 1px 0 #fff3c1, 0 0 18px #fcd47a, 0 0 32px #ffd47a85;
  }

  to {
    text-shadow: 0 1px 0 #fff9d5, 0 0 26px #fff3a5, 0 0 78px #fff4c8, 0 0 125px #fff6c9;
  }
}

@keyframes gentle {
  to {
    opacity: 1;
  }
}

@keyframes subtitle {
  to {
    opacity: 1;
    transform: rotate(-2deg) translateY(0);
  }
}

.stage.replaying .sunburst,
.stage.replaying .sun-core,
.stage.replaying h1,
.stage.replaying .prelude,
.stage.replaying .subtitle,
.stage.replaying .description,
.stage.replaying .replay {
  animation: none;
}

@media (max-width: 580px) {
  .stage {
    padding: 16px 13px 25px;
  }

  .topline,
  .bottomline {
    font-size: 8px;
    letter-spacing: 0;
    gap: 15px;
  }

  .reaction {
    padding: 25px 0;
  }

  h1 {
    font-size: 16vw;
  }

  .subtitle {
    max-width: 95%;
    line-height: 1.5;
  }

  .credit {
    font-size: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sunburst {
    opacity: .35;
    animation: none;
  }

  .sun-core {
    opacity: .55;
    animation: none;
  }

  h1 {
    opacity: 1;
    filter: none;
    transform: none;
    animation: none;
  }

  .prelude,
  .subtitle,
  .description,
  .replay {
    opacity: 1;
    animation: none;
  }

  .subtitle {
    transform: rotate(-2deg);
  }

  .sky-video {
    display: none;
  }
}
