/* =====================================================
   Root & Global Styles
   ===================================================== */

:root {
    /* Color Palette */
    --color-bg-primary: #FFFBF5;
    --color-bg-secondary: #FAF3EB;
    --color-neutral-light: #F0E4D4;
    --color-neutral-medium: #D4C4A8;
    --color-text-dark: #3D3526;
    --color-accent-blue: #5B6E8A;
    --color-accent-gold: #D4A853;
    --color-accent-sage: #A8B89C;

    /* Typography */
    --font-display: 'Nunito', sans-serif;
    --font-body: 'Karla', sans-serif;
    --font-mono: 'DM Mono', monospace;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
    --spacing-xl: 4rem;
    --spacing-2xl: 6rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--color-text-dark);
    background: var(--color-bg-primary);
    line-height: 1.75;
    position: relative;
    overflow-x: hidden;
}

/* =====================================================
   Blob Background Layer (Z: 0)
   ===================================================== */

.blob-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: var(--color-bg-primary);
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 1px,
        rgba(212, 196, 168, 0.06) 1px,
        rgba(212, 196, 168, 0.06) 2px
    );
    pointer-events: none;
}

/* Large background blobs */
.blob-background::before,
.blob-background::after {
    content: '';
    position: absolute;
    background: var(--color-neutral-light);
    opacity: 0.6;
    border-radius: 60% 40% 70% 30% / 50% 60% 40% 50%;
}

.blob-background::before {
    width: 500px;
    height: 500px;
    top: 10%;
    left: 5%;
    border-radius: 60% 40% 70% 30% / 50% 60% 40% 50%;
}

.blob-background::after {
    width: 450px;
    height: 450px;
    bottom: 15%;
    right: 8%;
    border-radius: 40% 60% 30% 70% / 60% 30% 70% 40%;
}

/* Accent blobs with low opacity */
.blob-accent-1 {
    position: fixed;
    width: 300px;
    height: 300px;
    background: var(--color-accent-gold);
    opacity: 0.2;
    border-radius: 50% 60% 40% 70% / 60% 40% 50% 40%;
    top: 40%;
    right: 10%;
    z-index: 1;
    pointer-events: none;
}

.blob-accent-2 {
    position: fixed;
    width: 250px;
    height: 250px;
    background: var(--color-accent-sage);
    opacity: 0.15;
    border-radius: 70% 30% 60% 40% / 40% 50% 60% 30%;
    bottom: 20%;
    left: 12%;
    z-index: 1;
    pointer-events: none;
}

/* =====================================================
   Accent Layer (Z: 2)
   ===================================================== */

.accent-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

/* Micro-parallax accent elements */
.accent-star {
    position: absolute;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, var(--color-accent-gold) 30%, transparent 70%);
    border-radius: 50%;
    opacity: 0.4;
}

/* =====================================================
   Content Layer (Z: 10)
   ===================================================== */

.content-layer {
    position: relative;
    z-index: 10;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-xl);
}

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

h1 {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5.5vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: var(--spacing-md);
}

h2 {
    font-family: var(--font-display);
    font-size: clamp(1.875rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
}

h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: var(--spacing-sm);
}

p {
    font-size: 1rem;
    font-weight: 400;
    margin-bottom: var(--spacing-md);
}

label, .metadata {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

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

@keyframes float-accent {
    0%, 100% {
        transform: translateY(0px);
        opacity: 0.3;
    }
    50% {
        transform: translateY(-20px);
        opacity: 0.6;
    }
}

@keyframes slide-in-left {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* =====================================================
   Draw Underline Animation
   ===================================================== */

.draw-underline {
    position: relative;
    text-decoration: none;
    color: var(--color-text-dark);
    display: inline-block;
}

.draw-underline::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-accent-gold);
    transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* Scrolling trigger for draw animation */
.draw-underline.in-view::after {
    width: 100%;
}

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

section {
    margin-bottom: var(--spacing-2xl);
    padding: var(--spacing-lg) 0;
}

.section-title {
    color: var(--color-text-dark);
    margin-bottom: var(--spacing-lg);
}

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

.hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(180deg, var(--color-bg-primary) 0%, var(--color-bg-secondary) 100%);
    border-radius: 24px;
    padding: var(--spacing-2xl);
    margin-bottom: var(--spacing-2xl);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
}

