/* ==========================================================================
   CSS Variables & Base (Minimalist V2)
   ========================================================================== */
:root {
    --text-secondary: #9ca3af;
    --bg-dark-core: #050505;
    --bg-dark-gradient: radial-gradient(circle at 50% 100%, #111111 0%, #050505 100%);
    --accent-gold-start: #D4AF37;
    /* Champagne Gold */
    --accent-gold-end: #F3E5AB;
    /* Light Gold */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    /* removed smooth-scroll to let Lenis handle it */
    font-size: 16px;
    background-color: #050505;
    /* Start directly dark */
}

body {
    background-color: var(--bg-dark-core);
    color: #f3f4f6;
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    cursor: none !important;
}

*,
a,
button,
input,
textarea,
select {
    cursor: none !important;
}

/* ==========================================================================
   Lenis Smooth Scroll Base Styles
   ========================================================================== */
html.lenis,
html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

.lenis.lenis-smooth iframe {
    pointer-events: none;
}

/* Base dark theme variables for standardizing the 'tech money' feel */
/* Moved roots to top */

.accent-text {
    background: linear-gradient(135deg, var(--accent-gold-start) 0%, var(--accent-gold-end) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: var(--accent-gold-start);
}

/* Layout */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section-padding {
    padding: 6rem 0;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.mt-5 {
    margin-top: 3rem;
}

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

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

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

@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .section-padding {
        padding: 4rem 0;
    }
}

/* ==========================================================================
   Navigation (Difference Blend Mode)
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999;
    padding: 2rem 0;
    color: #ffffff;
    pointer-events: none;
    /* Let clicks pass to the container */
    transition: padding 0.3s ease, background 0.3s ease;
}

.navbar.scrolled {
    padding: 1rem 0;
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-container {
    pointer-events: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
}

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

.nav-links li a {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    text-decoration: none;
    font-size: 0.95rem;
    position: relative;
    padding-bottom: 4px;
    transition: color 0.3s ease;
}

.nav-links li a:hover {
    color: #ffffff;
}

.nav-links li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: #ffffff;
    transition: width 0.3s ease;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 1001;
}

.hamburger span {
    width: 30px;
    height: 2px;
    background: #fff;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100vw;
        height: 100vh;
        background: linear-gradient(135deg, #080808 0%, #101025 25%, #0a0a0a 50%, #15150f 75%, #080808 100%);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        gap: 3rem;
    }

    .nav-links li a {
        font-size: 1.5rem;
    }

    .nav-links.active {
        right: 0;
    }

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

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

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

/* ==========================================================================
   Custom Cursor
   ========================================================================== */
.cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    background-color: var(--accent-gold-start);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease, background-color 0.3s ease;
}

.cursor-follower {
    position: fixed;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.cursor.hovered {
    width: 0;
    height: 0;
}

.cursor-follower.hovered {
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.05);
    /* Slight tint, no more hard blur */
    border-color: rgba(212, 175, 55, 0.8);
}

/* Hide custom cursor on touch/mobile devices */
@media (pointer: coarse) {

    .cursor,
    .cursor-follower,
    .blur-overlay {
        display: none !important;
    }

    *,
    body,
    a,
    button {
        cursor: auto !important;
    }
}

/* ==========================================================================
   Spotlight Blur Overlay
   ========================================================================== */
.blur-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 990;
    /* Below cursor, above background/content */
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    background: rgba(0, 0, 0, 0.25);
    /* Dim the rest of the page */
    opacity: 0;
    transition: opacity 0.8s ease;

    /* Make a transparent hole where the mouse is */
    mask-image: radial-gradient(circle at var(--mouse-x, 50vw) var(--mouse-y, 50vh), transparent 0px, transparent 60px, rgba(0, 0, 0, 1) 150px);
    -webkit-mask-image: radial-gradient(circle at var(--mouse-x, 50vw) var(--mouse-y, 50vh), transparent 0px, transparent 60px, rgba(0, 0, 0, 1) 150px);
}

body.is-hovering .blur-overlay {
    opacity: 1;
}

/* ==========================================================================
   Reactive Background
   ========================================================================== */
.reactive-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: -1;
    /* Updated dynamically via JS to trace mouse glow */
    background: radial-gradient(circle 800px at 50% 50%, rgba(212, 175, 55, 0.04), transparent 80%);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
    min-height: 100vh;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background: linear-gradient(135deg, #080808 0%, #101025 25%, #0a0a0a 50%, #15150f 75%, #080808 100%);
    background-size: 400% 400%;
    animation: gradientDrift 30s ease infinite;
}

/* Simple Resonating Circles */
.resonance-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 100vh;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

.resonance-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px solid rgba(212, 175, 55, 0.5);
    animation: resonate 20s infinite ease-out;
}

@keyframes resonate {
    0% {
        width: 50px;
        height: 50px;
        opacity: 0;
    }

    5% {
        opacity: 0.8;
    }

    40% {
        opacity: 0.4;
    }

    100% {
        width: 120vw;
        height: 120vw;
        opacity: 0;
    }
}

.r-1 {
    animation-delay: 0s;
}

.r-2 {
    animation-delay: -5s;
}

.r-3 {
    animation-delay: -10s;
}

.r-4 {
    animation-delay: -15s;
}

.hero-content {
    text-align: center;
    z-index: 10;
}

.hero-text-wrapper {
    overflow: hidden;
    padding: 10px;
}

.hero-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(4rem, 12vw, 9rem);
    line-height: 0.9;
    font-weight: 500;
    margin: 0;
    color: #ffffff;
    /* Removed initial CSS hide states to prevent FOUC / flickering */
}

