/* ==========================================================================
   DAVI engineering - Design-System
   Farbwelt basierend auf dem Hexagon-Logo (Brauntöne)
   Inspiration: anthropic.com (Farbstimmung) + linear.app (Struktur)
   ========================================================================== */

:root {
    /* Farben - Brauntöne aus dem Logo */
    --color-bg:         #faf7f2;   /* Creme/Beige - Hintergrund */
    --color-bg-alt:     #f3ece0;   /* etwas wärmerer Block-Hintergrund */
    --color-bg-dark:    #2a211a;   /* Dunkles Braun für Kontrast-Sections */
    --color-primary:    #675849;   /* Hauptbraun */
    --color-accent:     #896a4f;   /* Akzent-Braun (Links, Hovers) */
    --color-accent-2:   #b8946a;   /* Helles Karamel */
    --color-text:       #2a211a;   /* Fliesstext fast schwarz */
    --color-text-muted: #6e6357;   /* Sekundärtext */
    --color-line:       #e3d8c4;   /* Linien und Ränder */

    /* Typographie */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;

    /* Spacing (8-Grid) */
    --s-1: 0.25rem;
    --s-2: 0.5rem;
    --s-3: 0.75rem;
    --s-4: 1rem;
    --s-6: 1.5rem;
    --s-8: 2rem;
    --s-12: 3rem;
    --s-16: 4rem;
    --s-24: 6rem;
    --s-32: 8rem;

    /* Layout */
    --max-width: 1200px;
    --radius: 4px;
    --radius-lg: 12px;

    /* Animation */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Reset / Base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 17px;
    line-height: 1.65;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--color-accent); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--color-primary); }

h1, h2, h3, h4 {
    font-family: var(--font-serif);
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--color-text);
    margin: 0 0 var(--s-4);
}
h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
h3 { font-size: 1.35rem; }

p { margin: 0 0 var(--s-4); }

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--s-6);
}

/* ==========================================================================
   Header / Navigation
   ========================================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(250, 247, 242, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-line);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 88px;
}

.nav__logo {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    transition: transform .2s var(--ease);
}
.nav__logo:hover { transform: scale(1.03); }
.nav__logo img {
    height: 52px;
    width: auto;
    image-rendering: -webkit-optimize-contrast;
}

.nav__menu {
    display: flex;
    align-items: center;
    gap: var(--s-8);
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav__menu a {
    color: var(--color-text);
    font-size: 0.95rem;
    font-weight: 500;
    transition: color .2s var(--ease);
}
.nav__menu a:hover { color: var(--color-accent); }

.nav__menu .nav__cta {
    background: var(--color-text);
    color: var(--color-bg);
    padding: var(--s-2) var(--s-4);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    transition: background .2s var(--ease), color .2s var(--ease);
}
.nav__menu .nav__cta:hover { background: var(--color-accent); color: var(--color-bg); }

.nav__burger {
    display: none;
    background: none;
    border: 0;
    padding: var(--s-2);
    cursor: pointer;
}
.nav__burger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    margin: 5px 0;
    transition: transform .2s var(--ease), opacity .2s;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
    position: relative;
    padding: var(--s-32) 0 var(--s-24);
    overflow: hidden;
}

.hero__inner {
    max-width: 820px;
}
.hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: var(--s-6);
    font-weight: 500;
}
.hero__eyebrow::before {
    content: '';
    width: 24px;
    height: 1px;
    background: var(--color-accent);
    display: inline-block;
}
.hero h1 {
    margin-bottom: var(--s-6);
}
.hero__lead {
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--color-text-muted);
    max-width: 640px;
    margin-bottom: var(--s-8);
}
.hero__actions {
    display: flex;
    gap: var(--s-4);
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    padding: var(--s-3) var(--s-6);
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    border: 0;
    transition: all .2s var(--ease);
    text-decoration: none;
}
.btn--primary {
    background: var(--color-text);
    color: var(--color-bg);
}
.btn--primary:hover { background: var(--color-accent); color: var(--color-bg); transform: translateY(-1px); }
.btn--ghost {
    background: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-line);
}
.btn--ghost:hover { border-color: var(--color-text); color: var(--color-text); }

/* Hexagon-Muster im Hero-Hintergrund */
.hero__hexagons {
    position: absolute;
    top: 0;
    right: -5%;
    width: 55%;
    height: 100%;
    opacity: 0.35;
    pointer-events: none;
    /* z-index entfernt — Container wird via .hero .container über das hexagons-Element gelegt */
}
.hero .container {
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   Sections
   ========================================================================== */

section {
    padding: var(--s-24) 0;
}
.section--alt {
    background: var(--color-bg-alt);
}
.section--dark {
    background: var(--color-bg-dark);
    color: var(--color-bg);
}
.section--dark h2, .section--dark h3 { color: var(--color-bg); }
.section--dark .section__eyebrow { color: var(--color-accent-2); }
.section--dark p { color: #d5cfc3; }

.section__head {
    max-width: 720px;
    margin-bottom: var(--s-12);
}
.section__eyebrow {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: var(--s-3);
    font-weight: 500;
}

/* ==========================================================================
   Leistungs-Grid (Hexagon-Icons als Aufzähler)
   ========================================================================== */

.services {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--s-8);
}

.service {
    padding: var(--s-8);
    background: var(--color-bg);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-lg);
    transition: transform .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.service:hover {
    transform: translateY(-4px);
    border-color: var(--color-accent);
    box-shadow: 0 12px 30px -12px rgba(137, 106, 79, 0.25);
}

.service__icon {
    width: 52px;
    height: 52px;
    margin-bottom: var(--s-6);
    color: var(--color-accent);
}
.service h3 {
    font-family: var(--font-sans);
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: var(--s-3);
}
.service p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    margin: 0;
}

