@font-face { font-family: 'Pretendard'; src: url('fonts/PretendardVariable.woff2') format('woff2'); font-weight: 45 920; font-display: block; }
:root {
  --paper: #FAF8F3; --panel: #FFFFFF; --line: #E7E2D6; --hair: #C9C4B8;
  --ink: #1B1D24; --quiet: #6B6F7C; --quiet2: #4E525E;
  --inc: #E3264C; --dec: #2C63E0; --low: #9C9EA6; --nr: #CBC4B5;
  --fs-11: 11px; --fs-13: 13px; --fs-16: 16px; --fs-22: 22px; --fs-34: 34px;
  --ease: cubic-bezier(.22,.8,.2,1); --ease-in: cubic-bezier(.4,0,1,1); --exit: 160ms; --enter: 360ms;
  --sans: 'Pretendard', -apple-system, 'Segoe UI', system-ui, sans-serif;
  --serif: 'EB Garamond', Georgia, serif;
  --gut: 48px;              --bar: 44px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--paper); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
body { overflow: hidden; }
::selection { background: color-mix(in srgb, var(--inc) 22%, var(--paper)); color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

.skip { position: absolute; left: 16px; top: -48px; z-index: 40; background: var(--ink); color: var(--panel); padding: 10px 14px; border-radius: 6px; font-size: var(--fs-13); text-decoration: none; }
.skip:focus { top: 8px; }

.bar { height: var(--bar); display: flex; align-items: center; justify-content: space-between; padding: 0 var(--gut); }
.mark { font-size: var(--fs-13); font-weight: 650; letter-spacing: .01em; margin: 0; }
.steps { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; }
.steps li { width: 28px; height: 3px; border-radius: 2px; background: var(--line); transition: background var(--enter) var(--ease); }
.steps li.done { background: var(--hair); }
.steps li.now { background: var(--ink); }

main { display: flex; flex-direction: column; height: calc(100vh - var(--bar)); }
.head { position: relative; padding: 4px var(--gut) 0; }
.titles { min-width: 0; }
h1 { margin: 0; font-weight: 750; letter-spacing: -0.01em; text-wrap: balance; outline: none; }
h1:focus, h1:focus-visible { outline: none; }
h1 .l1 { display: block; min-height: 44px; padding: 7px calc(var(--dockw, 240px) + 24px) 4px 0; font-size: var(--fs-22); line-height: 1.3; font-weight: 600; color: var(--quiet2); letter-spacing: 0; }
h1 .l1:has(.hz) { text-wrap: wrap; }
h1 .l1 .hz { display: inline-block; color: var(--ink); }
h1 .l2 { display: block; font-size: var(--fs-34); line-height: 1.16; }
h1 .l2.quiet { font-size: var(--fs-22); font-weight: 500; color: var(--quiet); }
h1 .inc { color: var(--inc); } h1 .dec { color: var(--dec); }
h1 .word { font-family: var(--serif); font-style: italic; font-weight: 500; }   h1 .conf { font-style: normal; }                                                  h1 .ctxw { color: var(--ink); }
.sub { margin: 8px 0 0; font-size: var(--fs-16); line-height: 1.4; color: var(--quiet); max-width: 120ch; }
.sub:empty { display: none; }

.slot { font: inherit; color: var(--ink); background: none; border: 0; padding: 0 2px; margin: 0 -2px; cursor: pointer; border-radius: 4px; touch-action: manipulation;
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; text-decoration-color: var(--hair); }
.slot:hover { text-decoration-color: var(--ink); }
.slot.empty { text-decoration-color: var(--ink); text-decoration-style: dashed; }
.slot svg { width: 14px; height: 14px; margin-left: 4px; vertical-align: 1px; }
.slot[aria-expanded="true"] { text-decoration-color: var(--ink); }

.dock { position: absolute; right: var(--gut); top: 4px; display: flex; align-items: center; gap: 12px; }
.btn { font: 600 var(--fs-16)/1 var(--sans); display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 999px;
  border: 1px solid var(--ink); background: var(--ink); color: var(--panel); cursor: pointer; text-decoration: none; touch-action: manipulation; white-space: nowrap;
  transition: transform 120ms var(--ease), background 120ms var(--ease); }
.btn:hover { background: #33363F; }
.btn:active { transform: scale(.98); }
.btn svg { width: 16px; height: 16px; flex: none; }
.back { font: 500 var(--fs-13)/1 var(--sans); color: var(--quiet); text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; border-radius: 6px; }
.back:hover { color: var(--ink); }
.nudge { animation: ring 1400ms var(--ease) 700ms 2; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ink) 30%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }

.fig { position: relative; flex: 1; min-height: 0; margin: 14px 0 0; outline: none; }
#stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
#cv, #ov { position: absolute; left: 0; top: 0; display: block; }
#ov { font-family: var(--sans); overflow: visible; }
#ov .ovl { transition: opacity .28s var(--ease); }
#ov .ovl.off { opacity: 0; }
#ov text { paint-order: stroke; stroke: var(--paper); stroke-width: 3px; stroke-linejoin: round; }
#ov .pill text, #ov .cell text { stroke: none; }
#ov [data-drv], #ov [data-key], #ov [data-act] { cursor: pointer; }
#ov [data-key] { transition: opacity .2s var(--ease); }
#ov .dim { opacity: .22; }
#ov [data-drv]:focus, #ov [data-key]:focus { outline: none; }
#ov [data-drv]:focus-visible, #ov [data-key]:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
#ov .nring { fill: none; stroke: var(--ink); stroke-opacity: 0; animation: nring 1400ms var(--ease) 700ms 2; }
@keyframes nring { 0% { stroke-width: 1; stroke-opacity: .45; } 100% { stroke-width: 14; stroke-opacity: 0; } }
.pending { position: absolute; left: var(--gut); top: 8px; margin: 0; font-size: var(--fs-16); color: var(--quiet); }

.foot { margin: 8px var(--gut) 0; padding: 9px 0 12px; border-top: 1px solid var(--line); font-size: var(--fs-13); line-height: 1.45; color: var(--quiet); }
.foot p { margin: 0; }

.pop { position: fixed; z-index: 20; background: var(--panel); border-radius: 12px; padding: 18px 20px 14px; box-shadow: 0 18px 40px -18px rgba(27,29,36,.28), 0 0 0 1px var(--line);
  max-height: calc(100vh - 120px); overflow: auto; overscroll-behavior: contain; animation: popin 220ms var(--ease); }
@keyframes popin { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.pop h2 { margin: 0 0 12px; font-size: var(--fs-16); font-weight: 650; }
.pop .cols { columns: 3 220px; column-gap: 28px; }
.pop .grp { break-inside: avoid; margin-bottom: 12px; }
.pop .grp p, .pop .lab { margin: 0 0 4px; font-size: var(--fs-11); color: var(--quiet); text-transform: uppercase; letter-spacing: .06em; }
.pop .opt { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; text-align: left; font: 500 var(--fs-13)/1.25 var(--sans);
  color: var(--ink); background: none; border: 0; border-radius: 6px; padding: 8px; min-height: 36px; cursor: pointer; }
.pop .opt:hover, .pop .opt:focus-visible, .pop .opt.on { background: var(--paper); }
.pop .opt small { color: var(--quiet); font-weight: 500; font-size: var(--fs-11); }
.pop .opt small.ex { color: var(--inc); font-weight: 650; }
.pop .opt[aria-current="true"] { font-weight: 700; }
.pop input { width: 100%; height: 44px; border: 1px solid var(--hair); background: var(--panel); border-radius: 22px; padding: 0 16px; font: inherit; font-size: var(--fs-16); color: var(--ink); }
.pop input:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
#suggest { list-style: none; margin: 8px 0 0; padding: 0; }
#suggest li { padding: 9px 10px; border-radius: 6px; font-size: var(--fs-16); cursor: pointer; }
#suggest li span { color: var(--quiet); font-size: var(--fs-13); margin-left: 6px; }
#suggest li:hover, #suggest li:focus { background: var(--paper); outline: none; }
#suggest li:focus-visible { outline: 2px solid var(--ink); }
.pop .exs { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }

#card { position: absolute; right: 48px; top: 40px; width: 440px; max-height: 620px; overflow: auto; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 18px 20px; font-size: 16px; z-index: 6; box-shadow: 0 10px 30px rgba(27,29,36,.08); }
#card h3 { margin: 0 24px 10px 0; font-size: 18px; line-height: 1.3; }
#card h4 { margin: 0 0 2px; font-size: 16px; color: var(--quiet); font-weight: 650; }
#card p { margin: 0 0 12px; line-height: 1.4; }
#card p.why { color: var(--ink); }
#card p.appr { color: var(--quiet2); margin: -6px 0 12px; }
#card .num { font-weight: 700; }
#card blockquote { margin: 0 0 12px; padding-left: 12px; border-left: 2px solid var(--ink); font-family: var(--serif); font-size: 17px; line-height: 1.4; color: var(--quiet2); }
#card details.quote summary, #card details.leg summary { cursor: pointer; color: var(--quiet2); font-weight: 650; margin: 0 0 8px; }
#card .x { position: absolute; right: 6px; top: 4px; width: 44px; height: 44px; border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--quiet); border-radius: 6px; }
#card p.copyrow { margin: -4px 0 14px; }
#card .chip { height: 36px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); border-radius: 18px; padding: 0 14px; font: inherit; font-size: 15px; font-weight: 650; cursor: pointer; }

#tip { position: fixed; z-index: 30; pointer-events: none; background: var(--ink); color: #fff; font-size: 13.5px; line-height: 1.35; padding: 7px 10px; border-radius: 6px; max-width: 320px; }
#tip .tipc { color: var(--hair); }

.leaving .head, .leaving .foot { opacity: 0; transform: translateY(-6px); transition: opacity var(--exit) var(--ease-in), transform var(--exit) var(--ease-in); }
.entering .head, .entering .foot { animation: enter var(--enter) var(--ease) both; }
.entering .foot { animation-delay: 120ms; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }

body.narrow { overflow: auto; }
.narrow main { height: auto; }
.narrow .dock { position: static; margin: 10px 0 0; flex-wrap: wrap; }
.narrow h1 .l1 { padding-right: 0; min-height: 0; font-size: var(--fs-16); }
.narrow h1 .l2 { font-size: var(--fs-22); }
.narrow .fig { flex: none; height: auto; aspect-ratio: 1440 / 900; }

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