/* 509 Corridor — Netflix-style PEST dashboard
   Brand palette: midnight blue #0B1426 + cyan #00E5FF (per GWD brand)
   Tone: data-dense, no hype */

:root {
  --bg-deep:    #07090f;
  --bg-base:    #0b1426;
  --bg-card:    #131c33;
  --bg-card-2:  #0f1a35;
  --line:       rgba(255,255,255,0.07);
  --line-strong:rgba(255,255,255,0.14);
  --ink:        #e8edf7;
  --ink-dim:    #a8b2c5;
  --ink-faint:  #6c7691;
  --accent:     #00e5ff;
  --accent-dim: #00b3cc;
  --warn:       #f59e0b;
  --high:       #ef4444;
  --med:        #f59e0b;
  --low:        #22c55e;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg-deep);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* TOP BAR */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(180deg, rgba(11,20,38,0.96), rgba(11,20,38,0.85));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.topbar .row {
  max-width: 1400px; margin: 0 auto; padding: 14px 28px;
  display: flex; align-items: center; gap: 28px;
}
.topbar .brand {
  font-weight: 800; font-size: 22px; color: #fff; letter-spacing: -0.02em;
}
.topbar .brand .accent { color: var(--accent); }
.topbar nav { display: flex; gap: 22px; flex-wrap: wrap; }
.topbar nav a { color: var(--ink-dim); font-size: 14px; font-weight: 500; }
.topbar nav a:hover { color: #fff; text-decoration: none; }
.topbar nav a.active { color: var(--accent); }
.topbar .spacer { flex: 1; }
.topbar .meta { color: var(--ink-faint); font-size: 12px; }

/* HERO */
.hero {
  position: relative;
  background:
    radial-gradient(ellipse 80% 60% at 80% 0%, rgba(0,229,255,0.18), transparent 70%),
    radial-gradient(ellipse 70% 70% at 0% 100%, rgba(0,229,255,0.08), transparent 60%),
    linear-gradient(180deg, var(--bg-deep), var(--bg-base));
  border-bottom: 1px solid var(--line);
  padding: 64px 0 56px;
}
.hero .wrap { max-width: 1400px; margin: 0 auto; padding: 0 28px; }
.hero .breadcrumb { color: var(--ink-faint); font-size: 13px; margin-bottom: 14px; }
.hero .breadcrumb a { color: var(--ink-dim); }
.hero h1 {
  font-size: clamp(34px, 5vw, 60px);
  margin: 0 0 14px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.05;
}
.hero h1 .accent { color: var(--accent); }
.hero p.subtitle {
  color: var(--ink-dim); font-size: 19px; max-width: 760px; margin: 0 0 18px;
}
.hero p.hero-line {
  color: var(--ink); font-size: 17px; max-width: 760px; margin: 0;
  border-left: 3px solid var(--accent); padding-left: 16px;
}
.hero .actions { margin-top: 24px; display: flex; gap: 12px; flex-wrap: wrap; }
.btn-primary, .btn-ghost {
  display: inline-block; padding: 11px 22px; border-radius: 8px;
  font-weight: 700; font-size: 14px; cursor: pointer; border: 0;
}
.btn-primary { background: var(--accent); color: var(--bg-base); }
.btn-primary:hover { background: #fff; text-decoration: none; }
.btn-ghost { background: transparent; color: #fff; border: 1.5px solid var(--line-strong); }
.btn-ghost:hover { background: rgba(255,255,255,0.06); text-decoration: none; }

/* MAIN */
main { max-width: 1400px; margin: 0 auto; padding: 30px 28px 60px; }

.kpi-row {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 36px;
}
.kpi {
  background: linear-gradient(160deg, var(--bg-card) 0%, var(--bg-card-2) 100%);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
}
.kpi .label {
  color: var(--ink-faint); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px;
}
.kpi .value {
  color: #fff; font-size: 30px; font-weight: 800; line-height: 1.1;
}
.kpi .value .unit { font-size: 14px; color: var(--ink-dim); margin-left: 4px; font-weight: 600; }
.kpi .compare { color: var(--accent); font-size: 12px; margin-top: 8px; }
.kpi .src { color: var(--ink-faint); font-size: 11px; margin-top: 6px; }

/* SECTION */
h2.section-title {
  color: #fff; font-size: 22px; margin: 30px 0 14px;
  display: flex; align-items: center; gap: 14px; font-weight: 700;
}
h2.section-title::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,0.16), transparent);
}
h2.section-title .tag { font-size: 11px; color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }

