/* gms-status — colours and type from GMS_BRAND.md. */

:root {
  --brand-accent: #0078D4;
  --surface-background: #F7FAFC;
  --surface-card: #FFFFFF;
  --surface-alt: #EAF2F8;
  --border-subtle: #D8E2EC;
  --text-primary: #0A1628;
  --text-secondary: #2A4A6A;
  --text-muted: #507090;
  --link: #005FA8;

  --status-success-bg: #DFF6DF;
  --status-success-text: #0E5E0E;
  --status-warning-bg: #FFF4CE;
  --status-warning-text: #5D4E00;
  --status-error-bg: #FDE7E9;
  --status-error-text: #B50A0A;
  --status-info-bg: #CCE5FF;
  --status-info-text: #003366;

  /* Day-bar fills (solid, 3:1 against the card). */
  --bar-up: #0E6B0E;
  --bar-slow: #8B5A00;
  --bar-down: #B50A0A;
  --bar-none: #D8E2EC;
  --bar-maint: #0078D4;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", system-ui, Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --radius-card: 12px;
  --radius-badge: 4px;
  --motion: 180ms;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand-accent: #4DA6FF;
    --surface-background: #0F1720;
    --surface-card: #1A2433;
    --surface-alt: #18202D;
    --border-subtle: #2E3E54;
    --text-primary: #E8F0F8;
    --text-secondary: #B0C8E0;
    --text-muted: #8098B8;
    --link: #6BB7FF;

    --status-success-bg: #0E6B0E;
    --status-success-text: #B8E6B8;
    --status-warning-bg: #8B5A00;
    --status-warning-text: #FFE566;
    --status-error-bg: #7A1717;
    --status-error-text: #F4A0A0;
    --status-info-bg: #004D4D;
    --status-info-text: #99CCCC;

    --bar-up: #B8E6B8;
    --bar-slow: #FFE566;
    --bar-down: #F4A0A0;
    --bar-none: #2E3E54;
    --bar-maint: #4DA6FF;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--surface-background);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
}

a { color: var(--link); }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
  border-radius: 2px;
}
main:focus { outline: none; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: 16px; top: -48px;
  padding: 8px 16px;
  background: var(--surface-card);
  color: var(--link);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  z-index: 10;
}
.skip-link:focus { top: 8px; }

.wrap {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------------------------------------------------------------- header */

.site-header {
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-card);
}
.header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 18px;
}
.brand:hover .brand-name { text-decoration: underline; }
.brand-tag {
  margin-left: auto;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 2px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-badge);
}
.logo--dark { display: none; }
@media (prefers-color-scheme: dark) {
  .logo--light { display: none; }
  .logo--dark { display: inline-block; }
}

main.wrap { padding-top: 32px; padding-bottom: 48px; }

.section-title {
  font-size: 20px;
  line-height: 1.3;
  margin: 0 0 12px;
}

.muted { color: var(--text-muted); }

/* --------------------------------------------------------------- overall */

.overall {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: var(--radius-card);
  margin-bottom: 32px;
  background: var(--surface-alt);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}
.overall-text { margin: 0; font-size: 20px; font-weight: 600; }
.overall-dot {
  flex: none;
  width: 14px; height: 14px;
  border-radius: 999px;
  background: var(--text-muted);
}
.overall--operational { background: var(--status-success-bg); color: var(--status-success-text); border-color: transparent; }
.overall--operational .overall-dot { background: currentColor; }
.overall--degraded { background: var(--status-warning-bg); color: var(--status-warning-text); border-color: transparent; }
.overall--degraded .overall-dot { background: currentColor; }
.overall--outage { background: var(--status-error-bg); color: var(--status-error-text); border-color: transparent; }
.overall--outage .overall-dot { background: currentColor; }
.overall--maintenance { background: var(--status-info-bg); color: var(--status-info-text); border-color: transparent; }
.overall--maintenance .overall-dot { background: currentColor; }

/* ----------------------------------------------------------- maintenance */

.maintenance { margin-bottom: 32px; }
.maintenance-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.maint {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--bar-maint);
  border-radius: var(--radius-card);
  padding: 16px 20px;
}
.maint-kind {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: var(--radius-badge);
  background: var(--status-info-bg);
  color: var(--status-info-text);
}
.maint-title { margin: 8px 0 4px; font-size: 17px; }
.maint p { margin: 4px 0 0; }
.maint-when { color: var(--text-secondary); font-size: 15px; }

/* ------------------------------------------------------------ components */

.card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 20px;
  margin-bottom: 32px;
}
.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  margin-bottom: 4px;
}
.card-head .section-title { margin: 0; }
.card-note { margin: 0; color: var(--text-muted); font-size: 14px; }

.components { list-style: none; margin: 0; padding: 0; }
.component {
  padding: 16px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.component:last-child { border-bottom: 0; }
.component--placeholder { color: var(--text-muted); }

.component-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.component-name { margin: 0; font-size: 16px; font-weight: 600; }
.state { font-size: 15px; font-weight: 600; white-space: nowrap; }
.state--up { color: var(--status-success-text); }
.state--slow { color: var(--status-warning-text); }
.state--down { color: var(--status-error-text); }
.state--maintenance { color: var(--status-info-text); }
.state--unknown { color: var(--text-muted); }
@media (prefers-color-scheme: dark) {
  /* The dark "text" tokens are tuned for their coloured backgrounds; on the
     card the bar colours read better. */
  .state--up { color: var(--bar-up); }
  .state--slow { color: var(--bar-slow); }
  .state--down { color: var(--bar-down); }
  .state--maintenance { color: var(--bar-maint); }
}

.bars {
  display: flex;
  gap: 2px;
  height: 32px;
}
.bar {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 2px;
  background: var(--bar-none);
  transition: opacity var(--motion) ease-out;
}
.bar--up { background: var(--bar-up); }
.bar--slow { background: var(--bar-slow); }
.bar--down { background: var(--bar-down); }
.bar:hover { opacity: 0.7; }

.bars-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-muted);
}
.bars-foot .uptime { color: var(--text-secondary); }

/* Phones: show the last 30 days so each day stays visible. */
@media (max-width: 560px) {
  .bar:nth-child(-n+60) { display: none; }
  .since-90 { display: none; }
}
@media (min-width: 561px) {
  .since-30 { display: none; }
}

.legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 12px 0 0;
  padding: 12px 0 0;
  border-top: 1px solid var(--border-subtle);
  font-size: 13px;
  color: var(--text-muted);
}
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }
.swatch--up { background: var(--bar-up); }
.swatch--slow { background: var(--bar-slow); }
.swatch--down { background: var(--bar-down); }
.swatch--none { background: var(--bar-none); }

/* ------------------------------------------------------------- incidents */

.incidents { display: grid; gap: 16px; }
.incident-day h3 {
  font-size: 16px;
  margin: 0 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
}
.incident-day ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.incident-title { margin: 0; font-weight: 600; }
.incident-title.is-down { color: var(--status-error-text); }
.incident-title.is-slow { color: var(--status-warning-text); }
@media (prefers-color-scheme: dark) {
  .incident-title.is-down { color: var(--bar-down); }
  .incident-title.is-slow { color: var(--bar-slow); }
}
.incident-when { margin: 0; font-size: 14px; color: var(--text-muted); }

/* ---------------------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 20px 0 32px;
  font-size: 14px;
}
.site-footer p { margin: 0 0 6px; }

.error-note {
  margin: 0;
  font-size: 15px;
  font-weight: 400;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
