:root {
  --bg: #0f1115;
  --fg: #f4f4f5;
  --muted: #9aa0a6;
  --card: #1a1d24;
  --up: #16a34a;
  --up-soft: #052e16;
  --down: #dc2626;
  --down-soft: #3f0d0d;
  --warn: #d97706;
  --warn-soft: #3a2606;
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* The whole page tints toward the verdict */
body[data-state="up"]   { background: radial-gradient(1200px 600px at 50% -10%, var(--up-soft), var(--bg)); }
body[data-state="down"] { background: radial-gradient(1200px 600px at 50% -10%, var(--down-soft), var(--bg)); }
body[data-state="degraded"] { background: radial-gradient(1200px 600px at 50% -10%, var(--warn-soft), var(--bg)); }

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 20px 60px;
}

.topbar { padding: 8px 0 4px; }
.brand { font-weight: 800; letter-spacing: -0.5px; font-size: 18px; }
.brand .dot { color: var(--muted); font-weight: 600; }

/* ---------- THE BIG TV ---------- */
.tv {
  text-align: center;
  padding: 28px 16px 24px;
}

.question {
  font-size: clamp(16px, 4vw, 20px);
  color: var(--muted);
  margin: 8px 0 0;
}

.verdict {
  font-size: clamp(72px, 22vw, 160px);
  line-height: 0.95;
  margin: 4px 0 8px;
  font-weight: 900;
  letter-spacing: -3px;
}
body[data-state="up"]   .verdict { color: var(--up); }
body[data-state="down"] .verdict { color: var(--down); }
body[data-state="degraded"] .verdict { color: var(--warn); }

.subline {
  font-size: clamp(15px, 3.5vw, 19px);
  color: var(--fg);
  margin: 0 auto 20px;
  max-width: 480px;
}

/* ---------- MASCOT ---------- */
.mascot { line-height: 0; }
.mascot img {
  display: block;
  margin: 0 auto;
  width: clamp(160px, 42vw, 240px);
  height: auto;
  filter: drop-shadow(0 14px 30px rgba(0, 0, 0, .55));
  transition: filter .3s;
}
body[data-state="up"] .mascot img { filter: drop-shadow(0 0 26px rgba(34, 197, 94, .45)); }
body[data-state="degraded"] .mascot img { filter: drop-shadow(0 0 26px rgba(217, 119, 6, .45)); }
body[data-state="down"] .mascot img {
  filter: drop-shadow(0 0 26px rgba(220, 38, 38, .5));
  animation: glitch 0.9s infinite steps(2);
}

@keyframes glitch {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-2px, 1px); }
  50%  { transform: translate(2px, -1px); }
  75%  { transform: translate(-1px, -1px); }
  100% { transform: translate(0, 0); }
}

/* ---------- SMASH BUTTON ---------- */
.smash {
  appearance: none;
  border: none;
  background: none;
  cursor: pointer;
  padding: 4px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: transform .05s ease, filter .1s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.smash img {
  width: clamp(110px, 30vw, 150px);
  height: auto;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.5));
  pointer-events: none;
}
.smash:hover { filter: brightness(1.08); }
.smash:active { transform: translateY(4px) scale(.95); }
/* lit glow that matches the active button color */
body[data-state="up"]   .smash img { filter: drop-shadow(0 0 18px rgba(132, 204, 22, .65)); }
body[data-state="down"] .smash img { filter: drop-shadow(0 0 18px rgba(220, 38, 38, .65)); }
.smash-label {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .5px;
  color: var(--fg);
  text-transform: uppercase;
}
.smash.pop { animation: pop .25s ease; }
@keyframes pop { 50% { transform: scale(1.08); } }

.quote {
  min-height: 1.4em;
  margin: 16px auto 6px;
  max-width: 460px;
  font-style: italic;
  color: var(--fg);
  opacity: 0;
  transition: opacity .2s;
}
.quote.show { opacity: 1; }

.counter { color: var(--muted); font-size: 14px; margin-top: 18px; }

