:root {
  --bg: #f3efe6;
  --bg-deep: #ece6da;
  --surface: rgba(255, 252, 247, 0.78);
  --surface-strong: #fbf9f4;
  --line: rgba(50, 69, 60, 0.16);
  --line-strong: rgba(37, 55, 48, 0.26);
  --text: #21312b;
  --muted: #5e6f68;
  --accent: #314b42;
  --accent-soft: #dbe4db;
  --accent-warm: #9c7d5d;
  --success: #2f6b4f;
  --warn: #9a6b2f;
  --max-width: 1180px;
  --shadow: 0 22px 60px rgba(29, 43, 37, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  font-family: "Work Sans", "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  line-height: 1.62;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(49, 75, 66, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(49, 75, 66, 0.026) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.8), transparent 78%);
}

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

button,
select {
  font: inherit;
}

a:focus-visible,
button:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(49, 75, 66, 0.34);
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  top: -4rem;
  left: 1rem;
  z-index: 100;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(49, 75, 66, 0.12);
  background: rgba(243, 239, 230, 0.88);
  backdrop-filter: blur(18px);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand-mark {
  display: grid;
  width: 2.45rem;
  height: 2.45rem;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
  font-family: "Newsreader", "Noto Serif KR", serif;
  font-size: 1.08rem;
  letter-spacing: 0;
  text-transform: none;
}

.nav-links {
  display: inline-flex;
  align-items: center;
  gap: 1.25rem;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.nav-links a {
  position: relative;
  padding-bottom: 0.16rem;
}

.nav-links a::after {
  position: absolute;
  bottom: -0.12rem;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  content: "";
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.18s ease;
}

.nav-links a:hover::after,
.nav-links a.is-active::after {
  transform: scaleX(1);
}

.nav-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-width: fit-content;
}

.profile-metrics {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  color: var(--muted);
}

.profile-metrics-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 0.32rem;
  min-height: 1.8rem;
  padding: 0.28rem 0.58rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.profile-metrics strong {
  color: var(--accent);
  font-weight: 800;
}

.profile-metrics[data-state="loading"] strong {
  color: var(--muted);
}

.profile-metrics[data-state="error"] {
  display: none;
}

.command-center {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(18rem, 0.74fr);
  gap: clamp(1rem, 3vw, 2.2rem);
  align-items: start;
  padding: clamp(2.9rem, 5.5vw, 4.8rem) 0 0.9rem;
}

.section-label {
  margin: 0 0 0.75rem;
  color: var(--accent-warm);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
.chapter-number,
.route-number {
  font-family: "Newsreader", "Noto Serif KR", Georgia, serif;
  font-weight: 600;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.6rem, 4.8vw, 4.05rem);
  line-height: 1.08;
  word-break: keep-all;
}

h2 {
  margin: 0;
  font-size: clamp(1.75rem, 3.2vw, 2.75rem);
  line-height: 1.12;
  word-break: keep-all;
}

h3 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.18;
  word-break: keep-all;
}

.lede {
  max-width: 42rem;
  margin: 1.25rem 0 0;
  color: rgba(33, 49, 43, 0.92);
  font-size: clamp(1.02rem, 1.6vw, 1.18rem);
}

.supporting {
  max-width: 40rem;
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.45rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0.78rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  transition:
    transform 0.18s ease,
    background 0.18s ease;
}

.button:hover {
  background: #243932;
  transform: translateY(-1px);
}

.button-ghost {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.55);
  color: var(--text);
}

.button-ghost:hover {
  background: rgba(255, 255, 255, 0.92);
}

.role-panel,
.lab-surface,
.checklist-panel {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.role-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 16.5rem;
  padding: clamp(1.05rem, 2.4vw, 1.45rem);
}

.role-panel h2 {
  font-size: clamp(2.05rem, 3.8vw, 3.05rem);
}

.panel-heading {
  display: grid;
  gap: 0.25rem;
}

