/* ============================================
   FILE: base.css — Medilion Brand 2026
   Purpose: Design Tokens (Single Source of Truth),
            CSS-Reset, Base-Typography, Utility-Classes
   Dependencies: none
   Notes: Updated to Ferhat's visual reference palette:
          Klarweiß #FFFFFF · MediLion Navy #1F3F86
          Royal Blue #2F4F97
          Typography: Outfit
============================================ */

/* ---------- 1. Design Tokens ---------- */
:root {
  /* ---- Brand colors — visual reference palette ---- */
  --color-primary: #1F3F86;          /* MediLion Navy */
  --color-primary-hover: #18366F;
  --color-primary-active: #132C5D;
  --color-primary-deep: #0B1E45;
  --color-primary-soft: #EEF3FF;
  --color-text-strong: #0B1E45;

  --color-secondary: #2F4F97;        /* Royal Blue */
  --color-secondary-soft: #EEF3FA;
  --color-blue-quiet: #DCE6F7;
  --color-clay: #E7ECF6;             /* Cool blue-grey neutral */
  --color-clay-soft: #F6F8FC;

  /* Buttons — reference palette: primary CTA = MediLion Navy */
  --color-button-primary: #1F3F86;
  --color-button-primary-hover: #18366F;
  --color-button-primary-active: #132C5D;

  --color-accent: #2F4F97;           /* Royal Blue accent */
  --color-accent-soft: #EEF3FF;
  --color-accent-strong: #1F3F86;

  /* ---- Surfaces ---- */
  --color-bg: #FFFFFF;               /* Klarweiß */
  --color-bg-soft: #FFFFFF;
  --color-bg-sand: #E7ECF6;
  --color-bg-sand-soft: #F6F8FC;
  --color-surface: #FFFFFF;
  --color-surface-soft: #F8FAFF;
  --color-surface-elevated: #FFFFFF;
  --color-border: #D9E2F4;
  --color-border-soft: #EEF3FA;
  --color-border-strong: #AEBEDD;
  --color-divider: rgba(31, 63, 134, 0.10);

  /* ---- Text ---- */
  --color-text: #13244A;
  --color-text-muted: #42516F;
  --color-text-soft: #77839A;
  --color-text-on-primary: #FFFFFF;
  --color-text-on-primary-muted: rgba(255, 255, 255, 0.80);
  --color-text-on-primary-soft: rgba(255, 255, 255, 0.60);

  /* ---- Semantic ---- */
  --color-success: #2F4F97;
  --color-success-soft: rgba(47, 79, 151, 0.12);
  --color-warning: #B8893D;
  --color-error: #B85450;

  /* ---- Typography — MediLion Brand Guideline ---- */
  --font-headline: "Outfit", "Inter", "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Outfit", "Inter", "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-wordmark: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* ---- Type scale ---- */
  --fs-display: 4rem;      /* 64px — hero display */
  --fs-h1: 2.5rem;         /* 40px */
  --fs-h2: 1.75rem;        /* 28px */
  --fs-h3: 1.375rem;       /* 22px */
  --fs-h4: 1.1875rem;      /* 19px */
  --fs-lead: 1.1875rem;
  --fs-body-lg: 1.125rem;
  --fs-body: 1rem;
  --fs-small: 0.9375rem;
  --fs-tagline: 0.8125rem;
  --fs-micro: 0.75rem;
  --fs-button: 0.9375rem;

  --lh-tight: 1.05;
  --lh-headline: 1.1;
  --lh-h2: 1.2;
  --lh-h3: 1.3;
  --lh-body: 1.65;
  --lh-relaxed: 1.7;

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-display: 700;

  --tracking-tight: -0.02em;        /* display headlines */
  --tracking-snug: -0.01em;
  --tracking-normal: 0;
  --tracking-wide: 0.14em;          /* wordmark / labels */
  --tracking-label: 0.16em;         /* eyebrows */

  /* ---- Spacing — 4px base ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --space-9: 48px;
  --space-10: 64px;
  --space-11: 80px;
  --space-12: 96px;
  --space-13: 120px;
  --space-14: 160px;

  /* ---- Layout ---- */
  --page-max: 1480px;
  --content-max: 1240px;
  --content-narrow: 880px;
  --reading-max: 680px;
  --nav-height: 76px;

  /* ---- Radii — brand guideline (cards 16px, big surfaces 20-24px) ---- */
  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 8px;       /* buttons, inputs */
  --r-lg: 12px;      /* small cards */
  --r-xl: 16px;      /* feature cards, modals */
  --r-2xl: 20px;     /* hero cards, big surfaces */
  --r-3xl: 24px;     /* anchor cards / final CTA */
  --r-pill: 9999px;

  /* ---- Shadows — navy-tinted, layered ---- */
  --sh-1: 0 1px 2px rgba(31, 63, 134, 0.05);
  --sh-2: 0 8px 20px rgba(31, 63, 134, 0.07);
  --sh-3: 0 16px 38px rgba(31, 63, 134, 0.10);
  --sh-4: 0 24px 58px rgba(31, 63, 134, 0.13);
  --sh-5: 0 34px 80px rgba(31, 63, 134, 0.16);

  --sh-button:
    0 1px 2px rgba(31, 63, 134, 0.10),
    0 8px 16px rgba(31, 63, 134, 0.14);
  --sh-button-hover:
    0 2px 4px rgba(31, 63, 134, 0.14),
    0 12px 28px rgba(31, 63, 134, 0.22);
  --sh-button-accent:
    0 1px 2px rgba(47, 79, 151, 0.20),
    0 8px 18px rgba(47, 79, 151, 0.26);
  --sh-button-accent-hover:
    0 2px 6px rgba(47, 79, 151, 0.26),
    0 14px 30px rgba(47, 79, 151, 0.34);

  --sh-inset-light: inset 0 1px 0 rgba(255, 255, 255, 0.65);

  /* Backward-compat aliases */
  --sh-soft: var(--sh-1);
  --sh-medium: var(--sh-3);

  /* ---- Motion ---- */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 180ms;
  --t-med: 280ms;
  --t-slow: 520ms;
  --t-reveal: 540ms;

  /* ---- Z-index scale ---- */
  --z-base: 1;
  --z-sticky: 50;
  --z-modal-backdrop: 90;
  --z-modal: 100;
  --z-toast: 110;
}

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, svg, video { display: block; max-width: 100%; height: auto; }
img { font-style: italic; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: 4px;
}
::selection { background: rgba(31, 63, 134, 0.15); color: var(--color-primary); }

