/* 대문과 소개 계열 화면(요금·결제·탈퇴·약관): 색·간격·글꼴은 tokens.css + brand.css 를 씀.
   InCarve 브랜드(밝게 Daylight Paper·어둡게 Moonlit Desk): 제목은 세리프, 본문은 산세리프, 강조는 골드 한두 곳. 휴대폰 화면을 먼저 생각해서 씀.
   설명은 docs/DESIGN.md 19절 */
* { box-sizing: border-box; }
/* 스크롤바 자리를 늘 비워 둠: 내용이 짧은 화면(탈퇴 등)과 긴 화면(대문)에서 머리 메뉴 위치가 달라지지 않게 */
html { scrollbar-gutter: stable; }
body { margin: 0; background: var(--paper); color: var(--ink); font: var(--fs-base)/1.7 var(--font); -webkit-font-smoothing: antialiased; }
:lang(en) body { line-height: 1.6; }
/* 한국어는 낱말 중간에서 줄을 바꾸지 않음 */
:lang(ko) body { word-break: keep-all; overflow-wrap: anywhere; }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 var(--s-4); }
a { color: var(--gold-ink, var(--accent)); }
a:hover { color: var(--ink); }
code { font-size: 0.9em; }
kbd { font: inherit; font-size: 0.85em; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--card); }
h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.02em; overflow-wrap: anywhere; word-break: keep-all; }
h3 { font-weight: 600; }

/* 머리: 얇은 줄, 뒤가 흐리게 비치는 종이색 */
.top { border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; background: var(--paper); background: color-mix(in srgb, var(--paper) 82%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2); }
.nav { display: flex; align-items: center; gap: var(--s-4); height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-family: var(--serif-en, var(--serif)); font-weight: 600; font-size: 1.2rem; letter-spacing: -0.02em; text-decoration: none; color: var(--ink); margin-right: auto; flex: none; white-space: nowrap; } /* 좁아져도 로고 글자가 줄어 꺾이지 않게 */
.brand:hover { color: var(--ink); }
/* 로고: 내 메모 보기(/read)와 같은 파일(icons/logo.svg·logo-dark.svg), 밝기에 따라 하나만 보임 */
.brand-logo { display: block; flex: none; width: 24px; height: 24px; border-radius: 6px; }
.brand-logo-dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand-logo-light { display: none; } :root:not([data-theme="light"]) .brand-logo-dark { display: block; } }
:root[data-theme="dark"] .brand-logo-light { display: none; }
:root[data-theme="dark"] .brand-logo-dark { display: block; }
.menu { display: flex; gap: 18px; font-size: var(--t-body); }
.menu a { text-decoration: none; color: var(--sub); }
.menu a:hover { color: var(--ink); }

