:root {
  --bg: #03050a;
  --ink: #eef1f6;
  --ink-soft: rgba(238, 241, 246, 0.64);
  --ink-faint: rgba(238, 241, 246, 0.4);
  --serif: "Instrument Serif", "Iowan Old Style", "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(1.5rem, 7vw, 7rem);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Updated from js/globe.js so overlays can line up with the globe. */
  --globe-x: 69vw;
  --hint-top: 92vh;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

a,
button,
canvas {
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100svh;
  background:
    radial-gradient(ellipse 50% 60% at var(--globe-x) 50%, rgba(40, 80, 150, 0.09), transparent 70%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Sky and globe ---------- */

#stars,
#globe {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
}

#stars {
  transition: opacity 2.4s ease;
}

#globe {
  transition: opacity 2.2s var(--ease-out);
  /* The hero is one screen, so touch drags can turn the globe freely. */
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

#stars.is-ready,
#globe.is-ready {
  opacity: 1;
}

#globe.is-over-globe {
  cursor: grab;
}

#globe.is-dragging {
  cursor: grabbing;
}

#globe.is-over-pin {
  cursor: pointer;
}

/* ---------- Intro ---------- */

.hero {
  position: relative;
  z-index: 1;
  transition: opacity 0.8s ease;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: var(--gutter);
  /* Let drags fall through to the globe everywhere except the text itself. */
  pointer-events: none;
}

.intro {
  width: fit-content;
  max-width: 44rem;
  pointer-events: auto;
}

/* One quiet line of study details under the tagline. */
.studies {
  margin: 0.55rem 0 0;
  color: var(--ink-faint);
  font-size: clamp(0.55rem, 0.62vw, 0.62rem);
  text-align: center;
  padding-left: 0.2em; /* balances the trailing letter-spacing */
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-wrap: balance;
}

.name {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3.8rem, 9vw, 9rem);
  line-height: 0.92;
  letter-spacing: -0.015em;
}

.tagline {
  margin: 1.1rem 0 0;
  color: var(--ink-soft);
  font-size: clamp(0.78rem, 0.85vw, 0.88rem);
  font-weight: 400;
  letter-spacing: 0.03em;
  text-align: center;
}

.tagline .sep {
  margin: 0 0.55em;
  color: var(--ink-faint);
  font-weight: 300;
}

.lede {
  margin: 1.75rem 0 0;
  max-width: 25rem;
  font-size: clamp(1rem, 1.15vw, 1.125rem);
  line-height: 1.7;
  color: var(--ink-soft);
}

.links {
  display: flex;
  justify-content: center;
  gap: 2.25rem;
  margin-top: 2.25rem;
}

.links a {
  position: relative;
  padding-block: 0.4rem;
  color: rgba(238, 241, 246, 0.85);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  margin-right: -0.16em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.4s ease;
}

.links a::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s var(--ease-out);
}

.links a:hover,
.links a:focus-visible {
  color: var(--ink);
}

.links a:hover::after,
.links a:focus-visible::after {
  transform: scaleX(1);
}

.links a:focus-visible {
  outline: 1px solid var(--ink-faint);
  outline-offset: 6px;
}

/* Text settles in while the globe makes its opening turn. */
.intro > * {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 1.6s var(--ease-out) forwards;
}

.studies {
  animation-delay: 0.75s;
}

.name {
  animation-delay: 0.35s;
}

.lede,
.tagline {
  animation-delay: 0.6s;
}

.links {
  animation-delay: 0.85s;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}

.hint {
  position: fixed;
  z-index: 1;
  top: var(--hint-top);
  left: var(--globe-x);
  margin: 0;
  transform: translateX(-50%);
  color: var(--ink-faint);
  font-size: 0.6875rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.hint.is-visible {
  opacity: 1;
}

/* ---------- Portrait phones and tablets: globe on top, text below ---------- */

@media (max-width: 899px) and (orientation: portrait) {
  .hero {
    align-items: flex-end;
    justify-content: center;
    padding: var(--gutter);
    padding-bottom: max(3.25rem, calc(env(safe-area-inset-bottom) + 2.25rem), 8svh);
  }

  .hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(to top, rgba(3, 5, 10, 0.92), rgba(3, 5, 10, 0.55) 38%, transparent 60%);
    pointer-events: none;
  }

  .studies {
    margin-top: 0.5rem;
    font-size: 0.55rem;
    letter-spacing: 0.14em;
    padding-left: 0.14em;
  }

  .name {
    font-size: clamp(3.4rem, 17vw, 5.4rem);
  }

  .lede {
    margin-top: 1.25rem;
    font-size: clamp(0.98rem, 4.1vw, 1.1rem);
    line-height: 1.6;
  }

  .links {
    gap: 1.75rem;
    margin-top: 1.75rem;
  }

  .links a {
    padding-block: 0.6rem; /* comfortable tap targets */
  }

  .hint {
    display: none;
  }
}

