/* ============================================
   PC Delta GmbH - Custom Styles
   Refined Editorial Minimalism
   ============================================ */

/* Base & Reset */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Prevent text overflow on mobile */
h1, h2, h3, p, span, a, li {
    word-wrap: break-word;
    overflow-wrap: break-word;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
    hyphens: auto;
}

/* Selection styling */
::selection {
    background-color: #8B7355;
    color: #FAFAF8;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #F5F5F0;
}

::-webkit-scrollbar-thumb {
    background: #A8A898;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #8B8B78;
}

/* ============================================
   Animations
   ============================================ */

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

/* Fade in up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade in down */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide in from left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slow bounce for scroll indicator */
@keyframes bounceSlow {
    0%, 100% {
        transform: translateY(0) translateX(-50%);
    }
    50% {
        transform: translateY(8px) translateX(-50%);
    }
}

/* Line grow */
@keyframes lineGrow {
    from {
        width: 0;
    }
    to {
        width: 48px;
    }
}

/* Animation classes */
.animate-fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

.animate-fade-in-down {
    animation: fadeInDown 0.6s ease-out forwards;
}

.animate-slide-in-left {
    animation: slideInLeft 0.6s ease-out forwards;
}

.animate-bounce-slow {
    animation: bounceSlow 2s ease-in-out infinite;
}

/* Animation delays */
.animation-delay-100 {
    animation-delay: 0.1s;
}

.animation-delay-200 {
    animation-delay: 0.2s;
}

.animation-delay-300 {
    animation-delay: 0.3s;
}

.animation-delay-400 {
    animation-delay: 0.4s;
}

.animation-delay-500 {
    animation-delay: 0.5s;
}

.animation-delay-600 {
    animation-delay: 0.6s;
}

/* Initial state for animated elements */
.animate-fade-in,
.animate-fade-in-up,
.animate-slide-in-left {
    opacity: 0;
}

/* ============================================
   Scroll-triggered animations
   ============================================ */

.service-card,
.value-card,
.client-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.service-card.visible,
.value-card.visible,
.client-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animation for service cards */
.service-card:nth-child(1) { transition-delay: 0s; }
.service-card:nth-child(2) { transition-delay: 0.15s; }
.service-card:nth-child(3) { transition-delay: 0.3s; }

/* Stagger for value cards */
.value-card:nth-child(1) { transition-delay: 0s; }
.value-card:nth-child(2) { transition-delay: 0.1s; }
.value-card:nth-child(3) { transition-delay: 0.2s; }
.value-card:nth-child(4) { transition-delay: 0.3s; }

/* Stagger for client items */
.client-item:nth-child(1) { transition-delay: 0s; }
.client-item:nth-child(2) { transition-delay: 0.08s; }
.client-item:nth-child(3) { transition-delay: 0.16s; }
.client-item:nth-child(4) { transition-delay: 0.24s; }
.client-item:nth-child(5) { transition-delay: 0.32s; }

/* ============================================
   Typography enhancements
   ============================================ */

/* Elegant text rendering for serif headings */
.font-serif {
    font-feature-settings: "kern" 1, "liga" 1;
    text-rendering: optimizeLegibility;
}

/* Letter spacing for small caps */
.tracking-widest {
    letter-spacing: 0.15em;
}

/* ============================================
   Interactive elements
   ============================================ */

/* Links with underline animation */
.link-underline {
    position: relative;
    display: inline-block;
}

.link-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: currentColor;
    transition: width 0.3s ease;
}

.link-underline:hover::after {
    width: 100%;
}

/* Button hover effects */
a[href]:not(.no-effect),
button:not(.no-effect) {
    transition: all 0.3s ease;
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #8B7355;
    outline-offset: 3px;
}

/* ============================================
   Layout utilities
   ============================================ */

/* Decorative line before section headers */
.section-line {
    width: 48px;
    height: 1px;
    background-color: #8B7355;
}

/* Card hover effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

/* Border accent on hover */
.hover-border-accent {
    transition: border-color 0.3s ease;
}

.hover-border-accent:hover {
    border-color: #8B7355;
}

/* ============================================
   Icons
   ============================================ */

/* Ensure Lucide icons scale properly */
[data-lucide] {
    display: inline-block;
    vertical-align: middle;
}

/* Icon in button - slight adjustment */
a [data-lucide],
button [data-lucide] {
    flex-shrink: 0;
}

/* ============================================
   Mobile menu styles
   ============================================ */

#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

#mobile-menu.open {
    max-height: 300px;
}

#mobile-menu:not(.hidden) {
    max-height: 300px;
}

/* ============================================
   Geometric decorations
   ============================================ */

/* Subtle rotating decoration */
@keyframes subtleRotate {
    from {
        transform: rotate(12deg);
    }
    to {
        transform: rotate(15deg);
    }
}

.geometric-decoration {
    animation: subtleRotate 20s ease-in-out infinite alternate;
}

/* ============================================
   Page transitions
   ============================================ */

.page-enter {
    opacity: 0;
}

.page-enter-active {
    opacity: 1;
    transition: opacity 0.4s ease;
}

/* ============================================
   Print styles
   ============================================ */

@media print {
    header,
    footer,
    .no-print {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }

    a {
        text-decoration: underline;
        color: #000;
    }
}

/* ============================================
   Reduced motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* ============================================
   404 & Error page styles
   ============================================ */

.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-code {
    font-size: 8rem;
    font-weight: 500;
    line-height: 1;
    color: #E8E8E0;
}

@media (min-width: 768px) {
    .error-code {
        font-size: 12rem;
    }
}

/* ============================================
   Impressum / Legal page styles
   ============================================ */

.legal-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 8rem 1.5rem 4rem;
}

.legal-content h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

.legal-content h2 {
    font-size: 1.5rem;
    margin-top: 3rem;
    margin-bottom: 1rem;
    padding-top: 2rem;
    border-top: 1px solid #E8E8E0;
}

.legal-content h2:first-of-type {
    border-top: none;
    padding-top: 0;
}

.legal-content p {
    margin-bottom: 1rem;
    line-height: 1.75;
    color: #4A4A3C;
}

.legal-content ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.legal-content li {
    margin-bottom: 0.5rem;
    color: #4A4A3C;
}

.legal-content a {
    color: #8B7355;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.legal-content a:hover {
    color: #6B5540;
}
