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

:root {
    --bg: #faf6ef;
    --text: #1a1a18;
    --muted: #6b6760;
    --border: #dbd7d0;
    --serif: 'Cormorant Garamond', Georgia, serif;
    --sans: 'DM Sans', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ─── NAVBAR ─── */

.navbar {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 900;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 28px 60px;
    transition: background 0.35s, border-color 0.35s, padding 0.35s;
    border-bottom: 1px solid transparent;
}

.navbar.solid {
    background: var(--bg);
    border-bottom-color: var(--border);
    padding-top: 18px;
    padding-bottom: 18px;
}

.nav-list {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 36px;
}

.nav-list a {
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-decoration: none;
    color: #fff;
    transition: opacity 0.2s;
    text-shadow: 0 1px 10px rgba(0,0,0,0.55);
}

.navbar.solid .nav-list a { color: var(--text); text-shadow: none; }
.nav-list a:hover { opacity: 0.45; }

/* Contact dropdown */
.nav-contact { position: relative; }

.nav-contact > a {
    display: flex;
    align-items: center;
    gap: 5px;
}

.caret {
    font-size: 0.55rem;
    display: inline-block;
    transition: transform 0.2s;
    margin-top: 1px;
}

.nav-contact:hover .caret,
.nav-contact.is-open .caret { transform: scaleY(-1); }

.contact-menu {
    position: absolute;
    top: calc(100% + 18px);
    right: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 18px 24px;
    display: none;
    flex-direction: column;
    gap: 14px;
    min-width: 168px;
}

/* Transparent bridge fills the gap so mouse can travel from trigger to menu */
.contact-menu::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: -20px;
    right: -20px;
    height: 22px;
}

.nav-contact:hover .contact-menu,
.nav-contact.is-open .contact-menu { display: flex; }

.contact-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text) !important;
    text-decoration: none;
    transition: opacity 0.2s;
    text-shadow: none;
}

.contact-menu a:hover { opacity: 0.45; }

.contact-sep {
    height: 1px;
    background: var(--border);
    margin: 2px 0;
}

.contact-menu i {
    width: 15px;
    text-align: center;
    font-size: 0.9rem;
}

/* ─── HAMBURGER ─── */

.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5.5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    position: fixed;
    top: 13px;
    right: 18px;
    z-index: 1000;
}

.nav-hamburger span {
    display: block;
    width: 22px;
    height: 1.5px;
    background: #fff;
    transition: background 0.3s, transform 0.25s, opacity 0.2s;
    transform-origin: center;
}

.navbar.solid .nav-hamburger span,
.navbar.menu-open .nav-hamburger span { background: var(--text); }

.navbar.menu-open .nav-hamburger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.navbar.menu-open .nav-hamburger span:nth-child(2) { opacity: 0; }
.navbar.menu-open .nav-hamburger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ─── HERO ─── */

.hero {
    height: 100vh;
    min-height: 560px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background-color: #1a1a18;
}

.hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        to top,
        rgba(0,0,0,.58) 0%,
        rgba(0,0,0,.16) 50%,
        rgba(0,0,0,.03) 100%
    );
}

.hero-copy {
    position: relative;
    z-index: 2;
    color: #fff;
    text-align: center;
}

.hero-name {
    font-family: var(--serif);
    font-size: clamp(3rem, 7.5vw, 9rem);
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.02em;
    white-space: nowrap;
    text-shadow: 0 2px 28px rgba(0,0,0,0.5);
}

.hero-tagline {
    margin-top: 20px;
    font-size: 0.75rem;
    font-weight: 300;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    opacity: 0.95;
    text-shadow: 0 1px 18px rgba(0,0,0,0.8);
}

/* ─── ABOUT ─── */

.about {
    padding: 110px 60px 130px;
}

.about-inner {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 80px;
    max-width: 1140px;
    margin: 0 auto;
    align-items: stretch;
}

.about-text h2 {
    font-family: var(--serif);
    font-size: clamp(1.8rem, 3.5vw, 3.2rem);
    font-weight: 300;
    line-height: 1.15;
    margin-bottom: 28px;
}

.about-text p {
    font-size: 0.88rem;
    line-height: 1.85;
    color: var(--muted);
    margin-bottom: 16px;
}

.about-text p:last-child { margin-bottom: 0; }

.about-photo {
    width: 100%;
    display: block;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 10px;
    margin-top: 0;
}

/* ─── WORKS PAGES (Research / Creative) ─── */

.page-intro {
    padding: 150px 60px 20px;
    text-align: center;
}

