/* =========================================================================
   d' branding — Foundation tokens
   Achromatic only. No hue, no gradient, no shadow.
   ========================================================================= */

/* ----- Webfonts -----------------------------------------------------------
   Pretendard (Korean) — OFL, loaded via CDN.
   Roboto Condensed (Latin substitute for Helvetica Neue Condensed)
   — Google Fonts. Replace with licensed Helvetica when available.
*/
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable.css');
@import url('https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@300;400&display=swap');

:root {
  /* ----- Layer 1 — Platform Master Palette (per guide §3.1) ------------
     Authoritative names match the brand guide. The legacy short tokens
     beneath are kept as aliases so existing UI keeps working.            */
  --carbon-black:  #0A0A0A;   /* dark mode bg, deep blacks */
  --ink-black:     #1A1A1A;   /* body text on light */
  --slate:         #4A4A4A;   /* secondary text, descriptions */
  --mid-gray:      #999999;   /* captions, labels, inactive */
  --light-gray:    #D4D4D4;   /* dividers, subtle borders */
  --paper-master:  #F4F4F2;   /* light mode page background */
  --pure-white:    #FFFFFF;   /* package base, content surfaces */

  /* Legacy aliases — kept for ui_kits compatibility */
  --ink:       var(--carbon-black);
  --ink-2:     #1C1C1C;
  --graphite:  var(--slate);
  --ash:       #6F6F6F;
  --fog:       var(--mid-gray);
  --mist:      var(--light-gray);
  --paper-2:   #EAE8E3;
  --paper:     var(--paper-master);
  --white:     var(--pure-white);

  /* ----- Layer 2 — Sub-brand Color Reservation (per guide §3.2) --------
     d' platform never uses these in UI. Documented for cross-channel
     reference (doopeeboo for SCALP retains its own visual system).      */
  --doopeeboo-cyan:        #00AEEF;   /* doopeeboo for SCALP master */
  --scalp-yellow:          #F9ED32;   /* Twoface Scalp Scaler */
  --scalp-green:           #39B54A;   /* Gentle Fortifying Shampoo */

  /* ----- Layer 3 — Editorial Accent Palette (per guide §3.3) -----------
     PHOTOGRAPHY / CAMPAIGN MOOD ONLY. Never used for UI (text, buttons,
     borders, backgrounds). Each colour belongs to one of the five
     stages of self-manifestation.                                        */
  --accent-compose:   #0A0A0A;   /* d'compose · 잠재의식 · 헤테로토피아 */
  --accent-tox:       #5EB1B0;   /* d'tox · 정화 · 흐름 */
  --accent-fine:      #6B7280;   /* d'fine · 사색 · 윤곽 */
  --accent-realize:   #8B0000;   /* d'realize · 욕망 · 발현 */
  --accent-bunk:      #B8860B;   /* d'bunk · 도발 · 균열 */

  /* ----- Semantic surface ---------------------------------------------- */
  --bg:            var(--paper);
  --bg-elevated:   var(--white);
  --bg-soft:       var(--paper-2);
  --bg-inverse:    var(--ink);

  --fg:            var(--ink);
  --fg-2:          var(--graphite);
  --fg-3:          var(--ash);
  --fg-disabled:   var(--ash);
  --fg-on-ink:     var(--paper);

  --rule:          var(--mist);
  --rule-strong:   var(--ink);
  --rule-on-ink:   var(--fog);

  /* ----- Type families -------------------------------------------------- */
  /* Latin: Helvetica Neue Condensed when available, else Roboto Condensed. */
  --font-latin:
    'Helvetica Neue', 'HelveticaNeue', 'HelveticaNeue-CondensedLight',
    'Helvetica Neue Condensed', 'Roboto Condensed', 'Arial Narrow',
    Helvetica, Arial, sans-serif;

  /* Korean: Pretendard, with system Korean fallbacks. */
  --font-kr:
    'Pretendard Variable', 'Pretendard', 'Apple SD Gothic Neo',
    'Noto Sans KR', sans-serif;

  /* Mixed-script default — Latin first, Korean falls in via unicode-range
     of Pretendard. Use this as the global font-family. */
  --font-sans:
    'Helvetica Neue', 'HelveticaNeue', 'HelveticaNeue-CondensedLight',
    'Helvetica Neue Condensed', 'Roboto Condensed', 'Arial Narrow',
    'Pretendard Variable', 'Pretendard', 'Apple SD Gothic Neo',
    'Noto Sans KR', Helvetica, Arial, sans-serif;

  /* Mono is not part of the system. Provided for code blocks only. */
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* ----- Type scale (paper-set, 1.15 / 1.55) ---------------------------- */
  --fs-display-1:  88px;   /* hero, packaging-style title */
  --fs-display-2:  64px;
  --fs-display-3:  48px;
  --fs-h1:         36px;
  --fs-h2:         28px;
  --fs-h3:         22px;
  --fs-h4:         18px;
  --fs-body:       16px;
  --fs-body-sm:    14px;
  --fs-caption:    12px;
  --fs-label:      11px;   /* all-caps section markers */

  --lh-display:    1.05;
  --lh-heading:    1.15;
  --lh-body:       1.55;
  --lh-tight:      1.25;

  --tracking-label:    0.18em;   /* all-caps Latin section markers */
  --tracking-display: -0.01em;   /* slight negative on display sizes */
  --tracking-body:     0.00em;
  --tracking-kr:       0.02em;   /* generous limit on Korean */

  --weight-light:    300;
  --weight-regular:  400;
  /* No bold weight. Bold is forbidden in headlines. Body bold is unused. */

  /* ----- Spacing scale (4px base) -------------------------------------- */
  --space-1:    4px;
  --space-2:    8px;
  --space-3:   12px;
  --space-4:   16px;
  --space-5:   24px;
  --space-6:   32px;
  --space-7:   48px;
  --space-8:   64px;
  --space-9:   96px;
  --space-10: 144px;
  --space-11: 200px;

  /* ----- Layout -------------------------------------------------------- */
  --grid-cols:    12;
  --grid-gutter:  32px;
  --grid-margin: 144px;
  --content-max: 1280px;
  --measure:      52ch;       /* maximum body width */

  /* ----- Radii (square is the brand) ----------------------------------- */
  --radius-0:     0px;        /* default everywhere */
  --radius-pill: 999px;       /* circular badges only */

  /* ----- Borders ------------------------------------------------------- */
  --border-hair: 1px solid var(--mist);
  --border-ink:  1px solid var(--ink);
  --border-fog:  1px solid var(--fog);

  /* ----- Motion -------------------------------------------------------- */
  --ease:           cubic-bezier(0.2, 0, 0.2, 1);
  --duration-hover: 200ms;
  --duration-base:  400ms;
  --duration-page:  600ms;

  /* ----- Modal scrim (the only permitted overlay) ---------------------- */
  --scrim: rgba(10, 10, 10, 0.55);
}

