/* =========================================================================
   SABI Sky Omakase, Design Biến + Reset + Typography utilities
   Single source of truth for colors, typography, spacing.
   Brand DNA: Sumi #1B1B1B + Bronze #997E65 + Be Vietnam Pro + EB Garamond
   Updated: Phase 7.9.A
   ========================================================================= */

:root {
  /* ===== SUMI palette (dark, main mood) ===== */
  --sumi:         #1B1B1B;
  --sumi-2:       #252526;
  --charcoal:     #161513;
  --sumi-deep:    #0F0E0D; /* image void background */
  --ink:          #2A2826;
  --line:         rgba(232, 223, 208, 0.08);
  --line-strong:  rgba(232, 223, 208, 0.18);

  /* ===== BONE palette (light, text/contrast on dark) ===== */
  --bone:         var(--bone-warm); /* T1 alias - deprecated, will remove T6 */
  --bone-bright:  #F3F4F4;

  /* ===== BRONZE palette (accent) ===== */
  --bronze:        #997E65;
  --bronze-soft:   var(--bronze); /* T1 alias - deprecated, will remove T6 */
  --bronze-bright: #FFBC7D;
  --bronze-light:  #B59879; /* manifesto sub-accent (tam-giac + nguyen-lieu) */

  /* ===== GRAY (text mute) ===== */
  --wabi:         var(--bone-warm); /* T1 alias - deprecated, will remove T6 */
  --stone:        #595959;

  /* ===== SEMANTIC ===== */
  --moss:         #5F8A6A;
  --hansko:       #5C1518;

  /* ===== TYPOGRAPHY ===== */
  --sans:  'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --serif: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --jp:    'Noto Serif JP', 'EB Garamond', Georgia, serif;

  /* ===== SPACING ===== */

  /* ===== RADIUS ===== */

  /* ===== TYPE SCALE (Phase 8.7-typo final) ===== */
  --fs-caption:  0.875rem;
  --fs-body:     1.0625rem;
  --fs-lead:     1.1875rem; /* 19px, chủ dự án chốt 25/10/2026 (SABI Typography v1.0); bản 1.1 từng hạ 17px */
  --fs-h3:       clamp(1.5rem, 2.2vw, 1.875rem);
  --fs-h2: var(--fs-h1); /* v1.0 strategy: alias deprecated → K2 display */
  --fs-h1:       clamp(3rem, 5.5vw, 5rem);

  /* ═══ STRATEGY v1.0: Image + Kanji Foundation ═══
   * Reference: Aman, Noma, Kinfolk, Sake Voyager v15 chuẩn quốc tế.
   * Added: 2026-05-13 (Tier STRATEGY-1)
   * ═════════════════════════════════════════════════ */

  /* Image aspect ratios: 3 chuẩn duy nhất */
  --ratio-cinema:   16 / 9;    /* hero, chapter (Aman editorial) */
  --ratio-portrait: 4 / 5;     /* card, gallery (Kinfolk editorial) */
  --ratio-square:   1 / 1;     /* decoration, pillar (Cereal minimalism) */

  /* Kanji decoration sizes: K1-K4 roles */

  /* Kanji opacity standards: strict per role */
  --opacity-stamp:   0.95;   /* K1 stamp inline (Sake Voyager precedent) */
  --opacity-ghost:   0.06;   /* K3 ghost background (Sake Voyager strict) */
  --opacity-pillar:  0.20;   /* K4 pillar image overlay (Yahoo Japan pattern) */

  /* ─── DEPRECATED ALIASES (Strategy v1.0) ───────────────────
   * Legacy --fs-stamp added here (not in bien-thiet-ke.css before).
   * STRATEGY-2 will migrate consumers to --fs-h1, then remove.
   * ───────────────────────────────────────────────────────── */


  /* ===== LETTER-SPACING SCALE ===== */
  --ls-tight:    -0.005em;
  --ls-normal:    0;
  --ls-wide:      0.04em;
  --ls-button:    0.18em;
  --ls-eyebrow:   0.32em;

  /* ===== LINE-HEIGHT SCALE ===== */
  --lh-flat:     1;
  --lh-tight:    1.15;
  --lh-snug:     1.35;
  --lh-base:     1.6;
  --lh-relaxed:  1.75;

  /* ===== FONT-WEIGHT SCALE ===== */
  --fw-light:    300;
  --fw-regular:  400;
  --fw-medium:   500;

  /* ===== EASING ===== */
  --ease:        cubic-bezier(.22,.61,.36,1);
  --ease-luxury: cubic-bezier(.7,0,.3,1);

  /* ============================================
     DESIGN SYSTEM ADDITIONS (Phase 8.A)
     ============================================ */

  /* Layout containers - 4 cấp hierarchy */
  --container-xl:      1640px;
  --container-wide:    1280px;
  --container-default: 1080px;
  --container-narrow:   720px;
  --container-prose:    580px;

  /* Horizontal padding */
  --pad-x:    clamp(24px, 5vw, 60px);
  --pad-x-lg: clamp(32px, 6vw, 80px);

  /* Vertical section spacing - 3 nhịp */
  --space-section:       clamp(100px, 14vh, 160px);
  --space-section-grand: clamp(120px, 18vh, 200px);
  --space-section-tight: clamp(64px,  9vh,  96px);

  /* Image size scale - philosophy pages CẤM vượt 640px */
  --img-feature:       640px;

  /* Typography missing biến */

  /* Manifesto hero scale, áp 5 trang Group A câu chuyện */
  --space-hero-top:     clamp(120px, 18vh, 200px);
  --space-hero-bottom:  clamp(80px,  12vh, 140px);
  --header-height:      72px;

  /* === ALIAS BIẾN - tương thích cả 2 tên cũ + mới === */
  --fs-eyebrow: 0.75rem;
  --fs-ghost:   clamp(280px, 36vw, 520px); /* v1.0 strategy: match Sake Voyager v15 precedent */

  /* Line-height specifics */

  /* ============================================
     DESIGN SYSTEM ADDITIONS (Phase 8.D)
     Spacing 8pt grid, component, letter-spacing, SVG
     ============================================ */

  /* Spacing scale - 8pt grid */
  --space-1:    8px;
  --space-2:   16px;
  --space-3:   24px;
  --space-4:   32px;
  --space-5:   40px;
  --space-6:   48px;
  --space-7:   56px;
  --space-8:   64px;
  --space-9:   80px;
  --space-10:  96px;

  /* Letter-spacing additions for kanji */

  /* Component biến - Button */
  --btn-pad-y:    18px;
  --btn-pad-x:    48px;
  --btn-pad-y-sm: 16px;
  --btn-pad-x-sm: 40px;

  /* Component biến - Card */
  --card-pad-l:    40px;
  --card-pad-l-sm: 28px;

  /* SVG figure max-width */
  --svg-figure-max: 420px;

  /* === PHASE A ADDITIONS (v0.9.0) === */
  --bone-warm:    #C9C5BC;
  --fs-manifesto: clamp(1.75rem, 3vw, 2.375rem);
}