.page-intro h1 {
    font-family: var(--serif);
    font-size: clamp(4rem, 10vw, 11rem);
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.025em;
}

.page-intro .sub {
    margin-top: 14px;
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}

.page-description {
    padding: 20px 60px 48px;
    text-align: center;
}

.page-description p {
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--muted);
    max-width: 640px;
    margin: 0 auto;
}

.works {
    padding-bottom: 120px;
    border-top: 1px solid var(--border);
}

.work-row {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    align-items: baseline;
    gap: 0 40px;
    padding: 36px 60px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    transition: opacity 0.25s;
    cursor: default;
}

a.work-row { cursor: pointer; }
.work-row:hover { opacity: 0.42; }

.work-num {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    color: var(--muted);
    padding-top: 5px;
}

.work-title {
    font-family: var(--serif);
    font-size: clamp(1.6rem, 3.2vw, 2.8rem);
    font-weight: 400;
    line-height: 1.15;
}

.work-desc {
    font-family: var(--sans);
    font-size: 0.82rem;
    line-height: 1.7;
    color: var(--muted);
    margin-top: 8px;
}

.work-tag {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
    padding-top: 5px;
}

/* ─── CREATIVE GRID ─── */

.creative-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 56px 40px;
    padding: 60px;
}

.creative-item {
    text-decoration: none;
    color: var(--text);
    display: block;
}

.creative-thumb {
    width: 100%;
    aspect-ratio: 3/1;
    background-color: var(--border);
    overflow: hidden;
    position: relative;
    border-radius: 8px;
}

.creative-thumb-inner {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.65s ease;
}

.creative-item:hover .creative-thumb-inner { transform: scale(1.04); }

/* Caption overlaid on image */
.creative-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 48px 20px 20px;
    background: linear-gradient(to top, rgba(0,0,0,.72) 0%, transparent 100%);
    transition: opacity 0.3s;
}

.creative-caption-title {
    font-family: var(--serif);
    font-size: clamp(1.2rem, 2.2vw, 1.9rem);
    font-weight: 400;
    line-height: 1.2;
    color: #fff;
}

.creative-caption-tag {
    margin-top: 5px;
    font-size: 0.65rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.7);
}

/* ─── QNM WAVEFORM ─── */

.qnm-canvas {
    display: block;
    width: 100%;
    height: 88px;
    pointer-events: none;
    opacity: 1;
}

/* ─── CV PAGE ─── */

.cv-intro {
    padding: 48px 60px 56px;
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.cv-intro p {
    font-size: 0.88rem;
    line-height: 1.8;
    color: var(--muted);
    max-width: 520px;
    margin: 0 auto;
}

/* ─── RESPONSIVE ─── */

@media (max-width: 900px) {
    .navbar, .navbar.solid {
        padding-left: 28px;
        padding-right: 28px;
    }
    .hero { padding: 0; }
    .page-description { padding: 40px 28px; }
    .about { padding: 80px 28px 100px; }
    .about-inner {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .about-photo {
        height: auto;
        aspect-ratio: 4/3;
        order: -1;
        margin-top: 0;
    }
    .page-intro { padding: 110px 28px 16px; }
    .work-row {
        grid-template-columns: 40px 1fr;
        gap: 0 20px;
        padding: 28px 28px;
    }
    .work-tag { display: none; }
    .creative-grid {
        grid-template-columns: 1fr;
        padding: 40px 28px 80px;
        gap: 40px;
    }
    .cv-intro { padding: 40px 28px 48px; }
}

@media (max-width: 680px) {
    .nav-hamburger { display: flex; }

    .nav-list {
        position: fixed;
        inset: 0;
        background: var(--bg);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 32px;
        display: none;
        z-index: 999;
    }

    .navbar.menu-open .nav-list { display: flex; }

    .nav-list a {
        font-size: 0.8rem;
        letter-spacing: 0.15em;
        color: var(--text);
        text-shadow: none;
    }

    /* Inside mobile menu, contact dropdown opens inline */
    .navbar.menu-open .nav-contact:hover .contact-menu { display: none; }
    .navbar.menu-open .nav-contact.is-open .contact-menu {
        display: flex;
        position: static;
        border: none;
        background: transparent;
        padding: 20px 0 0;
        gap: 18px;
        min-width: unset;
        align-items: center;
    }
    .navbar.menu-open .contact-menu::before { display: none; }
    .navbar.menu-open .contact-menu a { color: var(--muted) !important; font-size: 0.72rem; }
    .navbar.menu-open .contact-sep { display: none; }
}
