/* ==================== */
/* CSS Reset & Base     */
/* ==================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

::selection {
    background-color: var(--primary-color);
    color: var(--bg-light);
}

:root {
    --primary-color: #27332D; /* Deep green */
    --primary-dark: #1E2622;
    --primary-light: #515748;
    --secondary-color: #FADB3F; /* Yellow */
    --secondary-dark: #D9C137;
    --accent-color: #ECF7C5; /* Soft mint */
    --text-color: #27332D;
    --text-light: #515748;
    --text-lighter: #6C7260;
    --bg-color: #ECF7C5;
    --bg-light: #F7FBE3;
    --bg-dark: #27332D;
    --border-color: #DCE7B7;
    --border-light: #EAF2C6;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
    --nav-height: 180px;
    --gradient-primary: none;
    --gradient-secondary: none;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Sora', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-light);
    background-attachment: fixed;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    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="rgba(255,255,255,0.03)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.03)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.02)"/><circle cx="10" cy="50" r="0.5" fill="rgba(255,255,255,0.02)"/><circle cx="90" cy="30" r="0.5" fill="rgba(255,255,255,0.02)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1,
h2,
h3,
.nav-brand a,
.section-title {
    font-family: 'Space Grotesk', 'Sora', sans-serif;
}

/* ==================== */
/* Navigation           */
/* ==================== */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: var(--transition);
    height: var(--nav-height);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-lg);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
    min-height: var(--nav-height);
}

.nav-brand a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    text-align: left;
}

.brand-logo {
    width: 104px;
    height: 104px;
    display: block;
}

.brand-text {
    font-size: 1.8rem;
    line-height: 1.2;
}

.nav-brand .brand-name {
    font-family: "Playpen Sans", cursive;
    font-optical-sizing: auto;
    font-weight: 600;
    font-style: normal;
    letter-spacing: 0.3px;
}

.nav-brand a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--secondary-color);
    transition: var(--transition);
}

.nav-brand a:hover::after {
    width: 100%;
}

.nav-brand a:hover {
    transform: translateY(-1px);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    position: relative;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: var(--transition);
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover {
    color: var(--primary-color);
    background: rgba(250, 219, 63, 0.2);
    transform: translateY(-2px);
}

.nav-link.active {
    color: var(--primary-color);
    background: rgba(250, 219, 63, 0.2);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 3px 0;
    transition: var(--transition);
}

/* ==================== */
/* Hero Section         */
/* ==================== */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    color: var(--primary-color);
    padding-top: calc(var(--nav-height) + 40px);
    position: relative;
    overflow: hidden;
}

.hero-bubble-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
    z-index: 0;
}

@keyframes bubble-orbit {
    0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
    50% { transform: translate(-50%, -50%) rotate(180deg); }
}

@keyframes bubble-orbit-reverse {
    0%, 100% { transform: translate(-50%, -50%) rotate(360deg); }
    50% { transform: translate(-50%, -50%) rotate(180deg); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-10px) rotate(1deg); }
    66% { transform: translateY(5px) rotate(-1deg); }
}

.hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    position: relative;
    z-index: 1;
}

.hero-content {
    text-align: left;
    max-width: 640px;
}

.hero-media {
    flex: 0 0 320px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 0;
}


.hero-photo {
    position: relative;
    z-index: 1;
    width: 320px;
    max-width: 80vw;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    border: 6px solid rgba(250, 219, 63, 0.6);
    box-shadow: 0 20px 40px rgba(39, 51, 45, 0.18);
    background: var(--bg-color);
    object-fit: cover;
    opacity: 0.8;
    animation: bubble-float 6s ease-in-out infinite;
}

@keyframes bubble-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease;
    line-height: 1.1;
}

.highlight {
    font-family: "Playpen Sans", cursive;
    font-optical-sizing: auto;
    font-weight: 600;
    font-style: normal;
    color: var(--secondary-color);
    position: relative;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--secondary-color);
    border-radius: 2px;
    animation: slideIn 1s ease 0.8s both;
}

@keyframes slideIn {
    from { width: 0; }
    to { width: 100%; }
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    opacity: 0.9;
    animation: fadeInUp 1s ease 0.2s both;
    font-weight: 300;
}

.hero-description {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.85;
    animation: fadeInUp 1s ease 0.4s both;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 1s ease 0.6s both;
}

/* ==================== */
/* Buttons              */
/* ==================== */