.hero-content {
    max-width: 700px;
}

.hero h1 {
    color: var(--color-text-dark);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--color-accent-blue);
    margin-bottom: var(--spacing-lg);
    font-weight: 500;
}

/* =====================================================
   Call-to-Action Button
   ===================================================== */

.cta-button {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--color-accent-gold);
    color: var(--color-bg-primary);
    border: none;
    border-radius: 12px;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.cta-button:hover {
    background: var(--color-accent-sage);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(212, 168, 83, 0.3);
}

.cta-button::after {
    bottom: -6px;
}

/* =====================================================
   About Section
   ===================================================== */

.about {
    background: rgba(240, 228, 212, 0.5);
    border-radius: 20px;
    padding: var(--spacing-2xl);
    border: 1px solid rgba(212, 168, 83, 0.2);
}

.about-content p {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--color-text-dark);
}

.about-content p:last-child {
    margin-bottom: 0;
}

/* =====================================================
   Services Grid
   ===================================================== */

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.service-card {
    background: var(--color-bg-secondary);
    border-radius: 16px;
    padding: var(--spacing-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(212, 168, 83, 0.15);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.1);
}

.service-card h3 {
    color: var(--color-accent-gold);
    margin-bottom: var(--spacing-md);
}

.service-card p {
    color: var(--color-text-dark);
    margin-bottom: 0;
}

/* =====================================================
   Portfolio Grid
   ===================================================== */

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.portfolio-item {
    border-radius: 16px;
    overflow: hidden;
    background: var(--color-bg-secondary);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.portfolio-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.1);
}

.portfolio-image {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
}

.portfolio-item h3 {
    color: var(--color-accent-gold);
    padding: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    margin-bottom: 0;
}

.portfolio-item p {
    padding: 0 var(--spacing-md) var(--spacing-md);
    color: var(--color-text-dark);
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* =====================================================
   Contact Section
   ===================================================== */

.contact {
    background: linear-gradient(135deg, var(--color-accent-blue) 0%, var(--color-accent-sage) 100%);
    border-radius: 20px;
    padding: var(--spacing-2xl);
    text-align: center;
    color: var(--color-bg-primary);
}

.contact h2 {
    color: var(--color-bg-primary);
}

.contact-content p {
    color: var(--color-bg-primary);
    font-size: 1.125rem;
    margin-bottom: var(--spacing-lg);
}

.contact .cta-button {
    background: var(--color-bg-primary);
    color: var(--color-accent-blue);
}

.contact .cta-button:hover {
    background: var(--color-bg-secondary);
}

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

.constellation-footer {
    background: var(--color-text-dark);
    color: var(--color-bg-primary);
    padding: var(--spacing-2xl) var(--spacing-xl);
    text-align: center;
    position: relative;
    margin-top: var(--spacing-2xl);
}

.constellation-pattern {
    display: flex;
    justify-content: center;
    margin-bottom: var(--spacing-xl);
}

.constellation-svg {
    width: 100%;
    max-width: 600px;
    height: auto;
}

.constellation-star {
    fill: var(--color-accent-gold);
    animation: twinkle 3.5s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.4;
    }
    50% {
        opacity: 1;
    }
}

.constellation-line {
    stroke: var(--color-accent-blue);
    stroke-width: 1px;
    opacity: 0.4;
}

.footer-content {
    z-index: 10;
    position: relative;
}

.footer-domain {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-accent-gold);
    margin-bottom: var(--spacing-sm);
}

.footer-tagline {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-accent-blue);
    margin-bottom: 0;
}

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

@media (max-width: 768px) {
    :root {
        --spacing-xl: 2rem;
        --spacing-2xl: 3rem;
    }

    .content-layer {
        padding: var(--spacing-md);
    }

    .hero {
        min-height: 60vh;
        padding: var(--spacing-lg);
    }

    .services-grid,
    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .blob-background::before {
        width: 300px;
        height: 300px;
    }

    .blob-background::after {
        width: 250px;
        height: 250px;
    }
}

@media (max-width: 480px) {
    .content-layer {
        padding: var(--spacing-sm);
    }

    .hero {
        min-height: 50vh;
        padding: var(--spacing-md);
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    .cta-button {
        padding: var(--spacing-xs) var(--spacing-md);
        font-size: 0.9rem;
    }
}
