/* ————————————————————————————————————————————
   Meridian Observatory — deep indigo, moonlight
   silver, star white, dome red.
   ———————————————————————————————————————————— */

:root {
  --indigo-deep: #070b1d;
  --indigo: #0c1230;
  --indigo-panel: #121838;
  --indigo-line: #232b52;
  --silver: #aeb7d4;
  --silver-dim: #7b84a8;
  --star: #f2f4ff;
  --red: #d84a32;
  --red-soft: #e0654f;
  --serif: "Cormorant", "Times New Roman", serif;
  --sans: "Albert Sans", system-ui, sans-serif;
  --mono: "Spline Sans Mono", ui-monospace, monospace;
  --measure: 34rem;
}

/* Night-vision mode: everything shifts to dome red */
:root.red-mode {
  --indigo-deep: #0c0302;
  --indigo: #140503;
  --indigo-panel: #1c0805;
  --indigo-line: #3a120a;
  --silver: #c86048;
  --silver-dim: #8f3f2d;
  --star: #ff7a5c;
  --red: #ff5a3c;
  --red-soft: #e0654f;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--indigo-deep);
  color: var(--silver);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .6s ease, color .6s ease;
}

::selection { background: var(--red); color: var(--star); }

h1, h2, h3.serif { font-family: var(--serif); font-weight: 300; color: var(--star); }
h1 em, h2 em { font-style: italic; font-weight: 300; color: var(--silver); }

.mono {
  font-family: var(--mono);
  font-weight: 300;
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

a { color: inherit; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ———————— header ———————— */
.site-head {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1.1rem 2.2rem;
  background: color-mix(in srgb, var(--indigo-deep) 78%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--indigo-line) 55%, transparent);
  transition: background-color .6s ease;
}
.wordmark {
  display: flex; align-items: center; gap: .6rem;
  text-decoration: none;
  font-family: var(--mono);
  font-size: .78rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--star);
}
.wordmark .mark { width: 26px; height: 26px; color: var(--star); }
.wordmark em { font-style: normal; color: var(--silver-dim); margin-left: .5em; }
.site-nav { margin-left: auto; display: flex; gap: 1.8rem; }
.site-nav a {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase;
  text-decoration: none; color: var(--silver);
  padding-bottom: .2em;
  border-bottom: 1px solid transparent;
  transition: color .25s, border-color .25s;
}
.site-nav a:hover { color: var(--star); border-color: var(--red); }

.redlight {
  display: flex; align-items: center; gap: .55rem;
  background: none; border: 1px solid var(--indigo-line);
  border-radius: 999px;
  padding: .45rem .9rem;
  color: var(--silver);
  font-family: var(--mono); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .3s, color .3s;
}
.redlight:hover { border-color: var(--red); color: var(--star); }
.redlight .lamp {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--silver-dim);
  box-shadow: 0 0 0 0 transparent;
  transition: background .3s, box-shadow .3s;
}
.redlight[aria-pressed="true"] .lamp { background: var(--red); box-shadow: 0 0 10px 2px rgba(216,74,50,.55); }

/* ———————— hero ———————— */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
}
#sky {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
}
.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 33rem;
  padding: 7rem 0 5rem 5.5vw;
  pointer-events: none;
}
.hero-copy a, .hero-copy .btn { pointer-events: auto; }
.kicker { color: var(--red-soft); margin-bottom: 1.2rem; }
.hero h1 {
  font-size: clamp(2.4rem, 4.6vw, 4.1rem);
  line-height: 1.06;
  letter-spacing: -.01em;
  margin-bottom: 1.4rem;
}
.lede { max-width: var(--measure); color: var(--silver); margin-bottom: 2rem; }

.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 3rem; }
.btn {
  display: inline-block;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .18em; text-transform: uppercase;
  text-decoration: none;
  color: var(--indigo-deep);
  background: var(--star);
  padding: .95rem 1.7rem;
  border-radius: 999px;
  transition: background .25s, color .25s, transform .25s;
}
.btn:hover { background: var(--red); color: var(--star); transform: translateY(-1px); }
.btn.ghost {
  background: transparent; color: var(--silver);
  box-shadow: inset 0 0 0 1px var(--indigo-line);
}
.btn.ghost:hover { color: var(--star); box-shadow: inset 0 0 0 1px var(--red); background: transparent; }
.btn.wide { width: 100%; text-align: center; }