/* 단추: 부드러운 사각형. 주요 단추는 채움(밝게 네이비·어둡게 골드), 한 화면에 하나. 보조 단추는 테두리 */
.btn { display: inline-block; padding: 12px 22px; border: 1px solid var(--accent); border-radius: var(--r-btn, var(--r-pill)); background: var(--accent); color: var(--accent-ink); text-decoration: none; font: inherit; font-weight: 600; cursor: pointer; line-height: 1.3; }
.btn:hover { filter: brightness(1.08); color: var(--accent-ink); }
.btn:focus-visible, .menu a:focus-visible, .text-link:focus-visible { outline: 2px solid var(--gold-ink, var(--accent)); outline-offset: 2px; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--field-line, var(--accent)); }
.btn.ghost:hover { color: var(--ink); background: var(--soft); filter: none; }
.btn.small { padding: 7px 14px; font-size: var(--t-label); }
/* 머리의 작은 단추는 폭을 맞춤: 대문("시작하기")과 탈퇴 화면("처음으로")의 글자 수가 달라도 메뉴 위치가 움직이지 않게 */
.nav .btn.small { min-width: 7.5em; text-align: center; flex: none; white-space: nowrap; } /* 글자를 키워도 단추 글이 두 줄로 꺾이지 않게 */
/* 대문: 글자를 키워 머리에 다 들어가지 않으면 머리의 '시작하기'를 숨김 (서랍에 같은 단추가 있음, home.js 가 .tight 를 붙임) */
.top.tight .nav-start { display: none; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.text-link { font-weight: 600; text-decoration: none; color: var(--gold-ink, var(--accent)); }

/* 자주 묻는 질문 */
.faq details, .faq h2 { max-width: 680px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; padding: 16px 0; list-style: none; display: flex; justify-content: space-between; gap: var(--s-4); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--sub); font-weight: 400; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { color: var(--sub); font-size: var(--t-read); margin: 0 0 16px; }

/* 탈퇴 화면은 머리 바로 아래에서 시작하므로 .block 의 위 여백을 줄임 */
.block.withdraw { padding-top: var(--s-8); }
.withdraw h1 { font-size: var(--t-section); margin: 0 0 8px; }
.withdraw .lead { text-align: left; margin-bottom: 14px; }
.check-line { display: flex; gap: var(--s-2); align-items: flex-start; font-size: var(--t-read); color: var(--sub); }
.check-line input { margin-top: 5px; }
.withdraw .hint { color: var(--sub); font-size: var(--t-body); margin: 0; }
.withdraw .checks, .withdraw .form { margin-bottom: var(--s-4); }

/* 첫 화면: 왼쪽 글·오른쪽 화면 예시, 소개 영역에만 그라데이션 */
.hero-band { background: linear-gradient(180deg, var(--hero-from, var(--paper)), var(--hero-to, var(--soft))); border-bottom: 1px solid var(--line); }
.hero { display: grid; gap: var(--s-8); grid-template-columns: minmax(0, 1fr); padding-top: var(--s-12); padding-bottom: var(--s-12); align-items: center; }
.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 var(--s-4); font-family: var(--sans-en, var(--font)); font-size: var(--t-label); font-weight: 600; letter-spacing: 0.04em; color: var(--sub); }
.eyebrow::before { content: ""; width: 20px; height: 2px; background: var(--gold, var(--accent)); }
h1 { font-size: var(--t-hero); line-height: 1.25; margin: 0 0 var(--s-4); }
:lang(en) h1 { line-height: 1.1; }
.lead { font-size: var(--t-lead); line-height: 1.75; margin: 0 0 var(--s-6); color: var(--sub); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-6); align-items: center; }
.fine { color: var(--sub); font-size: var(--t-label); margin: var(--s-4) 0 0; }

