:root {
  color-scheme: light dark;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --text: #101828;
  --muted: #667085;
  --faint: #98a2b3;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --blue: #2563eb;
  --blue-soft: #eaf1ff;
  --green: #079455;
  --green-soft: #e9f8f0;
  --amber: #dc6803;
  --amber-soft: #fff5e7;
  --red: #d92d20;
  --red-soft: #fff0ef;
  --purple: #7a5af8;
  --purple-soft: #f1efff;
  --shadow: 0 18px 50px rgba(16, 24, 40, 0.06);
  --radius-lg: 24px;
  --radius-md: 18px;
  --font: "SF Arabic", "Noto Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 280px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 78% -5%, rgba(37, 99, 235, 0.08), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button { font: inherit; }

.skip-link {
  position: fixed;
  inset: 12px auto auto 12px;
  z-index: 100;
  transform: translateY(-160%);
  border-radius: 10px;
  background: var(--text);
  color: var(--surface);
  padding: 10px 14px;
  text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.header-inner,
main,
.footer-inner {
  width: min(100% - 40px, 920px);
  margin-inline: auto;
}

.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
  text-decoration: none;
}

.brand img {
  display: block;
  width: 112px;
  height: auto;
  filter: none;
}

.brand-divider { width: 1px; height: 26px; background: var(--line-strong); }
.brand-section { color: var(--muted); font-size: 15px; font-weight: 650; }

.theme-toggle {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(16, 24, 40, 0.04);
}
.theme-toggle:hover { color: var(--blue); border-color: color-mix(in srgb, var(--blue) 35%, var(--line)); }
.theme-toggle:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 25%, transparent); outline-offset: 2px; }
.theme-toggle svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.moon-icon { display: none; }

main { padding-block: 72px 96px; }

.hero { max-width: 760px; margin-bottom: 52px; }
.eyebrow, .section-kicker {
  color: var(--blue);
  font-size: 14px;
  font-weight: 750;
  letter-spacing: .01em;
}
.eyebrow { display: flex; align-items: center; gap: 9px; }
.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 5px var(--blue-soft);
}

h1, h2, p { margin-top: 0; }
h1 {
  margin: 18px 0 16px;
  font-size: clamp(38px, 7vw, 66px);
  line-height: 1.13;
  letter-spacing: -.045em;
  font-weight: 800;
}
.hero-copy {
  margin-bottom: 26px;
  max-width: 670px;
  color: var(--muted);
  font-size: clamp(17px, 2.5vw, 20px);
  line-height: 1.9;
}

.preview-notice {
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid color-mix(in srgb, var(--blue) 20%, var(--line));
  border-radius: 14px;
  background: var(--blue-soft);
  color: var(--text);
  padding: 12px 14px;
}
.preview-notice[hidden] { display: none; }
.preview-notice svg { width: 21px; flex: 0 0 auto; fill: none; stroke: var(--blue); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.preview-notice div { display: grid; gap: 2px; }
.preview-notice strong { font-size: 14px; }
.preview-notice span { color: var(--muted); font-size: 13px; line-height: 1.55; }

.overall-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  min-height: 126px;
  margin-bottom: 56px;
  border: 1px solid color-mix(in srgb, var(--green) 18%, var(--line));
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--surface), color-mix(in srgb, var(--green-soft) 55%, var(--surface)));
  padding: 26px 28px;
  box-shadow: var(--shadow);
}
.overall-card[data-status="degraded"], .overall-card[data-status="maintenance"] {
  border-color: color-mix(in srgb, var(--amber) 24%, var(--line));
  background: linear-gradient(135deg, var(--surface), color-mix(in srgb, var(--amber-soft) 60%, var(--surface)));
}
.overall-card[data-status="unknown"] {
  border-color: color-mix(in srgb, var(--blue) 22%, var(--line));
  background: linear-gradient(135deg, var(--surface), color-mix(in srgb, var(--blue-soft) 55%, var(--surface)));
}
.overall-card[data-status="partial_outage"], .overall-card[data-status="major_outage"] {
  border-color: color-mix(in srgb, var(--red) 22%, var(--line));
  background: linear-gradient(135deg, var(--surface), color-mix(in srgb, var(--red-soft) 60%, var(--surface)));
}
.overall-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
}
.overall-card[data-status="degraded"] .overall-icon,
.overall-card[data-status="maintenance"] .overall-icon { background: var(--amber-soft); color: var(--amber); }
.overall-card[data-status="unknown"] .overall-icon { background: var(--blue-soft); color: var(--blue); }
.overall-card[data-status="partial_outage"] .overall-icon,
.overall-card[data-status="major_outage"] .overall-icon { background: var(--red-soft); color: var(--red); }
.overall-icon svg { width: 27px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.overall-copy h2 { margin-bottom: 6px; font-size: 22px; letter-spacing: -.02em; }
.overall-copy p { margin-bottom: 0; color: var(--muted); line-height: 1.65; }
.updated-at { min-width: 120px; display: grid; gap: 5px; color: var(--faint); font-size: 12px; text-align: left; }
.updated-at time { color: var(--muted); font-size: 13px; font-weight: 650; }

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 20px;
}
.section-kicker { margin-bottom: 7px; }
.section-heading h2 { margin-bottom: 0; font-size: 26px; letter-spacing: -.025em; }
.auto-refresh { display: inline-flex; align-items: center; gap: 7px; color: var(--faint); font-size: 12px; }
.auto-refresh svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.components {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 10px 35px rgba(16, 24, 40, 0.035);
}
.component-row {
  min-height: 108px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 22px;
}
.component-row + .component-row { border-top: 1px solid var(--line); }
.component-copy h3 { margin: 0 0 6px; font-size: 16px; }
.component-copy p { margin-bottom: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.monitor-meta { display: block; margin-top: 8px; color: var(--faint); font-size: 11px; line-height: 1.55; }
.status-pill { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; color: var(--green); font-size: 13px; font-weight: 750; }
.status-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 12%, transparent); }
.status-pill[data-status="degraded"], .status-pill[data-status="maintenance"] { color: var(--amber); }
.status-pill[data-status="partial_outage"], .status-pill[data-status="major_outage"] { color: var(--red); }
.status-pill[data-status="unknown"] { color: var(--faint); }

