:root {
  --bg: #141210;
  --bg-panel: #1d1a17;
  --ink: #e8e2d8;
  --ink-dim: #a89f91;
  --accent: #d4a94e;
  --accent-soft: rgba(212, 169, 78, 0.15);
  --line: rgba(232, 226, 216, 0.12);
  --serif: "Noto Serif KR", "Nanum Myeongjo", serif;
  --sans: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--sans); line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

/* ── 공통 UI ── */
.topbar {
  position: fixed; top: 3px; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 18px;
  background: linear-gradient(to bottom, rgba(20,18,16,0.92), rgba(20,18,16,0));
  font-size: 12.5px; letter-spacing: 0.04em; color: var(--ink-dim);
}
.topbar .brand { color: var(--ink); font-weight: 600; text-decoration: none; }
.topbar .demo-badge { border: 1px solid var(--line); border-radius: 20px; padding: 2px 10px; font-size: 11px; }

#progressTrack { position: fixed; top: 0; left: 0; right: 0; height: 3px; background: rgba(255,255,255,0.06); z-index: 60; }
#progressFill { height: 100%; width: 0%; background: var(--accent); transition: width 0.1s linear; }

.btn {
  display: inline-block; margin-top: 14px;
  background: var(--accent); color: #1a1508;
  border: none; border-radius: 10px; padding: 12px 22px;
  font-size: 14.5px; font-weight: 700; cursor: pointer;
  font-family: var(--sans); text-decoration: none;
  transition: transform .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); font-weight: 500; }
.btn.small { padding: 8px 16px; font-size: 13px; margin-top: 0; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.card {
  background: var(--bg-panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 26px;
}
.card h3 { font-family: var(--serif); font-size: 20px; margin-bottom: 6px; }
.card .sub { color: var(--ink-dim); font-size: 13.5px; margin-bottom: 18px; }

textarea {
  width: 100%; min-height: 110px; resize: vertical;
  background: #12100e; color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; font-family: var(--sans); font-size: 15px; line-height: 1.7;
}
textarea:focus { outline: 1px solid var(--accent); }

pre.prompt {
  background: #12100e; border: 1px solid var(--line); border-radius: 10px;
  padding: 16px; font-size: 13px; line-height: 1.7;
  white-space: pre-wrap; word-break: break-all;
  color: var(--ink-dim); font-family: var(--sans);
  max-height: 180px; overflow-y: auto;
}

#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--ink); color: #1a1508; font-weight: 600;
  padding: 12px 24px; border-radius: 30px; font-size: 14px;
  transition: transform .35s cubic-bezier(.2,.9,.3,1.2); z-index: 90;
}
#toast.show { transform: translateX(-50%) translateY(0); }

/* ── 히어로 ── */
.hero {
  min-height: 92vh;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; padding: 80px 24px 40px;
}
.hero .session-label { color: var(--accent); font-size: 13px; letter-spacing: 0.25em; margin-bottom: 18px; font-weight: 600; }
.hero h1 { font-family: var(--serif); font-size: clamp(30px, 6vw, 52px); font-weight: 700; line-height: 1.35; margin-bottom: 22px; }
.hero p { max-width: 480px; color: var(--ink-dim); font-size: 15.5px; }
.hero .session-plan {
  display: flex; gap: 14px; flex-wrap: wrap; justify-content: center;
  margin-top: 26px;
}
.hero .session-plan span {
  font-size: 13px; color: var(--ink-dim);
  border: 1px solid var(--line); border-radius: 24px; padding: 7px 16px;
}
.hero .session-plan b { color: var(--accent); font-weight: 700; }
.hero .scroll-cue { margin-top: 60px; color: var(--ink-dim); font-size: 12px; letter-spacing: 0.15em; animation: bob 2.2s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); opacity:.55 } 50% { transform: translateY(8px); opacity:1 } }

/* ── 스크롤리텔링 ── */
.scrolly { position: relative; }
.artpane {
  position: sticky; top: 0; z-index: 10;
  height: 46vh; background: #0d0c0a;
  padding-top: 50px; /* 고정 상단바가 그림을 가리지 않도록 */
  display: flex; flex-direction: column;
  border-bottom: 1px solid var(--line);
}
.artstage { position: relative; flex: 1; overflow: hidden; cursor: zoom-in; }
.artstage img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: contain;
  opacity: 0; transition: opacity 0.9s ease; padding: 10px;
}
.artstage img.active { opacity: 1; }
.artcaption {
  padding: 8px 16px 10px; font-size: 12px; color: var(--ink-dim);
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  background: rgba(13,12,10,0.9);
}
.artcaption .title { color: var(--ink); font-family: var(--serif); font-size: 13px; }
.artcaption .zoomhint { white-space: nowrap; font-size: 11px; opacity: 0.8; }

