/* KanzleiFM — Counsel meets Neon (aligned with eM-Client signature v0.7) */
:root {
  --ink: #0c131f;
  --ink-2: #141c2b;
  --paper: #f4f1ea;
  --paper-2: #ebe6dc;
  --muted: #5b6472;
  --line: rgba(12, 19, 31, 0.12);
  --cyan: #0f6f7a;
  --cyan-hover: #0b5a63;
  --cyan-dim: rgba(15, 111, 122, 0.12);
  --on-accent: #ffffff;
  --amber: #c4a35a;
  --white: #ffffff;
  --font-display: "Manrope", system-ui, sans-serif;
  --font-sans: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --max: 1080px;
  --radius: 2px;
  color-scheme: light;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  max-width: 100%;
  /* was overflow-x:clip — in CSS if one axis is not visible, the other "visible" becomes auto and CLIPS Syne descenders (g). */
  overflow-x: hidden;
  overflow-y: visible;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--cyan); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--cyan-hover); }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: 20px;
  box-sizing: border-box;
}

/* Headings: Syne is very wide — never clip; wrap long German compounds */
h1, h2, h3, .brand-mark {
  overflow: visible;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(244, 241, 234, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.brand-mark span { color: var(--cyan); }

.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  align-items: center;
}

.nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}

.nav a:hover,
.nav a[aria-current="page"] { color: var(--cyan); }

.nav .btn { margin-left: 4px; }

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.btn-primary {
  background: var(--ink);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--cyan);
  color: var(--on-accent);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-ghost:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

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

/* —— Hero —— */
.hero {
  position: relative;
  padding: 88px 0 72px;
  color: #e8eef5;
  /* do NOT overflow:hidden here — it was clipping Syne descenders + wide titles */
  overflow: visible;
  background:
    radial-gradient(900px 420px at 100% 0%, rgba(56,189,200,.14), transparent 55%),
    linear-gradient(180deg, #0c131f 0%, #141c2b 55%, #0f1724 100%);
  isolation: isolate;
}

/* Photo via real <img> — reliable with file:// and OneDrive (CSS url() often fails locally) */
.hero--photo {
  position: relative;
  min-height: min(72vh, 600px);
  display: flex;
  align-items: flex-end;
  background-color: var(--ink);
  padding-top: 96px;
  padding-bottom: 72px;
  /* CRITICAL: do NOT overflow:hidden on hero — clips Syne descenders (g,y,p)
     Clip photo only via .hero-media */
  overflow: visible;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  z-index: 0;
  pointer-events: none;
  user-select: none;
}

.hero-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(105deg, rgba(12,19,31,.92) 0%, rgba(12,19,31,.78) 38%, rgba(12,19,31,.38) 62%, rgba(56,189,200,.20) 100%),
    linear-gradient(180deg, rgba(12,19,31,.42) 0%, rgba(12,19,31,.12) 42%, rgba(12,19,31,.75) 100%),
    linear-gradient(0deg, rgba(56,189,200,.10), rgba(12,19,31,.15));
  box-shadow: inset 0 0 120px rgba(12,19,31,.35);
}

.hero--photo .wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--max);
  padding-inline: 20px;
  /* room for left cyan bar */
  padding-left: max(20px, 16px);
}

.hero::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--cyan);
  box-shadow: 0 0 24px rgba(56,189,200,.45);
  z-index: 3;
}

.hero-kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 0 0 14px;
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* Syne is wide: smaller fluid size, no ch-cap that forces overflow on mobile */
.hero h1 {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.55rem, 7.2vw, 2.75rem);
  line-height: 1.22;
  letter-spacing: 0;
  max-width: 100%;
  padding: 0.08em 0.02em 0.18em 0;
  overflow: visible;
  overflow-wrap: anywhere;
  word-break: break-word;
  -webkit-font-smoothing: antialiased;
}

.section h2,
.panel-dark h2,
.prose h1 {
  font-size: clamp(1.35rem, 5.5vw, 2rem);
  line-height: 1.3;
  overflow: visible;
  max-width: 100%;
  padding-bottom: 0.1em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hero-lead {
  margin: 0 0 28px;
  max-width: min(52ch, 100%);
  font-size: clamp(0.95rem, 2.8vw, 1.05rem);
  color: rgba(232, 238, 245, 0.78);
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero .btn-ghost {
  color: #e8eef5;
  border-color: rgba(232,238,245,.35);
}
.hero .btn-ghost:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

/* —— Sections —— */
.section {
  padding: 56px 0;
}

.section-head {
  margin-bottom: 28px;
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 0 0 8px;
}

.section h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  letter-spacing: 0.02em;
}

.section-intro {
  margin: 0;
  max-width: 60ch;
  color: var(--muted);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 800px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .nav .btn { display: none; }
  body { font-size: 16px; }
  .hero--photo { min-height: auto; padding-top: 72px; padding-bottom: 48px; }
  .hero h1 { font-size: clamp(1.5rem, 8vw, 2.1rem); }
  .section { padding: 40px 0; }
  .card { overflow: visible; }
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 3px solid var(--cyan);
  padding: 22px 22px 24px;
  box-shadow: 0 10px 30px rgba(12,19,31,.04);
}

.card h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.03em;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.panel-dark {
  background: var(--ink);
  color: #dce7f2;
  padding: 36px 32px;
  border-left: 4px solid var(--cyan);
}

.panel-dark h2 {
  color: #fff;
  margin-top: 0;
}

.panel-dark p { color: rgba(220,231,242,.78); }

.panel-dark .btn-primary {
  background: var(--cyan);
  color: var(--on-accent);
}

/* —— Contact —— */
.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.contact-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.contact-list strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}

