:root {
  --night: #0c1528;
  --paper: #fbf6ec;
  --ink: #2a1d14;
  --ink-light: #6b5442;
  --berry: #a5303c;
  --fir: #2c5a49;
  --gold: #d9a640;
  --font: "Avenir Next", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
}

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

html {
  background: var(--night);
  color: #efe6d6;
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
html.dialog-open { overflow: hidden; }
body { margin: 0; min-height: 100vh; overflow-x: clip; }
button { font: inherit; }

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

.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, #08101f 0%, #0e1a33 40%, #1b2a4b 78%, #2a3658 100%);
}
.sky__stars { position: absolute; inset: 0; }
.sky__aurora {
  position: absolute;
  left: -10%;
  right: -10%;
  top: 2%;
  height: 50%;
  background:
    radial-gradient(ellipse 28% 20% at 20% 42%, rgba(90, 220, 170, .17), rgba(90, 220, 170, 0) 70%),
    radial-gradient(ellipse 34% 16% at 50% 30%, rgba(80, 205, 195, .14), rgba(80, 205, 195, 0) 70%),
    radial-gradient(ellipse 24% 18% at 80% 46%, rgba(140, 115, 235, .11), rgba(140, 115, 235, 0) 70%);
  transform: skewY(-6deg);
  animation: aurora 18s ease-in-out infinite alternate;
}
@keyframes aurora {
  from { opacity: .5; transform: skewY(-6deg) translateX(-2%); }
  to   { opacity: 1; transform: skewY(-4deg) translateX(2%); }
}
.sky__stars i {
  position: absolute;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: #f4f1e8;
  opacity: .7;
  animation: star-twinkle var(--twinkle-duration) ease-in-out var(--twinkle-delay) infinite alternate;
}
.sky__moon {
  position: absolute;
  top: 150px;
  right: 3%;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 34%, #fbf7e8, #ece2c2 60%, #d6c99f);
  box-shadow: 0 0 60px 10px rgba(240, 230, 200, .12);
}
.sky__moon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 62% 38%, rgba(160, 140, 100, .28) 0 9%, transparent 10%),
    radial-gradient(circle at 40% 64%, rgba(160, 140, 100, .22) 0 12%, transparent 13%);
}
.snow {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
@keyframes star-twinkle { from { opacity: .25; } to { opacity: .85; } }

.header {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 24px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 26px clamp(16px, 4vw, 40px) 30px;
}
.header__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
  line-height: 1.15;
  color: #f4ead6;
}
.header__text {
  margin: 6px 0 0;
  max-width: 46ch;
  font-size: .95rem;
  line-height: 1.5;
  color: rgba(239, 230, 214, .72);
}
.header__toggles { display: flex; gap: 8px; padding-top: 4px; }
.toggle {
  padding: 7px 12px;
  border: 1px solid rgba(239, 230, 214, .28);
  border-radius: 6px;
  background: transparent;
  color: #efe6d6;
  font-size: .85rem;
  cursor: pointer;
}
.toggle:hover { border-color: rgba(239, 230, 214, .6); }
.toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.toggle[aria-pressed="false"] { color: rgba(239, 230, 214, .6); }
.toggle--today { border-color: rgba(217, 166, 64, .7); color: #f4dca0; }
.toggle--today:hover { border-color: #d9a640; }
.header__toggles { flex-wrap: wrap; justify-content: flex-end; }

.preview-note {
  position: relative;
  z-index: 3;
  margin: 0;
  padding: 7px 16px;
  text-align: center;
  font-size: .82rem;
  background: #7d2029;
  color: #fff3e6;
}

.footer {
  position: relative;
  z-index: 2;
  margin-top: -2px;
  padding: 10px 20px 48px;
  text-align: center;
  color: #3a4660;
  background: #e2e9f4;
}
.footer p { margin: 6px auto; max-width: 64ch; line-height: 1.5; }
.footer__note { font-size: .95rem; }
.footer__names { font-size: .85rem; color: #5a6680; }

@media (max-width: 640px) {
  .header { padding-top: 18px; padding-bottom: 22px; }
  .header__text { font-size: .9rem; }
  .sky__moon { width: 34px; height: 34px; top: 20px; right: 5%; }
  .factory { margin-top: 20px; }
}

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