/* ==========================================================================
   Centerline – Stylesheet
   Struktur: Tokens · Schrift · Basis · Header/Navigation · Startseite
             · Rechtsseiten · Footer · Reveal · Utilities · Präferenzen · Print
   ========================================================================== */

/* 1. Design-Tokens ------------------------------------------------------- */
:root {
  color-scheme: light dark;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;

  /* Typografie: Größe, Laufweite und Zeilenhöhe immer als Set */
  --text-body: 1.0625rem;
  --text-lead: 1.125rem;
  --text-small: 0.9375rem;
  --text-caption: 0.8125rem;
  --text-display: clamp(2.75rem, 1.6rem + 4vw, 5rem);
  --text-h1: clamp(2.25rem, 1.5rem + 2.6vw, 3.5rem);
  --text-h2: clamp(1.375rem, 1.15rem + 0.8vw, 1.75rem);

  --leading-body: 1.55;
  --leading-tight: 1.05;

  --tracking-display: -0.028em;
  --tracking-h1: -0.022em;
  --tracking-h2: -0.012em;
  --tracking-caps: 0.06em;

  /* Layout */
  --container: 70rem;
  --container-narrow: 44rem;
  --gutter: max(1rem, 5vw);
  --header-height: 4rem;

  --radius-sm: 0.625rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;
  --radius-pill: 999px;

  /* Bewegung: kritisch gedämpfte Feder (kein Überschwingen) */
  --ease-spring: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-press: 100ms;
  --duration-hover: 200ms;
  --duration-sheet: 450ms;
  --duration-reveal: 700ms;

  /* Farben – hell */
  --bg: #ffffff;
  --bg-elevated: #f5f7fa;
  --bg-material: rgba(255, 255, 255, 0.72);
  --text: #0e1a26;
  --text-secondary: #5a6b7b;
  --text-tertiary: #8694a3;
  --heading: #082f49;
  --accent: #075985;
  --accent-hover: #0369a1;
  --accent-soft: #e6f3fb;
  --on-accent: #ffffff;
  --hairline: rgba(8, 47, 73, 0.1);
  --hairline-strong: rgba(8, 47, 73, 0.22);
  --focus: #0ea5e9;
  --selection: #bae6fd;
  --shadow-card:
    0 1px 2px rgba(8, 47, 73, 0.05),
    0 12px 32px -12px rgba(8, 47, 73, 0.18),
    0 40px 80px -40px rgba(8, 47, 73, 0.25);
  --shadow-sheet:
    0 1px 0 var(--hairline),
    0 24px 48px -16px rgba(8, 47, 73, 0.25);
  --shadow-header:
    0 1px 0 var(--hairline),
    0 12px 32px -20px rgba(8, 47, 73, 0.2);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1017;
    --bg-elevated: #121a24;
    --bg-material: rgba(11, 16, 23, 0.72);
    --text: #e8eef4;
    --text-secondary: #9fb0c0;
    --text-tertiary: #718395;
    --heading: #f3f7fb;
    --accent: #7dd3fc;
    --accent-hover: #bae6fd;
    --accent-soft: rgba(125, 211, 252, 0.12);
    --on-accent: #06283d;
    --hairline: rgba(255, 255, 255, 0.1);
    --hairline-strong: rgba(255, 255, 255, 0.24);
    --focus: #7dd3fc;
    --selection: #0c4a6e;
    --shadow-card:
      0 1px 2px rgba(0, 0, 0, 0.4),
      0 12px 32px -12px rgba(0, 0, 0, 0.6),
      0 40px 80px -40px rgba(0, 0, 0, 0.7);
    --shadow-sheet:
      0 1px 0 var(--hairline),
      0 24px 48px -16px rgba(0, 0, 0, 0.6);
    --shadow-header:
      0 1px 0 var(--hairline),
      0 12px 32px -20px rgba(0, 0, 0, 0.6);
  }
}

