/* =========================================
   1. VARIABLES & THEMES
   ========================================= */

@font-face {
    font-family: 'Blorado';
    src: url("fonts/NeurialGrotesk-Regular.otf") format("opentype");
    font-weight: normal;
    font-display: swap;
    font-style: normal;
}

@font-face {
    font-family: 'Blorado';
    src: url("fonts/NeurialGrotesk-Medium.otf") format("opentype");
    font-weight: 500;
    font-display: swap;
    font-style: normal;
}

@font-face {
    font-family: 'Blorado';
    src: url("fonts/NeurialGrotesk-Bold.otf") format("opentype");
    font-weight: 600;
    font-display: swap;
    font-style: normal;
}

@font-face {
    font-family: 'Blorado';
    src: url("fonts/NeurialGrotesk-Extrabold.otf") format("opentype");
    font-weight: bold;
    font-display: swap;
    font-style: normal;
}

:root {
    --bg-color: #0a0a0a;
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --bg-text: #111111;
    --link-color: #888888;
    --grid-color: rgba(255, 255, 255, 0.03);
    --glow-1: rgba(138, 43, 226, 0.2);
    --glow-2: rgba(0, 191, 255, 0.2);
}

body.light-mode {
    --bg-color: #f0f2f5;
    --text-main: #1a1a1a;
    --text-muted: #555555;
    --bg-text: #e0e0e0;
    --link-color: #555555;
    --grid-color: rgba(0, 0, 0, 0.03);
    --glow-1: rgba(255, 182, 255, 0.4);
    --glow-2: rgba(182, 255, 255, 0.4);
}

/* =========================================
   2. RESET & BASE
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    padding: 3rem 10%;
    transition: background-color 0.4s ease, color 0.4s ease;
}

body,
a,
button {
    cursor: none;
}

nav,
main {
    position: relative;
    z-index: 10;
}

/* =========================================
   3. THE GLOWING AURORA & GRID BACKGROUND
   ========================================= */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-size: 50px 50px;
    background-image:
        linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
    z-index: 0;
    pointer-events: none;
    transition: background-image 0.4s ease;
}

.glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: 1;
    opacity: 0.8;
    pointer-events: none;
    animation: float 15s infinite alternate ease-in-out;
}

.glow-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--glow-1) 0%, transparent 70%);
    top: -20%;
    right: -10%;
}

.glow-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--glow-2) 0%, transparent 70%);
    bottom: -20%;
    left: -10%;
    animation-delay: -7s;
}

@keyframes float {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(-50px, 80px);
    }
}

/* Watermark Background Letters */
.bg-text {
    position: fixed;
    bottom: -10%;
    left: -5%;
    font-size: clamp(12rem, 25vw, 30rem);
    font-weight: 900;
    color: var(--bg-text);
    z-index: 1;
    white-space: nowrap;
    letter-spacing: -10px;
    transition: color 0.4s ease;
    pointer-events: none;
    font-family: 'Playfair Display', serif;
}

/* =========================================
   4. PREMIUM CUSTOM CURSOR
   ========================================= */
.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--text-muted);
    transition: width 0.3s ease, height 0.3s ease, background-color 0.3s ease, border 0.3s ease;
}

.cursor-outline {
    width: 85px;
    height: 85px;
    border: 1px solid var(--text-muted);
    transition: opacity 0.3s ease;
}

/* Hover State (cursor logic from original site) */
.cursor-dot.hovered {
    width: 25px;
    height: 25px;
    background-color: rgba(255, 255, 255, 0.3);
    border: 1px solid #ffffff;
}

body.light-mode .cursor-dot.hovered {
    background-color: rgba(0, 0, 0, 0.1);
    border: 1px solid #000000;
}

.cursor-outline.hovered {
    opacity: 0;
}

/* =========================================
   5. NAVIGATION
   ========================================= */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 9rem;
}

.logo-text {
    color: var(--text-main);
    font-size: 1.8rem;
    font-weight: 900;
    text-decoration: none;
    letter-spacing: -1px;
    font-family: 'Abril Fatface', 'Playfair Display', serif;
    transition: transform 0.3s ease, color 0.4s ease;
}

.logo-text:hover {
    color: var(--text-muted);
}

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

.nav-links a {
    text-decoration: none;
    color: var(--link-color);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: color 0.3s, border-color 0.3s;
}

.nav-links a:hover {
    color: var(--text-main);
}

.nav-links a.nav-resume-btn {
    border: 1px solid var(--text-muted);
    padding: 0.4rem 1.2rem;
    border-radius: 4px;
    color: var(--text-muted);
}