/* ---------- Short landscape screens (phones on their side) ---------- */

@media (max-height: 520px) and (orientation: landscape) {
  .hero {
    padding-block: max(1.25rem, env(safe-area-inset-top));
    padding-left: max(var(--gutter), calc(env(safe-area-inset-left) + 1rem));
  }

  .intro {
    max-width: 24rem;
  }

  .name {
    font-size: clamp(2.6rem, 7vw, 3.6rem);
  }

  .lede {
    margin-top: 0.9rem;
    max-width: 21rem;
    font-size: 0.92rem;
    line-height: 1.55;
  }

  .links {
    margin-top: 1.1rem;
  }

  .hint {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro > * {
    opacity: 1;
    transform: none;
    animation: none;
  }

  #stars,
  #globe,
  .hint {
    transition-duration: 0.01s;
  }
}

/* ---------- Contact: asteroid strike, shatter, rebuild ---------- */

#contact {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  color: var(--ink);
  background: transparent;
}

#contact::backdrop {
  background: transparent;
}

/* Deep space behind the shards, shown from the moment of impact. */
#contact::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 47%, #0d1a2e 0%, #060a14 55%, #02040a 100%);
  opacity: 0;
  pointer-events: none;
}

#contact.is-struck::before {
  opacity: 0.94;
}

#impact {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#contact.is-built #impact {
  opacity: 0;
  transition: opacity 0.8s ease 0.1s;
}

.contact-toolbar {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 3;
  padding: 1.5rem var(--gutter);
}

#close-contact,
#place-back {
  padding: 0.7rem 1.1rem;
  border: 1px solid rgba(129, 150, 176, 0.3);
  border-radius: 999px;
  background: rgba(7, 16, 28, 0.7);
  color: var(--ink);
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: border-color 0.3s ease;
}

#close-contact:hover,
#place-back:hover {
  border-color: #a7cfff;
}

#contact :focus-visible {
  outline: 2px solid #9fcaff;
  outline-offset: 6px;
}

.contact-icons {
  --icon: clamp(72px, 21vw, 124px);
  position: fixed;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--icon) * 0.4);
  pointer-events: none;
}

.app-icon {
  display: block;
  border-radius: 23%;
  opacity: 0;
  pointer-events: auto;
}

.app-icon svg {
  display: block;
  width: var(--icon);
  height: var(--icon);
  transition: transform 0.4s var(--ease-out), filter 0.4s ease;
}

#contact.is-built .app-icon {
  opacity: 1;
  transition: opacity 0.45s ease;
}

#contact.is-built .app-icon svg {
  filter: drop-shadow(0 18px 36px rgba(0, 0, 0, 0.45));
}

#contact.is-built .app-icon:hover svg,
#contact.is-built .app-icon:focus-visible svg {
  transform: translateY(-6px) scale(1.04);
  filter: drop-shadow(0 22px 44px rgba(70, 140, 255, 0.35));
}

body.contact-open {
  overflow: hidden;
}

body.contact-struck .hero,
body.contact-struck #globe,
body.contact-struck .hint,
body.contact-struck #pins {
  visibility: hidden;
}

@media (max-width: 600px) {
  .contact-toolbar {
    padding: max(1rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right)) 1rem 1.25rem;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .contact-icons {
    --icon: clamp(64px, 22vh, 104px);
  }

  .contact-toolbar {
    padding: max(0.9rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right)) 0.9rem 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  #contact *,
  #contact::before {
    transition: none !important;
  }
}

/* ---------- Project pins on the globe ---------- */

#pins {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.pin-label {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  justify-items: start;
  padding: 0.38rem 0.7rem 0.42rem;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 999px;
  background: rgba(6, 10, 20, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 0 22px color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--ink);
  font: inherit;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, padding 0.35s var(--ease-out), border-radius 0.35s ease, border-color 0.3s ease, box-shadow 0.35s ease;
  will-change: transform;
}

