/* =====================================================================
   BEGAP – Berner Gesellschaft für Alterspsychiatrie und Alterspsychotherapie
   Designsystem · statische Ersatzseite (begap.org)
   Keine externen Schriften/Requests (DSG-konform). System-Fonts only.
   ===================================================================== */

:root {
  /* Markenfarben – abgeleitet aus der Wortmarke */
  --teal: #2e5c6e;          /* Primär – Petrol */
  --teal-deep: #224756;
  --teal-soft: #e8eff2;
  --green: #6fae9f;         /* Sekundär – Salbeigrün */
  --green-deep: #4f8c7d;
  --green-soft: #e9f3f0;

  --ink: #233139;           /* Fliesstext / Titel */
  --ink-soft: #51616b;      /* sekundärer Text */
  --line: #e3e9ec;          /* feine Linien */
  --bg: #ffffff;
  --bg-alt: #f6f9fa;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(35,49,57,.04), 0 14px 34px rgba(35,49,57,.07);
  --shadow-soft: 0 1px 2px rgba(35,49,57,.04), 0 6px 18px rgba(35,49,57,.05);

  --maxw: 1100px;
  --font: "Helvetica Neue", Helvetica, Arial, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  letter-spacing: .005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; }
a { color: var(--teal-deep); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; font-weight: 700; margin: 0 0 .5em; }
h1 { font-size: clamp(2.05rem, 4.2vw, 2.95rem); letter-spacing: -.022em; }
h2 { font-size: clamp(1.5rem, 2.7vw, 2rem); letter-spacing: -.015em; }
h3 { font-size: 1.15rem; letter-spacing: -.004em; }
p  { margin: 0 0 1.1em; color: var(--ink-soft); }
strong { color: var(--ink); }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.lead { font-size: 1.18rem; color: var(--ink-soft); max-width: 62ch; }

.eyebrow {
  display: inline-block;
  font-size: .76rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--green-deep); margin-bottom: .9rem;
}
.eyebrow.pill {
  background: #fff; border: 1px solid var(--line); color: var(--teal-deep);
  padding: 5px 14px; border-radius: 999px; box-shadow: var(--shadow-soft); letter-spacing: .18em;
}

/* ---------------------------------------------------------------- Header */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,255,255,.9);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, var(--teal), var(--green)) 1;
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; min-height: 76px; gap: 16px; }

/* Wortmarke */
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand:hover { text-decoration: none; }
.brand .wordmark { font-weight: 800; font-size: 1.6rem; letter-spacing: .02em; color: var(--teal); line-height: 1; }
.brand .wordmark .dot { color: var(--green); }
.brand .tagline {
  display: none; font-size: .72rem; line-height: 1.3; color: var(--ink-soft);
  border-left: 1px solid var(--line); padding-left: 12px;
}
@media (min-width: 820px){ .brand .tagline { display: block; } }

/* Navigation */
.nav { display: flex; gap: 2px; align-items: center; }
.nav a {
  position: relative; color: var(--ink); font-size: .96rem; font-weight: 500;
  padding: 8px 12px; border-radius: 8px;
}
.nav a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 2px;
  background: linear-gradient(90deg, var(--teal), var(--green));
  transform: scaleX(0); transform-origin: left; transition: transform .22s ease; border-radius: 2px;
}
.nav a:hover { text-decoration: none; }
.nav a:hover::after { transform: scaleX(1); }
.nav a[aria-current="page"] { color: var(--teal-deep); font-weight: 600; }
.nav a[aria-current="page"]::after { transform: scaleX(1); }

/* Hamburger */
.nav-toggle {
  display: none; width: 44px; height: 40px; border: 1px solid var(--line); background: #fff;
  border-radius: 10px; cursor: pointer; align-items: center; justify-content: center;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; display: block; width: 20px; height: 2px; background: var(--teal-deep); position: relative; transition: .2s;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after  { position: absolute; top: 6px; }

@media (max-width: 819px){
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute; top: 76px; left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    padding: 8px 16px 16px; gap: 2px; display: none;
  }
  .site-header.open .nav { display: flex; }
  .nav a { padding: 12px 10px; border-radius: 8px; }
  .nav a::after { display: none; }
  .nav a[aria-current="page"]{ background: var(--teal-soft); }
}

