/* ============================================================================
   CSS PALETTE (Design Tokens)
   ============================================================================ */

:root {
    /* Brand Colors */
    --color-primary: #00d4ff;
    --color-secondary: #ff6b6b;
    --color-white: #ffffff;
    --color-text-muted: #cccccc;
    --color-text-gray: #d1d5db;
    --color-text-light: #e0e0e0f3;
    
    /* Background Colors */
    --color-bg-dark: rgba(1, 20, 36, 0.9);
    --color-bg-card: rgba(17, 24, 39, 0.8);
    --color-bg-button: #020421;
    --color-bg-button-hover: #010212;
    
    /* Shadow Colors */
    --color-shadow-blue: rgba(15, 52, 96, 1);
    --color-shadow-blue-light: rgba(15, 52, 96, 0.8);
    --color-shadow-blue-lighter: rgba(15, 52, 96, 0.6);
    
    /* Spacing Scale */
    --spacing-xs: 0.25rem;   /* 4px */
    --spacing-sm: 0.5rem;    /* 8px */
    --spacing-md: 1rem;      /* 16px */
    --spacing-lg: 1.5rem;    /* 24px */
    --spacing-xl: 2rem;      /* 32px */
    --spacing-2xl: 3rem;     /* 48px */
    --spacing-3xl: 4rem;     /* 64px */
    
    /* Border Radius Scale */
    --radius-sm: 0.375rem;   /* 6px */
    --radius-md: 0.625rem;   /* 10px */
    --radius-lg: 0.75rem;     /* 12px */
    --radius-xl: 1.2rem;     /* 20px */
    --radius-full: 50px;
    
    /* Typography Scale */
    --font-body: 'Open Sans', system-ui, sans-serif;
    --font-heading: 'Open Sans', system-ui, sans-serif;
    
    /* Shadow Presets */
    --shadow-card:
        0 0.263rem 0.656rem 0.175rem var(--color-shadow-blue),
        0 0.131rem 0.219rem 0.088rem var(--color-shadow-blue-light),
        0 0.066rem 0.109rem 0.044rem var(--color-shadow-blue-lighter);
    --shadow-card-hover:
        0 0.547rem 1.531rem 0.438rem var(--color-shadow-blue),
        0 0.328rem 0.656rem 0.263rem var(--color-shadow-blue-light),
        0 0.175rem 0.328rem 0.131rem var(--color-shadow-blue-lighter);
    --shadow-category:
        0 0.438rem 0.547rem -0.109rem rgba(0, 0, 0, 0.3),
        0 0.219rem 0.219rem -0.109rem rgba(0, 0, 0, 0.2);
    --shadow-category-hover:
        0 0.547rem 0.656rem -0.109rem rgba(0, 212, 255, 0.2),
        0 0.328rem 0.328rem -0.109rem rgba(0, 0, 0, 0.3);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}


/* ============================================================================
   LOCAL FONTS
   ============================================================================ */

@font-face {
    font-family: 'Open Sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/public/fonts/open-sans-v44-latin-regular.woff2') format('woff2');
}

@font-face {
    font-family: 'Open Sans';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/public/fonts/open-sans-v44-latin-500.woff2') format('woff2');
}

@font-face {
    font-family: 'Open Sans';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/public/fonts/open-sans-v44-latin-600.woff2') format('woff2');
}

@font-face {
    font-family: 'Open Sans';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/public/fonts/open-sans-v44-latin-700.woff2') format('woff2');
}

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


body {
    font-family: 'Open Sans', system-ui, sans-serif;
    line-height: 1.6;
    color: var(--color-white);
    background: linear-gradient(135deg, var(--bg-color-1, #1f4972) 0%, var(--bg-color-2, #1a1a2e) 25%, var(--bg-color-3, #16213e) 50%, var(--bg-color-4, #0f3460) 75%, var(--bg-color-5, #1a1a2e) 100%);
    background-attachment: fixed;
    background-size: 400% 400%;
    /* Use will-change for animated background */
    will-change: background-position;
    animation: gradientShift 8s ease infinite;
    overflow-x: hidden;
    min-height: 100vh;
    /* Prevent scrollbar flicker */
    scrollbar-gutter: stable;
    padding: 0 12px 0 12px;
}

h1, h2, h3 {
    color: white;
    font-family: 'Open Sans', system-ui, sans-serif;
}

p {
    color: var(--color-text-light);
}

.gradient-header {
    background: linear-gradient(45deg, #00d4ff, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Particles and Spotlight */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
}

#spotlight {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    pointer-events: none;
    background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(255, 255, 255, 0.35) 0%, transparent 2%);
    mix-blend-mode: overlay;
    z-index: 1;
}

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

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: transparent;
}