/* 화면 예시: 브라우저 창 안에 읽던 글(왼쪽)과 메모 칸(오른쪽). 좁은 화면은 글 아래에 메모 칸 (내용은 가상의 글) */
.window { position: relative; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card); overflow: hidden; box-shadow: var(--shadow); }
.bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; background: var(--paper); border-bottom: 1px solid var(--line); }
.bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--line); flex: none; }
.bar em { margin-left: 8px; flex: 1; min-width: 0; font-style: normal; font-family: var(--sans-en, var(--font)); color: var(--sub); font-size: var(--t-caption); background: var(--soft); border-radius: 6px; padding: 3px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar i { font-style: normal; font-size: var(--t-caption); line-height: 1.6; color: var(--sub); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 0 8px; white-space: nowrap; background: var(--card); }
.shot { display: grid; }
.doc { padding: var(--s-8) var(--s-6); min-width: 0; }
.doc p { margin: 0 0 var(--s-3); font-size: var(--t-read); line-height: 1.8; color: var(--sub); }
.doc .doc-site { font-size: var(--t-caption); font-weight: 600; margin-bottom: var(--s-2); }
.doc .doc-title { font-family: var(--serif); font-size: 1.75rem; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); line-height: 1.3; margin-bottom: var(--s-4); }
.doc mark { background: var(--gold-bg, var(--soft)); color: var(--ink); border-bottom: 2px solid var(--gold, var(--accent)); padding: 0 1px; }
/* 메모 칸 (예시): 확장의 메모 칸과 같은 차례: 머리, 탭, 제목, 태그, 기록 카드, 여정, 쓰는 칸 */
.panel { margin: var(--s-4); min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow); padding: var(--s-4); display: grid; gap: var(--s-3); align-content: start; }
.panel p, .j-panel p { margin: 0; }
.p-head { display: flex; align-items: center; gap: 8px; }
.p-head strong { font-family: var(--serif-en, var(--serif)); font-size: 1.125rem; letter-spacing: -0.02em; }
.p-head span { color: var(--sub); font-size: var(--t-label); }
.p-tabs { display: flex; background: var(--soft); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 3px; font-size: var(--t-label); }
.p-tabs span { flex: 1; text-align: center; padding: 5px 0; color: var(--sub); border-radius: var(--r-pill); white-space: nowrap; }
.p-tabs .on { background: var(--ink); color: var(--paper); font-weight: 600; }
.p-title { font-weight: 600; font-size: 1.0625rem; line-height: 1.4; }
.p-tags { display: flex; flex-wrap: wrap; gap: 4px 12px; background: var(--card); border-radius: var(--r-sm); padding: 6px 12px; font-size: var(--t-label); color: var(--sub); }
.p-tags .tag { color: var(--gold-ink, var(--accent)); font-weight: 600; }
.p-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; display: grid; gap: 8px; }
.memo-tag { display: flex; align-items: center; gap: 6px; justify-self: start; font-size: var(--t-caption); font-weight: 600; color: var(--gold-ink, var(--accent)); background: var(--gold-bg, var(--soft)); border-radius: var(--r-pill); padding: 3px 10px; }
.memo-tag svg { stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.memo-text { font-size: var(--t-body); line-height: 1.7; color: var(--ink); }
.memo-date { display: flex; flex-wrap: wrap; gap: 2px 12px; border-top: 1px solid var(--line); padding-top: 8px; font-size: var(--t-caption); color: var(--sub); }
.p-trail { display: flex; gap: var(--s-2); font-size: var(--t-label); }
.p-trail span { color: var(--sub); min-width: 0; }
.memo-input { min-height: 64px; border: 1.5px solid var(--ink); border-radius: var(--r-sm); padding: 9px 12px; font-size: var(--t-body); color: var(--sub); background: var(--card); }

/* 구역: 제목은 세리프, 그 아래 한 줄 설명 */
.block { padding: var(--s-16) var(--s-4) var(--s-4); scroll-margin-top: 56px; }
/* 위 scroll-margin-top 은 머리 높이(56px)에 맞춤: 이동했을 때 구역 제목이 머리 아래로 가려지지 않게 */
.block h2 { font-size: var(--t-section); line-height: 1.35; margin: 0 0 var(--s-3); }
.section-lead { color: var(--sub); font-size: var(--t-read); margin: 0 0 var(--s-8); max-width: 36em; }
.block > h2 + :not(.section-lead) { margin-top: var(--s-6); }
.band { background: var(--soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: var(--s-16); }
.band > .block { padding-bottom: var(--s-16); }

/* 문제 공감: 왼쪽 제목, 오른쪽 글 */
.split { display: grid; gap: var(--s-6); }
.split h2 { margin: 0; }
.split h2 + .section-lead { margin: var(--s-4) 0 0; }
.split .body p { margin: 0 0 var(--s-4); color: var(--sub); font-size: 1.0625rem; line-height: 1.8; }
.split .body p:last-child { margin: 0; color: var(--ink); font-weight: 600; }

/* 작동 방식: 번호가 있는 세 단계 */
.how { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); counter-reset: how; }
.how li { counter-increment: how; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-6); }
.how li::before { content: counter(how); display: block; font-family: var(--serif-en, var(--serif)); font-size: 1.75rem; font-weight: 600; line-height: 1; color: var(--gold-ink, var(--accent)); margin-bottom: var(--s-3); }
.how strong { display: block; font-size: 1.125rem; line-height: 1.4; margin-bottom: 6px; }
.how span { color: var(--sub); font-size: var(--t-read); }

