:root {
    --color-bg: #f5f5f5;
    --color-text: #0a0a0a;
    --color-accent: #000;
    --color-border: #e0e0e0;
    --color-card-bg: #fff;
    --font-display: 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
}

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

html {
    scroll-behavior: smooth;
}

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

/* --- Components & Global UI --- */
.btn {
    padding: 1rem 2rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition);
    display: inline-block;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: none;
}

.btn-primary {
    background: var(--color-accent);
    color: #fff;
    border: 2px solid var(--color-accent);
}

.btn-primary:hover {
    background: transparent;
    color: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: transparent;
    color: var(--color-accent);
    border: 2px solid var(--color-accent);
}

.btn-secondary:hover {
    background: var(--color-accent);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to { transform: scale(4); opacity: 0; }
}

/* --- Navigation --- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid var(--color-border);
}

.nav-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.2rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-width: 0;
    flex-wrap: wrap;
}

.logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-accent);
    text-decoration: none;
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    flex-shrink: 1;
    min-width: 0;
}

.nav-link {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text);
    text-decoration: none;
    position: relative;
    transition: var(--transition);
    opacity: 0.7;
}

.nav-link:hover, .nav-link.active { opacity: 1; }

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    transition: width 0.3s ease;
}

.nav-link.active::after, .nav-link:hover::after { width: 100%; }

/* --- Section Headers --- */
.section-title {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-align: center;
    letter-spacing: -0.02em;
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--color-text);
    opacity: 0.6;
    text-align: center;
    max-width: 700px;
    margin: 0 auto 4rem;
}

/* --- Home (Intro) Section --- */
.page {
    padding: 8rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Extra breathing room under the fixed nav for the hero */
#home.page {
    padding-top: 12rem;
}

.home-content {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 6rem;
    align-items: center;
    min-height: 60vh;
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Slide-up keyframe */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(28px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Blinking cursor for typing animation */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

.title {
    display: flex;
    flex-direction: column;
    gap: 0.15em;
}

/* Both greeting and name share identical type treatment */
.greeting,
.name {
    display: block;
    font-family: var(--font-display);
    font-size: 4.5rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.greeting {
    animation: slideUp 0.55s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.name {
    animation: slideUp 0.55s cubic-bezier(0.4, 0, 0.2, 1) 0.18s both;
}

/* Bio typing cursor */
.bio-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--color-text);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: blink 0.75s step-end infinite;
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--color-text);
    opacity: 0.8;
}

.cta-buttons {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

.illustration {
    width: 100%;
    max-width: 500px;
}

.avatar-img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.1));
}

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

.project-card {
    background: var(--color-card-bg);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    border: 1px solid var(--color-border);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.project-number {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-family: var(--font-display);
    font-size: 5rem;
    font-weight: 900;
    color: var(--color-accent);
    opacity: 0.05;
    line-height: 1;
    z-index: 1;
    pointer-events: none;
}

.project-image {
    width: 100%;
    height: 240px;
    background: #eee;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-info {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.project-title {
    font-size: 1.8rem;
    font-weight: 700;
}

.project-description {
    color: #555;
    font-size: 1rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.tag {
    background: var(--color-bg);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
}

.project-links {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.project-link {
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--color-accent);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.project-link:hover {
    gap: 0.8rem;
}

.website-link {
    opacity: 0.6;
}

.website-link:hover {
    opacity: 1;
}

/* --- Modal Link Buttons --- */
.modal-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.modal-link {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 1.75rem;
    border-radius: 10px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    transition: var(--transition);
    border: 2px solid transparent;
    cursor: pointer;
}

/* GitHub button — filled black, inverts on hover */
.modal-link-primary {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}

.modal-link-primary:hover {
    background: transparent;
    color: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* itch.io button — outlined red, fills on hover */
.modal-link-itch {
    background: transparent;
    color: #fa5c5c;
    border-color: #fa5c5c;
}

.modal-link-itch:hover {
    background: #fa5c5c;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(250, 92, 92, 0.25);
}

.modal-no-links {
    font-size: 0.95rem;
    color: var(--color-text);
    opacity: 0.4;
    font-style: italic;
}

/* --- Contact Section --- */

/* Two-column: envelope + text on left, card on right */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 5rem;
    align-items: start;
}

.contact-left {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Left-align the title inside the contact section only */
.contact-left .section-title {
    text-align: left;
}

.contact-intro {
    font-size: 1.1rem;
    color: var(--color-text);
    opacity: 0.65;
    line-height: 1.75;
}

.contact-illustration {
    margin-top: 1.5rem;
}

.envelope-img {
    width: 100%;
    max-width: 320px;
    height: auto;
    filter: drop-shadow(0 16px 32px rgba(0, 0, 0, 0.1));
}

/* Contact info card */
.contact-info-card {
    background: var(--color-card-bg);
    padding: 3.5rem;
    border-radius: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--color-border);
}

.contact-card-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.contact-card-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 4px;
    background: var(--color-accent);
    border-radius: 2px;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 3rem;
}

.contact-item {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.contact-icon {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    background: var(--color-bg);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.contact-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.45;
}

.contact-value {
    font-weight: 600;
    font-size: 1rem;
    color: var(--color-text);
    text-decoration: none;
    word-break: break-all;
}

.contact-socials {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    border-top: 1px solid var(--color-border);
    padding-top: 2rem;
}

.social-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--color-text);
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition);
}

