/* ============================================================
   KFO Dr. Mustermann — Design-System „DER BOGEN"
   Editorial Health-Premium · Light/Dark · Motion-ready
   ============================================================ */

:root {
  --primary:   #0E5A63;   --primary-700: #0a464d;
  --teal:      #127A78;
  --mint:      #6FC7C0;   --mint-soft: #E8F4F2;
  --accent:    #F2785C;   --accent-700: #d85b3f;
  --bg:        #FBFAF7;
  --surface:   #FFFFFF;
  --surface-2: #F4F1EA;
  --ink:       #15302E;
  --muted:     #5C726F;
  --border:    #E4E0D6;
  --ring:      rgba(14,90,99,.35);
  --shadow-sm: 0 1px 2px rgba(21,48,46,.05), 0 4px 14px rgba(21,48,46,.05);
  --shadow-md: 0 10px 30px -10px rgba(14,90,99,.22), 0 4px 12px rgba(21,48,46,.06);
  --shadow-lg: 0 30px 70px -28px rgba(14,90,99,.36);
  --radius:    20px;
  --radius-sm: 12px;
  --maxw:      1200px;
  --font-head: "Fraunces", "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease:      cubic-bezier(.22,1,.36,1);
  color-scheme: light;
}

html[data-theme="dark"] {
  --primary:   #5fd0c7;   --primary-700: #8fe0d8;
  --teal:      #6FC7C0;
  --mint:      #2b4b49;   --mint-soft: #14302e;
  --accent:    #FF8E73;   --accent-700: #ffa994;
  --bg:        #0C1A1A;
  --surface:   #122625;
  --surface-2: #16302e;
  --ink:       #EAF3F1;
  --muted:     #9DB3B0;
  --border:    #25403E;
  --ring:      rgba(111,199,192,.4);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 14px 36px -14px rgba(0,0,0,.6);
  --shadow-lg: 0 36px 80px -30px rgba(0,0,0,.7);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background .5s var(--ease), color .5s var(--ease);
}

::selection { background: var(--accent); color: #fff; }

/* ---------- Typografie ---------- */
h1,h2,h3,h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.08; letter-spacing: -.015em; margin: 0; color: var(--ink); text-wrap: balance; }
.h-hero  { font-size: clamp(2.4rem, 6vw, 4.4rem); line-height: 1.02; }
.h-sec   { font-size: clamp(1.8rem, 3.6vw, 2.7rem); }
.h-sub   { font-size: clamp(1.25rem, 2vw, 1.6rem); }
p { margin: 0 0 1rem; text-wrap: pretty; }
.lead { font-size: clamp(1.08rem, 1.5vw, 1.3rem); color: var(--muted); line-height: 1.6; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--font-body); font-weight: 600; font-size: .76rem;
  letter-spacing: .18em; text-transform: uppercase; color: var(--primary);
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--accent); border-radius: 2px; }
.serif-em { font-family: var(--font-head); font-style: italic; font-weight: 500; color: var(--teal); }