.pin-label.is-visible,
.pin-label:focus-visible {
  opacity: 1;
  pointer-events: auto;
}

.pin-label.is-focused,
.pin-label:focus-visible {
  padding: 0.7rem 0.95rem 0.75rem;
  border-color: var(--accent);
  border-radius: 14px;
  box-shadow: 0 0 36px color-mix(in srgb, var(--accent) 45%, transparent);
}

.pin-label:hover {
  border-color: var(--accent);
}

.pin-label:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.pin-name {
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1;
  transition: font-size 0.35s var(--ease-out);
}

.pin-label.is-focused .pin-name,
.pin-label:focus-visible .pin-name {
  font-size: 1.4rem;
}

/* Place and call to action only appear once the pin is centred. */
.pin-place,
.pin-cta {
  display: block;
  max-width: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-width 0.35s var(--ease-out), max-height 0.35s var(--ease-out), opacity 0.3s ease, margin 0.35s ease;
}

.pin-place {
  color: var(--ink-faint);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.pin-cta {
  color: var(--accent);
  font-size: 0.72rem;
}

.pin-label.is-focused .pin-place,
.pin-label.is-focused .pin-cta,
.pin-label:focus-visible .pin-place,
.pin-label:focus-visible .pin-cta {
  max-width: 18rem;
  max-height: 1.4rem;
  opacity: 1;
  margin-top: 0.3rem;
}

body.is-traveling .hero,
body.is-traveling .hint,
body.is-traveling #pins {
  opacity: 0;
  pointer-events: none;
}

body.is-traveling .hint {
  transition: opacity 0.5s ease;
}

/* ---------- A project's 3D world ---------- */

#place {
  position: fixed;
  inset: 0;
  z-index: 5;
  background: #000;
  opacity: 0;
  transition: opacity 0.7s ease;
}

#place[hidden] {
  display: none;
}

#place.is-revealed {
  opacity: 1;
}

#place.is-leaving {
  opacity: 0;
  transition: opacity 0.9s ease;
}

#place-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}

#place-canvas:active {
  cursor: grabbing;
}

.place-toolbar {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  padding: max(1.5rem, env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) 1rem 1rem;
}

.place-card {
  position: absolute;
  bottom: max(var(--gutter), calc(env(safe-area-inset-bottom) + 1.25rem));
  left: max(var(--gutter), env(safe-area-inset-left));
  z-index: 1;
  max-width: 25rem;
  padding: 1.3rem 1.45rem 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 18px;
  background: rgba(8, 10, 18, 0.5);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

.place-card.is-visible {
  opacity: 1;
  transform: none;
}

.place-meta {
  margin: 0;
  color: var(--ink-faint);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.place-name {
  margin: 0.55rem 0 0;
  font-family: var(--serif);
  font-size: clamp(2.1rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1;
}

.place-blurb {
  margin: 0.8rem 0 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.6;
}

.place-link {
  display: inline-flex;
  margin-top: 1.1rem;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  background: var(--accent, #fff);
  color: #0b0b10;
  font-size: 0.78rem;
  font-weight: 400;
  text-decoration: none;
  transition: transform 0.3s var(--ease-out), filter 0.3s ease;
}

.place-link:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.place-link[hidden] {
  display: none;
}

.place-link:focus-visible,
#place-back:focus-visible {
  outline: 2px solid var(--accent, #9fcaff);
  outline-offset: 4px;
}

body.place-open {
  overflow: hidden;
}

@media (max-width: 600px) {
  .place-card {
    right: 1rem;
    left: 1rem;
    bottom: max(1rem, calc(env(safe-area-inset-bottom) + 0.75rem));
    max-width: none;
    padding: 1.05rem 1.15rem 1.15rem;
  }

  .place-name {
    font-size: 2rem;
  }

  .place-blurb {
    font-size: 0.86rem;
    line-height: 1.55;
  }

  .place-toolbar {
    padding: max(1rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right)) 1rem 1rem;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .place-card {
    bottom: 1rem;
    max-width: 19rem;
    padding: 0.9rem 1rem 1rem;
  }

  .place-name {
    font-size: 1.7rem;
  }

  .place-blurb {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  #place,
  .place-card,
  .pin-label {
    transition-duration: 0.01s;
  }
}

/* ---------- Work: a formal page with a hint of space ---------- */

#work-page {
  --paper-ink: #ece8e1;
  --paper-soft: #b9b6b0;
  --paper-rule: rgba(236, 232, 225, 0.14);
  --paper-link: #c9d6ee;
  position: fixed;
  inset: 0;
  z-index: 6;
  background: #07080c;
  color: var(--paper-ink);
  font-family: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  font-optical-sizing: auto;
  opacity: 0;
  transition: opacity 0.6s ease;
}

#work-page[hidden] {
  display: none;
}

#work-page.is-revealed {
  opacity: 1;
}

#work-page.is-leaving {
  opacity: 0;
}

/* The only nod to space: a faint curve of Earth's horizon and a few stars. */
#work-page::before {
  content: "";
  position: absolute;
  top: -86vw;
  left: 50%;
  width: 200vw;
  height: 88vw;
  border-radius: 50%;
  box-shadow: 0 1px 0 rgba(170, 195, 235, 0.22), 0 14px 70px rgba(90, 130, 200, 0.12);
  transform: translateX(-50%);
  pointer-events: none;
}

