/* ===== 색상 ===== */
:root {
  --bg: #fff8ef;
  --paper: #ffffff;
  --ink: #2b2a33;
  --ink-soft: #6b6876;
  --line: #f0e3d2;
  --red: #ff6b6b;
  --yellow: #ffd166;
  --green: #4cc9a0;
  --blue: #5aa9ff;
  --purple: #a78bfa;
  --accent: var(--red);
  --shadow: 0 6px 0 rgba(43, 42, 51, 0.08);
  --radius: 22px;
  --font: 'Jua', 'Nunito', system-ui, -apple-system, sans-serif;
  --font-body: 'Nunito', 'Gowun Dodum', system-ui, -apple-system, sans-serif;
}
html[lang="ko"] { --font-body: 'Gowun Dodum', 'Nunito', system-ui, sans-serif; }

* { box-sizing: border-box; }
html.lang-pending body { visibility: hidden; }

/* 한 언어만 보이기 */
html[lang="ko"] [data-lang="en"],
html[lang="en"] [data-lang="ko"] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .brand, .btn, .badge, .step-num { font-family: var(--font); font-weight: 400; }
img { max-width: 100%; display: block; }
a { color: inherit; }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* ===== 상단바 ===== */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 248, 239, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 2px dashed var(--line);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 24px; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; }

.lang-toggle {
  display: inline-flex; padding: 4px; gap: 2px;
  border: 2px solid var(--ink); border-radius: 999px;
  background: var(--paper); cursor: pointer;
  font-family: var(--font); font-size: 15px;
}
.lang-toggle span { padding: 4px 12px; border-radius: 999px; color: var(--ink-soft); transition: background .2s, color .2s; }
html[lang="ko"] .lang-toggle .opt-ko,
html[lang="en"] .lang-toggle .opt-en { background: var(--ink); color: #fff; }
.lang-toggle:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* ===== 히어로 ===== */
.hero { padding: 48px 0 24px; text-align: center; }
.hero h1 { font-size: clamp(36px, 7vw, 60px); line-height: 1.2; margin: 0 0 12px; }
.hero p { font-size: 20px; color: var(--ink-soft); margin: 0 auto; max-width: 560px; }
.hero .hl { background: linear-gradient(transparent 60%, var(--yellow) 60%); }

/* ===== 카드 목록 ===== */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; padding: 24px 0 64px; }
.card {
  background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; text-decoration: none;
  display: flex; flex-direction: column;
  transition: transform .15s ease;
}
a.card:hover { transform: translateY(-4px) rotate(-0.5deg); }
.card-thumb { aspect-ratio: 4 / 3; display: grid; place-items: center; border-bottom: 2px solid var(--ink); }
.card-thumb { position: relative; overflow: hidden; }
.card-thumb svg { width: 55%; height: auto; }
.card-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: inherit; }
.card-body { padding: 16px 18px 20px; }
.card-body h3 { font-size: 24px; margin: 0 0 4px; }
.card-body p { margin: 0; color: var(--ink-soft); font-size: 16px; }
.card.soon { opacity: .55; border-style: dashed; box-shadow: none; }

.badge {
  display: inline-block; font-size: 14px; padding: 2px 10px; border-radius: 999px;
  background: var(--yellow); margin-top: 10px;
}
.stars { letter-spacing: 2px; color: #f4a300; }

/* ===== 접기 페이지 ===== */
.back { display: inline-block; margin-top: 20px; color: var(--ink-soft); text-decoration: none; font-family: var(--font); }
.back:hover { color: var(--ink); }

.model-head { display: grid; grid-template-columns: 1fr; gap: 24px; padding: 24px 0; align-items: center; }
@media (min-width: 720px) { .model-head { grid-template-columns: 1.1fr 1fr; } }
.model-head h1 { font-size: clamp(36px, 6vw, 54px); margin: 0 0 8px; line-height: 1.2; }
.model-head .lead { font-size: 20px; color: var(--ink-soft); margin: 0 0 16px; }
.model-hero-img {
  background: #ffe3e3; border: 2px solid var(--ink); border-radius: var(--radius);
  aspect-ratio: 1; display: grid; place-items: center; box-shadow: var(--shadow); position: relative; overflow: hidden;
}

.facts { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 0; }
.facts li { background: var(--paper); border: 2px solid var(--line); border-radius: 14px; padding: 6px 14px; font-size: 16px; }
.facts b { font-family: var(--font); font-weight: 400; margin-right: 4px; }

.panel {
  background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius);
  padding: 20px 22px; margin: 8px 0 28px; box-shadow: var(--shadow);
}
.panel h2 { margin: 0 0 8px; font-size: 26px; }
.panel ul { margin: 0; padding-left: 22px; }

