:root {
  --ink: #153239;
  --navy: #123b4a;
  --teal: #2c7a78;
  --teal-dark: #1f605f;
  --mint: #e4f2ee;
  --mint-strong: #c8e5de;
  --ivory: #f7f4ec;
  --paper: #fffefa;
  --amber: #d99a3d;
  --amber-soft: #fff2d6;
  --coral: #bd5b4d;
  --line: #dce5e2;
  --muted: #65777a;
  --shadow: 0 18px 50px rgb(18 59 74 / 9%);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 7% 3%, rgb(44 122 120 / 9%), transparent 26rem),
    linear-gradient(180deg, #fbfaf5 0%, var(--ivory) 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, a { font: inherit; }

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  color: white;
  background: var(--navy);
  border-radius: 8px;
  transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

[hidden] { display: none !important; }

.site-header,
.page-shell,
footer {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid rgb(21 50 57 / 12%);
}

.brand,
.header-actions,
.update-note,
.count-row,
.card-heading-row,
.occupancy-summary,
.freshness-row,
.section-heading,
.legend {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  color: var(--navy);
  text-decoration: none;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 30px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 2px solid var(--navy);
  border-radius: 14px 14px 4px 4px;
}

.brand-mark span {
  width: 12px;
  height: 17px;
  border: 2px solid var(--teal);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.header-actions { gap: 16px; }

.update-note {
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.pulse-dot,
.freshness-icon,
.dot {
  flex: 0 0 auto;
  border-radius: 50%;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--teal);
  box-shadow: 0 0 0 5px rgb(44 122 120 / 13%);
}

.refresh-button {
  padding: 8px 12px;
  color: var(--navy);
  background: transparent;
  border: 1px solid rgb(18 59 74 / 22%);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 700;
}

.refresh-button:hover { background: var(--mint); }
.refresh-button:disabled { cursor: wait; opacity: 0.55; }

.admin-entry {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  color: white;
  background: var(--navy);
  border: 1px solid var(--navy);
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.76rem;
  font-weight: 720;
}

.admin-entry:hover {
  color: white;
  background: var(--teal);
  border-color: var(--teal);
}

.page-shell { padding: 36px 0 70px; }

.demo-banner,
.connection-message {
  padding: 13px 16px;
  border-radius: 14px;
  font-size: 0.86rem;
}

.demo-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #704913;
  background: var(--amber-soft);
  border: 1px solid rgb(217 154 61 / 38%);
}

.demo-banner p,
.connection-message { margin: 0; }

.demo-badge,
.interval-label {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
}

.demo-badge {
  color: #563507;
  background: rgb(217 154 61 / 22%);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.connection-message {
  margin-bottom: 18px;
  color: #704913;
  background: var(--amber-soft);
  border: 1px solid rgb(217 154 61 / 38%);
}

.intro {
  max-width: 680px;
  padding: 66px 0 34px;
}

.eyebrow,
.card-kicker {
  margin: 0 0 8px;
  color: var(--teal-dark);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }

h1,
.section-heading h2,
.trust-panel h2,
.project-notice h2 {
  color: var(--navy);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

h1 {
  max-width: 620px;
  margin-bottom: 16px;
  font-size: clamp(2.5rem, 6vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.intro > p:last-child {
  max-width: 560px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.16rem);
  line-height: 1.65;
}

.hero-grid,
.analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(270px, 0.75fr);
  gap: 20px;
}

.occupancy-card,
.visit-card,
.chart-card {
  border: 1px solid rgb(18 59 74 / 10%);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.occupancy-card {
  position: relative;
  overflow: hidden;
  padding: clamp(25px, 4vw, 42px);
  color: white;
  background: var(--navy);
}

.occupancy-card::after {
  content: "";
  position: absolute;
  top: -130px;
  right: -120px;
  width: 290px;
  height: 290px;
  border: 1px solid rgb(228 242 238 / 12%);
  border-radius: 50%;
  box-shadow: 0 0 0 45px rgb(228 242 238 / 3.5%), 0 0 0 90px rgb(228 242 238 / 2.5%);
  pointer-events: none;
}

.occupancy-card .card-kicker { color: #a7d4cb; }

.card-heading-row,
.occupancy-summary,
.section-heading { justify-content: space-between; gap: 18px; }

.count-row { align-items: baseline; gap: 11px; }

.current-count {
  font-size: clamp(4.7rem, 13vw, 8rem);
  font-weight: 650;
  line-height: 0.92;
  letter-spacing: -0.075em;
}

.capacity-label { color: #b8d1cf; }

.status-pill {
  z-index: 1;
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid currentcolor;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 730;
  white-space: nowrap;
}

.status-quiet { color: #9ee6cc; }
.status-moderate { color: #f1d18a; }
.status-busy, .status-near-capacity { color: #ffb5a9; }
.status-unavailable { color: #d7dedc; }

.capacity-meter {
  height: 12px;
  margin: 28px 0 16px;
  overflow: hidden;
  background: rgb(255 255 255 / 12%);
  border-radius: 999px;
}

.capacity-meter span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #72c8b7, #efc16c);
  border-radius: inherit;
  transition: width 500ms ease;
}

.occupancy-summary { color: #cfdddc; font-size: 0.9rem; }
.occupancy-summary p { margin-bottom: 0; }
.occupancy-summary strong { color: white; white-space: nowrap; }

.freshness-row {
  justify-content: flex-start;
  gap: 10px;
  margin-top: 26px;
  color: #aec5c4;
  font-size: 0.8rem;
}

.freshness-icon { width: 9px; height: 9px; background: #79cbb9; }
.freshness-icon.stale { background: var(--amber); }

.warning {
  position: relative;
  z-index: 1;
  margin-top: 20px;
  padding: 13px 15px;
  color: #ffe6b4;
  background: rgb(217 154 61 / 16%);
  border: 1px solid rgb(239 193 108 / 36%);
  border-radius: 12px;
  font-size: 0.82rem;
  line-height: 1.5;
}

.visit-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px;
  background: var(--paper);
}

.visit-card .card-kicker { align-self: flex-start; }

.ring {
  --ring-progress: 0deg;
  position: relative;
  width: 170px;
  height: 170px;
  margin: 10px auto 26px;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--teal) var(--ring-progress), var(--mint) var(--ring-progress));
  border-radius: 50%;
}

.ring::before {
  content: "";
  position: absolute;
  inset: 13px;
  background: var(--paper);
  border-radius: 50%;
}

.ring div {
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ring strong { color: var(--navy); font-size: 2.35rem; line-height: 1; letter-spacing: -0.06em; }
.ring strong small { font-size: 1rem; }
.ring div > span { margin-top: 5px; color: var(--muted); font-size: 0.72rem; }

.threshold-list {
  width: 100%;
  display: grid;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.threshold-list > span {
  display: grid;
  grid-template-columns: 9px 1fr auto;
  align-items: center;
  gap: 9px;
  font-size: 0.78rem;
  font-weight: 650;
}

.threshold-list small { color: var(--muted); font-weight: 450; }
.dot { width: 8px; height: 8px; }
.dot.quiet { background: var(--teal); }
.dot.moderate { background: var(--amber); }
.dot.busy, .dot.full { background: var(--coral); }

.analytics-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.9fr);
  margin-top: 20px;
}

.chart-card {
  min-width: 0;
  padding: clamp(22px, 3vw, 30px);
  background: rgb(255 254 250 / 88%);
}

.section-heading { align-items: flex-start; margin-bottom: 25px; }

.section-heading h2,
.trust-panel h2,
.project-notice h2 {
  margin-bottom: 0;
  font-size: 1.55rem;
  letter-spacing: -0.025em;
}

.interval-label { color: var(--teal-dark); background: var(--mint); border-radius: 7px; }

.today-chart {
  position: relative;
  height: 185px;
  border-bottom: 1px solid var(--line);
}

.chart-gridline {
  position: absolute;
  right: 0;
  left: 0;
  border-top: 1px dashed #dbe4e0;
}

.grid-high { top: 25%; }
.grid-mid { top: 60%; }

.today-bars {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  gap: clamp(1px, 0.2vw, 3px);
}

.today-bar {
  flex: 1 1 2px;
  min-width: 2px;
  max-width: 9px;
  background: linear-gradient(180deg, #69b8aa, var(--teal));
  border-radius: 4px 4px 0 0;
  transition: height 500ms ease;
}

.empty-chart {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  color: var(--muted);
  text-align: center;
  font-size: 0.84rem;
}

.time-axis { display: flex; justify-content: space-between; padding-top: 9px; color: var(--muted); font-size: 0.62rem; }

.week-chart {
  position: relative;
  height: 205px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 8px;
}

.week-column {
  height: 100%;
  min-width: 0;
  display: grid;
  grid-template-rows: 1fr auto auto;
  justify-items: center;
  gap: 5px;
}

.week-bar-track { position: relative; width: min(27px, 75%); height: 100%; align-self: end; }

.week-peak,
.week-average {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: 3px;
  border-radius: 6px 6px 2px 2px;
  transition: height 500ms ease;
}

.week-peak { background: var(--mint-strong); }
.week-average { right: 5px; left: 5px; background: var(--teal); }
.week-value { color: var(--muted); font-size: 0.62rem; }
.week-label { font-size: 0.68rem; font-weight: 650; }

.legend { justify-content: center; gap: 18px; margin-top: 18px; color: var(--muted); font-size: 0.68rem; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 2px; }
.legend-average { background: var(--teal); }
.legend-peak { background: var(--mint-strong); border: 1px solid #a9d3c9; }

.trend-warning { margin: 16px 0 0; color: #81571d; font-size: 0.82rem; }

.trust-panel,
.project-notice {
  margin-top: 20px;
  padding: 24px 28px;
  border-radius: 20px;
}

.trust-panel {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  background: rgb(228 242 238 / 52%);
  border: 1px solid rgb(44 122 120 / 18%);
}

.privacy-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--teal);
  border-radius: 50%;
  font-weight: 800;
}

.trust-panel p,
.project-notice p:last-child {
  max-width: 760px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.project-notice { background: rgb(255 254 250 / 76%); border: 1px solid rgb(21 50 57 / 13%); }
.static-warning { color: #704913; background: var(--amber-soft); }

footer {
  padding: 26px 0 34px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  border-top: 1px solid rgb(21 50 57 / 12%);
  font-size: 0.73rem;
}

footer p { margin: 0; }

@media (max-width: 840px) {
  .hero-grid, .analytics-grid { grid-template-columns: 1fr; }
  .visit-card { display: grid; grid-template-columns: 1fr auto 1fr; column-gap: 24px; }
  .visit-card .card-kicker { grid-column: 1 / -1; }
  .ring { grid-column: 2; }
  .threshold-list { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .site-header, .page-shell, footer { width: min(100% - 28px, 1180px); }
  .site-header { min-height: 72px; flex-wrap: wrap; padding-block: 12px; }
  .update-note { display: none; }
  .header-actions { gap: 8px; }
  .page-shell { padding-top: 20px; }
  .demo-banner { align-items: flex-start; }
  .intro { padding: 50px 0 28px; }
  .card-heading-row { align-items: flex-start; flex-direction: column; gap: 20px; }
  .status-pill { order: -1; }
  .current-count { font-size: clamp(4.2rem, 26vw, 6rem); }
  .occupancy-summary { align-items: flex-start; flex-direction: column; gap: 5px; }
  .visit-card { display: flex; }
  .ring { margin-top: 12px; }
  .trust-panel, .project-notice { padding: 22px; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
