/* ============================================================
   Ashtanga Shala — Design System
   ------------------------------------------------------------
   콘셉트: 밝고 중립적인 도구 화면.
     · 표면 — 서늘한 회백색 바탕 위에 흰 카드가 뜬다
     · 강조 — 하나의 파랑. 나머지는 전부 중성 회색
     · 활자 — 기하학적 산세리프 표제 + Pretendard 본문
   토큰은 전부 의미 기반(bg / surface / ink / line / accent)이며
   라이트·다크 두 팔레트가 동일한 이름을 채운다.
   ============================================================ */

/* ============================================================
   1. 토큰
   ============================================================ */
:root {
  /* --- 표면 --- */
  --bg:          #F8FAFC;   /* 페이지 바탕 */
  --bg-sub:      #F1F5F9;   /* 푸터·드로어·구분 띠 */
  --bg-inset:    #E2E8F0;   /* 눌린 면, 셀 호버 */
  --surface:     #FFFFFF;   /* 카드 */
  --surface-2:   #F8FAFC;   /* 카드 안쪽 강조 */

  /* --- 글자 --- */
  --ink:         #0F172A;
  --ink-2:       #475569;
  --muted:       #64748B;

  /* --- 선 --- */
  --line:        #E2E8F0;
  --line-soft:   #F1F5F9;

  /* --- 파랑(강조) --- */
  --accent:      #2563EB;   /* 도형·그래프 채움 */
  --accent-ink:  #1D4ED8;   /* 배경 위 글자 (AA 6.3:1) */
  --accent-deep: #2563EB;   /* 채운 버튼 배경 */
  --accent-on:   #FFFFFF;   /* 채운 버튼 글자 */
  --accent-soft: #EFF6FF;   /* 옅은 틴트 */
  --accent-line: #BFDBFE;

  /* --- 보조 색 --- */
  --clay:        #DC2626;   /* 경고·삭제 */
  --indigo:      #4F46E5;
  --sage:        #16A34A;

  /* --- 레벨(난이도) 스케일 — 초록에서 빨강으로 --- */
  --lv-1: #16A34A;
  --lv-2: #65A30D;
  --lv-3: #CA8A04;
  --lv-4: #EA580C;
  --lv-5: #DC2626;

  /* --- 그림자 — 서늘한 회색 --- */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 12px -6px rgba(15, 23, 42, .12);
  --shadow-md: 0 1px 3px rgba(15, 23, 42, .07), 0 12px 28px -12px rgba(15, 23, 42, .16);
  --shadow-lg: 0 2px 6px rgba(15, 23, 42, .08), 0 24px 52px -24px rgba(15, 23, 42, .24);

  /* --- 반경 --- */
  --r-xs:   6px;
  --r-sm:  10px;
  --r-md:  14px;
  --r-lg:  18px;
  --r-pill: 999px;

  /* --- 지면 --- */
  --maxw: 1160px;
  --gutter: clamp(1.15rem, 3.4vw, 2.25rem);

  /* --- 서체 --- */
  --font-display: "Plus Jakarta Sans", "Pretendard Variable", Pretendard,
                  "Noto Sans JP", "Noto Sans SC", "Noto Sans Devanagari", "Noto Sans Arabic",
                  "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --font-body: "Pretendard Variable", Pretendard,
               "Noto Sans JP", "Noto Sans SC", "Noto Sans Devanagari", "Noto Sans Arabic",
               "Apple SD Gothic Neo", "Malgun Gothic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  /* --- 타이포 스케일 --- */
  --fs-2xs:  .6875rem;
  --fs-xs:   .75rem;
  --fs-sm:   .8125rem;
  --fs-md:   .875rem;
  --fs-base: clamp(.9375rem, .9rem + .16vw, 1rem);
  --fs-lg:   1rem;
  --fs-xl:   1.25rem;

  --lh-tight: 1.18;
  --lh-snug:  1.45;
  --lh-body:  1.62;

  --tracking-label: .06em;

  /* --- 모션 --- */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --dur: .18s;
}

/* --- 다크 팔레트 --- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          #0B1120;
    --bg-sub:      #111A2E;
    --bg-inset:    #1E293B;
    --surface:     #151E31;
    --surface-2:   #1B2740;

    --ink:         #F1F5F9;
    --ink-2:       #CBD5E1;
    --muted:       #94A3B8;

    --line:        #2B3A52;
    --line-soft:   #1E293B;

    --accent:      #3B82F6;
    --accent-ink:  #93C5FD;
    --accent-deep: #2563EB;
    --accent-on:   #FFFFFF;
    --accent-soft: #172554;
    --accent-line: #1E3A8A;

    --clay:        #F87171;
    --indigo:      #818CF8;
    --sage:        #4ADE80;

    --lv-1: #4ADE80;
    --lv-2: #A3E635;
    --lv-3: #FACC15;
    --lv-4: #FB923C;
    --lv-5: #F87171;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5), 0 4px 12px -6px rgba(0, 0, 0, .7);
    --shadow-md: 0 1px 3px rgba(0, 0, 0, .55), 0 12px 28px -12px rgba(0, 0, 0, .8);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, .6), 0 24px 52px -24px rgba(0, 0, 0, .95);
  }
}
:root[data-theme="dark"] {
  --bg:          #0B1120;
  --bg-sub:      #111A2E;
  --bg-inset:    #1E293B;
  --surface:     #151E31;
  --surface-2:   #1B2740;

  --ink:         #F1F5F9;
  --ink-2:       #CBD5E1;
  --muted:       #94A3B8;

  --line:        #2B3A52;
  --line-soft:   #1E293B;

  --accent:      #3B82F6;
  --accent-ink:  #93C5FD;
  --accent-deep: #2563EB;
  --accent-on:   #FFFFFF;
  --accent-soft: #172554;
  --accent-line: #1E3A8A;

  --clay:        #F87171;
  --indigo:      #818CF8;
  --sage:        #4ADE80;

  --lv-1: #4ADE80;
  --lv-2: #A3E635;
  --lv-3: #FACC15;
  --lv-4: #FB923C;
  --lv-5: #F87171;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5), 0 4px 12px -6px rgba(0, 0, 0, .7);
  --shadow-md: 0 1px 3px rgba(0, 0, 0, .55), 0 12px 28px -12px rgba(0, 0, 0, .8);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .6), 0 24px 52px -24px rgba(0, 0, 0, .95);
}

/* ============================================================
   2. 리셋 · 기본
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--line) transparent;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: var(--lh-body);
  letter-spacing: -.006em;
  /* 한글은 기본값이면 음절 단위로 아무 데서나 끊긴다("수리/야 나마스카라").
     keep-all 로 띄어쓰기에서만 줄을 바꾸고, 끊을 데가 없는 긴 문자열만 예외로 쪼갠다. */
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* 테마를 바꾸는 두 프레임 동안만 모든 전환을 끈다.
   호버용 transition 들이 테마 전환에도 걸려 요소마다 제각각 늦게 따라오면
   화면이 한 박자 늦게 바뀌는 것처럼 보인다. app.js 의 applyTheme() 이 붙였다 뗀다. */
.theme-switching, .theme-switching *,
.theme-switching *::before, .theme-switching *::after {
  transition: none !important;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: none; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; list-style: none; }
b, strong { font-weight: 600; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: -.022em;
  margin: 0;
  text-wrap: balance;
}

::selection { background: var(--accent-soft); color: var(--accent-ink); }

:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* left: -9999px 로 숨기면 RTL 에서는 그 방향이 '끝'이 되어 스크롤 가능한
   오버플로가 된다(아랍어에서 화면이 통째로 비어 보였던 원인).
   방향에 의존하지 않는 clip 방식으로 숨긴다. */