/* 진행 막대 */
.progress { position: sticky; top: 64px; z-index: 5; background: var(--bg); padding: 10px 0; }
.progress-row { display: flex; align-items: center; gap: 12px; font-family: var(--font); }
.progress-bar { flex: 1; height: 14px; border-radius: 999px; background: var(--line); overflow: hidden; border: 2px solid var(--ink); }
.progress-fill { height: 100%; width: 0; background: var(--green); transition: width .3s ease; }

/* 단계 */
.steps { list-style: none; padding: 0; margin: 0 0 40px; display: grid; gap: 22px; }
.step {
  background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr);
  transition: background .2s;
}
@media (min-width: 720px) { .step { grid-template-columns: 300px minmax(0, 1fr); } }
.step.done { background: #eafaf4; }

.step-img {
  position: relative; aspect-ratio: 1; background: #f7f1ff;
  border-bottom: 2px solid var(--ink);
  display: grid; place-items: center; text-align: center;
  color: var(--ink-soft); font-family: var(--font); font-size: 18px;
}
@media (min-width: 720px) { .step-img { border-bottom: 0; border-right: 2px solid var(--ink); } }
.step:nth-child(4n+2) .step-img { background: #e9f4ff; }
.step:nth-child(4n+3) .step-img { background: #fff4d6; }
.step:nth-child(4n+4) .step-img { background: #e3f8ef; }
/* Figma 그림이 있으면 자리표시 위를 덮어요 */
.step-img img, .model-hero-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: inherit; }
.ph-icon { font-size: 44px; line-height: 1; display: block; margin-bottom: 6px; }

.step-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 10px; }
.step-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.step-num {
  width: 48px; height: 48px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 24px;
  background: var(--accent); color: #fff; border: 2px solid var(--ink);
}
.step:nth-child(4n+2) .step-num { background: var(--blue); }
.step:nth-child(4n+3) .step-num { background: var(--yellow); color: var(--ink); }
.step:nth-child(4n+4) .step-num { background: var(--green); }
.step h3 { margin: 0; font-size: 24px; line-height: 1.3; }
.step p { margin: 0; font-size: 19px; }
.hard { background: #ffe1e1; color: #b3261e; }
.tip { font-size: 16px; color: var(--ink-soft); background: var(--bg); border-radius: 12px; padding: 8px 12px; }

/* 다른 각도에서 본 그림 (단계 전체 너비) */
.step-extra {
  grid-column: 1 / -1; margin: 0; min-width: 0;
  border-top: 2px dashed var(--line); background: #fffaf3;
  padding: 16px 22px 18px;
}
.step-extra figcaption { display: flex; flex-direction: column; gap: 2px; font-size: 17px; margin-bottom: 10px; }
.step-extra figcaption b { font-family: var(--font); font-weight: 400; font-size: 20px; }
.step-extra .scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.step-extra img { width: 100%; min-width: 760px; height: auto; }
.step-extra .swipe { display: none; font-size: 14px; color: var(--ink-soft); text-align: center; margin-top: 4px; }
@media (max-width: 700px) { .step-extra .swipe { display: block; } }

.check {
  align-self: flex-start; margin-top: 6px;
  display: inline-flex; align-items: center; gap: 8px;
  border: 2px solid var(--ink); border-radius: 999px; background: var(--paper);
  padding: 6px 16px; font-family: var(--font); font-size: 17px; cursor: pointer;
}
.check:hover { background: var(--bg); }
.check .box { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--ink); display: grid; place-items: center; font-size: 14px; color: transparent; }
.step.done .check { background: var(--green); color: #fff; }
.step.done .check .box { background: #fff; color: var(--green); }

/* 완성 */
.finish { text-align: center; padding: 28px 22px; margin-bottom: 64px; }
.finish h2 { font-size: 32px; }
.finish .big { font-size: 64px; line-height: 1; }

.footer { text-align: center; color: var(--ink-soft); font-size: 14px; padding: 24px 0 40px; }

@media (max-width: 480px) {
  body { font-size: 17px; }
  .step p { font-size: 18px; }
  .brand { font-size: 20px; }
}

/* 그림 위 이름표 (언어 바뀌는 글자) */
.img-label {
  position: absolute; z-index: 1; left: 55%;
  max-width: 42%; text-align: left;
  font-family: var(--font); font-size: 14px; line-height: 1.25;
  background: #fff; border: 2px solid var(--ink); border-radius: 12px; padding: 3px 9px;
  color: var(--ink);
}
.img-label.top { top: 11%; }
.img-label.bottom { top: 80%; background: var(--yellow); }
.step-extra .scroll img[src*="step-05-open"] { min-width: 520px; }
.img-label small { display: block; font-family: var(--font-body); font-size: 12px; color: var(--ink-soft); }
