/* FARMGOD status page. Look: the 502 page (hero) + the Telegram card headers (tiles). */
@font-face { font-family: "FG Roboto"; font-weight: 100 900; font-display: swap; src: url(assets/roboto-var.woff2) format("woff2"); }

:root {
  /* from 502.html and the Telegram card templates */
  --bg: #000;
  --glow-a: #08161b;
  --glow-b: #030607;
  --head: #d9dadd;
  --text: #a3a3a8;
  --dim: #8e8e93;
  --foot: #7d828a;
  --teal: #006a84;
  --teal-hi: #0a8fb0;
  --line: #3fb6cf;
  --tile: rgba(255, 255, 255, 0.025);
  --tile-border: rgba(255, 255, 255, 0.08);
  --tile-hover: rgba(255, 255, 255, 0.16);
  --divider: #4a4a4f;
  --grid: rgba(255, 255, 255, 0.07);
  --nodata: rgba(255, 255, 255, 0.09);
  --tip-bg: #0b1418;
  --ok: #2fbf63;
  --warn: #f6a23a;
  --bad: #ff4d4f;
  --maint: #6e9fff;
  --ring-track: rgba(10, 143, 176, 0.16);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f3f5f7;
    --glow-a: #dcecf0;
    --glow-b: #eef2f4;
    --head: #15181c;
    --text: #3d4249;
    --dim: #5c626a;
    --foot: #5c626a;
    --teal: #0a7f9c;
    --teal-hi: #0a7f9c;
    --line: #0a7f9c;
    --tile: #ffffff;
    --tile-border: rgba(0, 0, 0, 0.09);
    --tile-hover: rgba(0, 0, 0, 0.2);
    --divider: #b9bdc3;
    --grid: rgba(0, 0, 0, 0.08);
    --nodata: rgba(0, 0, 0, 0.09);
    --tip-bg: #ffffff;
    --ok: #16853f;
    --warn: #a85f00;
    --bad: #cf2a2d;
    --maint: #2f62cc;
    --ring-track: rgba(10, 127, 156, 0.16);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  padding: calc(40px + env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom));
  background: var(--bg) radial-gradient(ellipse 70% 55% at 50% 22%, var(--glow-a) 0%, var(--glow-b) 55%, var(--bg) 100%) fixed;
  color: var(--text);
  font: 15px/1.55 "FG Roboto", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--line); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--teal-hi); outline-offset: 2px; border-radius: 4px; }

/* ------------------------------------------------------------------ hero (the 502 page) */
.sub-link { margin-left: 10px; padding-left: 11px; border-left: 1px solid var(--divider); color: var(--line); text-decoration: none; }
.sub-link:hover { color: var(--head); }
.hero { max-width: 680px; margin: 0 auto; text-align: center; }
.logo { display: block; width: 168px; height: auto; margin: 0 auto; }
.ring {
  --c: var(--ok);
  width: 46px; height: 46px; margin: 46px auto 30px; border-radius: 50%;
  border: 3px solid var(--ring-track); border-top-color: var(--c);
  animation: turn 2.4s linear infinite;
  transition: border-top-color .4s;
}
.kicker {
  font-size: 13px; font-weight: 500; line-height: 1; letter-spacing: 2px; text-transform: uppercase;
  color: var(--dim);
}
.kicker b { font-weight: 500; color: var(--state, var(--dim)); transition: color .4s; }
.kicker span { margin-left: 10px; padding-left: 11px; border-left: 1px solid var(--divider); }
h1 {
  margin: 18px 0 0; color: var(--head);
  font-size: clamp(30px, 7.4vw, 54px); font-weight: 700; line-height: 1.12; letter-spacing: .5px; text-transform: uppercase;
}
.rule { width: min(320px, 62%); height: 3px; margin: 28px auto 22px; background: var(--teal); border-radius: 2px; }
.updated {
  min-height: 18px; font-size: 11px; font-weight: 500; line-height: 18px; letter-spacing: 2px; text-transform: uppercase; color: var(--dim);
}
#updated.stale { color: var(--warn); }
.chip .wide { display: none; }
.chip .narrow { display: inline; }

/* ------------------------------------------------------------------ tiles (Telegram cards) */
.chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 28px auto 0; max-width: 620px; }
.chip, .tile {
  background: var(--tile); border: 1px solid var(--tile-border); border-radius: 14px;
}
.chip { padding: 16px 6px 14px; text-align: center; }
.chip b { display: block; will-change: filter; font-size: clamp(24px, 6.4vw, 38px); font-weight: 700; line-height: 1; color: var(--head); font-variant-numeric: tabular-nums; }
.chip span { display: block; margin-top: 9px; font-size: 11px; font-weight: 600; letter-spacing: 1.6px; text-transform: uppercase; color: var(--dim); }
.chip b.ok { color: var(--ok); } .chip b.warn { color: var(--warn); } .chip b.bad { color: var(--bad); } .chip b.maint { color: var(--maint); }