/* ---------- Layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: clamp(1.1rem, 4vw, 2.5rem); }
.section { padding-block: clamp(4rem, 9vw, 8rem); position: relative; }
.section--tight { padding-block: clamp(3rem, 6vw, 5rem); }
.grid { display: grid; gap: clamp(1.2rem, 2.4vw, 2rem); }
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--primary); color: #fff; padding: .8rem 1.2rem; border-radius: 0 0 12px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Buttons ---------- */
.btn {
  --bg-btn: var(--primary); --fg-btn: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  font-family: var(--font-body); font-weight: 600; font-size: .98rem;
  padding: .92rem 1.6rem; border-radius: 999px; border: 1px solid transparent;
  background: var(--bg-btn); color: var(--fg-btn); cursor: pointer;
  text-decoration: none; line-height: 1; transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s, color .25s;
  box-shadow: var(--shadow-sm); will-change: transform;
}
.btn:hover { box-shadow: var(--shadow-md); }
.btn--accent { --bg-btn: var(--accent); --fg-btn: #fff; }
.btn--accent:hover { background: var(--accent-700); }
.btn--ghost { --bg-btn: transparent; --fg-btn: var(--ink); border-color: var(--border); box-shadow: none; }
.btn--ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn--lg { padding: 1.05rem 2rem; font-size: 1.02rem; }
.btn svg { width: 18px; height: 18px; }

.link-arrow { display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; color: var(--primary); text-decoration: none; }
.link-arrow svg { width: 17px; height: 17px; transition: transform .3s var(--ease); }
.link-arrow:hover svg { transform: translateX(5px); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  transition: background .4s var(--ease), box-shadow .4s var(--ease), backdrop-filter .4s;
}
.site-header.scrolled {
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  box-shadow: 0 1px 0 var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 78px; gap: 1.5rem; }
.nav__logo { display: inline-flex; align-items: center; height: 44px; flex: none; }
.nav__logo svg, .nav__logo img { height: 38px; width: auto; display: block; }
.nav__links { display: flex; align-items: center; gap: .35rem; list-style: none; margin: 0; padding: 0; }
.nav__links a {
  position: relative; font-size: .93rem; font-weight: 500; color: var(--ink); text-decoration: none;
  padding: .55rem .75rem; border-radius: 9px; transition: color .25s, background .25s;
}
.nav__links a:hover, .nav__links a[aria-current="page"] { color: var(--primary); background: var(--mint-soft); }
.nav__cta { display: flex; align-items: center; gap: .5rem; flex: none; }
.has-dropdown { position: relative; }
.dropdown {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%) translateY(8px);
  min-width: 280px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: .6rem; opacity: 0; visibility: hidden; transition: .28s var(--ease);
  display: grid; gap: 2px;
}
.has-dropdown:hover .dropdown, .has-dropdown:focus-within .dropdown { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.dropdown a { display: flex; align-items: center; gap: .7rem; padding: .65rem .8rem; border-radius: 11px; font-size: .9rem; }
.dropdown a span.d-ic { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--mint-soft); color: var(--primary); flex: none; }
.dropdown a span.d-ic svg { width: 16px; height: 16px; }

.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: .25s var(--ease); }
.icon-btn:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.icon-btn svg { width: 19px; height: 19px; }
.theme-toggle .sun { display: none; } html[data-theme="dark"] .theme-toggle .sun { display: block; }
html[data-theme="dark"] .theme-toggle .moon { display: none; }

