:root {
  --page: #fbf6ee;
  --text: #2a2233;
  --muted: #6b6175;
  --hill-far: #6d3a63;
  --sans: "Satoshi", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #15121c;
    --text: #f0e9df;
    --muted: #b1a8bc;
    --hill-far: #3a2547;
  }
}

* { box-sizing: border-box; }

html {
  height: 100%;
  overflow: hidden;
  background: var(--page);
  -webkit-text-size-adjust: 100%;
}

body {
  height: 100vh;
  height: 100dvh;
  margin: 0;
  overflow-y: auto;
  overscroll-behavior-y: none;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  background: var(--page);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.paged body {
  scroll-snap-type: none;
  scroll-behavior: auto;
}

.sky {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: center;
  --sun-area: 310px;
  min-height: 100%;
  padding: 48px 24px var(--sun-area);
  padding-top: min(var(--sun-area), max(48px, calc(100vh - var(--sun-area) - 200px)));
  padding-top: min(var(--sun-area), max(48px, calc(100dvh - var(--sun-area) - 200px)));
  scroll-snap-align: start;
  color: #fff7ea;
  text-align: center;
  background: linear-gradient(180deg,
    #1b1836 0%,
    #2d1f4a 26%,
    #55295f 48%,
    #96406c 64%,
    #d9675f 78%,
    #f4a259 90%,
    #fbd08a 100%);
}

.sky-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

h1 {
  max-width: 10em;
  margin: 0 auto;
  font-weight: 400;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.lead {
  max-width: 300px;
  margin: 14px auto 0;
  font-size: 15px;
  line-height: 1.65;
  color: rgba(255, 247, 234, 0.82);
  text-wrap: balance;
}

.stars {
  position: absolute;
  inset: 0 0 45% 0;
  z-index: 0;
  opacity: 0.75;
  background-image:
    radial-gradient(1.4px 1.4px at 8% 22%, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 19% 58%, #fff 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 31% 14%, #fff 50%, transparent 51%),
    radial-gradient(1.1px 1.1px at 44% 40%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 57% 9%, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 68% 47%, #fff 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 79% 19%, #fff 50%, transparent 51%),
    radial-gradient(1.1px 1.1px at 90% 52%, #fff 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 96% 12%, #fff 50%, transparent 51%);
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent);
          mask-image: linear-gradient(180deg, #000 30%, transparent);
}

.sun {
  position: absolute;
  left: 50%;
  bottom: 44px;
  z-index: 1;
  width: 230px;
  height: 230px;
  margin-left: -115px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, #fff6cf 0%, #ffd98a 42%, #ff9d5c 100%);
  box-shadow:
    0 0 60px 18px rgba(255, 200, 120, 0.55),
    0 0 180px 70px rgba(255, 150, 90, 0.35);
  animation: set 3.2s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

@keyframes set {
  from { transform: translateY(-70px); }
  to   { transform: translateY(0); }
}

.horizon {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  z-index: 2;
  display: block;
  width: 100%;
  height: clamp(90px, 14vw, 170px);
}
.hill-far  { fill: var(--hill-far); opacity: 0.55; }
.hill-near { fill: var(--page); }

.next {
  position: absolute;
  left: 50%;
  bottom: 10px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 44px;
  height: 28px;
  margin-left: -22px;
  color: var(--muted);
  animation: nudge 2.4s ease-in-out infinite;
}
.next svg {
  width: 22px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes nudge {
  50% { transform: translateY(4px); }
}

main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 48px 24px;
  scroll-snap-align: start;
}

h2 {
  margin: 0 0 16px;
  font-weight: 400;
  font-size: clamp(22px, 2.2vw, 26px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-align: center;
}

.note {
  max-width: 320px;
  text-align: center;
}
.note p {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
  text-wrap: balance;
}
.note .signature {
  margin: 24px 0 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

@media (max-width: 720px) {
  .sky { --sun-area: 240px; padding-left: 22px; padding-right: 22px; }
  .sun { width: 170px; height: 170px; margin-left: -85px; bottom: 30px; }
  .next { bottom: 0; height: 26px; }
  .next svg { width: 18px; height: 9px; }
  main { padding: 40px 22px; }
}

@media (max-height: 560px) {
  body { scroll-snap-type: y proximity; }
}

@media (prefers-reduced-motion: reduce) {
  body { scroll-behavior: auto; }
  .sun, .next { animation: none; }
}
