/* ============================================================
   MIDPOINT — DESIGN TOKENS
   The single source of truth for every visual value.
   No raw values outside this file.
   ============================================================ */

:root {
  /* ---------- Typography family ---------- */
  --font-sans: "Mulish", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-logo: "Clemente", "Mulish", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", monospace;

  /* ---------- Typography weights ---------- */
  --weight-light: 300;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-extrabold: 800;

  /* ---------- Typography sizes (fluid clamp where appropriate) ---------- */
  --text-display-xl: clamp(2.5rem, 1.5rem + 5vw, 4.5rem);   /* 40 → 72 */
  --text-display-l:  clamp(2rem, 1.3rem + 3.4vw, 3.5rem);   /* 32 → 56 */
  --text-display-m:  clamp(1.625rem, 1.2rem + 2vw, 2.5rem); /* 26 → 40 */
  --text-h1:         clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem);/* 28 → 40 */
  --text-h2:         clamp(1.5rem, 1.2rem + 1.2vw, 2rem);   /* 24 → 32 */
  --text-h3:         clamp(1.25rem, 1.15rem + 0.4vw, 1.5rem);/* 20 → 24 */
  --text-h4:         clamp(1.125rem, 1.075rem + 0.2vw, 1.25rem);/* 18 → 20 */
  --text-lead:       clamp(1.125rem, 1.075rem + 0.2vw, 1.25rem);/* 18 → 20 */
  --text-body:       clamp(1rem, 0.97rem + 0.12vw, 1.0625rem); /* 16 → 17 */
  --text-small:      clamp(0.875rem, 0.86rem + 0.06vw, 0.9375rem);/* 14 → 15 */
  --text-micro:      clamp(0.75rem, 0.74rem + 0.05vw, 0.8125rem); /* 12 → 13 */
  --text-stat-l:     clamp(3rem, 2rem + 4vw, 4rem);           /* 48 → 64 */
  --text-stat-m:     clamp(2.25rem, 1.7rem + 2.4vw, 3rem);    /* 36 → 48 */

  /* ---------- Line heights ---------- */
  --leading-display: 1.1;
  --leading-tight: 1.15;
  --leading-snug: 1.25;
  --leading-relaxed: 1.4;
  --leading-body: 1.6;
  --leading-loose: 1.5;
  --leading-flat: 1.0;

  /* ---------- Tracking ---------- */
  --track-tight: -0.01em;
  --track-snug: -0.005em;
  --track-normal: 0;
  --track-wide: 0.04em;
  --track-eyebrow: 0.12em;

  /* ---------- Spacing scale (4px base) ---------- */
  --space-0: 0;
  --space-1: 0.25rem;   /* 4 */
  --space-2: 0.5rem;    /* 8 */
  --space-3: 0.75rem;   /* 12 */
  --space-4: 1rem;      /* 16 */
  --space-5: 1.5rem;    /* 24 */
  --space-6: 2rem;      /* 32 */
  --space-7: 3rem;      /* 48 */
  --space-8: 4rem;      /* 64 */
  --space-9: 6rem;      /* 96 */
  --space-10: 8rem;     /* 128 */
  --space-11: 10rem;    /* 160 */
  --space-12: 12rem;    /* 192 */

  /* ---------- Section padding presets (responsive) ---------- */
  --section-padding-y: clamp(4rem, 3rem + 5vw, 6rem);          /* 64 → 96 */
  --section-padding-y-lg: clamp(5rem, 3.5rem + 6vw, 8rem);     /* 80 → 128 */
  --section-padding-y-xl: clamp(6rem, 4rem + 8vw, 10rem);      /* 96 → 160 */

  /* ---------- Border radius ---------- */
  --radius-none: 0;
  --radius-xs: 4px;
  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 16px;
  --radius-pill: 9999px;
  --radius-circle: 50%;

  /* ---------- Shadows — layered elevation system ---------- */
  --shadow-none: none;
  --shadow-header: 0 1px 0 rgba(26, 26, 26, 0.06);
  --shadow-xs: 0 1px 2px rgba(20, 42, 20, 0.04);
  --shadow-s:  0 2px 8px rgba(20, 42, 20, 0.06);
  --shadow-m:  0 8px 24px rgba(20, 42, 20, 0.08), 0 2px 6px rgba(20, 42, 20, 0.04);
  --shadow-l:  0 20px 48px rgba(20, 42, 20, 0.12), 0 6px 12px rgba(20, 42, 20, 0.06);
  --shadow-xl: 0 32px 80px rgba(20, 42, 20, 0.18), 0 12px 24px rgba(20, 42, 20, 0.08);
  --shadow-modal: 0 8px 32px rgba(20, 42, 20, 0.16);
  --shadow-focus-ring: 0 0 0 3px var(--focus-ring);

  /* ---------- Gradients — atmospheric, brand-aligned ---------- */
  /* De orange/grønne glød-gradienter er slået fra (feedback 23/10-2026:
     "blur orange look"). Tokens bevares, så eksisterende regler ikke knækker. */
  --gradient-hero-glow: none;
  --gradient-hero-vignette:
    linear-gradient(180deg, transparent 0%, transparent 55%, rgba(20, 42, 20, 0.35) 100%);
  --gradient-forest-atmosphere: none;
  --gradient-cream-wash:
    linear-gradient(180deg, var(--surface-cream) 0%, #F7F1E6 100%);
  --gradient-sand-wash:
    linear-gradient(180deg, var(--surface-sand) 0%, #EDE5D5 100%);
  --gradient-warm-cta: var(--brand-orange);
  --gradient-image-vignette:
    linear-gradient(180deg, transparent 0%, transparent 55%, rgba(20, 42, 20, 0.28) 100%);
  --gradient-card-hover:
    linear-gradient(180deg, transparent 40%, rgba(20, 42, 20, 0.55) 100%);

  /* ---------- Grain texture — used as ::after overlay on select surfaces ---------- */
  --grain-svg: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.12  0 0 0 0 0.16  0 0 0 0 0.12  0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");

  /* ---------- Containers ---------- */
  --container-narrow: 720px;
  --container-content: 1280px;
  --container-wide: 1440px;

  /* ---------- Grid ---------- */
  --grid-gutter: 16px;
  --grid-outer: 20px;

  /* ---------- Icon sizes ---------- */
  --icon-xs: 12px;
  --icon-s: 16px;
  --icon-m: 20px;
  --icon-l: 24px;
  --icon-xl: 32px;
  --icon-2xl: 48px;
  --icon-3xl: 64px;

  /* ---------- Button sizes ---------- */
  --btn-s-height: 36px;
  --btn-m-height: 48px;
  --btn-l-height: 56px;
  --btn-icon-size: 44px;

  /* ---------- Motion ---------- */
  --duration-fast: 150ms;
  --duration-snap: 120ms;
  --duration-default: 220ms;
  --duration-medium: 320ms;
  --duration-long: 600ms;
  --duration-stat: 1200ms;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

  /* ---------- Layers ---------- */
  --z-default: 1;
  --z-sticky-bar: 90;
  --z-header: 100;
  --z-mega-menu: 110;
  --z-overlay: 200;
  --z-modal: 300;
  --z-toast: 400;

  /* ========================================================
     COLOR SYSTEM
     ======================================================== */

  /* ---------- Brand ---------- */
  --brand-orange: #E2A440;
  --brand-orange-deep: #C28A2F;
  --brand-orange-80: #E8B566;
  --brand-orange-60: #EEC58D;
  --brand-orange-40: #F4D6B3;

  --brand-green: #3F7E3E;
  --brand-green-deep: #2E5E2D;
  --brand-green-forest: #1F3F1E;
  --brand-green-forest-deep: #142A14;
  --brand-green-80: #65976A;
  --brand-green-40: #B2CCB3;

  /* ---------- Surfaces ---------- */
  --surface-cream: #FAF7F2;
  --surface-sand: #F2EDE5;
  --surface-white: #FFFFFF;
  --surface-forest: #1F3F1E;
  --surface-forest-deep: #142A14;

  /* ---------- Ink (text) ---------- */
  --ink-primary: #1A1A1A;
  --ink-mid: #4A4A4A;
  --ink-soft: #7A7A7A;
  --ink-faint: #A8A8A8;
  --ink-on-dark: #FAF7F2;
  --ink-on-dark-soft: rgba(250, 247, 242, 0.72);
  --ink-on-dark-faint: rgba(250, 247, 242, 0.48);

  /* ---------- Borders ---------- */
  --border-soft: #E5DDD0;
  --border-mid: #C9BFAE;
  --border-strong: var(--ink-primary);
  --border-on-dark: rgba(250, 247, 242, 0.16);

  /* ---------- Functional ---------- */
  --success: #2E7D32;
  --success-bg: #E3F0E3;
  --warning: #C28A2F;
  --warning-bg: #FAEBC8;
  --error: #B22A2A;
  --error-bg: #F8DEDE;
  --info: #1F3F1E;
  --focus-ring: #1A6CFF;

  /* ---------- Alias tokens ----------
     Bridges the alternative naming used by kontakt/stoet-nu/vaer-med
     styles to the canonical tokens above. Keep both in sync. */
  --brand-gold: var(--brand-orange);
  --ink-secondary: var(--ink-mid);
  --ink-on-dark-secondary: var(--ink-on-dark-soft);
  --border-light: var(--border-soft);
  --border-subtle: var(--border-soft);
  --font-body: var(--font-sans);
  --radius-sm: var(--radius-s);
  --radius-md: var(--radius-m);
  --radius-lg: var(--radius-l);
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: var(--radius-pill);
  --shadow-lg: var(--shadow-l);
  --space-16: 4rem;   /* 64 */
  --space-20: 5rem;   /* 80 */
}

/* ---------- Tablet+ grid (640px and up) ---------- */
@media (min-width: 640px) {
  :root {
    --grid-gutter: 20px;
    --grid-outer: 24px;
  }
}

/* ---------- Desktop grid (1024px and up) ---------- */
@media (min-width: 1024px) {
  :root {
    --grid-gutter: 24px;
    --grid-outer: 32px;
  }
}