/* 기능 카드: 선 아이콘, 넓은 화면은 세 칸 */
.cards { display: grid; grid-template-columns: 1fr; gap: var(--s-3); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-6); }
.card.tint { background: var(--soft); }
.card h3 { font-size: 1.0625rem; line-height: 1.4; margin: var(--s-3) 0 6px; }
.card p { margin: 0; color: var(--sub); font-size: var(--t-read); }
.ico { display: block; width: 28px; height: 28px; stroke: var(--gold-ink, var(--accent)); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.more { color: var(--sub); font-size: var(--t-read); margin: var(--s-6) 0 0; }

/* 여정: 왼쪽은 거쳐 온 길(골드 선 위의 점), 오른쪽은 지금 페이지의 메모 칸 (예시) */
.journey { display: grid; gap: var(--s-6); align-items: start; }
.trail { list-style: none; margin: 0 0 0 5px; padding: 0 0 0 22px; border-left: 2px solid var(--gold, var(--accent)); display: grid; gap: var(--s-3); }
.trail li { position: relative; }
.trail li::before { content: ""; position: absolute; left: -29px; top: 16px; width: 12px; height: 12px; border-radius: 50%; background: var(--sub); box-shadow: 0 0 0 3px var(--soft); }
.trail li.here::before { background: var(--gold, var(--accent)); box-shadow: 0 0 0 3px var(--ink); }
.trail li:has(.t-why)::before { top: 44px; }
.t-why { margin: 0 0 6px; font-size: var(--t-label); font-weight: 600; color: var(--gold-ink, var(--accent)); }
.t-why::before { content: "\2193\00a0"; }
.t-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 16px; }
.here .t-card { border: 2px solid var(--ink); box-shadow: var(--shadow); }
.t-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0; }
.t-head strong { flex: 1 1 12em; line-height: 1.4; }
.t-badge { font-size: var(--t-caption); color: var(--sub); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 1px 9px; white-space: nowrap; }
.here .t-badge { background: var(--ink); border-color: var(--ink); color: var(--paper); font-weight: 600; }
.t-memo { margin: 8px 0 0; background: var(--paper); border-radius: var(--r-sm); padding: 8px 12px; font-size: var(--t-body); line-height: 1.6; }
.here .t-memo { background: var(--gold-bg, var(--soft)); }
.j-panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow); padding: var(--s-4); display: grid; gap: var(--s-3); }
.j-group { border-top: 1px solid var(--line); padding-top: var(--s-3); display: grid; gap: var(--s-2); }
.j-label { font-weight: 600; font-size: var(--t-read); color: var(--gold-ink, var(--accent)); }
.j-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 14px; display: grid; gap: 2px; }
.j-item strong { font-size: var(--t-body); line-height: 1.45; }
.j-item span { color: var(--sub); font-size: var(--t-label); line-height: 1.6; }

/* 사용 장면: 위 굵은 선과 짧은 글 */
.people { display: grid; grid-template-columns: 1fr; gap: var(--s-6) var(--s-4); margin: 0; padding: 0; list-style: none; }
.people li { border-top: 2px solid var(--ink); padding-top: var(--s-3); }
.people li:last-child { border-top-color: var(--line); }
.people strong { display: block; font-size: 1.0625rem; line-height: 1.4; margin-bottom: 4px; }
.people span { color: var(--sub); font-size: var(--t-read); }

/* 시간의 흐름: 한 페이지에 쌓인 메모 (예시) */
.timeline { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-6); }
.timeline .t-title { margin: 0; font-weight: 600; }
.timeline .t-url { margin: 0 0 var(--s-4); font-family: var(--sans-en, var(--font)); font-size: var(--t-caption); color: var(--sub); }
.timeline ol { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 7.5em 1fr; gap: var(--s-4); padding: 14px 0; border-top: 1px solid var(--line); font-size: var(--t-read); }
.timeline time, .timeline .now { font-size: var(--t-label); color: var(--sub); }
.timeline li.again { background: var(--gold-bg, var(--soft)); border-radius: var(--r-sm); border-top-color: transparent; padding: 14px 12px; margin: 0 -12px; }
.timeline li.again .now { color: var(--gold-ink, var(--accent)); font-weight: 600; }

