﻿/* ════════════════════════════════════════════════════════════
   CORE – RESET, VARIABLES, BASE, LAYOUT, ANIMATIONS
════════════════════════════════════════════════════════════ */

:root {
    /* Base backgrounds */
    --bg-dark: #05070c;
    --bg-surface: #070b12;
    --bg-elevated: #0b111a;
    --border: #2a3a2a;
    --border-light: #447035;

    /* Accents */
    --green: #7afd2e;
    --green-dark: #5fc024;
    --green-glow: rgba(122, 253, 46, 0.15);

    --pink: #fd2ea5;
    --pink-dark: #cc1f84;
    --pink-glow: rgba(253, 46, 165, 0.15);

    --yellow: #f6b716;
    --yellow-dark: #d4940f;

    /* Text */
    --text-primary: #eef2ff;
    --text-secondary: #c8c4c4;
    --text-muted: #8a8a8a;

    /* Gradients */
    --grad-green: linear-gradient(90deg, var(--green), transparent);
    --grad-pink: linear-gradient(90deg, var(--pink), transparent);

    /* Typography */
    --head: 'Barlow Condensed', sans-serif;
    --body: 'Rajdhani', sans-serif;
    --mono: 'Share Tech Mono', monospace;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--body);
    overflow-x: hidden;
    cursor: none;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
    cursor: none;
}

img {
    display: block;
    max-width: 100%;
}

button {
    cursor: none;
}

/* Grid texture overlay */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 20% 30%, var(--green-glow), transparent 40%),
    radial-gradient(circle at 80% 70%, var(--pink-glow), transparent 40%);
    pointer-events: none;
    z-index: 1;
}

.page {
    position: relative;
    z-index: 2;
}

/* ═════ CUSTOM CURSOR ═════ */
#cursor {
    position: fixed;
    width: 8px;
    height: 8px;
    background: var(--green);
    pointer-events: none;
    z-index: 99999;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    transform: translate(-50%, -50%);
    transition: transform 0.08s linear;
    will-change: transform;
}

#cursor-ring {
    position: fixed;
    width: 28px;
    height: 28px;
    border: 1px solid var(--pink);
    border-radius: 0;
    pointer-events: none;
    z-index: 99998;
    transform: translate(-50%, -50%);
    transition: left 0.15s ease, top 0.15s ease, width 0.2s, height 0.2s, border-color 0.2s;
    will-change: transform;
}

body.cursor-hover #cursor-ring {
    width: 44px;
    height: 44px;
    border-color: var(--green);
}

/* ═════ LAYOUT UTILITIES ═════ */
.wrap {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

section {
    position: relative;
    z-index: 1;
    padding: 96px 40px;
}

/* ═════ ANIMATIONS ═════ */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spinSlow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.fade-in {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

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

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-light);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spinSlow 0.8s linear infinite;
}

/* ════════════════════════════════════════════════════════════
   NAVIGATION (global)
════════════════════════════════════════════════════════════ */
#nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
    padding: 0 40px;
    background: rgba(5, 7, 12, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 0 25px var(--green-glow);
}

#nav.scrolled {
    border-bottom-color: var(--pink);
}

.nav-logo {
    font-family: var(--head);
    font-weight: 900;
    font-size: 17px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-primary);
    flex: 0 0 auto;
}
.nav-logo .acc {
    color: var(--green);
}

.nav-center {
    flex: 1;
    display: flex;
    justify-content: center;
    gap: 10px;
    align-items: center;
}

.nav-right {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
}

.nav-link {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-secondary);
    padding: 8px 18px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    position: relative;
}
.nav-link:hover {
    color: var(--green);
    border-color: rgba(253, 46, 165, 0.3);
    background: rgba(122, 253, 46, 0.05);
}
.nav-link.active {
    color: var(--green);
    border-color: rgba(122, 253, 46, 0.45);
}

.lang-toggle {
    display: flex;
    border: 1px solid var(--border-light);
    overflow: hidden;
}
.lang-btn {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 5px 12px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    cursor: none;
    transition: all 0.2s;
}
.lang-btn.active {
    background: var(--green);
    color: var(--bg-dark);
}
.lang-btn:not(.active):hover {
    color: var(--text-primary);
}

.nav-cv {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 6px 16px;
    border: 1px solid var(--green);
    color: var(--green);
    transition: all 0.2s;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}
.nav-cv:hover {
    background: var(--green);
    color: var(--bg-dark);
}

/* ════════════════════════════════════════════════════════════
   FOOTER (global)
════════════════════════════════════════════════════════════ */
footer {
    border-top: 1px solid var(--border-light);
    padding: 28px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    position: relative;
}
.footer-logo {
    font-family: var(--head);
    font-weight: 900;
    font-size: 13px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.footer-logo span {
    color: var(--green);
}
.footer-copy {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.1em;
    color: var(--green);
    text-align: center;
}
.footer-right {
    display: flex;
    gap: 16px;
}
.footer-social {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--green);
    transition: color 0.2s;
}
.footer-social:hover {
    color: var(--green);
}

/* ════════════════════════════════════════════════════════════
   GRID BACKGROUND OVERLAY (hero, studio, about, footer)
════════════════════════════════════════════════════════════ */
#hero::before,
#studio::before,
#about::before,
footer::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
            linear-gradient(var(--border) 1px, transparent 1px),
            linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.28;
    pointer-events: none;
    z-index: 0;
}

