@import url("https://fonts.googleapis.com/css2?family=Metal+Mania&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Michroma&display=swap");
@import url("https://fonts.cdnfonts.com/css/pixeloid-sans");
@import url("https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap");

/* ===== Theme ===== */
:root {
    --indigo: #6366f1;
    --indigo-2: #4f46e5;
    --cyan: #06b6d4;
    --purple: #a855f7;
    --bg-900: #0a0f1f;
    --bg-950: #070b17;
    --text-100: #f3f4f6;
    --text-400: #9ca3af;
    --glass-blur: 12px;

    /* grid sizing */
    --nav-h: 4rem;
    --row-h: 100vh; /* constant move per row */
    --panel-h: calc(100vh - var(--nav-h));
}
body.home-mode {
    --nav-h: 0rem;
}

/* Fonts */
.metal-mania-regular {
    font-family: "Metal Mania", system-ui;
    font-weight: 400;
}
.michroma-regular {
    font-family: "Michroma", sans-serif;
    font-weight: 400;
}
.nav-brand-heading-size {
    font-size: 24px;
}
.mainbrand-section-heading-size {
    font-size: 48px;
}

/* Keep anchors clear of fixed nav */
html {
    scroll-padding-top: var(--nav-h);
}
.grid-section {
    scroll-margin-top: var(--nav-h);
}

/* Base */
html,
body {
    min-height: 100%;
}
body {
    font-family: "Space Grotesk", ui-sans-serif, system-ui, -apple-system,
        Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans",
        "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    background: radial-gradient(
            1200px 600px at 80% 10%,
            rgba(99, 102, 241, 0.08),
            transparent 60%
        ),
        radial-gradient(
            900px 500px at 20% 80%,
            rgba(6, 182, 212, 0.07),
            transparent 60%
        ),
        linear-gradient(180deg, var(--bg-900) 0%, var(--bg-950) 100%);
    color: var(--text-100);
    -webkit-font-smoothing: antialiased;
    overscroll-behavior: none;
}

/* Scrollbars (yours) */
* {
    scrollbar-width: thin;
    scrollbar-color: #667eea rgba(17, 24, 39, 0.5);
}
*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
*::-webkit-scrollbar-track {
    background: rgba(17, 24, 39, 0.5);
    border-radius: 10px;
}
*::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
    transition: all 0.3s ease;
}
*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}
*::-webkit-scrollbar-corner {
    background: rgba(17, 24, 39, 0.5);
}
body::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

/* Decorative BG */
.bg-decor {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}
.bg-grid {
    position: absolute;
    inset: 0;
    background-size: 50px 50px;
    background-image: linear-gradient(
            to right,
            rgba(6, 182, 212, 0.06) 1px,
            transparent 1px
        ),
        linear-gradient(to bottom, rgba(6, 182, 212, 0.06) 1px, transparent 1px);
    opacity: 0.18;
}
.bg-glow {
    position: fixed;
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.6;
    background: radial-gradient(
        circle,
        rgba(99, 102, 241, 0.18) 0%,
        rgba(6, 182, 212, 0.06) 50%,
        transparent 70%
    );
}
.bg-glow.top-right {
    top: -20%;
    right: -20%;
}
.bg-glow.bottom-left {
    bottom: -20%;
    left: -20%;
}

/* ===== Main logo - top nav ===== */

.header-logo {
    text-orientation: mixed;
    font-family: "Michroma", sans-serif;
    font-size: 1.4rem;
    letter-spacing: 4px;
    color: var(--text-100);
    text-transform: uppercase;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-image: url("../images/overlay4_horiz.jpg");
    background-size: 800%;
    background-position: 60% 50%;
    /*
    background-image: url("../images/overlay9_horiz.jpg");
    background-size: 300%;
    background-position: 75% 50%;
    */
}


/* ===== Navbar ===== */
nav.glass {
    background: rgba(17, 24, 39, 0.72);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    border: 0;
    border-bottom: 1px solid rgba(6, 182, 212, 0.25);
    border-radius: 0 !important;
    box-shadow: none;
}
#mobile-menu {
    background: rgba(17, 24, 39, 0.95);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
nav a {
    position: relative;
}
nav a::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -6px;
    height: 1px;
    width: 0;
    background: linear-gradient(90deg, var(--cyan), var(--purple));
    transform: translateX(-50%);
    border-radius: 2px;
    transition: width 0.25s ease;
}
nav a:hover::after,
nav a.is-active::after {
    width: 100%;
}
nav a.is-active,
nav a:hover {
    color: #e8f8ff;
}

