/* 자경단 웹사이트. 어두운 무대(앱 화면) 위에 3집 Ballad of You 커버의 붉은 테이프. */
@font-face {
  font-family: Ballad;  /* 앱의 DejaVu Sans Mono Bold, 뽑기 표 글자만 (build_assets.sh) */
  src: url(/assets/fonts/ballad.woff) format('woff');
  font-display: block;
}
@font-face {
  font-family: SUIT;  /* SUIT 가변 글꼴 (sun-typeface/SUIT, OFL) */
  src: url(https://cdn.jsdelivr.net/gh/sun-typeface/SUIT@v2.0.5/fonts/variable/woff2/SUIT-Variable.woff2) format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --stage: #09090a;
  --line: #2a2a2e;
  --text: #f3f1ea;
  --muted: #a7a49c;
  --ink: #c50000;      /* Ballad of You 글자색 (AsciiFilter.ink) */
  --red: #ff4a3d;      /* 어두운 바탕 위 강조 (대비 4.5:1 이상) */
  --violet: #6a14f0;
  --sans: SUIT, -apple-system, BlinkMacSystemFont, system-ui, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  --wrap: min(1120px, 100% - 32px);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: hidden; }
main { overflow-x: clip; }  /* 기울인 테이프 띠·종이 카드가 가로 스크롤을 만들지 않게 (html 은 clip 을 모르는 브라우저용) */
body {
  margin: 0;
  background: var(--stage);
  color: var(--text);
  font: 400 17px/1.7 var(--sans);
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
img, canvas, svg { display: block; max-width: 100%; }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.02em; font-weight: 800; }
p { margin: 0; }
em { font-style: normal; font-weight: 700; }
.wrap { width: var(--wrap); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 30; padding: 10px 16px; background: var(--text); color: var(--stage); border-radius: 8px; }
.skip:focus { top: 12px; }

/* ── 언어 권하기 ── */
.lang-hint {
  display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap;
  padding: 8px 16px; background: var(--ink); color: #fff; font-size: 14px;
}
.lang-hint[hidden] { display: none; }
.lang-hint a { font-weight: 700; }
.lang-hint :focus-visible { outline-color: #fff; }
.lang-hint button { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; min-width: 32px; min-height: 32px; }

/* ── 머리 ── */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: var(--stage);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: -0.01em; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.brand small { color: var(--muted); font-weight: 500; font-size: 13px; }
.nav nav { display: none; }
.nav ul { display: flex; gap: 22px; margin: 0; padding: 0; list-style: none; font-size: 15px; }
.nav ul a { text-decoration: none; color: var(--muted); transition: color .2s; }
.nav ul a:hover { color: var(--text); }
.nav-end { display: flex; gap: 10px; align-items: center; margin-left: auto; }
.motion {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: none; color: var(--muted); cursor: pointer;
}
.motion:hover { color: var(--text); }
.motion svg { width: 16px; height: 16px; }
.motion .play, .motion[aria-pressed='true'] .pause { display: none; }
.motion[aria-pressed='true'] .play { display: block; }
.paused .tape-run div { animation-play-state: paused; }
.lang { font-size: 14px; text-decoration: none; color: var(--muted); padding: 6px 4px; }
.lang:hover { color: var(--text); }
.pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 16px;
  border-radius: 999px; background: var(--text); color: var(--stage); text-decoration: none; font-weight: 700; font-size: 15px; white-space: nowrap;
  transition: background .2s;
}
.pill:hover { background: #fff; }
@media (min-width: 860px) { .nav nav { display: block; } }
@media (max-width: 419px) { .nav .pill { display: none; } }  /* 좁은 화면: 바로 아래 첫 화면에 App Store 배지가 있다 */
@media (max-width: 374px) { .brand small { display: none; } }

/* ── 첫 화면 ── */
.hero { padding: 56px 0 72px; }
.hero .wrap { display: grid; gap: 48px; align-items: center; }
.hero h1 { margin: 0 0 20px; font-size: clamp(3.2rem, 12vw, 6rem); line-height: 1; }
.hero .lede { color: #d6d3cb; font-size: clamp(1.02rem, 2.2vw, 1.18rem); max-width: 34em; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 30px; }
.badge img { height: 52px; width: auto; }
.badge { border-radius: 10px; }
.soon { color: var(--muted); font-size: 14px; }
.hero-phone { display: grid; justify-items: center; gap: 14px; }
.hero-phone > p { color: var(--muted); font-size: 13px; }
@media (min-width: 960px) {
  .hero { padding: 72px 0 96px; }
  .hero .wrap { grid-template-columns: 1.15fr .85fr; }
}
/* ── 휴대폰 미리보기 (앱 화면을 HTML 로) ── */
.phone {
  --w: min(300px, 76vw);
  width: var(--w); padding: calc(var(--w) * .035); border-radius: calc(var(--w) * .15);
  background: #000; box-shadow: inset 0 0 0 1.5px #3b3b40, 0 0 0 1px #000;
}
.phone-ui { position: relative; border-radius: calc(var(--w) * .118); overflow: hidden; background: #000; }
.phone-top { height: calc(var(--w) * .1); }
.cam { position: relative; aspect-ratio: 9 / 16; }
.phone-bottom { height: calc(var(--w) * .26); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 10%; }
.seg {
  position: absolute; z-index: 2; top: 10px; left: 5%; right: 5%;
  display: grid; grid-template-columns: repeat(3, 1fr); padding: 2px; border-radius: 9px;
  background: rgba(0, 0, 0, .45); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.seg button {
  min-height: 26px; border: 0; border-radius: 7px; background: none; color: #fff; cursor: pointer;
  font: 500 clamp(9px, calc(var(--w) * .034), 11px)/1 var(--sans); letter-spacing: -0.01em; white-space: nowrap;
  transition: background .25s;
}
.seg button[aria-selected='true'] { background: rgba(255, 255, 255, .28); font-weight: 700; }
.mode {
  position: absolute; z-index: 2; bottom: 10px; left: 50%; translate: -50% 0;
  display: flex; padding: 2px; border-radius: 99px; background: rgba(0, 0, 0, .4); font-size: 10px;
}
.mode span { padding: 4px 12px; border-radius: 99px; color: #ddd; }
.mode span:first-child { background: rgba(255, 255, 255, .28); color: #fff; font-weight: 700; }
.shutter { width: calc(var(--w) * .2); aspect-ratio: 1; border-radius: 50%; border: 3px solid #fff; padding: 3px; background-clip: content-box; background-color: #fff; }
.round { width: calc(var(--w) * .11); aspect-ratio: 1; border-radius: 50%; background: rgba(255, 255, 255, .15); justify-self: center; display: grid; place-items: center; }
.round svg { width: 50%; height: 50%; }

/* 필터 그림: 정지 이미지 위에 같은 크기의 캔버스. 캔버스가 그리기 시작하면(.on) 위로 */
.shot { position: absolute; inset: 0; }
.shot img, .shot canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shot canvas { opacity: 0; transition: opacity .6s; }
canvas[data-live=kaleidoscope] { touch-action: pan-y pinch-zoom; }  /* 가로로 끌면 크리스털이 따라오고, 확대는 그대로 */
.shot canvas.on { opacity: 1; }
.shot[hidden] { display: none; }
.cam .shot:not([hidden]) { animation: wipe .55s var(--ease); }
@keyframes wipe { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }

/* ── 붉은 테이프 띠 ── */
.tape-run { overflow: hidden; background: var(--ink); color: #fff; transform: rotate(-1.6deg); margin: 0 -2%; padding: 10px 0; }
.tape-run div { display: flex; width: max-content; animation: run 38s linear infinite; }
.tape-run span { padding-right: 2.2em; font: 700 15px/1 var(--mono); letter-spacing: .14em; white-space: nowrap; }
@keyframes run { to { transform: translateX(-50%); } }

/* ── 섹션 공통 ── */
section { scroll-margin-top: 64px; }
.block { padding: 104px 0; }
.head { max-width: 40em; margin-bottom: 56px; }
.head h2 { font-size: clamp(2rem, 5vw, 3.2rem); }

/* ── 세 필터 ── */
.filters { display: grid; gap: 120px; }
.filter { display: grid; gap: 36px; align-items: center; }
.frame {
  position: relative; justify-self: center; width: min(360px, 82vw); aspect-ratio: 9 / 16;
  border-radius: 24px; overflow: hidden; background: #000;
}
.label {  /* 사진 귀퉁이에 붙인 빨간 테이프 */
  position: absolute; z-index: 3; top: 18px; left: -10px; padding: 6px 16px 6px 22px;
  background: var(--ink); color: #fff; font: 700 12px/1 var(--mono); letter-spacing: .14em;
  transform: rotate(-4deg); transform-origin: left; box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.filter h3 { font-size: clamp(1.9rem, 4.2vw, 2.7rem); margin: 8px 0 14px; }
.filter .lede { font-size: 1.2rem; font-weight: 600; margin-bottom: 14px; }
.filter p + p { margin-top: 12px; }
.filter .body { color: #cfccc4; }
.verse { margin-top: 26px !important; padding-left: 16px; border-left: 2px solid var(--ink); color: var(--muted); font-size: 15px; }
.verse span { display: block; color: var(--text); font-weight: 600; white-space: pre-line; }
.try { display: none; margin-top: 12px; color: var(--muted); font-size: 14px; }
#kaleidoscope:has(canvas.on) .try { display: block; }  /* 크리스털이 실제로 움직일 때만 */
#kaleidoscope canvas { cursor: crosshair; }
@media (min-width: 900px) {
  .filter { grid-template-columns: 1fr 1fr; gap: 72px; }
  .filter:nth-child(even) .frame { order: 2; }
}

/* ── 줄로 나눈 목록: 기능·자주 묻는 질문·문제 해결 ── */
.rows { max-width: 820px; margin: 0; border-bottom: 1px solid var(--line); }
.rows > div { padding: 18px 0 20px; border-top: 1px solid var(--line); }
.rows dt { font-weight: 700; }
.rows dd { margin: 6px 0 0; color: #cfccc4; }
@media (min-width: 760px) {  /* 기능은 사양표처럼 이름 | 설명 */
  .specs > div { display: grid; grid-template-columns: 13em 1fr; gap: 24px; }
  .specs dd { margin: 0; }
}

/* ── 도움말·개인정보처리방침 (긴 글) ── */
.doc { padding: 64px 0 104px; }
.doc .wrap { max-width: 760px; }
.doc h1 { font-size: clamp(2.2rem, 6vw, 3.2rem); margin: 10px 0 14px; }
.doc h2 { font-size: 1.6rem; margin: 64px 0 16px; padding-top: 28px; border-top: 1px solid var(--line); }
.doc h3 { font-size: 1.15rem; margin: 36px 0 12px; }
.doc :is(p, ul, ol) { color: #cfccc4; }
.doc :is(p, ul, ol, .rows) + :is(p, ul, ol, .rows) { margin-top: 14px; }
.doc :is(ul, ol) { margin: 0; padding-left: 1.4em; }
.doc li + li { margin-top: 6px; }
.doc strong { color: var(--text); }
.doc .updated { color: var(--muted); font-size: 15px; }
.toc { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 28px; }
.toc a { text-underline-offset: 3px; }
.toc a:hover { color: var(--red); }

/* ── 바닥 ── */
footer { border-top: 1px solid var(--line); padding: 40px 0 56px; color: var(--muted); font-size: 14px; }
footer .wrap { display: grid; gap: 18px; }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
footer a { color: var(--text); text-decoration: none; display: inline-block; padding: 6px 0; }
footer a:hover { text-decoration: underline; }
footer .note { max-width: 52em; }

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