/* ==========================================================================
   isitdownrightnow.app · "Signal" (v3)
   Answer first, evidence second, help third. One status colour carries meaning;
   everything else stays quiet. Dark by default, full light theme, no framework.
   ========================================================================== */

/* ---------- tokens ---------- */
:root {
  color-scheme: dark;
  --bg: #0a0b0d;
  --surface: #101216;
  --surface-2: #171a20;
  --line: #1f232a;
  --line-2: #2b3039;
  --line-3: #3a404b;
  --text: #ecedf0;
  --text-2: #a3aab6;
  --text-3: #6d7583;
  --accent: #8fb3ff;
  --bar: #2c313b;
  --ok: #3ddc84;   --ok-tint: rgba(61, 220, 132, .12);
  --warn: #f5b941; --warn-tint: rgba(245, 185, 65, .13);
  --bad: #ff6159;  --bad-tint: rgba(255, 97, 89, .13);
  --shadow-pop: 0 18px 50px -12px rgba(0, 0, 0, .6);

  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;
  --fs-answer: clamp(2.375rem, 1.3rem + 3.9vw, 4.25rem);
  --fs-h1: clamp(1.125rem, 1rem + .55vw, 1.375rem);
  --fs-h2: clamp(1.375rem, 1.2rem + .7vw, 1.75rem);
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --maxw: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 64px;

  --st: var(--ok);
  --st-tint: var(--ok-tint);
}
[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f6f3;
  --surface: #ffffff;
  --surface-2: #f0efeb;
  --line: #e5e3de;
  --line-2: #d6d3cc;
  --line-3: #c1bdb4;
  --text: #0d0f12;
  --text-2: #4a515c;
  --text-3: #7a818c;
  --accent: #2f5fe0;
  --bar: #dcd9d2;
  --ok: #0b9c55;   --ok-tint: rgba(11, 156, 85, .10);
  --warn: #b26b00; --warn-tint: rgba(214, 140, 18, .13);
  --bad: #d6302b;  --bad-tint: rgba(214, 48, 43, .10);
  --shadow-pop: 0 18px 50px -14px rgba(20, 22, 26, .22);
}
[data-status="warning"] { --st: var(--warn); --st-tint: var(--warn-tint); }
[data-status="danger"]  { --st: var(--bad);  --st-tint: var(--bad-tint); }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}
img, svg { display: block; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
button { font: inherit; color: inherit; }
::selection { background: color-mix(in srgb, var(--accent) 32%, transparent); color: var(--text); }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 8px;
}
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.ico { flex: none; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 10px; background: var(--text); color: var(--bg); text-decoration: none; font-weight: 600; }
.skip:focus { top: 12px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.hdr { height: var(--header-h); display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 650; font-size: 15.5px; letter-spacing: -.02em; white-space: nowrap; }
.brand-mark { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--text); color: var(--bg); }
.brand b { font-weight: 500; color: var(--text-3); }
.hdr-search { position: relative; flex: 1; max-width: 440px; margin-left: auto; }
.hdr-search > .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.hdr-search input {
  width: 100%; height: 40px; padding: 0 40px 0 38px;
  border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: var(--surface); color: var(--text); font: 400 14.5px var(--font);
  transition: border-color .15s, background .15s;
}
.hdr-search input::placeholder { color: var(--text-3); }
.hdr-search input:focus { outline: none; border-color: var(--line-3); background: var(--surface-2); }
.hdr-search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 500 11.5px var(--mono); color: var(--text-3); border: 1px solid var(--line-2); border-radius: 6px; padding: 2px 6px; }
.hdr-nav { display: flex; align-items: center; gap: 6px; }
.hdr-nav a { color: var(--text-2); text-decoration: none; font-size: 14.5px; padding: 8px 10px; border-radius: 8px; white-space: nowrap; }
.hdr-nav a:hover { color: var(--text); background: var(--surface-2); }
.icon-btn {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center;
  border-radius: var(--r-sm); border: 1px solid var(--line-2); background: transparent;
  color: var(--text-2); cursor: pointer; transition: color .15s, background .15s, border-color .15s;
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); border-color: var(--line-3); }
.theme-dark-only { display: none; }
[data-theme="light"] .theme-dark-only { display: block; }
[data-theme="light"] .theme-light-only { display: none; }
.search-toggle { display: none; }
.results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 50;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-md);
  padding: 6px; box-shadow: var(--shadow-pop); max-height: min(420px, 70vh); overflow: auto;
}
.results[hidden] { display: none; }
.results a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px; color: var(--text); text-decoration: none; font-size: 14.5px; }
.results a:hover, .results a[aria-selected="true"] { background: var(--surface-2); }
.results .r-status { margin-left: auto; font-size: 12.5px; color: var(--text-3); }
.results .r-empty { padding: 14px 12px; color: var(--text-3); font-size: 14px; }

