/* VOICE   조용하고 다정한 웰니스 매거진의 디지털 한 페이지. 말수는 적게, 여백은 넉넉히.
   IDEA    종이 워크시트의 연장선. 손에 쥔 인쇄물처럼 고운 종이 위에 남색 활자가 놓인다.
   PICTURE 아쿠아 블루 입자가 아침 물결처럼 겹겹이 퍼지고 호흡하는 그레인 필드.
   COLOUR  종이 #F8F7F3 · 남색 #282F66 · 아쿠아 #88C4CF(그래픽·선택) · 옅은 아쿠아 #E0EEF0.
   TYPE    Pretendard 400/500/600 (영문·숫자 포함).
   LAYOUT  한 화면 한 질문. 460px 종이 한 장 폭의 단일 칼럼, 하단에 주요 버튼. */

@font-face { font-family: 'Pretendard'; font-weight: 400; font-display: swap; src: url('../fonts/Pretendard-Regular.subset.woff2') format('woff2'); }
@font-face { font-family: 'Pretendard'; font-weight: 500; font-display: swap; src: url('../fonts/Pretendard-Medium.subset.woff2') format('woff2'); }
@font-face { font-family: 'Pretendard'; font-weight: 600; font-display: swap; src: url('../fonts/Pretendard-SemiBold.subset.woff2') format('woff2'); }

:root {
  color-scheme: light;
  --bg: #F8F7F3;
  --ink: #282F66;
  --ink-2: rgba(40, 47, 102, .68);
  --ink-3: rgba(40, 47, 102, .44);
  --line: rgba(40, 47, 102, .16);
  --line-2: rgba(40, 47, 102, .32);
  --aqua: #88C4CF;
  --aqua-soft: #E0EEF0;
  --kr: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  --en: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', sans-serif;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --gut: max(24px, env(safe-area-inset-left, 0px));
  --tooth: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='420'%3E%3Cfilter id='t' x='0' y='0'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='9' stitchTiles='stitch' result='n'/%3E%3CfeDiffuseLighting in='n' surfaceScale='0.9' diffuseConstant='1' lighting-color='%23fff'%3E%3CfeDistantLight azimuth='60' elevation='68'/%3E%3C/feDiffuseLighting%3E%3CfeComponentTransfer%3E%3CfeFuncR type='linear' slope='0.14' intercept='0.860'/%3E%3CfeFuncG type='linear' slope='0.14' intercept='0.860'/%3E%3CfeFuncB type='linear' slope='0.14' intercept='0.852'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23t)'/%3E%3C/svg%3E");
  --mottle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='700' height='700'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.0045' numOctaves='4' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .5 0 0 0 0 .4 0 0 0 .09 -.028'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23m)'/%3E%3C/svg%3E");
  --fiber: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012 .55' numOctaves='2' seed='8' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .4 0 0 0 0 .38 0 0 0 0 .34 0 0 0 .06 -.026'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .16 0 0 0 0 .18 0 0 0 0 .3 0 0 0 .1 -.016'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme=dark], :root[data-theme=light] { color-scheme: light; }

* { box-sizing: border-box; min-width: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.6 var(--kr); letter-spacing: -0.01em;
  word-break: keep-all; overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overflow-x: clip;
}
/* 종이 질감 — 배경 레이어에만, 움직이지 않음 */
.paper { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: var(--tooth), var(--noise), var(--fiber), var(--mottle), var(--bg); background-blend-mode: multiply, normal, normal, normal; }
button, input { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 3px; }
.en { font-family: var(--en); font-weight: 400; letter-spacing: 0; font-feature-settings: 'tnum'; }

/* ---------- 프레임 ---------- */
.app { position: relative; z-index: 1; max-width: 460px; min-height: 100%; margin: 0 auto; }
.screen {
  display: none; flex-direction: column; min-height: 100svh; min-height: 100dvh;
  padding: max(16px, env(safe-area-inset-top, 0px)) var(--gut) 0;
}
.screen.on { display: flex; }
.screen.leave { opacity: 0; transform: translateY(-6px); transition: opacity 260ms var(--ease), transform 260ms var(--ease); }

