/* Udemy Letter — 독자 화면 (게이트 + 레터 본문)
   규칙: tokens.css 변수만 사용 · 인라인 style 금지 · 터치 영역 44px 이상 · 모션은 reduce 설정 존중 */

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: var(--t-md); line-height: 1.7;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; word-break: keep-all; overflow-wrap: anywhere; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 var(--s5); }
.measure { max-width: var(--measure); margin: 0 auto; }
@media (max-width: 640px) { .wrap { padding: 0 20px; } .prose { padding: 0 4px; } }

/* ── 상단 바 ─────────────────────────────── */
.topbar { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar-in { height: 60px; display: flex; align-items: center; gap: var(--s3); }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: -.02em; font-size: 17px; }
.logo-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; font-size: 14px; font-weight: 900; }
.logo-name { display: inline-flex; align-items: baseline; gap: 7px; min-width: 0; }
.logo small { font-size: 15px; font-weight: 600; color: var(--ink-3); letter-spacing: -.01em; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo small i { font-style: normal; font-weight: 500; }
.logo small b { color: var(--brand); font-weight: 800; }
.topbar .spacer { flex: 1; }
.progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: var(--brand); transition: width .1s linear; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: var(--r-pill);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 600; font-size: var(--t-sm); text-decoration: none; cursor: pointer;
  transition: background .2s, border-color .2s, transform .15s var(--ease); white-space: nowrap; }
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: scale(.97); }
.btn-brand { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-brand:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--bg-muted); border-color: transparent; }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: var(--t-md); }
.icon-btn { width: 40px; height: 40px; padding: 0; border-radius: var(--r-pill); }
.seg { display: inline-flex; padding: 3px; background: var(--bg-muted); border-radius: var(--r-pill); }
.seg a, .seg button { min-height: 34px; padding: 0 12px; border: 0; background: transparent; border-radius: var(--r-pill); font-size: 13px; font-weight: 700; color: var(--ink-3); text-decoration: none; display: inline-flex; align-items: center; cursor: pointer; }
.seg .on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
@media (max-width: 640px) { .hide-sm { display: none !important; } }

/* ── 게이트 ─────────────────────────────── */
.gate-head { padding-top: var(--s8); padding-bottom: var(--s6); }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.gate-title { font-size: clamp(32px, 5.4vw, 56px); line-height: 1.15; letter-spacing: -.035em; font-weight: 800; margin: var(--s3) 0 var(--s3); }
.gate-title em { font-style: normal; color: var(--brand); }
.gate-sub { color: var(--ink-2); font-size: var(--t-lg); margin: 0; max-width: 680px; word-break: keep-all; text-wrap: pretty; }
.gate-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s5); }

.feature { display: grid; grid-template-columns: 1.25fr 1fr; border-radius: var(--r-xl); overflow: hidden; background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; box-shadow: var(--shadow-2); transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-3); }
.feature-media { position: relative; min-height: 320px; background: var(--bg-muted); overflow: hidden; }
.feature-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.feature:hover .feature-media img { transform: scale(1.04); }
.feature-body { padding: var(--s6); display: flex; flex-direction: column; gap: var(--s3); }
.chip { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; padding: 4px 10px; border-radius: var(--r-pill); background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 700; }
.chip-new { background: var(--brand); color: var(--on-brand); }
.feature h2 { font-size: var(--t-2xl); line-height: 1.3; letter-spacing: -.025em; margin: 0; }
.feature p { color: var(--ink-2); margin: 0; }
.feature .meta { color: var(--ink-3); font-size: var(--t-sm); margin-top: auto; display: flex; gap: var(--s3); flex-wrap: wrap; }
.read-more { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--brand); }
.read-more .arr { transition: transform .25s var(--ease); }
.feature:hover .arr, .card:hover .arr { transform: translateX(4px); }
@media (max-width: 820px) {
  .feature { grid-template-columns: 1fr; }
  .feature-media { min-height: 0; aspect-ratio: 16 / 9; }
  .feature-body { padding: var(--s5); }
}

.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); margin: var(--s8) 0 var(--s4); }
.list-head h3 { font-size: var(--t-xl); letter-spacing: -.02em; margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s5); }
.card { display: flex; flex-direction: column; text-decoration: none; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line);
  overflow: hidden; transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: transparent; }