/* ------------------------------------------------------------- Dynamic Hero */
.hero { position: relative; overflow: hidden; background: linear-gradient(180deg, #f4f8f9, #eef4f4); border-bottom: 1px solid var(--line); }
.hero .nodegraph { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; display: block; }
.hero .container { position: relative; z-index: 2; padding-top: clamp(60px, 10vw, 120px); padding-bottom: clamp(60px, 10vw, 120px); }
.hero h1 { max-width: 20ch; }
.hero .lead { margin-top: .4rem; }
.hero .hero-actions { margin-top: 1.8rem; display: flex; flex-wrap: wrap; gap: 12px; }
.hero.compact .container { padding-top: clamp(48px, 7vw, 80px); padding-bottom: clamp(40px, 6vw, 64px); }

/* ------------------------------------------------------------------ Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .98rem;
  padding: 12px 20px; border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: linear-gradient(120deg, var(--teal), var(--green-deep)); color: #fff; box-shadow: var(--shadow-soft); }
.btn-primary:hover { box-shadow: 0 8px 22px rgba(46,92,110,.32); }
.btn-ghost { background: #fff; color: var(--teal-deep); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--teal); }

/* ------------------------------------------------------------------ Sections */
.section { padding: clamp(48px, 8vw, 88px) 0; }
.section.alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 66ch; margin-bottom: 2.2rem; }

/* ------------------------------------------------------------------ Cards */
.grid { display: grid; gap: 20px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px){ .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; } }

.begap-card {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px; box-shadow: var(--shadow-soft);
  transition: transform .18s ease, box-shadow .22s ease, border-color .22s ease;
}
.begap-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #d4dee2; }
.begap-card h3 { margin-bottom: .35em; }
.begap-card p:last-child { margin-bottom: 0; }
.begap-card .ic {
  width: 44px; height: 44px; border-radius: 12px; margin-bottom: 16px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--teal-soft), var(--green-soft)); color: var(--teal-deep);
}
.begap-card .ic svg { width: 22px; height: 22px; }
.begap-card .region { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--green-deep); margin-bottom: 8px; }
.begap-card .meta { font-size: .9rem; color: var(--ink-soft); margin: .3rem 0 .8rem; }
.begap-card .card-link { font-weight: 600; font-size: .92rem; }

/* ------------------------------------------------------------------ Badges */
.begap-badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600;
  padding: 5px 12px; border-radius: 999px; background: var(--teal-soft); color: var(--teal-deep); border: 1px solid #d6e2e7;
}
.begap-badge.green { background: var(--green-soft); color: var(--green-deep); border-color: #d2e7e0; }

/* ------------------------------------------------------------------ Prose */
.prose { max-width: 74ch; }
.prose h2 { margin-top: 1.9em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.6em; color: var(--teal-deep); }
.prose ul { padding-left: 1.2em; margin: 0 0 1.2em; color: var(--ink-soft); }
.prose li { margin: .4em 0; }
.prose ul li::marker { color: var(--green-deep); }

.statute .art { border-top: 1px solid var(--line); padding-top: 1.4rem; margin-top: 1.4rem; }
.statute .art:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.statute .art h3 { margin-top: 0; }
.statute h4 { margin: 1.1rem 0 .3rem; color: var(--teal-deep); font-size: 1rem; }

.note { background: var(--green-soft); border: 1px solid #d2e7e0; border-radius: var(--radius-sm); padding: 14px 18px; font-size: .94rem; color: var(--green-deep); }
.note strong { color: var(--green-deep); }
.callout { background: var(--teal-soft); border: 1px solid #d6e2e7; border-radius: var(--radius-sm); padding: 16px 20px; color: var(--teal-deep); }

/* Link-Liste */
.linklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.linklist a.row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; box-shadow: var(--shadow-soft); color: var(--ink);
  transition: transform .15s ease, border-color .2s ease;
}
.linklist a.row:hover { text-decoration: none; border-color: var(--teal); transform: translateY(-2px); }
.linklist .row .t { font-weight: 600; }
.linklist .row .d { color: var(--ink-soft); font-size: .92rem; }
.linklist .row .arr { color: var(--green-deep); font-weight: 700; }

/* ------------------------------------------------------------------ Footer */
.site-footer { background: var(--ink); color: #c5d1d8; padding: 50px 0 30px; }
.site-footer a { color: #dbe6ec; }
.site-footer .cols { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 28px; }
@media (max-width: 760px){ .site-footer .cols { grid-template-columns: 1fr; gap: 22px; } }
.site-footer .wordmark { font-weight: 800; font-size: 1.35rem; letter-spacing: .02em; color: #fff; }
.site-footer .wordmark .dot { color: var(--green); }
.site-footer h4 { color: #fff; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 .9rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: .4em 0; }
.site-footer .fineprint { margin-top: 32px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12); font-size: .85rem; color: #90a0a8; display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between; }

/* ------------------------------------------------------------------ Utilities */
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.muted { color: var(--ink-soft); }
.hr { height: 1px; background: var(--line); border: 0; margin: 2.4rem 0; }
.sub-sec { margin-top: 2.6rem; }
.sub-sec > h3 { font-size: 1.3rem; color: var(--ink); margin-bottom: 1rem; }

/* ------------------------------------------------------- Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:hover, .begap-card:hover, .linklist a.row:hover { transform: none; }
}