/* ---------- SPLIT-FLAP ODOMETER ---------- */
.odometer {
  display: inline-flex;
  gap: 2px;
  vertical-align: middle;
  perspective: 240px;
}
.odometer .cell {
  display: inline-block;
  min-width: 0.72em;
  text-align: center;
  font-weight: 800;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
  background: #000;
  border-radius: 4px;
  padding: 3px 2px;
  margin: 0 1px;
  box-shadow: inset 0 0 0 1px #2c2f37, 0 1px 2px rgba(0,0,0,.6);
  /* faux split-flap seam */
  background-image: linear-gradient(transparent 49%, rgba(0,0,0,.55) 49%, rgba(0,0,0,.55) 51%, transparent 51%);
  backface-visibility: hidden;
}
.odometer .comma {
  background: none;
  box-shadow: none;
  color: var(--muted);
  min-width: 0.28em;
  padding: 3px 0;
}
.odometer .cell.flipping { animation: flap .26s ease-in-out; }
@keyframes flap {
  0%   { transform: rotateX(0deg); }
  50%  { transform: rotateX(88deg); }
  100% { transform: rotateX(0deg); }
}

/* ---------- SECTIONS ---------- */
.signup, .components {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  margin: 22px 0;
}
.signup { text-align: center; }
.signup h2, .components h2 { margin: 0 0 6px; font-size: 20px; }
.signup p { color: var(--muted); margin: 0 0 16px; }

.finehint { font-size: 12px; color: var(--muted); margin-top: 10px; }