.work-stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.work-scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.work-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: max(1.25rem, env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) 1rem max(var(--gutter), env(safe-area-inset-left));
  background: #07080c;
  border-bottom: 1px solid var(--paper-rule);
}

.work-mark {
  font-size: 1.05rem;
  font-weight: 600;
}

.work-home {
  padding: 0;
  border: 0;
  background: none;
  color: var(--paper-link);
  font: inherit;
  font-size: 0.95rem;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
  cursor: pointer;
}

.work-body {
  position: relative;
  width: min(44rem, 100% - 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(3rem, 9vh, 5.5rem) 0 0;
}

.work-title {
  margin: 0;
  font-size: clamp(2.6rem, 6vw, 3.6rem);
  font-weight: 400;
  line-height: 1.05;
}

.work-title:focus {
  outline: none;
}

.work-contents {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.6rem;
  margin: 1rem 0 0;
  font-size: 1.05rem;
}

#work-page a {
  color: var(--paper-link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

#work-page a:hover,
.work-home:hover {
  color: var(--paper-ink);
}

#work-page a:focus-visible,
#work-page button:focus-visible {
  outline: 2px solid var(--paper-link);
  outline-offset: 3px;
}

.work-section {
  margin-top: clamp(3rem, 8vh, 4.5rem);
  scroll-margin-top: 5rem;
}

.work-heading {
  margin: 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--paper-rule);
  font-size: 1.45rem;
  font-weight: 600;
}

.work-heading-minor {
  margin-top: 2.75rem;
  font-size: 1.15rem;
}

.work-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.work-entry {
  padding: 1.35rem 0;
}

.work-entry + .work-entry {
  border-top: 1px solid rgba(236, 232, 225, 0.06);
}

.work-entry-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
}

.work-entry-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
}

.work-entry-sub {
  margin: 0.15rem 0 0;
  color: var(--paper-soft);
  font-style: italic;
}

.work-entry-dates {
  flex: none;
  margin: 0;
  color: var(--paper-soft);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.work-points {
  margin: 0.7rem 0 0;
  padding-left: 1.15rem;
  color: var(--paper-ink);
  line-height: 1.6;
}

.work-points li + li {
  margin-top: 0.35rem;
}

.work-points strong {
  font-weight: 600;
}

.work-entry-text {
  margin: 0.45rem 0 0;
  line-height: 1.6;
}

.work-entry-link,
.work-entry-note {
  display: inline-block;
  margin: 0.45rem 0 0;
  font-size: 0.95rem;
}

.work-entry-note {
  color: var(--paper-soft);
  font-style: italic;
}

.work-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.6rem;
  margin-top: clamp(3rem, 8vh, 4.5rem);
  padding: 1.5rem 0 max(3rem, calc(env(safe-area-inset-bottom) + 2rem));
  border-top: 1px solid var(--paper-rule);
}

body.work-open {
  overflow: hidden;
}

@media (max-width: 600px) {
  .work-entry-head {
    flex-direction: column;
  }

  .work-entry-dates {
    order: -1;
    font-size: 0.85rem;
  }

  .work-bar {
    padding: max(1rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right)) 0.85rem max(1.25rem, env(safe-area-inset-left));
  }
}

@media (prefers-reduced-motion: reduce) {
  #work-page {
    transition-duration: 0.01s;
  }
}

/* ---------- About: the telescope and the star tunnel ---------- */

/* The eyepiece is drawn on this canvas during the transition. */
#scope {
  position: fixed;
  inset: 0;
  z-index: 7;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#scope[hidden] {
  display: none;
}

