/* style.css — 카르픽토리아 · 사진첩 디자인 (모바일 1단 먼저, .pc 에서 펼친 앨범 2쪽)
   세 가지 사진첩을 섞음: ① 흑백 사진집(검은 페이지·큰 세리프·넓은 여백) ② 삼각 모자이크(사진을 삼각형으로 잘라 맞물림·가는 선)
   ③ 손글씨 일기 앨범(인화한 사진·테이프·사진 옆 손글씨). 글꼴은 Google Fonts(OFL), 종이 결은 SVG 잡음으로 직접 만듦(외부 그림 없음) */
:root {
  --paper: #f1ece2; --bg: #f1ece2; --card: #fbf8f2; --fg: #161514; --muted: #6f685c; --line: #d8d0c0;
  --ink: #161514; --black: #121212; --accent: #161514; --accent-fg: #fbf8f2; --accent-soft: #e4ddcf; --lav: #8d72c8;
  --radius: 2px; --shadow: 0 10px 30px rgba(40, 30, 10, .10);
  --serif: "Gowun Batang", "Noto Serif KR", "AppleMyungjo", "Batang", serif;
  --latin: "Cormorant Garamond", "Gowun Batang", Georgia, serif;
  --hand: "Nanum Pen Script", "Gaegu", cursive;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .32 0 0 0 0 .27 0 0 0 0 .18 0 0 0 .1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body { background: var(--paper) var(--grain); }
.hand { font-family: var(--hand); font-weight: 400; letter-spacing: 0; }

/* 머리글: 사진집 표지처럼 자간 넓은 영문 + 작은 한글 */
.top { background: color-mix(in srgb, var(--paper) 90%, transparent); border-bottom: 1px solid var(--ink); }
.top .logo { display: inline-flex; align-items: baseline; gap: 8px; font-weight: 600; }
.top .logo .en { font-family: var(--latin); font-size: 17px; letter-spacing: .3em; }
.top .logo .ko { font-family: var(--serif); font-size: 11px; color: var(--muted); letter-spacing: 0; font-weight: 400; }
.viewtoggle { border-color: var(--ink); border-radius: 2px; background: transparent; }

/* 공용: 각진 잉크 단추, 납작한 칩 */
.btn { border-radius: 2px; border-color: var(--ink); background: transparent; letter-spacing: .02em; }
.btn.big { border-radius: 2px; font-size: 17px; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--accent-fg); }
.btn.ghost { border-color: transparent; text-decoration: underline; text-underline-offset: 4px; font-weight: 600; }
:focus-visible { outline-color: var(--lav); }
.btn:focus-visible, .chip:focus-visible { box-shadow: 0 0 0 4px color-mix(in srgb, var(--lav) 35%, transparent); }
.card { border-radius: 2px; }
h1 { font-family: var(--serif); font-weight: 700; letter-spacing: -.02em; }

/* ---------- 첫 화면: 앨범 표지 ---------- */
.cover .kicker { margin: 0; font-family: var(--latin); font-size: 12px; letter-spacing: .32em; display: flex; justify-content: space-between; border-bottom: 1px solid var(--ink); padding-bottom: 8px; }
.cover .kicker span { letter-spacing: .1em; font-style: italic; }
.cover .tagline { margin: 14px 0 0; font-family: var(--serif); font-size: 14px; color: var(--muted); }
.cover .tagline em { display: block; font-family: var(--latin); font-size: 22px; color: var(--ink); font-style: italic; line-height: 1.2; }
.home h1 { font-size: 34px; line-height: 1.22; margin: 10px 0 0; }
.home .lead { font-size: 15px; }
.pick { position: relative; overflow: hidden; }
.pick input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.pick:focus-within { box-shadow: 0 0 0 4px color-mix(in srgb, var(--lav) 35%, transparent); }
.mobile .dropnote { display: none; }
.home.over .pick { outline: 3px dashed var(--lav); outline-offset: 4px; }
.msg:empty { display: none; }
.msg { color: var(--danger); font-weight: 600; }

