/* ============================================================
   BASE – Design-System: Custom Properties, Typografie, Layout
   ============================================================ */

/* ── Fonts ──────────────────────────────────────────────── */

/* Variable Font – ein File für alle drei Schnitte */
@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter-latin.woff2') format('woff2');
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter Tight';
  src: url('../fonts/InterTight-latin.woff2') format('woff2');
  font-weight: 700 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../fonts/IBMPlexMono-Medium-latin.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Custom Properties ──────────────────────────────────── */

:root {
  /* Farben */
  --color-primary:  #0D1F2D;
  --color-accent:   #B8743E;
  --color-cream:    #F5F1EA;
  --color-white:    #FFFFFF;
  --color-text:     #1A1A1A;
  --color-muted:    #6B7280;
  --color-border:   #E5E1D8;

  /* Typografie */
  --font-body:      'Inter', system-ui, sans-serif;
  --font-heading:   'Inter Tight', system-ui, sans-serif;
  --font-mono:      'IBM Plex Mono', 'Courier New', monospace;

  /* Spacing (8px-Basis) */
  --space-1:   8px;
  --space-2:   16px;
  --space-3:   24px;
  --space-4:   32px;
  --space-6:   48px;
  --space-8:   64px;
  --space-12:  96px;
  --space-16:  128px;
  --space-20:  160px;

  /* Breakpoints als Custom Properties (nur zur Referenz) */
  --bp-sm:  640px;
  --bp-md:  768px;
  --bp-lg:  1024px;
  --bp-xl:  1280px;

  /* Container */
  --container-max: 1280px;
  --container-px:  48px;

  /* Border Radius */
  --radius-sm:  2px;
  --radius-md:  4px;

  /* Transitions */
  --transition: 200ms ease;
}

/* ── Basis-Typografie ────────────────────────────────────── */

html {
  font-size: 16px;
}

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

h1 {
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-size: clamp(3rem, 7vw, 6rem);
}

h2 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-size: clamp(1.75rem, 3vw + 0.75rem, 2.75rem);
}

h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-size: clamp(1.25rem, 2vw + 0.5rem, 1.75rem);
}

h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  font-size: clamp(1.1rem, 1.5vw + 0.25rem, 1.35rem);
}

p {
  line-height: 1.7;
  color: var(--color-text);
}

p.lead {
  font-size: clamp(1.05rem, 1.5vw + 0.25rem, 1.25rem);
  color: var(--color-muted);
  line-height: 1.65;
}

strong {
  font-weight: 600;
}

.mono {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--color-accent);
}

/* ── Logo-Skalierung (fluid, clamp-basiert) ──────────────── */

.site-logo {
  display: block;
  background: transparent;
  border: none;
  padding: 0;
}

.site-logo--header {
  height: clamp(26px, 3vw, 32px);
  width: auto;
}

.site-logo--footer {
  height: clamp(28px, 3.5vw, 36px);
  width: auto;
}

.site-logo--hero {
  height: clamp(60px, 8vw, 96px);
  width: auto;
}

/* Logo-Untertitel auf hellem Hintergrund */
.nav__logo-sub--light {
  color: #6B7280;
}

/* ── Links ───────────────────────────────────────────────── */

a {
  color: var(--color-accent);
  transition: opacity var(--transition);
}

a:hover {
  opacity: 0.75;
}

/* ── Buttons ─────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 14px var(--space-4);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color var(--transition), color var(--transition), border-color var(--transition), opacity var(--transition);
  text-align: center;
  white-space: nowrap;
  text-decoration: none;
}

.btn--primary {
  background-color: var(--color-accent);
  color: var(--color-white);
  border-color: var(--color-accent);
}

.btn--primary:hover {
  background-color: #A0612F;
  border-color: #A0612F;
}

.btn--secondary {
  background-color: transparent;
  color: var(--color-white);
  border-color: rgba(255,255,255,0.5);
}

.btn--secondary:hover {
  border-color: var(--color-white);
  opacity: 1;
}

.btn--outline {
  background-color: transparent;
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.btn--outline:hover {
  background-color: var(--color-accent);
  color: var(--color-white);
}

.btn--dark {
  background-color: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}

.btn--dark:hover {
  opacity: 0.85;
}

/* ── Container ───────────────────────────────────────────── */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-px);
}

@media (max-width: 768px) {
  .container {
    padding-inline: 24px;
  }
}

/* ── Section-Spacing ─────────────────────────────────────── */

.section {
  padding-block: var(--space-20);
}

.section--compact {
  padding-block: var(--space-8);
}

@media (max-width: 768px) {
  .section {
    padding-block: var(--space-12);
  }
  .section--compact {
    padding-block: var(--space-6);
  }
}

/* ── Background Grid ─────────────────────────────────────── */

.bg-grid {
  background-image:
    repeating-linear-gradient(0deg, rgba(13,31,45,0.04) 0px, rgba(13,31,45,0.04) 1px, transparent 1px, transparent 64px),
    repeating-linear-gradient(90deg, rgba(13,31,45,0.04) 0px, rgba(13,31,45,0.04) 1px, transparent 1px, transparent 64px);
}

.bg-grid--dark {
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0px, rgba(255,255,255,0.03) 1px, transparent 1px, transparent 64px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.03) 0px, rgba(255,255,255,0.03) 1px, transparent 1px, transparent 64px);
}

/* ── Section-Varianten ───────────────────────────────────── */

.section--dark {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.section--dark p,
.section--dark p.lead {
  color: rgba(255,255,255,0.75);
}

.section--cream {
  background-color: var(--color-cream);
}

.section--white {
  background-color: var(--color-white);
}

/* ── Utility-Klassen ─────────────────────────────────────── */

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

.text-center { text-align: center; }
.text-muted   { color: var(--color-muted); }
.text-accent  { color: var(--color-accent); }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }

/* ── Section-Label ───────────────────────────────────────── */

.section__label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-2);
}

.section--dark .section__label {
  color: var(--color-accent);
}

/* ── Section-Header ──────────────────────────────────────── */

.section__header {
  max-width: 680px;
}

.section__header--centered {
  max-width: 680px;
  margin-inline: auto;
  text-align: center;
}

.section__header p {
  margin-top: var(--space-2);
  color: var(--color-muted);
  font-size: 1.05rem;
}

.section--dark .section__header p {
  color: rgba(255,255,255,0.65);
}

/* ── Divider ─────────────────────────────────────────────── */

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin-block: var(--space-8);
}

/* ── Focus-Styles (WCAG 2.2 AA) ─────────────────────────── */

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

/* ── Selection ───────────────────────────────────────────── */

::selection {
  background-color: rgba(184, 116, 62, 0.2);
  color: var(--color-primary);
}

/* ── Scroll-Padding für Anker-Links (Fixed Nav) ──────────── */

:target {
  scroll-margin-top: calc(72px + var(--space-4));
}

/* ── Print ───────────────────────────────────────────────── */

@media print {
  .nav,
  .footer,
  .btn,
  .skip-link {
    display: none !important;
  }

  body {
    font-size: 12pt;
    color: #000;
  }

  a[href]::after {
    content: ' (' attr(href) ')';
    font-size: 0.8em;
    color: #555;
  }

  h1, h2, h3 {
    page-break-after: avoid;
  }

  section {
    page-break-inside: avoid;
  }
}
