/* ===================================================
   ANDREA SAVASTANO — PORTFOLIO
   Dark theme, multi-section layout
   =================================================== */

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0a0a0a;
    --bg-card: #111111;
    --bg-card-hover: #161616;
    --text-primary: #e8e8e8;
    --text-secondary: #999999;
    --text-muted: #555555;
    --accent: #ff6b8a;
    --accent-hover: #ff8fa8;
    --accent-rgb: 255, 107, 138;
    --accent-glow: rgba(var(--accent-rgb), 0.35);
    --accent-soft: rgba(var(--accent-rgb), 0.10);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --font-display: 'Bebas Neue', 'Impact', sans-serif;
    --font-mono: 'Space Mono', 'Courier New', monospace;
    --transition-base: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    --section-padding: 80px 48px 60px;
    --max-width: 1200px;
}

/* ---------- Green Color Mode Override ---------- */
[data-color-mode="green"] {
    --accent: #6bff8a;
    --accent-hover: #8fffa8;
    --accent-rgb: 107, 255, 138;
}

[data-color-mode="blue"] {
    --accent: #6b8aff;
    --accent-hover: #8fafff;
    --accent-rgb: 107, 138, 255;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg);
    color: var(--text-primary);
    font-family: var(--font-mono);
    cursor: default;
    overflow-x: hidden;
}

::selection {
    background: var(--accent);
    color: var(--bg);
}

/* ---------- Noise Overlay ---------- */
#noise-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    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;
}

/* ---------- Animations ---------- */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}



@keyframes lineGrow {
    from {
        transform: scaleX(0);
    }

    to {
        transform: scaleX(1);
    }
}

/* Scroll reveal (Staggered entries) */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 1.2s cubic-bezier(0.23, 1, 0.32, 1),
        transform 1.2s cubic-bezier(0.23, 1, 0.32, 1);
    will-change: opacity, transform;
}

/* For simple fade-in (no movement), used for descriptions */
.reveal-fade {
    opacity: 0;
    transition: opacity 0.8s ease-out;
    transform: none;
    display: inline-block;
    will-change: opacity;
}

.text-lower {
    font-size: 0.7em;
}

.reveal.visible,
.reveal-fade.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-fade.visible {
    transform: none;
}

/* Ensure hover transitions are always immediate, overriding staggering transition-delays from JS */
.project-card:hover,
.focus-item:hover,
.skill-tag:hover,
.contact-card:hover,
.nav-link:hover,
.back-to-top:hover {
    transition-delay: 0s !important;
}


/* ---------- NAVBAR ---------- */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 48px;
    height: 64px;
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition-base), background var(--transition-base);
}

#navbar.scrolled {
    border-bottom-color: var(--border-color);
    background: rgba(10, 10, 10, 0.85);
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 1.6rem;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 3px;
    transition: color var(--transition-base);
}

.nav-logo:hover {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-link {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 18px;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: all var(--transition-base);
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.nav-link.active {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
}

/* ---------- HERO SECTION ---------- */
#hero {
    position: relative;
    width: 100%;
    height: 92vh;
    min-height: 600px;
    overflow: hidden;
    background: var(--bg);
}

/* Two-column flex layout */
#hero-layout {
    display: flex;
    align-items: stretch;
    height: 100%;
    padding-top: 0;
}

/* ---------- Hero Left Column ---------- */
#hero-left {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 48px 32px;
    flex: 0 0 auto;
    width: clamp(340px, 38vw, 520px);
    z-index: 10;
    animation: fadeSlideUp 0.8s ease-out 0.2s both;
}


#site-logo {
    font-family: var(--font-display);
    font-size: clamp(3.2rem, 5.5vw, 6rem);
    font-weight: 400;
    line-height: 0.88;
    letter-spacing: 2px;
    color: var(--text-primary);
    text-transform: uppercase;
    user-select: none;
    transition: text-shadow var(--transition-base);
}

