/* ==========================================================================
   StoreLocators — Platform Status
   Built to the StoreLocators Brand Style Guide v1.0
   Type: Outfit (display) + DM Sans (body/UI)
   ========================================================================== */

:root {
  /* Grape — primary palette */
  /* grape-700 is extrapolated: the guide's secondary-button spec references a
     "grape-700 label" but stops at grape-600 in the swatches. Confirm w/ brand. */
  --grape-700: #3d2a6b; /* secondary button label / dense text */
  --grape-600: #55378b; /* bold headings, gradient end-stop, hover */
  --grape-500: #753ff3; /* PRIMARY — CTAs, links, key UI */
  --grape-400: #9290f3; /* logo glyph, decorative shapes */
  --grape-300: #b1b0eb; /* secondary borders, disabled */
  --grape-200: #d0c3ff; /* card borders, dividers, focus rings */
  --grape-100: #e6e0fc; /* hover surfaces, soft fills */
  --grape-50: #f5f0ff; /* default app surface, section bands */
  --header-lav: #e3dcfd; /* sticky header, hero washes */

  /* Accents & ink */
  --coral: #ff715b;
  --emerald: #10b981;
  --mint: #b0ebb9;

  --ink-100: #1d1533; /* headlines, primary text */
  --ink-70: #544d67; /* body text */
  --ink-50: #8e8a99; /* captions, metadata */
  --ink-15: #d2d0d6; /* hairlines, dividers */
  --white: #ffffff;

  /* Status semantics */
  --status-operational: var(--emerald);
  --status-degraded: var(--coral);
  --status-down: #e5484d;
  --status-loading: var(--grape-300);

  /* Type */
  --font-display: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Shape & depth */
  --radius: 16px; /* rounded-2xl */
  --radius-sm: 12px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgba(29, 21, 51, 0.04),
    0 18px 40px -22px rgba(29, 21, 51, 0.22);
  --shadow-lift: 0 2px 4px rgba(29, 21, 51, 0.05),
    0 28px 56px -24px rgba(29, 21, 51, 0.28);

  --gradient-grape: linear-gradient(100deg, var(--grape-500), var(--grape-600));

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 240ms;

  --container: 880px;
}

/* ------------------------------------------------------------------ Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* keep the native `hidden` attribute working even when an element also
   carries a class that sets `display` (e.g. .notice { display: flex }). */
[hidden] {
  display: none !important;
}

/* Visually hidden, but available to assistive tech. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link — revealed on keyboard focus. */
.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 50;
  padding: 10px 16px;
  border-radius: 0 0 12px 12px;
  background: var(--grape-500);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  transition: top 160ms ease;
}
.skip-link:focus {
  top: 0;
  color: #fff;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-70);
  background: var(--grape-50);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  color: var(--ink-100);
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.08;
}

a {
  color: var(--grape-500);
  text-decoration: none;
}
a:hover {
  color: var(--grape-600);
}

button {
  font-family: inherit;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

/* --------------------------------------------------------- Background blobs */
.blobs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
}
.blob--grape {
  width: 540px;
  height: 540px;
  top: -180px;
  right: -120px;
  background: radial-gradient(circle at 30% 30%, #9290f3, #753ff3);
  opacity: 0.32;
}
.blob--coral {
  width: 360px;
  height: 360px;
  bottom: -120px;
  left: -100px;
  background: radial-gradient(circle at 50% 50%, #ff715b, #ff715b00 70%);
  opacity: 0.18;
}
.blob--mint {
  width: 420px;
  height: 420px;
  bottom: 8%;
  right: -160px;
  background: radial-gradient(circle at 50% 50%, #b0ebb9, #b0ebb900 70%);
  opacity: 0.35;
}

/* --------------------------------------------------------------- Eyebrows */
.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.05em; /* +5% per guide */
  text-transform: uppercase;
  color: var(--grape-500);
}

/* ----------------------------------------------------------------- Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--header-lav) 82%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--grape-200);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 68px;
}
.page-title {
  flex: 1 1 auto;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 21px; /* the page title — bigger than the chrome around it */
  color: var(--ink-100);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.header-nav {
  flex: 0 0 auto;
}
.logo {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-100);
}
.logo:hover {
  color: var(--ink-100);
}
.logo-glyph {
  display: inline-flex;
  line-height: 0;
}
.logo-img {
  display: block;
  height: 28px;
  width: auto;
}
.logo-word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
  color: var(--ink-100);
}
.logo-tag {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grape-500);
  background: var(--grape-100);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  align-self: center;
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}
.header-link {
  font-weight: 500;
  color: var(--ink-70);
}
.header-link:hover {
  color: var(--grape-600);
}

