:root {
  color-scheme: light dark;
  --bg: #f4f1ea;
  --surface: #faf8f3;
  --text: #171a17;
  --muted: #6c716d;
  --line: #d7d6cf;
  --green: #153a27;
  --green-soft: #e4e9e1;
  --accent: #9b5368;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Pretendard,"Noto Sans KR",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  -webkit-font-smoothing: antialiased;
}
button,a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
a { color: inherit; }

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px clamp(18px,5vw,64px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb,var(--bg) 94%,transparent);
  backdrop-filter: blur(14px);
}
.brand { display: inline-flex; align-items: baseline; gap: 4px; text-decoration: none; }
.brand span { color: var(--accent); font-family: Georgia,serif; font-size: 10px; font-style: italic; }
.brand strong { font-family: Georgia,"Times New Roman",serif; font-size: 20px; font-weight: 500; letter-spacing: .08em; }
.brand i { margin-left: 8px; color: var(--muted); font-size: 7px; font-style: normal; font-weight: 700; letter-spacing: .17em; }
.header-home-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 15px;
  border: 1px solid var(--green);
  border-radius: 999px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(72px,10vw,130px) clamp(20px,4vw,48px) clamp(55px,8vw,90px);
  border-bottom: 1px solid var(--line);
}
.hero-content { max-width: 760px; }
.eyebrow { margin: 0 0 16px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.hero h1 {
  margin: 0;
  font-family: Georgia,"Noto Serif KR",serif;
  font-size: clamp(48px,8vw,82px);
  font-weight: 500;
  letter-spacing: -.055em;
  line-height: 1.08;
}
.hero-copy { max-width: 600px; margin: 25px 0 0; color: var(--muted); font-size: 16px; line-height: 1.75; word-break: keep-all; }

.library { max-width: 1200px; margin: 0 auto; padding: clamp(50px,7vw,84px) clamp(20px,4vw,48px) 90px; }
.section-heading h2 {
  margin: 0;
  font-family: Georgia,"Noto Serif KR",serif;
  font-size: clamp(28px,4vw,40px);
  font-weight: 500;
  letter-spacing: -.04em;
}
.filters {
  display: flex;
  gap: 24px;
  margin: 26px 0 36px;
  padding-bottom: 10px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.filters button {
  flex: 0 0 auto;
  padding: 8px 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.filters button[aria-pressed="true"] { border-color: var(--green); color: var(--green); }

.featured {
  scroll-margin-top: 110px;
  display: grid;
  grid-template-columns: minmax(0,1.55fr) minmax(290px,.75fr);
  border-top: 1px solid var(--text);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.featured-media { min-height: 430px; display: grid; place-items: center; background: #060806; }
.featured-media video { width: 100%; height: 100%; max-height: 620px; display: block; object-fit: contain; background: #060806; }
.featured-media[data-orientation="vertical"] video,.featured-media[data-orientation="portrait"] video { max-width: 420px; }
.featured-copy { display: flex; flex-direction: column; justify-content: center; padding: clamp(28px,4vw,46px); border-left: 1px solid var(--line); }
.featured-category { color: var(--accent); font-size: 11px; font-weight: 800; }
.featured-copy h3 {
  margin: 15px 0 0;
  font-family: Georgia,"Noto Serif KR",serif;
  font-size: clamp(28px,3.5vw,42px);
  font-weight: 500;
  letter-spacing: -.045em;
  line-height: 1.35;
  word-break: keep-all;
}
.featured-copy p { margin: 22px 0 0; color: var(--muted); font-size: 14px; line-height: 1.8; word-break: keep-all; }

.video-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 34px 22px; margin-top: 52px; }
.lesson-card { min-width: 0; border-top: 1px solid var(--line); }
.lesson-card.active { border-color: var(--accent); }
.lesson-select { width: 100%; display: block; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.poster-frame {
  position: relative;
  aspect-ratio: 16/9;
  display: grid;
  place-items: center;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 5px;
  background: #080b09;
}
.poster-frame.portrait,.poster-frame.vertical { aspect-ratio: 4/3; }
.poster-frame img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform 220ms ease; }
.poster-frame.portrait img,.poster-frame.vertical img { object-fit: contain; }
.lesson-select:hover .poster-frame img { transform: scale(1.015); }
.play-mark {
  position: absolute;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding-left: 3px;
  border-radius: 50%;
  background: rgba(10,20,14,.68);
  color: #fff;
  font-size: 12px;
  font-style: normal;
}
.lesson-copy { min-height: 180px; display: flex; flex-direction: column; padding: 17px 2px 0; }
.lesson-copy em { color: var(--accent); font-size: 10px; font-style: normal; font-weight: 800; }
.lesson-copy>strong {
  margin-top: 10px;
  font-family: Georgia,"Noto Serif KR",serif;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -.03em;
  line-height: 1.42;
  word-break: keep-all;
}
.lesson-description {
  margin-top: 11px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.selection-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.closing {
  display: grid;
  grid-template-columns: 1fr minmax(260px,520px) auto;
  align-items: center;
  gap: 30px;
  padding: clamp(42px,6vw,72px) clamp(22px,7vw,100px);
  background: var(--green);
  color: #f3f0e8;
}
.closing h2 { margin: 0; font-family: Georgia,serif; font-size: 28px; font-weight: 500; }
.closing p { margin: 0; color: rgba(243,240,232,.72); font-size: 13px; line-height: 1.7; }
.closing a { min-height: 46px; display: inline-flex; align-items: center; gap: 15px; padding: 0 18px; border: 1px solid rgba(255,255,255,.34); border-radius: 999px; font-size: 12px; font-weight: 700; text-decoration: none; }
.site-footer { display: flex; justify-content: space-between; gap: 24px; padding: 24px clamp(20px,5vw,64px) 34px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.site-footer strong { color: var(--text); font-family: Georgia,serif; font-weight: 500; letter-spacing: .1em; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a100c;
    --surface: #0f1711;
    --text: #f0eee7;
    --muted: #a8ada8;
    --line: #293129;
    --green: #d2dfa9;
    --green-soft: #19231b;
    --accent: #d08ca0;
  }
  .header-home-link { border-color: #647158; color: #d9e2c0; }
  .filters button[aria-pressed="true"] { border-color: var(--accent); color: var(--text); }
  .closing { background: #13281a; }
}
@media (max-width: 960px) {
  .featured { grid-template-columns: 1fr; }
  .featured-copy { border-left: 0; border-top: 1px solid var(--line); }
  .video-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .closing { grid-template-columns: 1fr; text-align: left; }
  .closing a { justify-self: start; }
}
@media (max-width: 640px) {
  .site-header { min-height: 60px; padding: 9px 16px; }
  .brand strong { font-size: 17px; }
  .brand i,.header-home-link { display: none; }
  .hero { padding: 62px 18px 48px; }
  .hero h1 { font-size: 50px; }
  .hero-copy { font-size: 14px; }
  .library { padding: 44px 16px 64px; }
  .filters { margin: 22px 0 28px; gap: 21px; }
  .featured { border-radius: 0; }
  .featured-media { min-height: 250px; max-height: 400px; }
  .featured-copy { padding: 24px 17px 28px; }
  .featured-copy h3 { font-size: 28px; }
  .video-grid { grid-template-columns: 1fr; gap: 28px; margin-top: 42px; }
  .lesson-copy { min-height: 0; padding-bottom: 7px; }
  .closing { padding: 42px 20px; }
  .site-footer { flex-direction: column; align-items: center; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,*::before,*::after { transition-duration: .01ms !important; }
}
