/* =============================================================
   JADEY DESIGN SYSTEM — Colors & Type
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* -------------------------------------------------------------
   COLOR TOKENS
   ------------------------------------------------------------- */
:root {
  /* ——— Ink / neutrals ————————————————————————————————————— */
  /* Warm-cool near-black; used for text and dark surfaces */
  --ink-0:   #FFFFFF;
  --ink-25:  #F7F7F5;   /* page bg — faint warm off-white */
  --ink-50:  #EFEEEA;   /* subtle surface */
  --ink-100: #E3E1DC;   /* card border */
  --ink-200: #CDCBC4;   /* divider */
  --ink-300: #A8A6A0;   /* disabled fg */
  --ink-400: #6F6D67;   /* secondary text */
  --ink-500: #4A4945;   /* tertiary / meta */
  --ink-600: #2C2B28;   /* strong text on light */
  --ink-700: #1A1A18;   /* display headlines */
  --ink-800: #121210;   /* near-black surface */
  --ink-900: #0B0D0F;   /* dark UI base — matches logo ground */

  /* ——— Orange · Primary CTA accent ——————————————————————————
     Jadeys einziger Marken-Akzent. Strikt für Primary-CTAs und
     primär-aktive Links reserviert. Nicht für Flächen, Hero-Blöcke,
     Icons oder dekorative Elemente. Status-Palette bleibt unberührt. */
  --orange-400: #FF8A4A;   /* hover on dark */
  --orange-500: #FF6B1A;   /* primary · dark */
  --orange-600: #E85D1F;   /* primary · light */
  --orange-700: #C94A10;   /* hover on light */

  /* ——— Status colors ——————————————————————————————————————— */
  --status-running-fg: #1A1A18;   /* läuft — monochrom, stark */
  --status-running-bg: #EFEEEA;

  --status-pending-fg: #8A5A00;   /* amber — wartet / in Arbeit */
  --status-pending-bg: #FBF0D6;

  --status-blocked-fg: #A8321C;   /* rust — blockiert */
  --status-blocked-bg: #F8E4DD;

  --status-done-fg:    #1A1A18;   /* done / abgeschlossen */
  --status-done-bg:    #E3E1DC;

  --status-review-fg:  #1F4A7A;   /* Freigabe ausstehend */
  --status-review-bg:  #E0EAF4;

  /* ——— Semantic aliases — DARK THEME (default) —————————————————
     Jadey is dark‑first. The logo is designed on Ink‑900 ground,
     the hero is dark, the product lives on dark. Light is a
     secondary mode for print, PDFs, and inverse sections.         */
  --bg-canvas:   var(--ink-900);
  --bg-surface:  var(--ink-800);
  --bg-subtle:   #191917;
  --bg-inverse:  var(--ink-25);

  --fg-default:  var(--ink-25);
  --fg-muted:    #8A8A84;
  --fg-subtle:   #6F6D67;
  --fg-onInverse: var(--ink-900);

  --border-default: rgba(255,255,255,0.08);
  --border-strong:  rgba(255,255,255,0.16);
  --border-inverse: var(--ink-100);

  --accent:       #FFFFFF;          /* monochrome primary on dark */
  --accent-hover: var(--ink-25);
  --accent-weak:  rgba(255,255,255,0.08);
  --accent-fg:    var(--ink-900);
  --cta-primary: var(--orange-500);
  --cta-primary-hover: var(--orange-400);
  --cta-primary-fg: var(--orange-500);

  --focus-ring: 0 0 0 2px var(--bg-canvas), 0 0 0 4px var(--ink-25);

  /* ——— Status colors (dark‑tuned) —————————————————————————— */
  --status-running-fg: #E3E1DC;
  --status-running-bg: rgba(255,255,255,0.08);

  --status-pending-fg: #F2C97A;
  --status-pending-bg: rgba(217,156,54,0.14);

  --status-blocked-fg: #F09A84;
  --status-blocked-bg: rgba(217,98,72,0.14);

  --status-review-fg:  #9CC3EB;
  --status-review-bg:  rgba(100,151,210,0.14);

  --status-done-fg:    #8A8A84;
  --status-done-bg:    rgba(255,255,255,0.04);

  /* ——— Shadow (dark) ———————————————————————————————————————— */
  --shadow-0: none;
  --shadow-1: 0 1px 0 0 rgba(0,0,0,0.4);
  --shadow-2: 0 2px 4px -1px rgba(0,0,0,0.4), 0 4px 12px -4px rgba(0,0,0,0.5);
  --shadow-3: 0 8px 24px -8px rgba(0,0,0,0.6), 0 2px 4px -1px rgba(0,0,0,0.4);
  --shadow-pop: 0 20px 48px -16px rgba(0,0,0,0.7);

  /* ——— Radii ——————————————————————————————————————————————— */
  --radius-xs: 2px;    /* input chips, small badges */
  --radius-sm: 4px;    /* default inputs, buttons */
  --radius-md: 6px;    /* cards */
  --radius-lg: 10px;   /* prominent cards, modals */
  --radius-xl: 16px;   /* hero surfaces */
  --radius-full: 9999px;

  /* ——— Spacing (4px base) ————————————————————————————————— */
  --space-0:  0;
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* ——— Layout ——————————————————————————————————————————————— */
  --container-sm: 640px;
  --container-md: 960px;
  --container-lg: 1200px;
  --container-xl: 1440px;
  --gutter: 24px;

  /* ——— Motion ——————————————————————————————————————————————— */
  /* Restrained, precise. Enterprise doesn't bounce. */
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-accel:    cubic-bezier(0.4, 0, 1, 1);
  --ease-decel:    cubic-bezier(0, 0, 0.2, 1);
  --dur-instant: 80ms;
  --dur-fast:    140ms;
  --dur-base:    220ms;
  --dur-slow:    360ms;
}

