/* Status page styles — mobile-first, --salon-* tokens only. */

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

/* Follows the visitor's system theme (tokens.css holds both palettes). */
:root { color-scheme: light dark; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--salon-bg);
  color: var(--salon-text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a {
  color: var(--salon-accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }
a:focus-visible { outline: none; box-shadow: var(--salon-focus-ring); border-radius: 4px; }

/* ── Brand bar ───────────────────────────────────────────── */

.brand-bar {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--salon-border);
}

.brand-bar__home {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.brand-bar__logo { width: 104px; }

/* The logo's <picture> wrapper must not change the layout. */
picture { display: contents; }

.brand-bar__kicker {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--salon-muted);
}

/* ── Layout ──────────────────────────────────────────────── */

.page {
  flex: 1 0 auto;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

@media (min-width: 768px) {
  .brand-bar { padding: 20px 32px; }
  .page { padding: 56px 32px 64px; }
}

.page-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.page-header h1 {
  margin: 0;
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.page-header .subtitle {
  margin: 0;
  color: var(--salon-muted);
  font-size: 1rem;
}

@media (min-width: 768px) {
  .page-header h1 { font-size: 2.25rem; }
}

.nav-crumb {
  font-size: 0.9rem;
  margin: -12px 0 8px;
}

.nav-crumb a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 500;
}

/* ── Overall banner ──────────────────────────────────────── */

.banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  border: 1px solid var(--salon-border);
  border-radius: 12px;
  margin-bottom: 24px;
  background: var(--salon-card);
}

.banner .dot {
  width: 14px;
  height: 14px;
  margin-top: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.banner .title {
  font-size: 1.1rem;
  font-weight: 600;
}

.banner .detail {
  color: var(--salon-muted);
  font-size: 0.9rem;
  margin-top: 2px;
}

.banner--ok           { background: var(--salon-success-tint);   border-color: color-mix(in srgb, var(--salon-success) 35%, transparent); }
.banner--ok .dot      { background: var(--salon-success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--salon-success) 20%, transparent); }
.banner--degraded     { background: var(--salon-warning-tint);   border-color: color-mix(in srgb, var(--salon-warning) 35%, transparent); }
.banner--degraded .dot{ background: var(--salon-warning); box-shadow: 0 0 0 4px color-mix(in srgb, var(--salon-warning) 20%, transparent); }
.banner--down         { background: var(--salon-danger-tint);    border-color: color-mix(in srgb, var(--salon-danger) 35%, transparent); }
.banner--down .dot    { background: var(--salon-danger); box-shadow: 0 0 0 4px color-mix(in srgb, var(--salon-danger) 20%, transparent); }
.banner--unconfigured { background: var(--salon-accent-tint);    border-color: var(--salon-accent-border); }
.banner--unconfigured .dot { background: var(--salon-accent); box-shadow: 0 0 0 4px var(--salon-accent-glow); }

/* Expired data. Deliberately NOT a status color: the page is not
   claiming the services are bad, it is refusing to claim anything. A
   muted dot inside an amber border reads as "no signal", where a red
   banner would read as a live outage that had actually been observed.
   Uses the plain card background rather than --salon-surface: the theme's
   surface is green-tinted, which put this banner within a shade of the
   healthy one — the exact confusion it exists to prevent. */
.banner--stale        { background: var(--salon-card); border-color: color-mix(in srgb, var(--salon-warning) 55%, transparent); }
.banner--stale .dot   { background: var(--salon-muted); box-shadow: 0 0 0 4px color-mix(in srgb, var(--salon-muted) 20%, transparent); }

/* ── Freshness notice (sits above the banner) ────────────── */

.stale-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 12px;
  border: 1px solid color-mix(in srgb, var(--salon-warning) 40%, transparent);
  border-left: 3px solid var(--salon-warning);
  border-radius: 10px;
  background: var(--salon-warning-tint);
}

.stale-notice__badge {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--salon-warning);
  /* Ink derived from the badge's own background rather than from a theme
     text token. The badge is amber in both themes, so its contrast
     partner must be too — --salon-text-inverse is white, which lands
     around 2:1 on amber, and --salon-text flips with the theme. */
  color: color-mix(in srgb, var(--salon-warning) 22%, black);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.6;
}

.stale-notice__headline { font-weight: 600; font-size: 0.95rem; }
.stale-notice__detail   { color: var(--salon-muted); font-size: 0.85rem; margin-top: 2px; }