.role-summary {
  margin: 1.2rem 0 1.4rem;
  color: var(--muted);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.mobile-role-jump {
  display: none;
  margin-top: 0.85rem;
}

.topic-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1.2rem 0 0;
}

.topic-tab,
.choice-button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.54);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    transform 0.16s ease;
}

.topic-tab {
  min-height: 2.85rem;
  padding: 0 0.9rem;
}

.topic-tab:hover,
.choice-button:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.topic-tab.active {
  border-color: rgba(49, 75, 66, 0.52);
  background: var(--accent);
  color: #fff;
}

.section,
.section-grid {
  padding: clamp(1.6rem, 3.8vw, 3rem) 0 0;
  scroll-margin-top: 6rem;
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(12.5rem, 0.46fr) minmax(0, 1.54fr);
  gap: clamp(1rem, 2.8vw, 1.6rem);
  align-items: start;
}

#lens-lab.section-grid {
  grid-template-columns: 1fr;
}

#lens-lab .section-copy {
  display: grid;
  grid-template-columns: minmax(16rem, 0.38fr) minmax(0, 0.62fr);
  gap: clamp(0.8rem, 2vw, 1.25rem);
  align-items: end;
}

#lens-lab .section-copy .section-label {
  grid-column: 1;
  grid-row: 1;
}

#lens-lab .section-copy h2 {
  grid-column: 1;
  grid-row: 2;
}

#lens-lab .section-copy p:not(.section-label) {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  margin: 0;
}

.section-copy p:not(.section-label),
.section-heading p:not(.section-label) {
  max-width: 44rem;
  margin: 1rem 0 0;
  color: var(--muted);
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.2rem;
}

.route-grid article,
.chapter-card,
.result-box,
.scenario-box,
.workflow-inline {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
}

.route-grid article {
  min-height: 10.5rem;
  padding: 0.9rem;
}

.route-number {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  margin-bottom: 1.1rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--accent);
  font-size: 1.4rem;
  font-weight: 700;
}

.route-grid p {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.lab-surface {
  display: grid;
  grid-template-columns: minmax(17rem, 0.58fr) minmax(0, 1.42fr);
  gap: 0.75rem;
  padding: 0.85rem;
}

#lens-lab .control-row,
#lens-lab .workflow-inline {
  grid-column: 1 / -1;
}

.control-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

select {
  width: 100%;
  min-height: 2.45rem;
  padding: 0 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
}

.result-box,
.scenario-box,
.workflow-inline {
  padding: 0.85rem;
}

.result-status {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 1.75rem;
  padding: 0.2rem 0.58rem;
  border-radius: 999px;
  background: rgba(47, 107, 79, 0.12);
  color: var(--success);
  font-size: 0.85rem;
  font-weight: 700;
}

.result-copy {
  margin: 0.65rem 0 0;
}

.result-next,
.scenario-context,
.scenario-feedback {
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.scenario-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(11rem, 0.45fr);
  gap: 0.75rem;
  align-items: start;
}

.choice-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 1rem;
}

.choice-button {
  min-height: 2.55rem;
  padding: 0.62rem 0.75rem;
  text-align: left;
}

.choice-button.active {
  border-color: rgba(49, 75, 66, 0.5);
  background: rgba(219, 228, 219, 0.72);
}

.workflow-inline-head {
  margin-bottom: 0.7rem;
}

.workflow-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.workflow-step {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
  padding: 0.72rem;
}

.workflow-step.current {
  border-color: rgba(49, 75, 66, 0.5);
  background: rgba(219, 228, 219, 0.72);
}

.workflow-step strong {
  display: block;
  font-size: 0.9rem;
}

.workflow-step span {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.2rem;
}

.chapter-card {
  display: grid;
  gap: 0.68rem;
  min-height: 25rem;
  padding: 0.88rem;
}

.chapter-card-visual {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(49, 75, 66, 0.14);
  border-radius: calc(var(--radius) - 2px);
  background: rgba(246, 240, 229, 0.72);
}

