/* ==========================================================
   Project Beacon — style.css
   Dark + light themes (auto), mobile-first, no frameworks.
   ========================================================== */

/* ----------------------------------------------------------
   THEME TOKENS

   :root holds the dark palette (the original brand). The light
   override is keyed off the OS preference via prefers-color-scheme.
   ---------------------------------------------------------- */
:root {
  color-scheme: dark light;

  --bg: #0d1117;
  --surface: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #2f81f7;
  --accent-hover: #1a6fe0;
  --success: #3fb950;
  --success-hover: #2ea043;
  --success-text: #0d1117;
  --warning: #d29922;
  --danger: #f85149;
  --header-bg: rgba(13, 17, 23, 0.92);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial,
    sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --radius: 6px;
  --max-w: 1100px;
  --header-h: 56px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #ffffff;
    --surface: #f6f8fa;
    --border: #d0d7de;
    --text: #1f2328;
    --text-muted: #656d76;
    --accent: #0969da;
    --accent-hover: #0860c0;
    --success: #1a7f37;
    --success-hover: #15692d;
    --success-text: #ffffff;
    --warning: #9a6700;
    --danger: #cf222e;
    --header-bg: rgba(255, 255, 255, 0.92);
  }
}

/* Manual override from the header toggle. Higher specificity than :root or
   the media-query :root, so it wins over the OS preference. */
:root[data-theme="dark"] {
  --bg: #0d1117;
  --surface: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #2f81f7;
  --accent-hover: #1a6fe0;
  --success: #3fb950;
  --success-hover: #2ea043;
  --success-text: #0d1117;
  --warning: #d29922;
  --danger: #f85149;
  --header-bg: rgba(13, 17, 23, 0.92);
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --surface: #f6f8fa;
  --border: #d0d7de;
  --text: #1f2328;
  --text-muted: #656d76;
  --accent: #0969da;
  --accent-hover: #0860c0;
  --success: #1a7f37;
  --success-hover: #15692d;
  --success-text: #ffffff;
  --warning: #9a6700;
  --danger: #cf222e;
  --header-bg: rgba(255, 255, 255, 0.92);
}

/* ----------------------------------------------------------
   RESET & BASE
   ---------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Visible focus for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

img {
  max-width: 100%;
  display: block;
}

ul, ol {
  list-style: none;
}

/* ----------------------------------------------------------
   UTILITIES
   ---------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1rem;
}

.section {
  padding: 3rem 0;
}

.section-alt {
  background: var(--surface);
}

.section h2 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.section-desc {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.section h2 + .section-desc {
  margin-top: 0.25rem;
}

/* ----------------------------------------------------------
   BUTTONS
   ---------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  text-align: center;
  min-height: 44px;
  line-height: 1.4;
  transition: background 0.15s ease;
}

.btn:hover,
.btn:focus-visible {
  background: var(--accent-hover);
  text-decoration: none;
}

.btn:disabled {
  cursor: default;
  opacity: 0.85;
}

.btn.is-success,
.btn.is-success:hover {
  background: var(--success);
  color: var(--success-text);
}

.btn-sm {
  padding: 0.375rem 1rem;
  min-height: 36px;
}

.btn-block {
  display: block;
  width: 100%;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-outline:hover,
.btn-outline:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  background: transparent;
}

/* Solid CTA — background uses the muted-text token (the same grey nav links
   render in), text is always white in both themes. The .nav-list a override
   is needed because `.nav-list a { color: var(--text-muted) }` has higher
   specificity than the bare `.btn-success` rule. */
.btn-success,
.btn-success:hover,
.btn-success:focus-visible,
.nav-list a.btn-success,
.nav-list a.btn-success:hover,
.nav-list a.btn-success:focus-visible {
  color: #fff;
}
.btn-success {
  background: var(--text-muted);
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}
.btn-success:hover,
.btn-success:focus-visible {
  background: var(--text);
}

/* Theme toggle — sits in the header nav. Shows the icon for the theme the user
   would switch TO (sun while in dark, moon while in light). */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* Show the sun icon while in dark mode, moon while in light. The pre-paint
   script sets data-theme on <html>; the media query handles the auto case. */
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

@media (prefers-color-scheme: dark) {
  .theme-toggle .icon-sun { display: block; }
  .theme-toggle .icon-moon { display: none; }
}

:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* ----------------------------------------------------------
   HEADER
   ---------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo:hover {
  text-decoration: none;
  color: var(--accent);
}