.component-skeleton {
  height: 91px;
  background: linear-gradient(90deg, var(--surface) 15%, var(--surface-subtle) 45%, var(--surface) 75%);
  background-size: 220% 100%;
  animation: shimmer 1.35s linear infinite;
}
.component-skeleton + .component-skeleton { border-top: 1px solid var(--line); }
@keyframes shimmer { to { background-position: -220% 0; } }

.incidents-section, .maintenance-section, .history-section, .subscriptions-section { margin-top: 64px; }
.incidents {
  min-height: 154px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 68%, transparent);
  padding: 28px;
}
.empty-state { text-align: center; }
.empty-state-icon { width: 44px; height: 44px; display: grid; place-items: center; margin: 0 auto 13px; border-radius: 50%; background: var(--green-soft); color: var(--green); }
.empty-state-icon svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.empty-state h3 { margin: 0 0 6px; font-size: 16px; }
.empty-state p { margin-bottom: 0; color: var(--muted); font-size: 13px; }
.incident-card { width: 100%; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); padding: 20px; }
.incident-card + .incident-card { margin-top: 14px; }
.incident-head { display: flex; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.incident-head h3 { margin: 0 0 6px; font-size: 17px; }
.incident-head time { color: var(--faint); font-size: 12px; }
.incident-impact { color: var(--red); font-size: 12px; font-weight: 750; }
.affected-components { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 18px; }
.affected-components span { border: 1px solid var(--line); border-radius: 999px; background: var(--surface-subtle); color: var(--muted); padding: 4px 9px; font-size: 11px; }
.incident-update { position: relative; padding-right: 20px; }
.incident-update + .incident-update { margin-top: 15px; }
.incident-update::before { content: ""; position: absolute; right: 2px; top: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
.incident-update strong { display: inline-block; margin-left: 6px; font-size: 13px; }
.incident-update span { color: var(--faint); font-size: 11px; }
.incident-update p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }

.calendar-link { display: inline-flex; align-items: center; gap: 8px; color: var(--blue); font-size: 12px; font-weight: 700; text-decoration: none; }
.calendar-link svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.calendar-link:focus-visible, .subscription-option:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 25%, transparent); outline-offset: 3px; }
.maintenances { min-height: 154px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); padding: 24px; }
.maintenance-card { width: 100%; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-subtle); padding: 20px; }
.maintenance-card + .maintenance-card { margin-top: 14px; }
.maintenance-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.maintenance-head h3 { margin: 0; font-size: 17px; }
.maintenance-head span { color: var(--blue); font-size: 12px; font-weight: 750; }
.maintenance-head span[data-phase="in_progress"], .maintenance-head span[data-phase="verifying"] { color: var(--amber); }
.maintenance-schedule { margin: 8px 0; color: var(--faint); font-size: 12px; }
.maintenance-message { margin-bottom: 14px; color: var(--muted); font-size: 13px; line-height: 1.75; }
.maintenance-card .affected-components { margin-bottom: 0; }