/* PILLAR ROW */
.pillar-row {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.pillar-card {
  background: linear-gradient(160deg, #0f1a35 0%, #0b1426 100%);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.pillar-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0,229,255,0.4);
}
.pillar-card .hero {
  height: 120px;
  background: linear-gradient(135deg, #0b1426, #1c2740);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.pillar-card .hero .glyph {
  font-size: 64px; font-weight: 900; color: var(--accent);
  opacity: 0.85; letter-spacing: -0.04em;
}
.pillar-card .hero .maturity {
  position: absolute; top: 10px; right: 10px;
  font-size: 10px; padding: 3px 8px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700;
}
.pillar-card .hero .maturity.high { background: rgba(239,68,68,0.18); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.pillar-card .hero .maturity.medium { background: rgba(245,158,11,0.18); color: #fcd34d; border: 1px solid rgba(245,158,11,0.3); }
.pillar-card .hero .maturity.low { background: rgba(34,197,94,0.18); color: #86efac; border: 1px solid rgba(34,197,94,0.3); }
.pillar-card .body { padding: 16px 18px; }
.pillar-card .tag { color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: 0.1em; }
.pillar-card h3 { margin: 4px 0 8px; font-size: 17px; color: #fff; line-height: 1.25; }
.pillar-card p.oneLine { color: var(--ink-dim); font-size: 13px; margin: 0 0 12px; }
.pillar-card .stats { display: flex; flex-direction: column; gap: 4px; }
.pillar-card .stats .stat {
  font-size: 12px; color: var(--ink-faint);
  padding-left: 14px; position: relative;
}
.pillar-card .stats .stat::before {
  content: "▸"; color: var(--accent-dim); position: absolute; left: 0;
}
.pillar-card .footer { padding: 0 18px 14px; display: flex; justify-content: space-between; align-items: center; }
.pillar-card .footer .src { color: var(--ink-faint); font-size: 11px; }

/* RISK MATRIX TABLE */
.matrix-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  margin-top: 14px;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden;
}
.matrix-table thead th {
  background: var(--bg-card-2); color: var(--accent);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 12px 16px; text-align: left; font-weight: 700;
  border-bottom: 1px solid var(--line);
}
.matrix-table tbody td {
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  vertical-align: top; font-size: 14px; color: var(--ink);
}
.matrix-table tbody tr:last-child td { border-bottom: 0; }
.matrix-table tbody td.pillar-cell { color: var(--accent); font-weight: 700; white-space: nowrap; }
.matrix-table tbody td.vuln-cell { color: var(--ink-dim); }

/* IMPLICATION CARDS */
.impl-row {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.impl-card {
  background: linear-gradient(160deg, #0f1a35 0%, #0b1426 100%);
  border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px;
  position: relative;
}
.impl-card .num {
  display: inline-block;
  background: rgba(0,229,255,0.12); color: var(--accent);
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  padding: 4px 10px; border-radius: 999px; margin-bottom: 12px;
}
.impl-card h3 { color: #fff; font-size: 19px; margin: 0 0 10px; line-height: 1.3; }
.impl-card p { color: var(--ink-dim); font-size: 14px; margin: 0; line-height: 1.65; }

/* DATA TABLES */
.data-table {
  width: 100%; border-collapse: collapse; margin-top: 14px;
  background: var(--bg-card); border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line);
}
.data-table th, .data-table td {
  padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.data-table th { background: var(--bg-card-2); color: var(--accent); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.data-table td { color: var(--ink); }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td strong { color: #fff; }

/* PILLAR DETAIL (collapsible) */
.pillar-detail {
  background: var(--bg-card);
  border: 1px solid var(--line); border-radius: 10px;
  margin-top: 16px; overflow: hidden;
}
.pillar-detail .head {
  padding: 18px 22px; display: flex; align-items: center; gap: 14px;
  cursor: pointer; user-select: none;
  background: var(--bg-card-2);
}
.pillar-detail .head h3 { margin: 0; font-size: 17px; color: #fff; flex: 1; }
.pillar-detail .head .tag { color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: 0.1em; }
.pillar-detail .head .toggle {
  font-size: 14px; color: var(--accent-dim); transition: transform 0.2s;
}
.pillar-detail.open .head .toggle { transform: rotate(180deg); }
.pillar-detail .body {
  display: none;
  padding: 22px;
  border-top: 1px solid var(--line);
}
.pillar-detail.open .body { display: block; }
.pillar-detail .body p {
  color: var(--ink-dim); font-size: 14px; line-height: 1.7; margin: 0 0 12px;
}
.pillar-detail .body p strong { color: #fff; }

/* CITATIONS */
.citations {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 10px; padding: 20px 22px; margin-top: 16px;
}
.citations h3 { color: var(--accent); font-size: 14px; margin: 0 0 12px; }
.citations ul { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 30px; }
.citations li {
  color: var(--ink-dim); font-size: 12px; padding: 4px 0;
  break-inside: avoid;
}
.citations li b { color: var(--ink); margin-right: 6px; }
@media (max-width: 720px) { .citations ul { columns: 1; } }

/* FOOTER */
.site-footer {
  background: var(--bg-deep);
  border-top: 1px solid var(--line);
  padding: 36px 0 24px;
  color: var(--ink-faint); font-size: 13px;
  margin-top: 40px;
}
.site-footer .wrap { max-width: 1400px; margin: 0 auto; padding: 0 28px; }
.site-footer .grid {
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 18px;
}
.site-footer h4 { color: var(--ink); font-size: 14px; margin: 0 0 10px; }
.site-footer a { color: var(--ink-dim); }
.site-footer a:hover { color: var(--accent); }
.site-footer .copy {
  border-top: 1px solid var(--line); padding-top: 14px;
  color: var(--ink-faint); font-size: 12px;
}

@media (max-width: 720px) {
  .topbar .row { padding: 12px 18px; gap: 14px; flex-wrap: wrap; }
  .topbar nav { gap: 14px; }
  .hero .wrap, main { padding-left: 18px; padding-right: 18px; }
  .matrix-table thead th, .matrix-table tbody td { font-size: 13px; padding: 10px 12px; }
}