/* =========================================
   1. CSS VARIABLES (THEMES)
========================================= */

/* Light Theme Variables */
:root {
    --bg-main: #f8fafc;
    --bg-secondary: rgba(255, 255, 255, 0.7);
    --nav-bg: rgba(255, 255, 255, 0.8);
    --border-color: rgba(15, 23, 42, 0.1);
    --border-hover: rgba(15, 23, 42, 0.25);
    --card-hover-bg: rgba(255, 255, 255, 0.95);
    --tag-bg: rgba(15, 23, 42, 0.05);
    --text-main: #0f172a;
    --text-muted: #475569;
    --accent-glow: rgba(37, 99, 235, 0.08);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    
    --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    --neu-shadow-dark: rgba(15, 23, 42, 0.12); /* Soft dark shadow */
    --neu-shadow-light: #ffffff; /* Bright white highlight */
}

/* Dark Theme Variables */
html.dark {
    --bg-main: #0a0a0a;
    --bg-secondary: rgba(17, 17, 17, 0.6);
    --nav-bg: rgba(10, 10, 10, 0.8);
    --border-color: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.2);
    --card-hover-bg: rgba(20, 20, 20, 0.8);
    --tag-bg: rgba(255, 255, 255, 0.05);
    --text-main: #ededed;
    --text-muted: #a1a1aa;
    --accent-glow: rgba(255, 255, 255, 0.05);
    --neu-shadow-dark: #000000; /* Deep black shadow */
    --neu-shadow-light: rgba(255, 255, 255, 0.06); /* Faint rim light */
}

/* =========================================
   2. GLOBAL RESETS & BASE
========================================= */

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

html {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    scroll-behavior: smooth;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: transparent;
    overflow-x: hidden;
}

main {
    width: 100%;
    max-width: 900px;
    padding: 0 24px;
}

a {
    color: var(--text-main);
    text-decoration: none;
    transition: var(--transition);
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

/* =========================================
   3. TYPOGRAPHY
========================================= */

h1, h2, h3, h4 {
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* =========================================
   4. NAVIGATION
========================================= */

.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 16px 24px;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav-content {
    width: 100%;
    max-width: 900px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 700;
    font-size: 1.25rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-links a {
    font-size: 0.875rem;
    color: var(--text-muted);
}

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

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 6px; 
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    margin-left: 8px;
}

.icon-btn svg {
    width: 18px; 
    height: 18px;
    stroke: currentColor;
}

.icon-btn:hover {
    background: var(--accent-glow);
    transform: scale(1.05);
}

.icon-btn:active {
    transform: scale(0.95);
}

.sun-icon { display: none; }
.moon-icon { display: block; }
html.dark .sun-icon { display: block; }
html.dark .moon-icon { display: none; }

/* =========================================
   5. CARDS & BUTTONS
========================================= */

.section {
    padding: 100px 0;
}

.section-header {
    margin-bottom: 40px;
}

.section-title {
    font-size: 1.5rem;
    color: var(--text-main);
}

.card {
    background: var(--bg-secondary);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    transition: var(--transition);
}

.card:hover {
    border-color: var(--border-hover);
    background: var(--card-hover-bg);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
}

html.dark .card:hover {
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--text-main);
    color: var(--bg-main);
    border: 1px solid var(--text-main);
}

.btn-primary:hover {
    background: transparent;
    color: var(--text-main);
}

.btn-secondary {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--text-muted);
    background: var(--accent-glow);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: var(--tag-bg);
    border: 1px solid var(--border-color);
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    color: var(--text-main);
    transition: var(--transition);
}

.tag:hover {
    border-color: var(--border-hover);
}

/* =========================================
   6. HERO SECTION & PROFILE IMAGE
========================================= */

.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    padding-top: 80px;
}

/* Flexbox layout for Side-by-Side */
.hero-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    width: 100%;
}

/* Left Side: Text Container */
.hero-text {
    flex: 1; /* Takes up available space */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 5rem);
    margin-bottom: 4px;
}

.hero-subtitle {
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 24px;
}

.hero-tagline {
    font-size: 1.125rem;
    max-width: 550px;
    margin-bottom: 40px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 16px;
}

/* Right Side: Profile Image Container */
.profile-container {
    flex-shrink: 0; /* Prevents the image from being squished */
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Increased size slightly since it has its own column now */
.profile-placeholder {
    /* width: 160px; */
    /* height: 160px; */
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-glow) 0%, rgba(37, 99, 235, 0.1) 100%);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

