@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
    :root {
        --primary: #000000;
        /* Custom Blue */
        --primary-container: #164B7F;
        /* Darker Blue */
        --surface: #ffffff;
        /* Cream Foundation */
        --surface-dim: #f4f4f5;
        /* Dim Cream */
        --secondary: #C5A059;
        /* Wood/Ochre Accent */
        --secondary-container: #D4AF37;
        /* Bright Gold */
        --outline-variant: rgba(0, 6, 19, 0.15);
        /* Ghost Border */
    }

    /* Enforce rigid, zero-border-radius aesthetic everywhere */
    *,
    *::before,
    *::after {
        border-radius: 0 !important;
        box-shadow: none !important;
        /* Force removal of generic drop shadows */
    }

    /* Accessibility Focus States */
    *:focus-visible {
        outline: 2px solid var(--secondary);
        outline-offset: 2px;
    }

    body {
        background-color: var(--surface);
        color: var(--primary);
        font-family: 'Barlow', sans-serif;
        overflow-x: clip;
        -webkit-font-smoothing: antialiased;
    }

    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        font-family: 'Barlow', sans-serif;
    }

    .font-script {
        font-family: 'Beth Ellen', cursive;
        font-weight: 400;
    }



    .drop-cap::first-letter {
        font-family: 'Barlow', sans-serif;
        font-weight: 800;
        font-size: 3.5em;
        line-height: 0.8;
        font-size: 3.5em;
        line-height: 0.8;
        font-weight: 800;
        float: left;
        margin-top: 0.1em;
        margin-right: 0.1em;
        margin-bottom: -0.1em;
        color: var(--primary-container);
    }
}

@layer components {
    #navbar {
        background-color: transparent;
        background-image:
            url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200' preserveAspectRatio='none'%3E%3Cpath d='M0,50 C40,90 60,10 100,50 S160,80 200,50 V200 H0 Z' fill='rgba(22,75,127,0.7)'/%3E%3C/svg%3E"),
            url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200' preserveAspectRatio='none'%3E%3Cpath d='M0,50 C30,10 50,70 100,50 S170,10 200,50 V200 H0 Z' fill='rgba(22,75,127,0.95)'/%3E%3C/svg%3E");
        background-size: 100% 300px, 100% 300px;
        background-position: 0 100px, 0 100px;
        background-repeat: no-repeat;
        border-bottom: 1px solid transparent;
        /* Slowed down splash (1.0s) and snappier color shift (0.1s) for better sync */
        transition: background-position 1.0s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.7s ease, color 0.1s ease !important;
    }

    #navbar.nav-glass {
        background-position: 0 -150px, 0 -150px;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-link {
        position: relative;
        text-decoration: none;
    }

    .nav-link::after {
        content: '';
        position: absolute;
        width: 100%;
        transform: scaleX(0);
        height: 1px;
        bottom: -4px;
        left: 0;
        background-color: var(--secondary);
        transform-origin: bottom right;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .nav-link:hover::after {
        transform: scaleX(1);
        transform-origin: bottom left;
    }

    .btn-primary {
        @apply inline-flex items-center justify-center border-none;
        background-color: var(--primary-container);
        color: var(--surface);
        padding: 1.25rem 2.5rem;
        font-family: 'Barlow', sans-serif;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        font-size: 0.875rem;
        transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease;
    }

    .btn-primary:hover {
        background-color: var(--primary);
    }

    .btn-primary:active {
        transform: scale(0.98);
    }

    .btn-secondary {
        @apply inline-flex items-center justify-center border-none;
        background-color: var(--secondary-container);
        color: var(--primary);
        padding: 1.25rem 2.5rem;
        font-family: 'Barlow', sans-serif;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        font-size: 0.875rem;
        transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease;
    }

    .btn-secondary:hover {
        background-color: #e5b045;
    }

    .btn-secondary:active {
        transform: scale(0.98);
    }

    .btn-outline {
        @apply inline-flex items-center justify-center bg-transparent border border-primary;
        color: var(--primary);
        padding: 1.25rem 2.5rem;
        font-family: 'Barlow', sans-serif;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        font-size: 0.875rem;
        transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease, color 0.2s ease;
    }

    .btn-outline:hover {
        background-color: var(--primary);
        color: var(--surface);
    }

    .btn-outline:active {
        transform: scale(0.98);
    }

    .grain-overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
        opacity: 0.04;
        pointer-events: none;
        z-index: 10;
        mix-blend-mode: multiply;
    }

    .ambient-blob {
        position: absolute;
        top: 0;
        left: -20%;
        width: 140vw;
        height: 140vh;
        border-radius: 50% !important;
        /* Specific exception for ambient blur */
        background: radial-gradient(circle, rgba(123, 88, 0, 0.03) 0%, transparent 60%);
        pointer-events: none;
        z-index: 0;
        filter: blur(100px);
    }

    .emblem-badge {
        @apply inline-flex items-center justify-center bg-secondary-container text-primary font-sans font-bold uppercase tracking-widest text-sm border-2 border-primary;
        width: 140px;
        height: 140px;
        transform: rotate(-5deg);
    }

    /* Carousel hidden scrollbar */
    .hide-scrollbar {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .hide-scrollbar::-webkit-scrollbar {
        display: none;
    }

    .carousel-item {
        scroll-snap-align: start;
    }
}

@layer utilities {
    .bg-primary {
        background-color: var(--primary);
    }

    .bg-primary-container {
        background-color: var(--primary-container);
    }

    .bg-surface {
        background-color: var(--surface);
    }

    .bg-surface-dim {
        background-color: var(--surface-dim);
    }

    .text-primary {
        color: var(--primary);
    }

    .text-primary-container {
        color: var(--primary-container);
    }

    .text-surface {
        color: var(--surface);
    }

    .text-secondary {
        color: var(--secondary);
    }

    .text-secondary-container {
        color: var(--secondary-container);
    }

    .border-primary {
        border-color: var(--primary);
    }

    .border-outline {
        border-color: var(--outline-variant);
    }

    .stroke-primary {
        stroke: var(--primary);
    }

    .stroke-surface {
        stroke: var(--surface);
    }

    .stroke-secondary {
        stroke: var(--secondary);
    }

    /* GSAP Class */
    .gsap-reveal {
        opacity: 0;
        visibility: hidden;
    }

    /* Tonal Lift for Cards */
    .tonal-lift {
        background-color: var(--surface);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.4s ease;
    }

    .bg-surface-dim .tonal-lift:hover {
        background-color: #fafae0;
        /* Slight color shift, no shadow */
        transform: translateY(-2px);
    }

    /* Mobile scroll states */
    @media (max-width: 767px) {
        body.scrolled-down #mobile-bottom-bar {
            transform: translate(-50%, 0) !important;
        }
    }



    /* ── Navigation links inside overlay ── */
    .nav-overlay-link {
        font-family: 'Barlow', sans-serif;
        font-weight: 500;
        font-size: clamp(1.5rem, 3vw, 2.5rem);
        text-transform: uppercase;
        letter-spacing: 0.1em;
        color: white;
        transition: color 0.3s ease, letter-spacing 0.4s cubic-bezier(0.16, 1, 0.3, 1), scale 0.3s ease;
        position: relative;
    }

    .nav-overlay-link:hover {
        color: var(--secondary-container); /* doré */
        letter-spacing: 0.15em;
        scale: 1.02;
    }

    /* ── Hamburger → Croix animation ── */
    #menu-toggle.is-active .menu-bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    #menu-toggle.is-active .menu-bar:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }
    #menu-toggle.is-active .menu-bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
        width: 1.5rem; /* reset à la même largeur */
    }