/* 
 * DESIGN SYSTEM & TYPOGRAPHY - MONOCHROME HERITAGE
 */

:root {
    /* Color Palette - Premium Dark Monochrome Theme */
    --bg-dark: #000000;
    --bg-medium: rgba(18, 18, 20, 0.7);
    --bg-light: rgba(30, 30, 35, 0.8);
    --text-primary: #ffffff;
    --text-secondary: #a0a0a5;
    --text-muted: #5e5e64;
    --text-dark: #0a0a0a;
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.15);
    --accent-glow: rgba(255, 255, 255, 0.15);
    --accent-glow-strong: rgba(255, 255, 255, 0.6);
    
    /* Fonts */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-display: 'Syne', sans-serif;
    
    /* Animations */
    --transition-smooth: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

html {
    scroll-behavior: initial; /* Lenis handles scrolling */
    background-color: var(--bg-dark);
    font-size: 62.5%; /* 1rem = 10px */
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-size: 1.6rem;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Global legibility enhancement: Text drop-shadow to prevent background distraction */
h1, h2, h3, h4, h5, h6, 
.hero-subtitle, .hero-eyebrow,
.section-desc, .about-lead, .about-body, 
.timeline-desc, .project-card-desc, .skill-card-desc,
.tool-name, .tool-percent, .nav-link, .logo-text {
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.95), 0 4px 24px rgba(0, 0, 0, 0.98);
}

/* Accessibility: Focus States */
:focus-visible {
    outline: 2px solid var(--text-primary);
    outline-offset: 4px;
    border-radius: 2px;
}

/* Base Links */
a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

/* The lotus artwork is applied directly to the body for stable fixed coverage. */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    opacity: 0;
    z-index: 0;
    pointer-events: none;
    display: none;
}

/* Interactive Background Canvas — sits behind all page content */
#canvas-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;       /* Behind page content */
    pointer-events: none;
    display: none;
    opacity: 0;
}

.lotus-background {
    --lotus-x: 0px;
    --lotus-y: 0px;
    --lotus-rotate: 0deg;
    --lotus-scale: 1.04;
    --lotus-light: 1;
    --pattern-fill: 0.75;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
    background: transparent;
    opacity: 0;
    transition: opacity 1.2s ease;
}

.lotus-background.is-bloomed {
    opacity: 1;
}

.lotus-background::after {
    display: none;
}

.ambient-mark {
    position: absolute;
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    transform-origin: center;
}

.interactive-stars {
    --star-x: 0px;
    --star-y: 0px;
    --star-rotate: 0deg;
    position: absolute;
    inset: -4%;
    transform: translate3d(var(--star-x), var(--star-y), 0) rotate(var(--star-rotate));
    transform-origin: center;
    will-change: transform;
}

.interactive-star {
    position: absolute;
    width: var(--star-size, 2px);
    height: var(--star-size, 2px);
    border-radius: 50%;
    background: rgba(255, 255, 255, var(--star-alpha, 0.28));
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.22);
}

.falling-star {
    position: absolute;
    left: var(--fall-left);
    top: var(--fall-top);
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
    opacity: 0;
    animation: falling-star-travel var(--fall-duration) cubic-bezier(0.2, 0.7, 0.25, 1) forwards;
}

.falling-star::after {
    content: '';
    position: absolute;
    right: 1px;
    top: 50%;
    width: var(--tail-length);
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5));
    transform: translateY(-50%) rotate(var(--tail-angle));
    transform-origin: right center;
}

@keyframes falling-star-travel {
    0% { opacity: 0; transform: translate3d(0, 0, 0) scale(0.6); }
    12% { opacity: 0.85; }
    72% { opacity: 0.72; }
    100% {
        opacity: 0;
        transform: translate3d(var(--fall-x), var(--fall-y), 0) scale(0.9);
    }
}

