:root {
  --bg: #0b0f17;
  --bg-elevated: #111827;
  --surface: #151c2c;
  --surface-2: #1a2336;
  --surface-hover: #1f2a40;
  --text: #e8edf5;
  --text-muted: #94a3b8;
  --primary: #3b82f6;
  --primary-light: #60a5fa;
  --primary-dark: #2563eb;
  --accent: #38bdf8;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --border: #243047;
  --border-light: #2d3a52;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --header-grad: linear-gradient(135deg, #0a1628 0%, #1e3a5f 45%, #1d4ed8 100%);
  --tag-bg: rgba(56, 189, 248, 0.12);
  --tag-text: #7dd3fc;
  --tag-warn-bg: rgba(251, 191, 36, 0.12);
  --tag-warn-text: #fcd34d;
  --input-bg: #0f1520;
  --radius: 16px;
  --radius-sm: 10px;
}

@media (prefers-color-scheme: light) {
  :root.theme-auto {
    --bg: #f0f4fa;
    --bg-elevated: #ffffff;
    --surface: #ffffff;
    --surface-2: #eef3fa;
    --surface-hover: #e2e9f4;
    --text: #1a2332;
    --text-muted: #5c6b82;
    --border: #dbe4f0;
    --border-light: #c8d4e6;
    --shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
    --header-grad: linear-gradient(135deg, #0f2744 0%, #1d4ed8 55%, #2563eb 100%);
    --tag-bg: #e0f2fe;
    --tag-text: #0369a1;
    --tag-warn-bg: #fef3c7;
    --tag-warn-text: #b45309;
    --input-bg: #ffffff;
  }
}

:root.theme-light {
  --bg: #f0f4fa;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef3fa;
  --surface-hover: #e2e9f4;
  --text: #1a2332;
  --text-muted: #5c6b82;
  --border: #dbe4f0;
  --border-light: #c8d4e6;
  --shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
  --header-grad: linear-gradient(135deg, #0f2744 0%, #1d4ed8 55%, #2563eb 100%);
  --tag-bg: #e0f2fe;
  --tag-text: #0369a1;
  --tag-warn-bg: #fef3c7;
  --tag-warn-text: #b45309;
  --input-bg: #ffffff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 1rem;
  overflow-x: hidden;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

html.theme-transitioning body,
html.theme-transitioning .site-footer,
html.theme-transitioning .info-card,
html.theme-transitioning .conditions-box,
html.theme-transitioning .condition-item,
html.theme-transitioning .news-card,
html.theme-transitioning .service-card,
html.theme-transitioning .stat-item,
html.theme-transitioning .search-box,
html.theme-transitioning .section-alert {
  transition:
    background-color 0.55s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.55s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.55s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.55s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

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

.container {
  width: min(1180px, 92vw);
  margin: 0 auto;
  padding-left: max(0px, env(safe-area-inset-left));
  padding-right: max(0px, env(safe-area-inset-right));
}

.mobile-quicknav {
  display: none;
}

/* Header */
.site-header {
  background: var(--header-grad);
  color: #fff;
  padding: 1rem 0 3.5rem;
  position: relative;
  overflow: hidden;
}

.site-header::before {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.18) 0%, transparent 70%);
  top: -180px;
  right: -120px;
  pointer-events: none;
  animation: headerGlow 8s ease-in-out infinite alternate;
}

.site-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(255,255,255,.1), transparent 45%);
  pointer-events: none;
}

.header-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: #fff;
  text-decoration: none;
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: rgba(255,255,255,.14);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  font-weight: 800;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s;
}

