@font-face { font-family: "Pretendard Variable"; src: url("./fonts/PretendardVariable.woff2") format("woff2-variations"); font-weight: 45 920; font-style: normal; font-display: swap; }
:root {
  --ink: #111214;
  --ink-2: #4a4d52;
  --muted: #8a8f96;
  --line: #e4e6e9;
  --line-2: #f1f2f4;
  --bg: #ffffff;
  --bg-2: #fafafa;
  --accent: #d63d4b;
  --accent-soft: #fdecee;
  --danger: #c91f2c;
  --ok: #16794a;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
  --radius: 4px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--sans); color: var(--ink); background: var(--bg);
  font-size: 15px; line-height: 1.65; letter-spacing: -0.01em; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.02em; text-wrap: balance; }
p { margin: 0; }
.copy-line { display: block; }
.lead, .section-head p, .hint, .closing-line, .notes-col p { text-wrap: pretty; word-break: keep-all; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 32px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); font-weight: 400; }
.hint { color: var(--muted); font-size: 13px; line-height: 1.6; }
.mt { margin-top: 32px; }

/* hatch placeholder */
.hatch {
  position: relative; border: 1px solid var(--line); background-color: var(--bg-2);
  background-image: repeating-linear-gradient(135deg, transparent 0 9px, var(--line) 9px 10px);
  display: flex; align-items: center; justify-content: center; text-align: center;
}
.hatch > span {
  background: var(--bg); padding: 6px 12px; font-size: 12px; color: var(--muted);
  border: 1px solid var(--line); letter-spacing: 0.02em;
}

