:root {
  --page: #e9ecef;
  --panel: #ffffff;
  --panel-alt: #f4f5f6;
  --text: #2b2b2b;
  --muted: #6b6f75;
  --rule: #dfe2e6;
  --accent: #D81E1E;
  --accent-dark: #A61717;
  --word-fill: #2b2b2b;
  --word-stroke: transparent;
  --sky-top: #e4eaf1;
  --sky-mid: #edf1f5;
  --sky-bottom: #f5f7f9;
  --grid: rgba(60, 80, 110, .07);
  --grid-major: rgba(60, 80, 110, .14);
  --node-bg: #ffffff;
  --node-stroke: #9aa6b4;
  --line: #a7b2bf;
  --label: #3d4652;
  --tag: #8a95a3;
  --structure-light: #8a929c;
  --shadow: 0 18px 50px rgba(30, 40, 55, .12);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #1b1c1f;
    --panel: #121315;
    --panel-alt: #18191c;
    --text: #e8e8e8;
    --muted: #9a9ea5;
    --rule: #2a2c30;
    --accent: #E53535;
    --accent-dark: #b52323;
    --word-fill: #ffffff;
    --word-stroke: #999999;
    --sky-top: #070b12;
    --sky-mid: #0b1220;
    --sky-bottom: #111a2b;
    --grid: rgba(140, 170, 210, .06);
    --grid-major: rgba(140, 170, 210, .13);
    --node-bg: #0f1622;
    --node-stroke: #3d4c63;
    --line: #34435a;
    --label: #c9d3e0;
    --tag: #5f6f86;
    --structure-light: #4a5566;
    --shadow: 0 18px 50px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --page: #1b1c1f;
  --panel: #121315;
  --panel-alt: #18191c;
  --text: #e8e8e8;
  --muted: #9a9ea5;
  --rule: #2a2c30;
  --accent: #E53535;
  --accent-dark: #b52323;
  --word-fill: #ffffff;
  --word-stroke: #999999;
  --sky-top: #070b12;
  --sky-mid: #0b1220;
  --sky-bottom: #111a2b;
  --grid: rgba(140, 170, 210, .06);
  --grid-major: rgba(140, 170, 210, .13);
  --node-bg: #0f1622;
  --node-stroke: #3d4c63;
  --line: #34435a;
  --label: #c9d3e0;
  --tag: #5f6f86;
  --structure-light: #4a5566;
  --shadow: 0 18px 50px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

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

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

body {
  background: var(--page);
  color: var(--text);
  font-family: 'Barlow', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color .3s ease, color .3s ease;
}

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* Header */
header {
  background: var(--panel);
  border-bottom: 1px solid var(--rule);
  position: relative;
  z-index: 2;
  transition: background-color .3s ease;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 18px;
  padding-bottom: 18px;
}

.logo { display: block; width: 190px; flex-shrink: 0; }
.logo svg { display: block; width: 100%; height: auto; overflow: visible; }

.logo .mark { fill: var(--accent); stroke: var(--accent-dark); stroke-width: 2; }
.logo .word { fill: var(--word-fill); stroke: var(--word-stroke); stroke-width: 1; }

.logo .mark, .logo .word {
  stroke-dasharray: 1600;
  stroke-dashoffset: 1600;
  fill-opacity: 0;
  animation: draw 1.6s ease-out forwards, fill .6s ease-out forwards;
}
.logo .mark { stroke-width: 3; animation-delay: 0s, 1.1s; }
.logo .word { animation-delay: .35s, 1.35s; }

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fill { to { fill-opacity: 1; } }

.header-right { display: flex; align-items: center; gap: 14px; }

.tiles { display: flex; gap: 10px; list-style: none; }
.tiles li { display: flex; }

.tile {
  position: relative;
  width: 108px;
  height: 82px;
  background: var(--panel-alt);
  border: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  overflow: hidden;
  transition: background-color .3s ease, border-color .3s ease;
}
.tile svg { width: 30px; height: 30px; stroke: var(--structure-light); fill: none; stroke-width: 1.6; }
.tile span {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.tile::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  border-style: solid;
  border-width: 0 0 14px 14px;
  border-color: transparent transparent var(--accent) transparent;
}
a.tile { text-decoration: none; }
a.tile:hover { border-color: var(--accent); }
a.tile:hover span { color: var(--accent); }
a.tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tile.active { background: var(--accent); border-color: var(--accent); }
a.tile.active:hover span { color: #fff; }
.tile.active svg { stroke: #fff; }
.tile.active span { color: #fff; }
.tile.active::after { border-color: transparent transparent #fff transparent; opacity: .85; }

.theme-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid var(--rule);
  background: var(--panel-alt);
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background-color .3s ease;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}

/* Hero */
.hero {
  position: relative;
  height: 60vh;
  min-height: 360px;
  max-height: 620px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 55%, var(--sky-bottom) 100%);
  transition: background .3s ease;
}
.hero svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.grid-minor { stroke: var(--grid); }
.grid-major { stroke: var(--grid-major); }
.link { fill: none; stroke: var(--line); stroke-width: 1.5; }
.flow { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 6 90; animation: flow 3.2s linear infinite; }
.flow.slow { animation-duration: 4.4s; }
.flow.rev { animation-direction: reverse; }
@keyframes flow { to { stroke-dashoffset: -96; } }
.joint { fill: var(--line); }
.node rect { fill: var(--node-bg); stroke: var(--node-stroke); stroke-width: 1.5; }
.node text, .hub text {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .14em;
  fill: var(--label);
  text-anchor: middle;
  dominant-baseline: central;
}
.node .tag, .hub .tag { font-size: 10px; font-weight: 500; letter-spacing: .12em; fill: var(--tag); text-anchor: start; }
.hub rect { fill: var(--node-bg); stroke: var(--accent); stroke-width: 2; }
.hub .core { fill: var(--accent); }
.tick { stroke: var(--tag); stroke-width: 1; }
.hero rect, .hero text, .hero line, .hero path { transition: fill .3s ease, stroke .3s ease; }

.hero-sub { height: 38vh; min-height: 260px; max-height: 400px; }
.hero-sub + main .panel { margin-top: -48px; }

/* Content */
main { flex: 1; position: relative; z-index: 1; }

.panel {
  background: var(--panel);
  margin-top: -110px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr 300px;
  transition: background-color .3s ease;
}

.intro { padding: 44px 48px 48px; }

.eyebrow {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

h1 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 500;
  font-size: clamp(32px, 4.4vw, 50px);
  line-height: 1.08;
  letter-spacing: -.005em;
  margin-bottom: 26px;
  text-wrap: balance;
}
h1 strong { color: var(--accent); font-weight: 600; }

.intro p { color: var(--muted); max-width: 54ch; margin-bottom: 16px; }
.intro p.lead { color: var(--text); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 16px;
  border: 1px solid var(--rule);
  background: var(--panel-alt);
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .25; } }

.stats {
  list-style: none;
  border-left: 1px solid var(--rule);
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
}
.stats li { padding: 18px 0; border-bottom: 1px solid var(--rule); }
.stats li:last-child { border-bottom: 0; }

.stat-num {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 500;
  font-size: 56px;
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.stat-num small { font-size: 18px; font-weight: 600; letter-spacing: .08em; }
.stat-label {
  display: block;
  margin-top: 6px;
  font-family: 'Barlow Condensed', sans-serif;
  font-style: italic;
  font-size: 17px;
  color: var(--muted);
}

.areas {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rule);
}
.area { padding: 30px 32px 34px; border-right: 1px solid var(--rule); }
.area:last-child { border-right: 0; }
.area .tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: .14em;
  color: var(--muted);
  margin-bottom: 10px;
}
.area .tag::before { content: ''; width: 8px; height: 8px; background: var(--accent); }
.area h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 24px;
  line-height: 1.15;
  margin-bottom: 8px;
}
.area p { color: var(--muted); font-size: 16px; }

