/* ORRERY — site styles. The 3D canvas is fixed behind everything; sections scroll over it. */
:root {
  --ink: #efe4cc;
  --dim: rgba(239, 228, 204, .66);
  --faint: rgba(239, 228, 204, .42);
  --line: rgba(214, 171, 98, .35);
  --brass: #d6ab62;
  --bg: #040509;
  --scrim: rgba(4, 5, 9, .78);
  --gutter: clamp(16px, 6vw, 110px);
  --display: 'Cinzel', Georgia, serif;
  --text: 'Cormorant Garamond', Georgia, serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: var(--text); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
::selection { background: rgba(214, 171, 98, .35); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 16px; top: -60px; z-index: 50; padding: 10px 14px; background: var(--bg); border: 1px solid var(--brass); font-family: var(--display); font-size: 12px; letter-spacing: .2em; text-decoration: none; }
.skip:focus { top: 16px; }

#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
body.no-webgl #gl { display: none; }
body.no-webgl { background: radial-gradient(ellipse at 70% 40%, #2a1b0c 0%, #0b0907 45%, var(--bg) 80%) fixed; }

/* ---------------------------------------------------------------- loader */
#veil { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; transition: opacity 1.6s ease, visibility 1.6s; }
#veil.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.veil-mark { font-family: var(--display); font-weight: 600; letter-spacing: .5em; margin-right: -.5em; font-size: 15px; color: var(--brass); }
.veil-bar { width: 160px; height: 1px; background: rgba(214, 171, 98, .18); }
.veil-bar i { display: block; height: 100%; width: 0; background: var(--brass); transition: width .35s ease; }
.veil-text { font-family: var(--display); font-size: 10px; letter-spacing: .38em; color: var(--faint); text-transform: uppercase; }

/* ---------------------------------------------------------------- header */
.top { position: fixed; left: 0; right: 0; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px clamp(16px, 3vw, 40px); background: linear-gradient(rgba(4, 5, 9, .7), rgba(4, 5, 9, 0)); }
.mark { font-family: var(--display); font-weight: 600; letter-spacing: .42em; font-size: 15px; color: var(--brass); text-decoration: none; }
.nav { display: flex; gap: clamp(14px, 2.2vw, 30px); }
.nav a, .footnav a { font-family: var(--display); font-size: 10.5px; letter-spacing: .26em; text-transform: uppercase; text-decoration: none; color: var(--dim); padding: 8px 0; border-bottom: 1px solid transparent; transition: color .25s, border-color .25s; }
.nav a:hover, .nav a[aria-current="true"] { color: var(--brass); border-bottom-color: var(--line); }
.nav a:focus-visible, .footnav a:focus-visible, .mark:focus-visible, .cta:focus-visible { outline: 1px solid var(--brass); outline-offset: 4px; }
.menu { display: none; font-family: var(--display); font-size: 11px; letter-spacing: .26em; text-transform: uppercase; color: var(--ink); background: rgba(8, 8, 12, .5); border: 1px solid var(--line); padding: 10px 14px; min-height: 40px; cursor: pointer; }

/* ---------------------------------------------------------------- fixed HUD (date + speed) */
.hud { position: fixed; left: 0; right: 0; z-index: 10; display: flex; justify-content: space-between; align-items: flex-end; padding: 22px clamp(16px, 3vw, 40px); pointer-events: none; }
.hud.bottom { bottom: 0; }
.readout { position: relative; pointer-events: auto; }
.readout .label { display: block; font-family: var(--display); font-size: 10px; letter-spacing: .3em; color: var(--dim); margin-bottom: 6px; text-transform: uppercase; }
.readout .value { font-family: var(--display); font-size: 20px; letter-spacing: .14em; font-variant-numeric: tabular-nums; }
.when { all: unset; display: block; cursor: pointer; padding: 4px 6px; margin: -4px -6px; border-radius: 2px; }
.when:focus-visible { outline: 1px solid var(--brass); outline-offset: 2px; }
.when .value::after { content: '\25BE'; font-size: .55em; margin-left: .6em; color: var(--brass); vertical-align: .25em; }
.when[aria-expanded="true"] .value::after { content: '\25B4'; }
.controls { display: flex; gap: 6px; pointer-events: auto; }
.controls button, .datepanel button, .windform button, .presets button {
  font-family: var(--display); font-size: 11px; letter-spacing: .16em; color: var(--ink); background: rgba(8, 8, 12, .5);
  border: 1px solid var(--line); padding: 9px 12px; cursor: pointer; min-width: 44px; min-height: 40px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: background .2s, border-color .2s, color .2s;
}
.controls button[aria-pressed="true"] { border-color: var(--brass); color: var(--brass); background: rgba(214, 171, 98, .1); }
.controls button:hover, .datepanel button:hover, .windform button:hover, .presets button:hover { border-color: var(--brass); }
button:focus-visible, input:focus-visible { outline: 1px solid var(--brass); outline-offset: 2px; }

.datepanel { position: absolute; left: -6px; bottom: calc(100% + 14px); width: min(290px, calc(100vw - 32px)); padding: 16px; background: rgba(8, 8, 12, .88); border: 1px solid var(--line); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.datepanel[hidden] { display: none; }
.datepanel label { display: block; font-family: var(--display); font-size: 10px; letter-spacing: .3em; color: var(--dim); margin-bottom: 10px; text-transform: uppercase; }
input[type="date"] { width: 100%; color-scheme: dark; font-family: var(--display); font-size: 17px; letter-spacing: .08em; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: 6px 0 8px; border-radius: 0; }
input[type="date"]:focus { outline: none; border-bottom-color: var(--brass); }
.datepanel .row { display: flex; gap: 6px; margin-top: 14px; }
.datepanel .row button { flex: 1; }
.datepanel button[type="submit"], .windform button { border-color: var(--brass); color: var(--brass); background: rgba(214, 171, 98, .1); }
.datepanel .note { margin: 12px 0 0; font-size: 14px; line-height: 1.35; color: var(--dim); }

.pips { position: fixed; right: clamp(16px, 2.4vw, 34px); top: 50%; transform: translateY(-50%); z-index: 10; display: flex; flex-direction: column; gap: 4px; }
.pips a { display: block; padding: 6px; }
.pips a i { display: block; width: 6px; height: 6px; border: 1px solid var(--brass); border-radius: 50%; opacity: .45; transition: all .4s; }
.pips a[aria-current="true"] i { background: var(--brass); opacity: 1; transform: scale(1.3); }
.pips a:focus-visible { outline: 1px solid var(--brass); }
.hint { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 10; font-family: var(--display); font-size: 10px; letter-spacing: .38em; text-transform: uppercase; color: var(--dim); pointer-events: none; transition: opacity .8s; text-align: center; }
.hint::after { content: ''; display: block; width: 1px; height: 28px; margin: 10px auto 0; background: linear-gradient(var(--brass), transparent); }
#fps { position: fixed; top: 70px; right: 16px; z-index: 40; font: 11px ui-monospace, monospace; color: #9f9; display: none; }

/* ---------------------------------------------------------------- hover label */
.tag { position: fixed; left: 0; top: 0; z-index: 12; pointer-events: none; opacity: 0; transition: opacity .25s; }
.tag.on { opacity: 1; }
.tag .ring { position: absolute; left: 0; top: 0; border: 1px solid var(--brass); border-radius: 50%; box-shadow: 0 0 0 1px rgba(4, 5, 9, .6), 0 0 14px rgba(214, 171, 98, .4); }
.tag .lead { position: absolute; left: 0; top: 0; width: 24px; height: 1px; background: var(--brass); transform-origin: 0 0; }
.tag .card { position: absolute; left: 0; top: 0; padding: 9px 14px 8px 12px; border-bottom: 1px solid var(--brass); white-space: nowrap; background: linear-gradient(90deg, rgba(4, 5, 9, .8), rgba(4, 5, 9, .55)); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
.tag.flip .card { padding: 9px 12px 8px 14px; text-align: right; background: linear-gradient(270deg, rgba(4, 5, 9, .8), rgba(4, 5, 9, .55)); }
.tag b { display: block; font-family: var(--display); font-weight: 600; font-size: 12px; letter-spacing: .32em; color: var(--brass); margin-bottom: 3px; }
.tag span { display: block; font-size: 16px; line-height: 1.25; }
.tag span + span { color: var(--dim); font-size: 15px; }
body.picking { cursor: pointer; }

/* ---------------------------------------------------------------- sections */
main { position: relative; z-index: 5; }
.sec { position: relative; overflow: hidden; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: 120px var(--gutter) 130px; pointer-events: none; }
.sec.right { justify-content: flex-end; }
.sec.center { justify-content: center; text-align: center; }
/* a soft scrim on the text side keeps copy legible over bright brass */
.sec::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, var(--scrim) 0%, rgba(4, 5, 9, .45) 34%, rgba(4, 5, 9, 0) 60%); }
.sec.right::before { background: linear-gradient(270deg, var(--scrim) 0%, rgba(4, 5, 9, .45) 34%, rgba(4, 5, 9, 0) 60%); }
.sec.center::before { background: radial-gradient(ellipse 60% 70% at 50% 50%, rgba(4, 5, 9, .72), rgba(4, 5, 9, 0)); }
.sec.hero::before { background: linear-gradient(90deg, rgba(4, 5, 9, .55) 0%, rgba(4, 5, 9, 0) 45%); }
.panel { position: relative; min-width: 0; width: 100%; max-width: 460px; pointer-events: auto; text-shadow: 0 2px 30px rgba(0, 0, 0, .85); }
.panel.wide { max-width: 620px; }
.sec.center .panel { max-width: 860px; }
.sec.center .panel > p { max-width: 620px; margin-left: auto; margin-right: auto; }

.eyebrow, .num { font-family: var(--display); font-size: 11px; letter-spacing: .35em; text-transform: uppercase; color: var(--brass); margin: 0; }
h1 { font-family: var(--display); font-weight: 500; font-size: clamp(48px, 7.6vw, 104px); letter-spacing: .22em; margin: .25em 0 .1em; line-height: 1; text-transform: uppercase; }
h2 { font-family: var(--display); font-weight: 500; font-size: clamp(28px, 3.2vw, 42px); letter-spacing: .06em; margin: .4em 0 .4em; line-height: 1.12; }
h3 { font-family: var(--display); font-weight: 500; font-size: 15px; letter-spacing: .14em; text-transform: uppercase; color: var(--brass); margin: 0 0 .55em; }
.panel p { font-size: clamp(18px, 1.45vw, 21px); line-height: 1.5; color: var(--dim); margin: 0 0 1em; }
.panel p.lead { font-size: clamp(19px, 1.6vw, 23px); color: rgba(239, 228, 204, .78); }
.panel p.aside { font-size: 16px; font-style: italic; color: var(--faint); margin-top: 1.4em; }
.rule { width: 56px; height: 1px; background: var(--brass); margin: 18px 0 22px; opacity: .7; }
.cta { display: inline-flex; gap: 12px; align-items: center; margin-top: 10px; font-family: var(--display); font-size: 11px; letter-spacing: .3em; text-transform: uppercase; text-decoration: none; color: var(--brass); padding: 14px 20px; border: 1px solid var(--line); background: rgba(8, 8, 12, .35); transition: border-color .25s, background .25s; }
.cta:hover { border-color: var(--brass); background: rgba(214, 171, 98, .1); }

/* movement stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: 1.6em 0 0; background: var(--line); border: 1px solid var(--line); }
.stats div { background: rgba(6, 6, 10, .82); padding: 14px 12px 12px; }
.stats dt { font-family: var(--display); font-size: 9px; letter-spacing: .22em; text-transform: uppercase; color: var(--faint); }
.stats dd { margin: 6px 0 0; font-family: var(--display); font-size: 28px; color: var(--ink); font-variant-numeric: tabular-nums; }

/* planet table */
.tablewrap { margin-top: 1.4em; overflow-x: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(6, 6, 10, .6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.planets { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.planets caption { text-align: left; font-family: var(--display); font-size: 10px; letter-spacing: .3em; text-transform: uppercase; color: var(--faint); padding: 12px 12px 4px; }
.planets th { font-family: var(--display); font-weight: 500; font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--faint); text-align: left; padding: 8px 12px; }
.planets td { padding: 9px 12px; border-top: 1px solid rgba(214, 171, 98, .14); font-size: 17px; color: var(--ink); white-space: nowrap; }
.planets td:first-child { font-family: var(--display); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; }
.planets td .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 10px; vertical-align: .05em; }
.planets .err { color: var(--faint); font-size: 14px; margin-left: 4px; }
.planets tbody tr { cursor: default; transition: background .2s; }
.planets tbody tr:hover, .planets tbody tr.hot { background: rgba(214, 171, 98, .08); }

/* earth live readouts */
.live { display: grid; grid-template-columns: 1fr; gap: 0; margin: 1.6em 0 0; border-top: 1px solid var(--line); }
.live div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.live dt { font-family: var(--display); font-size: 10px; letter-spacing: .26em; text-transform: uppercase; color: var(--faint); }
.live dd { margin: 0; font-size: 20px; color: var(--ink); text-align: right; }

/* craft cards */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 1.4em; }
.cards article { padding: 20px 20px 8px; border: 1px solid var(--line); background: rgba(6, 6, 10, .66); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.cards article p { font-size: 17px; }

/* heritage timeline */
.timeline { list-style: none; margin: 1.4em 0 0; padding: 0; border-left: 1px solid var(--line); }
.timeline li { position: relative; padding: 0 0 18px 26px; }
.timeline li::before { content: ''; position: absolute; left: -4px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--bg); border: 1px solid var(--brass); }
.timeline li:last-child::before { background: var(--brass); }
.when-y { display: block; font-family: var(--display); font-size: 11px; letter-spacing: .26em; color: var(--brass); margin-bottom: 4px; text-transform: uppercase; }
.timeline p { margin: 0; font-size: 18px; }
.timeline b { color: var(--ink); font-weight: 600; }

/* wind section */
.windform { display: flex; gap: 10px; align-items: flex-end; max-width: 420px; margin: 1.6em auto 0; }
.windform input { flex: 1; text-align: center; }
.windform button { padding: 10px 22px; }
.presets { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 22px 0 0; padding: 0; }
.presets button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 14px; font-size: 10.5px; }
.presets small { font-family: var(--text); font-size: 14px; letter-spacing: .02em; color: var(--faint); text-transform: none; }

/* footer */
.foot { min-height: 80vh; align-items: flex-end; padding-bottom: 150px; }
.foot::before { background: linear-gradient(0deg, rgba(4, 5, 9, .92) 0%, rgba(4, 5, 9, .6) 45%, rgba(4, 5, 9, 0) 85%); }
.foot .panel { max-width: 560px; }
.mark.big { font-size: 22px; margin-bottom: 18px; }
.footnav { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 18px 0; }
.panel p.small { font-size: 14px; color: var(--faint); }
.contact a { color: var(--brass); text-decoration-color: var(--line); text-underline-offset: 4px; }
.nojs { position: relative; z-index: 6; text-align: center; color: var(--dim); padding: 0 16px 40px; }

/* ---------------------------------------------------------------- reveal on scroll */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 1s cubic-bezier(.2, .7, .2, 1), transform 1.1s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--i, 0) * 90ms); }
.reveal.in { opacity: 1; transform: none; }
body.no-js .reveal, body.no-webgl .reveal { opacity: 1; transform: none; }
body.no-webgl .hud, body.no-webgl .hint, body.no-webgl .pips, body.no-webgl .tablewrap, body.no-webgl .live, body.no-webgl .stats, body.no-webgl .windform, body.no-webgl .presets, body.no-webgl .wind-only { display: none; }