.skip-link {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.skip-link:focus {
  position: fixed; inset-inline-start: 10px; top: 10px; z-index: 100;
  width: auto; height: auto; margin: 0; overflow: visible; clip-path: none;
  background: var(--ink); color: var(--bg);
  padding: .7rem 1.1rem; border-radius: var(--r-sm);
  font-size: var(--fs-md);
}

/* 숫자는 어디서나 자리폭이 같아야 표가 흔들리지 않는다 */
.stat-value, .timer, .pr-breath, .grp-count, .pose-num, .cc-num,
.rec-date, .rec-min, .stage-num, .ws-m, .ring-num, .pr-progress small {
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   3. 헤더 · 내비게이션
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
body.scrolled .site-header {
  border-bottom-color: var(--line-soft);
  box-shadow: 0 1px 24px -16px rgba(30, 20, 5, .6);
}

.header-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: .7rem var(--gutter);
  display: flex; align-items: center; gap: .9rem;
}

.brand { display: flex; align-items: center; gap: .7rem; flex-shrink: 0; }
.brand-mark {
  width: 34px; height: 34px; color: var(--accent);
  transition: transform .7s var(--ease-out);
}
.brand:hover .brand-mark { transform: rotate(160deg); }
.brand-mark svg { width: 100%; height: 100%; }
.brand-text strong {
  display: block; font-family: var(--font-display);
  font-size: 1.06rem; font-weight: 600; line-height: 1.15; letter-spacing: -.02em;
}
.brand-text small {
  display: block; font-size: .5625rem; font-weight: 500;
  letter-spacing: .24em; color: var(--muted); margin-top: .12rem;
}

.nav { display: flex; gap: .05rem; margin-left: auto; flex-wrap: nowrap; }
.nav a {
  position: relative; white-space: nowrap;
  padding: .42rem .52rem; border-radius: var(--r-sm);
  font-size: var(--fs-md); font-weight: 500; color: var(--ink-2);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.nav a::after {
  content: ""; position: absolute; left: 50%; right: 50%; bottom: .2rem;
  height: 1.5px; border-radius: 2px; background: var(--accent);
  transition: left .28s var(--ease-out), right .28s var(--ease-out), opacity .2s;
  opacity: 0;
}
.nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 4%, transparent); }
.nav a:hover::after, .nav a.on::after { left: .52rem; right: .52rem; opacity: 1; }
.nav a.on { color: var(--accent-ink); }

.header-actions { display: flex; gap: .4rem; align-items: center; }

/* --- 언어 선택기 --- */
.lang-picker { position: relative; }
.lang-btn {
  display: inline-flex; align-items: center; gap: .4rem; cursor: pointer;
  height: 36px; padding: 0 .6rem 0 .55rem;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink-2);
  font-size: var(--fs-md); font-weight: 600;
  transition: border-color var(--dur), background var(--dur), color var(--dur);
}
.lang-btn:hover { border-color: var(--accent-line); color: var(--accent-ink); }
.lang-picker.open .lang-btn { border-color: var(--accent); color: var(--accent-ink); }
.lang-cc {
  font-family: var(--font-mono); font-size: .625rem; font-weight: 500;
  letter-spacing: .02em; color: var(--muted); text-transform: uppercase;
}
.lang-btn .lang-name { white-space: nowrap; }
.lang-caret { color: var(--muted); transition: transform .2s var(--ease); }
.lang-picker.open .lang-caret { transform: rotate(180deg); }

.lang-menu {
  position: absolute; top: calc(100% + .45rem); inset-inline-end: 0; z-index: 50;
  min-width: 15rem; padding: .35rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .16s var(--ease), transform .16s var(--ease), visibility .16s;
}
.lang-picker.open .lang-menu { opacity: 1; visibility: visible; transform: none; }

.lang-head {
  display: flex; align-items: center; gap: .4rem;
  padding: .5rem .6rem .45rem; color: var(--muted);
  font-size: var(--fs-2xs); font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
}

.lang-item {
  width: 100%; display: grid; grid-template-columns: 1.6rem 1fr auto;
  align-items: center; gap: .55rem; cursor: pointer;
  padding: .5rem .6rem; border-radius: var(--r-sm);
  font-size: var(--fs-lg); color: var(--ink); text-align: start;
  transition: background var(--dur);
}
.lang-item:hover { background: var(--bg-sub); }
.lang-item.on { color: var(--accent-ink); font-weight: 600; }
.lang-item .lang-check { color: var(--accent); font-weight: 700; }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: .7rem; font-weight: 600; letter-spacing: .04em; color: var(--ink-2);
  transition: border-color var(--dur), color var(--dur), background var(--dur), transform var(--dur);
}
.icon-btn:hover { border-color: var(--accent-line); color: var(--accent-ink); background: var(--surface); }
.icon-btn:active { transform: scale(.94); }
.menu-btn { display: none; }

/* --- 모바일 드로어 --- */
.drawer {
  /* 닫힌 패널이 화면 밖으로 밀려나 문서 오버플로를 만들지 않도록 잘라낸다 */
  overflow: hidden;
  position: fixed; inset: 0; z-index: 45;
  background: rgba(20, 15, 8, .45); backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity .28s var(--ease);
}
.drawer.open { opacity: 1; pointer-events: auto; }
.drawer-nav {
  position: absolute; right: 0; top: 0; bottom: 0; width: min(80vw, 310px);
  background: var(--bg); border-left: 1px solid var(--line);
  padding: 5.2rem 1.25rem 2rem; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateX(100%); transition: transform .32s var(--ease-out);
}
.drawer.open .drawer-nav { transform: none; }
.drawer-nav a {
  padding: .85rem .5rem; border-bottom: 1px solid var(--line-soft);
  font-family: var(--font-display); font-size: 1.05rem; font-weight: 500;
  transition: color var(--dur), padding-left var(--dur) var(--ease);
}
.drawer-nav a:hover { padding-left: .9rem; color: var(--accent-ink); }
.drawer-nav a.on { color: var(--accent-ink); }

/* ============================================================
   4. 레이아웃 · 제목
   ============================================================ */
/* 전면 폭 그리드 — 기본은 가운데 본문 열, .bleed 를 붙인 섹션만 화면 끝까지 넓어져
   자기 배경색을 깐다. vw 를 쓰지 않으므로 스크롤바 폭 때문에 가로 스크롤이 생기지 않는다. */
.main {
  --content: min(var(--maxw), 100% - var(--gutter) * 2);
  display: grid;
  grid-template-columns:
    [full-start] minmax(0, 1fr)
    [content-start] var(--content) [content-end]
    minmax(0, 1fr) [full-end];
  align-content: start;
  padding: 0 0 2.5rem;
  min-height: 64vh;
}
.main > * { grid-column: content; }
.main > .bleed,
.main > .page-head {
  grid-column: full;
  /* 안쪽 여백이 본문을 다시 maxw 로 가둔다 */
  padding-inline: max(var(--gutter), (100% - var(--maxw)) / 2);
}

.band { margin-top: clamp(1.4rem, 2.6vw, 2.2rem); }

/* 각 페이지가 열리는 머리 띠 — 부드러운 사프란 기운이 위에서 아래로 빠진다 */
.page-head {
  padding-block: clamp(1.2rem, 2.5vw, 1.8rem) clamp(1.1rem, 2vw, 1.5rem);
  margin-bottom: clamp(1rem, 2vw, 1.4rem);
  background:
    radial-gradient(64% 130% at 10% 0%, color-mix(in srgb, var(--accent) 11%, transparent), transparent 68%),
    linear-gradient(180deg, var(--bg-sub), var(--bg));
  border-bottom: 1px solid var(--line-soft);
}
.page-head .lede { max-width: 62ch; }

/* 색을 깐 구획 띠 */
.band.bleed {
  margin-top: clamp(1.4rem, 2.6vw, 2.2rem);
  padding-block: clamp(1.4rem, 2.5vw, 2.1rem);
  background: var(--bg-sub);
  border-block: 1px solid var(--line-soft);
}

.main > .back-link { justify-self: start; margin: clamp(.8rem, 1.6vw, 1.2rem) 0 .3rem; }