.brand-lotus-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 50%;
    mix-blend-mode: screen;
    -webkit-mask-image: radial-gradient(circle, #000 56%, transparent 74%);
    mask-image: radial-gradient(circle, #000 56%, transparent 74%);
    opacity: 0;
    transform: scale(0.18) rotate(-8deg);
    transform-origin: center;
}

.lotus-background.is-bloomed .brand-lotus-image {
    animation: pattern-lotus-bloom 1.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.lotus-copy-one {
    top: 13%; left: 5%; width: clamp(24rem, 30vmin, 40rem);
    opacity: 0.09;
}

.lotus-copy-two {
    top: 23%; left: 34%; width: clamp(11rem, 13vmin, 17rem);
    opacity: 0.15;
}

.lotus-copy-three {
    top: 9%; left: 66%; width: clamp(6rem, 6.5vmin, 8rem);
    opacity: 0.15;
}

.lotus-copy-four {
    top: 27%; left: 93%; width: clamp(17rem, 20vmin, 26rem);
    opacity: 0.15;
}

.lotus-copy-five {
    top: 47%; left: 18%; width: clamp(16rem, 19vmin, 24rem);
    opacity: 0.15;
}

.lotus-copy-six {
    top: 39%; left: 49%; width: clamp(6rem, 7vmin, 9rem);
    opacity: 0.15;
}

.lotus-copy-seven { top: 53%; left: 81%; width: clamp(10rem, 12vmin, 16rem); opacity: 0.15; }
.lotus-copy-eight { top: 74%; left: 4%; width: clamp(6rem, 6.5vmin, 8rem); opacity: 0.15; }
.lotus-copy-nine { top: 65%; left: 34%; width: clamp(11rem, 13vmin, 17rem); opacity: 0.15; }
.lotus-copy-ten { top: 80%; left: 63%; width: clamp(18rem, 21vmin, 27rem); opacity: 0.15; }
.lotus-copy-eleven { top: 70%; left: 94%; width: clamp(6rem, 7vmin, 9rem); opacity: 0.15; }
.lotus-copy-twelve { top: 96%; left: 45%; width: clamp(10rem, 12vmin, 16rem); opacity: 0.15; }
.lotus-copy-thirteen { top: 6%; left: 22%; opacity: 0.15; }
.lotus-copy-fourteen { top: 15%; left: 51%; opacity: 0.15; }
.lotus-copy-fifteen { top: 35%; left: 75%; opacity: 0.15; }
.lotus-copy-sixteen { top: 61%; left: 7%; opacity: 0.15; }
.lotus-copy-seventeen { top: 58%; left: 56%; opacity: 0.15; }
.lotus-copy-eighteen { top: 93%; left: 79%; opacity: 0.15; }
.lotus-copy-nineteen { top: -3%; left: -4%; width: clamp(21rem, 27vmin, 36rem); opacity: 0.055; }
.lotus-copy-twenty { top: 0; left: 100%; opacity: 0.15; }
.lotus-copy-twenty-one { top: 100%; left: 0; opacity: 0.15; }
.lotus-copy-twenty-two { top: 100%; left: 100%; opacity: 0.15; }

/* Consistent responsive hierarchy: seven small, eight medium, seven large. */
.lotus-small { width: clamp(9rem, 11vmin, 14rem); }
.lotus-medium { width: clamp(16rem, 19vmin, 25rem); }
.lotus-large { width: clamp(27rem, 33vmin, 43rem); }

/* Keep the generated artwork atmospheric even at the larger mixed scales. */
.lotus-copy { opacity: 0.075; }
.lotus-copy-one { width: clamp(24rem, 30vmin, 40rem); opacity: 0.095; }
.lotus-copy-nineteen { width: clamp(21rem, 27vmin, 36rem); opacity: 0.055; }
.lotus-copy-four,
.lotus-copy-ten,
.lotus-copy-fifteen,
.lotus-copy-sixteen,
.lotus-copy-twenty-two { opacity: 0.06; }

/* Keep the corner duplicates hidden; selected extras are restored on desktop below. */
.lotus-copy-thirteen,
.lotus-copy-fourteen,
.lotus-copy-fifteen,
.lotus-copy-sixteen,
.lotus-copy-seventeen,
.lotus-copy-eighteen,
.lotus-copy-nineteen,
.lotus-copy-twenty,
.lotus-copy-twenty-one,
.lotus-copy-twenty-two {
    display: none;
}

.lotus-copy-two .brand-lotus-image { animation-delay: 0.12s !important; }
.lotus-copy-three .brand-lotus-image { animation-delay: 0.24s !important; }
.lotus-copy-four .brand-lotus-image { animation-delay: 0.36s !important; }
.lotus-copy-five .brand-lotus-image { animation-delay: 0.48s !important; }
.lotus-copy-six .brand-lotus-image { animation-delay: 0.6s !important; }
.lotus-copy-seven .brand-lotus-image { animation-delay: 0.72s !important; }
.lotus-copy-eight .brand-lotus-image { animation-delay: 0.84s !important; }
.lotus-copy-nine .brand-lotus-image { animation-delay: 0.96s !important; }
.lotus-copy-ten .brand-lotus-image { animation-delay: 1.08s !important; }
.lotus-copy-eleven .brand-lotus-image { animation-delay: 1.2s !important; }
.lotus-copy-twelve .brand-lotus-image { animation-delay: 1.32s !important; }
.lotus-copy-thirteen .brand-lotus-image { animation-delay: 1.44s !important; }
.lotus-copy-fourteen .brand-lotus-image { animation-delay: 1.56s !important; }
.lotus-copy-fifteen .brand-lotus-image { animation-delay: 1.68s !important; }
.lotus-copy-sixteen .brand-lotus-image { animation-delay: 1.8s !important; }
.lotus-copy-seventeen .brand-lotus-image { animation-delay: 1.92s !important; }
.lotus-copy-eighteen .brand-lotus-image { animation-delay: 2.04s !important; }
.lotus-copy-nineteen .brand-lotus-image { animation-delay: 0.08s !important; }
.lotus-copy-twenty .brand-lotus-image { animation-delay: 0.2s !important; }
.lotus-copy-twenty-one .brand-lotus-image { animation-delay: 0.32s !important; }
.lotus-copy-twenty-two .brand-lotus-image { animation-delay: 0.44s !important; }

@keyframes pattern-lotus-bloom {
    0% {
        opacity: 0;
        transform: scale(0.18) rotate(-8deg);
        filter: blur(5px) brightness(1.5);
    }
    55% { opacity: 0.82; }
    100% {
        opacity: 1;
        transform: scale(var(--pattern-fill)) rotate(0deg);
        filter: blur(0) brightness(1);
    }
}

.smooth-scroll-wrapper {
    position: relative;
    z-index: 2;
}

@media (max-width: 768px) {
    .lotus-copy-one { top: 9%; left: -2%; width: 20rem; opacity: 0.08; }
    .lotus-copy-two { top: 18%; left: 69%; width: 11rem; }
    .lotus-copy-three { top: 29%; left: 24%; width: 6rem; }
    .lotus-copy-four { top: 38%; left: 91%; width: 15rem; }
    .lotus-copy-five { top: 45%; left: 48%; width: 10rem; }
    .lotus-copy-six { top: 53%; left: 4%; width: 15rem; }
    .lotus-copy-seven { top: 61%; left: 76%; width: 6rem; }
    .lotus-copy-eight { top: 70%; left: 31%; width: 10rem; }
    .lotus-copy-nine { top: 78%; left: 94%; width: 6rem; }
    .lotus-copy-ten { top: 87%; left: 55%; width: 15rem; }
    .lotus-copy-eleven { top: 94%; left: 8%; width: 10rem; }
    .lotus-copy-twelve { display: none; }
    .lotus-copy-thirteen { top: 5%; left: 48%; }
    .lotus-copy-fourteen { top: 24%; left: 91%; }
    .lotus-copy-fifteen { top: 34%; left: 49%; }
    .lotus-copy-sixteen { top: 68%; left: 5%; }
    .lotus-copy-seventeen { top: 76%; left: 55%; }
    .lotus-copy-eighteen { top: 96%; left: 85%; }
    .lotus-copy-nineteen { display: none; }
    .lotus-copy-twenty { top: 0; left: 100%; width: 10rem; }
    .lotus-copy-twenty-one { top: 100%; left: 0; width: 10rem; }
    .lotus-copy-twenty-two { top: 100%; left: 100%; width: 12rem; }

    .lotus-small { width: 8rem; }
    .lotus-medium { width: 13rem; }
    .lotus-large { width: 20rem; }
}

/* Consistent requested visibility across desktop and mobile. */
.lotus-copy {
    opacity: 0.165;
}

@media (min-width: 769px) {
    .lotus-copy-thirteen,
    .lotus-copy-fourteen,
    .lotus-copy-fifteen,
    .lotus-copy-sixteen,
    .lotus-copy-seventeen,
    .lotus-copy-eighteen {
        display: block;
        opacity: 0.165;
    }

    .lotus-copy-thirteen { top: 6%; left: 43%; width: clamp(6rem, 7vmin, 9rem); }
    .lotus-copy-fourteen { top: 34%; left: 69%; width: clamp(6rem, 7vmin, 9rem); }
    .lotus-copy-fifteen { top: 58%; left: 59%; width: clamp(7rem, 8vmin, 10rem); }
    .lotus-copy-sixteen { top: 91%; left: 18%; width: clamp(9rem, 11vmin, 14rem); }
    .lotus-copy-seventeen { top: 91%; left: 87%; width: clamp(8rem, 10vmin, 13rem); }
    .lotus-copy-eighteen { top: 45%; left: 65%; width: clamp(5rem, 6vmin, 8rem); }
}

@media (prefers-reduced-motion: reduce) {
    .lotus-background {
        opacity: 1;
    }

    .lotus-background::after { display: none; }
    .ambient-mark { transform: translate(-50%, -50%); }
    .interactive-stars { transform: none; }
    .falling-star { display: none; }
    .brand-lotus-image { opacity: 1; transform: none; animation: none !important; }
}

/* Preloader */
#preloader {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    z-index: 9999;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}
#preloader.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}
.preloader-inner { text-align: center; }
.preloader-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #111, #000);
    box-shadow: 0 8px 30px rgba(0,0,0,0.7);
    animation: preloader-pulse 1.8s infinite;
}
.preloader-logo, .site-logo {
    width: 76px;
    height: 76px;
    object-fit: contain;
    border-radius: 50%;
    display: block;
}
@keyframes preloader-pulse { 0%{ transform:scale(1);}50%{ transform:scale(0.97);}100%{ transform:scale(1);} }

.preloader-bar {
    width: 120px;
    height: 2px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    margin: 2rem auto 0;
    overflow: hidden;
}
.preloader-bar-fill {
    display: block;
    height: 100%;
    width: 0%;
    background: var(--text-primary);
    border-radius: 2px;
    animation: preloader-bar-anim 1.4s ease-in-out forwards;
}
@keyframes preloader-bar-anim {
    0%   { width: 0%; }
    60%  { width: 80%; }
    100% { width: 100%; }
}

/* Header logo image wrapper */
.logo-img-wrap { display:inline-block; width:44px; height:44px; margin-right:1rem; }
.logo-img-wrap .site-logo { width:44px; height:44px; }

/* Typography Utility */
.font-syne {
    font-family: var(--font-display);
    font-weight: 700;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-fast);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Layout Elements */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 4rem;
}