/* 믿을 수 있는 설명: 체크 목록 (탈퇴 화면도 씀) */
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); }
.checks li { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px 14px 44px; position: relative; color: var(--sub); font-size: var(--t-read); }
.checks li[hidden] { display: none; }
.checks li::before { content: "\2713"; position: absolute; left: 18px; top: 13px; color: var(--gold-ink, var(--accent)); font-weight: 600; }
.checks strong { display: block; color: var(--ink); }
.trust .checks { grid-template-columns: 1fr; }

/* 설치 순서 */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); counter-reset: s; max-width: 680px; }
.steps li { counter-increment: s; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 18px; }
.steps strong { display: block; margin-bottom: 2px; }
.steps strong::before { content: counter(s) ". "; color: var(--gold-ink, var(--accent)); }
.steps span { color: var(--sub); font-size: var(--t-read); }

/* 요금: 두 칸 (요금 안내 화면도 씀) */
.plan-grid { display: grid; grid-template-columns: 1fr; gap: var(--s-4); max-width: 720px; }
.plan { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-8) var(--s-6) var(--s-6); }
.plan.featured { border-color: var(--ink); }
.plan h3 { margin: 0 0 2px; font-size: 1.25rem; }
.plan .price { margin: var(--s-2) 0 var(--s-4); color: var(--ink); font-weight: 600; font-size: 1.125rem; }
.plan ul { margin: 0; padding-left: 18px; color: var(--ink); font-size: var(--t-read); display: grid; gap: 4px; }

/* 가입 칸 */
.signup .hint { color: var(--sub); font-size: var(--t-body); margin: 0 0 var(--s-4); }
.form { display: grid; gap: var(--s-2); margin: 0 0 14px; max-width: 520px; }
.form[hidden], .done[hidden] { display: none; }
.form label { font-size: var(--t-body); color: var(--sub); margin-top: var(--s-1); }
.row { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.row input { flex: 1 1 200px; }
input { font: inherit; padding: 10px 14px; border: 1px solid var(--field-line, var(--line)); border-radius: var(--r-sm); background: var(--card); color: var(--ink); min-width: 0; }
input::placeholder { color: var(--sub); opacity: 0.8; }
input:focus { outline: 2px solid var(--gold-ink, var(--accent)); outline-offset: 1px; }
.msg { min-height: 1.7em; font-size: var(--t-read); margin: var(--s-1) 0 0; max-width: 520px; }
.msg.bad { color: var(--bad); }
.done { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; max-width: 520px; }
.done p { margin: 0 0 var(--s-2); }

/* 마지막 권유: 가운데, 짧은 골드 선 */
.closing { text-align: center; padding: var(--s-16) var(--s-4); }
.closing::before { content: ""; display: block; width: 32px; height: 2px; background: var(--gold, var(--accent)); margin: 0 auto var(--s-6); }
.closing h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem); line-height: 1.3; margin: 0 0 var(--s-3); }
.closing p { color: var(--sub); margin: 0 0 var(--s-6); }

.foot { color: var(--sub); font-size: var(--t-label); border-top: 1px solid var(--line); padding: var(--s-6) 0 var(--s-12); margin-top: var(--s-8); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-6); align-items: center; justify-content: center; }
.foot p { margin: 0; }
.foot a { color: var(--sub); }

