/* ========================================
   GANESH ARAVIND - PERSONAL CV WEBSITE
   A cinematic, editorial experience
   ======================================== */

/* === RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color System - Sophisticated dark palette */
    --color-bg: #08090a;
    --color-bg-elevated: #0f1012;
    --color-bg-card: #141518;
    --color-border: rgba(255, 255, 255, 0.08);
    --color-border-hover: rgba(255, 255, 255, 0.15);
    
    --color-text: #f4f4f5;
    --color-text-secondary: #a1a1aa;
    --color-text-muted: #52525b;
    
    --color-accent: #818cf8;
    --color-accent-muted: rgba(129, 140, 248, 0.15);
    --color-accent-glow: rgba(129, 140, 248, 0.4);
    
    --color-success: #34d399;
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-display: 'Space Grotesk', var(--font-sans);
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 5rem;
    --space-3xl: 8rem;
    
    /* Timing */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 0.2s;
    --duration-normal: 0.4s;
    --duration-slow: 0.8s;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
}

/* === NOISE TEXTURE === */
.noise {
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    z-index: 9999;
}

/* === CURSOR GLOW === */
.cursor-glow {
    position: fixed;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--color-accent-glow) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
}

body:hover .cursor-glow {
    opacity: 0.5;
}

/* === HERO SECTION === */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--space-lg);
    position: relative;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.hero-left {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    background: var(--color-accent-muted);
    border: 1px solid rgba(129, 140, 248, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-size: 0.8rem;
    color: var(--color-accent);
    font-weight: 500;
    width: fit-content;
}

.tag-dot {
    width: 8px;
    height: 8px;
    background: var(--color-success);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.hero-name {
    font-family: var(--font-display);
    font-size: clamp(3.5rem, 10vw, 8rem);
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: -0.03em;
}

.name-line {
    display: block;
}

.name-line--accent {
    color: var(--color-accent);
}

.hero-title {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--color-text-secondary);
    font-weight: 400;
    letter-spacing: 0.02em;
}

.hero-location {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.hero-location svg {
    opacity: 0.6;
}

.hero-right {
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-frame {
    position: relative;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 4/5;
}

.profile-frame-inner {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(20%);
    transition: filter var(--duration-slow) var(--ease-out-expo);
}

.profile-frame:hover .profile-img {
    filter: grayscale(0%);
}

.profile-frame-accent {
    position: absolute;
    inset: -1px;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--color-accent) 0%, transparent 50%);
    opacity: 0.3;
    z-index: -1;
    transform: translate(12px, 12px);
}

.hero-scroll {
    position: absolute;
    bottom: var(--space-lg);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.scroll-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(180deg, var(--color-accent) 0%, transparent 100%);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 1; transform: scaleY(1); }
    50% { opacity: 0.5; transform: scaleY(0.8); }
}

/* === SECTION BASE === */
.section {
    padding: var(--space-3xl) var(--space-lg);
    position: relative;
}

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

/* === LABELS === */
.label-group,
.about-label,
.skills-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

.label-number {
    font-family: var(--font-display);
    font-size: 0.8rem;
    color: var(--color-accent);
    font-weight: 600;
}

.label-text {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-xl);
}

/* === ABOUT SECTION === */
.section--about {
    background: var(--color-bg-elevated);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.about-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: var(--space-2xl);
}

.about-headline {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-lg);
}

.about-headline em {
    color: var(--color-accent);
    font-style: normal;
}

.about-text {
    font-size: 1.05rem;
    color: var(--color-text-secondary);
    line-height: 1.8;
    margin-bottom: var(--space-md);
}

/* === SKILLS SECTION === */
.section--skills {
    padding: var(--space-xl) 0;
    overflow: hidden;
    border-bottom: 1px solid var(--color-border);
}

.skills-marquee {
    overflow: hidden;
    margin-top: var(--space-lg);
}

.marquee-track {
    display: flex;
    gap: var(--space-lg);
    animation: marquee 30s linear infinite;
    width: max-content;
}

