/**
 * Beamers Portfolio — 디자인 토큰 레지스트리 (--bsp-*)  ★ 공통 분모(common denominator)
 * =====================================================================================
 * 이 파일이 모든 스튜디오가 공유하는 **토큰 목록의 단일 소스**다(studio-core 포함, 전 스튜디오 마운트 배포).
 * 블록/패턴은 오직 여기 정의된 --bsp-* 만 소비한다. 새 블록/패턴이 새 토큰을 필요로 하면
 * 임의 값 하드코딩 대신 **여기에 토큰을 추가**한다 → 그 즉시 모든 테마가 override 가능한 공통 토큰이 된다.
 *
 * 각 토큰의 값 우선순위(왼→오):
 *   1) --wp--custom--bsp--<name>  ← 각 테마 theme.json 의 settings.custom.bsp.<camelCase> (스튜디오 override, 전역 자동 로드)
 *   2) --<legacy>                 ← beamers-main 등 자체 style.css 시맨틱 토큰(하위호환)
 *   3) 하드 기본값                ← 어떤 테마 설정도 없을 때의 안전한 기본
 *
 * 스튜디오 커스터마이징(정도): 자기 테마 theme.json 에
 *   "settings": { "custom": { "bsp": { "accent": "#0f766e", "radius": "8px", "fontDisplay": "..." } } }
 * 만 채우면 WP가 --wp--custom--bsp--accent 등을 전역(프론트+에디터) 출력 → 아래 토큰이 받아 전 블록 리스타일.
 *   (camelCase→kebab 자동 변환: paper2→paper-2, fontDisplay→font-display, gapSection→gap-section ...)
 *
 * :where(:root) 로 특이도 0 → 위 1)/2) 어느 것이든 손쉽게 이긴다.
 */

:where(:root) {
  /* ── 색상 ────────────────────────────  theme.json key (settings.custom.bsp.*) ── */
  --bsp-paper:        var(--wp--custom--bsp--paper,        var(--paper,        #ffffff));               /* paper */
  --bsp-paper-2:      var(--wp--custom--bsp--paper-2,      var(--paper-2,      #f4f2ee));               /* paper2 */
  --bsp-ink:          var(--wp--custom--bsp--ink,          var(--ink,          #141414));               /* ink */
  --bsp-ink-soft:     var(--wp--custom--bsp--ink-soft,     var(--ink-soft,     #44403c));               /* inkSoft */
  --bsp-ink-mute:     var(--wp--custom--bsp--ink-mute,     var(--ink-mute,     #8a8378));               /* inkMute */
  --bsp-rule:         var(--wp--custom--bsp--rule,         var(--rule,         rgba(20,20,20,.10)));    /* rule */
  --bsp-rule-strong:  var(--wp--custom--bsp--rule-strong,  var(--rule-strong,  rgba(20,20,20,.20)));    /* ruleStrong */
  --bsp-accent:       var(--wp--custom--bsp--accent,       var(--accent,       #c4361b));               /* accent */
  --bsp-accent-soft:  var(--wp--custom--bsp--accent-soft,  var(--accent-soft,  rgba(196,54,27,.08)));   /* accentSoft */
  --bsp-on-accent:    var(--wp--custom--bsp--on-accent,    var(--on-accent,    #ffffff));               /* onAccent */

  /* ── 타이포그래피 ──────────────────────────────────────────────────────────────── */
  --bsp-font-display: var(--wp--custom--bsp--font-display, var(--f-display, 'Fraunces', ui-serif, Georgia, serif));                       /* fontDisplay */
  --bsp-font-body:    var(--wp--custom--bsp--font-body,    var(--f-body, 'Pretendard Variable', system-ui, -apple-system, sans-serif));  /* fontBody */
  --bsp-font-mono:    var(--wp--custom--bsp--font-mono,    var(--f-mono, 'JetBrains Mono', ui-monospace, monospace));                     /* fontMono */

  --bsp-h1:           var(--wp--custom--bsp--h1,           clamp(2.25rem, 6vw,  4.5rem));   /* h1 */
  --bsp-h2:           var(--wp--custom--bsp--h2,           clamp(1.6rem,  3.5vw, 2.6rem));  /* h2 */
  --bsp-h3:           var(--wp--custom--bsp--h3,           clamp(1.2rem,  2vw,   1.6rem));  /* h3 */
  --bsp-body-size:    var(--wp--custom--bsp--body-size,    1.0625rem);   /* bodySize */
  --bsp-small-size:   var(--wp--custom--bsp--small-size,   0.8125rem);   /* smallSize */
  --bsp-eyebrow-size: var(--wp--custom--bsp--eyebrow-size, 0.75rem);     /* eyebrowSize */

  --bsp-lh-tight:     var(--wp--custom--bsp--lh-tight,     1.08);   /* lhTight — 디스플레이 행간(한글 네모틀 고려) */
  --bsp-lh-heading:   var(--wp--custom--bsp--lh-heading,   1.2);    /* lhHeading */
  --bsp-lh-body:      var(--wp--custom--bsp--lh-body,      1.65);   /* lhBody */
  --bsp-tracking:     var(--wp--custom--bsp--tracking,     0.08em); /* tracking — eyebrow/라벨 자간(양수) */
  /* 한글 본문/제목 자간·굵기 토큰 — 기본값은 현행 유지(0/600), 각 테마가 theme.json 으로 정제값 override */
  --bsp-tracking-display: var(--wp--custom--bsp--tracking-display, 0em);  /* trackingDisplay — 디스플레이 음수 자간 */
  --bsp-tracking-head:    var(--wp--custom--bsp--tracking-head,    0em);  /* trackingHead — 헤딩 음수 자간 */
  --bsp-tracking-body:    var(--wp--custom--bsp--tracking-body,    0em);  /* trackingBody — 본문 음수 자간 */
  --bsp-weight-display:   var(--wp--custom--bsp--weight-display,   600);  /* weightDisplay — 디스플레이 굵기 */

  /* ── 간격 ──────────────────────────────────────────────────────────────────────── */
  --bsp-pad-page:     var(--wp--custom--bsp--pad-page,     var(--pad-page,    clamp(1.25rem, 4vw, 3rem)));   /* padPage */
  --bsp-gap-section:  var(--wp--custom--bsp--gap-section,  var(--pad-section, clamp(3rem, 8vw, 6rem)));      /* gapSection */
  --bsp-gap:          var(--wp--custom--bsp--gap,          clamp(1rem, 2.5vw, 1.75rem));   /* gap */
  --bsp-gap-sm:       var(--wp--custom--bsp--gap-sm,       0.5rem);   /* gapSm */

  /* ── 레이아웃 ──────────────────────────────────────────────────────────────────── */
  --bsp-maxw:         var(--wp--custom--bsp--maxw,         72rem);    /* maxw — alignwide 콘텐츠 폭 */
  --bsp-maxw-text:    var(--wp--custom--bsp--maxw-text,    40rem);    /* maxwText — 본문 가독 폭 */
  --bsp-radius:       var(--wp--custom--bsp--radius,       var(--radius, 2px));   /* radius */
}