/* ============================================================
   SABI Typography v1.0: DEPRECATION NOTES
   Date: May 2026 · SABI_VERSION 0.11.0
   Reference: SABI-Typography-System-v1.0.md
   ============================================================

   ACTIVE BIẾN (chốt sử dụng):
   - Fonts: --serif (EB Garamond), --jp (Noto Serif JP)
            --sans (Be Vietnam Pro): chỉ utility (form, CRM, login)
   - Sizes: --fs-h1, --fs-h3, --fs-lead, --fs-ghost
   - Weights: --fw-light, --fw-regular
   - Letter-spacing: --ls-tight, --ls-wide
   - Line-heights: --lh-tight, --lh-snug, --lh-relaxed
   - Text colors: --bone-bright, --bone-warm, --bronze
   - Bg colors: --sumi, --charcoal, --line, --line-strong
   - Animation: --ease-luxury

   DEPRECATED (sẽ migrate dần qua Phase 76+):
   - --fs-h2, --fs-body, --fs-caption, --fs-eyebrow → merge --fs-lead/--fs-h1/--fs-h3
   - --fs-display, --fs-manifesto, --fs-manifesto-title → bỏ
   - --fw-medium, --fw-bold → bỏ
   - --ls-button, --ls-eyebrow, --ls-extra-wide → bỏ
   - --lh-flat, --lh-base, --lh-hero, --lh-heading, --lh-prose → bỏ
   - --bone → migrate --bone-warm
   - --wabi → migrate --bone-warm + opacity 0.7
   - --bronze-soft → migrate --bronze + opacity 0.85

   Biến deprecated VẪN GIỮ trong file để tránh vỡ các page CSS chưa migrate.
   Sẽ xóa hẳn sau Phase 84 (final QA toàn site đã align v1.0).
   ============================================================ */