.logo-icon {
  color: var(--accent);
  font-size: 1rem;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-list a {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.nav-list a:hover {
  color: var(--text);
  text-decoration: none;
}

/* Hide nav text on very small screens, keep ticket button */
@media (max-width: 599px) {
  .nav-list {
    gap: 0.75rem;
  }

  .nav-list li:not(:last-child) {
    display: none;
  }
}

/* ----------------------------------------------------------
   PROJECT CALENDAR TIMELINE
   ---------------------------------------------------------- */
.calendar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
  overflow: hidden;
}

.calendar-track {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 0.5rem 1rem;
  max-width: var(--max-w);
  margin: 0 auto;
}

/* Hide scrollbar but keep functionality */
.calendar-track::-webkit-scrollbar { height: 4px; }
.calendar-track::-webkit-scrollbar-track { background: transparent; }
.calendar-track::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.milestone {
  flex: 1 0 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.5rem 0.75rem;
  position: relative;
  scroll-snap-align: start;
  min-width: 140px;
}

/* Connecting line between milestones.
   top = milestone padding-top (0.5rem) + dot radius (11px) - half line height (1px). */
.milestone::before {
  content: "";
  position: absolute;
  top: calc(0.5rem + 10px);
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border);
}

.milestone:first-child::before { left: 50%; }
.milestone:last-child::before { right: 50%; }

/* Dot marker */
.milestone-dot {
  position: relative;
  z-index: 1;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

/* Complete: filled dot with check */
.milestone[data-status="complete"] .milestone-dot {
  background: var(--success);
  border-color: var(--success);
}

.milestone[data-status="complete"] .milestone-dot::after {
  content: "\2713";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

/* Next upcoming: accent ring */
.milestone[data-status="next"] .milestone-dot {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 129, 247, 0.25);
  background: var(--accent);
}

.milestone[data-status="next"] .milestone-dot::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 50%;
}

/* Upcoming: open circle */
.milestone[data-status="upcoming"] .milestone-dot {
  border-color: var(--text-muted);
}

/* T-minus badge */
.milestone-badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  margin-top: 0.5rem;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  background: rgba(139, 148, 158, 0.12);
  color: var(--text-muted);
}

.milestone[data-status="complete"] .milestone-badge {
  background: rgba(63, 185, 80, 0.12);
  color: var(--success);
}

.milestone[data-status="next"] .milestone-badge {
  background: rgba(47, 129, 247, 0.15);
  color: var(--accent);
}

/* Milestone name */
.milestone h3 {
  font-size: 0.8125rem;
  font-weight: 600;
  margin-top: 0.375rem;
  line-height: 1.3;
  color: var(--text);
}

.milestone[data-status="complete"] h3 {
  color: var(--text-muted);
}

.milestone[data-status="next"] h3 {
  color: var(--accent);
}

/* Date */
.milestone time {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 0.125rem;
}

/* Connecting line turns green for completed segments */
.milestone[data-status="complete"]::before {
  background: var(--success);
}

/* The milestone right after the last complete one needs a gradient line */
.milestone[data-status="complete"] + .milestone[data-status="next"]::before,
.milestone[data-status="complete"] + .milestone[data-status="upcoming"]::before {
  background: linear-gradient(to right, var(--success), var(--border));
}

/* Desktop: no scroll needed, fit all inline */
@media (min-width: 900px) {
  .milestone {
    flex: 1 1 0;
    min-width: 0;
  }

  .calendar-track {
    overflow-x: visible;
    padding: 0.5rem 2rem;
  }
}

@media (min-width: 600px) {
  .calendar {
    padding: 1.5rem 0;
  }
}

/* ----------------------------------------------------------
   VERTICAL TIMELINE (used on /timeline)
   Mirrors the horizontal calendar styling: dot-on-a-line with
   the same data-state colour cues, rotated 90°.
   ---------------------------------------------------------- */
.timeline-vertical {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
}

.timeline-entry {
  position: relative;
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 1rem;
  padding: 0.75rem 0 1.5rem;
}

/* Connecting line running vertically through the dot column. */
.timeline-entry::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-entry:first-child::before { top: 1.25rem; }
.timeline-entry:last-child::before { bottom: calc(100% - 1.25rem - 22px); }

/* Dot marker — same dimensions as .milestone-dot for visual consistency.
   display:block + justify-self:center pin the dot to the centre of the
   32px grid column so the connecting line (also at column-centre) aligns. */
