/* ── Sigil color system ───────────────────────────────────────────────
   "Editorial Instrument": warm paper-cream light mode + warm-charcoal IDE
   dark mode. ONE accent — Japanese vermillion (shu-iro). Vermillion never
   appears more than once per view; blue + ochre are structural supports
   for categorical data only, never decoration. */

:root {
  /* Base palette — light (paper) */
  --paper:            #FAF8F3;  /* primary background, book-cloth cream */
  --surface-sunken:   #F2EEE6;  /* subtle section / sunken card */
  --surface-card:     #EAE4D9;  /* elevated card, hangtag paper-stock */
  --ink:              #37352F;  /* primary text — Notion warm off-black */
  --ink-secondary:    #6B6862;  /* body / caption */
  --ink-tertiary:     #9B9A97;  /* metadata */
  --hairline:         #E3DDD2;  /* drafting-rule borders */

  /* Accents (light) */
  --vermillion:       #E94709;  /* THE accent — shu-iro ink */
  --vermillion-ink:   #C43A06;  /* pressed / hover-darken */
  --blue:             #225095;  /* Mondrian blue — categorical only */
  --ochre:            #C8902A;  /* sepia ochre — categorical only */

  /* Warm book-cloth neutrals — textures & fills, never text < #A8916E */
  --cloth-1:          #EFE8DA;
  --cloth-2:          #E0D4BE;
  --cloth-3:          #C9B79A;
  --cloth-4:          #A8916E;

  /* Greyscale data ramp (dark → light), 6 steps */
  --ramp-1:           #2B2A28;
  --ramp-2:           #57544E;
  --ramp-3:           #8A867E;
  --ramp-4:           #B4AFA4;
  --ramp-5:           #D6D0C4;
  --ramp-6:           #ECE7DC;

  /* ── Semantic aliases (theme-agnostic; consume these, not base names) ── */
  --bg:               var(--paper);
  --bg-sunken:        var(--surface-sunken);
  --bg-card:          var(--surface-card);
  --text:             var(--ink);
  --text-muted:       var(--ink-secondary);
  --text-faint:       var(--ink-tertiary);
  --border:           var(--hairline);
  --border-strong:    #D3CBBC;
  --accent:           var(--vermillion);
  --accent-press:     var(--vermillion-ink);
  --accent-contrast:  #FAF8F3;   /* text on a vermillion fill */
  --focus-ring:       #F0A184;   /* vermillion tint for focus halos */
}

/* ── Dark mode: warm-charcoal code-editor field ──────────────────────── */
:root[data-theme="dark"], .sigil-dark {
  --paper:            #1A1917;
  --surface-sunken:   #201F1C;
  --surface-card:     #232220;
  --ink:              #EDEAE2;  /* warm off-white, not #FFF */
  --ink-secondary:    #A8A39A;
  --ink-tertiary:     #6F6A61;
  --hairline:         #34322E;

  --vermillion:       #FF5B26;  /* AMOLED-lifted for legibility */
  --vermillion-ink:   #E24A1B;
  --blue:             #5B8FCF;
  --ochre:            #E0A93C;

  /* Syntax-highlight states — QUARANTINED to data marks, never chrome */
  --state-green:      #8FB573;
  --state-magenta:    #C98FB0;

  --cloth-1:          #2C2A27;
  --cloth-2:          #38352F;
  --cloth-3:          #4A463E;
  --cloth-4:          #6F6A61;

  --ramp-1:           #ECE7DC;
  --ramp-2:           #C7C1B4;
  --ramp-3:           #9A948A;
  --ramp-4:           #6F6A61;
  --ramp-5:           #48453F;
  --ramp-6:           #2C2A27;

  --surface-1:        #232220;  /* elevation 1 */
  --surface-2:        #2C2A27;  /* elevation 2 */
  --border-strong:    #45423C;
  --accent-contrast:  #1A1917;
  --focus-ring:       #7A3320;
}
