/* JSZaunbrecher — Global styles with design system tokens */

:root {
  /* Neutrals — warm grey ramp */
  --neutral-0:   #ffffff;
  --neutral-50:  #f7f6f4;
  --neutral-100: #efedea;
  --neutral-200: #e2dfda;
  --neutral-300: #cbc7c0;
  --neutral-400: #a39e96;
  --neutral-500: #7c776f;
  --neutral-600: #5a554e;
  --neutral-700: #403c37;
  --neutral-800: #2b2926;
  --neutral-900: #1c1b19;

  /* Brand accent — orange */
  --orange-100: #fce7d6;
  --orange-300: #f4b483;
  --orange-500: #ed7d31;
  --orange-600: #d8691e;
  --orange-700: #b5550f;

  /* Semantic status */
  --green-500:  #4caf50;
  --green-50:   #e8f5e9;
  --red-500:    #d64545;
  --red-50:     #fbeaea;
  --blue-500:   #2a8fd6;
  --blue-50:    #e6f3fb;

  /* Semantic aliases */
  --bg-page:        var(--neutral-50);
  --bg-canvas:      var(--neutral-0);
  --surface-card:   var(--neutral-0);
  --surface-sunken: var(--neutral-100);
  --surface-inverse:var(--neutral-900);

  --text-strong:    var(--neutral-900);
  --text-body:      var(--neutral-700);
  --text-muted:     var(--neutral-500);
  --text-inverse:   var(--neutral-0);
  --text-link:      var(--orange-600);

  --accent:         var(--orange-500);
  --accent-hover:   var(--orange-600);
  --accent-press:   var(--orange-700);
  --accent-soft:    var(--orange-100);

  --border-subtle:  var(--neutral-200);
  --border-default: var(--neutral-300);
  --border-strong:  var(--neutral-400);

  --focus-ring:     var(--orange-500);

  --success:        var(--green-500);
  --success-soft:   var(--green-50);
  --danger:         var(--red-500);
  --danger-soft:    var(--red-50);
  --info:           var(--blue-500);
  --info-soft:      var(--blue-50);

  /* Typography */
  --font-sans: "Helvetica Neue", Helvetica, Arial, "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --text-xs:   12px;
  --text-sm:   14px;
  --text-base: 16px;
  --text-md:   18px;
  --text-lg:   22px;
  --text-xl:   28px;
  --text-2xl:  36px;
  --text-3xl:  46px;
  --weight-regular: 400;
  --weight-medium:  500;
  --weight-bold:    700;
  --leading-tight: 1.15;
  --leading-snug:  1.3;
  --leading-body:  1.6;
  --tracking-tight: -0.02em;

  /* Spacing — 4px base */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  24px;
  --space-6:  32px;
  --space-7:  48px;
  --space-8:  64px;
  --space-9:  96px;

  /* Radius */
  --radius-none: 0px;
  --radius-sm:   4px;
  --radius-md:   6px;
  --radius-lg:   10px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(28, 27, 25, 0.06);
  --shadow-md: 0 2px 8px rgba(28, 27, 25, 0.08);
  --shadow-lg: 0 8px 24px rgba(28, 27, 25, 0.10);
}

/* ---- Base element defaults ---- */
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--text-body);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-sans);
  color: var(--text-strong);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  margin: 0 0 var(--space-3);
}

h1 { font-size: var(--text-3xl); letter-spacing: var(--tracking-tight); }
h2 { font-size: var(--text-xl); letter-spacing: var(--tracking-tight); }
h3 { font-size: var(--text-lg); }
h4 { font-size: var(--text-md); }

p { margin: 0 0 var(--space-4); }

a {
  color: var(--text-link);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  color: var(--accent-hover);
}

hr {
  border: 0;
  border-top: 1px solid var(--border-subtle);
  margin: var(--space-5) 0;
}

hr.accent {
  border-top: 3px solid var(--accent);
  margin: 0 0 var(--space-4);
  opacity: 1;
}

::selection {
  background: var(--accent-soft);
  color: var(--text-strong);
}

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ---- Page wrapper for sticky footer ---- */
.page-content {
  flex: 1;
}

/* ---- Badge component ---- */
.badge-ds {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  line-height: 1.4;
}
.badge-neutral {
  background: var(--surface-sunken);
  color: var(--text-body);
  border: 1px solid var(--border-subtle);
}
.badge-accent {
  background: var(--accent-soft);
  color: var(--accent-press);
  border: 1px solid transparent;
}

/* ---- Card component ---- */
.card-ds {
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  background: var(--surface-card);
}
.card-elevated {
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
}
.card-outline {
  border: 1px solid var(--border-default);
  box-shadow: none;
}

/* ---- Button component ---- */
.btn-ds {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-sans);
  font-weight: var(--weight-medium);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 120ms ease;
  line-height: 1;
  text-decoration: none;
  border: none;
}
.btn-ds:hover { text-decoration: none; }
.btn-sm { padding: 6px 12px; font-size: var(--text-sm); }
.btn-md { padding: 10px 18px; font-size: var(--text-base); }
.btn-primary {
  background: var(--accent);
  color: var(--text-inverse);
  border: 1px solid var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); color: var(--text-inverse); }
.btn-primary:active { background: var(--accent-press); }
.btn-secondary {
  background: var(--surface-card);
  color: var(--text-strong);
  border: 1px solid var(--border-default);
}
.btn-secondary:hover { background: var(--surface-sunken); color: var(--text-strong); }
.btn-ghost {
  background: transparent;
  color: var(--text-link);
  border: 1px solid transparent;
  padding-left: 0;
}
.btn-ghost:hover { background: var(--surface-sunken); }
.btn-ds[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- Section pattern (CV-style) ---- */
.ds-section {
  margin-bottom: var(--space-6);
}
.ds-section h2 {
  font-size: var(--text-xl);
}

/* ---- Alert ---- */
.alert-ds {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  font-weight: var(--weight-medium);
  margin-bottom: var(--space-4);
}
.alert-success {
  background: var(--success-soft);
  color: #2e7d32;
}
.alert-error {
  background: var(--danger-soft);
  color: #a83232;
}
