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

html {
    scroll-padding-top: 70px;
    /* adjust to match navbar height */
}

:root {
    --primary: #007bff;
    --dark: #1a1a1a;
    --light: #2a2a2a;
    --white: #ffffff;
    --text: #e0e0e0;
    --gray: #a0a0a0;
    --border: #404040;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--dark);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--light);
    z-index: 1000;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 1px;
    text-decoration: none;
    /* remove underline */
    margin-right: 1rem;
    /* keep space between logo and nav links */
}

.logo .nav-pfp {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    display: inline-block;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
    border: 2px solid rgba(255, 255, 255, 0.06);
}

.logo .logo-text {
    line-height: 1;
}

.nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    padding: 0.35rem;
    margin-left: auto;
    cursor: pointer;
    line-height: 0;
}

.nav-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.nav-toggle-icon {
    width: 30px;
    height: 30px;
    display: block;
    pointer-events: none;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: absolute;
    top: calc(100% + 0.5rem);
    right: clamp(1rem, 3vw, 2rem);
    min-width: 220px;
    width: min(320px, 60vw);
    padding: 1rem;
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-0.4rem);
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 1000;
}

.nav-links.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.nav-links a {
    color: var(--gray);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    min-height: auto;
    width: 100%;
    padding: 0.35rem 0.25rem;
    justify-content: flex-start;
    white-space: nowrap;
}

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

.nav-links a:hover {
    color: var(--primary);
}

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

.nav-contacts {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-left: auto;
}

.nav-contacts .contact-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
}

.nav-contacts .contact-item:hover,
.nav-contacts .contact-item:focus-visible {
    transform: translateY(-1px);
}

.nav-contacts svg.contact-icon {
    color: var(--white);
}

.nav-contacts img.contact-icon {
    filter: brightness(0) invert(1);
}

.nav-contacts .contact-icon {
    width: 28px;
    height: 28px;
    display: block;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dark);
    /* fallback */
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Blurred background image layer */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url('../Images/General/MainBackground.webp') center/cover no-repeat;
    filter: blur(12px);
    transform: scale(1.06);
    z-index: 0;
}

/* Gradient overlay to blend into About background (#2a2a2a) */
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(42, 42, 42, 0.3) 0%, rgba(42, 42, 42, 1) 100%);
    z-index: 1;
    pointer-events: none;
}

.hero-content {
    animation: fadeInUp 0.8s ease-out;
    position: relative;
    z-index: 2;
}

/* Profile picture styles */
.hero .profile-pic {
    /* image fills the wrapper; visual decoration is applied to .pfp-wrap */
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Wrapper that holds the img and draws an inward border with a pseudo-element */
.pfp-wrap {
    width: 160px;
    height: 160px;
    display: block;
    margin: 0 auto 1.5rem auto;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.pfp-wrap::after {
    /* inner ring: positioned inside the wrapper so it overlays any transparent image pixels */
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    box-sizing: border-box;
    /* ensure border is drawn inside the wrapper */
    border-radius: 50%;
    border: 3px solid var(--light);
    /* solid, fully opaque ring */
    pointer-events: none;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero h1 {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--white);
}

.subtitle {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 400;
    color: var(--gray);
    margin-bottom: 2rem;
}

.cta-button {
    display: inline-block;
    padding: 0.875rem 2rem;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
}

.cta-button:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

section {
    padding: 5rem 2rem;
}

.section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    text-align: center;
    margin-bottom: 3rem;
    color: var(--white);
    font-weight: 700;
}

.about {
    background: var(--light);
}

.about-content {
    font-size: 1.2rem;
    text-align: center;
}

.hero .profile-pic {
    /* image fills the wrapper; visual decoration is applied to .pfp-wrap */
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    animation: fadeIn 0.8s ease-out;
    align-items: stretch;
    grid-auto-rows: 1fr;
    justify-items: center;
}

.project-card {
    background: var(--light);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    -webkit-tap-highlight-color: transparent;
    pointer-events: none;
    cursor: default;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: min(100%, 360px);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
}

.project-image {
    width: 100%;
    height: 250px;
    background: var(--dark);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.project-image-music img {
    transform: scale(1.1);
}

.project-image-kitchen img {
    transform: scale(1.2);
}

.project-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.placeholder-image {
    color: var(--gray);
    font-size: 0.9rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.project-card h3 {
    font-size: 1.3rem;
    color: var(--white);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.project-card p {
    color: var(--white);
    line-height: 1.6;
    margin: 0;
}

.project-card p a {
    color: var(--white);
    text-decoration: underline;
    pointer-events: auto;
    cursor: pointer;
}

.project-body {
    position: relative;
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: var(--light);
    background-image: none;
    background-position: center;
    background-size: 150%;
    background-repeat: no-repeat;
    overflow: hidden;
}

.project-body::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(5, 5, 5, 0.55);
    z-index: 0;
}

.project-body > * {
    position: relative;
    z-index: 1;
}

.contact {
    background: var(--light);
}

.contact-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    animation: fadeIn 0.8s ease-out;
}

.contact-content p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--white);
}