.display {
  font-size: clamp(2.1rem, 5vw, 3.35rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.038em;
}
.display.sm { font-size: clamp(1.65rem, 3vw, 2.15rem); font-weight: 800; letter-spacing: -.032em; }

.lede {
  color: var(--ink-2);
  font-size: var(--fs-lg);
  line-height: var(--lh-body);
  margin-top: .85rem;
  text-wrap: pretty;
}

.sec-title {
  display: flex; align-items: center; gap: 1.1rem;
  font-family: var(--font-body); font-size: var(--fs-xs); font-weight: 600;
  letter-spacing: var(--tracking-label); text-transform: uppercase;
  color: var(--muted); margin-bottom: .75rem;
}
.sec-title span { flex-shrink: 0; }
.sec-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.sec-sub { color: var(--muted); font-size: var(--fs-md); margin: -.5rem 0 .75rem; max-width: 62ch; }

.mini-title {
  font-family: var(--font-body); font-size: var(--fs-2xs); font-weight: 600;
  letter-spacing: var(--tracking-label); text-transform: uppercase;
  color: var(--muted); margin: 0 0 .38rem;
}

.empty {
  color: var(--muted); text-align: center; padding: 1.6rem 1.2rem;
  border: 1px dashed var(--line); border-radius: var(--r-md);
  font-size: var(--fs-md);
}
.empty.sm { padding: .3rem 0 .1rem; border: none; text-align: left; }

.fine-print { color: var(--muted); font-size: var(--fs-xs); margin-top: 1.1rem; line-height: 1.65; }

.back-link {
  display: inline-flex; align-items: center; gap: .35rem;
  color: var(--muted); font-size: var(--fs-md);
  transition: color var(--dur), gap var(--dur) var(--ease);
}
.back-link:hover { color: var(--accent-ink); gap: .55rem; }

/* 카드 면 — 사이트 전체가 이 한 가지 표면 규칙을 공유한다 */
.surface {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
}
.lift { transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease); }
.lift:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); border-color: var(--accent-line); }

/* ============================================================
   5. 버튼 · 폼
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .72rem 1.35rem; border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-size: var(--fs-md); font-weight: 600; letter-spacing: -.005em;
  cursor: pointer; white-space: nowrap;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
              border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
              transform .12s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn.sm { padding: .45rem .85rem; font-size: var(--fs-sm); border-radius: var(--r-xs); }

.btn-primary { background: var(--ink); color: var(--bg); box-shadow: var(--shadow-xs); }
.btn-primary:hover { background: var(--accent-deep); color: var(--accent-on); box-shadow: var(--shadow-sm); }

.btn-solid { background: var(--accent-deep); color: var(--accent-on); box-shadow: var(--shadow-xs); }
.btn-solid:hover { background: color-mix(in srgb, var(--accent-deep) 86%, var(--ink)); box-shadow: var(--shadow-sm); }

.btn-ghost { border-color: var(--line); color: var(--ink-2); background: var(--surface); }
.btn-ghost:hover { border-color: var(--accent-line); color: var(--accent-ink); background: var(--accent-soft); }

.btn-danger { border-color: color-mix(in srgb, var(--clay) 45%, transparent); color: var(--clay); }
.btn-danger:hover { background: var(--clay); color: #fff; border-color: var(--clay); }

.btn.disabled, .btn[disabled] { opacity: .4; cursor: not-allowed; box-shadow: none; }
.btn.disabled:hover, .btn[disabled]:hover { background: inherit; }

.btn-col { display: flex; flex-direction: column; gap: .55rem; }
.file-btn { cursor: pointer; }

.link-btn {
  color: var(--muted); font-size: var(--fs-xs); cursor: pointer; margin-left: auto;
  padding: .2rem .3rem; border-radius: var(--r-xs);
  transition: color var(--dur);
}
.link-btn:hover { color: var(--clay); }

.input, .select {
  width: 100%; padding: .62rem .8rem;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: var(--fs-md);
  transition: border-color var(--dur), box-shadow var(--dur), background var(--dur);
}
.input::placeholder { color: var(--muted); }
.input:hover, .select:hover { border-color: var(--accent-line); }
.input:focus, .select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
textarea.input { resize: vertical; line-height: 1.65; }

.select {
  appearance: none;
  padding-right: 2.1rem;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 1.05rem center, right .78rem center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

.field { display: block; margin-bottom: 1rem; }
.field > span {
  display: block; font-size: var(--fs-2xs); font-weight: 600;
  letter-spacing: var(--tracking-label); text-transform: uppercase;
  color: var(--muted); margin-bottom: .4rem;
}
.check {
  display: flex; align-items: center; gap: .55rem;
  font-size: var(--fs-md); margin: .3rem 0 1.1rem; cursor: pointer;
}
.check input { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }

.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-pill);
  padding: .38rem .95rem; font-size: var(--fs-sm); font-weight: 500;
  color: var(--ink-2); cursor: pointer;
  transition: background var(--dur), color var(--dur), border-color var(--dur);
}
.chip:hover { border-color: var(--accent-line); color: var(--accent-ink); }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.filter-bar {
  display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
  padding: .25rem .85rem;
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r-lg); box-shadow: var(--shadow-xs);
  margin-bottom: 1.1rem;
}
.filter-right { display: flex; gap: .5rem; margin-left: auto; }
.filter-right .select { width: auto; }
.filter-right .input { width: min(250px, 46vw); }

/* ============================================================
   6. 도해(圖解) · 사진
   ============================================================ */
/* 도판 프레임 — 안의 사진/선화를 절대 배치해 프레임의 aspect-ratio 가 항상 이긴다.
   (흐름 배치로 두면 사진의 고유 높이가 프레임을 밀어내 카드마다 높이가 달라진다) */
.fig-box { position: relative; }
.fig-box > .asana-fig,
.fig-box > .asana-photo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  padding: var(--fig-pad, 0);
}
.asana-fig { width: 100%; height: 100%; display: block; overflow: visible; }

/* 사진 — 출처가 제각각이므로 톤을 통일해 '종이에 인쇄된 도판'처럼 보이게 한다.
   object-fit: contain — 자세가 잘리면 자료로서 쓸모가 없으므로 전체를 보여준다. */
.asana-photo {
  width: 100%; height: 100%; object-fit: contain; border-radius: var(--r-xs);
  filter: grayscale(1) sepia(.18) contrast(1.05);
  mix-blend-mode: multiply;                     /* 흰 배경이 종이에 녹아든다 */
  transition: filter .45s var(--ease);
}
.pose-card:hover .asana-photo,
.chart-cell:hover .asana-photo,
.pd-left:hover .asana-photo { filter: grayscale(.12) sepia(.04) contrast(1.02); }

:root[data-theme="dark"] .asana-photo {
  mix-blend-mode: normal;
  filter: grayscale(1) sepia(.12) contrast(1.02) brightness(.84);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .asana-photo {
    mix-blend-mode: normal;
    filter: grayscale(1) sepia(.12) contrast(1.02) brightness(.84);
  }
}
.photo-credit {
  font-size: var(--fs-2xs); color: var(--muted); margin-top: .85rem; line-height: 1.55;
  display: flex; gap: .35rem; flex-wrap: wrap; align-items: baseline;
}
.photo-credit a { text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--line); }
.photo-credit a:hover { color: var(--accent-ink); text-decoration-color: currentColor; }

/* 선화(線畫) */
/* 엔소(円相)는 이번 디자인에서 쓰지 않는다. figure.js 가 계속 그리므로 여기서 숨긴다. */
.fig-enso { display: none; }
/* ---- 선화 도해 ----
   실루엣(꽉 채운 덩어리)도 만들어 봤지만 이 데이터로는 쓸 수 없었다.
   관절 좌표 13개는 자세를 '암시'하는 도식이라, 두껍게 채우면 인체가 아니라
   글자처럼 읽힌다(마리챠아사나 B → 「4」, 우파비스타 코나아사나 B → 「W」).
   가는 선으로 그리면 도해로 읽히므로 이쪽을 유지한다.
   대신 마디별 굵기·손·발·곡선 몸통은 살려서 막대 인간보다는 사람에 가깝다.
   굵기는 --fw 하나로 한꺼번에 조절한다(도판이 커질수록 얇게). */
