/* ============================================================
   BMDNA Web Design System — "Modern Clarity" v2
   Die Business Modell DNA — Web Stylesheet
   April 2026 Redesign
   ============================================================ */


/* ============================================================
   TIER 1: PRIMITIVE TOKENS (raw values, never use directly)
   ============================================================ */
:root {
  /* Colors: Okabe-Ito Palette */
  --raw-orange: #E69F00;
  --raw-blue: #0072B2;
  --raw-teal: #009E73;
  --raw-vermilion: #D55E00;
  --raw-sky: #56B4E9;

  /* Colors: Tinted Fills */
  --raw-orange-light: #FEF5E0;
  --raw-blue-light: #E4F0FA;
  --raw-teal-light: #DCEEE7;
  --raw-vermilion-light: #FCEDE4;
  --raw-gray-light: #F5F4F1;

  /* Colors: Dark text on tinted backgrounds */
  --raw-orange-dark: #8B6508;
  --raw-blue-dark: #004A75;
  --raw-teal-dark: #006B4E;
  --raw-vermilion-dark: #A04500;

  /* Neutrals */
  --raw-black: #1A1A1A;
  --raw-gray-900: #2D2D2D;
  --raw-gray-700: #555555;
  --raw-gray-500: #888888;
  --raw-gray-400: #AAAAAA;
  --raw-gray-300: #BBBBBB;
  --raw-gray-200: #E0DDD8;
  --raw-gray-100: #F2F1EE;
  --raw-gray-50: #F8F7F4;
  --raw-white: #FFFFFF;

  /* Spacing Scale */
  --raw-space-1: 0.25rem;
  --raw-space-2: 0.5rem;
  --raw-space-3: 0.75rem;
  --raw-space-4: 1rem;
  --raw-space-5: 1.25rem;
  --raw-space-6: 1.5rem;
  --raw-space-8: 2rem;
  --raw-space-10: 2.5rem;
  --raw-space-12: 3rem;
  --raw-space-16: 4rem;
  --raw-space-20: 5rem;
  --raw-space-24: 6rem;
  --raw-space-32: 8rem;
  --raw-space-40: 10rem;

  /* Font Sizes — fluid where possible */
  --raw-text-2xs: 0.65rem;
  --raw-text-xs: 0.75rem;
  --raw-text-sm: 0.875rem;
  --raw-text-md: 0.9375rem;
  --raw-text-base: 1rem;
  --raw-text-lg: 1.125rem;
  --raw-text-xl: 1.375rem;
  --raw-text-2xl: 1.75rem;
  --raw-text-3xl: clamp(2rem, 4vw, 2.75rem);
  --raw-text-4xl: clamp(2.5rem, 5vw, 3.5rem);

  /* Radii */
  --raw-radius-sm: 6px;
  --raw-radius-md: 10px;
  --raw-radius-lg: 14px;
  --raw-radius-xl: 20px;
  --raw-radius-2xl: 28px;
  --raw-radius-pill: 100px;

  /* Shadows — layered for depth */
  --raw-shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.05);
  --raw-shadow-md: 0 2px 4px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.07);
  --raw-shadow-lg: 0 4px 8px rgba(0,0,0,0.04), 0 16px 40px rgba(0,0,0,0.09);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 400ms;
}


/* ============================================================
   TIER 2: SEMANTIC TOKENS
   ============================================================ */
:root {
  /* BMDNA Layer Colors */
  --color-segments: var(--raw-blue);
  --color-acquisition: var(--raw-vermilion);
  --color-conversion: var(--raw-orange);
  --color-revenue: var(--raw-teal);
  --color-brand: var(--raw-blue);
  --color-accent: var(--raw-sky);

  /* Text Colors */
  --color-text-primary: var(--raw-black);
  --color-text-body: var(--raw-gray-900);
  --color-text-secondary: var(--raw-gray-700);
  --color-text-caption: var(--raw-gray-500);
  --color-text-muted: var(--raw-gray-400);
  --color-text-inverse: var(--raw-white);

  /* Surface Colors */
  --color-surface-page: var(--raw-white);
  --color-surface-warm: var(--raw-gray-50);
  --color-surface-muted: var(--raw-gray-100);
  --color-surface-rule: var(--raw-gray-200);
  --color-surface-dark: #181B20;

  /* Typography */
  --font-body: 'IBM Plex Serif', 'Georgia', serif;
  --font-heading: 'IBM Plex Sans', 'Helvetica Neue', sans-serif;
  --font-ui: 'IBM Plex Sans', 'Helvetica Neue', sans-serif;
  --font-mono: 'IBM Plex Mono', 'Consolas', monospace;

  /* Vertical Rhythm */
  --baseline: 1.625rem;
  --line-height-body: 1.7;
  --line-height-heading: 1.15;
  --line-height-tight: 1.35;
  --line-height-loose: 1.8;
}


