:root {
  --paper: #f3f5f8;
  --paper-2: #e8ecf2;
  --ink: #0f1a2b;
  --ink-2: #44506a;
  --line: #d3dae5;
  --blue: #3b7cf4;
  --blue-ink: #1f5fd6;
  --said: #ffe27a;
  --ok: #1f8a5b;
  --night: #0f1a2b;
  --night-2: #18253b;
  --night-line: #2a3a55;
  --night-text: #c9d3e3;

  --sans: "Pretendard Variable", Pretendard, -apple-system, "Segoe UI", "Malgun Gothic", sans-serif;
  --voice: "Gowun Dodum", "Pretendard Variable", sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.625rem;
  --step-3: clamp(1.9rem, 1.4rem + 1.8vw, 2.6rem);
  --step-4: clamp(2.4rem, 1.5rem + 3.6vw, 4.1rem);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.7;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue-ink); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
code { font-family: var(--mono); font-size: 0.9em; }

.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 32px); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip { position: absolute; left: 16px; top: -48px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 6px; z-index: 10; }
.skip:focus { top: 12px; }

/* 버튼 */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px;
  background: var(--ink); color: #fff;
  border-radius: 999px; font-weight: 650; text-decoration: none;
  transition: background-color 0.15s;
}
.btn:hover { background: var(--blue-ink); }
.btn-large { min-height: 56px; padding: 0 28px; font-size: var(--step-1); }

/* 상단 */
.top {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-row { display: flex; align-items: center; gap: 28px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 750; letter-spacing: -0.01em; }
.brand img { border-radius: 8px; }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { color: var(--ink-2); text-decoration: none; font-weight: 550; font-size: 0.97rem; }
.nav a:hover { color: var(--ink); }

/* 첫 화면 */
.hero { padding: 96px 0 112px; }
.hero-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 72px; align-items: center; }
h1 {
  font-size: var(--step-4);
  line-height: 1.12;
  letter-spacing: -0.035em;
  font-weight: 820;
  margin: 0 0 24px;
  max-width: 11em;
  text-wrap: balance;
}
.lede { font-size: var(--step-1); color: var(--ink-2); max-width: 30em; margin: 0 0 36px; line-height: 1.6; }
.note { color: var(--ink-2); font-size: var(--step--1); margin: 16px 0 0; }

/* 시연 화면: 작업 항목 하나. 자리는 처음부터 다 있고, 같은 자리의 글자가 바뀐다(.swap 안의 변형을 겹쳐 두고 하나만 보인다).
   그래서 높이가 흔들리지 않고, 화면 전체가 갈아끼워지는 대신 «이 줄이 이렇게 바뀌었다»가 보인다 */
