/* 한코한코 뜨개 가이드 — 앱 밖의 정적 페이지라 tokens.css 를 쓸 수 없어 같은 값을 옮겨 둔다 (색을 바꾸면 tokens.css 와 함께 고친다) */
:root {
	color-scheme: light dark;
	--canvas: #f7f7f5;
	--surface: #ffffff;
	--surface-muted: #efefec;
	--fg: #1c1c1a;
	--fg-muted: #5b5b57;
	--border: #e6e6e2;
	--accent: #3d7255;
	--accent-subtle: #e3efe7;
	--accent-text: #2e5d43;
	--on-accent: #ffffff;
	--emphasis-subtle: #fbe6de;
	--emphasis-text: #a8462a;
}
:root[data-theme='dark'] {
	--canvas: #141514;
	--surface: #1e1f1e;
	--surface-muted: #2a2b2a;
	--fg: #f2f2ef;
	--fg-muted: #c2c2bd;
	--border: #2f302f;
	--accent: #e2a54a;
	--accent-subtle: rgb(226 165 74 / 0.16);
	--accent-text: #eab65f;
	--on-accent: #141514;
	--emphasis-subtle: rgb(208 96 63 / 0.22);
	--emphasis-text: #eb9a7c;
}

* {
	box-sizing: border-box;
}
/* hidden 속성이 display 를 정한 규칙에 지지 않게 한다 (앱에서 들어왔을 때만 보이는 버튼 등) */
[hidden] {
	display: none !important;
}
html {
	-webkit-text-size-adjust: 100%;
}
body {
	margin: 0;
	background: var(--canvas);
	color: var(--fg);
	font-family: 'IBM Plex Sans KR', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', system-ui, sans-serif;
	font-size: 17px;
	line-height: 1.75;
	word-break: keep-all;
	overflow-wrap: anywhere;
}
:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}
a {
	color: var(--accent-text);
	text-underline-offset: 3px;
}

.skip {
	position: absolute;
	left: -999px;
}
.skip:focus {
	left: 16px;
	top: 12px;
	padding: 8px 14px;
	background: var(--surface);
	border-radius: 8px;
	z-index: 1;
}

.site-header {
	max-width: 760px;
	margin: 0 auto;
	padding: 16px 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
.brand {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	color: var(--fg);
	font-weight: 700;
	font-size: 18px;
	text-decoration: none;
}
.brand img {
	width: 28px;
	height: 28px;
}
.site-header nav {
	display: flex;
	gap: 8px;
}
.site-header nav .app-link {
	padding: 0 14px;
	border-radius: 999px;
	background: var(--accent-subtle);
	color: var(--accent-text);
}
.site-header nav a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 4px;
	font-size: 15px;
	font-weight: 700;
	color: var(--fg-muted);
	text-decoration: none;
}

main {
	max-width: 760px;
	margin: 0 auto;
	padding: 8px 20px 64px;
}
.crumbs {
	font-size: 14px;
	color: var(--fg-muted);
	margin: 0 0 8px;
}
.crumbs a {
	color: inherit;
}
h1 {
	font-size: clamp(24px, 5.5vw, 32px);
	line-height: 1.35;
	margin: 0 0 10px;
	letter-spacing: -0.02em;
}
.lead {
	font-size: 16px;
	color: var(--fg-muted);
	margin: 0 0 24px;
}
.meta {
	font-size: 14px;
	color: var(--fg-muted);
	margin: 0 0 32px;
}
h2 {
	font-size: 24px;
	line-height: 1.4;
	margin: 48px 0 12px;
	letter-spacing: -0.01em;
}
h3 {
	font-size: 19px;
	margin: 28px 0 8px;
}
p,
ul,
ol {
	margin: 0 0 16px;
}
li {
	margin: 4px 0;
}
strong {
	font-weight: 700;
}
code {
	font-family: ui-monospace, 'SF Mono', Menlo, monospace;
	font-size: 0.88em;
	background: var(--surface-muted);
	padding: 2px 6px;
	border-radius: 6px;
}

.toc {
	margin: 0 0 8px;
	padding: 8px;
	border-radius: 20px;
	background: var(--surface);
	box-shadow: 0 0 0 1px var(--border);
}
.toc-title {
	margin: 8px 12px 4px;
	font-size: 14px;
	font-weight: 700;
	color: var(--fg-muted);
}
.toc ol {
	display: grid;
	gap: 2px;
	margin: 0;
	padding: 0;
	list-style: none;
}
@media (min-width: 640px) {
	.toc ol {
		grid-template-columns: 1fr 1fr;
		column-gap: 8px;
	}
}
.toc li {
	margin: 0;
}
/* 줄 전체가 누르는 자리 — 번호 배지 · 제목 (화살표를 두면 펼치기처럼 보여서 두지 않는다) */
.toc a {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 48px;
	padding: 8px 12px;
	border-radius: 12px;
	color: var(--fg);
	font-size: 16px;
	line-height: 1.45;
	text-decoration: none;
	transition: background-color 150ms;
}
.toc a:hover {
	background: var(--surface-muted);
}
.toc-num {
	flex: none;
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--accent-subtle);
	color: var(--accent-text);
	font-size: 14px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}
/* 목차로 이동했을 때 제목이 화면 맨 위에 붙지 않게 */
h2[id] {
	scroll-margin-top: 16px;
}
@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