html.dark .profile-placeholder {
    background: linear-gradient(135deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.06) 100%);
}

.profile-container:hover .profile-placeholder {
    border-color: rgba(37, 99, 235, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(37, 99, 235, 0.1);
}

.profile-placeholder::after {
    content: '';
    position: absolute;
    top: -150%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 70%);
    animation: placeholder-sweep 6s infinite linear;
    pointer-events: none;
}

html.dark .profile-placeholder::after {
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
}

/* Class to use when you replace the placeholder with an actual <img> */
.profile-image {
  display: block;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.profile-image:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

@keyframes placeholder-sweep {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Responsiveness for Hero */
@media (max-width: 768px) {
    .hero-content {
        flex-direction: column-reverse; /* Puts text on bottom, image on top */
        text-align: center;
        gap: 32px;
        padding-top: 20px;
    }

    .hero-text {
        align-items: center; /* Centers text and buttons on mobile */
    }

    .hero-tagline {
        text-align: center;
    }
}

/* =========================================
   7. OTHER SECTIONS (Timeline, Grids, Contact)
========================================= */

.timeline {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.timeline-item {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 640px) {
    .timeline-item {
        grid-template-columns: 200px 1fr;
    }
}

.timeline-date {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.timeline-content h3 {
    font-size: 1.125rem;
    margin-bottom: 4px;
}

.timeline-content h4 {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 12px;
}

.timeline-content p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

.skills-grid, .projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.skill-category h3 {
    font-size: 1rem;
    margin-bottom: 16px;
}

.project-card {
    display: flex;
    flex-direction: column;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.project-header h3 {
    font-size: 1.125rem;
}

.project-links {
    display: flex;
    gap: 12px;
}

.project-links a {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-decoration: underline;
    text-underline-offset: 4px;
}

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

.project-desc {
    flex-grow: 1;
    font-size: 0.95rem;
}

.project-tags {
    margin-top: 24px;
}

.contact-container {
    max-width: 600px;
}

.contact-text {
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.form-group input,
.form-group textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
    color: var(--text-main);
    font-family: var(--font-sans);
    transition: var(--transition);
}

html.dark .form-group input,
html.dark .form-group textarea {
    background: rgba(0, 0, 0, 0.2);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(120, 120, 120, 0.5);
    background: var(--tag-bg);
}

.submit-btn {
    width: 100%;
    margin-bottom: 24px;
}

.social-links {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.875rem;
}

.separator {
    color: var(--border-color);
}

footer {
    width: 100%;
    text-align: center;
    padding: 40px 0;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* =========================================
   8. ANIMATIONS & VIEW TRANSITION
========================================= */

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.7s;
    animation-timing-function: cubic-bezier(0.25, 1, 0.5, 1);
}

::view-transition-old(root) {
    animation: none;
    z-index: -1;
}

::view-transition-new(root) {
    clip-path: circle(0px at var(--x, 50%) var(--y, 50%));
    animation: ripple-out 0.7s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes ripple-out {
    to {
        clip-path: circle(150% at var(--x, 50%) var(--y, 50%));
    }
}

/* =========================================
   9. MOBILE RESPONSIVENESS
========================================= */

@media (max-width: 640px) {
    .nav-links a:not(.icon-btn) {
        display: none; 
    }
    .section {
        padding: 60px 0;
    }
}

/* Neumorphic Social Links Container */
.hero-socials {
    display: flex;
    gap: 16px;
    margin-top: 32px;
}

/* Base Neumorphic Button (Outset / Extruded) */
.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-main); /* Matches background perfectly */
    color: var(--text-muted);
    transition: var(--transition);
    
    /* The double shadow creates the 3D raised effect */
    box-shadow: 
        5px 5px 10px var(--neu-shadow-dark), 
        -5px -5px 10px var(--neu-shadow-light);
}

/* Hover State (Inset / Pressed) */
.social-btn:hover {
    color: var(--text-main);
    
    /* Reversing the shadows to 'inset' pushes the button into the page */
    box-shadow: 
        inset 5px 5px 10px var(--neu-shadow-dark), 
        inset -5px -5px 10px var(--neu-shadow-light);
    
    /* Prevent default link lift so the pressed illusion works */
    transform: translateY(0); 
}

footer p{
  display: flex;
  justify-content: center;
  align-items: center;
}