/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&family=Playfair+Display:ital,wght@0,400;0,700;1,400&display=swap');

@import 'variables.css';
@import 'responsive.css';

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

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

main {
    padding-top: var(--header-height, 7.5rem); /* Account for floating header and add equal visual spacing */
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 1rem;
}

a {
    color: var(--accent-glow);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-main);
}

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

/* --------------------------------------
   Navigation - Floating Island
   -------------------------------------- */
.floating-nav-container {
    position: fixed;
    top: 1.5rem;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    pointer-events: none; /* Let clicks pass through empty space */
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Auto-hide header when scrolling down */
.floating-nav-container.nav-hidden {
    transform: translateY(calc(-100% - 2rem));
}

.floating-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
    width: 90%;
    max-width: 1200px; /* Match container max-width */
    padding: 0.75rem 1.5rem;
    border-radius: 50px; /* Pill shape */
    pointer-events: auto; /* Re-enable clicks on navbar */
}

.floating-nav .logo {
    margin-right: auto; /* Pushes the nav and controls to the right */
}

.floating-nav .logo a {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.05em;
    color: var(--text-primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
}

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

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent-glow);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 0 10px var(--accent-glow);
}

.nav-links a:hover::after {
    transform: translateX(-50%) scaleX(1);
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* SVG Mobile Menu Styles */
.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001; /* Above mobile overlay */
    color: var(--text-primary);
    padding: 0.25rem;
}

.mobile-menu-btn svg {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.icon-open { display: block; }
.icon-close { display: none; }

.mobile-menu-btn.active .icon-open { display: none; }
.mobile-menu-btn.active .icon-close { display: block; }

/* Utilities */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.section {
    padding: 5rem 0;
}

/* Button Styles */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0.75rem 1.75rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    text-align: center;
    border: none;
    z-index: 1;
}

.btn:active {
    transform: scale(0.96) !important;
}

/* Premium Primary Button */
.btn-primary {
    background: var(--accent-gradient);
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.2);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.btn-primary::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, var(--accent-glow), var(--accent-main));
    opacity: 0;
    z-index: -1;
    transition: opacity 0.4s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px var(--shadow-glow), inset 0 1px 0 rgba(255,255,255,0.4);
}

.btn-primary:hover::before {
    opacity: 1;
}

/* Sleek Secondary Outline Button */
.btn-outline {
    background: transparent;
    border: 1px solid var(--accent-glow);
    color: var(--accent-glow) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Pseudo element for hover fill color without hardcoding rgb values */
.btn-outline::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--accent-glow);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.btn-outline:hover {
    transform: translateY(-2px);
    border-color: var(--accent-glow);
    color: #ffffff !important; /* Forces contrast when filled */
    box-shadow: 0 10px 20px -5px var(--shadow-glow);
}

.btn-outline:hover::before {
    opacity: 1; /* Completely fills the button with glow color organically */
}

/* Projects */
#projects-container article {
    max-width: 500px;
    margin: 0 auto;
}

/* Blog Category Filter Tabs
   Auto-generated from blogData — add new categories in blog.js, not here. */
.category-tab {
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font-body);
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.category-tab:hover {
    border-color: var(--accent-glow);
    color: var(--text-primary);
}

.category-tab.active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: #ffffff;
    -webkit-text-fill-color: #ffffff;
}

/* UX/UI Premium Glass Cards & Panels */
.glass-card,
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--glass-shadow);
    position: relative;
    /* overflow hidden breaks child absolute elements if any, but fine for these cards */
    overflow: hidden; 
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Noise overlay */
.glass-card::before,
.glass-panel::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 0; /* Behind content */
    background-image: var(--glass-noise);
    opacity: 1;
}

/* Ensure content is above noise */
.glass-card > *,
.glass-panel > * {
    position: relative;
    z-index: 1;
}

.glass-card:hover {
    transform: translateY(-4px) scale(1.02) perspective(1000px) rotateX(2deg) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15), 0 0 30px var(--shadow-glow) !important;
    border-color: var(--border-hover);
    /* Hover shine effect using a radial gradient via after pseudo */
}

/* Animated Gradient Text */
.gradient-text-animated {
    background: var(--accent-gradient);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientFlow 5s ease infinite alternate;
}

@keyframes gradientFlow {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}


/* --------------------------------------
   Markdown Content Styles (post.html)
   -------------------------------------- */
#post-content p {
    margin-bottom: 1.5rem;
}

#post-content h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-size: 2rem;
}

#post-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

#post-content ul, 
#post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

#post-content li {
    margin-bottom: 0.5rem;
}

#post-content blockquote {
    border-left: 4px solid var(--accent-main);
    padding: 0.5rem 0 0.5rem 1.5rem;
    margin-left: 0;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    font-style: italic;
    background: rgba(123, 44, 191, 0.05); /* Very subtle background tint */
    border-radius: 0 8px 8px 0;
}

#post-content img {
    border-radius: 8px;
    margin: 2rem 0;
    box-shadow: var(--shadow-md);
}

#post-content pre {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

#post-content code {
    font-family: monospace;
    font-size: 0.9em;
    padding: 0.2em 0.4em;
    background: var(--bg-secondary);
    border-radius: 4px;
}

#post-content pre code {
    padding: 0;
    background: transparent;
}

/* --------------------------------------
   Theme Toggle Classic Animations
   -------------------------------------- */
.theme-toggle.theme-toggle--reversed .theme-toggle__classic{transform:scale(-1,1)}
.theme-toggle{--theme-toggle__classic--duration:500ms;color:var(--text-primary);}
.theme-toggle__classic path{transition-timing-function:cubic-bezier(0,0,0.15,1.25);transform-origin:center;transition-duration:calc(var(--theme-toggle__classic--duration) * .8)}
.theme-toggle__classic g path{transition-property:opacity,transform;transition-delay:calc(var(--theme-toggle__classic--duration) * 0.2)}
.theme-toggle__classic :first-child path{transition-property:transform,d}
.theme-toggle input[type=checkbox]:checked~.theme-toggle__classic g path,.theme-toggle--toggled:not(label).theme-toggle .theme-toggle__classic g path{transform:scale(.5) rotate(45deg);opacity:0;transition-delay:0s}
.theme-toggle input[type=checkbox]:checked~.theme-toggle__classic :first-child path,.theme-toggle--toggled:not(label).theme-toggle .theme-toggle__classic :first-child path{d:path("M-12 5h30a1 1 0 0 0 9 13v24h-39Z");transition-delay:calc(var(--theme-toggle__classic--duration) * 0.2)}
@supports not (d:path("")){.theme-toggle input[type=checkbox]:checked~.theme-toggle__classic :first-child path,.theme-toggle--toggled:not(label).theme-toggle .theme-toggle__classic :first-child path{transform:translate3d(-12px,10px,0)}}
.theme-toggle{border:none;background:0 0;cursor:pointer;margin-top:3.5px}
.theme-toggle input[type=checkbox]{display:none}
.theme-toggle .theme-toggle-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}
@media (prefers-reduced-motion:reduce){.theme-toggle:not(.theme-toggle--force-motion) *{transition:none!important}}

/* --------------------------------------
   Background Effects
   -------------------------------------- */
canvas#neural-canvas {
    opacity: 0.6;
    transition: opacity 0.5s ease;
}
