/*
 * 🔴Cascade layers — `@layer iyu.base, iyu.house;`
 *
 *   iyu.base   this sheet (neutral defaults every component can render with)
 *   iyu.house  a house theme such as `@iyulab/house-style`
 *   (none)     the application's own CSS — unlayered, so it always wins
 *
 * Unlayered styles beat every layer regardless of specificity or source order, so an
 * application overrides a token with a plain `:root { --u-… }` — no `:root:root` or
 * `:not([theme])` tricks, and no dependence on when `Theme.init()` injects this sheet.
 * ⚠That includes dark mode: an unlayered `:root` override applies in both themes. Scope it
 * with `:root[theme="dark"]` (or `:root:not([theme="dark"])`) when the value is mode-specific.
 *
 * The order statement is repeated by every sheet that joins a layer, so whichever loads
 * first fixes the same order.
 */
@layer iyu.base, iyu.house;

@layer iyu.base {
:root[theme="dark"] {
  color-scheme: dark;

  /* Neutral Colors */
  --u-neutral-0:     #000000;
  --u-neutral-50:    #0A0A0A;
  --u-neutral-100:   #121212;
  --u-neutral-200:   #1E1E1E;
  --u-neutral-300:   #2A2A2A;
  --u-neutral-400:   #3D3D3D;
  --u-neutral-500:   #525252;
  --u-neutral-600:   #6E6E6E;
  --u-neutral-700:   #8A8A8A;
  --u-neutral-800:   #B0B0B0;
  --u-neutral-900:   #D4D4D4;
  --u-neutral-1000:  #FFFFFF;

  /* Blue Colors */
  --u-blue-0:        #030D1A;
  --u-blue-100:      #061629;
  --u-blue-200:      #0A223B;
  --u-blue-300:      #103150;
  --u-blue-400:      #174167;
  --u-blue-500:      #205281;
  --u-blue-600:      #2A659D;
  --u-blue-700:      #3678B8;
  --u-blue-800:      #478DCE;
  --u-blue-900:      #5DA2DF;
  --u-blue-1000:     #79BBEA;

  /* Green Colors */
  --u-green-0:       #06140C;
  --u-green-100:     #0A2114;
  --u-green-200:     #10301D;
  --u-green-300:     #164228;
  --u-green-400:     #1F5535;
  --u-green-500:     #2A6942;
  --u-green-600:     #367E50;
  --u-green-700:     #4A9563;
  --u-green-800:     #63AB7A;
  --u-green-900:     #80BE97;
  --u-green-1000:    #9BCFB1;

  /* Yellow Colors */
  --u-yellow-0:      #1C1300;
  --u-yellow-100:    #2D1E00;
  --u-yellow-200:    #402B00;
  --u-yellow-300:    #553900;
  --u-yellow-400:    #6B4900;
  --u-yellow-500:    #825A00;
  --u-yellow-600:    #9A6C00;
  --u-yellow-700:    #B08012;
  --u-yellow-800:    #C69635;
  --u-yellow-900:    #D9AD5A;
  --u-yellow-1000:   #E8C57F;

  /* Red Colors */
  --u-red-0:         #1C0707;
  --u-red-100:       #2C0B0B;
  --u-red-200:       #3E1111;
  --u-red-300:       #541818;
  --u-red-400:       #6C2020;
  --u-red-500:       #852A2A;
  --u-red-600:       #A13535;
  --u-red-700:       #B94949;
  --u-red-800:       #CB6262;
  --u-red-900:       #D98383;
  --u-red-1000:      #E7A2A2;

  /* Orange Colors */
  --u-orange-0:      #1D0E00;
  --u-orange-100:    #2F1700;
  --u-orange-200:    #421F00;
  --u-orange-300:    #582A00;
  --u-orange-400:    #703600;
  --u-orange-500:    #8A4500;
  --u-orange-600:    #A55600;
  --u-orange-700:    #BD6A18;
  --u-orange-800:    #D1823C;
  --u-orange-900:    #E19D67;
  --u-orange-1000:   #EDB992;

  /* Teal Colors */
  --u-teal-0:        #041411;
  --u-teal-100:      #07201B;
  --u-teal-200:      #0B2E28;
  --u-teal-300:      #10403A;
  --u-teal-400:      #16544D;
  --u-teal-500:      #1E6860;
  --u-teal-600:      #297D74;
  --u-teal-700:      #3A9389;
  --u-teal-800:      #54A89F;
  --u-teal-900:      #73BBB3;
  --u-teal-1000:     #93CBC5;

  /* Cyan Colors */
  --u-cyan-0:        #041318;
  --u-cyan-100:      #071F29;
  --u-cyan-200:      #0B2D3A;
  --u-cyan-300:      #104050;
  --u-cyan-400:      #165469;
  --u-cyan-500:      #1E6A82;
  --u-cyan-600:      #287F9C;
  --u-cyan-700:      #3995B5;
  --u-cyan-800:      #53AACC;
  --u-cyan-900:      #73BEDD;
  --u-cyan-1000:     #95CFE8;

  /* Purple Colors */
  --u-purple-0:      #150A22;
  --u-purple-100:    #220F36;
  --u-purple-200:    #31164B;
  --u-purple-300:    #432064;
  --u-purple-400:    #572B80;
  --u-purple-500:    #6C379C;
  --u-purple-600:    #8245B7;
  --u-purple-700:    #975BCB;
  --u-purple-800:    #AB79D9;
  --u-purple-900:    #BD99E2;
  --u-purple-1000:   #CEB8EA;

  /* Pink Colors */
  --u-pink-0:        #1F0A14;
  --u-pink-100:      #310F20;
  --u-pink-200:      #451532;
  --u-pink-300:      #5C1D45;
  --u-pink-400:      #74285A;
  --u-pink-500:      #8F336F;
  --u-pink-600:      #AB4187;
  --u-pink-700:      #C0569D;
  --u-pink-800:      #D174B3;
  --u-pink-900:      #E095C7;
  --u-pink-1000:     #EBB5D9;

  /* ==========================================================================
     Role Colors — 의미 역할 층
     컴포넌트는 팔레트 프리미티브가 아니라 이 층을 참조한다.
     브랜드 색 교체는 아래 30개만 재정의하면 시맨틱 층까지 따라온다.

     단은 '강도' 축이다 (weakest -> strong). 용도(배경/테두리/텍스트)는
     소비처가 정한다 -- 단을 속성에 묶으면 primary 버튼의 배경이 어느
     단인지 같은 모순이 생긴다.

     ★**다만 두 단은 용도가 확정돼 있다** — 대비 요구가 서로 다르기 때문이다.
        `-color`  = **면**. `--u-*-txt-color` 가 그 위에 얹히므로 on-color 기준 4.5.
        `-strong` = **글자·아이콘**. `--u-bg-color` 위에 놓이므로 바탕 기준 4.5.
     라이트에서는 바탕도 on-color 도 흰색이라 두 요구가 한 조건으로 합쳐지지만,
     **다크에서는 정반대 방향**이다(바탕 #121212 · on-color #FFFFFF). 바탕에서 읽히는
     밝은 단은 흰 글자를 못 받고, 흰 글자를 받는 어두운 단은 바탕에서 안 읽힌다.
     ⇒ 다크에서 `-color` 와 `-strong` 이 두 단 벌어지는 것이 그 결과다.
     `tests/build/token-contrast.test.ts` 가 값을 지킨다.
     ========================================================================== */

  /* primary — 브랜드 · 강조 · 포커스 · 링크 */
  --u-primary-color-weakest:     var(--u-blue-200);
  --u-primary-color-weaker:      var(--u-blue-300);
  --u-primary-color-weak:        var(--u-blue-500);
  --u-primary-color:             var(--u-blue-600);  /* 면: 흰 글자 6.09 ✓ */
  --u-primary-color-strong:      var(--u-blue-800);  /* 글자: 바탕 5.32 ✓ (700 은 4.05 ✗) */

  /* info — 정보 안내 (primary 와 기본값은 같으나 역할이 다르다 — 브랜딩은 primary 만 바꾼다) */
  --u-info-color-weakest:        var(--u-blue-200);
  --u-info-color-weaker:         var(--u-blue-300);
  --u-info-color-weak:           var(--u-blue-500);
  --u-info-color:                var(--u-blue-600);
  --u-info-color-strong:         var(--u-blue-800);

  /* secondary — 보조 브랜드 색(light.css 참조). primary 와 같은 단 구성이다. */
  --u-secondary-color-weakest:   var(--u-purple-200);
  --u-secondary-color-weaker:    var(--u-purple-300);
  --u-secondary-color-weak:      var(--u-purple-500);
  --u-secondary-color:           var(--u-purple-600);  /* 면: 흰 글자 6.03 ✓ */
  --u-secondary-color-strong:    var(--u-purple-800);  /* 글자: 바탕 5.77 ✓ (700 은 4.17 ✗) */

  /* success — 성공 · 완료 */
  --u-success-color-weakest:     var(--u-green-200);
  --u-success-color-weaker:      var(--u-green-300);
  --u-success-color-weak:        var(--u-green-500);
  --u-success-color:             var(--u-green-600);
  --u-success-color-strong:      var(--u-green-700);

  /* warning — 주의 */
  --u-warning-color-weakest:     var(--u-yellow-200);
  --u-warning-color-weaker:      var(--u-yellow-300);
  --u-warning-color-weak:        var(--u-yellow-500);
  --u-warning-color:             var(--u-yellow-600);
  --u-warning-color-strong:      var(--u-yellow-700);

  /* danger — 오류 · 위험 · 유효성 실패 */
  --u-danger-color-weakest:      var(--u-red-200);
  --u-danger-color-weaker:       var(--u-red-300);
  --u-danger-color-weak:         var(--u-red-500);
  --u-danger-color:              var(--u-red-600);  /* 면: 흰 글자 6.83 ✓ */
  --u-danger-color-strong:       var(--u-red-800);  /* 글자: 바탕 4.87 ✓ (700 은 3.67 ✗) */
  /* Text Colors */
  --u-txt-color:             var(--u-neutral-900);
  --u-txt-color-inverse:     var(--u-neutral-100);

  /* 유채색 배경 위의 글자 — warning 만 다르다(light.css 참조). */
  --u-primary-txt-color:     #FFFFFF;
  --u-info-txt-color:        #FFFFFF;
  --u-secondary-txt-color:   #FFFFFF;
  --u-success-txt-color:     #FFFFFF;
  --u-danger-txt-color:      #FFFFFF;
  /* ★라이트 시트와 같은 이유로 중립 최상단을 쓴다 — 다크에서는 그 값이 #FFFFFF 라
     결과가 종전과 같다(4.65 ✓). 리터럴 대신 토큰을 쓰는 이유는 라이트에서 뒤집히기
     때문이다(#000000). 두 시트가 같은 선언이 되어 어긋날 자리가 없어진다. */
  --u-warning-txt-color:     var(--u-neutral-1000);
  --u-txt-color-hover:       var(--u-primary-color-strong);
  --u-txt-color-active:      var(--u-primary-color-strong);
  --u-txt-color-disabled:    var(--u-neutral-500);
  /* 라이트와 같은 기준 — 놓이는 모든 면에서 AA. neutral-700(#8A8A8A)은 바탕 5.43 ·
     올림면(neutral-300) 4.16 · active 면(neutral-400) 3.15 로 미달이었다.
     neutral-800(#B0B0B0) = 8.64 · 6.62 · 5.01. 본문(neutral-900)과의 대비비 1.46. */
  --u-txt-color-weak:        var(--u-neutral-800);
  /* ★Third text step — metadata, units, secondary columns, an empty value's dash: text that
     must stay readable (5.0 on the surface) but should recede behind -weak. Not a placeholder or a
     disabled colour (those are -disabled). */
  --u-txt-color-weaker:      var(--u-neutral-700);
  --u-txt-color-strong:      var(--u-neutral-1000);

  --u-link-txt-color:        var(--u-primary-color-strong);
  --u-tooltip-txt-color:     var(--u-neutral-100);

  /* Icon Colors */
  --u-icon-color:            var(--u-neutral-800);
  --u-icon-color-inverse:    var(--u-neutral-100);
  --u-icon-color-hover:      var(--u-primary-color-strong);
  --u-icon-color-active:     var(--u-primary-color-strong);
  --u-icon-color-disabled:   var(--u-neutral-500);

  /* Border Colors
     ★`-weak` 는 `neutral-300` 일 수 없다 — `--u-bg-color-raised` 가 같은 단이라, 올림면(사이드바·
       표 머리/행·마스터-디테일 구분선) 위에 그리는 약한 선이 **면과 같은 색**(대비 1.00)이 되어
       화면에서 사라진다. 라이트는 200 단이 올림면(50)과 떨어져 있어 보인다. 램프에서 올림면(300)
       위로 올릴 수 있는 다음 단이 400 뿐이라 `-weak` 는 이 테마에서 `--u-border-color` 와 같은
       단이다 — 다크에서는 «약함/보통» 두 단이 하나로 합쳐지지만, 종전 `-weak` 는 그것이 쓰이는
       면 위에서 애초에 구별되지 않았다. */
  --u-border-color:          var(--u-neutral-400);
  --u-border-color-weak:     var(--u-neutral-400);
  --u-border-color-strong:   var(--u-neutral-500);
  --u-border-color-hover:    var(--u-neutral-500);

  /* ★상태 테두리는 `-strong` 단이다 — light.css 의 같은 자리 주석 참조.
     이 테마가 실제로 미달이었다: focus 2.74 · invalid 2.44 → 4.74 / 4.34. */
  --u-input-border-color:         var(--u-neutral-400);
  --u-input-border-color-hover:   var(--u-neutral-500);
  --u-input-border-color-focus:   var(--u-primary-color-strong);
  --u-input-border-color-invalid: var(--u-danger-color-strong);

  /* Focus ring — a graphic drawn over the background, so it must clear 3:1 against it
     (WCAG 1.4.11). Defaults to the primary text step; a theme whose primary is a neutral
     ink can point it at an interaction hue instead. */
  --u-focus-ring-color:      var(--u-primary-color-strong);

  /* Selection — the mark of a chosen option (a checked checkbox, a selected radio, a switch that is on, a
     selected row's checkbox) and the check drawn on it. Defaults to the primary pair; a theme whose primary
     is a neutral ink can point the selection at an interaction hue, the way it does the focus ring. */
  --u-selection-color:       var(--u-primary-color);
  --u-selection-txt-color:   var(--u-primary-txt-color);

  /* Background Colors */
  --u-bg-color:              var(--u-neutral-100);
  --u-bg-color-inverse:      var(--u-neutral-0);
  --u-bg-color-hover:        var(--u-neutral-300);
  --u-bg-color-active:       var(--u-neutral-400);
  --u-bg-color-disabled:     var(--u-neutral-100);

  /* ★Canvas — the application background **behind** surfaces (page body, shell side
     panels). `--u-bg-color` is the surface: components paint their own face with it
     (buttons, menu items, options, tags, table bodies, sheets), so tinting it to make a
     page background greys every control inside a white card. Paint the page with this
     token instead and keep `--u-bg-color` as the surface. */
  --u-canvas-bg-color:       var(--u-neutral-50);

  /* 면 높이 — 상세는 light.css 참조. 다크는 **바탕보다 밝은 쪽**이 위다.
     neutral-300(#2A2A2A)은 바탕(#121212) 대비 1.42 로, 소비 측이 오버라이드로 쓰던
     neutral-200(1.15)보다 실제로 더 잘 구분된다 — 그 오버라이드가 해결하려던 증상이
     *"툴바·헤더가 배경에 묻힌다"* 였다. */
  --u-bg-color-raised:       var(--u-neutral-300);

  /* ★올림면 위의 hover — `--u-bg-color-hover`(전역, 바탕면 전용)와 값이 같아서
     («둘 다 neutral-300») 카드·표 머리 위에 마우스를 올려도 아무 일도 안 일어났다
     (소비자 실측). 전역 토큰 하나로는 "지금 위에 있는 면"을
     알 방법이 없어(참조 지점마다 계산 기준이 다를 수 없다) **전용 토큰**을 신설한다.

     ⚠**A안**(`raised`를 neutral-200으로) — 과거에 거부된 값(위 주석). **B안**(전역
     `hover`를 neutral-400으로) — `--u-bg-color-active` 와 충돌해 결함이 다른 쌍으로
     옮겨간다. ⇒ hover 는 본래 "현재 면보다 한 단 위"이지 절대 단이 아니므로
     `color-mix()` 로 raised 자신을 기준 삼아 상대 계산한다.

     N=6% 는 raised(L≈0.023)와 active(L≈0.047, neutral-400) 사이 대비 계산으로 골랐다 —
     결과 L≈0.038, raised 대비 ≈1.21(라이트의 기존 "약한" 1.04보다 뚜렷하고, `bg→raised`
     의 기존 1.31 과 비슷한 체감), active 와는 값이 달라 겹치지 않는다(≈#373737 vs
     active #3D3D3D). N 을 더 올리면(≈10%+) active 를 넘어서 순서가 뒤집힌다 — 확인함. */
  --u-bg-color-raised-hover: color-mix(in srgb, var(--u-bg-color-raised), white 6%);

  /* 유채색 표면 — 라이트와 **같은 단이 아니라 같은 세기**로 짝지었다(light.css 참조).
     팔레트 유채색 틴트가 다크에서 짓눌리므로 한 단 위를 쓴다. green 은 대칭이라 그대로. */
  --u-primary-bg-color:      var(--u-blue-100);
  --u-info-bg-color:         var(--u-blue-100);
  --u-secondary-bg-color:    var(--u-purple-100);
  --u-success-bg-color:      var(--u-green-0);
  --u-danger-bg-color:       var(--u-red-100);
  /* warning 합류 — 라이트는 yellow-200 이다(단 이름이 다른 이유는 light.css 참조). */
  --u-warning-bg-color:      var(--u-yellow-100);

  --u-input-bg-color:        var(--u-neutral-200);
  --u-panel-bg-color:        var(--u-neutral-200);
  --u-overlay-bg-color:      rgba(0, 0, 0, 0.7);
  --u-tooltip-bg-color:      rgba(255, 255, 255, 0.85);

  /* Shadow Colors */
  --u-shadow-color-weaker:   rgba(0, 0, 0, 0.15);
  --u-shadow-color-weak:     rgba(0, 0, 0, 0.25);
  --u-shadow-color-normal:   rgba(0, 0, 0, 0.35);
  --u-shadow-color-strong:   rgba(0, 0, 0, 0.45);
  --u-shadow-color-stronger: rgba(0, 0, 0, 0.60);

  /* Elevation Scale — 근거는 light.css 의 같은 자리 주석 참조.
     ★다크는 알파가 3배 가까이 진하다 — 리터럴로 흩어져 있던 종전에는 이 차이가
     적용되지 않아 다크에서 그림자가 사실상 보이지 않았다. */
  --u-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25), 0 1px 1px rgba(0, 0, 0, 0.14);    /* = shadow-color-weak */
  --u-shadow-md: 0 2px 8px rgba(0, 0, 0, 0.35), 0 1px 2px rgba(0, 0, 0, 0.18);    /* = shadow-color-normal */
  --u-shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.45), 0 2px 4px rgba(0, 0, 0, 0.22);   /* = shadow-color-strong */
  --u-shadow-xl: 0 6px 18px rgba(0, 0, 0, 0.60), 0 2px 6px rgba(0, 0, 0, 0.30);   /* = shadow-color-stronger */


  /* ==========================================================================
     Chart categorical palette — 다크 면(#121212 · 올림면 #2A2A2A)에 대해 **따로 고른** 여덟 칸
     ★램프를 참조하지 않는 이유: 다크 장식 램프는 채도가 낮아(면 위 배지·태그용) 차트 계열로는
       회색처럼 읽힌다 — 램프의 단 조합 39만 가지 중 검증을 통과한 것이 없었다. 그래서 라이트
       여덟 칸과 **같은 색상·순서**를 OKLCH 밝기만 다크 대역으로 옮겨 잡았다.
     검증: 밝기 0.48–0.67 · 채도 ≥ 0.1 · 색각 이상 이웃 ΔE ≥ 9.5 · 정상 시각 이웃 ΔE ≥ 25.1 ·
       두 면 모두 대비 ≥ 3:1. 순서는 light.css 와 같다.
     ========================================================================== */
  --u-chart-color-1: #247EDB;
  --u-chart-color-2: #D03E73;
  --u-chart-color-3: #0DA1B2;
  --u-chart-color-4: #ED5711;
  --u-chart-color-5: #059183;
  --u-chart-color-6: #D96D04;
  --u-chart-color-7: #AE48CB;
  --u-chart-color-8: #4AA74D;

  /* Scrollbar Colors */
  --u-scrollbar-color:       var(--u-neutral-500);
  --u-scrollbar-color-hover: var(--u-neutral-600);
  --u-scrollbar-track-color: transparent;
}

