/* Dr. med. Matthias E. Fabra: statische Fassung.
   Typografie: Spectral (Überschriften, Fachpublikations-Charakter) + Public Sans (Text).
   Ein Akzent (Petrol), ein Radius (4px), Dark Mode folgt dem System. */

@font-face {
  font-family: 'Public Sans';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/public-sans-latin.woff2") format('woff2');
}
@font-face {
  font-family: 'Spectral';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/spectral-400-latin.woff2") format('woff2');
}
@font-face {
  font-family: 'Spectral';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/spectral-500-latin.woff2") format('woff2');
}

:root {
  color-scheme: light;

  --bg: #fcfdfd;
  --tint: #eef3f5;
  --text: #1f2a30;
  --text-2: #3b4a52;
  --muted: #56656d;
  --line: #dbe3e7;
  --line-strong: #b7c4ca;
  --field-line: #7d8d95;
  --placeholder: #5f6d75;
  --accent: #216477;
  --accent-ink: #184c5b;
  --btn: #216477;
  --btn-hover: #184c5b;
  --on-btn: #ffffff;
  --notice-bg: #184c5b;
  --error: #a1342a;
  --footer-bg: #184c5b;
  --footer-text: #e3edf0;
  --footer-muted: #b4c8cf;
  --footer-line: #3b6b79;

  --head: 'Spectral', Georgia, 'Times New Roman', serif;
  --body: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --r: 4px;
  --wrap: 1120px;
  --gutter: 32px;
  --header-h: 72px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-ink); }
