/* 발표 사이트 공통 모양. 슬라이드는 1280x720 판을 줄여서 보여 준다. */
:root {
  --font: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --mono: "JetBrains Mono", "D2Coding", ui-monospace, Consolas, monospace;
  --notes-size: 22px;
}
[data-theme="dark"], .home { --bg: #121110; --fg: #ece8e1; --dim: #8d877d; --line: #2b2925; --card: #1b1a18; --accent: #ff6a3d; --code-bg: #1d1c1a; }
[data-theme="light"] { --bg: #f3f0e9; --fg: #161514; --dim: #6f6a61; --line: #dcd6ca; --card: #fbfaf6; --accent: #d9401a; --code-bg: #e9e4d9; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--fg); font-family: var(--font); -webkit-font-smoothing: antialiased; word-break: keep-all; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
code { font-family: var(--mono); font-size: .88em; }

/* ── 슬라이드 판 ───────────────────────────── */
.slide { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; transform-origin: 0 0; overflow: hidden;
  background: var(--bg); color: var(--fg); padding: 84px 104px 72px; display: flex; flex-direction: column; justify-content: center;
  transition: opacity .28s ease; }
.slide.enter { opacity: 0; }
.slide-body { max-width: 100%; }
.slide-body > :first-child { margin-top: 0; }
.slide-body > :last-child { margin-bottom: 0; }
.slide-num { position: absolute; right: 48px; bottom: 32px; font-size: 15px; color: var(--dim); font-variant-numeric: tabular-nums; letter-spacing: .04em; }

.slide h1 { font-size: 76px; line-height: 1.08; letter-spacing: -.035em; font-weight: 750; margin: 0 0 28px; }
.slide h2 { font-size: 54px; line-height: 1.12; letter-spacing: -.03em; font-weight: 700; margin: 0 0 36px; }
.slide h3 { font-size: 34px; line-height: 1.25; letter-spacing: -.02em; font-weight: 650; margin: 0 0 18px; }
.slide h4, .slide h5, .slide h6 { font-size: 20px; text-transform: uppercase; letter-spacing: .14em; color: var(--accent); font-weight: 600; margin: 0 0 20px; }
.slide p, .slide li { font-size: 30px; line-height: 1.5; }
.slide p { margin: 0 0 22px; max-width: 30em; }
.slide strong { font-weight: 700; color: var(--fg); }
.slide em { font-style: normal; color: var(--accent); }
.slide mark { background: none; color: var(--accent); box-shadow: inset 0 -.32em color-mix(in srgb, var(--accent) 24%, transparent); }
.slide del { color: var(--dim); }
.slide a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: .18em; }
.slide ul, .slide ol { margin: 0 0 22px; padding-left: 1.15em; }
.slide ul, .slide ol { font-size: 30px; }
.slide li ul, .slide li ol { font-size: 25px; }
.slide li { margin: 0 0 12px; padding-left: .2em; }
.slide li::marker { color: var(--accent); }
.slide ul > li { list-style: none; position: relative; }
.slide ul > li::before { content: ""; position: absolute; left: -1.15em; top: .7em; width: .42em; height: 2px; background: var(--accent); }
.slide li li { font-size: 25px; color: var(--dim); margin: 8px 0 0; }
.slide blockquote { margin: 0 0 22px; padding: 0 0 0 32px; border-left: 3px solid var(--accent); }
.slide blockquote p { font-size: 40px; line-height: 1.35; letter-spacing: -.02em; }
.slide code { background: var(--code-bg); padding: .08em .32em; border-radius: 4px; }
.slide pre { margin: 0 0 22px; padding: 26px 30px; background: var(--code-bg); border-radius: 8px; font-size: 22px; line-height: 1.55; overflow: hidden; position: relative; }
.slide pre code { background: none; padding: 0; font-size: inherit; }
.slide pre[data-lang]::after { content: attr(data-lang); position: absolute; top: 12px; right: 16px; font: 13px var(--mono); color: var(--dim); }
.slide table { border-collapse: collapse; font-size: 24px; margin: 0 0 22px; min-width: 60%; }
.slide th, .slide td { padding: 14px 28px 14px 0; border-bottom: 1px solid var(--line); text-align: left; font-variant-numeric: tabular-nums; }
.slide th { font-size: 16px; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); font-weight: 600; }
.slide figure { margin: 0 0 22px; }
.slide img { max-width: 100%; max-height: 460px; display: block; border-radius: 6px; }

