/* ============================================================
   Night vision.

   Not a dark theme — the site is already dark. This mode exists to
   avoid resetting dark adaptation while the user is at the eyepiece:
   short-wavelength light (blue/green) is what bleaches rhodopsin, so
   everything collapses onto a deep red channel, peak luminance drops,
   and photographs are suppressed rather than merely dimmed.
   ============================================================ */

html[data-vision="night"] {
  --ink-900: #060202;
  --ink-850: #0c0303;
  --ink-800: #120404;
  --ink-750: #180606;
  --ink-700: #241010;
  --ink-600: #2e1414;

  /* The ramp is lifted well above a "just make it red" tint: at the original
     values the small mono labels sat at 1.7:1 and were genuinely unreadable.
     Body and interface text now clear AA; the two quietest steps land at
     3.5:1 and 2.7:1, which is a deliberate trade — this mode exists to keep
     total light output down, and pushing every caption to 4.5:1 would collapse
     the whole hierarchy onto one colour. */
  --paper:      #e8674c;
  --paper-dim:  #cc5340;
  --fog:        #ab4132;
  --fog-deep:   #8e3628;

  --azure:        #d95a42;
  --azure-bright: #f27a5c;
  --azure-deep:   #7a2519;

  --signal-good:  #d95a42;
  --signal-fair:  #c24c37;
  --signal-poor:  #a83e2c;

  --surface:        #0c0303;
  --surface-raised: #120404;
  --surface-sunken: #040101;
  --line:           #2a1010;
  --line-strong:    #3d1815;
  --line-hair:      #1c0808;
}

/* New atlas surfaces use a few intentionally richer gradients in normal mode.
   Collapse them back to the red token ramp here so no cyan light leaks into
   the eyepiece-friendly view. */
html[data-vision="night"] body,
html[data-vision="night"] .band--sunken,
html[data-vision="night"] .site-footer,
html[data-vision="night"] .mobile-menu,
html[data-vision="night"] .page-head,
html[data-vision="night"] .article-head,
html[data-vision="night"] .moon-disc,
html[data-vision="night"] .ground-track {
  background: var(--ink-900);
}

html[data-vision="night"] .today__rule,
html[data-vision="night"] .home-conditions .split-data > *,
html[data-vision="night"] .home-data .data-pair > *,
html[data-vision="night"] .sky-aside > section {
  background: var(--surface);
}

/* Photographs are the brightest thing on any page — cut them hard. */
html[data-vision="night"] img,
html[data-vision="night"] video,
html[data-vision="night"] .aladin-host {
  filter: grayscale(1) brightness(0.26) sepia(1) hue-rotate(-32deg) saturate(4.5);
}

/* The hero photograph is the brightest element on the page; it fades almost
   out while its caption and technical data stay readable. */
html[data-vision="night"] .hero-plate img {
  opacity: 0.16;
}

html[data-vision="night"] .site-header {
  background: var(--ink-900);
  backdrop-filter: none;
}

/* No glow, no translucency, no blur while adapting. */
html[data-vision="night"] * {
  text-shadow: none !important;
  box-shadow: none !important;
}
html[data-vision="night"] .search-panel,
html[data-vision="night"] .lightbox {
  backdrop-filter: none;
  background: var(--ink-900);
}

html[data-vision="night"] .btn--primary {
  background: var(--azure-deep);
  border-color: var(--azure-bright);
  color: var(--azure-bright);
}
html[data-vision="night"] .chip[aria-pressed="true"] {
  background: var(--azure-deep);
  border-color: var(--azure-bright);
  color: var(--azure-bright);
}
html[data-vision="night"] ::selection { background: var(--azure-deep); color: var(--paper); }

html[data-vision="night"] .skeleton {
  background: var(--ink-800);
  animation: none;
}

/* Bar charts and rules that carried colour meaning collapse to one hue. */
html[data-vision="night"] .factor-fill,
html[data-vision="night"] .cloud-bar__seg { background: var(--azure-deep); }

.night-note {
  display: none;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--azure);
}
html[data-vision="night"] .night-note { display: inline-flex; }
