/* K-Chow — comic pop palette & readable mobile typography */

:root {
  --cream: #fff8ec;
  --chocolate: #3b2317;
  --white: #ffffff;
  --font-body: "Quicksand", system-ui, sans-serif;
  --max-copy: 44rem;
  --stanza-line-size: clamp(2.05rem, 4.5vmin + 3vw, 4.5rem);
  /* Space reserved at bottom of viewport so the next stanza peeks in */
  --stanza-peek-space: clamp(3rem, 12vmin, 6rem);
  --content-pad-top: calc(env(safe-area-inset-top, 0px) + 0.75rem);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--chocolate);
  background: radial-gradient(
    circle at 50% 22%,
    #fff5e8 0%,
    #ffeef6 35%,
    #ffffff 65%
  );
  font-family: var(--font-body);
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  line-height: 1.55;
  letter-spacing: 0.01em;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.75rem;
  padding: 0.5rem 1rem;
  background: var(--cream);
  color: var(--chocolate);
  border-radius: 999px;
  z-index: 50;
  font-weight: 700;
}

.skip-link:focus {
  left: 0.75rem;
}

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

.scene {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.rays {
  position: absolute;
  inset: -45%;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 200, 120, 0.42) 0deg 5deg,
    rgba(255, 182, 193, 0.38) 5deg 10deg,
    rgba(255, 255, 255, 0) 10deg 18deg
  );
  opacity: 0.58;
  animation: spin-rays 120s linear infinite;
}

@keyframes spin-rays {
  to {
    transform: rotate(360deg);
  }
}

.content {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: var(--content-pad-top) clamp(1.25rem, 5vw, 2.5rem)
    clamp(3rem, 8vw, 5rem);
  text-align: center;
}

@media (min-width: 768px) {
  .content {
    padding-bottom: clamp(4rem, 10vh, 8rem);
  }
}

.message {
  width: 100%;
  max-width: var(--max-copy);
  margin: 0 auto;
}

.stanza {
  margin: 0;
  box-sizing: border-box;
  /* One “screen” minus top padding and bottom peek — centers copy vertically */
  min-height: calc(
    100vh - var(--content-pad-top) - var(--stanza-peek-space)
  );
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

@supports (height: 100dvh) {
  .stanza {
    min-height: calc(
      100dvh - var(--content-pad-top) - var(--stanza-peek-space)
    );
  }
}

.stanza:last-child {
  margin-bottom: clamp(2rem, 8vh, 5rem);
}
.stanza__build,
.stanza__headline {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--stanza-line-size);
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: 0.02em;
  color: var(--chocolate);
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.95),
    0 0 28px rgba(255, 248, 236, 0.85), 0 1px 2px rgba(255, 255, 255, 0.9);
}

.stanza__headline {
  margin: 0.45rem 0 0;
}

.stanza--closing {
  margin-top: 0;
}

.stanza--closing .stanza__headline {
  margin: 0;
}

/* Fixed caret — hints at vertical scroll; fades after first scroll (see scripts/scroll-caret.js) */
.scroll-caret {
  position: fixed;
  bottom: calc(
    env(safe-area-inset-bottom, 0px) + clamp(1.1rem, 4vmin, 2rem)
  );
  left: 50%;
  translate: -50% 0;
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-width: clamp(5rem, 18vmin, 8rem);
  min-height: clamp(5rem, 18vmin, 8rem);
  padding: 1.25rem 2rem;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--chocolate);
  opacity: 0.72;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.scroll-caret:focus-visible {
  outline: 2px solid var(--chocolate);
  outline-offset: 4px;
  border-radius: 6px;
  opacity: 1;
}

.scroll-caret--hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.scroll-caret__chevron {
  width: clamp(1.15rem, 3.6vmin, 1.55rem);
  height: clamp(1.15rem, 3.6vmin, 1.55rem);
  border-right: 4px solid currentColor;
  border-bottom: 4px solid currentColor;
  transform: rotate(45deg);
  animation: scroll-caret-nudge 1.35s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.95));
}

.scroll-caret__chevron + .scroll-caret__chevron {
  margin-top: -0.42rem;
  opacity: 0.88;
  animation-delay: 0.12s;
}

@keyframes scroll-caret-nudge {
  0%,
  100% {
    transform: translateY(0) rotate(45deg);
  }
  45% {
    transform: translateY(13px) rotate(45deg);
  }
  70% {
    transform: translateY(5px) rotate(45deg);
  }
}

.footer {
  position: relative;
  z-index: 1;
  padding: 2rem 1rem 3rem;
  text-align: center;
}

.footer-note {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: rgba(59, 35, 23, 0.55);
}

.footer-note a,
.footer-note a:visited,
.footer-note a:focus-visible,
.footer-note a:hover,
.footer-note a:active {
  color: inherit;
  text-decoration: none;
}

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

  .scroll-caret__chevron {
    animation: none;
  }
}
