/*
 * Core Styles - Light Theme with 3D Depth
 * Portfolio: Ajith K - Python Developer
 * 
 * Requires: tokens.css to be loaded first
 */

/* ================================
   BASE STYLES
   ================================ */

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

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    background-color: var(--color-base);
    color: var(--color-text-primary);
    font-family: var(--font-family-primary);
    font-size: var(--font-body);
    line-height: var(--line-height-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ================================
   TYPOGRAPHY
   ================================ */

h1,
.h1 {
    font-size: var(--font-h1);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    letter-spacing: var(--tracking-tight);
    color: var(--color-text-primary);
}

h2,
.h2 {
    font-size: var(--font-h2);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-snug);
    letter-spacing: var(--tracking-tight);
    color: var(--color-text-primary);
}

h3,
.h3 {
    font-size: var(--font-h3);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-snug);
    color: var(--color-text-primary);
}

h4,
.h4 {
    font-size: var(--font-h4);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-snug);
    color: var(--color-text-primary);
}

p {
    color: var(--color-text-secondary);
    line-height: var(--line-height-relaxed);
}

a {
    color: var(--color-accent-primary);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
}

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

/* ================================
   GLASS CARD (Frosted Glass)
   ================================ */

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-md);
    transition: transform var(--duration-normal) var(--ease-spring),
        box-shadow var(--duration-normal) var(--ease-out);
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.glass-card-strong {
    background: var(--glass-bg-strong);
    backdrop-filter: blur(calc(var(--glass-blur) * 1.5));
    -webkit-backdrop-filter: blur(calc(var(--glass-blur) * 1.5));
}

/* ================================
   3D DEPTH CONTAINERS
   ================================ */

.depth-container {
    position: relative;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.depth-elevated {
    background: var(--color-surface-elevated);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-3d);
    transition: transform var(--duration-slow) var(--ease-spring),
        box-shadow var(--duration-slow) var(--ease-out);
}

.depth-elevated:hover {
    transform: translateY(-8px) translateZ(20px);
    box-shadow: var(--shadow-3d-hover);
}

/* Ambient occlusion effect for depth */
.depth-ao::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 10%;
    right: 10%;
    height: 20px;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

/* ================================
   NAVIGATION
   ================================ */

.nav-container {
    background: var(--glass-bg-strong);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md);
}

.nav-link {
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-medium);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    transition: all var(--duration-fast) var(--ease-spring);
}

.nav-link:hover {
    color: var(--color-text-primary);
    background: var(--color-surface-2);
}

.nav-link.active {
    color: var(--color-accent-primary);
    background: var(--color-accent-primary-light);
}

/* ================================
   HERO SECTION
   ================================ */

.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-title {
    font-size: var(--font-h1);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    letter-spacing: var(--tracking-tight);
    margin-bottom: var(--space-6);
}

.hero-title .highlight {
    background: var(--color-accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    position: relative;
}

.hero-tagline {
    font-size: var(--font-body-lg);
    color: var(--color-text-secondary);
    max-width: 600px;
    line-height: var(--line-height-relaxed);
}

/* 3D Canvas Container */
.hero-3d-container {
    position: absolute;
    top: 50%;
    right: 5%;
    transform: translateY(-50%);
    width: 400px;
    height: 400px;
    pointer-events: none;
}

@media (max-width: 1024px) {
    .hero-3d-container {
        position: relative;
        top: auto;
        right: auto;
        transform: none;
        width: 100%;
        height: 300px;
        margin: var(--space-8) 0;
        pointer-events: auto;
    }
}

#hero-3d-canvas {
    width: 100%;
    height: 100%;
    pointer-events: auto;
}

/* ================================
   SECTION STYLES
   ================================ */

.section {
    padding: var(--space-20) var(--space-6);
}

.section-title {
    font-size: var(--font-h2);
    font-weight: var(--font-weight-bold);
    text-align: center;
    margin-bottom: var(--space-4);
}

.section-divider {
    width: 80px;
    height: 4px;
    background: var(--color-accent-gradient);
    border-radius: var(--radius-full);
    margin: 0 auto var(--space-12);
}

/* ================================
   TECH CHIPS & TAGS
   ================================ */

.tech-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--color-accent-primary-light);
    border: 1px solid rgba(0, 102, 255, 0.15);
    border-radius: var(--radius-full);
    font-size: var(--font-small);
    font-weight: var(--font-weight-medium);
    color: var(--color-accent-primary);
    transition: all var(--duration-fast) var(--ease-spring);
}

