@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400&family=Inter:wght@300;400;500;600&family=Nunito:wght@700;800&display=swap');

:root {
    --bg-black: #050505;
    --bg-white: #ffffff;
    --bg-gray: #f5f5f5;
    --bg-dark-gray: #111111;
    --accent: #d4af37;
    /* Keep gold as a very subtle accent */
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-black: #050505;
    --border: rgba(255, 255, 255, 0.1);
    --border-dark: rgba(0, 0, 0, 0.1);
    --transition-slow: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: all 0.4s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-black);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
.serif {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    letter-spacing: -0.02em;
}

/* --- Custom Cursor --- */
.cursor {
    width: 8px;
    height: 8px;
    background: var(--text-primary);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    transition: transform 0.1s ease;
}

.cursor-follower {
    width: 30px;
    height: 30px;
    border: 1px solid var(--text-primary);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

/* --- Layout Utils --- */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 5%;
}

.section-spacing {
    padding: 180px 0;
}

/* --- Navigation --- */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4%;
    z-index: 1000;
    transition: var(--transition-slow);
    background: transparent;
}

nav.scrolled {
    background: rgba(5, 5, 5, 0.95);
    backdrop-filter: blur(10px);
    height: 70px;
}

.logo {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    line-height: 1;
}

.logo-initials {
    font-family: 'Nunito', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0.05em;
}

.logo-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.55rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.15em;
    margin-top: 4px;
}

/* Image Overlay on Split Screens */
.split-overlay-img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    mix-blend-mode: multiply;
    /* Removes white background dynamically */
    pointer-events: none;
    /* Let clicks pass through */
    z-index: 1;
    /* Above canvas, below text */
}

/* Specific adjustments for left side image */
.implant-overlay {
    left: 25%;
    /* Center it specifically within the left 50vw split-side */
    transform: translate(-50%, -45%);
    max-width: 60vw;
    /* Increased from 40vw to make the image much larger */
    opacity: 1;
    filter: contrast(1.2) saturate(1.2) brightness(1.15);
    /* Brighten the overlaid image to make it pop */
    mix-blend-mode: multiply;
    /* Fade out the harsh square corners of the image */
    -webkit-mask-image: radial-gradient(ellipse at 50% 50%, black 50%, transparent 68%);
    mask-image: radial-gradient(ellipse at 50% 50%, black 50%, transparent 68%);
}

.nav-links {
    display: flex;
    gap: 40px;
    list-style: none;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    transition: var(--transition-fast);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}

.btn-nav {
    border: 1px solid var(--text-primary);
    padding: 10px 25px;
    border-radius: 50px;
    color: var(--text-primary) !important;
}

.btn-nav:hover {
    background: var(--text-primary);
    color: var(--bg-black) !important;
}

/* --- Cinematic Scroll Hero --- */
.scroll-hero {
    position: relative;
    background-color: var(--bg-black);
}

.hero-spacer {
    height: 150vh;
    /* Scroll amount needed to scale image fully */
}

.sticky-container {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    padding: 20px 5%;
    color: var(--bg-white);
    pointer-events: none;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
}

.hero-content::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 150%;
    background: radial-gradient(circle at center, rgba(5, 5, 5, 0.4) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

.hero-content .btn-lux {
    pointer-events: auto;
    mix-blend-mode: normal;
}

.hero-content h1 {
    font-size: clamp(3.5rem, 8vw, 8rem);
    line-height: 1;
    margin-bottom: 30px;
}

.hero-content h1 i {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-style: italic;
}

.hero-subtext {
    font-size: 1.2rem;
    color: var(--bg-white);
    line-height: 1.6;
    margin: 0 auto 40px auto;
    max-width: 600px;
}

.media-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30vw;
    /* Initial constrained width */
    height: 100vh;
    /* Initial full height */
    overflow: hidden;
    z-index: 1;
    will-change: width;
}

.media-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.6);
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    color: var(--bg-white);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.mouse {
    width: 20px;
    height: 35px;
    border: 1px solid var(--bg-white);
    border-radius: 15px;
    position: relative;
}

.mouse::before {
    content: '';
    width: 4px;
    height: 4px;
    background: var(--bg-white);
    border-radius: 50%;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll 2s infinite;
}

@keyframes scroll {
    0% {
        transform: translate(-50%, 0);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, 15px);
        opacity: 0;
    }
}

.reveal-text {
    overflow: hidden;
}

.reveal-text span {
    display: block;
    transform: translateY(100%);
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Buttons --- */
.btn-lux {
    padding: 18px 40px;
    background: var(--bg-white);
    border: 1px solid var(--bg-white);
    color: var(--text-black);
    text-decoration: none;
    font-size: 0.8rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    transition: var(--transition-fast);
    border-radius: 50px;
    display: inline-block;
}

.btn-lux:hover {
    background: transparent;
    color: var(--text-primary);
    transform: translateY(-5px);
}

/* --- Editorial Grid --- */
.asymmetric-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 40px;
}

.editorial-card {
    grid-column: span 6;
    position: relative;
}

.editorial-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 4/5;
    object-fit: cover;
    transition: var(--transition-slow);
}

.editorial-card:hover img {
    transform: scale(1.02);
}

.product-image {
    object-fit: contain !important;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
}

.card-content {
    margin-top: 30px;
    max-width: 450px;
}

.card-content h3 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.divider {
    width: 100%;
    height: 1px;
    background: var(--border);
    margin: 60px 0;
}

/* --- About Legacy --- */
.doctor-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 100px;
    align-items: center;
}

.doctor-hero h2 {
    font-size: 4rem;
    margin-bottom: 40px;
}