.logo:hover .logo-icon {
  transform: rotate(-8deg) scale(1.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.logo-sub {
  display: block;
  font-size: .68rem;
  font-weight: 500;
  opacity: .75;
  margin-top: .1rem;
}

.nav-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-links a {
  color: rgba(255,255,255,.9);
  font-size: .88rem;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  transition: color 0.2s;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: #fff;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-links a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.theme-toggle {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.22);
  color: #fff;
  border-radius: 999px;
  padding: .45rem .85rem;
  font-size: .82rem;
  cursor: pointer;
  transition: background 0.25s, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s;
  position: relative;
  overflow: hidden;
}

.theme-toggle:hover {
  background: rgba(255,255,255,.22);
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.theme-toggle:active { transform: scale(0.95); }

.theme-toggle.is-switching {
  animation: themeBtnSpin 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero {
  position: relative;
  z-index: 1;
  margin-top: 2rem;
  max-width: 820px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  padding: .35rem .85rem;
  border-radius: 999px;
  font-size: .78rem;
}

.hero-rates {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.hero-rate {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  padding: .35rem .75rem;
  border-radius: 999px;
  font-size: .78rem;
  color: rgba(255,255,255,.95);
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.hero-rate:hover {
  background: rgba(255,255,255,.2);
  border-color: rgba(255,255,255,.35);
  text-decoration: none;
}

.hero-rate__code {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,.65);
}

.hero-rate strong {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Weather section — horizontal strip */
.section--weather {
  margin-bottom: 1.75rem;
}

.section-header--compact {
  margin-bottom: 0.85rem;
}

.section-header--compact h2 {
  font-size: clamp(1.15rem, 3vw, 1.35rem);
}

.section-header--compact p {
  font-size: 0.82rem;
}

.weather-scroll {
  position: relative;
  margin: 0 -0.25rem;
}

.weather-scroll::before,
.weather-scroll::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1.75rem;
  pointer-events: none;
  z-index: 2;
}

.weather-scroll::before {
  left: 0;
  background: linear-gradient(to right, var(--bg) 15%, transparent);
}

.weather-scroll::after {
  right: 0;
  background: linear-gradient(to left, var(--bg) 15%, transparent);
}

.weather-track {
  display: flex;
  gap: 0.65rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) transparent;
  padding: 0.35rem 0.5rem 0.65rem;
}

.weather-track::-webkit-scrollbar {
  height: 5px;
}

.weather-track::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 999px;
}

.weather-loading {
  flex: 1;
  text-align: center;
  color: var(--text-muted);
  padding: 1.25rem 1rem;
  font-size: 0.88rem;
}

.weather-card {
  flex: 0 0 auto;
  width: clamp(118px, 28vw, 142px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  scroll-snap-align: start;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition:
    transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    border-color 0.25s,
    box-shadow 0.35s,
    background 0.25s;
}

.weather-card-enter {
  opacity: 0;
  animation: weatherSlideIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.weather-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
  text-decoration: none;
}

.weather-card:hover .weather-icon {
  transform: scale(1.15) rotate(-4deg);
}

.weather-card--clear {
  background: linear-gradient(160deg, var(--surface) 0%, rgba(251, 191, 36, 0.06) 100%);
}

.weather-card--cloud {
  background: linear-gradient(160deg, var(--surface) 0%, rgba(148, 163, 184, 0.08) 100%);
}

.weather-card--rain,
.weather-card--storm {
  background: linear-gradient(160deg, var(--surface) 0%, rgba(56, 189, 248, 0.1) 100%);
}

.weather-card--snow {
  background: linear-gradient(160deg, var(--surface) 0%, rgba(186, 230, 253, 0.1) 100%);
}

.weather-card--empty {
  cursor: default;
  opacity: 0.65;
}

.weather-city {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.weather-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.1rem 0 0.05rem;
}

.weather-icon {
  font-size: 1.15rem;
  line-height: 1;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.weather-temp {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary-light);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.weather-condition {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.weather-precip {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero h1 {
  font-size: clamp(1.65rem, 4.5vw, 2.55rem);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero p {
  color: rgba(255,255,255,.88);
  font-size: clamp(.95rem, 2.5vw, 1.05rem);
  max-width: 700px;
}

.hero-actions {
  margin-top: 1.4rem;
  display: flex;
  gap: .65rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .65rem 1.15rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .9rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s, background 0.25s;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.25) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.55s;
}

.btn:hover::after { transform: translateX(120%); }

.btn:hover {
  transform: translateY(-3px);
  text-decoration: none;
}

.btn:active { transform: translateY(-1px) scale(0.98); }

.btn-primary {
  background: #fff;
  color: #1e3a8a;
  box-shadow: 0 4px 14px rgba(0,0,0,.2);
}

.btn-primary:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}

.btn-ghost {
  background: rgba(255,255,255,.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,.25);
}

.btn-outline {
  background: transparent;
  color: var(--primary-light);
  border: 1px solid var(--border-light);
}

/* Search */
.search-section {
  margin-top: -2rem;
  position: relative;
  z-index: 2;
  margin-bottom: 2rem;
}

.search-box {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem;
  display: flex;
  gap: .65rem;
  flex-wrap: wrap;
  align-items: center;
  border: 1px solid var(--border);
}

.search-box input,
.search-box select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .7rem 1rem;
  font-size: .95rem;
  outline: none;
  background: var(--input-bg);
  color: var(--text);
}

.search-box input {
  flex: 1;
  min-width: min(100%, 200px);
}

.search-box select { min-width: min(100%, 180px); }

.search-box input:focus,
.search-box select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, .15);
}

/* Stats */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: .85rem;
  margin-bottom: 2.5rem;
}

.stat-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .9rem;
  text-align: center;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s, border-color 0.25s;
}

.stat-item:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow);
  border-color: var(--border-light);
}

