:root {
  color-scheme: dark;
  background: #121316;
  color: #e9e2d5;
  font-family: system-ui, sans-serif;
  --gold: #e1c58d;
  --line: #514737;
}
* { box-sizing: border-box; }
body { margin: 0; }
header { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; border-bottom: 1px solid var(--line); padding: 1rem max(5vw, 1rem); }
nav { display: flex; flex-wrap: wrap; gap: 1rem; margin-left: auto; }
a { color: var(--gold); text-underline-offset: .22em; }
.brand, .eyebrow { letter-spacing: .2em; color: var(--gold); font-size: .82rem; }
.brand { text-decoration: none; }
main { width: min(90%, 72rem); margin: auto; }
section { padding: 3rem 0; border-bottom: 1px solid var(--line); }
.hero { padding-top: clamp(3rem, 8vw, 7rem); }
h1, h2, h3 { font-family: Georgia, serif; font-weight: 400; margin: 0; }
h1 { font-size: clamp(2.5rem, 9vw, 6rem); }
h2 { font-size: clamp(1.7rem, 5vw, 3rem); }
p, li { line-height: 1.65; }
form { display: grid; gap: .65rem; max-width: 32rem; margin-top: 2rem; }
input, select, button { border: 1px solid var(--line); border-radius: .5rem; padding: .65rem .8rem; min-height: 44px; font: inherit; color: inherit; background: #222126; }
input, select { width: 100%; }
#filter { display: block; max-width: 32rem; margin: .5rem 0 1rem; }
button { cursor: pointer; }
button:disabled { opacity: .65; cursor: wait; }
.primary { background: var(--gold); color: #181414; font-weight: 700; margin-top: .5rem; }
:focus-visible { outline: 3px solid #f4dca8; outline-offset: 3px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: .85rem; }
.card { padding: 1rem; min-width: 0; border: 1px solid var(--line); border-radius: .7rem; background: linear-gradient(142deg, #2b2634, #1b1b21); overflow-wrap: anywhere; }
.card p { margin: .4rem 0 .65rem; font-size: .88rem; }
#reading .card { background: radial-gradient(ellipse at top right, #392f41, #1b1b21 70%); }

.observatory { background: #080b12; min-height: 100vh; }
.observatory header { position: relative; z-index: 1; }
.observatory nav { font-size: .88rem; }
.observatory nav a[aria-current] { color: white; }
.observatory footer { width: min(90%,72rem); margin: 2rem auto; }
.cosmos { min-height: min(85vh, 54rem); display: grid; align-content: end; position: relative; isolation: isolate; overflow: hidden; padding: 2rem; }
.cosmos canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; touch-action: pan-y; background: radial-gradient(ellipse at 70% 32%, #222537, #090c14 65%); }
.cosmos h1 { max-width: 12ch; text-shadow: 0 2px 18px #000; }
.cosmos p { max-width: 40ch; text-shadow: 0 2px 9px #000; }
.cosmos .primary { display: inline-block; text-decoration: none; padding: .75rem 1rem; width: fit-content; border-radius: .4rem; }
.cosmos-buttons { display: flex; gap: .5rem; flex-wrap: wrap; }
.observatory form { width: min(100%, 42rem); max-width: none; }
.observatory fieldset { display: grid; min-width: 0; gap: .5rem; padding: 1rem; border: 1px solid var(--line); }
.observatory .results { margin-top: 1.5rem; overflow-wrap: anywhere; }
.chart-wheel { width: min(100%, 31rem); display: block; margin: 1rem auto; }
.chart-wheel circle, .chart-wheel line { stroke: #857653; stroke-width: 1; }
.chart-wheel text { fill: #f3ddb0; font-size: 9px; text-anchor: middle; dominant-baseline: central; }
.chart-wheel .planet-dot { fill: #e1c58d; }
.observatory .result-list { columns: 2 17rem; padding-inline-start: 1.4rem; }
.observatory .result-list li { break-inside: avoid; }
@media (max-width: 600px) {
  .observatory nav { order: 3; width: 100%; gap: .55rem .9rem; }
  .observatory header button { margin-left: auto; }
  .cosmos { padding: 1rem; }
}


.cosmos { min-height: min(86svh, 52rem); border: 1px solid #2b2b3e; border-radius: 1rem; }
.cosmos-content { position: relative; width: fit-content; max-width: 100%; }
.cosmos-content::before { content: ""; position: absolute; z-index: -1; inset: -3rem; pointer-events: none; background: radial-gradient(ellipse at left, #080b12d9, transparent 72%); }
.cosmos .eyebrow { margin: 0 0 .65rem; }
.cosmos h1 { line-height: .98; font-size: clamp(2.65rem, 8vw, 6.5rem); }
.cosmos-links { display: flex; align-items: center; gap: .6rem 1rem; flex-wrap: wrap; }
.cosmos-buttons { margin-top: .95rem; }
.cosmos-buttons[hidden] { display: none; }
.cosmos-buttons button { font-size: .83rem; background: #0c101be8; }
.cosmos-buttons [aria-pressed="true"] { color: #111018; background: var(--gold); border-color: var(--gold); }
@media (max-width: 640px) {
  .cosmos { min-height: max(39rem, 81svh); }
  .cosmos-content::before { background: linear-gradient(0deg,#080b12f2 22%,transparent); }
}

.cosmos-destination { display: inline-block; margin-top: .8rem; padding: .5rem 0; }
.cosmos-destination[hidden] { display: none; }
.cosmos-buttons button { touch-action: manipulation; }