/* ---------- status dots & pills ---------- */
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.dot.warning { background: var(--warn); }
.dot.danger { background: var(--bad); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill.ok { color: var(--ok); background: var(--ok-tint); }
.pill.warning { color: var(--warn); background: var(--warn-tint); }
.pill.danger { color: var(--bad); background: var(--bad-tint); }

/* ---------- breadcrumbs ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 28px 0 16px; padding: 0; list-style: none; font-size: 13.5px; color: var(--text-3); }
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.crumbs .ico { opacity: .55; }

/* ---------- hero: the answer ---------- */
.hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 40px; align-items: center;
  padding: clamp(24px, 4vw, 48px);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: radial-gradient(1000px 440px at 0% 0%, var(--st-tint), transparent 62%), var(--surface);
}
.hero::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, var(--st), transparent 72%); }
.svc { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.svc-logo { width: 44px; height: 44px; flex: none; border-radius: 12px; background: #fff; display: grid; place-items: center; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
.svc-logo img { width: 28px; height: 28px; object-fit: contain; }
.svc-name { font-weight: 600; font-size: 16px; letter-spacing: -.01em; }
.svc-domain { display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); font-size: 14px; text-decoration: none; }
.svc-domain:hover { color: var(--text-2); }
.live { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.live .dot { background: var(--st); animation: ping 2.4s cubic-bezier(.2, .6, .3, 1) infinite; }
@keyframes ping {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--st) 60%, transparent); }
  70%, 100% { box-shadow: 0 0 0 7px transparent; }
}
.hero-q { margin-top: 28px; font-size: var(--fs-h1); font-weight: 500; line-height: 1.35; letter-spacing: -.012em; color: var(--text-2); }
.hero-q span { color: var(--text-3); font-weight: 400; }
.answer { position: relative; margin-top: 6px; padding-left: .5em; font-size: var(--fs-answer); line-height: 1.04; font-weight: 700; letter-spacing: -.045em; color: var(--text); text-wrap: balance; }
.answer-dot { position: absolute; left: .02em; top: .38em; width: .3em; height: .3em; border-radius: 50%; background: var(--st); box-shadow: 0 0 0 .09em var(--st-tint); }
.answer-detail { margin-top: 18px; font-size: clamp(1rem, .95rem + .3vw, 1.1875rem); color: var(--text-2); max-width: 58ch; line-height: 1.55; }
.hero-meta { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13px; color: var(--text-3); }
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-actions { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 10px; }
.hero-shot { width: 340px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface-2); overflow: hidden; box-shadow: var(--shadow-pop); }
.hero-shot-bar { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-bottom: 1px solid var(--line); font: 500 11.5px var(--mono); color: var(--text-3); }
.hero-shot-bar i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-3); }
.hero-shot-bar span { margin-left: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-shot img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; object-position: top; background: var(--surface-2); }
.answer.is-long { font-size: calc(var(--fs-answer) * .8); }
.answer.is-xlong { font-size: calc(var(--fs-answer) * .68); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 20px; border-radius: var(--r-sm); border: 1px solid transparent;
  font: 500 15px/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .12s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { background: color-mix(in srgb, var(--text) 86%, var(--bg)); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line-3); }
.btn[aria-pressed="true"] { color: var(--st); border-color: color-mix(in srgb, var(--st) 45%, transparent); background: var(--st-tint); }