main { max-width: 860px; margin: 0 auto; }
section { margin-top: 44px; }
.section, .section-row h2 {
  margin: 0 0 14px; font-size: 12px; font-weight: 600; letter-spacing: 2.6px; text-transform: uppercase; color: var(--dim);
}
.section-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-row h2 { margin: 0; }
.stack { display: grid; gap: 12px; }

.seg { display: inline-flex; border: 1px solid var(--tile-border); border-radius: 9px; padding: 2px; background: var(--tile); }
.seg button {
  border: 0; background: none; cursor: pointer; padding: 5px 11px; border-radius: 7px;
  font-size: 11px; font-weight: 600; letter-spacing: 1.6px; text-transform: uppercase; color: var(--dim);
  transition: background-color .2s, color .2s;
}
.seg button[aria-pressed="true"] { background: rgba(10, 143, 176, .2); color: var(--head); }

/* ------------------------------------------------------------------ components */
.comp { padding: 18px 18px 14px; }
.comp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.comp-name { margin: 0; color: var(--head); font-size: 16px; font-weight: 600; line-height: 1.3; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  font-size: 11px; font-weight: 600; letter-spacing: 1.6px; text-transform: uppercase; color: var(--state);
}
.pill i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }
.s-operational { --state: var(--ok); }
.s-degraded, .s-partial { --state: var(--warn); }
.s-down, .s-major { --state: var(--bad); }
.s-maintenance { --state: var(--maint); }
.s-unknown { --state: var(--dim); }

.bars { display: flex; gap: 2px; height: 34px; margin-top: 16px; outline-offset: 4px; touch-action: pan-y; }
.bars span {
  flex: 1 1 0; min-width: 0; border-radius: 2px; background: var(--nodata);
  transform-origin: 50% 100%; transition: opacity .15s, transform .15s;
}
.bars span.ok { background: var(--ok); }
.bars span.warn { background: var(--warn); }
.bars span.bad { background: var(--bad); }
.bars span.maint { background: var(--maint); }
.bars.dense { gap: 1px; }
.bars.dense span { border-radius: 1px; }
@media (min-width: 640px) { .bars.dense { gap: 2px; } }
.bars:hover span, .bars.focus span { opacity: .55; }
.bars span.on { opacity: 1 !important; transform: scaleY(1.12); }
/* The bars build in left to right: one soft-edged mask wipes across each row (one animated element per row,
   not one per bar, so a phone stays smooth), the colours fading in with it. */