/* ----------------------------------------------------------------- Buttons */
.btn {
  --btn-h: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--btn-h);
  padding-inline: 22px;
  border-radius: var(--radius-pill); /* radius = height / 2 */
  border: 1.6px solid transparent;
  font-family: var(--font-body);
  font-weight: 600; /* SemiBold; sentence case */
  font-size: 14px;
  cursor: pointer;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    background-color var(--dur) var(--ease), color var(--dur) var(--ease),
    border-color var(--dur) var(--ease), opacity var(--dur) var(--ease);
  white-space: nowrap;
}
.btn:hover {
  transform: scale(1.02);
}
.btn:active {
  transform: scale(0.98);
}
.btn:focus-visible {
  outline: 2px solid var(--grape-500);
  outline-offset: 2px;
}
a:focus-visible {
  outline: 2px solid var(--grape-500);
  outline-offset: 2px;
  border-radius: 4px;
}
.btn-sm {
  --btn-h: 36px;
  padding-inline: 16px;
  font-size: 13px;
}
.btn-primary {
  background: var(--gradient-grape);
  color: var(--white);
  box-shadow: 0 10px 22px -12px rgba(117, 63, 243, 0.7);
}
.btn-secondary {
  background: var(--white);
  color: var(--grape-700);
  border-color: var(--grape-300);
}
.btn-secondary:hover {
  border-color: var(--grape-500);
  color: var(--grape-600);
}
.btn-tertiary {
  background: var(--grape-100);
  color: var(--grape-600);
}
.btn-tertiary:hover {
  background: var(--grape-200);
}
.btn-icon {
  margin-left: -2px;
}

/* ------------------------------------------------------------------- Cards */
.card {
  background: var(--white);
  border: 1px solid var(--grape-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

/* -------------------------------------------------------------------- Hero */
main.container {
  flex: 1;
  padding-top: 40px;
  padding-bottom: 56px;
}
.hero {
  padding: 36px 32px 28px;
  position: relative;
  overflow: hidden;
  text-align: center; /* centered overall status banner */
}
.hero::before {
  /* status accent bar along the top edge */
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--accent, var(--grape-300));
  transition: background-color var(--dur) var(--ease);
}
.hero-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
}
.hero-copy h1 {
  font-weight: 800; /* Outfit ExtraBold */
  font-size: clamp(28px, 4.6vw, 40px);
}
.hero-sub {
  margin: 8px auto 0;
  color: var(--ink-70);
  font-size: 15px;
  max-width: 48ch;
}

.hero-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--grape-100);
  font-size: 13.5px;
}
.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.meta-strong {
  font-weight: 700;
  color: var(--ink-100);
}
.meta-muted {
  color: var(--ink-70);
}
.meta-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ink-15);
}
.meta-spacer {
  flex: 1 1 auto;
}
.next-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 26px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: var(--grape-100);
  color: var(--grape-600);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.next-check::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald);
  animation: softpulse 1.6s ease-in-out infinite;
}

/* ----------------------------------------------------------- Status orb (hero) */
.status-orb {
  position: relative;
  flex: none;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
}
.orb-core {
  position: relative;
  z-index: 1;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--accent, var(--grape-300));
  box-shadow: 0 10px 26px -10px var(--accent, var(--grape-300));
  transition: background-color var(--dur) var(--ease);
}
.orb-ping {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent, var(--grape-300));
  opacity: 0.55;
  animation: ping 1.4s var(--ease) infinite; /* brand: live ping 1.4s */
}
.orb-icon {
  display: block;
}
/* swap the hero icon by overall status */
.icon-check {
  stroke-dasharray: 26;
  stroke-dashoffset: 0;
}