/* ============================================================
   BASE RESET & DEFAULTS
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: var(--line-height-body);
  color: var(--color-text-body);
  background-color: var(--color-surface-page);
}

::selection {
  background: var(--raw-blue);
  color: var(--raw-white);
}

:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 3px;
  border-radius: var(--raw-radius-sm);
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}


/* ============================================================
   TYPOGRAPHY: HEADINGS
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-text-primary);
  line-height: var(--line-height-heading);
  font-weight: 600;
  text-wrap: balance;
}

h1 {
  font-size: var(--raw-text-3xl);
  font-weight: 800;
  margin-bottom: var(--raw-space-6);
  letter-spacing: -0.025em;
}

h2 {
  font-size: var(--raw-text-xl);
  font-weight: 700;
  margin-top: var(--raw-space-12);
  margin-bottom: var(--raw-space-5);
  letter-spacing: -0.02em;
}

h3 {
  font-size: var(--raw-text-lg);
  margin-top: var(--raw-space-8);
  margin-bottom: var(--raw-space-3);
  letter-spacing: -0.015em;
}

h4 {
  font-size: var(--raw-text-base);
  margin-top: var(--raw-space-6);
  margin-bottom: var(--raw-space-2);
}

/* Gradient text utility */
.text-gradient {
  background: linear-gradient(135deg, var(--raw-blue), var(--raw-sky));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}


/* ============================================================
   TYPOGRAPHY: BODY TEXT
   ============================================================ */
p {
  margin-bottom: var(--baseline);
  max-width: 65ch;
}

strong {
  font-weight: 600;
  color: var(--color-text-primary);
}

small {
  font-size: var(--raw-text-sm);
  color: var(--color-text-secondary);
}

.lead {
  font-size: var(--raw-text-lg);
  line-height: var(--line-height-tight);
  color: var(--color-text-secondary);
  margin-bottom: var(--raw-space-8);
  max-width: 65ch;
}

a {
  color: var(--color-brand);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--duration-fast) var(--ease-in-out),
              text-decoration-thickness var(--duration-fast) var(--ease-in-out);
}

a:hover {
  color: var(--raw-blue-dark);
  text-decoration-thickness: 2px;
}


/* ============================================================
   LISTS
   ============================================================ */
ul, ol {
  margin-bottom: var(--baseline);
  padding-left: var(--raw-space-6);
}

li {
  margin-bottom: var(--raw-space-2);
  padding-left: var(--raw-space-2);
}

li::marker {
  color: var(--color-brand);
  font-weight: 700;
}

ul.checklist {
  list-style: none;
  padding-left: 0;
}

ul.checklist li {
  padding-left: var(--raw-space-6);
  position: relative;
}

ul.checklist li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--color-revenue);
  font-weight: 700;
  font-size: var(--raw-text-lg);
}

dl { margin-bottom: var(--baseline); }

dt {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-text-primary);
  margin-top: var(--raw-space-4);
  padding-left: var(--raw-space-3);
  border-left: 2px solid var(--color-brand);
}

dd {
  margin-left: var(--raw-space-8);
  margin-bottom: var(--raw-space-2);
  color: var(--color-text-secondary);
}


/* ============================================================
   CALLOUT BOXES
   ============================================================ */
.callout {
  position: relative;
  margin: var(--raw-space-8) 0;
  padding: 0;
  background: var(--color-surface-page);
  border: none;
  border-left: 3px solid var(--color-surface-rule);
  border-radius: var(--raw-radius-xl);
  overflow: hidden;
  box-shadow: var(--raw-shadow-sm);
}

