/*
  ──────────────────────────────────────────────────────────────────────
   Répondia

   Copyright (c) 2026 Répondia SAS
   Fabio Palumbo x Nicolas Patron

   Proprietary and confidential. All rights reserved.
   This file is the property of Répondia SAS (RCS Nice 983 585 290).
   Reproduction, distribution or use, in whole or in part, without the
   prior written consent of Répondia SAS is strictly forbidden.

   SPDX-License-Identifier: LicenseRef-Repondia-Proprietary
  ──────────────────────────────────────────────────────────────────────
*/
/* Same tokens and font as the webapp and legal.repondia.com. Violet is the brand accent only;
   green, amber and red belong to service state and appear nowhere else. */

@font-face {
  font-family: "Geist";
  src: url("/fonts/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #f4f5f8;
  --surface: #ffffff;
  --ink: #17181c;
  --ink-soft: #545866;
  --ink-mute: #676c7a;
  --line: #e5e7ee;
  --line-soft: #eef0f4;
  --accent: #7c5ce0;
  --up: #2c9a6b;
  --warn: #d0922a;
  --down: #d1495b;
  --none: #e2e4ea;
  --state: var(--up);
  --radius: 14px;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121316;
    --surface: #1b1c20;
    --ink: #f2f3f7;
    --ink-soft: #b3b6c2;
    --ink-mute: #858a98;
    --line: #2a2c33;
    --line-soft: #222429;
    --accent: #9b82ec;
    --up: #3db382;
    --warn: #e2a645;
    --down: #e5677a;
    --none: #2c2e35;
  }
}

body[data-overall="partial_outage"] { --state: var(--warn); }
body[data-overall="major_outage"] { --state: var(--down); }

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

html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--line) transparent; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.55 var(--sans);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
a:focus-visible, button:focus-visible, .bars:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap { width: 100%; max-width: 780px; margin: 0 auto; padding-inline: 20px; }

/* Top bar */
.topbar {
  border-bottom: 1px solid var(--line);
}
.topbar-in { height: 64px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; text-decoration: none; }
.logo { height: 24px; width: auto; aspect-ratio: 677 / 156; color: var(--ink); display: block; }
.site-link {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 13.5px; font-weight: 500; text-decoration: none;
  transition: border-color .2s, transform .2s;
}
.site-link svg { width: 14px; height: 14px; color: var(--ink-mute); }
.site-link:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.site-link:active { transform: translateY(1px); }

main { flex: 1; padding-top: 44px; padding-bottom: 72px; }

/* Summary */
.summary {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 26px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.summary-mark {
  width: 48px; height: 48px; border-radius: 13px;
  display: grid; place-items: center;
  color: var(--state);
  background: color-mix(in srgb, var(--state) 12%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--state) 22%, transparent);
}
.summary-mark svg { width: 24px; height: 24px; grid-area: 1 / 1; }
.mark-bad { display: none; }
body[data-overall$="outage"] .mark-ok { display: none; }
body[data-overall$="outage"] .mark-bad { display: block; }
body[data-state="loading"] .summary-mark svg { visibility: hidden; }

h1 { margin: 0; font-size: 25px; line-height: 1.2; font-weight: 600; letter-spacing: -0.025em; }
.summary-text p { margin: 4px 0 0; color: var(--ink-soft); }

.updated {
  margin: 0; display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ink-mute); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.live { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--state); }

.stale {
  margin: 14px 0 0; padding: 10px 14px; border-radius: 10px;
  font-size: 13.5px; color: var(--ink-soft);
  background: color-mix(in srgb, var(--warn) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--warn) 28%, var(--line));
}

/* The 90-day facts, said once, in a sentence, under a hairline inside the summary */
.facts {
  grid-column: 1 / -1; margin: 4px 0 0; padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  font-size: 14px; color: var(--ink-soft); font-variant-numeric: tabular-nums;
}
.facts strong { color: var(--ink); font-weight: 600; }

/* Panels */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.panel { margin-top: 20px; }
.summary + .panel, .stale + .panel { margin-top: 28px; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 28px 0;
}
h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.legend { display: flex; gap: 14px; margin: 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--ink-mute); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.sw-up { background: var(--up); }
.sw-warn { background: var(--warn); }
.sw-down { background: var(--down); }
.sw-none { background: var(--none); }