@media (max-width: 768px) {
    .container {
        padding: 0 2.4rem;
    }
}

/* Motif Overlay Background */
.motif-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.012), transparent 24%);
    opacity: 1;
}

/* Global Glowing Effect */
.text-glow {
    text-shadow: 0 0 20px var(--accent-glow);
}

/* --- HEADER / NAVIGATION --- */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    transition: var(--transition-fast);
}

.header-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 2.4rem 4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@media (max-width: 768px) {
    .header-container {
        padding: 2rem 2.4rem;
    }
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.8rem;
    letter-spacing: 0.1em;
}

.logo-circle {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-primary);
    box-shadow: 0 0 10px var(--text-primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4rem;
}

.nav-link {
    font-size: 1.4rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
    position: relative;
    padding: 0.5rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--text-primary);
    transition: var(--transition-fast);
    box-shadow: 0 0 5px var(--text-primary);
}

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

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

.nav-btn {
    border: 1px solid var(--border-light);
    padding: 1.2rem 2.4rem;
    border-radius: 4px;
    background-color: #000000;
}

.nav-btn:hover {
    background-color: var(--text-primary);
    color: var(--bg-dark);
}

/* Mobile Nav Toggle */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 6px;
    z-index: 110;
}

.mobile-nav-toggle .line {
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    transition: var(--transition-fast);
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    .mobile-nav-toggle {
        display: flex;
    }
}

/* Mobile Nav Overlay */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--bg-dark);
    z-index: 99;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.mobile-nav-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4rem;
}

.mobile-link {
    font-family: var(--font-display);
    font-size: 3.2rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.mobile-link:hover {
    color: var(--text-primary);
    text-shadow: 0 0 15px var(--accent-glow);
}

.mobile-nav-toggle.active .line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.mobile-nav-toggle.active .line:nth-child(2) {
    transform: rotate(-45deg) translateY(-0px);
}

/* --- HERO SECTION --- */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 100px;
    overflow: hidden;
}

.hero-portrait {
    --portrait-opacity: 0.9;
    position: absolute;
    right: 8%;
    top: 18%;
    bottom: auto;
    width: 34%;
    height: 76%;
    max-height: none;
    z-index: 4;
    pointer-events: none;
    opacity: 0;
    transform: translate3d(5rem, 2rem, 0) scale(1.03);
    animation: hero-portrait-in 1.7s cubic-bezier(0.16, 1, 0.3, 1) 0.45s forwards;
    -webkit-mask-image:
        linear-gradient(to right, transparent 0%, #000 20%, #000 92%, transparent 100%),
        linear-gradient(to bottom, transparent 0%, #000 12%, #000 82%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image:
        linear-gradient(to right, transparent 0%, #000 20%, #000 92%, transparent 100%),
        linear-gradient(to bottom, transparent 0%, #000 12%, #000 82%, transparent 100%);
    mask-composite: intersect;
}

.hero-portrait::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.72), transparent 42%);
}

.hero-portrait img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: 52% 43%;
    filter: grayscale(1) contrast(1.08) brightness(0.91);
}

