@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400;1,700&family=DM+Sans:wght@300;400;500&family=DM+Mono:wght@400;500&display=swap");

:root {
    --bg: #050505;
    --surface: rgba(255,255,255,0.04);
    --surface-hover: rgba(255,255,255,0.08);
    --border: rgba(255,255,255,0.08);
    --border-strong: rgba(255,255,255,0.18);
    --text: #f5f5f0;
    --text-muted: #aaa9a4;
    --text-dim: #555550;
    --accent: #c9b99a;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: "DM Sans", sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    line-height: 1.7;
    font-size: 18px;
}

#bg-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1;
    opacity: 0.55;
}

#loading {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-family: "DM Mono", monospace;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    color: var(--accent);
    background: rgba(5,5,5,0.95);
    padding: 2rem 3rem;
    border: 1px solid var(--border-strong);
    z-index: 1000;
    pointer-events: none;
    text-transform: uppercase;
}

/* ─── TYPOGRAPHY ─── */
h1, h2, h3 { font-family: "Playfair Display", serif; }

.title {
    font-family: "Playfair Display", serif;
    font-size: clamp(3.5rem, 7vw, 6rem);
    font-weight: 900;
    line-height: 1.0;
    letter-spacing: -0.02em;
    color: var(--text);
    text-align: left;
    margin-bottom: 0;
}

.section__text__p1 {
    font-family: "DM Mono", monospace;
    font-size: 0.8rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.2rem;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.section__text__p1::before {
    content: '';
    display: inline-block;
    width: 32px; height: 1px;
    background: var(--accent);
    flex-shrink: 0;
}

p { color: var(--text-muted); font-weight: 300; font-size: 1.05rem; }
a { color: var(--text); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent); }