.doctor-hero .stats {
    display: flex;
    gap: 50px;
    margin-top: 60px;
}

.stat-item h4 {
    color: var(--gold);
    font-size: 2.5rem;
    margin-bottom: 5px;
}

/* --- Form Editorial --- */
.contact-editorial {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.input-lux {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
    color: var(--text-primary);
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    outline: none;
    transition: var(--transition-fast);
}

.input-lux:focus {
    border-color: var(--text-primary);
}

::placeholder {
    color: rgba(255, 255, 255, 0.2);
    letter-spacing: 0.1em;
    font-size: 0.7rem;
    font-family: 'Inter', sans-serif;
}

footer {
    padding: 120px 0;
    text-align: center;
    border-top: 1px solid var(--border);
}

/* Animations */
.fade-up {
    opacity: 0;
    transform: translateY(50px);
    transition: var(--transition-slow);
}

.fade-up.active {
    opacity: 1;
    transform: translateY(0);
}

.portrait-bw {
    filter: grayscale(1) contrast(1.2) brightness(0.9);
    transition: var(--transition-slow);
}

.portrait-bw:hover {
    filter: grayscale(1) contrast(1.4) brightness(1);
    transform: scale(1.05);
}

@media (max-width: 1024px) {

    .asymmetric-grid {
        display: flex;
        flex-direction: column;
    }

    .editorial-card,
    .doctor-hero,
    .contact-editorial {
        grid-template-columns: 1fr;
        display: block;
        width: 100%;
    }

    .hero h1 {
        font-size: 4rem;
    }
}

/* --- Dual Landing Page (Split Screen) --- */
.split-body {
    overflow: hidden;
}

.split-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
}

.split-side {
    flex: 1;
    /* Both flex equally to 50% by default */
    position: relative;
    overflow: hidden;
    transition: flex 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--bg-white);
}

/* When the parent container is hovered, the NON-hovered child implicitly shrinks */
.split-layout:hover .split-side {
    flex: 0.8;
}

/* The actively hovered child expands */
.split-layout .split-side:hover {
    flex: 1.2;
}

.video-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.split-side.right .video-wrapper {
    left: auto;
    right: 0;
}

.split-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.4) grayscale(0.5);
    transition: filter 0.8s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    transform: scale(1.02);
}

.split-side:hover .split-bg {
    filter: brightness(0.7) grayscale(0);
    transform: scale(1.05);
}

.split-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 40px;
    pointer-events: none;
}

.split-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 4vw, 4.5rem);
    margin-bottom: 20px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
    letter-spacing: 0.05em;
    font-weight: 400;
}

.split-content p {
    font-size: 0.9rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
    opacity: 0.6;
    transition: opacity 0.5s ease;
}

.split-side:hover .split-content p {
    opacity: 1;
}

.logo-center {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    text-transform: uppercase;
    color: white;
    letter-spacing: 0.2em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

/* =========================================================================
   Mobile Responsiveness (Max Width: 768px)
   ========================================================================= */
@media screen and (max-width: 768px) {

    /* Stack split screens vertically instead of horizontally */
    .split-layout {
        flex-direction: column !important;
    }

    .split-side {
        width: 100vw !important;
        height: 50vh !important;
        border-right: none !important;
        border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    }

    /* Remove the bottom border from the last item */
    .split-side:last-child {
        border-bottom: none !important;
    }

    /* Ensure canvases fill the 50vh vertically */
    .video-wrapper {
        min-height: 50vh;
    }

    /* Disable the hover flex expansion on mobile to prevent jumpy touch UX */
    .split-layout:hover .split-side,
    .split-layout .split-side:hover {
        flex: 1;
    }

    /* Adjust the implant overlay to fit the new aspect ratio */
    .implant-overlay {
        left: 50%;
        max-width: 60%;
        max-height: 80%;
        /* Limit the vertical size on extremely wide/short phones */
        transform: translate(-50%, -50%);
    }

    /* Scale down the massive typography for smaller screens */
    .split-content h2 {
        font-size: 2.5rem;
        margin-bottom: 10px;
    }

    .split-content p {
        font-size: 0.75rem;
        letter-spacing: 0.2em;
    }

    .logo-center {
        top: 20px !important;
    }

    .logo-initials {
        font-size: 1.8rem !important;
        letter-spacing: 1px !important;
    }

    .logo-text {
        font-size: 0.5rem !important;
    }

    /* Mobile Navigation Fixes */
    nav,
    #main-nav {
        flex-direction: column !important;
        padding: 15px 5% !important;
        background: rgba(5, 5, 5, 0.98) !important;
        height: auto !important;
    }

    nav.scrolled,
    #main-nav.scrolled {
        padding: 10px 5% !important;
    }

    .logo {
        text-align: center;
        align-items: center;
        margin-bottom: 10px !important;
    }

    .nav-links {
        width: 100%;
        gap: 15px;
        overflow-x: auto;
        justify-content: flex-start !important;
        padding-bottom: 5px;
        -webkit-overflow-scrolling: touch;
    }

    .nav-links::-webkit-scrollbar {
        height: 3px;
    }

    .nav-links::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.2);
        border-radius: 3px;
    }

    .nav-links a {
        white-space: nowrap;
        font-size: 0.65rem;
    }

    .btn-nav {
        padding: 8px 15px;
    }

    /* Fix headings on mobile */
    .section-spacing {
        padding: 80px 0 !important;
    }

    h1 {
        font-size: clamp(2.5rem, 8vw, 3.5rem) !important;
    }

    h2 {
        font-size: clamp(2rem, 6vw, 2.5rem) !important;
    }
}