.history-heading { align-items: end; }
.history-heading > p { max-width: 390px; margin-bottom: 0; color: var(--muted); font-size: 13px; line-height: 1.7; text-align: left; }
.history-board { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); padding: 24px; box-shadow: 0 10px 35px rgba(16, 24, 40, 0.035); }
.history-grid { direction: ltr; display: grid; grid-template-columns: repeat(30, minmax(4px, 1fr)); gap: 5px; }
.history-day { aspect-ratio: 1; min-height: 8px; border-radius: 3px; background: var(--line); }
.history-day[data-status="operational"] { background: var(--green); }
.history-day[data-status="degraded"], .history-day[data-status="maintenance"] { background: var(--amber); }
.history-day[data-status="partial_outage"], .history-day[data-status="major_outage"] { background: var(--red); }
.history-day[data-status="unknown"], .history-day[data-status="no_data"] { background: var(--line-strong); }
.history-legend { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 16px; color: var(--faint); font-size: 11px; }
.history-legend span { display: inline-flex; align-items: center; gap: 6px; }
.history-legend i { width: 8px; height: 8px; border-radius: 2px; background: var(--line-strong); }
.history-legend i[data-status="operational"] { background: var(--green); }
.history-legend i[data-status="degraded"] { background: var(--amber); }
.history-legend i[data-status="major_outage"] { background: var(--red); }
.resolved-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 38px 0 16px; }
.resolved-heading h3 { margin: 0; font-size: 18px; }
.resolved-heading span { color: var(--faint); font-size: 11px; }
.resolved-incidents { min-height: 138px; display: grid; place-items: center; border: 1px dashed var(--line-strong); border-radius: var(--radius-md); background: color-mix(in srgb, var(--surface) 68%, transparent); padding: 24px; }
.resolved-card { width: 100%; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); padding: 20px; }
.resolved-card + .resolved-card { margin-top: 14px; }
.resolved-head { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.resolved-head h4 { margin: 0; font-size: 16px; }
.resolved-head time { color: var(--faint); font-size: 11px; text-align: left; }
.resolved-card > p { margin: 10px 0 14px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.resolved-card .affected-components { margin-bottom: 0; }
.postmortem { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.postmortem summary { color: var(--blue); font-size: 13px; font-weight: 750; cursor: pointer; }
.postmortem p { color: var(--muted); font-size: 13px; line-height: 1.75; }
.postmortem strong { display: block; margin-bottom: 5px; font-size: 12px; }

.subscriptions-section { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 36px; align-items: center; border: 1px solid color-mix(in srgb, var(--blue) 18%, var(--line)); border-radius: var(--radius-lg); background: linear-gradient(135deg, var(--surface), color-mix(in srgb, var(--blue-soft) 48%, var(--surface))); padding: 32px; }
.subscription-copy h2 { margin-bottom: 10px; font-size: 25px; }
.subscription-copy > p:last-child { margin-bottom: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.subscription-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.subscription-option { display: grid; gap: 3px; min-height: 76px; align-content: center; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 14px 16px; text-decoration: none; }
.subscription-option:hover { border-color: color-mix(in srgb, var(--blue) 35%, var(--line)); }
.subscription-option strong { color: var(--text); font-size: 14px; }
.subscription-option span { color: var(--muted); font-size: 11px; }
.subscription-option-disabled { opacity: .6; }
.status-disclaimer { display: flex; gap: 12px; margin-top: 28px; border-radius: 14px; background: var(--surface-subtle); color: var(--muted); padding: 15px 17px; }
.status-disclaimer svg { width: 19px; flex: 0 0 auto; fill: none; stroke: var(--faint); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.status-disclaimer p { margin-bottom: 0; font-size: 12px; line-height: 1.75; }

footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { min-height: 100px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--faint); font-size: 12px; }
.footer-inner a { color: var(--blue); font-weight: 700; text-decoration: none; }
.footer-inner p { margin-bottom: 0; text-align: center; }
.noscript { position: fixed; inset: auto 18px 18px; z-index: 50; border-radius: 12px; background: var(--red); color: white; padding: 12px 16px; text-align: center; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0d14;
    --surface: #111620;
    --surface-subtle: #171d28;
    --text: #f3f6fb;
    --muted: #a9b1bf;
    --faint: #7d8798;
    --line: #252c38;
    --line-strong: #343d4c;
    --blue: #6f9cff;
    --blue-soft: #142345;
    --green: #32d583;
    --green-soft: #102b22;
    --amber: #fdb022;
    --amber-soft: #33250f;
    --red: #f97066;
    --red-soft: #351716;
    --shadow: 0 18px 60px rgba(0,0,0,.2);
  }
  :root:not([data-theme="light"]) .sun-icon { display: none; }
  :root:not([data-theme="light"]) .moon-icon { display: block; }
}

:root[data-theme="dark"] {
  --bg: #0a0d14;
  --surface: #111620;
  --surface-subtle: #171d28;
  --text: #f3f6fb;
  --muted: #a9b1bf;
  --faint: #7d8798;
  --line: #252c38;
  --line-strong: #343d4c;
  --blue: #6f9cff;
  --blue-soft: #142345;
  --green: #32d583;
  --green-soft: #102b22;
  --amber: #fdb022;
  --amber-soft: #33250f;
  --red: #f97066;
  --red-soft: #351716;
  --shadow: 0 18px 60px rgba(0,0,0,.2);
}
:root[data-theme="dark"] .sun-icon { display: none; }
:root[data-theme="dark"] .moon-icon { display: block; }
:root[data-theme="light"] .sun-icon { display: block; }
:root[data-theme="light"] .moon-icon { display: none; }

@media (max-width: 680px) {
  .header-inner, main, .footer-inner { width: min(100% - 28px, 920px); }
  .header-inner { min-height: 68px; }
  .brand img { width: 100px; }
  .brand { gap: 10px; }
  .brand-divider { height: 22px; }
  .brand-section { font-size: 13px; }
  .theme-toggle { width: 40px; height: 40px; }
  main { padding-block: 50px 64px; }
  .hero { margin-bottom: 38px; }
  h1 { margin-top: 14px; font-size: 40px; }
  .hero-copy { font-size: 16px; line-height: 1.85; }
  .preview-notice { width: 100%; align-items: flex-start; }
  .overall-card { grid-template-columns: auto 1fr; gap: 14px; padding: 21px 18px; margin-bottom: 44px; }
  .overall-icon { width: 44px; height: 44px; }
  .overall-copy h2 { font-size: 19px; }
  .overall-copy p { font-size: 13px; }
  .updated-at { grid-column: 2; min-width: 0; display: flex; gap: 7px; text-align: right; }
  .section-heading h2 { font-size: 23px; }
  .auto-refresh { display: none; }
  .component-row { min-height: 108px; align-items: flex-start; gap: 14px; padding: 18px 17px; }
  .component-copy h3 { font-size: 15px; }
  .component-copy p { font-size: 12px; }
  .status-pill { padding-top: 2px; font-size: 11px; }
  .incidents-section, .maintenance-section, .history-section, .subscriptions-section { margin-top: 48px; }
  .incidents, .maintenances, .resolved-incidents { padding: 24px 16px; }
  .incident-head { display: grid; gap: 8px; }
  .maintenance-head, .resolved-head { display: grid; gap: 8px; }
  .history-heading { display: grid; align-items: start; }
  .history-heading > p { max-width: none; text-align: right; }
  .history-board { padding: 19px 16px; }
  .history-grid { grid-template-columns: repeat(15, minmax(5px, 1fr)); gap: 5px; }
  .resolved-heading { align-items: start; }
  .resolved-heading span { text-align: left; }
  .subscriptions-section { grid-template-columns: 1fr; gap: 24px; padding: 26px 20px; }
  .footer-inner { min-height: 132px; flex-direction: column; justify-content: center; gap: 9px; padding-block: 24px; text-align: center; }
}

@media (max-width: 380px) {
  .header-inner, main, .footer-inner { width: min(100% - 22px, 920px); }
  .brand-section, .brand-divider { display: none; }
  h1 { font-size: 35px; }
  .overall-card { grid-template-columns: 1fr; }
  .overall-icon { width: 40px; height: 40px; }
  .updated-at { grid-column: 1; }
  .component-row { display: grid; }
  .status-pill { order: -1; }
  .calendar-link { font-size: 0; }
  .calendar-link svg { width: 20px; }
  .resolved-heading { display: grid; }
  .resolved-heading span { text-align: right; }
  .subscription-options { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