#site-logo:hover {
    text-shadow: 0 0 40px var(--accent-glow);
}

/* Info strip — inside left column at the bottom */
#hero-info {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

#time-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 2px;
    color: var(--text-muted);
    text-transform: uppercase;
    display: block;
    margin-bottom: 2px;
}

#clock-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

#clock-digits {
    font-family: var(--font-display);
    font-size: clamp(2.6rem, 4vw, 3.8rem);
    font-weight: 400;
    letter-spacing: 2px;
    color: var(--text-primary);
    line-height: 1;
    min-width: 120px;
}

#ampm-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 6px;
}

.period {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 1px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color var(--transition-base);
}

.period::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    border: 1.5px solid var(--text-muted);
    display: inline-block;
    transition: all var(--transition-base);
}

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

.period.active::before {
    background-color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}

#viewport-info {
    display: flex;
    gap: 14px;
    margin-top: 4px;
}

@media (max-width: 600px) {
    #viewport-info {
        display: none;
    }
}

#viewport-size,
#fps-counter {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 1px;
    color: var(--text-muted);
}

#location-block {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 2px;
    color: var(--text-muted);
    text-transform: uppercase;
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
}

/* ---------- Hero Right Column — Image Panel ---------- */
#hero-right {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 48px 32px 0;
    z-index: 5;
    animation: fadeSlideUp 0.9s ease-out 0.45s both;
}

#hero-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-height: calc(92vh - 56px);
    border-radius: 12px;
    overflow: hidden;
    cursor: crosshair;
    background-color: var(--bg-card);
    transform: translateZ(0);
    /* Hardware accelerate to fix overflow clipping */

    /* Glowing shadow effect */
    box-shadow:
        0 0 30px rgba(var(--accent-rgb), 0.08),
        0 0 80px rgba(0, 0, 0, 0.6);
}

/* Image layers — now relative to the container */
.hero-img-layer {
    position: absolute;
    inset: 0;
    background-image: url('assets/HeroBackgroundSnippet.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

/* Base state: clear image for mobile/no-hover devices */
#hero-img-blurred {
    opacity: 0;
    transform: scale(1);
}

#hero-img-sharp {
    opacity: 1;
    filter: brightness(0.85);
    /* Ensure no mask is present on mobile */
    -webkit-mask-image: none;
    mask-image: none;
}

/* Desktop: enable interactive blur/spotlight if hover is supported */
@media (hover: hover) {
    #hero-img-blurred {
        opacity: 1;
        filter: blur(10px) brightness(0.4);
        transform: scale(1.04);
        /* prevent blur edge artifacts */
    }

    #hero-img-sharp {
        opacity: 0;
        -webkit-mask-image: radial-gradient(circle 0px at 0px 0px, black 0%, transparent 100%);
        mask-image: radial-gradient(circle 0px at 0px 0px, black 0%, transparent 100%);
        -webkit-mask-repeat: no-repeat;
        mask-repeat: no-repeat;
        filter: brightness(0.85);
        transition: opacity 0.25s ease;
    }
}

/* Vignette frame — edges of the image container */
#hero-img-frame {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: 12px;
    border: 1px solid rgba(var(--accent-rgb), 0.25);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    background:
        linear-gradient(to right, rgba(10, 10, 10, 0.55) 0%, transparent 18%, transparent 82%, rgba(10, 10, 10, 0.55) 100%),
        linear-gradient(to bottom, rgba(10, 10, 10, 0.45) 0%, transparent 15%, transparent 80%, rgba(10, 10, 10, 0.7) 100%);
    z-index: 3;
}

/* ---------- PAGE SECTIONS (shared) ---------- */
.page-section {
    width: 100%;
    min-height: 100vh;
    position: relative;
}

.section-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--section-padding);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
}

.section-number {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--accent);
    letter-spacing: 2px;
    flex-shrink: 0;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 4vw, 3.5rem);
    font-weight: 400;
    letter-spacing: 3px;
    color: var(--text-primary);
    text-transform: uppercase;
    flex-shrink: 0;
}