.asana-fig { --fw: 1; }
.fig-ground { stroke: var(--line); stroke-width: .8; stroke-dasharray: 2 2.5; }

.fig-limb {
  fill: none; stroke: var(--ink);
  stroke-linecap: round; stroke-linejoin: round;
  stroke-width: calc(var(--fw) * 5);
}
.fig-limb.seg-thigh    { stroke-width: calc(var(--fw) * 7.2); }
.fig-limb.seg-shin     { stroke-width: calc(var(--fw) * 5.4); }
.fig-limb.seg-arm      { stroke-width: calc(var(--fw) * 5);   }
.fig-limb.seg-forearm  { stroke-width: calc(var(--fw) * 4.2); }
.fig-limb.seg-neck     { stroke-width: calc(var(--fw) * 4.6); }

.fig-torso, .fig-head, .fig-hand, .fig-foot { fill: var(--ink); }

/* 실루엣은 한 가지 색이어야 한다. 먼 쪽 팔다리에 투명도를 주면
   겹치는 자리에 경계선이 생겨 덩어리가 갈라져 보인다. */
.fig-far { opacity: 1; }

/* 도판이 커질수록 몸이 가늘어 보이도록 굵기를 함께 줄인다 */
.fig-lg .asana-fig   { --fw: .8; }
.hero-ink .asana-fig { --fw: .85; }


/* ============================================================
   7. 히어로
   ============================================================ */
.hero {
  display: grid; grid-template-columns: 1.1fr .9fr;
  gap: clamp(1.6rem, 4vw, 3.6rem); align-items: center;
  padding-block: clamp(1.2rem, 2.4vw, 2rem) clamp(1.2rem, 2.4vw, 2.2rem);
  background:
    radial-gradient(58% 90% at 76% 28%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 68%),
    radial-gradient(52% 84% at 6% 92%, color-mix(in srgb, var(--indigo) 11%, transparent), transparent 70%),
    linear-gradient(180deg, var(--bg-sub), var(--bg));
  border-bottom: 1px solid var(--line-soft);
}
.hero-body { max-width: 37rem; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .7rem;
  font-size: var(--fs-2xs); font-weight: 600; letter-spacing: .26em;
  text-transform: uppercase; color: var(--accent-ink); margin-bottom: .7rem;
}
.eyebrow::before {
  content: ""; width: 1.9rem; height: 1px; background: var(--accent);
}

.hero .display { margin-bottom: .7rem; }
.hero-cta { display: flex; gap: .7rem; margin-top: 1rem; flex-wrap: wrap; }

.hero-quote {
  margin: 1.4rem 0 0; padding-left: 1.25rem;
  border-left: 2px solid var(--accent);
  font-family: var(--font-body); font-size: 1rem; font-weight: 500;
  line-height: 1.6; color: var(--ink-2);
}
.hero-quote cite {
  display: block; font-family: var(--font-body); font-style: normal;
  font-size: var(--fs-sm); color: var(--muted); margin-top: .5rem;
}

.hero-ink {
  position: relative; width: 100%; max-width: 400px;
  aspect-ratio: 1; margin-inline: auto;
}
.hero-ink .asana-fig { position: absolute; inset: 0; width: 100%; height: 100%; }


/* ============================================================
   8. 통계 카드
   ============================================================ */
.stat-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
  gap: .75rem; margin-bottom: 1.1rem;
}
.stat-row:last-child {
  margin-bottom: 0;
}
.stat-card {
  display: flex; gap: .9rem; align-items: center;
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r-lg); padding: .25rem 1.1rem;
  box-shadow: var(--shadow-xs);
  transition: border-color .25s var(--ease), transform .25s var(--ease),
              box-shadow .25s var(--ease);
}
a.stat-card:hover {
  border-color: var(--accent-line); transform: translateY(-3px); box-shadow: var(--shadow-sm);
}
/* 이모지 아이콘은 그대로 두되, 색 원반에 앉혀 클립아트가 아니라 기호로 읽히게 한다 */
.stat-icon {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); font-size: 1.05rem; line-height: 1;
}
.stat-label {
  display: block; font-size: var(--fs-2xs); font-weight: 600;
  letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--muted);
}
.stat-value {
  display: block; font-family: var(--font-display); font-weight: 700;
  font-size: 1.5rem; line-height: 1.2; letter-spacing: -.03em; white-space: nowrap;
  margin-top: .1rem;
}
/* 자세 이름은 길어서 한 줄에 안 들어간다 — 여기서만 줄바꿈을 허용한다 */
.stat-value.sm { font-size: 1.02rem; white-space: normal; line-height: 1.35; }
.stat-value em {
  font-style: normal; font-family: var(--font-body);
  font-size: var(--fs-sm); font-weight: 500; color: var(--muted); margin-left: .25rem;
}
.stat-sub { font-size: var(--fs-xs); color: var(--muted); }
/* 도해도 아이콘과 같은 원반에 앉혀 통계 카드의 왼쪽 열을 맞춘다 */
.stat-fig {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%;
  background: var(--bg-sub); display: grid; place-items: center; overflow: hidden;
}
.stat-fig .asana-fig { padding: 3px; }
.next-pose { align-items: center; }

/* ============================================================
   9. 필러 · 여덟 가지
   ============================================================ */
.pillar-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(228px, 1fr)); gap: .6rem 1rem; }
.pillar {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r-lg); padding: .31rem 1.3rem; box-shadow: var(--shadow-xs);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.pillar:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); border-color: var(--accent-line); }
.pillar-num {
  font-family: var(--font-mono); font-size: var(--fs-xs);
  color: var(--accent-ink); letter-spacing: .1em;
}
.pillar h3 { font-size: 1.22rem; margin: .22rem 0 .25rem; }
.pillar p { font-size: var(--fs-md); color: var(--ink-2); line-height: 1.6; }

.limbs {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(258px, 1fr));
  border-top: 1px solid var(--line-soft);
}
.limbs li {
  display: grid; grid-template-columns: 2.1rem 1fr; gap: .15rem .85rem;
  padding: 1.05rem .8rem; border-bottom: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  align-items: baseline; transition: background .3s var(--ease);
}
.limbs li:hover { background: var(--surface); }
.limbs .limb-i {
  grid-row: span 3; font-family: var(--font-display); font-weight: 400;
  font-size: 1.6rem; color: var(--line); line-height: 1;
}
.limbs li.on { background: var(--accent-soft); }
.limbs li.on .limb-i { color: var(--accent); }
.limbs strong { font-family: var(--font-display); font-size: 1.04rem; font-weight: 600; }
.limbs em {
  font-style: normal; font-size: var(--fs-2xs); font-weight: 600;
  letter-spacing: .16em; color: var(--accent-ink); text-transform: uppercase;
}
.limbs li > span:last-child { font-size: var(--fs-sm); color: var(--muted); line-height: 1.6; }

/* ============================================================
   10. 시퀀스
   ============================================================ */
.grp-block { margin-bottom: 1.8rem; }
.grp-head {
  margin-bottom: .8rem; padding-bottom: .55rem; border-bottom: 1px solid var(--line);
  display: grid; grid-template-columns: 1fr auto; gap: .25rem .9rem; align-items: baseline;
}
.grp-head h2 { font-size: 1.55rem; }
.grp-head p {
  grid-column: 1 / -1; font-size: var(--fs-md); color: var(--muted);
  max-width: 62ch; margin-top: .35rem;
}
.grp-count {
  font-family: var(--font-mono); font-size: var(--fs-xs);
  color: var(--muted); white-space: nowrap;
}

