/* Estado dos portais públicos. Fonts are kept with the site (SIL Open Font License, see the
   OFL files next to them); nothing is loaded from other domains. */
@font-face { font-family: "Hanken Grotesk"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/hanken-grotesk-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap; src: url("../fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2"); }

:root {
  --bg: #F3F4F1;
  --surface: #FFFFFF;
  --surface-2: #E9ECE6;
  --ink: #14213A;
  --muted: #4D5869;
  --line: #CDD3CB;
  --accent: #1D5E8C;
  --ok: #1E7044;
  --warn: #8A5300;
  --err: #B0281B;
  --none: #5E6775;
  --bar: #2F7A55;
  --bar-slow: #9A6200;
  --bar-fail: #B0281B;
  --focus: #1D5E8C;
  --demo-bg: #FFF1D6;
  --demo-line: #B87A12;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1626; --surface: #152035; --surface-2: #1B2840; --ink: #E9EDF2; --muted: #A9B4C4; --line: #2B3B57;
    --accent: #8CC4EE; --ok: #79D3A0; --warn: #F2C066; --err: #FF9A8D; --none: #A9B4C4;
    --bar: #5FBF8B; --bar-slow: #E8B04B; --bar-fail: #FF8B7C; --focus: #8CC4EE; --demo-bg: #3A2E14; --demo-line: #E8B04B;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1626; --surface: #152035; --surface-2: #1B2840; --ink: #E9EDF2; --muted: #A9B4C4; --line: #2B3B57;
  --accent: #8CC4EE; --ok: #79D3A0; --warn: #F2C066; --err: #FF9A8D; --none: #A9B4C4;
  --bar: #5FBF8B; --bar-slow: #E8B04B; --bar-fail: #FF8B7C; --focus: #8CC4EE; --demo-bg: #3A2E14; --demo-line: #E8B04B;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1rem/1.55 "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; overflow-wrap: break-word;
}
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.01em; }
a { color: var(--accent); }
code, .mono { font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace; font-size: .86rem; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px; z-index: 10; text-decoration: none; font-weight: 600; }
.skip:focus { top: 12px; }

/* header */
.top { border-bottom: 1px solid var(--line); background: var(--surface-2); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; padding-bottom: 6px; flex-wrap: wrap; }
.brand { margin: 0; display: inline-flex; align-items: center; gap: 10px; font-weight: 650; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: url("../img/icon.svg") center / cover no-repeat; flex: none; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
button, select, input { font: inherit; color: inherit; }
select { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-height: 44px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: transparent; cursor: pointer; font-weight: 600; }
.btn:hover, select:hover { border-color: var(--muted); }
.btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn[aria-pressed="true"]::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin-right: 8px; }
.intro { padding-top: 16px; padding-bottom: 24px; }
.intro h1 { font-size: clamp(2rem, 4.6vw, 3.2rem); margin: 0 0 12px; font-weight: 750; }
.lead { font-size: 1.08rem; max-width: 72ch; margin: 0 0 14px; }
.notice { margin: 8px 0 0; padding: 10px 14px; border-radius: var(--radius); max-width: 80ch; font-size: .95rem; }
.notice-independent { border: 1px solid var(--line); background: var(--surface); }
.notice-demo { border: 2px dashed var(--demo-line); background: var(--demo-bg); font-weight: 600; }
.notice-label { font-weight: 750; text-transform: uppercase; letter-spacing: .05em; font-size: .78rem; margin-right: 6px; }

main { padding: 26px 0 56px; }
main:focus { outline: none; }
main h2 { font-size: 1.5rem; margin: 0 0 10px; }

/* overview */
.overview { display: grid; gap: 10px; margin-bottom: 22px; }
.summary { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.summary li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 600; }
.summary .count { font-variant-numeric: tabular-nums; }
.updated, .every { margin: 0; color: var(--muted); }
.stale { margin: 0; padding: 10px 14px; border: 2px solid var(--warn); border-radius: var(--radius); background: var(--surface); font-weight: 600; }
.window { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 14px 10px; margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 6px 18px; background: var(--surface); max-width: max-content; }
.window legend { font-weight: 650; padding: 0 4px; }
.window label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.window input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }

/* state shapes and badges */
.shape { width: 16px; height: 16px; flex: none; }
.state-up { --c: var(--ok); }
.state-slow { --c: var(--warn); }
.state-error, .state-timeout, .state-network { --c: var(--err); }
.state-blocked, .state-none { --c: var(--none); }
.shape { color: var(--c, var(--none)); }
.badge { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 4px 12px 4px 10px; border-radius: 999px; border: 2px solid var(--c); font-weight: 700; font-size: .92rem; background: var(--surface); white-space: nowrap; }
.badge.state-slow { border-style: dashed; }
.badge.state-error, .badge.state-timeout, .badge.state-network { border-width: 3px; }
.badge.state-blocked, .badge.state-none { border-style: dotted; font-weight: 600; }

/* service cards */
.services { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.svc { background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--c, var(--line)); border-radius: var(--radius); padding: 14px 16px 16px; min-width: 0; }
.svc article { display: grid; gap: 10px; }
.svc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.svc h3 { margin: 0; font-size: 1.2rem; }
.svc-desc { margin: 0; color: var(--muted); }
.svc-url { margin: 0; font-size: .92rem; overflow-wrap: anywhere; }
.figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.figures div { background: var(--surface-2); border-radius: 8px; padding: 6px 10px; min-width: 0; }
.figures dt { font-size: .8rem; color: var(--muted); }
.figures dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.figures dd small { display: block; font-weight: 500; color: var(--muted); font-size: .8rem; }
.robots-note { margin: 0; font-size: .92rem; }

/* chart */
.chart { margin: 0; }
.chart-top { display: flex; justify-content: space-between; gap: 8px; font-size: .8rem; color: var(--muted); }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 64px; padding-bottom: 12px; border-bottom: 1px solid var(--line); position: relative; }
.bar { flex: 1 1 0; min-width: 0; position: relative; border-radius: 2px 2px 0 0; background: var(--bar); }
.bar.is-slow { background: repeating-linear-gradient(135deg, var(--bar-slow) 0 3px, transparent 3px 5px); border: 1px solid var(--bar-slow); }
.bar.is-fail { background: repeating-linear-gradient(45deg, var(--bar-fail) 0 2px, transparent 2px 4px); border: 1px solid var(--bar-fail); }
.bar.is-fail::after { content: ""; position: absolute; left: 50%; bottom: -12px; width: 9px; height: 8px; transform: translateX(-50%); background: var(--bar-fail); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.bar.is-empty { background: none; border-bottom: 2px dotted var(--line); height: 2px !important; }
.chart-axis { display: flex; justify-content: space-between; gap: 8px; font-size: .8rem; color: var(--muted); margin-top: 4px; }

/* failures */
.episodes h4 { margin: 0 0 4px; font-size: .95rem; }
.episodes ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.episodes li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 8px; align-items: start; font-size: .92rem; }
.episodes li .shape { margin-top: 3px; }
.episodes p { margin: 0; font-size: .92rem; color: var(--muted); }

/* legend and explanation */
.legend-box, .how { margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--line); }
.legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; margin: 0; }
.legend div { min-width: 0; }
.legend dt { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.legend dd { margin: 2px 0 0 26px; color: var(--muted); }
.how p { max-width: 78ch; margin: 0 0 10px; }
.how code { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); overflow-wrap: anywhere; word-break: break-all; }

.foot { border-top: 1px solid var(--line); padding: 20px 0 80px; color: var(--muted); font-size: .9rem; }
.foot p { margin: 0 0 6px; max-width: 80ch; }

@media (max-width: 900px) {
  .services { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .wrap { padding: 0 14px; }
  .figures { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .figures div:last-child { grid-column: 1 / -1; }
  .legend { grid-template-columns: minmax(0, 1fr); }
  .bars { gap: 1px; }
}
@media print {
  .toolbar, .skip, .window { display: none; }
}