/* ─── NAV ─── */
nav {
    position: fixed;
    top: 0; width: 100%; z-index: 200;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4rem;
    height: 72px;
    border-bottom: 1px solid var(--border);
    background: rgba(5,5,5,0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.logo {
    font-family: "Playfair Display", serif;
    font-size: 1.2rem;
    font-weight: 700;
    font-style: italic;
    cursor: default;
    color: var(--text);
}

.nav-links { display: flex; list-style: none; gap: 3rem; }

.nav-links a {
    font-family: "DM Mono", monospace;
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    position: relative;
    transition: color 0.2s;
}
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px; left: 0;
    width: 0; height: 1px;
    background: var(--accent);
    transition: width 0.3s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

#hamburger-nav { display: none; }

.hamburger-icon {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 18px; width: 26px;
    cursor: pointer;
}
.hamburger-icon span {
    width: 100%; height: 1px;
    background: var(--text);
    transition: 0.3s;
}

.menu-links {
    position: absolute;
    top: calc(100% + 1px); right: 0;
    background: rgba(5,5,5,0.98);
    border: 1px solid var(--border-strong);
    width: 200px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
}
.menu-links.open { max-height: 300px; padding: 1.5rem; }
.menu-links li { list-style: none; }
.menu-links a {
    display: block;
    padding: 0.85rem 0;
    font-family: "DM Mono", monospace;
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}
.menu-links a:hover { color: var(--accent); }

.hamburger-icon.open span:first-child { transform: rotate(45deg) translate(9px, 4px); }
.hamburger-icon.open span:nth-child(2) { opacity: 0; }
.hamburger-icon.open span:last-child { transform: rotate(-45deg) translate(9px, -4px); }

/* ─── SECTIONS ─── */
section {
    padding-top: 72px;
    min-height: 100vh;
    margin: 0 auto;
    padding-left: 4rem;
    padding-right: 4rem;
    width: 100%;
    max-width: 1400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

/* ─── HERO ─── */
#profile {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6rem;
    height: 100vh;
    padding-top: 0;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

/* Profile photo — circular, properly sized */
.section__pic-container {
    position: relative;
    flex-shrink: 0;
    width: 420px;
    height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.section__pic-container::before {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 1px solid var(--accent);
    pointer-events: none;
    opacity: 0.4;
}

.profileIcon {
    width: 420px;
    height: 420px;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    border: 2px solid rgba(255,255,255,0.12);
}

.section__text {
    flex: 1;
    max-width: 520px;
}

.section__text__p2 {
    font-size: 1.15rem;
    font-weight: 300;
    color: var(--text-muted);
    letter-spacing: 0.03em;
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}
.section__text__p2::before { content: '—'; color: var(--accent); font-weight: 400; }

.btn-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    justify-content: flex-start;
}

.btn {
    font-family: "DM Mono", monospace;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 0.9rem 2.2rem;
    border-radius: 0;
    border: 1px solid var(--border-strong);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: all 0.25s ease;
    min-width: auto;
}
.btn:hover { transform: none; box-shadow: none; }
.btn-color-1 { background: var(--text); color: #050505; border-color: var(--text); }
.btn-color-1:hover { background: var(--accent); border-color: var(--accent); color: #050505; }
.btn-color-2:hover { background: var(--surface-hover); border-color: var(--accent); color: var(--accent); }

#socials-container { display: flex; gap: 1.5rem; align-items: center; }

.icon {
    cursor: pointer;
    height: 1.6rem; width: 1.6rem;
    filter: invert(1) opacity(0.45);
    transition: filter 0.2s, transform 0.2s;
}
.icon:hover { filter: invert(1) opacity(1); transform: translateY(-2px); }

.arrow {
    position: absolute;
    right: 0; bottom: 2rem;
    animation: bounce 3s infinite;
    opacity: 0.3;
}
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* ─── ABOUT ─── */
#about {
    padding-top: 100px;
    padding-bottom: 5rem;
    min-height: 100vh;
}

.about-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 5rem;
    align-items: start;
    margin-top: 3rem;
}

.about-img-block {
    position: relative;
    flex-shrink: 0;
}
/* Fixed: constrained photo, not stretched */
.about-pic {
    width: 380px;
    height: 480px;
    object-fit: cover;
    object-position: center top;
    border-radius: 0;
    display: block;
}
.about-img-block::after {
    content: '';
    position: absolute;
    bottom: -14px; right: -14px;
    width: 55%; height: 40%;
    border: 1px solid var(--accent);
    pointer-events: none;
    z-index: -1;
}

.about-content {}

.about-bio {
    font-size: 1.1rem;
    line-height: 1.9;
    color: var(--text-muted);
    margin-top: 1.5rem;
    margin-bottom: 3rem;
    max-width: 560px;
}

.about-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--border);
    max-width: 560px;
}

.stat-cell {
    background: var(--bg);
    padding: 2rem 1.75rem;
    position: relative;
    transition: background 0.3s;
    overflow: hidden;
}
.stat-cell:hover { background: var(--surface); }
.stat-cell::before {
    content: attr(data-num);
    font-family: "Playfair Display", serif;
    font-size: 4.5rem;
    font-weight: 900;
    font-style: italic;
    color: var(--accent);
    opacity: 0.1;
    position: absolute;
    top: 0.25rem; right: 1rem;
    line-height: 1;
    pointer-events: none;
}
.stat-cell h3 {
    font-family: "DM Mono", monospace;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.75rem;
    font-weight: 400;
}
.stat-cell p { font-size: 0.95rem; line-height: 1.65; color: var(--text-muted); }

/* ─── PROJECTS ─── */
#projects {
    padding-top: 100px;
    padding-bottom: 5rem;
    min-height: 100vh;
}

.projects-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    padding-bottom: 2rem;
    margin-bottom: 0;
}
.projects-count {
    font-family: "DM Mono", monospace;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    color: var(--text-dim);
    text-transform: uppercase;
    padding-bottom: 0.3rem;
}

.experience-details-container { margin-top: 0; }

#projects-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border);
    width: 100%;
}

.details-container.color-container {
    background: var(--bg);
    border: none;
    border-radius: 0;
    padding: 0;
    backdrop-filter: none;
    box-shadow: none;
    transition: background 0.3s;
    display: flex;
    flex-direction: column;
}
.details-container.color-container:hover {
    background: var(--surface);
    transform: none;
    border-color: transparent;
}