/* =========================================================================
   Semantic primitives
   ========================================================================= */

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-weight: var(--weight-light);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-stretch: 75%;            /* condensed when font supports it */
}

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

/* ----- Display & headings ----- */
.d-display-1,
.d-display-2,
.d-display-3,
.d-h1,
.d-h2,
.d-h3,
.d-h4 {
  font-family: var(--font-sans);
  font-weight: var(--weight-light);     /* light only — no bold headlines */
  letter-spacing: var(--tracking-display);
  color: var(--fg);
  margin: 0;
}

.d-display-1 { font-size: var(--fs-display-1); line-height: var(--lh-display); }
.d-display-2 { font-size: var(--fs-display-2); line-height: var(--lh-display); }
.d-display-3 { font-size: var(--fs-display-3); line-height: var(--lh-display); }
.d-h1        { font-size: var(--fs-h1);        line-height: var(--lh-heading); }
.d-h2        { font-size: var(--fs-h2);        line-height: var(--lh-heading); }
.d-h3        { font-size: var(--fs-h3);        line-height: var(--lh-heading); }
.d-h4        { font-size: var(--fs-h4);        line-height: var(--lh-heading); }

/* ----- Body ----- */
.d-body {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--weight-light);
  letter-spacing: var(--tracking-body);
  max-width: var(--measure);
}

.d-body-sm {
  font-size: var(--fs-body-sm);
  line-height: var(--lh-body);
  font-weight: var(--weight-light);
}

.d-caption {
  font-size: var(--fs-caption);
  line-height: var(--lh-tight);
  color: var(--fg-3);
  font-weight: var(--weight-light);
}

/* ----- Section label / eyebrow ----- */
.d-label {
  font-size: var(--fs-label);
  line-height: 1;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--fg-3);
  font-weight: var(--weight-regular);
}

/* ----- Korean-first text class — slightly more tracking ----- */
.d-kr {
  font-family: var(--font-kr);
  letter-spacing: var(--tracking-kr);
  font-stretch: normal;
}

/* ----- Links ----- */
.d-link, a.d-link {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: text-decoration-thickness var(--duration-hover) var(--ease);
}
.d-link:hover { text-decoration-thickness: 2px; }

/* ----- Hairline rule ----- */
.d-rule { border: 0; border-top: var(--border-hair); margin: 0; }

/* ----- Focus ring (square, 2px offset, ink) ----- */
:where(button, a, input, textarea, select, [tabindex]):focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 2px;
  border-radius: 0;
}