.timeline-entry-dot {
  position: relative;
  z-index: 1;
  display: block;
  justify-self: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  margin-top: 1rem;
}

/* Past: filled green dot with tick. */
.timeline-entry[data-state="past"] .timeline-entry-dot {
  background: var(--success);
  border-color: var(--success);
}
.timeline-entry[data-state="past"] .timeline-entry-dot::after {
  content: "\2713";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

/* Today: accent ring with inner dot. */
.timeline-entry[data-state="today"] .timeline-entry-dot {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 129, 247, 0.25);
}
.timeline-entry[data-state="today"] .timeline-entry-dot::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 50%;
}

/* Past segments of the line turn green, matching the horizontal calendar. */
.timeline-entry[data-state="past"]::before { background: var(--success); }
.timeline-entry[data-state="past"] + .timeline-entry[data-state="today"]::before,
.timeline-entry[data-state="past"] + .timeline-entry[data-state="upcoming"]::before {
  background: linear-gradient(to bottom, var(--success), var(--border));
}

.timeline-entry-content {
  min-width: 0;
}

.timeline-entry-content time {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.timeline-entry-content h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0.125rem 0 0.25rem;
  color: var(--text);
}

.timeline-entry[data-state="past"] h3 { color: var(--text-muted); }
.timeline-entry[data-state="today"] h3 { color: var(--accent); }

.timeline-entry-link {
  font-size: 0.75rem;
  margin-left: 0.25rem;
  opacity: 0.6;
  text-decoration: none;
}
.timeline-entry-link:hover { opacity: 1; }