.callout-content {
  padding: var(--raw-space-6) var(--raw-space-8);
}

.callout-content p {
  font-family: var(--font-ui);
  font-size: var(--raw-text-md);
  line-height: var(--line-height-tight);
  margin-bottom: var(--raw-space-3);
}

.callout-content p:last-child { margin-bottom: 0; }

.callout-label {
  font-family: var(--font-ui);
  font-size: var(--raw-text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: var(--raw-space-3);
  display: flex;
  align-items: center;
  gap: var(--raw-space-2);
}

.callout-icon { width: 20px; height: 20px; flex-shrink: 0; }
.callout-icon svg { width: 20px; height: 20px; display: block; }

.callout-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--raw-text-md);
  color: var(--color-text-primary);
  margin-bottom: var(--raw-space-3);
}

/* Callout Variants */
.callout-tip { background: var(--raw-orange-light); border-left-color: var(--raw-orange); }
.callout-tip .callout-label { color: var(--raw-orange-dark); }
.callout-tip .callout-icon svg { stroke: var(--raw-orange); }

.callout-check { background: var(--raw-blue-light); border-left-color: var(--raw-blue); }
.callout-check .callout-label { color: var(--raw-blue-dark); }
.callout-check .callout-icon svg { stroke: var(--raw-blue); }

.callout-example { background: var(--raw-teal-light); border-left-color: var(--raw-teal); }
.callout-example .callout-label { color: var(--raw-teal-dark); }
.callout-example .callout-icon svg { stroke: var(--raw-teal); }

.callout-error { background: var(--raw-vermilion-light); border-left-color: var(--raw-vermilion); }
.callout-error .callout-label { color: var(--raw-vermilion-dark); }
.callout-error .callout-icon svg { stroke: var(--raw-vermilion); }

.callout-deep { background: var(--raw-gray-light); border-left-color: var(--raw-gray-700); }
.callout-deep .callout-label { color: var(--raw-gray-700); }
.callout-deep .callout-icon svg { stroke: var(--raw-gray-700); }

.callout-takeaway {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #1a1a2e 100%);
  border-left-color: var(--raw-blue);
}
.callout-takeaway .callout-label { color: var(--raw-sky); }
.callout-takeaway .callout-title { color: var(--color-text-inverse); }
.callout-takeaway .callout-content p { color: rgba(255,255,255,0.85); }


/* ============================================================
   BLOCKQUOTE / PULL QUOTE
   ============================================================ */
blockquote {
  position: relative;
  margin: var(--raw-space-8) 0;
  padding: var(--raw-space-6) var(--raw-space-8);
  border-left: 4px solid transparent;
  border-image: linear-gradient(to bottom, var(--raw-blue), var(--raw-sky)) 1;
  color: var(--color-text-secondary);
  font-style: italic;
}

blockquote::before {
  content: "\201C";
  position: absolute;
  top: -0.15em;
  left: 0.15em;
  font-family: var(--font-heading);
  font-size: 4rem;
  font-weight: 800;
  line-height: 1;
  color: var(--raw-blue);
  opacity: 0.1;
  pointer-events: none;
}

blockquote p { margin-bottom: var(--raw-space-2); }

blockquote cite,
blockquote .attribution {
  display: block;
  font-family: var(--font-ui);
  font-style: normal;
  font-size: var(--raw-text-sm);
  color: var(--color-text-caption);
  margin-top: var(--raw-space-3);
}

blockquote cite::before,
blockquote .attribution::before {
  content: "\2014\00a0";
}

.pull-quote {
  margin: var(--raw-space-10) var(--raw-space-4);
  padding: var(--raw-space-8) var(--raw-space-10);
  border-left: 4px solid transparent;
  border-image: linear-gradient(to bottom, var(--raw-blue), var(--raw-sky)) 1;
  border-top: none;
  border-bottom: none;
  border-right: none;
  font-style: normal;
  color: var(--color-text-primary);
}

.pull-quote p {
  font-family: var(--font-body);
  font-size: var(--raw-text-xl);
  line-height: var(--line-height-tight);
  font-weight: 400;
  font-style: italic;
}


/* ============================================================
   FIGURES & ILLUSTRATIONS
   ============================================================ */
figure {
  margin: var(--raw-space-8) 0;
}