::selection { background: color-mix(in oklab, var(--accent) 24%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 60;
  background: var(--btn);
  color: var(--on-btn);
  padding: 10px 16px;
  border-radius: var(--r);
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.icon { width: 1.25em; height: 1.25em; flex: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 500 15px/1.2 var(--body);
  text-decoration: none;
  white-space: nowrap;
  padding: 13px 26px;
  border-radius: var(--r);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s, transform .15s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--btn); color: var(--on-btn); }
.btn--primary:hover { background: var(--btn-hover); color: var(--on-btn); }
.btn--ghost { color: var(--accent-ink); border-color: var(--line-strong); background: transparent; }
.btn--ghost:hover { background: var(--tint); color: var(--accent-ink); border-color: var(--accent); }
.btn--small { padding: 9px 18px; font-size: 14.5px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg) 90%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
@media (prefers-reduced-transparency: reduce) {
  .site-header { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
.site-header__bar {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 12px;
}
.brand { display: flex; flex-direction: column; gap: 2px; min-width: 0; text-decoration: none; }
.brand__name { font: 500 18px/1.25 var(--head); letter-spacing: .01em; color: var(--text); }
.brand__sub { font-size: 12.5px; line-height: 1.35; color: var(--accent); text-wrap: balance; }

.nav { display: flex; align-items: center; gap: 26px; flex: none; }
.nav a:not(.btn) {
  position: relative;
  font-size: 14.5px;
  color: var(--text-2);
  text-decoration: none;
  padding-block: 6px;
  transition: color .2s;
}
.nav a:not(.btn):hover { color: var(--accent); }
.nav a[aria-current="true"] { color: var(--accent); font-weight: 600; }

.burger {
  display: none;
  width: 44px;
  height: 44px;
  background: none;
  border: 0;
  border-radius: var(--r);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  color: var(--text);
}
.burger span { display: block; width: 22px; height: 2px; background: currentColor; transition: transform .25s var(--ease), opacity .2s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav { border-top: 1px solid var(--line); padding: 8px var(--gutter) 16px; }
.mobile-nav[hidden] { display: none; }
.mobile-nav a { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 15.5px; }
.mobile-nav a:last-child { border-bottom: 0; color: var(--accent); font-weight: 600; }

/* ---------- Views (Startseite, Impressum, Datenschutz) ---------- */
.js [data-view] { display: none; }
.js[data-page="home"] [data-view="home"],
.js[data-page="impressum"] [data-view="impressum"],
.js[data-page="datenschutz"] [data-view="datenschutz"] { display: block; }

/* ---------- Typography helpers ---------- */
.eyebrow {
  margin-bottom: 14px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}
.h2 {
  font: 400 clamp(27px, 3vw, 34px)/1.2 var(--head);
  letter-spacing: -.01em;
  color: var(--text);
  max-width: 22em;
  text-wrap: balance;
  hyphens: auto;
}
.h3 { font: 500 20px/1.3 var(--head); color: var(--text); }
.prose { color: var(--text-2); max-width: 65ch; text-wrap: pretty; }
.prose + .prose { margin-top: 18px; }

.section { padding-block: 96px; scroll-margin-top: 84px; }
.section--tint { background: var(--tint); border-block: 1px solid var(--line); }
.section__head { margin-bottom: 48px; }

/* ---------- Hero ---------- */
.hero {
  scroll-margin-top: 84px;
  background: linear-gradient(180deg, var(--tint), var(--bg) 78%);
}
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: 56px;
  align-items: center;
  padding-block: 72px 64px;
}
.hero__title {
  font: 400 clamp(32px, 3.7vw, 42px)/1.12 var(--head);
  letter-spacing: -.015em;
  color: var(--text);
  hyphens: auto;
  text-wrap: balance;
}
.hero__lead { margin-top: 24px; max-width: 30em; font-size: 18px; line-height: 1.6; color: var(--text-2); text-wrap: pretty; }
.hero__lead strong { font-weight: 600; color: var(--accent-ink); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.hero__image { border-radius: var(--r); overflow: hidden; }
.hero__image img { width: 100%; height: auto; }

.stats { border-top: 1px solid var(--line); }
.stats__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { padding: 28px 24px 28px 0; }
.stat + .stat { padding-left: 32px; border-left: 1px solid var(--line); }
.stat__value { font: 400 34px/1 var(--head); color: var(--accent-ink); }
.stat__label { margin-top: 8px; font-size: 14px; line-height: 1.45; color: var(--muted); }

/* ---------- Profil ---------- */
.profil__grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 72px; margin-top: 40px; align-items: start; }
.facts { display: grid; gap: 22px; padding-left: 32px; border-left: 1px solid var(--line-strong); }
.facts dt { font-size: 13.5px; color: var(--muted); }
.facts dd { margin-top: 2px; font: 400 19px/1.4 var(--head); color: var(--text); }

/* ---------- Leistungen ---------- */
.lead { font: 400 clamp(19px, 2vw, 22px)/1.5 var(--head); color: var(--text); max-width: 36em; margin-top: 20px; text-wrap: pretty; }
.services { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 56px; margin-top: 48px; }
.service { padding: 26px 0 30px; border-top: 1px solid var(--line-strong); }
.service p { margin-top: 8px; font-size: 15.5px; line-height: 1.6; color: var(--text-2); max-width: 34em; }

.clients { margin-top: 56px; }
.clients__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; margin-top: 24px; }
.clients__group h4 { font: 500 17px/1.3 var(--head); color: var(--accent-ink); padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--line-strong); }
.clients__group li { padding-block: 7px; font-size: 15.5px; line-height: 1.5; color: var(--text); }
.clients__group li span { display: block; margin-top: 2px; font-size: 14px; color: var(--muted); }
.clients__more { margin-top: 28px; font-size: 14.5px; color: var(--muted); }

.notice {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-top: 48px;
  padding: 24px 28px;
  background: var(--notice-bg);
  color: #fff;
  border-radius: var(--r);
}
.notice .icon { width: 26px; height: 26px; margin-top: 2px; opacity: .9; }
.notice p { font-size: 17px; line-height: 1.55; max-width: 48em; }

/* ---------- Werdegang ---------- */
.werdegang__grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 64px; align-items: start; }
.werdegang__intro { position: sticky; top: 108px; }
.werdegang__intro p { margin-top: 24px; font-size: 15.5px; line-height: 1.7; color: var(--muted); max-width: 26em; }