.pose-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(184px, 1fr)); gap: .5rem .8rem; }
.pose-card {
  position: relative; display: flex; flex-direction: column; gap: .42rem;
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r-lg); padding: .25rem .8rem .25rem;
  box-shadow: var(--shadow-xs);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.pose-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); border-color: var(--accent-line); }
/* 도판은 자기 판 위에 앉는다 — 출처가 제각각인 사진들이 하나의 톤으로 묶인다 */
.pose-card .fig-box {
  aspect-ratio: 1 / .84; --fig-pad: .45rem;
  background: var(--bg-sub); border-radius: var(--r-md);
}
.pose-card .pose-num { order: -1; }
.pose-num {
  font-family: var(--font-mono); font-size: var(--fs-2xs);
  color: var(--accent-ink); letter-spacing: .1em;
}
.pose-num.big { font-size: var(--fs-sm); }
.pose-meta strong {
  display: block; font-family: var(--font-display);
  font-size: .97rem; font-weight: 600; line-height: 1.35; letter-spacing: -.01em;
}
.pose-meta em {
  display: block; font-style: normal;
  font-size: var(--fs-xs); color: var(--muted); margin-top: .15rem;
}
.pose-tags {
  display: flex; align-items: center; gap: .45rem; margin-top: .55rem;
  font-size: var(--fs-2xs); color: var(--muted);
}

.lv-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.lv1 { background: var(--lv-1); }
.lv2 { background: var(--lv-2); }
.lv3 { background: var(--lv-3); }
.lv4 { background: var(--lv-4); }
.lv5 { background: var(--lv-5); }

.mst { display: inline-flex; gap: 2px; margin-left: auto; }
.mst i { width: 9px; height: 3px; background: var(--line); border-radius: 2px; }
.mst.m1 i:nth-child(1), .mst.m2 i:nth-child(-n+2), .mst.m3 i { background: var(--accent); }

/* ============================================================
   11. 시퀀스 차트 (포스터형 · 인쇄용)
   ============================================================ */
/* 제목은 한 줄을 온전히 쓰고, 리드문과 인쇄 버튼이 그 아래 한 줄을 나눈다 */
.chart-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .7rem 1.5rem; }
.chart-head .display { flex: 1 0 100%; }
/* margin-left:auto 를 쓰면 auto 마진이 여유 공간을 먼저 먹어 lede 의 flex-grow 가 죽는다.
   lede 를 키워 버튼을 오른쪽 끝으로 미는 편이 안전하다. */
.chart-head .lede { flex: 1 1 18rem; margin-top: 0; }
.chart-head .btn { flex: 0 0 auto; }

/* 시트는 색을 깐 판 — 그 위에 흰 카드가 떠서 나머지 페이지와 같은 규칙을 따른다 */
.chart-sheet {
  background: var(--bg-sub); border: 1px solid var(--line-soft);
  border-radius: var(--r-lg); padding: clamp(1.1rem, 3vw, 2.2rem);
}
.chart-block + .chart-block { margin-top: 1.2rem; }
.chart-h {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--font-body); font-size: var(--fs-xs); font-weight: 600;
  letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--accent-ink);
  border-bottom: 1px solid var(--line); padding-bottom: .5rem; margin-bottom: 1rem;
}
.chart-h span { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--muted); letter-spacing: 0; }

/* 104px — 수리야 나마스카라 9자세가 넓은 화면에서 정확히 한 줄에 들어간다 */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: .6rem; }
.chart-cell {
  display: flex; flex-direction: column; gap: .18rem;
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r-md); padding: .2rem .45rem .25rem;
  box-shadow: var(--shadow-xs);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.chart-cell:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); border-color: var(--accent-line); }
.chart-cell .fig-box {
  aspect-ratio: 1 / .92; --fig-pad: .3rem;
  background: var(--bg-sub); border-radius: var(--r-sm); margin-bottom: .32rem;
}
.cc-num { font-family: var(--font-mono); font-size: .5625rem; color: var(--accent-ink); }
.cc-name {
  font-style: normal; font-weight: 500;
  font-size: .64rem; line-height: 1.3; color: var(--ink-2);
}
.cc-ko { font-size: .6rem; line-height: 1.3; color: var(--muted); }
.chart-foot {
  text-align: center; font-size: var(--fs-2xs); font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-top: 1.1rem;
}

/* ============================================================
   12. 자세 상세
   ============================================================ */
.pose-detail {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(1.4rem, 3.5vw, 2.6rem); margin-top: .7rem; align-items: start;
}
.pd-left { position: sticky; top: 96px; }
.pd-left .fig-box {
  --fig-pad: clamp(.85rem, 2.4vw, 1.4rem);
  aspect-ratio: 1; background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.pd-nav {
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: .7rem; font-size: var(--fs-sm); color: var(--muted);
}
.pd-nav a { transition: color var(--dur); }
.pd-nav a:hover { color: var(--accent-ink); }

.sk-name {
  font-family: var(--font-body); font-weight: 500;
  color: var(--accent-ink); font-size: 1rem; letter-spacing: -.01em;
  margin: .3rem 0 .9rem;
}

.pd-meta {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .6rem; margin-bottom: 1.1rem;
}
.pd-meta > div {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r-md); padding: .25rem .95rem;
}
.pd-meta dt {
  font-size: var(--fs-2xs); font-weight: 600; letter-spacing: var(--tracking-label);
  text-transform: uppercase; color: var(--muted); margin-bottom: .3rem;
}
.pd-meta dd { font-size: var(--fs-md); font-weight: 500; line-height: 1.45; }

.cues { display: grid; gap: .5rem; margin-bottom: 1.1rem; }
.cues li {
  position: relative; padding-left: 1.6rem;
  font-size: var(--fs-lg); color: var(--ink-2); line-height: 1.7;
}
.cues li::before {
  content: ""; position: absolute; left: .1rem; top: .78em;
  width: .75rem; height: 1.5px; border-radius: 2px; background: var(--accent);
}

.benefit {
  font-family: var(--font-body); font-size: 1rem; line-height: 1.6;
  color: var(--ink-2); border-left: 2px solid var(--line);
  padding-left: 1.1rem; margin-bottom: 1.1rem;
}

.mastery-picker { display: flex; gap: .4rem; flex-wrap: wrap; }
.mp {
  border: 1px solid var(--line); background: var(--surface);
  padding: .48rem .95rem; border-radius: var(--r-pill);
  font-size: var(--fs-sm); font-weight: 500; cursor: pointer; color: var(--ink-2);
  transition: background var(--dur), color var(--dur), border-color var(--dur);
}
.mp:hover { border-color: var(--accent-line); color: var(--accent-ink); }
.mp.on { background: var(--accent-deep); border-color: var(--accent-deep); color: var(--accent-on); }

/* ============================================================
   13. 수련하기
   ============================================================ */
.practice-wrap {
  display: grid; grid-template-columns: 286px minmax(0, 1fr);
  gap: 1.6rem; align-items: start;
}
.pr-panel {
  position: sticky; top: 96px;
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r-lg); padding: .3rem 1.2rem; box-shadow: var(--shadow-sm);
}
.timer {
  font-family: var(--font-display); font-weight: 700;
  font-size: 2.5rem; text-align: center; line-height: 1.06; letter-spacing: -.04em;
}
.timer-cap {
  text-align: center; font-size: var(--fs-2xs); font-weight: 600;
  letter-spacing: var(--tracking-label); text-transform: uppercase;
  color: var(--muted); margin-bottom: 1.2rem;
}
.pr-controls { display: grid; grid-template-columns: 1fr auto; gap: .5rem; margin-bottom: 1.3rem; }
.pr-progress { margin: 1.1rem 0 1.3rem; }
.pr-progress-head {
  display: flex; justify-content: space-between;
  font-size: var(--fs-2xs); font-weight: 600; letter-spacing: var(--tracking-label);
  text-transform: uppercase; color: var(--muted); margin-bottom: .45rem;
}
.pr-progress small { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--muted); }

