:root {
  --bg: #f3efe6;
  --paper: #fffdf8;
  --paper-strong: #fffaf1;
  --ink: #172118;
  --muted: #4f5b52;
  --line: rgba(23, 33, 24, 0.12);
  --accent: #a24f1d;
  --forest: #243e30;
  --gold: #be8a32;
  --rose: #b65b56;
  --shadow: 0 18px 48px rgba(44, 36, 28, 0.08);
  --radius: 28px;
  --radius-sm: 18px;
  --max: 1320px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.08)),
    var(--bg);
  color: var(--ink);
  font-family: "Noto Sans KR", sans-serif;
  font-size: 18px;
  line-height: 1.92;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(23, 33, 24, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 33, 24, 0.028) 1px, transparent 1px);
  background-size: 72px 72px;
  opacity: 0.35;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

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

.hero-title,
.page-title,
.section-title,
.chapter-title,
.simulator-title {
  font-family: "Cormorant Garamond", "Noto Serif KR", serif;
}

.eyebrow,
.page-kicker,
.chapter-meta,
.roadmap-step small {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  font-weight: 700;
}

.hero {
  padding: 44px 0 28px;
}

.hero-grid,
.page-hero {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 22px;
  align-items: stretch;
}

.hero-card,
.mini-panel,
.content-block,
.simulator-card,
.chapter-card,
.roadmap-step,
.page-nav a {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 56px 56px 50px;
  position: relative;
  overflow: hidden;
}

.hero-card::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -40px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(162, 79, 29, 0.18), transparent 70%);
}

.hero-title {
  margin: 14px 0 16px;
  font-size: clamp(62px, 8vw, 104px);
  line-height: 0.9;
  letter-spacing: -0.035em;
}

.hero-subtitle {
  max-width: 780px;
  font-size: 28px;
  line-height: 1.35;
  color: var(--forest);
}

.hero-copy {
  max-width: 860px;
  margin-top: 22px;
  font-size: 21px;
  color: var(--muted);
}

.hero-note {
  padding: 34px 30px;
  background: var(--paper-strong);
}

.hero-note h3,
.chapter-note h3,
.simulator-title {
  margin: 0 0 12px;
  font-size: 28px;
  line-height: 1.1;
}

.hero-note p,
.chapter-note p,
.simulator-copy,
.content-block p,
.chapter-card p,
.roadmap-step p {
  margin: 0 0 14px;
  font-size: 19px;
  color: var(--muted);
}

.hero-actions,
.page-actions,
.chapter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 16px;
  font-weight: 700;
}

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

.button.secondary {
  background: transparent;
  border-color: var(--line);
}

.section {
  padding: 24px 0 18px;
}

.section-header {
  margin-bottom: 18px;
}

.section-title {
  margin: 8px 0 0;
  font-size: clamp(36px, 4.6vw, 64px);
  line-height: 0.96;
}

.roadmap-grid {
  display: grid;
  gap: 16px;
}

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

.roadmap-step {
  padding: 24px 22px;
}

.roadmap-step h3 {
  margin: 0 0 8px;
  font-size: 31px;
  line-height: 1;
}

.card-grid {
  display: grid;
  gap: 18px;
}

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

.chapter-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px 28px 26px;
}

.chapter-top {
  display: block;
}

.chapter-title {
  margin: 4px 0 0;
  font-size: 40px;
  line-height: 0.98;
}

.page-shell {
  padding: 32px 0 56px;
}

.page-panel,
.content-block,
.simulator-card {
  padding: 34px 36px;
}

.page-title {
  margin: 12px 0 14px;
  font-size: clamp(52px, 7vw, 92px);
  line-height: 0.9;
  letter-spacing: -0.03em;
}

.page-question {
  margin: 0;
  font-size: 28px;
  line-height: 1.45;
  color: var(--forest);
}

.goal-list {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

.goal-item {
  padding-left: 18px;
  border-left: 4px solid var(--accent);
  font-size: 19px;
}

.chapter-note {
  padding: 32px 28px;
  background: var(--paper-strong);
}

.page-body,
.simulator-section {
  margin-top: 24px;
}

.content-stack {
  display: grid;
  gap: 18px;
}

.content-block {
  max-width: 980px;
}

.content-block h3 {
  margin: 0 0 18px;
  font-size: 34px;
  line-height: 1.1;
  color: var(--forest);
}

.content-block p:last-child,
.chapter-card p:last-child,
.hero-note p:last-child,
.chapter-note p:last-child,
.roadmap-step p:last-child {
  margin-bottom: 0;
}

.equation {
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(36, 62, 48, 0.06);
  font-family: "IBM Plex Mono", monospace;
  font-size: 16px;
  overflow-x: auto;
  white-space: pre-wrap;
}

.simulator-card {
  background: linear-gradient(180deg, #fffef9, #fbf6ec);
}

.sim-panel {
  display: grid;
  gap: 16px;
}

.sim-canvas,
.sim-svg {
  width: 100%;
  min-height: 320px;
  border-radius: 22px;
  background: #fffdf8;
  border: 1px solid var(--line);
}

.sim-canvas-secondary {
  min-height: 240px;
}

.sim-canvas-tertiary {
  min-height: 220px;
}

.controls {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.control {
  display: grid;
  grid-template-columns: 220px 1fr auto;
  gap: 14px;
  align-items: center;
}

.control span,
.sim-output,
.table-like td,
.table-like th,
.sim-detail-box li {
  font-size: 16px;
}

.control input,
.control select {
  width: 100%;
}

input[type="range"] {
  accent-color: var(--forest);
}

.sim-output {
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
}

.sim-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 15px;
}

.sim-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sim-legend i {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
}

.sim-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.sim-detail-box {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
}

.sim-detail-box h4 {
  margin: 0 0 8px;
  font-size: 18px;
}

.sim-detail-box ul,
.content-block ul {
  margin: 0;
  padding-left: 20px;
}

.table-like {
  width: 100%;
  border-collapse: collapse;
  margin-top: 18px;
}

.table-like th,
.table-like td {
  padding: 14px 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.table-like th {
  color: var(--accent);
  font-weight: 700;
}

.page-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 28px;
}

.page-nav a {
  padding: 18px 20px;
}

.page-nav small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.page-nav strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
  line-height: 1.2;
}

@media (max-width: 1160px) {
  .flow-grid,
  .chapter-list-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-grid,
  .page-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  body {
    font-size: 17px;
  }

  .shell {
    width: min(calc(100% - 24px), var(--max));
  }

  .hero-card,
  .page-panel,
  .content-block,
  .simulator-card,
  .chapter-card,
  .roadmap-step,
  .page-nav a,
  .mini-panel {
    padding: 24px;
  }

  .hero-title,
  .page-title {
    font-size: 52px;
  }

  .hero-subtitle,
  .page-question {
    font-size: 24px;
  }

  .content-block h3,
  .chapter-title {
    font-size: 30px;
  }

  .flow-grid,
  .chapter-list-grid,
  .page-nav,
  .sim-meta-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 560px) {
  .hero-title,
  .page-title {
    font-size: 42px;
  }

  .hero-subtitle,
  .page-question,
  .hero-copy,
  .content-block p,
  .chapter-card p,
  .roadmap-step p {
    font-size: 18px;
  }
}
