/* 종이 위의 설명서처럼: 글은 조용히, 눈에 띄는 건 앱 화면 하나뿐. */
:root {
  --paper: #f6f5f1;
  --ink: #1b1b1a;
  --ink-2: #55534e;
  --ink-3: #8c8a84;
  --rule: #dddbd4;
  --key: #ffffff;
  --key-edge: #cfccc3;
  --link: #1b1b1a;

  /* 데모 화면: macOS 라이트 모드 */
  --wall: linear-gradient(170deg, #b9c3cf 0%, #9aa8b8 55%, #7d8a9b 100%);
  --menubar: rgba(246, 246, 248, .72);
  --panel: rgba(246, 246, 248, .86);
  --panel-edge: rgba(0, 0, 0, .12);
  --p-ink: #1d1d1f;
  --p-2: #6e6e73;
  --p-3: #9a9aa0;
  --p-rule: rgba(0, 0, 0, .08);
  --accent: #0a84ff;
  --mark: rgba(255, 196, 0, .38);

  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --measure: 46rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141413;
    --ink: #ecebe7;
    --ink-2: #a8a6a0;
    --ink-3: #74726c;
    --rule: #2c2b29;
    --key: #262624;
    --key-edge: #3d3c39;
    --link: #ecebe7;

    --wall: linear-gradient(170deg, #2d3440 0%, #222831 55%, #191d24 100%);
    --menubar: rgba(30, 30, 32, .7);
    --panel: rgba(36, 36, 40, .86);
    --panel-edge: rgba(255, 255, 255, .12);
    --p-ink: #f5f5f7;
    --p-2: #a1a1a6;
    --p-3: #6e6e73;
    --p-rule: rgba(255, 255, 255, .08);
    --mark: rgba(255, 196, 0, .3);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.7 var(--sans);
  letter-spacing: -0.008em;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--ink-3); }
a:hover { text-decoration-color: currentColor; }
code { font: .86em var(--mono); }
b { font-weight: 600; }
kbd {
  display: inline-block; min-width: 1.55em; padding: 0 .38em;
  font: 500 .8em/1.55 var(--sans); text-align: center; color: var(--ink);
  background: var(--key); border: 1px solid var(--key-edge); border-radius: 5px;
  box-shadow: 0 1px 0 var(--key-edge);
  transition: transform .06s, box-shadow .06s, background-color .06s;
}
kbd.down {
  transform: translateY(1px); box-shadow: none;
  background-color: color-mix(in srgb, var(--accent) 16%, var(--key));
  border-color: color-mix(in srgb, var(--accent) 50%, var(--key-edge));
}

.wrap { width: min(100% - 32px, 64rem); margin-inline: auto; }

/* 머리 */
.top { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; }
.mark { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; text-decoration: none; }
.top nav { display: flex; gap: 22px; font-size: 15px; }
.top nav a { text-decoration: none; color: var(--ink-2); }
.top nav a:hover { color: var(--ink); }

/* 소개 */
.intro { padding: 88px 0 56px; }
.icon { margin-left: -6px; }
h1 { margin: 18px 0 0; font-size: clamp(44px, 7vw, 64px); font-weight: 700; letter-spacing: -0.04em; line-height: 1.05; }
.lead { max-width: var(--measure); margin: 18px 0 0; font-size: clamp(19px, 2.3vw, 22px); line-height: 1.6; color: var(--ink-2); }
.lead kbd { font-size: .72em; vertical-align: .12em; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 34px 0 0; }
.download {
  display: inline-block; padding: 11px 18px; border-radius: 10px;
  background: var(--ink); color: var(--paper); font-weight: 600; font-size: 16px; text-decoration: none;
}
.download:hover { opacity: .88; }
.meta { font-size: 14px; color: var(--ink-3); }
.elsewhere { margin: 12px 0 0; font-size: 14px; color: var(--ink-2); }

/* 데모 화면 */
.desk { padding-bottom: 24px; }
.screen {
  position: relative;
  min-height: 560px;
  padding: 0 0 72px;
  border-radius: 14px;
  background: var(--wall);
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .06), 0 30px 60px -30px rgba(0, 0, 0, .35);
}
.menubar {
  display: flex; justify-content: space-between; align-items: center;
  height: 26px; padding: 0 14px;
  background: var(--menubar);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  font-size: 13px; color: var(--p-ink);
}
.menus { display: flex; gap: 18px; }
.menus b { font-weight: 700; }
.extras { display: flex; align-items: center; gap: 14px; }
.tray { all: unset; display: flex; padding: 2px 5px; border-radius: 4px; }
.tray img { display: block; border-radius: 4px; }
.tray[aria-pressed="true"] { background: rgba(127, 127, 127, .3); }
.tray:focus-visible { outline: 2px solid var(--accent); }

