/*
 * Tokens copied from how-platform packages/config/themes.ts (DEFAULT_LIGHT / DEFAULT_DARK, the
 * `wedding` brand). That file is the source of truth; if the palette changes there, change it here.
 *
 * The look follows the homepage, not a generic status page: pastel icon tiles (accent pink,
 * primary lavender, warning yellow), bordered cards at an 18px radius, solid lavender blocks with
 * dark text. Status colours are the familiar ones — green working, amber a blip, red down —
 * taken from the app's success/warning/destructive tokens, never the brand violet as text.
 */
@font-face {
  font-family: 'Graphie';
  src: url('https://houseofweddings.ai/fonts/graphie-regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Graphie';
  src: url('https://houseofweddings.ai/fonts/graphie-semibold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

:root {
  --background: #ffffff;
  --foreground: #0a0a0a;
  --card: #ffffff;
  --muted: #f5f5f5;
  --muted-foreground: #6b6b6b;
  --primary: #c79fff;
  --success-strong: #166534; /* successStrong — text on the green tint, 7:1 */
  --success-tint: #dcfce7;
  --accent: #ffd8e9;
  --warning: #ffdf9a;
  --warning-strong: #854d0e;
  --destructive: #e7000b;
  --destructive-strong: #991b1b;
  --destructive-foreground: #ffffff;
  --banner-down: #fca5a5;
  --border: #e5e5e5;
  --ring: #9563e8;
  /* Day bars: a soft green that sits with the pastel tiles, the same in both modes (the app's
     dark-mode successStrong). It is under 3:1 on white on purpose, like the review stars: a
     working day carries no information of its own — the uptime figure, the tooltip and the
     screen-reader summary say it — and the days that matter are the amber and red ones. */
  --bar-up: #4ade80;
  --bar-none: #ececec;
  --bar-degraded: #d97706;
  --radius: 1.125rem;
  --radius-sm: 0.75rem;
  color-scheme: light;
}

/* Light is the default; dark only when the visitor picks it (the toggle in the header). */
/* One step lighter than the app's #0a0a0a dark palette: on a page that is mostly empty
   background, near-black read as a hole. Each surface keeps the same step above the one below. */
:root[data-theme='dark'] {
  --background: #171717;
  --foreground: #fafafa;
  --card: #212121;
  --muted: #2e2e2e;
  --muted-foreground: #a1a1a1;
  --success-strong: #4ade80; /* successStrong, dark */
  --success-tint: #16301f;
  --warning-strong: #fcd34d;
  --destructive: #ff6467;
  --destructive-strong: #fca5a5;
  --destructive-foreground: #450a0a;
  --border: #333333;
  --ring: #c79fff;
  --bar-up: #4ade80;
  --bar-none: #363636;
  --bar-degraded: #fbbf24;
  color-scheme: dark;
}

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

html {
  font-family: 'Graphie', ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  line-height: 1.5;
}

a {
  color: inherit;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 6px;
}

svg.i {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wrap {
  max-width: 50rem;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ── Header ───────────────────────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 4.5rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  text-decoration: none;
}
.brand svg {
  height: 1.75rem;
  width: auto;
  color: var(--foreground);
}
.brand-label {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  padding-left: 0.875rem;
  border-left: 1px solid var(--border);
}
.lang {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.lang button,
.theme-toggle {
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  background: none;
  border: 0;
  color: var(--muted-foreground);
  height: 2rem;
  min-width: 2rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  cursor: pointer;
}
.lang button:hover,
.theme-toggle:hover {
  color: var(--foreground);
}
.lang button[aria-pressed='true'] {
  background: var(--muted);
  color: var(--foreground);
}
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin-left: 0.25rem;
  background: var(--muted);
}
.theme-toggle svg {
  width: 1rem;
  height: 1rem;
}
:root[data-theme='dark'] .icon-moon,
:root:not([data-theme='dark']) .icon-sun {
  display: none;
}

/* ── Hero ─────────────────────────────────────────────── */
.hero {
  padding: 3.5rem 0 2.5rem;
  text-align: center;
}
.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
h1,
h2 {
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
}
h1 {
  font-size: clamp(2.125rem, 6vw, 3.25rem);
}
.intro {
  margin: 0.875rem auto 0;
  max-width: 38rem;
  color: var(--muted-foreground);
}
h2 {
  font-size: 1.5rem;
}

/* A solid block like the homepage's: pink when all is well (softer than the lavender), yellow
   while something is being looked into or is slow, red only when a service is unreachable. */
.overall {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 2.25rem;
  padding: 1.25rem 1.5rem;
  border-radius: 1.5rem;
  background: var(--muted);
  color: var(--foreground);
  text-align: left;
}
.overall[data-state='up'] {
  background: var(--accent);
  color: #0a0a0a;
}
.overall[data-state='degraded'] {
  background: var(--warning);
  color: #0a0a0a;
}
/* A pastel red (the app's dark-mode destructiveStrong), the same in both modes, so it reads as
   "down" without shouting.
   Dark text on it; the red that carries the meaning is the icon's (destructiveStrong). */
.overall[data-state='down'] {
  background: var(--banner-down);
  color: #0a0a0a;
}
.overall[data-state='down'] .overall-icon {
  color: #991b1b;
}
.overall-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  background: #ffffff;
  color: #0a0a0a;
}
.overall[data-state='loading'] .overall-icon,
.overall[data-state='unknown'] .overall-icon {
  background: var(--card);
  color: var(--muted-foreground);
}
.overall strong {
  display: block;
  font-size: 1.125rem;
  font-weight: 600;
}
.overall .meta {
  font-size: 0.875rem;
  opacity: 0.75;
}

/* ── Services ─────────────────────────────────────────── */
section {
  padding: 1.5rem 0;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
section > h2 {
  margin-bottom: 1.25rem;
}
.services {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}
.service {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}
.service-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}
/* The homepage feature cards' icon tile, one pastel per service. */
.tile {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #0a0a0a;
}
.tile[data-tone='pink'] {
  background: var(--accent);
}
.tile[data-tone='yellow'] {
  background: var(--warning);
}
.tile[data-tone='mint'] {
  background: #68fdc7; /* pro-collective primary */
}
.service-title {
  flex: 1;
  min-width: 0;
}
.service-name {
  font-weight: 600;
}
.service-stats {
  display: flex;
  gap: 0.125rem 1rem;
  flex-wrap: wrap;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}
.badge {
  flex: none;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: var(--success-tint);
  color: var(--success-strong);
}
.badge[data-state='degraded'] {
  background: var(--warning);
  color: #0a0a0a;
}
.badge[data-state='down'] {
  background: color-mix(in srgb, var(--destructive) 12%, transparent);
  color: var(--destructive-strong);
}

.bars {
  display: flex;
  gap: 3px;
  height: 2.25rem;
  margin-top: 1.25rem;
}
.bar {
  flex: 1;
  min-width: 0;
  border-radius: 999px;
  background: var(--bar-none);
}
.bar[data-state='up'] {
  background: var(--bar-up);
}
/* Not the warning token: #ffdf9a is 1.3:1 on white, so a short blip would vanish. This amber
   clears the 3:1 a meaningful graphic needs; the palette has no token for it. */
.bar[data-state='degraded'] {
  background: var(--bar-degraded);
}
.bar[data-state='down'] {
  background: var(--destructive);
}
.bar:hover {
  opacity: 0.7;
}
.bars-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-top: 0.5rem;
}

.tip {
  position: fixed;
  z-index: 10;
  pointer-events: none;
  background: var(--foreground);
  color: var(--background);
  font-size: 0.75rem;
  padding: 0.375rem 0.625rem;
  border-radius: 999px;
  white-space: nowrap;
  transform: translate(-50%, calc(-100% - 8px));
}

/* ── Incidents ────────────────────────────────────────── */
.incidents {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.incident {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.125rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}
.incident .tile {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.625rem;
  background: var(--muted);
  color: var(--muted-foreground);
}
.incident[data-open='true'] .tile {
  background: color-mix(in srgb, var(--destructive) 12%, transparent);
  color: var(--destructive-strong);
}
.incident svg.i {
  width: 1.125rem;
  height: 1.125rem;
}
.incident-body {
  flex: 1;
  min-width: 0;
  padding-top: 0.25rem;
}
.incident-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 0.625rem;
}
.incident-title {
  font-weight: 600;
  text-decoration: none;
}
/* One pill per phase. Only "resolved" is lavender: everything before it is still in progress. */
.phase {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.125rem 0.625rem;
  border-radius: 999px;
  background: var(--warning);
  color: #0a0a0a;
}
.phase[data-phase='resolved'] {
  background: var(--success-tint);
  color: var(--success-strong);
}
.phase[data-phase='update'] {
  background: var(--muted);
  color: var(--foreground);
}
.incident-update {
  margin: 0.375rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.55;
}
.incident-title:hover {
  text-decoration: underline;
}
.incident-meta {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  margin-top: 0.375rem;
}
.preview-note {
  margin: 1.5rem 0 0;
  padding: 0.625rem 1rem;
  border-radius: 999px;
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: center;
}
.empty {
  color: var(--muted-foreground);
  padding: 1.5rem;
  text-align: center;
  border-radius: var(--radius);
  background: var(--muted);
}

/* ── Footer ───────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 2.5rem;
  padding: 1.5rem 0 3rem;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.skeleton {
  background: var(--muted);
  border-radius: var(--radius);
  height: 9rem;
}
@media (prefers-reduced-motion: no-preference) {
  .skeleton {
    animation: fade 1.2s ease-in-out infinite alternate;
  }
}
@keyframes fade {
  to {
    opacity: 0.5;
  }
}

@media (max-width: 40rem) {
  .brand-label {
    display: none;
  }
  .hero {
    padding-top: 2.5rem;
  }
  .service {
    padding: 1.125rem;
  }
  .bars {
    gap: 2px;
  }
  .bar {
    border-radius: 2px;
  }
}