.section-line {
    flex: 1;
    height: 1px;
    background: var(--border-color);
    transform-origin: left;
}

.section-line.visible {
    animation: lineGrow 0.8s ease-out forwards;
}

/* ---------- ABOUT SECTION ---------- */
#about {
    background: var(--bg);
    border-top: 1px solid var(--border-color);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px 48px;
}

.about-bio {
    grid-column: 1 / -1;
}

.bio-text {
    font-family: var(--font-mono);
    font-size: 0.88rem;
    line-height: 1.85;
    color: var(--text-secondary);
    max-width: 720px;
    margin-bottom: 16px;
}

.bio-text:last-child {
    margin-bottom: 0;
}

.bio-muted {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.subsection-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-primary);
    margin-bottom: 24px;
}

/* Focus Areas */
.focus-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.focus-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all var(--transition-base);
}

.focus-item:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateX(4px);
}

.focus-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    width: 36px;
    text-align: center;
}

.focus-name {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
    margin-bottom: 0;
}

.focus-desc {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Skills Categories */
.skills-category {
    margin-bottom: 24px;
}

.skills-category:last-child {
    margin-bottom: 0;
}

.skills-category-title {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
    font-weight: 500;
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 100px;
    color: var(--text-secondary);
    background: var(--bg-card);
    transition: all var(--transition-base);
    cursor: default;
}

.skill-tag:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.1);
}

.skill-tag[data-category="lang"]:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.skill-tag[data-category="ide"]:hover {
    color: #9d72ff;
    border-color: #9d72ff;
    background: rgba(157, 114, 255, 0.08);
    box-shadow: 0 4px 16px rgba(157, 114, 255, 0.1);
}

.skill-tag[data-category="tool"]:hover {
    color: #6bdfff;
    border-color: #6bdfff;
    background: rgba(107, 223, 255, 0.08);
    box-shadow: 0 4px 16px rgba(107, 223, 255, 0.1);
}

/* ---------- PROJECTS SECTION ---------- */
#projects {
    background: var(--bg);
    border-top: 1px solid var(--border-color);
}

.projects-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 48px;
    animation-delay: 0.2s;
}

.filter-btn {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 1px;
    padding: 10px 22px;
    border: 1px solid var(--border-color);
    border-radius: 100px;
    color: var(--text-secondary);
    background: var(--bg-card);
    transition: all var(--transition-base);
    cursor: pointer;
    text-transform: uppercase;
}

.filter-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.1);
}

.filter-btn.active {
    color: var(--bg);
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}

.projects-grid {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.project-card {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 32px;
    padding: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition:
        opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        padding 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        margin 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.3s ease;
    overflow: hidden;
    max-height: 2000px;
    /* High enough to contain content */
}

.project-card.project-hidden {
    max-height: 0 !important;
    opacity: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: -20px !important;
    /* Half of the grid gap to collapse space naturally */
    margin-bottom: -20px !important;
    border-top-width: 0 !important;
    border-bottom-width: 0 !important;
    pointer-events: none;
    transform: translateY(20px) scale(0.95);
}

.project-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.project-image-wrapper {
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: #1a1a1a;
}

.project-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #141414 0%, #1c1c1c 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    /* Refined border */
    border-radius: 8px;
}

.placeholder-icon {
    font-size: 2.4rem;
    opacity: 0.4;
}

/* ---------- CAROUSEL ---------- */
.carousel {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.carousel-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transform: scale(1.08);
    filter: blur(8px);
    transition:
        opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        filter 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0.5s;
    cursor: pointer;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #141414 0%, #1c1c1c 100%);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.carousel-slide.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    filter: blur(0px);
    z-index: 2;
}

.carousel-slide img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Arrows */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(10, 10, 10, 0.3);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
}

.carousel-btn svg {
    transition: transform 0.3s ease;
}