.demo {
  margin: 0;
  background: var(--night);
  color: var(--night-text);
  border-radius: 20px;
  overflow: hidden;
  font-size: 0.92rem;
  line-height: 1.55;
}
.demo-head {
  position: relative;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--night-line);
}
.demo-where { color: #8ea3c4; white-space: nowrap; }
.demo-where b { color: #fff; font-weight: 650; margin-left: 4px; }
.demo-status { justify-items: end; font-size: 0.82rem; font-weight: 600; white-space: nowrap; color: var(--night-text); }
.demo-status .ready { color: #8fdcb4; }
.demo-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; overflow: hidden; }
.demo-progress::after { content: ""; position: absolute; top: 0; bottom: 0; width: 30%; background: var(--blue); }
.demo-progress.on::after { animation: demo-progress 1.1s ease-in-out infinite; }
@keyframes demo-progress { from { left: -30%; } to { left: 100%; } }

.demo-body { padding: 24px; }

/* 같은 자리에 겹친 변형 */
.swap { display: inline-grid; }
.swap > * { grid-area: 1 / 1; }

.demo-meta { margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.8rem; color: #8ea3c4; }
.kind { font-weight: 650; color: var(--night-text); margin-right: 10px; }
.kind.bug { color: #ff9d9d; }

.demo-title { display: grid; margin: 0; font-size: 1.3rem; line-height: 1.4; font-weight: 750; color: #fff; letter-spacing: -0.01em; }
/* 사람이 한 말만 손글씨에 가까운 글꼴과 형광펜 */
.demo-title .raw { font-family: var(--voice); font-weight: 400; font-size: 1.15rem; }
.demo-title mark { background: var(--said); color: var(--ink); padding: 2px 6px; border-radius: 4px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.demo-origin { margin: 8px 0 0; font-size: 0.8rem; color: #8ea3c4; }

.demo-rows { margin: 22px 0 0; padding-top: 6px; border-top: 1px solid var(--night-line); display: grid; }
.demo-rows > div { display: grid; grid-template-columns: 4em 1fr; gap: 12px; padding: 10px 0; }
.demo-rows dt { color: #8ea3c4; transition: opacity 0.5s ease; }
.demo-rows dd { margin: 0; color: #e7edf7; }
.demo-rows .empty { color: #5b6d8c; }
.demo-rows .bad { color: #ff9d9d; font-weight: 650; }

/* 자바스크립트가 없거나 움직임 줄이기면 마지막 상태만 보인다: 나중에 사라지는 변형(data-to)은 숨긴다 */
.demo [data-to] { visibility: hidden; }
.demo-progress { visibility: hidden; }

/* 재생: main.js가 .js를 붙이고 시간에 맞춰 .on을 붙였다 뗀다. 바뀌는 글자는 제자리에서 겹쳐 바뀐다 */
.js .demo [data-to], .js .demo-progress { visibility: visible; }
.js .demo [data-from], .js .demo [data-to] {
  opacity: 0;
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.45s ease;
}
.js .demo .swap > [data-from] { transform: translateY(4px); filter: blur(2px); }
.js .demo .on, .js .demo .swap > .on { opacity: 1; transform: none; filter: none; }
/* 자리 바꾸기: 옛 글자가 먼저 빠지고 새 글자가 조금 늦게 들어와 두 글자가 겹쳐 보이지 않게 */
.js .demo .swap > .on { transition-delay: 0.18s; }
.js .demo-rows > div:has(.empty.on) dt { opacity: 0.5; }
.js .demo-body, .js .demo-status { transition: opacity 0.5s ease; }
.js .demo.out .demo-body, .js .demo.out .demo-status { opacity: 0; }
.js .demo.reset, .js .demo.reset * { transition: none !important; }

/* 공통 구획 */
.band { padding: 104px 0; border-top: 1px solid var(--line); }
h2 { font-size: var(--step-3); line-height: 1.25; letter-spacing: -0.025em; font-weight: 780; margin: 0 0 14px; max-width: 22em; }
h3 { font-size: var(--step-1); letter-spacing: -0.01em; margin: 0 0 10px; }
.sub { color: var(--ink-2); max-width: 40em; margin: 0 0 48px; font-size: var(--step-1); line-height: 1.6; }

/* 직원 표 */
.staff { width: 100%; border-collapse: collapse; margin-bottom: 88px; }
.staff th, .staff td { text-align: left; padding: 18px 16px 18px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.staff thead th { font-size: var(--step--1); color: var(--ink-2); font-weight: 600; padding-top: 0; }
.staff tbody th { width: 11em; font-weight: 700; }
.staff td:last-child { width: 8em; text-align: right; padding-right: 0; }
.tag { display: inline-block; font-size: 0.82rem; font-weight: 650; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.tag.live { background: #dff3e8; color: #13623f; }
.tag.soon { background: var(--paper-2); color: var(--ink-2); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; margin-bottom: 72px; }
.split p { color: var(--ink-2); margin: 0 0 16px; max-width: 34em; }

.voices { display: grid; gap: 12px; margin-top: 22px; }
.voices p { margin: 0; display: grid; gap: 4px; padding: 14px 18px; background: #fff; border-left: 4px solid var(--blue); border-radius: 0 10px 10px 0; color: var(--ink); }
.voices p:first-child { border-left-color: var(--said); }
.voices b { font-size: var(--step--1); color: var(--ink-2); font-weight: 650; }

.tools { list-style: none; padding: 0; margin: 22px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid var(--line); }
.tools li { padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.tools b { display: block; color: var(--ink); font-size: var(--step-1); }

.screen { margin: 0; }
.screen img { border-radius: 16px; border: 1px solid var(--line); box-shadow: 0 24px 48px -32px rgba(15, 26, 43, 0.5); }
.screen figcaption { color: var(--ink-2); font-size: var(--step--1); margin-top: 14px; }

/* 개발자: 앱과 같은 밤색 */
.dark { background: var(--night); color: #fff; border-top: 0; }
.dark .sub, .dark .split p { color: var(--night-text); }
.dark code { color: #ffd76a; }

.arch {
  display: grid; grid-template-columns: 1fr 48px 1.3fr 48px 1fr; grid-template-rows: auto auto;
  align-items: center; margin-bottom: 72px;
}
.node { border: 1px solid var(--night-line); border-radius: 14px; padding: 18px 20px; display: grid; gap: 4px; }
.node span { color: var(--night-text); font-size: var(--step--1); }
.node.strong { border-color: var(--blue); background: var(--night-2); }
.node.side { grid-column: 3; margin-top: 28px; position: relative; }
.node.side::before { content: ""; position: absolute; left: 50%; top: -29px; height: 28px; border-left: 2px dashed #5b77a8; }
.wire { height: 2px; background: #5b77a8; }

.code {
  margin: 0; background: #0a1220; border: 1px solid var(--night-line); border-radius: 14px;
  padding: 22px 24px; overflow-x: auto; font-size: 0.86rem; line-height: 1.65; color: #dbe4f3;
}
.code code { color: inherit; font-size: inherit; }
.code .c { color: #6f82a3; }
.code .k { color: #8fb4ff; }
.code .f { color: #ffd76a; }
.code .s { color: #9ed9b5; }

/* 약속 */
.promises { margin: 0 0 40px; display: grid; grid-template-columns: 1fr 1fr; gap: 0 56px; }
.promises div { padding: 22px 0; border-top: 2px solid var(--ink); }
.promises dt { font-weight: 750; font-size: var(--step-1); margin-bottom: 6px; }
.promises dd { margin: 0; color: var(--ink-2); max-width: 30em; }
.contact { color: var(--ink-2); }

/* 다운로드 */
.download { background: var(--paper-2); }
.dl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.steps { margin: 8px 0 0; padding: 0; counter-reset: s; list-style: none; display: grid; gap: 18px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 36px 1fr; gap: 12px; color: var(--ink-2); }
.steps li::before {
  content: counter(s); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--ink); color: #fff; font-weight: 700; font-size: 0.9rem;
}

/* 질문 */
details { border-bottom: 1px solid var(--line); }
details:first-of-type { border-top: 1px solid var(--line); }
summary { cursor: pointer; padding: 20px 0; font-weight: 650; font-size: var(--step-1); list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--ink-2); font-weight: 400; font-size: 1.4rem; line-height: 1; }
details[open] summary::after { content: "−"; }
details p { margin: 0 0 22px; color: var(--ink-2); max-width: 38em; }

/* 푸터 */
.foot { background: var(--night); color: var(--night-text); padding: 48px 0 28px; }
.foot .brand { color: #fff; }
.foot-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: var(--step--1); }
.foot nav a { color: var(--night-text); text-decoration: none; }
.foot nav a:hover { color: #fff; text-decoration: underline; }
.legal { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--night-line); font-size: 0.8rem; color: #8ea3c4; }

/* 좁은 화면 */
@media (max-width: 900px) {
  .hero { padding: 48px 0 64px; }
  .hero-grid, .split, .dl-grid, .promises { grid-template-columns: 1fr; gap: 40px; }
  .nav a:not([href="#download"]) { display: none; }
  .band { padding: 72px 0; }
  .arch { grid-template-columns: 1fr; grid-template-rows: none; gap: 0; }
  .wire { width: 2px; height: 22px; margin-left: 24px; }
  .node.side { grid-column: auto; margin-top: 22px; }
  .node.side::before { left: 24px; top: -23px; height: 22px; }
}
@media (max-width: 560px) {
  .staff thead { display: none; }
  .staff tr { display: grid; grid-template-columns: 1fr auto; padding: 16px 0; border-bottom: 1px solid var(--line); }
  .staff th, .staff td { border: 0; padding: 0; }
  .staff tbody th { width: auto; }
  .staff td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; margin-top: 6px; color: var(--ink-2); }
  .staff td:last-child { width: auto; grid-row: 1; grid-column: 2; }
  .tools { grid-template-columns: 1fr; }
  .demo-head, .demo-body { padding-left: 18px; padding-right: 18px; }
  .demo-rows > div { grid-template-columns: 3.4em 1fr; }
}