/* ---------- chart + metrics ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.chart-panel { margin-top: 20px; padding: 26px var(--pad) 0; --pad: clamp(18px, 3vw, 30px); }
.panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 24px; }
.panel-title { font-size: 1.0625rem; font-weight: 600; letter-spacing: -.01em; }
.panel-sub { margin-top: 4px; font-size: 14px; color: var(--text-3); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--text-3); }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--bar); }
.legend i.c1 { background: var(--warn); }
.legend i.c2 { background: var(--bad); }
.legend i.base { height: 0; width: 14px; border-radius: 0; background: none; border-top: 1.5px dashed var(--text-3); }
.chart { position: relative; margin: 22px 0 0; padding-left: 40px; }
/* scale labels live in their own left gutter, so they can never cover a bar (the newest data is on the right) */
.chart .ymax, .chart .ymid { position: absolute; left: 0; width: 32px; text-align: right; transform: translateY(-50%); font: 500 11.5px var(--mono); color: var(--text-3); line-height: 1; pointer-events: none; }
.chart .ymax { top: 4%; }
.chart + .axis { padding-left: 40px; }
.chart svg { width: 100%; height: 220px; overflow: visible; }
.chart .b { fill: var(--bar); transition: fill .12s; }
.chart .b.c1 { fill: var(--warn); }
.chart .b.c2 { fill: var(--bad); }
.chart .b.is-hot { fill: var(--text); }
.chart .base { fill: none; stroke: var(--text-3); stroke-width: 1.5; stroke-dasharray: 4 4; stroke-linejoin: round; vector-effect: non-scaling-stroke; opacity: .9; }
.chart .grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.axis { display: flex; justify-content: space-between; margin-top: 10px; font: 500 12px var(--mono); color: var(--text-3); }
.tip {
  position: absolute; z-index: 5; top: 0; pointer-events: none; transform: translate(-50%, calc(-100% - 10px));
  min-width: 148px; padding: 9px 12px; border-radius: 10px; background: var(--text); color: var(--bg);
  font-size: 12.5px; line-height: 1.45; box-shadow: var(--shadow-pop); white-space: nowrap;
}
.tip[hidden] { display: none; }
.tip b { font: 600 15px var(--mono); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 24px calc(-1 * var(--pad)) 0; border-top: 1px solid var(--line); }
.metric { padding: 20px var(--pad) 22px; border-left: 1px solid var(--line); min-width: 0; }
.metric:first-child { border-left: 0; }
.metric-label { font-size: 13px; color: var(--text-3); }
.metric-value { margin-top: 6px; font: 600 1.625rem/1.15 var(--mono); letter-spacing: -.025em; font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric-sub { margin-top: 6px; display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text-2); }
.metric-sub.up { color: var(--bad); }
.metric-sub.down { color: var(--ok); }

/* ---------- jump bar (mobile table of contents) ---------- */
.jump { display: none; gap: 8px; margin: 20px calc(-1 * var(--gutter)) 0; padding: 0 var(--gutter) 4px; overflow-x: auto; scrollbar-width: none; }
.jump::-webkit-scrollbar { display: none; }
.jump a { flex: none; display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-2); text-decoration: none; font-size: 14px; white-space: nowrap; }