.contact-mobile-portrait {
    display: none;
}

@keyframes hero-portrait-in {
    to {
        opacity: var(--portrait-opacity);
        transform: translate3d(0, 0, 0) scale(1);
    }
}

.hero-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    z-index: 10;
    min-height: calc(100vh - 160px);
}

@media (max-width: 992px) {
    .hero-container {
        align-items: center;
        text-align: center;
    }

    .hero-portrait {
        --portrait-opacity: 0.24;
        right: -1%;
        top: 20%;
        bottom: auto;
        width: 68%;
        height: 72%;
        opacity: 0;
        filter: brightness(0.65);
    }

}

@media (max-width: 600px) {
    .hero-portrait {
        right: -14%;
        top: 27%;
        width: 96%;
        height: 66%;
        bottom: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-portrait {
        animation: none;
        opacity: var(--portrait-opacity);
        transform: none;
    }
}

.hero-content {
    max-width: 860px;
}

@media (max-width: 992px) {
    .hero-content {
        margin: 0 auto;
    }
}

.hero-eyebrow {
    font-size: 1.4rem;
    letter-spacing: 0.25em;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

.hero-eyebrow::after {
    content: '';
    position: absolute;
    right: -40px;
    top: 50%;
    width: 24px;
    height: 1px;
    background-color: var(--border-light);
}

@media (max-width: 992px) {
    .hero-eyebrow::after {
        display: none;
    }
}

.hero-title {
    margin-bottom: 3rem;
    letter-spacing: -0.01em;
}

.brand-name {
    display: block;
    font-size: clamp(2.4rem, 4vw, 4rem);
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.personal-name {
    display: block;
    font-size: clamp(3.6rem, 6.5vw, 7.2rem);
    line-height: 1.05;
}

.hero-subtitle {
    font-size: clamp(1.6rem, 2vw, 2rem);
    color: var(--text-secondary);
    margin-bottom: 4.8rem;
    font-weight: 300;
    max-width: 500px;
}

@media (max-width: 992px) {
    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }
}

.hero-actions {
    display: flex;
    gap: 2rem;
    align-items: center;
}

@media (max-width: 992px) {
    .hero-actions {
        justify-content: center;
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 1.2rem;
    font-size: 1.4rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1.6rem 3.2rem;
    border-radius: 4px;
    transition: var(--transition-fast);
    cursor: pointer;
}

.btn-primary {
    background-color: var(--text-primary);
    color: var(--bg-dark);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(255, 255, 255, 0.25);
}

.btn-secondary {
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    background-color: #000000;
}

.btn-secondary:hover {
    border-color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.03);
}

/* Scroll indicator mouse */
.hero-scroll-indicator {
    position: absolute;
    bottom: 4.8rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    opacity: 0.7;
    z-index: 10;
}

.indicator-mouse {
    width: 20px;
    height: 36px;
    border: 1.5px solid var(--text-secondary);
    border-radius: 10px;
    position: relative;
}

.indicator-wheel {
    width: 3px;
    height: 7px;
    background-color: var(--text-primary);
    border-radius: 1.5px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollMouse 1.5s infinite;
}

@keyframes scrollMouse {
    0% { transform: translate(-50%, 0); opacity: 1; }
    50% { transform: translate(-50%, 6px); opacity: 0.2; }
    100% { transform: translate(-50%, 0); opacity: 1; }
}

.indicator-text {
    font-size: 1rem;
    letter-spacing: 0.2em;
    color: var(--text-secondary);
}

/* --- SECTIONS COMMON --- */
section {
    padding: 14rem 0;
    position: relative;
    z-index: 10;
    border-bottom: 1px solid var(--border-subtle);
}

@media (max-width: 768px) {
    section {
        padding: 10rem 0;
    }
}

.section-grid {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 6rem;
}

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

.section-title {
    font-size: 3.6rem;
    line-height: 1.1;
    letter-spacing: -0.01em;
    text-transform: uppercase;
}

.section-subtitle {
    display: block;
    font-size: 1.2rem;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
    margin-top: 1rem;
    text-transform: uppercase;
}

.section-header-center {
    max-width: 700px;
    margin: 0 auto 8rem;
}

.section-desc {
    font-size: 1.8rem;
    color: var(--text-secondary);
    margin-top: 1.6rem;
    font-weight: 300;
}

.text-center {
    text-align: center;
}

/* --- ABOUT SECTION --- */
.about-lead {
    font-size: 2.8rem;
    line-height: 1.3;
    margin-bottom: 3.2rem;
    font-weight: 600;
}

.about-body {
    font-size: 1.6rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-weight: 300;
}

/* About Lenses (Three Pillars) */
.about-lenses {
    display: flex;
    flex-direction: column;
    gap: 3.2rem;
    margin-top: 3.2rem;
}

.about-lens {
    padding: 2.8rem 3.2rem;
    border-left: 2px solid var(--border-light);
    background: linear-gradient(135deg, rgba(255,255,255,0.02) 0%, transparent 100%);
    border-radius: 0 4px 4px 0;
    transition: var(--transition-smooth);
}

.about-lens:hover {
    border-left-color: var(--text-primary);
    background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, transparent 100%);
    box-shadow: -2px 0 20px rgba(255,255,255,0.05);
}

.about-lens-title {
    font-size: 2rem;
    margin-bottom: 1.2rem;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

.about-lens-desc {
    font-size: 1.5rem;
    color: var(--text-secondary);
    font-weight: 300;
    line-height: 1.7;
}

/* --- SKILLS SECTION --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2rem;
    margin-bottom: 12rem;
}

.skills-grid .skill-card {
    padding: 3.2rem 2.6rem;
}

.skills-grid .skill-card-title {
    font-size: clamp(1.75rem, 1.6vw, 2.2rem);
}

.interests-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3rem;
    max-width: 900px;
    margin: 0 auto;
}

.skill-card {
    background-color: var(--bg-medium);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    padding: 4rem;
    border-radius: 4px;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.skill-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-light);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.skill-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--transition-fast);
    box-shadow: 0 0 10px var(--text-primary);
}

.skill-card:hover::after {
    transform: scaleX(1);
}

.skill-icon-box {
    margin-bottom: 3rem;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.skill-card:hover .skill-icon-box {
    color: var(--text-primary);
    transform: scale(1.1);
}

.skill-card-title {
    font-size: 2.2rem;
    margin-bottom: 1.6rem;
}

.skill-card-desc {
    font-size: 1.4rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-weight: 300;
    line-height: 1.6;
}

.skill-focus-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    margin-top: auto;
}

.skill-focus-item {
    font-size: 1.3rem;
    color: var(--text-secondary);
    display: flex;
    align-items: flex-start;
    gap: 1.2rem;
    line-height: 1.5;
}

.skill-focus-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    background-color: var(--text-muted);
    transition: var(--transition-fast);
    margin-top: 0.6rem;
}

.skill-card:hover .skill-focus-dot {
    background-color: var(--text-primary);
    box-shadow: 0 0 5px var(--text-primary);
}

/* Tools System styling */
.tools-wrapper {
    background-color: var(--bg-medium);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 6rem;
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
}

.tools-title {
    font-size: 2rem;
    letter-spacing: 0.1em;
    margin-bottom: 4.8rem;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 3.2rem;
}

.tool-item {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.tool-info {
    display: flex;
    justify-content: space-between;
    font-size: 1.3rem;
    font-weight: 500;
}

.tool-name {
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

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

.tool-progress-bg {
    width: 100%;
    height: 3px;
    background-color: var(--border-subtle);
    border-radius: 1.5px;
    overflow: hidden;
    position: relative;
}

.tool-progress-fill {
    height: 100%;
    background-color: var(--text-muted);
    border-radius: 1.5px;
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--transition-smooth);
}

.tool-item:hover .tool-progress-fill {
    background-color: var(--text-primary);
    box-shadow: 0 0 8px var(--text-primary);
}

/* --- TIMELINE SECTION --- */
.timeline-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 4rem 0;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: var(--border-subtle);
    transform: translateX(-50%);
}

.timeline-line-fill {
    width: 100%;
    height: 0;
    background-color: var(--text-primary);
    box-shadow: 0 0 10px var(--text-primary);
}

.timeline-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8rem;
    margin-bottom: 8rem;
    position: relative;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: 50%;
    top: 8px;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--bg-dark);
    border: 2px solid var(--text-muted);
    z-index: 5;
    transition: var(--transition-fast);
}