/* Map status -> accent color (hero + orb) */
[data-status="operational"] {
  --accent: var(--status-operational);
  --pill-fg: #047857; /* dark emerald — AA on the mint tint */
}
[data-status="degraded"] {
  --accent: var(--status-degraded);
  --pill-fg: #9a3412; /* dark warm — AA on the coral tint */
}
[data-status="partial_outage"] {
  --accent: var(--status-degraded);
  --pill-fg: #9a3412;
}
[data-status="down"] {
  --accent: var(--status-down);
  --pill-fg: #b42318; /* dark red — AA on the red tint */
}
[data-status="loading"] {
  --accent: var(--status-loading);
  --pill-fg: var(--ink-50);
}
/* The hero only pings when everything is healthy. */
.hero:not([data-status="operational"]) .orb-ping {
  animation: none;
  opacity: 0;
}

/* ------------------------------------------------------------ Error notice */
.notice {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: #fff1ee;
  border: 1px solid color-mix(in srgb, var(--coral) 40%, white);
  color: #8a2f22;
  font-size: 13.5px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.notice strong {
  color: #7a261a;
}

/* ---------------------------------------------------------------- Services */
.services {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.service {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}
.service:hover {
  transform: scale(1.01);
  box-shadow: var(--shadow-lift);
  border-color: var(--grape-300);
}
.service-main {
  display: flex;
  align-items: stretch; /* so the thumbnail matches the text-stack height */
  gap: 14px;
  min-width: 0;
}
.service-main > .status-dot {
  align-self: center;
}
.service-thumb {
  flex: 0 0 auto;
  align-self: stretch;
  width: 104px;
  padding: 7px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--grape-200);
  background: var(--grape-50);
}
.service-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* minimal illustration — frame it, never crop */
  object-position: center;
  display: block;
}
.service-text {
  min-width: 0;
}
.service-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px; /* H3 step */
  color: var(--ink-100);
}
.service-host {
  display: inline-block;
  margin: 1px 0 0;
  font-size: 12.5px;
  color: var(--grape-500);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
  text-decoration: none;
}
.service-host:hover {
  color: var(--grape-600);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.service-desc {
  margin: 5px 0 0;
  font-size: 13px;
  color: var(--ink-70);
}
.service-stats {
  margin: 6px 0 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--grape-600);
  font-variant-numeric: tabular-nums;
}

.service-metrics {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: none;
}
.spark-slot {
  display: inline-flex;
  flex: none;
}
.sparkline {
  display: block;
  width: 116px;
  height: 34px;
  overflow: visible;
}
.metric {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  min-width: 88px;
}
.metric-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  color: var(--ink-100);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.metric-value .unit {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  color: var(--ink-70);
  margin-left: 2px;
}
.metric-value.is-empty {
  color: var(--ink-50);
}
.metric-uptime {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-70);
  font-variant-numeric: tabular-nums;
}
.metric-uptime .uptime-window {
  color: var(--ink-50);
  font-weight: 500;
}

/* -------------------------------------------------------- Status dot + pill */
.status-dot {
  position: relative;
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent, var(--status-loading));
}
.status-dot[data-status]::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--accent, transparent);
  opacity: 0;
}
/* live ping only on operational dots */
.status-dot[data-status="operational"]::after {
  animation: ping 1.4s var(--ease) infinite;
  opacity: 0.6;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 11px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em; /* +5% per the brand label rule */
  text-transform: uppercase;
  /* Darker, AA-compliant text on the tint (raw accent failed WCAG contrast). */
  color: var(--pill-fg, var(--accent));
  background: color-mix(in srgb, var(--accent) 16%, white);
}

/* ---------------------------------------------------------------- Legend */
.legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 26px;
  padding: 0 4px;
  font-size: 12.5px;
  color: var(--ink-70);
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.legend-dot {
  width: 9px;
  height: 9px;
}
.legend-dot::after {
  display: none !important;
}
.legend-note {
  margin-left: auto;
  color: var(--ink-70);
}

