:root {
  --ink: #13251e;
  --muted: #68766f;
  --line: #dfe8e3;
  --surface: rgba(255, 255, 255, 0.9);
  --green: #16a34a;
  --green-dark: #0d7a37;
  --green-soft: #eaf8ef;
  --lime: #84cc16;
  --amber: #f59e0b;
  --red: #dc2626;
  --blue: #2788d9;
  --violet: #7c6ee6;
  --shadow: 0 18px 50px rgba(24, 63, 45, 0.08);
  --radius: 24px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: #f6faf7;
  font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    linear-gradient(rgba(255,255,255,.62), rgba(255,255,255,.62)),
    radial-gradient(circle at 30% 10%, #dff5e7 0, transparent 34%),
    radial-gradient(circle at 90% 30%, #e8f4f1 0, transparent 30%);
}

.ambient {
  position: fixed;
  z-index: -2;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .32;
  pointer-events: none;
}
.ambient-one { top: 70px; right: -190px; background: #a7e6bd; }
.ambient-two { bottom: 50px; left: -220px; background: #bfe1d8; }

.shell { width: min(1400px, calc(100% - 48px)); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(205, 220, 212, .72);
  background: rgba(247, 251, 248, .82);
  backdrop-filter: blur(20px);
}

.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand > span:last-child { display: grid; line-height: 1.1; }
.brand strong { font-size: 19px; letter-spacing: -.04em; }
.brand small { margin-top: 5px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }

.brand-mark {
  width: 39px;
  height: 39px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #1fb15a, #087431);
  box-shadow: 0 8px 20px rgba(22, 163, 74, .22);
}
.brand-mark::before, .brand-mark::after, .brand-mark span {
  content: "";
  position: absolute;
  width: 4px;
  border-radius: 10px;
  background: #fff;
}
.brand-mark { position: relative; }
.brand-mark::before { height: 13px; transform: translate(-7px, 4px); opacity: .7; }
.brand-mark span { height: 21px; transform: translate(0, 0); }
.brand-mark::after { height: 28px; transform: translate(7px, -3px); opacity: .85; }

.header-meta { display: flex; align-items: center; gap: 20px; }
.campus-label { color: #506159; font-size: 13px; font-weight: 700; }
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid #d8e5dc;
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  color: #54655d;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
}
.live-pill i { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; box-shadow: 0 0 0 4px rgba(148,163,184,.12); }
.live-pill.online { color: #087431; border-color: #c9e9d5; background: #f1fbf5; }
.live-pill.online i { background: var(--green); box-shadow: 0 0 0 4px rgba(22,163,74,.13); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(22,163,74,0); } }

.page { padding: 66px 0 56px; }

.hero { display: grid; grid-template-columns: 1.35fr .65fr; gap: 48px; align-items: end; margin-bottom: 38px; }
.eyebrow, .section-kicker {
  display: block;
  margin-bottom: 10px;
  color: var(--green-dark);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.hero h1 { margin: 0; max-width: 780px; font-size: clamp(48px, 5vw, 78px); line-height: .98; letter-spacing: -.065em; font-weight: 800; }
.hero h1 span { color: #789084; }
.hero-copy p { max-width: 650px; margin: 25px 0 0; color: var(--muted); font-size: 16px; line-height: 1.72; }

.hero-status {
  min-height: 150px;
  display: flex;
  align-items: center;
  gap: 23px;
  padding: 25px;
  border: 1px solid rgba(211, 225, 217, .9);
  border-radius: var(--radius);
  background: rgba(255,255,255,.75);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.hero-status > div:last-child { display: grid; min-width: 0; }
.hero-status small { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.hero-status strong { margin: 5px 0 4px; font-size: 25px; letter-spacing: -.04em; }
.hero-status span:last-child { color: var(--muted); font-size: 11px; line-height: 1.5; }
.status-orbit { flex: 0 0 72px; width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: #eef3f0; }
.status-orbit::before { content: ""; position: absolute; width: 58px; height: 58px; border: 1px solid rgba(148,163,184,.35); border-radius: 50%; }
.status-orbit { position: relative; }
.status-orbit span { width: 32px; height: 32px; border-radius: 50%; background: #94a3b8; box-shadow: 0 8px 18px rgba(148,163,184,.3); }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.metric-card {
  min-height: 170px;
  padding: 22px 23px;
  border: 1px solid rgba(214, 226, 220, .9);
  border-radius: 21px;
  background: var(--surface);
  box-shadow: 0 10px 32px rgba(27, 66, 48, .045);
}
.metric-card.primary-metric { background: linear-gradient(150deg, #f5fff8, #fff); border-color: #cce8d6; }
.metric-top { display: flex; align-items: center; justify-content: space-between; color: #526259; font-size: 12px; font-weight: 800; }
.metric-dot { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 0 4px rgba(22,163,74,.09); }
.metric-dot.green { background: var(--green); }
.metric-dot.blue { background: var(--blue); box-shadow: 0 0 0 4px rgba(39,136,217,.09); }
.metric-dot.amber { background: var(--amber); box-shadow: 0 0 0 4px rgba(245,158,11,.09); }
.metric-dot.violet { background: var(--violet); box-shadow: 0 0 0 4px rgba(124,110,230,.09); }
.metric-value { display: flex; align-items: baseline; gap: 8px; margin: 18px 0 9px; }
.metric-value strong { font-size: 40px; line-height: 1; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.metric-value small { color: #85938c; font-size: 11px; font-weight: 700; }
.metric-card p { margin: 0; color: #8a9891; font-size: 10px; font-weight: 600; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(330px, .65fr); gap: 22px; }
.panel { border: 1px solid rgba(211, 224, 217, .92); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.panel-head { min-height: 88px; padding: 22px 25px 16px; display: flex; align-items: center; justify-content: space-between; gap: 25px; }
.panel-head h2, .station-head h2 { margin: 0; font-size: 21px; letter-spacing: -.04em; }
.panel-head .section-kicker, .station-head .section-kicker { margin-bottom: 5px; }
.map-legend { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; color: #718077; font-size: 9px; font-weight: 700; }
.map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.map-legend i { width: 7px; height: 7px; border-radius: 50%; }
.legend-good { background: var(--green); }
.legend-moderate { background: var(--lime); }
.legend-poor { background: var(--amber); }
.legend-danger { background: var(--red); }

#campus-map { height: 485px; margin: 0 12px; border: 1px solid #dce7e1; border-radius: 18px; background: #eaf0ec; }
.leaflet-control-zoom { border: 0 !important; box-shadow: 0 8px 26px rgba(34,64,51,.16) !important; }
.leaflet-control-zoom a { color: #244b39 !important; border: 0 !important; }
.leaflet-popup-content-wrapper { border-radius: 15px; box-shadow: 0 14px 38px rgba(26,59,44,.2); }
.leaflet-popup-content { margin: 16px 18px; font-family: "Manrope", sans-serif; }
.popup-station strong { display: block; margin-bottom: 5px; font-size: 13px; }
.popup-station span { color: #65756c; font-size: 11px; }
.popup-value { margin-top: 10px; font-size: 22px; font-weight: 800; }
.campus-marker { position: relative; width: 34px; height: 34px; display: grid; place-items: center; }
.campus-marker::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--marker-color); opacity: .2; animation: markerPulse 2.3s infinite; }
.campus-marker span { position: relative; width: 18px; height: 18px; border: 4px solid #fff; border-radius: 50%; background: var(--marker-color); box-shadow: 0 6px 18px rgba(32,60,48,.35); }
@keyframes markerPulse { 50% { transform: scale(1.35); opacity: .06; } }
.map-caption { min-height: 46px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; color: #93a098; font-size: 9px; }

.station-panel { padding: 25px; }
.station-head { display: flex; align-items: center; gap: 14px; padding-bottom: 20px; border-bottom: 1px solid #e4ece7; }
.station-icon { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; background: var(--green-soft); }
.station-icon span { width: 15px; height: 15px; border: 4px solid #fff; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green); }
.station-location { display: flex; gap: 12px; margin: 22px 0; padding: 16px; border-radius: 16px; background: #f5f8f6; }
.location-pin { color: var(--green); font-size: 18px; line-height: 1; }
.station-location div { display: grid; gap: 3px; }
.station-location strong { font-size: 12px; }
.station-location small { color: var(--muted); font-size: 10px; }
.station-facts { margin: 0; }
.station-facts div { min-height: 43px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid #edf1ef; }
.station-facts dt { color: #829087; font-size: 10px; }
.station-facts dd { margin: 0; text-align: right; color: #3d5147; font-size: 10px; font-weight: 800; }
.station-facts dd i { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: #94a3b8; }
.station-facts dd.online { color: var(--green-dark); }
.station-facts dd.online i { background: var(--green); }
.quality-scale { margin-top: 25px; }
.scale-title { display: flex; justify-content: space-between; color: #55675d; font-size: 10px; font-weight: 800; }
.scale-title small { color: #94a098; }
.scale-bar { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; height: 8px; margin: 13px 0 7px; }
.scale-bar i { border-radius: 999px; }
.scale-bar i:nth-child(1) { background: var(--green); }
.scale-bar i:nth-child(2) { background: var(--lime); }
.scale-bar i:nth-child(3) { background: var(--amber); }
.scale-bar i:nth-child(4) { background: var(--red); }
#scale-pointer { position: absolute; top: -5px; left: 0; width: 3px; height: 18px; border: 2px solid #fff; border-radius: 5px; background: #233f32; box-shadow: 0 2px 6px rgba(0,0,0,.25); transform: translateX(-50%); transition: left .5s ease; }
.scale-labels { display: flex; justify-content: space-between; color: #a0aaa4; font-size: 8px; }
.station-note { margin: 23px 0 0; color: #89968f; font-size: 9px; line-height: 1.65; }

.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 22px; }
.chart-panel { min-height: 360px; }
.panel-head.compact { min-height: 82px; }
.chart-badge { padding: 7px 10px; border-radius: 9px; color: #0d7a37; background: #ecf8f0; font-size: 9px; font-weight: 800; }
.chart-badge.neutral { color: #5b598e; background: #f1f0fb; }
.chart-wrap { position: relative; height: 255px; padding: 5px 20px 20px; }
.empty-chart { position: absolute; inset: 0; display: grid; place-items: center; color: #98a49d; font-size: 11px; }
.chart-wrap.has-data .empty-chart { display: none; }

footer { margin-top: 28px; border-top: 1px solid #dce7e1; background: rgba(255,255,255,.55); }
.footer-inner { min-height: 112px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.footer-brand .brand-mark { width: 34px; height: 34px; border-radius: 11px; }
.footer-inner > p { margin: 0; color: #829087; font-size: 10px; }

@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; }
  .hero-status { max-width: 480px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
  .station-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
  .station-head { grid-column: 1 / -1; }
  .station-note { align-self: end; }
}

@media (max-width: 760px) {
  .shell { width: min(100% - 28px, 1400px); }
  .page { padding-top: 42px; }
  .campus-label { display: none; }
  .hero { gap: 28px; }
  .hero h1 { font-size: clamp(42px, 13vw, 62px); }
  .hero-copy p { font-size: 14px; }
  .metric-grid, .charts-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 146px; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .map-legend { justify-content: flex-start; }
  #campus-map { height: 420px; }
  .station-panel { display: block; }
  .footer-inner { padding: 26px 0; align-items: flex-start; flex-direction: column; }
}

@media (max-width: 480px) {
  .header-inner { min-height: 68px; }
  .brand small { display: none; }
  .live-pill span { display: none; }
  .live-pill { width: 34px; justify-content: center; padding: 0; }
  .hero-status { padding: 19px; }
  .status-orbit { width: 58px; height: 58px; flex-basis: 58px; }
  .status-orbit::before { width: 48px; height: 48px; }
  .status-orbit span { width: 27px; height: 27px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { min-height: 140px; padding: 18px; }
  .metric-value strong { font-size: 32px; }
  .metric-card p { display: none; }
  .panel-head, .station-panel { padding: 20px; }
  #campus-map { height: 380px; margin: 0 8px; }
  .map-caption span:last-child { display: none; }
}

