:root {
  color-scheme: dark;
  --bg: #07111f;
  --panel: #102235;
  --panel-2: #142b42;
  --text: #f5f7fb;
  --muted: #aebccc;
  --line: rgba(255, 255, 255, 0.14);
  --accent: #13c6a3;
  --accent-2: #ffcc4d;
  --danger: #f45656;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 14px clamp(18px, 4vw, 64px);
  background: rgba(7, 17, 31, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand img {
  width: 112px;
  height: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.2vw, 28px);
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.site-nav a:hover {
  color: var(--text);
}

.language-switch {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.language-switch button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-size: 1.18rem;
}

.language-switch button.is-active {
  background: rgba(19, 198, 163, 0.2);
  box-shadow: inset 0 0 0 1px rgba(19, 198, 163, 0.42);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.nav-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: var(--text);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(320px, 0.96fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  min-height: calc(100vh - 72px);
  padding: clamp(42px, 7vw, 96px) clamp(18px, 5vw, 84px) 42px;
  overflow: hidden;
}

.hero::before {
  position: absolute;
  inset: 72px 0 auto;
  height: min(64vh, 620px);
  pointer-events: none;
  content: "";
  background:
    linear-gradient(120deg, rgba(244, 86, 86, 0.2), transparent 38%),
    linear-gradient(290deg, rgba(19, 198, 163, 0.18), transparent 42%);
}

.hero-copy,
.hero-media {
  position: relative;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(2.75rem, 7vw, 6.5rem);
  line-height: 0.94;
}

.hero-text {
  max-width: 680px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1.08rem, 2vw, 1.35rem);
}

.hero-actions,
.store-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.button,
.store-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 20px;
  border-radius: 8px;
  font-weight: 850;
}

.button.primary {
  background: var(--accent);
  color: #03110e;
}

.button.secondary {
  border: 1px solid var(--line);
  color: var(--text);
}

.hero-media {
  display: grid;
  place-items: center;
}

.hero-media img {
  width: min(460px, 88vw);
  filter: drop-shadow(0 34px 44px rgba(0, 0, 0, 0.34));
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 0 clamp(18px, 5vw, 84px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  box-shadow: var(--shadow);
}

.status-strip div {
  padding: 20px;
  background: var(--panel);
}

.status-strip strong {
  display: block;
  font-size: 1.45rem;
}

.status-strip span {
  color: var(--muted);
}

.section {
  padding: clamp(58px, 8vw, 104px) clamp(18px, 5vw, 84px);
}

.section-heading {
  max-width: 780px;
  margin-bottom: 26px;
}

.section-heading h2,
.download-section h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1;
}

.section-heading p:not(.eyebrow),
.download-section p {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.feature-grid article {
  min-height: 230px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.feature-icon {
  display: inline-grid;
  place-items: center;
  min-width: 48px;
  height: 48px;
  padding: 0 10px;
  border-radius: 8px;
  background: rgba(19, 198, 163, 0.14);
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 950;
}

.feature-grid h3 {
  margin: 20px 0 8px;
  font-size: 1.18rem;
}

.feature-grid p {
  margin: 0;
  color: var(--muted);
}

.download-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin: clamp(28px, 5vw, 72px) clamp(18px, 5vw, 84px);
  padding: clamp(30px, 5vw, 56px);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--panel-2), #19314a 58%, #223419);
  box-shadow: var(--shadow);
}

.store-actions {
  margin-top: 0;
}

.store-button {
  min-width: 178px;
  flex-direction: column;
  align-items: flex-start;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
}

.store-button span {
  color: var(--muted);
  font-size: 0.9rem;
}

.store-button strong {
  font-size: 1.08rem;
}

.contact-form {
  display: grid;
  gap: 14px;
  max-width: 760px;
}

.contact-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 750;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: var(--panel);
  color: var(--text);
  font: inherit;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--accent);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 32px clamp(18px, 5vw, 84px);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer img {
  width: 96px;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.social-links a:hover {
  color: var(--text);
}

.report-dashboard {
  display: grid;
  gap: 16px;
}

.report-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.report-toolbar label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.report-toolbar select {
  min-width: 120px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1828;
  color: var(--text);
  font: inherit;
  font-weight: 850;
}

.report-toolbar a,
.panel-heading a {
  color: var(--accent);
  font-weight: 850;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}

.metric-card,
.skeleton {
  min-height: 116px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1;
}

.metric-card small {
  display: block;
  margin-top: 8px;
  color: var(--accent-2);
  font-weight: 800;
}

.skeleton {
  background: linear-gradient(100deg, var(--panel), var(--panel-2), var(--panel));
  background-size: 200% 100%;
  animation: pulse 1.5s linear infinite;
}

@keyframes pulse {
  to {
    background-position: -200% 0;
  }
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.analytics-panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.analytics-panel.wide {
  grid-column: 1 / -1;
}

.panel-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-heading h3 {
  margin: 0;
  font-size: 1.08rem;
}

.panel-heading span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.chart-area,
.rank-list,
.incident-list {
  min-height: 260px;
}

.loading,
.empty-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  color: var(--muted);
  text-align: center;
}

.bar-chart {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(110px, 190px) 1fr auto;
  gap: 12px;
  align-items: center;
}

.bar-label {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.bar-value {
  min-width: 36px;
  text-align: right;
  font-weight: 900;
}

.compare-list {
  display: grid;
  gap: 13px;
}

.compare-row {
  display: grid;
  gap: 7px;
}

.compare-row-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.compare-label {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-values {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
}

.compare-delta {
  color: var(--accent-2);
}

.compare-delta.negative {
  color: var(--danger);
}

.compare-bars {
  display: grid;
  gap: 4px;
}

.compare-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.compare-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.compare-fill.current {
  background: var(--accent);
}

.compare-fill.previous {
  background: var(--danger);
  opacity: 0.82;
}

.line-chart svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.chart-legend i {
  display: inline-block;
  width: 22px;
  height: 4px;
  border-radius: 999px;
}

.legend-current {
  background: var(--accent);
}

.legend-previous {
  background: var(--danger);
}

.line-chart text {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.line-chart .grid-line {
  stroke: rgba(255, 255, 255, 0.1);
}

.line-chart .area {
  fill: rgba(19, 198, 163, 0.15);
}

.line-chart .line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 4;
}

.line-chart .previous-line {
  stroke: var(--danger);
  stroke-dasharray: 8 8;
  opacity: 0.9;
}

.line-chart .dot {
  fill: var(--accent-2);
}

.incident-list {
  display: grid;
  gap: 10px;
}

.incident-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.incident-item strong {
  font-size: 1rem;
}

.incident-item span,
.incident-item time {
  color: var(--muted);
  font-size: 0.9rem;
}


@media (max-width: 920px) {
  .site-nav {
    position: fixed;
    top: 72px;
    right: 18px;
    left: 18px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    padding: 12px;
  }

  .nav-toggle {
    display: block;
  }

  .language-switch {
    margin-left: auto;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-media {
    order: -1;
  }

  h1 {
    font-size: clamp(2.4rem, 13vw, 4.3rem);
  }

  .status-strip,
  .feature-grid,
  .metric-grid,
  .analytics-grid,
  .download-section,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .status-strip,
  .feature-grid {
    display: grid;
  }

  .analytics-panel.wide {
    grid-column: auto;
  }

  .download-section,
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .hero {
    padding-top: 28px;
  }

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

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

  .report-toolbar,
  .panel-heading,
  .incident-item {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .report-toolbar,
  .panel-heading {
    flex-direction: column;
  }

  .bar-row {
    grid-template-columns: 1fr auto;
  }

  .bar-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .button,
  .store-button {
    width: 100%;
  }
}