/* ---------- page layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 72px; margin-top: 72px; align-items: start; }
.side { position: sticky; top: calc(var(--header-h) + 24px); display: flex; flex-direction: column; gap: 18px;
  max-height: calc(100vh - var(--header-h) - 48px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.others { margin-top: 96px; }
.others-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; margin-top: 26px; align-items: start; }
.links-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 20px; }
.links-grid a { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 14.5px; }
.links-grid a:hover span:last-child { text-decoration: underline; text-underline-offset: 3px; }
.links-grid span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sec { scroll-margin-top: calc(var(--header-h) + 24px); }
.sec + .sec { margin-top: 80px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-3); letter-spacing: .01em; margin-bottom: 12px; }
.sec-title { font-size: var(--fs-h2); font-weight: 650; letter-spacing: -.028em; line-height: 1.2; }
.sec-lead { margin-top: 12px; color: var(--text-2); font-size: 1.0625rem; line-height: 1.7; max-width: 66ch; }
.sec-lead + .sec-lead { margin-top: 10px; }
.sec-lead strong, .prose strong { color: var(--text); font-weight: 600; }

/* incidents */
.inc-list { list-style: none; margin: 26px 0 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.inc { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; padding: 16px 20px; border-top: 1px solid var(--line); }
.inc:first-child { border-top: 0; }
.inc-main { font-size: 15px; font-weight: 500; }
.inc-sub { font-size: 13.5px; color: var(--text-3); }
.inc-peak { text-align: right; font-size: 13px; color: var(--text-2); }
.inc-peak .num { display: block; font-size: 16px; font-weight: 600; color: var(--text); }
.empty { display: flex; gap: 14px; align-items: flex-start; margin-top: 26px; padding: 20px 22px; border: 1px dashed var(--line-2); border-radius: var(--r-md); color: var(--text-2); }
.empty .ico { color: var(--ok); margin-top: 2px; }
.empty b { display: block; color: var(--text); font-weight: 600; margin-bottom: 2px; }

/* fix steps */
.steps { list-style: none; margin: 26px 0 0; padding: 0; counter-reset: step; }
.step { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 18px; padding: 22px 0; border-top: 1px solid var(--line); }
.step:first-child { border-top: 0; padding-top: 6px; }
.step::before {
  counter-increment: step; content: counter(step);
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font: 600 14px var(--mono); color: var(--text); background: var(--surface-2); border: 1px solid var(--line-2);
}
.step h3 { margin-top: 5px; font-size: 1.0625rem; font-weight: 600; letter-spacing: -.01em; }
.step p { margin-top: 6px; color: var(--text-2); line-height: 1.7; }

/* device tabs */
.tabs { margin-top: 26px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.tablist { display: none; gap: 4px; padding: 6px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.js .tablist { display: flex; }
.tab { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--text-2); font-weight: 500; font-size: 14.5px; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { background: var(--surface-2); color: var(--text); }
.tabpanel { padding: 24px; }
.tabpanel + .tabpanel { border-top: 1px solid var(--line); }
.js .tabpanel + .tabpanel { border-top: 0; }
.js .tabpanel[hidden] { display: none; }
.tabpanel h3 { font-size: 1rem; font-weight: 600; margin-bottom: 14px; }
.kv { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px 18px; margin: 0; }
.kv dt { font-size: 13px; font-weight: 600; color: var(--text-3); padding-top: 3px; }
.kv dd { margin: 0; color: var(--text-2); line-height: 1.7; }
.cmds { margin-top: 20px; display: grid; gap: 10px; }
.cmds-label { font-size: 12.5px; font-weight: 600; color: var(--text-3); margin-top: 20px; }
.cmd { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 14px; border-radius: 11px; border: 1px solid var(--line); background: var(--bg); }
.cmd-body { min-width: 0; flex: 1; }
.cmd code { display: block; font: 500 13.5px var(--mono); color: var(--text); overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.cmd small { display: block; margin-top: 3px; font-size: 12.5px; color: var(--text-3); }
.copy { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); cursor: pointer; }
.copy:hover { color: var(--text); border-color: var(--line-3); }
.copy.is-done { color: var(--ok); }

/* long-form copy */
.prose { margin-top: 22px; color: var(--text-2); font-size: 1.0625rem; line-height: 1.75; max-width: 68ch; }
.prose p + p { margin-top: 1.05em; }
.prose h3 { margin: 30px 0 10px; color: var(--text); font-size: 1.125rem; font-weight: 600; letter-spacing: -.01em; }

/* FAQ */
.faq { margin-top: 22px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px 0; cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary h3 { font-size: 1.0625rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.4; }
.faq summary .ico { color: var(--text-3); transition: transform .2s ease; }
.faq details[open] summary .ico { transform: rotate(180deg); }
.faq summary:hover h3 { color: var(--text); }
.faq .ans { padding: 0 44px 24px 0; color: var(--text-2); line-height: 1.75; max-width: 70ch; }

/* methodology note */
.method { padding: 24px 26px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.method .sec-title { font-size: 1.125rem; }
.method p { margin-top: 10px; color: var(--text-2); font-size: 15px; line-height: 1.7; }

/* posts from X */
.posts { margin-top: 24px; display: grid; gap: 12px; }
.post { padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.post-meta a { margin-left: auto; color: var(--text-2); text-decoration: none; }
.post-meta a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.post-head { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.post-head img { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); }
.post-head b { font-weight: 600; }
.post-head span { color: var(--text-3); }
.post p { margin-top: 10px; color: var(--text-2); line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.post-meta { margin-top: 12px; display: flex; gap: 16px; font-size: 12.5px; color: var(--text-3); }

/* ---------- sidebar ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px 20px; }
.card-title { font-size: 13px; font-weight: 600; color: var(--text-3); letter-spacing: .01em; margin-bottom: 10px; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a { display: flex; align-items: center; gap: 10px; margin: 0 -10px; padding: 7px 10px; border-radius: 8px; color: var(--text-2); text-decoration: none; font-size: 14.5px; }
.toc a:hover { color: var(--text); background: var(--surface-2); }
.toc a.is-active { color: var(--text); background: var(--surface-2); box-shadow: inset 2px 0 0 var(--st); }
.channels { list-style: none; margin: 0; padding: 0; }
.channels a { display: flex; align-items: center; gap: 12px; margin: 0 -8px; padding: 10px 8px; border-radius: 9px; text-decoration: none; color: var(--text); }
.channels a:hover { background: var(--surface-2); }
.channels .ico { color: var(--text-3); }
.ch-text { min-width: 0; flex: 1; }
.ch-text b { display: block; font-size: 14.5px; font-weight: 500; }
.ch-text span { display: block; font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channels .go { color: var(--text-3); }
.card-note { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-3); line-height: 1.55; }
.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 9px 16px; margin: 0; font-size: 14px; }
.facts dt { color: var(--text-3); }
.facts dd { margin: 0; color: var(--text); text-align: right; overflow-wrap: anywhere; }
.rel { list-style: none; margin: 0; padding: 0; }
.rel a { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--text); font-size: 14.5px; }
.rel li:first-child a { border-top: 0; padding-top: 2px; }
.rel a:hover .rel-name { text-decoration: underline; text-underline-offset: 3px; }
.rel-name { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rel .num { font-size: 12.5px; color: var(--text-3); }
.card-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 14px; color: var(--text-2); text-decoration: none; }
.card-more:hover { color: var(--text); }

/* ---------- footer ---------- */
.site-footer { margin-top: 112px; border-top: 1px solid var(--line); padding: 44px 0 64px; color: var(--text-3); font-size: 14px; }
.ftr { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.ftr p { max-width: 56ch; line-height: 1.65; margin-top: 12px; }
.ftr-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px 22px; }
.ftr-nav a { color: var(--text-2); text-decoration: none; }
.ftr-nav a:hover { color: var(--text); }
.ftr-copy { margin-top: 28px; font-size: 13px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 64px; margin-top: 56px; }
  .side { position: static; max-height: none; overflow: visible; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .others-grid { grid-template-columns: minmax(0, 1fr); }
  .links-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .side .toc { display: none; }
  .jump { display: flex; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-shot { display: none; }
}
@media (max-width: 760px) {
  :root { --header-h: 58px; }
  .hdr { gap: 10px; }
  .hdr-nav .nav-text { display: none; }
  .hdr-search { display: none; }
  .search-toggle { display: grid; margin-left: auto; }
  .site-header.search-open .hdr-search { display: block; position: absolute; left: var(--gutter); right: var(--gutter); top: calc(100% + 8px); max-width: none; margin: 0; }
  .site-header.search-open .hdr-search input { height: 46px; background: var(--surface-2); box-shadow: var(--shadow-pop); }
  .hdr-search kbd { display: none; }
  .crumbs { margin-top: 18px; }
  .hero { border-radius: 16px; }
  .hero-q { margin-top: 22px; }
  .hero-actions .btn { flex: 1 1 0; padding: 0 12px; font-size: 14.5px; }
  .hero-actions .btn-primary { flex-basis: 100%; }
  .hide-sm { display: none; }
  .chart svg { height: 170px; }
  .chart, .chart + .axis { padding-left: 32px; }
  .chart .ymax, .chart .ymid { width: 26px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:nth-child(3) { border-left: 0; }
  .metric:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .metric-value { font-size: 1.375rem; }
  .side { grid-template-columns: minmax(0, 1fr); }
  .others { margin-top: 72px; }
  .links-grid { grid-template-columns: minmax(0, 1fr); }
  .sec + .sec { margin-top: 64px; }
  .inc { grid-template-columns: minmax(0, 1fr) auto; }
  .inc .pill { grid-column: 1 / -1; justify-self: start; }
  .faq .ans { padding-right: 0; }
  .tabpanel { padding: 20px 18px; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .kv dd + dt { margin-top: 12px; }
  .ftr { grid-template-columns: minmax(0, 1fr); }
  .ftr-nav { justify-content: flex-start; }
}

/* ---------- motion & print ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .hero-actions, .side, .jump, .site-footer, .tabs .tablist { display: none !important; }
  .js .tabpanel[hidden] { display: block !important; }
  body { background: #fff; color: #000; }
}

/* live status-change notice (shown by app.js when the 60s poll sees a new status) */
.status-change { margin-top: 16px; padding: 10px 14px; border-radius: var(--r-sm); background: var(--st-tint); border: 1px solid color-mix(in srgb, var(--st) 35%, transparent); font-size: 14px; color: var(--text); }
.status-change[hidden] { display: none; }
.status-change a { color: var(--text); font-weight: 600; }
.show-sm { display: none; }
@media (max-width: 760px) { .show-sm { display: inline; } }

/* ==========================================================================
   Homepage
   ========================================================================== */
.home-hero { max-width: 860px; margin: 0 auto; padding: clamp(40px, 8vw, 96px) 0 clamp(28px, 4vw, 44px); text-align: center; }
.home-eyebrow { display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 16px; font-size: 13.5px; color: var(--text-3); }
.home-title { margin-top: 22px; font-size: clamp(2.5rem, 1.4rem + 4.6vw, 4.75rem); line-height: 1.02; font-weight: 700; letter-spacing: -.045em; }
.home-lead { margin: 20px auto 0; max-width: 56ch; font-size: clamp(1.0625rem, 1rem + .35vw, 1.25rem); color: var(--text-2); line-height: 1.55; }
.big-search { position: relative; display: flex; align-items: center; gap: 10px; max-width: 640px; margin: 34px auto 0; padding: 7px 7px 7px 18px; border: 1px solid var(--line-2); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-pop); text-align: left; }
.big-search:focus-within { border-color: var(--line-3); }
.big-search > .ico { color: var(--text-3); }
.big-search input { flex: 1; min-width: 0; height: 46px; border: 0; background: transparent; color: var(--text); font: 400 17px var(--font); }
.big-search input::placeholder { color: var(--text-3); }
.big-search input:focus { outline: none; }
.big-search .btn { height: 46px; border-radius: 11px; }
.big-search .results { top: calc(100% + 10px); }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; list-style: none; max-width: 600px; margin: 22px auto 0; padding: 0; }
.chips a { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 13px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--text-2); text-decoration: none; font-size: 14px; }
.chips a:hover { color: var(--text); border-color: var(--line-3); background: var(--surface); }
.summary { padding: 0 var(--pad); --pad: clamp(18px, 3vw, 30px); }
.summary .metrics { margin-top: 0; border-top: 0; }
.metric-name { font-family: var(--font); letter-spacing: -.02em; }
.metric-name a { color: var(--text); text-decoration: none; }
.metric-name a:hover { text-decoration: underline; text-underline-offset: 4px; }
.home-sec { margin-top: 88px; }
.tiles { list-style: none; margin: 26px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tiles-wide { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile { display: flex; flex-direction: column; gap: 14px; height: 100%; padding: 16px 16px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--text); text-decoration: none; transition: border-color .15s, background .15s; }
.tile:hover { border-color: var(--line-3); background: var(--surface-2); }
.tile-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tile-top img { width: 28px; height: 28px; flex: none; border-radius: 8px; background: #fff; object-fit: contain; padding: 3px; }
.tile-top b { min-width: 0; flex: 1; font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spark { width: 100%; height: 28px; }
.spark .s0 { fill: var(--bar); }
.spark .s1 { fill: var(--warn); }
.spark .s2 { fill: var(--bad); }
.tile:hover .spark .s0 { fill: var(--line-3); }
.tile-meta { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2); }
.tile-meta .num { margin-left: auto; color: var(--text-3); font-size: 12.5px; }
.tiles-wide .tile-meta .num { margin-left: 0; color: var(--text); font-size: 13px; font-weight: 600; }
.browse { margin-top: 22px; }
.how { list-style: none; margin: 26px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; counter-reset: how; }
.how li { padding: 22px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.how li::before { counter-increment: how; content: counter(how); display: grid; place-items: center; width: 30px; height: 30px; margin-bottom: 14px; border-radius: 50%; font: 600 13px var(--mono); background: var(--surface-2); border: 1px solid var(--line-2); }
.how b { display: block; font-weight: 600; font-size: 1.0625rem; letter-spacing: -.01em; }
.how span { display: block; margin-top: 8px; color: var(--text-2); line-height: 1.65; }
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .home-hero { text-align: left; padding-top: 32px; }
  .home-eyebrow, .chips { justify-content: flex-start; }
  .chips { margin-left: 0; }
  .home-lead { margin-left: 0; }
  .big-search { margin-left: 0; padding-left: 14px; }
  .big-search .btn { display: none; }
  .tiles, .tiles-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .how { grid-template-columns: minmax(0, 1fr); }
  .home-sec { margin-top: 64px; }
}
@media (max-width: 420px) { .tiles { grid-template-columns: minmax(0, 1fr); } }