.section--alt .service {
    background: var(--color-bg);
}

/* ==========================================================================
   Über-Sektion
   ========================================================================== */

.about {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s-16);
    align-items: start;
}
.about__lead {
    font-size: 1.35rem;
    line-height: 1.55;
    font-family: var(--font-serif);
    color: var(--color-text);
}
.about__facts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s-8);
}
.fact__number {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    font-weight: 500;
    color: var(--color-accent);
    line-height: 1;
    display: block;
    margin-bottom: var(--s-2);
}
.fact__label {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* ==========================================================================
   Referenzen
   ========================================================================== */

.refs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--s-6);
}

.ref {
    padding: var(--s-8);
    border-left: 3px solid var(--color-accent);
    background: var(--color-bg);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}
.ref__quote {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    line-height: 1.55;
    color: var(--color-text);
    margin-bottom: var(--s-4);
}
.ref__who {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}
.ref__name {
    color: var(--color-text);
    font-weight: 600;
    display: block;
}

.ref-logos {
    margin-top: var(--s-12);
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-8);
    align-items: center;
    justify-content: center;
    padding-top: var(--s-8);
    border-top: 1px solid var(--color-line);
}
.ref-logos__item {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    color: var(--color-text-muted);
    letter-spacing: 0.02em;
    opacity: 0.7;
    transition: opacity .2s var(--ease), color .2s var(--ease);
}
.ref-logos__item:hover { opacity: 1; color: var(--color-accent); }

/* ==========================================================================
   Kontakt / Formular
   ========================================================================== */

.contact {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: var(--s-16);
}
.contact__info p {
    color: #d5cfc3;
    margin-bottom: var(--s-2);
}
.contact__info strong { color: var(--color-bg); font-weight: 500; }
.contact__info a { color: var(--color-accent-2); }
.contact__info a:hover { color: var(--color-bg); }

.form {
    display: grid;
    gap: var(--s-4);
}
.form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s-4);
}
.form label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: var(--s-2);
    color: #d5cfc3;
    font-weight: 500;
}
.form input, .form textarea {
    width: 100%;
    padding: var(--s-3) var(--s-4);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius);
    color: var(--color-bg);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color .2s var(--ease), background .2s var(--ease);
}
.form input:focus, .form textarea:focus {
    outline: 0;
    border-color: var(--color-accent-2);
    background: rgba(255,255,255,0.10);
}
.form textarea { resize: vertical; min-height: 140px; }