.burger { display: none; }
.mobile-nav { display: none; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #d7e4e2; padding-block: clamp(3.5rem, 6vw, 5rem) 2rem; position: relative; overflow: hidden; }
html[data-theme="dark"] .site-footer { background: #081312; }
.site-footer a { color: #cfe0dd; text-decoration: none; transition: color .2s; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 2.5rem; }
.footer-col h4 { color: #fff; font-family: var(--font-body); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 1rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; font-size: .92rem; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.12); font-size: .85rem; color: #9db3b0; }
.footer-legal { display: flex; gap: 1.25rem; flex-wrap: wrap; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: clamp(1.4rem, 2.4vw, 2rem); box-shadow: var(--shadow-sm);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .4s;
  display: flex; flex-direction: column; height: 100%;
}
.card:hover { box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); }
.card__ic { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--mint-soft); color: var(--primary); margin-bottom: 1.1rem; flex: none; }
.card__ic svg { width: 26px; height: 26px; }
.card h3 { font-size: 1.3rem; margin-bottom: .5rem; }
.card p { color: var(--muted); font-size: .96rem; margin-bottom: 1rem; }
.card .mt-auto { margin-top: auto; }

.tag { display: inline-flex; align-items: center; gap: .4rem; font-size: .76rem; font-weight: 600; letter-spacing: .04em; padding: .35rem .7rem; border-radius: 999px; background: var(--mint-soft); color: var(--primary); }
.tag--accent { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-700); }

/* ---------- Media / images ---------- */
.media { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media--16x9 { aspect-ratio: 16/9; }
.media--4x3 { aspect-ratio: 4/3; }
.media--1x1 { aspect-ratio: 1/1; }
.media--3x4 { aspect-ratio: 3/4; }
.ratio { aspect-ratio: var(--r, 4/3); }

/* Signatur-Bogen */
.arch-divider { width: 100%; height: 90px; display: block; color: var(--mint); }
.arch-divider path { fill: none; stroke: currentColor; stroke-width: 2; }

/* Stat */
.stat__num { font-family: var(--font-head); font-size: clamp(2.2rem, 4vw, 3.2rem); font-weight: 600; color: var(--primary); line-height: 1; }
.stat__lbl { color: var(--muted); font-size: .92rem; margin-top: .4rem; }

/* FAQ / accordion */
.acc { border-top: 1px solid var(--border); }
.acc__item { border-bottom: 1px solid var(--border); }
.acc__q { width: 100%; text-align: left; background: none; border: 0; cursor: pointer; font-family: var(--font-head); font-weight: 600; font-size: 1.12rem; color: var(--ink); padding: 1.3rem 3rem 1.3rem 0; position: relative; display: flex; }
.acc__q::after { content: ""; position: absolute; right: .2rem; top: 50%; width: 13px; height: 13px; transform: translateY(-50%); background: no-repeat center/contain; transition: transform .35s var(--ease); }
.acc__q::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230E5A63' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E"); }
.acc__item.open .acc__q::after { transform: translateY(-50%) rotate(135deg); }
.acc__a { max-height: 0; overflow: hidden; transition: max-height .45s var(--ease); }
.acc__a-inner { padding: 0 2.5rem 1.4rem 0; color: var(--muted); }

/* Process steps */
.step { position: relative; padding-left: 0; }
.step__n { font-family: var(--font-head); font-size: 2.4rem; font-weight: 600; color: var(--mint); line-height: 1; }
html[data-theme="dark"] .step__n { color: var(--teal); }

/* Pill nav for audiences */
.switch { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 5px; gap: 4px; }
.switch button { border: 0; background: none; cursor: pointer; font-weight: 600; font-size: .92rem; color: var(--muted); padding: .55rem 1.2rem; border-radius: 999px; transition: .3s var(--ease); }
.switch button.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }

/* ---------- Motion prep ---------- */
[data-reveal] > * { will-change: transform, opacity; }
[data-tilt] { transform-style: preserve-3d; }
[data-split] { display: inline-block; }
.split-line { display: block; overflow: hidden; }
canvas.bg-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.hero-blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; z-index: 0; pointer-events: none; }

/* utility */
.text-accent { color: var(--accent); }
.text-primary { color: var(--primary); }
.text-muted { color: var(--muted); }
.bg-soft { background: var(--mint-soft); }
.bg-surface2 { background: var(--surface-2); }
.rounded-xl { border-radius: var(--radius); }
.relative { position: relative; } .z1 { position: relative; z-index: 1; }
.center { text-align: center; }
.maxw-prose { max-width: 60ch; }
.maxw-narrow { max-width: 46ch; }
.flow > * + * { margin-top: 1rem; }
.divider-soft { height: 1px; background: var(--border); border: 0; }
.badge-float { position: absolute; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-md); padding: .8rem 1rem; display: flex; align-items: center; gap: .65rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}
@media (max-width: 860px) {
  .nav__links, .nav .has-dropdown { display: none; }
  .burger { display: grid; }
  .mobile-nav { display: block; position: fixed; inset: 78px 0 0 0; z-index: 99; background: var(--bg);
    transform: translateX(100%); transition: transform .45s var(--ease); overflow-y: auto; padding: 1.5rem clamp(1.1rem,4vw,2.5rem) 3rem; }
  .mobile-nav.open { transform: translateX(0); }
  .mobile-nav a { display: block; padding: .9rem 0; font-size: 1.1rem; font-family: var(--font-head); font-weight: 600; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--border); }
  .mobile-nav .m-group { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 1.5rem; font-weight: 700; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
  .btn { width: 100%; }
  .nav__cta .btn-hide-sm { display: none; }
}

/* ---------- Vollbild-Scroll-Story (Ablauf) ----------
   Standard = vertikal gestapelte Vollbild-Slides (funktioniert OHNE JS,
   bei reduced-motion und auf Mobil). Den horizontalen Pin-Scroll aktiviert
   das JS nur am Desktop mit Motion via Klasse .story-horizontal. */