/* ---------- 3. Base Typography ---------- */
html { font-size: 100%; }
body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-text-muted);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

@media (max-width: 767px) {
  :root {
    --fs-display: 2.5rem;
    --fs-h1: 2.125rem;
    --fs-h2: 1.625rem;
    --fs-h3: 1.1875rem;
    --fs-lead: 1.0625rem;
    --nav-height: 68px;
  }
}

@media (max-width: 380px) {
  :root {
    --fs-display: 2.125rem;
    --fs-h1: 1.9375rem;
    --fs-body: 0.96875rem;
    --fs-button: 0.875rem;
  }
}

/* Display headlines — Outfit Bold (MediLion Brand Guideline) */
h1, h2 {
  font-family: var(--font-headline);
  color: var(--color-primary);
  font-weight: var(--fw-display);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}
h1 {
  font-size: var(--fs-h1);
  line-height: var(--lh-headline);
}
h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
}

/* H3 / H4 — Outfit SemiBold (clean, readable UI text) */
h3, h4 {
  font-family: var(--font-body);
  color: var(--color-primary);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-snug);
  text-wrap: balance;
}
h3 {
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
}
h4 {
  font-size: var(--fs-h4);
  line-height: 1.4;
}

p { color: var(--color-text-muted); text-wrap: pretty; }

em {
  font-style: italic;
  color: var(--color-secondary);   /* Powder Blue accent on italic display */
}

/* ---------- 4. Utility Classes ---------- */
.u-hidden { display: none; }
.u-sprite { position: absolute; width: 0; height: 0; pointer-events: none; }
.u-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.u-text-center { text-align: center; }
.u-highlight { color: var(--color-primary); font-style: italic; }
.u-highlight--accent { color: var(--color-secondary); font-weight: var(--fw-semibold); }
.u-no-scroll { overflow: hidden; }

/* Brand tagline — Outfit, uppercase, wide-tracked */
.u-tagline {
  font-family: var(--font-body);
  font-size: var(--fs-tagline);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  line-height: 1.2;
  color: var(--color-primary);
}

/* Subtle grain texture */
.u-grain {
  position: relative;
}
.u-grain::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.025;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 5. Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