.chapter-card-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease, filter 180ms ease;
}

.chapter-card:hover .chapter-card-visual img {
  transform: scale(1.025);
  filter: saturate(1.04) contrast(1.02);
}

.chapter-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
}

.chapter-number {
  color: var(--accent-warm);
  font-size: 2rem;
  line-height: 1;
}

.chapter-card h3 {
  font-size: 1.1rem;
}

.chapter-card h3 a {
  color: inherit;
}

.chapter-card h3 a:hover {
  color: var(--accent);
}

.chapter-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.chapter-meta {
  display: grid;
  gap: 0.45rem;
  padding-top: 0.2rem;
}

.chapter-meta p {
  color: var(--text);
}

.chapter-meta span {
  color: var(--muted);
}

.chapter-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-self: end;
}

.topic-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.72rem;
  padding: 0.22rem 0.58rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--accent-warm);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.mini-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.mini-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 1.55rem;
  padding: 0.18rem 0.48rem;
  border: 1px solid rgba(49, 75, 66, 0.12);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.mini-link,
.text-link {
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(49, 75, 66, 0.22);
  text-underline-offset: 0.18rem;
}

.primary-link {
  color: var(--text);
  text-decoration-color: rgba(156, 125, 93, 0.55);
}

.chapter-page {
  padding: clamp(2rem, 4vw, 3.4rem) 0 0;
}

.breadcrumb {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 1.3rem;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(49, 75, 66, 0.22);
  text-underline-offset: 0.18rem;
}

.chapter-hero {
  display: grid;
  grid-template-columns: minmax(13rem, 0.36fr) minmax(0, 1.64fr);
  gap: clamp(0.9rem, 2.4vw, 1.5rem);
  align-items: start;
  min-width: 0;
}

.chapter-side {
  position: sticky;
  top: 5.4rem;
  display: grid;
  gap: 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.chapter-side .chapter-number {
  margin-top: 0.2rem;
}

.chapter-side h1 {
  max-width: 100%;
  margin: 0;
  font-size: clamp(1.45rem, 2vw, 1.9rem);
  line-height: 1.12;
  overflow-wrap: break-word;
  word-break: keep-all;
}

.chapter-side p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.chapter-main {
  display: grid;
  gap: 0.85rem;
  min-width: 0;
}

.chapter-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
  padding: 0.95rem;
  min-width: 0;
}

.chapter-block h2 {
  font-size: clamp(1.28rem, 2.1vw, 1.75rem);
}

.chapter-block p {
  color: var(--muted);
}

.chapter-block ul {
  display: grid;
  gap: 0.48rem;
  margin: 0.8rem 0 0;
  padding-left: 1.15rem;
  color: var(--muted);
}

.source-lecture-block {
  display: grid;
  gap: 0.9rem;
  padding: clamp(1rem, 2.6vw, 1.35rem);
  min-width: 0;
}

.source-lecture-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.reference-note-status {
  width: fit-content;
  border: 1px solid rgba(49, 75, 66, 0.16);
  border-radius: 999px;
  background: rgba(219, 228, 219, 0.54);
  color: var(--muted);
  padding: 0.35rem 0.68rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.reference-note-content {
  display: block;
  min-width: 0;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  color: var(--text);
}

.reference-note-content h1,
.reference-note-content h2,
.reference-note-content h3,
.reference-note-content h4 {
  color: var(--text);
  word-break: keep-all;
}

.reference-note-content h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.55rem, 2.8vw, 2.35rem);
  line-height: 1.18;
}

.reference-note-content h2 {
  margin-top: 2.3rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  font-size: clamp(1.32rem, 2.2vw, 1.9rem);
}

.reference-note-content h3 {
  margin-top: 1.65rem;
  font-size: 1.18rem;
}

.reference-note-content h4 {
  margin-top: 1.2rem;
  color: var(--accent-warm);
  font-size: 1rem;
}

