@font-face {
  font-family: "Pixelify Sans";
  src: url("assets/fonts/PixelifySans.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

html,
body {
  margin: 0;
  padding: 0;
  background: #140c2c;
}

body {
  min-height: 100vh;
  font-family: "Pixelify Sans", Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
  color: #fff8ea;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hero {
  position: relative;
  min-height: 100svh;
  height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 28%, #3a2460 0%, #1a1038 42%, #140c2c 72%, #0e091f 100%);
}

.stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.world,
.world img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.world img {
  object-fit: cover;
  object-position: center center;
  image-rendering: pixelated;
}

.fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.sun-glow {
  position: absolute;
  left: 50%;
  top: 32%;
  width: 28%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    circle,
    rgba(255, 236, 176, 0.55) 0%,
    rgba(246, 193, 90, 0.28) 34%,
    rgba(232, 148, 58, 0.1) 58%,
    rgba(196, 92, 42, 0) 74%
  );
  animation: glowpulse 4.5s ease-in-out infinite;
}

.stars span,
.embers span {
  position: absolute;
  display: block;
}

.stars span {
  background: #f6d56a;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  animation: twinkle 3.2s ease-in-out infinite;
  filter: drop-shadow(0 0 4px rgba(246, 193, 90, 0.8));
}

.stars span:nth-child(1)  { left: 10%; top: 16%; width: 9px; height: 9px; }
.stars span:nth-child(2)  { left: 18%; top: 9%;  width: 6px; height: 6px; animation-delay: 0.6s; }
.stars span:nth-child(3)  { left: 27%; top: 20%; width: 7px; height: 7px; animation-delay: 1.3s; }
.stars span:nth-child(4)  { left: 37%; top: 8%;  width: 5px; height: 5px; animation-delay: 0.2s; }
.stars span:nth-child(5)  { left: 63%; top: 7%;  width: 8px; height: 8px; animation-delay: 1.1s; }
.stars span:nth-child(6)  { left: 74%; top: 15%; width: 6px; height: 6px; animation-delay: 1.8s; }
.stars span:nth-child(7)  { left: 84%; top: 10%; width: 9px; height: 9px; animation-delay: 0.4s; }
.stars span:nth-child(8)  { left: 91%; top: 22%; width: 5px; height: 5px; animation-delay: 2s; }
.stars span:nth-child(9)  { left: 8%;  top: 38%; width: 5px; height: 5px; animation-delay: 1.5s; }
.stars span:nth-child(10) { left: 93%; top: 40%; width: 7px; height: 7px; animation-delay: 0.9s; }
.stars span:nth-child(11) { left: 14%; top: 72%; width: 6px; height: 6px; animation-delay: 2.2s; }
.stars span:nth-child(12) { left: 88%; top: 70%; width: 8px; height: 8px; animation-delay: 0.7s; }
.stars span:nth-child(13) { left: 22%; top: 86%; width: 5px; height: 5px; animation-delay: 1.6s; }
.stars span:nth-child(14) { left: 78%; top: 88%; width: 6px; height: 6px; animation-delay: 2.4s; }

.stars {
  position: absolute;
  inset: 0;
  animation: drift-slow 18s ease-in-out infinite;
}

.embers span {
  width: 4px;
  height: 4px;
  background: #ffb24a;
  box-shadow: 0 0 8px 2px rgba(255, 178, 74, 0.55);
  animation: ember-rise 9.5s linear infinite;
}

.embers span:nth-child(odd) {
  width: 3px;
  height: 3px;
  background: #ffe08a;
}

.embers span:nth-child(1)  { left: 18%; bottom: 8%;  animation-delay: 0s;    animation-duration: 10s; }
.embers span:nth-child(2)  { left: 28%; bottom: 12%; animation-delay: 1.4s;  animation-duration: 8.5s; }
.embers span:nth-child(3)  { left: 36%; bottom: 6%;  animation-delay: 3.1s;  animation-duration: 11s; }
.embers span:nth-child(4)  { left: 47%; bottom: 10%; animation-delay: 0.8s;  animation-duration: 9s; }
.embers span:nth-child(5)  { left: 54%; bottom: 7%;  animation-delay: 4.2s;  animation-duration: 10.5s; }
.embers span:nth-child(6)  { left: 62%; bottom: 14%; animation-delay: 2.2s;  animation-duration: 8s; }
.embers span:nth-child(7)  { left: 71%; bottom: 9%;  animation-delay: 5.1s;  animation-duration: 9.8s; }
.embers span:nth-child(8)  { left: 80%; bottom: 11%; animation-delay: 1.8s;  animation-duration: 11.2s; }
.embers span:nth-child(9)  { left: 12%; bottom: 18%; animation-delay: 6s;    animation-duration: 8.8s; }
.embers span:nth-child(10) { left: 88%; bottom: 16%; animation-delay: 3.6s;  animation-duration: 10.2s; }
.embers span:nth-child(11) { left: 42%; bottom: 4%;  animation-delay: 7.1s;  animation-duration: 9.4s; }
.embers span:nth-child(12) { left: 58%; bottom: 20%; animation-delay: 2.8s;  animation-duration: 12s; }

.site-header {
  position: absolute;
  top: 4.2%;
  left: 0;
  right: 0;
  z-index: 6;
  pointer-events: none;
}

.wordmark {
  margin: 0;
  text-align: center;
  font-size: clamp(1.05rem, 2.1vw, 1.45rem);
  font-weight: 600;
  letter-spacing: 0.28em;
  color: #fff8ea;
  text-shadow:
    0 0 18px rgba(246, 193, 90, 0.55),
    0 1px 0 #1a1038;
}

.walnut-hero {
  position: absolute;
  left: 50%;
  bottom: 11.5%;
  transform: translateX(-50%);
  z-index: 5;
  pointer-events: none;
  line-height: 0;
}

.walnut-on-island {
  display: block;
  height: 58vh;
  width: auto;
  max-width: 58vw;
  object-fit: contain;
  filter: drop-shadow(0 24px 20px rgba(16, 8, 28, 0.42));
}

.walnut-aura {
  position: absolute;
  left: 16%;
  top: 4%;
  width: 62%;
  height: 56%;
  background: radial-gradient(ellipse at 48% 48%,
    rgba(255, 220, 140, 0.42) 0%,
    rgba(246, 193, 90, 0.16) 46%,
    rgba(232, 148, 58, 0) 74%);
  filter: blur(14px);
  z-index: 1;
  animation: walnut-aura 3.6s ease-in-out infinite;
  pointer-events: none;
}

.walnut-sparkles {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.walnut-sparkles-back { z-index: 2; }
.walnut-on-island { position: relative; z-index: 3; }
.walnut-sparkles-front { z-index: 8; }

@keyframes walnut-aura {
  0%, 100% { opacity: 0.72; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

.copy-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 38%;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(18, 10, 36, 0) 0%,
    rgba(18, 10, 36, 0.28) 32%,
    rgba(18, 10, 36, 0.78) 68%,
    rgba(18, 10, 36, 0.94) 100%
  );
}

.copy {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  padding: 0 1.25rem 1.15rem;
  text-align: center;
  background: none;
}

.copy-inner {
  width: min(28rem, 90%);
  margin: 0 auto;
}

h1 {
  margin: 0;
  font-size: clamp(1.28rem, 2.8vw, 1.85rem);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: 0.01em;
  color: #fff8ea;
}

.lede {
  margin: 0.42rem 0 0;
  font-size: clamp(0.98rem, 1.7vw, 1.15rem);
  line-height: 1.35;
  color: #f6d56a;
}

.friend-line {
  margin: 0.5rem 0 0;
  font-size: clamp(0.92rem, 1.5vw, 1.02rem);
  color: #fff8ea;
}

.friend-line a {
  color: #f6c15a;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.friend-line a:hover {
  color: #ffe08a;
}

.friend-line a:focus-visible {
  outline: 2px solid #f6c15a;
  outline-offset: 3px;
  border-radius: 2px;
}

.rk-star {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  margin-right: 0.35rem;
  vertical-align: -0.05rem;
  background: linear-gradient(135deg, #ff6fae 0%, #2ec4c4 100%);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
}

@keyframes glowpulse {
  0%, 100% { opacity: 0.7; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
}

@keyframes twinkle {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

@keyframes drift-slow {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(6px, -10px, 0); }
}

@keyframes ember-rise {
  0% {
    transform: translateY(10px) scale(0.7);
    opacity: 0;
  }
  12% { opacity: 0.95; }
  80% { opacity: 0.7; }
  100% {
    transform: translateY(-85vh) scale(1);
    opacity: 0;
  }
}

@media (max-width: 720px) {
  .sun-glow {
    top: 21%;
    width: 48%;
  }

  .walnut-hero {
    bottom: 20%;
  }

  .walnut-on-island {
    height: auto;
    width: 90vw;
    max-width: 90vw;
    max-height: 50vh;
  }

  .copy {
    padding: 0 1rem 1.2rem;
  }

  .copy-fade {
    height: 34%;
  }

  .site-header {
    top: 5.2%;
  }

  .wordmark {
    font-size: clamp(1.05rem, 5vw, 1.25rem);
  }

  .copy {
    padding: 0 1rem 1.2rem;
  }

  .copy-inner {
    width: min(22rem, 92%);
  }

  h1 {
    font-size: clamp(1.28rem, 6vw, 1.65rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sun-glow,
  .stars,
  .stars span,
  .embers span,
  .walnut-aura {
    animation: none !important;
  }

  .walnut-aura { opacity: 0.8; transform: none; }

  .sun-glow {
    opacity: 0.8;
    transform: translate(-50%, -50%);
  }

  .stars span {
    opacity: 0.75;
  }

  .embers span {
    opacity: 0.55;
    transform: none;
  }
}

.walnut-hero.is-static .walnut-aura {
  animation: none !important;
  opacity: 0.8;
  transform: none;
}