/* 넓은 화면: 첫 화면 두 칸, 카드 세 칸, 요금 두 칸 (첫 제목 크기는 --t-hero 가 화면 폭에 따라 정함) */
@media (min-width: 700px) {
  .hero { padding-top: var(--s-16); padding-bottom: var(--s-16); }
  .hero > div:first-child { max-width: 40em; }
  .shot { grid-template-columns: minmax(0, 1fr) 368px; }
  .split { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: var(--s-12); }
  .how { grid-template-columns: repeat(3, 1fr); }
  .journey { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .j-panel { position: sticky; top: 72px; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .people { grid-template-columns: repeat(3, 1fr); }
  .trust .checks { grid-template-columns: 1fr 1fr; }
  .plan-grid { grid-template-columns: 1fr 1fr; }
}
/* 메뉴 서랍 (대문만, home.html): 넓은 화면에서는 아이콘·서랍이 없고 머리에 메뉴가 늘 보임 */
.nav-toggle, .nav-scrim, .nav-drawer { display: none; }
.nav-toggle, .nav-close { align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--ink); cursor: pointer; }
.nav-toggle::before, .nav-close::before { content: ""; width: 22px; height: 22px; background: currentColor; -webkit-mask: var(--i-nav) center / contain no-repeat; mask: var(--i-nav) center / contain no-repeat; }
.nav-toggle { --i-nav: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'><path d='M4 7h16M4 12h16M4 17h16'/></svg>"); margin-right: -8px; }
.nav-close { --i-nav: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'><path d='M6 6l12 12M18 6L6 18'/></svg>"); color: var(--sub); }
.nav-toggle:hover, .nav-close:hover { background: var(--soft); color: var(--ink); }
.nav-toggle:focus-visible, .nav-close:focus-visible, .nav-drawer-links a:focus-visible { outline: 2px solid var(--gold-ink, var(--accent)); outline-offset: 2px; }

/* 좁은 화면: 머리에는 로고·시작하기·메뉴 아이콘만, 나머지는 서랍으로. 첫 소개 글은 조금 작게 */
@media (max-width: 699px) {
  .doc p:nth-child(n+5) { display: none; }
  .top:has(.nav-toggle) .menu, .top:has(.nav-toggle) .nav-read { display: none; }
  .nav-toggle, .nav-close { display: inline-flex; }
  .nav { gap: var(--s-3, 12px); }
  .nav-scrim { display: block; position: fixed; inset: 0; z-index: 20; background: rgb(0 0 0 / 0.4); opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
  .nav-drawer { display: flex; flex-direction: column; gap: var(--s-4); position: fixed; top: 0; right: 0; bottom: 0; z-index: 21; width: min(80vw, 300px); padding: 8px 16px 24px; overflow-y: auto; overscroll-behavior: contain; background: var(--paper); border-left: 1px solid var(--line); box-shadow: -8px 0 24px rgb(0 0 0 / 0.12); transform: translateX(100%); visibility: hidden; transition: transform 0.24s ease, visibility 0s linear 0.24s; }
  body.nav-open .nav-scrim { opacity: 1; pointer-events: auto; }
  body.nav-open .nav-drawer { transform: none; visibility: visible; transition: transform 0.24s ease; }
  body.nav-open { overflow: hidden; } /* 서랍이 열린 동안 뒤의 글은 스크롤되지 않음 */
  .nav-drawer-head { display: flex; align-items: center; justify-content: space-between; height: 48px; margin-right: -8px; }
  .nav-drawer-title { font-weight: 600; color: var(--sub); font-size: var(--t-label); }
  .nav-drawer-links { display: flex; flex-direction: column; }
  .nav-drawer-links a { padding: 12px 4px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: var(--t-title, 1.125rem); font-weight: 600; }
  .nav-drawer-links a:hover { color: var(--gold-ink, var(--accent)); }
  .nav-drawer-actions { display: flex; flex-direction: column; gap: 10px; margin-top: var(--s-2, 8px); }
  .nav-drawer-actions .btn { text-align: center; }
}
@media (max-width: 699px) and (prefers-reduced-motion: reduce) {
  .nav-scrim, .nav-drawer, body.nav-open .nav-drawer { transition: none; }
}
/* 아주 좁은 화면: 머리 단추의 폭 맞춤·여백을 줄여 로고·단추 둘이 한 줄에 들어가게 (320px 요금·탈퇴 화면) */
@media (max-width: 420px) {
  .nav { gap: 10px; }
  .nav .btn.small { min-width: 0; padding: 7px 12px; }
}
@media (max-width: 480px) {
  .menu { display: none; }
  .lead { font-size: var(--t-title); }
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
}
