@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,500;0,600;1,300;1,400&family=Montserrat:wght@200;300;400;600&family=Mrs+Saint+Delafield&display=swap');

:root {
    --midnight: #0f172a;
    --champagne: #d4af37;
    --sand-paper: #fdfbf7;
    --tie-green: #0d9488;
    --electric-blue: #3b82f6;
}

html {
    scroll-behavior: smooth;
}

/* Custom Prestige Scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--midnight);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, var(--champagne), var(--tie-green));
    border-radius: 10px;
    border: 3px solid var(--midnight);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--champagne);
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.2);
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: #f0ece3;
    color: var(--midnight);
    position: relative;
    overflow-x: hidden;
}

/* Post-Process Background Effect */
.bg-topo {
    position: relative;
    overflow-x: hidden;
}

.bg-topo::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: url("https://i.ibb.co/5hB66sFh/IMG-3762.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    /* More performant than JS scrolling */
    filter: grayscale(80%) brightness(0.6);
    /* Simplified filter, removed blur */
    opacity: 0.15;
    /* Adjusted opacity */
}

/* Structural Accents */
main::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    width: 40px;
    height: 40px;
    border-top: 2px solid var(--champagne);
    border-left: 2px solid var(--champagne);
    z-index: 30;
    pointer-events: none;
}

main::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 40px;
    height: 40px;
    border-bottom: 2px solid var(--champagne);
    border-right: 2px solid var(--champagne);
    z-index: 30;
    pointer-events: none;
}

/* Image Reveal Animation */
.image-wrapper {
    clip-path: inset(100% 0 0 0);
    transition: clip-path 1.5s cubic-bezier(0.77, 0, 0.175, 1);
    /* Ensure consistent portrait framing across devices */
    padding: 0;
    /* normalize padding so positioning is predictable */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* ensure rounded or framed images don't overflow */
    box-sizing: border-box;
}

.image-wrapper.reveal {
    clip-path: inset(0 0 0 0);
}

.image-wrapper img {
    /* Centered focal point with extra headroom for portrait */
    transform: scale(1.04);
    object-position: 50% 35%;
    transition: transform 1.6s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.9s ease;
    will-change: transform, object-position;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    /* fill container while preserving aspect */
}

.image-wrapper.reveal img {
    transform: scale(1);
}

h1,
h2,
h3 {
    font-family: 'Cormorant Garamond', serif;
}

.signature {
    font-family: 'Mrs Saint Delafield', cursive;
}

/* Image Effects */
.image-wrapper {
    position: relative;
}

.image-wrapper:hover img {
    filter: grayscale(10%) contrast(105%) sepia(0%);
    transform: scale(1.05);
}

.image-wrapper img {
    /* Softer grayscale for a warmer, more natural portrait */
    filter: grayscale(75%) contrast(110%) brightness(0.95);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Button Animations */
.btn-slide {
    background-size: 200% auto;
    background-image: linear-gradient(to right, #0f172a 0%, #0d9488 51%, #0f172a 100%);
    transition: 0.5s;
}

.btn-slide:hover {
    background-position: right center;
}

.btn-slide:hover .conversation-icon-container {
    transform: scale(1.1) rotate(-5deg);
}

.conversation-icon-container {
    transition: transform 0.3s ease;
}

/* Card Shadows */
.float-shadow {
    box-shadow: 20px 20px 60px rgba(15, 23, 42, 0.1), -20px -20px 60px rgba(255, 255, 255, 0.8);
}

/* --- Restored Prestige Glass Nav Bar --- */
.glass-nav {
    background: linear-gradient(120deg, rgba(15, 23, 42, 0.98) 80%, rgba(212, 175, 55, 0.08) 100%);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.15);
    border-bottom: 1.5px solid rgba(212, 175, 55, 0.13);
}

.glass-nav.scrolled {
    background: linear-gradient(120deg, rgba(15, 23, 42, 0.98) 90%, rgba(212, 175, 55, 0.13) 100%);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.18);
}