.sbar { height: 5px; background: var(--line-soft); border-radius: var(--r-pill); overflow: hidden; }
.sbar i {
  display: block; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 70%, var(--clay)));
  transition: width .45s var(--ease-out);
}

#prFinish { width: 100%; margin-top: .4rem; }
.breath-hint {
  display: flex; align-items: center; gap: .55rem; justify-content: center;
  font-size: var(--fs-xs); color: var(--muted); margin-top: 1.1rem;
}
.breath-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  animation: breathe 8s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { transform: scale(.7); opacity: .45; }
  50%      { transform: scale(1.7); opacity: 1; }
}

.pr-list {
  border: 1px solid var(--line-soft); border-radius: var(--r-lg);
  overflow: hidden; background: var(--surface);
}
.pr-sep {
  background: var(--bg-sub); padding: .65rem 1.1rem;
  font-size: var(--fs-2xs); font-weight: 600; letter-spacing: var(--tracking-label);
  text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--line-soft);
}
.pr-item {
  display: grid; grid-template-columns: 24px 48px 1fr auto; gap: .85rem;
  align-items: center; padding: .62rem 1.1rem;
  border-bottom: 1px solid var(--line-soft); cursor: pointer;
  transition: background .2s var(--ease);
}
.pr-item:last-child { border-bottom: none; }
.pr-item:hover { background: var(--bg-inset); }
.pr-item.on { background: var(--accent-soft); }
.pr-check {
  width: 21px; height: 21px; border: 1.5px solid var(--line); border-radius: 50%;
  display: grid; place-items: center; font-size: var(--fs-xs); color: var(--accent-on);
  transition: background var(--dur), border-color var(--dur);
}
.pr-item.on .pr-check { background: var(--accent-deep); border-color: var(--accent-deep); }
.pr-fig { width: 48px; height: 42px; }
.pr-fig .asana-fig { height: 100%; }
.pr-item.on .fig-limb, .pr-item.on .fig-spine { stroke: var(--accent-ink); }
.pr-item.on .fig-torso, .pr-item.on .fig-head { fill: var(--accent-ink); }
.pr-name strong {
  display: block; font-family: var(--font-display);
  font-size: .95rem; font-weight: 600; letter-spacing: -.01em;
}
.pr-name em {
  font-style: normal; font-size: var(--fs-xs); color: var(--muted);
}
.pr-breath { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--muted); }

/* ============================================================
   14. 대시보드 · 그래프
   ============================================================ */
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem 1rem; }

.card {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r-lg); padding: .28rem 1.3rem; box-shadow: var(--shadow-xs);
}
.dash-grid .card { display: flex; flex-direction: column; }
.dash-grid .card > .chart, .dash-grid .card > .stage-list { flex: 1; min-height: 0; }
.card.wide { grid-column: 1 / -1; }
.card.center { display: flex; flex-direction: column; align-items: center; justify-content: center; }

.chart { width: 100%; height: auto; display: block; }
/* 캘린더는 셀 크기를 유지해야 하므로 고유 크기 + 축소만 허용 */
.chart-cal { width: min(100%, 800px); height: auto; margin: 0 auto; }

.ch-lbl { font-size: 9px; fill: var(--muted); font-family: var(--font-body); }
.cal-cell { fill: var(--line-soft); }
.cal-cell.l1 { fill: color-mix(in srgb, var(--accent) 28%, var(--line-soft)); }
.cal-cell.l2 { fill: color-mix(in srgb, var(--accent) 52%, var(--line-soft)); }
.cal-cell.l3 { fill: color-mix(in srgb, var(--accent) 78%, var(--line-soft)); }
.cal-cell.l4 { fill: var(--accent); }
.cal-cell.future { opacity: .32; }

.cal-legend {
  display: flex; align-items: center; gap: .3rem; justify-content: center;
  margin-top: .9rem; font-size: var(--fs-xs); color: var(--muted);
}
.cal-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; background: var(--line-soft); }
.cal-legend i.l1 { background: color-mix(in srgb, var(--accent) 28%, var(--line-soft)); }
.cal-legend i.l2 { background: color-mix(in srgb, var(--accent) 52%, var(--line-soft)); }
.cal-legend i.l3 { background: color-mix(in srgb, var(--accent) 78%, var(--line-soft)); }
.cal-legend i.l4 { background: var(--accent); }

.chart-bars { height: 100%; min-height: 160px; }
.ch-bar { fill: var(--accent); }
.ch-bar.moon { fill: var(--indigo); }
.ch-miss { fill: var(--line); }
.ch-axis { stroke: var(--line); stroke-width: .4; }

.chart-ring { width: 134px; height: 134px; }
.ring-track { fill: none; stroke: var(--line-soft); stroke-width: 8; }
.ring-value {
  fill: none; stroke: var(--accent); stroke-width: 8; stroke-linecap: round;
  transition: stroke-dasharray .9s var(--ease-out);
}
.ring-num { font-family: var(--font-display); font-weight: 700; font-size: 21px; fill: var(--ink); text-anchor: middle; }
.ring-pct { font-family: var(--font-body); font-size: 11px; fill: var(--muted); }
/* .chart 가 display:block 이라 text-align 으로는 링이 가운데로 오지 않는다 */
.ring-wrap { text-align: center; }
.ring-wrap .chart-ring { margin-inline: auto; }
.ring-cap strong { display: block; font-family: var(--font-display); font-size: 1.06rem; font-weight: 600; }
.ring-cap span { font-size: var(--fs-xs); color: var(--muted); }

.chart-radar { max-width: 300px; margin: 0 auto; }
.rad-grid { fill: none; stroke: var(--line-soft); stroke-width: .7; }
.rad-spoke { stroke: var(--line-soft); stroke-width: .5; }
.rad-area { fill: color-mix(in srgb, var(--accent) 20%, transparent); stroke: var(--accent); stroke-width: 1.4; }
.rad-dot { fill: var(--accent-ink); }
.rad-lbl { font-size: 8px; fill: var(--muted); font-family: var(--font-body); }

.chart-spark { height: 46px; }
.spark-line { fill: none; stroke: var(--accent); stroke-width: 1.6; }
.spark-area { fill: color-mix(in srgb, var(--accent) 11%, transparent); stroke: none; }
.spark-wrap { margin-top: 1.1rem; border-top: 1px solid var(--line-soft); padding-top: .9rem; }

.stage-list { display: grid; gap: .75rem; }
.stage-row {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(80px, 1fr) auto;
  gap: .85rem; align-items: center; font-size: var(--fs-md);
}
.stage-row .sbar { width: 100%; }
.stage-name { color: var(--ink-2); }
.stage-row.done .stage-name { color: var(--accent-ink); }
.stage-row.current .stage-name { font-weight: 600; color: var(--ink); }
.stage-num { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--muted); }

.recent { display: grid; }
.recent li {
  display: grid; grid-template-columns: auto 1fr auto; gap: .9rem;
  padding: .6rem 0; border-bottom: 1px solid var(--line-soft);
  font-size: var(--fs-md); align-items: baseline;
}
.recent li:last-child { border-bottom: none; }
.rec-date { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--muted); }
.rec-mode { color: var(--ink-2); }
.rec-min { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--accent-ink); }
.rec-note { grid-column: 2 / -1; font-size: var(--fs-sm); color: var(--muted); }

/* ============================================================
   15. 단계 가이드
   ============================================================ */