.report {
  grid-column: 1 / -1;
  border-top: 1px solid var(--rule);
  padding: 12px 48px;
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  letter-spacing: .04em;
}

footer { padding: 28px 0 32px; font-size: 14px; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--rule); }
footer a:hover { color: var(--accent); border-color: var(--accent); }

/* Tablet / phone */
@media (max-width: 860px) {
  .areas { grid-template-columns: 1fr; }
  .area { border-right: 0; border-bottom: 1px solid var(--rule); }
  .area:last-child { border-bottom: 0; }
  .panel { grid-template-columns: 1fr; margin-top: -70px; }
  .stats { border-left: 0; border-top: 1px solid var(--rule); padding: 8px 32px; flex-direction: row; flex-wrap: wrap; gap: 0 32px; }
  .stats li { flex: 1 1 160px; border-bottom: 0; }
  .report { padding: 12px 32px; }
}

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .header-inner { flex-wrap: wrap; }
  .logo { width: 150px; }
  .header-right { width: 100%; justify-content: space-between; }
  .header-right nav, .tiles { flex: 1; }
  .tiles li { flex: 1; }
  .tile { flex: 1; width: auto; height: 64px; }
  .tile svg { width: 22px; height: 22px; }
  .hero { height: 38vh; min-height: 240px; }
  .hero-sub { height: 26vh; min-height: 180px; }
  .hero-sub + main .panel { margin-top: -28px; }
  .area { padding: 24px 22px 26px; }
  .panel { margin-top: -48px; }
  .intro { padding: 30px 22px 32px; }
  .stats { padding: 4px 22px 12px; flex-direction: column; }
  .stats li { border-bottom: 1px solid var(--rule); }
  .stats li:last-child { border-bottom: 0; }
  .stat-num { font-size: 46px; }
  .report { padding: 12px 22px; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .logo .mark, .logo .word { animation: none; stroke-dashoffset: 0; fill-opacity: 1; }
  .status .dot, .flow { animation: none; }
  .flow { display: none; }
  body, header, .panel, .tile, .hero { transition: none; }
}
