/* Prototype surfaces only. Keep chart palettes and shared color variables intact. */
@font-face {
  font-family: 'Inter';
  src: url('fonts/inter/InterVariable.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: 'Space Grotesk';
  src: url('fonts/space-grotesk/SpaceGroteskVariable.woff2') format('woff2');
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
}

body {
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-variant-numeric: lining-nums tabular-nums;
  --range-highlight: #c5bfe8;
  --prototype-chart-text: #c5bfe8;
  --prototype-rain-line: #c5bfe8;
  --prototype-rain-comparison: #9989d2;
  --prototype-rain-fill: rgba(153, 137, 210, .12);
}

.page-header .eyebrow,
h1,
h2,
.reading-label,
.sun-card-heading,
.reading-value,
.metric-extreme-value,
.wind-value {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
}

:root { background-color: #1b203b; }

body {
  background:
    radial-gradient(ellipse at 15% 0%, rgba(91, 95, 155, .28), transparent 48rem),
    linear-gradient(145deg, #1b203b 0%, #141a30 55%, #10172a 100%);
  background-color: #1b203b;
}

body::before {
  background:
    radial-gradient(ellipse at 15% 0%, rgba(91, 95, 155, .18), transparent 48rem),
    linear-gradient(145deg, #191d34 0%, #13182c 55%, #101527 100%);
}

.page-header .eyebrow,
.page-header .updated,
.page-header .updated-suffix,
.page-header .unit-toggle,
.history-heading h2,
.history-heading p,
.timeline-heading {
  color: #fff;
}

.page-header .updated-suffix { color: #c5bfe8; opacity: 1; }
.page-header .station-location,
.page-header .updated { color: #aaa3c2; }

.reading-card,
.chart-card {
  border: 0;
  background:
    radial-gradient(ellipse at 0% 0%, rgba(126, 135, 196, .20), transparent 70%),
    linear-gradient(135deg, #303653 0%, #252e49 50%, #1c2941 100%);
  box-shadow: 0 .6rem 1.8rem rgba(0, 0, 0, .12);
}

.reading-card > .reading-label,
.sun-card-heading,
.chart-card > :first-child {
  background: transparent;
  color: #fff;
}

.reading-card .reading-label,
.chart-card h2,
.chart-card > :first-child h2 span,
.chart-card > :first-child .chart-kicker,
.reading-card .sun-daylight,
.reading-card .moon-illumination,
.reading-card .moon-window-illumination,
.reading-card .moon-window-caption,
.reading-card .reading-detail,
.reading-card .reading-note,
.reading-card .wind-period,
.reading-card .metric-extreme-label,
.chart-card .chart-note,
.chart-card .chart-caption {
  color: #fff;
}

.chart-heading .chart-control { color: #fff; }
.sky-path-card > .moon-card { border-top: 0; }

/* Text accents only: shared chart palette variables stay unchanged. */
.reading-card .reading-value > span:not(.unit-number),
.reading-card .wind-value > span,
.reading-card .metric-extreme.high .metric-icon,
.reading-card .metric-extreme.low .metric-icon,
.reading-card .peek-hourly-rain {
  color: #c5bfe8;
}

/* Unify all controls, including dynamically inserted comparison buttons.
   Override legacy control-specific paint rules without changing their sizing. */
.dashboard button {
  border: 0 !important;
  background: transparent !important;
  color: #c5bfe8 !important;
  box-shadow: none;
}

.dashboard button:is(.is-active, [aria-pressed="true"]) {
  background: rgba(153, 137, 210, .24) !important;
  color: #fff !important;
}

.dashboard button:hover:not(:disabled) {
  background: rgba(153, 137, 210, .16) !important;
  color: #fff !important;
}

.dashboard button:is(.is-active, [aria-pressed="true"]):hover:not(:disabled) {
  background: rgba(153, 137, 210, .34) !important;
}

.dashboard button:focus-visible {
  outline: 2px solid #c5bfe8;
  outline-offset: 2px;
}

.dashboard button:disabled {
  background: transparent !important;
  color: #9790b5 !important;
  opacity: .4;
  cursor: default;
}

.astronomy-pagination button span { background: #c5bfe8; }

/* Earth keeps its day/night shading in the prototype's periwinkle palette. */
#orbit-earth-day-shading stop:nth-child(1) { stop-color: #ded8fa; }
#orbit-earth-day-shading stop:nth-child(2) { stop-color: #a99bdc; }
#orbit-earth-day-shading stop:nth-child(3) { stop-color: #7165aa; }
#orbit-earth-day-shading stop:nth-child(4) { stop-color: #49416f; }
#orbit-earth-night-shading stop:nth-child(1) { stop-color: #484365; }
#orbit-earth-night-shading stop:nth-child(2) { stop-color: #302d4b; }
#orbit-earth-night-shading stop:nth-child(3) { stop-color: #1b1c32; }
.orbit-earth-outline { stroke: #c5bfe8; }

.orbit-earth-geography { visibility: hidden; }
.orbit-earth-geography.is-ready { visibility: visible; }
.orbit-earth-ocean { fill: #365f91; }
.orbit-earth-land { fill: #c9c9cb; stroke: none; }
.orbit-earth-night-overlay { fill: #090b14; opacity: .62; }
.orbit-earth-rim { fill: none; stroke: #d7d7dc; stroke-width: .5; stroke-opacity: .4; }

.moon-window-art .moon-disc {
  fill: #1b1c32;
  stroke: #a69cc9;
  stroke-opacity: .45;
}
.moon-window-art .moon-window-lit { fill: #ddd7ef; }
.orbit-card .moon-disc {
  fill: #1b1c32;
  stroke: #a69cc9;
}
.orbit-card .moon-lit,
.orbit-card .orbit-day-moon-lit { fill: #ddd7ef; }
#orbit-moon-day-shading stop:nth-child(1) { stop-color: #eeeaf8; }
#orbit-moon-day-shading stop:nth-child(2) { stop-color: #ddd7ef; }
#orbit-moon-day-shading stop:nth-child(3) { stop-color: #a69cc9; }
#orbit-moon-day-shading stop:nth-child(4) { stop-color: #71658f; }
#orbit-moon-night-shading stop:nth-child(1) { stop-color: #484365; }
#orbit-moon-night-shading stop:nth-child(2) { stop-color: #302d4b; }
#orbit-moon-night-shading stop:nth-child(3) { stop-color: #1b1c32; }
.orbit-card .orbit-moon-outline { stroke: #a69cc9; }
#orbit-day-moon-gradient stop:last-child,
#orbit-month-sphere-shading stop:nth-last-child(-n+2) { stop-color: #1b1c32; }
.moon-window-highlight { fill: #9989d2; }

/* Apply the text palette directly; shared variables also paint chart lines. */
.reading-card .metric-extreme-time,
.reading-card .temperature-peek,
.reading-card .peek-time,
.reading-card .sun-hours,
.reading-card .sun-times,
.reading-card .moon-phase-row,
.reading-card .moon-next-events,
.reading-card .moon-window-times,
.reading-card .moon-window-labels,
.reading-card .orbit-date,
.reading-card .orbit-status,
.reading-card .orbit-info summary,
.reading-card .orbit-info p,
.chart-card .chart-status,
.dashboard .comparison-status,
.dashboard .timeline-day-label {
  color: #c5bfe8;
}

.reading-card .peek-temperature { color: #eeeaf8; }
.reading-card .moon-eclipse { color: #ddd7ef; }
.orbit-art text,
.orbit-day-event { fill: #c5bfe8; }
.orbit-info p { background: #1b1c32; border-color: #61577e; }

.chart-caption { white-space: pre-line; }
.pressure-card .reading-value > span:not(.unit-number) {
  display: inline;
  margin: 0 0 0 .3rem;
}
.readings:not(.comparison-readings) .humidity-card .reading-value {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  padding-top: calc(.72rem * 1.2 + .2rem);
}
@media (max-width: 42rem) {
  body:not(.comparing-dates) .readings:not(.comparison-readings) :is(.humidity-card, .pressure-card) .reading-value {
    font-size: clamp(1.1rem, 5vw, 1.6rem);
    padding-top: calc(.58rem * 1.2 + .2rem);
  }
}
.chart-card .chart-caption {
  color: #c5bfe8;
  opacity: 0;
  transition: opacity .18s ease-in-out;
}
.chart-card .chart-caption[data-caption-visible="true"] { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .chart-card .chart-caption { transition: none; }
}
.rainfall-comparison-controls > span { color: #c5bfe8; }

.timeline-bars { fill: #c5bfe8; }
.timeline-storm-bars { fill: #9989d2; }
.year-timeline .timeline-selected { stroke: #c5bfe8; opacity: .65; }
.year-timeline .timeline-today-line { stroke: #c5bfe8; }
.year-timeline .timeline-today-marker {
  color: #eeeaf8;
  background: #30304d;
}
.year-timeline .timeline-caption,
.year-timeline .timeline-range-start,
.year-timeline .timeline-range-end {
  color: #eeeaf8;
  background: #30304d;
}
.year-timeline .timeline-range {
  fill: var(--range-highlight);
  stroke: var(--range-highlight);
}

/* Clip edge markers without creating nested scroll containers on mobile. */
.reading-card.history-card { overflow: clip; }
.temperature-dot.high { background: #c5bfe8; }
.rainfall-card .temperature-trace { stroke: #c5bfe8; }
.rainfall-hourly-bars,
.rainfall-daily-bars { fill: #c5bfe8; }
.rainfall-storm-bars { fill: #9989d2; }
.temperature-dot.low { border-color: #c5bfe8; }
.temperature-cursor:is([data-extreme="high"], [data-extreme="low"]) {
  stroke: #c5bfe8;
}

@media (min-width: 42.01rem) {
  .sky-path-card {
    align-self: stretch;
    aspect-ratio: auto;
  }
  .comparison-readings .pressure-card .temperature-peek .peek-comparison {
    margin-left: 2ch;
  }
}

/* Card traces and reference lines share the prototype's lavender palette. */
.reading-card .temperature-trace,
.reading-card .temperature-cursor,
.reading-card .sun-curve,
.reading-card .moon-window-curve {
  stroke: #c5bfe8;
}
.reading-card .sun-horizon,
.reading-card .moon-window-today,
.reading-card .orbit-day-horizon {
  stroke: #a69cc9;
}
.reading-card .comparison-trace,
.reading-card .sun-comparison-curve { stroke: #9989d2; }
.reading-card .comparison-hourly-bars { fill: #9989d2; }
.orbit-card .orbit-track,
.orbit-card .orbit-equator { stroke: #a69cc9; }
.orbit-card .orbit-north-pole { fill: #ddd7ef; }
.sky-path-card .moon-disc { fill: #1b1c32; stroke: #a69cc9; }
.sky-path-card .moon-marker-lit { fill: #ddd7ef; }

.comparison-readings .comparison-date,
.comparison-readings .peek-temperature { color: #c5bfe8; }
.comparison-readings .comparison-second .comparison-date,
.comparison-readings .peek-comparison,
.comparison-readings .peek-comparison-hourly,
.comparison-readings .sun-comparison-times { color: #b2a0e0; }
.comparison-readings .reading-card .temperature-trace,
.comparison-readings .reading-card .sun-curve { stroke: #c5bfe8; }
.comparison-readings .reading-card .comparison-trace,
.comparison-readings .reading-card .sun-comparison-curve { stroke: #9989d2; }

.readings:not(.comparison-readings) > :is(.temperature-card, .humidity-card, .pressure-card) > .metric-layout > .metric-range {
  transition-duration: .25s;
  transition-timing-function: ease-in-out;
}

.station-about p { color: #89839e; }

/* The liquid layer supplies the pager highlight, including hover/press states. */
.dashboard .astronomy-pager .astronomy-pagination button[data-astronomy-page][aria-pressed] {
  background: transparent !important;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}

.temperature-summary-card { padding-bottom: .65rem; }
.temperature-summary-card .chart-wrap { height: 24rem; }
#temperature-summary-status:empty { display: none; }
@media (max-width: 42rem) {
  .temperature-summary-card .chart-wrap { height: 19rem; }
}

.temperature-summary-controls { justify-content: center; }

.rainfall-period-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .45rem;
}
.rainfall-period-controls > .chart-controls { justify-content: center; }

.temperature-year-pager { display: flex; justify-content: center; align-items: center; gap: .65rem; margin-top: .5rem; color: #c5bfe8; }
.temperature-year-pager[hidden] { display: flex; visibility: hidden; pointer-events: none; }
.temperature-year-pager button { width: 2rem; height: 2rem; padding: 0; border-radius: .4rem; font: inherit; font-size: 1.25rem; cursor: pointer; }
.temperature-year-pager span { min-width: 4ch; text-align: center; font-variant-numeric: tabular-nums; }

.temperature-day-windows { justify-content: center; gap: .3rem; margin: .5rem auto 0; max-width: 38rem; min-height: 2rem; }
.temperature-day-windows[hidden] { display: flex; visibility: hidden; pointer-events: none; }
.temperature-day-windows button { flex: 1; min-width: 0; padding: .4rem .25rem; font-size: clamp(.6rem, 2.3vw, .8rem); white-space: nowrap; }

.dashboard .date-picker-today { background: rgba(153, 137, 210, .24) !important; color: #fff !important; }
.dashboard .date-picker-today:hover:not(:disabled) { background: rgba(153, 137, 210, .34) !important; }

/* Match date B's ruler, labels, and traces with the existing comparison accent. */
.comparison-readings .comparison-second .comparison-date,
.comparison-readings .peek-comparison,
.comparison-readings .peek-comparison-hourly,
.comparison-readings .sun-comparison-times { color: var(--comparison-accent); }
.comparison-readings .reading-card .comparison-trace,
.comparison-readings .reading-card .sun-comparison-curve,
.comparison-readings .reading-card .moon-comparison-curve { stroke: var(--comparison-accent); }
.dashboard .date-picker-comparison .date-picker-today { background: color-mix(in srgb, var(--comparison-accent) 20%, transparent) !important; color: var(--comparison-accent) !important; }