.nav-links a.nav-resume-btn:hover {
    border-color: var(--text-main);
    color: var(--text-main);
}

/* Theme Toggle specifics */
.theme-icon-container {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--link-color);
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s;
}

.nav-links a:hover .theme-icon-container {
    border-color: var(--text-main);
}

.half-moon {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background-color: var(--link-color);
    transition: background-color 0.3s, transform 0.4s ease;
}

.nav-links a:hover .half-moon {
    background-color: var(--text-main);
}

body.light-mode .half-moon {
    transform: translateX(100%);
}

/* =========================================
   6. HERO & TYPOGRAPHY
   ========================================= */
.hero {
    max-width: 950px;
}

/* Hero Title */
.hero-title {
    font-family: 'Blorado', 'Abril Fatface', 'Playfair Display', serif;
    font-size: clamp(2rem, 4vw, 36.4px);
    font-weight: normal;
    /* Tuned down from bold */
    letter-spacing: 9.9px;
    /* Reverted to wide tracking */
    line-height: 1.2;
    text-transform: uppercase;
    color: var(--text-main);
    margin-bottom: 2.5rem;
}

/* Glitch Effect */
.glitch {
    position: relative;
    display: inline-block;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
}

.glitch::before {
    left: 2px;
    text-shadow: -1px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 3s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -1px 0 #00fff9, 1px 1px #ff00c1;
    animation: glitch-anim2 3s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip: rect(32px, 9999px, 83px, 0);
        transform: translate(0);
    }

    10% {
        clip: rect(45px, 9999px, 92px, 0);
        transform: translate(-1px, 1px);
    }

    20% {
        clip: rect(25px, 9999px, 54px, 0);
        transform: translate(1px, -1px);
    }

    30% {
        clip: rect(10px, 9999px, 45px, 0);
        transform: translate(0);
    }

    40% {
        clip: rect(55px, 9999px, 78px, 0);
        transform: translate(-1px, 0);
    }

    50% {
        clip: rect(40px, 9999px, 62px, 0);
        transform: translate(1px, 1px);
    }

    60% {
        clip: rect(15px, 9999px, 34px, 0);
        transform: translate(0);
    }

    70% {
        clip: rect(72px, 9999px, 88px, 0);
        transform: translate(-1px, -1px);
    }

    80% {
        clip: rect(38px, 9999px, 56px, 0);
        transform: translate(1px, 0);
    }

    90% {
        clip: rect(22px, 9999px, 44px, 0);
        transform: translate(0);
    }

    100% {
        clip: rect(55px, 9999px, 95px, 0);
        transform: translate(-1px, 1px);
    }
}

@keyframes glitch-anim2 {
    0% {
        clip: rect(15px, 9999px, 45px, 0);
        transform: translate(0);
    }

    10% {
        clip: rect(33px, 9999px, 66px, 0);
        transform: translate(1px, -1px);
    }

    20% {
        clip: rect(56px, 9999px, 89px, 0);
        transform: translate(-1px, 1px);
    }

    30% {
        clip: rect(24px, 9999px, 55px, 0);
        transform: translate(0);
    }

    40% {
        clip: rect(65px, 9999px, 90px, 0);
        transform: translate(1px, 0);
    }

    50% {
        clip: rect(12px, 9999px, 34px, 0);
        transform: translate(-1px, -1px);
    }

    60% {
        clip: rect(45px, 9999px, 76px, 0);
        transform: translate(0);
    }

    70% {
        clip: rect(28px, 9999px, 55px, 0);
        transform: translate(1px, 1px);
    }

    80% {
        clip: rect(66px, 9999px, 88px, 0);
        transform: translate(-1px, 0);
    }

    90% {
        clip: rect(18px, 9999px, 42px, 0);
        transform: translate(0);
    }

    100% {
        clip: rect(44px, 9999px, 77px, 0);
        transform: translate(1px, -1px);
    }
}

.subtitle {
    font-size: clamp(14px, 2vw, 14.9px);
    line-height: 2.3;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    transition: color 0.4s ease;
    font-weight: 400;
    letter-spacing: 0;
}