.svg-container {
  width: 100%;
  border-radius: var(--raw-radius-xl);
  overflow: hidden;
  box-shadow: var(--raw-shadow-sm);
}

.svg-container svg {
  display: block;
  width: 100%;
  height: auto;
}

figcaption {
  font-family: var(--font-ui);
  font-size: var(--raw-text-sm);
  color: var(--color-text-caption);
  margin-top: var(--raw-space-4);
  line-height: var(--line-height-tight);
}


/* ============================================================
   TABLES
   ============================================================ */
.table-container {
  margin: var(--raw-space-8) 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--raw-radius-xl);
  box-shadow: var(--raw-shadow-sm);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-family: var(--font-ui);
  font-size: var(--raw-text-sm);
  line-height: var(--line-height-tight);
}

thead th {
  background: var(--color-surface-warm);
  color: var(--color-text-primary);
  font-weight: 700;
  font-size: var(--raw-text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: var(--raw-space-4) var(--raw-space-5);
  text-align: left;
  border-bottom: 2px solid var(--color-surface-rule);
}

tbody td {
  padding: var(--raw-space-4) var(--raw-space-5);
  border-bottom: 1px solid var(--color-surface-rule);
  vertical-align: top;
  transition: background var(--duration-fast) var(--ease-in-out);
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) td { background: var(--color-surface-warm); }
tbody tr:hover td { background: var(--raw-blue-light); }


/* ============================================================
   FORMULA / EQUATION BLOCK
   ============================================================ */
.formula {
  margin: var(--raw-space-8) 0;
  padding: var(--raw-space-8) var(--raw-space-10);
  background: var(--color-surface-warm);
  border: 1px solid var(--color-surface-rule);
  border-radius: var(--raw-radius-xl);
  text-align: center;
}

.formula-expression {
  font-family: var(--font-mono);
  font-size: var(--raw-text-xl);
  font-weight: 500;
  color: var(--color-text-primary);
  letter-spacing: 0.02em;
}

.formula-label {
  display: block;
  font-family: var(--font-ui);
  font-size: var(--raw-text-sm);
  color: var(--color-text-caption);
  margin-top: var(--raw-space-3);
}

.formula-expression .highlight {
  color: var(--color-brand);
  font-weight: 600;
}


/* ============================================================
   NUMBERED STEPS
   ============================================================ */
.steps {
  margin: var(--raw-space-8) 0;
  padding: 0;
  list-style: none;
  counter-reset: step-counter;
}

.step {
  display: flex;
  gap: var(--raw-space-5);
  margin-bottom: var(--raw-space-8);
  counter-increment: step-counter;
}

.step-number {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-brand);
  color: var(--color-text-inverse);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--raw-text-base);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 114, 178, 0.25);
}

.step-content {
  flex: 1;
  padding-top: var(--raw-space-1);
}

.step-title {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--raw-space-1);
}

.step-body {
  font-size: var(--raw-text-md);
  color: var(--color-text-secondary);
}

.step-connector {
  width: 2px;
  background: linear-gradient(to bottom, var(--raw-blue), var(--raw-sky));
  margin-left: calc(1.25rem - 1px);
  min-height: var(--raw-space-4);
  margin-bottom: var(--raw-space-2);
  margin-top: calc(-1 * var(--raw-space-6));
  border-radius: 1px;
}


/* ============================================================
   COMPARISON CARDS (B2C vs B2B)
   ============================================================ */
.comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--raw-space-4);
  margin: var(--raw-space-8) 0;
}

@media (max-width: 600px) {
  .comparison { grid-template-columns: 1fr; }
}

.comparison-card {
  border: 1px solid var(--color-surface-rule);
  border-radius: var(--raw-radius-xl);
  overflow: hidden;
  box-shadow: var(--raw-shadow-sm);
  transition: box-shadow var(--duration-base) var(--ease-in-out);
}

.comparison-card:hover { box-shadow: var(--raw-shadow-md); }

.comparison-header {
  padding: var(--raw-space-3) var(--raw-space-4);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--raw-text-sm);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-inverse);
}

.comparison-card.b2c .comparison-header { background: var(--color-acquisition); }
.comparison-card.b2b .comparison-header { background: var(--color-conversion); }