.timeline-item.active .timeline-marker {
    border-color: var(--text-primary);
    background-color: var(--text-primary);
    box-shadow: 0 0 10px var(--text-primary);
}

.timeline-left {
    text-align: right;
}

.timeline-right {
    text-align: left;
}

.timeline-item.right-align .timeline-right {
    grid-column: 2;
}

.timeline-year {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.timeline-item.active .timeline-year {
    color: var(--text-primary);
    text-shadow: 0 0 10px var(--accent-glow);
}

.timeline-title {
    font-size: 2rem;
    margin: 0.8rem 0;
}

.timeline-institution {
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 1.6rem;
}

.timeline-item.active .timeline-institution {
    color: var(--text-secondary);
}

.timeline-desc {
    font-size: 1.4rem;
    color: var(--text-secondary);
    font-weight: 300;
}

@media (max-width: 768px) {
    .timeline-line {
        left: 20px;
    }
    .timeline-marker {
        left: 20px;
    }
    .timeline-item {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding-left: 5rem;
        margin-bottom: 6rem;
    }
    .timeline-left {
        text-align: left;
    }
    .timeline-item.right-align .timeline-right {
        grid-column: 1;
    }
    .timeline-year {
        font-size: 1.6rem;
    }
}

/* --- PROJECTS SECTION --- */
.project-filters {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 6rem;
    flex-wrap: wrap;
}

.filter-btn {
    background-color: #000000;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 1.2rem 2.4rem;
    border-radius: 20px;
    font-size: 1.3rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.filter-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-light);
}

.filter-btn.active {
    background-color: var(--text-primary);
    color: var(--bg-dark);
    border-color: var(--text-primary);
    font-weight: 600;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2rem;
}

.projects-grid .project-info {
    padding: 2.4rem 2rem;
}

.projects-grid .project-card-title {
    font-size: clamp(1.65rem, 1.5vw, 2rem);
}

.project-card {
    background-color: var(--bg-medium);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
}

.category-card {
    cursor: default;
}

.portfolio-link-btn {
    min-height: 4.4rem;
    margin-top: 2.4rem;
    padding: 1.1rem 1.4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 1.1rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.portfolio-link-btn:hover {
    background: var(--text-primary);
    color: var(--bg-dark);
}

.portfolio-link-btn.is-disabled {
    cursor: default;
    color: var(--text-muted);
    border-color: var(--border-subtle);
}

.portfolio-link-btn.is-disabled:hover {
    background: transparent;
    color: var(--text-muted);
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-light);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.project-image-box {
    width: 100%;
    aspect-ratio: 16/10;
    overflow: hidden;
    position: relative;
    background-color: var(--bg-dark);
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1) contrast(1.1) brightness(0.9);
    transform: scale(var(--image-scale, 1));
    transition: var(--transition-smooth);
}

.project-card:hover .project-image {
    filter: grayscale(0) contrast(1) brightness(1);
    transform: scale(calc(var(--image-scale, 1) + 0.05));
}

.project-info {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.6rem;
    flex-wrap: wrap;
}