.timeline { position: relative; }
.timeline li { position: relative; padding: 0 0 26px 30px; border-left: 1px solid var(--line-strong); }
.timeline li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 7px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--bg);
}
.timeline li:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline li:last-child::before { background: var(--accent-ink); }
.timeline time, .timeline .when { display: block; font: 500 15px/1.4 var(--head); color: var(--accent-ink); }
.timeline p { margin-top: 2px; font-size: 16px; line-height: 1.55; color: var(--text); }

.members { margin-top: 72px; }
.members__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; margin-top: 20px; padding-top: 24px; border-top: 1px solid var(--line-strong); }
.members dt { font: 500 24px/1.2 var(--head); color: var(--accent-ink); }
.members dd { margin-top: 6px; font-size: 13.5px; line-height: 1.5; color: var(--muted); }

/* ---------- Publikationen ---------- */
.pubs { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line-strong); display: grid; gap: 22px; }
.pub { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 24px; align-items: baseline; }
.pub__year { font: 400 18px/1.4 var(--head); color: var(--accent-ink); }
.pub__text { font-size: 15.5px; line-height: 1.6; color: var(--text-2); max-width: 62em; }
.pub__text strong { font-weight: 600; color: var(--text); }
.pub__text em { color: var(--muted); }

.more { margin-top: 22px; }
.more summary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
  padding: 8px 0;
}
.more summary::-webkit-details-marker { display: none; }
.more summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .2s var(--ease);
}
.more[open] summary::after { transform: translateY(1px) rotate(-135deg); }
.more .pubs { margin-top: 12px; padding-top: 24px; }

/* ---------- Kontakt ---------- */
.kontakt__grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 56px; align-items: start; }
.kontakt__intro { margin-top: 18px; font-size: 16.5px; line-height: 1.7; color: var(--text-2); max-width: 34em; }
.contact-list { display: grid; gap: 20px; margin-top: 32px; }
.contact-item { display: flex; gap: 14px; align-items: flex-start; }
.contact-item__icon {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--r);
  background: var(--tint);
  border: 1px solid var(--line-strong);
  color: var(--accent-ink);
  font-size: 18px;
}
.contact-item__label { display: block; font-size: 13.5px; color: var(--muted); }
.contact-item__value { display: block; font-size: 16px; line-height: 1.5; color: var(--text); }
.contact-item__value small { display: block; font-size: 14px; color: var(--muted); }
.contact-item a { color: var(--text); text-decoration-color: var(--line-strong); }
.contact-item a:hover { color: var(--accent); text-decoration-color: currentColor; }