/* --- Animated Gold Underline for Nav Links --- */
.nav-link {
    position: relative;
    color: #e0e7ef;
    transition: color 0.3s;
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #d4af37 0%, #fffbe6 100%);
    box-shadow: 0 0 6px 0 #d4af37cc;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s;
    border-radius: 2px;
}

.nav-link:hover,
.nav-link:focus {
    color: #d4af37;
}

.nav-link:hover::after,
.nav-link:focus::after {
    width: 100%;
    background: linear-gradient(90deg, #fffbe6 0%, #d4af37 100%);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .logo-container {
        width: 200px;
    }

    .logo-text {
        font-size: 24px;
    }

    .credential-card {
        padding: 1.25rem !important;
    }

    .mobile-menu a {
        font-size: 0.9rem;
        letter-spacing: 0.12em;
        padding: 0.9rem 0;
    }

    /* Maintain portrait ratio on small screens */
    .image-wrapper {
        aspect-ratio: 4 / 5;
    }

    nav .max-w-[700px] {
        position: static;
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 5rem;
    }

    #mobile-menu-btn {
        padding: 0.6rem;
        margin-right: 0.25rem;
        border-radius: 8px;
    }

    .btn-slide {
        padding-top: 1.25rem !important;
        padding-bottom: 1.25rem !important;
        font-size: 10px !important;
    }
}

@media (max-width: 480px) {
    .logo-container {
        width: 170px;
    }

    h1 {
        font-size: 3rem !important;
    }

    .signature {
        font-size: 2.3rem !important;
    }

    .p-8 {
        padding: 1rem !important;
        /* Tighter padding for very small devices */
    }

    .conversation-icon-container {
        width: 20px !important;
        height: 20px !important;
    }
}

/* Mobile header reflow: Side-by-side layout to keep image on the right */
@media (max-width: 768px) {
    header {
        display: flex !important;
        flex-direction: row !important;
        min-height: 240px !important;
        background: #0f172a;
        overflow: hidden;
    }

    header>div:first-child {
        width: 65% !important;
        padding: 1.5rem 1.2rem !important;
        order: 1 !important;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    header>div:last-child {
        width: 35% !important;
        order: 2 !important;
        margin-bottom: 0 !important;
        border-radius: 0 !important;
        position: relative !important;
        min-height: 240px !important;
    }

    .image-wrapper {
        height: 100% !important;
        width: 100% !important;
        aspect-ratio: auto !important;
        max-height: none !important;
        background: #0f172a;
        clip-path: none !important;
        /* Ensure image isn't hidden by animation clip */
        opacity: 1 !important;
        visibility: visible !important;
    }

    .image-wrapper img {
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover;
        object-position: 25% 35% !important;
        filter: grayscale(20%) !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        transform: none !important;
        /* Disable parallax/scale on mobile if it causes issues */
    }

    /* Desktop override: nudge the focal point down and slightly reduce scale so the face sits comfortably centered */
    @media (min-width: 768px) {
        .image-wrapper img {
            object-position: 12% 42% !important;
            transform: scale(1.04) !important;
        }
    }

    /* Zoom out effect: scale down text and spacing */
    #profile {
        margin-top: 5.5rem !important;
        width: 100% !important;
        max-width: 100% !important;
        box-shadow: none !important;
    }

    h1 {
        font-size: 1.9rem !important;
        line-height: 1 !important;
        letter-spacing: -0.02em;
    }

    /* Extra small screens fix */
    @media (max-width: 360px) {
        h1 {
            font-size: 1.7rem !important;
        }

        header>div:first-child {
            width: 70% !important;
        }

        header>div:last-child {
            width: 30% !important;
        }
    }

    .text-6xl {
        font-size: 1.9rem !important;
    }

    .text-7xl {
        font-size: 2.2rem !important;
    }

    p {
        font-size: 0.8rem !important;
        margin-bottom: 0.5rem !important;
    }

    .signature {
        font-size: 1.5rem !important;
        margin-top: 0.75rem !important;
    }

    .mb-8 {
        margin-bottom: 0.75rem !important;
    }

    .mt-8 {
        margin-top: 0.75rem !important;
    }
}

