/* 
   Naresh Natarajan | Professional Portfolio Redesign Style Sheet 
   Modern Glassmorphic Dark Theme with HSL Design Tokens
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    /* Design Tokens (HSL) */
    --bg-base: hsl(224, 71%, 4%);
    --bg-surface: hsl(222, 47%, 10%);
    --bg-surface-elevated: hsl(222, 40%, 15%);
    --text-primary: hsl(0, 0%, 100%);
    --text-secondary: hsl(217, 32%, 76%);
    --text-muted: hsl(215, 20%, 55%);
    
    --accent: hsl(175, 75%, 45%);
    --accent-glow: hsla(175, 75%, 45%, 0.15);
    --accent-hover: hsl(175, 85%, 55%);
    --accent-rgb: 20, 209, 178;

    --card-bg: rgba(15, 23, 42, 0.45);
    --card-border: rgba(255, 255, 255, 0.06);
    --card-border-hover: rgba(20, 209, 178, 0.4);

    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-display: 'Outfit', sans-serif;

    --nav-height: 80px;
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --border-radius-lg: 24px;
}

/* Reset & Global */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
}

body {
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(at 0% 0%, hsla(222, 47%, 10%, 0.5) 0px, transparent 50%),
        radial-gradient(at 100% 0%, hsla(175, 75%, 45%, 0.04) 0px, transparent 50%),
        radial-gradient(at 100% 100%, hsla(224, 71%, 4%, 0.8) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    color: var(--text-primary);
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
}

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

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

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-surface-elevated);
    border: 2px solid var(--bg-base);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Glassmorphism General Utlity */
.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-md);
    transition: var(--transition-smooth);
}

.glass-panel:hover {
    border-color: var(--card-border-hover);
    box-shadow: 0 10px 30px -15px var(--accent-glow);
}

/* Header & Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    z-index: 1000;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
}

header.scrolled {
    height: 70px;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--card-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo span {
    color: var(--accent);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-links a {
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    position: relative;
    padding: 8px 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: var(--transition-smooth);
}

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

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

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

/* Mobile Toggle Hamburger */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1100;
}

.mobile-nav-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--text-primary);
    margin: 5px auto;
    transition: var(--transition-smooth);
}

/* Grid & Section Spacing */
section {
    padding: 100px 0;
    position: relative;
}

.section-container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 12px;
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    display: block;
    width: 50px;
    height: 4px;
    background: var(--accent);
    margin: 10px auto 0 auto;
    border-radius: 2px;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Hero Section (Home) */
#home {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: var(--nav-height);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 60px;
    align-items: center;
}

