/* Global Variables & Reset */
:root {
    --bg-dark: #0a0a0f;
    --bg-card: #13131f;
    --primary: #6d28d9;
    /* Deep Purple */
    --primary-light: #8b5cf6;
    --accent: #06b6d4;
    /* Cyan */
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --gradient-main: linear-gradient(135deg, var(--primary), var(--accent));
    --glass-bg: rgba(19, 19, 31, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'IBM Plex Sans Thai', sans-serif;

    --container-width: 1200px;
    --header-height: 80px;
    --transition: all 0.3s ease;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Background Effects */
.background-glow {
    position: fixed;
    top: -20%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(109, 40, 217, 0.15), transparent 70%);
    z-index: -1;
    pointer-events: none;
}

.background-glow::after {
    content: '';
    position: absolute;
    top: 50vh;
    left: 60vw;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.1), transparent 70%);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

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

ul {
    list-style: none;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--gradient-main);
    color: #fff;
    border: none;
    box-shadow: 0 4px 15px rgba(109, 40, 217, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(109, 40, 217, 0.5);
}

.btn-outline {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    margin-left: 1rem;
}

.btn-outline:hover {
    border-color: var(--primary-light);
    background: rgba(255, 255, 255, 0.05);
}

/* Header */
.glass-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.dot {
    color: var(--primary-light);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 500;
}

.nav-links a:hover {
    color: #fff;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: var(--header-height);
    position: relative;
    overflow: hidden;
}

.hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 600px;
    z-index: 1;
}

.greeting {
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.hero-title {
    font-size: 4rem;
    background: linear-gradient(to right, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 2rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.hero-description {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
    max-width: 500px;
}

.hero-visual {
    position: absolute;
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
    width: 500px;
    display: none;
    /* Show only on desktop */
}

@media (min-width: 992px) {
    .hero-visual {
        display: block;
    }
}

.code-block-decoration {
    background: #1e1e2e;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: rotate(-5deg);
    transition: transform 0.5s ease;
}

.code-block-decoration:hover {
    transform: rotate(0deg) scale(1.02);
}

.keyword {
    color: #f778ba;
}

.variable {
    color: #a6accd;
}

.string {
    color: #a3f7bf;
}

.property {
    color: #89b4fa;
}

/* Sections */
.section {
    padding: 6rem 0;
}

.section-header {
    margin-bottom: 4rem;
    text-align: center;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: var(--primary-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.8rem;
}

/* About Grid */
.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

.about-text p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.stat-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    font-family: var(--font-heading);
}

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

/* Skills */
.skills-container {
    display: grid;
    gap: 2rem;
}

.skill-category h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #fff;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.skill-tags span {
    background: rgba(139, 92, 246, 0.1);
    color: var(--primary-light);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid rgba(139, 92, 246, 0.2);
    transition: var(--transition);
}

.skill-tags span:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
}

.project-card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

.project-image {
    height: 200px;
    overflow: hidden;
}

.img-placeholder {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.gradient-1 {
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4);
}

.gradient-2 {
    background: linear-gradient(45deg, #A8E6CF, #FFD3B6);
}

.gradient-3 {
    background: linear-gradient(45deg, #fc5c7d, #6a82fb);
}

.project-content {
    padding: 2rem;
}

.project-title {
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
}

.project-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.project-tech {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.project-tech li {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 500;
}

.project-links {
    display: flex;
    gap: 1.5rem;
}

.link-item {
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.link-item:hover {
    color: var(--primary-light);
}

.arrow {
    transition: transform 0.2s;
}

.link-item:hover .arrow {
    transform: translateX(3px);
}

/* Contact */
.contact-wrapper {
    background: linear-gradient(rgba(19, 19, 31, 0.8), rgba(19, 19, 31, 0.9)), url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48ZyBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0wIDQwaDQwVjBIMHY0MHptMjAgMjBWMjBMMjAgMjB6IiBzdHlsZT0iZmlsbDojZmZmO2ZpbGwtb3BhY2l0eTowLjAzIi8+PC9nPjwvc3ZnPg==');
    border-radius: 24px;
    padding: 4rem 2rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.contact-title {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

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

.email-link {
    display: inline-block;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: var(--transition);
}

.email-link:hover {
    transform: scale(1.05);
}

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

.social-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    font-weight: 700;
}

.social-icon:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-3px);
}

.social-icon svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.social-icon img {
    width: 24px;
    height: 24px;
    object-fit: cover;
}

.social-icon i {
    font-size: 24px;
}

/* Footer */
.footer {
    padding: 2rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.heart {
    color: var(--primary-light);
}

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

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

.fade-in {
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

.slide-up {
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

.delay-3 {
    animation-delay: 0.6s;
}

/* Scroll Animation Classes (controlled by JS) */
.fade-in-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.fade-in-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (min-width: 768px) {
    .about-grid {
        grid-template-columns: 3fr 2fr;
    }

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