.project-tag {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
    padding: 0.4rem 1rem;
    border-radius: 20px;
}

.project-card:hover .project-tag {
    color: var(--text-secondary);
    border-color: var(--border-light);
}

.project-card-title {
    font-size: 2rem;
    margin-bottom: 1.2rem;
}

.project-card-desc {
    font-size: 1.4rem;
    color: var(--text-secondary);
    font-weight: 300;
    line-height: 1.5;
    flex-grow: 1;
}

/* --- CODE & REPOSITORIES SECTION --- */
.repos-section {
    border-bottom: 1px solid var(--border-subtle);
}

.repos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 3rem;
    margin-bottom: 5rem;
}

.repo-card {
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
    background-color: var(--bg-medium);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    padding: 3.6rem;
    border-radius: 4px;
    transition: var(--transition-smooth);
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.repo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--text-primary), transparent);
    transform: scaleX(0);
    transition: var(--transition-fast);
}

.repo-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-light);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255,255,255,0.03);
}

.repo-card:hover::before {
    transform: scaleX(1);
}

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

.repo-icon {
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.repo-card:hover .repo-icon {
    color: var(--text-primary);
}

.repo-arrow {
    color: var(--text-muted);
    transition: var(--transition-fast);
    transform: translate(0, 0);
}

.repo-card:hover .repo-arrow {
    color: var(--text-primary);
    transform: translate(3px, -3px);
}

.repo-card-title {
    font-size: 2rem;
    color: var(--text-primary);
}

.repo-card-desc {
    font-size: 1.4rem;
    color: var(--text-secondary);
    font-weight: 300;
    line-height: 1.6;
    flex-grow: 1;
}

.repo-link-text {
    font-size: 1.3rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    transition: var(--transition-fast);
    margin-top: 0.8rem;
}

.repo-card:hover .repo-link-text {
    color: var(--text-primary);
}

.repos-cta {
    display: flex;
    justify-content: center;
}

.repos-explore-btn {
    display: inline-flex;
    align-items: center;
    gap: 1.2rem;
}

@media (max-width: 600px) {
    .repos-grid {
        grid-template-columns: 1fr;
    }
}

/* --- CONTACT SECTION --- */
.contact-content-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.contact-header {
    text-align: center;
    margin-bottom: 6rem;
}

.contact-title {
    font-size: clamp(3.6rem, 5vw, 5.6rem);
    line-height: 1.1;
    margin-bottom: 2.4rem;
}

.contact-subtitle {
    font-size: 1.8rem;
    color: var(--text-secondary);
    font-weight: 300;
    max-width: 500px;
    margin: 0 auto;
}

/* Copy Email Banner */
.email-banner {
    background-color: var(--bg-medium);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    padding: 3rem 4rem;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    margin-bottom: 8rem;
    position: relative;
    overflow: hidden;
}

.email-banner::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1.5px;
    background-color: var(--text-primary);
    transition: var(--transition-smooth);
    box-shadow: 0 0 10px var(--text-primary);
}

.email-banner:hover {
    border-color: var(--border-light);
    transform: scale(1.01);
}

.email-banner:hover::after {
    width: 100%;
}