.hero-left h3 {
    color: var(--accent);
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.hero-left h1 {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.hero-subtitle {
    font-size: 1.6rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 24px;
    min-height: 40px;
}

.hero-left p {
    font-size: 1.1rem;
    margin-bottom: 35px;
    color: var(--text-secondary);
    max-width: 540px;
}

.typed-text {
    color: var(--accent);
}

.cursor {
    display: inline-block;
    width: 3px;
    background-color: var(--accent);
    margin-left: 2px;
    animation: blink 0.8s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-buttons {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition-smooth);
    cursor: pointer;
    gap: 8px;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: 0 8px 24px var(--accent-glow);
    transform: translateY(-2px);
}

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

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.social-links {
    display: flex;
    gap: 20px;
}

.social-links a {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.2rem;
}

.social-links a:hover {
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 4px 15px var(--accent-glow);
    transform: translateY(-3px);
}

/* Avatar Frame Design */
.hero-right {
    display: flex;
    justify-content: center;
    position: relative;
}

.avatar-wrapper {
    position: relative;
    width: 320px;
    height: 320px;
    border-radius: var(--border-radius-lg);
    padding: 8px;
    background: linear-gradient(135deg, var(--card-border), var(--accent-glow));
    border: 1px solid var(--card-border);
}

.avatar-wrapper::before {
    content: '';
    position: absolute;
    top: -15px;
    left: -15px;
    width: calc(100% + 30px);
    height: calc(100% + 30px);
    border: 2px dashed rgba(20, 209, 178, 0.25);
    border-radius: calc(var(--border-radius-lg) + 8px);
    z-index: -1;
    animation: rotate 40s linear infinite;
}

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

.avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: calc(var(--border-radius-lg) - 4px);
    filter: grayscale(10%) contrast(105%);
    transition: var(--transition-smooth);
}

.avatar-wrapper:hover .avatar-image {
    filter: grayscale(0%) contrast(100%);
    transform: scale(1.02);
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

.about-left h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.about-left p {
    margin-bottom: 20px;
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.about-education {
    margin-top: 35px;
}

.edu-item {
    position: relative;
    padding-left: 28px;
    margin-bottom: 24px;
}

.edu-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

.edu-item::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 20px;
    width: 2px;
    height: calc(100% + 4px);
    background: var(--card-border);
}

.edu-item:last-child::after {
    display: none;
}

.edu-item h4 {
    font-size: 1.15rem;
    color: var(--text-primary);
}

.edu-item .edu-school {
    color: var(--accent);
    font-weight: 500;
    font-size: 0.95rem;
}

.edu-item .edu-date {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Skills Badges Grid */
.about-right {
    padding: 30px;
}

.skills-category {
    margin-bottom: 30px;
}

.skills-category h4 {
    font-size: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 16px;
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.skill-badge {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.skill-badge i {
    color: var(--accent);
}

.skill-badge:hover {
    background: rgba(20, 209, 178, 0.08);
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* Experience Section (Timeline) */
.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, var(--card-border), var(--accent), var(--card-border));
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    width: 50%;
    padding: 20px 40px;
    box-sizing: border-box;
}

.timeline-item:nth-child(odd) {
    left: 0;
    text-align: right;
}

.timeline-item:nth-child(even) {
    left: 50%;
    text-align: left;
}

.timeline-badge {
    position: absolute;
    top: 25px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-base);
    border: 3px solid var(--accent);
    box-shadow: 0 0 12px var(--accent);
    z-index: 10;
}

.timeline-item:nth-child(odd) .timeline-badge {
    right: -8px;
}

.timeline-item:nth-child(even) .timeline-badge {
    left: -8px;
}

.timeline-content {
    position: relative;
    padding: 30px;
}

.timeline-content h3 {
    font-size: 1.4rem;
    margin-bottom: 5px;
}

.timeline-content .company-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 16px;
    justify-content: flex-end;
    align-items: center;
    font-size: 0.9rem;
}

.timeline-item:nth-child(even) .company-meta {
    justify-content: flex-start;
}

.company-meta .role {
    color: var(--accent);
    font-weight: 600;
}

.company-meta .duration {
    color: var(--text-muted);
    font-weight: 500;
}

.timeline-bullets {
    list-style: none;
    text-align: left;
}

.timeline-bullets li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.timeline-bullets li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
}

.experience-footer {
    text-align: center;
    margin-top: 40px;
}

/* Projects & Assignments Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.card-item {
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-image-box {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/10;
    background: var(--bg-surface-elevated);
}

.card-image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.card-item:hover .card-image-box img {
    transform: scale(1.08);
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition-smooth);
    padding: 20px;
    text-align: center;
}

.card-item:hover .card-overlay {
    opacity: 1;
}

.overlay-btn {
    transform: translateY(20px);
    transition: var(--transition-smooth);
}

.card-item:hover .overlay-btn {
    transform: translateY(0);
}

.card-details {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-details h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
}

.card-details p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 16px;
    line-height: 1.5;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.card-tags span {
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    padding: 3px 10px;
    border-radius: 4px;
    color: var(--text-muted);
}

.card-item:hover .card-tags span {
    border-color: var(--accent-glow);
    color: var(--accent);
}

.card-action-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
}

.card-action-link:hover {
    color: var(--accent-hover);
}

/* Contact Section */
.contact-grid {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 60px;
    align-items: start;
}

.contact-info-panel {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.info-card {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.info-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--border-radius-sm);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 1.3rem;
    transition: var(--transition-smooth);
}

.info-card:hover .info-icon {
    background: var(--accent);
    color: var(--bg-base);
    box-shadow: 0 0 15px var(--accent-glow);
}

.info-content h4 {
    font-size: 0.95rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.info-content p {
    font-size: 1.05rem;
    color: var(--text-primary);
    font-weight: 500;
}

.contact-form-panel {
    padding: 40px;
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-sm);
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 1rem;
    transition: var(--transition-smooth);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

textarea.form-control {
    resize: vertical;
}

/* Footer Section */
footer {
    background: hsl(224, 71%, 3%);
    border-top: 1px solid var(--card-border);
    padding: 40px 0;
    text-align: center;
}

.footer-container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.footer-socials {
    display: flex;
    gap: 20px;
}

.footer-socials a {
    color: var(--text-muted);
    font-size: 1.3rem;
}

.footer-socials a:hover {
    color: var(--accent);
}

.footer-copyright {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Reveal on Scroll Animations */
.reveal {
    opacity: 0;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.8s ease;
}

.reveal.slide-up {
    transform: translateY(40px);
}

.reveal.fade-in {
    transform: scale(0.98);
}

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

/* Toast/Alert Message styling */
.toast-msg {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 16px 24px;
    background: var(--bg-surface-elevated);
    border-left: 4px solid var(--accent);
    color: var(--text-primary);
    border-radius: var(--border-radius-sm);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 2000;
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition-smooth);
}

.toast-msg.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-msg i {
    color: var(--accent);
    font-size: 1.2rem;
}

/* Responsive Breakpoints */
@media (max-width: 991px) {
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }
    
    .hero-left p {
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .timeline::before {
        left: 30px;
    }
    
    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 0;
    }
    
    .timeline-item:nth-child(odd) {
        text-align: left;
    }
    
    .timeline-item:nth-child(odd) .timeline-badge,
    .timeline-item:nth-child(even) .timeline-badge {
        left: 22px;
    }
    
    .timeline-item:nth-child(odd) .company-meta {
        justify-content: flex-start;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    :root {
        --nav-height: 70px;
    }
    
    .hero-left h1 {
        font-size: 2.8rem;
    }
    
    .hero-subtitle {
        font-size: 1.3rem;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .mobile-nav-toggle {
        display: block;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background: var(--bg-surface);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 40px;
        transition: var(--transition-smooth);
    }
    
    .nav-links.open {
        right: 0;
    }
    
    .mobile-nav-toggle.open span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    
    .mobile-nav-toggle.open span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-nav-toggle.open span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
}
