/* CSS Custom Properties */
:root {
    --background: 0 0% 100%;
    --foreground: 240 10% 3.9%;
    --card: 0 0% 100%;
    --card-foreground: 240 10% 3.9%;
    --primary: 240 5.9% 10%;
    --primary-foreground: 0 0% 98%;
    --secondary: 240 4.8% 95.9%;
    --secondary-foreground: 240 5.9% 10%;
    --muted: 240 4.8% 95.9%;
    --muted-foreground: 240 3.8% 46.1%;
    --accent: 240 4.8% 95.9%;
    --accent-foreground: 240 5.9% 10%;
    --border: 240 5.9% 90%;
    --radius: 0.5rem;
}

[data-theme="dark"] {
    --background: 240 10% 3.9%;
    --foreground: 0 0% 98%;
    --card: 240 10% 3.9%;
    --card-foreground: 0 0% 98%;
    --primary: 0 0% 98%;
    --primary-foreground: 240 5.9% 10%;
    --secondary: 240 3.7% 15.9%;
    --secondary-foreground: 0 0% 98%;
    --muted: 240 3.7% 15.9%;
    --muted-foreground: 240 5% 64.9%;
    --accent: 240 3.7% 15.9%;
    --accent-foreground: 0 0% 98%;
    --border: 240 3.7% 15.9%;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    line-height: 1.6;
    min-height: 100vh;
    min-height: 100dvh;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
    max-width: 42rem;
    margin: 0 auto;
    padding: 3rem 1.5rem 6rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

/* Sections */
.section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Blur Fade Animation */
.blur-fade {
    animation: blurFadeIn 0.4s ease-out forwards;
    animation-delay: calc(var(--delay, 0) * 0.04s);
    opacity: 0;
    filter: blur(6px);
    transform: translateY(6px);
}

@keyframes blurFadeIn {
    to {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0);
    }
}

/* Hero Section */
.hero-layout {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.hero-text {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.375rem;
}

.hero-title {
    font-size: clamp(1.875rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.1;
}

.hero-description {
    max-width: 600px;
    font-size: 1rem;
    color: hsl(var(--muted-foreground));
}

.hero-avatar {
    flex-shrink: 0;
}

.avatar {
    width: 7rem;
    height: 7rem;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid hsl(var(--border));
}

/* Section Headings */
.section-heading {
    font-size: 1.25rem;
    font-weight: 700;
}

/* About Section */
.about-text {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    line-height: 1.7;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Skills Section */
.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.skill-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    background-color: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
    border-radius: 9999px;
    transition: all 0.2s ease;
}

.skill-badge:hover {
    background-color: hsl(var(--accent));
}

/* Projects Section */
.projects-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1rem;
    padding: 3rem 0;
}

.projects-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    background-color: hsl(var(--foreground));
    color: hsl(var(--background));
    border-radius: 0.5rem;
}

.projects-title {
    font-size: clamp(1.875rem, 4vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.025em;
}

.projects-description {
    color: hsl(var(--muted-foreground));
    font-size: 1rem;
    max-width: 600px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    max-width: 50rem;
    margin: 0 auto;
}

@media (max-width: 640px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

/* Project Card */
.project-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background-color: hsl(var(--card));
    transition: box-shadow 0.3s ease;
    height: 100%;
}

.project-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .project-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
}

/* Project Media (video/image/gif) */
.project-media {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-color: hsl(var(--muted));
    border-bottom: 1px solid hsl(var(--border));
}

.project-media img,
.project-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.project-content {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.project-title {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.project-date {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
}

.project-description {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 0 0.25rem;
    font-size: 0.625rem;
    font-weight: 500;
    background-color: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
    border-radius: 9999px;
}

.project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: auto;
    padding-top: 0.5rem;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.625rem;
    font-weight: 500;
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border-radius: 9999px;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.project-link:hover {
    opacity: 0.9;
}

/* Contact Section */
.contact-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.75rem;
    padding: 3rem 1rem;
}

.contact-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    background-color: hsl(var(--foreground));
    color: hsl(var(--background));
    border-radius: 0.5rem;
}

.contact-title {
    font-size: clamp(1.875rem, 4vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.025em;
}

.contact-description {
    max-width: 600px;
    color: hsl(var(--muted-foreground));
    font-size: 1rem;
}

/* Dock Navigation */
.dock {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    justify-content: center;
    padding-bottom: 1rem;
    pointer-events: none;
}

.dock::before {
    content: '';
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4rem;
    background: linear-gradient(to top, hsl(var(--background)), transparent);
    pointer-events: none;
}

.dock-container {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    background-color: hsl(var(--background));
    border: 1px solid hsl(var(--border));
    border-radius: 9999px;
    box-shadow: 0 0 0 1px rgba(0,0,0,.03), 0 2px 4px rgba(0,0,0,.05), 0 12px 24px rgba(0,0,0,.05);
    pointer-events: auto;
    /* Smooth horizontal stretch - width handled by flexbox naturally */
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

[data-theme="dark"] .dock-container {
    border: 1px solid rgba(255,255,255,.1);
    box-shadow: 0 -20px 80px -20px rgba(255,255,255,.12) inset;
}

.dock-item {
    --scale: 1;
    --width: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--width);
    height: 3rem;
    border-radius: 9999px;
    color: hsl(var(--foreground));
    background: transparent;
    border: none;
    cursor: pointer;
    text-decoration: none;
    /* Spring-like transition using custom cubic-bezier */
    transition: width 0.4s cubic-bezier(0.25, 1, 0.5, 1),
                background-color 0.2s ease;
    will-change: width;
    position: relative;
}

/* Tooltip for aria-label on hover */
.dock-item[aria-label]::before {
    content: attr(aria-label);
    position: absolute;
    bottom: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%);
    padding: 0.375rem 0.75rem;
    background-color: hsl(var(--foreground));
    color: hsl(var(--background));
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 0.375rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Tooltip arrow */
.dock-item[aria-label]::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 0.25rem);
    left: 50%;
    transform: translateX(-50%);
    border: 0.375rem solid transparent;
    border-top-color: hsl(var(--foreground));
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    z-index: 100;
}

.dock-item[aria-label]:hover::before,
.dock-item[aria-label]:hover::after {
    opacity: 1;
    visibility: visible;
}

.dock-item svg {
    transform: scale(var(--scale));
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.dock-item:hover {
    background-color: hsl(var(--accent));
}

/* Bounce animation for click */
@keyframes dock-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.dock-item.bouncing {
    animation: dock-bounce 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.dock-separator {
    width: 1px;
    height: 2rem;
    background-color: hsl(var(--border));
    margin: 0 0.25rem;
    align-self: center;
}

/* Theme Toggle in Dock */
.theme-toggle .sun-icon {
    display: none;
}

.theme-toggle .moon-icon {
    display: block;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: block;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: none;
}

/* Responsive */
@media (max-width: 640px) {
    .container {
        padding: 2rem 1rem 5rem;
    }

    .hero-layout {
        flex-direction: column-reverse;
        align-items: flex-start;
        gap: 1rem;
    }

    .avatar {
        width: 5rem;
        height: 5rem;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .dock-item {
        width: 2.5rem;
        height: 2.5rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }

    .blur-fade {
        opacity: 1;
        filter: none;
        transform: none;
    }
}

:focus-visible {
    outline: 2px solid hsl(var(--foreground));
    outline-offset: 2px;
}

/* Print */
@media print {
    .dock {
        display: none;
    }

    body {
        background: white;
        color: black;
    }
}