.tag {
    color: var(--text-main);
    font-weight: 800;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.tag:hover {
    opacity: 0.7;
}

/* Orbit Animation */
.orbit-wrap {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 1px solid var(--text-muted);
    border-radius: 50%;
    position: relative;
    vertical-align: middle;
    margin: 0 4px;
    animation: spin 4s linear infinite;
}

.orbit-dot {
    width: 6px;
    height: 6px;
    background-color: var(--text-main);
    border-radius: 50%;
    position: absolute;
    top: -3px;
    left: 50%;
    transform: translateX(-50%);
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* =========================================
   7. CALL TO ACTION & SOCIALS
   ========================================= */
.bottom-actions {
    margin-top: 5rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.cta a {
    text-decoration: none;
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 1.2rem;
    transition: color 0.3s;
}

.cta a .hover-text {
    border-bottom: 2px solid var(--text-main);
    padding-bottom: 4px;
}

.cta a svg {
    transition: transform 0.3s ease;
}

.cta a:hover svg {
    transform: translateX(8px);
}

.social-links {
    display: flex;
    gap: 1.8rem;
}

.social-links a {
    color: var(--link-color);
    font-size: 1.2rem;
    text-decoration: none;
    transition: color 0.3s, transform 0.2s;
}

.social-links a:hover {
    color: var(--text-main);
    transform: translateY(-3px);
}

/* =========================================
   8. BULLETPROOF LOAD ANIMATIONS
   ========================================= */
@keyframes slideUpReveal {
    0% {
        opacity: 0;
        transform: translateY(40px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo-svg,
.nav-links,
.hero-title,
.subtitle,
.bottom-actions {
    opacity: 0;
    animation: slideUpReveal 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.logo-svg {
    animation-delay: 0.1s;
}

.nav-links {
    animation-delay: 0.2s;
}

.hero-title {
    animation-delay: 0.3s;
}

.subtitle:nth-of-type(1) {
    animation-delay: 0.4s;
}

.subtitle:nth-of-type(2) {
    animation-delay: 0.5s;
}

.bottom-actions {
    animation-delay: 0.7s;
}

/* =========================================
   9. MOBILE RESPONSIVENESS
   ========================================= */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 2rem;
        margin-bottom: 5rem;
    }

    .nav-links {
        flex-wrap: wrap;
        gap: 1.5rem;
    }

    body {
        padding: 2rem 5%;
    }

    /* Hide custom cursors on mobile */
    .cursor-dot,
    .cursor-outline {
        display: none;
    }

    body,
    a,
    button {
        cursor: auto;
    }

    .bg-text {
        font-size: clamp(8rem, 20vw, 15rem);
        bottom: 5%;
    }
}

/* =========================================
   10. INNER PAGES: PROJECTS & CONTACT
   ========================================= */

/* Skills Section (About Page) */
.skills-section {
    margin: 4rem 0 5rem 0;
    opacity: 0;
    animation: slideUpReveal 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    animation-delay: 0.6s;
}

.skills-title {
    font-size: 1.2rem;
    color: var(--text-main);
    margin-bottom: 2rem;
    font-weight: 700;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1.5rem;
    list-style: none;
    padding: 0;
}

.skills-grid li {
    font-size: 1rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 1.5rem;
}

.skills-grid li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--text-main);
}

/* Projects Grid */
.projects-hero {
    max-width: 1100px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    margin-top: 4rem;
}

.project-card {
    display: block;
    text-decoration: none;
    color: var(--text-main);
}

/* Text-Based Project Cards */
.text-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 2rem 1.8rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 380px;
    transition: transform 0.4s ease, border-color 0.4s ease, background 0.4s ease;
}

body.light-mode .text-card {
    background: rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.text-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.12);
    /* Brighter on hover */
    border-color: rgba(255, 255, 255, 0.1);
}

body.light-mode .text-card:hover {
    background: rgba(0, 0, 0, 0.12);
    border-color: rgba(0, 0, 0, 0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.icon-folder {
    font-size: 2.2rem;
    color: var(--text-main);
}

.card-links a {
    color: var(--text-muted);
    font-size: 1.3rem;
    margin-left: 1rem;
    transition: color 0.3s ease;
    text-decoration: none;
}

.card-links a:hover {
    color: var(--text-main);
}

.card-content {
    flex-grow: 1;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 650;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    text-align: center;
}

.card-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.8;
    text-align: center;
}

.card-footer {
    margin-top: 2rem;
}

.tech-stack {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.2rem;
    list-style: none;
    padding: 0;
}

.tech-stack li {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: inherit;
    letter-spacing: 0.5px;
}

/* Contact Redirect */
.contact-hero {
    max-width: 800px;
}

.submit-btn {
    display: inline-block;
    background: transparent;
    border: 2px solid var(--text-muted);
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 700;
    padding: 1.2rem 2.5rem;
    margin-top: 1rem;
    transition: all 0.4s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: none;
}

.submit-btn:hover {
    border-color: var(--text-main);
    color: var(--text-main);
}

.contact-details {
    margin-top: 5rem;
    opacity: 0;
    animation: slideUpReveal 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    animation-delay: 0.5s;
}