:root {
    /* Palette - Coffee Theme */
    --color-coffee-dark: #3b2f2f; /* Dark Roast - Replaces Charcoal */
    --color-coffee-medium: #6F4E37; /* Medium Roast */
    --color-cream: #F5E8C7; /* Light Roast/Foam */
    --color-gold: #D4A574; /* Caramel/Gold Accent */
    --color-teal: #1D7874; /* Deep Teal Accent - Optimized for contrast */
    --color-orange: #E76F51; /* Warm Orange/Terracotta */
    
    /* Semantic Colors - Light Mode Default */
    --bg-body: var(--color-cream);
    --text-body: var(--color-coffee-dark);
    --bg-surface: color-mix(in srgb, var(--color-cream), white 40%);
    --color-primary: var(--color-teal); /* Replaces Electric Blue */
    --color-secondary: var(--color-gold);
    
    --border-subtle: color-mix(in srgb, var(--color-coffee-medium), transparent 85%);
    --shadow-soft: 0 4px 20px -2px color-mix(in srgb, var(--color-coffee-dark), transparent 90%);
    
    /* Typography */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    
    /* BS Overrides */
    --bs-body-bg: var(--bg-body);
    --bs-body-color: var(--text-body);
    --bs-primary: var(--color-primary);
    --bs-primary-rgb: 42, 157, 143; /* RGB of Teal */
}

@media (prefers-color-scheme: dark) {
    :root {
        /* Semantic Colors - Dark Mode */
        --bg-body: var(--color-coffee-dark);
        --text-body: var(--color-cream);
        --bg-surface: color-mix(in srgb, var(--color-coffee-dark), black 20%);
        --border-subtle: color-mix(in srgb, var(--color-cream), transparent 85%);
        --shadow-soft: 0 4px 20px -2px black;
        
        /* BS Overrides */
        --bs-body-bg: var(--bg-body);
        --bs-body-color: var(--text-body);
        --bs-dark: #1f1a17;
    }
}

/* Global Reset & Base */
body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    transition: text-decoration-color 0.2s;
    
    &:hover {
        text-decoration: underline;
        text-decoration-thickness: 2px;
        text-underline-offset: 4px;
    }
}

/* Typography Enhancements */
h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    letter-spacing: -0.03em;
    color: currentColor;
    margin-bottom: 1rem;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.1;
}

h2 {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    margin-top: 3rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-secondary);
    display: inline-block;
}

/* Header */
header {
    background-color: var(--bg-body);
    padding: 3rem 1rem;
    margin-bottom: 2rem;
    
    h1 {
        color: var(--color-coffee-medium) !important; /* Elegant coffee tone for main title */
    }
    
    p {
        font-size: 1.25rem;
        opacity: 0.8;
        max-width: 600px;
        margin-inline: auto;
    }
}

/* Cards (Services & Portfolio) */
.card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.3s ease;
    height: 100%;
    
    /* Scroll Animation Entry */
    view-timeline-name: --card-entry;
    view-timeline-axis: block;
    animation: fade-in-up linear both;
    animation-timeline: view();
    animation-range: entry 10% cover 20%;

    &:hover {
        transform: translateY(-4px) scale(1.01);
        box-shadow: var(--shadow-soft);
        border-color: var(--color-secondary);
    }
    
    .card-img-top {
        aspect-ratio: 16/9;
        object-fit: cover;
        transition: transform 0.5s ease;
    }
    
    &:hover .card-img-top {
        transform: scale(1.05);
    }

    .card-body {
        padding: 1.5rem;
        display: flex;
        flex-direction: column;
        
        h5.card-title {
            font-size: 1.25rem;
            margin-bottom: 0.75rem;
        }
        
        p.card-text {
            font-size: 0.95rem;
            opacity: 0.9;
            flex-grow: 1;
        }
    }
}

/* List Group (Services) */
.list-group {
    --bs-list-group-bg: transparent;
    --bs-list-group-border-color: var(--border-subtle);
    
    .list-group-item {
        background-color: var(--bg-surface);
        border-color: var(--border-subtle);
        font-weight: 500;
        transition: background-color 0.2s;
        
        &:hover {
            background-color: color-mix(in srgb, var(--color-primary), transparent 95%);
            border-left: 4px solid var(--color-secondary);
        }
    }
}

/* Footer */
footer {
    background-color: var(--color-coffee-dark) !important;
    color: var(--color-cream) !important;
    padding: 3rem 0;
    margin-top: 5rem;
    border-top: 4px solid var(--color-secondary);
    
    a {
        color: var(--color-cream);
        opacity: 0.7;
        
        &:hover {
            opacity: 1;
            color: var(--color-secondary);
        }
    }
}

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

/* Container Queries for Responsive Typography inside cards if needed */
.card-body {
    container-type: inline-size;
}

@container (max-width: 300px) {
    .card-title {
        font-size: 1.1rem;
    }
}

/* Utility Overrides for Bootstrap Buttons to match theme */
.btn-primary {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: white; /* Electric blue needs white text for contrast */
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    padding: 0.6em 1.2em;
    border-radius: 50px; /* Pill shape */
    
    &:hover, &:focus, &:active {
        background-color: color-mix(in srgb, var(--color-primary), black 10%) !important;
        border-color: color-mix(in srgb, var(--color-primary), black 10%) !important;
    }
}