.stat-item strong {
  display: block;
  font-size: 1.4rem;
  color: var(--primary-light);
  transition: transform 0.3s;
}

.stat-item:hover strong { transform: scale(1.08); }

.stat-item span {
  font-size: .78rem;
  color: var(--text-muted);
}

/* Info cards */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s, border-color 0.25s;
}

.info-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
  border-color: var(--border-light);
}

.info-card h3 {
  font-size: 1.05rem;
  margin-bottom: .55rem;
  color: var(--primary-light);
}

.info-card p, .info-card li {
  color: var(--text-muted);
  font-size: .92rem;
}

.info-card ul {
  margin: .5rem 0 0 1.1rem;
}

.info-card li { margin-bottom: .35rem; }

.info-card--wide {
  grid-column: 1 / -1;
}

.patriot-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.patriot-banner__item {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
}

.patriot-banner__label {
  display: block;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  margin-bottom: .4rem;
}

.patriot-banner__value {
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  color: var(--primary-light);
  line-height: 1.3;
}

/* Conditions block */
.conditions-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow);
}

.conditions-box h3 {
  font-size: 1.15rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.conditions-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.condition-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  transition: transform 0.3s, border-color 0.25s, background 0.25s;
}

.condition-item:hover {
  transform: translateX(4px);
  border-color: var(--accent);
}

.condition-item strong {
  display: block;
  font-size: .88rem;
  color: var(--accent);
  margin-bottom: .35rem;
}

.condition-item p {
  font-size: .86rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Section */
.section {
  margin-bottom: 3rem;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.section-header h2 {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  color: var(--text);
}

.section-header p {
  color: var(--text-muted);
  font-size: .92rem;
  max-width: 560px;
}

.section-alert {
  background: var(--tag-warn-bg);
  border: 1px solid rgba(251, 191, 36, .25);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
  font-size: .9rem;
  color: var(--text-muted);
}

.section-alert strong { color: var(--tag-warn-text); }

/* News */
.news-top {
  margin-top: 0.5rem;
  padding-top: 0.25rem;
}

.news-top .section-header h2 {
  color: var(--primary-light);
}

.news-loading {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 1rem;
  font-size: 0.92rem;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1rem;
}

.news-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: .45rem;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.25s, box-shadow 0.35s;
}

.news-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
}

.news-card:hover h3 { color: var(--primary-light); }

.news-source {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--accent);
}

.news-date { font-size: .8rem; color: var(--text-muted); }

.news-card h3 {
  font-size: .98rem;
  line-height: 1.4;
  color: var(--text);
  transition: color 0.2s;
}

.news-card p {
  font-size: .88rem;
  color: var(--text-muted);
  flex: 1;
}

/* Services */
.category-block { margin-bottom: 2rem; }

.category-title {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  margin-bottom: 1rem;
  color: var(--text);
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--border);
  flex-wrap: wrap;
}

.category-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: .85rem;
}

.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s, border-color 0.25s, background 0.25s;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--border-light);
  background: var(--surface-hover);
}

.service-card:hover .service-name { color: var(--primary-light); }

.service-card--outside {
  border-color: rgba(251, 191, 36, .2);
}

.service-card--outside:hover {
  border-color: rgba(251, 191, 36, .4);
}

.service-card h4 {
  font-size: .95rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
}

.service-name {
  color: var(--text);
  font-weight: 600;
  transition: color 0.2s;
}