/* ==========================================================================
   ★모드와 무관한 스케일 — 반경·여백·글자 스케일·모션·글꼴.
   값이 light.css 와 **같다.** 그런데 위 블록(`:root[theme="dark"]`, 특이도 0,1,1)에 두면
   `:root`(0,1,0)로 이 토큰을 덮는 **모든 층**(하우스 프리셋·소비자 브랜드 시트)이 다크
   모드에서만 **로드 순서와 무관하게** 진다 — 에러도 경고도 없이, 색은 정상으로 바뀌므로
   «다크가 잘 된다» 로 보인다. `:where()` 로 특이도를 `:root` 와 같게 두면 층 모델이 라이트와
   똑같이 로드 순서로 선다.
   ⚠이 블록을 지우지 말 것 — 이 시트만 쓰는 «고정 다크 디자인» 소비자(docs/theming.md)는
   이 토큰들을 여기서 받는다. 두 시트를 함께 쓸 때는 값이 같으므로 어느 쪽이 이겨도 같다.
   ========================================================================== */
:root:where([theme="dark"]) {
  /* Field box — mode-independent (same as light.css). */
  --u-field-padding-block:   0.3em;
  --u-field-padding-inline:  0.6em;
  --u-field-radius:          0.25em;

  /* ==========================================================================
     Radius Scale — 모서리 반경
     리터럴을 흩뿌리면 값이 갈린다(실제로 pill 이 999px/9999px 두 표기로 나뉘어 있었다).
     ========================================================================== */
  --u-radius-none:   0;
  --u-radius-sm:     3px;
  --u-radius-md:     4px;
  --u-radius-lg:     6px;
  --u-radius-xl:     8px;
  /* ★상단 2단은 **면(surface)용**이다 — 카드·패널·대화상자처럼 큰 사각형은 컨트롤과
     같은 반경을 쓰면 각져 보인다. 기존 5단은 **컨트롤용**이고 값을 바꾸지 않는다
     (바꾸면 모든 소비자의 버튼·입력이 동시에 움직인다). */
  --u-radius-2xl:   12px;
  --u-radius-3xl:   16px;
  --u-radius-pill:   9999px;
  --u-radius-circle: 50%;

  /* ==========================================================================
     Layer Scale — 페이지 전역에서 겹치는 표면의 쌓임 순서
     컴포넌트 «안» 의 국소 순서(1~100)는 그 컴포넌트의 쌓임 맥락 안에서만 뜻이 있어 여기 두지 않는다.
     여기는 서로 다른 패키지의 표면이 페이지에서 다투는 층이다 — 값을 흩뿌리면 층이 갈린다
     (셸 1000 · 플로팅 1000 · 오버레이 9999 · 라이트박스 9999 가 각자 숫자였다).
     오버레이 띠의 실제 값은 OverlayManager 가 «동시에 열린 깊이» 로 인라인에 쓴다 — 이 토큰은
     그 띠의 시작값(열리기 전 기본값)이고 OverlayManager.OVERLAY_BASE 와 같아야 한다.
     ========================================================================== */
  --u-layer-shell:    1000;  /* 앱 셸의 사이드바·모바일 머리 */
  --u-layer-floating: 1000;  /* 팝오버·목록·메뉴 — 앵커를 따라 뜨는 표면 */
  --u-layer-overlay:  9999;  /* 대화상자·서랍·라이트박스 — 화면을 덮는 표면 */

  /* ==========================================================================
     Space Scale — 컨테이너·오버레이의 절대 여백
     ⚠**여백은 하나의 축이 아니다.** 이 스케일은 컨테이너/오버레이의 **레이아웃 여백**만
     담당한다. 폼·인라인 요소의 `em` 여백은 상속된 `font-size` 에 비례하는 것이 의도이므로
     **여기로 흡수하지 않는다.** 반경과 마찬가지로 테마와 무관하므로 두 시트가 같다.
     축 구분과 근거는 docs/design-tokens.md 참조.
     ========================================================================== */
  --u-space-3xs:  2px;
  --u-space-2xs:  4px;
  --u-space-xs:   6px;
  --u-space-sm:   8px;
  --u-space-md:  12px;
  --u-space-lg:  16px;
  /* ★상단 4단은 **화면 리듬**이다 — 카드 안쪽 여백(20~24)·섹션 간격(24~32)·페이지 여백
     (32~40). 종전에는 이 구간이 통째로 비어 있어 소비자가 전부 리터럴로 적었고,
     그래서 앱마다 화면 밀도가 달라졌다. `lg`(16px) 이하는 **요소 사이**, `xl` 이상은
     **영역 사이**로 나눠 쓴다.
     ⚠`xs: 6px` 는 4px 격자에서 벗어나 있으나 **바꾸지 않는다** — 이미 배선된 컨트롤
     여백이 전부 움직인다. 신규 단은 전부 4의 배수로 둔다. */
  --u-space-xl:  20px;
  --u-space-2xl: 24px;
  --u-space-3xl: 32px;
  --u-space-4xl: 40px;

  /* ==========================================================================
     Type Scale — 글자 크기·굵기·행간·자간의 **한 벌**
     ★**크기만 주면 스케일이 되지 않는다.** 소비자가 크기만 받고 굵기·행간을 각자 정하면
     결국 화면마다 다른 위계가 생긴다 — 그래서 네 값을 **단 단위로 묶어** 낸다.

     단 이름은 크기가 아니라 **역할**이다(`lg`/`xl` 이 아니라 `title`/`label`). 역할로 두면
     소비자가 *"어느 크기를 쓸까"* 가 아니라 *"이 글자는 무엇인가"* 를 묻게 된다.

     ★**한글 기준으로 값을 골랐다**:
       ⑴ 행간은 **1.4 이상**. 라틴 관례(1.2)는 한글에서 답답하다 — 받침 때문에 글자 상자가
          세로로 꽉 차 있어 라틴과 같은 행간이면 줄이 붙어 보인다.
       ⑵ 자간은 **0 이 기본**이고 큰 제목만 **음수**. 한글에 양수 자간(letter-spacing)을 주면
          가독성이 떨어진다 — 라틴 소문자 조판 관례를 그대로 옮기면 안 되는 자리다.
       ⑶ `overline` 에만 양수 자간을 둔다. 그 단은 **영문·숫자 라벨**을 전제한 자리이고,
          한글을 넣을 소비자는 자간을 0 으로 덮어야 한다(문서에 명시).

     ⚠**`text-transform` 은 토큰으로 내지 않는다.** 한글에는 대문자가 없어 `uppercase` 가
       아무 효과가 없고, 영문이 섞이면 그것만 커져 오히려 어수선해진다.
     ========================================================================== */
  --u-text-display-size:     26px;
  --u-text-display-weight:   700;
  --u-text-display-leading:  1.4;
  --u-text-display-tracking: -0.02em;

  --u-text-title-size:       20px;
  --u-text-title-weight:     700;
  --u-text-title-leading:    1.45;
  --u-text-title-tracking:   -0.01em;

  --u-text-subtitle-size:    16px;
  --u-text-subtitle-weight:  600;
  --u-text-subtitle-leading: 1.5;
  --u-text-subtitle-tracking: 0;

  --u-text-body-size:        14px;
  --u-text-body-weight:      400;
  --u-text-body-leading:     1.6;
  --u-text-body-tracking:    0;

  --u-text-label-size:       13px;
  --u-text-label-weight:     600;
  --u-text-label-leading:    1.5;
  --u-text-label-tracking:   0;

  --u-text-caption-size:     12px;
  --u-text-caption-weight:   400;
  --u-text-caption-leading:  1.5;
  --u-text-caption-tracking: 0;

  --u-text-overline-size:    11px;
  --u-text-overline-weight:  700;
  --u-text-overline-leading: 1.45;
  --u-text-overline-tracking: 0.06em;

  /* ==========================================================================
     Motion — 지속시간·이징
     ★값이 없으면 앱마다 다른 속도가 생기고, `prefers-reduced-motion` 은 **반드시**
     빠뜨리는 앱이 나온다. 축을 여기 두고 존중 규칙은 아래 미디어 쿼리가 진다.
     ========================================================================== */
  --u-duration-instant: 80ms;
  --u-duration-fast:   140ms;
  --u-duration-normal: 220ms;
  --u-duration-slow:   320ms;
  --u-ease-standard:   cubic-bezier(0.2, 0, 0, 1);
  --u-ease-decelerate: cubic-bezier(0, 0, 0, 1);
  --u-ease-accelerate: cubic-bezier(0.3, 0, 1, 1);

  /* ==========================================================================
     Font Styles
     ★**CJK 폴백을 스택에 포함한다 — 국제화이지 취향이 아니다.**
     종전 스택(`-apple-system, Segoe UI, Noto Sans, Helvetica, Arial`)에는 **한중일 글립을
     가진 폰트가 하나도 없었다.** Windows 에서 한글은 `Segoe UI` 에 없으므로 UA 가 임의로
     맑은 고딕을 고르고, macOS 는 `-apple-system` 이 Apple SD Gothic Neo 를 준다 ⇒ **같은 앱이
     OS 마다 다른 글꼴로 렌더**됐다. 폴백을 명시하면 그 선택이 결정적이 된다.
     ⚠**웹폰트를 로드하지 않는다.** 라이브러리가 네트워크 요청을 만들면 소비자의 CSP·
     오프라인 환경을 깬다. 스택 맨 앞의 `Pretendard` 는 **소비자가 로드했을 때만** 잡히는
     선택적 이름이다(없으면 조용히 다음으로 넘어간다).
     ========================================================================== */
  --u-font-base:    'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', 'Hiragino Sans', 'Yu Gothic UI', 'Microsoft YaHei', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
  --u-font-mono:    ui-monospace, 'Cascadia Code', Consolas, 'Source Code Pro', Menlo, Monaco, 'Courier New', monospace;
  --u-font-serif:   'Georgia', 'Times New Roman', Times, serif;
  --u-font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
  --u-font-modern:  'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --u-font-rounded: 'Nunito', 'Quicksand', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ★`prefers-reduced-motion` — light.css 와 같은 규칙을 이 시트도 진다. 이 시트만 쓰는
   소비자가 있고, 두 시트를 함께 쓸 때는 어느 시트가 뒤에 오든 **마지막 선언이 이 0ms**
   가 되도록 각 시트가 자기 블록 뒤에 둔다. 종전에는 지속시간이 위 (0,1,1) 블록에 있어
   다크 모드에서 «동작 줄이기» 설정이 **무시됐다.** */
@media (prefers-reduced-motion: reduce) {
  :root:where([theme="dark"]) {
    --u-duration-instant: 0ms;
    --u-duration-fast:    0ms;
    --u-duration-normal:  0ms;
    --u-duration-slow:    0ms;
  }
}

} /* @layer iyu.base */