.hero-content {
    text-align: center;
    z-index: 2;
    animation: fadeInUp 1s ease-out;
}

.glowing-name-span {
    background: linear-gradient(45deg, #00d4ff, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}



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

.wave {
    display: inline-block;
    animation: wave 1.5s ease-in-out infinite;
    -webkit-text-fill-color: var(--color-white);
    color: var(--color-white);
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg) }
    25% { transform: rotate(15deg) ; }
    50% { transform: rotate(-10deg) ; }
    75% { transform: rotate(5deg) ; }
}

.hero-subtitle {
    font-size: 0.8rem;
    height: 0.8rem;
    margin-bottom: 2.5rem;
    color: var(--color-text-muted)
}


.cta-button {
    display: inline-block;
    padding: 0.9375rem 1.875rem;
    background: linear-gradient(45deg, #00d4ff, #ff6b6b);
    color: #000000;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 0.088rem 0.328rem rgba(0, 212, 255, 0.3);
    margin-top: 1.25rem;
}

.cta-button:hover {
    transform: translateY(-0.1875rem);
    box-shadow: 0 0.175rem 0.547rem rgba(0, 212, 255, 0.5);
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23ffffff" opacity="0.05"/><circle cx="75" cy="75" r="1" fill="%23ffffff" opacity="0.05"/><circle cx="50" cy="10" r="0.5" fill="%23ffffff" opacity="0.03"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
}

/* Sections */
section {
    padding: 6.25rem 0;
    opacity: 0;
    transform: translateY(1.875rem);
    transition: opacity 0.6s ease, transform 0.6s ease;
    will-change: opacity, transform;
    contain: layout paint;
    content-visibility: auto;
    /* Use intrinsic height to prevent blank space when scrolling fast on mobile */
    contain-intrinsic-size: auto 100vh;
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3.125rem;
    color: white;
}

/* About Section */
.about {
    padding: 4rem 1.25rem 1rem;
}

@media (min-width: 500px) {
    .about {
        padding-left: 1.75rem;
        padding-right: 1.75rem;
    }
    .hero-subtitle {
        font-size: 1rem;
        height: 1rem;
    }

}

@media (min-width: 1024px) {
    .about {
        padding-left: 2.25rem;
        padding-right: 2.25rem;
    }
    .hero-subtitle {
        font-size: 1.2rem;
        height: 1.2rem;
    }
}

.about-intro {
    max-width: 70ch;
    margin: 0 auto 1rem auto

}

.about-title {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.875rem;
    line-height: 1.25;
    font-weight: 700;
}

@media (min-width: 640px) {
    .about-title {
        font-size: 3rem;
    }
}

@media (min-width: 1024px) {
    .about-title {
        font-size: 3.75rem;
    }
}

.about-text {
    font-size: 1.125rem;
    line-height: 1.625;
    color: #d1d5db;
}

@media (max-width: 480px) {
    .about-text {
        font-size: 1rem;
    }
}

@media (min-width: 1024px) {
    .about-text {
        font-size: 1.25rem;
    }
}

.about-text p {
    margin-bottom: 1rem;
}

.about-text strong {
    font-weight: 600;
    color: #00d4ff;
}

.about-text .nowrap {
    white-space: nowrap;
}

.about-text .highlight {
    margin-right: 1px;
}

.dimmed {
    filter: brightness(0.75);
}

/* Skills Section */
.skills-section {
    margin-top: 1.5rem;
    color: var(--color-text-muted)
}

.skills-title {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--color-text-light);
}

@media (min-width: 640px) {
    .skills-title {
        font-size: 3rem;
    }
}

@media (min-width: 1024px) {
    .skills-title {
        font-size: 3.75rem;
    }
}

.skills-container {
    display: flex;
    justify-content: center;
}

.skills-grid-container {
    display: flex;
    max-width: 75%;
    flex-direction: column;
    flex-wrap: wrap;
    justify-content: center;
    column-gap: 1.75rem;
    row-gap: 2.5rem;
}

@media (min-width: 640px) {
    .skills-grid-container {
        max-width: 70%;
    }
}

@media (min-width: 768px) {
    .skills-grid-container {
        flex-direction: row;
    }
}

