/* ===== CSS Variables ===== */
:root {
    --primary-color: #FFEB3B;
    --primary-dark: #FFD700;
    --secondary-color: #2196F3;
    --accent-pink: #E91E63;
    --accent-orange: #FF5722;
    --dark-bg: #1a1a1a;
    --darker-bg: #0f0f0f;
    --card-bg: #252525;
    --light-bg: #1a1a1a;
    --text-primary: #e0e0e0;
    --text-light: #ffffff;
    --text-muted: #a0a0a0;
    --gradient-1: linear-gradient(135deg, #FFEB3B 0%, #FFD700 100%);
    --gradient-2: linear-gradient(135deg, #E91E63 0%, #FF5722 100%);
    --gradient-3: linear-gradient(135deg, #2196F3 0%, #42A5F5 100%);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.6);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--dark-bg);
    overflow-x: hidden;
}

/* ===== Typography ===== */
@font-face {
    font-family: 'Kanit';
    font-style: normal;
    font-display: swap;
    src: url('fonts/Kanit/Kanit-Regular.ttf') format('truetype');
}

@font-face {
    font-family: 'Kanit';
    font-style: italic;
    font-weight: bold;
    font-display: swap;
    src: url('fonts/Kanit/Kanit-BoldItalic.ttf') format('truetype');
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Kanit', sans-serif;
    line-height: 1.2;
    font-weight: 700;
    margin-bottom: 1rem;
}

h1 {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-style: italic;
}

h2 {
    font-size: clamp(2rem, 5vw, 3rem);
}

h3 {
    font-size: clamp(1.5rem, 4vw, 2rem);
}

p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1rem;
}

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

a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* ===== Navigation ===== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.navbar.scrolled {
    background: rgba(26, 26, 26, 0.98);
    box-shadow: var(--shadow-lg);
}

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

.nav-logo a {
    font-family: 'Kanit', sans-serif;
    font-size: 1.5rem;
    font-weight: bold;
    font-style: italic;
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
}

.nav-logo a:hover {
    color: var(--primary-color);
    text-decoration: none;
    text-shadow: 0 0 10px rgba(255, 235, 59, 0.5);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: var(--text-light);
    font-weight: 500;
    text-decoration: none;
    position: relative;
    transition: var(--transition);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary-color);
    text-decoration: none;
}

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

.nav-link:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.bar {
    width: 25px;
    height: 3px;
    background: var(--text-light);
    transition: var(--transition);
    border-radius: 3px;
}

.hamburger.active .bar:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger.active .bar:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ===== Hero Section ===== */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 50%, #1a1a1a 100%);
    color: var(--text-light);
    text-align: center;
    padding: 8rem 2rem 4rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 235, 59, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(33, 150, 243, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 50% 20%, rgba(233, 30, 99, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    animation: fadeInUp 1s ease-out;
}

.hero-title {
    margin-bottom: 1.5rem;
}

.title-line {
    display: block;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 1s ease-out 0.2s both;
}

.title-line:nth-child(2) {
    animation-delay: 0.4s;
}

.hero-subtitle {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--text-light);
    margin-bottom: 0.5rem;
    opacity: 0.9;
    animation: fadeInUp 1s ease-out 0.6s both;
}

.hero-description {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--text-muted);
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease-out 0.8s both;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 1s ease-out 1s both;
}

.btn {
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    display: inline-block;
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--primary-color);
    color: #1a1a1a;
    box-shadow: var(--shadow-md);
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
}

.btn-secondary {
    background: transparent;
    color: var(--text-light);
    border-color: var(--text-light);
}

.btn-secondary:hover {
    background: var(--secondary-color);
    color: var(--text-light);
    border-color: var(--secondary-color);
    text-decoration: none;
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.mouse {
    width: 30px;
    height: 50px;
    border: 2px solid var(--text-light);
    border-radius: 20px;
    position: relative;
}

.wheel {
    width: 4px;
    height: 10px;
    background: var(--text-light);
    border-radius: 2px;
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll 2s infinite;
}

/* ===== Container ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ===== Section Styles ===== */
section {
    padding: 6rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
    display: inline-block;
    width: 100%;
    color: var(--text-light);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-orange));
    border-radius: 2px;
}

/* ===== About Section ===== */
.about {
    background: var(--dark-bg);
    color: var(--text-primary);
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-text {
    font-size: 1.2rem;
    line-height: 1.8;
}

.about-text strong {
    color: var(--primary-color);
    font-weight: 600;
}

.about-text a {
    color: var(--secondary-color);
}

/* ===== Projects Section ===== */
.projects {
    background: var(--dark-bg);
    color: var(--text-primary);
}

.projects-grid {
    display: grid;
    gap: 3rem;
}

.project-card {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    opacity: 0;
    transform: translateY(30px);
    border: 1px solid rgba(255, 235, 59, 0.2);
}

.project-card.visible {
    opacity: 1;
    transform: translateY(0);
    animation: fadeInUp 0.6s ease-out;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(255, 235, 59, 0.5);
}

.project-media {
    width: 100%;
    position: relative;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background: #000;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.image-container {
    width: 100%;
    overflow: hidden;
}

.image-container img {
    width: 100%;
    height: auto;
    display: block;
    transition: var(--transition);
}

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

.image-caption,
.video-caption {
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
    background: rgba(15, 15, 30, 0.8);
}

.project-content {
    padding: 2rem;
}

.project-title {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tag {
    padding: 0.4rem 1rem;
    background: rgba(255, 235, 59, 0.15);
    color: var(--primary-color);
    border: 1px solid rgba(255, 235, 59, 0.4);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.project-description {
    color: var(--text-primary);
    line-height: 1.8;
}

.project-description a {
    color: var(--secondary-color);
    font-weight: 500;
}

.project-description a:hover {
    color: var(--accent-pink);
}

/* ===== Contact Section ===== */
.contact {
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--darker-bg) 100%);
    color: var(--text-light);
}

.contact-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.contact-info {
    margin-bottom: 2rem;
}

.contact-email {
    font-size: 1.2rem;
    color: var(--text-light);
}

.social-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 2rem;
}

.social-link {
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.social-link:hover {
    background: var(--primary-color);
    color: #1a1a1a;
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
    border-color: var(--primary-color);
}

.social-icon {
    font-weight: 500;
}

/* ===== Footer ===== */
.footer {
    background: var(--darker-bg);
    color: var(--text-muted);
    text-align: center;
    padding: 2rem 0;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

@keyframes scroll {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: rgba(26, 26, 26, 0.98);
        width: 100%;
        text-align: center;
        transition: var(--transition);
        box-shadow: var(--shadow-lg);
        padding: 2rem 0;
        gap: 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-item {
        margin: 1rem 0;
    }

    .nav-link {
        font-size: 1.2rem;
    }

    .hero {
        padding: 6rem 1rem 3rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 300px;
    }

    .section-title {
        font-size: 2rem;
    }

    .project-content {
        padding: 1.5rem;
    }

    .social-links {
        flex-direction: column;
        align-items: center;
    }

    .social-link {
        width: 100%;
        max-width: 300px;
    }

    section {
        padding: 4rem 0;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .nav-container {
        padding: 0 1rem;
    }

    .hero {
        padding: 5rem 1rem 2rem;
    }

    .project-content {
        padding: 1rem;
    }
}

/* ===== Smooth Scroll Behavior ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