#hero,
#studio,
#about,
footer {
    position: relative;
}

/* ════════════════════════════════════════════════════════════
   DIAGONAL GRID BACKGROUND OVERLAY (projects, devlog, contact)
════════════════════════════════════════════════════════════ */
#projects::before,
#devlog::before,
#contact::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
            45deg,
            transparent,
            transparent 30px,
            rgba(122, 253, 46, 0.04) 30px,
            rgba(122, 253, 46, 0.04) 32px
    );
    pointer-events: none;
    z-index: 0;
}

#projects,
#devlog,
#contact {
    position: relative;
    background: radial-gradient(ellipse at center,
    var(--bg-surface) 0%,
    var(--bg-dark) 100%);
}

#projects::after,
#devlog::after,
#contact::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.4) 100%);
    pointer-events: none;
    z-index: 0;
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {

    /* ───────── GENERAL ───────── */
    section { padding: 64px 20px; }

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

    .nav-center { display: none; }
    .nav-right { margin-left: auto; }

    body { cursor: auto; }
    #cursor, #cursor-ring { display: none !important; }

    a, button, .tag-chip, .filter-btn { cursor: pointer; }

    .sec-head {
        margin-bottom: 32px;
        gap: 12px;
    }
    .sec-title { font-size: clamp(28px, 8vw, 48px); }

    /* ───────── HERO ───────── */
    #hero { padding: 72px 0 32px; }

    .hero-body {
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 20px !important;
        min-height: auto !important;
        text-align: center;
    }

    .hero-left {
        width: 100%;
        text-align: left;
        animation: none;
        opacity: 1;
        transform: none;
    }

    .hero-name { font-size: clamp(42px, 12vw, 72px); line-height: 0.9; }
    .hero-eyebrow, .hero-name, .hero-meta {
        animation: none;
        opacity: 1;
        transform: none;
    }
    .hero-eyebrow::before { display: none; }
    .hero-desc { max-width: 100%; margin: 0 auto; }
    .hero-meta { justify-content: center; }
    .hero-stats { display: none; }

    .hero-ctas {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
    .hero-ctas .btn-primary,
    .hero-ctas .btn-ghost {
        text-align: center;
        width: 80%;
        margin: 4px auto;
    }

    /* ───────── PROJECTS ───────── */
    .proj-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
    .proj-card[data-ratio] {
        grid-column: span 1 !important;
    }
    .proj-inner {
        height: auto !important;
    }

    .proj-grid--tetris {
        align-items: stretch;
    }
    .proj-grid--tetris .proj-card {
        grid-column: span 1 !important;
        grid-row: auto !important;
        height: auto !important;
    }
    .proj-grid--tetris .proj-card .proj-inner {
        height: auto !important;
    }

    /* ───────── STUDIO ───────── */
    .studio-grid {
        grid-template-columns: 1fr;
        border: none;
    }
    .studio-left {
        border-right: none;
        border-bottom: 1px solid var(--border-light);
        padding: 28px 20px;
    }
    .studio-right { padding: 28px 20px; }

    /* ───────── DEVLOG ───────── */
    .devlog-layout { grid-template-columns: 1fr; gap: 0px;}
    .dlog-sidebar { display: none; }

    /* ───────── ABOUT ME ───────── */
    .about-layout {
        display: flex;
        flex-direction: column;
        gap: 40px;
    }
    .about-layout .about-bio { order: 1; }
    .about-layout .about-photo { order: 2; }
    .about-layout .skill-section { order: 3; margin-top: 0; }
    .skill-section {
        order: 3;
        margin-top: 0;
    }

    .about-p { font-size: 14px; line-height: 1.7; }
    .skills-grid { grid-template-columns: 1fr; }
    .skill-cat { padding: 14px; }

    /* ───────── CONTACT ───────── */
    .contact-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .contact-big { font-size: clamp(36px, 12vw, 64px); }
    .contact-tagline { font-size: 14px; }
    .clink { font-size: 10px; padding: 10px 14px; }

    /* ───────── PROJECT PAGE ───────── */
    .proj-page-hero {
        padding: 80px 20px 32px;
        min-height: 45vh;
    }
    .proj-page-title { font-size: clamp(32px, 10vw, 56px); }
    .proj-page-meta { gap: 16px; }
    .post-layout { padding: 72px 20px 40px; }
    .proj-body-layout {
        grid-template-columns: 1fr;
        padding: 40px 20px;
    }
    .proj-sidebar { position: static; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }

    /* ───────── BLOG ───────── */
    .blog-hero { padding: 80px 20px 32px; }
    .blog-layout {
        grid-template-columns: 1fr;
        padding: 40px 20px;
    }
    .blog-sidebar-panel { display: none; }

    /* ───────── FOOTER ───────── */
    footer {
        flex-direction: column;
        text-align: center;
        padding: 24px 20px;
    }
}

/* ───────── SMALL PHONES (≤480px) ───────── */
@media (max-width: 480px) {
    .hero-name { font-size: 52px; }
    .proj-grid { grid-template-columns: 1fr; }
    .proj-body-layout { padding: 32px 16px; }
    .post-layout { padding: 60px 16px; }
    .blog-hero { padding: 72px 16px 24px; }
    .contact-big { font-size: clamp(32px, 12vw, 56px); }
    .gallery-grid { grid-template-columns: 1fr; }
    .proj-page-hero { padding: 72px 16px 24px; }
    footer { padding: 20px 16px; }
}