:root {
  --bg: #020617;
  --bg2: #060c1c;
  --panel: rgba(14, 22, 40, 0.72);
  --panel2: rgba(20, 30, 52, 0.85);
  --line: rgba(90, 160, 220, 0.16);
  --line2: rgba(90, 160, 220, 0.30);
  --txt: #dbe7f5;
  --muted: #7f93ad;
  --cyan: #4fd4ff;
  --cyan-dim: #2a91c4;
  --green: #34e29b;
  --yellow: #ffd24a;
  --red: #ff5d6c;
  --violet: #a78bff;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: radial-gradient(1200px 700px at 50% -200px, #0a1730 0%, var(--bg) 60%);
  color: var(--txt); font-family: "Rajdhani", -apple-system, "Apple SD Gothic Neo", sans-serif;
  font-size: 15px; letter-spacing: .2px;
}

/* ── HERO ───────────────────────────────────────────── */
.hero {
  position: relative; min-height: 440px; display: flex; align-items: center; justify-content: space-between;
  gap: 24px; overflow: hidden; border-bottom: 1px solid var(--line);
  max-width: 1240px; margin: 0 auto; padding: 28px 24px;
}
.hero-visual { flex: 0 0 auto; position: relative; z-index: 1; }
.jarvis { display: block; width: 430px; max-width: 44vw; height: auto; opacity: .98; pointer-events: none; }
.hero-grid {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image: linear-gradient(rgba(79,212,255,.05) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(79,212,255,.05) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(circle at 70% 50%, #000 20%, transparent 70%);
}
.hero-overlay {
  position: relative; z-index: 2; flex: 1 1 0; max-width: 640px; padding: 4px;
  display: flex; flex-direction: column; gap: 26px;
}
.brand {
  font-family: "Orbitron", sans-serif; font-weight: 900; font-size: clamp(26px, 5vw, 52px);
  letter-spacing: 6px; color: #eaf6ff; text-shadow: 0 0 24px rgba(79,212,255,.55), 0 0 60px rgba(79,212,255,.25);
}
.brand-sub { color: var(--cyan); font-family: "Orbitron", sans-serif; font-weight: 700; letter-spacing: 2px; font-size: clamp(14px,2vw,20px); margin-top: 8px; text-shadow: 0 0 18px rgba(79,212,255,.35); }
.brand-flow { color: var(--muted); font-weight: 600; letter-spacing: 2px; font-size: 12px; margin-top: 6px; text-transform: uppercase; }
.hero-readouts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; max-width: 760px;
}
.readout {
  background: rgba(6, 14, 30, 0.55); border: 1px solid var(--line2); border-radius: 10px;
  padding: 10px 12px; backdrop-filter: blur(6px);
}
.readout .rk { color: var(--muted); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; }
.readout .rv { font-family: "Orbitron", sans-serif; font-weight: 700; font-size: 17px; margin-top: 3px; display: flex; align-items: center; gap: 7px; }
.hero-foot { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 12px; letter-spacing: 1px; }
.hero-foot button {
  margin-left: auto; background: rgba(79,212,255,.10); color: var(--cyan); border: 1px solid var(--line2);
  border-radius: 8px; padding: 7px 14px; cursor: pointer; font-family: "Orbitron", sans-serif; font-size: 11px; letter-spacing: 2px;
}
.hero-foot button:hover { background: rgba(79,212,255,.2); }

/* ── TABS ───────────────────────────────────────────── */
.tabs {
  position: sticky; top: 0; z-index: 20; display: flex; gap: 8px; padding: 12px 18px; flex-wrap: wrap;
  background: rgba(2, 6, 23, 0.82); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.tabs button {
  background: var(--panel); color: var(--muted); border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 16px; cursor: pointer; font-size: 13px; font-weight: 600;
  font-family: "Rajdhani", sans-serif; letter-spacing: .5px; transition: all .15s;
}
.tabs button:hover { color: var(--txt); }
.tabs button.active { color: #eaf6ff; border-color: var(--cyan); background: rgba(79,212,255,.12); box-shadow: 0 0 14px rgba(79,212,255,.25); }

main { padding: 22px 18px 10px; max-width: 1240px; margin: 0 auto; }

/* ── OVERVIEW ───────────────────────────────────────── */
.overview { margin-bottom: 30px; }
.section-label { font-family: "Orbitron", sans-serif; font-size: 12px; letter-spacing: 3px; color: var(--cyan-dim); text-transform: uppercase; margin: 0 0 12px 2px; }

/* ── 결론 4대 기둥 ── */
.pillar-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; margin-bottom: 28px; }
.pcard { background: linear-gradient(160deg, rgba(20,32,56,.85), rgba(12,20,38,.85)); border: 1px solid var(--line2); border-radius: 14px; padding: 16px; cursor: pointer; position: relative; transition: transform .15s, border-color .15s; }
.pcard:hover { transform: translateY(-2px); border-color: var(--cyan); box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.pc-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.pc-icon { font-size: 16px; }
.pc-en { font-family: "Orbitron", sans-serif; font-weight: 700; font-size: 13px; letter-spacing: 2px; color: var(--cyan); }
.pc-ko { color: var(--muted); font-size: 12px; }
.pc-sig { margin-left: auto; font-size: 15px; }
.pc-head { font-size: 17px; font-weight: 700; color: #eaf6ff; line-height: 1.3; }
.pc-sub { color: var(--muted); font-size: 12.5px; margin-top: 6px; line-height: 1.4; }

/* ── 기둥별 그룹 ── */
.pillar-group { margin-bottom: 22px; }
.pillar-head { display: flex; align-items: baseline; gap: 9px; margin: 0 0 11px 2px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.pg-icon { font-size: 14px; }
.pg-en { font-family: "Orbitron", sans-serif; font-size: 13px; letter-spacing: 2px; color: var(--cyan-dim); }
.pg-ko { color: var(--muted); font-size: 12px; }
.ov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; }
.ov-card {
  display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; text-decoration: none; color: var(--txt); backdrop-filter: blur(8px);
  position: relative; overflow: hidden; transition: border-color .15s, transform .15s;
}
.ov-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(var(--cyan), transparent); opacity: .8; }
.ov-card:hover { border-color: var(--line2); transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,.35); }
.ov-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.ov-name { font-weight: 700; font-size: 15px; letter-spacing: .5px; }
.ov-grade { font-family: "Orbitron", sans-serif; font-size: 11px; color: var(--cyan); text-align: right; max-width: 55%; }
.ov-body { display: flex; flex-direction: column; gap: 7px; }
.ov-row { display: grid; grid-template-columns: 18px 1fr auto; gap: 7px; align-items: baseline; font-size: 13px; }
.ov-k { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-v { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ── MODULE BLOCKS ──────────────────────────────────── */
.module-block { margin-bottom: 36px; scroll-margin-top: 64px; }
.module-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; padding-left: 12px; border-left: 3px solid var(--cyan); }
.module-head h2 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: .5px; }
.module-head .asof { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.module-head .grade { font-family: "Orbitron", sans-serif; font-size: 13px; font-weight: 700; margin-left: auto; color: var(--cyan); }
.note { background: var(--panel2); border: 1px dashed var(--line2); border-radius: 10px; padding: 9px 13px; color: #b9cce0; margin-bottom: 14px; font-size: 13px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 13px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 15px; position: relative; backdrop-filter: blur(8px); }
.card .t { color: var(--muted); font-size: 12px; margin-bottom: 7px; letter-spacing: .5px; }
.card .v { font-size: 21px; font-weight: 700; font-family: "Orbitron", sans-serif; font-variant-numeric: tabular-nums; }
.card .d { color: var(--muted); font-size: 12px; margin-top: 5px; }
.card .dot { position: absolute; top: 13px; right: 13px; font-size: 14px; }

table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 13px; }
th, td { text-align: left; padding: 8px 11px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; letter-spacing: 1px; text-transform: uppercase; font-size: 11px; }
td { font-variant-numeric: tabular-nums; }
td.sig { text-align: center; width: 46px; }
tbody tr:hover { background: rgba(79,212,255,.04); }
.group-tag { color: var(--cyan-dim); font-size: 11px; font-weight: 600; }

.ov-more { margin-top: 11px; color: var(--cyan); font-size: 12px; font-weight: 600; letter-spacing: .5px; }
.ov-card { cursor: pointer; }

/* ── 막대차트 ── */
.bars { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 18px; margin-top: 16px; }
.barchart { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.bc-title { font-size: 13px; font-weight: 700; color: #cfe0f5; margin-bottom: 12px; letter-spacing: .3px; }
.bc-row { display: grid; grid-template-columns: 120px 1fr 60px; gap: 9px; align-items: center; margin-bottom: 6px; }
.bc-label { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-track { position: relative; height: 15px; background: rgba(127,160,200,.07); border-radius: 4px; }
.bc-zero { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: rgba(160,190,220,.4); }
.bc-fill { position: absolute; top: 2px; bottom: 2px; border-radius: 3px; opacity: .92; }
.bc-marker { position: absolute; top: -3px; bottom: -3px; width: 0; border-left: 1px dashed rgba(255,210,74,.55); }
.bc-val { font-size: 12px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

/* ── 차트 이미지 ── */
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; margin-top: 16px; }
.chart { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.chart figcaption { font-size: 13px; font-weight: 700; color: #cfe0f5; margin-bottom: 8px; }
.chart img { width: 100%; height: auto; border-radius: 8px; display: block; }
.chart-note { font-size: 12px; font-weight: 400 !important; color: var(--muted) !important; margin-top: 8px; line-height: 1.45; border-top: 1px solid var(--line); padding-top: 7px; }
.charts { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

/* ── 서브탭 ── */
.subnav { display: flex; gap: 7px; flex-wrap: wrap; margin: 18px 0 4px; }
.subbtn { background: var(--panel); color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 6px 13px; cursor: pointer; font-family: "Rajdhani", sans-serif; font-weight: 600; font-size: 13px; }
.subbtn.active { color: #eaf6ff; border-color: var(--cyan); background: rgba(79,212,255,.12); }

/* ── AT A GLANCE ── */
.glance-wrap { max-width: 1200px; }
.glance-lead { color: #cfe0f5; font-size: 15px; line-height: 1.7; margin: 6px 2px 20px; }
.glance-lead b { color: var(--cyan); font-weight: 700; }
.glance-svg { width: 100%; height: auto; background: rgba(8,14,28,.5); border: 1px solid var(--line); border-radius: 16px; padding: 8px; margin-bottom: 8px; }
.gs-data { fill: #9fb4cf; font-size: 14px; font-weight: 600; letter-spacing: .5px; font-family: "Rajdhani"; }
.gs-en { font-family: "Orbitron"; font-size: 17px; font-weight: 700; }
.gs-ko { fill: #cfe0f5; font-size: 13px; font-weight: 600; font-family: "Rajdhani"; }
.gs-q { fill: var(--muted); font-size: 12px; font-family: "Rajdhani"; }
.gs-desc { fill: #b9cce0; font-size: 12.5px; font-family: "Rajdhani"; }
.gs-side { fill: #c4b8ec; font-size: 12px; font-weight: 600; font-family: "Rajdhani"; }
.gs-loop { fill: #b9a8e8; font-size: 13px; font-weight: 600; font-family: "Rajdhani"; }
.gs-act { fill: #eaf6ff; font-size: 13px; font-weight: 700; font-family: "Orbitron"; }
.gs-actk { fill: var(--muted); font-size: 11px; font-family: "Rajdhani"; }
.glance-sub { font-family: "Orbitron"; font-size: 13px; letter-spacing: 2px; color: var(--cyan-dim); text-transform: uppercase; margin: 26px 0 14px 2px; }
.gp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.gp-card { background: var(--panel); border: 1px solid var(--line); border-radius: 13px; padding: 16px; }
.gp-head { display: flex; align-items: baseline; gap: 9px; margin-bottom: 9px; }
.gp-en { font-family: "Orbitron"; font-weight: 700; font-size: 14px; letter-spacing: 1.5px; }
.gp-ko { color: var(--muted); font-size: 12.5px; }
.gp-body { color: #cfe0f5; font-size: 13px; line-height: 1.55; margin-bottom: 11px; }
.gp-refs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.gp-refs li { border-left: 2px solid var(--line2); padding-left: 10px; }
.gp-refs b { display: block; color: #dbe7f5; font-size: 12.5px; font-weight: 600; }
.gp-refs span { color: var(--muted); font-size: 12px; }
.gx-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 13px; }
.gx-item { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.gx-t { color: var(--cyan); font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.gx-d { color: #c5d4e8; font-size: 13px; line-height: 1.6; }
.glance-foot { color: var(--muted); font-size: 12px; margin-top: 20px; }

.foot { padding: 20px 0 40px; }
.loading { color: var(--muted); padding: 50px; text-align: center; font-family: "Orbitron", sans-serif; letter-spacing: 2px; }

@media (max-width: 900px) {
  .hero { flex-direction: column; text-align: center; }
  .hero-visual { order: -1; }
  .jarvis { width: 320px; max-width: 80vw; }
  .hero-readouts { justify-content: center; }
}