.panel {
  width: min(100% - 32px, 720px);
  margin: 64px auto 0;
  border-radius: 18px;
  background: var(--panel);
  -webkit-backdrop-filter: blur(40px) saturate(180%); backdrop-filter: blur(40px) saturate(180%);
  box-shadow: 0 0 0 1px var(--panel-edge), 0 24px 70px -12px rgba(0, 0, 0, .45);
  color: var(--p-ink);
  font-size: 13px; line-height: 1.35; letter-spacing: 0;
  overflow: hidden;
  transform-origin: 50% 0;
  transition: opacity .16s ease, transform .16s ease;
}
.panel.closed { opacity: 0; transform: translateY(-6px) scale(.98); visibility: hidden; transition: opacity .12s, transform .12s, visibility 0s .12s; }
.reopen {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: max-content; max-width: calc(100% - 32px); margin: 0; padding: 8px 14px; border-radius: 10px;
  background: rgba(0, 0, 0, .3); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  color: #fff; font-size: 13px; text-align: center;
}
.reopen kbd { font-size: 11px; color: #fff; background: rgba(255, 255, 255, .15); border-color: rgba(255, 255, 255, .3); box-shadow: none; }
.field { display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 16px; color: var(--p-2); }
.field input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: none;
  font: 400 22px var(--sans); color: var(--p-ink); letter-spacing: -0.01em;
}
.field input::placeholder { color: var(--p-3); }
.mode {
  flex: none; min-width: 42px; text-align: center; border: 0; cursor: pointer;
  padding: 3px 9px; border-radius: 6px;
  font: 600 11px var(--sans); color: var(--p-2); background: var(--p-rule);
}
.mode[data-mode="content"], .mode[data-mode="semantic"] { color: #fff; background: var(--accent); }
.chips { display: flex; gap: 6px; height: 30px; padding: 0 16px 10px; }
.chips[hidden] { display: none; }
.chips:not([hidden]) + .list { height: 314px; }
.chips span { padding: 2px 8px; border-radius: 6px; font: 12px var(--mono); color: var(--accent); background: color-mix(in srgb, var(--accent) 13%, transparent); }
/* 결과 수와 상관없이 패널 크기는 그대로다. 칠 때마다 패널이 출렁이면 싸 보인다. */
.list { height: 344px; border-top: 1px solid var(--p-rule); padding: 0 8px 6px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.head { display: flex; gap: 5px; align-items: flex-end; height: 28px; padding: 0 8px 4px; font-size: 11px; font-weight: 600; color: var(--p-2); }
.head span { color: var(--p-3); font-weight: 400; }
.row { display: grid; grid-template-columns: 20px auto 1fr auto; align-items: center; column-gap: 10px; min-height: 36px; padding: 0 8px; border-radius: 8px; cursor: default; }
.row .n { font-weight: 500; white-space: nowrap; }
/* 굵기를 바꾸면 글자 폭이 달라져 줄이 밀린다. 획만 덧칠한다. */
.row .n strong { font-weight: inherit; -webkit-text-stroke: .45px currentColor; color: var(--p-ink); }
.row.on .n strong { color: #fff; }
.row .p { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--p-2); }
.row .a { font-size: 11px; color: var(--p-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.row .l { grid-column: 2 / -1; padding: 0 0 7px; font: 12px/1.4 var(--mono); color: var(--p-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .l i { font-style: normal; color: var(--p-3); margin-right: 10px; }
.row mark { background: var(--mark); color: inherit; border-radius: 2px; }
.row.on { background: var(--accent); color: #fff; }
.row.on .p, .row.on .a, .row.on .l, .row.on .l i { color: rgba(255, 255, 255, .8); }
.row.on mark { background: rgba(255, 255, 255, .3); }
.row.gone { opacity: 0; transform: translateX(28px); transition: opacity .17s, transform .17s; }
.empty { display: grid; place-items: center; height: 100%; padding: 0 40px; font-size: 13px; line-height: 1.6; color: var(--p-2); text-align: center; }
.bar {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  height: 36px; padding: 0 16px; border-top: 1px solid var(--p-rule);
  font-size: 11px; color: var(--p-2); white-space: nowrap;
}
#status { overflow: hidden; text-overflow: ellipsis; }
.bar .keys { display: flex; gap: 12px; }
.bar kbd { font-size: 10px; color: var(--p-2); background: transparent; border-color: var(--p-rule); }

/* 파일 아이콘: Finder 아이콘을 단순화한 모양 */
.ic { width: 18px; height: 20px; border-radius: 3px; position: relative; background: #fff; box-shadow: 0 0 0 .5px rgba(0, 0, 0, .25); }
.ic::after { position: absolute; inset: auto 0 3px; text-align: center; font: 700 5px var(--sans); color: #555; content: attr(data-x); }
.ic.dir { width: 20px; height: 15px; border-radius: 2px 3px 3px 3px; background: #5aacf5; box-shadow: none; }
.ic.dir::before { content: ""; position: absolute; top: -2px; left: 0; width: 8px; height: 3px; border-radius: 2px 2px 0 0; background: #5aacf5; }
.ic.app { width: 20px; height: 20px; background: url("/assets/icon.png") center / cover; box-shadow: none; border-radius: 5px; }
.ic.pic { width: 20px; height: 16px; border-radius: 2px; box-shadow: 0 0 0 1.5px #fff, 0 0 0 2px rgba(0, 0, 0, .2); }
.ic.pic::after { content: none; }
.ic.swift { color: #f05138; }
.ic.swift::after, .ic.pdf::after, .ic.mov::after, .ic.m4a::after { color: inherit; }
.ic.pdf { color: #d93a32; }
.ic.mov { color: #6a46c9; }
.ic.m4a { color: #e0326e; }

.try { margin: 20px 0 0; font-size: 14px; color: var(--ink-3); line-height: 2.1; }
.try button {
  margin: 0 2px; padding: 2px 8px; border: 1px solid var(--rule); border-radius: 6px;
  background: transparent; color: var(--ink-2); font: 13px var(--mono); cursor: pointer;
}
.try button:hover { color: var(--ink); border-color: var(--ink-3); }
.note { margin: 4px 0 0; font-size: 13px; line-height: 1.9; color: var(--ink-3); }
.note kbd { font-size: 11px; }

/* 본문 섹션 */
h2 { margin: 0 0 20px; font-size: 15px; font-weight: 600; color: var(--ink-3); letter-spacing: 0; }
.spec, .keymap, .install { padding: 88px 0 0; }
dl { margin: 0; border-top: 1px solid var(--rule); }
dl div { display: grid; grid-template-columns: 9rem 1fr; gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--rule); }
dt { font-weight: 600; }
dd { margin: 0; max-width: var(--measure); color: var(--ink-2); }
dd kbd { font-size: .72em; }

table { width: 100%; border-collapse: collapse; border-top: 1px solid var(--rule); }
td { padding: 13px 0; border-bottom: 1px solid var(--rule); vertical-align: middle; color: var(--ink-2); }
td:first-child { width: 13rem; white-space: nowrap; color: var(--ink-3); }

.install ol { margin: 0; padding: 0; list-style: none; counter-reset: step; border-top: 1px solid var(--rule); }
.install ol li { counter-increment: step; display: grid; grid-template-columns: 9rem 1fr; gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--rule); color: var(--ink-2); }
.install ol li::before { content: counter(step) "."; font-weight: 600; color: var(--ink); }
.install ol li > * { grid-column: 2; }
.install ol li pre { margin: 12px 0 0; }
pre {
  display: flex; align-items: center; gap: 12px; margin: 14px 0 0; padding: 12px 14px;
  border: 1px solid var(--rule); border-radius: 8px; background: var(--key); overflow-x: auto;
}
pre code { flex: 1; color: var(--ink); }
pre button { flex: none; border: 0; background: none; color: var(--ink-3); font: 600 13px var(--sans); cursor: pointer; }
pre button:hover { color: var(--ink); }
.aside { margin: 22px 0 0; font-size: 15px; color: var(--ink-3); }

footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 120px; padding: 24px 0 48px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--ink-3); }
footer a { color: var(--ink-3); }

@media (max-width: 720px) {
  .intro { padding-top: 48px; }
  dl div, .install ol li { grid-template-columns: 1fr; gap: 6px; }
  .install ol li { display: block; }
  .install ol li::before { display: block; margin-bottom: 4px; }
  td:first-child { width: auto; padding-right: 16px; }
  .menus span { display: none; }
  .panel { margin-top: 28px; }
  .screen { min-height: 480px; }
  .ql { right: 50%; translate: 50% 0; }
  .field input { font-size: 18px; }
  .bar .keys span:not(:first-child) { display: none; }
  .row { grid-template-columns: 20px 1fr auto; }
  .row .p { display: none; }
}
.row:has(.l) { padding-top: 7px; }

/* 바탕화면은 보는 사람의 시각을 따른다(page.js가 data-phase를 단다). */
.screen[data-phase="dawn"] { --wall: linear-gradient(170deg, #c7c4d8 0%, #e4c3b2 58%, #b9a4a8 100%); }
.screen[data-phase="dusk"] { --wall: linear-gradient(170deg, #59668a 0%, #a97888 55%, #dd9f83 100%); }
.screen[data-phase="night"] { --wall: linear-gradient(170deg, #2b3242 0%, #1f2530 55%, #161a21 100%); }
@media (prefers-color-scheme: dark) {
  .screen[data-phase="dawn"] { --wall: linear-gradient(170deg, #3a3a4c 0%, #4a3c3f 60%, #2a2730 100%); }
  .screen[data-phase="dusk"] { --wall: linear-gradient(170deg, #2a3048 0%, #4b3444 55%, #5a3e3a 100%); }
  .screen[data-phase="day"] { --wall: linear-gradient(170deg, #2d3440 0%, #222831 55%, #191d24 100%); }
}

/* 밤의 스라소니. 어두운 데서도 잘 본다. */
.eyes {
  position: absolute; right: 9%; bottom: 24px; display: flex; gap: 9px;
  opacity: 0; pointer-events: none;
  transform: translate(var(--x, 0), var(--y, 0)); transition: transform .25s ease-out;
}
.screen[data-phase="night"] .eyes { opacity: 1; animation: eyes-in 2.5s 4s both; }
@media (prefers-color-scheme: dark) { .screen .eyes { opacity: 1; animation: eyes-in 2.5s 4s both; } }
.eyes i {
  width: 6px; height: 3.5px; border-radius: 50%;
  background: #ffd45e; box-shadow: 0 0 6px 1px rgba(255, 190, 60, .55);
  animation: blink 7s 7s infinite;
}
.eyes i:first-child { border-radius: 60% 40% 50% 50%; }
.eyes i:last-child { border-radius: 40% 60% 50% 50%; }
@keyframes eyes-in { from { opacity: 0; } }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }

/* ⌘Y 미리보기 */
.ql {
  --ql-bg: #fff; --ql-bar: #ececee; --ql-well: #e6e6e9;
  position: absolute; z-index: 2; right: 28px; top: 78px;
  width: min(100% - 48px, 450px); border-radius: 12px; overflow: hidden;
  background: var(--ql-bg); color: var(--p-ink);
  box-shadow: 0 0 0 1px var(--panel-edge), 0 30px 80px -10px rgba(0, 0, 0, .55);
  font-size: 13px; line-height: 1.4; letter-spacing: 0;
  animation: ql-in .18s ease-out;
}
@media (prefers-color-scheme: dark) { .ql { --ql-bg: #1e1e20; --ql-bar: #2b2b2e; --ql-well: #161618; } }
@keyframes ql-in { from { opacity: 0; scale: .94; } }
.ql-bar {
  position: relative; display: flex; align-items: center; justify-content: center;
  height: 30px; padding: 0 70px; background: var(--ql-bar); border-bottom: 1px solid var(--p-rule);
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
#ql-title { overflow: hidden; text-overflow: ellipsis; }
.lights { position: absolute; left: 11px; display: flex; gap: 7px; }
.lights > * { width: 11px; height: 11px; border-radius: 50%; background: #febc2e; }
.lights button { all: unset; width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; cursor: default; }
.lights button:focus-visible { outline: 2px solid var(--accent); }
.lights i:last-child { background: #28c840; }
.ql-body { height: 300px; overflow: auto; }

.q-text { padding: 14px 0; font: 12px/1.75 var(--mono); }
.q-text div { display: flex; padding: 0 18px; white-space: pre; }
.q-text i { flex: none; width: 2.6em; margin-right: 16px; text-align: right; font-style: normal; color: var(--p-3); }
.q-text .hit { background: var(--mark); }
.q-pic { height: 100%; }
.q-page { display: grid; place-items: center; height: 100%; background: var(--ql-well); }
.q-page > div { width: 190px; height: 250px; padding: 22px 20px; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }
.q-page.key > div { width: 330px; height: 186px; }
.q-page b { display: block; margin-bottom: 12px; font-size: 11px; color: #1d1d1f; }
.q-page i { display: block; height: 4px; margin-top: 7px; border-radius: 2px; background: #dcdce1; }
.q-movie { position: relative; display: grid; place-items: center; height: 100%; }
.q-movie .play { width: 56px; height: 56px; border-radius: 50%; background: rgba(255, 255, 255, .85) no-repeat 56% 50% / 20px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 12'%3E%3Cpath d='M0 0l10 6-10 6z' fill='%23111'/%3E%3C/svg%3E"); }
.q-movie .time { position: absolute; right: 12px; bottom: 10px; padding: 1px 6px; border-radius: 4px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 11px; font-variant-numeric: tabular-nums; }
.q-sound { display: flex; flex-direction: column; justify-content: center; gap: 14px; height: 100%; padding: 0 28px; color: var(--p-2); font-size: 12px; }
.q-sound .wave { display: flex; align-items: center; gap: 2px; height: 96px; }
.q-sound .wave i { flex: 1; border-radius: 2px; background: #e0326e; }
.q-sound .wave i:nth-child(n + 31) { opacity: .35; }
.q-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 18px 8px; padding: 22px 16px; }
.q-grid span { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.q-grid .ic { scale: 2; margin-top: 12px; }
.q-grid b { font-size: 11px; font-weight: 400; overflow-wrap: anywhere; }
.q-app, .q-icon { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 100%; }
.q-app img { border-radius: 24px; margin-bottom: 8px; }
.q-app b { font-size: 16px; }
.q-app span, .q-empty { color: var(--p-2); font-size: 12px; }
.q-empty { padding: 24px; }
.q-icon .ic { scale: 4; }

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