body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    color: #000;
    display: flex;
    flex-direction: column;
    font-family: 'Poppins', sans-serif;
    background-color: #fffeef;
}

/* Header & Navigation */
:root{
  --logo-h: 90px; /* anpassen falls Logo anders */
  --nav-gap: 16px;
}

header {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 11000; /* höher als .top-nav */
    height: var(--logo-h);
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.logo img {
    height: var(--logo-h);
    max-width: 40vw;
    width: auto;
    object-fit: contain;
}

.top-nav {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    top: calc(var(--logo-h) + var(--nav-gap));
    z-index: 10900; /* kleiner als header */
    width: 95%;
    max-width: 920px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    background: rgba(255,255,255,0.95);
    padding: 8px 12px;
    border-radius: 40px;
}

.top-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 30px;
    align-items: center;
}

.top-nav ul li a {
    text-decoration: none;
    color: #000;
    font-weight: bold;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    padding: 8px 16px;
    border-radius: 25px;
}

.top-nav ul li a:hover {
    background: #d1d1d1;
    color: #fff;
}

.top-nav ul li.separator {
    color: #a4cede;
    font-size: 0.8rem;
}

/* Main Content */
main {
    margin-top: calc(var(--logo-h) + 96px);
    flex: 1;
}

.services-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    text-align: center; /* <-- added: centers inline content and helps h1 centering */
}

h1 {
    color: #000;
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.5rem;
    animation: fadeIn 1s ease-out;
}

/* ==== Page animations (like startpage) ==== */