.reference-note-content p {
  color: rgba(33, 49, 43, 0.88);
  line-height: 1.82;
  overflow-wrap: anywhere;
}

.reference-note-content a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(49, 75, 66, 0.22);
  text-underline-offset: 0.18rem;
}

.reference-note-content ul,
.reference-note-content ol {
  display: block;
  min-width: 0;
  padding-left: 1.25rem;
  color: rgba(33, 49, 43, 0.88);
}

.reference-note-content li {
  max-width: 100%;
  margin: 0.38rem 0;
  overflow-wrap: anywhere;
}

.reference-note-content .toc,
.reference-note-content .key-point,
.reference-note-content .example-box,
.reference-note-content .reference-container,
.reference-note-content blockquote {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
  padding: 0.9rem;
  margin: 1rem 0;
}

.reference-note-content .toc ul {
  margin: 0.3rem 0 0;
}

.reference-note-content .key-point {
  border-color: rgba(47, 107, 79, 0.22);
  background: rgba(219, 228, 219, 0.54);
}

.reference-note-content .example-box {
  border-color: rgba(156, 125, 93, 0.24);
  background: rgba(156, 125, 93, 0.08);
}

.reference-note-content .math-formula,
.reference-note-content mjx-container {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
}

.reference-note-content mjx-container {
  display: inline-block !important;
  min-width: 0;
  vertical-align: middle;
}

.reference-note-content mjx-container[display="true"] {
  display: block !important;
  width: 100%;
}

.reference-note-content .math-formula {
  border: 1px solid rgba(49, 75, 66, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
  padding: 0.7rem;
  margin: 0.85rem 0;
  text-align: center;
}

.reference-note-content pre {
  overflow-x: auto;
  max-width: 100%;
  border-radius: var(--radius);
  background: #1f2d28;
  color: #f6f0e5;
  padding: 0.85rem;
  line-height: 1.55;
}

.reference-note-content code {
  border-radius: 0.3rem;
  background: rgba(31, 45, 40, 0.08);
  padding: 0.1rem 0.24rem;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.88em;
}

.reference-note-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.reference-note-content table {
  display: block;
  overflow-x: auto;
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.reference-note-content th,
.reference-note-content td {
  border: 1px solid var(--line);
  padding: 0.58rem 0.65rem;
  text-align: left;
  vertical-align: top;
}

.reference-note-content th {
  background: rgba(219, 228, 219, 0.54);
}

.reference-note-content img {
  display: block;
  max-width: 100%;
  height: auto;
  max-height: 360px;
  margin: 1rem auto;
  border-radius: var(--radius);
}

.reference-note-content figure {
  margin: 1.4rem 0;
  text-align: center;
}

.reference-note-content figcaption {
  color: var(--muted);
  font-size: 0.85rem;
}

.reference-note-content .chart-container {
  position: relative;
  width: min(100%, 720px);
  min-height: 260px;
  margin: 1.3rem auto;
}

.reference-note-content canvas {
  max-width: 100%;
}

.reference-note-content .reference-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.65rem;
  border-top: 1px solid var(--line);
  padding-top: 0.7rem;
  margin-top: 0.7rem;
}

.reference-note-content .reference-item:first-child {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

.reference-note-content .reference-number {
  color: var(--accent-warm);
  font-weight: 800;
}

.reference-note-content .reference-link {
  overflow-wrap: anywhere;
  font-size: 0.86rem;
}

.chapter-intro {
  display: grid;
  grid-template-columns: minmax(18rem, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(0.9rem, 2.4vw, 1.35rem);
  align-items: center;
  padding: clamp(0.9rem, 2.5vw, 1.2rem);
}

.chapter-intro-visual {
  display: grid;
  gap: 0.48rem;
  min-width: 0;
  margin: 0;
}

.chapter-intro-visual img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid rgba(49, 75, 66, 0.14);
  border-radius: calc(var(--radius) - 2px);
  background: rgba(246, 240, 229, 0.72);
}

.chapter-intro-visual figcaption {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.chapter-intro-copy {
  min-width: 0;
}

.chapter-intro-copy p:not(.section-label) {
  max-width: 48rem;
}

.intro-point-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  margin-top: 0.9rem;
}

.intro-point-grid span {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.54);
  padding: 0.75rem;
  color: var(--text);
  font-size: 0.9rem;
}

.equation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.equation-card {
  display: grid;
  gap: 0.55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.54);
  padding: 0.75rem;
}