/* Expired is the same shape, turned up — it is the state where the page
   has stopped vouching for its own contents. */
.stale-notice--expired { border-color: var(--salon-warning); }

/* Desaturate the service rows once the snapshot has expired. A column of
   green dots is the most persuasive thing on the page; it must not keep
   reading as live once we can no longer stand behind it. */
.sections--untrusted {
  filter: grayscale(0.85);
  opacity: 0.65;
}

/* ── Sections (Twilio-style: header + rollup status + row list) ─ */

.section {
  margin-top: 28px;
  background: var(--salon-card);
  border: 1px solid var(--salon-border);
  border-radius: 12px;
  overflow: hidden;
}

.section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--salon-border);
  background: var(--salon-surface);
}

.section__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.section__status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 500;
}

.section__status .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* Section-level rollup dot colors; tie the header to the worst state
   among its members so a yellow/red bar draws the eye. */
.section--ok       .section__status .dot { background: var(--salon-success); }
.section--degraded .section__status .dot { background: var(--salon-warning); }
.section--partial  .section__status .dot { background: var(--salon-warning); }
.section--down     .section__status .dot { background: var(--salon-danger); }

/* Colored left-edge accent for trouble sections — skim-readable. */
.section--degraded { border-left: 3px solid var(--salon-warning); }
.section--partial  { border-left: 3px solid var(--salon-warning); }
.section--down     { border-left: 3px solid var(--salon-danger); }

/* ── Service rows (one per service, grouped under a section) ─── */

.section__services {
  display: flex;
  flex-direction: column;
}

.service-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid var(--salon-border);
  flex-wrap: wrap;
}

.service-row:first-child { border-top: none; }

/* Wide enough for a service name; when name and status don't both fit,
   the status drops to its own line rather than squeezing the name. */
.service-row__main {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex: 1 1 12rem;
}

.service-row__label {
  font-weight: 500;
}

.service-row__meta {
  font-size: 0.78rem;
  color: var(--salon-muted);
  flex-shrink: 0;
}

.service-row__status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.service-row__status .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.service-row--ok       .service-row__status .dot { background: var(--salon-success); }
.service-row--degraded .service-row__status .dot { background: var(--salon-warning); }
.service-row--down     .service-row__status .dot { background: var(--salon-danger); }

/* Inline per-check detail, shown only when a check has failed. Full
   width below the row so it can list multiple deps cleanly. */
.service-row .checks {
  width: 100%;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--salon-border);
  font-size: 0.8rem;
  color: var(--salon-muted);
}

.service-row .checks .check-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}


/* ── Uptime history ──────────────────────────────────────── */

.uptime__range {
  color: var(--salon-muted);
  font-size: 0.85rem;
}

.uptime__range--full { display: none; }

.uptime__rows {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 16px 18px 4px;
}

.uptime-row__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}

.uptime-row__label { font-weight: 600; }

.uptime-row__pct { font-size: 0.85rem; color: var(--salon-muted); }

.uptime-bar {
  display: flex;
  gap: 2px;
  height: 32px;
}

.uptime-day {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 2px;
  background: var(--salon-surface);
}

.uptime-day--ok    { background: var(--salon-success); }
.uptime-day--minor { background: var(--salon-warning); }
.uptime-day--major { background: var(--salon-danger); }

/* Small screens show the most recent 30 days; 90 slivers would be too thin
   to read. */
.uptime-day--older { display: none; }

.uptime__note {
  padding: 12px 18px 16px;
  color: var(--salon-muted);
  font-size: 0.85rem;
}

@media (min-width: 768px) {
  .uptime-day--older { display: block; }
  .uptime-bar { gap: 1px; }
  .uptime__range--recent { display: none; }
  .uptime__range--full { display: inline; }
}

/* Status words. The status hues are bright, which reads well on the dark
   theme; on the light theme the text takes a darker mix of the same hue. */
.section--ok .section__status-label,
.service-row--ok .service-row__status-label,
.uptime-row__pct--ok        { color: var(--salon-success); }
.section--degraded .section__status-label,
.section--partial .section__status-label,
.service-row--degraded .service-row__status-label,
.uptime-row__pct--minor     { color: var(--salon-warning); }
.section--down .section__status-label,
.service-row--down .service-row__status-label,
.uptime-row__pct--major,
.service-row .checks .check-row.failed { color: var(--salon-danger); }