@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.skill-item {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    transition: color var(--duration-fast) ease;
}

.skill-item:hover {
    color: var(--color-accent);
}

.skill-divider {
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--color-text-muted);
}

/* === EXPERIENCE SECTION === */
.experience-header,
.projects-header,
.achievements-header {
    margin-bottom: var(--space-2xl);
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.timeline-item {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: var(--space-lg);
    position: relative;
}

.timeline-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 0.5rem;
}

.marker-dot {
    width: 12px;
    height: 12px;
    background: var(--color-accent);
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 20px var(--color-accent-glow);
}

.marker-line {
    width: 2px;
    flex: 1;
    background: linear-gradient(180deg, var(--color-accent) 0%, var(--color-border) 100%);
    margin-top: var(--space-sm);
}

.timeline-content {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: var(--space-lg);
    transition: all var(--duration-normal) var(--ease-out-expo);
}

.timeline-content:hover {
    border-color: var(--color-border-hover);
    transform: translateX(8px);
}

.timeline-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

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

.timeline-badge {
    font-size: 0.7rem;
    background: var(--color-accent-muted);
    color: var(--color-accent);
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.timeline-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.timeline-company {
    font-size: 1rem;
    color: var(--color-accent);
    font-weight: 500;
    margin-bottom: var(--space-md);
}

.timeline-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.timeline-list li {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.6;
}

.timeline-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 6px;
    height: 6px;
    background: var(--color-accent);
    border-radius: 50%;
}

/* === EDUCATION SECTION === */
.section--education {
    background: var(--color-bg-elevated);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.education-grid {
    display: grid;
    gap: var(--space-md);
}

.education-card {
    display: grid;
    grid-template-columns: 140px 1fr auto;
    gap: var(--space-lg);
    align-items: center;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: var(--space-lg);
    transition: all var(--duration-normal) var(--ease-out-expo);
}

.education-card:hover {
    border-color: var(--color-border-hover);
    transform: translateY(-4px);
}

.education-year {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.education-degree {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

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

.education-icon {
    color: var(--color-text-muted);
    opacity: 0.5;
}

/* === PROJECTS SECTION === */
.project-feature {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 24px;
    padding: var(--space-2xl);
    transition: all var(--duration-normal) var(--ease-out-expo);
}

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

.project-meta {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.project-client {
    font-size: 0.85rem;
    color: var(--color-accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.project-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-lg);
}

.project-results {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.project-results li {
    display: flex;
    align-items: baseline;
    gap: var(--space-sm);
}

.result-number {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-accent);
    letter-spacing: -0.02em;
}

.result-label {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
}

.project-feature-visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

.visual-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
    width: 100%;
    max-width: 280px;
}

.visual-cell {
    aspect-ratio: 1;
    background: linear-gradient(135deg, var(--color-accent-muted) 0%, var(--color-bg) 100%);
    border-radius: 12px;
    border: 1px solid var(--color-border);
}

.visual-cell:nth-child(1) { animation: cellPulse 4s ease-in-out infinite; }
.visual-cell:nth-child(2) { animation: cellPulse 4s ease-in-out infinite 1s; }
.visual-cell:nth-child(3) { animation: cellPulse 4s ease-in-out infinite 2s; }
.visual-cell:nth-child(4) { animation: cellPulse 4s ease-in-out infinite 3s; }

@keyframes cellPulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.02); }
}

/* === ACHIEVEMENTS SECTION === */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-md);
}

.achievement-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: var(--space-lg);
    display: flex;
    gap: var(--space-md);
    transition: all var(--duration-normal) var(--ease-out-expo);
}

.achievement-card:hover {
    border-color: var(--color-border-hover);
    transform: translateY(-4px);
}

.achievement-card--featured {
    grid-column: span 2;
    background: linear-gradient(135deg, var(--color-accent-muted) 0%, var(--color-bg-card) 100%);
    border-color: rgba(129, 140, 248, 0.3);
}

.achievement-badge {
    width: 48px;
    height: 48px;
    background: var(--color-accent);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
}