.form-card { background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--r); padding: 32px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: 14px; font-weight: 500; color: var(--text); }
.field .req { color: var(--muted); }
.field input, .field textarea {
  font: 400 15.5px/1.4 var(--body);
  color: var(--text);
  background: var(--bg);
  padding: 12px 14px;
  border: 1px solid var(--field-line);
  border-radius: var(--r);
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input::placeholder, .field textarea::placeholder { color: var(--placeholder); opacity: 1; }
.field input:hover, .field textarea:hover { border-color: var(--muted); }
.field input:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.field [aria-invalid="true"] { border-color: var(--error); }
.field__error { font-size: 13.5px; color: var(--error); }
.field__error[hidden] { display: none; }
.form-note { margin-top: 20px; font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 24px; }
.form-actions small { font-size: 13px; color: var(--muted); }

.done { text-align: center; background: var(--tint); border: 1px solid var(--line-strong); border-radius: var(--r); padding: 48px 36px; }
.done[hidden], .form-card[hidden] { display: none; }
.done .icon { width: 48px; height: 48px; color: var(--accent); margin-inline: auto; }
.done h3 { margin-top: 16px; font: 500 22px/1.3 var(--head); color: var(--text); }
.done p { margin-top: 10px; font-size: 15px; line-height: 1.6; color: var(--text-2); }
.done p small { font-size: 13.5px; color: var(--muted); }
.done .btn { margin-top: 22px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--footer-bg); color: var(--footer-text); }
.site-footer a { color: var(--footer-text); text-decoration: none; font-size: 14.5px; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer :focus-visible { outline-color: #fff; }
.site-footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-block: 56px 36px; }
.site-footer__name { font: 400 19px/1.3 var(--head); color: #fff; }
.site-footer address { margin-top: 10px; font-style: normal; font-size: 14px; line-height: 1.7; color: var(--footer-muted); }
.site-footer h2 { font: 600 13.5px/1.3 var(--body); color: var(--footer-muted); margin-bottom: 12px; }
.site-footer ul { display: grid; gap: 8px; }
.site-footer__legal { border-top: 1px solid var(--footer-line); }
.site-footer__legal .wrap { padding-block: 18px; font-size: 13px; color: var(--footer-muted); }

/* ---------- Rechtliche Seiten ---------- */
.legal { background: linear-gradient(180deg, var(--tint), var(--bg) 320px); }
.legal__wrap { max-width: 860px; margin-inline: auto; padding: 72px var(--gutter) 104px; }
.legal__back { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 500; text-decoration: none; }
.legal h1 { margin-top: 40px; font: 400 clamp(32px, 4vw, 42px)/1.15 var(--head); letter-spacing: -.01em; color: var(--text); }
.legal__sub { margin-top: 10px; font-size: 15px; color: var(--muted); }
.legal__rows { margin-top: 36px; border-bottom: 1px solid var(--line-strong); }
.legal__row { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: 6px 32px; padding: 22px 0; border-top: 1px solid var(--line); }
.legal__row dt { font-size: 14.5px; font-weight: 600; color: var(--accent-ink); }
.legal__row dd { font-size: 15.5px; line-height: 1.7; color: var(--text-2); }
.legal__sections { margin-top: 36px; border-bottom: 1px solid var(--line-strong); }
.legal__section { padding: 28px 0; border-top: 1px solid var(--line); }
.legal__section h2 { display: flex; gap: 14px; font: 500 22px/1.3 var(--head); color: var(--text); margin-bottom: 12px; }
.legal__section h2 span { color: var(--accent); }
.legal__section p { font-size: 15.5px; line-height: 1.7; color: var(--text-2); }
.legal__section p + p { margin-top: 12px; }

.page-404__text { margin-top: 20px; }
.page-404__cta { margin-top: 28px; }

/* ---------- Bewegung: nur dezent, nur wenn erlaubt ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .6s var(--ease), transform .6s var(--ease);
  }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav { display: none; }
  .burger { display: flex; }
}
@media (max-width: 860px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr); gap: 36px; padding-block: 48px 48px; }
  .hero__image { max-width: 560px; }
  .section { padding-block: 64px; }
  .section__head { margin-bottom: 32px; }
  .profil__grid, .werdegang__grid, .kontakt__grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .profil__grid { margin-top: 28px; }
  .facts { padding-left: 0; border-left: 0; padding-top: 24px; border-top: 1px solid var(--line-strong); }
  .werdegang__intro { position: static; }
  .clients__grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .members__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .site-footer__grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  :root { --gutter: 20px; }
  .brand__sub { font-size: 11.5px; }
  .hero__cta .btn { flex: 1 1 auto; }
  .stats__grid { grid-template-columns: minmax(0, 1fr); }
  .stat { padding: 20px 0; }
  .stat + .stat { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .services { grid-template-columns: minmax(0, 1fr); }
  .members__grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .pub { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .notice { padding: 20px; }
  .form-card { padding: 20px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .field input, .field textarea { font-size: 16px; }
  .form-actions .btn { width: 100%; }
  .site-footer__grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .legal__wrap { padding: 40px var(--gutter) 72px; }
  .legal__row { grid-template-columns: minmax(0, 1fr); }
}