.email-details {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.email-label {
    font-size: 1.1rem;
    letter-spacing: 0.15em;
    color: var(--text-muted);
}

.email-address {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 2.5vw, 2.8rem);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.email-row {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-top: 0.7rem;
    padding: 0.8rem 1rem;
    margin-left: -1rem;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.email-row:hover,
.email-row:focus-visible {
    border-color: var(--border-light);
    background: rgba(255, 255, 255, 0.025);
    outline: none;
}

.email-kind {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.email-address-secondary {
    color: var(--text-secondary);
    font-size: clamp(1.45rem, 2vw, 2.1rem);
    font-weight: 500;
}

.email-action {
    display: flex;
    align-items: center;
    gap: 1.6rem;
}

.copy-text {
    font-size: 1.2rem;
    letter-spacing: 0.1em;
    font-weight: 600;
    color: var(--text-secondary);
}

.copy-icon {
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.email-banner:hover .copy-icon {
    color: var(--text-primary);
}

@media (max-width: 600px) {
    .email-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 3rem;
        padding: 3rem;
    }
    .email-action {
        width: 100%;
        justify-content: space-between;
    }
}

/* Social Grid Links */
.social-links-container {
    display: flex;
    flex-direction: column;
    gap: 2.4rem;
    align-items: center;
}

.social-title {
    font-size: 1.2rem;
    letter-spacing: 0.25em;
    color: var(--text-muted);
}

.social-grid {
    display: flex;
    gap: 2.4rem;
    flex-wrap: wrap;
    justify-content: center;
}

.social-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.4rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    padding: 1.2rem 2.4rem;
    border-radius: 4px;
}

.social-item:hover {
    color: var(--text-primary);
    border-color: var(--border-light);
    background-color: rgba(255, 255, 255, 0.02);
}

@media (min-width: 769px) {
    .social-grid {
        width: 100%;
        flex-wrap: nowrap;
    }

    .social-item {
        flex: 1 1 0;
        justify-content: center;
        padding-inline: clamp(1.2rem, 2vw, 2.4rem);
        white-space: nowrap;
    }
}

/* --- FOOTER --- */
.main-footer {
    border-top: 1px solid var(--border-subtle);
    background-color: #000000;
    padding: 4.8rem 0;
    position: relative;
    z-index: 10;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 1.3rem;
}

.credits {
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

@media (max-width: 600px) {
    .footer-container {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }
}

/* --- MODAL DETAILED OVERLAY --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
    padding: 4rem 2rem;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-container {
    background-color: var(--bg-medium);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    width: 100%;
    max-width: 900px;
    max-height: 90%;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    transform: scale(0.96);
    transition: var(--transition-smooth);
}

.modal-close {
    position: absolute;
    right: 2.4rem;
    top: 2.4rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    z-index: 10;
    transition: var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
    transform: rotate(90deg);
}

.modal-content {
    padding: 6rem;
}

@media (max-width: 768px) {
    .modal-content {
        padding: 4rem 2.4rem;
    }
}

/* Modal Internal Elements */
.modal-project-title {
    font-size: 3.6rem;
    margin-bottom: 1.6rem;
}

.modal-project-cat {
    font-size: 1.2rem;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4rem;
    display: block;
}

.modal-image-wrapper {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6rem;
    background-color: var(--bg-dark);
}

.modal-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-section-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6rem;
    margin-bottom: 6rem;
}

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

.modal-block {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.modal-label {
    font-size: 1.1rem;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.modal-body-text {
    font-size: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.6;
    font-weight: 300;
}

.modal-footer {
    border-top: 1px solid var(--border-subtle);
    padding-top: 4rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.modal-tag {
    font-size: 1.2rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    padding: 0.6rem 1.4rem;
    border-radius: 20px;
}

/* --- UI POLISH & MOBILE REFINEMENTS --- */

/* Fix Sticky Hovers on Touch Devices */
@media (hover: none) {
    .project-card:hover { transform: none; border-color: var(--border-subtle); box-shadow: none; }
    .project-card:hover .project-image { transform: none; }
    .skill-card:hover { transform: none; box-shadow: none; border-color: var(--border-subtle); }
    .skill-card:hover .skill-icon-box { transform: none; color: inherit; }
    .skill-card:hover .skill-focus-dot { background-color: var(--border-light); box-shadow: none; }
    .repo-card:hover { transform: none; border-color: var(--border-subtle); box-shadow: none; }
    .repo-card:hover::before { transform: scaleX(0); }
    .repo-card:hover .repo-icon, .repo-card:hover .repo-arrow, .repo-card:hover .repo-link-text { color: inherit; transform: none; }
    .about-lens:hover { border-left-color: var(--border-light); background: linear-gradient(135deg, rgba(255,255,255,0.02) 0%, transparent 100%); box-shadow: none; }
    .btn-primary:hover, .btn-secondary:hover { transform: none; box-shadow: none; }
    .nav-link:hover { color: var(--text-secondary); }
    .nav-link:hover::after { transform: scaleX(0); }
}

/* Specific Mobile Padding Adjustments */
@media (max-width: 600px) {
    .about-lens {
        padding: 2rem 1.8rem;
    }
    .repo-card {
        padding: 2.4rem;
    }
}

/* --- MOBILE USABILITY PASS: desktop and laptop rules remain unchanged --- */
@media (max-width: 768px) {
    html {
        scroll-padding-top: 7.2rem;
    }

    body {
        font-size: 1.5rem;
    }

    .container {
        padding-inline: max(2rem, env(safe-area-inset-left));
    }

    .header-container {
        min-height: 7.2rem;
        padding: 1.2rem max(2rem, env(safe-area-inset-right));
    }

    .logo-img-wrap,
    .logo-img-wrap .site-logo {
        width: 3.2rem;
        height: 3.2rem;
    }

    .logo-text {
        max-width: none;
        overflow: visible;
        font-size: 1.15rem;
        letter-spacing: 0.045em;
        white-space: nowrap;
    }

    .mobile-nav-toggle {
        width: 4.8rem;
        height: 4.8rem;
        align-items: center;
        justify-content: center;
        padding: 1.2rem;
        margin-right: -1.2rem;
        touch-action: manipulation;
    }

    .mobile-nav-overlay {
        height: 100dvh;
        padding: 9rem 2rem max(3rem, env(safe-area-inset-bottom));
        overflow-y: auto;
    }

    .mobile-nav-links {
        width: min(100%, 36rem);
        gap: 1rem;
    }

    .mobile-link {
        width: 100%;
        min-height: 5.6rem;
        display: grid;
        place-items: center;
        font-size: clamp(2rem, 7vw, 2.8rem);
        border-bottom: 1px solid var(--border-subtle);
        touch-action: manipulation;
    }

    section {
        padding: 7.2rem 0;
    }

    .hero-section {
        min-height: 100svh;
        padding-top: 7.2rem;
        align-items: stretch;
    }

    .hero-container {
        min-height: calc(100svh - 7.2rem);
        justify-content: center;
        padding-top: 3rem;
        padding-bottom: 8rem;
    }

    .hero-content {
        width: 100%;
        position: relative;
        z-index: 2;
    }

    .hero-eyebrow {
        max-width: 100%;
        margin-bottom: 1.6rem;
        font-size: 1.1rem;
        letter-spacing: 0.18em;
        line-height: 1.5;
    }

    .hero-title {
        margin-bottom: 2.2rem;
    }

    .brand-name {
        font-size: clamp(2rem, 8vw, 3rem);
        overflow-wrap: anywhere;
    }

    .personal-name {
        max-width: 100%;
        margin-inline: auto;
        font-size: clamp(3rem, 9.6vw, 4.2rem);
        line-height: 1.08;
        overflow-wrap: normal;
        word-break: normal;
        text-align: center;
    }

    .hero-subtitle {
        max-width: 34rem;
        margin-bottom: 3rem;
        font-size: 1.55rem;
        line-height: 1.65;
        text-wrap: pretty;
    }

    .hero-actions {
        width: min(100%, 34rem);
        margin-inline: auto;
        gap: 1.2rem;
    }

    .hero-actions .btn {
        min-height: 5rem;
        flex: 1 1 0;
        justify-content: center;
        padding: 1.4rem 1.6rem;
        white-space: nowrap;
        touch-action: manipulation;
    }

    .hero-scroll-indicator {
        bottom: max(1.6rem, env(safe-area-inset-bottom));
    }

    .indicator-text {
        display: none;
    }

    .section-header-center {
        margin-bottom: 4.8rem;
    }

    .section-title {
        font-size: clamp(2.8rem, 9vw, 3.4rem);
    }

    .section-desc {
        font-size: 1.55rem;
        line-height: 1.65;
    }

    .section-grid {
        gap: 3.6rem;
    }

    .about-section .section-header,
    .about-content {
        text-align: center;
    }

    .about-section .section-grid,
    .about-section .about-lead,
    .about-section .about-body,
    .about-section .about-lens,
    .about-section .about-lens-title,
    .about-section .about-lens-desc {
        text-align: center;
    }

    .about-section .about-lens {
        border-left: 0;
        border-top: 1px solid var(--border-light);
        border-radius: 4px;
    }

    .about-section .section-title {
        font-size: clamp(2.6rem, 8vw, 3.2rem);
    }

    .about-section .section-subtitle {
        max-width: 32rem;
        margin: 1.2rem auto 0;
        font-size: 1.05rem;
        line-height: 1.65;
        letter-spacing: 0.12em;
    }

    .about-lead {
        max-width: 34rem;
        margin: 0 auto 2.8rem;
        font-size: clamp(2rem, 6vw, 2.4rem);
        line-height: 1.42;
        text-wrap: balance;
    }

    .about-body {
        max-width: 36rem;
        margin: 0 auto 2rem;
        font-size: 1.45rem;
        line-height: 1.75;
        text-wrap: pretty;
    }

    .skills-grid,
    .interests-grid,
    .projects-grid,
    .repos-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.6rem;
    }

    .skills-grid {
        margin-bottom: 6rem;
    }

    .skill-card,
    .skills-grid .skill-card {
        padding: 2.6rem 2.2rem;
    }

    .skill-icon-box {
        margin-bottom: 2rem;
    }

    .skill-card-desc {
        margin-bottom: 2.2rem;
    }

    .tools-wrapper {
        padding: 3.2rem 2.2rem;
    }

    .tools-title {
        margin-bottom: 3.2rem;
        line-height: 1.4;
    }

    .tools-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 2.4rem;
    }

    .timeline-item {
        padding-left: 4.4rem;
        margin-bottom: 4.8rem;
    }

    .timeline-line,
    .timeline-marker {
        left: 1.2rem;
    }

    .project-filters {
        justify-content: flex-start;
        flex-wrap: nowrap;
        gap: 0.8rem;
        margin-inline: -2rem;
        margin-bottom: 3.2rem;
        padding: 0 2rem 0.8rem;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .project-filters::-webkit-scrollbar {
        display: none;
    }

    .filter-btn {
        min-height: 4.4rem;
        flex: 0 0 auto;
        padding: 1rem 1.7rem;
        touch-action: manipulation;
    }

    .project-card,
    .repo-card {
        min-width: 0;
    }

    .project-info,
    .projects-grid .project-info {
        padding: 2.2rem;
    }

    .email-banner {
        margin-bottom: 5rem;
    }

    .email-address {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .social-grid {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.2rem;
    }

    .social-item {
        width: 100%;
        min-height: 4.8rem;
        justify-content: center;
        padding: 1.2rem 1rem;
        font-size: 1.2rem;
    }

    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .modal-container {
        max-height: 92dvh;
        border-radius: 1.2rem 1.2rem 0 0;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .modal-close {
        top: 1.2rem;
        right: 1.2rem;
        width: 4.8rem;
        height: 4.8rem;
        display: grid;
        place-items: center;
        border-radius: 50%;
        background: rgba(0, 0, 0, 0.72);
    }

    .modal-content {
        padding: 5.6rem 2rem 3rem;
    }

    .modal-project-title {
        padding-right: 4rem;
        font-size: clamp(2.6rem, 9vw, 3.4rem);
    }

    .modal-image-wrapper,
    .modal-section-grid {
        margin-bottom: 3.6rem;
    }

    /* Keep the brand atmosphere without crowding a narrow viewport. */
    .lotus-copy-three,
    .lotus-copy-five,
    .lotus-copy-seven,
    .lotus-copy-nine,
    .lotus-copy-eleven,
    .lotus-copy-thirteen,
    .lotus-copy-fourteen,
    .lotus-copy-fifteen,
    .lotus-copy-seventeen,
    .lotus-copy-eighteen,
    .lotus-copy-twenty,
    .lotus-copy-twenty-one,
    .lotus-copy-twenty-two {
        display: none;
    }

    .lotus-copy-one { top: 10%; left: -10%; width: 15rem; }
    .lotus-copy-two { top: 23%; left: 88%; width: 9rem; }
    .lotus-copy-four { top: 42%; left: 96%; width: 12rem; }
    .lotus-copy-six { top: 57%; left: -5%; width: 12rem; }
    .lotus-copy-eight { top: 75%; left: 82%; width: 9rem; }
    .lotus-copy-ten { top: 92%; left: 12%; width: 12rem; }

    .hero-portrait {
        display: none;
    }

    .contact-mobile-portrait {
        position: relative;
        display: block;
        width: clamp(17rem, 54vw, 21rem);
        aspect-ratio: 1;
        margin: 5rem auto 0;
        overflow: hidden;
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 50%;
        background: #080808;
        box-shadow:
            0 0 0 0.7rem rgba(255, 255, 255, 0.025),
            0 1.8rem 4rem rgba(0, 0, 0, 0.55);
    }

    .contact-mobile-portrait::after {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: inherit;
        background: linear-gradient(180deg, transparent 52%, rgba(0, 0, 0, 0.3));
        pointer-events: none;
    }

    .contact-mobile-portrait img {
        width: 100%;
        height: 100%;
        display: block;
        object-fit: cover;
        object-position: 52% 30%;
        filter: grayscale(1) contrast(1.08) brightness(1.08);
    }

}

@media (max-width: 430px) {
    .logo-text {
        max-width: none;
        overflow: visible;
        text-overflow: clip;
        white-space: nowrap;
        font-size: 1.05rem;
        letter-spacing: 0.03em;
    }

    .hero-actions {
        flex-direction: column;
    }

    .hero-actions .btn {
        width: 100%;
        flex-basis: auto;
    }

    .personal-name {
        font-size: clamp(2.8rem, 9.4vw, 3.8rem);
    }

    .contact-title {
        font-size: 3.2rem;
    }

    .email-banner {
        padding: 2.4rem 2rem;
    }
}