.achievement-badge--alt {
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
}

.achievement-year {
    font-size: 0.75rem;
    color: var(--color-accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.achievement-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.achievement-description {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

/* === FOOTER === */
.footer {
    background: var(--color-bg-elevated);
    border-top: 1px solid var(--color-border);
    padding: var(--space-3xl) var(--space-lg);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-cta {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.footer-label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: var(--space-sm);
    display: block;
}

.footer-headline {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 600;
    letter-spacing: -0.02em;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
    margin-bottom: var(--space-2xl);
}

.footer-contact {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.contact-card {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: var(--space-md);
    text-decoration: none;
    position: relative;
    transition: all var(--duration-normal) var(--ease-out-expo);
}

.contact-card:hover {
    border-color: var(--color-border-hover);
    background: var(--color-bg-elevated);
}

.contact-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.contact-value {
    font-size: 1rem;
    color: var(--color-text);
    font-weight: 500;
}

.contact-arrow {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    color: var(--color-text-muted);
    opacity: 0;
    transform: translate(-4px, 4px);
    transition: all var(--duration-fast) var(--ease-out-expo);
}

.contact-card:hover .contact-arrow {
    opacity: 1;
    transform: translate(0, 0);
}

.downloads-label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-sm);
    display: block;
}

.downloads-buttons {
    display: flex;
    gap: var(--space-sm);
}

.download-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-md);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--duration-normal) var(--ease-out-expo);
}

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

.download-btn--primary {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: white;
}

.download-btn--primary:hover {
    background: #6366f1;
    box-shadow: 0 8px 24px var(--color-accent-glow);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--space-xl);
    border-top: 1px solid var(--color-border);
}

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

/* === REVEAL ANIMATIONS === */
[data-reveal] {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity var(--duration-slow) var(--ease-out-expo),
                transform var(--duration-slow) var(--ease-out-expo);
}

[data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
}

[data-delay="1"] { transition-delay: 0.1s; }
[data-delay="2"] { transition-delay: 0.2s; }
[data-delay="3"] { transition-delay: 0.3s; }
[data-delay="4"] { transition-delay: 0.4s; }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
        text-align: center;
    }
    
    .hero-left {
        align-items: center;
    }
    
    .hero-right {
        order: -1;
    }
    
    .profile-frame {
        max-width: 280px;
    }
    
    .about-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .project-feature {
        grid-template-columns: 1fr;
    }
    
    .project-feature-visual {
        display: none;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .achievement-card--featured {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    :root {
        --space-3xl: 5rem;
        --space-2xl: 3rem;
    }
    
    .section {
        padding: var(--space-2xl) var(--space-md);
    }
    
    .hero {
        padding: var(--space-md);
    }
    
    .hero-name {
        font-size: clamp(2.5rem, 12vw, 4rem);
    }
    
    .timeline-item {
        grid-template-columns: 16px 1fr;
        gap: var(--space-md);
    }
    
    .marker-dot {
        width: 10px;
        height: 10px;
    }
    
    .education-card {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }
    
    .education-icon {
        display: none;
    }
    
    .achievements-grid {
        grid-template-columns: 1fr;
    }
    
    .downloads-buttons {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    :root {
        --space-3xl: 3rem;
        --space-2xl: 2rem;
        --space-xl: 1.5rem;
    }
    
    .hero-scroll {
        display: none;
    }
    
    .skill-item,
    .skill-divider {
        font-size: 1.75rem;
    }
    
    .timeline-content {
        padding: var(--space-md);
    }
    
    .footer-headline {
        font-size: 1.5rem;
    }
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    [data-reveal] {
        opacity: 1;
        transform: none;
    }
    
    .marquee-track {
        animation: none;
    }
    
    .cursor-glow {
        display: none;
    }
}

/* === PRINT === */
@media print {
    .noise,
    .cursor-glow,
    .hero-scroll,
    .skills-marquee,
    .visual-grid {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .section {
        page-break-inside: avoid;
    }
}