:root {
    --primary: #1a1a1a;
    --secondary: #666;
    --accent: #5e5e5e;
    --bg: #ffffff;
    --bg-secondary: #f9f9f9;
    --border: #e0e0e0;
    --white: #ffffff;
    --transition-fast: 0.2s ease;
    --transition-slow: 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    --container-max: 1200px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--primary);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

/* Typography Extensions */
i {
    font-family: 'Playfair Display', serif;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 20px;
    /* Floating from top */
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 80px);
    /* Padding on sides */
    max-width: var(--container-max);
    padding: 20px 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: saturate(180%) blur(20px);
    z-index: 1000;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
    transition: var(--transition-slow);
}

.navbar.scrolled {
    top: 10px;
    padding: 12px 0;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

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

.logo {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -0.5px;
    text-decoration: none;
    color: var(--primary);
    text-transform: uppercase;
}

.logo>span:last-child {
    color: var(--accent);
}

.logo-last {
    margin-left: 8px;
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 40px;
}

.nav-links a {
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary);
    opacity: 0.7;
    transition: var(--transition-fast);
}

.nav-links a.active {
    opacity: 1;
    color: var(--primary);
    position: relative;
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

.nav-links a:hover {
    opacity: 1;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 18px 30px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 4px;
    text-decoration: none;
    transition: var(--transition-slow);
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border: 1px solid var(--primary);
}

.btn-primary:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.btn-link {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 8px;
    background: transparent;
}

/* Sections */
section {
    padding: 160px 0;
}

.section-header {
    margin-bottom: 80px;
    max-width: 600px;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    line-height: 1.1;
    margin-bottom: 20px;
}

/* Hero Section */
.hero {
    padding: 180px 0 160px;
}

.hero-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--secondary);
    margin-bottom: 30px;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(3.5rem, 8vw, 6rem);
    font-weight: 700;
    line-height: 1.05;
    margin-bottom: 40px;
    letter-spacing: -1px;
}

.hero-sub {
    font-size: 1.25rem;
    max-width: 600px;
    color: var(--secondary);
    margin-bottom: 50px;
}

.hero-cta {
    display: flex;
    align-items: center;
    gap: 30px;
}

/* Projects (Alternating Layout) */
.work {
    background: var(--bg-secondary);
}

.project-list-alt {
    display: flex;
    flex-direction: column;
    gap: 120px;
}

.project-item-alt {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.project-img-container {
    width: 100%;
    aspect-ratio: 16/10;
    background: #eee;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    transition: var(--transition-slow);
}

.project-img-container:hover {
    transform: scale(1.02);
}

.project-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.project-img-container:hover img {
    transform: scale(1.1);
}

.placeholder-img {
    width: 100%;
    height: 100%;
}

.placeholder-img.color-2 {
    background: #e3dcd1;
}

.project-details {
    display: flex;
    flex-direction: column;
}

.project-num {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    color: var(--secondary);
    margin-bottom: 20px;
    display: block;
}

.project-details h3 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    margin-bottom: 15px;
    letter-spacing: -0.5px;
}

.project-tags {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--secondary);
    letter-spacing: 1.5px;
    margin-bottom: 25px;
}

.project-text {
    font-size: 1.1rem;
    color: var(--secondary);
    line-height: 1.7;
    margin-bottom: 35px;
    max-width: 450px;
}

.github-link-alt {
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    padding-bottom: 5px;
    border-bottom: 2px solid var(--primary);
    width: fit-content;
    transition: var(--transition-fast);
}

.github-link-alt:hover {
    opacity: 0.6;
}

/* Services Section */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.service-card {
    padding: 50px 40px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: var(--transition-slow);
}

.service-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
}

.service-icon {
    font-size: 1.5rem;
    margin-bottom: 25px;
    color: var(--primary);
}

.service-card h3 {
    font-size: 1.25rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.service-card p {
    color: var(--secondary);
    font-size: 0.95rem;
}

/* Stats Section */
.stats {
    padding: 100px 0;
    background: var(--primary);
    color: var(--white);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    text-align: center;
}

.stat-value {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
}

/* Journey Staggered Layout */
.journey-v2 {
    display: flex;
    flex-direction: column;
    gap: 100px;
    margin-bottom: 120px;
}

.journey-item-v2 {
    display: flex;
    align-items: center;
    gap: 60px;
}

.journey-item-v2.right-aligned {
    margin-right: auto;
    width: 60%;
}

.journey-item-v2.left-aligned {
    margin-left: auto;
    width: 60%;
    justify-content: flex-end;
}

.journey-graphic {
    position: relative;
    height: 300px;
    width: 2px;
    background: var(--border);
}

.journey-dot {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

.journey-info-v2 {
    max-width: 400px;
}

.journey-date {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    display: block;
    margin-bottom: 15px;
}

.journey-text-v2 {
    font-size: 1.1rem;
    color: var(--secondary);
    line-height: 1.7;
}

/* Skills sub-section */
.about-skills {
    padding-top: 80px;
    border-top: 1px solid var(--border);
}

.about-skills h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--secondary);
    margin-bottom: 30px;
}