.service-tag {
  font-size: .68rem;
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: .15rem .45rem;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.service-tag--warn {
  background: var(--tag-warn-bg);
  color: var(--tag-warn-text);
}

.service-desc {
  font-size: .84rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.service-note {
  font-size: .78rem;
  color: var(--warning);
  margin-top: .2rem;
}

/* Footer */
.site-footer {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  padding: 2.5rem 0 1.5rem;
  margin-top: 3rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.footer-grid h4 {
  color: var(--text);
  margin-bottom: .55rem;
  font-size: .92rem;
}

.footer-grid p, .footer-grid li {
  font-size: .84rem;
  line-height: 1.5;
}

.footer-grid ul { list-style: none; }
.footer-grid li { margin-bottom: .3rem; }
.footer-grid a { color: var(--text-muted); }
.footer-grid a:hover { color: var(--primary-light); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  font-size: .78rem;
  color: var(--text-muted);
  text-align: center;
  opacity: .85;
}

.hidden { display: none !important; }

/* Mobile nav */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  flex-shrink: 0;
}

.nav-toggle__bar {
  display: block;
  width: 100%;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.is-open .nav-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-open .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-open .nav-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s;
}

.mobile-nav-backdrop.is-visible {
  opacity: 1;
}

.mobile-nav {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 9001;
  width: min(320px, 88vw);
  height: 100%;
  height: 100dvh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.35);
  padding: max(1rem, env(safe-area-inset-top)) 1.25rem max(1.5rem, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.mobile-nav.is-open {
  transform: translateX(0);
}

.mobile-nav__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.mobile-nav__title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.mobile-nav__close {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
}

.mobile-nav a {
  display: block;
  padding: 0.85rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}

.mobile-nav a:hover,
.mobile-nav a:focus-visible {
  background: var(--surface-2);
  color: var(--primary-light);
  text-decoration: none;
}

body.nav-open {
  overflow: hidden;
}

/* ============================================================
   MOBILE / TABLET
   ============================================================ */

@media (max-width: 900px) {
  .container {
    width: 100%;
    max-width: 100%;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .header-inner {
    flex-wrap: nowrap;
    gap: 0.5rem;
  }

  .header-actions {
    margin-left: auto;
    flex-wrap: nowrap;
    gap: 0.45rem;
    flex-shrink: 0;
  }

  .logo {
    min-width: 0;
    flex: 1;
  }

  main.container {
    width: 100%;
    max-width: 100%;
  }

  .mobile-quicknav {
    display: flex;
    gap: 0.45rem;
    overflow-x: auto;
    padding-top: 0.65rem;
    padding-bottom: 0.15rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    mask-image: linear-gradient(to right, transparent, #000 8px, #000 calc(100% - 8px), transparent);
  }

  .mobile-quicknav::-webkit-scrollbar {
    display: none;
  }

  .mobile-quicknav a {
    flex-shrink: 0;
    padding: 0.42rem 0.8rem;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    color: #fff;
    font-size: 0.76rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
  }

  .mobile-quicknav a:active {
    background: rgba(255, 255, 255, 0.28);
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .section-header p {
    max-width: none;
  }
}

@media (max-width: 768px) {
  .site-header {
    padding: 0.85rem 0 2rem;
  }

  .search-section {
    margin-top: 0.75rem;
    margin-bottom: 1.25rem;
  }

  .hero {
    margin-top: 0.85rem;
    max-width: none;
  }

  /* Контент сразу виден — reveal не скрывает блоки на телефоне */
  .reveal {
    opacity: 1;
    transform: none;
  }

  .reveal-scale {
    opacity: 1;
    transform: none;
  }

  .anim-in {
    opacity: 1;
    animation: none;
  }

  .search-box {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    gap: 0.6rem;
  }

  .search-box input,
  .search-box select {
    width: 100%;
    min-width: 0;
    font-size: 16px;
    padding: 0.85rem 1rem;
  }

  .hero-meta {
    gap: 0.4rem;
  }

  .hero-badge,
  .hero-rate {
    font-size: 0.72rem;
    max-width: 100%;
    line-height: 1.4;
  }

  .stats-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
    margin-bottom: 2rem;
  }

  .stat-item {
    padding: 0.75rem 0.5rem;
  }

  .stat-item strong {
    font-size: 1.2rem;
  }

  .stat-item span {
    font-size: 0.72rem;
    line-height: 1.3;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .patriot-banner {
    grid-template-columns: 1fr;
  }

  .conditions-box {
    padding: 1.15rem;
  }

  .conditions-list {
    grid-template-columns: 1fr;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .service-card h4 {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .service-tag {
    align-self: flex-start;
  }

  .news-grid {
    grid-template-columns: 1fr;
  }

  .section {
    margin-bottom: 2.25rem;
  }

  .section-alert {
    padding: 0.9rem 1rem;
    font-size: 0.86rem;
  }

  .site-footer {
    padding: 2rem 0 1.25rem;
    margin-top: 2rem;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
  }
}

@media (max-width: 480px) {
  .header-inner {
    gap: 0.65rem;
  }

  .logo {
    font-size: 1rem;
    min-width: 0;
  }

  .logo-icon {
    width: 36px;
    height: 36px;
    font-size: 1.05rem;
    flex-shrink: 0;
  }

  .theme-toggle {
    padding: 0.5rem 0.65rem;
    font-size: 0.78rem;
    min-width: 44px;
  }

  .logo-sub {
    font-size: 0.62rem;
  }

  .hero h1 {
    font-size: 1.45rem;
  }

  .hero p {
    font-size: 0.92rem;
    line-height: 1.55;
  }

  .hero-actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
    padding: 0.75rem 1rem;
  }

  .stats-strip {
    grid-template-columns: 1fr 1fr;
  }

  .info-card {
    padding: 1.1rem;
  }

  .info-card h3 {
    font-size: 0.98rem;
  }

  .info-card p {
    font-size: 0.88rem;
  }

  .patriot-banner__item {
    padding: 1rem 1.1rem;
  }

  .patriot-banner__value {
    font-size: 1.05rem;
  }

  .category-title {
    font-size: 0.98rem;
  }

  .service-card,
  .news-card {
    padding: 0.95rem;
  }

  .weather-card:active {
    transform: scale(0.97);
  }

  .service-card:active,
  .news-card:active {
    transform: scale(0.98);
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.1rem;
  }

  .footer-bottom {
    font-size: 0.72rem;
    line-height: 1.5;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}

@media (max-width: 768px) {
  .stat-item:hover,
  .info-card:hover,
  .service-card:hover,
  .news-card:hover,
  .condition-item:hover {
    transform: none;
  }

  .search-box:focus-within {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-nav,
  .mobile-nav-backdrop {
    transition: none;
  }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

.theme-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, visibility 0.15s;
}

.theme-overlay.active {
  opacity: 1;
  visibility: visible;
}

.theme-overlay__circle {
  position: absolute;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  animation: themeRipple 0.75s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  will-change: transform, opacity;
}

@keyframes themeRipple {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0.85;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
  }
}

@keyframes themeBtnSpin {
  0%   { transform: scale(1) rotate(0deg); }
  40%  { transform: scale(0.88) rotate(180deg); }
  100% { transform: scale(1) rotate(360deg); }
}

@keyframes headerGlow {
  0%   { transform: translate(0, 0) scale(1); opacity: 0.7; }
  100% { transform: translate(-30px, 20px) scale(1.15); opacity: 1; }
}

@keyframes fadeUpIn {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes cardPop {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes weatherSlideIn {
  from {
    opacity: 0;
    transform: translateX(18px) translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
}

/* Hero entrance */
.anim-in {
  opacity: 0;
  animation: fadeUpIn 0.75s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.anim-d1 { animation-delay: 0.08s; }
.anim-d2 { animation-delay: 0.18s; }
.anim-d3 { animation-delay: 0.28s; }
.anim-d4 { animation-delay: 0.38s; }

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.reveal-scale.is-visible {
  opacity: 1;
  transform: scale(1);
}

/* Dynamic cards (after filter/render) */
.card-enter {
  animation: cardPop 0.45s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

/* Search box pulse on focus area */
.search-box {
  transition: box-shadow 0.35s, border-color 0.35s, transform 0.35s;
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12), var(--shadow);
  transform: translateY(-2px);
}

.category-icon {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.category-title:hover .category-icon {
  transform: scale(1.12) rotate(-6deg);
}

/* Filter fade */
.catalog-fade {
  animation: fadeIn 0.35s ease;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .anim-in {
    opacity: 1;
    animation: none;
  }
}