.stage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: .6rem 1rem; }
.stage-card {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r-lg); padding: .28rem 1.3rem; box-shadow: var(--shadow-xs);
  transition: border-color var(--dur), box-shadow var(--dur);
}
.stage-card.current { border-color: var(--accent-line); box-shadow: var(--shadow-sm); }
.stage-card.locked { opacity: .62; }
.stage-card header { display: flex; align-items: center; gap: .65rem; margin-bottom: .45rem; flex-wrap: wrap; }
.stage-badge {
  width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: var(--bg);
  font-family: var(--font-mono); font-size: var(--fs-xs);
}
.stage-card.done .stage-badge { background: var(--accent-deep); color: var(--accent-on); }
.stage-card header h3 { font-size: 1.05rem; flex: 1; min-width: 8rem; }
.stage-state {
  font-size: var(--fs-2xs); font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
}
.stage-card.current .stage-state { color: var(--accent-ink); }
.stage-card dl { margin-bottom: .45rem; display: grid; gap: .3rem; }
.stage-card dt {
  font-size: var(--fs-2xs); font-weight: 600; letter-spacing: var(--tracking-label);
  text-transform: uppercase; color: var(--muted);
}
.stage-card dd { font-size: var(--fs-md); color: var(--ink-2); line-height: 1.5; }
.stage-num-line { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--muted); margin-top: .28rem; }
.stage-card details { margin-top: .45rem; border-top: 1px solid var(--line-soft); padding-top: .4rem; }
.stage-card summary {
  font-size: var(--fs-sm); color: var(--muted); cursor: pointer;
  list-style: none; display: flex; align-items: center; gap: .4rem;
}
.stage-card summary::-webkit-details-marker { display: none; }
.stage-card summary::before {
  content: "+"; font-family: var(--font-mono); font-size: 1em;
  line-height: 1; color: var(--accent-ink); width: .8em; text-align: center;
}
.stage-card details[open] summary::before { content: "\2212"; }
.stage-card summary:hover { color: var(--accent-ink); }
.stage-poses { margin-top: .8rem; display: grid; gap: .4rem; max-height: 260px; overflow-y: auto; }
.stage-poses a {
  display: flex; align-items: center; gap: .55rem;
  font-size: var(--fs-md); color: var(--ink-2); transition: color var(--dur);
}
.stage-poses a:hover { color: var(--accent-ink); }
.stage-poses .mst { margin-left: 0; }

.rules-band .rules { counter-reset: r; display: grid; gap: 1rem; max-width: 68ch; }
.rules li {
  counter-increment: r; position: relative; padding-left: 2.6rem;
  color: var(--ink-2); font-size: var(--fs-lg); line-height: 1.7;
}
.rules li::before {
  content: counter(r, decimal-leading-zero);
  position: absolute; left: 0; top: .18rem;
  font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--accent-ink);
}

/* ============================================================
   16. 뱃지
   ============================================================ */
.badge-progress { margin-bottom: 1.1rem; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .5rem .8rem; }
.badge {
  background: var(--bg-sub); border: 1px solid var(--line-soft);
  border-radius: var(--r-lg); padding: .29rem 1.1rem; text-align: center;
  filter: grayscale(1); opacity: .55;
  transition: filter .4s var(--ease), opacity .4s var(--ease),
              background .3s var(--ease), box-shadow .3s var(--ease);
}
.badge.on {
  filter: none; opacity: 1;
  background: var(--surface); box-shadow: var(--shadow-xs);
}
.badge-icon { font-size: 1.8rem; display: block; margin-bottom: .25rem; line-height: 1; }
.badge strong { display: block; font-family: var(--font-display); font-size: 1rem; font-weight: 600; }
.badge p { font-size: var(--fs-sm); color: var(--muted); margin: .18rem 0 .3rem; line-height: 1.5; }
.badge-state {
  font-size: .625rem; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted);
}
.badge.on .badge-state { color: var(--accent-ink); }

/* ============================================================
   17. 커뮤니티
   ============================================================ */
.composer { margin-bottom: 1.1rem; }
.composer-row { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }

.posts { display: grid; gap: .6rem; }
.post {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r-lg); padding: .26rem 1.3rem; box-shadow: var(--shadow-xs);
}
.post header { display: flex; align-items: center; gap: .65rem; margin-bottom: .8rem; flex-wrap: wrap; }
.post header strong { font-family: var(--font-display); font-size: .98rem; font-weight: 600; }
.post header time { font-size: var(--fs-xs); color: var(--muted); }
.post-cat {
  font-size: .625rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  padding: .22rem .6rem; border-radius: var(--r-pill);
  border: 1px solid var(--line); color: var(--muted);
}
.post-cat.c-question { border-color: color-mix(in srgb, var(--accent) 55%, transparent); color: var(--accent-ink); }
.post-cat.c-injury { border-color: color-mix(in srgb, var(--clay) 55%, transparent); color: var(--clay); }
.post-cat.c-philosophy { border-color: color-mix(in srgb, var(--indigo) 55%, transparent); color: var(--indigo); }
.post-cat.c-log { border-color: color-mix(in srgb, var(--sage) 55%, transparent); color: var(--sage); }
.post-body { font-size: var(--fs-lg); color: var(--ink-2); line-height: 1.78; }
.post footer { margin-top: .5rem; }

.cheer-btn {
  border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: .3rem .85rem; font-size: var(--fs-sm); cursor: pointer; color: var(--muted);
  transition: background var(--dur), color var(--dur), border-color var(--dur);
}
.cheer-btn:hover { border-color: var(--accent-line); color: var(--accent-ink); }
.cheer-btn.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }

.replies {
  margin-top: .55rem; display: grid; gap: .4rem;
  border-left: 2px solid var(--line-soft); padding-left: 1rem;
}
.replies li { font-size: var(--fs-md); color: var(--ink-2); line-height: 1.7; }
.replies strong { font-weight: 600; color: var(--ink); }
.replies time { font-size: var(--fs-xs); color: var(--muted); margin-left: .45rem; }
.reply-form { display: flex; gap: .5rem; margin-top: .9rem; }

/* ============================================================
   18. 워크숍
   ============================================================ */
.my-bookings { margin-bottom: .8rem; }
.booking-list { display: grid; gap: .55rem; }
.booking-list li { display: flex; gap: .65rem; align-items: baseline; font-size: var(--fs-md); }
.booking-list strong { font-family: var(--font-display); font-weight: 600; }
.booking-list time { margin-left: auto; font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--muted); }

.ws-grid { display: grid; gap: .6rem; }
.ws-card {
  display: grid; grid-template-columns: 76px minmax(0, 1fr) 156px; gap: 1.4rem;
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r-lg); padding: .28rem 1.3rem; box-shadow: var(--shadow-xs);
  transition: border-color var(--dur), box-shadow var(--dur), transform var(--dur) var(--ease);
}
.ws-card:hover { border-color: var(--line); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.ws-card.booked { border-color: var(--accent-line); }
.ws-date { text-align: center; border-right: 1px solid var(--line-soft); padding-right: 1rem; }
.ws-d { display: block; font-family: var(--font-display); font-weight: 700; font-size: 1.9rem; line-height: 1; letter-spacing: -.04em; }
.ws-m { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--muted); }
.ws-body h3 { font-size: 1.18rem; margin-bottom: .45rem; }
.ws-desc { font-size: var(--fs-md); color: var(--ink-2); line-height: 1.6; margin-bottom: .45rem; }
.ws-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: .65rem 1rem; }
.ws-meta dt {
  font-size: var(--fs-2xs); font-weight: 600; letter-spacing: var(--tracking-label);
  text-transform: uppercase; color: var(--muted);
}
.ws-meta dd { font-size: var(--fs-md); font-weight: 500; }
.ws-time { font-size: var(--fs-sm); color: var(--muted); margin-top: .4rem; }
.ws-action { display: flex; flex-direction: column; gap: .65rem; align-items: stretch; justify-content: center; }
.ws-seats { font-size: var(--fs-xs); color: var(--muted); text-align: center; }
.ws-seats b { font-family: var(--font-display); font-size: 1.15rem; color: var(--ink); }
.ws-seats.low b { color: var(--clay); }

/* ============================================================
   19. 설정
   ============================================================ */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(288px, 1fr)); gap: 1rem; align-items: start; }