.article-container { overflow: hidden; }

.project-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 0;
    margin-bottom: 0;
    display: block;
    filter: grayscale(35%);
    transition: filter 0.4s, transform 0.5s;
}
.details-container.color-container:hover .project-img {
    filter: grayscale(0%);
    transform: scale(1.04);
}

.experience-sub-title.project-title {
    font-family: "Playfair Display", serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    padding: 1.5rem 1.75rem 0.25rem;
    margin-bottom: 0;
}

.details-container.color-container .btn-container {
    padding: 0.5rem 1.75rem 1.75rem;
    margin-top: auto;
    justify-content: flex-start;
    gap: 0.5rem;
}

.project-btn { margin-top: 0; }

.projects-cta {
    margin-top: 1px;
    background: var(--bg);
    padding: 2.5rem;
    text-align: center;
    border-top: 1px solid var(--border);
    transition: background 0.3s;
}
.projects-cta:hover { background: var(--surface); }

/* ─── CONTACT ─── */
#contact {
    min-height: 60vh;
    padding-top: 100px;
    padding-bottom: 5rem;
}

.contact-info-upper-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--border);
    margin: 3rem 0;
    max-width: 680px;
}

.contact-info-container {
    background: var(--bg);
    border: none;
    border-radius: 0;
    backdrop-filter: none;
    box-shadow: none;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 2.25rem 2rem;
    transition: background 0.3s;
}
.contact-info-container:hover { background: var(--surface); transform: none; border-color: transparent; }
.contact-info-container p {
    font-family: "DM Mono", monospace;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.contact-info-container a { color: var(--text-muted); }
.contact-info-container a:hover { color: var(--accent); }

/* ─── FOOTER ─── */
footer {
    margin: 0 auto;
    padding: 2.5rem 4rem;
    width: 100%;
    max-width: 1400px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    position: relative; z-index: 10;
}
footer nav { position: static; height: auto; background: none; backdrop-filter: none; border: none; padding: 0; }
footer .nav-links { gap: 2.5rem; }
footer .nav-links a { font-size: 0.72rem; color: var(--text-dim); }
footer p { font-size: 0.75rem; color: var(--text-dim); }

/* ─── RESPONSIVE ─── */
@media (max-width: 1200px) {
    #desktop-nav { display: none; }
    #hamburger-nav {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 2rem;
        position: fixed;
        width: 100%; top: 0; z-index: 200;
        height: 64px;
        background: rgba(5,5,5,0.9);
        backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border);
    }
    section { padding-left: 2rem; padding-right: 2rem; }
    footer { padding-left: 2rem; padding-right: 2rem; }

    #profile {
        flex-direction: column;
        height: auto;
        padding-top: 100px;
        padding-bottom: 4rem;
        gap: 3rem;
        align-items: flex-start;
    }
    .section__pic-container { width: 300px; height: 300px; }
    .profileIcon { width: 300px; height: 300px; }

    .about-layout { grid-template-columns: 1fr; gap: 2.5rem; }
    .about-pic { width: 100%; height: 300px; }
    .about-img-block { width: 100%; }

    #projects-container { grid-template-columns: 1fr 1fr; }
    .contact-info-upper-container { grid-template-columns: 1fr; }
    .arrow { display: none; }
}

@media (max-width: 768px) {
    section { padding-left: 1.25rem; padding-right: 1.25rem; }
    footer { padding-left: 1.25rem; padding-right: 1.25rem; }
    nav { padding: 0 1.25rem; }

    .section__pic-container { width: 220px; height: 220px; }
    .profileIcon { width: 220px; height: 220px; }

    .title { font-size: 2.8rem; }
    #projects-container { grid-template-columns: 1fr; }
    .about-stats { grid-template-columns: 1fr; max-width: 100%; }
    .projects-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .contact-info-upper-container { max-width: 100%; }
}
