/* ============================================================
   APP SHELL: Top-bar, Header, Footer, Hero, Page-Layout
   Replaces legacy CSS via cascade-layer override.
   ============================================================ */

@layer components {

  /* ===== APP SHELL ===== */
  .app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }
  .app__main { flex: 1 0 auto; }

  /* ===== TOP A11Y BAR ===== */
  .ds-tbar {
    background: var(--earth-700);
    color: var(--neutral-100);
    font-size: var(--fs-xs);
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .ds-tbar__inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--sp-4);
    padding-block: 6px;
    flex-wrap: wrap;
  }
  .ds-tbar__left { display: flex; gap: var(--sp-4); flex-wrap: wrap; align-items: center; }
  .ds-tbar__left span {
    display: inline-flex; align-items: center; gap: 6px;
    color: rgba(255,255,255,0.78);
  }
  .ds-tbar__left svg { width: 14px; height: 14px; fill: var(--green-300); }
  .ds-tbar__right { display: flex; gap: 4px; }
  .ds-tbar__right button {
    background: rgba(255,255,255,0.08);
    color: var(--neutral-100);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-sm);
    padding: 2px 10px;
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out);
  }
  .ds-tbar__right button:hover { background: rgba(255,255,255,0.16); }

  /* ===== HEADER ===== */
  .ds-header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky; top: 0; z-index: var(--z-sticky);
    backdrop-filter: blur(8px);
    background: color-mix(in srgb, var(--bg-surface) 92%, transparent);
  }
  .ds-header__inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--sp-5);
    padding-block: var(--sp-3);
  }
  .ds-brand {
    display: flex; align-items: center; gap: var(--sp-3);
    text-decoration: none;
    color: var(--text-strong);
  }
  .ds-brand__mark {
    width: 34px; height: 34px;
    flex-shrink: 0;
  }
  .ds-brand__name {
    font-family: var(--ff-display);
    font-size: var(--fs-lg);
    font-weight: var(--fw-semibold);
    line-height: 1;
    letter-spacing: var(--tracking-tight);
  }
  .ds-brand__sub {
    display: block;
    font-family: var(--ff-sans);
    font-size: 10px;
    font-weight: var(--fw-semibold);
    letter-spacing: var(--tracking-wider);
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 2px;
  }

  .ds-nav {
    display: flex; align-items: center; gap: var(--sp-2);
  }
  .ds-nav__link {
    color: var(--text-default);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    transition: background var(--dur-fast) var(--ease-out),
                color var(--dur-fast) var(--ease-out);
  }
  .ds-nav__link:hover { background: var(--bg-muted); color: var(--text-strong); }
  .ds-nav__link[aria-current="page"] { color: var(--brand-primary); background: var(--green-50); }

  /* ===== KOOPERATION-PILL-BAR ===== */
  .ds-coop {
    background: var(--neutral-50);
    border-bottom: 1px solid var(--border-subtle);
    font-size: var(--fs-xs);
  }
  .ds-coop__inner {
    display: flex; align-items: center; justify-content: center;
    gap: var(--sp-3); padding-block: 8px; flex-wrap: wrap;
  }
  .ds-coop__label { color: var(--text-muted); }
  .ds-coop__pill {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-strong);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-weight: var(--fw-medium);
  }
  .ds-coop__pill::before {
    content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green-500);
  }

  /* ===== FOOTER ===== */
  .ds-footer {
    background: var(--earth-700);
    color: rgba(255,255,255,0.72);
    padding-block: var(--sp-5) var(--sp-4);
    flex-shrink: 0;
    margin-top: var(--sp-8);
  }
  .ds-footer__grid {
    display: grid;
    grid-template-columns: 1.4fr repeat(3, 1fr);
    gap: var(--sp-6);
    margin-bottom: var(--sp-4);
  }
  .ds-footer__brand { display: flex; flex-direction: column; gap: var(--sp-2); }
  .ds-footer__brand .ds-brand { color: white; }
  .ds-footer__brand .ds-brand__name { color: white; }
  .ds-footer__brand .ds-brand__sub { color: var(--green-300); }
  .ds-footer__tag {
    font-size: var(--fs-sm); color: rgba(255,255,255,0.55);
    line-height: var(--lh-snug); max-width: 30ch;
  }
  .ds-footer__col h4 {
    color: white;
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    font-weight: var(--fw-bold);
    margin-bottom: var(--sp-3);
    display: flex; align-items: center; gap: 6px;
  }
  .ds-footer__col a {
    display: block;
    color: rgba(255,255,255,0.72);
    font-size: var(--fs-sm);
    padding-block: 4px;
    transition: color var(--dur-fast) var(--ease-out);
  }
  .ds-footer__col a:hover { color: var(--green-300); }
  .ds-footer__inline-badge {
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.72);
    font-size: 9px;
    font-weight: var(--fw-bold);
    letter-spacing: var(--tracking-wide);
    padding: 2px 6px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
  }
  .ds-footer__copy {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: var(--sp-3);
    text-align: center;
    font-size: var(--fs-xs);
    color: rgba(255,255,255,0.5);
  }
  @media (max-width: 720px) {
    .ds-footer__grid { grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
  }

  /* ===== HERO ===== */
  .ds-hero {
    position: relative;
    overflow: hidden;
    padding-block: clamp(var(--sp-7), 8vw, var(--sp-9));
    background:
      linear-gradient(180deg, var(--neutral-25) 0%, var(--green-50) 100%);
  }
  .ds-hero__inner {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: var(--sp-8);
    align-items: center;
  }
  @media (max-width: 900px) {
    .ds-hero__inner { grid-template-columns: 1fr; gap: var(--sp-6); }
  }
  .ds-hero__content { display: flex; flex-direction: column; gap: var(--sp-4); }
  .ds-hero__title {
    font-family: var(--ff-display);
    font-weight: var(--fw-semibold);
    font-size: clamp(2.25rem, 4vw + 1rem, 4.25rem);
    line-height: 1.05;
    letter-spacing: var(--tracking-tight);
    color: var(--text-strong);
  }
  .ds-hero__title em {
    font-style: italic;
    color: var(--brand-primary);
    font-weight: var(--fw-regular);
  }
  .ds-hero__lead {
    font-size: var(--fs-lg);
    line-height: var(--lh-relaxed);
    color: var(--text-muted);
    max-width: 50ch;
  }
  .ds-hero__cta { display: flex; gap: var(--sp-3); flex-wrap: wrap; margin-top: var(--sp-2); }
  .ds-hero__proof {
    display: flex; gap: var(--sp-5); margin-top: var(--sp-5);
    padding-top: var(--sp-4);
    border-top: 1px solid var(--border-subtle);
    font-size: var(--fs-sm); color: var(--text-muted);
  }
  .ds-hero__proof strong { display: block; font-size: var(--fs-xl); color: var(--text-strong); font-family: var(--ff-display); }
  .ds-hero__media {
    position: relative;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    aspect-ratio: 4 / 5;
    box-shadow: var(--shadow-xl);
  }
  .ds-hero__media img { width: 100%; height: 100%; object-fit: cover; }

  /* ===== PAGE HEADER (sub-pages) ===== */
  .ds-page-header {
    padding-block: var(--sp-7) var(--sp-5);
    background: var(--neutral-50);
    border-bottom: 1px solid var(--border-subtle);
  }
  .ds-page-header__eyebrow { color: var(--brand-primary); font-size: var(--fs-xs); font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: var(--tracking-wider); margin-bottom: var(--sp-2); }
  .ds-page-header h1 {
    font-family: var(--ff-display);
    font-weight: var(--fw-semibold);
    font-size: clamp(2rem, 3vw + 1rem, 3.25rem);
    line-height: 1.1;
    color: var(--text-strong);
    letter-spacing: var(--tracking-tight);
  }
  .ds-page-header__lead { font-size: var(--fs-md); color: var(--text-muted); max-width: 60ch; margin-top: var(--sp-3); }

  /* ===== EMPTY STATE ===== */
  .ds-empty {
    text-align: center;
    padding: var(--sp-7) var(--sp-5);
    border: 1px dashed var(--border-default);
    border-radius: var(--radius-lg);
    background: var(--bg-muted);
    color: var(--text-muted);
  }
  .ds-empty__icon {
    width: 56px; height: 56px;
    margin: 0 auto var(--sp-3);
    color: var(--text-subtle);
  }
  .ds-empty__title {
    font-family: var(--ff-display);
    font-size: var(--fs-xl);
    color: var(--text-strong);
    margin-bottom: var(--sp-2);
  }
  .ds-empty__body { max-width: 40ch; margin: 0 auto var(--sp-4); }

  /* ===== HELP FAB (refined) ===== */
  .ds-fab {
    position: fixed; right: var(--sp-5); bottom: var(--sp-5);
    width: 52px; height: 52px;
    border-radius: var(--radius-full);
    background: var(--brand-primary);
    color: var(--brand-primary-fg);
    box-shadow: var(--shadow-lg);
    display: flex; align-items: center; justify-content: center;
    z-index: var(--z-overlay);
    border: none; cursor: pointer;
    transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
  }
  .ds-fab:hover { transform: translateY(-2px) scale(1.05); box-shadow: var(--shadow-xl); }
  .ds-fab svg { width: 24px; height: 24px; }
}