.carousel:hover .carousel-btn {
    opacity: 1;
    visibility: visible;
}

.carousel-btn:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 0 20px var(--accent-glow);
}

.carousel-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-btn.prev {
    left: 12px;
}

.carousel-btn.next {
    right: 12px;
}

/* Pagination Dots below image */
.carousel-nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    z-index: 10;
}

.carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(var(--accent-rgb), 0.2);
    /* Soft accent */
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-dot.active {
    background: var(--accent);
    width: 24px;
    border-radius: 4px;
}

.project-visuals {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ---------- LIGHTBOX ---------- */
#lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

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

#lightbox-content {
    width: 90vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#lightbox.active #lightbox-content {
    transform: scale(1);
}

.lightbox-carousel {
    position: relative;
    width: 80vw;
    height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-track-container {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

#lightbox-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.lightbox-item {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transform: scale(1.1);
    filter: blur(12px);
    transition:
        opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        filter 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0.5s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    background: var(--bg-card);
}

.lightbox-item.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    filter: blur(0px);
    z-index: 2;
}

.lightbox-item img {
    width: 100%;
    height: 100%;
    max-width: 75%;
    max-height: 75%;
    object-fit: contain;
    display: block;
    transition:
        max-width 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

#lightbox.is-zoomed .lightbox-item img {
    max-width: 100%;
    max-height: 100%;
}

.lightbox-item .placeholder-icon {
    font-size: 6rem;
    opacity: 0.4;
}

/* Lightbox Zoom Controls */
.lightbox-zoom-controls {
    position: absolute;
    bottom: -60px;
    right: 16px;
    display: flex;
    gap: 16px;
    z-index: 10002;
}

.zoom-btn {
    background: rgba(10, 10, 10, 0.6);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    /* Circle for better look with magnifying glass */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.zoom-btn svg {
    transition: transform 0.3s ease;
}

.zoom-btn:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
    transform: scale(1.1);
    box-shadow: 0 0 20px var(--accent-glow);
}

.zoom-btn:hover svg {
    transform: scale(1.1);
}

.zoom-btn:active {
    transform: scale(0.95);
}

.zoom-btn.info-btn {
    position: absolute;
    right: -60px;
    bottom: 16px;
    z-index: 10002;
}

.zoom-btn.info-btn.active {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

#lightbox.is-zoomed .zoom-btn.zoom-in {
    opacity: 0.2;
    pointer-events: none;
    filter: grayscale(1);
}

#lightbox:not(.is-zoomed) .zoom-btn.zoom-out {
    opacity: 0.2;
    pointer-events: none;
    filter: grayscale(1);
}

/* Lightbox Navigation Buttons */
.lightbox-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(10, 10, 10, 0.4);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.lightbox-btn svg {
    transition: transform 0.3s ease;
}

.lightbox-btn:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 0 30px var(--accent-glow);
}

.lightbox-btn:hover svg {
    transform: scale(1.1);
}

.lightbox-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.lightbox-btn.prev {
    left: -84px;
}

.lightbox-btn.next {
    right: -84px;
}

@media (max-width: 1250px) {
    .lightbox-btn.prev {
        left: 24px;
    }

    .lightbox-btn.next {
        right: 24px;
    }
}

/* Pagination Dots in Lightbox */
#lightbox-nav {
    position: absolute;
    bottom: 7vh;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 10001;
}

.lightbox-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(var(--accent-rgb), 0.2);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lightbox-dot.active {
    background: var(--accent);
    width: 24px;
    border-radius: 4px;
}

/* Lightbox Caption Panel */
#lightbox-caption-panel {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translate(-50%, 102%);
    width: 90%;
    max-width: 650px;
    background: rgba(15, 15, 15, 0.8);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: none;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 32px;
    z-index: 10005;
    transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: 0 -20px 40px rgba(0, 0, 0, 0.4);
}

#lightbox-caption-panel.active {
    transform: translate(-50%, 0);
}

#caption-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 50%;
    z-index: 10;
}