/* Animated gradient headline + underline */
.services-section h1 {
    /* keep existing appearance but make it animated */
    background: linear-gradient(90deg, #000 0%, #000 45%, #000 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: block;           /* <-- changed from inline-block */
    margin: 0 auto 48px;         /* <-- added: centers the h1 element */
    animation: h1-entrance 700ms cubic-bezier(.2,.9,.3,1) both,
               h1-grad-shift 6s linear infinite;
    position: relative;
}

/* decorative underline that grows */
.services-section h1::after {
    content: "";
    display: block;
    height: 6px;
    width: 0%;
    background: #000;
    border-radius: 6px;
    margin: 12px auto 0;
    animation: underline-grow 700ms 220ms cubic-bezier(.2,.9,.3,1) forwards;
}

/* Card entrance + stagger */
.service-card {
    position: relative; /* needed for ::before badge */
    transform: translateY(18px) scale(.995);
    opacity: 0;
    animation: card-pop 620ms cubic-bezier(.2,.9,.3,1) forwards;
    will-change: transform, opacity;
}

/* stagger delays */
.service-card:nth-child(1) { animation-delay: 260ms; }
.service-card:nth-child(2) { animation-delay: 420ms; }
.service-card:nth-child(3) { animation-delay: 580ms; }

/* small accent badge (grows) */
.service-card::before {
    content: "";
    position: absolute;
    top: 18px;
    left: 20px;
    width: 44px;
    height: 6px;
    background: #000;
    border-radius: 6px;
    transform-origin: left center;
    opacity: 0;
    transform: scaleX(0);
    animation: badge-pop 520ms 480ms cubic-bezier(.2,.9,.3,1) forwards;
}

/* keyframes */
@keyframes h1-entrance {
    from { opacity: 0; transform: translateY(12px) scale(.995); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes h1-grad-shift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes underline-grow {
    from { width: 0%; opacity: 0; }
    to   { width: 48%; opacity: 1; }
}
@keyframes card-pop {
    from { opacity: 0; transform: translateY(18px) scale(.995); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes badge-pop {
    from { transform: scaleX(0); opacity: 0; }
    to   { transform: scaleX(1); opacity: 1; }
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .services-section h1,
    .services-section h1::after,
    .service-card,
    .service-card::before {
        animation: none !important;
        transition: none !important;
    }
    .services-section h1 { color: #000; -webkit-background-clip: unset; background: none; }
}

/* ==== end animations ==== */

.services-grid {
    margin-top: 8px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 20px;
}

.service-card {
    background: #ffffff; /* changed to white */
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    border: 1px solid rgba(26,52,116,0.10); /* subtle border */
    box-shadow: 0 10px 24px rgba(26,52,116,0.06); /* soft shadow */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(26,52,116,0.09);
}

.service-card h2 {
    color: #1a3474;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.service-card p {
    color: #333;
    line-height: 1.6;
}

.service-icon {
    margin-bottom: 20px;
}

.service-icon svg {
    width: 64px;
    height: 64px;
    transition: transform 0.3s ease;
}

.service-card:hover .service-icon svg {
    transform: scale(1.1);
}

/* Footer */
footer {
    position: relative;
    width: 100%;
    padding: 20px 0;
    background: rgba(255, 255, 255, 0.95);
    margin-top: 40px;
}

footer ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

footer ul li a {
    color: #000;
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s ease;
}

footer ul li a:hover {
    color: #a4cede;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translate(-50%, -100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media screen and (max-width: 1024px) {
    :root{ --logo-h:80px; }
    main{ margin-top: calc(var(--logo-h) + 90px); }
}

@media screen and (max-width: 900px) {
  header {
    position: relative;
    top: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 15px;
    z-index: 50;
  }

  .logo img {
    max-height: 90px;
    width: auto;
  }

  .top-nav {
    position: relative;
    top: 0;
    left: 0;
    transform: none;
    margin-top: 10px;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 20px;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  }

  .top-nav ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }
}


@media screen and (max-width: 768px) {
    :root{ --logo-h:72px; }
    .top-nav{ top: calc(var(--logo-h) + 12px); }
    main{ margin-top: calc(var(--logo-h) + 82px); }

    .logo img {
        max-height: 100px;
    }

    .top-nav {
        padding: 12px 25px;
        width: 90%;
    }

    .top-nav ul {
        gap: 15px;
    }

    .top-nav ul li a {
        font-size: 1rem;
        padding: 6px 12px;
    }

    main {
        margin-top: 160px;
    }

    .services-section {
        padding: 15px;
    }

    h1 {
        font-size: 2rem;
        margin-bottom: 30px;
    }

    .service-icon svg {
        width: 56px;
        height: 56px;
    }
}

@media screen and (max-width: 480px) {
    :root{ --logo-h:56px; }
    header{ right:8px; }
    .top-nav{ top: calc(var(--logo-h) + 10px); padding:6px 8px; border-radius:32px; }
    main{ margin-top: calc(var(--logo-h) + 72px); }

    .logo img {
        max-height: 80px;
    }

    .top-nav {
        padding: 8px 15px;
        top: 30px;
    }

    .top-nav ul {
        gap: 10px;
    }

    .top-nav ul li a {
        font-size: 0.9rem;
        padding: 5px 10px;
    }

    main {
        /* margin-top: 130px; */
        margin-top: clamp(120px, 20vh, 220px);
    }

    h1 {
        font-size: 1.8rem;
        margin-bottom: 25px;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 10px;
    }

    .service-card {
        padding: 20px;
    }

    .service-card h2 {
        font-size: 1.3rem;
    }

    .service-icon svg {
        width: 48px;
        height: 48px;
    }
}

/* Override: center first h1 and force black for texts & animated parts */
.services-section h1 {
  color: #000 !important;
  text-align: center !important; /* ensure centered */
}

/* animated underline (h1) -> black */
.services-section h1::after {
  background: #000 !important;
}

/* animated badge on cards -> black */
.service-card::before {
  background: #000 !important;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12) !important;
}

/* make general text black */
body,
.services-section h1,
.service-card h2,
.service-card p,
.top-nav ul li a,
footer ul li a {
  color: #000 !important;
}

/* icons: fill/stroke -> black */
.service-icon svg,
.service-icon svg * {
  fill: #000 !important;
  stroke: #000 !important;
  color: #000 !important;
}

/* ensure animated gradients fallback to black where applied */
@keyframes h1-grad-shift { /* keep animation but ensure visible on black text fallback */ }

/* respect reduced motion (no change) */
@media (prefers-reduced-motion: reduce) {
  .services-section h1,
  .services-section h1::after,
  .service-card,
  .service-card::before {
    animation: none !important;
    transition: none !important;
  }
}