#sky {
  position: fixed;
  inset: 0;
  z-index: 6;
  background: #02030a;
  color: var(--ink);
  font-family: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

#sky[hidden] {
  display: none;
}

.sky-canvas,
.sky-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.sky-art {
  overflow: visible;
  pointer-events: none;
  will-change: transform;
}

.sky-ground {
  fill: #030408;
  stroke: rgba(140, 160, 210, 0.14);
  stroke-width: 1;
}

.sky-telescope {
  fill: #05070d;
  stroke: rgba(160, 180, 225, 0.42);
  stroke-width: 1.2;
  stroke-linecap: round;
}

.sky-labels {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

/* A constellation's name, shown only while it's lit. */
.sky-label {
  position: absolute;
  top: 0;
  left: 0;
  padding: 0.2rem 0.4rem;
  border: 0;
  background: none;
  color: rgba(236, 232, 225, 0.9);
  font: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

.sky-label:focus-visible {
  outline: 1px solid rgba(201, 214, 238, 0.6);
  outline-offset: 2px;
}

.sky-bar {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: max(1.5rem, env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) 1rem max(var(--gutter), env(safe-area-inset-left));
  pointer-events: none;
}

.sky-title {
  margin: 0;
  font-size: clamp(1.9rem, 3vw, 2.4rem);
  font-weight: 400;
  line-height: 1;
}

.sky-home {
  padding: 0;
  border: 0;
  background: none;
  color: #c9d6ee;
  font: inherit;
  font-size: 0.95rem;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
  cursor: pointer;
  pointer-events: auto;
}

.sky-home:hover {
  color: var(--ink);
}

.sky-home:focus-visible {
  outline: 2px solid #c9d6ee;
  outline-offset: 3px;
}

body.sky-open {
  overflow: hidden;
}

/* The photo wheel that opens from a constellation. */
.sky-reel {
  position: absolute;
  left: 50%;
  bottom: max(4.5rem, calc(env(safe-area-inset-bottom) + 3.75rem));
  width: min(36rem, calc(100vw - 2rem));
  padding: 0.9rem 1rem 0.8rem;
  border: 1px solid rgba(236, 232, 225, 0.12);
  border-radius: 10px;
  background: rgba(4, 6, 14, 0.82);
  color: var(--ink);
  transform: translate(-50%, 12px);
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s var(--ease-out);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.sky-reel[hidden] {
  display: none;
}

.sky-reel.is-open {
  opacity: 1;
  transform: translate(-50%, 0);
}

.sky-reel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.sky-reel-title {
  font-size: 1.1rem;
}

.sky-reel button {
  padding: 0.2rem 0.35rem;
  border: 0;
  background: none;
  color: #c9d6ee;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.sky-reel button:hover {
  color: var(--ink);
}

.sky-reel button:focus-visible {
  outline: 1px solid #c9d6ee;
  outline-offset: 2px;
}

.sky-reel-stage {
  height: 150px;
  margin-top: 0.5rem;
  perspective: 900px;
  overflow: hidden;
  cursor: grab;
}

.sky-reel-stage:active {
  cursor: grabbing;
}

.sky-reel-ring {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.55s var(--ease-out);
}

.sky-reel-ring.is-dragging {
  transition: none;
}

.sky-reel-photo {
  position: absolute;
  top: calc(50% - 62px);
  left: calc(50% - 84px);
  width: 168px;
  height: 124px;
  overflow: hidden;
  border: 1px solid rgba(236, 232, 225, 0.16);
  border-radius: 4px;
  background: #0b0e18;
  backface-visibility: hidden;
  opacity: 0.45;
  transition: opacity 0.4s ease;
}

.sky-reel-photo.is-front {
  opacity: 1;
}

.sky-reel-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.sky-reel-photo.is-empty {
  display: grid;
  place-items: center;
  padding: 0.75rem;
  background: hsl(var(--hue) 22% 13%);
  color: rgba(236, 232, 225, 0.6);
  font-size: 0.8rem;
  font-style: italic;
  text-align: center;
}

.sky-reel-nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 0.35rem;
}

@media (max-width: 600px) {
  .sky-reel-stage {
    height: 118px;
  }

  .sky-reel-photo {
    top: calc(50% - 48px);
    left: calc(50% - 64px);
    width: 128px;
    height: 96px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sky-reel,
  .sky-reel-ring {
    transition-duration: 0.01s;
  }
}