.card-media { aspect-ratio: 16 / 9; background: var(--bg-muted); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.card:hover .card-media img { transform: scale(1.05); }
.card-body { padding: var(--s4) var(--s4) var(--s5); display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-issue { font-size: 12px; font-weight: 700; color: var(--brand); letter-spacing: .04em; }
.card h4 { margin: 0; font-size: var(--t-lg); line-height: 1.4; letter-spacing: -.015em; }
.card p { margin: 0; color: var(--ink-3); font-size: var(--t-sm); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.empty { text-align: center; color: var(--ink-3); padding: var(--s8) var(--s4); }
.empty-mark { font-size: 40px; margin-bottom: var(--s3); }

/* ── 레터 머리 ─────────────────────────────── */
.cover { padding-top: var(--s7); padding-bottom: var(--s6); text-align: center; }
.cover .eyebrow { display: inline-flex; gap: 8px; align-items: center; }
.cover h1 { font-size: clamp(30px, 5vw, 50px); line-height: 1.18; letter-spacing: -.035em; font-weight: 800; margin: var(--s4) auto var(--s3); max-width: 860px; }
.cover-sub { color: var(--ink-2); font-size: var(--t-lg); max-width: 640px; margin: 0 auto; }
.cover-meta { margin-top: var(--s4); color: var(--ink-3); font-size: var(--t-sm); display: flex; gap: var(--s3); justify-content: center; flex-wrap: wrap; }
.cover-meta span + span::before { content: '·'; margin-right: var(--s3); color: var(--line-strong); }
.cover-img { margin: var(--s6) auto 0; max-width: var(--wide); border-radius: var(--r-xl); overflow: hidden; aspect-ratio: 21 / 9; background: var(--bg-muted); }
.cover-img img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 640px) { .cover-img { aspect-ratio: 16 / 10; border-radius: var(--r-lg); } }

/* ── 이번 달 딱 하나 ─────────────────────────── */
.pick { margin: var(--s7) auto 0; max-width: var(--col); }
.pick-label { display: flex; align-items: center; gap: var(--s2); font-weight: 800; font-size: var(--t-sm); margin-bottom: var(--s3); }
.pick-label .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.pick-card { display: grid; grid-template-columns: 1.1fr 1fr; gap: 0; text-decoration: none; border-radius: var(--r-xl); overflow: hidden;
  background: var(--surface); border: 1.5px solid var(--brand-line); box-shadow: var(--shadow-2); transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.pick-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-3); }
.pick-media { background: var(--bg-muted); min-height: 260px; overflow: hidden; }
.pick-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.pick-card:hover .pick-media img { transform: scale(1.04); }
.pick-body { padding: var(--s6); display: flex; flex-direction: column; gap: var(--s3); }
.pick-body h2 { margin: 0; font-size: var(--t-xl); line-height: 1.35; letter-spacing: -.02em; }
.pick-body p { margin: 0; color: var(--ink-2); }
.pick-body .btn { align-self: flex-start; margin-top: auto; }
@media (max-width: 760px) {
  .pick-card { grid-template-columns: 1fr; }
  .pick-media { min-height: 0; aspect-ratio: 16 / 9; }
  .pick-body { padding: var(--s5); }
  .pick-body .btn { align-self: stretch; }
}

/* ── 목차 ─────────────────────────────── */
.toc { display: flex; gap: var(--s2); justify-content: center; flex-wrap: wrap; margin: var(--s7) auto 0; }
.toc a { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: var(--r-pill); border: 1px solid var(--line);
  text-decoration: none; font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); background: var(--surface); transition: all .2s; }
.toc a:hover { border-color: var(--brand); color: var(--brand); }
.toc a b { color: var(--brand); font-variant-numeric: tabular-nums; }
.rail { position: fixed; left: max(16px, calc(50% - 640px)); top: 50%; transform: translateY(-50%); z-index: 20; display: flex; flex-direction: column; gap: 4px; opacity: 0; pointer-events: none; transition: opacity .3s; }
.rail.show { opacity: 1; pointer-events: auto; }
.rail a { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 13px; color: var(--ink-3); padding: 6px 0; }
.rail a i { width: 18px; height: 2px; background: var(--line-strong); border-radius: 2px; transition: all .25s var(--ease); }
.rail a span { opacity: 0; transform: translateX(-4px); transition: all .25s var(--ease); white-space: nowrap; }
.rail:hover a span, .rail a.on span { opacity: 1; transform: none; }
.rail a.on { color: var(--ink); font-weight: 700; }
.rail a.on i { width: 32px; background: var(--brand); }
@media (max-width: 1240px) { .rail { display: none; } }