/* Accessible focus styles */
:focus-visible {
    outline: 3px solid rgba(212, 175, 55, 0.12);
    outline-offset: 3px;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* Card Hover Effects */
.card-reveal {
    transition: transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.card-reveal:hover {
    transform: translateY(-8px);
}

/* Logo Styling */
.logo-container {
    width: 320px;
    max-width: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.logo-container:hover {
    transform: scale(1.02);
}

.logo-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 42px;
    font-weight: 300;
    letter-spacing: 0.05em;
    fill: url(#prestigeGradient);
    opacity: 0;
}

.logo-text.animated {
    animation: fadeInLogo 3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.logo-text.permanent {
    opacity: 1 !important;
}

.logo-text-mask {
    font-family: 'Cormorant Garamond', serif;
    font-size: 42px;
    font-weight: 300;
    letter-spacing: 0.05em;
}

.logo-shimmer {
    display: none;
}

/* Cleanup unused class if present, kept for reference if needed elsewhere or removed */
.logo-text-shimmer {
    display: none;
}

.underline-path {
    stroke: var(--champagne);
    stroke-width: 1.2;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    opacity: 0.9;
}

.underline-path.animated {
    animation: drawLine 3s 1s cubic-bezier(0.4, 0, 0.2, 1) forwards, glow 3s 4s ease-in-out infinite;
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    animation: slideDown 0.3s ease-out;
}

/* Horizontal Line Expansion */
.expand-width {
    width: 0 !important;
    /* Force start at 0 */
    animation: expandWidth 1s ease-out forwards;
}

@keyframes expandWidth {
    to {
        width: 2.5rem;
    }
}

.mobile-menu.active {
    display: block;
}

.mobile-menu a {
    display: block;
    padding: 0.75rem 0;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-menu a:last-child {
    border-bottom: none;
}

/* Animations */
@keyframes fadeInLogo {
    from {
        opacity: 0;
        transform: translateY(2px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes drawLine {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes glow {

    0%,
    100% {
        filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.4));
        opacity: 0.9;
    }

    50% {
        filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.7));
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Page Entrance Loader */
#page-entrance {
    position: fixed;
    inset: 0;
    background: #0f172a;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.8s;
}

#page-entrance.loaded {
    opacity: 0;
    visibility: hidden;
}

.entrance-line {
    width: 0;
    height: 1px;
    background: #d4af37;
    animation: lineGrow 1.2s ease-in-out forwards;
}

@keyframes lineGrow {
    to {
        width: 100px;
        opacity: 0;
    }
}

/* Staggered Text Reveal */
.reveal-text {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s cubic-bezier(0.2, 0.8, 0.2, 1), transform 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal-text.visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.reveal-delay-1 {
    transition-delay: 0.1s;
}

.reveal-delay-2 {
    transition-delay: 0.2s;
}

.reveal-delay-3 {
    transition-delay: 0.3s;
}

.reveal-delay-4 {
    transition-delay: 0.4s;
}

/* Scroll Reveal Base */
.scroll-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: transform, opacity;
}

.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Metallic Gold Text Effect */
.text-gold-metallic {
    background: linear-gradient(135deg, #b88a00 0%, #e2c055 25%, #fceabb 50%, #d4af37 75%, #b88a00 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: background-position 0.5s ease;
}

.text-gold-metallic:hover {
    background-position: right center;
}

/* Fade-in animation for scroll */
.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media print {

    .glass-nav,
    .search-bar,
    button {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .report-section {
        break-inside: avoid;
        page-break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }

    .text-white {
        color: black !important;
    }

    .bg-slate-900 {
        background: white !important;
        color: black !important;
        border-bottom: 2px solid #000;
    }

    .gold-gradient {
        background: none;
        -webkit-text-fill-color: initial;
        color: #000;
    }
}