/* ---------------------------------------------------------------- small screens */
@media (max-width: 900px) {
  .nav { display: none; position: fixed; inset: 0; z-index: -1; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: rgba(4, 5, 9, .94); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
  .nav.open { display: flex; }
  .nav a { font-size: 14px; padding: 12px 0; }
  .menu { display: block; }
  .cards { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .pips, .hint { display: none; }
  .readout .value { font-size: 15px; }
  .controls button { padding: 8px 9px; min-width: 40px; }
  .sec, .sec.right, .sec.center { justify-content: flex-start; align-items: flex-start; padding: 96px 16px 140px; text-align: left; }
  .sec::before, .sec.right::before, .sec.center::before { background: linear-gradient(180deg, var(--scrim) 0%, rgba(4, 5, 9, .62) 45%, rgba(4, 5, 9, .15) 80%); }
  .sec.hero::before { background: linear-gradient(180deg, rgba(4, 5, 9, .6) 0%, rgba(4, 5, 9, 0) 50%); }
  .foot { align-items: flex-end; }
  .stats { grid-template-columns: 1fr 1fr; }
  .planets .opt { display: none; }
  .planets td, .planets th { padding-left: 8px; padding-right: 8px; }
  .windform { margin-left: 0; }
  .presets { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { transition: none; opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- apps */
.apps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 1.4em 0 0; padding: 0; }
.app { display: flex; flex-direction: column; height: 100%; box-sizing: border-box; padding: 18px 18px 16px; border: 1px solid var(--line); background: rgba(6, 6, 10, .66); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: inherit; text-decoration: none; transition: border-color .25s, background .25s; }
.app .app-n { font-family: var(--display); font-size: 10px; letter-spacing: .3em; color: var(--faint); margin-bottom: 14px; }
.app h3 { margin-bottom: .4em; }
.panel .app p { font-size: 16px; margin: 0 0 1em; flex: 1; }
.app .app-go { font-family: var(--display); font-size: 10px; letter-spacing: .24em; text-transform: uppercase; color: var(--brass); }
a.app:hover { border-color: var(--brass); background: rgba(214, 171, 98, .08); }
a.app:focus-visible { outline: 1px solid var(--brass); outline-offset: 4px; }
.app.soon { border-style: dashed; }
.app.soon .app-go { color: var(--faint); }
@media (max-width: 900px) { .apps { grid-template-columns: 1fr; } .app .app-n { margin-bottom: 8px; } }
/* the apps panel is wide, so its scrim reaches further in */
#apps::before { background: linear-gradient(270deg, var(--scrim) 0%, rgba(4, 5, 9, .7) 45%, rgba(4, 5, 9, 0) 75%); }
@media (max-width: 700px) { #apps::before { background: linear-gradient(180deg, var(--scrim) 0%, rgba(4, 5, 9, .62) 45%, rgba(4, 5, 9, .15) 80%); } }