.readouts {
  display: flex; flex-wrap: wrap; gap: 2.2rem;
  border-top: 1px solid var(--indigo-line);
  padding-top: 1.4rem;
  max-width: 30rem;
}
.readouts dt { color: var(--silver-dim); font-size: .62rem; margin-bottom: .35rem; }
.readouts dd { color: var(--star); font-size: .95rem; letter-spacing: .06em; }
.readouts .unit { color: var(--silver-dim); font-size: .65rem; }

.chart-note {
  position: absolute;
  right: 2.2rem; bottom: 1.6rem;
  z-index: 2;
  color: var(--silver-dim);
  font-size: .62rem;
}
#conHint { color: var(--silver); transition: color .3s; }

/* ———————— page-load sequence ———————— */
@media (prefers-reduced-motion: no-preference) {
  #sky { opacity: 0; animation: sky-in 1.6s ease .25s forwards; }
  .hero-copy > * { opacity: 0; transform: translateY(16px); animation: rise .85s cubic-bezier(.2,.7,.2,1) forwards; }
  .hero-copy > :nth-child(1) { animation-delay: .1s; }
  .hero-copy > :nth-child(2) { animation-delay: .22s; }
  .hero-copy > :nth-child(3) { animation-delay: .38s; }
  .hero-copy > :nth-child(4) { animation-delay: .52s; }
  .hero-copy > :nth-child(5) { animation-delay: .68s; }
  .chart-note { opacity: 0; animation: rise 1s ease 1.3s forwards; }
}
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes sky-in { to { opacity: 1; } }

/* ———————— sections shared ———————— */
section { padding: 7rem 5.5vw; }
.section-head { max-width: 46rem; margin-bottom: 3.5rem; }
.section-head h2 {
  font-size: clamp(1.9rem, 3.4vw, 3rem);
  line-height: 1.12;
  margin: 1rem 0 1.2rem;
}
.section-lede { max-width: var(--measure); color: var(--silver); }

/* ———————— program / sun path ———————— */
.program {
  background: linear-gradient(to bottom, var(--indigo-deep), var(--indigo) 30%, var(--indigo-deep));
}
.sunpath { margin: 0 0 4rem; }
#sunArc { width: 100%; height: auto; display: block; }
.sunpath figcaption {
  color: var(--silver-dim);
  font-size: .62rem;
  margin-top: .9rem;
}

.timeline {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.6rem 2.4rem;
  counter-reset: evt;
}
.timeline li {
  border-top: 1px solid var(--indigo-line);
  padding-top: 1.3rem;
  position: relative;
}
.timeline li::before {
  content: "";
  position: absolute; top: -3px; left: 0;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--red);
}
.timeline .evt-time {
  font-family: var(--mono);
  font-size: 1.5rem; font-weight: 300;
  font-variant-numeric: tabular-nums;
  color: var(--star);
  letter-spacing: .02em;
}
.timeline .evt-anchor {
  display: block;
  font-family: var(--mono); font-size: .62rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--red-soft);
  margin: .5rem 0 .7rem;
}
.timeline .evt-name {
  font-family: var(--serif);
  font-size: 1.45rem; font-weight: 400;
  color: var(--star);
  margin-bottom: .5rem;
}
.timeline p { font-size: .95rem; color: var(--silver); max-width: 26rem; }

/* ———————— targets ———————— */
.target-scroll { overflow-x: auto; }
.target-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
}
.target-table th {
  text-align: left;
  font-weight: 400;
  font-size: .62rem;
  color: var(--silver-dim);
  padding: 0 1.2rem .8rem 0;
  border-bottom: 1px solid var(--indigo-line);
}
.target-table td {
  padding: 1.15rem 1.2rem 1.15rem 0;
  border-bottom: 1px solid var(--indigo-line);
  vertical-align: baseline;
  font-size: .95rem;
}
.target-table td.obj {
  font-family: var(--serif);
  font-size: 1.35rem;
  color: var(--star);
  white-space: nowrap;
}
.target-table td.obj .mono { text-transform: none; letter-spacing: .1em; font-size: .68rem; }
.target-table td.num {
  font-family: var(--mono); font-weight: 300;
  font-variant-numeric: tabular-nums;
  font-size: .9rem;
  color: var(--star);
  white-space: nowrap;
}
.target-table td .faint { color: var(--silver-dim); font-size: .8em; }