.tech-chip:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    background: rgba(0, 102, 255, 0.15);
}

.tech-chip i {
    font-size: 0.9em;
}

/* ================================
   PROJECT CARDS (Expandable)
   ================================ */

.project-card {
    background: var(--color-surface-1);
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform var(--duration-normal) var(--ease-spring),
        box-shadow var(--duration-normal) var(--ease-out);
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.project-card-image {
    position: relative;
    height: 240px;
    overflow: hidden;
}

.project-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration-slow) var(--ease-out);
}

.project-card:hover .project-card-image img {
    transform: scale(1.05);
}

.project-card-content {
    padding: var(--space-6);
}

.project-card-title {
    font-size: var(--font-h3);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-3);
    color: var(--color-text-primary);
}

.project-card-description {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-4);
    line-height: var(--line-height-relaxed);
}

/* Expandable section */
.project-card-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--duration-slow) var(--ease-spring);
}

.project-card.expanded .project-card-details {
    max-height: 500px;
}

.project-card-technical {
    padding-top: var(--space-4);
    border-top: 1px solid var(--glass-border);
    margin-top: var(--space-4);
}

.project-card-technical h4 {
    font-size: var(--font-small);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    margin-bottom: var(--space-3);
}

/* ================================
   SKILLS MAP
   ================================ */

.skills-map {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    justify-content: center;
    align-items: center;
}

.skill-node {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4);
    background: var(--color-surface-1);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-spring);
}

.skill-node:hover,
.skill-node:focus {
    transform: translateY(-6px) scale(1.05);
    box-shadow: var(--shadow-lg);
    z-index: 10;
}

.skill-node:focus {
    outline: 2px solid var(--color-accent-primary);
    outline-offset: 2px;
}

.skill-node-icon {
    font-size: 2rem;
    transition: transform var(--duration-normal) var(--ease-spring);
}

.skill-node:hover .skill-node-icon {
    transform: scale(1.2);
}

.skill-node-label {
    font-size: var(--font-small);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
}

/* Skill tooltip */
.skill-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: var(--space-3) var(--space-4);
    background: var(--color-text-primary);
    color: var(--color-text-inverse);
    border-radius: var(--radius-lg);
    font-size: var(--font-small);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--duration-fast) var(--ease-spring);
    pointer-events: none;
    z-index: 100;
}

.skill-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--color-text-primary);
}

.skill-node:hover .skill-tooltip,
.skill-node:focus .skill-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-12px);
}

/* ================================
   EXPERIENCE TIMELINE
   ================================ */

.experience-card {
    background: var(--color-surface-1);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--glass-border);
    transition: all var(--duration-normal) var(--ease-spring);
    position: relative;
    overflow: hidden;
}

.experience-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--color-accent-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--duration-slow) var(--ease-spring);
}

.experience-card:hover::before {
    transform: scaleX(1);
}

.experience-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

/* ================================
   CONTACT SECTION
   ================================ */

.contact-card {
    background: var(--color-surface-1);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    box-shadow: var(--shadow-md);
}

.contact-link {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    transition: all var(--duration-fast) var(--ease-spring);
}

.contact-link:hover {
    background: var(--color-surface-2);
    transform: translateX(4px);
}

.contact-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-accent-primary-light);
    border-radius: var(--radius-lg);
    color: var(--color-accent-primary);
    font-size: 1.25rem;
    transition: all var(--duration-fast) var(--ease-spring);
}

.contact-link:hover .contact-icon {
    transform: scale(1.1);
    background: var(--color-accent-primary);
    color: var(--color-text-inverse);
}

/* ================================
   SOCIAL ICONS
   ================================ */

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
    background: var(--color-surface-2);
    color: var(--color-text-secondary);
    font-size: 1.25rem;
    transition: all var(--duration-fast) var(--ease-spring);
}

.social-icon:hover {
    transform: translateY(-4px);
    background: var(--color-accent-primary);
    color: var(--color-text-inverse);
    box-shadow: var(--shadow-md);
}

.social-icon:focus {
    outline: 2px solid var(--color-accent-primary);
    outline-offset: 2px;
}

