:root {
  --bg: #f4efe6;
  --panel: rgba(255, 250, 242, 0.78);
  --panel-strong: #fff8ee;
  --text: #182026;
  --muted: #5f6a70;
  --line: rgba(24, 32, 38, 0.1);
  --gold: #c9892b;
  --navy: #14324a;
  --teal: #1c7a6c;
  --red: #bf5a46;
  --shadow: 0 18px 50px rgba(20, 50, 74, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Noto Sans KR", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(201, 137, 43, 0.24), transparent 25%),
    radial-gradient(circle at right 20%, rgba(28, 122, 108, 0.18), transparent 20%),
    linear-gradient(160deg, #f8f1e7 0%, #f1ebdf 38%, #e9efe9 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(20, 50, 74, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 50, 74, 0.02) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 64px;
}

.hero,
.controls-section,
.chart-section,
.projection-section,
.table-section,
.insights-grid {
  position: relative;
  z-index: 1;
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 28px;
}

.hero-copy,
.hero-panel,
.controls-section,
.chart-section,
.projection-section,
.table-section,
.insight-card {
  background: var(--panel);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 40px;
  border-radius: 32px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  color: var(--navy);
  font-family: "Space Grotesk", sans-serif;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(2.4rem, 4vw, 4.4rem);
  line-height: 0.96;
}

.hero-text {
  margin: 18px 0 0;
  max-width: 56ch;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

#languageBtn {
  min-width: 104px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 0;
  text-decoration: none;
  cursor: pointer;
  font: 600 0.95rem "Space Grotesk", sans-serif;
}

.button.primary {
  background: var(--navy);
  color: #fff;
}

.button.secondary {
  background: rgba(20, 50, 74, 0.08);
  color: var(--navy);
}

.hero-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 22px;
  border-radius: 32px;
}

.stat-card {
  padding: 22px;
  border-radius: 22px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 8px;
}

.stat-card strong {
  font-size: 1.8rem;
  font-family: "Space Grotesk", sans-serif;
}

.controls-section,
.chart-section,
.projection-section,
.table-section {
  padding: 28px;
  margin-top: 24px;
  border-radius: 28px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 18px;
}

.section-heading h2 {
  font-size: clamp(1.5rem, 2.5vw, 2.4rem);
}

.controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.controls label {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
}

.controls span,
.controls strong,
select,
input {
  font-size: 0.96rem;
}

select,
input[type="range"] {
  width: 100%;
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.toggle-card small {
  color: var(--muted);
  line-height: 1.5;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toggle-status {
  font: 700 0.95rem "Space Grotesk", sans-serif;
  color: var(--navy);
}

.toggle-row input[type="checkbox"] {
  width: 48px;
  height: 24px;
  accent-color: var(--teal);
}

.projection-note {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.7;
}

.projection-controls,
.projection-summary {
  display: grid;
  gap: 16px;
}

.projection-controls {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compare-controls {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.projection-controls label,
.summary-card,
.projection-chart-card,
.projection-table {
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--line);
  border-radius: 22px;
}

.projection-controls label {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
}

.projection-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.summary-card {
  padding: 20px;
}

.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 10px;
}

.summary-card strong {
  font: 700 1.6rem "Space Grotesk", sans-serif;
}

.projection-chart-card {
  margin-top: 18px;
  padding: 22px;
}

.projection-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 14px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 999px;
}

.swatch-value {
  background: var(--navy);
}

.swatch-dividend {
  background: rgba(201, 137, 43, 0.7);
}

.swatch-value-a {
  background: var(--red);
}

.swatch-value-b {
  background: var(--gold);
}

.projection-stock-title {
  margin-bottom: 10px;
  font: 700 1rem "Space Grotesk", sans-serif;
}

.projection-stock-subtitle {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

.projection-chart {
  position: relative;
  overflow-x: auto;
}

.projection-svg {
  width: 100%;
  min-width: 720px;
  display: block;
}

.projection-axis {
  stroke: rgba(24, 32, 38, 0.18);
  stroke-width: 1.2;
}

.projection-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.projection-area {
  opacity: 0.16;
}

.projection-area-primary {
  fill: var(--red);
}

.projection-area-tertiary {
  fill: var(--gold);
}

.projection-line-primary {
  stroke: var(--red);
}

.projection-line-secondary {
  stroke: var(--gold);
  opacity: 0.9;
}

.projection-line-tertiary {
  stroke: var(--gold);
}

.projection-dot {
  stroke: #fff8ee;
  stroke-width: 2;
}

.projection-dot-primary {
  fill: var(--red);
}

.projection-dot-tertiary {
  fill: var(--gold);
}

.projection-hover-target {
  fill: transparent;
  cursor: crosshair;
}

.projection-tooltip {
  position: absolute;
  z-index: 2;
  min-width: 156px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(24, 32, 38, 0.92);
  color: #fff8ee;
  font-size: 0.84rem;
  line-height: 1.5;
  pointer-events: none;
  box-shadow: 0 10px 24px rgba(20, 50, 74, 0.18);
}

.projection-tooltip-title {
  margin-bottom: 4px;
  font: 700 0.86rem "Space Grotesk", sans-serif;
}

.projection-bar {
  fill: rgba(201, 137, 43, 0.24);
}

.projection-axis-label {
  fill: var(--muted);
  font-size: 11px;
  font-family: "Space Grotesk", sans-serif;
}

.projection-table {
  margin-top: 18px;
  overflow: hidden;
}

.projection-table-row {
  display: grid;
  grid-template-columns: 72px repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}

.projection-table-row span {
  font-size: 0.94rem;
}

.projection-table-head {
  background: rgba(20, 50, 74, 0.05);
  border-top: 0;
  font-weight: 700;
}

.projection-table-group-head {
  background: rgba(20, 50, 74, 0.08);
}

.projection-table-group-label {
  font-family: "Space Grotesk", sans-serif;
}

.projection-table-row-compare {
  grid-template-columns: 72px repeat(4, minmax(0, 1fr));
}

.insight-card {
  padding: 24px;
  border-radius: 24px;
  overflow: hidden;
}

.insight-card p {
  margin: 0 0 10px;
  font: 600 0.88rem "Space Grotesk", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.insight-card h3 {
  font-size: 1.28rem;
  line-height: 1.25;
}

.accent-gold {
  background: linear-gradient(145deg, rgba(201, 137, 43, 0.16), rgba(255, 248, 238, 0.92));
}

.accent-blue {
  background: linear-gradient(145deg, rgba(20, 50, 74, 0.12), rgba(255, 248, 238, 0.92));
}

.accent-green {
  background: linear-gradient(145deg, rgba(28, 122, 108, 0.16), rgba(255, 248, 238, 0.92));
}

.bar-chart {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: 180px 1fr 72px;
  gap: 14px;
  align-items: center;
}

.bar-label,
.bar-value {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
}

.bar-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.2;
}

.bar-label-top {
  font-size: 0.82rem;
  color: var(--muted);
}

.bar-label-bottom {
  font-size: 0.92rem;
  color: var(--text);
}

.bar-track {
  position: relative;
  height: 14px;
  background: rgba(20, 50, 74, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--teal));
}

.stock-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.stock-card {
  padding: 22px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.stock-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(20, 50, 74, 0.12);
}

.stock-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.badge-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 8px;
}

.ticker {
  margin: 0 0 4px;
  color: var(--muted);
  font: 600 0.86rem "Space Grotesk", sans-serif;
  letter-spacing: 0.08em;
}

.market,
.sector {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
}

.market {
  background: rgba(28, 122, 108, 0.12);
  color: var(--teal);
}

.sector {
  background: rgba(20, 50, 74, 0.08);
  font-size: 0.8rem;
}

.yield-badge {
  display: inline-flex;
  margin-top: 20px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(201, 137, 43, 0.14);
  color: var(--navy);
  font: 700 1rem "Space Grotesk", sans-serif;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 0;
}

.metrics div {
  padding: 12px;
  border-radius: 16px;
  background: rgba(20, 50, 74, 0.04);
}

.metrics dt {
  font-size: 0.78rem;
  color: var(--muted);
}

.metrics dd {
  margin: 8px 0 0;
  font: 700 1rem "Space Grotesk", sans-serif;
}

.note {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.92rem;
}

@media (max-width: 980px) {
  .hero,
  .controls,
  .projection-controls,
  .compare-controls,
  .projection-summary,
  .insights-grid,
  .stock-grid {
    grid-template-columns: 1fr;
  }

  .metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 20px;
  }

  .hero-copy,
  .hero-panel,
  .controls-section,
  .chart-section,
  .projection-section,
  .table-section {
    padding: 20px;
    border-radius: 24px;
  }

  h1 {
    font-size: 2.2rem;
  }

  .bar-row {
    grid-template-columns: 132px 1fr 58px;
    gap: 8px;
  }

  .projection-table-row {
    grid-template-columns: 56px repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 12px 14px;
  }
}