.equation-card code {
  color: #f6f0e5;
  background: #1f2d28;
  border-radius: var(--radius);
  padding: 0.58rem;
  overflow-wrap: anywhere;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
}

.equation-card p {
  margin: 0;
  font-size: 0.88rem;
}

.next-steps-block {
  background: rgba(156, 125, 93, 0.08);
  border-color: rgba(156, 125, 93, 0.24);
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.source-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.28rem 0.58rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.source-pill:hover {
  border-color: var(--line-strong);
  color: var(--accent);
}

.chapter-nav {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.takehome-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(0.9rem, 2.5vw, 1.25rem);
  align-items: start;
  margin-top: 1.2rem;
}

.summary-figure {
  display: grid;
  gap: 0.5rem;
  width: min(100%, 980px);
  margin: 1.2rem auto 0;
}

.summary-figure img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.42);
  box-shadow: var(--shadow);
}

.summary-figure figcaption {
  color: var(--muted);
  font-size: 0.88rem;
}

.takeaway-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.takeaway-card {
  display: grid;
  gap: 0.6rem;
  min-height: 9.5rem;
  padding: 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
}

.takeaway-number {
  display: inline-grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--accent-warm);
  font-family: "Newsreader", "Noto Serif KR", Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
}

.takeaway-card h3 {
  font-size: 1.18rem;
}

.takeaway-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.checklist-panel {
  padding: 1rem;
}

.selfcheck-panel {
  display: grid;
  gap: 0.85rem;
}

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

.selfcheck-head h3 {
  font-size: 1.22rem;
}

.selfcheck-head p:not(.section-label) {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.checklist {
  display: grid;
  gap: 0.65rem;
}

.check-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
}

.check-item input {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.18rem;
  accent-color: var(--accent);
}

.check-item strong {
  display: block;
  font-size: 0.96rem;
}

.check-item span {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.reset-button {
  margin-top: 0.9rem;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 2rem 0 3rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer a {
  color: var(--text);
  border-bottom: 1px solid var(--line-strong);
}

.footer a:hover {
  color: var(--accent);
  border-bottom-color: currentColor;
}

@media (max-width: 1040px) {
  .command-center,
  .section-grid,
  .chapter-hero,
  .takehome-layout {
    grid-template-columns: 1fr;
  }

  #lens-lab .section-copy,
  .lab-surface {
    grid-template-columns: 1fr;
  }

  #lens-lab .section-copy .section-label,
  #lens-lab .section-copy h2,
  #lens-lab .section-copy p:not(.section-label) {
    grid-column: 1;
    grid-row: auto;
  }

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

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

  .chapter-side {
    position: static;
  }
}

@media (max-width: 720px) {
  .nav-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
  }

  .nav-actions {
    justify-content: flex-start;
  }

  .command-center {
    padding-top: 3rem;
  }

  .route-grid,
  .chapter-grid,
  .takeaway-grid,
  .selfcheck-panel .checklist,
  .workflow-board,
  .equation-grid,
  .intro-point-grid,
  .control-row,
  .scenario-head {
    grid-template-columns: 1fr;
  }

  .chapter-intro {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(2.35rem, 12vw, 3.45rem);
  }

  .role-panel {
    min-height: auto;
  }

  .mobile-role-jump {
    display: grid;
  }

  .chapter-nav {
    flex-direction: column;
  }

  .source-lecture-head {
    flex-direction: column;
  }
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
