:root {
  color-scheme: dark;
  --ink: #f4efe8;
  --muted: #b2b0ad;
  --accent: #f0bb8e;
  --line: #343333;
  --page-pad: max(1.25rem, calc((100% - 76rem) / 2));
  scroll-padding-top: 4rem;
}
* { box-sizing: border-box; }
body { margin: 0; background: #101112; color: var(--ink); font: 400 .94rem/1.7 var(--site-mono); }
h1, h2, h3, p, blockquote, ul { margin: 0; }
a { color: inherit; text-underline-offset: .24em; }
a:hover { color: var(--accent); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
.skip-link { position: fixed; top: .75rem; left: 1rem; z-index: 200; transform: translateY(-200%); background: var(--ink); color: #121315; padding: .6rem 1rem; }
.skip-link:focus { transform: none; }

#hero {
  --hero-x: 74%;
  --hero-y: 46%;
  --hero-distance: 19;
  position: relative; isolation: isolate;
  height: clamp(35rem, 86svh, 64rem); background: #060609;
}
.hero-plate, .hero-plate img, #gl, #hero::after { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-plate img { display: block; object-fit: cover; object-position: var(--hero-x) var(--hero-y); }
#gl { opacity: 0; transition: opacity .45s ease; }
#hero.live #gl { opacity: 1; }
#hero::after {
  content: ""; pointer-events: none;
  background: linear-gradient(90deg, #090a0de8, #090a0da8 29%, transparent 59%),
              linear-gradient(0deg, #090a0ef5, transparent 27%);
}
#welcome { position: absolute; left: var(--page-pad); top: 51%; transform: translateY(-50%); z-index: 1; }
#welcome h1 { font-size: clamp(3.4rem, 6.5vw, 7rem); font-weight: 480; letter-spacing: -.085em; line-height: .97; }
#welcome h1 span { color: var(--accent); }
.hero-summary { max-width: 30ch; margin: 1.35rem 0; color: #d5d1cc; font-size: clamp(.85rem, 1.2vw, 1.05rem); }
#scroll-cue { display: inline-flex; align-items: center; gap: 1rem; min-height: 44px; color: var(--accent); font-size: .84rem; text-decoration: none; }
#scroll-cue:hover { text-decoration: underline; }
.scene-bar { position: absolute; inset: auto var(--page-pad) 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: .8rem; border-top: 1px solid #ffffff35; padding: .65rem 0; }
.scene-caption { font-size: .74rem; color: #ded9d4; }
.scene-caption span { color: #bcb5ae; border-left: 1px solid #66605c; padding-left: .8em; margin-left: .5em; }
#ui { display: flex; gap: .4rem; }
#ui button, .apod-toggle { min-height: 44px; padding: .35rem .9rem; background: #141517d9; border: 1px solid #55514e; border-radius: 3px; font-size: .76rem; }
#ui button:hover, .apod-toggle:hover { border-color: var(--accent); color: var(--accent); }
#hint { position: absolute; z-index: 1; bottom: 5rem; left: 50%; transform: translateX(-50%); width: max-content; max-width: 92%; text-align: center; background: #111318df; color: #ddd; padding: .4rem .8rem; font-size: .75rem; }
body.immersive { overflow: hidden; }
body.immersive #hero { height: 100dvh; }
body.immersive #hero::after, body.immersive #welcome, body.immersive #content { display: none; }
body.immersive .scene-bar { padding-bottom: max(.65rem, env(safe-area-inset-bottom)); }
@media (max-width: 500px) {
  body.immersive .scene-caption { display: none; }
  body.immersive .scene-bar { justify-content: center; }
}
body.immersive #gl { cursor: grab; touch-action: none; }
body.immersive #gl:active { cursor: grabbing; }

#content { border-top: 1px solid var(--line); }
.wrap { max-width: 76rem; margin: auto; padding: clamp(2.4rem, 5vw, 4.2rem) 0; width: calc(100% - 2.5rem); }
.wrap h2 { font-size: clamp(1.4rem, 2.5vw, 2.1rem); font-weight: 480; letter-spacing: -.065em; line-height: 1.25; margin: 3.5rem 0 1.4rem; }
.wrap h2:first-child { margin-top: 0; }
.start-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-block: 1px solid var(--line); }
.start-links a { position: relative; padding: 1.5rem 2.5rem 1.5rem 1.25rem; color: var(--ink); text-decoration: none; }
.start-links a + a { border-left: 1px solid var(--line); }
.start-links a::after { content: "↗"; position: absolute; top: 1.45rem; right: 1rem; color: var(--accent); }
.start-links a:hover { background: #1a1a1a; }
.start-links strong { display: block; margin-bottom: .45rem; font-size: 1.03rem; font-weight: 550; }
.start-links span, .widget p, .wrap li { color: var(--muted); font-size: .85rem; }
.about { display: grid; grid-template-columns: minmax(9rem, 16rem) minmax(0, 64ch); gap: clamp(1.25rem, 5vw, 4rem); }
.about img { width: 100%; height: auto; border-radius: 3px; }
.txt p { color: #c9c7c4; margin-bottom: .9rem; }
.txt a, .wrap li a, .note a { color: var(--ink); text-decoration-color: #756a61; }
.txt a:hover, .wrap li a:hover, .note a:hover { color: var(--accent); }
.contact-links { display: flex; flex-wrap: wrap; gap: 1rem; }
.wrap ul { list-style: none; padding: 0; }
.wrap li { padding: .75rem 0; border-bottom: 1px solid var(--line); }
blockquote { max-width: 64ch; padding-left: 1.2rem; border-left: 2px solid var(--accent); }
.attribution { display: block; color: var(--muted); font-size: .8rem; margin-top: .5rem; }
.widgets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 1rem; }
.widget { background: #161719; border: 1px solid var(--line); padding: clamp(1rem, 2.5vw, 1.6rem); overflow-wrap: anywhere; }
.widget h3 { font-size: .82rem; color: var(--accent); font-weight: 550; margin-bottom: .9rem; }
.widget img { display: block; max-width: 100%; height: auto; margin: .7rem 0; }
.apod-desc.clamped { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.apod-toggle { margin-top: .7rem; }
.commit-meta, .iss-label, .launch-countdown-label { font-size: .72rem; color: var(--muted); }
.iss-coords { display: flex; gap: 1.2rem; }
.iss-label { display: block; }
.iss-value, .launch-countdown { font-size: 1.2rem; }
.note { margin-top: 2.8rem; font-size: .8rem; }

@media (max-aspect-ratio: 1/1) {
  #hero { --hero-x: 59%; --hero-y: 34%; --hero-distance: 22; height: clamp(39rem, 88svh, 66rem); }
  #hero::after { background: linear-gradient(0deg, #08090cf7 4%, #08090cbf 32%, transparent 58%); }
  #welcome { top: auto; bottom: 5.2rem; transform: none; }
  #welcome h1 { font-size: clamp(3.2rem, 10vw, 5.6rem); }
  .hero-summary { margin: .7rem 0 .2rem; }
}
@media (max-width: 650px) {
  .scene-caption span { display: block; padding: 0; margin: 0; border: 0; font-size: .67rem; }
  .scene-caption { font-size: .68rem; }
  #ui button { padding-inline: .55rem; }
  .start-links, .widgets { grid-template-columns: 1fr; }
  .start-links a { padding: 1rem 2rem 1rem 0; }
  .start-links a::after { top: 1rem; right: .2rem; }
  .start-links a + a { border-left: 0; border-top: 1px solid var(--line); }
  .about { grid-template-columns: 1fr; }
  .about img { width: min(52%, 12rem); }
}
@media (max-height: 530px) and (orientation: landscape) {
  #hero { height: max(26rem, 100svh); }
  #welcome h1 { font-size: 2.8rem; }
  .hero-summary { margin: .5rem 0; }
}
@media (prefers-reduced-motion: reduce) { #gl { transition: none; } }
