/* SPBWATER24 — статическая посадочная страница «Уровень воды в Санкт-Петербурге».
   Оформление повторяет дизайн приложения: тёмная «стеклянная» тема на синем
   градиенте, шрифт Manrope, акценты cyan/green, скруглённые glass-карточки и
   pill-статусы. Без сборки и зависимостей; быстрый, индексируемый первый экран. */

:root {
  color-scheme: dark;

  --page: #0a1426;
  --blue-900: #102c74;
  --blue-700: #1746b8;
  --blue-500: #2e7af2;
  --cyan: #37d0ff;
  --green: #34e0a1;
  --amber: #ffbf3d;
  --orange: #ff9f45;
  --red: #ff5a5a;

  /* Текстовые тона (имена сохранены, чтобы переиспользовать в разметке). */
  --ink: rgba(255, 255, 255, 0.95);
  --ink-soft: rgba(255, 255, 255, 0.74);
  --ink-faint: rgba(255, 255, 255, 0.52);

  --line: rgba(255, 255, 255, 0.14);
  --glass: rgba(255, 255, 255, 0.10);
  --glass-strong: rgba(255, 255, 255, 0.16);
  --card: var(--glass);

  --shadow: 0 18px 48px rgba(0, 18, 78, 0.34);
  --shadow-soft: 0 10px 30px rgba(0, 18, 78, 0.28);

  --radius: 24px;
  --radius-sm: 18px;
  --pill: 999px;
  --maxw: 940px;

  --font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background:
    radial-gradient(120% 70% at 50% -8%, rgba(106, 190, 255, 0.55), transparent 52%),
    linear-gradient(180deg, #1c64e6 0%, #2f7cf0 30%, #1d56cf 64%, #102c74 100%);
  background-attachment: fixed;
  background-color: var(--blue-700);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Мягкие «амбиентные» подсветки приложения, без лишней разметки. */
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: 0;
  pointer-events: none;
  border-radius: var(--pill);
  filter: blur(8px);
}
body::before {
  top: -120px; left: 50%; width: 460px; height: 460px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.22), transparent);
}
body::after {
  right: -180px; top: 38%; width: 360px; height: 360px;
  background: radial-gradient(closest-side, rgba(55, 208, 255, 0.20), transparent);
}

main, .site-header, .site-footer { position: relative; z-index: 1; }

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0 0 .5em; color: #fff; font-weight: 800; line-height: 1.12; letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 1.05rem + 1.7vw, 2.05rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

.section { padding: 40px 0; }
.section__lead { color: var(--ink-soft); max-width: 72ch; font-size: 1.04rem; }

.eyebrow {
  display: inline-block; margin-bottom: .55em;
  color: var(--cyan); font-size: .72rem; font-weight: 800;
  letter-spacing: .14em; text-transform: uppercase;
}

/* ---------- Glass primitive ---------- */
.card,
.answer,
.summary,
.faq details,
.source-list li {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
  box-shadow: var(--shadow), inset 1px 1px 0 rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(16px) saturate(165%);
  -webkit-backdrop-filter: blur(16px) saturate(165%);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(8, 20, 46, 0.55);
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}
.site-header__row { display: flex; align-items: center; gap: 18px; height: 62px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 1.02rem; letter-spacing: .04em; }
.brand:hover { text-decoration: none; }
.brand img { width: 26px; height: 26px; display: block; }
.brand b { color: var(--cyan); font-weight: 800; }
.site-nav { margin-left: auto; display: flex; gap: 22px; }
.site-nav a { color: rgba(255, 255, 255, 0.72); font-weight: 700; font-size: .92rem; }
.site-nav a:hover { color: #fff; text-decoration: none; }
@media (max-width: 760px) { .site-nav { display: none; } }

/* ---------- Hero ---------- */
.hero { padding: 52px 0 36px; }
.hero h1 {
  font-size: clamp(2rem, 1.2rem + 3.4vw, 3.1rem);
  text-shadow: 0 2px 22px rgba(0, 26, 80, 0.45);
  margin-bottom: .35em;
}
.hero__sub { color: rgba(255, 255, 255, 0.82); max-width: 60ch; font-size: 1.1rem; margin-bottom: 24px; }
.hero__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 28px; align-items: center; }
@media (max-width: 880px) { .hero__grid { grid-template-columns: 1fr; gap: 22px; } }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 16px;
  font-weight: 800; font-size: .98rem; cursor: pointer; border: 1px solid transparent;
  transition: transform .08s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: #fff; color: #1763e0; box-shadow: 0 12px 30px rgba(0, 20, 78, 0.35); }