.timeline-entry-description {
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.timeline-entry-body {
  margin-top: 0.75rem;
}

.timeline-entry-body > * + * { margin-top: 0.75rem; }

/* When the URL targets a specific milestone, highlight the destination. */
.timeline-entry:target {
  scroll-margin-top: calc(var(--header-h) + 1rem);
}
.timeline-entry:target .timeline-entry-content {
  background: rgba(47, 129, 247, 0.06);
  border-left: 3px solid var(--accent);
  margin-left: -0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ----------------------------------------------------------
   HERO STATUS BANNER
   ---------------------------------------------------------- */
.hero {
  padding: 2.5rem 0 2rem;
}

.status-banner {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid;
}

.status-banner.status-ok {
  background: rgba(63, 185, 80, 0.08);
  border-color: rgba(63, 185, 80, 0.3);
}

.status-banner.status-warning {
  background: rgba(210, 153, 34, 0.08);
  border-color: rgba(210, 153, 34, 0.3);
}

.status-banner.status-danger {
  background: rgba(248, 81, 73, 0.08);
  border-color: rgba(248, 81, 73, 0.3);
}

.status-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 0.125rem;
}

.status-ok .status-icon { color: var(--success); }
.status-warning .status-icon { color: var(--warning); }
.status-danger .status-icon { color: var(--danger); }

.status-banner h1 {
  font-size: 1.25rem;
  line-height: 1.4;
}

.status-banner p {
  margin-top: 0.25rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.hero-subtitle {
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* ----------------------------------------------------------
   SERVICE STATUS GRID
   ---------------------------------------------------------- */
.status-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.status-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  transition: border-color 0.15s ease;
}

.status-card:hover {
  border-color: var(--accent);
}

.status-card-link {
  display: block;
  padding: 1.25rem;
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius);
}

.status-card-link:hover {
  text-decoration: none;
  color: inherit;
}

.status-card-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.625rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Status colours — always paired with text label */
[data-status="ok"] .status-dot { background: var(--success); }
[data-status="ok"] .status-label { color: var(--success); }

[data-status="warning"] .status-dot { background: var(--warning); }
[data-status="warning"] .status-label { color: var(--warning); }

[data-status="danger"] .status-dot { background: var(--danger); }
[data-status="danger"] .status-label { color: var(--danger); }

[data-status="investigating"] .status-dot { background: var(--accent); }
[data-status="investigating"] .status-label { color: var(--accent); }

[data-status="maintenance"] .status-dot { background: var(--text-muted); }
[data-status="maintenance"] .status-label { color: var(--text-muted); }

.status-card h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.status-card p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

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

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

/* ----------------------------------------------------------
   KNOWN ISSUES
   ---------------------------------------------------------- */
.issues-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.issue-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.section-alt .issue-card {
  background: var(--bg);
}

.issue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.issue-severity {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

[data-severity="danger"] .issue-severity { color: var(--danger); }
[data-severity="warning"] .issue-severity { color: var(--warning); }
[data-severity="low"] .issue-severity { color: var(--text-muted); }

.issue-header time {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.issue-card h3 {
  font-size: 1rem;
  margin-bottom: 0.375rem;
}

.issue-card p {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Footer link beneath the issues list — mirrors .guides-footer. */
.issues-footer {
  margin-top: 1.25rem;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.issues-all-link {
  font-weight: 600;
}
.issues-count {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ----------------------------------------------------------
   INCIDENT HISTORY (/incidents)
   Two-column layout: sidebar of services + main pane of incident cards,
   each card carrying a chronological update log.
   ---------------------------------------------------------- */

.incidents-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2rem;
  margin-top: 1rem;
}

.incidents-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  align-self: start;
  max-height: calc(100vh - var(--header-h) - 2rem);
  overflow-y: auto;
}

.incidents-sidebar-heading {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
  padding: 0 0.75rem;
}

.incidents-sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.incidents-sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
  line-height: 1.2;
}

.incidents-sidebar-nav a:hover {
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
}

.incidents-sidebar-nav a[aria-current="page"] {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

.incidents-sidebar-nav a[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 0;
  width: 3px;
  height: 1.25rem;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
  margin-left: -0.5rem;
}

.incidents-sidebar-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.incidents-sidebar-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 10px;
  font-size: 0.875rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.incidents-sidebar-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0 0.4rem;
  border-radius: 9999px;
  line-height: 1.4;
}

.incidents-main {
  min-width: 0;
}

/* Stack the sidebar above the content on narrow screens. */
@media (max-width: 720px) {
  .incidents-layout {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .incidents-sidebar {
    position: static;
    max-height: none;
    overflow-y: visible;
  }
}

/* Banner shown when a ?service=N filter is active. (Kept for compatibility
   even though the redesigned sidebar makes it visually redundant.) */
.incidents-filter {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
}

.incidents-clear-filter {
  font-weight: 600;
  font-size: 0.875rem;
}

.incidents-history {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.incident-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.incident-card[data-state="resolved"] {
  opacity: 0.82;
}

.incident-card-header {
  margin-bottom: 1rem;
}

.incident-state {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--danger);
  margin-bottom: 0.4rem;
}

.incident-card[data-state="resolved"] .incident-state {
  color: var(--success);
}

.incident-state-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.incident-card h3 {
  font-size: 1.0625rem;
  margin-bottom: 0.25rem;
}

.incident-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.incident-updates {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-left: 2px solid var(--border);
  padding-left: 1rem;
}

.incident-update {
  position: relative;
}

.incident-update-meta {
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.incident-update-status {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.6875rem;
}

.incident-update[data-severity="danger"] .incident-update-status { color: var(--danger); }
.incident-update[data-severity="warning"] .incident-update-status { color: var(--warning); }
.incident-update[data-severity="low"] .incident-update-status { color: var(--text-muted); }
.incident-update[data-severity="ok"] .incident-update-status { color: var(--success); }

.incident-update .markdown-body {
  font-size: 0.9375rem;
  color: var(--text);
}

.incident-update .markdown-body > * + * {
  margin-top: 0.625rem;
}

/* ----------------------------------------------------------
   SELF-SERVICE GUIDES
   ---------------------------------------------------------- */
.guides-grid {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.guide-link {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 500;
  transition: border-color 0.15s ease;
  min-height: 44px;
}

.guide-link:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.guide-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

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

/* Footer row under the pinned grid — "Browse all guides" link plus a
   reassuring count of total published guides. */
.guides-footer {
  margin-top: 1.25rem;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.guides-all-link {
  font-weight: 600;
}

.guides-count {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ----------------------------------------------------------
   COMMUNICATIONS TIMELINE
   ---------------------------------------------------------- */
.comms-timeline {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.comms-entry {
  position: relative;
  padding-left: 1.5rem;
  border-left: 2px solid var(--border);
}

.comms-entry time {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.comms-entry h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.comms-link {
  font-size: 0.8125rem;
  color: var(--text-muted);
  opacity: 0;
  margin-left: 0.25rem;
  transition: opacity 0.15s ease;
  vertical-align: middle;
}

.comms-entry:hover .comms-link,
.comms-link:focus-visible {
  opacity: 1;
}

.comms-link:hover {
  color: var(--accent);
  text-decoration: none;
}

.comms-entry p {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* <details>-based collapsible entries — snippet shown while closed, full
   markdown body rendered when open. */
.comms-summary {
  cursor: pointer;
  list-style: none;
}
.comms-summary::-webkit-details-marker { display: none; }
.comms-summary::marker { content: ''; }

.comms-meta {
  font-size: 0.75rem;
  margin: 0.25rem 0 0;
  letter-spacing: 0.02em;
}

.comms-snippet {
  margin-top: 0.5rem;
}

.comms-summary::after {
  content: 'Read more';
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 0.5rem;
  letter-spacing: 0.02em;
}
.comms-entry[open] .comms-summary::after {
  content: 'Show less';
}

.comms-entry[open] .comms-snippet {
  display: none;
}

.comms-body {
  margin-top: 0.75rem;
}
.comms-body > * + * {
  margin-top: 0.75rem;
}

.comms-external {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
}

/* ----------------------------------------------------------
   FAQ (native <details>)
   ---------------------------------------------------------- */
.faq-list {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.faq-item summary {
  padding: 1rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 44px;
}

/* Custom expand indicator */
.faq-item summary::after {
  content: "+";
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text-muted);
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "\2212"; /* minus sign */
}

/* Remove default marker in all browsers */
.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-answer {
  padding: 0 1.25rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* ----------------------------------------------------------
   FOOTER
   ---------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ----------------------------------------------------------
   INLINE TICKET FORM
   ---------------------------------------------------------- */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.125rem;
}

.form-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem 1rem;
}

.form-fields + .form-fields {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.form-fields-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 0.25rem;
}

.form-group {
  margin: 0;
}

.form-group > label,
.form-group > .form-label {
  display: block;
  font-weight: 600;
  font-size: 0.8125rem;
  margin-bottom: 0.25rem;
}

.form-label-aside {
  font-weight: 400;
  color: var(--text-muted);
}

.form-hint {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="datetime-local"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.9375rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 44px;
  transition: border-color 0.15s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 2px rgba(47, 129, 247, 0.25);
}

.form-group textarea {
  min-height: 96px;
  resize: vertical;
}

@media (min-width: 600px) {
  .form-card {
    padding: 1.5rem;
  }

  .form-fields {
    grid-template-columns: 1fr 1fr;
    gap: 0.875rem 1.25rem;
  }

  .form-fields .full {
    grid-column: 1 / -1;
  }
}

.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%238b949e' d='M1.4 0L6 4.6 10.6 0 12 1.4l-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}

/* Radio and checkbox groups — modern pill-button selectors */
.radio-group,
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.radio-option,
.checkbox-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.875rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9999px;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  min-height: 44px;
  user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

/* Native input visually hidden but keyboard-focusable */
.radio-option input,
.checkbox-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  margin: 0;
  padding: 0;
  border: 0;
  appearance: none;
  -webkit-appearance: none;
  pointer-events: none;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.radio-option:hover,
.checkbox-option:hover {
  border-color: var(--accent);
}

.radio-option:has(input:checked),
.checkbox-option:has(input:checked) {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.radio-option:has(input:focus-visible),
.checkbox-option:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.option-label {
  font-weight: 500;
}

/* Character counter */
.char-count {
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.char-count.over-limit {
  color: var(--danger);
}

/* Form actions */
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding-top: 0.5rem;
}

.email-copy-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.email-copy-toggle input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Validation feedback */
.form-group input:invalid:not(:placeholder-shown),
.form-group textarea:invalid:not(:placeholder-shown) {
  border-color: var(--danger);
}

.form-error {
  font-size: 0.8125rem;
  color: var(--danger);
  margin-top: 0.25rem;
}

/* Error alert bar */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid;
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
}

.alert-danger {
  background: rgba(248, 81, 73, 0.08);
  border-color: rgba(248, 81, 73, 0.3);
  color: var(--danger);
}

.alert-success {
  background: rgba(63, 185, 80, 0.08);
  border-color: rgba(63, 185, 80, 0.3);
  color: var(--success);
}

/* ----------------------------------------------------------
   THANKS PAGE
   ---------------------------------------------------------- */
.thanks-page {
  min-height: calc(100vh - var(--header-h) - 100px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1rem;
}

.thanks-content {
  max-width: 520px;
}

.thanks-icon {
  font-size: 3rem;
  color: var(--success);
  margin-bottom: 1rem;
}

.thanks-content h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.thanks-content p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.thanks-content .btn {
  margin-top: 0.5rem;
}

/* ----------------------------------------------------------
   SUPPORT / CONTACT
   ---------------------------------------------------------- */
.support-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.support-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.support-card[data-emphasis="warning"] {
  border-color: rgba(210, 153, 34, 0.4);
}

.support-icon {
  display: inline-block;
  font-size: 1.5rem;
  line-height: 1;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.support-card[data-emphasis="warning"] .support-icon {
  color: var(--warning);
}

.support-card h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.support-card p {
  font-size: 0.9375rem;
  margin: 0;
}

.support-card a {
  font-weight: 600;
}

.support-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.25rem !important;
}

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

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

/* ----------------------------------------------------------
   INLINE TICKET FORM
   ---------------------------------------------------------- */
.ticket-intro {
  margin-bottom: 1rem;
}

.ticket-intro p {
  color: var(--text-muted);
  margin-top: 0.25rem;
  max-width: 60ch;
}

.notice {
  background: rgba(47, 129, 247, 0.06);
  border: 1px solid rgba(47, 129, 247, 0.25);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
  color: var(--text);
  line-height: 1.5;
}

.notice strong {
  color: var(--accent);
}

.notice.notice-warning {
  background: rgba(210, 153, 34, 0.06);
  border-color: rgba(210, 153, 34, 0.3);
  border-left-color: var(--warning);
}

.notice.notice-warning strong {
  color: var(--warning);
}

.notice + .notice {
  margin-top: -0.75rem;
}

.req {
  color: var(--danger);
  font-weight: 700;
  margin-left: 0.125rem;
}

.form-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0;
}

@media (min-width: 600px) {
  .form-actions {
    flex-wrap: wrap;
  }
}

/* ----------------------------------------------------------
   RESPONSIVE BREAKPOINTS
   ---------------------------------------------------------- */

/* 600px — tablet */
@media (min-width: 600px) {
  .container {
    padding: 0 1.5rem;
  }

  .section {
    padding: 4rem 0;
  }

  .section h2 {
    font-size: 1.75rem;
  }

  .hero {
    padding: 3rem 0 2.5rem;
  }

  .status-banner h1 {
    font-size: 1.5rem;
  }
}

/* 900px — desktop */
@media (min-width: 900px) {
  .container {
    padding: 0 2rem;
  }

  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

/* ----------------------------------------------------------
   GUIDES — listing extras
   ---------------------------------------------------------- */
.guide-link > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.guide-summary {
  font-weight: 400;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.empty-state {
  margin-top: 1.5rem;
  padding: 2rem;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
}

/* ----------------------------------------------------------
   GUIDE — single article view
   ---------------------------------------------------------- */
.container-narrow {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 900px) {
  .container-narrow {
    padding: 0 2rem;
  }
}

.breadcrumbs {
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.guide-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.guide-header h1 {
  font-size: 1.875rem;
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

.guide-lede {
  font-size: 1.0625rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.guide-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Typography for body_html rendered from Markdown. */
.guide-body {
  font-size: 1rem;
  line-height: 1.7;
}

.guide-body > * + * {
  margin-top: 1rem;
}

.guide-body h1,
.guide-body h2,
.guide-body h3,
.guide-body h4 {
  margin-top: 2rem;
  line-height: 1.3;
}

.guide-body h1 { font-size: 1.5rem; }
.guide-body h2 { font-size: 1.25rem; }
.guide-body h3 { font-size: 1.0625rem; }
.guide-body h4 { font-size: 1rem; }

.guide-body p {
  color: var(--text);
}

.guide-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.guide-body ul,
.guide-body ol {
  padding-left: 1.5rem;
}

.guide-body ul { list-style: disc; }
.guide-body ol { list-style: decimal; }

.guide-body li + li {
  margin-top: 0.375rem;
}

.guide-body li > ul,
.guide-body li > ol {
  margin-top: 0.375rem;
}

.guide-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875em;
  padding: 0.125em 0.375em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.guide-body pre {
  padding: 1rem;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  line-height: 1.5;
}

.guide-body pre code {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: inherit;
}

.guide-body blockquote {
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-muted);
}

.guide-body blockquote > * + * {
  margin-top: 0.5rem;
}

.guide-body hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.guide-body img {
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.guide-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.guide-body th,
.guide-body td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  text-align: left;
}

.guide-body th {
  background: var(--surface);
  font-weight: 600;
}
