:root {
  --bg: #030304;
  --fg: #ece8e1;
  --muted: #a39f97;
  --faint: #8a867f;
  --accent: #ffb877;
  --line: rgba(236, 232, 225, 0.14);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, ui-serif, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --pad: clamp(1.25rem, 5vw, 5rem);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { background: var(--bg); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
::selection { background: var(--accent); color: #140a02; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

.skip {
  position: fixed; left: 1rem; top: -4rem; z-index: 20;
  padding: .6rem 1rem; background: var(--fg); color: var(--bg);
  font: 500 .875rem var(--sans); text-decoration: none;
}
.skip:focus { top: 1rem; }

/* The sky: canvas behind everything. */
.sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.sky canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* Without WebGL (or before it draws): a still black hole in CSS. */
.sky-fallback {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at var(--fx, 72%) 50%, #000 0 9vmin, transparent 9.2vmin),
    radial-gradient(circle at var(--fx, 72%) 50%, rgba(255, 214, 170, .9) 9.3vmin, rgba(255, 140, 60, .35) 10.5vmin, transparent 14vmin),
    radial-gradient(ellipse 46vmin 6vmin at var(--fx, 72%) 50%, rgba(255, 170, 90, .55), rgba(140, 40, 10, .25) 60%, transparent 72%),
    var(--bg);
}
.webgl .sky-fallback { opacity: 0; transition: opacity 1.2s ease; }

/* Keeps text readable where the disk is bright. */
.scrim {
  position: absolute; inset: 0;
  /* Dark as far as the text column reaches, then a fade. */
  background: linear-gradient(90deg, rgba(3, 3, 4, .9) 0, rgba(3, 3, 4, .88) calc(var(--pad) + 29rem), rgba(3, 3, 4, .78) calc(var(--pad) + 35rem), rgba(3, 3, 4, .5) calc(var(--pad) + 43rem), rgba(3, 3, 4, .2) calc(var(--pad) + 51rem), rgba(3, 3, 4, 0) calc(var(--pad) + 60rem));
  opacity: var(--scrim, 0);
}

/* HUD */
.hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: clamp(.9rem, 2.2vw, 1.6rem) var(--pad);
  padding-top: max(clamp(.9rem, 2.2vw, 1.6rem), env(safe-area-inset-top));
  font: 400 .75rem/1 var(--mono);
  letter-spacing: .06em;
  color: var(--muted);
}
.hud::before {
  content: ""; position: absolute; inset: 0 0 -2.5rem; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(3, 3, 4, .92) 0%, rgba(3, 3, 4, .7) 55%, rgba(3, 3, 4, 0) 100%);
}
.mark {
  font: 400 1.35rem/1 var(--serif);
  letter-spacing: -.01em;
  color: var(--fg);
  text-decoration: none;
}
.mark span { font-style: italic; color: var(--accent); }
.readout { display: flex; gap: .6rem; align-items: baseline; white-space: nowrap; }
.readout b { font-weight: 400; color: var(--fg); font-variant-numeric: tabular-nums; }
.readout sub { font-size: .7em; vertical-align: -.1em; }
.controls { display: flex; gap: .5rem; }
html:not(.js) .controls { display: none; }
.chip {
  font: inherit; letter-spacing: inherit; color: var(--muted);
  background: rgba(3, 3, 4, .55);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .55rem .85rem;
  min-height: 2.25rem;
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: color .2s, border-color .2s;
}
.chip:hover { color: var(--fg); border-color: rgba(236, 232, 225, .35); }
.chip .state { color: var(--fg); }

/* Content */
main, .legal { position: relative; z-index: 1; }

.panel {
  min-height: 100vh;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 7rem var(--pad);
  max-width: calc(40rem + 2 * var(--pad));
}
.panel > * { margin: 0; }
.panel > * + * { margin-top: 1.4rem; }

.hero {
  max-width: none;
  justify-content: flex-end;
  padding-bottom: clamp(3rem, 9vh, 6rem);
}

.eyebrow, .label, .cue {
  font: 400 .75rem/1.4 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.label span:first-child { color: var(--accent); margin-right: .6em; text-transform: none; }
.label sub { font-size: .75em; text-transform: none; }

.display {
  font: 400 clamp(3.4rem, 11vw, 10rem)/.92 var(--serif);
  letter-spacing: -.035em;
  text-shadow: 0 0 40px rgba(0, 0, 0, .6);
}
.lede {
  max-width: 34rem;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--fg);
  text-shadow: 0 0 24px rgba(0, 0, 0, .9);
}
.cue .arrow { display: inline-block; margin-left: .4em; }

.title {
  font: 400 clamp(2rem, 4.6vw, 3.6rem)/1.06 var(--serif);
  letter-spacing: -.02em;
  text-wrap: balance;
  text-shadow: 0 0 30px rgba(0, 0, 0, .8);
}
.body {
  max-width: 34rem;
  color: var(--muted);
  text-shadow: 0 0 20px rgba(0, 0, 0, .9);
}

.orbit { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.orbit li {
  display: grid; grid-template-columns: 3rem 1fr; gap: .2rem 1rem;
  padding: 1.25rem 0; border-bottom: 1px solid var(--line);
}
.orbit .n { font: .75rem/1.9 var(--mono); color: var(--accent); grid-row: span 2; }
.orbit .name { font: 400 1.5rem/1.2 var(--serif); }
.orbit .what { color: var(--muted); font-size: .95rem; }
.orbit a { grid-column: 2; font: .75rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.orbit .pending .name { color: var(--muted); }

.horizon {
  max-width: none;
  align-items: flex-start;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, #000 55%);
}
.horizon .title { max-width: 16ch; }
.mail {
  display: inline-block;
  font: 400 clamp(1.3rem, 3.6vw, 2.4rem)/1.2 var(--serif);
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 184, 119, .4);
  padding-bottom: .15em;
  word-break: break-word;
  transition: border-color .2s;
}
.mail:hover { border-color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.links a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: .2em; transition: color .2s, border-color .2s; }
.links a:hover { color: var(--fg); border-color: var(--fg); }
.links { margin-top: 2rem !important; list-style: none; padding: 0; display: flex; gap: 1.5rem; font: .8rem var(--mono); letter-spacing: .1em; text-transform: uppercase; }

/* Footer: the legal identity, always plain and readable. */
.legal {
  background: #000;
  border-top: 1px solid var(--line);
  padding: 3rem var(--pad) max(3rem, env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: .9rem;
}
.legal .owner { margin: 0 0 2rem; font: 400 1.25rem/1.4 var(--serif); color: var(--fg); }
.legal dl {
  margin: 0; display: grid; gap: 1.25rem 2rem;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}
.legal dt { font: .7rem/1.6 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.legal dd { margin: .2rem 0 0; color: var(--fg); }
.legal .copy { margin: 2.5rem 0 0; font: .7rem var(--mono); letter-spacing: .08em; color: var(--faint); }

/* Reveal on scroll: only when JS runs and motion is allowed. */
.js.motion .reveal {
  opacity: 0;
  transform: translateY(1.5rem);
  filter: blur(6px);
  transition: opacity 1.1s cubic-bezier(.2, .7, .2, 1), transform 1.1s cubic-bezier(.2, .7, .2, 1), filter 1.1s ease;
}
.js.motion .reveal.in { opacity: 1; transform: none; filter: none; }
.js.motion .panel .reveal:nth-child(2) { transition-delay: .08s; }
.js.motion .panel .reveal:nth-child(3) { transition-delay: .16s; }
.js.motion .panel .reveal:nth-child(4) { transition-delay: .24s; }

.js.motion .cue .arrow { animation: drift 2.4s ease-in-out infinite; }
@keyframes drift { 50% { transform: translateY(.35rem); } }

@media (max-width: 760px) {
  .chip { padding: .5rem .7rem; }
}

@media (prefers-reduced-motion: reduce) {
  .chip, .mail { transition: none; }
}

@media print {
  .sky, .hud, .skip { display: none; }
  body, .legal { background: #fff; color: #000; }
}

/* Slanted-disk layout: the hole fills the right side and the disk runs down
   to the lower left, so the text keeps to the upper left. The stacked layout
   at the end of this file undoes this for phones and tall windows. */
.panel { padding-bottom: 20vh; }
.hero { justify-content: center; padding-bottom: 24vh; }
.display { font-size: clamp(3.4rem, 8.4vw, 8.6rem); width: min-content; }
.hero .lede { max-width: 26rem; }
.horizon { padding-bottom: 7rem; }

/* With JavaScript, the CSS black hole shows only when WebGL is not available,
   so it never flashes while the shader is being prepared. */
.js .sky-fallback { opacity: 0; }
.js.nogl .sky-fallback { opacity: 1; }
.sky canvas { opacity: 0; transition: opacity 1.4s ease; }
.webgl .sky canvas { opacity: 1; }

/* The numbers in the header are a button that opens their legend. */
.telemetry { position: relative; }
button.readout {
  font: inherit; letter-spacing: inherit; color: inherit;
  background: rgba(3, 3, 4, .62); border: 0; margin: 0; padding: .6rem .9rem; cursor: pointer;
  border-radius: 999px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
button.readout:hover b, button.readout[aria-expanded="true"] b { color: var(--accent); }
.legend {
  position: absolute; top: calc(100% + .6rem); left: 50%; transform: translateX(-50%);
  width: min(30rem, 86vw);
  max-height: calc(100vh - 7rem); max-height: calc(100dvh - 7rem); overflow: auto;
  padding: 1.1rem 1.25rem;
  background: rgba(3, 3, 4, .94);
  border: 1px solid var(--line); border-radius: 12px;
  font: 400 .85rem/1.55 var(--sans); letter-spacing: 0;
  color: var(--muted);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.legend dl { margin: 0; display: grid; gap: .8rem; }
.legend dl > div { display: grid; grid-template-columns: 5rem 1fr; gap: .8rem; }
.legend dt { font: .72rem/2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.legend dt.lc { text-transform: none; }
.legend dd { margin: 0; color: var(--fg); }

.readout sup { font-size: .7em; }
.readout [hidden] { display: none; }
/* Narrower windows: the numbers drop to their own line under the header. */
@media (max-width: 1180px) {
  .hud { flex-wrap: wrap; row-gap: 0; }
  .telemetry { order: 3; flex-basis: 100%; display: flex; justify-content: center; }
}
/* Phones: the four numbers wrap onto two lines. */
@media (max-width: 760px) {
  button.readout { flex-wrap: wrap; justify-content: center; gap: .15rem .9rem; font-size: .68rem; padding: .45rem .8rem; border-radius: 14px; }
  .readout .dot { display: none; }
  .legend { width: 92vw; max-height: calc(100dvh - 10rem); }
  .legend dl > div { grid-template-columns: 1fr; gap: .1rem; }
  .legend dl > div > dd { grid-column: 1; }
  .legend dl > div > dd.start { margin-top: .2rem; }
}

.legend dd { grid-column: 2; }
.legend dd.start { margin-top: -.45rem; color: var(--muted); }

/* The CSS black hole (no WebGL), drawn to match: on the right, slanted. */
.sky-fallback {
  inset: -40%;
  transform: rotate(-18deg);
  --fx: 64.5%; --fy: 55.5%;
  background:
    radial-gradient(circle at var(--fx) var(--fy), #000 0 24vmin, transparent 24.4vmin),
    radial-gradient(ellipse 120vmin 7vmin at var(--fx) var(--fy), rgba(255, 244, 228, .95), rgba(255, 176, 96, .7) 34%, rgba(150, 52, 14, .35) 68%, transparent 100%),
    radial-gradient(circle at var(--fx) var(--fy), transparent 24vmin, rgba(255, 246, 232, .95) 25vmin, rgba(255, 190, 120, .75) 31vmin, rgba(170, 70, 20, .3) 40vmin, transparent 50vmin),
    var(--bg);
}
@media (max-width: 760px), (max-aspect-ratio: 1/1) {
  .sky-fallback {
    --fx: 54%; --fy: 39%; background-position: 0 0;
    background:
      radial-gradient(circle at var(--fx) var(--fy), #000 0 15vmax, transparent 15.3vmax),
      radial-gradient(ellipse 70vmax 4.5vmax at var(--fx) var(--fy), rgba(255, 244, 228, .95), rgba(255, 176, 96, .7) 34%, rgba(150, 52, 14, .35) 68%, transparent 100%),
      radial-gradient(circle at var(--fx) var(--fy), transparent 15vmax, rgba(255, 246, 232, .95) 15.7vmax, rgba(255, 190, 120, .75) 19vmax, rgba(170, 70, 20, .3) 25vmax, transparent 31vmax),
      var(--bg);
  }
}

/* Stacked layout: phones, and any window taller than it is wide. The hole
   sits on top and the text below. main.js reads this same query. */
@media (max-width: 760px), (max-aspect-ratio: 1/1) {
  .panel { justify-content: flex-end; padding-bottom: 5rem; }
  .hero { justify-content: flex-end; padding-bottom: clamp(3rem, 9vh, 6rem); }
  .display { font-size: clamp(3.4rem, 11vw, 10rem); width: auto; }
  .hero .lede { max-width: 34rem; }
  /* Sized by the text block, which is about 24rem tall, not by the screen. */
  .scrim { background: linear-gradient(0deg, rgba(3, 3, 4, .92) 0, rgba(3, 3, 4, .88) 23rem, rgba(3, 3, 4, .45) 29rem, rgba(3, 3, 4, 0) 36rem); }
}

.readout .values { display: contents; }