/* nav */
.nav { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { font-weight: 700; letter-spacing: -0.02em; }
.brand span { font-weight: 400; color: var(--muted); margin-left: 8px; }
.nav-links { display: flex; gap: 24px; font-size: 13px; color: var(--ink-2); }
.nav-links a:hover { color: var(--ink); }
.nav-back { color: var(--muted); }

/* hero */
.hero { padding: 96px 0 80px; border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 64px; align-items: center; }
.eyebrow { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 20px; }
.hero h1 { font-size: 44px; line-height: 1.2; }
.lead { margin-top: 24px; font-size: 17px; color: var(--ink-2); max-width: 520px; }
.hero-actions { display: flex; gap: 12px; margin-top: 32px; }
.hero-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 48px 0 0; padding-top: 24px; border-top: 1px solid var(--line); }
.hero-facts dt { font-size: 12px; color: var(--muted); }
.hero-facts dd { margin: 4px 0 0; font-size: 14px; font-weight: 500; }
.hero-art { min-width: 0; position: relative; }
.hero-art-static { aspect-ratio: 4 / 3; overflow: hidden; }
.hero-art-top, .hero-art-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hero-art-top { min-height: 32px; border-bottom: 1px solid var(--line-2); }
.hero-art-label { display: flex; align-items: center; gap: 8px; font: 10px var(--mono); letter-spacing: .12em; color: var(--ink-2); }
.hero-art-label i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.hero-motion-toggle { padding: 8px 0 8px 8px; border: 0; background: none; color: var(--muted); font: 11px var(--sans); cursor: pointer; }
.hero-motion-toggle:hover { color: var(--accent); }
.hero-motion-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.hero-stage { position: relative; aspect-ratio: 4 / 3; perspective: 900px; }
.hero-stage::before { content: ""; position: absolute; inset: 5% 0; background: radial-gradient(ellipse at 35% 50%, #2457e612, transparent 65%); }
.hero-scene { position: absolute; inset: 0; transform: rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)); transition: transform .5s ease-out; }
.hero-art.is-animated .hero-stage { animation: hero-float 7s ease-in-out infinite; }
.hero-art img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  -webkit-mask-image: radial-gradient(ellipse 72% 72% at 50% 50%, #000 55%, rgba(0,0,0,.6) 78%, transparent 100%);
  mask-image: radial-gradient(ellipse 72% 72% at 50% 50%, #000 55%, rgba(0,0,0,.6) 78%, transparent 100%);
}
.hero-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-scan { transform: translateY(240px); }
.hero-landmarks circle { transform-box: fill-box; transform-origin: center; opacity: .45; }
.hero-streams path { stroke-dasharray: 2 23; opacity: .15; }
.hero-art.is-animated .hero-scan { animation: hero-scan 4.8s ease-in-out infinite; }
.hero-art.is-animated .hero-landmarks circle { animation: hero-landmark 4s ease-out infinite; animation-delay: var(--phase); }
.hero-art.is-animated .hero-streams path { stroke-dasharray: 10 100; opacity: .6; animation: hero-stream 3s linear infinite; animation-delay: var(--phase); }
.hero-art-bottom { border-top: 1px solid var(--line-2); padding-top: 16px; font-size: 11px; color: var(--muted); }
.hero-art-bottom b { color: var(--ink-2); font: 12px var(--mono); }
.hero-signal { display: flex; align-items: center; justify-content: center; gap: 3px; height: 24px; flex: 1; max-width: 140px; overflow: hidden; }
.hero-signal i { flex: 1; height: var(--bar-height); background: var(--accent); opacity: .45; transform: scaleY(.65); }
.hero-art.is-animated .hero-signal i { animation: hero-signal 2.4s ease-in-out infinite; animation-delay: var(--phase); }
.hero-art-caption { margin-top: 14px; text-align: center; font-size: 10px; color: var(--muted); }
.hero-art.is-paused *, .hero-art.is-idle * { animation-play-state: paused !important; }
.hero-art.is-paused .hero-scene, .hero-art.is-idle .hero-scene { transform: none; }
@keyframes hero-float { 0%, 100% { transform: translateY(3px); } 50% { transform: translateY(-7px); } }
@keyframes hero-scan { 0% { transform: translateY(-100px); opacity: 0; } 15%, 75% { opacity: 1; } 95%, 100% { transform: translateY(800px); opacity: 0; } }
@keyframes hero-landmark { 0% { transform: scale(.4); opacity: .8; } 75%, 100% { transform: scale(1.8); opacity: 0; } }
@keyframes hero-stream { to { stroke-dashoffset: -440; } }
@keyframes hero-signal { 0%, 100% { transform: scaleY(.35); opacity: .25; } 50% { transform: scaleY(1); opacity: .8; } }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px;
  border: 1px solid var(--ink); border-radius: var(--radius); background: var(--bg); color: var(--ink);
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; transition: background .15s, color .15s;
}
.btn:hover { background: var(--bg-2); }
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover { background: #2a2c30; }
.btn.ghost { border-color: var(--line); color: var(--ink-2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.file-btn { position: relative; }

/* sections */
.section { padding: 88px 0; border-bottom: 1px solid var(--line); }
.section-head { display: grid; grid-template-columns: 72px 1fr; gap: 0 24px; margin-bottom: 40px; }
.section-head .num { font-family: var(--mono); font-size: 13px; color: var(--muted); padding-top: 8px; }
.section-head h2 { font-size: 28px; grid-column: 2; }
.section-head p { grid-column: 2; margin-top: 12px; color: var(--ink-2); max-width: 760px; }
.input-section { background: var(--bg-2); }
.input-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-left: 96px; }
.status { font-size: 13px; color: var(--muted); margin-left: 8px; }
.status.busy::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 8px; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .2; } }
.cam-panel { margin: 24px 0 0 96px; max-width: 560px; }
.cam-panel video { width: 100%; background: #000; border: 1px solid var(--line); display: block; }
.cam-actions { display: flex; gap: 12px; margin-top: 12px; }

/* registry */
.registry { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 0 96px; }
.reg-item { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--bg); padding: 6px 10px 6px 6px; border-radius: var(--radius); }
.reg-item img { width: 36px; height: 36px; object-fit: cover; display: block; border-radius: 2px; background: var(--line-2); }
.reg-item input { border: none; border-bottom: 1px solid transparent; font: inherit; font-size: 14px; width: 84px; padding: 2px 0; outline: none; background: transparent; }
.reg-item input:focus { border-bottom-color: var(--ink); }
.reg-item .swatch { width: 10px; height: 10px; border-radius: 50%; }
.reg-item button { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; }
.reg-item button:hover { color: var(--danger); }
.reg-item.selected { border-color: var(--ink); }