/* Light theme override (inverse — for print, PDF, light sections) */
[data-theme="light"] {
  --bg-canvas:   var(--ink-25);
  --bg-surface:  var(--ink-0);
  --bg-subtle:   var(--ink-50);
  --bg-inverse:  var(--ink-900);

  --fg-default:  var(--ink-700);
  --fg-muted:    var(--ink-400);
  --fg-subtle:   var(--ink-500);
  --fg-onInverse: var(--ink-0);

  --border-default: var(--ink-100);
  --border-strong:  var(--ink-200);
  --border-inverse: rgba(255,255,255,0.12);

  --accent:       var(--ink-900);
  --accent-hover: var(--ink-700);
  --accent-weak:  var(--ink-50);
  --accent-fg:    #FFFFFF;
  --cta-primary: var(--orange-600);
  --cta-primary-hover: var(--orange-700);
  --cta-primary-fg: var(--orange-600);

  --focus-ring: 0 0 0 2px var(--bg-canvas), 0 0 0 4px var(--ink-700);

  --status-running-fg: #1A1A18;
  --status-running-bg: #EFEEEA;
  --status-pending-fg: #8A5A00;
  --status-pending-bg: #FBF0D6;
  --status-blocked-fg: #A8321C;
  --status-blocked-bg: #F8E4DD;
  --status-done-fg:    #1A1A18;
  --status-done-bg:    #E3E1DC;
  --status-review-fg:  #1F4A7A;
  --status-review-bg:  #E0EAF4;

  --shadow-1: 0 1px 0 0 rgba(11,13,15,0.04), 0 1px 2px -1px rgba(11,13,15,0.06);
  --shadow-2: 0 2px 4px -1px rgba(11,13,15,0.06), 0 4px 12px -4px rgba(11,13,15,0.08);
  --shadow-3: 0 8px 24px -8px rgba(11,13,15,0.12), 0 2px 4px -1px rgba(11,13,15,0.06);
  --shadow-pop: 0 20px 48px -16px rgba(11,13,15,0.18);
}

/* (old dark override retained as no‑op for back‑compat) */
[data-theme="dark"] { /* already default */ }

/* -------------------------------------------------------------
   TYPE TOKENS
   ------------------------------------------------------------- */
:root {
  --font-sans:    'Inter Tight', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', 'Consolas', ui-monospace, monospace;
  --font-display: 'Inter Tight', 'Inter', sans-serif;   /* same family, tighter tracking */

  /* Type scale — modest ratio, enterprise-appropriate */
  --text-xs:   11px;
  --text-sm:   12px;
  --text-base: 14px;
  --text-md:   15px;
  --text-lg:   17px;
  --text-xl:   20px;
  --text-2xl:  24px;
  --text-3xl:  32px;
  --text-4xl:  44px;
  --text-5xl:  60px;
  --text-6xl:  80px;
  --text-7xl:  108px;
  --text-h1:   72px;

  --leading-tight:   1.05;
  --leading-snug:    1.2;
  --leading-normal:  1.45;
  --leading-relaxed: 1.6;

  --tracking-tightest: -0.03em;
  --tracking-tight:    -0.015em;
  --tracking-normal:   0;
  --tracking-wide:     0.04em;
  --tracking-caps:     0.08em;
}

