/* The landing page: out of universe, one night scene. Everything past it (wiki, H&A, Clearwind) is in-universe. */
:root {
  --bg: #000;
  --ink: #e8e3d8;             /* warm off-white, the colour of the city lights, desaturated */
  --ink-2: rgba(232, 227, 216, .62);
  --ink-3: rgba(232, 227, 216, .38);
  --line: rgba(232, 227, 216, .14);
  --green: #6eff8c;
  --purple: #af5fff;
  --serif: Georgia, 'Times New Roman', serif;
  --subtitle: 'Libre Baskerville', Baskerville, 'Baskerville Old Face', Georgia, serif;
  --display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;   /* title screen only, self-hosted */
  --sans: system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); color: var(--ink); scroll-behavior: smooth; }
body { background: var(--bg); font-family: var(--sans); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; }

/* ---------- hero: the globe fills the first screen ---------- */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 520px; overflow: hidden; }
#globe { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; cursor: grab; }
#globe.dragging { cursor: grabbing; }
#globe.over-iris { cursor: pointer; }

.title { position: absolute; left: 0; right: 0; top: 15vh; text-align: center; pointer-events: none; }
.title h1 {
  font-family: var(--display); font-weight: 300; font-size: clamp(34px, 6.4vw, 92px);
  letter-spacing: .42em; margin-right: -.42em;          /* letter-spacing trails the last letter; pull it back to centre */
  line-height: 1; color: var(--ink); opacity: .92;
}
.title p {
  font-family: var(--subtitle); font-style: italic; font-weight: 400; font-size: clamp(15px, 1.6vw, 21px);
  color: var(--ink-2); letter-spacing: .08em; margin-top: 1.1em;
}

/* ---------- the year control ---------- */
.years {
  position: absolute; left: 50%; bottom: calc(6.5vh + 16px); transform: translateX(-50%);
  display: flex; align-items: flex-end; gap: clamp(6px, 1.6vw, 22px);
  padding: 0 16px; max-width: 100%;
}
.years button {
  appearance: none; background: none; border: 0; color: var(--ink-3); cursor: pointer;
  font-family: var(--sans); font-size: 12px; font-variant-numeric: tabular-nums; letter-spacing: .06em;
  padding: 10px 2px 8px; position: relative; transition: color .4s, transform .4s;
}
.years button::after {                                      /* a tick under each year */
  content: ''; position: absolute; left: 50%; bottom: 0; width: 1px; height: 4px; background: var(--line);
  transition: height .4s, background .4s;
}
.years button:hover, .years button:focus-visible { color: var(--ink-2); outline: none; }
.years button[aria-pressed="true"] { color: var(--ink); transform: translateY(-2px); font-size: 14px; }
.years button[aria-pressed="true"]::after { height: 9px; background: var(--ink-2); }
.years::before {                                            /* the rail the ticks hang from */
  content: ''; position: absolute; left: 16px; right: 16px; bottom: 0; height: 1px; background: var(--line);
}

.hint {
  position: absolute; left: 0; right: 0; bottom: calc(2.2vh + 16px); text-align: center;
  font-size: 11px; letter-spacing: .14em; color: var(--ink-3); text-transform: lowercase; pointer-events: none;
}

/* two wide chevrons under the hint: there's more below the globe */
.more {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); padding: 4px 10px;
  color: var(--ink-3); transition: color .3s; animation: more 2.8s ease-in-out infinite;
}
.more svg { display: block; width: 40px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.more:hover, .more:focus-visible { color: var(--ink-2); outline: none; }
@keyframes more { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 4px); } }
@media (prefers-reduced-motion: reduce) { .more { animation: none; } }
.orbit .more { display: none; }

