/* 색: 늘 밝은 화면(오너 요청 — 다크 모드 없음). 흰 바탕 + 밝은 하늘색 면 + 선명한 파랑 하나. */
:root {
  --bg: #ffffff;
  --surface: #f2f7ff;
  --card: #ffffff;
  --text: #17202b;
  --muted: #4f5b69;      /* 흰 배경 대비 약 6.8:1 */
  --line: #dfe7f2;
  --accent: #2563eb;     /* 흰 배경 대비 약 5.2:1 */
  --accent-ink: #ffffff;
  --accent-soft: #e8f0ff;
  --focus: #2563eb;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: linear-gradient(180deg, #e9f2ff 0, #f6f9ff 320px, var(--bg) 640px) no-repeat, var(--bg);
  color: var(--text);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-underline-offset: 3px; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 8px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  padding: 10px 14px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 8px;
  z-index: 10;
}
.skip:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 16px;
}
.wrap-narrow { max-width: 760px; }

/* 버튼 */
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover { filter: brightness(1.08); }

/* ── 목록 화면 ── */
.hero { padding-top: 72px; padding-bottom: 48px; }
.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(34px, 7vw, 46px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.nowrap { white-space: nowrap; }
.intro { margin: 0 0 24px; max-width: 40em; color: var(--muted); font-size: 18px; }

.section-title {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
/* 카드가 네 장이라 넓은 화면에서도 두 칸(2×2)으로 둡니다. 세 칸이면 둘째 줄에 한 장만 남습니다. */

.card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
  transition: border-color .15s ease, transform .15s ease;
}
.card { box-shadow: 0 1px 2px rgba(23, 32, 43, 0.04), 0 4px 14px rgba(37, 99, 235, 0.06); }
.card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(37, 99, 235, 0.14); }
.card:focus-visible { outline-offset: 4px; border-radius: 16px; }

.thumb {
  aspect-ratio: 16 / 10;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

.card-body { padding: 18px 20px 22px; }
.kind {
  display: block;
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}
.card-name { margin: 0; font-size: 22px; line-height: 1.3; letter-spacing: -0.01em; }
.card-line { margin: 4px 0 0; color: var(--muted); font-size: 16px; }

.more { margin: 20px 0 0; color: var(--muted); font-size: 16px; }
.more a { display: inline-block; padding: 10px 0; }

.footer {
  margin-top: 64px;
  padding-top: 24px;
  padding-bottom: 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0 0 4px; }
.footer-links a { display: inline-block; min-width: 44px; padding: 10px 0; }
.footer p { margin: 0; }

/* ── 자세히 화면 ── */
.back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 16px;
  font-weight: 600;
  text-decoration: none;
}
.back:hover { text-decoration: underline; }