#caption-close:hover {
    color: var(--accent);
    background: rgba(255, 255, 255, 0.05);
    transform: rotate(90deg);
}

.caption-content {
    text-align: center;
    max-width: 440px;
    margin: 0 auto;
}

.caption-title {
    font-family: var(--font-display);
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 12px;
}

.caption-text {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--text-primary);
    opacity: 0.9;
}

.lightbox-close {
    position: fixed;
    top: 24px;
    right: 24px;
    background: rgba(10, 10, 10, 0.4);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10002;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.lightbox-close:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 0 25px var(--accent-glow);
}

.lightbox-close:active {
    transform: scale(0.9);
}

.project-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
}

.project-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-primary);
}

.project-full-title {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    font-style: italic;
}

.project-description {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.project-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.project-tag {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.5px;
    padding: 4px 12px;
    border: 1px solid var(--border-color);
    border-radius: 100px;
    color: var(--text-muted);
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.5px;
    color: var(--accent);
    text-decoration: none;
    padding: 8px 0;
    transition: all var(--transition-base);
    margin-top: 4px;
    width: fit-content;
}

.project-link:hover {
    gap: 14px;
    color: var(--accent-hover);
}

.project-link svg {
    flex-shrink: 0;
}

/* Projects Show More Button */
.projects-action {
    display: flex;
    justify-content: center;
    margin-top: 48px;
}

.show-more-btn {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-primary);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px 32px;
    cursor: pointer;
    transition: all var(--transition-base);
}

.show-more-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 4px 20px rgba(var(--accent-rgb), 0.15);
    transform: translateY(-2px);
}

/* ---------- RESUME SECTION ---------- */
#resume {
    background: var(--bg);
    border-top: 1px solid var(--border-color);
}

.resume-content {
    display: flex;
    justify-content: center;
}

.resume-card {
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-base);
    max-width: 600px;
    width: 100%;
}

.resume-card:hover {
    border-color: var(--accent);
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(var(--accent-rgb), 0.08);
}

.resume-preview-wrapper {
    position: relative;
    width: 160px;
    min-width: 160px;
    height: 220px;
    border-radius: 8px;
    overflow: hidden;
    background: #1a1a1a;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.resume-preview-canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.resume-blur-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
            transparent 0%,
            transparent 30%,
            rgba(10, 10, 10, 0.3) 50%,
            rgba(10, 10, 10, 0.7) 70%,
            rgba(10, 10, 10, 0.95) 100%);
    pointer-events: none;
}

.resume-card-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.resume-card-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-primary);
}

.resume-card-subtitle {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.resume-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 1px;
    color: var(--accent);
    margin-top: 12px;
    padding: 10px 20px;
    border: 1px solid var(--accent);
    border-radius: 6px;
    background: var(--accent-soft);
    transition: all var(--transition-base);
    width: fit-content;
}

.resume-card:hover .resume-card-cta {
    background: rgba(var(--accent-rgb), 0.18);
    box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.1);
    gap: 14px;
}

.resume-card-cta svg {
    flex-shrink: 0;
}

/* ---------- CONTACT SECTION ---------- */
#contact {
    background: var(--bg);
    border-top: 1px solid var(--border-color);
}

.contact-content {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.contact-heading {
    font-family: var(--font-display);
    font-size: clamp(2rem, 3.5vw, 3rem);
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.contact-subtext {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 48px;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 480px;
    margin: 0 auto;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 28px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all var(--transition-base);
}

.contact-card:hover {
    border-color: var(--accent);
    background: var(--bg-card-hover);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(var(--accent-rgb), 0.08);
}

.contact-card:hover .contact-card-arrow {
    transform: translateX(4px);
    color: var(--accent);
}

.contact-card:hover .contact-card-label {
    color: var(--accent);
}

.contact-card svg {
    flex-shrink: 0;
    color: var(--text-muted);
    transition: color var(--transition-base);
}

.contact-card:hover svg {
    color: var(--accent);
}

.contact-card-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    min-width: 70px;
    text-align: left;
    transition: color var(--transition-base);
}

.contact-card-value {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-primary);
    flex: 1;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contact-card-arrow {
    font-size: 1.1rem;
    color: var(--text-muted);
    transition: all var(--transition-base);
    flex-shrink: 0;
}

/* ---------- FOOTER ---------- */
#site-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 80px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 1px;
    color: var(--text-muted);
}