.rv { opacity: 0; transform: translateY(7px); }
.screen.on .rv { animation: rise 440ms var(--ease) forwards; animation-delay: calc(var(--i, 0) * 70ms + 60ms); }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- 상단 ---------- */
.top { display: flex; align-items: center; justify-content: space-between; height: 48px; flex: none; }
.logo { display: block; width: 76px; height: 17px; color: var(--ink); }
.top .en { font-size: 13px; color: var(--ink-2); }
.back { display: grid; place-items: center; width: 44px; height: 44px; margin-left: -12px; color: var(--ink); }
.back svg { width: 20px; height: 20px; }
.step { font-size: 13px; color: var(--ink-2); }
.step b { font-weight: 500; color: var(--ink); }
.bar { height: 2px; background: var(--line); margin: 4px 0 0; flex: none; }
.bar i { display: block; height: 100%; width: 0; background: var(--ink); transition: width 700ms cubic-bezier(.33, 0, .2, 1); }
.bar i.still { transition: none; }

/* ---------- 타이포 ---------- */
h1, h2, h3, p { margin: 0; }
.lead { font-size: clamp(30px, 8.6vw, 36px); line-height: 1.32; font-weight: 600; letter-spacing: -0.035em; }
.q { font-size: clamp(25px, 7vw, 29px); line-height: 1.4; font-weight: 600; letter-spacing: -0.03em; margin-top: clamp(28px, 6vh, 48px); }
.sub { font-size: 15.5px; line-height: 1.65; color: var(--ink-2); margin-top: 14px; }
.ctx { display: inline-flex; gap: 8px; align-items: baseline; font-size: 14px; color: var(--ink-2); margin-top: clamp(24px, 5vh, 40px); }
.ctx b { font-weight: 500; color: var(--ink); }
.ctx + .q { margin-top: 10px; }

/* ---------- 인트로 ---------- */
.intro .lead { margin-top: clamp(18px, 3.5vh, 34px); font-weight: 600; }
.intro .sub { max-width: 21em; }
.fig { position: relative; flex: 1 1 auto; min-height: 260px; margin: 8px calc(var(--gut) * -1) 0; }
.fig canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.meta { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--ink-2); padding: 0 2px 12px; }

/* ---------- 하단 버튼 ---------- */
.foot {
  position: sticky; bottom: 0; margin-top: auto; z-index: 2;
  padding: 20px 0 max(20px, calc(env(safe-area-inset-bottom, 0px) + 12px));
}
.foot::before {
  content: ''; position: absolute; z-index: -1; inset: 0 calc(var(--gut) * -1);
  background: var(--tooth), var(--noise), var(--fiber), var(--mottle), var(--bg); background-blend-mode: multiply, normal, normal, normal;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 22px); mask-image: linear-gradient(to bottom, transparent, #000 22px);
}
.cta {
  display: flex; align-items: center; justify-content: space-between; width: 100%; height: 58px; padding: 0 22px;
  background: var(--ink); color: var(--bg); border-radius: 2px; font-size: 16px; font-weight: 500;
  transition: background 220ms var(--ease), color 220ms var(--ease), opacity 220ms var(--ease);
}
.cta svg { width: 22px; height: 12px; transition: transform 260ms var(--ease); }
.cta:not(:disabled):active svg { transform: translateX(4px); }
.cta:disabled { background: transparent; color: var(--ink-3); box-shadow: inset 0 0 0 1px var(--line); cursor: default; }
.ghost { display: block; width: 100%; height: 48px; margin-top: 6px; font-size: 14.5px; color: var(--ink-2); }