.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: var(--border-radius-lg);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--secondary-color);
    color: var(--primary-color);
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    background: var(--primary-color);
    color: var(--accent-color);
}

.btn-secondary {
    background: rgba(39, 51, 45, 0.1);
    color: var(--primary-color);
    border-color: rgba(39, 51, 45, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(39, 51, 45, 0.2);
    border-color: rgba(39, 51, 45, 0.5);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* ==================== */
/* Section Styles       */
/* ==================== */

section {
    padding: 100px 0;
    position: relative;
}

section:nth-child(even) {
    background: #F0F6D5;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-color);
    position: relative;
    line-height: 1.2;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: var(--secondary-color);
    margin: 1rem auto 0;
    border-radius: 2px;
}

.section-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* ==================== */
/* About Section        */
/* ==================== */

.about {
    background-color: #F0F6D5;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: var(--text-light);
}

/* ==================== */
/* Projects Section     */
/* ==================== */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card {
    background: #F7FBE3;
    border-radius: var(--border-radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border-light);
    position: relative;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--secondary-color);
    opacity: 0;
    transition: var(--transition);
    z-index: -1;
}

.project-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

.project-card:hover::before {
    opacity: 0.05;
}

.project-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.project-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: var(--transition);
}

.project-card:hover .project-image::after {
    opacity: 1;
}

.project-placeholder {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 700;
    z-index: 1;
    position: relative;
}

.project-content {
    padding: 1.5rem;
}

.project-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.project-description {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.project-section-title {
    font-weight: 600;
    color: var(--text-color);
    margin: 1rem 0 0.5rem;
}

.project-code {
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: var(--text-color);
    overflow-x: auto;
    margin-bottom: 1rem;
}

.project-features,
.project-tech {
    list-style: none;
    margin-bottom: 1rem;
    color: var(--text-light);
    display: grid;
    gap: 0.4rem;
    font-size: 0.95rem;
}

.project-features li,
.project-tech li {
    padding-left: 0.2rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    background-color: var(--bg-light);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.project-link:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* ==================== */
/* Project Details      */
/* ==================== */

.project-details {
    background-color: var(--bg-light);
}

.project-detail-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.project-detail-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

/* ==================== */
/* Skills Section       */
/* ==================== */

.skills {
    background-color: var(--bg-light);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.skill-category {
    background-color: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.skill-category:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.skill-category h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.skill-list {
    list-style: none;
}

.skill-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-light);
    transition: var(--transition);
}

.skill-list li:last-child {
    border-bottom: none;
}

.skill-list li:hover {
    color: var(--primary-color);
    padding-left: 10px;
}

/* ==================== */
/* Contact Section      */
/* ==================== */

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
}

.contact-info h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.contact-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.contact-icon {
    font-size: 1.5rem;
}

.contact-item strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-color);
}

.contact-item p {
    color: var(--text-light);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.social-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* ==================== */
/* Contact Form         */
/* ==================== */

.contact-form {
    background-color: var(--bg-light);
    padding: 2rem;
    border-radius: 12px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-form .btn {
    width: 100%;
}

/* ==================== */
/* Footer               */
/* ==================== */

.footer {
    background-color: var(--text-color);
    color: white;
    text-align: center;
    padding: 2rem 0;
}

.footer p {
    margin: 0.5rem 0;
    opacity: 0.8;
}

/* ==================== */
/* Animations           */
/* ==================== */

/* ==================== */
/* Animations           */
/* ==================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==================== */
/* Responsive Design    */
/* ==================== */

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: var(--nav-height);
        left: -100%;
        width: 100%;
        height: calc(100vh - var(--nav-height));
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 2rem;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: var(--shadow-xl);
        justify-content: flex-start;
        gap: 1.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
        background-color: var(--primary-color);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(8px, -8px);
        background-color: var(--primary-color);
    }

    .nav-link {
        font-size: 1.1rem;
        padding: 1rem;
        width: 100%;
        text-align: center;
        border-radius: var(--border-radius-lg);
    }

    .nav-link:hover {
        background: rgba(250, 219, 63, 0.2);
        transform: translateY(0);
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-inner {
        flex-direction: column;
        text-align: center;
    }

    .hero-content {
        text-align: center;
    }

    .hero-media {
        order: -1;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .nav-brand a {
        font-size: 1.25rem;
    }

    .brand-logo {
        width: 76px;
        height: 76px;
    }

    .brand-text {
        font-size: 1.45rem;
    }

    section {
        padding: 60px 0;
    }
}