.services { list-style: none; margin: 0; padding: 6px 0 4px; }
.service { padding: 20px 28px 18px; }
.service + .service { border-top: 1px solid var(--line-soft); }
.svc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.svc-name { margin: 0; font-size: 15px; font-weight: 550; letter-spacing: -0.01em; }
.svc-desc { margin: 1px 0 0; font-size: 13px; color: var(--ink-mute); }
.pill {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 8px; border-radius: 999px;
  font-size: 12.5px; font-weight: 550;
  color: var(--c); background: color-mix(in srgb, var(--c) 11%, var(--surface));
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill[data-s="up"], .pill[data-s="resolved"] { --c: var(--up); }
.pill[data-s="down"] { --c: var(--down); }
.pill[data-s="paused"], .pill[data-s="unknown"] { --c: var(--ink-mute); }

/* Uptime bars */
.bars {
  display: grid;
  grid-template-columns: repeat(90, 1fr);
  gap: 3px;
  height: 34px;
  cursor: default;
}
.bar {
  border-radius: 2.5px;
  background: var(--b, var(--none));
  transform-origin: bottom;
  transition: opacity .15s, transform .15s;
}
.bar[data-l="up"] { --b: var(--up); }
.bar[data-l="warn"] { --b: var(--warn); }
.bar[data-l="down"] { --b: var(--down); }
.bars:hover .bar { opacity: .55; }
.bars:hover .bar:hover, .bar.is-active { opacity: 1; transform: scaleY(1.08); }
.bars-foot {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 9px; font-size: 12px; color: var(--ink-mute); font-variant-numeric: tabular-nums;
}
.bars-foot strong { font-weight: 550; color: var(--ink-soft); }
.span-30 { display: none; }

@media (prefers-reduced-motion: no-preference) {
  body[data-state="ready"] .bars.is-new .bar {
    animation: rise .5s cubic-bezier(.16, 1, .3, 1) both;
    animation-delay: calc(var(--i) * 4ms);
  }
  .live::after {
    content: ""; position: absolute; inset: -4px; border-radius: 50%;
    border: 1.5px solid var(--state); opacity: 0;
    animation: ping 2.4s cubic-bezier(.16, 1, .3, 1) infinite;
  }
}
@keyframes rise { from { transform: scaleY(.3); } }
@keyframes ping { 0% { transform: scale(.6); opacity: .7; } 70%, 100% { transform: scale(1.6); opacity: 0; } }

/* Incidents */
.incidents { list-style: none; margin: 0; padding: 8px 0 10px; }
.incident { display: grid; grid-template-columns: 52px 1fr auto; align-items: start; gap: 16px; padding: 14px 28px; }
.incident .pill { margin-top: 1px; }
.incident + .incident { border-top: 1px solid var(--line-soft); }
.inc-date { text-align: center; line-height: 1.1; padding-top: 2px; }
.inc-day { display: block; font-size: 20px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.inc-mon { display: block; font-size: 11.5px; color: var(--ink-mute); text-transform: capitalize; }
.inc-title { margin: 0; font-weight: 550; font-size: 14.5px; }
.inc-meta { margin: 2px 0 0; font-size: 13px; color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.empty { padding: 18px 28px 22px; margin: 0; color: var(--ink-mute); font-size: 14px; }

/* Error */
.error { padding: 24px 28px; margin-top: 20px; }
.error p { margin: 6px 0 16px; color: var(--ink-soft); }
.error button {
  font: 500 14px var(--sans); color: var(--surface); background: var(--ink);
  border: 0; border-radius: 999px; padding: 9px 18px; cursor: pointer;
}
.error button:active { transform: translateY(1px); }

/* Tooltip */
.tip {
  position: fixed; z-index: 20; pointer-events: none;
  min-width: 150px; padding: 9px 12px; border-radius: 10px;
  background: var(--ink); color: var(--bg);
  font-size: 12.5px; line-height: 1.4; font-variant-numeric: tabular-nums;
  box-shadow: 0 10px 30px -10px rgb(0 0 0 / .35);
  transform: translate(-50%, calc(-100% - 10px));
}
.tip b { display: block; font-weight: 600; }
.tip span { opacity: .75; }

/* Skeleton */
.skel { display: inline-block; background: var(--line-soft); border-radius: 6px; vertical-align: middle; }
.skel-line { height: .9em; }
.skel-bars { background: repeating-linear-gradient(90deg, var(--line-soft) 0 calc((100% - 267px) / 90), transparent 0 calc((100% - 267px) / 90 + 3px)); border-radius: 3px; }
@media (prefers-reduced-motion: no-preference) {
  .is-skel, .skel { animation: breathe 1.6s ease-in-out infinite; }
}
@keyframes breathe { 50% { opacity: .55; } }

/* Footer */
.foot { border-top: 1px solid var(--line); }
.foot-in { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-top: 22px; padding-bottom: 26px; }
.foot-note { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 13px; color: var(--ink-mute); max-width: 52ch; }
.foot-note img { flex-shrink: 0; }
.foot-links { display: flex; gap: 18px; font-size: 13px; }
.foot-links a { color: var(--ink-soft); text-decoration: none; }
.foot-links a:hover { color: var(--accent); }

/* Phones: last 30 days only, stacked header */
@media (max-width: 640px) {
  main { padding-top: 24px; }
  .summary { grid-template-columns: auto 1fr; padding: 20px; gap: 14px; }
  .summary-mark { width: 42px; height: 42px; }
  .updated { grid-column: 1 / -1; }
  h1 { font-size: 21px; }
  .facts { padding-top: 14px; }
  .panel-head { padding: 16px 18px 0; }
  .legend { display: none; }
  .service { padding: 18px; }
  .incident { padding: 12px 18px; }
  .empty { padding: 14px 18px 18px; }
  .bars { grid-template-columns: repeat(30, 1fr); height: 30px; }
  .bar:nth-child(-n+60) { display: none; }
  .span-90 { display: none; }
  .span-30 { display: inline; }
  .foot-in { flex-direction: column; align-items: flex-start; }
}