.social-link:hover {
    color: var(--color-accent);
    transform: translateY(-5px);
}

.social-icon {
    width: 44px;
    height: 44px;
    background: var(--color-bg);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    border: 1px solid var(--color-border);
}

.social-link:hover .social-icon {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}

.social-label {
    font-size: 0.75rem;
}

/* --- Contact Form (kept for forward compatibility) --- */
.contact-form {
    background: var(--color-card-bg);
    padding: 3.5rem;
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--color-accent);
}

/* --- Modal --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal.active { display: flex; }

.modal-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    max-width: 800px;
    width: 100%;
    border-radius: 20px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.5s ease;
}

@keyframes modalIn {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-body { padding: 3rem; }

.modal-image-container {
    width: 100%;
    height: 280px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 2rem;
    background: #eee;
}

.modal-project-image {
    width: 100%;
    height: 100%;
}

.modal-project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* --- Modal text typography --- */
.modal-header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1rem;
}

.modal-number {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text);
    opacity: 0.35;
    flex-shrink: 0;
}

.modal-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--color-text);
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.modal-description {
    font-size: 1rem;
    line-height: 1.8;
    color: #444;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
}

.modal-features {
    margin-bottom: 0.5rem;
}

.modal-features h3 {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-text);
    opacity: 0.4;
    margin-bottom: 1rem;
}

.features-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0;
}

.features-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text);
}

.features-list li::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-accent);
    flex-shrink: 0;
    opacity: 0.7;
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
    color: var(--color-text);
    opacity: 0.45;
    transition: var(--transition);
}

.modal-close:hover {
    opacity: 1;
}

/* --- Responsive Layouts --- */

@media (max-width: 1024px) {
    .home-content {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }

    .cta-buttons { justify-content: center; }
    .illustration { margin: 0 auto; order: -1; }

    /* Stack contact layout on tablet */
    .contact-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .contact-left .section-title {
        text-align: center;
    }

    .contact-intro {
        text-align: center;
    }

    .contact-illustration {
        display: flex;
        justify-content: center;
    }
}

/* Nav comfort zone — reduce link gap before they crowd */
@media (max-width: 900px) {
    .nav-links {
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .nav-links { display: none; }

    .greeting,
    .name { font-size: 3.2rem; }

    .section-title { font-size: 2.8rem; }

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

    .contact-socials { grid-template-columns: repeat(2, 1fr); }

    .modal-links {
        flex-direction: column;
    }

    .modal-link {
        justify-content: center;
    }
    .nav-content {
        padding: 1rem; /* Smaller padding for mobile */
        flex-direction: column; /* Stacks logo and links vertically */
        gap: 1rem; /* Adds space between logo and links */
    }

    .nav-links {
        display: flex;
        gap: 1rem;
        font-size: 0.9rem; /* Slightly smaller text */
    }
}

@media (max-width: 480px) {
    .greeting,
    .name { font-size: 2.5rem; }

    .cta-buttons { flex-direction: column; }

    .contact-info-card,
    .contact-form { padding: 2rem 1.5rem; }

    .contact-socials { grid-template-columns: repeat(2, 1fr); }

    .contact-item { flex-direction: column; text-align: center; }
}

/* --- Footer --- */
.footer {
    text-align: center;
    padding: 3rem;
    border-top: 1px solid var(--color-border);
    opacity: 0.6;
}