.comparison-body {
  padding: var(--raw-space-5);
  font-family: var(--font-ui);
  font-size: var(--raw-text-md);
  line-height: var(--line-height-tight);
}


/* ============================================================
   LEARNING OBJECTIVES (Lernziele)
   ============================================================ */
.lernziele {
  margin: var(--raw-space-8) 0;
  padding: var(--raw-space-6) var(--raw-space-8);
  border: 2px dashed var(--color-surface-rule);
  border-radius: var(--raw-radius-xl);
}

.lernziele-header {
  font-family: var(--font-heading);
  font-size: var(--raw-text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-text-secondary);
  margin-bottom: var(--raw-space-4);
}

.lernziele-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.lernziele-list li {
  padding-left: var(--raw-space-6);
  position: relative;
  font-family: var(--font-ui);
  font-size: var(--raw-text-md);
  margin-bottom: var(--raw-space-2);
}

.lernziele-list li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--color-revenue);
  font-weight: 700;
}


/* ============================================================
   BADGES & TAGS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-heading);
  font-size: var(--raw-text-2xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.3em 0.85em;
  border-radius: var(--raw-radius-pill);
  white-space: nowrap;
}

.badge-vermilion { background: var(--raw-vermilion-light); color: var(--raw-vermilion-dark); border: 1px solid rgba(213, 94, 0, 0.2); }
.badge-orange    { background: var(--raw-orange-light);    color: var(--raw-orange-dark);    border: 1px solid rgba(230, 159, 0, 0.2); }
.badge-teal      { background: var(--raw-teal-light);      color: var(--raw-teal-dark);      border: 1px solid rgba(0, 158, 115, 0.2); }
.badge-blue      { background: var(--raw-blue-light);      color: var(--raw-blue-dark);      border: 1px solid rgba(0, 114, 178, 0.2); }
.badge-gray      { background: var(--color-surface-muted); color: var(--color-text-secondary); border: 1px solid rgba(0, 0, 0, 0.08); }
.badge-dark      { background: var(--color-surface-dark);  color: var(--color-text-inverse);   border: 1px solid rgba(255, 255, 255, 0.1); }


/* ============================================================
   INLINE ELEMENTS
   ============================================================ */

/* Metric highlight (inline BMDNA metric names) */
.metric {
  font-family: var(--font-heading);
  font-size: 0.88em;
  font-weight: 600;
  padding: 0.1em 0.55em 0.1em 0.65em;
  border-radius: var(--raw-radius-sm);
  background: var(--color-surface-muted);
  color: var(--color-text-primary);
  white-space: nowrap;
  border-left: 2px solid var(--color-brand);
}

/* Inline code */
code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 0.15em 0.4em;
  background: var(--color-surface-warm);
  border: 1px solid var(--color-surface-rule);
  border-radius: var(--raw-radius-sm);
  color: var(--color-text-primary);
}

/* Code block */
pre {
  position: relative;
  margin: var(--raw-space-6) 0;
  padding: var(--raw-space-5) var(--raw-space-6);
  background: #0d1117;
  border-radius: var(--raw-radius-xl);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

pre code {
  font-size: var(--raw-text-md);
  padding: 0;
  background: none;
  border: none;
  color: rgba(255,255,255,0.9);
  line-height: 1.6;
  display: block;
}

/* Definition term (inline) */
.term {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: var(--color-text-caption);
  text-underline-offset: 3px;
  cursor: help;
}


/* ============================================================
   NOTE / ASIDE
   ============================================================ */
.note {
  margin: var(--raw-space-6) 0;
  padding: var(--raw-space-5) var(--raw-space-6);
  background: var(--color-surface-warm);
  border-radius: var(--raw-radius-xl);
  font-family: var(--font-ui);
  font-size: var(--raw-text-md);
  color: var(--color-text-secondary);
  line-height: var(--line-height-tight);
  box-shadow: var(--raw-shadow-sm);
}

.note p { margin-bottom: var(--raw-space-2); }
.note p:last-child { margin-bottom: 0; }


/* ============================================================
   SECTION BREAKS
   ============================================================ */
hr {
  border: none;
  border-top: 1px solid var(--color-surface-rule);
  margin: var(--raw-space-10) 0;
}
