/* ==========================================================================
   CSS Variables & Theme Setup
   ========================================================================== */
:root {
    --bg-color: #050505;
    --text-primary: #f5f5f5;
    --text-secondary: #a0a0a0;

    /* Gold Accents */
    --gold-primary: #D4AF37;
    /* Metallic Gold */
    --gold-light: #F3E5AB;
    /* Vanilla */
    --gold-bright: #FFD700;
    /* Standard Gold */
    --gold-dark: #996515;
    /* Golden Brown */

    /* Fonts */
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Outfit', sans-serif;

    /* Spacing & Layout */
    --section-padding: 100px 0;
    --container-width: 1200px;

    /* Glassmorphism */
    --glass-bg: rgba(10, 10, 10, 0.4);
    --glass-border: rgba(212, 175, 55, 0.15);
    /* Subtle gold border */
    --glass-blur: blur(12px);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1,
h2,
h3,
h4,
.logo {
    font-family: var(--font-heading);
    font-weight: 700;
}

h1 {
    font-size: clamp(3rem, 6vw, 5.5rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

p {
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
    color: var(--text-secondary);
}

.text-gradient {
    background: linear-gradient(135deg, var(--gold-light), var(--gold-primary), var(--gold-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==========================================================================
   Background Canvas & Overlays
   ========================================================================== */
#topo-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    pointer-events: none;
}

.glass-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    /* Create a subtle dark vignette to ensure text readability over bright center lines */
    background: radial-gradient(circle at center, transparent 0%, rgba(5, 5, 5, 0.8) 100%);
}

/* ==========================================================================
   Layout Components
   ========================================================================== */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: var(--section-padding);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Glass Card Reusable Component */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.glass-card:hover {
    border-color: rgba(212, 175, 55, 0.4);
    transform: translateY(-5px);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--gold-primary);
    color: #000;
    border: 2px solid var(--gold-primary);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--gold-primary);
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.5);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    border-color: var(--gold-primary);
    color: var(--gold-primary);
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 0;
    background: rgba(5, 5, 5, 0.85);
    /* Darker and more solid to prevent text clashing */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.nav-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 2rem;
    color: var(--gold-primary);
    text-decoration: none;
    display: inline-flex;
}

.cursor {
    animation: blink 1s infinite;
    font-weight: 300;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1rem;
    font-family: var(--font-heading);
    font-weight: 400;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--gold-primary);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--gold-primary);
}

.nav-links a:hover::after {
    width: 100%;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    position: relative;
    z-index: 10;
    justify-content: center;
    padding-top: 25vh;
    /* offset for fixed header + visual balance */
}

.hero-content {
    position: relative;
    z-index: 10;
}

.greeting {
    font-family: var(--font-heading);
    color: var(--gold-primary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.subtitle {
    max-width: 600px;
    font-size: 1.25rem;
    margin-bottom: 3rem;
}

.hero-actions {
    display: flex;
    gap: 1.5rem;
}

/* ==========================================================================
   About Section
   ========================================================================== */
.section-header .line {
    height: 1px;
    flex-grow: 1;
    background: linear-gradient(to right, var(--gold-primary), transparent);
    opacity: 0.3;
}

.about-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 4rem;
    align-items: center;
}

.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.skill-tag {
    padding: 0.5rem 1rem;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--gold-light);
    background: rgba(212, 175, 55, 0.05);
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.skill-tag:hover {
    background: rgba(212, 175, 55, 0.2);
    transform: translateY(-2px);
    color: #fff;
}

.portrait-container {
    position: relative;
    width: 100%;
}

.portrait-img {
    width: 100%;
    aspect-ratio: 4/5;
    object-fit: cover;
    padding: 0;
    border: 1px solid var(--gold-primary);
}

.portrait-container::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    right: -20px;
    bottom: -20px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 20px;
    z-index: -1;
}

.floating-tag {
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    text-decoration: none;
    z-index: 10;
    background: var(--bg-color);
    border: 1px solid var(--gold-primary);
    white-space: nowrap;
}

.floating-tag:hover {
    color: #fff;
    background: rgba(212, 175, 55, 0.2);
}

.pulse-effect {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(212, 175, 55, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0);
    }
}

/* ==========================================================================
   Work Section (Medium Feed)
   ========================================================================== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.medium-post-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0;
    /* Remove default glass card padding for edge-to-edge image */
    overflow: hidden;
}

.medium-thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid var(--glass-border);
}

.project-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.pub-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    color: var(--gold-primary);
}

.tech-stack span {
    background: rgba(212, 175, 55, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
}

.project-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s;
    margin-top: auto;
    /* Push to bottom */
}

.medium-post-card:hover .project-link {
    color: var(--gold-primary);
}

.loading-text,
.error-text {
    text-align: center;
    width: 100%;
    color: var(--text-secondary);
    grid-column: 1 / -1;
}

/* ==========================================================================
   Contact Section
   ========================================================================== */
.contact-container {
    text-align: center;
    max-width: 800px;
    padding: 4rem 2rem;
}

.contact-container h2 {
    justify-content: center;
    margin-bottom: 1rem;
}

.contact-container p {
    margin-bottom: 2.5rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.status-dot {
    width: 12px;
    height: 12px;
    background-color: #4ade80;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.6);
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(74, 222, 128, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
    }
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
    padding: 2rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.socials {
    display: flex;
    gap: 1.5rem;
}

.socials a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

.socials a:hover {
    color: var(--gold-primary);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
    .about-grid {
        grid-template-columns: 1fr;
    }

    .hero-actions {
        flex-direction: column;
    }

    .btn {
        text-align: center;
    }
}

.hamburger {
    display: none;
    cursor: pointer;
}
.hamburger .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    transition: all 0.3s ease-in-out;
    background-color: var(--text-primary);
}

@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .nav-links {
        position: fixed;
        left: -100%;
        top: 75px; 
        gap: 0;
        flex-direction: column;
        background-color: rgba(5, 5, 5, 0.95);
        backdrop-filter: blur(10px);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.5);
        padding: 2rem 0;
    }

    .nav-links.nav-active {
        left: 0;
    }

    .nav-links li {
        margin: 1.5rem 0;
    }

    .hamburger.toggle .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .hamburger.toggle .bar:nth-child(2) {
        opacity: 0;
    }
    .hamburger.toggle .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}