/* === COSMIC WEATHER BUREAU — STYLE === */

:root {
  --void: #060911;
  --deep: #0a0e1a;
  --surface: #111729;
  --surface-raised: #172038;
  --border: rgba(240, 192, 64, 0.12);
  --border-active: rgba(240, 192, 64, 0.3);
  --gold: #f0c040;
  --gold-dim: #c49a2a;
  --gold-glow: rgba(240, 192, 64, 0.15);
  --ember: #e05a3a;
  --teal: #3ac5b8;
  --lavender: #a78bfa;
  --ice: #8bcaff;
  --text: #d8dce8;
  --text-dim: #7a8298;
  --text-bright: #f0f2f8;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Outfit', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--void);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* === STARFIELD CANVAS === */
#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* === HEADER === */
.bureau-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: rgba(6, 9, 17, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.bureau-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 36px;
  height: 36px;
  color: var(--gold);
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.logo-subtitle {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bureau-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(58, 197, 184, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(58, 197, 184, 0); }
}

.status-text {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--teal);
  letter-spacing: 0.15em;
}

/* === MAIN LAYOUT === */
main {
  position: relative;
  z-index: 1;
}

/* === HERO === */
.hero-section {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  padding: 3rem 1.25rem 2rem;
  min-height: 60vh;
  align-items: center;
  justify-content: center;
}

.hero-content {
  max-width: 600px;
}

.hero-dateline {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--gold-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.2s;
}

.hero-headline {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  font-weight: 400;
  color: var(--text-bright);
  line-height: 1.1;
  letter-spacing: -0.01em;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.4s;
}

.hero-accent {
  color: var(--gold);
  font-style: italic;
}

.hero-body {
  margin-top: 1.25rem;
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: var(--text-dim);
  max-width: 480px;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.6s;
}

.hero-readout {
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.8s;
}

.readout-ring {
  position: relative;
  width: 180px;
  height: 180px;
}

.ring-svg {
  width: 100%;
  height: 100%;
}

.ring-progress {
  transform-origin: center;
  animation: ring-spin 20s linear infinite;
}

@keyframes ring-spin {
  to { transform: rotate(360deg); }
}

.readout-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.readout-value {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 300;
  color: var(--gold);
  line-height: 1;
}

.readout-label {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.4rem;
  text-align: center;
  max-width: 120px;
}

/* === ALERTS BAR === */
.alerts-bar {
  overflow: hidden;
  background: rgba(224, 90, 58, 0.06);
  border-top: 1px solid rgba(224, 90, 58, 0.15);
  border-bottom: 1px solid rgba(224, 90, 58, 0.15);
  padding: 0.75rem 0;
}

.alerts-scroll {
  display: flex;
  align-items: center;
  gap: 1rem;
  white-space: nowrap;
  animation: scroll-left 40s linear infinite;
  padding-left: 100%;
}

@keyframes scroll-left {
  to { transform: translateX(-100%); }
}

.alert-tag {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  flex-shrink: 0;
}

.alert-tag.critical {
  background: rgba(224, 90, 58, 0.2);
  color: var(--ember);
  border: 1px solid rgba(224, 90, 58, 0.3);
}

.alert-tag.moderate {
  background: rgba(240, 192, 64, 0.15);
  color: var(--gold);
  border: 1px solid rgba(240, 192, 64, 0.25);
}

.alert-tag.low {
  background: rgba(58, 197, 184, 0.12);
  color: var(--teal);
  border: 1px solid rgba(58, 197, 184, 0.2);
}

.alert-text {
  font-size: 0.8rem;
  color: var(--text);
  flex-shrink: 0;
}

.alert-divider {
  color: var(--text-dim);
  opacity: 0.3;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  flex-shrink: 0;
}

/* === SECTION TITLES === */
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 400;
  color: var(--text-bright);
  padding: 3rem 1.25rem 1.5rem;
  letter-spacing: -0.01em;
}

.section-title::after {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background: var(--gold);
  margin-top: 0.6rem;
}

/* === FORECAST GRID === */
.forecast-grid {
  padding-bottom: 2rem;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  padding: 0 1.25rem;
}

.forecast-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.3s ease, background 0.3s ease;
  cursor: default;
}

.forecast-card:hover {
  border-color: var(--border-active);
  background: var(--surface-raised);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.card-sector {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--gold-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.card-severity {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.severity-calm { background: var(--teal); }
.severity-moderate { background: var(--gold); }
.severity-active { background: var(--ember); }
.severity-intense { background: var(--lavender); }

.card-condition {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--text-bright);
  font-weight: 400;
  line-height: 1.2;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.card-stats {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.25rem;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-bright);
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* === PHENOMENA === */
.phenomena-list {
  padding: 0 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.phenomenon-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color 0.3s ease;
}

.phenomenon-row:hover {
  border-color: var(--border-active);
}

.phenom-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phenom-icon svg {
  width: 20px;
  height: 20px;
}

.phenom-info {
  min-width: 0;
}

.phenom-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-bright);
  line-height: 1.2;
}

.phenom-detail {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phenom-magnitude {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--gold);
  white-space: nowrap;
}

/* === OBSERVATORY MAP === */
.observatory-section {
  padding-bottom: 2rem;
}

.observatory-map {
  position: relative;
  margin: 0 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 2 / 1;
}

.map-svg {
  width: 100%;
  height: 100%;
}

.map-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem 1.25rem;
  background: linear-gradient(transparent, rgba(6,9,17,0.9));
}

.map-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
}

/* === READINGS === */
.ticker-section {
  padding-bottom: 3rem;
}

.readings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  padding: 0 1.25rem;
}

.reading-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.reading-name {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.reading-value {
  font-family: var(--font-mono);
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 300;
  color: var(--text-bright);
  line-height: 1.2;
}

.reading-unit {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-dim);
}

.reading-trend {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  margin-top: 0.25rem;
}

.trend-up { color: var(--ember); }
.trend-down { color: var(--teal); }
.trend-stable { color: var(--text-dim); }

/* === FOOTER === */
.bureau-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.25rem;
  position: relative;
  z-index: 1;
}

.footer-inner {
  max-width: 600px;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--gold-dim);
}

.footer-note {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.4rem;
  line-height: 1.5;
}

/* === ANIMATIONS === */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === RESPONSIVE === */
@media (min-width: 640px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .readings-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero-section {
    flex-direction: row;
    padding: 5rem 2.5rem 3rem;
    gap: 3rem;
  }

  .section-title {
    padding-left: 2.5rem;
    padding-right: 2.5rem;
  }

  .grid,
  .phenomena-list,
  .readings-grid {
    padding-left: 2.5rem;
    padding-right: 2.5rem;
  }

  .observatory-map {
    margin: 0 2.5rem;
  }

  .bureau-header {
    padding: 1rem 2.5rem;
  }

  .bureau-footer {
    padding: 2rem 2.5rem;
  }
}

@media (min-width: 1024px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .readings-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .hero-section {
    padding: 6rem 4rem 4rem;
    max-width: 1200px;
    margin: 0 auto;
  }

  .readout-ring {
    width: 220px;
    height: 220px;
  }

  .section-title {
    padding-left: 4rem;
    padding-right: 4rem;
    max-width: 1200px;
  }

  .grid,
  .phenomena-list,
  .readings-grid {
    padding-left: 4rem;
    padding-right: 4rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
  }

  .observatory-map {
    margin: 0 4rem;
    max-width: 1132px;
  }

  .bureau-header {
    padding: 1rem 4rem;
  }

  .bureau-footer {
    padding: 2.5rem 4rem;
  }
}