.textpane { position: relative; z-index: 5; }
.step { max-width: 620px; margin: 0 auto; padding: 18vh 26px; }
.step .tool-num { color: var(--accent); font-size: 13px; letter-spacing: 0.2em; font-weight: 700; margin-bottom: 12px; }
.step h2 { font-family: var(--serif); font-size: clamp(24px, 4.5vw, 34px); margin-bottom: 20px; line-height: 1.4; }
.step p { margin-bottom: 16px; font-size: 16px; }
.step p.dim { color: var(--ink-dim); font-size: 15px; }
.step .try {
  margin-top: 22px; padding: 14px 18px;
  background: var(--accent-soft); border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0; font-size: 14.5px;
}
.step .try b { color: var(--accent); }
.draft-note {
  display: inline-block; margin-bottom: 14px;
  font-size: 11.5px; color: var(--ink-dim);
  border: 1px dashed var(--line); border-radius: 6px; padding: 2px 10px;
}

/* ── 세션 마무리 / 카드 목록 영역 ── */
.after { max-width: 620px; margin: 0 auto; padding: 60px 26px 100px; display: flex; flex-direction: column; gap: 28px; }

#hintLocked { display: flex; align-items: center; gap: 14px; color: var(--ink-dim); font-size: 14.5px; }
#hintLocked .lock { font-size: 26px; }
#hintRevealed { display: none; }
#hintRevealed.show { display: block; animation: reveal 1s ease; }
@keyframes reveal { 0% { opacity: 0; transform: translateY(14px); } 100% { opacity: 1; transform: translateY(0); } }
#hintRevealed .hint-text { font-family: var(--serif); font-size: 18.5px; line-height: 1.8; color: var(--accent); margin-top: 10px; }
#hintRevealed .hint-count { margin-top: 14px; font-size: 12.5px; color: var(--ink-dim); }

.next-teaser { text-align: center; color: var(--ink-dim); font-size: 14px; padding-top: 20px; border-top: 1px solid var(--line); }
.next-teaser b { color: var(--ink); font-family: var(--serif); }

/* ── 라이트박스 ── */
#lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(8,7,6,0.96);
  display: none; overflow: hidden; cursor: grab; touch-action: none;
}
#lightbox.open { display: block; }
#lightbox img { position: absolute; top: 0; left: 0; max-width: none; transform-origin: 0 0; user-select: none; -webkit-user-drag: none; }
#lbClose {
  position: absolute; top: 16px; right: 16px; z-index: 101;
  background: rgba(255,255,255,0.1); color: var(--ink);
  border: none; border-radius: 50%; width: 42px; height: 42px;
  font-size: 18px; cursor: pointer;
}
#lbHint {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  color: var(--ink-dim); font-size: 12px; z-index: 101;
  background: rgba(8,7,6,0.7); padding: 6px 14px; border-radius: 20px;
  pointer-events: none;
}

/* ── 대시보드 ── */
.dash { max-width: 680px; margin: 0 auto; padding: 90px 24px 100px; display: flex; flex-direction: column; gap: 28px; }
.dash-hero { text-align: center; padding: 20px 0 4px; }
.dash-hero h1 { font-family: var(--serif); font-size: clamp(26px, 5vw, 38px); margin-bottom: 8px; }
.dash-hero .dim { color: var(--ink-dim); font-size: 14.5px; }
.progress-wrap { margin: 22px auto 0; max-width: 420px; }
.progress-bar-lg { height: 10px; background: rgba(255,255,255,0.07); border-radius: 6px; overflow: hidden; }
.progress-bar-lg .fill { height: 100%; background: var(--accent); border-radius: 6px; transition: width .6s ease; }
.progress-label { margin-top: 8px; font-size: 12.5px; color: var(--ink-dim); letter-spacing: 0.05em; }

.week-label { color: var(--accent); font-size: 12.5px; letter-spacing: 0.2em; font-weight: 700; margin: 8px 0 -14px; }
.session-item {
  display: flex; align-items: center; gap: 16px;
  background: var(--bg-panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px 20px;
  text-decoration: none; transition: border-color .2s ease, transform .15s ease;
}
.session-item:hover { border-color: var(--accent); transform: translateY(-1px); }
.session-item.locked { opacity: 0.45; pointer-events: none; }
.session-item .status { font-size: 20px; width: 28px; text-align: center; flex-shrink: 0; }
.session-item .info { flex: 1; min-width: 0; }
.session-item .num { font-size: 11.5px; color: var(--ink-dim); letter-spacing: 0.1em; }
.session-item .name { font-family: var(--serif); font-size: 16px; }
.session-item .go { color: var(--ink-dim); font-size: 13px; }
.session-item.current { border-color: var(--accent); background: linear-gradient(135deg, var(--bg-panel), rgba(212,169,78,0.08)); }

.hint-list { display: flex; flex-direction: column; gap: 10px; }
.hint-item { display: flex; gap: 12px; font-size: 14.5px; align-items: baseline; }
.hint-item .n { color: var(--accent); font-weight: 700; font-size: 12.5px; flex-shrink: 0; width: 20px; }
.hint-item.locked-h { color: var(--ink-dim); opacity: 0.5; }
.hint-item .t { font-family: var(--serif); line-height: 1.7; }

/* ── 랜딩 ── */
.landing { max-width: 640px; margin: 0 auto; padding: 0 24px 60px; }
.landing .hero { min-height: 88vh; }

/* 히어로 배경 그림 */
.hero { position: relative; }
.hero-bg { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 100vw; height: 100%; overflow: hidden; z-index: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: center 28%; opacity: 0.33; }
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(20,18,16,0.5), rgba(20,18,16,0.35) 45%, var(--bg) 97%);
}
.hero > :not(.hero-bg) { position: relative; z-index: 1; }

