/* Living Magic — Tier 2 · Semantic roles
   Three theme scopes over one gold spine:
     :root         NOCTURNE — dark, mystical, luxurious (default)
     .theme-sand   SAND     — bright, earthen, quiet luxury
     .theme-olive  OLIVE    — the Vessel document ground
   Product code consumes ONLY these roles (plus Tier-3 control tokens below). */

:root {
  /* Surfaces */
  --bg:              var(--ink-900);
  --bg-raised:       var(--ink-800);
  --bg-inset:        var(--ink-950);
  --surface:         var(--ink-800);
  --surface-raised:  var(--ink-700);
  --surface-sunken:  var(--ink-950);
  --backdrop:        rgba(7, 6, 5, 0.66);

  /* Gilded glass */
  --glass-bg:        rgba(18, 16, 16, 0.55);
  --glass-bg-strong: rgba(11, 9, 8, 0.74);
  --glass-border:    var(--gold-a24);
  --glass-highlight: var(--light-a06);

  /* Verdigris glass — panels over living water (Verdigris surfaces only).
     Official recipe (chosen F): 22% ink tint + 10px blur + verd hairline. */
  --glass-verd:        rgba(11, 24, 21, 0.22);
  --glass-verd-strong: rgba(9, 20, 17, 0.72);
  --glass-verd-border: rgba(148, 193, 176, 0.28);

  /* Text */
  --text:            var(--sand-50);
  --text-strong:     var(--white);
  --text-muted:      var(--taupe-400);
  --text-faint:      var(--taupe-500);
  --text-on-accent:  var(--ink-900);
  --text-link:       var(--gold-400);
  --text-link-hover: var(--gold-300);

  /* Accent — full interactive ramp */
  --accent:          var(--gold-500);
  --accent-hover:    var(--gold-400);
  --accent-active:   var(--gold-600);
  --accent-deep:     var(--gold-600);
  --accent-subtle:   var(--gold-a10);
  --script:          var(--gold-400);

  /* Lines & rules */
  --line:            var(--gold-a32);
  --line-strong:     var(--gold-500);
  --line-soft:       var(--light-a10);

  /* Interaction states */
  --hover-veil:      var(--light-a06);
  --active-veil:     rgba(7, 6, 5, 0.28);
  --selected-bg:     var(--gold-a16);
  --focus-ring:      var(--gold-300);
  --disabled-fg:     rgba(138, 128, 113, 0.62);
  --disabled-bg:     var(--light-a06);
  --disabled-border: var(--light-a10);

  /* Feedback — warm only */
  --positive:        var(--sage-300);
  --positive-bg:     rgba(113, 128, 79, 0.16);
  --caution:         var(--ochre-300);
  --caution-bg:      rgba(181, 127, 40, 0.14);
  --danger:          var(--rust-300);
  --danger-bg:       rgba(163, 78, 53, 0.16);

  /* Live / flowing — the verdigris exception. Current state, activity,
     progress-in-motion. NOT for success (that stays sage) or actions (gold). */
  --live:            var(--tide-400);
  --live-bg:         var(--verd-a14);
  --live-border:     var(--verd-a24);

  /* Imagery protection */
  --overlay-scrim:   rgba(11, 9, 8, 0.55);
}

.theme-sand {
  --bg:              var(--sand-50);
  --bg-raised:       var(--sand-100);
  --bg-inset:        var(--sand-200);
  --surface:         var(--sand-0);
  --surface-raised:  #ffffff;
  --surface-sunken:  var(--sand-100);
  --backdrop:        rgba(61, 47, 28, 0.42);

  --glass-bg:        rgba(251, 247, 239, 0.62);
  --glass-bg-strong: rgba(251, 247, 239, 0.82);
  --glass-border:    var(--umber-a35);
  --glass-highlight: rgba(255, 255, 255, 0.5);

  --text:            var(--umber-800);
  --text-strong:     var(--umber-900);
  --text-muted:      var(--umber-700);
  --text-faint:      var(--taupe-500);
  --text-on-accent:  var(--ink-900);
  --text-link:       var(--gold-700);
  --text-link-hover: var(--gold-600);

  --accent:          var(--gold-600);
  --accent-hover:    var(--gold-500);
  --accent-active:   var(--gold-700);
  --accent-deep:     var(--gold-700);
  --accent-subtle:   rgba(168, 134, 63, 0.10);
  --script:          var(--gold-600);

  --line:            var(--umber-a35);
  --line-strong:     var(--gold-600);
  --line-soft:       rgba(77, 63, 39, 0.14);

  --hover-veil:      var(--umber-a10);
  --active-veil:     var(--umber-a16);
  --selected-bg:     rgba(168, 134, 63, 0.14);
  --focus-ring:      var(--gold-600);
  --disabled-fg:     rgba(138, 128, 113, 0.7);
  --disabled-bg:     rgba(79, 63, 39, 0.05);
  --disabled-border: rgba(79, 63, 39, 0.12);

  --positive:        var(--sage-700);
  --positive-bg:     rgba(113, 128, 79, 0.12);
  --caution:         var(--ochre-700);
  --caution-bg:      rgba(181, 127, 40, 0.10);
  --danger:          var(--rust-700);
  --danger-bg:       rgba(163, 78, 53, 0.10);

  --live:            var(--verd-500);
  --live-bg:         rgba(63, 118, 105, 0.12);
  --live-border:     rgba(44, 88, 74, 0.30);

  --overlay-scrim:   rgba(245, 240, 231, 0.35);
}