/* Default: nav hidden (prevents flash on Home) */
.site-nav {
    height: var(--nav-h);
    background: rgba(17, 24, 39, 0.72);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid rgba(6, 182, 212, 0.25);
    opacity: 0;
    transform: translateY(-16px);
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease;
}
body.nav-mode .site-nav {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Show nav on non-grid pages (like post pages) */
body:not(.no-scroll) nav {
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
}
/* on Home it's hidden via default + body.home-mode */

/* ===== Lock page scrolling entirely (sections scroll internally only) ===== */
.no-scroll,
.no-scroll-html {
    overflow: hidden !important;
    height: 100vh;
}

/* ===== Grid viewport (prevents manual section-to-section scrolling) ===== */
#grid-viewport {
    position: fixed;
    left: 0;
    right: 0;
    top: var(--nav-h);
    width: 100vw;
    height: var(--panel-h);
    overflow: hidden;
    z-index: 1;
}
body.home-mode #grid-viewport {
    top: 0;
    height: 100vh;
}

/* Large canvas that slides inside the fixed viewport */
#grid-container {
    position: absolute;
    left: 0;
    top: 0;
    width: 300vw;
    height: calc(var(--row-h) * 2);
    transition: transform 950ms cubic-bezier(0.16, 0.84, 0.44, 1);
    will-change: transform;
}

/* Sections fill ONE row height (not the whole canvas) */
.grid-section {
    position: absolute;
    width: 100vw;
    height: var(--row-h); /* <-- fixed */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-top: 1rem;
    padding-bottom: 3rem;
    padding-top: 50px; /* space added ABOVE each section header text*/
}
#home.grid-section {
    overflow: hidden;
} /* no manual scroll on HOME */



/* ===== Cards/Buttons/Headings (yours) */
.glass {
    background: rgba(17, 24, 39, 0.72);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid rgba(99, 102, 241, 0.28);
    border-radius: 0.9rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.glass:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 24px 60px rgba(6, 182, 212, 0.18);
}
#projects .glass,
#music .glass,
#blog .glass {
    background: linear-gradient(
        180deg,
        rgba(17, 24, 39, 0.78),
        rgba(3, 7, 18, 0.86)
    );
    border: 1px solid rgba(99, 102, 241, 0.22);
}
#projects .glass:hover,
#music .glass:hover,
#blog .glass:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.45);
    box-shadow: 0 24px 60px rgba(6, 182, 212, 0.18);
}
.btn-grad {
    display: inline-block;
    padding: 0.6rem 1rem;
    border-radius: 0.75rem;
    background: linear-gradient(
        90deg,
        rgba(29, 33, 84, 0.95),
        rgba(54, 16, 74, 0.95)
    );
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: #fff;
    font-weight: 500;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}