.skill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 50px;
    width: 100%;
}

.skill-box {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    z-index: 10;
}

.skill-box:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

@media (max-width: 600px) {
    .skill-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Contact Section */
.contact {
    padding: 60px 0 20px;
    /* Reduced padding to bring footer into view */
}

.contact-box {
    background: var(--primary);
    color: var(--white);
    padding: 40px 60px;
    /* Reduced vertical padding from 80px */
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.contact-box .section-title {
    color: var(--white);
    margin-bottom: 30px;
    /* Reduced from 60px */
}

.contact-box p {
    color: #999;
    margin-bottom: 30px;
    /* Reduced from 40px */
    max-width: 450px;
}

.contact-socials {
    margin-top: 30px;
    /* Reduced from 50px */
    padding-top: 25px;
    /* Reduced from 40px */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
}

.contact-socials p {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 20px;
    margin-left: auto;
    margin-right: auto;
}

.social-links-inner {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.social-links-inner a {
    color: var(--white);
    opacity: 0.6;
    transition: all 0.3s ease;
}

.social-links-inner a:hover {
    opacity: 1;
    transform: translateY(-5px);
}

.contact-form {
    width: 100%;
    max-width: 800px;
    text-align: left;
    /* Keep form labels/inputs left-aligned for better UX */
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: var(--transition-fast);
}

.contact-form input,
.contact-form textarea {
    padding: 15px 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--white);
    font-family: inherit;
    font-size: 1.1rem;
    outline: none;
    transition: var(--transition-fast);
}

/* The 'Something Other' - Expanding Underline Effect */
.form-group::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--white);
    transform: translateX(-101%);
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.form-group:focus-within::after {
    transform: translateX(0);
}

.form-group:focus-within label {
    color: var(--white);
    letter-spacing: 2.5px;
}

/* Prevent Browser Autofill Box */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--white);
    -webkit-box-shadow: 0 0 0px 1000px transparent inset;
    transition: background-color 5000s ease-in-out 0s;
}

/* --- Submit Button Premium Styling --- */
#submit-btn {
    width: 100%;
    margin-top: 20px;
    /* Reduced from 40px */
    background: #ffffff;
    color: #1a1a1a;
    border: none;
    border-radius: 8px;
    padding: 18px;
    /* Reduced from 22px */
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#submit-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    background: #fdfdfd;
}

#submit-btn:active {
    transform: translateY(-2px);
    background: #f0f0f0;
}

/* Hover Shine Effect */
#submit-btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.4),
            transparent);
    transition: 0.5s;
}

#submit-btn:hover::after {
    left: 100%;
}

.form-status {
    padding-top: 20px;
    font-size: 0.9rem;
}

.success {
    color: #4CAF50;
}

.error {
    color: #f44336;
}

/* Footer */
.footer {
    padding: 80px 0;
    border-top: 1px solid var(--border);
}

.footer-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.footer-inner p {
    color: var(--secondary);
    font-size: 1.1rem;
    /* Increased from 0.9rem */
    font-weight: 500;
}

.social-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.social-links a {
    text-decoration: none;
    color: var(--primary);
    opacity: 0.6;
    transition: var(--transition-fast);
    display: flex;
}

.social-links a:hover {
    opacity: 1;
    transform: translateY(-2px);
}

/* Menu for mobile? Let's skip complex nav for now. */
.menu-toggle {
    display: none;
}

@media (max-width: 991px) {
    .project-list-alt {
        gap: 60px;
    }

    .project-item-alt {
        grid-template-columns: 1fr;
        gap: 30px;
    }

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

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

    .container-split {
        grid-template-columns: 1fr;
        gap: 60px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .contact-box {
        padding: 60px 40px;
    }
}

@media (max-width: 768px) {
    .navbar {
        width: calc(100% - 40px);
        top: 15px;
    }

    .hero {
        padding: 180px 0 100px;
    }

    section {
        padding: 100px 0;
    }

    .nav-links {
        display: none;
    }
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* Success Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    visibility: hidden;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal.active {
    visibility: visible;
    opacity: 1;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1;
}

.modal-content {
    position: relative;
    background: var(--white);
    padding: 60px 50px;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.08);
    z-index: 2;
    transform: translateY(40px) scale(0.95);
    transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-icon {
    width: 80px;
    height: 80px;
    background: var(--bg-secondary);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
}

.modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--primary);
}

.modal-text {
    font-size: 1.1rem;
    color: var(--secondary);
    margin-bottom: 40px;
    line-height: 1.6;
}

.modal-close {
    width: 100%;
    max-width: 200px;
    cursor: pointer;
}

.back-to-top:hover {
    transform: translateY(-5px);
    background: var(--secondary);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.back-to-top svg {
    transition: transform 0.3s ease;
}

.back-to-top:hover svg {
    transform: translateY(-2px);
}