.day-chips { display: flex; gap: .35rem; flex-wrap: wrap; }
.day-chip {
  border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: .32rem .75rem; font-size: var(--fs-sm); cursor: pointer; color: var(--muted);
  transition: background var(--dur), color var(--dur), border-color var(--dur);
}
.day-chip:hover { border-color: var(--accent-line); color: var(--accent-ink); }
.day-chip input { display: none; }
.day-chip.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* ============================================================
   20. 토스트 · 푸터
   ============================================================ */
.toast {
  position: fixed; left: 50%; bottom: 1.7rem; transform: translate(-50%, 130%);
  background: var(--ink); color: var(--bg);
  padding: .8rem 1.35rem; border-radius: var(--r-pill);
  font-size: var(--fs-md); font-weight: 500;
  display: flex; align-items: center; gap: .6rem; z-index: 60;
  box-shadow: var(--shadow-lg); opacity: 0; max-width: 90vw;
  transition: transform .42s var(--ease-out), opacity .3s var(--ease);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast-icon { font-size: 1.1rem; }

.site-footer { border-top: 1px solid var(--line-soft); background: var(--bg-sub); margin-top: 0; }
.foot-inner { max-width: var(--maxw); margin: 0 auto; padding: 1.7rem var(--gutter); text-align: center; }
.foot-mantra { font-family: var(--font-body); font-size: 1rem; line-height: 1.7; color: var(--ink-2); }
.foot-mantra span { display: block; font-size: var(--fs-sm); color: var(--muted); margin-top: .35rem; }
.foot-note { font-size: var(--fs-sm); color: var(--muted); max-width: 60ch; margin: .85rem auto 0; line-height: 1.7; }
.foot-meta {
  font-size: var(--fs-2xs); font-weight: 500; letter-spacing: .18em;
  text-transform: uppercase; color: var(--muted); margin-top: .85rem;
}
.foot-meta span { color: var(--accent-ink); }

/* ============================================================
   21. 반응형
   ============================================================ */
@media (max-width: 1180px) {
  .nav { display: none; }
  .menu-btn { display: grid; }
  .hero { grid-template-columns: 1fr; }
  .hero-ink { order: -1; max-width: 320px; margin: 0 auto; }
  .dash-grid { grid-template-columns: 1fr; }
  .practice-wrap { grid-template-columns: 1fr; }
  .pr-panel { position: static; }
  .pose-detail { grid-template-columns: 1fr; }
  .pd-left { position: static; max-width: 430px; }
}

@media (max-width: 720px) {
  .header-inner { padding: .65rem 1rem; }
  .brand-text small { display: none; }
  .filter-right { width: 100%; margin-left: 0; }
  .filter-right .input { flex: 1; width: auto; }
  .pose-grid { grid-template-columns: repeat(auto-fill, minmax(152px, 1fr)); }
  .ws-card { grid-template-columns: 1fr; gap: 1rem; }
  .ws-date {
    display: flex; gap: .55rem; align-items: baseline; text-align: left;
    border-right: none; border-bottom: 1px solid var(--line-soft); padding: 0 0 .8rem;
  }
  .ws-d { font-size: 1.45rem; }
  .composer-row { grid-template-columns: 1fr; }
  .pr-item { grid-template-columns: 22px 40px 1fr auto; gap: .65rem; padding: .58rem .75rem; }
  .pr-fig { width: 40px; height: 35px; }
  .stat-row { grid-template-columns: repeat(auto-fit, minmax(142px, 1fr)); }
  .stage-row { grid-template-columns: 1fr auto; }
  .stage-row .sbar { grid-column: 1 / -1; }
  .recent li { grid-template-columns: auto 1fr; }
  .timer { font-size: 2.3rem; }
}

@media (max-width: 420px) {
  .pose-grid { grid-template-columns: repeat(2, 1fr); }
  .badge-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   RTL (아랍어) — 방향에 묶인 몇 군데만 뒤집는다.
   나머지는 논리 속성(inset-inline / text-align: start)이 알아서 처리한다.
   ============================================================ */
[dir="rtl"] .nav { margin-left: 0; margin-right: auto; }
[dir="rtl"] .filter-right { margin-left: 0; margin-right: auto; }
[dir="rtl"] .mst { margin-left: 0; margin-right: auto; }
[dir="rtl"] .link-btn { margin-left: 0; margin-right: auto; }
[dir="rtl"] .booking-list time { margin-left: 0; margin-right: auto; }
[dir="rtl"] .chart-head .btn { margin-left: 0; margin-right: auto; }
[dir="rtl"] .drawer-nav { left: 0; right: auto; border-left: 0; border-right: 1px solid var(--line); }
[dir="rtl"] .drawer-nav { transform: translateX(-100%); }
[dir="rtl"] .drawer.open .drawer-nav { transform: none; }
[dir="rtl"] .drawer-nav a:hover { padding-left: .5rem; padding-right: .9rem; }
[dir="rtl"] .cues li { padding-left: 0; padding-right: 1.6rem; }
[dir="rtl"] .cues li::before { left: auto; right: .1rem; }
[dir="rtl"] .rules li { padding-left: 0; padding-right: 2.6rem; }
[dir="rtl"] .rules li::before { left: auto; right: 0; }
[dir="rtl"] .hero-quote { padding-left: 0; padding-right: 1.25rem; border-left: 0; border-inline-start: 2px solid var(--accent); }
[dir="rtl"] .benefit { padding-left: 0; padding-right: 1.1rem; border-left: 0; border-inline-start: 2px solid var(--line); }
[dir="rtl"] .replies { padding-left: 0; padding-right: 1rem; border-left: 0; border-inline-start: 2px solid var(--line-soft); }
[dir="rtl"] .ws-date { border-right: 0; padding-right: 0; border-left: 1px solid var(--line-soft); padding-left: 1rem; }
[dir="rtl"] .eyebrow::before { order: 1; }
/* 숫자·산스크리트·모노 표기는 RTL 에서도 왼쪽에서 오른쪽으로 읽는다 */
[dir="rtl"] .pose-num, [dir="rtl"] .cc-num, [dir="rtl"] .grp-count,
[dir="rtl"] .rec-date, [dir="rtl"] .stage-num, [dir="rtl"] .ws-m,
[dir="rtl"] .timer, [dir="rtl"] .pr-breath, [dir="rtl"] .lang-cc,
[dir="rtl"] .sk-name, [dir="rtl"] .cc-name { direction: ltr; text-align: start; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ============================================================
   22. 인쇄 — 시퀀스 차트를 A3 포스터로
   ============================================================ */
@media print {
  .site-header, .drawer, .site-footer, .toast, .hero-cta,
  .chart-head .lede, #btnPrint, .back-link { display: none !important; }
  body { background: #fff; background-image: none; color: #000; }
  .main { padding: 0; max-width: none; }
  /* 화면용 배경 띠는 종이에서 잉크만 먹는다 — 걷어내고 여백도 좁힌다 */
  .main > .bleed, .main > .page-head { padding-inline: 0; }
  .page-head {
    background: none; border-bottom: none;
    padding-block: 0 .5rem; margin-bottom: .8rem;
  }
  .chart-sheet { border: none; padding: 0; box-shadow: none; background: #fff; }
  .chart-grid { grid-template-columns: repeat(9, 1fr); gap: .3rem; }
  .chart-block, .chart-cell { break-inside: avoid; }
  /* 종이 위에서는 카드 장식을 걷어낸다 — 얇은 괘선만 남겨 도판이 주인공이 되게 */
  .chart-cell { padding: .2rem; border-color: #e2e2e2; }
  .chart-cell .fig-box { background: none; }
  .asana-photo { filter: grayscale(1) contrast(1.1); mix-blend-mode: normal; }
  .card, .pose-card, .stat-card, .post, .ws-card, .stage-card, .chart-cell { box-shadow: none; }
  @page { size: A3 portrait; margin: 10mm; }
}

/* 헤더가 좁아지면 언어 버튼은 국가 코드만 남긴다 */
@media (max-width: 560px) {
  .lang-btn .lang-name { display: none; }
  .lang-btn { padding-inline: .5rem; }
}