/* the object crossing our meridian next */
.next-tag {
  display: inline-block;
  font-size: .58rem; letter-spacing: .18em;
  color: var(--red-soft);
  margin-left: .7em;
  vertical-align: .15em;
}
.next-tag::before {
  content: "";
  display: inline-block;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--red);
  margin-right: .5em;
  vertical-align: .1em;
}
@media (prefers-reduced-motion: no-preference) {
  .next-tag::before { animation: pulse 2.2s ease infinite; }
}
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(216,74,50,.18); } }

/* ———————— visit ———————— */
.visit { background: linear-gradient(to bottom, var(--indigo-deep), var(--indigo) 40%, var(--indigo-deep)); }
.visit-grid {
  display: grid;
  grid-template-columns: 1.2fr .9fr;
  gap: 4rem;
  align-items: start;
}
.visit-notes article + article { margin-top: 2.4rem; }
.visit-notes h3 {
  color: var(--red-soft);
  font-weight: 400;
  margin-bottom: .6rem;
}
.visit-notes p { max-width: var(--measure); }

.booking {
  background: var(--indigo-panel);
  border: 1px solid var(--indigo-line);
  border-radius: 14px;
  padding: 2.4rem 2.2rem;
  position: sticky;
  top: 6rem;
}
.booking-kicker { color: var(--red-soft); margin-bottom: 1.2rem; }
.price { font-family: var(--serif); color: var(--star); margin-bottom: 1.6rem; font-size: 1.2rem; }
.price .amount { font-size: 3rem; font-weight: 300; line-height: 1; margin-right: .2em; }
.price .sub { display: block; font-family: var(--sans); font-size: .85rem; color: var(--silver-dim); margin-top: .5rem; }
.booking-list { list-style: none; margin-bottom: 2rem; }
.booking-list li {
  font-size: .93rem;
  padding: .65rem 0 .65rem 1.4rem;
  border-top: 1px solid var(--indigo-line);
  position: relative;
}
.booking-list li::before {
  content: "✦";
  position: absolute; left: 0; top: .7rem;
  color: var(--red);
  font-size: .7rem;
}
.booking-fine { margin-top: 1.1rem; color: var(--silver-dim); font-size: .62rem; text-align: center; }

/* ———————— footer ———————— */
.site-foot {
  border-top: 1px solid var(--indigo-line);
  padding: 4rem 5.5vw 3rem;
}
.foot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 3rem;
}
.foot-grid p { color: var(--silver-dim); font-size: .68rem; line-height: 2; text-transform: none; letter-spacing: .08em; }
.foot-grid a { color: var(--silver); }
.foot-line {
  color: var(--silver-dim);
  font-size: .62rem;
  text-transform: none;
  letter-spacing: .08em;
  border-top: 1px solid var(--indigo-line);
  padding-top: 1.6rem;
}

/* ———————— responsive ———————— */
@media (max-width: 980px) {
  .timeline { grid-template-columns: repeat(2, 1fr); }
  .visit-grid { grid-template-columns: 1fr; }
  .booking { position: static; }
}
.chart-spacer { display: none; }
@media (max-width: 720px) {
  .site-head { padding: 1rem 1.2rem; gap: 1rem; }
  .site-nav { display: none; }
  .redlight { margin-left: auto; padding: .55rem .7rem; }
  .redlight .redlight-label { display: none; }
  .redlight .lamp { width: 10px; height: 10px; }
  section { padding: 4.5rem 1.4rem; }
  .hero-copy { padding: 7.5rem 1.4rem 0; }
  .hero { align-items: flex-start; flex-direction: column; }
  .chart-spacer { display: block; height: 110vw; width: 100%; }
  .readouts { gap: 1.4rem 2rem; }
  .timeline { grid-template-columns: 1fr; gap: 2.2rem; }
  .chart-note { left: 1.4rem; right: 1.4rem; text-align: left; }
  .foot-grid { grid-template-columns: 1fr; }
  .site-foot { padding: 3rem 1.4rem 2rem; }
}