.bars.intro, .bars.enter {
  -webkit-mask-image: linear-gradient(90deg, #000 40%, transparent 60%);
  mask-image: linear-gradient(90deg, #000 40%, transparent 60%);
  -webkit-mask-size: 250% 100%;
  mask-size: 250% 100%;
}
.bars.intro { animation: wipe .7s cubic-bezier(.2, .8, .2, 1) both; }
.bars { transition: opacity .12s ease; }
.bars.leave { opacity: 0; }
.bars.enter { animation: wipe .3s ease-out both; }
.chart svg { transition: opacity .12s ease; }
.chart.leave svg { opacity: 0; }
.chart svg.fade { animation: fadeIn .2s ease both; }
.legend {
  display: flex; justify-content: space-between; gap: 8px; margin-top: 8px;
  font-size: 11px; font-weight: 500; letter-spacing: 1.4px; text-transform: uppercase; color: var(--dim);
}
.legend b { font-weight: 600; color: var(--head); }

.lat { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--tile-border); }
.lat-head { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase; color: var(--dim); }
.lat-head b { color: var(--head); font-weight: 600; font-variant-numeric: tabular-nums; }
.chart { position: relative; height: 76px; margin-top: 8px; touch-action: pan-y; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .ylab { fill: var(--dim); font-size: 10px; letter-spacing: .5px; }
.chart .area { fill: url(#fade); }
.chart .ln { fill: none; stroke: var(--line); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .ln.draw { animation: draw var(--dur, 1.1s) ease-out both; }
.chart .band-down { fill: var(--bad); opacity: .28; }
.chart .band-maint { fill: var(--maint); opacity: .22; }
.chart .band-slow { fill: var(--warn); opacity: .22; }
.chart .cross { stroke: var(--dim); stroke-width: 1; }
.chart .dot { fill: var(--line); stroke: var(--bg); stroke-width: 2; }
.chart .empty { fill: var(--dim); font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; }
.xlab { display: flex; justify-content: space-between; margin-top: 4px; padding-right: 46px; font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--dim); }

/* ------------------------------------------------------------------ incidents */
.inc { position: relative; padding: 16px 18px 14px 20px; overflow: hidden; }
.inc::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--state); }
.inc-title { margin: 0; color: var(--head); font-size: 15px; font-weight: 600; line-height: 1.35; }
.inc-meta {
  margin-top: 6px; font-size: 11px; font-weight: 500; letter-spacing: 1.3px; text-transform: uppercase; color: var(--dim);
}
.inc-meta b { color: var(--state); font-weight: 600; }
.updates { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.updates li { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 2px 14px; }
.updates .st { font-size: 11px; font-weight: 600; letter-spacing: 1.3px; text-transform: uppercase; color: var(--head); padding-top: 2px; }
.updates .st time { display: block; margin-top: 2px; font-weight: 500; letter-spacing: .6px; color: var(--dim); text-transform: none; font-size: 12px; }
.updates p { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.inc-none { padding: 18px; text-align: center; font-size: 11px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--dim); }
.more {
  display: block; margin: 14px auto 0; padding: 8px 16px; border: 1px solid var(--tile-border); border-radius: 9px; background: var(--tile);
  cursor: pointer; font-size: 11px; font-weight: 600; letter-spacing: 1.8px; text-transform: uppercase; color: var(--dim);
}
.more:hover { color: var(--head); border-color: var(--tile-hover); }

/* ------------------------------------------------------------------ subscribe + footer */
.subs { display: flex; flex-wrap: wrap; gap: 10px; }
.sub {
  display: inline-flex; align-items: center; gap: 9px; padding: 10px 16px;
  border: 1px solid var(--tile-border); border-radius: 10px; background: var(--tile);
  color: var(--head); text-decoration: none; font-size: 12px; font-weight: 600; letter-spacing: 1.6px; text-transform: uppercase;
  transition: border-color .2s;
}
.sub:hover { border-color: var(--teal-hi); }
.sub svg { width: 16px; height: 16px; fill: var(--line); }
.foot {
  margin: 56px auto 0; text-align: center; font-size: 11px; font-weight: 600; letter-spacing: 2.6px; text-transform: uppercase; color: var(--foot);
}
.noscript { text-align: center; }

/* ------------------------------------------------------------------ tooltip */
.tip {
  position: fixed; z-index: 10; max-width: min(280px, calc(100vw - 32px)); padding: 10px 12px;
  background: var(--tip-bg); border: 1px solid var(--tile-border); border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .35); pointer-events: none;
  font-size: 13px; line-height: 1.45; color: var(--text);
}
.tip .t-date { font-size: 11px; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase; color: var(--dim); }
.tip .t-val { margin-top: 3px; font-size: 18px; font-weight: 700; color: var(--head); font-variant-numeric: tabular-nums; }
.tip .t-row { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.tip .t-row i { width: 10px; height: 2px; border-radius: 1px; background: var(--state); flex: none; }
.tip .t-inc { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--tile-border); color: var(--head); }

/* ------------------------------------------------------------------ motion */
.hero .kicker, .hero h1, .chips { animation: rise .7s cubic-bezier(.2, .8, .2, 1) both; }
.hero h1 { animation-delay: .06s; }
.chips { animation-delay: .14s; }
.hero .rule { animation: widen .8s .1s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes turn { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes widen { from { width: 0; } }
@keyframes grow { from { transform: scaleY(.25); opacity: 0; } }
@keyframes wipe {
  from { -webkit-mask-position: 100% 0; mask-position: 100% 0; opacity: .4; }
  to { -webkit-mask-position: 0 0; mask-position: 0 0; opacity: 1; }
}
@keyframes fadeIn { from { opacity: 0; } }
@keyframes draw { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ------------------------------------------------------------------ wider screens */
@media (min-width: 640px) {
  body { padding-top: calc(48px + env(safe-area-inset-top)); }
  .chip .wide { display: inline; }
  .chip .narrow { display: none; }
  .chips { gap: 22px; }
  .chip { padding: 20px 8px 18px; }
  .chip span { font-size: 12px; letter-spacing: 2px; }
  .comp { padding: 20px 22px 16px; }
  .inc { padding: 18px 22px 16px 24px; }
}
@media (max-width: 560px) {
  .updates li { grid-template-columns: minmax(0, 1fr); }
  .updates .st time { display: inline; margin: 0 0 0 10px; }
}
