/* boheApps — dark, Pretendard only, type scale = golden ratio (1.618) */
:root {
  --bg: #0a0a0b;
  --surface: #141417;
  --surface-2: #1c1c21;
  --line: #27272c;
  --line-strong: #3a3a41;
  --text: #f3f2ef;
  --muted: #a3a19b;
  --dim: #8a8883;
  --accent: #f3f2ef;

  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* 모듈러 스케일: 비율 하나만 바꾸면 전체 위계가 따라간다 */
  --r: 1.618;
  --s0: clamp(1rem, 0.94rem + 0.25vw, 1.1875rem);
  --s1: calc(var(--s0) * var(--r));
  --s2: calc(var(--s1) * var(--r));
  --s3: calc(var(--s2) * var(--r));
  --s4: calc(var(--s3) * var(--r));
  --s5: calc(var(--s4) * var(--r));
  --s6: calc(var(--s5) * var(--r));

  --pad: clamp(20px, 5vw, 96px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--s0);
  line-height: 1.6;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.skip { position: absolute; left: -9999px; top: 12px; z-index: 100; padding: 12px 16px; background: #fff; color: #000; }
.skip:focus { left: 12px; }

/* header */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: clamp(14px, 2.2vw, 30px) var(--pad);
  color: #fff; mix-blend-mode: difference;
}
.wordmark { font-size: var(--s1); font-weight: 800; letter-spacing: -0.045em; text-decoration: none; line-height: 1; }
.site-nav { display: flex; gap: clamp(16px, 2.6vw, 40px); font-weight: 600; }
.site-nav a { text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.site-nav a:hover { text-decoration: underline; text-underline-offset: 6px; }

/* hero */
.hero { position: relative; height: 100svh; min-height: 520px; overflow: hidden; background: #000; }
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(10, 10, 11, 0.92) 0%, rgba(10, 10, 11, 0.4) 22%, rgba(10, 10, 11, 0) 38%); }
/* 히어로는 쇼릴이 주인공이라 문구는 아래 띠에만 둔다 */
.hero-bar {
  position: absolute; left: var(--pad); right: var(--pad); bottom: clamp(24px, 4svh, 44px);
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: end; gap: 20px clamp(24px, 3vw, 48px);
}
.hero-title { margin: 0; font-size: var(--s2); font-weight: 800; line-height: 1; letter-spacing: -0.045em; }
.hero-sub { margin: 10px 0 0; font-weight: 500; color: #dcdad5; }
.hero-chapters { list-style: none; margin: 0; padding: 0; display: flex; gap: clamp(16px, 2.4vw, 40px); font-weight: 600; color: #dcdad5; }
.hero-chapters span { margin-right: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
/* 목차: 지금 나오는 앱을 밝히고, 누르면 그 앱의 쇼릴로 건너뛴다 */
.chapter { display: inline-flex; align-items: baseline; min-height: 44px; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; transition: opacity 0.5s; }
.js .chapter:not(.is-current) { opacity: 0.5; }
.chapter:hover { opacity: 1; }
.chapter.is-current span { color: #fff; }
.hero-pause { min-height: 44px; padding: 0 20px; border: 1px solid rgba(255, 255, 255, 0.45); border-radius: 999px; background: rgba(10, 10, 11, 0.35); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.hero-pause:hover { background: #fff; color: #000; }
/* 세로 화면: 16:9 쇼릴을 꽉 채우면 가운데만 남아 자막이 잘린다. 영상 비율 그대로 보여 주고 문구 띠는 그 아래에 둔다 */
@media (orientation: portrait) {
  .hero { height: auto; min-height: 0; padding-top: clamp(64px, 16vw, 96px); }
  .hero-video { position: relative; inset: auto; height: auto; aspect-ratio: 16 / 9; }
  .hero-shade { display: none; }
  .hero-bar { position: relative; left: auto; right: auto; bottom: auto; padding: 24px var(--pad) 40px; }
}

/* stages — shared */
.stage { position: relative; background: var(--bg); border-top: 1px solid var(--line); }
.label { margin: 0; font-weight: 600; letter-spacing: 0.06em; color: var(--muted); font-variant-numeric: tabular-nums; }
.label span { color: var(--accent); }
.app-name { margin: 0; font-size: min(var(--s6), 22vw); font-weight: 800; line-height: 0.8; letter-spacing: -0.06em; white-space: nowrap; }
.kicker { margin: 0; max-width: 18em; font-size: var(--s2); font-weight: 700; line-height: 1.05; letter-spacing: -0.035em; color: var(--accent); }
.lead { margin: 0; max-width: 19em; font-size: var(--s1); font-weight: 500; line-height: 1.3; letter-spacing: -0.02em; }
.q { margin: 0; max-width: 11em; font-size: var(--s3); font-weight: 800; line-height: 0.98; letter-spacing: -0.05em; }
.points { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 3svh, 32px) clamp(24px, 3.5vw, 56px); max-width: 68rem; }
.points li { position: relative; padding-top: 16px; font-size: var(--s1); font-weight: 500; line-height: 1.28; letter-spacing: -0.02em; }
/* 구분선은 등장할 때 왼쪽부터 그어진다(--ls: 0 → 1) */
.points li::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--line-strong); transform: scaleX(var(--ls, 1)); transform-origin: left center; }
.points--single { grid-template-columns: minmax(0, 1fr); }
.facts { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px clamp(20px, 2.4vw, 40px); }
.facts dt { color: var(--muted); font-weight: 600; }
.facts dd { margin: 0; }
.shot { margin: 0; }
.shot img { width: 100%; height: auto; border-radius: 6px; }
/* 이미지 틀(.shot-media) > 등장 확대(.shot-zoom) > img. JS가 감싸 만든다 */
.shot-media { position: relative; display: block; overflow: hidden; border-radius: 6px; }
.shot-zoom { display: block; }
.shot-zoom, .shot-media img { will-change: transform; }

.cta {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 14px;
  min-height: 60px; padding: 0 30px; border: 2px solid var(--accent); border-radius: 999px;
  font-size: var(--s1); font-weight: 700; letter-spacing: -0.03em; text-decoration: none;
}
.cta:hover { background: var(--accent); color: var(--bg); }

/* 가로 무대 — 기본은 세로로 쌓는다(JS 없음·터치·움직임 줄이기). html.motion 일 때만 가로로 편다 */
.track { display: flex; flex-direction: column; }
.panel {
  position: relative; flex: 0 0 auto;
  display: flex; flex-direction: column; justify-content: center; gap: clamp(20px, 3.4svh, 44px);
  padding: clamp(64px, 10svh, 120px) var(--pad);
}
.panel--title { min-height: 72svh; justify-content: flex-end; }
.panel--title .label { position: absolute; top: clamp(84px, 13svh, 150px); left: var(--pad); }
.panel--title .app-name { white-space: normal; font-size: min(var(--s6), 19vw); }
/* 배경 외곽선 글자. 가변 글꼴은 획 조각이 겹쳐 있어 글자에 윤곽선을 주면 안쪽 이음선까지 보인다.
   tools/ghost_outline 이 조각을 합친 바깥 윤곽만 SVG 로 만든다. 높이는 글자 크기(줄 상자 1em)와 같다.
   획 굵기는 viewBox 단위라 JS 가 화면 1px 로 맞춘다(10 은 JS 전 기본값) */
.ghost {
  position: absolute; top: 16%; right: 6vw; height: min(var(--s5), 15vw); width: auto; overflow: visible;
  fill: none; stroke: var(--line-strong); stroke-width: 10; stroke-linecap: round;
  pointer-events: none;
}

.motion .stage--h { height: 100svh; overflow: hidden; }
.motion .track { flex-direction: row; width: max-content; height: 100%; }
.motion .panel { height: 100%; padding: clamp(84px, 13svh, 150px) var(--pad) clamp(32px, 7svh, 80px); }
.motion .panel--title { min-width: 100vw; min-height: 0; }
.motion .panel--title .app-name { white-space: nowrap; font-size: min(var(--s6), 22vw); }
.motion .ghost { height: min(var(--s5), 17vw); }
.motion .panel--media { width: 90vw; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: center; gap: clamp(24px, 4vw, 72px); }
.motion .panel--media .shot img { height: 64svh; object-fit: cover; }
.motion .panel--facts { width: 76vw; }
/* 데모 칸은 데모와 버튼을 나란히 둬서 100svh 안에 들어가게 한다 */
.motion .panel--demo { flex-direction: row; align-items: center; gap: clamp(32px, 4vw, 72px); padding-right: calc(var(--pad) * 1.5); }
.motion .panel--demo .demo { width: min(56rem, 58vw); }
.motion .panel--demo .cta { align-self: center; }

/* vertical stage */
.v-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: clamp(24px, 5vw, 96px); padding: 0 var(--pad); }
.v-sticky {
  position: sticky; top: 0; height: 100svh;
  display: flex; flex-direction: column; justify-content: center; gap: clamp(18px, 3svh, 34px);
  padding: clamp(84px, 13svh, 150px) 0 clamp(32px, 7svh, 80px);
}
.app-name--v { font-size: min(var(--s5), 8.6vw); line-height: 0.84; white-space: normal; }
.v-sticky .kicker { font-size: var(--s1); }
.v-flow { display: flex; flex-direction: column; gap: clamp(72px, 16svh, 180px); padding: 22svh 0 26svh; }
.v-flow .shot img { border: 1px solid var(--line); }
/* 틀 안에서 이미지가 커지고 흐르므로 테두리는 틀에 그린다 */
.v-flow .shot-media img { border: 0; }
.v-flow .shot-media::after { content: ""; position: absolute; inset: 0; border: 1px solid var(--line); border-radius: inherit; pointer-events: none; }
.v-flow figcaption { margin-top: 18px; font-size: var(--s1); font-weight: 600; line-height: 1.25; letter-spacing: -0.02em; }
.v-block { display: flex; flex-direction: column; gap: clamp(24px, 4svh, 40px); }

/* demos */
.demo { width: 100%; max-width: 56rem; display: flex; flex-direction: column; gap: 20px; padding: clamp(20px, 2.8vw, 40px); border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.demo-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.demo-title { margin: 0; font-size: var(--s2); font-weight: 800; line-height: 1; letter-spacing: -0.04em; }
.demo-note { color: var(--muted); font-weight: 600; }

.chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.group-label { min-width: 6.5em; color: var(--muted); font-weight: 600; }
.chip { min-height: 44px; padding: 0 18px; border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--bg); }
.bubble { align-self: flex-start; width: min(100%, 36rem); padding: 20px 24px; border-radius: 20px 20px 20px 6px; background: var(--surface-2); }
.bubble-title { margin: 0; font-size: var(--s1); font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
.moa-item { margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--line-strong); color: #d6d4cf; line-height: 1.55; }
.moa-item strong { display: block; color: var(--text); }

.md-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.md-rendered { display: flex; flex-direction: column; gap: 4px; padding: 24px; border-radius: 12px; background: #f5f4f0; color: #1b1b1f; }
.md-h { margin: 0 0 8px; font-size: var(--s1); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.md-check { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
.md-check input { width: 22px; height: 22px; margin: 0; accent-color: #0088ff; }
.md-source { padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: #0b0b0d; font-family: var(--mono); font-size: 0.9em; line-height: 1.9; white-space: pre; overflow-x: auto; }
.md-file { color: var(--muted); }
.md-source .flash { animation: flash 1.4s ease-out; }
@keyframes flash { from { background: rgba(61, 155, 255, 0.45); } to { background: transparent; } }

.boss-input { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { color: var(--muted); font-weight: 600; }
.field input { width: 6.2em; min-height: 60px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 12px; background: #0b0b0d; color: var(--text); font: inherit; font-size: var(--s1); font-weight: 700; font-variant-numeric: tabular-nums; }
.field input:focus { border-color: var(--accent); outline: none; }
.boss-at { margin: 0 0 10px; font-size: var(--s1); font-weight: 700; letter-spacing: -0.02em; }
.boss-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.boss-rows li { display: flex; justify-content: space-between; gap: 16px; padding: 14px 20px; border-radius: 12px; background: var(--surface-2); font-size: var(--s1); font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.boss-rows .is-grey { color: var(--dim); }
.boss-rows .is-default { color: var(--text); }
.boss-rows .is-orange { color: #ffa53d; }
.boss-rows .is-red { color: #ff6b63; background: #2b1515; }
.boss-rows .is-red .bell { animation: blink 1s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }
.boss-say { align-self: flex-start; min-height: 48px; padding: 0 20px; border: 1px solid var(--line-strong); border-radius: 12px; background: transparent; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.boss-say:hover { border-color: var(--accent); }
.boss-say:disabled { opacity: 0.6; cursor: not-allowed; }

/* faq + footer */
.faq { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); gap: clamp(32px, 5vw, 96px); padding: clamp(110px, 18svh, 220px) var(--pad); border-top: 1px solid var(--line); }
.faq h2 { margin: 0; font-size: min(var(--s4), 15vw); font-weight: 800; line-height: 0.9; letter-spacing: -0.055em; }
.faq details { border-top: 1px solid var(--line-strong); }
.faq details:last-child { border-bottom: 1px solid var(--line-strong); }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 28px 0; list-style: none; cursor: pointer; font-size: var(--s2); font-weight: 700; line-height: 1.08; letter-spacing: -0.04em; }
.faq summary::-webkit-details-marker { display: none; }
.faq-a { overflow: hidden; }
.faq details p { margin: 0 0 32px; max-width: 30em; font-size: var(--s1); line-height: 1.32; letter-spacing: -0.02em; color: #d6d4cf; }
/* + 아이콘: 열리면 한 바퀴 돌면서 세로 막대가 가로로 누워 하나로 합쳐진다 */
/* easeOutQuint: 처음에 빠르게 돌고 끝에서 부드럽게 멈춘다 */
.faq-icon { position: relative; flex: 0 0 auto; width: 0.72em; height: 0.72em; transition: transform 0.75s cubic-bezier(0.22, 1, 0.36, 1); }
.faq-icon::before, .faq-icon::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 2px; background: currentColor; transition: transform 0.75s cubic-bezier(0.22, 1, 0.36, 1); }
.faq-icon::after { transform: rotate(90deg); }
.faq details.is-open .faq-icon,
html:not(.js) .faq details[open] .faq-icon { transform: rotate(360deg); }
.faq details.is-open .faq-icon::after,
html:not(.js) .faq details[open] .faq-icon::after { transform: rotate(0deg); }
.faq summary:hover .faq-icon { color: var(--accent); }

/* boheApps 글자 폭은 약 4.42em. 화면 폭(vw)이 아니라 바닥 안쪽 폭(cqi)에 맞춰 양 끝이 여백선에 닿고 잘리지 않게 한다 */
.site-footer { padding: 0 var(--pad) 32px; border-top: 1px solid var(--line); overflow: hidden; container-type: inline-size; }
.footer-mark { margin: 0; padding-top: 24px; font-size: min(var(--s6), 22.5cqi); font-weight: 800; line-height: 0.8; letter-spacing: -0.065em; white-space: nowrap; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; margin-top: calc(min(var(--s6), 22.5cqi) * 0.24); color: var(--muted); }
.footer-nav { display: flex; gap: 28px; }

/* 좁은 화면: 세로 무대와 FAQ를 한 줄로 */
@media (max-width: 900px) {
  .v-grid { grid-template-columns: minmax(0, 1fr); }
  .v-sticky { position: static; height: auto; }
  .v-flow { padding: 0 0 120px; }
  .points { grid-template-columns: minmax(0, 1fr); }
  .faq { grid-template-columns: minmax(0, 1fr); }
  .md-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-bar { grid-template-columns: minmax(0, 1fr) auto; }
  .hero-chapters { display: none; }
}

/* SplitText 마스크: 글자가 아래에서 올라올 때 꼬리(g, p)와 좁은 자간의 끝이 잘리지 않게 여유를 준다 */
.w-mask, .c-mask { padding: 0.08em 0.06em 0.18em; margin: -0.08em -0.06em -0.18em; }
.footer-mark .c { display: inline-block; will-change: transform; }
/* 앱 제목 타이포: JS 가 글자 칸 폭을 고정하므로 굵기가 바뀐 글리프를 칸 가운데에 둔다(옆 글자가 밀리지 않게).
   글자마다 레이어를 따로 둬서 올라오는 움직임은 합성만 하고, 굵기가 바뀌면 그 글자만 다시 칠한다 */
.app-name .c { text-align: center; will-change: transform; }

/* 등장 전 옆으로 비껴 있는 줄(목록·정보표)이 화면 밖으로 나가 모바일에서 가로로 넘치지 않게 자른다.
   clip 은 스크롤 영역을 만들지 않아 sticky·고정(pin)에 영향이 없다 */
main { overflow-x: clip; }

/* 한국어는 어절 단위로 줄을 바꾼다 */
:lang(ko) { word-break: keep-all; }

/* 404 페이지 */
.not-found { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: clamp(16px, 3svh, 28px); padding: 120px var(--pad) 80px; }
.not-found h1 { margin: 0; font-size: min(var(--s4), 12vw); font-weight: 800; line-height: 0.95; letter-spacing: -0.045em; }
.not-found p { margin: 0; color: var(--muted); font-size: var(--s1); }
.not-found .cta { color: var(--text); }