.form__hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.form__msg {
    padding: var(--s-4);
    border-radius: var(--radius);
    display: none;
}
.form__msg--ok { background: rgba(184,148,106,0.2); color: var(--color-accent-2); display: block; }
.form__msg--err { background: rgba(220,80,80,0.15); color: #f3b0b0; display: block; }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    padding: var(--s-12) 0 var(--s-8);
    background: #1e1813;
    color: #9a8e7f;
    font-size: 0.9rem;
}
.site-footer__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--s-4);
}
.site-footer a {
    color: #b8a690;
}
.site-footer a:hover { color: var(--color-bg); }
.site-footer__links {
    display: flex;
    gap: var(--s-6);
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
    .about { grid-template-columns: 1fr; gap: var(--s-8); }
    .contact { grid-template-columns: 1fr; gap: var(--s-8); }
    section { padding: var(--s-16) 0; }
    .hero { padding: var(--s-16) 0 var(--s-12); }
}

@media (max-width: 640px) {
    body { font-size: 16px; }
    .nav__menu { display: none; }
    .nav__menu.is-open {
        display: flex;
        position: absolute;
        top: 88px;
        left: 0;
        right: 0;
        background: var(--color-bg);
        flex-direction: column;
        padding: var(--s-6);
        gap: var(--s-4);
        border-bottom: 1px solid var(--color-line);
    }
    .nav { height: 72px; }
    .nav__logo img { height: 42px; }
    .nav__burger { display: block; }
    .nav__cta { display: none; }
    .form__row { grid-template-columns: 1fr; }
    .hero__hexagons { opacity: 0.15; width: 90%; right: -15%; }
    .about__facts { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Animationen — dezent, GPU-optimiert (transform/opacity)
   Respektiert prefers-reduced-motion
   ========================================================================== */

/* Scroll-Reveal: kommt sanft nach oben rein, sobald sichtbar */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .6s var(--ease), transform .6s var(--ease);
    will-change: opacity, transform;
}
.reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* Stagger: Kinder-Elemente erscheinen leicht zeitversetzt */
.reveal-stagger > * {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.reveal-stagger.is-visible > * {
    opacity: 1;
    transform: none;
}
.reveal-stagger.is-visible > *:nth-child(1) { transition-delay:   0ms; }
.reveal-stagger.is-visible > *:nth-child(2) { transition-delay:  80ms; }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 160ms; }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 240ms; }

/* Hero-Hexagons: weiches Parallax. JS setzt nur die CSS-Variable --parallax-y,
   das transform existiert schon im CSS. So bleibt das Compositing-Layer stabil
   (Firefox-Fix) und das Element wird nicht bei jedem Update neu komponiert. */
.hero__hexagons {
    will-change: transform;
    transform: translate3d(0, var(--parallax-y, 0px), 0);
    backface-visibility: hidden;
    transition: transform .15s linear;
}

/* Buttons: leichter Hover-Lift */
.btn {
    transition: background .2s var(--ease),
                color      .2s var(--ease),
                transform  .15s var(--ease),
                box-shadow .2s var(--ease);
}
.btn:hover {
    transform: translateY(-1px);
}
.btn--primary:hover {
    box-shadow: 0 6px 16px -8px rgba(42, 33, 26, 0.35);
}

/* Eyebrow-Akzentlinie: wächst beim Reveal von links nach rechts */
.section__eyebrow::before {
    content: '';
    width: 24px;
    height: 1px;
    background: currentColor;
    flex-shrink: 0;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform .55s var(--ease) .15s;
}
.hero__eyebrow::before {
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform .55s var(--ease) .15s;
}
.hero__eyebrow.is-visible::before,
.section__head.is-visible .section__eyebrow::before {
    transform: scaleX(1);
}

/* Reduced-Motion: alles deaktivieren */
@media (prefers-reduced-motion: reduce) {
    .section__eyebrow::before,
    .hero__eyebrow::before {
        transform: scaleX(1) !important;
        transition: none !important;
    }
    .reveal,
    .reveal-stagger > *,
    .hero__hexagons,
    .btn,
    .service,
    .ref-logos__item {
        transition: none !important;
        animation: none !important;
        transform: none !important;
        opacity: 1 !important;
    }
}
