/* =========================================================
   base.css — Reset, Design-Tokens, Grundtypografie
   Wums Tech · wums.tech
   ========================================================= */

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  hanging-punctuation: first last;
  scroll-padding-top: 6rem;
}

body {
  min-height: 100dvh;
  line-height: 1.62;
  font-family: var(--font-body, system-ui, sans-serif);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
}

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

ul[role='list'],
ol[role='list'] {
  list-style: none;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  text-wrap: balance;
  line-height: 1.14;
  font-weight: 400;
}

p,
li,
figcaption {
  text-wrap: pretty;
  max-width: 68ch;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

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

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

a,
button,
[role='button'],
input,
textarea,
select,
summary {
  transition:
    color var(--transition-interactive),
    background-color var(--transition-interactive),
    border-color var(--transition-interactive),
    box-shadow var(--transition-interactive),
    transform var(--transition-interactive);
}

@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;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ---------- Tokens ---------- */
:root {
  /* Typo-Skala (fluid) */
  --text-xs: clamp(0.75rem, 0.72rem + 0.15vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.84rem + 0.2vw, 0.9375rem);
  --text-base: clamp(1rem, 0.96rem + 0.25vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1.02rem + 0.55vw, 1.375rem);
  --text-xl: clamp(1.5rem, 1.22rem + 1.15vw, 2.125rem);
  --text-2xl: clamp(2rem, 1.35rem + 2.6vw, 3.25rem);
  --text-3xl: clamp(2.4rem, 1.3rem + 4.2vw, 4.5rem);

  /* Abstände (4px-System) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Radien — bewusst kantig, kleine Hierarchie */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;
  --radius-full: 999px;

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  --content-narrow: 44rem;
  --content-default: 64rem;
  --content-wide: 78rem;

  --border-hair: 1px;

  /* Schriften */
  --font-display: 'Zodiak', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Switzer', 'Segoe UI', system-ui, sans-serif;
}

/* ---------- Farbwelt: Werkstattpapier & Signalziegel ---------- */
:root,
[data-theme='light'] {
  --color-bg: #f7f2e8;
  --color-bg-deep: #efe7d8;
  --color-surface: #fffbf3;
  --color-surface-2: #f3ecdf;
  --color-ink: #211e19;
  --color-text: #2a2621;
  --color-text-muted: #57514a;
  --color-text-faint: #6b645b;
  --color-text-inverse: #fbf7ef;
  --color-border: rgba(42, 38, 33, 0.16);
  --color-border-strong: rgba(42, 38, 33, 0.34);
  --color-accent: #b4451f;
  --color-accent-strong: #9c3617;
  --color-accent-deep: #7d2a10;
  --color-accent-soft: #f0a06b;
  --color-accent-on-dark: #f0a06b;
  --color-accent-wash: rgba(180, 69, 31, 0.14);
  --color-accent-contrast: #fffbf3;
  --color-pine: #1f4d3d;
  --color-pine-wash: rgba(31, 77, 61, 0.12);
  --shadow-sm: 0 1px 2px rgba(58, 42, 24, 0.08);
  --shadow-md: 0 6px 20px -8px rgba(58, 42, 24, 0.22);
  --shadow-lg: 0 20px 50px -24px rgba(58, 42, 24, 0.38);
  --grain-opacity: 0.4;
  color-scheme: light;
}

[data-theme='dark'] {
  --color-bg: #15130f;
  --color-bg-deep: #100e0b;
  --color-surface: #1c1916;
  --color-surface-2: #221e1a;
  --color-ink: #ede6da;
  --color-text: #ede6da;
  --color-text-muted: #a79e92;
  --color-text-faint: #8e877c;
  --color-text-inverse: #17140f;
  --color-border: rgba(237, 230, 218, 0.16);
  --color-border-strong: rgba(237, 230, 218, 0.32);
  --color-accent: #f0a06b;
  --color-accent-strong: #f0a06b;
  --color-accent-deep: #e8834a;
  --color-accent-soft: #f4b78f;
  --color-accent-on-dark: #f4b78f;
  --color-accent-wash: rgba(240, 160, 107, 0.16);
  --color-accent-contrast: #17140f;
  --color-pine: #8fc0aa;
  --color-pine-wash: rgba(143, 192, 170, 0.12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 6px 20px -8px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 20px 50px -24px rgba(0, 0, 0, 0.7);
  --grain-opacity: 0.18;
  color-scheme: dark;
}