/* sound: bottom right, quiet until on; the credit shows while it plays */
.sound {
  position: absolute; right: 22px; bottom: 2.2vh; appearance: none; background: none; border: 0; cursor: pointer;
  font-family: var(--sans); font-size: 11px; letter-spacing: .14em; color: var(--ink-3); text-align: right;
  padding: 8px 4px; transition: color .3s;
}
.sound:hover, .sound:focus-visible { color: var(--ink-2); outline: none; }
.sound .note { font-size: 13px; }
.sound .credit {
  display: block; font-family: var(--serif); font-style: italic; font-size: 13px; letter-spacing: .04em;
  color: var(--ink-3); max-height: 0; opacity: 0; overflow: hidden; transition: opacity .8s, max-height .8s;
}
.sound[aria-pressed="true"] { color: var(--ink-2); }
.sound[aria-pressed="true"] .credit { max-height: 2em; opacity: 1; margin-top: 2px; }

/* the one line that answers a click on the Earth */
.tag {
  position: absolute; pointer-events: none; transform: translate(14px, -50%);
  font-size: 12px; letter-spacing: .05em; color: var(--ink); white-space: nowrap;
  opacity: 0; transition: opacity .25s;
}
.tag.on { opacity: 1; }
.tag small { display: block; color: var(--ink-3); font-size: 11px; }

/* ---------- below the fold ---------- */
.below { max-width: 760px; margin: 0 auto; padding: 18vh 24px 14vh; }
.below section + section { margin-top: 13vh; }
.below h2 {
  font-family: var(--serif); font-weight: 400; font-style: italic; font-size: 22px; color: var(--ink-2);
  letter-spacing: .04em; margin-bottom: 1.4em;
}
.below .aside { font-size: 13px; color: var(--ink-3); margin: -.6em 0 1.4em; }
.note p { font-family: var(--serif); font-size: 21px; line-height: 1.55; color: var(--ink); }
.note p + p { margin-top: .9em; }
.note .quiet { color: var(--ink-2); font-size: 18px; }

.rows { list-style: none; border-top: 1px solid var(--line); }
.rows li { border-bottom: 1px solid var(--line); }
.rows a, .rows .row {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 24px; align-items: baseline;
  padding: 18px 2px; text-decoration: none; transition: background .3s;
}
.rows a { transition: background .25s, padding .25s; }
.rows a:hover, .rows a:focus-visible { background: rgba(232, 227, 216, .07); padding-left: 12px; padding-right: 12px; outline: none; }
.rows a:hover .where { color: var(--ink-2); }
.rows .name { font-size: 16px; color: var(--ink); }
.rows .what { grid-column: 1; font-size: 14px; color: var(--ink-2); }
.rows .where { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 12px; letter-spacing: .08em; color: var(--ink-3); text-transform: lowercase; }
.rows .soon .name { color: var(--ink-2); }
.rows .off { opacity: .5; }

footer { text-align: center; padding: 0 24px 9vh; font-size: 12px; color: var(--ink-3); letter-spacing: .06em; }
footer blockquote {
  font-family: var(--serif); font-style: italic; font-size: 19px; letter-spacing: .02em; color: var(--ink-2);
  margin: 7vh auto 0; max-width: 560px;
}

