:root {
  /* canvas / surface / text roles */
  --canvas: #0d0d0f;
  --surface: #161618;
  --ink: #f5f5f5;
  --muted: #9a9a9a;
  --line: #2a2a2e;
  /* status (red) — used only for the offline state */
  --status: #e02424;
  --status-ink: #ff4242;
  --status-tint: #2a1212;
  --focus: #ff4242;

  /* type scale (hook / bridge / detail) */
  --fs-title: clamp(24px, 6vw, 34px);
  --fs-strong: clamp(15px, 3.6vw, 18px);
  --fs-soft: 14px;
  --fs-clock: clamp(24px, 6vw, 32px);
  --fs-label: 13px;
}

@media (prefers-color-scheme: light) {
  :root {
    --canvas: #f4f4f3;
    --surface: #ffffff;
    --ink: #111111;
    --muted: #6a6a6a;
    --line: #e2e2e0;
    --status: #d61f1f;
    --status-ink: #c01818;
    --status-tint: #fbeaea;
    --focus: #c01818;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: "IBM Plex Sans Arabic", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- stage / card ---------- */
.stage {
  flex: 1;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 32px);
  padding-top: max(clamp(16px, 4vw, 32px), env(safe-area-inset-top));
  padding-bottom: max(clamp(16px, 4vw, 32px), env(safe-area-inset-bottom));
  min-height: 0;
}

.card {
  background: var(--surface);
  border: 2px solid var(--status);
  max-width: min(520px, 92vw);
  width: 100%;
  text-align: center;
  padding: 0;
  overflow: hidden;
  animation: card-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- red/black banner of rectangles ---------- */
.banner {
  display: flex;
  align-items: stretch;
  background: var(--status);
  color: #fff;
}
.banner-bar {
  width: 14px;
  background: #000;
  opacity: 0.85;
}
.banner-bar:nth-child(2) { opacity: 0.6; }
.banner-bar:nth-child(3) { opacity: 0.4; }
.banner-label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 18px;
  font-weight: 700;
  letter-spacing: 1px;
  font-size: var(--fs-label);
  text-transform: uppercase;
  text-transform: none; /* keep Arabic natural */
}
.banner-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #fff;
  animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

/* ---------- body block ---------- */
.title {
  font-size: var(--fs-title);
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.25;
  padding: clamp(24px, 5vw, 32px) 24px 0;
  color: var(--status-ink);
}

.line {
  padding: 0 28px;
  line-height: 1.7;
}
.line-strong {
  font-size: var(--fs-strong);
  font-weight: 600;
  margin-top: 18px;
  border-inline-start: 4px solid var(--status);
  text-align: start;
  background: var(--status-tint);
  padding: 14px 18px;
  margin-inline: 24px;
}
.line-soft {
  font-size: var(--fs-soft);
  color: var(--muted);
  margin-top: 18px;
}

/* reconnect hint (from audit: no return signal) */
.line-status {
  font-size: var(--fs-label);
  color: var(--muted);
  margin-top: 14px;
  margin-bottom: 26px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.line-status::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--status);
  animation: blink 1.6s ease-in-out infinite;
}

/* ---------- clock rectangle ---------- */
.clock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border-top: 2px solid var(--line);
  background: var(--canvas);
  padding: 16px;
}
.clock-time {
  font-size: var(--fs-clock);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
  color: var(--status-ink);
}
.clock-date { font-size: 13px; color: var(--muted); }

/* ---------- footer ---------- */
.foot {
  text-align: center;
  padding: 14px 12px;
  font-size: 12px;
  color: var(--muted);
  border-top: 2px solid var(--line);
  background: var(--canvas);
}
.foot-link {
  color: var(--status-ink);
  font-weight: 700;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.foot-link:hover { opacity: 0.8; }
.foot-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
  .card { animation: none; }
}

@media (max-height: 560px) {
  .title { padding-top: 20px; }
  .line-strong { margin-top: 12px; }
  .line-soft { margin-top: 12px; }
  .line-status { margin-top: 10px; margin-bottom: 16px; }
  .foot { padding: 6px; }
}

@media (max-width: 480px) {
  .card { border-width: 2px; }
  .banner-label { font-size: 12px; }
}