/* ---------- 선택지 ---------- */
.opts { display: grid; gap: 10px; margin-top: clamp(28px, 5vh, 40px); padding-bottom: max(32px, env(safe-area-inset-bottom, 0px)); }
.opts.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.opt {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  width: 100%; min-height: 60px; padding: 16px 18px; text-align: left;
  border: 1px solid var(--line-2); border-radius: 2px; background: rgba(248, 247, 243, .6);
  font-size: 16.5px; line-height: 1.5;
  transition: border-color 220ms var(--ease), background-color 220ms var(--ease);
}
.opt::after {
  content: ''; flex: none; width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid var(--line-2); transition: all 220ms var(--ease);
}
.opt[aria-checked=true] { border-color: var(--ink); background: var(--aqua-soft); }
.opt[aria-checked=true]::after { border-color: var(--ink); background: radial-gradient(circle, var(--ink) 0 3.5px, transparent 4px); }
@media (hover: hover) { .opt:hover { border-color: var(--ink); } }
.kw { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 6px; min-height: 104px; padding: 16px 16px 18px; }
.kw::after { position: absolute; top: 18px; right: 16px; width: 14px; height: 14px; }
.kw .k { font-size: 20px; font-weight: 500; letter-spacing: -0.03em; }
.kw .d { font-size: 13px; line-height: 1.5; color: var(--ink-2); padding-right: 6px; }
.lv .t { margin-left: auto; font-size: 14px; color: var(--ink-2); }
.lv .l { font-weight: 500; }

/* ---------- 전환 ---------- */
.pause { padding: 0; }
.pause .fig { position: absolute; inset: 0; margin: 0; }
.pause .words { position: relative; z-index: 1; margin-top: auto; padding: 0 var(--gut) 18vh; min-height: 9em; }
.pause .w { position: absolute; left: var(--gut); right: var(--gut); bottom: 22vh; font-size: 21px; line-height: 1.55; font-weight: 500; letter-spacing: -0.025em; text-align: center; opacity: 0; transition: opacity 900ms var(--ease); }
.pause .w.show { opacity: 1; }
.skip { position: absolute; z-index: 2; left: 50%; transform: translateX(-50%); bottom: max(20px, env(safe-area-inset-bottom, 0px)); height: 44px; padding: 0 16px; font-size: 13.5px; color: var(--ink-3); }