/* —— Legal pages —— */
.prose {
  max-width: 72ch;
}

.prose h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin: 0 0 8px;
}

.prose h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 28px 0 10px;
}

.prose p, .prose li { color: #243041; }

.page-hero {
  padding: 40px 0 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
  background: linear-gradient(180deg, rgba(56,189,200,.06), transparent);
}

/* —— Footer —— */
.site-footer {
  margin-top: 40px;
  background: var(--ink);
  color: rgba(232,238,245,.72);
  padding: 36px 0 28px;
  border-top: 3px solid var(--cyan);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 28px;
}

@media (max-width: 800px) {
  .footer-grid { grid-template-columns: 1fr; }
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: 800;
  color: #fff;
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.footer-brand span { color: var(--cyan); }

.site-footer a {
  color: rgba(232,238,245,.85);
  text-decoration: none;
}
.site-footer a:hover { color: var(--cyan); }

.footer-col h4, .footer-col .footer-h {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col li { margin-bottom: 8px; }

.footer-bottom {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  justify-content: space-between;
}

.tagline {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}


/* —— Theme toggle —— */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.theme-toggle:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* —— Dark theme: Neon Night (not invert) —— */
html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e8eef5;
  --ink-2: #d5dee9;
  --paper: #0a1018;
  --paper-2: #121a26;
  --muted: #9aa7b8;
  --line: rgba(232, 238, 245, 0.12);
  --cyan: #38bdc8;
  --cyan-hover: #67d1da;
  --cyan-dim: rgba(56, 189, 200, 0.16);
  --on-accent: #042026;
  --amber: #d4b56a;
  --white: #152033;
  --card-bg: #121a26;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] body {
  background:
    radial-gradient(900px 480px at 0% -10%, rgba(62, 201, 214, 0.08), transparent 55%),
    radial-gradient(700px 400px at 100% 20%, rgba(196, 163, 90, 0.05), transparent 50%),
    var(--paper);
  color: var(--ink);
}

html[data-theme="dark"] .site-header {
  background: rgba(10, 16, 24, 0.88);
  border-bottom-color: var(--line);
}

html[data-theme="dark"] .brand-mark { color: #f2f6fb; }
html[data-theme="dark"] .nav a { color: #e0e8f2; }
html[data-theme="dark"] .btn-primary {
  background: var(--cyan);
  color: var(--on-accent);
}
html[data-theme="dark"] .btn-primary:hover {
  background: var(--cyan-hover);
  color: var(--on-accent);
}
html[data-theme="dark"] .btn-ghost {
  color: var(--ink);
  border-color: rgba(232, 238, 245, 0.35);
}
html[data-theme="dark"] .card {
  background: var(--card-bg);
  border-color: var(--line);
  box-shadow: var(--shadow);
}
html[data-theme="dark"] .card h3 { color: #f2f6fb; }
html[data-theme="dark"] .card p { color: var(--muted); }
html[data-theme="dark"] .section h2 { color: #f5f8fc; }
html[data-theme="dark"] .section-intro { color: var(--muted); }

html[data-theme="dark"] .panel-dark {
  background: linear-gradient(145deg, #0e1622 0%, #152033 55%, #0c1820 100%);
  border-left-color: var(--cyan);
  box-shadow: inset 0 0 0 1px rgba(62, 201, 214, 0.08);
}

html[data-theme="dark"] .page-hero {
  background: linear-gradient(180deg, rgba(62, 201, 214, 0.1), transparent);
}

html[data-theme="dark"] .prose p,
html[data-theme="dark"] .prose li { color: #c5d0dd; }
html[data-theme="dark"] .prose h1,
html[data-theme="dark"] .prose h2 { color: #f2f6fb; }

html[data-theme="dark"] .contact-list li { border-bottom-color: var(--line); }
html[data-theme="dark"] .contact-list strong { color: var(--muted); }

html[data-theme="dark"] .site-footer {
  background: #060a10;
  border-top-color: var(--cyan);
}
html[data-theme="dark"] .tagline { color: #7f8b9a; }

/* Hero stays cinematic; slightly richer cyan wash in dark */
html[data-theme="dark"] .hero-shade {
  background:
    linear-gradient(105deg, rgba(6,10,16,.94) 0%, rgba(10,16,24,.82) 38%, rgba(10,16,24,.42) 62%, rgba(62,201,214,.22) 100%),
    linear-gradient(180deg, rgba(6,10,16,.5) 0%, rgba(6,10,16,.15) 42%, rgba(6,10,16,.8) 100%),
    linear-gradient(0deg, rgba(62,201,214,.12), rgba(6,10,16,.2));
}

html[data-theme="dark"] .theme-toggle {
  border-color: rgba(232, 238, 245, 0.18);
  color: #e8eef5;
}

/* ============================================================
   MOTION LAYER — entrances, hover, theme crossfade (v0.8)
   All gated on prefers-reduced-motion. Fallback = visible.
   ============================================================ */

/* Shared easing */
:root { --motion-ease: cubic-bezier(.22,.61,.36,1); }

/* --- A: Hero staggered entry --- */
.hero-animate .hero-kicker,
.hero-animate h1,
.hero-animate .hero-lead,
.hero-animate .hero-lead-2,
.hero-animate .hero-actions {
  opacity: 0;
  transform: none;
  transition: opacity .55s var(--motion-ease);
  transition-delay: var(--d, 0ms);
}
.hero-animate.is-ready .hero-kicker,
.hero-animate.is-ready h1,
.hero-animate.is-ready .hero-lead,
.hero-animate.is-ready .hero-lead-2,
.hero-animate.is-ready .hero-actions {
  opacity: 1;
  transform: none;
}

/* Cyan bar grows 0 -> 100% */
.hero-animate::before { transform: scaleY(0); transform-origin: top; }
.hero-animate.is-ready::before {
  transform: scaleY(1);
  transition: transform .65s var(--motion-ease) .08s;
}

/* Subtle ken-burns settle on hero photo — one-shot */
.hero-animate.is-ready .hero-bg { animation: kenburns 8s ease-out forwards; }
@keyframes kenburns {
  from { transform: scale(1.06); }
  to   { transform: scale(1); }
}

/* --- B: Cards reveal on scroll --- */
.reveal { opacity: 0; transform: translateY(24px); }
.reveal-left  { opacity: 0; transform: translateX(-28px); }
.reveal-right { opacity: 0; transform: translateX(28px); }
.reveal, .reveal-left, .reveal-right {
  transition: opacity .5s var(--motion-ease), transform .5s var(--motion-ease);
  transition-delay: var(--d, 0ms);
  will-change: opacity, transform;
}
.reveal.is-inview,
.reveal-left.is-inview,
.reveal-right.is-inview {
  opacity: 1;
  transform: none;
  will-change: auto;
}

/* --- E: CTA panel-dark reveal --- */
.reveal-panel { opacity: 0; transform: scale(.98); transform-origin: center; }
.reveal-panel {
  transition: opacity .55s var(--motion-ease), transform .55s var(--motion-ease);
}
.reveal-panel.is-inview { opacity: 1; transform: none; }

/* --- C: Card hover (desktop pointers only) --- */
.card { transition: transform .28s var(--motion-ease), box-shadow .28s var(--motion-ease), border-left-color .28s var(--motion-ease); }
@media (hover: hover) and (pointer: fine) {
  .card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 44px rgba(12,19,31,.12);
    border-left-color: var(--cyan-hover);
  }
  html[data-theme="dark"] .card:hover {
    box-shadow: 0 22px 50px rgba(0,0,0,.5);
    border-left-color: var(--cyan-hover);
  }
}

/* --- D: Theme crossfade (short-lived, not forever) --- */
html.theme-animating,
html.theme-animating body,
html.theme-animating .site-header,
html.theme-animating .card,
html.theme-animating .panel-dark,
html.theme-animating .page-hero,
html.theme-animating .site-footer {
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease !important;
}
.theme-toggle svg { transition: transform .3s var(--motion-ease), opacity .2s ease; }
html.theme-animating .theme-toggle svg { transform: rotate(35deg); }

/* --- Page-hero light fade (subpages) --- */
.page-hero.reveal-hero { opacity: 0; transform: translateY(10px); }
.page-hero.reveal-hero.is-ready {
  opacity: 1; transform: none;
  transition: opacity .5s var(--motion-ease), transform .5s var(--motion-ease);
}

/* --- Reduced motion: kill it all, show final state --- */
@media (prefers-reduced-motion: reduce) {
  .hero-animate .hero-kicker,
  .hero-animate h1,
  .hero-animate .hero-lead,
  .hero-animate .hero-actions,
  .reveal, .reveal-left, .reveal-right, .reveal-panel,
  .page-hero.reveal-hero {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .hero-animate::before { transform: scaleY(1) !important; transition: none !important; }
  .hero-animate.is-ready .hero-bg { animation: none !important; }
  .card { transition: none !important; }
  .card:hover { transform: none !important; }
  html.theme-animating * { transition: none !important; }
  .theme-toggle svg { transition: none !important; }
}


/* Leistungs-Begriffszeile */
.card-tags {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  line-height: 1.45;
  color: var(--cyan);
}
html[data-theme="dark"] .card-tags { color: var(--cyan); opacity: 0.92; }


/* ===== Home band choreography (page-home only) =====
   Tuned slower/farther after UX research + Torgrim feedback (zu schnell/unsichtbar).
   Product UI defaults ~200-300ms are often "invisible"; marketing bands need longer
   duration + larger travel + clearer stagger between bands. */
body.page-home { overflow-x: hidden; overflow-y: visible; }

body.page-home .band-header {
  opacity: 0;
  transform: translateY(-12px);
  transition:
    opacity .55s cubic-bezier(0.16, 1, 0.3, 1),
    transform .55s cubic-bezier(0.16, 1, 0.3, 1);
}
body.page-home .band-header.is-ready {
  opacity: 1;
  transform: none;
}

body.page-home .band { /* neutralized container transform */ overflow: visible !important; }
/* Larger travel so slide is actually perceived on phone/desktop */
body.page-home .band-from-right { /* neutralized: was clipping text */ }
body.page-home .band-from-left { /* neutralized */ }
body.page-home .band.is-in {
  opacity: 1;
  transform: none;
  will-change: auto;
}

body.page-home .band-footer {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity .7s cubic-bezier(0.16, 1, 0.3, 1),
    transform .7s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--band-delay, 0ms);
}
body.page-home .band-footer.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  body.page-home .band-header,
  body.page-home .band,
  body.page-home .band-footer {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}


/* Footer fades in last, no fly */
body.page-home .band-footer {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .5s var(--motion-ease), transform .5s var(--motion-ease);
  transition-delay: var(--band-delay, 0ms);
}
body.page-home .band-footer.is-in {
  opacity: 1;
  transform: none;
}

/* When bands handle entrance, soften hero child stagger (still subtle inside) */
body.page-home .hero-animate:not(.is-in) .hero-kicker,
body.page-home .hero-animate:not(.is-in) h1,
body.page-home .hero-animate:not(.is-in) .hero-lead,
body.page-home .hero-animate:not(.is-in) .hero-actions {
  /* hide until band in - avoid double flash */
}

@media (prefers-reduced-motion: reduce) {
  body.page-home .band-header,
  body.page-home .band,
  body.page-home .band-footer {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}


/* Second hero paragraph */
.hero-lead-2 {
  margin-top: -12px;
  margin-bottom: 28px;
}

/* Google Maps embed on Kontakt */
.map-embed {
  border: 1px solid var(--line);
  border-left: 4px solid var(--cyan);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-2, #121a26);
  box-shadow: 0 12px 36px rgba(12,19,31,.08);
}
.map-embed iframe {
  display: block;
  width: 100%;
  height: min(420px, 55vh);
  border: 0;
  filter: none;
}
html[data-theme="dark"] .map-embed {
  border-color: var(--line);
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
}
.map-caption {
  margin: 0;
  padding: 12px 16px;
  font-size: 0.9rem;
  color: var(--muted);
  background: var(--white, #fff);
}
html[data-theme="dark"] .map-caption {
  background: var(--card-bg, #121a26);
  color: var(--muted);
}
.map-caption a { font-weight: 600; }

/* Cards with two paragraphs */
.card p + p { margin-top: 10px; }


/* ============================================================
   HEADING + DESCENDER FINAL SYSTEM (consolidated 2026-08-18)
   Replaces ALL previous "anti-clip / hard-fix / ultimate" blocks.

   Root causes of clipped g/y/p/q (verified empirically):
   1. overflow:hidden on .hero--photo (text container) — fixed:
      photo clips inside .hero-media only; text layer overflow visible.
   2. transforms on heading ancestors (band fly-ins) + WebKit glyph
      clipping with text-rendering:geometricPrecision — fixed:
      headings never get transforms; photo slides instead of text;
      text bands fade/translateY only, ending at transform:none.
   3. line-height too tight for Syne's deep descenders (ink descent
      = 0.215em, font descent 0.27em) — fixed: 1.4 line-height.
   4. overflow-x:clip on html/body (WebKit clips y-axis too) —
      replaced with overflow-x:hidden earlier in this file.
   ============================================================ */

/* --- Heading metrics: ONE deterministic rule, no !important wars --- */
h1, h2, h3,
.hero h1,
.section h2,
.panel-dark h2,
.page-hero h1,
.card h3,
.prose h1,
.prose h2 {
  overflow: visible;
  clip-path: none;
  -webkit-clip-path: none;
  contain: none;
  text-rendering: auto; /* geometricPrecision clips glyphs in WebKit */
  line-height: 1.4;
  padding-top: 0.1em;
  padding-bottom: 0.15em;
  overflow-wrap: anywhere;
  word-break: break-word;
}
/* Defensive: headings never carry a transform (entrance anims are
   opacity-only on text; any leftover transform is neutralized). */
h1, h2, h3,
.hero-animate h1,
.hero-animate.is-ready h1 {
  transform: none !important;
}
/* SyneHead (metric-repaired Syne) with safe fallback to Google Syne */
h1, h2, h3, .brand-mark,
.hero h1, .section h2, .panel-dark h2, .page-hero h1, .card h3 {
  font-family: "Outfit", system-ui, sans-serif;
}

/* --- Overflow guarantees on every text container --- */
.hero, .hero--photo, .hero-content, .hero-content.wrap,
.section, .section-head, .wrap, .card, .panel-dark, .page-hero, .prose {
  overflow: visible;
}

/* --- Hero structure: photo clips itself, text never clipped --- */
.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden; /* clips ONLY the photo/shade layer */
  pointer-events: none;
}
.hero-media .hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}
.hero-media .hero-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.hero-content, .hero-content.wrap {
  position: relative;
  z-index: 2;
}
/* Ken-burns on the photo only (clipped by .hero-media) */
.hero-animate.is-ready .hero-media .hero-bg {
  animation: kenburns 8s ease-out forwards;
}

/* ============================================================
   HOME ENTRANCE — text-safe (no X-transform on text containers)
   ============================================================ */
/* Photo: slide in (photo-only layer, clipped by itself) */
body.page-home .hero-media.band-slide-right {
  opacity: 0;
  transform: translate3d(48px, 0, 0);
  transition: opacity .9s cubic-bezier(0.16, 1, 0.3, 1),
              transform .9s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: 120ms;
}
body.page-home.is-motion-ready .hero-media.band-slide-right {
  opacity: 1;
  transform: none;
}

/* Text bands: fade + small Y travel only, ends at transform:none */
body.page-home .band-fade {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .85s cubic-bezier(0.16, 1, 0.3, 1),
              transform .85s cubic-bezier(0.16, 1, 0.3, 1);
}
body.page-home .hero-content.band-fade { transition-delay: 200ms; }
body.page-home .band-fade-delay-1 { transition-delay: 380ms; }
body.page-home .band-fade-delay-2 { transition-delay: 700ms; }
body.page-home.is-motion-ready .band-fade {
  opacity: 1;
  transform: none;
}

/* Header/footer: opacity-only fades */
body.page-home .band-header {
  opacity: 0;
  transform: none !important;
  transition: opacity .5s ease;
}
body.page-home.is-motion-ready .band-header { opacity: 1; }
body.page-home .band-footer {
  opacity: 0;
  transform: none !important;
  transition: opacity .55s ease 1s;
}
body.page-home.is-motion-ready .band-footer { opacity: 1; }

/* Cards: gentle Y reveal (neutralizes legacy X-slide classes) */
body.page-home .card.reveal,
body.page-home .card.reveal-left,
body.page-home .card.reveal-right {
  transform: translateY(12px) !important;
}
body.page-home .card.is-inview { transform: none !important; }

@media (prefers-reduced-motion: reduce) {
  body.page-home .hero-media.band-slide-right,
  body.page-home .band-fade,
  body.page-home .band-header,
  body.page-home .band-footer {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* --- Mobile tuning --- */
@media (max-width: 800px) {
  h1, h2, h3,
  .hero h1, .section h2, .panel-dark h2, .card h3, .page-hero h1 {
    line-height: 1.42;
    padding-bottom: 0.18em;
  }
  /* Hero contrast */
  .hero-shade {
    background:
      linear-gradient(180deg, rgba(6,10,16,.72) 0%, rgba(6,10,16,.55) 40%, rgba(6,10,16,.88) 100%),
      linear-gradient(105deg, rgba(6,10,16,.9) 0%, rgba(6,10,16,.55) 55%, rgba(6,10,16,.35) 100%) !important;
  }
  .hero-lead, .hero-lead-2 {
    color: rgba(242, 246, 251, 0.92) !important;
    text-shadow: 0 1px 2px rgba(0,0,0,.45);
  }
  .hero h1 { text-shadow: 0 2px 14px rgba(0,0,0,.35); }
  /* Nav less cramped */
  .header-inner { flex-wrap: wrap; align-items: flex-start; }
  .nav { width: 100%; justify-content: flex-start; gap: 8px 12px; padding-top: 4px; }
  .nav .btn { display: none; }
  .brand-sub { max-width: 70vw; }
}


/* Outfit headings — clean metrics, no Syne descender hacks needed */
h1, h2, h3,
.hero h1,
.section h2,
.panel-dark h2,
.page-hero h1,
.card h3,
.brand-mark {
  font-family: "Manrope", system-ui, sans-serif !important;
  overflow: visible !important;
  line-height: 1.25 !important;
  padding-top: 0.05em !important;
  padding-bottom: 0.12em !important;
  letter-spacing: -0.02em;
}
.hero h1 {
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2 !important;
}
.section h2, .panel-dark h2 {
  font-weight: 700;
  letter-spacing: -0.025em;
}
.card h3 {
  font-weight: 650;
  letter-spacing: -0.02em;
}


/* ===== Brand mark stronger (Torgrim 18.08.) ===== */
.brand {
  gap: 4px;
}
.brand-mark {
  font-size: clamp(1.45rem, 2.2vw, 1.75rem) !important;
  font-weight: 800 !important;
  letter-spacing: 0.02em !important;
  line-height: 1.1 !important;
}
.brand-sub {
  font-size: 0.72rem !important;
  letter-spacing: 0.1em !important;
  opacity: 0.9;
  max-width: 16rem;
}
.brand-rule {
  display: block;
  width: 2.4rem;
  height: 2px;
  margin: 3px 0 2px;
  background: var(--cyan);
  border-radius: 1px;
  box-shadow: 0 0 12px rgba(56,189,200,.35);
}
@media (max-width: 800px) {
  .brand-mark {
    font-size: 1.4rem !important;
  }
  .brand-sub {
    font-size: 0.68rem !important;
    max-width: 12rem;
  }
}

/* Font variant badge (preview only) */
.font-variant-badge {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 9999;
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 10px;
  border-radius: 2px;
  background: rgba(12,19,31,.88);
  color: #e8eef5;
  border-left: 3px solid var(--cyan);
  pointer-events: none;
}
html[data-theme="light"] .font-variant-badge {
  background: rgba(244,241,234,.95);
  color: #0c131f;
}


/* variant lock: Manrope */
h1, h2, h3, .hero h1, .section h2, .panel-dark h2, .page-hero h1, .card h3, .brand-mark {
  font-family: "Manrope", system-ui, sans-serif !important;
}


/* MANROPE LOCK */
h1, h2, h3, .hero h1, .section h2, .panel-dark h2, .page-hero h1, .card h3, .brand-mark {
  font-family: "Manrope", system-ui, sans-serif !important;
}


/* ===== Leistungen: recognition layer (SEO + Mandant) ===== */
.card-for {
  margin: -2px 0 12px;
  font-family: var(--font-display), system-ui, sans-serif;
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--cyan);
  line-height: 1.35;
}
.chip-row {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
}
.chip-row li {
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(56,189,200,0.06);
}
html[data-theme="dark"] .chip-row li {
  background: rgba(62,201,214,0.08);
  color: #b7c3d1;
  border-color: rgba(232,238,245,0.12);
}
.bring-note {
  margin-top: 1.25rem !important;
  padding: 14px 16px;
  border-left: 3px solid var(--cyan);
  background: rgba(56,189,200,0.07);
  border-radius: 0 2px 2px 0;
  color: var(--ink) !important;
  font-size: 0.98rem;
}
html[data-theme="dark"] .bring-note {
  background: rgba(62,201,214,0.08);
  color: #dce7f2 !important;
}
.bring-note strong {
  color: var(--cyan);
  font-weight: 650;
}
.faq-list {
  display: grid;
  gap: 10px;
  max-width: 760px;
}
.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white, #fff);
  padding: 0;
  overflow: hidden;
}
html[data-theme="dark"] .faq-item {
  background: var(--card-bg, #121a26);
  border-color: var(--line);
}
.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 18px;
  font-weight: 650;
  font-family: var(--font-display), system-ui, sans-serif;
  letter-spacing: -0.015em;
  color: var(--ink);
  position: relative;
  padding-right: 2.5rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--cyan);
  font-weight: 700;
  font-size: 1.15rem;
}
.faq-item[open] summary::after { content: "–"; }
.faq-item summary:hover { color: var(--cyan); }
.faq-item p {
  margin: 0;
  padding: 0 18px 16px;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.55;
  max-width: 62ch;
}
/* card-tags sit under chips */
.card .chip-row + .card-tags {
  margin-top: 12px;
}

/* Experience line — approved 20.10.2026 */
.hero-experience { font-family: var(--font-display); font-size: clamp(1.15rem, 2vw, 1.55rem); font-weight: 500; line-height: 1.45; margin: 0 0 1.35rem; }
.hero-experience strong { color: var(--cyan); font-weight: 800; }

/* Approved 20.10.2026: desktop body copy justified, no hyphenation.
   Mobile remains left-aligned for readability. */
.hero-lead, .section-intro, .card p, .faq p {
  hyphens: none;
  -webkit-hyphens: none;
  word-break: normal;
  overflow-wrap: normal;
}
@media (min-width: 900px) {
  .hero-lead, .section-intro, .card p, .faq p {
    text-align: justify;
  }
}

/* Zwei-Klick-Karte (DSGVO) */
.map-consent { padding: 32px 24px; text-align: center; min-height: 240px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.map-consent p { margin: 0; }
.map-consent-title { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.map-consent-note { max-width: 56ch; color: var(--muted); font-size: 0.9rem; line-height: 1.5; margin-bottom: 8px !important; }
.map-consent .btn { margin-top: 4px; }

/* Skip-Link (Barrierefreiheit) */
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 1000; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 6px; text-decoration: none; font-weight: 600; transition: top .15s; }
.skip-link:focus { top: 12px; outline: 2px solid var(--cyan); outline-offset: 2px; }

/* Telefon im Kopfbereich (immer sichtbar, am Handy ein Tipp) */
.nav .nav-tel { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; text-decoration: none; white-space: nowrap; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); }
.nav .nav-tel svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
.nav .nav-tel:hover { border-color: var(--cyan); color: var(--cyan); }
html[data-theme="dark"] .nav .nav-tel { border-color: rgba(224,232,242,.28); }
@media (max-width: 800px) {
  .nav .nav-tel { order: -1; margin-left: auto; background: var(--cyan); color: var(--on-accent) !important; border-color: var(--cyan); }
  .nav .nav-tel:hover { color: #06210f; background: var(--cyan-hover); }
}
/* Sekundär-Link statt zweitem Button (ein Hauptbutton) */
.link-quiet { color: inherit; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(255,255,255,.4); font-weight: 500; padding: 10px 4px; }
.link-quiet:hover { text-decoration-color: var(--cyan); color: var(--cyan); }

/* Mobiler Header: Zeile 1 Marke, Zeile 2 Telefon + Theme, Zeile 3 Links (Raster, kein Abschneiden) */
@media (max-width: 800px) {
  .nav { display: grid !important; grid-template-columns: auto auto 1fr; grid-auto-flow: row; align-items: center; gap: 10px 14px; width: 100%; justify-content: start; }
  .nav .nav-tel { grid-column: 1 / 3; grid-row: 1; margin: 0; justify-self: start; }
  .nav .theme-toggle { grid-column: 3; grid-row: 1; justify-self: end; margin: 0; }
  .nav > a:not(.nav-tel):not(.btn) { grid-row: 2; grid-column: auto; margin: 0; padding: 6px 0; }
  .nav > a:nth-of-type(1) { grid-column: 1; }
  .nav > a:nth-of-type(2) { grid-column: 2; }
  .nav > a:nth-of-type(3) { grid-column: 3; justify-self: start; }
}

/* Aktuelles / Newsfeed */
.news-empty { max-width: 62ch; }
.news-empty h3 { margin-top: 0; }
.news-item { margin-bottom: 20px; }
.news-meta { margin: 0 0 6px; color: var(--muted); font-size: 0.88rem; letter-spacing: .01em; }
.news-source { margin: 8px 0 0; color: var(--muted); font-size: 0.88rem; }
.news-hint { margin: 24px 0 0; color: var(--muted); font-size: 0.88rem; max-width: 62ch; }

/* 4 Nav-Links am schmalen Handy: kleinerer Abstand, Spalten nach Inhalt */
@media (max-width: 800px) {
  .nav { grid-template-columns: repeat(4, auto) 1fr; column-gap: 12px; }
  .nav .nav-tel { grid-column: 1 / 4; }
  .nav .theme-toggle { grid-column: 4 / 6; }
  .nav > a:nth-of-type(1) { grid-column: 1; }
  .nav > a:nth-of-type(2) { grid-column: 2; }
  .nav > a:nth-of-type(3) { grid-column: 3; }
  .nav > a:nth-of-type(4) { grid-column: 4; justify-self: start; }
}
@media (max-width: 380px) { .nav { column-gap: 9px; } .nav > a:not(.nav-tel):not(.btn) { font-size: 0.95rem; } }
html[data-theme="dark"] .news-hint, html[data-theme="dark"] .news-meta, html[data-theme="dark"] .news-source { color: #aab6c6; }

.news-lead { margin: 0 0 10px; }
.news-item h3 { margin: 0 0 10px; }
.news-item { max-width: 72ch; }

/* Petrol (B): auf immer dunklen Flächen (Hero-Foto, Footer, dunkle Panels) die helle Akzentstufe */
.hero, .site-footer, .panel-dark, .hero-shade {
  --cyan: #38bdc8;
  --cyan-hover: #67d1da;
  --cyan-dim: rgba(56, 189, 200, 0.16);
  --on-accent: #042026;
}
.site-footer .tagline { color: #9aa7b8; }
.skip-link { color: #fff; background: #0c131f; }

/* Header-Button: Textfarbe nicht von .nav a erben */
.nav a.btn-accent, html[data-theme="dark"] .nav a.btn-accent { color: var(--on-accent); }
.nav a.btn-accent:hover, html[data-theme="dark"] .nav a.btn-accent:hover { color: var(--on-accent); }
.btn-accent:hover { color: var(--on-accent); }

/* Desktop-Blocksatz mit Silbentrennung (Messung 08.11.2026: Wortabstand Median 1,83× → 1,03×) */
@media (min-width: 900px) {
  .hero-lead, .section-intro, .card p, .faq p {
    hyphens: auto;
    -webkit-hyphens: auto;
    hyphenate-limit-chars: 7 3 3;
  }
}
@media (max-width: 899px) {
  .hero-lead, .section-intro, .card p, .faq p { text-align: left; hyphens: manual; }
}

.news-item .news-h { font-family: var(--font-display); font-size: 1.25rem; line-height: 1.35; margin: 0 0 10px; }

/* h2 mit Kartenoptik (h3-Look bleibt, Struktur h1 → h2) */
h2.h-card { font-size: 1.15rem; letter-spacing: 0.03em; line-height: 1.35; margin: 0 0 8px; }
.card h2.h-card { font-family: var(--font-display); color: var(--ink); }
html[data-theme="dark"] .card h2.h-card { color: #f2f6fb; }

/* === Hero: links wie vorher (Textbereich dunkel), dann weicher Faden ins helle, farbige Foto (Torgrim 08.11.2026) === */
.hero-media .hero-bg { filter: saturate(1.25) brightness(1.12) contrast(1.04); }
.hero-media .hero-shade, html[data-theme="dark"] .hero-media .hero-shade {
  background:
    linear-gradient(100deg, rgba(12,19,31,.92) 0%, rgba(12,19,31,.86) 40%, rgba(12,19,31,.62) 52%, rgba(12,19,31,.26) 66%, rgba(12,19,31,0) 82%),
    linear-gradient(180deg, rgba(12,19,31,.30) 0%, rgba(12,19,31,0) 28%, rgba(12,19,31,.50) 100%);
  box-shadow: none;
}
@media (max-width: 899px) {
  .hero-shade, html[data-theme="dark"] .hero-shade {
    background:
      linear-gradient(180deg, rgba(8,13,22,.72) 0%, rgba(8,13,22,.58) 45%, rgba(8,13,22,.82) 100%) !important;
  }
}

/* === Unterseiten-Kopf mit Foto-Streifen (Torgrim 08.11.2026), Verlauf wie Hero === */
.page-hero--photo { position: relative; overflow: hidden; padding: 64px 0 44px; margin-bottom: 8px; background: #0c131f; border-bottom: 0; isolation: isolate; }
.page-hero-media { position: absolute; inset: 0; z-index: -1; }
.page-hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: center 55%; display: block; filter: saturate(1.2) brightness(1.1) contrast(1.03); }
.page-hero-shade { position: absolute; inset: 0;
  background:
    linear-gradient(100deg, rgba(12,19,31,.94) 0%, rgba(12,19,31,.88) 40%, rgba(12,19,31,.62) 54%, rgba(12,19,31,.24) 68%, rgba(12,19,31,0) 84%),
    linear-gradient(180deg, rgba(12,19,31,.25) 0%, rgba(12,19,31,0) 30%, rgba(12,19,31,.4) 100%); }
.page-hero--photo, html[data-theme="dark"] .page-hero--photo { background: #0c131f; }
.page-hero--photo .section-eyebrow { color: #38bdc8; }
.page-hero--photo h1 { color: #f2f6fb; text-shadow: 0 2px 14px rgba(0,0,0,.35); }
.page-hero--photo .section-intro { color: rgba(242,246,251,.92); text-shadow: 0 1px 2px rgba(0,0,0,.45); }
@media (max-width: 899px) {
  .page-hero--photo { padding: 48px 0 32px; }
  .page-hero-shade { background: linear-gradient(180deg, rgba(8,13,22,.74) 0%, rgba(8,13,22,.6) 50%, rgba(8,13,22,.84) 100%); }
}
.page-hero--photo img.ph-kontakt { filter: saturate(1.3) brightness(1.5) contrast(1.05); }

/* Helligkeit der Streifen auf Hero-Niveau angleichen (gemessen rechts: Start 80) */
.page-hero--photo img.ph-leistungen { filter: saturate(1.3) brightness(1.95) contrast(1.05); }
.page-hero--photo img.ph-aktuelles { filter: saturate(1.25) brightness(1.3) contrast(1.03); }
.page-hero--photo img.ph-kontakt { filter: saturate(1.3) brightness(1.65) contrast(1.05); }
.page-hero--photo img.ph-leistungen { filter: saturate(1.3) brightness(2.5) contrast(1.0); }
.page-hero--photo img.ph-aktuelles { filter: saturate(1.25) brightness(1.4) contrast(1.03); }

/* Foto-Streifen einheitlich hoch (Torgrim 08.11.2026: Leistungen zu schmal) */
.page-hero--photo { min-height: 340px; display: flex; flex-direction: column; justify-content: center; }
@media (max-width: 800px) { .page-hero--photo { min-height: 300px; } }

.page-hero--photo img.ph-verkehrsunfall { filter: saturate(1.25) brightness(1.5) contrast(1.03); }
.page-hero--photo img.ph-bussgeld { filter: saturate(1.25) brightness(1.6) contrast(1.03); }
