/* ============================================================
   Bulder Bank — Colors & Type Tokens
   ------------------------------------------------------------
   Values extracted from Bulder Design System Figma
   (node: 3:2 "Foundations canvas"). The file names Aeonik as
   the primary font, with Inter substituted in the .fig itself
   "until Aeonik is available" — we use Aeonik here (user-
   provided) and fall back to Inter.
   ============================================================ */

/* --- Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

@font-face { font-family: 'Aeonik'; font-weight: 400; font-style: normal; font-display: swap; src: url('fonts/Aeonik-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Aeonik'; font-weight: 500; font-style: normal; font-display: swap; src: url('fonts/Aeonik-Medium.ttf') format('truetype'); }
@font-face { font-family: 'Aeonik'; font-weight: 700; font-style: normal; font-display: swap; src: url('fonts/Aeonik-Bold.ttf') format('truetype'); }
@font-face { font-family: 'Aeonik'; font-weight: 300; font-style: normal; font-display: swap; src: url('fonts/Aeonik-Light.ttf') format('truetype'); }

:root {
  /* ============================================================
     PRIMITIVE COLORS — raw palette, 100 (light) → 900 (dark).
     Always reference semantic tokens in components, not these.
     ============================================================ */

  /* Red (Bulder brand accent) */
  --red-100: #FFEAEC;  --red-200: #FFCCD0;  --red-300: #FFA8AF;
  --red-400: #FE8088;  --red-500: #FE4D5B;  --red-600: #BD2A37;
  --red-700: #8B252D;  --red-800: #581319;  --red-900: #3C0003;

  /* Green (positive / mint accent) */
  --green-100: #E0FFE1; --green-200: #CCFFCC; --green-300: #B9FFBA;
  --green-400: #A6FFA5; --green-500: #85FF86; --green-600: #61D562;
  --green-700: #3AA53A; --green-800: #266B26; --green-900: #0B300B;

  /* Yellow (warning) */
  --yellow-100: #FFFFDE; --yellow-200: #FFF8BF; --yellow-300: #F8FF9C;
  --yellow-400: #FFFD81; --yellow-500: #FAE84E; --yellow-600: #E2C546;
  --yellow-700: #BA9839; --yellow-800: #97732F; --yellow-900: #63461F;

  /* Purple */
  --purple-100: #F2E8FF; --purple-200: #E4D4FF; --purple-300: #CEB0FF;
  --purple-400: #B78FFF; --purple-500: #9361F8; --purple-600: #6E49C0;
  --purple-700: #552FAA; --purple-800: #3B0A7A; --purple-900: #240F4A;

  /* Pink */
  --pink-100: #E2D1D9;  --pink-200: #E3B1C8;  --pink-300: #E790B7;
  --pink-400: #E36DA2;  --pink-500: #E04F90;  --pink-600: #C3447D;
  --pink-700: #A53A6A;  --pink-800: #893058;  --pink-900: #6D2646;

  /* Dark Blue (primary surface family) */
  --dark-blue-100: #959BC0; --dark-blue-200: #707C9E; --dark-blue-300: #4C5674;
  --dark-blue-400: #3E4965; --dark-blue-500: #333E5C; --dark-blue-600: #262F47;
  --dark-blue-700: #1A2037; --dark-blue-800: #0F1729; --dark-blue-900: #070912;

  /* Grey (text + light surfaces) */
  --grey-100: #FAFBFF; --grey-200: #F4F6FF; --grey-300: #EAEFFA;
  --grey-400: #DCE1F3; --grey-500: #D1D7E5; --grey-600: #BFC4D4;
  --grey-700: #B4BAC8; --grey-800: #9298A7; --grey-900: #747A89;

  /* Bulder-owned accents */
  --royal-blue: #0926D6;  /* CTA primary (seen in feed/buttons) */
  --warning-amber: #FFAD33;
  --warning-yellow: #FFD54F;

  /* ============================================================
     SEMANTIC TOKENS — default dark mode (the product's home).
     Flip with [data-theme="light"] on a wrapper.
     Names mirror the Foundations "Semantic tokens" frame.
     ============================================================ */
  --fg-primary:      var(--grey-100);   /* #FAFBFF */
  --fg-secondary:    var(--grey-500);   /* #D1D7E5 */
  --fg-tertiary:     var(--grey-800);   /* #9298A7 */
  --fg-on-primary:   var(--grey-100);   /* text on Bulder red surfaces */
  --bg-background:   var(--dark-blue-800); /* #0F1729 — app base */
  --bg-surface:      var(--dark-blue-700); /* #1A2037 — cards */
  --bg-surface-container: var(--dark-blue-600); /* #262F47 — elevated */
  --color-error:     var(--red-500);       /* #FE4D5B */
  --color-positive:  var(--green-500);     /* #85FF86 */
  --color-warning:   var(--warning-amber); /* #FFAD33 */
  --color-outline:   var(--dark-blue-400); /* #3E4965 — strokes */
  --color-bulder:    var(--red-500);       /* brand accent */

  /* ============================================================
     TYPOGRAPHY — names mirror app/* scale from Foundations
     ============================================================ */
  --font-sans:    'Aeonik', 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:    ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* Size / weight — line-height is 100% in the Figma spec */
  --t-h1:        700 32px/1   var(--font-sans);   /* app/h1 · 32 Bold */
  --t-h2:        700 26px/1.1 var(--font-sans);   /* app/h2 · 26 Bold */
  --t-h3:        700 20px/1.2 var(--font-sans);   /* app/h3 · 20 Bold */
  --t-subtitle:  500 18px/1.3 var(--font-sans);   /* app/subtitle · 18 Medium */
  --t-body:      500 16px/1.4 var(--font-sans);   /* app/body · 16 Medium */
  --t-body-2:    400 14px/1.4 var(--font-sans);   /* app/body 2 · 14 Regular */
  --t-caption:   400 14px/1.3 var(--font-sans);   /* app/caption · 14 Regular */
  --t-overline:  700 12px/1.2 var(--font-sans);   /* app/overline · 12 Bold */
  --t-button:    500 18px/1   var(--font-sans);   /* app/button · 18 Medium */

  /* ============================================================
     SPACING — 2-step scale (label · px · token name)
     ============================================================ */
  --space-small:    4px;     /* spacing/size 2  */
  --space-medium:   8px;     /* spacing/size 4  */
  --space-large:    16px;    /* spacing/size 8  */
  --space-xlarge:   24px;    /* spacing/size 12 */
  --space-xxlarge:  32px;    /* spacing/size 16 */
  --space-3xl:      48px;    /* spacing/size 24 */
  --space-4xl:      64px;    /* spacing/size 32 */
  --space-5xl:      96px;    /* spacing/size 48 */
  --space-6xl:      128px;   /* spacing/size 64 */

  /* ============================================================
     BORDER RADIUS — only 2 values (+ full)
     "Bulder bruker bare to radier: small (4px) og standard (10px)"
     ============================================================ */
  --radius-small:    4px;
  --radius-standard: 10px;
  --radius-full:     9999px;

  /* ============================================================
     SHADOWS — only 2 official
     "Bulder bruker to offisielle skygger. Alt annet er avvik."
     ============================================================ */
  --shadow:        0 2px 20px 0 rgba(42,49,70,0.25);    /* elevated card */
  --shadow-botnav: 0 -1px 10px 0 rgba(11,18,34,0.25);   /* bottom nav */

  /* ============================================================
     ICON SIZES — 5 official (token-named, not px)
     ============================================================ */
  --icon-xsmall: 16px;
  --icon-small:  20px;
  --icon-medium: 24px;
  --icon-large:  28px;
  --icon-xlarge: 60px;

  /* ============================================================
     MOTION
     ============================================================ */
  --ease-entry: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-exit:  cubic-bezier(0.4, 0, 1, 1);
  --dur-fast:   160ms;
  --dur-base:   240ms;
  --dur-slow:   400ms;
}

