/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  /* Theme tokens */
  :root {
    --brand-teal: #0E7C7B;
    --brand-teal-600: #0B6665;
    --brand-coral: #D34A45;
    --brand-dark: #0f172a;
    --brand-light: #ffffff;
    --bg-page: #F7F9FC;
    --bg-header: #F5F7FA;
    --bg-section-muted: #F3F6F9;
    --text-primary: #1f2937;
    --text-muted: #6B7B83;
    --border-soft: #E5E7EB;
    --hero-overlay: rgba(14,124,123,0.22);
  }
  
  /* Base */
  body {
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.65;
    color: var(--text-primary);
    background-color: var(--bg-page);
  }
  h1, h2, h3, h4 { font-family: 'Manrope', 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif; }
  
  /* Layout */
  .container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
  }
  
  /* Header */
  header { position: fixed; top: 0; width: 100%; z-index: 1000; }
  .topbar { background: #F5F7FA; color: var(--text-muted); font-size: 0.95rem; }
  .topbar .container { display: flex; justify-content: space-between; align-items: center; padding: 0.6rem 24px; gap: 1rem; }
  .topbar .cta { background: #fff; color: #1c3331; border: none; padding: 0.45rem 0.9rem; border-radius: 6px; font-weight: 600; cursor: pointer; }
  .nav-wrap { background: #F5F7FA; border-bottom: 1px solid #E5E7EB; box-shadow: 0 1px 2px rgba(16,24,40,0.04); padding: 10px 0; }
  
  nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 0;
  }
  
  .brand-logo { display: flex; align-items: center; line-height: 0; }
  .brand-logo img { height: 66px; width: auto; display: block; }
  
  .nav-links { display: flex; list-style: none; gap: 2rem; }
  .nav-links a { color: var(--text-primary); text-decoration: none; transition: color 0.3s ease; }
  .nav-links a:hover { color: var(--brand-teal); }
  
  .member-btn { background: var(--brand-teal); color: #fff !important; padding: 0.55rem 1rem; border-radius: 6px; font-weight: 600; border: none; cursor: pointer; }
  
  /* Mobile nav toggle (burger) */
  .nav-toggle {
    display: none; /* shown on mobile via media query */
    margin-left: auto;
    background: transparent;
    border: 0;
    padding: 8px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
  }
  .nav-toggle .bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: transform .25s ease, opacity .25s ease;
    position: relative;
  }
  .nav-toggle .bar + .bar { margin-top: 5px; }
  .nav-toggle.is-open .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.is-open .bar:nth-child(2) { opacity: 0; }
  .nav-toggle.is-open .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  
  /* Burger icon rendering fixes */
  nav .nav-toggle {
    /* prevent shrinking and keep consistent touch size */
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    margin-left: 0; /* rely on space-between for right alignment */
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    /* stack bars vertically */
    display: inline-flex;
    flex-direction: column;
    line-height: 1;
  }
  nav .nav-toggle .bar { 
    width: 24px; 
    height: 3px; 
    transform-origin: center; 
  }
  nav .nav-toggle .bar + .bar { margin-top: 6px; }
  /* adjust cross transform for thicker bars */
  .nav-toggle.is-open .bar:nth-child(1) { transform: translateY(9px) rotate(45deg); }
  .nav-toggle.is-open .bar:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }
  
  /* Off-canvas mobile menu (right) */
  .mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 80vw;
    max-width: 340px;
    background: #ffffff;
    box-shadow: -8px 0 24px rgba(0,0,0,0.15);
    transform: translateX(100%);
    transition: transform .3s ease;
    z-index: 1002; /* above header */
    padding: 24px 20px;
  }
  .mobile-menu.open { transform: translateX(0); }
  .mobile-nav ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 16px; }
  .mobile-nav a { color: var(--text-primary); text-decoration: none; font-size: 1.05rem; }
  
  /* Backdrop */
  .menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
    z-index: 1001;
  }
  .menu-backdrop.active { opacity: 1; pointer-events: auto; }
  
  /* Prevent body scroll when menu open */
  body.menu-open { overflow: hidden; }
  
  /* Header nav breakpoint for tablet/mobile */
  @media (max-width: 991px) {
    .nav-links { display: none; }
    .nav-toggle { display: inline-flex; }
  }
  
  /* Force-hide burger on desktop */
  @media (min-width: 992px) {
    nav .nav-toggle { display: none !important; }
  }
  
  /* Hero */
  .hero {
    min-height: 80vh;
    background: url('../assets/kierkegaard-bg.jpg') center/cover no-repeat;
    position: relative; /* allow absolute positioning of quote */
    display: block; /* no flex-based vertical shifting */
    color: #ffffff;
    text-align: center;
    padding-top: 160px; /* keep clear of fixed (taller) header */
    /* Anchor quote via absolute positioning instead of padding */
    padding-bottom: 0;
  }
  /* Remove bottom padding so the quote can sit lower */
  .hero-inner { display: block; width: 100%; padding: 2rem 0 0; }
  .hero-text h1 { display: none; }
  .hero-text .subtitle { display: none; }
  .hero-text .quote {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 77%; /* place just above water line; tweak as needed */
    max-width: 760px;
    width: min(92vw, 760px);
    margin: 0;
    padding: 0 12px;
    font-style: italic;
    font-size: 1.4rem;
    opacity: 1;
  }
  .hero .quote { background: none; border-radius: 0; padding: 0; color: inherit; box-shadow: none; }
  .hero .quote p, .hero .quote .quote-author { text-shadow: 0 2px 12px rgba(0,0,0,0.55); }
  .hero .quote .quote-author { margin-top: 0.75rem; color: inherit; }
  
  /* Intro */
  .intro { text-align: center; }
  .intro h1 {
    font-size: 2.4rem;
    margin-bottom: .5rem;
    font-family: 'Poppins', 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    font-weight: 700;
    color: var(--text-primary);
  }
  .intro .subtitle { font-size: 1.15rem; color: var(--text-muted); }
  .intro-wrap { display: flex; align-items: center; justify-content: center; gap: 24px; flex-wrap: nowrap; }
  .intro-photo { width: 220px; max-width: 40vw; height: auto; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
  .intro-text { text-align: left; }
  @media (max-width: 640px) { .intro-text { text-align: center; } }
  @media (max-width: 820px) {
    .intro-wrap { flex-wrap: wrap; }
  }
  
  /* Sections */
  section { padding: clamp(4.5rem, 7vw, 6rem) 0; }
  .section-dark { background: var(--bg-section-muted); color: var(--text-primary); }
  .section-light { background: #F8FAFC; color: var(--text-primary); }
  .section-gray { background: #F5F7FA; color: var(--text-primary); }
  
  h2 {
    font-size: clamp(2rem, 3.2vw, 2.6rem);
    margin-bottom: 2.2rem;
    text-align: center;
    color: var(--brand-dark);
    font-family: 'Manrope', 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    letter-spacing: -0.012em;
    font-weight: 800;
  }
  
  /* Buttons */
  .btn {
    background: var(--brand-coral);
    color: #ffffff;
    padding: 1rem 2rem;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.3s ease;
  }
  .btn:hover { transform: translateY(-2px); filter: brightness(0.95); }
  
  /* Cards */
  .services-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); 
    gap: 32px; 
    align-items: stretch; 
    margin-top: 1.25rem; 
  }
  @media (max-width: 1024px) { .services-grid { gap: 28px; } }
  @media (max-width: 768px) { .services-grid { gap: 20px; } }
  
  .service-card {
    background: #ffffff;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    /* Solid fallback so older browsers always get a left/right gutter */
    padding: 24px 32px;
    /* More horizontal padding so text doesn't feel flush to the left edge */
    padding-block: clamp(22px, 3vw, 30px);
    padding-inline: clamp(28px, 4.5vw, 44px);
    /* Fallbacks for older browsers */
    padding-left: clamp(28px, 4.5vw, 44px);
    padding-right: clamp(28px, 4.5vw, 44px);
    box-shadow: 0 1px 2px rgba(16,24,40,0.06), 0 8px 16px rgba(16,24,40,0.04);
    transition: box-shadow .2s ease, transform .2s ease;
    height: 100%; 
    display: flex; 
    flex-direction: column; 
  }
  .service-card > *:first-child { margin-top: 0; }
  .service-card > *:last-child { margin-bottom: 0; }
  .service-card > * { max-width: 68ch; }
  .service-card h3 { margin-bottom: 0.5rem; font-size: 1.7rem; line-height: 1.28; letter-spacing: -0.012em; font-weight: 800; color: var(--brand-dark); }
  .service-card h4 { margin: 0.5rem 0 0.25rem; color: var(--brand-teal-600); font-size: 1.2rem; }
  .service-card p { margin: 0.9rem 0; line-height: 1.78; font-size: 1.07rem; }
  .service-card ul { margin: 0.5rem 0 0.9rem; padding-left: 1.25rem; }
  .service-card li { margin: 0.35rem 0; font-size: 1.05rem; }
  .service-card li::marker { color: var(--brand-teal-600); }
  
  .service-card.long { border-left: none; }
  
  /* In-card quote: more subtle, aligned with content */
  .service-card .quote { text-align: left; margin: 0.25rem 0 0.75rem; font-size: 1rem; color: #475569; }
  .service-card .quote .quote-author { text-align: left; margin-top: 0.5rem; font-size: 0.95rem; color: #64748b; }
  
  /* Hover elevation on capable devices */
  @media (hover: hover) and (pointer: fine) {
    .service-card:hover { transform: translateY(-2px); box-shadow: 0 2px 6px rgba(16,24,40,0.08), 0 12px 28px rgba(16,24,40,0.08); }
  }
  
  /* Collapsible "mehr erfahren" content with animation */
  .card-more {
    display: block;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    margin-top: 8px;
    transition: max-height .35s ease, opacity .25s ease;
    clear: both; /* ensure it starts below floated trigger */
  }
  .card-more.open { max-height: 9999px; opacity: 1; border-top: 1px solid #eef2e7; padding-top: 12px; }
  .read-more {
    background: transparent;
    color: var(--brand-teal);
    border: 0;
    padding: 4px 0;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  .read-more:hover { text-decoration: underline; }
  .read-more::after { content: '▾'; font-size: .9em; }
  .read-more[aria-expanded="true"]::after { content: '▴'; }
  
  /* Larger screens: more breathing room */
  @media (min-width: 1200px) { .services-grid { gap: 32px; } }
  
  /* Read-more accessibility */
  .read-more:focus-visible { outline: 2px solid var(--brand-teal); outline-offset: 2px; border-radius: 6px; }
  
  /* Reduced motion support */
  @media (prefers-reduced-motion: reduce) {
    .service-card, .card-more { transition: none !important; }
  }
  
  /* Variable-height mode when a card is expanded */
  .services-grid.grid-free { align-items: start; }
  .services-grid.grid-free .service-card { height: auto; }
  
  /* Typography harmonization */
  #unternehmen p, #unternehmen ul,
  #privatpersonen p, #privatpersonen ul,
  #ueber-mich p, #ueber-mich ul {
    max-width: 68ch;
    line-height: 1.75;
  }
  #unternehmen p, #privatpersonen p, #ueber-mich p { margin: 0.6rem 0; }
  #unternehmen ul, #privatpersonen ul, #ueber-mich ul { margin: 0.5rem 0 0.9rem; padding-left: 1.25rem; }
  #unternehmen li, #privatpersonen li, #ueber-mich li { margin: 0.25rem 0; }
  
  /* Contact form */
  .contact-form { max-width: 760px; margin: 0 auto; }
  .form-card { background: #ffffff; border: 1px solid #e9eef2; border-radius: 14px; padding: 24px; box-shadow: 0 12px 30px rgba(16,24,40,0.06); }
  .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .form-field { display: flex; flex-direction: column; gap: 6px; }
  .form-field label { font-weight: 600; color: #334155; font-size: 0.95rem; }
  .form-input, .form-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cfd8e3;
    border-radius: 10px;
    background: #fff;
    color: #0f172a;
    transition: border-color .2s ease, box-shadow .2s ease;
  }
  .form-input::placeholder, .form-textarea::placeholder { color: #94a3b8; }
  .form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--brand-teal);
    box-shadow: 0 0 0 4px rgba(68,192,183,0.18);
  }
  .form-actions { margin-top: 12px; display: flex; gap: 12px; justify-content: flex-end; }
  .btn-primary { background: var(--brand-coral); color: #fff; border: none; padding: 0.9rem 1.4rem; border-radius: 10px; font-weight: 600; cursor: pointer; }
  .btn-primary:hover { background: #B83E3A; transform: translateY(-1px); }
  @media (max-width: 768px) { .form-grid { grid-template-columns: 1fr; } }

  /* Alerts */
  .alert { 
    max-width: 760px; 
    margin: 0 auto 16px; 
    padding: 12px 14px; 
    border-radius: 10px; 
    border: 1px solid; 
  }
  .alert p { margin: 0; }
  .alert-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
  .alert-error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
  
  /* Responsive tweaks */
  @media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-toggle { display: inline-flex; }
    .hero-text h1 { font-size: 2.2rem; }
    .services-grid { gap: 20px; }
    .container { padding: 0 16px; }
    /* nudge quote a bit lower on narrow screens */
    .hero-text .quote { top: 60%; }
  }
  @media (max-width: 480px) {
    .hero-text .quote { top: 62%; }
  }
  
  /* Quote author */
  .quote-author {
    text-align: right;
    margin-top: 1rem;
    font-style: italic;
    color: var(--text-muted);
    font-size: 1.05rem;
  }
  .quote .quote-author { text-align: center; }
  
  /* Global quote styling */
  .quote {
    text-align: center;
    margin: 1rem auto 1.25rem;
    font-style: italic;
    font-size: 1.3rem;
    line-height: 1.8;
    max-width: 68ch;
    color: var(--text-primary);
  }
  .quote p { margin: 0; }
  @media (min-width: 1024px) {
    .quote { font-size: 1.4rem; }
  }
  
  /* Small logo helper */
  .mdv-logo { margin: 8px 0; }
  .mdv-logo img { width: 180px; max-width: 40vw; height: auto; display: block; }
  
  /* Footer */
  footer { background: var(--bg-header); border-top: 1px solid var(--border-soft); padding: 1.5rem 0; }
  footer .container { display: block; }
  footer p { margin: 0.25rem 0; text-align: center; }
  footer a { color: #ff6b35; text-decoration: none; }
  footer a:hover { text-decoration: underline; }
  
  /* Utility: page content offset for fixed header */
  .page-content { padding-top: 140px; }