.notes { background: var(--bg-2); padding: 56px 0; }
.notes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px 48px; }
.notes-col h3 { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin-bottom: 10px; }
.notes-col p { font-size: 13px; color: var(--ink-2); line-height: 1.7; max-width: 520px; }
.notes-wide { grid-column: 1 / -1; }
.credits { font-size: 12px; color: var(--ink-2); line-height: 1.7; }
.credits ul { margin: 0; padding-left: 16px; columns: 2; column-gap: 40px; }
.credits li { break-inside: avoid; margin-bottom: 2px; }
.credits a { text-decoration: underline; text-underline-offset: 2px; }
.credits:not(:empty) + .credits-empty { display: none; }
.credits-empty { font-size: 12px; color: var(--muted); }

/* grids */
.grid { display: grid; gap: 20px; margin-left: 96px; }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid.chips { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.placeholder { grid-column: 1 / -1; min-height: 220px; }
.card { border: 1px solid var(--line); background: var(--bg); }
.card .canvas-wrap { position: relative; background: var(--bg-2); aspect-ratio: 4 / 5; overflow: hidden; }
.card canvas { width: 100%; height: 100%; display: block; object-fit: cover; }
.card .meta { height: 104px; align-content: start; }
.card .meta > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .meta { padding: 12px 14px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 12px; }
.card .meta b { font-weight: 600; }
.card .meta .k { color: var(--muted); }
.chip { border: 1px solid var(--line); background: var(--bg); }
.chip canvas { width: 100%; display: block; aspect-ratio: 1; }
.chip .meta { padding: 10px 12px; border-top: 1px solid var(--line); font-size: 12px; display: flex; justify-content: space-between; }

/* vectors */
.vector-list { display: flex; flex-direction: column; gap: 20px; margin-left: 96px; }
.vector-list .placeholder { min-height: 200px; }
.vec { border: 1px solid var(--line); background: var(--bg); padding: 18px 20px; }
.vec-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 13px; }
.vec-head .name { font-weight: 600; font-size: 15px; }
.vec-head .swatch { width: 10px; height: 10px; border-radius: 50%; }
.vec-head .stats { margin-left: auto; color: var(--muted); }
.vec svg { width: 100%; height: 120px; display: block; }
.vec-nums { margin-top: 12px; display: grid; grid-template-columns: repeat(16, 1fr); gap: 2px 8px; font-size: 11px; color: var(--ink-2); }
.vec-nums span { text-align: right; }
.vec-nums span.neg { color: var(--muted); }
.vec-foot { margin-top: 8px; font-size: 12px; color: var(--muted); }

/* comparison */
.threshold-row { display: flex; align-items: center; gap: 16px; margin: 0 0 28px 96px; flex-wrap: wrap; }
.threshold-row label { font-size: 13px; font-weight: 500; }
.threshold-row input[type=range] { width: 260px; accent-color: var(--ink); }
.threshold-row output { font-size: 14px; min-width: 40px; }
.matrix-wrap { margin-left: 96px; overflow-x: auto; }
.matrix-wrap .placeholder { min-height: 180px; }
table.matrix { border-collapse: collapse; font-size: 13px; }
table.matrix th, table.matrix td { border: 1px solid var(--line); padding: 0; height: 64px; min-width: 96px; text-align: center; vertical-align: middle; }
table.matrix th { background: var(--bg-2); font-weight: 500; padding: 8px 12px; }
table.matrix th .swatch { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
table.matrix td { font-family: var(--mono); font-size: 14px; }
table.matrix td.self { color: var(--muted); background: var(--bg-2); }
table.matrix td.same { color: var(--ok); }
table.matrix td.diff { color: var(--ink); }
table.matrix td small { display: block; font-family: var(--sans); font-size: 11px; color: var(--muted); margin-top: 2px; }
.pair-note { grid-column: 1 / -1; }
.pair-list { margin: 20px 0 0 96px; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.pair { border: 1px solid var(--line); padding: 12px 14px; font-size: 13px; }
.pair .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pair .names { font-weight: 500; }
.pair .verdict { font-size: 12px; padding: 2px 8px; border: 1px solid; border-radius: 2px; }
.pair .verdict.same { color: var(--ok); border-color: var(--ok); }
.pair .verdict.diff { color: var(--ink-2); border-color: var(--line); }
.pair .bar { position: relative; height: 4px; background: var(--line-2); margin-top: 10px; }
.pair .bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink); }
.pair .bar b { position: absolute; top: -4px; width: 1px; height: 12px; background: var(--accent); }
.pair .diffsvg { width: 100%; height: 48px; display: block; margin-top: 10px; }