/* ---------- 추천 ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 14px; }
.tag { font-size: 14px; line-height: 1.5; color: var(--ink-3); white-space: nowrap; }
.tag.k { color: var(--ink); font-weight: 500; }
.list { display: grid; gap: 12px; margin-top: 26px; }
.rit {
  position: relative; display: block; width: 100%; text-align: left; padding: 18px 18px 20px; cursor: pointer;
  border: 1px solid var(--line-2); border-radius: 2px; background: rgba(248, 247, 243, .65);
  transition: border-color 240ms var(--ease), background-color 240ms var(--ease);
}
.rit[aria-checked=true] { border-color: var(--ink); background: var(--aqua-soft); }
@media (hover: hover) { .rit:hover { border-color: var(--ink); } }
.rit .hd { display: flex; align-items: center; justify-content: space-between; }
.rit .n { font-size: 13px; color: var(--ink-3); }
.rit h3 { margin-top: 10px; font-size: 20px; line-height: 1.45; font-weight: 500; letter-spacing: -0.03em; }
.pick {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: 2px; font-size: 13.5px; color: var(--ink-2); white-space: nowrap;
  transition: all 220ms var(--ease);
}
.pick svg { width: 11px; height: 11px; }
.rit[aria-checked=true] .pick { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.rit .how { margin-top: 8px; font-size: 15.5px; line-height: 1.7; color: var(--ink); }
.rit .dl { margin: 14px 0 0; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 16px 0 0 34px; font-size: 14px; line-height: 1.6; }
.dl dt { color: var(--ink-3); white-space: nowrap; }
.dl dd { margin: 0; color: var(--ink-2); }
.why { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line-2); font-size: 14px; line-height: 1.65; color: var(--ink-2); }
.why b { display: block; font-weight: 500; color: var(--ink); font-size: 13px; margin-bottom: 2px; }
.count { display: flex; justify-content: center; font-size: 13.5px; color: var(--ink-2); margin-bottom: 10px; }
.count .en { font-size: 15px; color: var(--ink); }
.count .en b { font-weight: 500; }

/* ---------- 나의 리추얼 ---------- */
.mine .lead { margin-top: clamp(28px, 6vh, 52px); }
.cards { margin-top: 28px; border-top: 1px solid var(--ink); }
.mi { padding: 20px 0 22px; border-bottom: 1px solid var(--line); }
.mi .hd { display: flex; align-items: center; gap: 14px; }
.mi .n { font-size: 13px; color: var(--ink-3); width: 20px; flex: none; }
.name {
  flex: 1; width: 100%; height: 44px; padding: 0 30px 0 0; border: 0; border-bottom: 1px solid var(--line-2); border-radius: 0;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23282F66' stroke-opacity='.5' stroke-width='1.1'%3E%3Cpath d='M10.5 2.5l3 3L6 13H3v-3z'/%3E%3C/svg%3E") no-repeat right 4px center / 15px;
  font-size: 19px; font-weight: 500; letter-spacing: -0.03em;
}
.name:focus { outline: none; border-bottom-color: var(--ink); }
.mi .dl { margin-left: 34px; margin-top: 14px; }
.hint { margin-top: 14px; font-size: 13.5px; color: var(--ink-3); }
.tools { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 26px; }
.line-btn { display: flex; align-items: center; justify-content: center; gap: 8px; height: 52px; border: 1px solid var(--ink); border-radius: 2px; font-size: 15px; font-weight: 500; }
.line-btn svg { width: 16px; height: 16px; }
.line-btn.soft { border-color: var(--line-2); font-weight: 400; color: var(--ink-2); }
.rm { flex: none; height: 44px; padding: 0 2px 0 8px; font-size: 13px; color: var(--ink-3); }
.note { margin-top: 36px; font-size: 16px; line-height: 1.75; }
.note b { font-weight: 500; }
.close { position: relative; margin: 30px calc(var(--gut) * -1) 0; height: 250px; }
.close canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.sign { position: absolute; left: 0; right: 0; bottom: 18px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.sign .letter { width: 132px; height: 70px; color: var(--ink); }
.sign .en { font-size: 12.5px; color: var(--ink-2); }
.restart { display: block; margin: 8px auto 0; height: 44px; padding: 0 12px; font-size: 13.5px; color: var(--ink-3); text-decoration: underline; text-underline-offset: 4px; }
.mine .pad { height: max(28px, env(safe-area-inset-bottom, 0px)); }

.edge {
  position: fixed; z-index: 3; left: 50%; bottom: 0; width: min(100%, 460px); transform: translateX(-50%);
  height: calc(96px + env(safe-area-inset-bottom, 0px)); pointer-events: none; opacity: 0; transition: opacity 320ms var(--ease);
  background: var(--tooth), var(--noise), var(--fiber), var(--mottle), var(--bg); background-blend-mode: multiply, normal, normal, normal;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  -webkit-mask-image: linear-gradient(to bottom, transparent, rgba(0,0,0,.75) 55%, #000); mask-image: linear-gradient(to bottom, transparent, rgba(0,0,0,.75) 55%, #000);
}
.edge.show { opacity: 1; }
.sample { font-size: 12.5px; color: var(--ink-3); margin-top: 14px; }

.toast {
  position: fixed; z-index: 10; left: 50%; bottom: max(28px, calc(env(safe-area-inset-bottom, 0px) + 20px)); transform: translate(-50%, 10px);
  padding: 12px 18px; background: var(--ink); color: var(--bg); font-size: 14px; border-radius: 2px; opacity: 0; pointer-events: none;
  transition: opacity 260ms var(--ease), transform 260ms var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 600px) {
  .app::before, .app::after { content: ''; position: fixed; top: 0; bottom: 0; width: 1px; background: var(--line); }
  .app::before { left: calc(50% - 254px); }
  .app::after { right: calc(50% - 254px); }
}
@media (prefers-reduced-motion: reduce) {
  .rv { opacity: 1; transform: none; }
  .screen.on .rv { animation: none; }
  .screen.leave { transition: none; }
  .pause .w { transition: opacity 200ms linear; }
}