/* ── 섹션 ─────────────────────────────── */
.sec { padding-top: var(--s8); scroll-margin-top: 72px; }
.sec-head { max-width: var(--measure); margin: 0 auto var(--s5); }
.sec-num { font-size: 13px; font-weight: 800; color: var(--brand); letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.sec-head h2 { font-size: clamp(24px, 3.2vw, 32px); letter-spacing: -.03em; line-height: 1.25; margin: var(--s2) 0 0; }
.sec-img { max-width: var(--col); margin: 0 auto var(--s6); border-radius: var(--r-lg); overflow: hidden; background: var(--bg-muted); aspect-ratio: 2 / 1; }
.sec-img img { width: 100%; height: 100%; object-fit: cover; }

.prose { max-width: var(--col); margin: 0 auto var(--s7); font-size: 17.5px; line-height: 1.95; color: var(--ink-2); text-wrap: pretty; letter-spacing: -.003em; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose img { margin: 0; }
.prose > * + * { margin-top: 1.05em; }                 /* 문장 단위로 끊어 쓴 문단도 숨 쉬게 */
.prose > .gap { height: 1em; margin: 0; }              /* 원고의 빈 줄 → 문단 덩어리 구분 */
.prose > .gap + * { margin-top: .9em; }
.prose > .p-lead { font-size: 20px; line-height: 1.8; color: var(--ink); font-weight: 500; letter-spacing: -.012em; }
.prose > .p-head { margin-top: 2.6em; padding-top: 1.4em; border-top: 1px solid var(--line); color: var(--ink); font-weight: 800; font-size: 22px; line-height: 1.45; letter-spacing: -.02em; display: flex; gap: .55em; align-items: flex-start; }
.prose > .p-head:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose > .gap + .p-head { margin-top: 2.2em; }
.prose > .p-head .num { flex: none; display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; padding: 0 .3em; border-radius: 10px; background: var(--brand); color: var(--on-brand); font-size: .72em; font-weight: 800; margin-top: .12em; }
.prose > .p-sub { margin-top: 1.6em; color: var(--ink); font-weight: 700; font-size: 17.5px; padding-left: 14px; border-left: 3px solid var(--brand); line-height: 1.6; }
.prose > .p-bullet { padding-left: 1.1em; text-indent: -1.1em; }
.prose > .p-key { padding: 18px 22px; border-radius: var(--r); background: var(--brand-soft); color: var(--ink); font-weight: 700; font-size: 18px; line-height: 1.7; }
.prose > .p-key strong { color: inherit; }
.prose h2, .prose h3, .prose h4 { color: var(--ink); letter-spacing: -.02em; line-height: 1.4; }
.prose > h2, .prose > h3, .prose > h4 { margin-top: 2.2em; }
.prose > h2:first-child, .prose > h3:first-child, .prose > h4:first-child { margin-top: 0; }
.prose h2 { font-size: 26px; } .prose h3 { font-size: 22px; } .prose h4 { font-size: 19px; }
.prose strong { color: var(--ink); font-weight: 700; }
.prose a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .5em; }
.prose blockquote { padding: var(--s4) var(--s5); border-left: 3px solid var(--brand); background: var(--brand-soft); border-radius: 0 var(--r) var(--r) 0; color: var(--ink); }
.prose img { border-radius: var(--r); width: 100%; }
/* 숫자 카드 · 그래프 · 팁 (편집기 표시 문법 [[숫자 …]] [[그래프 …]] [[팁 …]]) */
.stat { display: grid; grid-template-columns: auto 1fr; gap: 6px 20px; align-items: center; padding: 22px 26px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.stat b { font-size: 46px; line-height: 1; font-weight: 800; letter-spacing: -.04em; color: var(--brand); font-variant-numeric: tabular-nums; }
.stat span { color: var(--ink-2); font-size: 15.5px; line-height: 1.6; }
.stat small { grid-column: 1 / -1; color: var(--ink-3); font-size: 12.5px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.prose > .stats .stat { margin: 0; }
.stats .stat { grid-template-columns: 1fr; align-content: start; gap: 8px; padding: 20px 22px; }
.stats .stat b { font-size: 38px; }
.prose > .chart { padding: 22px 24px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.chart h5 { margin: 0 0 14px; font-size: 15px; color: var(--ink); }
.chart .bar { display: grid; grid-template-columns: minmax(80px, 34%) 1fr auto; gap: 12px; align-items: center; font-size: 14px; line-height: 1.4; }
.chart .bar + .bar { margin-top: 10px; }
.chart .bar span:first-child { color: var(--ink-2); }
.chart .track { height: 14px; border-radius: 0 7px 7px 0; background: var(--bg-muted); overflow: hidden; }
.chart .fill { height: 100%; background: var(--brand); border-radius: 0 7px 7px 0; transform-origin: left; transform: scaleX(0); transition: transform 1s var(--ease) .2s; }
.reveal.in .chart .fill, .chart.in .fill { transform: scaleX(1); }
.chart .bar.top .fill { background: var(--brand); }
.chart .bar:not(.top) .fill { background: color-mix(in srgb, var(--brand) 45%, var(--surface)); }
.chart .val { font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.chart small { display: block; margin-top: 12px; color: var(--ink-3); font-size: 12.5px; }
.prose > .tip { display: flex; gap: 12px; padding: 16px 20px; border-radius: var(--r); background: var(--bg-subtle); border: 1px dashed var(--line-strong); font-size: 16px; color: var(--ink); }
.tip::before { content: '💡'; flex: none; }
@media (max-width: 640px) {
  .prose { font-size: 16.5px; line-height: 1.9; }
  .prose > .p-lead { font-size: 18.5px; }
  .prose > .p-head { font-size: 20px; }
  .stat b { font-size: 38px; }
  .prose > .stat { grid-template-columns: 1fr; }
}
.intro { max-width: var(--measure); margin: 0 auto var(--s5); font-size: var(--t-lg); font-weight: 600; color: var(--ink); }
.tags { display: flex; flex-wrap: wrap; gap: var(--s2); max-width: var(--measure); margin: 0 auto var(--s5); }
.tag { padding: 6px 12px; border-radius: var(--r-pill); background: var(--bg-muted); font-size: 13px; font-weight: 600; color: var(--ink-2); }

/* ── 강의 ─────────────────────────────── */
.courses { max-width: var(--col); margin: 0 auto; }
.cgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s4); }
@media (max-width: 680px) { .cgrid { grid-template-columns: 1fr; } }
.course { position: relative; display: flex; flex-direction: column; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); overflow: hidden;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s; }
.course:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: transparent; }
.course-media { aspect-ratio: 16 / 9; background: var(--bg-muted); overflow: hidden; }
.course-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.course:hover .course-media img { transform: scale(1.04); }
.course-body { padding: var(--s4) var(--s5) var(--s5); display: flex; flex-direction: column; gap: var(--s2); flex: 1; }
.course h3 { margin: 0; font-size: var(--t-md); line-height: 1.45; letter-spacing: -.01em; }
.course h3 a { text-decoration: none; }
.course h3 a::after { content: ''; position: absolute; inset: 0; } /* 카드 전체 클릭 */
.meta-row { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--ink-3); }
.meta-row .star { color: #b4690e; font-weight: 700; }
.note { font-size: var(--t-sm); color: var(--ink-2); line-height: 1.7; padding-top: var(--s2); border-top: 1px dashed var(--line); }
.go { margin-top: auto; padding-top: var(--s2); font-size: var(--t-sm); font-weight: 700; color: var(--brand); display: inline-flex; gap: 6px; align-items: center; }
.course:hover .go .arr { transform: translateX(4px); }
.go .arr { transition: transform .25s var(--ease); }
.badge { align-self: flex-start; padding: 3px 9px; border-radius: 6px; font-size: 12px; font-weight: 700; background: var(--brand-soft); color: var(--brand); }

.clist { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.crow { position: relative; display: grid; grid-template-columns: 56px 168px 1fr; gap: var(--s5); align-items: start; padding: var(--s5) var(--s2); border-bottom: 1px solid var(--line); transition: background .2s; border-radius: var(--r); }
.crow:hover { background: var(--bg-subtle); }
.crow-rank { font-size: 28px; font-weight: 800; color: var(--brand); letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.crow-media { border-radius: var(--r-sm); overflow: hidden; aspect-ratio: 16 / 9; background: var(--bg-muted); }
.crow-media img { width: 100%; height: 100%; object-fit: cover; }
.crow-body { display: flex; flex-direction: column; gap: 6px; }
.crow h3 { margin: 0; font-size: var(--t-lg); line-height: 1.4; letter-spacing: -.015em; }
.crow h3 a { text-decoration: none; }
.crow h3 a::after { content: ''; position: absolute; inset: 0; }
@media (max-width: 680px) {
  .crow { grid-template-columns: 36px 1fr; gap: var(--s3); }
  .crow-media { display: none; }
  .crow-rank { font-size: 22px; }
}

.inline-cta { max-width: var(--col); margin: var(--s6) auto 0; padding: var(--s5) var(--s6); border-radius: var(--r-lg); background: var(--bg-subtle); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; }
.inline-cta p { margin: 0; font-weight: 600; }
.summary { max-width: var(--measure); margin: var(--s5) auto 0; color: var(--ink-2); text-align: center; }

/* ── 마무리 · 피드백 · 이동 ─────────────────── */
.closing { max-width: var(--col); margin: var(--s9) auto 0; text-align: center; }
.closing .prose { text-align: left; }
.signoff { margin-top: var(--s6); display: flex; flex-direction: column; align-items: center; gap: var(--s3); }
.signoff p { margin: 0; color: var(--ink-3); font-size: var(--t-sm); }
.feedback { max-width: 560px; margin: var(--s8) auto 0; padding: var(--s6); border-radius: var(--r-xl); background: var(--bg-subtle); text-align: center; }
.feedback h3 { margin: 0 0 var(--s4); font-size: var(--t-lg); }
.fb-btns { display: flex; justify-content: center; gap: var(--s3); flex-wrap: wrap; }
.fb-btn { min-height: 52px; min-width: 132px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-weight: 700; font-size: var(--t-md);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .2s var(--ease), border-color .2s, background .2s; }
.fb-btn:hover { border-color: var(--brand); transform: translateY(-2px); }
.fb-btn .e { font-size: 22px; transition: transform .3s var(--ease); }
.fb-btn:hover .e { transform: scale(1.2) rotate(-8deg); }
.fb-form { display: flex; gap: var(--s2); flex-wrap: wrap; justify-content: center; }
.fb-form input { flex: 1 1 260px; min-height: 48px; padding: 0 16px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; }
.fb-form input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.fb-done { color: var(--good); font-weight: 700; margin: 0; }
.pager { max-width: var(--col); margin: var(--s8) auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.pager a { display: flex; flex-direction: column; gap: 4px; padding: var(--s5); border-radius: var(--r-lg); border: 1px solid var(--line); text-decoration: none; transition: border-color .2s, background .2s; }
.pager a:hover { border-color: var(--brand); background: var(--brand-soft); }
.pager small { color: var(--ink-3); font-weight: 600; }
.pager b { font-size: var(--t-md); line-height: 1.4; }
.pager .next { text-align: right; grid-column: 2; }
@media (max-width: 640px) { .pager { grid-template-columns: 1fr; } .pager .next { grid-column: 1; } }

.footer { margin-top: var(--s9); border-top: 1px solid var(--line); padding: var(--s6) 0 var(--s7); color: var(--ink-3); font-size: var(--t-sm); }
.footer-in { display: flex; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; align-items: center; }
.footer a { color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; }
.footer-links { display: flex; gap: var(--s4); flex-wrap: wrap; }
.to-top { position: fixed; right: 20px; bottom: 20px; z-index: 40; opacity: 0; transform: translateY(10px); pointer-events: none; transition: all .3s var(--ease); box-shadow: var(--shadow-2); }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }

/* ── 상태 · 모달 · 토스트 ─────────────────── */
.preview-bar { background: var(--warn-bg); color: var(--warn); text-align: center; font-size: 13px; font-weight: 700; padding: 8px 16px; }
.skeleton { background: linear-gradient(90deg, var(--bg-muted) 25%, var(--bg-subtle) 50%, var(--bg-muted) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r); }
@keyframes shimmer { to { background-position: -200% 0; } }
.sk-title { height: 48px; width: 70%; margin: var(--s7) auto var(--s3); }
.sk-line { height: 18px; width: 45%; margin: 0 auto; }
.sk-img { height: 360px; margin: var(--s6) auto 0; max-width: var(--wide); border-radius: var(--r-xl); }

.modal { position: fixed; inset: 0; z-index: 1000; background: rgba(10,10,14,.5); display: flex; align-items: center; justify-content: center; padding: var(--s4); animation: fade .2s; }
.modal-card { background: var(--surface); color: var(--ink); border-radius: var(--r-xl); padding: var(--s6); width: 100%; max-width: 420px; box-shadow: var(--shadow-3); animation: pop .3s var(--ease); }
.modal-card h3 { margin: 0 0 var(--s2); font-size: var(--t-lg); }
.modal-card p { margin: 0 0 var(--s4); color: var(--ink-2); font-size: var(--t-sm); }
.modal-card input { width: 100%; min-height: 48px; padding: 0 16px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink); font: inherit; }
.modal-card input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.modal-err { color: var(--danger) !important; margin: var(--s2) 0 0 !important; }
.modal-actions { display: flex; justify-content: flex-end; gap: var(--s2); margin-top: var(--s5); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.ui-toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px); opacity: 0; z-index: 2000; background: var(--ink); color: var(--bg); padding: 12px 20px;
  border-radius: var(--r-pill); font-size: var(--t-sm); font-weight: 600; box-shadow: var(--shadow-3); transition: all .3s var(--ease); max-width: calc(100vw - 32px); }
.ui-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 스크롤 등장 */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media print { .topbar, .rail, .to-top, .feedback, .footer, .inline-cta { display: none !important; } .reveal { opacity: 1; transform: none; } }

/* 상단 바: 좁은 화면 */
.logo, .seg a, .topbar .btn { white-space: nowrap; }
.logo { min-width: 0; flex: none; }
@media (max-width: 640px) {
  .topbar-in { gap: var(--s2); }
  .logo { font-size: 15px; gap: 8px; }
  .logo-name { flex-direction: column; align-items: flex-start; gap: 0; line-height: 1.15; }
  .logo small { font-size: 13px; max-width: 130px; }
  .topbar .btn { min-height: 36px; padding: 0 12px; font-size: 13px; }
  .topbar .icon-btn { width: 36px; padding: 0; }
  .seg a { min-height: 30px; padding: 0 9px; font-size: 12px; }
}
@media (max-width: 360px) { .logo-text { font-size: 14px; } .logo small { max-width: 96px; } }

/* 카드형 블록 앞뒤 여백 */
.prose > .stat, .prose > .stats, .prose > .chart, .prose > .tip, .prose > .p-key, .prose > blockquote { margin-top: 1.5em; }
.prose > .stat + *, .prose > .stats + *, .prose > .chart + *, .prose > .tip + *, .prose > .p-key + *, .prose > blockquote + * { margin-top: 1.5em; }

.footer-notice { order: 3; flex-basis: 100%; margin: 0; font-size: 12px; line-height: 1.6; color: var(--ink-3); }
img.logo-mark { width: 30px; height: 30px; background: none; border-radius: 0; display: block; }

/* 지난 호 검색 + 더 보기 */
.list-head { gap: var(--s3); flex-wrap: wrap; align-items: center; }
.search { display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; height: 40px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); color: var(--ink-3); min-width: 0; flex: 0 1 300px; }
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); color: var(--brand); }
.search input { border: 0; outline: 0; background: transparent; font: inherit; font-size: 14px; color: var(--ink); width: 100%; min-width: 0; }
.search-empty { grid-column: 1 / -1; text-align: center; color: var(--ink-3); padding: var(--s7) 0; margin: 0; }
.more-wrap { display: flex; justify-content: center; margin-top: var(--s5); }
.more-wrap:empty { display: none; }
.more-btn { min-width: 200px; justify-content: center; }
@media (max-width: 640px) { .search { flex-basis: 100%; } }

