/* =========================
   RESET + BASE
========================= */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    font-family: 'Inter', sans-serif;
    background: #0b0614;
    color: #e6e0ff;
    line-height: 1.6;
    overflow-x: hidden;
}

/* =========================
   VARIABLES
========================= */
:root {
    --bg-main: #0b0614;
    --bg-secondary: #140a24;
    --bg-header: #160d2e; /* NEW distinct navbar color */
    --accent: #8b5cf6;
    --accent-soft: #a78bfa;
    --text-main: #e6e0ff;
    --text-muted: rgba(230, 224, 255, 0.65);
    --border-soft: rgba(255,255,255,0.06);
}

/* =========================
   GLOBAL LINKS
========================= */

a {
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.25s ease;
}

/* hover */
a:hover {
    color: var(--accent);
}

/* visited */
a:visited {
    color: #9f7aea; /* slightly deeper purple */
}

/* Only apply click effect to buttons, NOT links */
button:active,
.contact-btn:active {
    transform: scale(0.97);
}

/* =========================
   PAGE TRANSITION
========================= */

/* Smooth page fade */

#pageWrapper {
    opacity: 0;
    transition: opacity 0.4s ease;
}

#pageWrapper.page-visible {
    opacity: 1;
}

#pageWrapper.page-fade-out {
    opacity: 0;
}

/* =========================
   GLOBAL CONTAINER FIX
========================= */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px; /* 🔥 THIS FIXES CLIPPING */
}

/* =========================
   SECTIONS
========================= */
.section {
    padding: clamp(60px, 6vw, 120px) 0;
}

.section-title {
    font-size: clamp(24px, 2vw, 32px);
    margin-bottom: 24px;
}

/* =========================
   HEADER / NAV
========================= */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;

    background: var(--bg-header); /* solid different shade */
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

/* NAV WRAPPER */
.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px; /* FIX HEIGHT consistency */
}

/* =========================
   IMAGE LOGO
========================= */

.logo img {
    height: 52px;          /* 🔥 main control */
    width: auto;
    display: block;

    /* polish */
    filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.35));
    transition: transform 0.25s ease, filter 0.25s ease;
}

.logo a:hover img {
    transform: scale(1.05);
    filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.6));
}

/* slightly smaller on tighter layouts */
@media (max-width: 1200px) {
    .logo img {
        height: 36px;
    }
}

/* NAV RIGHT SIDE */
.nav-desktop {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 100%;
}

/* LINKS */
.nav-desktop a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 14px;
    white-space: nowrap; /* 🔥 PREVENT WRAP CLIPPING */
    transition: 0.2s ease;
}

.nav-desktop a:hover {
    color: var(--accent);
}

/* MOBILE TOGGLE */
.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.mobile-toggle span {
    width: 26px;
    height: 2px;
    background: var(--text-main);
}

/* MOBILE NAV */
.mobile-nav {
    position: fixed;
    inset: 0;
    background: rgba(11, 6, 20, 0.95);
    backdrop-filter: blur(20px);

    display: none;
    justify-content: center;
    align-items: center;
}

.mobile-nav.active {
    display: flex;
}

.mobile-nav-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
    text-align: center;
}

.mobile-nav-content a {
    font-size: 22px;
    text-decoration: none;
    color: var(--text-main);
}

.mobile-nav-content a:hover {
    color: var(--accent);
}

/* =========================
   NAVBAR LINKS
========================= */

.nav-desktop a {
    position: relative;
    padding: 6px 4px;
    font-size: 15px;
    color: var(--text-muted);
}

/* hover glow */
.nav-desktop a:hover {
    color: var(--accent);
}

/* underline animation */
.nav-desktop a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 0%;
    height: 2px;

    background: linear-gradient(90deg, #8b5cf6, #c084fc);
    transition: width 0.25s ease;
}

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

/* ACTIVE PAGE */
.nav-desktop a.active {
    color: #c084fc;
    font-weight: 600;
}

/* active underline always visible */
.nav-desktop a.active::after {
    width: 100%;
}

.mobile-nav-content a {
    color: var(--text-main);
    opacity: 0.7;
}

.mobile-nav-content a.active {
    opacity: 1;
    color: var(--accent);
    font-weight: 600;
}

/* =========================
   INTRO
========================= */
.intro-title {
    font-size: clamp(36px, 4vw, 60px);
    margin-bottom: 20px;
    background: linear-gradient(90deg, #8b5cf6, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.intro-text {
    max-width: 700px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* =========================
   PROJECTS
========================= */
.projects-grid {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.project-card {
    flex: 1 1 300px;
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border-soft);

    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 220px;
}

.project-card h3 {
    margin-bottom: 12px;
}

.project-card p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.project-link {
    margin-top: auto;
    text-decoration: none;
    color: var(--accent);
}

/* =========================
   FOOTER
========================= */
.site-footer {
    border-top: 1px solid var(--border-soft);
    padding: 40px 0;
    background: #120a22; /* slightly different from main */
}

.footer-container {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    flex-wrap: wrap;
}

/* LEFT */
.footer-logo a {
    text-decoration: none;
    font-weight: 600;
    color: var(--text-main);
}

.footer-tagline {
    color: var(--text-muted);
    max-width: 300px;
    margin-top: 10px;
}

/* RIGHT */
.footer-links {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

.footer-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-column a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 14px;
}

.footer-column a:hover {
    color: var(--accent);
}

/* BOTTOM */
.footer-bottom {
    text-align: center;
    margin-top: 30px;
    color: var(--text-muted);
    font-size: 13px;
}

/* =========================
   CONTACT FORM CLEAN
========================= */

.contact-card {
    max-width: 600px;
    margin: 0 auto;
}

/* form layout */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* group spacing */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* labels */
.form-group label {
    font-size: 14px;
    color: var(--text-muted);
}

/* inputs */
.contact-form input,
.contact-form textarea {
    width: 100%;

    background: #0f0820;
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-main);

    border-radius: 8px;
    padding: 12px;

    font-size: 14px;

    transition: 0.2s ease;
}

/* focus */
.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(139,92,246,0.2);
}

/* textarea resize control */
.contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

/* =========================
   BUTTON (PROPER VERSION)
========================= */

.contact-btn {
    align-self: flex-start;

    padding: 12px 22px;

    background: linear-gradient(135deg, #8b5cf6, #c084fc);
    color: #fff;

    border: none;
    border-radius: 8px;

    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.4px;

    cursor: pointer;

    transition: all 0.25s ease;

    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
}

/* hover */
.contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(139, 92, 246, 0.55);
}

/* click */
.contact-btn:active {
    transform: translateY(0);
}

/* focus */
.contact-btn:focus {
    outline: none;
    box-shadow:
        0 0 0 2px rgba(139,92,246,0.4),
        0 4px 14px rgba(139,92,246,0.35);
}

/* =========================
   BREAKPOINT
========================= */
@media (max-width: 1200px) {

    .nav-desktop {
        display: none;
    }

    .mobile-toggle {
        display: flex;
    }

    .footer-container {
        flex-direction: column;
    }

    .projects-grid {
        flex-direction: column;
    }
}