.story-fs { position: relative; overflow: hidden; background: var(--bg); }
.story-track { display: flex; flex-direction: column; }
.story-slide {
  position: relative; flex: none; width: 100%; height: 88vh; min-height: 520px;
  display: flex; align-items: flex-end; overflow: hidden;
}
.story-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.story-ov {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8,18,18,.62) 0%, rgba(8,18,18,.12) 32%, rgba(8,18,18,.30) 55%, rgba(8,18,18,.86) 100%);
}
.story-content {
  position: relative; z-index: 2; color: #fff;
  padding: clamp(2rem, 6vw, 6rem); padding-bottom: clamp(3rem, 8vw, 7rem);
  max-width: 820px;
}
.story-num { display: block; font-family: var(--font-head); font-weight: 600; color: var(--mint);
  font-size: clamp(2.4rem, 6vw, 4.5rem); line-height: 1; margin-bottom: .6rem; }
.story-slide h3 { color: #fff; font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1.05; margin: 0 0 1rem; text-wrap: balance; }
.story-slide p { color: #e7f1ef; font-size: clamp(1.05rem, 1.7vw, 1.4rem); line-height: 1.55; max-width: 48ch; margin: 0; }
.story-head { position: relative; z-index: 6; pointer-events: none; padding: clamp(2rem,5vw,3rem) clamp(1.6rem,4vw,3.2rem) 1.5rem; }
.story-head .eyebrow { color: var(--primary); }
.story-head .eyebrow::before { background: var(--accent); }
.story-head h2 { color: var(--ink); }
.story-hint { display: none; }

/* Desktop + Motion: horizontaler Pin-Scroll (per JS aktiviert) */
.story-fs.story-horizontal { background: #0C1A1A; }
.story-fs.story-horizontal .story-track { flex-direction: row; height: 100vh; will-change: transform; }
.story-fs.story-horizontal .story-slide { width: 100vw; height: 100vh; min-height: 0; }
.story-fs.story-horizontal .story-head { position: absolute; top: 0; left: 0; }
.story-fs.story-horizontal .story-head .eyebrow { color: var(--mint); }
.story-fs.story-horizontal .story-head h2 { color: #fff; text-shadow: 0 2px 24px rgba(0,0,0,.5); }
.story-fs.story-horizontal .story-hint { display: flex; position: absolute; z-index: 6;
  right: clamp(1.6rem,4vw,3rem); bottom: clamp(1.6rem,4vw,3rem); align-items: center; gap: .6rem;
  color: rgba(255,255,255,.85); font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; pointer-events: none; }
.story-hint span { width: 46px; height: 2px; background: rgba(255,255,255,.4); position: relative; overflow: hidden; }
.story-hint span::after { content: ""; position: absolute; inset: 0; width: 40%; background: var(--mint); animation: hintslide 1.8s var(--ease) infinite; }
@keyframes hintslide { 0% { left: -40%; } 100% { left: 140%; } }

/* Feste 2-Spalten-Splits (inline gesetzt) auf Mobil einspaltig — repeat()-Grids
   (auto-fit/auto-fill) bleiben unangetastet, da sie bereits fluid sind. */
@media (max-width: 820px) {
  [style*="grid-template-columns"]:not([style*="repeat"]):not([style*="auto"]) {
    grid-template-columns: 1fr !important;
  }
  .h-hero { font-size: clamp(2.1rem, 8vw, 3rem); }
}
/* Pin-Scroll-Story auf Mobil vertikal stapeln (Pin ist dort deaktiviert) */
@media (max-width: 767px) {
  [data-story] > div { flex-direction: column; width: auto !important; }
  [data-panel-h] { width: auto !important; }
  .badge-float { transform: scale(.85); }
}
@media (max-width: 480px) {
  .badge-float { display: none; }
  .switch { width: 100%; justify-content: center; }
  .section { padding-block: clamp(3rem, 12vw, 5rem); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  [data-reveal] > *, [data-split] { opacity: 1 !important; transform: none !important; }
}
