@charset "UTF-8";

:root {
  color-scheme: light;
  --ink: #17212f;
  --muted: #647184;
  --line: #d9e0e8;
  --paper: #fff;
  --canvas: #e5eaf0;
  --focus: #2364d8;
  --toolbar-height: 72px;
  --page-width: 1280px;
  font-family: Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-padding-top: calc(var(--toolbar-height) + 16px); }
body { min-width: 320px; margin: 0; background: var(--canvas); color: var(--ink); font-family: inherit; font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
button, select, summary { font: inherit; }
button, select { color: inherit; }
a { color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; padding: 10px 14px; transform: translateY(-150%); border: 1px solid var(--line); background: #fff; color: var(--ink); }
.skip-link:focus { transform: translateY(0); }

.site-header { position: sticky; z-index: 30; top: 0; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.98); }
.toolbar-inner { width: min(var(--page-width), calc(100% - 32px)); min-height: var(--toolbar-height); display: flex; align-items: center; gap: 14px; margin: 0 auto; }
.brand { flex: 0 0 auto; color: var(--ink); font-size: 16px; font-weight: 700; letter-spacing: -.025em; text-decoration: none; }
.toc-menu { position: relative; flex: 0 0 auto; }
.toc-menu summary { min-width: 72px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 8px 12px; border: 1px solid var(--line); background: #fff; cursor: pointer; list-style: none; }
.toc-menu summary::-webkit-details-marker { display: none; }
.toc-menu summary::after { content: "⌄"; margin-left: 9px; color: var(--muted); }
.toc-menu[open] summary::after { content: "⌃"; }
.toc-menu nav { position: absolute; z-index: 40; top: calc(100% + 5px); left: 0; width: max-content; min-width: 210px; display: grid; padding: 6px; border: 1px solid var(--line); background: #fff; box-shadow: 0 8px 24px rgba(28, 43, 61, .14); }
.toc-menu nav a { min-height: 44px; display: flex; align-items: center; padding: 8px 11px; color: var(--ink); text-decoration: none; }
.toc-menu nav a:hover { background: #f2f5f8; }
.page-controls { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.control-button, #page-select { min-width: 44px; min-height: 44px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 2px; background: #fff; font-size: 14px; line-height: 1.25; cursor: pointer; }
.control-button:hover:not(:disabled), #page-select:hover { border-color: #aab7c5; background: #f7f9fb; }
.control-button:disabled { color: #9aa4b1; cursor: default; }
#page-select { min-width: 176px; cursor: pointer; }
.expand-button { margin-left: 4px; }

.document { width: min(var(--page-width), calc(100% - 32px)); display: grid; gap: 20px; margin: 0 auto; padding: 20px 0 max(36px, calc(100dvh - var(--toolbar-height) - min(720px, 56.25vw) - 50px)); }
.portfolio-page { min-width: 0; }
.slide-canvas { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #fff; box-shadow: 0 2px 8px rgba(25, 39, 56, .12); }
.page-image-link { position: absolute; z-index: 1; inset: 0; display: block; background: #fff; cursor: zoom-in; }
.slide-image { width: 100%; height: 100%; object-fit: contain; }
.zoom-hint { position: absolute; right: 12px; bottom: 12px; padding: 5px 9px; background: rgba(23, 33, 47, .82); color: #fff; font-size: 12px; opacity: 0; transition: opacity .12s ease; }
.page-image-link:hover .zoom-hint, .page-image-link:focus-visible .zoom-hint { opacity: 1; }
.page-hotspot { position: absolute; z-index: 2; display: block; overflow: hidden; color: transparent; text-decoration: none; }
.page-hotspot:hover { background: rgba(35, 100, 216, .07); outline: 1px solid rgba(35, 100, 216, .5); }
.page-hotspot:focus-visible { background: rgba(35, 100, 216, .10); outline: 3px solid var(--focus); outline-offset: -3px; }
.page-text { margin-top: 8px; background: rgba(255,255,255,.76); }
.page-text summary { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 14px; color: #576577; font-size: 13px; cursor: pointer; list-style: none; }
.page-text summary::-webkit-details-marker { display: none; }
.page-text summary::after { content: "+"; color: #576577; font-size: 18px; }
.page-text[open] summary::after { content: "−"; }
.page-text summary span:first-child { font-variant-numeric: tabular-nums; }
.transcript { padding: 5px 16px 18px; border-top: 1px solid #e7ebf0; background: #fff; color: #344253; }
.transcript p { margin: 8px 0 0; white-space: pre-line; }

.image-dialog { width: min(96vw, 1520px); height: min(92dvh, 1040px); max-width: none; max-height: none; margin: auto; padding: 0; overflow: hidden; border: 1px solid #cbd3dd; border-radius: 2px; background: #fff; color: var(--ink); box-shadow: 0 18px 64px rgba(21, 34, 50, .32); }
.image-dialog::backdrop { background: rgba(21, 32, 46, .72); }
.image-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.dialog-toolbar { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px 8px 16px; border-bottom: 1px solid var(--line); }
.dialog-toolbar h2 { min-width: 0; margin: 0; overflow-wrap: anywhere; font-size: 15px; font-weight: 650; }
.dialog-actions { display: flex; flex: 0 0 auto; gap: 6px; }
.dialog-actions .control-button { min-height: 42px; }
.dialog-body { min-height: 0; display: flex; align-items: center; justify-content: center; overflow: auto; padding: 14px; background: #e9edf2; }
.dialog-body img { width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; }
.image-dialog.zoomed .dialog-body { display: block; text-align: center; }
.image-dialog.zoomed .dialog-body img { width: 1920px; height: auto; max-width: none; max-height: none; }
.dialog-status { min-height: 34px; display: flex; align-items: center; justify-content: center; margin: 0; padding: 5px 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
body.dialog-open { overflow: hidden; }

@media (max-width: 640px) {
  :root { --toolbar-height: 118px; }
  .toolbar-inner { width: calc(100% - 24px); min-height: 0; display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 8px 0 9px; }
  .brand { grid-column: 1; grid-row: 1; font-size: 15px; }
  .toc-menu { grid-column: 2; grid-row: 1; }
  .toc-menu summary { min-height: 44px; }
  .toc-menu nav { right: 0; left: auto; }
  .page-controls { grid-column: 1 / -1; grid-row: 2; width: 100%; justify-content: stretch; gap: 5px; margin: 0; }
  .page-controls > button { flex: 0 0 auto; min-width: 50px; padding-right: 8px; padding-left: 8px; }
  #page-select { flex: 1 1 auto; min-width: 0; }
  .expand-button { margin-left: auto; }
  .document { width: calc(100% - 16px); gap: 14px; padding-top: 10px; }
  .page-text { margin-top: 6px; }
  .image-dialog { width: 100vw; height: 100dvh; border: 0; }
  .dialog-toolbar { align-items: flex-start; flex-wrap: wrap; padding: 8px; }
  .dialog-toolbar h2 { flex: 1 1 100%; }
  .dialog-actions { width: 100%; justify-content: flex-end; }
  .dialog-actions .control-button { flex: 1 1 auto; min-width: 0; padding-right: 6px; padding-left: 6px; }
  .dialog-body { padding: 7px; }
  .image-dialog.zoomed .dialog-body img { width: 960px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media print {
  @page { size: landscape; margin: 0; }
  body { background: #fff; }
  .site-header, .page-text, .zoom-hint, .skip-link, .image-dialog { display: none !important; }
  .document { width: 100%; gap: 0; margin: 0; padding: 0; }
  .portfolio-page { break-after: page; }
  .slide-canvas { width: 100vw; height: 56.25vw; box-shadow: none; }
}
