:root {
  color-scheme: light;
  --ink: #172f41;
  --muted: #4e6673;
  --accent: #126962;
  --accent-dark: #0d504d;
  --line: #cddbdd;
  --rule: var(--line);
  --paper: #fff;
  --wash: #edf6f3;
  --tint: var(--wash);
  --canvas: #edf2f3;
  --sans: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --serif: "Noto Serif KR", "Batang", serif;
  --lecture-top: 55px;
  --lecture-bottom: 52px;
  font: 16px/1.55 var(--sans);
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: var(--accent-dark); text-underline-offset: .2em; }
input { accent-color: var(--accent); }
:focus-visible { outline: 3px solid #448b87; outline-offset: 4px; }
.skip { position: fixed; top: -10rem; left: 16px; z-index: 10; padding: 8px 14px; background: var(--paper); }
.skip:focus { top: 12px; }

.lecture-bar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 3;
  background: #183345;
  color: #f4fbff;
  border-bottom: 2px solid #5b9e91;
}
.lecture-bar-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 53px;
  max-width: 1640px;
  margin: auto;
  padding: 7px 26px;
}
.lecture-brand { color: inherit; font-weight: 750; font-size: 16px; text-decoration: none; white-space: nowrap; }
.lecture-topic { color: #c1d8db; font-size: 13px; white-space: nowrap; border-left: 1px solid #6b8692; padding-left: 16px; }
.lecture-tools { display: flex; gap: 6px; margin-left: auto; }
.lecture-tools button, .lecture-pager button, .lecture-dialog button {
  min-height: 36px;
  padding: 5px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: inherit;
  background: transparent;
  font-size: 13px;
  line-height: 1.3;
  white-space: nowrap;
}
.lecture-tools button:hover, .lecture-tools button:focus-visible { background: #2b4958; border-color: #54707e; }
.lecture-tools [data-action="fullscreen"] { min-width: 109px; border-color: #597382; }
.lecture-pager {
  position: fixed;
  inset: auto 0 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 7px 16px;
  background: var(--paper);
  border-top: 1px solid var(--line);
}
.lecture-pager button { min-width: 94px; border-color: var(--line); }
.lecture-pager button:hover:not(:disabled), .lecture-dialog button:hover { background: var(--wash); }
.lecture-pager button:disabled { color: #627784; opacity: .57; }
.lecture-pager [data-action="next"]:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); color: white; }
.lecture-pager [data-action="next"]:hover:not(:disabled) { background: var(--accent); }
.lecture-folio { min-width: 5ch; text-align: center; font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; }
.lecture-status {
  position: fixed;
  inset: auto 20px calc(var(--lecture-bottom) + 8px) auto;
  z-index: 4;
  max-width: calc(100% - 40px);
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  box-shadow: 0 4px 20px #17334418;
  font-size: 13px;
}
.lecture-reveal-tools {
  display: none;
  position: fixed;
  z-index: 4;
  inset: 9px 10px auto auto;
  min-width: 36px;
  min-height: 34px;
  padding: 4px 6px;
  border: 1px solid #ffffff60;
  border-radius: 6px;
  background: #183345db;
  color: #fff;
  font-size: 12px;
}

.lecture-ready { scroll-padding: calc(var(--lecture-top) + 16px) 0 calc(var(--lecture-bottom) + 12px); }
.lecture-deck { display: grid; justify-items: center; gap: 20px; padding: 20px 24px; }
.lecture-ready .lecture-deck {
  min-height: 100svh;
  align-content: center;
  padding: calc(var(--lecture-top) + 20px) 24px calc(var(--lecture-bottom) + 20px);
}
.lecture-ready .lecture-continuous { align-content: start; }
.slide-frame { width: min(100%, 1440px); min-width: 0; }
.slide {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  margin: 0;
  padding: 0 58px;
  border-top: 5px solid #3d837b;
  background: var(--paper);
  box-shadow: 0 2px 5px #172f4110, 0 14px 36px #172f4118;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.slide-header, .slide-footer {
  flex: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.42;
}
.slide-header { min-height: 52px; padding-block: 8px; border-bottom: 1px solid var(--line); }
.slide-header > span:first-child { color: var(--accent-dark); font-weight: 750; white-space: nowrap; }
.slide-header > span:last-child { text-align: right; }
.slide-footer { min-height: 44px; padding-block: 8px; border-top: 1px solid var(--line); }
.slide-footer > span:last-child { color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.slide-content { flex: 1; padding: 19px 0 16px; font-size: 22px; line-height: 1.55; letter-spacing: -.018em; }
.slide-content h1 { margin: 0 0 13px; font-size: 36px; font-weight: 750; line-height: 1.27; letter-spacing: -.045em; }
.slide-content h2 { margin: 0 0 9px; font-size: 24px; font-weight: 700; line-height: 1.39; letter-spacing: -.028em; }
.slide-content h3 { margin: 0 0 6px; font-size: 20px; line-height: 1.43; }
.slide-content p { margin: 0; }
.slide-content p + p { margin-top: .6em; }
.slide-content figure { margin: 0; }
.slide .slide-content .lead { margin: 0 0 18px; color: #345565; font-size: 23px; line-height: 1.5; }
.slide .slide-content .slide-subtitle { margin: 0 0 12px; color: var(--accent-dark); font-size: 27px; font-weight: 700; line-height: 1.35; letter-spacing: -.032em; }
.slide-content .slide-intro { border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.slide-content .opening { padding-top: 0; }
.equation { color: var(--accent-dark); margin-block: 12px; }
.equation .katex { font-size: 1.32em; }
.equation .katex-display { margin: 0; }
.equation .katex-display > .katex { text-align: left; }
.slide .math .katex { font-size: 1.06em; }
.slide .sheet-content > h2 { margin-top: 14px; }
.speaker-note { display: none; }

.lecture-dialog {
  width: min(740px, calc(100% - 32px));
  max-height: 85svh;
  padding: 22px 25px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: 10px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 12px 44px #10283533;
}
.lecture-dialog::backdrop { background: #1930418c; }
.lecture-dialog-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.lecture-dialog-head h2 { margin: 0; font-size: 22px; }
.lecture-dialog button { border-color: var(--line); }
.lecture-contents { margin: 14px 0; padding: 0; columns: 2; column-gap: 18px; list-style: none; counter-reset: pages; }
.lecture-contents li { break-inside: avoid; counter-increment: pages; }
.lecture-contents a { display: flex; align-items: baseline; gap: 8px; padding: 8px; border-radius: 4px; color: var(--ink); text-decoration: none; font-size: 15px; }
.lecture-contents a::before { content: counter(pages, decimal-leading-zero); color: var(--accent-dark); font-size: 12px; font-variant-numeric: tabular-nums; }
.lecture-contents a:hover, .lecture-contents a[aria-current="page"] { background: var(--wash); }
.lecture-contents a[aria-current="page"] { font-weight: 700; }
.lecture-dialog-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; }
.lecture-shortcuts { margin: 15px 0 0; color: var(--muted); font-size: 12px; }
.lecture-note { margin: 16px 0 0; white-space: pre-line; }

.course-home { min-height: 100svh; border-top: 5px solid #3d837b; }
.course-index { width: min(920px, calc(100% - 48px)); margin: 0 auto; padding: clamp(32px, 7vh, 92px) 0 36px; }
.course-heading { margin-bottom: 26px; }
.course-heading p { margin: 0; color: var(--muted); }
.course-heading p:first-child { color: var(--accent-dark); font-size: 14px; font-weight: 750; }
.course-heading h1 { margin: 8px 0 10px; font-size: clamp(34px, 6vw, 58px); line-height: 1.2; letter-spacing: -.055em; }
.course-topics { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.course-topics li + li { border-top: 1px solid var(--line); }
.course-topics a {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 17px 23px;
  color: var(--ink);
  text-decoration: none;
}
.course-topics a:hover { background: var(--wash); }
.course-topics strong { display: block; font-size: 20px; margin-bottom: 2px; }
.course-topics strong + span { color: var(--muted); font-size: 14px; }
.course-topics .topic-number { color: var(--accent-dark); font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }

@media screen and (min-width: 761px) {
  .lecture-ready .slide-frame { width: 1440px; zoom: var(--lecture-scale, .65); }
  .lecture-ready .slide { height: 810px; }
}

@media screen and (max-width: 760px) {
  .lecture-bar-inner { padding-inline: 14px; gap: 8px 12px; flex-wrap: wrap; }
  .lecture-topic { padding-left: 10px; }
  .lecture-tools button { padding-inline: 8px; }
  .lecture-tools [data-action="fullscreen"] { min-width: 91px; }
  .lecture-ready .lecture-deck, .lecture-deck { padding-inline: 12px; align-content: start; }
  .slide { padding-inline: 15px; }
  .slide-header, .slide-footer { font-size: 11px; }
  .slide-content { font-size: 16px; letter-spacing: 0; }
  .slide-content h1 { font-size: 26px; }
  .slide-content h2 { font-size: 19px; }
  .slide-content h3 { font-size: 17px; }
  .slide .slide-content .lead { font-size: 17px; }
  .slide .slide-content .slide-subtitle { font-size: 21px; }
  .lecture-contents { columns: 1; }
}

@media screen and (max-width: 485px) {
  .lecture-tools { width: 100%; margin: 0; justify-content: space-between; }
  .lecture-tools button { flex: 1; }
}

@media screen {
  html.lecture-expanded { background: #101b23; scroll-padding: 0; }
  .lecture-expanded .lecture-deck { min-height: 100dvh; padding: 0; }
  .lecture-expanded .slide { box-shadow: none; }
  .lecture-expanded .lecture-reveal-tools { display: block; }
  .lecture-expanded:not(.lecture-tools-open) :is(.lecture-bar, .lecture-pager) { visibility: hidden; }
  .lecture-expanded .lecture-bar-inner { padding-right: 62px; }
}

@media screen and (min-width: 761px) {
  .lecture-expanded.lecture-presentation { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  @page { size: 1440px 810px; margin: 0; }
  :root, body { background: white; }
  .lecture-bar, .lecture-pager, .lecture-status, .lecture-reveal-tools, .lecture-dialog, .skip,
  .figure-controls, .scrub, .experiment-toolbar, .demo-controls { display: none !important; }
  .lecture-ready .lecture-deck, .lecture-deck { display: block; padding: 0; }
  .slide-frame, .slide-frame[hidden] {
    display: block !important;
    width: 1440px;
    height: 810px;
    break-after: page;
    break-inside: avoid;
  }
  .slide-frame:last-child { break-after: auto; }
  .slide { height: 810px; box-shadow: none; print-color-adjust: exact; }
}