/* Category Cards */
.category {
    display: flex;
    width: min(25rem, 80vw);
    flex-direction: column;
    border-radius: 0.75rem;
    border: 1px solid rgba(209, 213, 219, 0.3);
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(10px);
    box-shadow: 0 0.438rem 0.547rem -0.109rem rgba(0, 0, 0, 0.3), 0 0.219rem 0.219rem -0.109rem rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.category:hover {
    transform: translateY(-0.3125rem);
    box-shadow: 0 0.547rem 0.656rem -0.109rem rgba(0, 212, 255, 0.2), 0 0.328rem 0.328rem -0.109rem rgba(0, 0, 0, 0.3);
    border-color: rgba(0, 212, 255, 0.5);
}

.category-header {
    border-top-left-radius: 0.75rem;
    border-top-right-radius: 0.75rem;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 0.75rem 1rem;
    text-align: center;
    font-size: 1.125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (min-width: 1024px) {
    .category-header {
        font-size: 1.25rem;
    }
}

.category-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.25rem;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Category Lists */
.category-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0 1.25rem;
}

/* Fix list dots appearing on border at small screens */
.category-content ul {
    padding-left: 1.25rem;
}

@media (max-width: 450px) {
    .category-content ul {
        padding-left: 1.5rem;
    }
}

/* Skill Items */
.skill-item {
    display: inline-flex;
    align-items: center;
    font-weight: 500;
    color: var(--color-text-muted);
    opacity: 0.9;
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.375rem;
    transition: background 0.2s ease;
}

.skill-item:hover {
    background: rgba(0, 212, 255, 0.2);
    cursor: default;
}

.skill-item img {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 4px;
    object-fit: contain;
}

@media (max-width: 480px) {
    .skill-item {
        font-size: 0.875rem;
        padding: 0.1875rem 0.375rem;
    }

    .skill-item img {
        width: 1rem;
        height: 1rem;
    }
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18.75rem, 1fr));
    gap: 1.875rem;
    margin-top: 3.125rem;
}

.project-card {
    background: rgba(1, 20, 36, 0.9);
    border-radius: 0.625rem;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 0.263rem 0.656rem 0.175rem rgba(15, 52, 96, 1),
        0 0.131rem 0.219rem 0.088rem rgba(15, 52, 96, 0.8),
        0 0.066rem 0.109rem 0.044rem rgba(15, 52, 96, 0.6);
}

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



.project-image {
    
    height: 12.5rem;
    overflow: hidden;
    display: flex;
    justify-content: center;
}

.project-image img {
    width: 100%;
    height: 100%;
    max-width: 450px;
    object-fit:fill;
    transition: transform 0.3s ease;
}

.project-card h3 {
    padding: 1.25rem;
    font-size: 1.5rem;
    color: var(--color-white);
}

.project-card p {
    padding: 0 1.25rem 1.25rem;
    color: #cccccc;
}

.project-links {
    padding: 0 1.25rem 1.25rem;
    display: flex;
    gap: 0.625rem;
    margin-top: auto;
}

.project-link {
    color: var(--color-white);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
    background-color: #020421;
    padding: 7px 15px;
    border-radius: 20px;
}

.project-link:hover {
    color: #ff6b6b;
}

/* Contact Section */
.contact-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 1.875rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--color-white);
    text-decoration: none;
    padding: 0.9375rem 1.25rem;
    background: #020421;
    border-radius: 1.2rem;
    
}

.contact-link:hover {
    background: #010212;
    color: #ff6b6b;
}

.contact-link img {
    width: 1.5rem;
    height: 1.5rem;
}




/* Images */
img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
}

img[style*="height"] {
    height: auto !important;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(1.875rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes glow {
    from {
        text-shadow: 0 0 0.109rem #00d4ff;
    }
    to {
        text-shadow: 0 0 0.438rem #00d4ff, 0 0 0.656rem #ff6b6b;
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}




/* Section Spacing */
.hero {
    position: relative;
    padding-bottom: 4rem;
    content-visibility: visible;
}

.about {
    position: relative;
    min-height: 90vh;
    padding-top: 6rem;
}

.skills {
    position: relative;
    min-height: 100vh;
    padding-bottom: 2rem;
}

.projects {
    position: relative;
    padding: 2rem 0;
}

.contact {
    position: relative;
    min-height: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 3rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .category {
        width: 100%;
        max-width: 100%;
    }

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

/* Very small screens (e.g., 310px devices like Honor phones) */
@media (max-width: 340px) {
    body {
        padding: 0 8px 0 8px;
    }

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

    .skill-item {
        font-size: 0.7rem;
    }
}

/* Contact buttons flex-wrap at ~450px instead of column direction */
@media (max-width: 450px) {
    .contact-links {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: 15px;
    }

    .contact-link {
        padding: 12px 16px;
    }
}