.detail-head { padding-top: 24px; padding-bottom: 28px; }
.detail-head h1 {
  margin: 0 0 8px;
  font-size: clamp(32px, 7vw, 42px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.summary { margin: 0 0 22px; font-size: 18px; color: var(--muted); }

.block { padding-top: 22px; margin-top: 22px; border-top: 1px solid var(--line); }
.block-first { padding-top: 0; margin-top: 0; border-top: 0; }
.block h2 { margin: 0 0 10px; font-size: 19px; line-height: 1.4; }
.block p { margin: 0; }
.block .fine { margin-top: 10px; font-size: 15px; color: var(--muted); }

.dots { margin: 0; padding: 0; list-style: none; }
.dots li { position: relative; padding-left: 18px; margin: 6px 0; }
.dots li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.72em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.nums {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 0;
}
.nums div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  background: var(--surface);
  border-radius: 12px;
}
.nums dt { font-size: 15px; color: var(--muted); line-height: 1.5; }
/* 숫자를 설명 위에 보이게(읽는 순서는 설명 → 숫자) */
.nums dd { order: -1; margin: 0; font-size: 24px; font-weight: 700; line-height: 1.3; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chips li {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 15px;
}

/* 화면 사진 */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.shot {
  display: block;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.45;
  border-radius: 10px;
}
.shot img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  margin-bottom: 6px;
  transition: transform .15s ease;
}
.gallery-phone { max-width: 540px; }
.gallery-wide .shot img { aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; }
.gallery-two { grid-template-columns: repeat(2, 1fr); margin: 12px 0; }
.gallery-two .shot img { aspect-ratio: 76 / 63; }
.shot:hover img { transform: translateY(-2px); }

/* 좁은 화면: PC 화면 사진은 옆으로 넘겨 보기(페이지는 가로로 밀리지 않음). 폰 화면 사진은 3칸 그대로 */
@media (max-width: 560px) {
  .gallery-wide {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 10px;
    margin: -8px -16px 0;
    padding: 8px 16px;
    scroll-padding-inline: 16px;
    scrollbar-width: thin;
  }
  .gallery-wide li { flex: 0 0 80%; scroll-snap-align: start; }
  .gallery-phone { gap: 8px; }
  .gallery-phone .shot { font-size: 13px; }
}

.bottom-nav { margin-top: 40px; }

/* 사진 한 장(설명 그림·소개 그림) */
.figure { margin: 0; }
.figure .shot img { aspect-ratio: auto; }
.figure figcaption { margin-top: 2px; font-size: 14px; color: var(--muted); line-height: 1.5; }

/* 만든 방식 아래 기술 칩 */
.block p + .chips { margin-top: 14px; }

/* 크게 보기 */
.viewer {
  width: auto;
  max-width: min(1200px, 100vw - 24px);
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--text);
  overflow: auto;
}
.viewer::backdrop { background: rgba(10, 12, 16, .72); }
.viewer-bar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.viewer-caption { margin: 0; flex: 1; font-size: 15px; line-height: 1.45; }
.viewer-img { max-width: 100%; height: auto; margin: 0 auto; }
/* 폰 화면은 세로가 길어서 창 높이에 맞춤 */
.viewer-img.fit-height { width: auto; max-height: calc(100dvh - 96px); }

@media (prefers-reduced-motion: reduce) {
  .card, .shot img { transition: none; }
  .card:hover, .shot:hover img { transform: none; }
}

/* 인적 사항 — 폰에서는 항목과 값이 한 줄에 들어가게 좁은 첫 칸 */
.profile { margin: 0 0 24px; display: grid; gap: 6px; max-width: 40em; }
.profile > div { display: grid; grid-template-columns: 5.5em 1fr; gap: 12px; }
.profile dt { color: var(--muted); font-size: 15px; }
.profile dd { margin: 0; font-size: 15px; word-break: keep-all; overflow-wrap: anywhere; }

/* 자세히 머리의 짧은 사실 문장(예: 공개 배포 전) */
.head-note { margin: 12px 0 0; font-size: 15px; color: var(--muted); }

/* 세 줄 흐름 그림(무엇을 하는 도구인지). 번호 → 한 줄 */
.flow { margin: 0 0 16px; padding: 0; list-style: none; counter-reset: flow; display: grid; gap: 8px; }
.flow li {
  position: relative;
  padding: 12px 16px 12px 52px;
  background: var(--surface);
  border-radius: 12px;
  counter-increment: flow;
}
.flow li::before {
  content: counter(flow);
  position: absolute;
  left: 14px;
  top: 12px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 26px;
  text-align: center;
}
.flow b { display: block; font-size: 15px; color: var(--muted); font-weight: 600; }
.flow .mark { padding: 0 4px; border-radius: 4px; background: #fdf0c4; }

/* 숫자 칸이 긴 경우(세 번 잰 값을 나란히): 한 줄에 둘 */
.nums-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.nums + .fine, .nums + p { margin-top: 12px; }
/* 문단을 하나 더 이어 쓸 때 사이를 띄움 */
.block p.next { margin-top: 10px; }