.btn-grad:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.35);
}
.btn-outline {
    display: inline-block;
    padding: 0.55rem 0.9rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(6, 182, 212, 0.35);
    color: #80eaff;
}
.btn-outline:hover {
    background: rgba(6, 182, 212, 0.08);
}
.heading-gradient {
    background: linear-gradient(90deg, #9fb6ff 0%, #6fd3e6 40%, #bca5ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
#post-list.grid-cards {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(1, minmax(0, 1fr));
}
@media (min-width: 768px) {
    #post-list.grid-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 1280px) {
    #post-list.grid-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Blog card styles (yours) */
.fn-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    background: linear-gradient(
        180deg,
        rgba(17, 24, 39, 0.78),
        rgba(3, 7, 18, 0.86)
    );
    border: 1px solid var(--fn-border, rgba(129, 140, 248, 0.25));
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.fn-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
        60% 60% at 10% 0%,
        rgba(var(--tone), 0.1),
        transparent 60%
    );
    opacity: 0;
    filter: blur(6px);
    transition: opacity 0.25s;
}
.fn-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 60px rgba(6, 182, 212, 0.18);
    border-color: var(--fn-border-hover, rgba(129, 140, 248, 0.55));
}
.fn-card:hover::before {
    opacity: 1;
}
.fn--indigo {
    --tone: 99, 102, 241;
}
.fn--purple {
    --tone: 168, 85, 247;
}
.fn--cyan {
    --tone: 6, 182, 212;
}
.fn-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 0.6rem;
    background: rgba(var(--tone), 0.18);
    color: rgba(var(--tone), 0.9);
}
.fn-link {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    z-index: 10;
}
.fn-thumb {
    aspect-ratio: 16/9;
    width: 100%;
    border-radius: 10px;
    background: #0f172a center/cover no-repeat;
    border: 1px solid rgba(148, 163, 184, 0.12);
}
.fn-title {
    font-weight: 600;
    font-size: 1.125rem;
}
.fn-more {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-weight: 500;
    color: var(--fn-accent, #b4b9ff);
}
#post-list .fn-card:nth-child(8n + 1) {
    --fn-border: rgba(129, 140, 248, 0.25);
    --fn-border-hover: rgba(129, 140, 248, 0.55);
    --fn-accent: #a5b4fc;
    --tone: 129, 140, 248;
}
#post-list .fn-card:nth-child(8n + 2) {
    --fn-border: rgba(168, 85, 247, 0.25);
    --fn-border-hover: rgba(168, 85, 247, 0.55);
    --fn-accent: #c084fc;
    --tone: 168, 85, 247;
}
#post-list .fn-card:nth-child(8n + 3) {
    --fn-border: rgba(34, 197, 194, 0.25);
    --fn-border-hover: rgba(34, 197, 194, 0.55);
    --fn-accent: #5eead4;
    --tone: 34, 197, 194;
}
#post-list .fn-card:nth-child(8n + 4) {
    --fn-border: rgba(236, 72, 153, 0.25);
    --fn-border-hover: rgba(236, 72, 153, 0.55);
    --fn-accent: #f9a8d4;
    --tone: 236, 72, 153;
}
#post-list .fn-card:nth-child(8n + 5) {
    --fn-border: rgba(59, 130, 246, 0.25);
    --fn-border-hover: rgba(59, 130, 246, 0.55);
    --fn-accent: #93c5fd;
    --tone: 59, 130, 246;
}
#post-list .fn-card:nth-child(8n + 6) {
    --fn-border: rgba(34, 197, 94, 0.25);
    --fn-border-hover: rgba(34, 197, 94, 0.55);
    --fn-accent: #86efac;
    --tone: 34, 197, 94;
}
#post-list .fn-card:nth-child(8n + 7) {
    --fn-border: rgba(251, 146, 60, 0.25);
    --fn-border-hover: rgba(251, 146, 60, 0.55);
    --fn-accent: #fdba74;
    --tone: 251, 146, 60;
}
#post-list .fn-card:nth-child(8n + 8) {
    --fn-border: rgba(250, 204, 21, 0.25);
    --fn-border-hover: rgba(250, 204, 21, 0.55);
    --fn-accent: #fde047;
    --tone: 250, 204, 21;
}

