:root {
  --sky: #d7e4eb;
  --paper: #f6fafb;
  --ink: #16212b;
  --muted: #4c6270;
  --line: #c5d4dc;
  --sun: #e39b2b;
  --mars: #c45c3e;
  --ice: #2c6d7a;
  --deep: #102833;
  --shadow: 0 18px 40px rgba(16, 40, 51, 0.08);
  --sans: "IBM Plex Sans", "Segoe UI", sans-serif;
  --display: "Unbounded", "IBM Plex Sans", sans-serif;
  --serif: "Literata", "Iowan Old Style", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(227, 155, 43, 0.18), transparent 55%),
    linear-gradient(180deg, var(--sky), var(--paper) 280px);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.55;
}
body.reduced { scroll-behavior: auto; }
img { max-width: 100%; }
a { color: var(--ice); }
a:hover { color: var(--deep); }
:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--deep);
  color: white;
  padding: 0.6rem 0.9rem;
  z-index: 5;
}
.skip:focus { top: 0.6rem; }

.top {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: end;
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.4rem 1.25rem 0.6rem;
}
.brand {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.04em;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
}
.brand small {
  display: block;
  font-family: var(--sans);
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 0.15rem;
}
nav { display: flex; gap: 1rem; flex-wrap: wrap; }
nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
}
nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--sun); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 1.25rem 4rem; }

.desk {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: 2.5rem;
  align-items: center;
  padding: 1.2rem 0 2rem;
}
.lede h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.1rem, 4vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
  margin: 0 0 0.8rem;
}
.lede p { margin: 0; max-width: 38rem; color: var(--deep); }
.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mars);
  margin: 0 0 0.6rem;
}

.orrery {
  position: relative;
  width: min(100%, 420px);
  aspect-ratio: 1;
  margin-inline: auto;
}
.sun, .planet {
  position: absolute;
  border-radius: 50%;
  border: 0;
  padding: 0;
  cursor: pointer;
  transform: translate(-50%, -50%);
}
.sun {
  width: 18%;
  height: 18%;
  left: 50%;
  top: 50%;
  background: radial-gradient(circle at 35% 35%, #ffe1a3, var(--sun) 55%, #c47a12);
  box-shadow: 0 0 0 10px rgba(227, 155, 43, 0.15);
  color: transparent;
}
.planet {
  width: 14px;
  height: 14px;
  background: var(--ink);
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.55);
}
.planet[data-body="mercury"] { background: #8d8478; width: 8px; height: 8px; }
.planet[data-body="venus"] { background: #d7b56a; }
.planet[data-body="earth"] { background: #3d7ea6; }
.planet[data-body="mars"] { background: var(--mars); width: 10px; height: 10px; }
.planet[data-body="jupiter"] { background: #c9895a; width: 26px; height: 26px; }
.planet[data-body="saturn"] { background: #e2c48a; width: 22px; height: 22px; box-shadow: 0 0 0 6px rgba(255,255,255,.55), 14px 0 0 -8px #e2c48a, -14px 0 0 -8px #e2c48a; }
.planet[data-body="uranus"] { background: #8fd0d6; }
.planet[data-body="neptune"] { background: #355f9a; }
.planet[aria-pressed="true"], .sun[aria-pressed="true"] {
  box-shadow: 0 0 0 4px white, 0 0 0 7px var(--ink);
}
.ring {
  position: absolute;
  left: 50%;
  top: 50%;
  border: 1px solid rgba(22, 33, 43, 0.18);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.filters { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.2rem 0 1.2rem; }
.filters button, .text-btn {
  font: inherit;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
}
.filters button[aria-pressed="true"] { background: var(--deep); color: white; border-color: var(--deep); }

.stage {
  background: var(--deep);
  color: white;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #08141c;
}
.frame iframe, .frame .idle {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.idle {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1.5rem;
}
.idle button {
  font: inherit;
  background: var(--sun);
  color: var(--ink);
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.1rem;
  cursor: pointer;
}
.stage header { padding: 0.9rem 1rem 1rem; }
.stage h2 { font-family: var(--serif); font-weight: 600; font-size: 1.35rem; margin: 0.2rem 0; }
.stage p { margin: 0; color: #d5e4ea; }

.shelf, .cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}
.card, .note {
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.9rem;
  text-align: left;
  color: inherit;
  text-decoration: none;
  display: block;
}
button.card { font: inherit; width: 100%; cursor: pointer; }
.card:hover, .note:hover { border-color: var(--ice); }
.card strong, .note h3 { display: block; font-family: var(--serif); font-size: 1.08rem; line-height: 1.3; margin: 0.25rem 0; }
.meta { color: var(--muted); font-size: 0.82rem; }
.card[hidden], .note[hidden] { display: none; }

.notes { margin-top: 2.4rem; }
.notes h2, .shelf-title {
  font-family: var(--display);
  letter-spacing: -0.04em;
  font-size: 1.6rem;
  margin: 0 0 0.4rem;
}

article.long {
  max-width: 42rem;
}
article.long h1 {
  font-family: var(--display);
  letter-spacing: -0.04em;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.08;
  margin-bottom: 0.4rem;
}
article.long p { font-family: var(--serif); font-size: 1.16rem; }
article.long h2 { font-family: var(--display); font-size: 1.25rem; letter-spacing: -0.03em; }

footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 800px) {
  .desk { grid-template-columns: 1fr; }
  .top { align-items: start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
