/* ddalbae.dev 신청·설치·설정 안내(.guide) — docs/SITE_SPEC.md 6절 규칙. 원래 랜딩(Tailwind)에는 닿지 않게 .guide 안에만 적용한다. */
:root {
  --ink: #111418; --sub: #4b5560; --faint: #8a939c; --line: #e3e7ea; --soft: #f4f6f7; --bg: #ffffff;
  --accent: #047857; --accent-soft: #e6f4ee; /* 랜딩 첫 장면의 초록과 같은 색 */
  --mark: #e5484d; /* 누를 곳 표시 전용: 앱 화면의 청록 버튼과 겹치지 않는 색 */
  --s1: 4px; --s2: 8px; --s3: 16px; --s4: 24px; --s5: 32px; --s6: 48px; --s7: 64px;
  --t1: 28px; --t2: 20px; --t3: 17px; --t4: 14px;
  --r: 12px; --btn: 56px; --hit: 48px;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.guide {
  background: var(--bg); color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  font-size: var(--t3); line-height: 1.6; word-break: keep-all; overflow-wrap: break-word;
  -webkit-text-size-adjust: 100%;
}
.guide .wrap { max-width: 1080px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.guide h1, .guide h2, .guide h3, .guide p, .guide ol, .guide ul, .guide dl, .guide dd { margin: 0; padding: 0; }
.guide h1 { font-size: var(--t1); line-height: 1.35; font-weight: 800; text-wrap: balance; }
.guide h2 { font-size: var(--t1); line-height: 1.35; font-weight: 800; text-wrap: balance; }
.guide h3 { font-size: var(--t2); line-height: 1.4; font-weight: 700; text-wrap: balance; }
.guide p { text-wrap: pretty; }
.guide .note { font-size: var(--t4); color: var(--sub); }
.guide ol, .guide ul { list-style: none; }
.guide img { display: block; max-width: 100%; height: auto; }
.guide a { color: var(--accent); }
.guide :focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }


/* 단계 바: 이동만 하므로 링크 */
.guide .bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.guide .bar ol { display: grid; grid-template-columns: repeat(3, 1fr); }
.guide .bar a { display: flex; align-items: center; justify-content: center; gap: var(--s2); min-height: var(--hit); font-size: var(--t3); font-weight: 700; color: var(--faint); text-decoration: none; border-bottom: 3px solid transparent; }
.guide .bar a b { font-size: var(--t4); }
.guide .bar a[aria-current="step"] { color: var(--ink); border-bottom-color: var(--accent); }


/* 섹션 */
.guide section { padding-block: var(--s6); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: var(--s4); }
.guide section:last-of-type { border-bottom: 0; }
.guide .kicker { font-size: var(--t4); font-weight: 700; color: var(--accent); }
.guide .head { display: flex; flex-direction: column; gap: var(--s2); }

/* 성격이 다른 칸(준비할 것·막혔을 때)만 테두리 */
.guide .box { border: 1px solid var(--line); border-radius: var(--r); padding: var(--s3); display: flex; flex-direction: column; gap: var(--s2); }
.guide .box ul { display: flex; flex-direction: column; gap: var(--s2); }
.guide .box li { padding-left: var(--s3); position: relative; }
.guide .box li::before { content: ""; position: absolute; left: 0; top: 11px; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.guide .box-title { font-size: var(--t4); font-weight: 700; color: var(--sub); }

/* 세로 단계 목록: 왼쪽 선 하나로 잇는다 */
.guide .flow { display: flex; flex-direction: column; }
.guide .flow > li { position: relative; display: grid; grid-template-columns: 32px 1fr; gap: var(--s3); padding-bottom: var(--s5); }
.guide .flow > li:last-child { padding-bottom: 0; }
.guide .flow > li::before { content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: var(--line); }
.guide .flow > li:last-child::before { display: none; }
.guide .dot { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--bg); font-size: var(--t4); font-weight: 700; display: flex; align-items: center; justify-content: center; }
/* 첫 줄(폰 이름 표나 제목)은 번호 원과 같은 32px 높이로 맞춘다 */
.guide .step { min-width: 0; display: flex; flex-direction: column; gap: var(--s2); }
.guide .step h3 { line-height: 32px; }
.guide .step:has(> .shot:not(.wide)) { display: grid; grid-template-columns: minmax(0, 1fr) 120px; column-gap: var(--s3); row-gap: var(--s2); align-content: start; }
.guide .step:has(> .shot:not(.wide)) > * { grid-column: 1; }
.guide .step > .who { justify-self: start; }
.guide .step:has(> .shot:not(.wide)) > .shot { grid-column: 2; grid-row: 1 / span 6; }
.guide .step p { color: var(--sub); }
.guide .nw { white-space: nowrap; }
.guide .step em { font-style: normal; font-weight: 700; color: var(--ink); }
.guide .who { align-self: flex-start; display: inline-flex; align-items: center; height: 32px; font-size: var(--t4); font-weight: 700; line-height: 1; padding-inline: var(--s2); border-radius: var(--s2); background: var(--soft); color: var(--sub); }
.guide .who + h3 { line-height: 1.4; }
.guide .who.m { background: var(--accent); color: var(--bg); }
.guide .who.g { background: var(--bg); color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.guide .who.n { background: var(--ink); color: var(--bg); }

/* 실제 폰 사진 */
/* 폰 화면 사진은 전부 같은 폭, 글과 같은 왼쪽 선 */
.guide .shot { position: relative; padding: 0; width: 120px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--soft); cursor: zoom-in; }
.guide .shot img { width: 100%; }
.guide .tap { position: absolute; width: 22%; aspect-ratio: 1; transform: translate(-50%, -50%); border: 3px solid var(--mark); border-radius: 50%; box-shadow: 0 0 0 3px rgba(255,255,255,.8); pointer-events: none; }
.guide .shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--s3); }
.guide .shots .shot { width: 100%; margin: 0; }
.guide .shots figure { margin: 0; display: flex; flex-direction: column; gap: var(--s2); }
.guide .shots figcaption { font-size: var(--t4); color: var(--sub); }
.guide .wide { width: 100%; max-width: 368px; }