/* ---------- Back to Top Button ---------- */
.back-to-top {
    position: fixed;
    bottom: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    backdrop-filter: blur(8px);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 10px 30px rgba(var(--accent-rgb), 0.15);
    transform: translateY(-4px);
}

.back-to-top svg {
    transition: transform 0.3s ease;
}

.back-to-top:hover svg {
    transform: scale(1.1);
}

@media (max-width: 600px) {
    .back-to-top {
        bottom: 12px;
        right: 12px;
        width: 42px;
        height: 42px;
    }
}

/* ---------- Cursor Glow ---------- */
#cursor-glow {
    position: fixed;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1001;
    background: radial-gradient(circle, rgba(var(--accent-rgb), 0.05) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
    opacity: 0;
}

/* ---------- Color Mode Switch ---------- */
.color-switch {
    position: fixed;
    bottom: 16px;
    left: 16px;
    z-index: 1000;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.switch-track {
    position: relative;
    display: flex;
    align-items: center;
    width: 72px;
    /* Slightly more compact for elegance */
    height: 28px;
    background: rgba(var(--accent-rgb), 0.2);
    /* Subtle base tint */
    border-radius: 100px;
    padding: 0 4px;
    transition: all 0.3s cubic-bezier(0.7, 0, 0.3, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    border: none;
    overflow: hidden;
}

/* Fill the track with solid color on state change */
.switch-track::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent);
    opacity: 0.85;
    transition: background 0.3s cubic-bezier(0.7, 0, 0.3, 1);
    z-index: 1;
}

.switch-thumb {
    position: absolute;
    left: 4px;
    width: 20px;
    height: 20px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.7, 0, 0.3, 1),
        width 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

/* Precise Positions for 3 states */
/* Red (Left) is base transform: none */
[data-color-mode="green"] .switch-thumb {
    transform: translateX(22px);
}

[data-color-mode="blue"] .switch-thumb {
    transform: translateX(44px);
}

.color-switch:hover .switch-track::before {
    opacity: 1;
}

.color-switch:hover .switch-track {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(var(--accent-rgb), 0.4);
}

.color-switch:active .switch-thumb {
    width: 26px;
}

@media (max-width: 600px) {
    .color-switch {
        bottom: 12px;
        left: 12px;
    }
}

/* ---------- Scrollbar (Hidden for Modern UI) ---------- */
/* For Chrome, Safari and Opera */
::-webkit-scrollbar {
    display: none;
}

