/* =========================================================================
   Pur Digital – Stylesheet
   Branding: Primär #520298 (Violett), Akzent #C9A227 (Gold),
             Dunkelgrau, Hellgrau. Cookiefrei, lokale Fonts.
   ========================================================================= */

/* ---------- Design-Tokens ---------- */
:root {
    --violet:        #520298;
    --violet-light:  #7b2fc4;
    --violet-dark:   #3a016b;
    --accent:        #c9a227;   /* edles Gold */
    --accent-light:  #e0bd45;

    --ink:           #1d1b22;   /* Dunkelgrau (Text/Headlines) */
    --ink-soft:      #4b4754;
    --grey:          #6c6878;
    --line:          #e7e4ee;
    --bg:            #ffffff;
    --bg-soft:       #f6f4fb;   /* sehr helles Violett-Grau */
    --bg-dark:       #161320;

    /* Flächen-Tokens – steuern Header, Karten, Formularfelder usw.
       Werden im Dark Mode überschrieben, damit der Umschalter überall greift. */
    --surface:       #ffffff;   /* Karten, Formular, Cookie-Hinweis */
    --field-bg:      #ffffff;   /* Eingabefelder */
    --header-bg:     rgba(255, 255, 255, .82);
    --nav-mobile-bg: #ffffff;
    --accent-brand:  var(--violet);  /* Farbe für „Digital" im Logo / Markenakzente */
    --shadow-color:  rgba(40, 6, 80, .35);

    --radius:        16px;
    --radius-sm:     10px;
    --shadow:        0 18px 40px -18px rgba(40, 6, 80, .35);
    --shadow-soft:   0 8px 24px -12px rgba(40, 6, 80, .25);

    --maxw:          1140px;
    --header-h:      128px;

    --font:          'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* ---------- Reset / Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.15; color: var(--ink); font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.6rem); margin: 0 0 .6rem; }
h3 { font-size: 1.25rem; margin: 0 0 .5rem; }
p  { margin: 0 0 1rem; color: var(--ink-soft); }
a  { color: var(--violet); text-decoration: none; }
a:hover { color: var(--violet-light); }
img, svg { max-width: 100%; }
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 22px; }
.accent { color: var(--accent); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: .5rem; padding: .85rem 1.6rem; border-radius: 999px;
    font-weight: 600; font-size: .98rem; cursor: pointer;
    border: 1px solid transparent; transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
    will-change: transform;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
    background: linear-gradient(135deg, var(--violet) 0%, var(--violet-light) 100%);
    color: #fff; box-shadow: var(--shadow-soft);
}
.btn-primary:hover { color: #fff; transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-ghost { background: transparent; color: var(--violet); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--violet); background: var(--bg-soft); }
.btn-block { width: 100%; }
.btn-small { padding: .5rem 1rem; font-size: .85rem; }

/* ---------- Header ---------- */
.site-header {
    position: fixed; inset: 0 0 auto 0; height: var(--header-h); z-index: 100;
    display: flex; align-items: center;
    background: var(--header-bg);
    backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid transparent; transition: border-color .25s, box-shadow .25s;
}
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 20px -16px rgba(0,0,0,.4); }
.header-inner { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.header-right { display: flex; align-items: center; gap: 1.4rem; }
.brand { font-weight: 800; font-size: 1.35rem; letter-spacing: -.03em; display: inline-flex; align-items: center; }
.brand-logo { height: 110px; width: auto; display: block;margin-top:60px; }
.brand-mark { color: var(--ink); }
.brand-mark-accent { color: var(--accent-brand); }
.primary-nav { display: flex; align-items: center; gap: 1.8rem; }
.primary-nav a { color: var(--ink-soft); font-weight: 500; }
.primary-nav a:hover { color: var(--violet); }
.primary-nav .nav-cta {
    background: var(--violet); color: #fff; padding: .55rem 1.2rem; border-radius: 999px;
}
.primary-nav .nav-cta:hover { background: var(--violet-light); color: #fff; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: .25s; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; overflow: hidden; color: #fff; }
.hero-bg {
    position: absolute; inset: 0; z-index: -1;
    background:
        radial-gradient(120% 90% at 80% 10%, rgba(201,162,39,.20), transparent 55%),
        linear-gradient(135deg, var(--violet-dark) 0%, var(--violet) 55%, #2c0150 100%);
}
.hero-bg::after {
    content: ""; position: absolute; inset: 0;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(255,255,255,.08) 0, transparent 35%),
        radial-gradient(circle at 90% 60%, rgba(255,255,255,.06) 0, transparent 30%);
}
.hero-inner { padding-top: calc(var(--header-h) + 4vh); padding-bottom: 8vh; max-width: 820px; }
.hero-eyebrow { color: var(--accent-light); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; font-size: .85rem; margin-bottom: 1rem; }
.hero-title { font-size: clamp(2.2rem, 6vw, 4rem); color: #fff; margin: 0 0 1.2rem; }
.hero-sub { font-size: clamp(1.05rem, 2vw, 1.3rem); color: rgba(255,255,255,.85); max-width: 640px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }
.hero .btn-ghost { color: #fff; border-color: rgba(255,255,255,.4); }
.hero .btn-ghost:hover { background: rgba(255,255,255,.1); border-color: #fff; }
.scroll-cue { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); width: 26px; height: 42px; border: 2px solid rgba(255,255,255,.5); border-radius: 14px; }
.scroll-cue span { position: absolute; top: 8px; left: 50%; width: 4px; height: 8px; margin-left: -2px; background: #fff; border-radius: 2px; animation: scrollcue 1.6s infinite; }
@keyframes scrollcue { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 80% { opacity: 0; transform: translateY(14px); } 100% { opacity: 0; } }

/* ---------- Sektionen ---------- */
.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.section-head { max-width: 680px; margin: 0 auto 3rem; text-align: center; }
.section-eyebrow { color: var(--accent); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .8rem; margin-bottom: .5rem; }
.section-lead { font-size: 1.1rem; color: var(--grey); }
.leistungen { background: var(--bg-soft); }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 2rem 1.7rem; transition: transform .25s ease, box-shadow .25s ease, border-color .25s;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: transparent; }
.card-icon {
    width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center;
    background: linear-gradient(135deg, rgba(82,2,152,.12), rgba(201,162,39,.14));
    color: var(--violet); margin-bottom: 1.1rem;
}
.card-icon svg { width: 28px; height: 28px; }
.card p { margin: 0; color: var(--grey); }

/* ---------- Über uns ---------- */
.ueber-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 3rem; align-items: center; }
.value-list { list-style: none; padding: 0; margin: 1.5rem 0 2rem; display: grid; gap: 1rem; }
.value-list li { position: relative; padding-left: 1.8rem; color: var(--ink-soft); }
.value-list li::before { content: ""; position: absolute; left: 0; top: .55em; width: 10px; height: 10px; border-radius: 3px; background: var(--accent); }
.ueber-visual { display: grid; gap: 1rem; }
.stat { background: linear-gradient(135deg, var(--violet) 0%, var(--violet-light) 100%); color: #fff; border-radius: var(--radius); padding: 1.6rem 1.8rem; box-shadow: var(--shadow-soft); }
.stat:nth-child(2) { background: linear-gradient(135deg, #2a2730, var(--ink)); }
.stat:nth-child(3) { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%); color: var(--ink); }
.stat-num { display: block; font-size: 2rem; font-weight: 800; letter-spacing: -.02em; }
.stat-label { opacity: .9; font-size: .95rem; }

/* ---------- Kontakt ---------- */
.kontakt { background: var(--bg-soft); }
.kontakt-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 3rem; align-items: start; }
.contact-meta { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .6rem; color: var(--ink-soft); }
.contact-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow-soft); }
.form-row { margin-bottom: 1.1rem; display: grid; gap: .4rem; }
.form-row label { font-weight: 600; font-size: .92rem; color: var(--ink); }
.form-row input, .form-row textarea {
    width: 100%; padding: .8rem .9rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
    font: inherit; color: var(--ink); background: var(--field-bg); transition: border-color .2s, box-shadow .2s;
}
.form-row input:focus, .form-row textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(82,2,152,.12); }
.form-row textarea { resize: vertical; }
.form-consent label { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; font-size: .9rem; color: var(--ink-soft); }
.form-consent input { width: auto; margin-top: .25rem; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-feedback { margin: 1rem 0 0; font-weight: 600; min-height: 1.2em; }
.form-feedback.ok { color: #1a7f4b; }
.form-feedback.err { color: #c0392b; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-dark); color: rgba(255,255,255,.78); padding: 3.5rem 0 0; }
.footer-inner { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 2rem; padding-bottom: 2.5rem; }
.footer-logo { height: 48px; width: auto; display: block; }
.footer-brand p { color: rgba(255,255,255,.6); margin-top: .8rem; max-width: 320px; }
.footer-links { display: grid; gap: .6rem; align-content: start; }
.footer-links a, .footer-social a { color: rgba(255,255,255,.78); }
.footer-links a:hover, .footer-social a:hover { color: var(--accent-light); }
.footer-social { display: flex; gap: 1rem; align-content: start; }
.footer-social a { width: 40px; height: 40px; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 700; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 1.2rem 0; }
.footer-bottom small { color: rgba(255,255,255,.5); }

/* ---------- Cookie-Hinweis ---------- */
.cookie-note {
    position: fixed; bottom: 18px; left: 18px; right: 18px; max-width: 440px; z-index: 200;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 1.2rem 1.3rem;
}
.cookie-note p { font-size: .88rem; margin: 0 0 .8rem; }
.cookie-note[hidden] { display: none; }

/* ---------- Rechts-Seiten (Impressum/Datenschutz) ---------- */
.legal { padding-top: calc(var(--header-h) + 3rem); padding-bottom: 4rem; }
.legal .container { max-width: 820px; }
.legal h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 1.5rem; }
.legal h2 { font-size: 1.3rem; margin-top: 2rem; }
.legal .placeholder { background: #fff7e6; border: 1px dashed var(--accent); border-radius: var(--radius-sm); padding: .2rem .5rem; font-weight: 600; color: #8a6d12; }

/* ---------- Scroll-Reveal-Animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    html { scroll-behavior: auto; }
    .scroll-cue span { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .cards { grid-template-columns: repeat(2, 1fr); }
    .ueber-grid, .kontakt-grid { grid-template-columns: 1fr; }
    .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
    :root { --header-h: 84px; }
    .nav-toggle { display: flex; }
    .brand-logo { height: 64px; }
    .primary-nav {
        position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; gap: 0;
        background: var(--nav-mobile-bg); border-bottom: 1px solid var(--line);
        max-height: 0; overflow: hidden; transition: max-height .3s ease; box-shadow: var(--shadow-soft);
    }
    .primary-nav.open { max-height: 320px; }
    .primary-nav a { width: 100%; padding: 1rem 22px; border-top: 1px solid var(--line); }
    .primary-nav .nav-cta { border-radius: 0; }
    .cards { grid-template-columns: 1fr; }
    .footer-inner { grid-template-columns: 1fr; }
    .nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-toggle.open span:nth-child(2) { opacity: 0; }
    .nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* =========================================================================
   DARK MODE
   - Folgt automatisch der System-Einstellung (prefers-color-scheme),
     solange der Nutzer nicht aktiv "hell" gewählt hat.
   - Manuelle Wahl per data-theme-Attribut (gesetzt durch main.js).
   Die dunklen Werte stehen in beiden Selektoren (identisch).
   ========================================================================= */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --ink:           #eceaf1;
        --ink-soft:      #c4c0cf;
        --grey:          #9a95a8;
        --line:          #2c2838;
        --bg:            #131019;
        --bg-soft:       #1b1825;
        --bg-dark:       #100d17;
        --surface:       #211d2c;
        --field-bg:      #1a1724;
        --header-bg:     rgba(19, 16, 25, .85);
        --nav-mobile-bg: #1b1825;
        --accent-brand:  #b389e8;
        --shadow:        0 18px 40px -18px rgba(0, 0, 0, .6);
        --shadow-soft:   0 8px 24px -12px rgba(0, 0, 0, .5);
    }
}
:root[data-theme="dark"] {
    --ink:           #eceaf1;
    --ink-soft:      #c4c0cf;
    --grey:          #9a95a8;
    --line:          #2c2838;
    --bg:            #131019;
    --bg-soft:       #1b1825;
    --bg-dark:       #100d17;
    --surface:       #211d2c;
    --field-bg:      #1a1724;
    --header-bg:     rgba(19, 16, 25, .85);
    --nav-mobile-bg: #1b1825;
    --accent-brand:  #b389e8;
    --shadow:        0 18px 40px -18px rgba(0, 0, 0, .6);
    --shadow-soft:   0 8px 24px -12px rgba(0, 0, 0, .5);
}

/* Sanfter Übergang beim Umschalten (nicht für Nutzer mit reduzierter Bewegung). */
@media (prefers-reduced-motion: no-preference) {
    body, .site-header, .card, .contact-form, .form-row input, .form-row textarea, .cookie-note {
        transition: background-color .3s ease, color .3s ease, border-color .3s ease;
    }
}

/* ---------- Theme-Umschalter (Sonne/Mond) ---------- */
.theme-toggle {
    display: inline-grid; place-items: center;
    width: 40px; height: 40px; margin-left: .4rem;
    border: 1px solid var(--line); border-radius: 50%;
    background: transparent; color: var(--ink-soft); cursor: pointer;
    transition: color .2s, border-color .2s, background .2s;
}
.theme-toggle:hover { color: var(--violet); border-color: var(--violet); }
.theme-toggle svg { width: 20px; height: 20px; }
/* Im Hellmodus Mond zeigen (= "zu Dunkel wechseln"), im Dunkelmodus Sonne. */
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .icon-sun  { display: block; }
    :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}
/* Im Hero (heller Text auf Violett) den Toggle hell darstellen, solange der
   Header noch transparent über dem Hero liegt. */
.site-header:not(.scrolled) .theme-toggle { color: rgba(255,255,255,.85); border-color: rgba(255,255,255,.35); }
.site-header:not(.scrolled) .theme-toggle:hover { color: #fff; border-color: #fff; }