/* ---------- BREVO FORM (dark-theme overrides) ---------- */
.signup .sib-form { padding: 0; background: transparent !important; }
.signup .sib-form-container { max-width: 440px; margin: 0 auto; }
.signup #sib-container {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  max-width: none !important;
}
/* email field + button on one row, wrapping on mobile */
.signup #sib-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: flex-start;
}
.signup .sib-input { flex: 1 1 220px; padding: 0 !important; margin: 0 !important; }
.signup .form__entry, .signup .entry_block, .signup .form__label-row { margin: 0 !important; padding: 0 !important; }
.signup .sib-form .input,
.signup #sib-form input.input {
  box-sizing: border-box !important;
  width: 100%;
  height: 48px !important;
  padding: 0 14px !important;
  border-radius: 10px !important;
  border: 1px solid #2c2f37 !important;
  background: #0f1115 !important;
  color: var(--fg) !important;
  font-size: 15px !important;
  font-family: inherit !important;
  box-shadow: none !important;
}
.signup .sib-form .input::placeholder { color: var(--muted) !important; }
.signup .sib-form-block { padding: 0 !important; }
.signup .sib-form-block__button {
  box-sizing: border-box !important;
  height: 48px !important;
  padding: 0 22px !important;
  border: none !important;
  border-radius: 10px !important;
  cursor: pointer;
  background: #84cc16 !important;
  color: #0f1115 !important;
  font-weight: 800 !important;
  font-size: 15px !important;
  font-family: inherit !important;
  white-space: nowrap;
  transition: filter .12s ease;
}
.signup .sib-form-block__button:hover { filter: brightness(1.08); }
/* GDPR consent row — full width, sits on its own line below email+button */
.signup .sib-optin { flex-basis: 100%; padding: 0 !important; margin: 4px 0 0 !important; }
.signup .entry_mcq { margin: 0 !important; padding: 0 !important; }
.signup .consent-label {
  display: flex; align-items: flex-start; gap: 8px;
  text-align: left; cursor: pointer;
}
.signup .consent-label input[type="checkbox"] {
  width: 16px; height: 16px; margin: 1px 0 0; flex: 0 0 auto;
  accent-color: #84cc16; cursor: pointer;
}
.signup .consent-text { font-size: 12px; color: var(--muted); line-height: 1.45; }
.signup .consent-text a { color: #84cc16; }
/* field-level error text */
.signup .entry__error {
  flex-basis: 100%;
  margin-top: 6px !important;
  padding: 8px 10px !important;
  font-family: inherit !important;
  font-size: 13px !important;
}
/* success / error notification panels */
.signup .sib-form-message-panel {
  max-width: 440px !important;
  margin: 0 auto 14px !important;
  border-radius: 10px !important;
  font-family: inherit !important;
  font-size: 14px !important;
}

/* component list */
#components { list-style: none; margin: 0; padding: 0; }
#components li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 4px; border-bottom: 1px solid #24272f; font-size: 15px;
}
#components li:last-child { border-bottom: none; }
.pill { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; text-transform: capitalize; }
.pill.operational { background: var(--up-soft); color: #4ade80; }
.pill.degraded_performance, .pill.partial_outage { background: var(--warn-soft); color: #fbbf24; }
.pill.major_outage { background: var(--down-soft); color: #f87171; }

/* ---------- LEGAL / CONTENT PAGES ---------- */
.brand { text-decoration: none; color: var(--fg); }
.legal { max-width: 720px; }
.legal h1 { font-size: clamp(28px, 7vw, 40px); margin: 18px 0 4px; }
.legal h2 { font-size: 19px; margin: 28px 0 6px; }
.legal p, .legal li { color: #cbd2da; line-height: 1.6; font-size: 15px; }
.legal ul { padding-left: 20px; }
.legal li { margin: 8px 0; }
.legal a { color: #fff; }
.legal-updated { color: var(--muted); font-size: 13px; margin-top: 0; }

/* ---------- CONTEXTUAL BACKUP TOOLS (outage only) ---------- */
.alternatives {
  display: none; /* hidden when the product is up — keeps the calm view clean */
  background: var(--card);
  border: 1px solid var(--warn);
  border-radius: var(--radius);
  padding: 24px;
  margin: 22px 0;
  text-align: center;
}
body[data-state="down"] .alternatives,
body[data-state="degraded"] .alternatives { display: block; }
.alternatives h2 { margin: 0 0 6px; font-size: 20px; }
.alternatives > p { color: var(--muted); margin: 0 auto; max-width: 440px; }
.alt-list {
  list-style: none;
  margin: 16px auto 0;
  padding: 0;
  display: grid;
  gap: 8px;
  max-width: 440px;
}
.alt-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #0f1115;
  border-radius: 10px;
}
.alt-list a { color: var(--fg); font-weight: 700; text-decoration: none; }
.alt-list a:hover { text-decoration: underline; }
.alt-list span { color: var(--muted); font-size: 13px; }
.alt-disclaimer { color: var(--muted); font-size: 12px; margin-top: 14px; }

/* ---------- COMPANION TOOLS (always visible — pairs WITH the product, not a substitute) ---------- */
/* Deliberately separate from .alternatives: these are not outage fallbacks, so they
   show in the calm "up" view too. Kept quieter than .alternatives so the backup-tools
   slot stays the credible centrepiece. */
.companions {
  margin: 28px auto 0;
  max-width: 440px;
  text-align: center;
}
.companions h2 { margin: 0 0 4px; font-size: 16px; color: var(--muted); font-weight: 700; }
.companions > p { color: var(--muted); font-size: 13px; margin: 0 auto 12px; }
/* reuses .alt-list markup for consistent row styling */
.companions .alt-list { margin-top: 0; }

/* ---------- FAQ ---------- */
.faq {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  margin: 22px 0;
}
.faq h2 { margin: 0 0 8px; font-size: 20px; }
.faq details { border-bottom: 1px solid #24272f; padding: 14px 0; }
.faq details:last-child { border-bottom: none; padding-bottom: 0; }
.faq summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 700; font-size: 18px; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 10px 0 2px; }

/* ---------- SUPPORT / DONATE ---------- */
.support-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  margin: 22px 0;
  text-align: center;
}
.donate {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  transition: transform .08s ease, filter .15s ease;
}
.donate img {
  width: clamp(130px, 34vw, 170px);
  height: auto;
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, .5));
}
.donate:hover { transform: translateY(-3px); }
.donate:hover img { filter: drop-shadow(0 0 22px rgba(132, 204, 22, .5)); }
.donate-btn {
  background: #84cc16;
  color: #0f1115;
  font-weight: 800;
  font-size: 16px;
  padding: 12px 26px;
  border-radius: 999px;
  box-shadow: 0 4px 0 #4d7c0f, 0 8px 18px rgba(0,0,0,.4);
}
.donate:active .donate-btn { transform: translateY(2px); box-shadow: 0 2px 0 #4d7c0f; }
.support-copy {
  color: var(--muted);
  font-size: 14px;
  max-width: 420px;
  margin: 16px auto 0;
}

/* ---------- FOOTER ---------- */
.foot { color: var(--muted); font-size: 13px; text-align: center; margin-top: 24px; }
.foot p { margin: 6px 0; }
.foot a { color: var(--fg); }
.foot-main { font-size: 14px; color: var(--fg); }
.foot-legal { font-size: 12px; opacity: .65; }
