:root {
  --bg: #f4efe7;
  --paper: rgba(255, 251, 246, 0.9);
  --paper-strong: #fffaf3;
  --line: rgba(89, 60, 40, 0.14);
  --ink: #1f1b17;
  --muted: #62564d;
  --accent: #b4572f;
  --accent-soft: rgba(180, 87, 47, 0.14);
  --apartment: #bc5b38;
  --garage: #cc9c63;
  --good: #325743;
  --warn: #7c4a1f;
  --shadow: 0 18px 48px rgba(72, 43, 23, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --font-display: "Instrument Serif", Georgia, serif;
  --font-body: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.72), transparent 34%),
    linear-gradient(180deg, #efe6da 0%, #f8f3ec 42%, #f2ece4 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(82, 57, 36, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(82, 57, 36, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.28), transparent 75%);
}

.shell {
  position: relative;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.hero,
.panel,
.metric {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.hero {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(255, 250, 243, 0.94), rgba(250, 244, 235, 0.86));
  box-shadow: var(--shadow);
}

.eyebrow,
.panel-kicker,
.metric-label,
.scope dt {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-copy {
  display: grid;
  gap: 14px;
  margin-bottom: 28px;
}

.hero h1 {
  margin: 0;
  max-width: 12ch;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 5.2rem);
  font-weight: 400;
  line-height: 0.96;
  letter-spacing: -0.03em;
}

.lede,
.panel-copy,
.coverage-list p,
.story-card p,
.metric-note,
td,
th,
.chart-footer,
.scope dd {
  font-size: 0.98rem;
  line-height: 1.55;
}

.lede {
  max-width: 62ch;
  margin: 0;
  color: var(--muted);
}

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

.scope div,
.metric,
.panel {
  border: 1px solid var(--line);
  background: var(--paper);
}

.scope div {
  padding: 16px 18px;
  border-radius: var(--radius-md);
}

.scope dt {
  margin-bottom: 6px;
}

.scope dd {
  margin: 0;
  font-weight: 700;
}

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

.metric {
  min-height: 168px;
  padding: 18px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.metric.accent {
  background: linear-gradient(180deg, rgba(180, 87, 47, 0.08), rgba(255, 251, 246, 0.92));
}

.metric-value {
  margin: 6px 0 12px;
  font-size: clamp(1.9rem, 5vw, 3.1rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.metric-note {
  margin: 0;
  color: var(--muted);
}

.panel {
  padding: 22px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.panel-header h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.05;
}

.panel-copy {
  max-width: 48ch;
  margin: 0;
  color: var(--muted);
}

.panel-story {
  margin-bottom: 14px;
}

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

.story-card {
  padding: 18px;
  border-radius: var(--radius-md);
  background: var(--paper-strong);
  border: 1px solid var(--line);
}

.story-card h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.story-card p {
  margin: 0;
  color: var(--muted);
}

.bars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
  gap: 12px;
  align-items: end;
  min-height: 280px;
}

.bar-col {
  display: grid;
  gap: 8px;
}

.bar-stack {
  position: relative;
  height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: end;
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(93, 64, 42, 0.04), rgba(93, 64, 42, 0.09));
}

.bar-segment {
  width: 100%;
  transition: height 480ms ease;
}

.bar-segment.apartment {
  background: linear-gradient(180deg, #d27a58, var(--apartment));
}

.bar-segment.garage {
  background: linear-gradient(180deg, #dfbb8a, var(--garage));
}

.bar-meta {
  display: grid;
  gap: 2px;
}

.bar-year {
  font-weight: 800;
}

.bar-total {
  color: var(--muted);
  font-size: 0.92rem;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.92rem;
}

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

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  display: inline-block;
}

.legend-swatch.apartment {
  background: var(--apartment);
}

.legend-swatch.garage {
  background: var(--garage);
}

.layout-two {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.chart-frame {
  position: relative;
  min-height: 280px;
  padding: 10px 0;
}

#trend-chart {
  width: 100%;
  height: 280px;
  overflow: visible;
}

.chart-footer {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

.seasonal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.seasonal-card {
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--paper-strong);
  border: 1px solid var(--line);
}

.seasonal-card strong,
.coverage-item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.95rem;
}

.seasonal-card span {
  color: var(--muted);
  font-size: 0.92rem;
}

.seasonal-bar {
  margin-top: 10px;
  height: 8px;
  border-radius: 999px;
  background: rgba(93, 64, 42, 0.08);
  overflow: hidden;
}

.seasonal-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d6a06b, var(--apartment));
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 0;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(50, 87, 67, 0.1);
  color: var(--good);
}

.status-pill.missing {
  background: rgba(124, 74, 31, 0.1);
  color: var(--warn);
}

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

.coverage-item {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--paper-strong);
}

.coverage-item p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 980px) {
  .scope,
  .kpis,
  .story-grid,
  .layout-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-header {
    flex-direction: column;
    align-items: start;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 16px;
  }

  .hero,
  .panel,
  .metric {
    border-radius: 22px;
  }

  .scope,
  .kpis,
  .story-grid,
  .layout-two,
  .seasonal-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 20px;
  }

  .panel,
  .metric {
    padding: 18px;
  }

  .bars {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

  .bar-segment {
    transition: none;
  }
}