/* storage */
.storage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-left: 96px; }
.storage-col h3 { font-size: 15px; margin-bottom: 12px; }
.code { font-family: var(--mono); font-size: 12px; line-height: 1.6; background: var(--bg-2); border: 1px solid var(--line); padding: 16px; margin: 0 0 12px; white-space: pre-wrap; word-break: break-all; max-height: 420px; overflow: auto; }
table.plain { width: 100%; border-collapse: collapse; font-size: 13px; }
table.plain th, table.plain td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.plain th { font-weight: 500; color: var(--muted); font-size: 12px; }
table.plain .save-state-col { width: 64px; }
table.plain th:nth-child(2), table.plain td:nth-child(2) { min-width: 64px; text-align: center; white-space: nowrap; }
.flow { margin: 0; padding-left: 20px; font-size: 14px; color: var(--ink-2); }
.flow li { margin-bottom: 6px; }

.closing { border-bottom: none; padding: 96px 0; }
.closing-line { font-size: 24px; font-weight: 500; max-width: 720px; line-height: 1.45; margin-bottom: 16px; }
.footer { border-top: 1px solid var(--line); padding: 24px 0; font-size: 12px; }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .wrap { padding: 0 20px; }
  .hero { padding: 64px 0 56px; }
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero-art { width: 100%; max-width: 560px; justify-self: center; }
  .hero h1 { font-size: 32px; }
  .section { padding: 64px 0; }
  .section-head { grid-template-columns: 1fr; }
  .section-head h2, .section-head p { grid-column: 1; }
  .section-head .num { margin-bottom: 8px; }
  .input-row, .cam-panel, .registry, .grid, .vector-list, .threshold-row, .matrix-wrap, .pair-list, .storage-grid { margin-left: 0; }
  .storage-grid, .notes-grid { grid-template-columns: 1fr; }
  .credits ul { columns: 1; }
  .vec-nums { grid-template-columns: repeat(8, 1fr); }
  .nav-links { display: none; }
}

@media (max-width: 600px) {
  .vec-nums { grid-template-columns: repeat(4, 1fr); }
  .hero-facts { grid-template-columns: 1fr; gap: 12px; }
  .copy-line { display: inline; }
  .copy-line + .copy-line::before { content: " "; }
}

/* ── 애니메이션 ─────────────────────────────── */
.rise { opacity: 0; transform: translateY(14px); animation: rise .7s cubic-bezier(.2,.7,.2,1) forwards; animation-delay: var(--d, 0ms); }
@keyframes rise { to { opacity: 1; transform: none; } }
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s cubic-bezier(.2,.7,.2,1), transform .6s cubic-bezier(.2,.7,.2,1); transition-delay: var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }
td.reveal { transform: none; transition-duration: .35s; }
.vec svg .bars { transform: scaleY(0); transform-origin: 0px 60px; transition: transform .8s cubic-bezier(.2,.7,.2,1) .15s; }
.vec.in svg .bars { transform: scaleY(1); }
.vec svg rect { transition: fill .2s; }
.vec svg rect:hover { fill: var(--ink); }
table.matrix td { transition: color .25s, background-color .25s; }
table.matrix td.same { background: var(--accent-soft); }
.pair .bar i { transition: width .5s cubic-bezier(.2,.7,.2,1); }
.pair .bar b { transition: left .25s; }
.pair .verdict { transition: color .25s, border-color .25s; }
.reg-item { transition: border-color .15s, opacity .6s, transform .6s; }
.btn { transition: background .15s, color .15s, transform .15s; }
.btn:active { transform: translateY(1px); }
.hatch { background-size: 200% 100%; }
.status.busy::before { animation: pulse 1s infinite; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-art.is-animated *, .hero-art.is-animated *::before { animation: none !important; transition: none !important; }
  .hero-art .hero-scene { transform: none; transition: none; }
  .hero-motion-toggle { display: none; }
  .rise, .reveal { animation: none; transition: none; opacity: 1; transform: none; }
  .vec svg .bars { transform: none; transition: none; }
}