@media (prefers-color-scheme: light) {
  .section--ok .section__status-label,
  .service-row--ok .service-row__status-label,
  .uptime-row__pct--ok        { color: color-mix(in srgb, var(--salon-success) 55%, black); }
  .section--degraded .section__status-label,
  .section--partial .section__status-label,
  .service-row--degraded .service-row__status-label,
  .uptime-row__pct--minor     { color: color-mix(in srgb, var(--salon-warning) 55%, black); }
  .section--down .section__status-label,
  .service-row--down .service-row__status-label,
  .uptime-row__pct--major,
  .service-row .checks .check-row.failed { color: color-mix(in srgb, var(--salon-danger) 75%, black); }
}

/* ── Page notes ──────────────────────────────────────────── */

.foot {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--salon-border);
  font-size: 0.85rem;
  color: var(--salon-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.foot code {
  background: var(--salon-surface);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}

/* ── Loading / error / empty states ──────────────────────── */

.state {
  text-align: center;
  padding: 48px 16px;
  color: var(--salon-muted);
}

.state.error {
  background: var(--salon-danger-tint);
  border: 1px solid color-mix(in srgb, var(--salon-danger) 35%, transparent);
  border-radius: 10px;
  color: var(--salon-text);
}

/* ── Landing page (index.html) ───────────────────────────── */

.landing-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 24px;
}

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

.landing-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  background: var(--salon-card);
  border: 1px solid var(--salon-border);
  border-radius: 12px;
  padding: 24px;
  color: inherit;
}

.landing-card:hover {
  border-color: var(--salon-accent-border);
  text-decoration: none;
  transform: translateY(-1px);
  transition: transform 120ms ease, border-color 120ms ease;
}

.landing-card h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
}

.landing-card p {
  margin: 0;
  color: var(--salon-muted);
  font-size: 0.9rem;
}

/* One-line verdict on each card. */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 4px 12px 4px 10px;
  border-radius: 999px;
  background: var(--salon-surface);
  color: var(--salon-muted);
  font-size: 0.8125rem;
  font-weight: 600;
}

.pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.pill--ok           { background: var(--salon-success-tint); color: var(--salon-success); }
.pill--degraded,
.pill--partial      { background: var(--salon-warning-tint); color: var(--salon-warning); }
.pill--down         { background: var(--salon-danger-tint);  color: var(--salon-danger); }
@media (prefers-color-scheme: light) {
  .pill--ok           { background: var(--salon-success-tint); color: color-mix(in srgb, var(--salon-success) 55%, black); }
  .pill--degraded,
  .pill--partial      { background: var(--salon-warning-tint); color: color-mix(in srgb, var(--salon-warning) 55%, black); }
  .pill--down         { background: var(--salon-danger-tint);  color: color-mix(in srgb, var(--salon-danger) 75%, black); }
}
.pill--unconfigured { background: var(--salon-accent-tint);  color: var(--salon-accent); }

/* ── Site footer (same as elovarra.com) ──────────────────── */

.site-foot {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 26px 20px 48px;
  border-top: 1px solid var(--salon-border);
  text-align: center;
  font-size: 0.8rem;
  color: var(--salon-muted);
}

.site-foot__name {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--salon-accent);
}

.site-foot__legal {
  margin: 10px 0 0;
  color: var(--salon-text);
  line-height: 1.65;
}

.site-foot__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 18px;
  margin: 16px auto 0;
  max-width: 620px;
  font-size: 0.78rem;
  font-weight: 600;
}

.site-foot__links--legal {
  margin-top: 8px;
  font-weight: 500;
}

.site-foot__links > * {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}

.site-foot a { color: var(--salon-muted); }

.site-foot a:hover,
.site-foot a:focus-visible,
.site-foot a[aria-current="page"] { color: var(--salon-accent); }

/* On a phone the rows wrap, and a dot left at a line end looks broken:
   spacing alone separates the links until there is room for dots. */
.site-foot__sep {
  display: none;
  color: var(--salon-border);
}

@media (min-width: 768px) {
  .site-foot { padding: 26px 32px 64px; }
}

@media (min-width: 1024px) {
  .site-foot__links { gap: 4px 10px; }
  .site-foot__sep { display: inline-flex; }
}