figure {
	margin: 24px 0;
	color: var(--fg);
	background: var(--surface);
	border-radius: 16px;
	padding: 20px;
	box-shadow: 0 0 0 1px var(--border);
}
figure svg {
	display: block;
	width: 100%;
	height: auto;
	max-height: 360px;
}
figure.photo {
	padding: 12px;
}
figure.photo img {
	display: block;
	width: 100%;
	max-width: 520px;
	margin: 0 auto;
	height: auto;
	border-radius: 10px;
}
/* 서술형 도안 예시 — 단 번호 · 목표 코 수 · 반복을 색으로 나눈다 (설명 글에도 같은 색 표시를 쓴다) */
.pattern-lines {
	padding: 4px 4px 0;
	font-size: 16px;
	line-height: 1.6;
}
.pattern-lines p {
	margin: 0 0 10px;
}
.pt-row,
.pt-count,
.pt-repeat {
	padding: 1px 6px;
	border-radius: 6px;
	font-weight: 700;
	white-space: nowrap;
}
.pt-row {
	background: var(--accent-subtle);
	color: var(--accent-text);
}
.pt-count {
	background: var(--emphasis-subtle);
	color: var(--emphasis-text);
}
.pt-repeat {
	background: var(--surface-muted);
	color: var(--fg);
	box-shadow: inset 0 0 0 1px var(--border);
}
figcaption {
	font-size: 14px;
	color: var(--fg-muted);
	margin-top: 12px;
	text-align: center;
}

.tip,
.note {
	border-radius: 14px;
	padding: 14px 18px;
	margin: 20px 0;
	font-size: 16px;
}
.tip {
	background: var(--accent-subtle);
}
.tip strong {
	color: var(--accent-text);
}
.note {
	background: var(--emphasis-subtle);
}
.note strong {
	color: var(--emphasis-text);
}

table {
	width: 100%;
	border-collapse: collapse;
	margin: 16px 0 20px;
	font-size: 16px;
	background: var(--surface);
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 0 0 1px var(--border);
}
th,
td {
	overflow-wrap: normal;
	text-align: left;
	padding: 10px 14px;
	border-bottom: 1px solid var(--border);
	vertical-align: top;
}
thead th {
	background: var(--surface-muted);
	font-size: 15px;
}
tbody tr:last-child td {
	border-bottom: 0;
}
/* 기호 표 — 첫 칸에 코바늘 기호 그림 */
.sym {
	display: block;
	width: 32px;
	height: 32px;
	color: var(--fg);
}

.steps {
	counter-reset: step;
	list-style: none;
	padding: 0;
}
.steps li {
	counter-increment: step;
	position: relative;
	padding-left: 44px;
	margin: 0 0 14px;
}
.steps li::before {
	content: counter(step);
	position: absolute;
	left: 0;
	top: 2px;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--accent);
	color: var(--on-accent);
	font-weight: 700;
	font-size: 15px;
	display: grid;
	place-items: center;
}

.cta {
	margin: 48px 0 0;
	padding: 24px;
	border-radius: 20px;
	background: var(--surface);
	box-shadow: 0 0 0 1px var(--border);
	text-align: center;
}
.cta p {
	margin: 0 0 16px;
	font-weight: 700;
	font-size: 17px;
	text-wrap: balance;
}
.cta-mongsil {
	display: block;
	width: 88px;
	height: 88px;
	margin: -8px auto 4px;
}
.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	padding: 0 24px;
	border-radius: 14px;
	background: var(--accent);
	color: var(--on-accent);
	font-weight: 700;
	text-decoration: none;
}

.related {
	margin-top: 40px;
}
.related h2 {
	font-size: 20px;
}
/* 글 목록 (목록 페이지 · 함께 보면 좋은 글) — 왼쪽 칸 그림, 오른쪽 글 정보 */
.guide-list {
	display: grid;
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}
@media (min-width: 640px) {
	.guide-list {
		grid-template-columns: 1fr 1fr;
	}
}
.guide-list li {
	margin: 0;
}
.guide-list a {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	height: 100%;
	padding: 16px;
	border-radius: 20px;
	background: var(--surface);
	box-shadow: 0 0 0 1px var(--border);
	color: var(--fg);
	text-decoration: none;
	transition: box-shadow 150ms;
}
.guide-list a:hover {
	box-shadow: 0 0 0 2px var(--accent);
}
.thumb {
	flex: none;
	display: grid;
	place-items: center;
	width: 76px;
	height: 76px;
	padding: 10px;
	border-radius: 14px;
	background: var(--surface-muted);
}
.thumb svg {
	width: 100%;
	height: auto;
	border-radius: 3px;
}
.guide-list .text {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}
.guide-list strong {
	font-size: 16px;
	line-height: 1.45;
}
.guide-list .desc {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	font-size: 14px;
	line-height: 1.6;
	color: var(--fg-muted);
}
/* 스크린리더는 제목부터 읽고, 화면에서는 분류 · 읽는 시간을 제목 위에 둔다 */
.meta-row {
	order: -1;
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: var(--fg-muted);
}

.site-footer {
	max-width: 760px;
	margin: 0 auto;
	padding: 24px 20px 48px;
	font-size: 14px;
	color: var(--fg-muted);
	border-top: 1px solid var(--border);
}
.site-footer p {
	margin: 0 0 8px;
}
.site-footer nav {
	display: flex;
	flex-wrap: wrap;
	margin: 0 -8px;
}
.site-footer nav a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 8px;
	color: inherit;
}