/* ===== HOME styles (animated hero + left rail) ===== */
#home .background-text {
    position: fixed;
    inset: 0;
    font-size: 25vw;
    font-weight: 700;
    line-height: 0.8;
    color: rgba(99, 102, 241, 0.03);
    z-index: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    transform: rotate(-15deg);
}
#home .background-text::before {
    content: "creativilization";
    position: absolute;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-image: url("https://images.unsplash.com/photo-1534577403868-27b805ca4b9c?fm=jpg");
    background-size: cover;
    background-repeat: no-repeat;
    background-position: -400px;
    filter: blur(100px);
}
#home .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 160px;
    background: rgba(10, 15, 31, 0.95);
    backdrop-filter: blur(var(--glass-blur));
    border-right: 1px solid rgba(99, 102, 241, 0.15);
    z-index: 30;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    transition: opacity 0.35s ease, transform 0.35s ease;
}
body.nav-mode #home .sidebar {
    opacity: 0;
    transform: translateY(-24px);
    pointer-events: none;
}
body.home-mode #home .sidebar {
    opacity: 1;
    transform: none;
}
#home .sidebar-title {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-family: "Michroma", sans-serif;
    font-size: 7.5vh;
    letter-spacing: 4px;
    color: var(--text-100);
    text-transform: uppercase;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-image: url("https://i.pinimg.com/736x/c0/3c/71/c03c710c7894197ee67aa6d0b3dcfc08.jpg");
    background-size: cover;
    background-position: 69%;
}
#home .main-content {
    margin-left: 160px;
    height: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 10;
    padding: 0 80px;
    /*overflow: hidden;*/
}
#home .content-overlay {
    position: relative;
    max-width: 600px;
}
#home .primary-heading {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 300;
    line-height: 1.1;
    margin-bottom: 10px;
    color: var(--text-100);
    opacity: 0;
    transform: translateY(50px);
    animation: homeFadeUp 1.5s cubic-bezier(0.4, 0, 0.2, 1) 0.6s forwards;
}
#home .subtitle-text {
    font-size: 1.4rem;
    font-weight: 300;
    color: var(--text-400);
    line-height: 1.7;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(30px);
    animation: homeFadeUp 1.2s cubic-bezier(0.4, 0, 0.2, 1) 1.1s forwards;
}
@keyframes homeFadeUp {
    to {
        opacity: 1;
        transform: none;
    }
}
#home .accent-line {
    position: absolute;
    top: 10%;
    left: -80px;
    width: 2px;
    height: 80vh;
    background: linear-gradient(180deg, transparent, var(--cyan), transparent);
    opacity: 0.6;
    z-index: 30;
}
#home .nav-links {
    display: flex;
    flex-direction: column;
    gap: 0px;
    opacity: 0;
    transform: translateY(20px);
    animation: homeFadeUp 1s cubic-bezier(0.4, 0, 0.2, 1) 1.6s forwards;
    align-items: flex-start;
}
#home .nav-link {
    font-size: 1.1rem;
    color: var(--text-400);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    padding: 8px 0 8px 45px;
    display: inline-block;
    width: fit-content;
    /* Add isolation to prevent rendering conflicts */
    isolation: isolate;
}
#home .nav-link::before {
    content: "→";
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--cyan);
    font-weight: 600;
    transition: transform 0.3s ease;
}
#home .nav-link::after {
    content: "";
    position: absolute;
    left: 45px;
    right: 0;
    bottom: 4px;
    height: 2px;
    background: linear-gradient(90deg, var(--cyan), var(--indigo));
    transform-origin: left center;
    transform: scaleX(0);
    opacity: 0.9;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    /* Force GPU acceleration for smoother rendering */
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
#home .nav-link:hover {
    color: var(--text-100);
    transform: translateX(10px);
}
#home .nav-link:hover::before {
    transform: translateY(-50%) translateX(-10px);
}
#home .nav-link:hover::after {
    transform: scaleX(1);
}
/* Alternative fallback for browsers with rendering issues */
@supports not (transform: scaleX(1)) {
    #home .nav-link::after {
        width: 0;
        transition: width 0.4s ease;
    }
    
    #home .nav-link:hover::after {
        width: calc(100% - 45px);
    }
}

#home .scroll-indicator {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-400);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    z-index: 10;
    animation: homePulse 2s ease-in-out infinite;
}
@keyframes homePulse {
    0%,
    100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}
#home .cat-sprite {
    position: fixed;
    top: 90%;
    left: 160px;
    width: 64px;
    height: 64px;
    background: url("../images/8-bit-cat-sprite-256_3.png") no-repeat 0 0;
    image-rendering: pixelated;
    animation: blink 1.5s steps(4) infinite, peek 8s ease-in-out infinite;
    transform-origin: center center;
    z-index: 0;
    transform: translateY(-50%);
}
@keyframes blink {
    from {
        background-position: 0 0;
    }
    to {
        background-position: -256px 0;
    }
}
@keyframes peek {
    0%,
    100% {
        transform: translateY(-50%) translateX(-64px);
    }
    50% {
        transform: translateY(-50%) translateX(-7px);
    }
}
@media (max-width: 768px) {
    #home .sidebar {
        display: none;
    }
    #home .main-content {
        margin-left: 0;
        padding: 0 40px;
    }
    #home .accent-line,
    #home .cat-sprite {
        display: none;
    }
}

/* About helpers (yours) */

.about-header-text {
    padding-top: 50px;
}
.about-dynamic-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s ease;
    padding-top: 125px;
    margin-top: 100px;
}
.about-dynamic-text:hover {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.about-skill-bubble {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s;
}
.about-skill-bubble:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}
.about-skill-bubble::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.3),
        rgba(255, 255, 255, 0.1)
    );
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}
.about-typing-effect {
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid transparent;
    transition: border-color 0.3s;
}
.about-typing-effect:hover {
    border-right-color: #667eea;
}
.about-expertise-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}
.about-stats-counter {
    font-size: 2.5rem;
    font-weight: 800;
    color: #667eea;
    transition: color 0.3s;
}
.about-stats-counter:hover {
    color: #f093fb;
}
.about-pulse-dot {
    transition: all 0.3s;
}
.about-pulse-dot:hover {
    transform: scale(1.2);
    box-shadow: 0 0 20px currentColor;
}
.glass:hover .about-pulse-dot {
    transform: scale(1.2);
    box-shadow: 0 0 20px currentColor;
}

/* ===== BLOG POSTS PAGE ===== */

.blog-section-header-spacing {
    margin-top: 50px;
}