:root {
  color-scheme: dark;
  --bg: #07101d;
  --bg-elevated: rgba(13, 27, 47, 0.78);
  --panel: rgba(14, 29, 50, 0.74);
  --panel-solid: #0d1c30;
  --text: #eef4ff;
  --muted: #8fa1b9;
  --faint: #60738d;
  --line: rgba(155, 177, 210, 0.15);
  --line-strong: rgba(155, 177, 210, 0.27);
  --accent: #8391ff;
  --accent-2: #46ddc8;
  --positive: #4fdbb1;
  --negative: #ff7185;
  --warning: #f5bd5a;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.26);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --shell: 1320px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f6fb;
  --bg-elevated: rgba(255, 255, 255, 0.82);
  --panel: rgba(255, 255, 255, 0.78);
  --panel-solid: #ffffff;
  --text: #102038;
  --muted: #5d6c80;
  --faint: #8290a2;
  --line: rgba(35, 62, 96, 0.12);
  --line-strong: rgba(35, 62, 96, 0.22);
  --shadow: 0 24px 80px rgba(35, 62, 96, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 10% -10%, rgba(93, 111, 255, 0.16), transparent 34%),
    radial-gradient(circle at 93% 8%, rgba(40, 220, 193, 0.11), transparent 27%),
    var(--bg);
  color: var(--text);
  font-family: Inter, Pretendard, "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  transition: background-color .25s ease, color .25s ease;
}
button, select { font: inherit; }
button { color: inherit; }
a { color: inherit; }
.shell { width: min(calc(100% - 40px), var(--shell)); margin-inline: auto; }
.ambient { position: fixed; inset: auto; width: 34vw; aspect-ratio: 1; border-radius: 50%; filter: blur(100px); pointer-events: none; opacity: .15; z-index: -1; }
.ambient-one { background: #596cff; left: -12vw; top: 30vh; }
.ambient-two { background: #1fd1b6; right: -16vw; top: 62vh; }
.glass { background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(18px); }

.site-header { height: 88px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; padding: 8px; display: grid; grid-template-columns: repeat(4, 1fr); align-items: end; gap: 2px; background: linear-gradient(145deg, rgba(124, 140, 255, .24), rgba(70, 221, 200, .12)); border: 1px solid var(--line-strong); }
.brand-mark i { display: block; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
.brand-mark i:nth-child(1) { height: 45%; } .brand-mark i:nth-child(2) { height: 80%; } .brand-mark i:nth-child(3) { height: 60%; } .brand-mark i:nth-child(4) { height: 95%; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: -.02em; }
.brand small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.status-badge { min-height: 34px; display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 7px 13px; color: var(--muted); border: 1px solid var(--line); background: var(--bg-elevated); font-size: 12px; }
.status-badge span { width: 7px; height: 7px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 0 5px rgba(245, 189, 90, .08); }
.status-badge.live span { background: var(--positive); box-shadow: 0 0 0 5px rgba(79, 219, 177, .08); }
.status-badge.stale span { background: var(--negative); box-shadow: 0 0 0 5px rgba(255, 113, 133, .08); }
.icon-button { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-elevated); display: grid; place-items: center; cursor: pointer; transition: .2s ease; }
.icon-button:hover { transform: translateY(-1px); border-color: var(--line-strong); }
.icon-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }

.hero { min-height: 590px; padding: 96px 0 110px; display: grid; grid-template-columns: 1.2fr .8fr; align-items: center; gap: 70px; }
.eyebrow, .section-kicker { margin: 0 0 13px; color: var(--accent-2); font-size: 11px; font-weight: 800; letter-spacing: .17em; }
.hero h1 { margin: 0; max-width: 780px; font-size: clamp(45px, 5.7vw, 82px); line-height: 1.08; letter-spacing: -.058em; font-weight: 760; }
.hero h1 span { background: linear-gradient(100deg, #91a0ff, #55e7d1); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-description { max-width: 660px; margin: 26px 0 0; color: var(--muted); font-size: 17px; }
.hero-meta { display: flex; gap: 38px; margin-top: 42px; }
.hero-meta span, .hero-meta strong { display: block; }
.hero-meta span { color: var(--faint); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.hero-meta strong { margin-top: 5px; font-size: 13px; font-weight: 600; }
.hero-panel { border-radius: var(--radius-xl); padding: 24px; min-height: 390px; }
.pulse-head, .pulse-foot { display: flex; align-items: center; justify-content: space-between; color: var(--faint); font-size: 10px; letter-spacing: .12em; }
.ranking-list { margin: 28px 0 30px; display: grid; gap: 13px; }
.rank-row { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 15px; border: 1px solid var(--line); background: rgba(255,255,255,.018); }
.rank-number { color: var(--faint); font-variant-numeric: tabular-nums; font-size: 12px; }
.rank-name strong, .rank-name small { display: block; }
.rank-name strong { font-size: 14px; }
.rank-name small { color: var(--muted); font-size: 11px; }
.rank-value { font-size: 18px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.gradient-line { height: 3px; flex: 1; margin: 0 12px; border-radius: 3px; background: linear-gradient(90deg, #4edec7, #8591ff, #ff7d91); }

section { margin-bottom: 110px; }
.section-heading { display: flex; justify-content: space-between; gap: 30px; align-items: end; margin-bottom: 28px; }
.section-heading h2, .card-head h2, .dialog-head h2 { margin: 0; font-size: clamp(25px, 3vw, 36px); letter-spacing: -.04em; }
.section-heading > p, .card-head p { margin: 0; max-width: 480px; color: var(--muted); font-size: 13px; }
.company-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.company-card { border-radius: var(--radius-lg); padding: 21px; overflow: hidden; position: relative; min-height: 292px; transition: transform .25s ease, border-color .25s ease; }
.company-card:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.company-card::after { content: ""; position: absolute; width: 140px; height: 140px; border-radius: 50%; right: -65px; top: -65px; background: var(--card-glow, #8391ff); filter: blur(55px); opacity: .18; pointer-events: none; }
.company-top, .company-bottom, .price-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.company-id { display: flex; align-items: center; gap: 11px; min-width: 0; }
.company-orb { width: 35px; height: 35px; flex: 0 0 auto; border-radius: 12px; background: linear-gradient(145deg, color-mix(in srgb, var(--card-glow) 75%, white), color-mix(in srgb, var(--card-glow) 45%, transparent)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.company-id h3, .company-id p { margin: 0; }
.company-id h3 { font-size: 15px; letter-spacing: -.02em; white-space: nowrap; }
.company-id p { color: var(--muted); font-size: 10px; }
.quality-pill { border: 1px solid var(--line); border-radius: 999px; padding: 4px 8px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.price-row { margin-top: 26px; align-items: end; }
.price-row .label { display: block; color: var(--muted); font-size: 10px; }
.price-row .price { display: block; margin-top: 2px; font-size: 27px; line-height: 1.2; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.change { border-radius: 999px; padding: 4px 8px; font-size: 10px; font-weight: 700; }
.change.up { color: var(--positive); background: rgba(79, 219, 177, .09); }
.change.down { color: var(--negative); background: rgba(255, 113, 133, .09); }
.metric-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 25px; }
.metric-pair > div { padding: 13px; border-radius: 14px; background: rgba(255,255,255,.025); border: 1px solid var(--line); }
.metric-pair span { display: block; color: var(--muted); font-size: 10px; }
.metric-pair strong { font-size: 23px; font-variant-numeric: tabular-nums; letter-spacing: -.035em; }
.metric-pair small { margin-left: 3px; color: var(--faint); font-size: 9px; }
.company-bottom { margin-top: 21px; }
.financial-period { color: var(--faint); font-size: 10px; }
.source-button, .text-button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 11px; padding: 0; }
.source-button:hover, .text-button:hover { color: var(--text); }

.analytics-grid { display: grid; grid-template-columns: 1.45fr .55fr; gap: 16px; }
.chart-card { border-radius: var(--radius-xl); padding: 25px; min-height: 420px; }
.chart-card.full { grid-column: 1 / -1; min-height: 530px; }
.card-head { display: flex; justify-content: space-between; align-items: start; gap: 20px; margin-bottom: 20px; }
.card-head h2 { font-size: 24px; }
.card-head > div > p:last-child { margin-top: 7px; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.02); }
.segmented button { min-width: 55px; padding: 7px 11px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; }
.segmented button.active { color: var(--text); background: rgba(131,145,255,.14); box-shadow: inset 0 0 0 1px rgba(131,145,255,.2); }
.chart-area { width: 100%; height: 320px; }
.line-chart { height: 390px; }
.chart-area svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-axis-text { fill: var(--faint); font-size: 10px; }
.chart-label { fill: var(--muted); font-size: 11px; }
.chart-value { fill: var(--text); font-size: 11px; font-weight: 700; }
.chart-empty { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 13px; border: 1px dashed var(--line); border-radius: 18px; }
.chart-controls { display: flex; align-items: center; gap: 10px; }
select { color: var(--text); background: var(--panel-solid); border: 1px solid var(--line); border-radius: 11px; padding: 8px 34px 8px 11px; font-size: 11px; }
.dispersion-panel { display: grid; gap: 13px; margin-top: 30px; }
.dispersion-stat { border: 1px solid var(--line); border-radius: 15px; padding: 16px; }
.dispersion-stat span, .dispersion-stat strong, .dispersion-stat small { display: block; }
.dispersion-stat span { color: var(--muted); font-size: 10px; }
.dispersion-stat strong { margin-top: 5px; font-size: 27px; letter-spacing: -.04em; }
.dispersion-stat small { margin-top: 3px; color: var(--faint); font-size: 10px; }

.table-wrap { border-radius: var(--radius-lg); overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 1100px; }
th, td { padding: 17px 18px; text-align: right; border-bottom: 1px solid var(--line); font-size: 12px; white-space: nowrap; }
th { color: var(--faint); font-size: 10px; font-weight: 650; letter-spacing: .04em; background: rgba(255,255,255,.018); }
th:first-child, td:first-child { text-align: left; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255,255,255,.018); }
.table-company strong, .table-company small { display: block; }
.table-company small { color: var(--faint); font-size: 9px; }
.text-button { font-size: 12px; }
.warning-panel { margin-top: -70px; padding: 17px 20px; border: 1px solid rgba(245,189,90,.24); border-radius: 16px; background: rgba(245,189,90,.055); color: #d4ad69; font-size: 12px; }
.warning-panel strong { color: var(--text); }
.warning-panel ul { margin: 8px 0 0; padding-left: 18px; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 0 0 42px; color: var(--faint); font-size: 10px; }

.method-dialog { width: min(820px, calc(100% - 32px)); max-height: min(760px, calc(100vh - 32px)); border: 1px solid var(--line-strong); border-radius: 24px; padding: 0; color: var(--text); background: var(--panel-solid); box-shadow: 0 35px 120px rgba(0,0,0,.48); }
.method-dialog::backdrop { background: rgba(1,8,17,.72); backdrop-filter: blur(7px); }
.dialog-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: start; padding: 24px; border-bottom: 1px solid var(--line); background: var(--panel-solid); }
.dialog-head h2 { font-size: 25px; }
.dialog-content { padding: 24px; }
.method-block { padding: 18px; border: 1px solid var(--line); border-radius: 16px; margin-bottom: 13px; }
.method-block h3 { margin: 0 0 8px; font-size: 14px; }
.method-block p { margin: 0; color: var(--muted); font-size: 12px; }
.source-list { display: grid; gap: 9px; margin-top: 12px; }
.source-link { display: flex; justify-content: space-between; gap: 16px; padding: 12px; border-radius: 12px; text-decoration: none; border: 1px solid var(--line); }
.source-link:hover { border-color: var(--line-strong); }
.source-link strong, .source-link small { display: block; }
.source-link strong { font-size: 12px; }
.source-link small { color: var(--muted); font-size: 10px; }
.source-link span { color: var(--faint); font-size: 12px; }

@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; gap: 45px; padding-top: 70px; }
  .hero-panel { max-width: 680px; }
  .company-grid { grid-template-columns: repeat(2, 1fr); }
  .analytics-grid { grid-template-columns: 1fr; }
  .chart-card.full { grid-column: auto; }
}
@media (max-width: 680px) {
  .shell { width: min(calc(100% - 24px), var(--shell)); }
  .site-header { height: 72px; }
  .status-badge { display: none; }
  .hero { min-height: auto; padding: 64px 0 85px; }
  .hero h1 { font-size: 45px; }
  .hero-description { font-size: 15px; }
  .hero-meta { display: grid; gap: 18px; }
  section { margin-bottom: 80px; }
  .section-heading { align-items: start; display: grid; }
  .section-heading > p { display: none; }
  .company-grid { grid-template-columns: 1fr; }
  .analytics-grid { gap: 12px; }
  .chart-card { padding: 18px; min-height: 390px; }
  .chart-head-wrap { display: grid; }
  .chart-controls { justify-content: space-between; }
  .chart-area { height: 285px; }
  .line-chart { height: 320px; }
  .site-footer { display: grid; }
}
