/* ---- tokens ---- */
:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1a2230;
  --text-muted: #5b6472;
  --border: #e2e5ea;
  --accent: #1c5fa8;
  --accent-soft: #e8f1fb;

  --status-complete: #1e8e5a;
  --status-complete-bg: #e7f6ee;
  --status-progress: #b6790a;
  --status-progress-bg: #fdf1dd;
  --status-upcoming: #6b7280;
  --status-upcoming-bg: #eef0f2;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10151d;
    --panel: #171e28;
    --text: #e7ebf1;
    --text-muted: #9aa4b2;
    --border: #29323e;
    --accent: #5b9bd9;
    --accent-soft: #1b2a3a;

    --status-complete: #4cc38a;
    --status-complete-bg: #16301f;
    --status-progress: #e0ac4a;
    --status-progress-bg: #35280f;
    --status-upcoming: #9aa4b2;
    --status-upcoming-bg: #232b35;
  }
}

/* ---- reset-ish ---- */
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}
img { max-width: 100%; }
h1, h2 { margin: 0; }

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding-inline: 20px;
}

/* ---- header ---- */
.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding-block: 28px;
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.hyperit-logo {
  height: 40px;
  width: auto;
  flex-shrink: 0;
}
@media (prefers-color-scheme: dark) {
  .hyperit-logo {
    background: #fff;
    padding: 6px 10px;
    border-radius: 6px;
  }
}
.topbar-text {
  flex: 1 1 auto;
}
.district-logo {
  height: 48px;
  width: auto;
  flex-shrink: 0;
  margin-left: auto;
}
.eyebrow {
  margin: 0 0 2px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}
.topbar-text h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

/* ---- intro ---- */
.intro {
  padding-block: 24px 8px;
}
.intro p {
  margin: 0 0 6px;
  color: var(--text);
}
.meta-line {
  font-size: 0.9rem;
  color: var(--text-muted);
}
.dot { margin-inline: 6px; }

main.wrap section {
  margin-top: 36px;
}
main h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 14px;
}

/* ---- badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.badge-complete   { color: var(--status-complete);  background: var(--status-complete-bg); }
.badge-progress   { color: var(--status-progress);  background: var(--status-progress-bg); }
.badge-upcoming   { color: var(--status-upcoming);  background: var(--status-upcoming-bg); }

/* ---- phase timeline ---- */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  overflow: hidden;
}
.timeline-item {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.timeline-item:last-child { border-bottom: none; }

.timeline-marker {
  flex-shrink: 0;
  width: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.timeline-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 3px solid var(--status-upcoming);
  background: var(--panel);
  margin-top: 3px;
}
.timeline-item.is-complete .timeline-dot {
  border-color: var(--status-complete);
  background: var(--status-complete);
}
.timeline-item.is-progress .timeline-dot {
  border-color: var(--status-progress);
  background: var(--status-progress);
}
.timeline-line {
  flex: 1;
  width: 2px;
  background: var(--border);
  margin-top: 4px;
}
.timeline-item:last-child .timeline-line { display: none; }

.timeline-body { flex: 1; padding-top: 1px; }
.timeline-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.timeline-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}
.timeline-body p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* ---- section hint ---- */
.section-hint {
  margin: -6px 0 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ---- hardware table ---- */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}
.hardware-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 560px;
}
.hardware-table th,
.hardware-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.hardware-table thead th {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg);
  white-space: nowrap;
}
.hardware-table tbody tr:last-child td {
  border-bottom: none;
}
.hardware-item-name {
  font-weight: 600;
  display: block;
}
.hardware-item-detail {
  display: block;
  margin-top: 2px;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* status value + optional hover/tap note */
.status-value {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
}
.status-value.is-yes { color: var(--status-complete); }
.status-value.is-no  { color: var(--status-upcoming); }

.has-note {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted currentColor;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  padding: 0;
  font: inherit;
  color: inherit;
}
.has-note .note-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
  font-style: normal;
}
.has-note .tooltip-bubble {
  /* position: fixed (not absolute) so it escapes the table's scroll-clipping
     container; exact top/left are set by JS right before it's shown. */
  position: fixed;
  z-index: 50;
  width: max-content;
  max-width: min(240px, calc(100vw - 16px));
  background: var(--text);
  color: var(--panel);
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.4;
  padding: 8px 10px;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}
.has-note:hover .tooltip-bubble,
.has-note:focus-visible .tooltip-bubble,
.has-note.is-open .tooltip-bubble {
  opacity: 1;
  transform: translateY(0);
}

/* ---- sites ---- */
.site-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.site-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.site-card .site-name {
  font-weight: 600;
  font-size: 0.95rem;
}

/* ---- updates ---- */
.updates {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.update-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 12px 16px;
}
.update-date {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 3px;
}
.update-item p {
  margin: 0;
  font-size: 0.92rem;
}

/* ---- footer ---- */
.site-footer {
  margin-top: 56px;
  padding-block: 24px calc(24px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
}
.site-footer p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---- responsive ---- */
@media (max-width: 480px) {
  .topbar-inner { gap: 12px; }
  .district-logo { height: 38px; }
  .topbar-text h1 { font-size: 1.25rem; }
}
