:root {
  --bg:      #0a0c14;
  --bg-soft: #11131f;
  --ink:     #e9e7f1;
  --muted:   #918da6;
  --accent:  #a78bd0;
  --line:    #1e2133;
  --serif:   ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans:    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* the glow sits behind everything and breathes very slowly */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 60% at 50% -10%, rgba(122, 96, 176, 0.28), transparent 70%),
    radial-gradient(ellipse 70% 50% at 15% 40%, rgba(58, 78, 140, 0.16), transparent 70%);
  animation: breathe 24s ease-in-out infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
}

.wrap {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- hero ---------- */

.hero {
  padding: 22vh 0 16vh;
}

.mark {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 9vw, 4.2rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  margin: 0 0 2.2rem;
}

.lede {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 4.6vw, 2.1rem);
  line-height: 1.35;
  font-weight: 400;
  margin: 0 0 1.6rem;
  max-width: 17ch;
}

.lede em {
  font-style: italic;
  color: var(--accent);
}

.sub {
  color: var(--muted);
  max-width: 46ch;
  margin: 0;
}

/* ---------- sections ---------- */

section {
  padding: 5rem 0;
  border-top: 1px solid var(--line);
}

h2 {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 2rem;
}

h3 {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 400;
  margin: 0 0 0.5rem;
}

p { margin: 0 0 1.2rem; }
p:last-child { margin-bottom: 0; }

.big {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 3.6vw, 1.7rem);
  line-height: 1.45;
  max-width: 26ch;
}

.items { display: grid; gap: 3rem; }

.items p { color: var(--muted); max-width: 44ch; }

/* ---------- footer ---------- */

footer {
  padding: 4rem 0 6rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem;
  margin-bottom: 2rem;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.status {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2.5rem;
}

/* ---------- long-form pages ---------- */

.doc { padding: 8rem 0 6rem; }

.doc h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 6vw, 2.6rem);
  font-weight: 400;
  margin: 0 0 0.4rem;
}

.doc .date { color: var(--muted); font-size: 0.9rem; margin-bottom: 3.5rem; }

.doc h2 {
  font-size: 1.25rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  margin: 3rem 0 1rem;
}

.doc p, .doc li { color: #c9c6d8; }

.doc ul { padding-left: 1.2rem; margin: 0 0 1.2rem; }
.doc li { margin-bottom: 0.5rem; }

.callout {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.4rem 1.6rem;
  margin: 0 0 2rem;
}

.callout p { margin: 0; color: var(--ink); }

.back {
  display: inline-block;
  margin-bottom: 3rem;
  font-size: 0.9rem;
}

/* ---------- utilities ---------- */

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

.muted-p { color: var(--muted); max-width: 46ch; }
.muted-p strong { color: var(--ink); font-weight: 400; }

/* ---------- hero cta ---------- */

.cta-line { margin: 2.4rem 0 0; }

.cta {
  display: inline-block;
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 0.7rem 1.5rem;
  color: var(--accent);
  font-size: 0.95rem;
}

.cta:hover {
  text-decoration: none;
  background: var(--accent);
  color: var(--bg);
}

/* ---------- night chart ---------- */

.night {
  padding: 5rem 0;
  border-top: 1px solid var(--line);
}

.wrap.wide { max-width: 980px; }

.chart-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.plot { position: relative; }

.wake-label {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  margin: 0;
  pointer-events: none;
}

.wake-label span {
  display: inline-block;
  background: var(--bg);
  padding: 0 0.6rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  list-style: none;
  margin: 1.2rem 0 0;
  padding: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.legend li { display: flex; align-items: center; gap: 0.5rem; }

.legend i {
  width: 22px;
  height: 6px;
  border-radius: 3px;
  flex: none;
}

/* ---------- phases ---------- */

.phases {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2.2rem;
  list-style: none;
  margin: 3.2rem 0 0;
  padding: 0;
  counter-reset: none;
}

.phases li { border-top: 1px solid var(--line); padding-top: 1.1rem; }

.phases .when {
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.7rem;
}

.phases h3 { font-size: 1.15rem; margin-bottom: 0.6rem; }

.phases p:last-child {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.6;
  margin: 0;
}

.phases sup { font-size: 0.7em; }
.phases sup a { text-decoration: none; }

.notes {
  margin: 3.2rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.6;
}

.notes li { margin-bottom: 0.7rem; }
.notes em { font-style: italic; }

@media (max-width: 760px) {
  .phases { grid-template-columns: 1fr; gap: 1.8rem; }
}

/* ---------- signup ---------- */

.signup {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 2rem;
  max-width: 30rem;
}

.signup input {
  flex: 1 1 14rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.75rem 1.2rem;
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
}

.signup input::placeholder { color: #5f5c73; }

.signup input:focus {
  outline: none;
  border-color: var(--accent);
}

.signup button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--bg);
  border-radius: 999px;
  padding: 0.75rem 1.6rem;
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}

.signup button:hover { background: #b89ce0; border-color: #b89ce0; }

.fineprint {
  margin-top: 1rem;
  font-size: 0.82rem;
  color: var(--muted);
  max-width: 40ch;
}