.theme-olive {
  --bg:              var(--olive-700);
  --bg-raised:       var(--olive-600);
  --bg-inset:        var(--olive-800);
  --surface:         var(--olive-600);
  --surface-raised:  var(--olive-500);
  --surface-sunken:  var(--olive-800);
  --backdrop:        rgba(60, 56, 44, 0.6);

  --glass-bg:        rgba(74, 69, 54, 0.5);
  --glass-bg-strong: rgba(74, 69, 54, 0.78);
  --glass-border:    rgba(216, 189, 119, 0.4);
  --glass-highlight: var(--light-a06);

  --text:            var(--sand-100);
  --text-strong:     var(--white);
  --text-muted:      var(--taupe-300);
  --text-faint:      var(--taupe-400);
  --text-on-accent:  var(--ink-900);
  --text-link:       var(--gold-300);
  --text-link-hover: var(--gold-200);

  --accent:          var(--gold-400);
  --accent-hover:    var(--gold-300);
  --accent-active:   var(--gold-500);
  --accent-deep:     var(--gold-500);
  --accent-subtle:   rgba(216, 189, 119, 0.12);
  --script:          var(--gold-300);

  --line:            rgba(216, 189, 119, 0.45);
  --line-strong:     var(--gold-400);
  --line-soft:       var(--light-a14);

  --hover-veil:      var(--light-a06);
  --active-veil:     rgba(60, 56, 44, 0.4);
  --selected-bg:     rgba(216, 189, 119, 0.16);
  --focus-ring:      var(--gold-200);
  --disabled-fg:     rgba(195, 186, 169, 0.55);
  --disabled-bg:     var(--light-a06);
  --disabled-border: var(--light-a10);

  --positive:        var(--sage-300);
  --positive-bg:     rgba(113, 128, 79, 0.18);
  --caution:         var(--ochre-300);
  --caution-bg:      rgba(181, 127, 40, 0.16);
  --danger:          var(--rust-300);
  --danger-bg:       rgba(163, 78, 53, 0.18);

  --overlay-scrim:   rgba(74, 69, 54, 0.45);
}

/* Atmosphere scope — VERDIGRIS. Not a fourth theme: Nocturne's living layer
   for app/OS surfaces (portal, boards, CRM). Same gold spine and text voice;
   surfaces, lines and veils remap onto water. Pair the ground element with
   background: var(--ground-waterline) + a .lm-grain overlay. */
.atmos-verdigris {
  --bg:              #081310;
  --bg-raised:       var(--verd-800);
  --bg-inset:        var(--verd-950);
  --surface:         rgba(11, 24, 21, 0.55);
  --surface-raised:  rgba(15, 33, 29, 0.62);
  --surface-sunken:  rgba(6, 15, 13, 0.7);
  --backdrop:        rgba(4, 10, 9, 0.68);

  --glass-bg:        var(--glass-verd);
  --glass-bg-strong: var(--glass-verd-strong);
  --glass-border:    var(--glass-verd-border);
  --glass-highlight: rgba(148, 193, 176, 0.08);

  --text-muted:      var(--verd-200);
  --text-faint:      var(--verd-300);

  --line-soft:       rgba(148, 193, 176, 0.16);
  --hover-veil:      var(--mist-a06);
  --overlay-scrim:   rgba(6, 16, 13, 0.55);

  --input-bg:        rgba(148, 193, 176, 0.05);
  --input-border:    rgba(148, 193, 176, 0.18);
}

/* Tier 3 · Control tokens — shared sizing for interactive elements */
:root {
  --control-h-sm: 34px;
  --control-h-md: 42px;
  --control-h-lg: 50px;
  --control-radius: 2px;
  --input-bg:            var(--light-a06);
  --input-border:        var(--line-soft);
  --input-border-hover:  var(--gold-a32);
  --input-border-focus:  var(--accent);
}
.theme-sand {
  --input-bg:            rgba(255, 255, 255, 0.55);
  --input-border:        rgba(77, 63, 39, 0.22);
  --input-border-hover:  rgba(134, 106, 68, 0.5);
  --input-border-focus:  var(--accent);
}
.theme-olive {
  --input-bg:            rgba(60, 56, 44, 0.3);
  --input-border:        var(--light-a14);
  --input-border-hover:  rgba(216, 189, 119, 0.5);
  --input-border-focus:  var(--accent);
}