/* ---------------------------------------------------------------- Incidents */
.incidents {
  margin-top: 24px;
  padding: 24px 28px;
}
.incidents-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.incidents-sub {
  font-size: 12.5px;
  color: var(--ink-50);
}
.incident-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.incident-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0 2px;
  color: var(--ink-70);
  font-size: 14px;
}
.incident-empty::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--emerald) 18%, white);
}
.incident-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 0;
  border-top: 1px solid var(--grape-100);
}
.incident-item:first-child {
  border-top: 0;
}
.incident-dot {
  margin-top: 5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
  background: var(--accent, var(--status-down));
}
.incident-body {
  min-width: 0;
  flex: 1;
}
.incident-title {
  font-weight: 600;
  color: var(--ink-100);
  font-size: 14px;
}
.incident-badge {
  margin-left: 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--pill-fg, var(--accent));
}
.incident-meta {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--ink-70);
  font-variant-numeric: tabular-nums;
}
.incident-ongoing {
  color: var(--status-down);
  font-weight: 600;
}

/* -------------------------------------------------------------- Skeletons */
.service--skeleton {
  pointer-events: none;
}
.sk {
  display: block;
  border-radius: 6px;
  background: linear-gradient(
    100deg,
    var(--grape-50) 30%,
    var(--grape-100) 50%,
    var(--grape-50) 70%
  );
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}
.sk-title {
  width: 150px;
  height: 15px;
}
.sk-sub {
  width: 210px;
  height: 11px;
  margin-top: 8px;
}
.sk-thumb {
  width: 104px;
  height: 56px;
  border-radius: 10px;
  align-self: center;
}
.sk-spark {
  width: 116px;
  height: 34px;
}
.sk-metric {
  width: 88px;
  height: 22px;
}

/* ----------------------------------------------------------------- Footer */
.site-footer {
  border-top: 1px solid var(--grape-200);
  background: color-mix(in srgb, var(--white) 70%, var(--grape-50));
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-block: 34px;
  text-align: center;
}
.footer-logo {
  display: inline-flex;
  line-height: 0;
}
.footer-logo img {
  height: 26px;
  width: auto;
}
.footer-legal {
  margin: 0;
  color: var(--ink-70);
  font-size: 12.5px;
}

/* --------------------------------------------------------------- Keyframes */
@keyframes ping {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  70%,
  100% {
    transform: scale(2.1);
    opacity: 0;
  }
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}
@keyframes softpulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.is-refreshing .btn-icon {
  animation: spin 0.7s linear infinite;
}

/* Stale state: the status checker is unreachable, so the visible data is the
   last known snapshot — stop the "live" ping and visibly dim the cards so the
   page doesn't contradict the reconnecting notice. */
.is-stale .orb-ping {
  animation: none;
  opacity: 0;
}
.is-stale .status-dot[data-status="operational"]::after {
  animation: none;
  opacity: 0;
}
.is-stale .services {
  opacity: 0.5;
  filter: saturate(0.35);
  transition: opacity var(--dur) var(--ease), filter var(--dur) var(--ease);
}

/* ------------------------------------------------------------- Responsive */
@media (max-width: 640px) {
  .container {
    padding-inline: 18px;
  }
  main.container {
    padding-top: 26px;
  }
  .hero {
    padding: 24px;
  }
  .header-nav {
    display: none; /* hide the CTA on phones to give the title room */
  }
  .page-title {
    font-size: 17px;
  }
  .logo-img {
    height: 24px;
  }
  .service-thumb,
  .sk-thumb {
    width: 84px;
  }
  .service {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  .service-metrics {
    justify-content: space-between;
    border-top: 1px dashed var(--grape-100);
    padding-top: 14px;
  }
  .metric {
    align-items: flex-end;
  }
  .legend-note {
    margin-left: 0;
    flex-basis: 100%;
  }
}

/* ------------------------------------------------------- Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .btn:hover,
  .service:hover {
    transform: none;
  }
}