/* 2. Schrift (selbst gehostet, DSGVO-konform) ---------------------------- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/inter-latin-var.woff2") format("woff2");
  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;
}

/* 3. Basis --------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  font-weight: 400;
  font-optical-sizing: auto;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

main {
  flex: 1 0 auto;
}

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

h1,
h2,
h3 {
  margin: 0;
  color: var(--heading);
  font-weight: 600;
  text-wrap: balance;
}

p {
  margin: 0 0 1rem;
}

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

address {
  font-style: normal;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
  transition: color var(--duration-hover) var(--ease-out);
}

a:hover {
  color: var(--accent-hover);
}

::selection {
  background: var(--selection);
  color: var(--heading);
}

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

.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

/* 4. Header & Navigation ------------------------------------------------- */
.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 200;
  padding: 0.625rem 1rem;
  border-radius: var(--radius-pill);
  background: var(--heading);
  color: var(--bg);
  font-weight: 500;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform var(--duration-hover) var(--ease-out);
}

.skip-link:focus-visible {
  transform: none;
  outline-offset: 2px;
}

.scroll-sentinel {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-material);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  transition: box-shadow 350ms var(--ease-out);
}

.site-header.is-scrolled {
  box-shadow: var(--shadow-header);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-height);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--heading);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition:
    opacity var(--duration-hover) var(--ease-out),
    transform var(--duration-press) ease-out;
}

.brand:hover {
  color: var(--heading);
  opacity: 0.8;
}

.brand:active {
  transform: scale(0.97);
}

.brand img {
  width: 1.75rem;
  height: 1.75rem;
}

@media (prefers-color-scheme: dark) {
  .brand img {
    filter: brightness(0) invert(1);
  }
}

.nav-list {
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-size: var(--text-small);
  font-weight: 500;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color var(--duration-hover) var(--ease-out),
    color var(--duration-hover) var(--ease-out),
    transform var(--duration-press) ease-out;
}

.nav-link:hover {
  background: var(--accent-soft);
  color: var(--heading);
}

.nav-link:active {
  transform: scale(0.96);
}

.nav-link[aria-current="page"] {
  background: var(--bg-elevated);
  color: var(--heading);
}

.nav-toggle {
  display: none;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-right: -0.5rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--heading);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color var(--duration-hover) var(--ease-out),
    transform var(--duration-press) ease-out;
}

.nav-toggle:hover {
  background: var(--accent-soft);
}

.nav-toggle:active {
  transform: scale(0.92);
}

.nav-toggle__icon {
  position: relative;
  display: block;
  width: 1.125rem;
  height: 1.125rem;
}

.nav-toggle__bar {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1.5px;
  margin-top: -0.75px;
  border-radius: 1px;
  background: currentColor;
  transition: transform var(--duration-sheet) var(--ease-spring);
}

.nav-toggle__bar:nth-child(1) {
  transform: translateY(-4px);
}

.nav-toggle__bar:nth-child(2) {
  transform: translateY(4px);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  transform: rotate(-45deg);
}

/* Mobil: Navigation als Sheet, verankert am Auslöser (oben rechts) */
@media (max-width: 47.99rem) {
  :root {
    --header-height: 3.5rem;
  }

  .nav-toggle {
    display: inline-grid;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 0.25rem);
    right: var(--gutter);
    min-width: 14rem;
    max-width: calc(100vw - 2 * var(--gutter));
    padding: 0.5rem;
    border: 1px solid var(--hairline);
    border-radius: var(--radius-md);
    background: var(--bg-material);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    backdrop-filter: saturate(180%) blur(24px);
    box-shadow: var(--shadow-sheet);
    transform-origin: top right;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.5rem) scale(0.94);
    filter: blur(8px);
    transition:
      opacity var(--duration-hover) var(--ease-out),
      transform var(--duration-sheet) var(--ease-spring),
      filter 300ms var(--ease-out),
      visibility 0s linear var(--duration-sheet);
  }

  .site-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
    filter: none;
    transition-delay: 0s;
  }

  .nav-list {
    flex-direction: column;
    gap: 0.125rem;
  }

  .nav-link {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: var(--text-body);
  }
}

/* 5. Startseite ---------------------------------------------------------- */
.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
  padding-block: clamp(2.5rem, 8vw, 6rem) clamp(3rem, 10vw, 7rem);
}

@media (min-width: 56rem) {
  .hero {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  }
}

.hero__media {
  position: relative;
  justify-self: center;
  width: min(100%, 25rem);
}

.hero__media::before {
  content: "";
  position: absolute;
  inset: 15% 0 -4%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--accent-soft), transparent 75%);
  filter: blur(24px);
}