/* -------------------------------------------------------------
   SEMANTIC TYPE CLASSES
   ------------------------------------------------------------- */
html { font-family: var(--font-sans); color: var(--fg-default); background: var(--bg-canvas); }
body { font-size: var(--text-base); line-height: var(--leading-normal); }

.jd-display {
  font-family: var(--font-display);
  font-size: var(--text-7xl);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tightest);
  font-weight: 500;
}
.jd-h1 {
  font-size: var(--text-h1);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  font-weight: 500;
}
.jd-h2 {
  font-size: var(--text-3xl);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  font-weight: 500;
}
.jd-h3 {
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
  letter-spacing: -0.005em;
  font-weight: 500;
}
.jd-h4 {
  font-size: var(--text-md);
  font-weight: 600;
  line-height: var(--leading-snug);
}
.jd-body {
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}
.jd-body-lg {
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  color: var(--fg-muted);
}
.jd-lede {
  font-size: var(--text-xl);
  line-height: var(--leading-relaxed);
  color: var(--fg-muted);
  letter-spacing: -0.005em;
}
.jd-meta {
  font-size: var(--text-sm);
  color: var(--fg-muted);
  line-height: var(--leading-normal);
}
.jd-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--fg-muted);
}
.jd-mono {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: 0;
}
.jd-kbd {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  padding: 2px 6px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xs);
  background: var(--bg-surface);
  color: var(--fg-muted);
}
.jd-code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  padding: 2px 5px;
  background: var(--bg-subtle);
  border-radius: var(--radius-xs);
  color: var(--ink-700);
}

/* tabular numerals — critical for enterprise tables / metrics */
.jd-tnum { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }

/* -------------------------------------------------------------
   JADEY SITE BRIDGE
   design-token.css remains canonical; the site-specific aliases
   and component hooks below keep the existing Jadey CSS working.
   ------------------------------------------------------------- */