/* 단계(+ 목록) */
.slide .step { opacity: 0; transform: translateY(8px); transition: opacity .3s ease, transform .3s ease; }
.slide .step.shown { opacity: 1; transform: none; }

/* 모양 */
.layout-title { justify-content: flex-end; padding-bottom: 108px; }
.layout-title h1 { font-size: 96px; max-width: 11em; }
.layout-title p { color: var(--dim); font-size: 26px; }
.layout-title::before { content: ""; position: absolute; left: 104px; top: 84px; width: 56px; height: 6px; background: var(--accent); }
.layout-section { background: var(--accent); color: #140b07; }
.layout-section h1, .layout-section h2 { font-size: 104px; letter-spacing: -.045em; margin: 0; }
.layout-section p { color: #140b07; opacity: .72; margin-top: 24px; }
.layout-section .slide-num { color: #140b07; opacity: .6; }
.layout-center { align-items: center; text-align: center; }
.layout-center p { margin-left: auto; margin-right: auto; }
.layout-center blockquote { border: 0; padding: 0; }
.layout-center blockquote p { font-size: 52px; }
.layout-split .slide-body { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: center; }

/* ── 발표 화면 ───────────────────────────── */
.show { overflow: hidden; }
#stage { position: fixed; inset: 0; overflow: hidden; }
.show.blank #stage { visibility: hidden; }
#progress { position: fixed; left: 0; bottom: 0; height: 3px; width: 0; background: var(--accent); transition: width .3s ease; z-index: 5; }
#controls { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 12px); display: flex; align-items: center; gap: 4px; padding: 6px 8px;
  background: color-mix(in srgb, var(--card) 88%, transparent); border: 1px solid var(--line); border-radius: 10px; backdrop-filter: blur(8px);
  font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; z-index: 6; }
.show.ui #controls, #controls:hover, #controls:focus-within { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#controls button, #controls a { padding: 6px 10px; border-radius: 6px; color: var(--fg); text-decoration: none; }
#controls button:hover, #controls a:hover { background: var(--line); }
#btn-prev, #btn-next { font-size: 20px; line-height: 1; }
#counter { min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; color: var(--dim); }
#controls .sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
#overview { position: fixed; inset: 0; z-index: 8; background: var(--bg); overflow: auto; padding: 40px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; align-content: start; }
#overview[hidden] { display: none; }
.thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 6px; outline: 1px solid var(--line); padding: 0; }
.thumb.current { outline: 2px solid var(--accent); outline-offset: 3px; }
.thumb:hover { outline-color: var(--dim); }
.thumb .slide { transition: none; pointer-events: none; }
.thumb .step { opacity: 1; transform: none; }
#print { display: none; }
.fail { position: absolute; inset: 0; display: grid; place-content: center; gap: 12px; text-align: center; font-size: 20px; }
.fail code { color: var(--dim); }
.fail a { color: var(--accent); }

/* ── 발표자 화면 ───────────────────────────── */
.presenter { display: grid; height: 100vh; padding: 16px 20px; gap: 16px; overflow: hidden;
  grid-template: "head head" auto "now next" 1fr "now notes" 1.6fr "foot foot" auto / 1.55fr 1fr; }
.presenter header { grid-area: head; display: flex; align-items: center; gap: 20px; font-size: 15px; }
#deck-title { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#pos { color: var(--dim); font-variant-numeric: tabular-nums; }
#timer { font-size: 34px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.02em; padding: 0 6px; border-radius: 6px; }
#timer.paused { color: var(--dim); }
#timer:hover { background: var(--line); }
#clock { font-size: 22px; color: var(--dim); font-variant-numeric: tabular-nums; }
.p-now { grid-area: now; } .p-next { grid-area: next; } .p-notes { grid-area: notes; }
.presenter section { display: flex; flex-direction: column; min-height: 0; }
.label { font-size: 12px; letter-spacing: .14em; color: var(--dim); margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.label .font button { font-size: 13px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 5px; margin-left: 4px; letter-spacing: 0; }
.box { position: relative; flex: 1; overflow: hidden; }
.box .slide { outline: 2px solid var(--line); }
.p-now .box .slide { outline: 3px solid var(--accent); }
.box .end { position: absolute; inset: 0; display: grid; place-content: center; color: var(--dim); font-size: 22px; }
.box .slide { transition: none; }
.box .step:not(.shown) { opacity: .22; }
#notes { flex: 1; overflow: auto; font-size: var(--notes-size); line-height: 1.6; padding: 14px 18px; background: var(--card); border-radius: 6px; }
#notes p { margin: 0 0 .7em; }
#notes ul, #notes ol { margin: 0 0 .7em; padding-left: 1.2em; }
#notes .muted { color: var(--dim); }
#notes strong { color: var(--accent); }
.presenter footer { grid-area: foot; display: flex; gap: 10px; }
.presenter footer button { flex: 1; padding: 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 16px; }
.presenter footer button:hover { background: var(--line); }

/* ── 첫 화면(목록) ───────────────────────────── */
.home { max-width: 920px; margin: 0 auto; padding: 96px 28px 80px; min-height: 100%; }
.home-head h1 { font-size: 64px; letter-spacing: -.04em; margin: 0 0 16px; font-weight: 750; }
.home-head h1::after { content: "."; color: var(--accent); }
.home-head p { color: var(--dim); font-size: 17px; line-height: 1.6; max-width: 34em; margin: 0 0 56px; }
.home code { background: var(--card); padding: .1em .35em; border-radius: 4px; color: var(--fg); }
.decks { list-style: none; margin: 0 0 72px; padding: 0; border-top: 1px solid var(--line); counter-reset: d; }
.decks li { display: flex; align-items: center; border-bottom: 1px solid var(--line); counter-increment: d; }
.decks li.empty { padding: 28px 0; color: var(--dim); }
.deck-link { flex: 1; display: grid; grid-template-columns: 48px 1fr; column-gap: 8px; padding: 26px 0; color: inherit; text-decoration: none; }
.deck-link::before { content: counter(d, decimal-leading-zero); grid-row: span 3; color: var(--dim); font-size: 14px; padding-top: 9px; font-variant-numeric: tabular-nums; }
.deck-link .t { font-size: 28px; font-weight: 650; letter-spacing: -.02em; transition: color .15s; }
.deck-link:hover .t { color: var(--accent); }
.deck-link .d { color: var(--dim); font-size: 16px; margin-top: 6px; }
.deck-link .d:empty { display: none; }
.deck-link .m { color: var(--dim); font-size: 13px; margin-top: 8px; font-family: var(--mono); }
.decks .side { font-size: 14px; color: var(--dim); text-decoration: none; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; white-space: nowrap; }
.decks .side:hover { color: var(--fg); border-color: var(--dim); }
.keys h2 { font-size: 13px; letter-spacing: .14em; color: var(--dim); font-weight: 600; margin: 0 0 18px; }
.keys dl { display: grid; grid-template-columns: repeat(4, auto 1fr); gap: 12px 16px; margin: 0; font-size: 15px; }
.keys dt { font-family: var(--mono); font-size: 13px; color: var(--fg); background: var(--card); border: 1px solid var(--line); padding: 3px 8px; border-radius: 5px; justify-self: start; }
.keys dd { margin: 0; color: var(--dim); align-self: center; }
@media (max-width: 720px) { .keys dl { grid-template-columns: auto 1fr; } .home-head h1 { font-size: 44px; } .decks .side { display: none; } }

/* ── 인쇄 → PDF: 한 장에 한 슬라이드 ───────────────────────────── */
@media print {
  @page { size: 1280px 720px; margin: 0; }
  html, body { height: auto; overflow: visible; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #stage, #controls, #progress, #overview { display: none !important; }
  #print { display: block; }
  #print .slide { position: relative; transform: none; break-after: page; page-break-after: always; }
  #print .slide:last-child { break-after: auto; page-break-after: auto; }
  #print .step { opacity: 1; transform: none; }
}
.layout-section strong, .layout-section em { color: inherit; }
.layout-section code { background: rgba(0,0,0,.14); color: inherit; }