/* 갤러리 스트립 */
.strip-title { text-align: center; color: var(--ink-dim); font-size: 13.5px; letter-spacing: 0.14em; margin-bottom: 18px; }
.gallery-row { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 14px; scroll-snap-type: x proximity; }
.gallery-row figure { flex: 0 0 150px; scroll-snap-align: center; margin: 0; }
.gallery-row img { width: 150px; height: 112px; object-fit: cover; border-radius: 8px; display: block; border: 1px solid var(--line); }
.gallery-row figcaption { font-size: 11px; color: var(--ink-dim); margin-top: 7px; text-align: center; }

/* 섹션 제목 */
.section-title { text-align: center; font-family: var(--serif); font-size: 22px; margin: 64px 0 22px; }

/* 4주 커리큘럼 */
.week-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 10px; }
.week-item { display: flex; gap: 18px; align-items: baseline; background: var(--bg-panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; }
.week-item .wk { font-family: var(--serif); color: var(--accent); font-size: 14px; white-space: nowrap; font-weight: 700; letter-spacing: 0.06em; }
.week-item .wt b { font-family: var(--serif); font-size: 16.5px; font-weight: 700; display: block; margin-bottom: 3px; }
.week-item .wt span { font-size: 13.5px; color: var(--ink-dim); }

/* FAQ */
.faq { display: flex; flex-direction: column; gap: 10px; }
.faq details { background: var(--bg-panel); border: 1px solid var(--line); border-radius: 12px; padding: 2px 20px; }
.faq summary { cursor: pointer; padding: 14px 0; font-size: 15px; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 20px; flex-shrink: 0; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--ink-dim); font-size: 14px; padding-bottom: 16px; line-height: 1.8; }

/* 푸터 */
.site-foot { text-align: center; color: var(--ink-dim); font-size: 12.5px; padding: 34px 0 20px; border-top: 1px solid var(--line); margin-top: 70px; line-height: 2; }
.site-foot a { color: var(--ink); text-decoration: none; }
.site-foot a:hover { color: var(--accent); }
.site-foot .biz { font-size: 11.5px; opacity: 0.85; margin-top: 10px; line-height: 1.9; }

/* 약관·방침 문서 페이지 */
.doc { max-width: 680px; margin: 0 auto; padding: 90px 24px 100px; }
.doc h1 { font-family: var(--serif); font-size: 28px; margin-bottom: 6px; }
.doc .doc-date { color: var(--ink-dim); font-size: 13px; margin-bottom: 30px; }
.doc h2 { font-family: var(--serif); font-size: 17.5px; margin: 30px 0 10px; color: var(--accent); }
.doc p, .doc li { font-size: 14.5px; color: var(--ink); line-height: 1.85; }
.doc ul { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.doc .doc-foot { margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--ink-dim); font-size: 13px; }

/* 동의 체크박스 */
.consent { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 18px; }
.consent label { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.consent input[type="checkbox"] { width: 17px; height: 17px; margin-top: 3px; accent-color: var(--accent); flex-shrink: 0; }
.consent a { color: var(--accent); }
.how { display: flex; flex-direction: column; gap: 20px; margin: 40px 0; }
.how .card { display: flex; gap: 18px; align-items: flex-start; }
.how .n { font-family: var(--serif); font-size: 28px; color: var(--accent); line-height: 1.2; }
.how .card h3 { font-size: 17px; margin-bottom: 4px; }
.how .card p { font-size: 14px; color: var(--ink-dim); }
.center { text-align: center; }

/* ── 데스크톱 ── */
@media (min-width: 900px) {
  .scrolly { display: grid; grid-template-columns: 1fr 1fr; }
  .artpane { height: 100vh; top: 0; padding-top: 0; border-bottom: none; border-right: 1px solid var(--line); }
  .artstage img { padding: 40px 40px 20px; }
  .textpane .step { padding: 42vh 48px; max-width: 560px; }
  .textpane .step:first-child { padding-top: 30vh; }
}
