/**
 * ╔══════════════════════════════════════════════════════════════════╗
 * ║  MOUNTAINY — DESIGN TOKENS                                       ║
 * ║  Drop-in CSS variables for any app, web app, or extension        ║
 * ╚══════════════════════════════════════════════════════════════════╝
 *
 * HOW TO USE:
 *   1. Import this file at the top of your main stylesheet.
 *   2. Add class="dark" or class="light" to <html>.
 *      Default mode is dark (defined on :root).
 *   3. In components, reference tokens via var(--name) — or via the
 *      Tailwind utilities below if you've wired up the @theme block.
 *
 * NEVER use raw hex or rgba() in components — always use these tokens.
 */

/* ══════════════════════════════════════════════════════
   TAILWIND 4 THEME REGISTRATION (optional)
   Skip this block if you aren't using Tailwind.
   Maps CSS variables → Tailwind utility classes.
   ══════════════════════════════════════════════════════ */
@theme inline {
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);

  /* Semantic color mappings */
  --color-background:             var(--background);
  --color-foreground:             var(--foreground);
  --color-card:                   var(--card);
  --color-card-foreground:        var(--card-foreground);
  --color-popover:                var(--popover);
  --color-popover-foreground:     var(--popover-foreground);
  --color-primary:                var(--primary);
  --color-primary-foreground:     var(--primary-foreground);
  --color-secondary:              var(--secondary);
  --color-secondary-foreground:   var(--secondary-foreground);
  --color-muted:                  var(--muted);
  --color-muted-foreground:       var(--muted-foreground);
  --color-accent:                 var(--accent);
  --color-accent-foreground:      var(--accent-foreground);
  --color-destructive:            var(--destructive);
  --color-destructive-foreground: var(--destructive-foreground);
  --color-border:                 var(--border);
  --color-input:                  var(--input);
  --color-ring:                   var(--ring);

  /* Brand tokens */
  --color-mtn-navy:       var(--mtn-navy);
  --color-mtn-sage:       var(--mtn-sage);
  --color-mtn-sage-mid:   var(--mtn-sage-mid);
  --color-mtn-sage-light: var(--mtn-sage-light);
  --color-mtn-muted:      var(--mtn-muted);
  --color-mtn-ghost:      var(--mtn-ghost);
}

/* ══════════════════════════════════════════════════════
   DARK THEME (default — :root)
   ══════════════════════════════════════════════════════ */
:root {
  --radius: 0.45rem;

  /* ── Raw palette ── */
  --mtn-void:       #080e14;   /* deepest bg */
  --mtn-abyss:      #0b1420;   /* nav / secondary bg */
  --mtn-surface:    #0f1d2c;   /* card bg */
  --mtn-elevated:   #142436;   /* elevated panels, inputs */
  --mtn-highlight:  #1a2e44;   /* hover / active */
  --mtn-sage:       #7a9e7e;   /* primary brand green */
  --mtn-sage-mid:   #9ab598;
  --mtn-sage-light: #b8ccb8;
  --mtn-navy:       #25364c;
  --mtn-muted:      #7a8a95;
  --mtn-ghost:      #4a5a65;

  /* ── Semantic tokens ── */
  --background:              #080e14;
  --foreground:              #dce4ea;
  --card:                    #0f1d2c;
  --card-foreground:         #dce4ea;
  --popover:                 #0f1d2c;
  --popover-foreground:      #dce4ea;
  --primary:                 #7a9e7e;
  --primary-foreground:      #ffffff;
  --secondary:               #142436;
  --secondary-foreground:    #dce4ea;
  --muted:                   #142436;
  --muted-foreground:        #6a7a85;
  --accent:                  #7a9e7e;
  --accent-foreground:       #ffffff;
  --destructive:             #ef4444;
  --destructive-foreground:  #ffffff;
  --border:                  rgba(154,181,152,0.09);
  --input:                   #142436;
  --ring:                    rgba(122,158,126,0.3);

  /* ── Surface layers (depth scale) ── */
  --surface-0:  #080e14;   /* page background */
  --surface-1:  #0b1420;   /* nav / secondary panels */
  --surface-2:  #0f1d2c;   /* cards, main content */
  --surface-3:  #142436;   /* elevated panels, inputs, hover */

  /* ── Overlay ── */
  --overlay-bg: rgba(0,0,0,0.65);
}

/* ══════════════════════════════════════════════════════
   LIGHT THEME (applied when <html class="light">)
   ══════════════════════════════════════════════════════ */
:root.light, .light {
  /* ── Raw palette ── */
  --mtn-void:       #dfe4ea;
  --mtn-abyss:      #c8d0da;
  --mtn-surface:    #f2f5f8;
  --mtn-elevated:   #ffffff;
  --mtn-highlight:  #cdd5df;
  --mtn-sage:       #2e5c34;
  --mtn-sage-mid:   #3d7444;
  --mtn-sage-light: #5a9060;
  --mtn-navy:       #0d1f33;
  --mtn-muted:      #3d5068;
  --mtn-ghost:      #2a3d52;

  /* ── Semantic tokens ── */
  --background:              #dfe4ea;
  --foreground:              #0d1f33;
  --card:                    #f2f5f8;
  --card-foreground:         #0d1f33;
  --popover:                 #ffffff;
  --popover-foreground:      #0d1f33;
  --primary:                 #2e5c34;
  --primary-foreground:      #ffffff;
  --secondary:               #dde3ea;
  --secondary-foreground:    #0d1f33;
  --muted:                   #dde3ea;
  --muted-foreground:        #3d5068;
  --accent:                  #2e5c34;
  --accent-foreground:       #ffffff;
  --destructive:             #b91c1c;
  --destructive-foreground:  #ffffff;
  --border:                  rgba(13,31,51,0.14);
  --input:                   #e8ecf1;
  --ring:                    rgba(46,92,52,0.40);

  /* ── Surface layers ── */
  --surface-0:  #dfe4ea;
  --surface-1:  #c8d0da;
  --surface-2:  #f2f5f8;
  --surface-3:  #e8ecf1;

  /* ── Overlay ── */
  --overlay-bg: rgba(13,31,51,0.55);
}
