:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #172033;
  --muted: #5f6b7c;
  --line: #dce2ea;
  --primary: #174ea6;
  --primary-dark: #103b7d;
  --primary-soft: #eaf2ff;
  --success: #16704a;
  --success-soft: #eaf7f1;
  --warning: #8a5a00;
  --warning-soft: #fff8e8;
  --danger: #a23b3b;
  --bear: #7c4d36;
  --base: #174ea6;
  --bull: #16704a;
  --shadow: 0 10px 28px rgba(23, 32, 51, 0.07);
  --radius: 16px;
  --radius-small: 10px;
  --container: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
select,
textarea {
  outline-color: var(--primary);
  outline-offset: 2px;
}

.container {
  width: min(calc(100% - 40px), var(--container));
  min-width: 0;
  margin-inline: auto;
}

.narrow {
  width: min(calc(100% - 40px), 820px);
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(220, 226, 234, 0.9);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.header-inner {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  flex: 0 0 auto;
  color: var(--text);
  font-size: 1.04rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand:hover {
  color: var(--primary);
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.site-nav a {
  padding: 8px 11px;
  border-radius: 8px;
  color: #384559;
  font-size: 0.93rem;
  font-weight: 650;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--primary);
  background: var(--primary-soft);
  text-decoration: none;
}

main {
  min-height: 62vh;
}

.hero {
  padding: 88px 0 66px;
  background:
    radial-gradient(circle at 83% 20%, rgba(42, 101, 190, 0.1), transparent 29%),
    linear-gradient(180deg, #ffffff 0%, #f6f9fd 100%);
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
  align-items: center;
  gap: 64px;
}

.eyebrow {
  display: inline-flex;
  margin: 0 0 15px;
  padding: 5px 11px;
  border: 1px solid #c9daf4;
  border-radius: 999px;
  color: var(--primary);
  background: #f6f9ff;
  font-size: 0.82rem;
  font-weight: 750;
  letter-spacing: 0.02em;
}

h1,
h2,
h3 {
  margin-top: 0;
  color: var(--text);
  line-height: 1.28;
  letter-spacing: -0.035em;
}

h1 {
  margin-bottom: 20px;
  font-size: clamp(2rem, 5vw, 3.45rem);
}

h2 {
  margin-bottom: 16px;
  font-size: clamp(1.45rem, 3vw, 2rem);
}

h3 {
  margin-bottom: 10px;
  font-size: 1.15rem;
}

p {
  margin-top: 0;
}

.hero-copy {
  max-width: 720px;
}

.hero-copy > p:not(.eyebrow) {
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 1.1rem;
}

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

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 10px 19px;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 750;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.button:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

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

.button-primary:hover {
  background: var(--primary-dark);
}

.button-secondary {
  border-color: #bdc8d8;
  color: #26344a;
  background: #ffffff;
}

.button-secondary:hover {
  border-color: #9dadc3;
  background: #f8fafc;
}

.hero-panel {
  padding: 25px;
  border: 1px solid #d5dfed;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.hero-art-panel {
  width: min(100%, 410px);
  padding: 18px;
  justify-self: end;
}

.hero-illustration {
  display: block;
  width: min(100%, 340px);
  height: auto;
  margin-inline: auto;
  border-radius: 12px;
  object-fit: contain;
}

.hero-art-panel .hero-panel-label {
  margin: 15px 8px 10px;
}

.hero-art-panel .mini-scenarios {
  padding: 0 4px 4px;
}

.hero-panel-label {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.mini-scenarios {
  display: grid;
  gap: 10px;
}

.mini-scenario {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 13px;
  border-radius: 9px;
  background: var(--surface-soft);
  font-size: 0.92rem;
}

.mini-scenario strong {
  color: var(--primary);
}

.section {
  padding: 72px 0;
}

.section-white {
  background: var(--surface);
}

.section-heading {
  max-width: 720px;
  margin-bottom: 30px;
}

.section-heading p,
.lead,
.muted {
  color: var(--muted);
}

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

.card-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 5px 18px rgba(23, 32, 51, 0.035);
}

.card p:last-child {
  margin-bottom: 0;
}

.number-mark {
  display: grid;
  width: 38px;
  height: 38px;
  margin-bottom: 17px;
  place-items: center;
  border-radius: 10px;
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 800;
}

.ad-placeholder {
  display: grid;
  min-height: 96px;
  place-items: center;
  margin: 30px auto;
  border: 1px dashed #b9c3d1;
  border-radius: 12px;
  color: #738095;
  background: #f7f8fa;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

.page-header {
  padding: 58px 0 40px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.page-header h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 2.75rem);
}

.page-header p {
  max-width: 820px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.04rem;
}

.page-header-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 280px);
  align-items: center;
  gap: 50px;
}

.page-header-copy {
  min-width: 0;
}

.page-illustration-frame {
  width: 100%;
  padding: 16px;
  justify-self: end;
  border: 1px solid #d7e3f2;
  border-radius: 22px;
  background: #eef6ff;
  box-shadow: 0 14px 34px rgba(23, 78, 166, 0.1);
}

.page-illustration-frame.warm {
  border-color: #e8decc;
  background: #fff9ee;
}

.page-illustration {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  object-fit: contain;
}

.calculator-layout {
  display: grid;
  min-width: 0;
  max-width: 100%;
  gap: 28px;
}

.calculator-layout > *,
#stock-calculator-form,
#compound-calculator-form {
  min-width: 0;
  max-width: 100%;
}

.panel {
  min-width: 0;
  max-width: 100%;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.panel-header > * {
  min-width: 0;
}

.panel-header h2,
.panel-header p {
  margin-bottom: 0;
}

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

.field {
  min-width: 0;
}

.field label {
  display: block;
  margin-bottom: 7px;
  color: #2e3a4d;
  font-size: 0.9rem;
  font-weight: 700;
}

.field small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid #bdc7d5;
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
}

