:root {
    --bg-color: #0b0b15;
    --text-color: #f0f0f5;
    --text-muted: #8a8a9b;
    --accent-primary: #ff0055;
    --accent-secondary: #00e5ff;
    --gradient-cosmic: linear-gradient(135deg, #2d1b4e 0%, #1a1b3a 100%);
    --gradient-overlay: linear-gradient(to bottom, transparent 0%, #0b0b15 100%);
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Shippori Mincho', 'Inter', serif;
    --transition-smooth: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: default;
    /* For custom cursor implementation later if needed */
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Typography Overrides */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    font-weight: 900;
}

/* Background Grain */
.background-grain {
    position: fixed;
    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.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
}

/* Header */
.glass-header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 2rem 5%;
    display: flex;
    justify-content: center;
    padding: 2rem 5%;
    display: flex;
    justify-content: center;
    /* mix-blend-mode: exclusion; - Removed to prevent stacking context issues with mobile menu */
    z-index: 100;
}

.hamburger {
    display: none;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-weight: 900;
    font-size: 1.2rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    gap: 3rem;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    padding-bottom: 5px;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 1px;
    background: var(--text-color);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Hero Fullscreen */
.hero-fullscreen {
    height: 100vh;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.hero-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 1;
    /* Always visible, controlled by z-index/clip-path */
    transition: transform 6s ease-out;
    /* Continuous slow zoom */
    transform: scale(1.1);
    z-index: 0;
}

.hero-slide.active {
    z-index: 10;
    animation: maskReveal 2.5s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

.hero-slide.last-active {
    z-index: 5;
    /* Remains visible behind the new one until covered */
}

@keyframes maskReveal {
    0% {
        clip-path: circle(0% at 50% 50%);
        transform: scale(1.15);
    }

    100% {
        clip-path: circle(150% at 50% 50%);
        transform: scale(1.0);
    }
}

/* Deprecated KenBurns */
/* @keyframes kenBurns... removed */

.overlay-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    background: linear-gradient(to top, var(--bg-color), transparent);
}

.hero-text {
    text-align: center;
    position: relative;
    z-index: 2;
    padding: 0 1rem;
}

.badge-pill {
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 2rem;
    backdrop-filter: blur(5px);
}

.hero-text h1 {
    font-size: clamp(4rem, 12vw, 8rem);
    line-height: 0.85;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

.outlined-text {
    -webkit-text-stroke: 2px rgba(255, 255, 255, 0.5);
    /* Modern browsers support this */
    color: transparent;
    transition: color 0.5s ease;
}

.hero-text:hover .outlined-text {
    color: var(--text-color);
}

.hero-text p {
    font-size: 1.2rem;
    max-width: 500px;
    margin: 0 auto;
    font-weight: 300;
}

.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    left: 5%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.scroll-indicator span {
    writing-mode: vertical-rl;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
}

.scroll-indicator .line {
    width: 1px;
    height: 60px;
    background: rgba(255, 255, 255, 0.3);
}

/* Sections General */
section {
    padding: 10vh 5%;
}

.split-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
}

.split-section.reverse {
    flex-direction: row-reverse;
}

.text-content {
    flex: 1;
}

.text-content h2 {
    font-size: 3rem;
    margin-bottom: 2rem;
}

.stats-row {
    display: flex;
    gap: 3rem;
    margin-top: 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat .number {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--accent-secondary);
}

.stat .label {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
}

.image-content {
    flex: 1;
    position: relative;
}

.feature-img {
    width: 100%;
    border-radius: 4px;
    filter: sepia(20%) hue-rotate(190deg) contrast(1.1);
    transition: var(--transition-smooth);
}

.image-content:hover .feature-img {
    filter: none;
    transform: scale(1.02);
}

/* Showreel */
.showreel-section {
    padding: 10vh 5%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
}

.section-header.center {
    text-align: center;
    margin-bottom: 1rem;
}

.section-header.center h2 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.section-header.center p {
    color: var(--text-muted);
}

.video-container {
    width: 100%;
    max-width: 800px;
    /* Reduced from 1200px */
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.video-container video {
    width: 100%;
    display: block;
    cursor: pointer;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    transition: opacity 0.5s ease;
    cursor: pointer;
    backdrop-filter: blur(2px);
}

.video-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.play-button {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    transition: all 0.3s ease;
}

.video-overlay:hover .play-button {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
    transform: scale(1.1);
    color: black;
}

.play-button svg {
    width: 32px;
    height: 32px;
    margin-left: 4px;
    /* Optically centering triangle */
}

.video-overlay span {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Gallery */
.gallery-section h2 {
    font-size: 4rem;
    text-align: center;
    margin-bottom: 5rem;
}

.gradient-text {
    background: linear-gradient(to right, var(--accent-secondary), var(--accent-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.masonry-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: auto auto;
    gap: 2rem;
}

.grid-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.grid-item:hover img {
    transform: scale(1.1);
}

.grid-item.large {
    grid-column: 1 / 8;
    grid-row: 1 / 3;
    height: 600px;
}

.grid-item.small {
    grid-column: 8 / 13;
    grid-row: 1 / 2;
    height: 350px;
}

.grid-item.medium {
    grid-column: 8 / 13;
    grid-row: 2 / 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem;
    background: #15151e;
}

/* Gallery Page Specifics */
.gallery-page-header {
    padding: 15vh 5% 5vh;
    text-align: center;
}

.gallery-page-header h1 {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.gallery-page-header p {
    color: var(--text-muted);
}

.gallery-full-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    padding: 0 5% 10vh;
}

.gallery-card {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gallery-card:hover {
    transform: translateY(-5px);
}

.gallery-card .img-wrapper {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.gallery-card:hover img {
    transform: scale(1.1);
}

.card-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
}

.card-info p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox img {
    max-width: 90%;
    max-height: 85vh;
    border-radius: 4px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 3rem;
    background: none;
    border: none;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.lightbox-close:hover {
    transform: scale(1.1) rotate(90deg);
}

/* SREF Modal */
.sref-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 11, 21, 0.85);
    /* Dark background */
    backdrop-filter: blur(10px);
    z-index: 10001;
    /* Above standard lightbox */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.sref-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.sref-content {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 4rem;
    border-radius: 20px;
    text-align: center;
    position: relative;
    transform: scale(0.8) translateY(20px);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.sref-modal.active .sref-content {
    transform: scale(1) translateY(0);
}

.sref-content h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
    /* Offset for fixed header */
}

/* Connect Dropdown */
.connect-wrapper {
    position: relative;
    padding-bottom: 2rem;
    /* Extend hover area to menu */
    margin-bottom: -2rem;
    /* Compensate for layout */
    display: flex;
    align-items: center;
}

.submenu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 200px;
    background: rgba(11, 11, 21, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.connect-wrapper:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.submenu a {
    color: var(--text-color);
    text-decoration: none;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    transition: background 0.2s;
    font-size: 0.9rem;
}

.submenu a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-secondary);
}

/* Responsive Cleanup: Reset for mobile if needed, or keep hover for simple tap */
@media (max-width: 768px) {
    .connect-wrapper {
        flex-direction: column;
        padding-bottom: 0;
        margin-bottom: 0;
    }

    .submenu {
        position: static;
        width: 100%;
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 1rem 0 0 0;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        /* Hidden by default on mobile */
    }

    .connect-wrapper:hover .submenu {
        display: flex;
        /* Show on tap */
    }
}

.code-container {
    background: rgba(0, 0, 0, 0.3);
    padding: 1.5rem 3rem;
    border-radius: 12px;
    font-family: monospace;
    font-size: 2.5rem;
    cursor: pointer;
    position: relative;
    border: 1px solid rgba(0, 229, 255, 0.3);
    transition: all 0.3s ease;
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
}

.code-container:hover {
    background: rgba(0, 229, 255, 0.1);
    border-color: var(--accent-secondary);
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.2);
    transform: scale(1.02);
}

.code-container .command {
    color: var(--accent-primary);
}

.code-container .value {
    color: var(--accent-secondary);
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
}

.copy-hint {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.3s;
}

.code-container:hover .copy-hint {
    opacity: 1;
}

.copy-feedback {
    margin-top: 1rem;
    color: var(--accent-secondary);
    font-weight: 600;
    min-height: 24px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.copy-feedback.show {
    opacity: 1;
    transform: translateY(0);
}

.sref-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.2s;
}

.sref-close:hover {
    color: white;
}

/* SREF Modal Mobile */
@media (max-width: 768px) {
    .sref-content {
        width: 90%;
        padding: 2rem 1.5rem;
    }

    .code-container {
        font-size: 1.2rem;
        padding: 1rem 1.5rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .sref-content h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .hero-text h1 {
        font-size: 3.5rem;
    }

    .split-section {
        flex-direction: column !important;
        gap: 2rem;
    }

    .masonry-grid {
        display: flex;
        flex-direction: column;
    }

    .gallery-full-grid {
        grid-template-columns: 1fr;
    }

    .grid-item.large,
    .grid-item.small {
        height: 300px;
    }

    /* Mobile Nav */
    .hamburger {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 20px;
        cursor: pointer;
        z-index: 200;
    }

    .hamburger span {
        width: 100%;
        height: 2px;
        background-color: var(--text-color);
        transition: all 0.3s ease;
    }

    .nav-links {
        display: flex;
        /* Override previous none */
        flex-direction: column;
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        background: rgba(11, 11, 21, 0.98);
        backdrop-filter: blur(10px);
        align-items: center;
        justify-content: center;
        transform: translateY(-100%);
        transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
        z-index: 150;
    }

    .nav-links.active {
        transform: translateY(0);
    }

    /* Hamburger Animation */
    .hamburger.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    /* Footer Fix */
    .footer-content {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }
}

.hover-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    transform: translateY(100%);
    transition: transform 0.4s ease;
}

.grid-item:hover .hover-info {
    transform: translateY(0);
}

.link-arrow {
    margin-top: 1rem;
    color: var(--accent-secondary);
    text-decoration: none;
    font-size: 1.2rem;
    border: 1px solid var(--accent-secondary);
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    display: inline-block;
    transition: all 0.3s ease;
}

.link-arrow:hover {
    background: var(--accent-secondary);
    color: var(--bg-color);
    transform: translateY(-2px);
}

/* Pulse Animation */
.pulse {
    --hover: var(--accent-secondary);
    transition: box-shadow 0.3s ease;
}

.pulse:hover,
.pulse:focus {
    animation: pulse 1s;
    box-shadow: 0 0 0 2em transparent;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 var(--hover);
    }
}

/* About */
.about-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-bottom: 15vh;
}

.circle-clipper {
    width: 300px;
    height: 400px;
    border-radius: 150px 150px 0 0;
    overflow: hidden;
    margin-bottom: 3rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.portrait-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-text h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.about-text p {
    max-width: 600px;
    margin-bottom: 3rem;
    font-size: 1.4rem;
    font-family: var(--font-heading);
    font-style: italic;
    color: var(--text-muted);
}

.btn-primary.large {
    font-size: 1.2rem;
    padding: 1rem 3rem;
    background: white;
    color: black;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: transform 0.2s, background 0.2s;
}

.btn-primary.large:hover {
    transform: scale(1.05);
    background: var(--accent-secondary);
}

/* Footer */
footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 3rem 5%;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-text h1 {
        font-size: 3.5rem;
    }

    .split-section {
        flex-direction: column !important;
        gap: 2rem;
    }

    .masonry-grid {
        display: flex;
        flex-direction: column;
    }

    .grid-item.large,
    .grid-item.small {
        height: 300px;
    }

    .nav-links {
        display: none;
    }
}