/* ============================================================
   COLORS
   Warm paper (clean/technical) ←→ Midnight (magical/deep).
   Base ramps + brand accents, then semantic aliases.
   ============================================================ */
:root {
  /* — Warm paper ramp (light surfaces) — */
  --paper:        #F4EFE6; /* page background */
  --paper-raised: #FBF8F1; /* cards / raised on paper */
  --paper-sunken: #EBE3D4; /* wells, insets, code blocks */
  --paper-edge:   #E0D6C2; /* warm divider / subtle border */

  /* — Ink ramp (plum-tinted near-blacks → muted) — */
  --ink:    #21102B; /* primary text, strong fills — 15.6:1 on paper */
  --ink-2:  #4E3F57; /* secondary text — 8.4:1 */
  --ink-3:  #75667D; /* muted text, captions — 4.6:1 */
  --ink-4:  #A397A8; /* hairline-strong, disabled text */
  --line:   rgba(33, 16, 43, 0.12); /* hairline on paper */
  --line-2: rgba(33, 16, 43, 0.06); /* faint blueprint grid */

  /* — Dusk ramp (deep surfaces, sampled from the headshot) — */
  --midnight:    #1E0B29; /* deep dusk background */
  --midnight-2:  #2A1238; /* raised on dusk */
  --midnight-3:  #3A1A4C; /* hover / inset on dusk */
  --night-text:    #F7ECF6; /* primary text on dusk — 16:1 */
  --night-text-2:  #C9B3D1; /* secondary on dusk — 9.6:1 */
  --night-text-3:  #A68BB0; /* muted on dusk — 6.1:1 */
  --night-line:  rgba(255, 255, 255, 0.12);
  --night-line-2: rgba(255, 255, 255, 0.05);

  /* — Hero gradient: matches the headshot background top → bottom — */
  --dusk-violet: #6E08A0;
  --dusk-plum:   #7A1C66;
  --dusk-ember:  #86282C;
  --dusk-gradient: linear-gradient(180deg, var(--dusk-violet) 0%, var(--dusk-plum) 55%, var(--dusk-ember) 100%);

  /* — Brand accents —
     Variable names kept from the original system so nothing breaks;
     "indigo" now holds violet and "aura" holds neon pink. */
  --indigo:        #6A11A3; /* PRIMARY — violet — 8.3:1 on paper */
  --indigo-strong: #540C84; /* pressed / deep */
  --indigo-soft:   #EFE2F7; /* tint surface on paper */
  --aura:          #FF7AC8; /* neon pink — accent on dusk — 7.8:1 */

  --magenta:       #C81E8E; /* SECONDARY — hover, selection, highlights — 4.6:1 */
  --magenta-strong:#A3166F;
  --magenta-soft:  #F8DDEE;

  --ember:       #D9482B; /* SPARK — the brand dot, big numbers only (3.7:1) */
  --ember-strong:#B83A20; /* ember for small text and buttons — 5:1 */
  --ember-soft:  #FBE3D8; /* tint surface on paper */
  --ember-bright:#FF8A5B; /* on dusk — 8:1 */

  --gold:        #E6A93C; /* legacy tertiary, no longer used on the homepage */
  --gold-strong: #C98A22;
  --gold-soft:   #F7E9C9;

  /* — Functional states — */
  --success: #2E9E6B;
  --warning: #E0982A;
  --danger:  #D2402A;
  --info:    #6A11A3;

  /* ===========================================================
     SEMANTIC ALIASES — prefer these in components.
     Defaults below resolve to the warm-paper (light) theme.
     =========================================================== */
  --bg:              var(--paper);
  --surface:         var(--paper-raised);
  --surface-sunken:  var(--paper-sunken);
  --surface-inverse: var(--midnight);

  --text:        var(--ink);
  --text-muted:  var(--ink-2);
  --text-subtle: var(--ink-3);
  --text-faint:  var(--ink-4);
  --text-on-accent: #FBF8F1;
  --text-inverse:   var(--night-text);

  --border:        var(--line);
  --border-strong: var(--paper-edge);
  --grid-line:     var(--line-2);

  --accent:          var(--indigo);
  --accent-strong:   var(--indigo-strong);
  --accent-tint:     var(--indigo-soft);
  --accent-bright:   var(--aura);
  --accent-contrast: #FBF8F1;

  --spark:       var(--ember);       /* the brand "." dot */
  --spark-tint:  var(--ember-soft);
  --highlight:   var(--magenta);     /* magic / optimization */
  --highlight-tint: var(--magenta-soft);

  color-scheme: light;
}

/* ===========================================================
   NIGHT THEME — magical, deep. Apply on a section/page:
   <body data-theme="night"> or class="night".
   =========================================================== */
[data-theme="night"], .night {
  --bg:              var(--midnight);
  --surface:         var(--midnight-2);
  --surface-sunken:  #160720;
  --surface-inverse: var(--paper);

  --text:        var(--night-text);
  --text-muted:  var(--night-text-2);
  --text-subtle: var(--night-text-3);
  --text-faint:  #6E5878;
  --text-inverse: var(--ink);

  --border:        var(--night-line);
  --border-strong: var(--midnight-3);
  --grid-line:     var(--night-line-2);

  --accent:          var(--aura);
  --accent-strong:   #FF9AD6;
  --accent-tint:     rgba(255, 122, 200, 0.16);
  --accent-bright:   #FFB3DE;
  --accent-contrast: #1E0B29;

  --spark:       var(--ember-bright);
  --spark-tint:  rgba(217, 72, 43, 0.18);
  --highlight:   var(--aura);
  --highlight-tint: rgba(255, 122, 200, 0.16);

  color-scheme: dark;
}