/* For IE, Edge and Firefox */
html {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

/* ---------- SIDE NAVIGATION ---------- */
.side-nav {
    position: fixed;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1002;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    pointer-events: none;
}

.side-nav-wrapper {
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 20px 8px;
    pointer-events: auto;
    position: relative;
}

/* Vertical line connecting dots */
.side-nav-wrapper::before {
    content: '';
    position: absolute;
    right: 10px;
    /* Dot is center of this container */
    top: 24px;
    bottom: 24px;
    width: 2px;
    background: var(--border-color);
    opacity: 0.5;
    z-index: -1;
}

.side-nav-dot {
    position: relative;
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    display: block;
    text-decoration: none;
}

/* Hit area expansion */
.side-nav-dot::before {
    content: '';
    position: absolute;
    inset: -12px;
}

.side-nav-dot:hover,
.side-nav-dot.active {
    background: var(--accent);
    transform: scale(1.6);
    box-shadow: 0 0 12px var(--accent-glow);
}

.side-nav-label {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 6px 14px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    pointer-events: none;
}

@media (hover: hover) {
    .side-nav-dot:hover .side-nav-label {
        opacity: 1;
        visibility: visible;
        transform: translateY(-50%) translateX(-8px);
    }
}

/* Show on bottom for mobile/tablet */
@media (max-width: 1024px) {
    .side-nav {
        right: auto;
        left: 50%;
        top: auto;
        bottom: 24px;
        transform: translateX(-50%);
        align-items: center;
        width: fit-content;
    }

    .side-nav-wrapper {
        flex-direction: row;
        gap: 32px;
        padding: 12px 24px;
        background: rgba(10, 10, 10, 0.4);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-radius: 100px;
        border: 1px solid var(--border-color);
    }

    /* Horizontal line connecting dots */
    .side-nav-wrapper::before {
        right: 32px;
        left: 32px;
        top: 50%;
        bottom: auto;
        width: auto;
        height: 2px;
        transform: translateY(-50%);
        opacity: 0.8;
    }

    .side-nav-label {
        right: auto;
        left: 50%;
        top: -42px;
        bottom: auto;
        transform: translateX(-50%) translateY(10px);
    }

    .side-nav-wrapper.scrubbing .side-nav-dot.active .side-nav-label {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
        visibility: visible;
    }

    @media (max-width: 600px) {
        .side-nav {
            bottom: 17px;
        }
    }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    :root {
        --section-padding: 100px 28px 64px;
    }

    #navbar {
        padding: 0 24px;
    }

    .nav-link {
        padding: 6px 12px;
        font-size: 0.65rem;
    }

    #hero-layout {
        flex-direction: column;
    }

    #hero-left {
        width: 100%;
        padding: 100px 24px 24px;
        gap: 32px;
    }

    #hero-right {
        width: 100%;
        padding: 0 24px 48px;
        min-height: 380px;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .project-card {
        grid-template-columns: 1fr;
        padding: 24px;
    }

    .project-image-wrapper {
        aspect-ratio: 16 / 9;
    }

    .resume-card {
        flex-direction: column;
        gap: 24px;
        align-items: center;
        text-align: center;
    }

    .resume-preview-wrapper {
        width: 140px;
        min-width: 140px;
        height: 190px;
    }

    .resume-card-cta {
        margin: 8px auto 0;
    }
}

@media (max-width: 600px) {
    :root {
        --section-padding: 88px 20px 48px;
    }

    #navbar {
        padding: 0 16px;
        height: 56px;
    }

    .nav-logo {
        font-size: 1.3rem;
    }

    .nav-links {
        gap: 4px;
    }

    .nav-link {
        padding: 5px 8px;
        font-size: 0.58rem;
        letter-spacing: 1px;
    }

    #hero-layout {
        flex-direction: column;
    }

    #hero-left {
        padding: 88px 20px 24px;
        gap: 24px;
    }

    #hero-right {
        padding: 0 20px 40px;
        min-height: 320px;
    }

    #site-logo {
        font-size: clamp(2.6rem, 11vw, 3.2rem);
        line-height: 0.9;
    }

    #clock-digits {
        font-size: 2.22rem;
        min-width: 90px;
    }

    .section-header {
        margin-bottom: 40px;
        gap: 12px;
    }

    .section-title {
        font-size: 2rem;
    }

    .focus-item {
        padding: 16px;
    }

    .project-card {
        padding: 18px;
    }

    .resume-card {
        padding: 20px;
    }

    .resume-preview-wrapper {
        width: 120px;
        min-width: 120px;
        height: 165px;
    }

    .resume-card-title {
        font-size: 1.4rem;
    }

    .contact-card {
        padding: 18px 20px;
    }

    .contact-card-value {
        font-size: 0.68rem;
    }

    /* Hide email domain on very small screens to prevent overflow */
    @media (max-width: 480px) {
        .contact-email-domain {
            display: none;
        }
    }

    #site-footer {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

}