/* Light mode override — flips bg/fg */
[data-theme="light"] {
  --fg-primary:           var(--dark-blue-800);   /* #0F1729 */
  --fg-secondary:         var(--dark-blue-400);   /* #3E4965 */
  --fg-tertiary:          var(--grey-900);        /* #747A89 */
  --bg-background:        var(--grey-100);        /* #FAFBFF */
  --bg-surface:           #FFFFFF;
  --bg-surface-container: var(--grey-200);        /* #F4F6FF */
  --color-outline:        var(--grey-500);        /* #D1D7E5 */
}

/* ============================================================
   SEMANTIC CLASSES — for direct use
   ============================================================ */
.bb-h1       { font: var(--t-h1);       letter-spacing: -0.02em;  color: var(--fg-primary); }
.bb-h2       { font: var(--t-h2);       letter-spacing: -0.015em; color: var(--fg-primary); }
.bb-h3       { font: var(--t-h3);       letter-spacing: -0.01em;  color: var(--fg-primary); }
.bb-subtitle { font: var(--t-subtitle); color: var(--fg-primary); }
.bb-body     { font: var(--t-body);     color: var(--fg-primary); }
.bb-body-2   { font: var(--t-body-2);   color: var(--fg-primary); }
.bb-caption  { font: var(--t-caption);  color: var(--fg-tertiary); }
.bb-overline { font: var(--t-overline); color: var(--fg-tertiary); text-transform: uppercase; letter-spacing: 0.06em; }
.bb-button   { font: var(--t-button);   color: var(--fg-on-primary); }

/* ============================================================
   BASE
   ============================================================ */
.bb-root {
  background: var(--bg-background);
  color: var(--fg-primary);
  font: var(--t-body-2);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

*, *::before, *::after { box-sizing: border-box; }

/* Focus ring — the Bulder red ring */
.bb-focus:focus-visible,
button.bb-focus:focus-visible,
a.bb-focus:focus-visible {
  outline: 2px solid var(--color-bulder);
  outline-offset: 2px;
  border-radius: var(--radius-small);
}