.hero-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: var(--text-secondary);
    font-weight: 300;
    margin-top: 2rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    /* Removed initial CSS hide states to prevent FOUC / flickering */
}

.scroll-indicator {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeIn 1.5s ease 1s backwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.scroll-line {
    width: 1px;
    height: 80px;
    background: linear-gradient(to bottom, rgba(212, 175, 55, 0.8), transparent);
    animation: pulseLine 2s infinite ease-in-out;
}

@keyframes pulseLine {
    0% {
        transform: scaleY(0);
        transform-origin: top;
    }

    50% {
        transform: scaleY(1);
        transform-origin: top;
    }

    50.1% {
        transform: scaleY(1);
        transform-origin: bottom;
    }

    100% {
        transform: scaleY(0);
        transform-origin: bottom;
    }
}

/* ==========================================================================
   2. Dark Main Content
   ========================================================================== */
.main-content {
    color: #f3f4f6;
    position: relative;
    z-index: 30;
    background: linear-gradient(135deg, #080808 0%, #101025 25%, #0a0a0a 50%, #15150f 75%, #080808 100%);
    background-size: 400% 400%;
    animation: gradientDrift 30s ease infinite;
}

@keyframes gradientDrift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Film Grain Noise Overlay */
.main-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* ==========================================================================
   Elegant Components
   ========================================================================== */
.elegant-header {
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    padding-bottom: 1.5rem;
    margin-bottom: 4rem;
    display: flex;
    gap: 1.5rem;
    align-items: baseline;
}

.section-num {
    font-size: 1.2rem;
    font-family: 'Inter', sans-serif;
    color: var(--accent-gold-start);
    font-weight: 300;
    letter-spacing: 2px;
}

.section-title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-family: 'Cormorant Garamond', serif;
    margin: 0;
    line-height: 1;
    font-weight: 500;
}

/* Cards Grid */
.minimal-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.minimal-card {
    position: relative;
    padding: 4rem 2.5rem;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    text-decoration: none;
    color: #f3f4f6;
    display: flex;
    flex-direction: column;
    background: rgba(5, 5, 5, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
    overflow: hidden;
    will-change: transform;
}

.minimal-card:last-child {
    border-right: none;
}

.minimal-card:hover {
    background: rgba(20, 20, 20, 0.6);
    border-color: rgba(212, 175, 55, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    color: #f3f4f6;
}

/* Base Headlight Effect (Invisible normally) */
.minimal-card::before,
.minimal-project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(212, 175, 55, 0.15), transparent 60%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 1;
}

/* Headlight Effect (Visible on hover) */
.minimal-card:hover::before,
.minimal-project-card:hover::before {
    opacity: 1;
}

/* Keep text above the glare */
.minimal-card>*,
.minimal-project-card>* {
    position: relative;
    z-index: 2;
}

.minimal-card:hover .card-num,
.minimal-card:hover .card-desc {
    color: #4b5563;
}

.card-num {
    font-size: 1rem;
    color: var(--accent-gold-start);
    margin-bottom: 3rem;
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    transition: color 0.4s ease;
}

.card-title {
    font-size: 2.2rem;
    font-family: 'Cormorant Garamond', serif;
    margin: 0 0 0.5rem 0;
    font-weight: 500;
}

.card-desc {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin: 0;
    transition: color 0.4s ease;
}

@media (max-width: 900px) {
    .minimal-cards-grid {
        grid-template-columns: 1fr;
        border-bottom: none;
    }

    .minimal-card {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        padding: 3rem 1.5rem;
    }
}

/* Timeline */
.cv-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    margin: 5rem 0 3rem 0;
    border: none;
}

.subsection-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.2rem;
    color: var(--accent-gold-start);
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 300;
    margin-bottom: 3rem;
}

.minimal-timeline-item {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 3rem;
    padding: 3.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.minimal-timeline-item:last-child {
    border-bottom: none;
}

.timeline-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.timeline-date {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.timeline-company {
    font-size: 1rem;
    color: var(--text-secondary);
}

.timeline-detail h4 {
    font-size: 2.2rem;
    margin: 0 0 1rem 0;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 500;
}

.timeline-detail p {
    color: var(--text-secondary);
    font-size: 1.15rem;
    margin: 0;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .minimal-timeline-item {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 2.5rem 0;
    }

    .timeline-detail h4 {
        font-size: 1.6rem;
    }
}

/* Projects */
.minimal-project-card {
    position: relative;
    padding: 3rem;
    background: rgba(5, 5, 5, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
    overflow: hidden;
    will-change: transform;
}

.minimal-project-card:hover {
    background: rgba(20, 20, 20, 0.6);
    border-color: rgba(212, 175, 55, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.project-title {
    font-size: 2.2rem;
    font-family: 'Cormorant Garamond', serif;
    margin: 0;
    font-weight: 600;
    letter-spacing: -1px;
}

.project-tags {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.project-tags span {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.4rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    color: var(--text-secondary);
}

/* Contact */
.huge-contact-link {
    font-size: clamp(1.5rem, 5vw, 6.5rem);
    font-family: 'Cormorant Garamond', serif;
    color: #f3f4f6;
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
    position: relative;
    padding-bottom: 10px;
    transition: color 0.4s ease;
    word-break: break-word;
}

.huge-contact-link:hover {
    color: var(--accent-gold-start);
}

.huge-contact-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 1px;
    background: var(--accent-gold-start);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.huge-contact-link:hover::after {
    width: 100%;
}

.footer-links a:hover {
    color: #ffffff;
}

/* ==========================================================================
   Scroll Reveal utility
   ========================================================================== */
.reveal {
    opacity: 0;
}