/* 버튼 3종 */
.guide .btn { padding-block: 0; display: flex; align-items: center; justify-content: center; gap: var(--s2); min-height: var(--btn); padding-inline: var(--s4); border-radius: var(--r); font: inherit; font-size: var(--t3); font-weight: 700; text-decoration: none; cursor: pointer; border: 0; }
.guide .btn.primary { background: var(--ink); color: var(--bg); }
/* 설치 버튼: 눌러야 받아진다는 것을 버튼 안팎에서 알린다 */
.guide .btn.get { flex-direction: column; gap: 0; min-height: 64px; padding-block: var(--s2); }
.guide .btn.get { animation: get-pulse 1.2s ease-in-out infinite; }
.guide .btn.get:active { animation: none; }
@keyframes get-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@media (prefers-reduced-motion: reduce) { .guide .btn.get { animation: none; } }
.guide .btn.get small { font-size: var(--t4); font-weight: 400; opacity: .8; }
.guide .get-wrap { display: flex; flex-direction: column; gap: var(--s2); }
.guide .push { font-weight: 700; color: var(--ink); }
/* 형광펜: 꼭 지킬 한마디에만, 한 단계에 하나 */
.guide .hl { background: linear-gradient(transparent 55%, #fff2a8 55%); }
.guide .btn.primary:active { transform: scale(.98); }
.guide .example { border-radius: var(--r); background: var(--soft); padding: var(--s3); color: var(--ink); }
.guide .warn { border-radius: var(--r); background: #fdecec; padding: var(--s3); display: flex; flex-direction: column; gap: var(--s1); }
.guide .warn em { font-style: normal; font-weight: 700; color: var(--mark); font-size: var(--t2); }
.guide .msg { border-radius: var(--r); background: var(--soft); padding: var(--s3); display: flex; flex-direction: column; gap: var(--s3); }
.guide .msg q { quotes: none; font-weight: 700; }
.guide .status { font-size: var(--t4); color: var(--sub); min-height: 22px; }

/* 한 대 / 두 대 고르기: 눌러야 순서가 나온다 */
.guide .choose { display: flex; flex-direction: column; gap: var(--s2); }
.guide .tabs { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.guide .tabs button { position: relative; padding: var(--s3); min-height: var(--hit); border: 2px solid var(--line); border-radius: var(--r); background: var(--bg); font: inherit; color: var(--ink); cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); text-align: left; }
.guide .tabs button:active { transform: scale(.98); }
.guide .tabs .ico { display: flex; gap: var(--s1); }
.guide .tabs .ico svg { width: 32px; height: 32px; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; }
.guide .tabs .txt { display: flex; flex-direction: column; }
.guide .tabs b { font-size: var(--t2); line-height: 1.4; }
.guide .tabs small { font-size: var(--t4); color: var(--sub); }
.guide .tabs .chk { position: absolute; top: var(--s2); right: var(--s2); width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); color: transparent; font-size: var(--t4); font-weight: 700; display: flex; align-items: center; justify-content: center; }
.guide .tabs button[aria-selected="true"] { border-color: var(--accent); background: var(--accent-soft); }
.guide .tabs button[aria-selected="true"] .chk { background: var(--accent); border-color: var(--accent); color: var(--bg); }

/* 막혔을 때 */
.guide .fix { display: flex; flex-direction: column; gap: var(--s3); }
.guide .fix dt { font-weight: 700; }
.guide .fix dd { color: var(--sub); }
.guide .fix em { font-style: normal; font-weight: 700; color: var(--ink); }


/* 신청 버튼이 여는 전체 화면 창 */
#sheet { position: fixed; inset: 0; width: 100%; height: 100%; max-width: 100%; max-height: 100%; margin: 0; padding: 0; border: 0; background: var(--bg); overflow-y: auto; overscroll-behavior: contain; }
#sheet::backdrop { background: rgba(10, 10, 11, .6); }
#sheet[open] { animation: sheet-up .4s cubic-bezier(.16, 1, .3, 1); }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { #sheet[open] { animation: none; } }
.guide .bar { top: 0; display: flex; align-items: stretch; padding-top: env(safe-area-inset-top, 0px); }
.guide .bar ol { flex: 1; }
.guide .close { flex: none; width: 48px; min-height: 48px; padding: 0; border: 0; background: transparent; font: inherit; font-size: var(--t2); color: var(--ink); cursor: pointer; }

/* 사진 크게 보기 */
dialog.viewer { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; }
dialog.viewer::backdrop { background: rgba(0,0,0,.85); }
dialog.viewer img { max-height: 88vh; width: auto; border-radius: var(--r); }

/* 반응형: 600px 이상 단계 2칸, 900px 이상 3칸·첫 화면 2단 (docs/SITE_SPEC.md 6절) */
@media (min-width: 600px) {
  .guide .flow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5) var(--s4); }
  .guide .flow > li { padding-bottom: 0; }
  .guide .flow > li::before { display: none; }
  .guide .step:has(> .shot:not(.wide)) { display: flex; flex-direction: column; }
  .guide .shot { width: 100%; max-width: 220px; }
  .guide section { padding-block: var(--s7); }
  .guide .tabs { max-width: 560px; }
}
@media (min-width: 900px) {
  .guide .flow { grid-template-columns: repeat(3, minmax(0, 1fr)); }

}
