/* Layout: a quiet night above the boreal forest. Type sits on a precise grid;
   the sky does the atmosphere, the forest grounds it, maple red signs it. */
:root {
  /* Brand palette */
  --boreal-black: #111A16;
  --deep-forest: #243A30;
  --northern-sage: #98AD9D;
  --snow: #E8EBE5;
  --maple-red: #B33D35;

  /* Roles */
  --bg: var(--boreal-black);
  --ink: var(--snow);
  --muted: var(--northern-sage);
  --rule: rgba(152, 173, 157, .18);
  --accent: var(--maple-red);
  --tree-far: #15201b;
  --tree-near: #0c130f;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}

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

html, body { height: 100%; }

body {
  margin: 0;
  background-color: var(--bg);
  background-image: linear-gradient(180deg, #0c1310 0%, var(--bg) 55%);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--deep-forest); color: var(--snow); }

/* ---------- sky ---------- */

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

.stars {
  position: absolute;
  inset: 0 0 30% 0;
  opacity: .5;
  background-image:
    radial-gradient(1px 1px at 12% 18%, var(--snow) 50%, transparent 51%),
    radial-gradient(1px 1px at 27% 52%, var(--snow) 50%, transparent 51%),
    radial-gradient(1px 1px at 41% 9%, var(--snow) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 58% 34%, var(--snow) 50%, transparent 51%),
    radial-gradient(1px 1px at 71% 62%, var(--snow) 50%, transparent 51%),
    radial-gradient(1px 1px at 79% 14%, var(--snow) 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 44%, var(--snow) 50%, transparent 51%),
    radial-gradient(1px 1px at 19% 36%, var(--snow) 50%, transparent 51%),
    radial-gradient(1px 1px at 93% 76%, var(--snow) 50%, transparent 51%);
  animation: twinkle 8s ease-in-out infinite alternate;
}

/* The aurora stays in the forest's own greens: barely there, like a sky
   you have to stand outside for a while to notice. */
.aurora {
  position: absolute;
  inset: -25% -10% 30% -10%;
  filter: blur(70px);
  opacity: .7;
}

.band {
  position: absolute;
  display: block;
  border-radius: 50%;
  will-change: transform;
}

.b1 {
  left: -5%; top: 10%;
  width: 90%; height: 36%;
  background: radial-gradient(ellipse at center, #7fa58c 0%, #3d6450 30%, var(--deep-forest) 48%, transparent 68%);
  transform: rotate(-10deg);
  animation: drift1 48s ease-in-out infinite alternate;
}

.b2 {
  right: -15%; top: 2%;
  width: 70%; height: 40%;
  background: radial-gradient(ellipse at center, #3f6b55 0%, var(--deep-forest) 40%, transparent 68%);
  transform: rotate(8deg);
  opacity: .8;
  animation: drift2 60s ease-in-out infinite alternate;
}

/* Vertical rays, like the folds of an aurora curtain, fading toward the horizon. */
.curtain {
  position: absolute;
  inset: 0 0 45% 0;
  background:
    repeating-linear-gradient(90deg,
      transparent 0 20px,
      rgba(152, 173, 157, .045) 24px,
      transparent 32px 51px,
      rgba(152, 173, 157, .03) 56px,
      transparent 64px 86px);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .5) 35%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .5) 35%, transparent 100%);
  filter: blur(2px);
  transform-origin: top;
  animation: sway 30s ease-in-out infinite alternate;
}

.treeline {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  width: 100%;
  height: clamp(90px, 18vh, 180px);
  display: block;
}

@keyframes drift1 {
  from { transform: translate3d(0, 0, 0) rotate(-10deg) scaleY(1); }
  to   { transform: translate3d(12%, 6%, 0) rotate(-3deg) scaleY(1.3); }
}
@keyframes drift2 {
  from { transform: translate3d(0, 0, 0) rotate(8deg) scaleX(1); }
  to   { transform: translate3d(-14%, 8%, 0) rotate(-2deg) scaleX(1.2); }
}
@keyframes sway {
  from { transform: skewX(-5deg) translateX(-2%); opacity: .7; }
  to   { transform: skewX(5deg) translateX(2%); opacity: 1; }
}
@keyframes twinkle {
  from { opacity: .35; }
  to   { opacity: .6; }
}

/* ---------- content ---------- */

.frame {
  position: relative;
  z-index: 1;
  min-height: 100%;
  max-width: 68rem;
  margin: 0 auto;
  padding-block: clamp(1.5rem, 5vw, 4rem);
  padding-left: max(16px, env(safe-area-inset-left, 0px), clamp(1rem, 6vw, 5rem));
  padding-right: max(16px, env(safe-area-inset-right, 0px), clamp(1rem, 6vw, 5rem));
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: clamp(2.5rem, 7vh, 5rem);
}

.mark {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.dot { color: var(--accent); }

.hero {
  align-self: center;
  max-width: 44rem;
  animation: rise 1.6s cubic-bezier(.2, .7, .2, 1) .15s both;
}

h1 {
  margin: 0 0 1.5rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.5rem, 8vw, 5.5rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.lede {
  margin: 0;
  max-width: 34rem;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.55;
  color: var(--muted);
}

.principles {
  list-style: none;
  margin: 0;
  padding: 1.5rem 0 0;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem 2rem;
  font-size: 0.95rem;
  animation: rise 1.6s cubic-bezier(.2, .7, .2, 1) .55s both;
}

.principles li { display: flex; gap: .75rem; align-items: baseline; }

.n {
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--muted);
}

.foot {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--muted);
}

.status { display: inline-flex; align-items: center; gap: .5rem; }

.pulse {
  width: .4rem;
  height: .4rem;
  border-radius: 50%;
  background: var(--accent);
  animation: breathe 3.6s ease-in-out infinite;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(.75rem); }
  to   { opacity: 1; transform: none; }
}

@keyframes breathe {
  0%, 100% { opacity: .3; }
  50%      { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .hero, .principles, .band, .stars, .curtain, .pulse { animation: none; }
  .pulse { opacity: 1; }
}