/* Contact rows with icons */
.contact-row {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.contact-icon {
    width: 22px;
    height: 22px;
    color: var(--primary);
    flex: 0 0 auto;
}

.contact-content a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s ease;
    word-break: break-all;
}

.contact-content a:hover {
    color: #66b3ff;
    text-decoration: underline;
}

/* Clickable contact items with larger icons */
.contact-content .contact-item {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin: 0.25rem 0.5rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--white);
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    word-break: normal;
}

.contact-content .contact-item:hover,
.contact-content .contact-item:focus {
    color: var(--primary);
    background: rgba(0, 123, 255, 0.08);
    border-color: rgba(0, 123, 255, 0.35);
    transform: translateY(-1px);
    text-decoration: none;
}

.contact-content .contact-item:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.contact-content .contact-item .contact-icon {
    width: 32px;
    height: 32px;
    color: currentColor;
    flex: 0 0 auto;
}

.contact-content .contact-item .contact-icon-social {
    filter: invert(1);
}

.contact-content .contact-item .label {
    font-weight: 600;
}

.contact-content .contact-item .contact-value {
    color: var(--gray);
}

.footer {
    background: var(--dark);
    padding: 2rem;
    text-align: center;
    color: var(--gray);
    font-size: 0.9rem;
    border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0 1.25rem;
    }

    .logo {
        font-size: 1.1rem;
    }

    .nav-links {
        right: 1.25rem;
        left: 1.25rem;
        width: auto;
        min-width: 0;
    }

    .nav-links a {
        font-size: 1rem;
    }

    .hero {
        padding: 0 1rem;
        min-height: 100vh;
    }

    .hero h1 {
        font-size: clamp(2rem, 12vw, 3.5rem);
    }

    .pfp-wrap {
        width: 130px;
        height: 130px;
        margin-bottom: 1.25rem;
    }

    .pfp-wrap::after {
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }

    .subtitle {
        font-size: clamp(1rem, 5vw, 1.4rem);
    }

    .cta-button {
        padding: 0.75rem 1.75rem;
        font-size: 0.95rem;
        width: 100%;
        max-width: 300px;
    }

    section {
        padding: 3rem 1rem;
    }

    .section-title {
        font-size: clamp(1.75rem, 8vw, 2.5rem);
        margin-bottom: 2rem;
    }

    .about-content {
        font-size: 1.05rem;
        padding: 0 0.5rem;
    }

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

    .project-image {
        height: 200px;
    }

    .project-card {
        margin: 0 auto;
        max-width: 500px;
    }

    .contact-content {
        padding: 0 0.5rem;
    }

    .contact-content p {
        font-size: 1rem;
        word-break: break-word;
    }

    .contact-content .contact-item .contact-icon {
        width: 28px;
        height: 28px;
    }

    .footer {
        padding: 1.5rem 1rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 0.65rem 0;
    }

    .logo {
        font-size: 1rem;
    }

    .nav-toggle-icon {
        width: 26px;
        height: 26px;
    }

    .nav-links {
        right: 1rem;
        left: 1rem;
        padding: 0.85rem;
        width: auto;
        min-width: 0;
    }

    .nav-links a {
        font-size: 0.95rem;
    }

    .hero h1 {
        font-size: clamp(1.75rem, 15vw, 2.5rem);
        margin-bottom: 0.75rem;
    }

    .pfp-wrap {
        width: 110px;
        height: 110px;
        margin-bottom: 1rem;
    }

    .pfp-wrap::after {
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }

    .subtitle {
        font-size: clamp(0.9rem, 6vw, 1.2rem);
        margin-bottom: 1.5rem;
    }

    .cta-button {
        padding: 0.65rem 1.5rem;
        font-size: 0.9rem;
    }

    section {
        padding: 2.5rem 1rem;
    }

    .section-title {
        font-size: clamp(1.5rem, 10vw, 2rem);
        margin-bottom: 1.5rem;
    }

    .about-content {
        font-size: 1rem;
    }

    .projects-grid {
        gap: 1.25rem;
    }

    .project-image {
        height: 180px;
    }

    .project-card h3 {
        font-size: 1.1rem;
        padding: 0;
    }

    .project-card p {
        font-size: 0.9rem;
        padding: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