.hero__figure {
  margin: 0;
  padding: clamp(1rem, 3vw, 1.5rem);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: var(--shadow-card);
}

.hero__figure img {
  width: 100%;
  border-radius: var(--radius-md);
}

.display {
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
  font-size: var(--text-display);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
}

.display__sub {
  display: block;
  margin-top: 0.15em;
  font-size: 0.58em;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text-secondary);
}

.lead p {
  max-width: 58ch;
  font-size: var(--text-lead);
  line-height: 1.6;
}

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

/* 6. Rechtsseiten (Impressum, Datenschutz) ------------------------------- */
.page-header {
  padding-block: clamp(2.5rem, 7vw, 5rem) clamp(1.25rem, 3vw, 2rem);
}

.page-title {
  font-size: var(--text-h1);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: var(--tracking-h1);
}

.legal {
  max-width: var(--container-narrow);
  padding-bottom: clamp(3rem, 8vw, 6rem);
}

.legal h2 {
  margin: 2.5rem 0 0.875rem;
  font-size: var(--text-h2);
  line-height: 1.25;
  letter-spacing: var(--tracking-h2);
}

.legal h2:first-child {
  margin-top: 0;
}

.legal p,
.legal li {
  max-width: 70ch;
}

.legal ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.legal li {
  margin-bottom: 0.25rem;
}

.contact-card {
  margin: 0 0 2rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
}

.contact-card p:last-child {
  margin-bottom: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.375rem;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 500;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color var(--duration-hover) var(--ease-out),
    transform var(--duration-press) ease-out;
}

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

.btn:active {
  transform: scale(0.97);
}

/* 7. Footer -------------------------------------------------------------- */
.site-footer {
  margin-top: auto;
  padding-block: clamp(2.5rem, 6vw, 4rem);
  border-top: 1px solid var(--hairline);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: var(--text-small);
}

.footer-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 48rem) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr auto;
    gap: 3rem;
  }
}

.footer__title {
  margin: 0 0 0.75rem;
  color: var(--text-tertiary);
  font-size: var(--text-caption);
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.footer__text {
  margin: 0;
  line-height: 1.75;
}

.footer__text a,
.footer-nav a {
  color: var(--heading);
  text-decoration: none;
}

.footer__text a:hover,
.footer-nav a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.footer-nav ul {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-nav a {
  font-weight: 500;
}

.footer-nav a[aria-current="page"] {
  color: var(--text-tertiary);
}

/* 8. Reveal beim Laden / Scrollen --------------------------------------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(0.875rem);
  transition:
    opacity 600ms var(--ease-out),
    transform var(--duration-reveal) var(--ease-spring);
}

.js [data-reveal="left"] {
  transform: translateX(-1.25rem);
}

.js [data-reveal][data-reveal-order="2"] {
  transition-delay: 90ms;
}

.js [data-reveal][data-reveal-order="3"] {
  transition-delay: 180ms;
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* 9. Utilities ----------------------------------------------------------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* 10. Medien-Präferenzen ------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .js [data-reveal],
  .js [data-reveal="left"] {
    transform: none;
    transition: opacity 300ms ease;
  }

  .site-nav {
    transform: none;
    filter: none;
    transition:
      opacity 200ms ease,
      visibility 0s linear 200ms;
  }

  .site-nav.is-open {
    transition: opacity 200ms ease;
  }

  .nav-toggle__bar {
    transition: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .site-header,
  .site-nav {
    background: var(--bg);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (prefers-contrast: more) {
  :root {
    --hairline: rgba(8, 47, 73, 0.35);
    --text-secondary: #3e4c59;
    --text-tertiary: #4f5f6e;
  }

  .site-header {
    border-bottom: 1px solid var(--hairline-strong);
  }

  .site-nav,
  .hero__figure,
  .contact-card {
    border-color: var(--hairline-strong);
  }
}

@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root {
    --hairline: rgba(255, 255, 255, 0.35);
    --text-secondary: #c3cfdb;
    --text-tertiary: #aab8c6;
  }
}

/* 11. Print -------------------------------------------------------------- */
@media print {
  .site-header,
  .site-footer,
  .skip-link,
  .nav-toggle {
    display: none;
  }

  body {
    color: #000;
    background: #fff;
  }

  .hero__figure {
    border: 0;
    box-shadow: none;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