/* ============================================================
   CRM TYPOGRAPHY BIẾN v1.0 (SABI_VERSION 0.20.61+)
   ============================================================
   Internal admin tool: efficiency over aesthetic.
   Rules HARD:
   - NEVER italic (italic = decoration luxury, không fit admin tool)
   - NEVER serif (chỉ Be Vietnam Pro)
   - 3 weights tối đa: 400 / 500 / 600 (không 300, không 700+)
   - 7 font sizes tối đa (xs/sm/base/md/lg/xl/xxl)
   - UPPERCASE labels OK (data-table convention)
   ============================================================ */
:root {
    /* Font families: CRM only */
    --crm-font: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --crm-mono: 'SF Mono', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;

    /* Font sizes: compact scale */
    --crm-fs-xs:    12px;   /* labels uppercase, badges */
    --crm-fs-sm:    13px;   /* table cells, secondary info */
    --crm-fs-base:  14px;   /* DEFAULT body: HubSpot/Salesforce baseline */
    --crm-fs-md:    15px;   /* card titles */
    --crm-fs-lg:    17px;   /* section titles */
    --crm-fs-xl:    22px;   /* page titles */
    --crm-fs-xxl:   30px;   /* dashboard KPI numbers */
    --crm-fs-hero:  56px;   /* hero stat number */

    /* Font weights: strict 3 levels */
    --crm-fw-regular:  400;
    --crm-fw-medium:   500;
    --crm-fw-semibold: 600;

    /* Line heights: compact */
    --crm-lh-tight: 1.2;
    --crm-lh-snug:  1.4;
    --crm-lh-base:  1.5;

    /* Letter spacing */
    --crm-ls-tight:   -0.005em;
    --crm-ls-normal:  0;
    --crm-ls-wide:    0.05em;
    --crm-ls-eyebrow: 0.1em;     /* for UPPERCASE labels */
}

/* ============================================================
   CRM UI KIT BIẾN v1.0 (SABI_VERSION 0.20.96+)
   ============================================================
   Modal, Toast, Confirm, Hỏi nhập: overlay/z-index/shadow biến
   for SABI CRM UI Kit (sabiToast/Confirm/Hỏi nhập): Đợt 2.

   Rules HARD:
   - All modal/toast CSS MUST use these biến (no hardcode)
   - CRM scope only: front-end editorial pages use --serif/--sans
   ============================================================ */
:root {
    /* Text hierarchy (modal/card body) */
    --crm-text:        #E5E5E5;  /* body text in dark cards */
    --crm-text-muted:  #999DA0;  /* secondary, icon buttons */
    --crm-text-bright: var(--bone-bright);  /* alias for titles */

    /* Backdrops */
    --crm-overlay:     rgba(15, 15, 15, 0.85);  /* modal backdrop */

    /* Z-index scale */
    --z-modal:         99999;
    --z-toast:         9999;

    /* Transitions */
    --crm-transition:      0.25s var(--ease);
    --crm-transition-fast: 0.15s var(--ease);

    /* Shadows */
    --shadow-modal: 0 24px 64px rgba(0, 0, 0, 0.6);
    --shadow-toast: 0 12px 28px rgba(0, 0, 0, 0.4);

    /* Status semantic aliases */
    --crm-success: var(--moss);
    --crm-danger:  var(--hansko);
    --crm-warning: var(--bronze-bright);
    --crm-info:    var(--bronze);
}