:root {
  --jd-color-black: var(--ink-900);
  --jd-color-white: var(--ink-0);
  --jd-color-blue-500: var(--accent);
  --jd-color-header-backdrop: rgba(11, 13, 15, 0.84);

  --jd-color-canvas: var(--bg-canvas);
  --jd-color-surface: var(--bg-surface);
  --jd-color-surface-pressed: var(--bg-subtle);
  --jd-color-text-primary: var(--fg-default);
  --jd-color-text-secondary: var(--fg-muted);
  --jd-color-text-tertiary: var(--fg-subtle);
  --jd-color-text-quaternary: var(--fg-muted);
  --jd-color-text-nav: var(--fg-muted);
  --jd-color-text-label: var(--fg-muted);
  --jd-color-hairline: var(--border-default);
  --jd-color-border-subtle: var(--border-default);
  --jd-color-border-strong: var(--border-strong);
  --jd-color-accent: var(--accent);
  --jd-color-inverse-bg: var(--bg-inverse);
  --jd-color-inverse-text: var(--fg-onInverse);

  --jd-space-4: var(--space-1);
  --jd-space-6: 6px;
  --jd-space-8: var(--space-2);
  --jd-space-10: 10px;
  --jd-space-12: var(--space-3);
  --jd-space-14: 14px;
  --jd-space-16: var(--space-4);
  --jd-space-18: 18px;
  --jd-space-20: var(--space-5);
  --jd-space-24: var(--space-6);
  --jd-space-28: 28px;
  --jd-space-32: var(--space-8);
  --jd-space-40: var(--space-10);
  --jd-space-72: 72px;
  --jd-space-80: var(--space-20);
  --jd-space-112: 112px;

  --jd-size-160: 160px;
  --jd-size-180: 180px;

  --jd-border-hairline-width: 1px;
  --jd-border-rule-width: 1px;

  --jd-measure-container: var(--container-xl);
  --jd-measure-section: 860px;
  --jd-measure-hero: 880px;
  --jd-measure-copy: 640px;
  --jd-page-padding-fluid: clamp(24px, 4vw, 40px);
  --jd-section-gap-fluid: clamp(56px, 8vw, 88px);
  --jd-hero-top-space-fluid: clamp(40px, 6vw, 72px);
  --jd-footer-padding-top-fluid: clamp(72px, 8vw, 112px);
  --jd-footer-gap-fluid: clamp(32px, 5vw, 64px);

  --jd-space-page-padding: var(--jd-page-padding-fluid);
  --jd-space-section: var(--jd-section-gap-fluid);
  --jd-space-section-tight: var(--jd-space-24);
  --jd-space-gutter: var(--jd-space-40);
  --jd-space-hero-top: var(--jd-hero-top-space-fluid);

  --jd-measure-page-shell: var(--jd-measure-container);
  --jd-measure-page-section: var(--jd-measure-section);
  --jd-measure-page-hero: var(--jd-measure-hero);
  --jd-measure-page-copy: var(--jd-measure-copy);

  --jd-font-headline: var(--font-display);
  --jd-font-body: var(--font-sans);
  --jd-font-mono: var(--font-mono);

  --jd-font-size-12: var(--text-sm);
  --jd-font-size-16: var(--text-md);
  --jd-font-size-24: var(--text-2xl);
  --jd-font-size-32: var(--text-3xl);
  --jd-font-size-40: var(--text-4xl);

  --jd-line-height-16: var(--leading-normal);
  --jd-line-height-24: var(--leading-relaxed);
  --jd-line-height-32: var(--leading-snug);
  --jd-line-height-40: var(--leading-tight);

  --jd-letter-spacing-tight-xs: -0.01em;
  --jd-letter-spacing-tight-sm: var(--tracking-tight);
  --jd-letter-spacing-tight-md: -0.02em;
  --jd-letter-spacing-tight-lg: -0.028em;
  --jd-letter-spacing-tight-xl: var(--tracking-tightest);
  --jd-letter-spacing-wide-sm: var(--tracking-wide);
  --jd-letter-spacing-wide-md: 0.08em;
  --jd-letter-spacing-wide-lg: var(--tracking-caps);

  --jd-type-family-headline: var(--jd-font-headline);
  --jd-type-family-body: var(--jd-font-body);
  --jd-type-family-mono: var(--jd-font-mono);
  --jd-type-size-body: var(--text-md);
  --jd-type-size-meta: var(--text-sm);
  --jd-type-size-title-xs: var(--text-lg);
  --jd-type-size-title-sm: var(--text-xl);
  --jd-type-size-title-md: var(--text-3xl);
  --jd-type-size-hero-fluid: clamp(var(--text-4xl), 6vw, var(--text-h1));
  --jd-type-size-section-fluid: clamp(var(--text-3xl), 4vw, var(--text-5xl));
  --jd-type-size-title-lg: var(--jd-type-size-section-fluid);
  --jd-type-size-title-xl: var(--jd-type-size-hero-fluid);
  --jd-type-size-title-lg-tablet: var(--text-3xl);
  --jd-type-size-title-lg-mobile: var(--text-2xl);
  --jd-type-size-title-xl-tablet: var(--text-4xl);
  --jd-type-size-title-xl-mobile: var(--text-3xl);
  --jd-type-line-body: var(--leading-relaxed);
  --jd-type-line-body-ratio: var(--leading-relaxed);
  --jd-type-line-meta: var(--leading-normal);
  --jd-type-line-title-sm: var(--leading-snug);
  --jd-type-line-title-md: var(--leading-tight);
  --jd-type-letter-tight-xs: var(--jd-letter-spacing-tight-xs);
  --jd-type-letter-tight-sm: var(--jd-letter-spacing-tight-sm);
  --jd-type-letter-tight-md: var(--jd-letter-spacing-tight-md);
  --jd-type-letter-tight-lg: var(--jd-letter-spacing-tight-lg);
  --jd-type-letter-tight-xl: var(--jd-letter-spacing-tight-xl);
  --jd-type-letter-wide-sm: var(--jd-letter-spacing-wide-sm);
  --jd-type-letter-wide-md: var(--jd-letter-spacing-wide-md);
  --jd-type-letter-wide-lg: var(--jd-letter-spacing-wide-lg);

  --jd-header-height: 80px;
  --jd-brand-mark-height: 24px;
  --jd-cta-gap: var(--jd-space-8);
  --jd-cta-padding-bottom: var(--jd-space-4);
  --jd-cta-border-width: 1px;
  --jd-cta-color: var(--cta-primary-fg);
  --jd-cta-color-hover: var(--cta-primary-fg);
  --jd-cta-border-color: var(--text-secondary);
  --jd-cta-border-color-hover: var(--text-primary);

  --jd-section-divider-width: 1px;
  --jd-section-divider-color: var(--jd-color-hairline);
  --jd-rule-accent-width: 32px;
  --jd-rule-accent-height: 1px;
  --jd-faq-item-gap: var(--jd-space-24);
  --jd-faq-item-padding-y: var(--jd-space-24);

  --jd-footer-padding-top: var(--jd-footer-padding-top-fluid);
  --jd-footer-padding-bottom: var(--jd-space-28);
  --jd-footer-gap: var(--jd-footer-gap-fluid);
  --jd-footer-logo-width: 280px;
  --jd-footer-logo-width-mobile: 192px;

  --jd-section-surface-highlight:
    radial-gradient(circle at 14% 18%, rgba(255, 255, 255, 0.08), transparent 30%),
    radial-gradient(circle at 78% 22%, rgba(255, 255, 255, 0.05), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015)),
    var(--bg-surface);
  --jd-section-surface-highlight-overlay:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.08), transparent 60%),
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), transparent);
  --jd-section-surface-highlight-border-top: rgba(255, 255, 255, 0.14);
  --jd-section-surface-highlight-border-bottom: rgba(255, 255, 255, 0.08);
  --jd-section-surface-highlight-rule: rgba(255, 255, 255, 0.12);
  --jd-section-surface-highlight-text: rgba(247, 247, 245, 0.76);

  --jd-home-hero-shell-columns: minmax(0, 1fr) minmax(420px, 560px);
  --jd-home-hero-shell-columns-narrow: minmax(0, 1fr) minmax(360px, 480px);
  --jd-home-hero-shell-gap: clamp(40px, 5vw, 72px);
  --jd-home-hero-shell-gap-narrow: clamp(32px, 4vw, 52px);
  --jd-home-hero-shell-gap-tablet: var(--jd-space-40);
  --jd-home-hero-shell-gap-mobile: var(--jd-space-32);
  --jd-home-hero-copy-max: 720px;
  --jd-home-hero-visual-width: 540px;
  --jd-home-hero-visual-height: clamp(280px, 58vw, 440px);
  --jd-home-hero-glow:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.04) 36%, rgba(255, 255, 255, 0) 72%);
  --jd-home-hero-glow-blur: 18px;
  --jd-home-hero-background:
    radial-gradient(circle at 16% 18%, rgba(255, 255, 255, 0.08), transparent 28%),
    radial-gradient(circle at 82% 22%, rgba(255, 255, 255, 0.05), transparent 32%),
    radial-gradient(circle at 52% 80%, rgba(227, 225, 220, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0) 28%),
    linear-gradient(180deg, rgba(18, 18, 16, 0.98), rgba(11, 13, 15, 1));
  --jd-home-scroll-value: 0;
  --jd-home-scroll-progress: 0%;
  --jd-home-hero-progress: 0;
  --jd-home-hero-overlay-opacity-max: 0.55;
  --jd-home-hero-copy-opacity-min: 0.72;
  --jd-home-logos-padding-top: var(--jd-space-24);
  --jd-home-form-placeholder: rgba(247, 247, 245, 0.42);
  --jd-home-form-focus-border: var(--accent);
  --jd-home-form-error: var(--status-blocked-fg);
  --jd-home-checkbox-gap: var(--jd-space-12);
  --jd-home-checkbox-margin-top: var(--jd-space-4);

  --jd-page-header-height: var(--jd-header-height);
  --jd-page-section-measure: var(--jd-measure-page-section);

  --canvas: var(--jd-color-canvas);
  --surface: var(--jd-color-surface);
  --surface-pressed: var(--jd-color-surface-pressed);
  --text-primary: var(--jd-color-text-primary);
  --text-secondary: var(--jd-color-text-secondary);
  --text-tertiary: var(--jd-color-text-tertiary);
  --text-quaternary: var(--jd-color-text-quaternary);
  --hairline: var(--jd-color-hairline);
  --border-subtle: var(--jd-color-border-subtle);
  --container: var(--jd-measure-page-shell);
  --header-height: var(--jd-page-header-height);
  --hero-top-space: var(--jd-space-hero-top);
  --hero-measure: var(--jd-measure-page-hero);
  --copy-measure: var(--jd-measure-page-copy);
  --section-measure: var(--jd-page-section-measure);
  --section-text-size: 20px;
  --section-title-size: var(--jd-type-size-title-lg);
  --section-gap-tight: var(--jd-space-section-tight);
  --section-gap: var(--jd-space-section);
  --page-padding: var(--jd-space-page-padding);
  --headline: var(--jd-type-family-headline);
  --body: var(--jd-type-family-body);
  --mono: var(--jd-type-family-mono);
}

:root,
[data-page-mode="home"],
[data-page-mode="home-like"],
[data-page-mode="content"] {
  --jd-page-header-height: var(--jd-header-height);
  --jd-page-section-measure: var(--jd-measure-page-section);
}