/* 각 호 하단 목록 보기 */
.pager-home { display: flex; justify-content: center; margin-top: var(--s5); }
.pager-home .btn { gap: 8px; min-width: 180px; justify-content: center; border: 1px solid var(--line); }

/* 로딩: 편지지 고르기 → 봉투에 넣기 → 보내기 → 우체부 도착 */
.loader { min-height: 62vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; opacity: 0; animation: ld-in .3s .15s ease forwards; }
.ld-stage { position: relative; width: 120px; height: 120px; }
.ld-svg { display: block; overflow: visible; filter: drop-shadow(0 10px 18px rgba(86,36,208,.22)); }
.ld-svg g { transform-box: fill-box; transform-origin: center; }
.loader-lines { position: absolute; right: 100%; top: 62%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 8px; margin-right: 2px; opacity: 0; }
.loader-lines i { display: block; height: 5px; border-radius: 5px; background: var(--brand); opacity: .35; }
.loader-lines i:nth-child(1) { width: 30px; margin-left: 12px; } .loader-lines i:nth-child(2) { width: 44px; } .loader-lines i:nth-child(3) { width: 24px; margin-left: 18px; }
.ld-dot { transform-box: fill-box; transform-origin: center; transform: scale(0); }
.loader-shadow { width: 70px; height: 10px; border-radius: 50%; background: var(--ink); opacity: .08; }
.loader-text { margin: 10px 0 0; color: var(--ink-2); font-weight: 700; font-size: 15px; min-height: 1.5em; }
#ld-msg { display: inline-block; animation: ld-msg .35s ease; }
.loader-dots i { font-style: normal; animation: ld-dot 1.2s infinite; }
.loader-dots i:nth-child(2) { animation-delay: .2s; } .loader-dots i:nth-child(3) { animation-delay: .4s; }
/* ① 편지지 고르기: 종이가 좌우로 갸웃 */
.loader[data-ph="0"] .ld-paper { animation: ld-pick 1.1s ease-in-out both; }
/* ② 봉투에 넣기: 종이가 쏙 내려감 */
.loader[data-ph="1"] .ld-paper { animation: ld-insert 1.1s cubic-bezier(.5,0,.3,1) forwards; }
.loader[data-ph="1"] .ld-env { animation: ld-squash 1.1s ease forwards; }
/* ③ 보내기: 알림 점 톡, 오른쪽으로 슈웅 */
.loader[data-ph="2"] .ld-paper, .loader[data-ph="3"] .ld-paper { transform: translateY(46px); opacity: 0; }
.loader[data-ph="2"] .ld-dot { animation: ld-pop .4s ease forwards; }
.loader[data-ph="2"] .ld-env { animation: ld-send 1.1s cubic-bezier(.6,0,.4,1) forwards; }
.loader[data-ph="2"] .loader-shadow { animation: ld-shadow-out 1.1s ease forwards; }
/* ④ 우체부 도착: 왼쪽에서 날아와 통통 */
.loader[data-ph="3"] .ld-dot { transform: scale(1); }
.loader[data-ph="3"] .ld-env { animation: ld-arrive 1.1s cubic-bezier(.3,0,.2,1) forwards; }
.loader[data-ph="3"] .loader-lines { animation: ld-lines 1.1s ease forwards; }
@keyframes ld-in { to { opacity: 1; } }
@keyframes ld-msg { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes ld-pick { 0% { transform: translateY(8px) rotate(0); } 25% { transform: translateY(-6px) rotate(-9deg); } 55% { transform: translateY(-8px) rotate(8deg); } 80%, 100% { transform: translateY(-4px) rotate(0); } }
@keyframes ld-insert { 0% { transform: translateY(-4px); } 25% { transform: translateY(-12px); } 100% { transform: translateY(46px); } }
@keyframes ld-squash { 0%, 55% { transform: none; } 70% { transform: scale(1.06, .92); } 85% { transform: scale(.98, 1.03); } 100% { transform: none; } }
@keyframes ld-pop { 0% { transform: scale(0); } 60% { transform: scale(1.4); } 100% { transform: scale(1); } }
@keyframes ld-send { 0%, 30% { transform: none; } 45% { transform: translateX(-10px) rotate(-6deg); } 100% { transform: translateX(150px) translateY(-30px) rotate(14deg); opacity: 0; } }
@keyframes ld-shadow-out { 0%, 40% { transform: none; opacity: .08; } 100% { transform: translateX(120px) scale(.4); opacity: 0; } }
@keyframes ld-arrive { 0% { transform: translateX(-160px) translateY(-20px) rotate(-14deg); opacity: 0; } 20% { opacity: 1; } 55% { transform: translateX(0) translateY(-12px) rotate(4deg); } 70% { transform: scale(1.07, .93); } 85% { transform: translateY(-5px); } 100% { transform: none; } }
@keyframes ld-lines { 0% { opacity: 0; transform: translate(-60px, -50%); } 25% { opacity: 1; } 60% { opacity: 1; transform: translate(0, -50%); } 100% { opacity: 0; transform: translate(10px, -50%); } }
@keyframes ld-dot { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .loader *, .loader { animation: none !important; } .loader { opacity: 1; } }
.cover-top { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.cover-top .eyebrow { margin: 0; }
.share-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: border-color .2s, color .2s, background .2s; }
.share-btn:hover, .share-btn:focus-visible { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* 제목 줄바꿈: 단어 단위 + 줄 길이 균형 */
.gate-title, .cover h1, .feature-body h2, .card-body h4, .pager b, .pick-body h2 { word-break: keep-all; text-wrap: balance; }
/* 게이트 설명: PC 2줄 / 모바일 4줄(문장 단위) */
.gate-sub .ln { display: inline; }
@media (max-width: 640px) {
  .gate-sub { font-size: 16px; line-height: 1.65; }
  .gate-sub .ln { display: block; }
  .gate-sub br.pc { display: none; }
}
/* 리스트형 강의 중간 안내: 앞뒤 선과 붙지 않게 */
.courses .wrap { padding: 0; }
.courses .inline-cta { margin: var(--s5) auto; }
.clist-cont { border-top: 0; }
/* 섹션 목차(왼쪽 고정): 본문과 겹치지 않을 만큼 넓을 때만 */
@media (max-width: 1440px) { .rail { display: none; } }
/* 좁은 화면 섹션 바 (헤더 밑 한 줄) */
.snav { display: none; }
@media (max-width: 1440px) {
  .snav { display: block; height: 0; overflow: hidden; border-top: 1px solid transparent; transition: height .25s var(--ease), border-color .25s; }
  .snav.show { height: 40px; border-top-color: var(--line); }
  .snav-in { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; max-width: var(--wide); margin: 0 auto; padding: 0 var(--s5); height: 40px; align-items: center; }
  .snav-in::-webkit-scrollbar { display: none; }
  .snav a { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: var(--r-pill); font-size: 13px; font-weight: 600; color: var(--ink-3); text-decoration: none; white-space: nowrap; }
  .snav a b { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
  .snav a.on { background: var(--brand-soft); color: var(--brand); }
  .snav a.on b { color: var(--brand); }
}
@media (max-width: 640px) { .snav-in { padding: 0 12px; } }
.signoff .btn { white-space: normal; text-align: center; line-height: 1.35; }
@media (max-width: 1440px) { .sec { scroll-margin-top: 116px; } }
/* 번호 구분: 섹션은 PART n(보라 글자), 강의 순번은 작은 회색 원 */
.sec-num { letter-spacing: .12em; }
.crow-rank { font-size: 0; line-height: 0; }
.crow-rank span { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--line-strong); color: var(--ink-2); font-size: 14px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .crow-rank span { width: 28px; height: 28px; font-size: 13px; } }

/* 본문 칼럼 하나로 통일: 섹션 제목·이미지·본문·강의·안내 박스·이전/다음 호 좌우 끝선 일치 */
:root { --col: 820px; }
.sec-head { max-width: var(--col); margin-left: auto; margin-right: auto; }
/* 반응형 폭: 화면에 비례해 넓어지고(최소~최대), 본문 글자도 함께 커져 한 줄 길이를 유지 */
:root { --col: clamp(720px, calc(40vw + 270px), 1000px); --wide: clamp(960px, calc(50vw + 400px), 1320px); }
.prose { font-size: clamp(17px, 0.42vw + 12px, 19px); }
.cover h1 { max-width: min(100%, calc(var(--col) + 80px)); }
.cover-sub { max-width: var(--col); }
.prose > .p-head + p { margin-top: .85em; }
.prose > .p-sub + p { margin-top: .55em; }