@media (max-width: 560px) {
  .title { top: 11vh; }
  .years { gap: 4px; bottom: calc(8vh + 16px); }
  .years button { font-size: 10px; padding: 10px 1px 8px; }
  .years button:not([aria-pressed="true"]):not(:first-child):not(:last-child) { font-size: 0; width: 10px; }
  .years button[aria-pressed="true"] { font-size: 13px; }
  .note p { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.clean .title, .clean .years, .clean .hint, .clean .sound, .clean .back, .clean .more { display: none; }

/* no WebGL2: a still of the globe instead */
.no-gl { background: #000 url(../assets/fallback.jpg) center / cover no-repeat; }
.no-gl #globe, .no-gl .years, .no-gl .hint { display: none; }

/* leaving for the Iris's orbit: fade to black while the view pushes in */
.veil { position: fixed; inset: 0; background: #000; opacity: 0; transition: opacity 1s ease-in; pointer-events: none; z-index: 50; }
.veil.on { opacity: 1; }

/* ---------- the orbit view (same page: body.orbit hides the landing's text below the globe) ---------- */
.orbit .below, .orbit footer { display: none; }
.back[hidden] { display: none; }
.title h1, .title p { transition: opacity .5s; }
.orbit .title { top: 7vh; }
.orbit .title h1 { font-size: clamp(22px, 3.2vw, 44px); letter-spacing: .5em; margin-right: -.5em; }
.orbit .title p { margin-top: .7em; }
.back {
  position: absolute; left: 22px; top: 20px; z-index: 5; color: var(--ink-3); text-decoration: none;
  font-size: 12px; letter-spacing: .14em; text-transform: lowercase; padding: 6px 2px; transition: color .3s;
}
.back:hover, .back:focus-visible { color: var(--ink); outline: none; }
.orbit #globe { cursor: default; touch-action: none; }
.years button.fresh { animation: fresh 2.4s ease-out both; }
@keyframes fresh { from { opacity: 0; color: #6eff8c; } 40% { opacity: 1; color: #6eff8c; } to { opacity: 1; } }
.orbit #globe.over-body { cursor: pointer; }

/* ---------- the wiki over the globe (js/reader.js) ---------- */
/* a click on a place: its summary beside the click */
.card {
  position: fixed; z-index: 40; width: 330px; max-width: calc(100vw - 24px); padding: 18px 20px 16px;
  background: rgba(12, 11, 10, .93); border: 1px solid var(--line); backdrop-filter: blur(8px);
  opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s;
}
.card.on { opacity: 1; transform: none; }
.card h3 { font-family: var(--serif); font-weight: 400; font-size: 24px; line-height: 1.15; margin-bottom: 8px; }
.card p { font-size: 13.5px; line-height: 1.6; color: var(--ink-2); }
.card p.none { font-style: italic; }
.card .full, .entry .full {
  appearance: none; background: none; border: 0; cursor: pointer; padding: 0; margin-top: 12px;
  font-family: var(--sans); font-size: 12px; letter-spacing: .12em; text-transform: lowercase; color: #e9b98b;
}
.card .full:hover, .entry .full:hover { color: #ffd9b0; }

/* the full article: a panel from the right, the globe still turning on the left */
.reader {
  position: fixed; z-index: 45; top: 0; right: 0; bottom: 0; width: min(860px, 100vw);
  display: flex; flex-direction: column; background: #0b0a09; border-left: 1px solid var(--line);
  box-shadow: -30px 0 80px rgba(0, 0, 0, .6); transform: translateX(100%); transition: transform .45s cubic-bezier(.2, .7, .2, 1);
}
.reader.on { transform: none; }
.reader .bar { display: flex; justify-content: flex-end; align-items: center; gap: 18px; padding: 6px 12px; border-bottom: 1px solid var(--line); }
.reader .out { font-size: 11px; letter-spacing: .12em; color: var(--ink-3); text-decoration: none; }
.reader .out:hover { color: var(--ink-2); }
.reader .x { appearance: none; background: none; border: 0; color: var(--ink-2); font-size: 26px; line-height: 1; padding: 2px 6px; cursor: pointer; }
.reader .x:hover { color: var(--ink); }
.reader iframe { flex: 1; width: 100%; border: 0; background: #0b0a09; }

/* an orbit view scrolls down to its planet's entry */
.entry { max-width: 680px; margin: 0 auto; padding: 16vh 24px 22vh; }
.entry[hidden], body:not(.orbit) .entry { display: none; }
.entry .from { font-size: 12px; letter-spacing: .06em; color: var(--ink-3); }
.entry h2 { font-family: var(--serif); font-weight: 300; font-size: clamp(34px, 5vw, 54px); letter-spacing: .02em; margin: .2em 0 .5em; }
.entry .sum { font-family: var(--serif); font-size: 21px; line-height: 1.55; color: var(--ink); }
.entry .full { margin-top: 26px; font-size: 13px; }
.orbit.has-entry .more { display: block; }
#globe.over-place { cursor: pointer; }

@media (max-width: 560px) {
  .card { left: 12px !important; right: 12px; top: auto !important; bottom: 12px; width: auto; }
  .entry .sum { font-size: 19px; }
}
