@font-face { font-family: "IBM Plex Sans"; src: url("assets/fonts/IBMPlexSans-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("assets/fonts/IBMPlexSans-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("assets/fonts/IBMPlexSans-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("assets/fonts/IBMPlexSans-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "IBM Plex Serif"; src: url("assets/fonts/IBMPlexSerif-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Serif"; src: url("assets/fonts/IBMPlexSerif-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Serif"; src: url("assets/fonts/IBMPlexSerif-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }

:root {
  --ink: #0b1f33;
  --ink-2: #2d4055;
  --paper: #eef2f5;
  --card: #ffffff;
  --line: #c9d2dc;
  --teal: #2b7a78;
  --teal-light: #a9d6d2;
  --orange: #c58b2a;
  --red: #a84a55;
  --muted: #5d6b7a;
  --display: "IBM Plex Serif", Georgia, serif;
  --sans: "IBM Plex Sans", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 8%, rgba(197,139,42,.09), transparent 26rem),
    linear-gradient(135deg, transparent 0 49.7%, rgba(11,31,51,.028) 49.7% 50.3%, transparent 50.3%) 0 0 / 36px 36px,
    var(--paper);
  font-family: var(--sans);
}
.grain {
  position: fixed; inset: 0; pointer-events: none; opacity: .18; z-index: 20;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.11'/%3E%3C/svg%3E");
}
.masthead {
  min-height: 84px; padding: 18px clamp(22px, 5vw, 72px); display: flex; align-items: center;
  justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(238,242,245,.88);
  backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.brand-mark {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%;
  background: var(--ink); color: var(--paper); font: 700 13px var(--sans); letter-spacing: .08em;
}
.brand b { display: block; font: 600 18px var(--sans); letter-spacing: -.025em; }
.brand small { display: block; color: var(--muted); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.course-tag { font-size: 10px; letter-spacing: .16em; color: var(--muted); }
main { max-width: 1500px; margin: auto; padding: 0 clamp(22px, 5vw, 72px) 72px; }
.hero { min-height: 420px; display: grid; grid-template-columns: 1.6fr .65fr; gap: 8vw; align-items: center; }
.eyebrow, .chart-kicker { font-size: 10px; font-weight: 700; letter-spacing: .19em; color: var(--teal); }
.hero h1 { font: 500 clamp(56px, 7.7vw, 116px)/.88 var(--display); letter-spacing: -.055em; margin: 24px 0 0; }
.hero h1 em { color: var(--teal); font-style: normal; font-weight: 500; }
.hero-note { align-self: end; margin-bottom: 62px; border-top: 1px solid var(--ink); padding-top: 15px; }
.hero-note p { font: 16px/1.55 var(--sans); margin: 12px 0 24px; }
.note-index { color: var(--orange); font: 700 11px var(--sans); letter-spacing: .1em; }
.live-status { font-size: 9px; letter-spacing: .16em; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.live-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 5px rgba(23,126,120,.12); }
.control-deck {
  display: grid; grid-template-columns: 1.1fr repeat(4, 1fr); gap: 1px; padding: 1px; background: var(--ink);
  border: 1px solid var(--ink); box-shadow: 6px 6px 0 rgba(11,31,51,.09);
}
.control-deck > * { background: var(--card); }
.control-intro { padding: 17px 18px; display: flex; flex-direction: column; justify-content: space-between; gap: 13px; }
.control-intro span, label { font-size: 9px; letter-spacing: .14em; font-weight: 700; text-transform: uppercase; }
.control-intro button { align-self: flex-start; border: 0; background: none; color: var(--orange); padding: 0; font: 700 11px var(--sans); cursor: pointer; }
label { padding: 12px 14px 10px; color: var(--muted); }
select {
  display: block; width: 100%; margin-top: 8px; border: 0; border-bottom: 1px solid var(--line); padding: 6px 2px;
  color: var(--ink); background: transparent; font: 600 13px var(--sans); outline: none;
}
.active-filter { margin: 18px 0; padding-left: 13px; border-left: 3px solid var(--orange); font: 12px/1.5 var(--sans); color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 24px 0 14px; }
.kpi { min-height: 154px; padding: 21px; background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; }
.kpi span { font-size: 10px; text-transform: uppercase; letter-spacing: .16em; font-weight: 700; color: var(--muted); }
.kpi strong { font: 500 clamp(34px, 4vw, 56px)/1 var(--display); margin: auto 0 10px; letter-spacing: -.035em; }
.kpi small { color: var(--muted); font-size: 10px; }
.kpi-dark { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.kpi-dark span, .kpi-dark small { color: var(--teal-light); }
.kpi-accent { border-top: 5px solid var(--orange); }
.insight-strip {
  background: var(--teal); color: white; padding: 22px 28px; display: grid; grid-template-columns: 150px 1fr 40px;
  align-items: center; gap: 18px; margin-bottom: 14px;
}
.insight-label { font-size: 9px; letter-spacing: .18em; font-weight: 700; opacity: .75; }
.insight-strip p { margin: 0; font: 500 16px/1.5 var(--sans); }
.insight-number { font: 700 11px var(--sans); color: #b8e2d9; text-align: right; }
.dashboard-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.span-7 { grid-column: span 7; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; }
.chart-card { background: var(--card); border: 1px solid var(--line); padding: 24px; min-width: 0; overflow: hidden; }
.chart-head { display: flex; justify-content: space-between; gap: 24px; min-height: 76px; }
.chart-head h2 { font: 500 27px/1.1 var(--display); margin: 7px 0 0; letter-spacing: -.03em; }
.chart-head p { max-width: 310px; color: var(--muted); font-size: 11px; line-height: 1.5; margin: 0; }
.chart { width: 100%; min-height: 310px; position: relative; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.axis text { fill: var(--muted); font: 10px var(--sans); }
.axis line, .axis path { stroke: var(--line); }
.grid line { stroke: var(--line); stroke-dasharray: 2 5; }
.grid path { display: none; }
.bar, .point, .tree-node, .donut-segment { cursor: pointer; transition: opacity .18s ease, filter .18s ease; }
.bar:hover, .point:hover, .tree-node:hover, .donut-segment:hover { filter: brightness(.92); }
.legend { font: 9px var(--sans); fill: var(--muted); }
.method {
  margin-top: 14px; min-height: 250px; display: grid; grid-template-columns: 60px 1fr 1fr; gap: 36px; align-items: center;
  padding: 42px; background: var(--ink); color: var(--paper);
}
.method h2 { font: 500 42px/1.05 var(--display); letter-spacing: -.035em; margin: 12px 0; }
.method-copy { color: #b7c9c9; font-size: 13px; line-height: 1.7; max-width: 530px; }
footer {
  min-height: 72px; border-top: 1px solid var(--line); padding: 0 clamp(22px, 5vw, 72px); display: flex; align-items: center;
  justify-content: space-between; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .15em;
}
.tooltip {
  position: fixed; z-index: 30; pointer-events: none; opacity: 0; transform: translate(12px, -8px);
  background: var(--ink); color: white; padding: 10px 12px; border-radius: 2px; box-shadow: 5px 5px 0 rgba(239,123,69,.35);
  font: 11px/1.5 var(--sans); max-width: 240px;
}
.tooltip b { color: var(--teal-light); }
.empty { min-height: 260px; display: grid; place-items: center; color: var(--muted); font: 17px var(--display); }
.loading { opacity: .65; }

body.basic {
  --ink: #222; --paper: #fff; --card: #fff; --line: #bbb; --teal: #4e79a7; --teal-light: #9ecae1; --orange: #f28e2b;
  background: white; font-family: Arial, sans-serif;
}
body.basic .grain, body.basic .hero-note, body.basic .insight-strip, body.basic .method { display: none; }
body.basic .hero { min-height: 180px; grid-template-columns: 1fr; }
body.basic .hero h1 { font: 700 42px Arial, sans-serif; letter-spacing: 0; }
body.basic .hero h1 em { font-style: normal; color: #222; }
body.basic .control-deck { box-shadow: none; }
body.basic .chart-head h2, body.basic .kpi strong { font-family: Arial, sans-serif; letter-spacing: 0; }
body.basic .chart-card, body.basic .kpi { border-radius: 0; box-shadow: none; }

@media (max-width: 1050px) {
  .control-deck { grid-template-columns: repeat(2, 1fr); }
  .control-intro { grid-column: span 2; flex-direction: row; }
  .span-7, .span-5 { grid-column: span 12; }
  .span-4 { grid-column: span 6; }
}
@media (max-width: 720px) {
  .masthead { position: relative; } .course-tag { display: none; }
  .hero { min-height: 470px; grid-template-columns: 1fr; gap: 30px; padding: 55px 0; }
  .hero-note { margin: 0; align-self: auto; }
  .control-deck { grid-template-columns: 1fr; }
  .control-intro { grid-column: span 1; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .insight-strip { grid-template-columns: 1fr; } .insight-number { display: none; }
  .span-4 { grid-column: span 12; }
  .chart-head { display: block; } .chart-head p { margin-top: 10px; }
  .method { grid-template-columns: 1fr; padding: 30px; }
  footer { flex-direction: column; justify-content: center; gap: 8px; text-align: center; }
}
@media (max-width: 440px) {
  .kpis { grid-template-columns: 1fr; }
  .hero h1 { font-size: 52px; }
  .chart-card { padding: 17px; }
}
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { background: white; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .grain { display: none; }
  .masthead { position: static; }
  main { max-width: none; padding: 0; }
  .hero { min-height: 300px; }
  .control-deck, .kpis, .insight-strip, .chart-card, .method { break-inside: avoid; }
  .chart-card { box-shadow: none; }
  footer { margin-top: 12px; }
}