.btn--primary:hover { background: #eef5ff; }
.btn--ghost { background: rgba(255, 255, 255, 0.12); color: #fff; border-color: rgba(255, 255, 255, 0.20); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.btn--ghost:hover { background: rgba(255, 255, 255, 0.18); }

/* ---------- Live summary card ---------- */
.summary { padding: 24px; }
.summary__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.summary__label { color: var(--ink-faint); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.summary__value {
  display: flex; align-items: baseline; gap: 6px; margin: 14px 0 2px;
  font-variant-numeric: tabular-nums; color: #fff; text-shadow: 0 2px 18px rgba(0, 30, 90, 0.46);
}
.summary__value [data-field="level"] { font-size: clamp(3.2rem, 2rem + 6vw, 4.6rem); font-weight: 800; line-height: .9; }
.summary__value span:last-child { font-size: 1.2rem; font-weight: 800; color: rgba(255, 255, 255, 0.7); }
.summary__meta { margin-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.12); padding-top: 14px; display: grid; gap: 10px; }
.meta-row { display: flex; justify-content: space-between; gap: 12px; font-size: .96rem; }
.meta-row dt { color: var(--ink-faint); font-weight: 700; }
.meta-row dd { margin: 0; font-weight: 800; color: #fff; text-align: right; }
.summary__note { margin: 14px 0 0; font-size: .8rem; color: var(--ink-faint); line-height: 1.5; }

/* ---------- Status pill (как .gauge-status в приложении) ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  padding: 4px 12px; border-radius: var(--pill);
  border: 1px solid currentColor;
  color: var(--st, var(--green)); background: var(--st-soft, rgba(52, 224, 161, 0.14));
  font-size: .66rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 9px currentColor; }
.badge--normal   { --st: var(--green);  --st-soft: rgba(52, 224, 161, 0.14); }
.badge--elevated { --st: var(--amber);  --st-soft: rgba(255, 191, 61, 0.15); }
.badge--high     { --st: var(--orange); --st-soft: rgba(255, 159, 69, 0.15); }
.badge--danger   { --st: var(--red);    --st-soft: rgba(255, 90, 90, 0.16); }
.badge--nodata   { --st: rgba(255,255,255,0.62); --st-soft: rgba(255, 255, 255, 0.10); }

/* ---------- Answer block (GEO/AI) ---------- */
.answer { padding: 22px 24px; border-left: 4px solid var(--cyan); }
.answer h2 { font-size: 1.3rem; margin-bottom: .4em; }
.answer p { margin: 0; color: var(--ink-soft); }

/* ---------- Cards / grids ---------- */
.cards { display: grid; gap: 16px; margin-top: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card { padding: 20px; }
.card h3 { margin-bottom: .5em; }
.card h3 + p { color: var(--ink-soft); margin: 0; }

.post-card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.post-card__name { font-weight: 800; font-size: 1.05rem; color: #fff; }
.post-card__body { display: flex; align-items: baseline; gap: 5px; margin: 12px 0 2px; color: #fff; font-variant-numeric: tabular-nums; }
.post-card__body span:first-child { font-size: 2.2rem; font-weight: 800; line-height: 1; }
.post-card__body span:last-child { font-size: .95rem; font-weight: 800; color: rgba(255, 255, 255, 0.62); }
.post-card__water { color: var(--cyan); font-weight: 800; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.post-card__desc { color: var(--ink-soft); font-size: .92rem; margin: 10px 0 0; }
.post-card__src { color: var(--ink-faint); font-size: .8rem; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.12); }

/* ---------- "Что сейчас" — sparkline + table ---------- */
.now-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 16px; align-items: stretch; }
@media (max-width: 820px) { .now-grid { grid-template-columns: 1fr; } }
.spark { display: flex; flex-direction: column; justify-content: center; }
.spark svg { width: 100%; height: auto; display: block; overflow: visible; }
.spark__caption { color: var(--ink-faint); font-size: .82rem; margin-top: 12px; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; color: var(--ink); }
table.data caption { text-align: left; color: var(--ink-faint); font-size: .82rem; padding-bottom: 10px; }
table.data th, table.data td { padding: 9px 12px; text-align: left; border-bottom: 1px solid rgba(255, 255, 255, 0.10); white-space: nowrap; }
table.data thead th { color: var(--ink-faint); font-weight: 800; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody td { font-variant-numeric: tabular-nums; }
.delta-up { color: var(--orange); font-weight: 800; }
.delta-down { color: var(--green); font-weight: 800; }
.delta-flat { color: var(--ink-faint); }

/* ---------- Status scale table ---------- */
table.scale td, table.scale th { white-space: normal; vertical-align: top; }
table.scale td:first-child { white-space: nowrap; }

/* ---------- Sources ---------- */
.source-list { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 12px; }
.source-list li { padding: 16px 18px; }
.source-list b { display: block; color: #fff; font-weight: 800; }
.source-list span { color: var(--ink-soft); font-size: .94rem; }

/* ---------- FAQ ---------- */
.faq { margin-top: 20px; display: grid; gap: 10px; }
.faq details { padding: 2px 20px; }
.faq summary {
  cursor: pointer; font-weight: 800; color: #fff; padding: 16px 0; 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(--cyan); font-size: 1.5rem; font-weight: 700; line-height: 1; }
.faq details[open] summary::after { content: "\2013"; }
.faq details > p { margin: 0 0 18px; color: var(--ink-soft); }

/* ---------- Prose (SEO text) ---------- */
.prose { max-width: 74ch; }
.prose h2 { text-shadow: 0 2px 18px rgba(0, 26, 80, 0.4); }
.prose h3 { margin-top: 1.5em; color: #fff; }
.prose p { color: rgba(255, 255, 255, 0.86); }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 30px; padding: 40px 0 30px;
  background: rgba(6, 17, 38, 0.66);
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}
.site-footer a { color: rgba(255, 255, 255, 0.82); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 26px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 22px; } }
.site-footer h4 { color: #fff; font-size: .92rem; margin: 0 0 12px; font-weight: 800; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.site-footer .muted { color: rgba(255, 255, 255, 0.6); font-size: .86rem; line-height: 1.6; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12); margin-top: 26px; padding-top: 18px;
  font-size: .8rem; color: rgba(255, 255, 255, 0.55); display: flex; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
}

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .btn:hover { transform: none; } }
