/* ══ CONSTELLATION ═══════════════════════════════════════════════
   Everything that does not vary per star lives here. Per-star
   values (position, size, colour, animation offset) are set as
   inline styles or custom properties by app.js.
   ════════════════════════════════════════════════════════════════ */

:root {
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --serif: 'Times New Roman', Times, Georgia, serif;
  --ink: #030411;
}

html, body { margin: 0; padding: 0; background: #030411; }
a { color: #b794ff; text-decoration: none; }
a:hover { color: #e4d4ff; }

/* ── Motion ───────────────────────────────────────────────────── */

@keyframes om-twinkle { 0%, 100% { opacity: 0.9; } 50% { opacity: 0.25; } }
@keyframes om-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes om-shine { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
@keyframes om-line { 0%, 100% { opacity: 0.5; } 45% { opacity: 1; } }
@keyframes om-rise { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes om-slide { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: translateX(0); } }
@keyframes om-drift { 0%, 100% { transform: rotateX(64deg) translateZ(0); } 50% { transform: rotateX(60deg) translateZ(14px); } }
@keyframes om-pulse { 0%, 100% { opacity: 0.85; } 50% { opacity: 1; } }

/* Hidden tab: stop burning frames on a sky nobody is looking at. */
.om-paused * { animation-play-state: paused !important; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ── The sky ──────────────────────────────────────────────────── */

.sky {
  position: fixed;
  inset: 0;
  overflow: hidden;
  font-family: var(--serif);
  color: #ece6ff;
  background-color: #030411;
  background-image:
    radial-gradient(ellipse 1000px 700px at 20% 20%, rgba(30,45,110,0.25), transparent 62%),
    radial-gradient(ellipse 1100px 750px at 80% 28%, rgba(60,50,160,0.16), transparent 62%),
    radial-gradient(ellipse 1200px 850px at 50% 88%, rgba(18,26,70,0.35), transparent 65%),
    radial-gradient(ellipse 600px 480px at 52% 52%, rgba(110,130,235,0.14), transparent 70%);
}

/* Layer wrappers exist only to give app.js somewhere to render.
   `display: contents` keeps .sky as the containing block. */
.starfield,
.heritage-layer,
.star-layer,
.ui-layer { display: contents; }

/* ── Galaxy ───────────────────────────────────────────────────── */

.galaxy {
  position: absolute;
  left: 50%;
  top: 52%;
  width: 0;
  height: 0;
  z-index: 1;
  pointer-events: none;
  perspective: 900px;
  transform: rotate(-16deg);
}

.galaxy__disc {
  position: absolute;
  left: -390px;
  top: -390px;
  width: 780px;
  height: 780px;
  transform-style: preserve-3d;
  animation: om-drift 16s ease-in-out infinite;
}

.galaxy__haze {
  position: absolute;
  inset: -4%;
  border-radius: 50%;
  background: radial-gradient(ellipse 78% 60% at 50% 50%, transparent 26%, rgba(64,96,190,0.22) 42%, rgba(40,62,140,0.14) 60%, transparent 75%);
  filter: blur(14px);
  animation: om-spin 160s linear infinite;
}

.galaxy__arms,
.galaxy__swirl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.galaxy__arms { animation: om-spin 70s linear infinite; }
.galaxy__swirl { animation: om-spin 34s linear infinite; }

.galaxy__arm-haze { filter: blur(20px); }
.galaxy__arm-core { filter: blur(10px); }
.galaxy__swirl path { filter: blur(7px); }

.galaxy__dust {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background-image:
    radial-gradient(rgba(235,242,255,0.8) 0.6px, transparent 1.3px),
    radial-gradient(rgba(190,210,255,0.6) 0.5px, transparent 1.2px),
    radial-gradient(rgba(235,242,255,0.5) 0.7px, transparent 1.5px);
  background-size: 23px 19px, 31px 27px, 47px 41px;
  background-position: 0 0, 9px 13px, 21px 5px;
  -webkit-mask-image: radial-gradient(ellipse 70% 62% at 50% 50%, transparent 18%, rgba(0,0,0,0.85) 38%, rgba(0,0,0,0.4) 58%, transparent 74%);
  mask-image: radial-gradient(ellipse 70% 62% at 50% 50%, transparent 18%, rgba(0,0,0,0.85) 38%, rgba(0,0,0,0.4) 58%, transparent 74%);
  animation: om-spin 90s linear infinite;
}

.galaxy__core {
  position: absolute;
  inset: 34%;
  border-radius: 50%;
  transform: scaleX(1.45);
  background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(246,240,255,0.95) 14%, rgba(214,190,255,0.6) 34%, rgba(130,150,235,0.3) 55%, transparent 74%);
  filter: blur(4px);
  animation: om-pulse 6s ease-in-out infinite;
}

.galaxy__bloom {
  position: absolute;
  left: -120px;
  top: -90px;
  width: 240px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(240,236,255,0.35) 0%, rgba(150,140,255,0.12) 45%, transparent 70%);
  filter: blur(10px);
}

/* ── Field stars & vignette ───────────────────────────────────── */

.field-star {
  position: absolute;
  border-radius: 50%;
  z-index: 2;
  pointer-events: none;
}

.vignette {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: radial-gradient(ellipse 76% 66% at 50% 52%, transparent 40%, rgba(3,4,17,0.45) 78%, rgba(3,4,17,0.82) 100%);
}

/* ── Constellation lines ──────────────────────────────────────── */

.lines {
  position: absolute;
  left: 50%;
  top: 52%;
  margin: -550px 0 0 -650px;
  overflow: visible;
  z-index: 5;
  pointer-events: none;
}
.lines line {
  stroke: rgba(196,181,253,0.26);
  stroke-width: 1px;
}

/* ── Heritage stars ───────────────────────────────────────────── */

.om-her {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 44px;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: none;
  border: none;
  cursor: default;
  z-index: 8;
  padding: 4px;
}
.om-her__dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #a89cd8;
  opacity: 0.5;
  box-shadow: 0 0 6px rgba(168,156,216,0.6);
}
.om-her-l {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.24em;
  color: rgba(168,156,216,0.7);
  white-space: nowrap;
  text-shadow: 0 0 5px #030411, 0 0 9px #030411;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.om-her:hover .om-her-l,
.om-her:focus-visible .om-her-l { opacity: 1; }
.om-her:focus { outline: none; }
.om-her:focus-visible { outline: 1px solid rgba(167,139,250,0.6); outline-offset: 2px; }

/* ── Project stars ────────────────────────────────────────────── */

.om-star {
  position: absolute;
  /* --dx / --dy are the star's offset from the galactic centre */
  left: clamp(30px, calc(50% + var(--dx)), calc(100% - 30px));
  top: clamp(28%, calc(52% + var(--dy)), 72%);
  transform: translate(-50%, -50%);
  min-width: 44px;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 10;
  padding: 6px;
}
.om-star:focus { outline: none; }
.om-star:focus-visible { outline: 1px solid rgba(216,180,254,0.85); outline-offset: 3px; }

.om-star__seat {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.om-star__ring {
  position: absolute;
  width: var(--ring);
  height: var(--ring);
  border: 1px solid rgba(216,180,254,0.55);
  border-radius: 50%;
  box-shadow: 0 0 18px rgba(167,139,250,0.35), inset 0 0 14px rgba(167,139,250,0.18);
}

.om-glyph {
  display: flex;
  transition: transform 0.35s cubic-bezier(0.2,0.8,0.2,1), filter 0.35s ease;
}
.om-glyph svg { overflow: visible; }
.om-star:hover .om-glyph,
.om-star:focus-visible .om-glyph {
  transform: scale(1.22);
  filter: drop-shadow(0 0 13px rgba(216,180,254,0.95));
}

.om-star__caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
}
.om-tick {
  width: 1px;
  height: 7px;
  background: linear-gradient(to bottom, rgba(196,181,253,0.7), rgba(196,181,253,0));
  transition: opacity 0.3s ease;
  opacity: 0.45;
}
.om-star:hover .om-tick,
.om-star:focus-visible .om-tick { opacity: 1; }

.om-label {
  font-family: var(--mono);
  letter-spacing: 0.24em;
  white-space: nowrap;
  text-shadow: 0 0 3px #030411, 0 0 6px #030411, 0 0 10px #030411, 0 0 16px rgba(3,4,17,0.98), 0 1px 2px #030411;
  transition: color 0.3s ease, letter-spacing 0.3s ease;
}
.om-star:hover .om-label,
.om-star:focus-visible .om-label { color: #f2ecff !important; }

/* ── Masthead ─────────────────────────────────────────────────── */

.om-head {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 34px 20px 0;
  z-index: 20;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.om-head__eyebrow { display: flex; align-items: center; gap: 16px; }
.om-head__rule { width: clamp(24px, 6vw, 64px); height: 1px; }
.om-head__rule--l { background: linear-gradient(to right, transparent, rgba(167,139,250,0.5)); }
.om-head__rule--r { background: linear-gradient(to left, transparent, rgba(167,139,250,0.5)); }
.om-head__kicker {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: rgba(183,148,255,0.75);
  white-space: nowrap;
}
.om-head h1 {
  margin: 0;
  font-size: clamp(27px, 3.4vw, 46px);
  font-weight: 800;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  line-height: 1.05;
  color: #f2ecff;
  text-shadow: 0 0 30px rgba(167,139,250,0.4), 0 2px 20px rgba(3,4,17,0.9);
}
.om-head__sub {
  margin: 0;
  font-style: italic;
  font-size: clamp(13.5px, 1.9vw, 18px);
  letter-spacing: 0.03em;
  color: #a89cd8;
  text-shadow: 0 1px 12px rgba(3,4,17,0.95);
}

/* ── Key ──────────────────────────────────────────────────────── */

.om-key {
  position: absolute;
  left: 26px;
  bottom: 118px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 15px 17px 15px 16px;
  border: 1px solid rgba(167,139,250,0.16);
  background: rgba(6,8,26,0.5);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  user-select: none;
}
.om-key__title {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(168,156,216,0.55);
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(167,139,250,0.12);
}
.om-key__row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* Status diamond — colour comes from the element or its parent. */
.status-pip {
  width: 6px;
  height: 6px;
  flex: none;
  transform: rotate(45deg);
  border: 1px solid currentColor;
}

/* ── Footer ───────────────────────────────────────────────────── */

.om-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 30px 16px 20px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
  text-align: center;
  background: linear-gradient(to top, rgba(3,4,17,0.92) 45%, rgba(3,4,17,0.5) 78%, transparent);
}
.om-tagline {
  margin: 0;
  font-family: var(--mono);
  color: rgba(168,156,216,0.62);
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}
.om-tagline__item { display: inline-block; white-space: nowrap; }
.om-tagline__sep { color: rgba(167,139,250,0.35); margin: 0 9px; }
.om-foot nav {
  display: flex;
  gap: 22px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
}
.om-foot nav a {
  border-bottom: 1px solid rgba(183,148,255,0.3);
  padding-bottom: 3px;
}
.om-foot nav a:hover { border-bottom-color: #e4d4ff; }

/* ── Index toggle ─────────────────────────────────────────────── */

.index-toggle {
  position: absolute;
  top: 26px;
  right: 26px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 0 16px;
  cursor: pointer;
  background: rgba(6,8,26,0.62);
  border: 1px solid rgba(167,139,250,0.24);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #c9b8f5;
}
.index-toggle:hover { border-color: rgba(216,180,254,0.6); color: #f2ecff; }
.index-toggle:focus-visible { outline: 1px solid rgba(216,180,254,0.85); outline-offset: 2px; }
.index-toggle__count { color: rgba(168,156,216,0.6); letter-spacing: 0.1em; }

/* ── Star index ───────────────────────────────────────────────── */

.om-scrim {
  position: absolute;
  inset: 0;
  z-index: 29;
  background: rgba(3,4,17,0.62);
  border: none;
  cursor: default;
}

.om-panel {
  position: absolute;
  top: 26px;
  right: 26px;
  bottom: 118px;
  width: 272px;
  overflow-y: auto;
  box-sizing: border-box;
  z-index: 30;
  padding: 18px 18px 16px;
  background: linear-gradient(165deg, rgba(14,12,38,0.9), rgba(6,5,20,0.92));
  border: 1px solid rgba(167,139,250,0.2);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  box-shadow: 0 22px 60px rgba(0,0,0,0.5);
  animation: om-slide 0.28s ease-out;
}
.om-panel__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 11px;
  border-bottom: 1px solid rgba(167,139,250,0.16);
}
.om-panel__title {
  flex: 1;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #c9b8f5;
}

.om-close {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(168,156,216,0.7);
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
}
.om-close:hover { color: #f2ecff; }
.om-close:focus-visible { outline: 1px solid rgba(216,180,254,0.8); outline-offset: -8px; }
.om-panel .om-close { font-size: 15px; margin: -14px -14px -14px 0; }

.om-group { display: flex; flex-direction: column; margin-top: 14px; }
.om-group__title {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(168,156,216,0.45);
  margin-bottom: 6px;
}

.om-row {
  display: grid;
  grid-template-columns: 22px 1fr 8px;
  align-items: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  min-height: 36px;
  padding: 7px 8px 7px 6px;
  margin-left: -6px;
  text-align: left;
  cursor: pointer;
  background: transparent;
  border: none;
  border-left: 2px solid transparent;
}
.om-row--static { cursor: default; }
.om-row:hover { background: rgba(167,139,250,0.12); }
.om-row:focus-visible { outline: 1px solid rgba(216,180,254,0.7); outline-offset: -1px; }
.om-row.is-selected {
  background: rgba(167,139,250,0.14);
  border-left-color: rgba(216,180,254,0.85);
}
.om-row__no {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: rgba(168,156,216,0.5);
}
.om-row__name {
  font-size: 13px;
  letter-spacing: 0.13em;
  color: #cfc6ee;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.om-row--static .om-row__name { color: rgba(168,156,216,0.75); }
.om-row.is-selected .om-row__name { color: #f2ecff; }

.om-bio {
  margin-top: 18px;
  padding-top: 13px;
  border-top: 1px solid rgba(167,139,250,0.16);
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.om-bio__label {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(168,156,216,0.45);
}
.om-bio p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #cfc6ee;
  text-wrap: pretty;
}
.om-bio a {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(183,148,255,0.3);
  padding-bottom: 3px;
  align-self: flex-start;
}
.om-bio a:hover { border-bottom-color: #e4d4ff; }

/* ── Project detail ───────────────────────────────────────────── */

.om-card {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  width: min(440px, calc(100vw - 32px));
  max-height: min(64vh, 540px);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  background: linear-gradient(165deg, rgba(22,16,50,0.97), rgba(7,4,20,0.97));
  border: 1px solid rgba(167,139,250,0.34);
  box-shadow: 0 24px 70px rgba(0,0,0,0.62), 0 0 46px rgba(109,40,217,0.14);
  z-index: 40;
  animation: om-rise 0.32s cubic-bezier(0.2,0.8,0.2,1);
  font-family: var(--serif);
}
.om-card__head {
  flex: none;
  padding: 20px 24px 14px;
  border-bottom: 1px solid rgba(167,139,250,0.16);
}
.om-card__meta { display: flex; align-items: center; gap: 12px; }
.om-card__no {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: rgba(168,156,216,0.5);
}
.om-card__status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}
.om-card .om-close {
  font-size: 16px;
  color: rgba(168,156,216,0.75);
  margin: -14px -18px -14px 0;
}
.om-card h2 {
  margin: 9px 0 0;
  font-size: 27px;
  font-weight: 400;
  letter-spacing: 0.17em;
  line-height: 1.15;
  color: #f2ecff;
}
.om-card__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 24px 22px;
}
.om-card__desc {
  margin: 0;
  font-style: italic;
  font-size: 17px;
  line-height: 1.55;
  color: #ece6ff;
  text-wrap: pretty;
}
.om-card__section {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid rgba(167,139,250,0.14);
}
.om-card__section--links { display: flex; flex-direction: column; gap: 9px; }
.om-card__label {
  display: block;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(168,156,216,0.45);
  margin-bottom: 9px;
}
.om-card__section--links .om-card__label { margin-bottom: 0; }
.om-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.om-tag {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: #b9addf;
  border: 1px solid rgba(157,143,208,0.28);
  padding: 4px 9px;
}
.om-card__link {
  align-self: flex-start;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(183,148,255,0.35);
  padding-bottom: 3px;
}
.om-card__link:hover { border-bottom-color: #e4d4ff; }
.om-card__note {
  margin: 18px 0 0;
  padding-top: 13px;
  border-top: 1px solid rgba(167,139,250,0.14);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1.7;
  color: #7f6fae;
}

/* ── Scrollbars ───────────────────────────────────────────────── */

.om-scroll::-webkit-scrollbar { width: 5px; }
.om-scroll::-webkit-scrollbar-thumb { background: rgba(139,92,246,0.35); }
.om-scroll::-webkit-scrollbar-track { background: transparent; }
.om-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(139,92,246,0.35) transparent;
}

/* ── No JavaScript ────────────────────────────────────────────── */

.noscript {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  background: #030411;
  font-family: var(--serif);
  color: #ece6ff;
}
.noscript h1 { margin: 0; font-size: 32px; font-weight: 800; letter-spacing: 0.32em; text-indent: 0.32em; }
.noscript p { margin: 0; max-width: 46ch; font-style: italic; color: #a89cd8; }

/* ── Responsive ───────────────────────────────────────────────── */

@media (min-width: 1180px) {
  /* Keep the masthead and footer clear of the open index panel. */
  .om-head { padding-left: 322px; padding-right: 322px; }
  .om-foot { padding-left: 322px; padding-right: 322px; }
  .om-card.om-shift { left: calc(50% - 149px); }
  .om-scrim { display: none; }
}

@media (max-width: 1179px) {
  .om-panel { top: 12px; bottom: 12px; }
}

@media (max-width: 900px) {
  .om-key { display: none; }
}

@media (max-width: 560px) {
  .om-card,
  .om-card.om-shift {
    left: 0;
    right: 0;
    bottom: 0;
    transform: none;
    width: 100%;
    max-height: 62vh;
    border-left: none;
    border-right: none;
    border-bottom: none;
    border-radius: 0;
  }
  .om-panel { width: calc(100vw - 24px); right: 12px; }
  .om-tagline { letter-spacing: 0.16em; font-size: 10px; }
  .om-star .om-label { letter-spacing: 0.18em; }
}