.field textarea {
  min-height: 160px;
  resize: vertical;
}

.currency-field {
  padding: 12px;
  border: 1px solid #c9daf4;
  border-radius: 10px;
  background: var(--primary-soft);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 78, 166, 0.12);
}

.field input[readonly] {
  color: #465268;
  background: #f3f5f8;
}

.input-prefix {
  position: relative;
}

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

.scenario-card {
  min-width: 0;
  min-inline-size: 0;
  padding: 21px;
  border: 1px solid var(--line);
  border-top-width: 4px;
  border-radius: 13px;
  background: #ffffff;
}

.scenario-card.bear {
  border-top-color: var(--bear);
}

.scenario-card.base {
  border-top-color: var(--base);
}

.scenario-card.bull {
  border-top-color: var(--bull);
}

.scenario-card h3 {
  margin-bottom: 17px;
}

.scenario-card .field + .field {
  margin-top: 14px;
}

.table-scroll {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

th {
  color: #344158;
  background: #f5f7fa;
  font-size: 0.88rem;
  font-weight: 750;
}

th:first-child,
td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  text-align: left;
  background: #ffffff;
}

thead th:first-child {
  z-index: 2;
  background: #f5f7fa;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background-color: #fafcff;
}

.result-table {
  min-width: 700px;
}

.result-table tbody tr:nth-last-child(-n + 2) td {
  font-weight: 750;
}

.result-table [data-column="bear"] {
  color: var(--bear);
}

.result-table [data-column="base"] {
  color: var(--base);
}

.result-table [data-column="bull"] {
  color: var(--bull);
}

.interpretation {
  margin-top: 20px;
  padding: 20px 22px;
  border-left: 4px solid var(--primary);
  border-radius: 0 10px 10px 0;
  color: #28364a;
  background: var(--primary-soft);
}

.interpretation p:last-child {
  margin-bottom: 0;
}

.warning-box,
.info-box {
  margin-top: 22px;
  padding: 19px 21px;
  border-radius: 11px;
}

.warning-box {
  border: 1px solid #ead9aa;
  color: #62460c;
  background: var(--warning-soft);
}

.info-box {
  border: 1px solid #c9daf4;
  color: #24436e;
  background: var(--primary-soft);
}

.warning-box strong,
.info-box strong {
  display: block;
  margin-bottom: 4px;
}

.sensitivity-table {
  min-width: 760px;
}

.sensitivity-table td.negative {
  color: var(--danger);
  background: #fff6f6;
}

.sensitivity-table td.moderate {
  color: #61480e;
  background: #fffaf0;
}

.sensitivity-table td.positive {
  color: var(--success);
  background: #f1faf6;
}

.result-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}

.metric-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.metric-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.metric-value {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}

.article {
  padding: 58px 0 76px;
}

.article-content {
  padding: 36px 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.article-content h2 {
  margin-top: 46px;
  padding-top: 6px;
  font-size: 1.55rem;
}

.article-content h2:first-child {
  margin-top: 0;
}

.article-content h3 {
  margin-top: 28px;
}

.article-content p,
.article-content li {
  color: #354258;
}

.article-content ul,
.article-content ol {
  padding-left: 24px;
}

.article-content li + li {
  margin-top: 8px;
}

.formula {
  overflow-x: auto;
  margin: 20px 0;
  padding: 17px 19px;
  border: 1px solid #d7e1ef;
  border-radius: 10px;
  color: #203c66;
  background: #f6f9fd;
  font-weight: 700;
  white-space: nowrap;
}

.contact-form {
  display: grid;
  gap: 18px;
}

.site-footer {
  padding: 42px 0 30px;
  border-top: 1px solid var(--line);
  background: #172033;
  color: #d8dfeb;
}

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

.footer-brand {
  margin-bottom: 8px;
  color: #ffffff;
  font-weight: 800;
}

.footer-copy {
  max-width: 540px;
  margin-bottom: 0;
  color: #b4bece;
  font-size: 0.88rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 18px;
}

.footer-links a {
  color: #e6ebf3;
  font-size: 0.88rem;
}

.footer-bottom {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #344158;
  color: #9faabd;
  font-size: 0.8rem;
}

.text-center {
  text-align: center;
}

.justify-center {
  justify-content: center;
}

.spacer-top {
  margin-top: 28px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  .header-inner {
    padding: 13px 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .site-nav {
    width: 100%;
    max-width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .hero-panel {
    max-width: 520px;
  }

  .hero-art-panel {
    justify-self: start;
  }

  .page-header-grid {
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 30px;
  }

  .input-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 700px) {
  .container,
  .narrow {
    width: min(calc(100% - 28px), var(--container));
  }

  .hero {
    padding: 58px 0 48px;
  }

  .section {
    padding: 52px 0;
  }

  .page-header {
    padding: 42px 0 30px;
  }

  .page-header-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .page-illustration-frame {
    width: min(100%, 240px);
    margin-inline: auto;
    justify-self: center;
  }

  .hero-art-panel {
    width: min(100%, 380px);
    margin-inline: auto;
    justify-self: center;
  }

  .panel,
  .article-content {
    padding: 22px 18px;
  }

  .panel {
    overflow: hidden;
  }

  .input-grid,
  .scenario-grid,
  .result-summary,
  .card-grid.two {
    grid-template-columns: 1fr;
  }

  .panel-header,
  .footer-top {
    flex-direction: column;
  }

  .footer-links {
    justify-content: flex-start;
  }

  th,
  td {
    padding: 11px 12px;
  }

  .ad-placeholder {
    min-height: 80px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