/* 예시 사진: 삼각형 5개를 ▲▼▲▼▲ 로 맞물린 사다리꼴 액자(위 2칸 · 아래 3칸 폭) + 가는 테두리 선 + 세로 글씨 */
.album { position: relative; padding: 6px 20px 4px 28px; }   /* 사다리꼴 테두리가 좌우로 20px 나가므로 그만큼 비움 */
.album .hand { font-size: 22px; margin: 0 0 8px; color: var(--muted); }
.album::before { content: "Photo Album"; position: absolute; left: 0; top: 46px; writing-mode: vertical-rl; font-family: var(--latin); font-style: italic; font-size: 12px; letter-spacing: .18em; color: var(--muted); }
.samples { position: relative; z-index: 1; display: flex; margin-top: 10px; }
/* 사다리꼴 테두리: 삼각형 줄(폭 W, 높이 W/4) 둘레를 조금 띄워 감쌈. 폭 W+40px 에 4:1 이면 높이 W/4+10px */
.samples::before { content: ""; position: absolute; left: -20px; right: -20px; top: -6px; aspect-ratio: 4 / 1; pointer-events: none; z-index: -1;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 100' preserveAspectRatio='none'%3E%3Cpath d='M56 1 L244 1 L299 99 L1 99 Z' fill='none' stroke='%23161514' stroke-opacity='.35' stroke-width='1' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.sample { flex: 0 0 33.333%; margin-left: -16.667%; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: none; min-height: 44px; }
.sample:first-child { margin-left: 0; }
.sample .thumb, .sample b { pointer-events: auto; }
.sample .thumb { display: block; width: 100%; line-height: 0; clip-path: polygon(50% 3%, 97% 100%, 3% 100%); transition: transform .15s ease, filter .15s ease; filter: saturate(.92); }
.sample:nth-child(even) .thumb { clip-path: polygon(3% 0, 97% 0, 50% 97%); }
.sample canvas { width: 100%; height: auto; display: block; }
.sample b { font-family: var(--hand); font-weight: 400; font-size: 21px; line-height: 1.1; margin-top: 6px; }
.sample:hover .thumb, .sample:focus-visible .thumb { filter: saturate(1.1); transform: scale(1.03); }
.sample:active .thumb { transform: scale(.97); }
.sample:focus-visible { outline: none; box-shadow: none; }
.sample:focus-visible b { text-decoration: underline; text-decoration-color: var(--lav); }

/* 이렇게 노래가 돼요: 줄 공책 일기장 + 테이프 */
.how, .why { position: relative; background: var(--card) var(--grain); border-color: var(--line); }
.how { transform: rotate(.8deg); margin-top: 26px; }
.how::before, .print::before, .print::after { content: ""; position: absolute; width: 86px; height: 24px; background: rgba(223, 212, 186, .78); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.how::before { top: -12px; left: 50%; transform: translateX(-50%) rotate(-3deg); }
.how h3.hand, .why h3.hand { font-size: 30px; line-height: 1; margin: 0 0 8px; }
.home .how { text-align: left; }
.how ol, .steps { list-style: none; margin: 8px 0 0; padding: 0; counter-reset: n; background: linear-gradient(color-mix(in srgb, var(--lav) 35%, transparent), color-mix(in srgb, var(--lav) 35%, transparent)) 31px 0 / 1px 100% no-repeat; }   /* 공책 여백 선 */
.how li, .steps > li { counter-increment: n; position: relative; padding-left: 40px; line-height: 1.75; }
.how li + li { margin-top: 6px; }
.how li::before, .steps > li::before { content: counter(n, decimal-leading-zero); position: absolute; left: 0; top: -2px; font-family: var(--latin); font-style: italic; font-size: 22px; color: var(--lav); }
.how b, .steps b { font-family: var(--serif); }

/* 앱으로 설치 */
.install .btn { font-weight: 700; }
.install p { margin: 8px 2px 0; line-height: 1.5; }
.pc .home .stack { text-align: left; }

/* ---------- 결과 화면: 검은 페이지에 붙인 인화 사진 + 손글씨 + 필름 띠 ---------- */
.song > .stack:first-child { background: var(--black); color: #eee; margin: -20px -16px 0; padding: 26px 16px 20px; }
.song .notice { background: transparent; color: #cfc8bb; border-color: #555; }
.stagewrap { display: flex; justify-content: center; padding: 14px 6px 4px; }
.print { position: relative; margin: 0; background: #fbf8f2; padding: 10px 10px 6px; box-shadow: 0 14px 30px rgba(0,0,0,.45); transform: rotate(-1.4deg); max-width: 100%; }
.print::before { top: -11px; left: -18px; transform: rotate(-32deg); }
.print::after { top: -11px; right: -18px; transform: rotate(30deg); }
.print figcaption { color: #2b2620; font-size: 26px; line-height: 1.2; text-align: center; padding: 6px 4px 2px; }
.stage { position: relative; line-height: 0; overflow: hidden; }
.stage canvas { display: block; width: auto; height: auto; max-width: 100%; max-height: 42vh; }
/* 세로로 긴 사진: 곡 제목·요약이 아래 고정된 재생 단추에 가리지 않게 남은 화면 높이로 제한(사진 위 머리글·여백 + 제목·요약 + 재생 단추 ≈ 485px, 390×700 휴대폰에서 측정) */
.mobile .stage canvas { max-height: min(42vh, calc(100vh - 485px)); max-height: min(42svh, calc(100svh - 485px)); }
.scanbar { position: absolute; top: 0; bottom: 0; left: 0; width: 6.25%; background: rgba(255,255,255,.28); border-left: 2px solid #fff; border-right: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.35); pointer-events: none; }
.scanbar[hidden] { display: none; }
/* 16칸 띠 = 필름 한 줄(위아래 구멍) */
.strip { display: grid; grid-template-columns: repeat(16, 1fr); gap: 3px; padding: 15px 4px; position: relative; margin-top: 18px;
  background-image: radial-gradient(circle, #3a3a3a 2.2px, transparent 2.6px), radial-gradient(circle, #3a3a3a 2.2px, transparent 2.6px);
  background-size: 14px 8px, 14px 8px; background-repeat: repeat-x; background-position: 0 3px, 0 calc(100% - 3px); }
.strip div { height: 46px; border-radius: 1px; position: relative; transition: transform .12s ease; }
.strip i { position: absolute; left: 18%; right: 18%; height: 4px; border-radius: 2px; }
.strip .on { transform: translateY(-5px) scale(1.12); box-shadow: 0 0 0 2px #fbf8f2; z-index: 1; }
.reduce-motion .strip div { transition: none; }
.song .note { font-size: 24px; color: var(--muted); margin: 0; line-height: 1.1; }
.songtitle { font-family: var(--serif); font-size: 32px; margin: 2px 0; }
.playbar { background: var(--paper) var(--grain); padding: 8px 0; }
.mobile .playbar { position: sticky; bottom: 0; z-index: 5; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
.now { min-height: 1.6em; margin: 6px 0 0; font-weight: 700; text-align: center; }
.why { padding-top: 20px; }
.steps > li + li { margin-top: 14px; }
.steps p { margin: 4px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; font-size: 13px; padding: 2px 9px; border-radius: 1px; background: #fff; border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.chip.tag { background: transparent; border: 0; box-shadow: none; padding: 0 4px; color: var(--lav); font-family: var(--hand); font-size: 21px; font-weight: 400; }
.prompt { margin: 6px 0 0; padding: 4px 0 4px 14px; border-left: 2px solid var(--ink); font-family: var(--serif); font-size: 14.5px; line-height: 1.75; }
.rules { margin: 6px 0 0; padding-left: 18px; }
.why details { margin-top: 12px; }
.why summary { cursor: pointer; color: var(--muted); min-height: 32px; }
.sw { display: inline-block; width: .9em; height: .9em; border-radius: 1px; vertical-align: -1px; margin-right: 5px; border: 1px solid rgba(0,0,0,.2); }
.ended .share .btn.primary { box-shadow: 0 0 0 4px color-mix(in srgb, var(--lav) 40%, transparent); }

/* ---------- PC: 펼친 앨범(왼쪽 검은 페이지 · 오른쪽 종이 페이지 · 가운데 접힌 그림자) ---------- */
.pc .home h1 { font-size: 48px; }
.pc .cover .tagline em { font-size: 28px; }
.pc .home .how { padding: 26px 26px 22px; }
.pc .song.split { gap: 0; align-items: stretch; background: var(--card); box-shadow: 0 24px 60px rgba(30, 20, 0, .18); }
.pc .song > .stack:first-child { margin: 0; padding: 40px 36px 32px; display: flex; flex-direction: column; justify-content: center; }
.pc .song > .stack + .stack { position: relative; padding: 36px 40px 32px; background: var(--card) var(--grain); }
.pc .song > .stack + .stack::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 34px; background: linear-gradient(90deg, rgba(0,0,0,.16), transparent); pointer-events: none; }
.pc .song .why { border: 0; box-shadow: none; padding: 16px 0 0; background-color: transparent; }
.pc .song .playbar { background: transparent; }
.pc .stage canvas { max-height: 56vh; }
.pc .songtitle { font-size: 40px; }
.pc .strip div { height: 56px; }
.force-mobile main { background: var(--paper) var(--grain); }