/* ================================
   BUTTONS
   ================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-size: var(--font-body);
    font-weight: var(--font-weight-medium);
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-spring);
}

.btn:focus {
    outline: 2px solid var(--color-accent-primary);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--color-accent-gradient);
    color: var(--color-text-inverse);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.btn-secondary:hover {
    background: var(--color-surface-2);
    border-color: var(--color-accent-primary);
    color: var(--color-accent-primary);
}

/* ================================
   SKILL METER BARS
   ================================ */

.skill-meter {
    height: 8px;
    background: var(--color-surface-3);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: var(--color-accent-gradient);
    border-radius: var(--radius-full);
    transition: width var(--duration-slower) var(--ease-spring);
}

/* ================================
   ANIMATIONS
   ================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.fade-in {
    animation: fadeInUp var(--duration-slower) var(--ease-spring) forwards;
    opacity: 0;
}

.fade-in.delay-1 {
    animation-delay: 0.1s;
}

.fade-in.delay-2 {
    animation-delay: 0.2s;
}

.fade-in.delay-3 {
    animation-delay: 0.3s;
}

.fade-in.delay-4 {
    animation-delay: 0.4s;
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-bounce {
    animation: bounce 2s ease-in-out infinite;
}

/* ================================
   DECORATIVE ELEMENTS (Minimal)
   ================================ */

/* Floating shapes container */
.floating-elements {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

/* Base floating shape */
.floating-shape {
    position: absolute;
    opacity: 0.6;
    pointer-events: none;
}

/* Code bracket decorations */
.shape-bracket {
    font-size: 2rem;
    font-weight: 300;
    color: var(--color-accent-primary);
    opacity: 0.3;
    font-family: 'Courier New', monospace;
}

/* Simple float animation */
@keyframes floatVertical {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

.animate-float-slow {
    animation: floatVertical 8s ease-in-out infinite;
}

/* Responsive hiding for decorations */
@media (max-width: 768px) {
    .hide-mobile-decoration {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {

    .floating-shape,
    .animate-float-slow {
        animation: none;
    }
}

/* ================================
   BACKGROUND DECORATIONS
   ================================ */

.bg-gradient-subtle {
    background: linear-gradient(180deg,
            var(--color-base) 0%,
            var(--color-surface-2) 100%);
}

.bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    pointer-events: none;
}

.bg-blob-primary {
    background: rgba(0, 102, 255, 0.15);
}

.bg-blob-secondary {
    background: rgba(99, 102, 241, 0.1);
}

/* Grid pattern overlay */
.bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

/* ================================
   FOOTER
   ================================ */

.footer {
    background: var(--color-surface-2);
    border-top: 1px solid var(--glass-border);
    padding: var(--space-12) var(--space-6);
}

.footer-content {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-6);
}

@media (min-width: 768px) {
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
    }
}

/* ================================
   BACK TO TOP BUTTON
   ================================ */

#back-to-top {
    position: fixed;
    bottom: var(--space-8);
    right: var(--space-8);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-accent-primary);
    color: var(--color-text-inverse);
    border: none;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--duration-normal) var(--ease-spring);
    z-index: var(--z-fixed);
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

#back-to-top:focus {
    outline: 2px solid var(--color-accent-primary);
    outline-offset: 4px;
}

/* ================================
   SCROLLBAR (Light Theme)
   ================================ */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-surface-2);
}

::-webkit-scrollbar-thumb {
    background: var(--color-surface-3);
    border-radius: var(--radius-full);
    border: 2px solid var(--color-surface-2);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent-primary);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-surface-3) var(--color-surface-2);
}

/* ================================
   RESPONSIVE UTILITIES
   ================================ */

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

@media (max-width: 1024px) {
    .container {
        padding: 0 var(--space-4);
    }
}

/* Hide on mobile */
.hide-mobile {
    display: block;
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none;
    }
}

/* Hide on desktop */
.hide-desktop {
    display: none;
}

@media (max-width: 768px) {
    .hide-desktop {
        display: block;
    }
}

/* ================================
   ACCESSIBILITY
   ================================ */

/* Skip link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    padding: var(--space-2) var(--space-4);
    background: var(--color-accent-primary);
    color: var(--color-text-inverse);
    z-index: 100;
    transition: top var(--duration-fast);
}

.skip-link:focus {
    top: 0;
}

/* Focus visible */
:focus-visible {
    outline: 2px solid var(--color-accent-primary);
    outline-offset: 2px;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}