/* =========================================================
   CAETANO CHAPPUIS — Portfolio
   Cinematic editorial aesthetic · Dark · Minimal
   ========================================================= */

/* ---- Variables ---- */
:root {
    --black:       #0a0a0a;
    --black-soft:  #111111;
    --white:       #f0ebe4;
    --cream:       #c8b89a;
    --grey:        #666666;
    --grey-light:  #aaaaaa;
    --border:      rgba(255,255,255,0.07);

    --font-display: 'Space Grotesk', system-ui, sans-serif;
    --font-body:    'Space Grotesk', system-ui, sans-serif;

    --nav-h: 132px;
    --ease:  cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--black);
    color: var(--white);
    font-family: var(--font-body);
    font-weight: 300;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img { display: block; width: 100%; }

a { color: inherit; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 1px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: var(--grey); }


/* =========================================================
   NAV
   ========================================================= */
#nav {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    height: var(--nav-h);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 48px;
    transition: background 0.5s var(--ease), border-color 0.5s var(--ease);
    border-bottom: 1px solid transparent;
}

#nav.scrolled {
    background: rgba(10,10,10,0.90);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom-color: var(--border);
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--white);
    transition: color 0.3s;
}

.nav-logo:hover { color: var(--cream); }

/* Burger button */
.burger {
    position: absolute;
    left: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--white);
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding: 0;
    transition: color 0.3s;
}

.burger:hover { color: var(--cream); }

/* Menu drawer */
.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 150;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s var(--ease);
}

.menu-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.menu-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: min(420px, 80vw);
    height: 100vh;
    background: var(--black-soft);
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.55s var(--ease-out);
    padding: 0 48px 48px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
}

.menu-drawer.open {
    transform: translateX(0);
}

.drawer-close {
    display: flex;
    align-items: center;
    gap: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--white);
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding: 0;
    height: var(--nav-h);
    flex-shrink: 0;
    transition: color 0.3s;
}

.drawer-close:hover { color: var(--cream); }

.drawer-nav {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    gap: 4px;
}

.drawer-link {
    font-family: var(--font-display);
    font-size: clamp(3rem, 6vw, 4.5rem);
    font-weight: 500;
    color: var(--white);
    text-decoration: none;
    line-height: 1.15;
    transition: color 0.25s, padding-left 0.3s var(--ease);
    display: block;
}

.drawer-link:hover {
    color: var(--cream);
    padding-left: 8px;
}


/* =========================================================
   HERO
   ========================================================= */
#hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--nav-h) 48px 0;
    overflow: hidden;
}

/* Animated film grain */
.grain {
    position: absolute;
    inset: -100%;
    width: 300%;
    height: 300%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 250px 250px;
    animation: grain 0.4s steps(1) infinite;
}

@keyframes grain {
    0%   { transform: translate(0%,   0%); }
    10%  { transform: translate(-5%,  -10%); }
    20%  { transform: translate(-15%, 5%); }
    30%  { transform: translate(7%,   -25%); }
    40%  { transform: translate(-5%,  25%); }
    50%  { transform: translate(-15%, 10%); }
    60%  { transform: translate(15%,  0%); }
    70%  { transform: translate(0%,   15%); }
    80%  { transform: translate(3%,   35%); }
    90%  { transform: translate(-10%, 10%); }
    100% { transform: translate(5%,   5%); }
}

/* Hero content */
.hero-content {
    position: relative;
    z-index: 2;
}

.hero-eyeline {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
    overflow: hidden;
}

.hero-line {
    height: 1px;
    width: 0;
    background: var(--cream);
    transition: width 0.9s var(--ease-out) 0.2s;
}

.hero-line.visible { width: 56px; }

.hero-number {
    font-family: var(--font-body);
    font-size: 0.6rem;
    letter-spacing: 0.3em;
    color: var(--grey);
    opacity: 0;
    transition: opacity 0.6s 0.5s;
}

.hero-number.visible { opacity: 1; }

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(4.5rem, 11vw, 10rem);
    font-weight: 300;
    line-height: 0.95;
    letter-spacing: -0.03em;
    margin-bottom: 28px;
}

.reveal-word {
    display: block;
    opacity: 0;
    transform: translateY(64px);
    transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
}

.reveal-word:nth-child(2) { transition-delay: 0.18s; }

.reveal-word.accent {
    color: var(--cream);
    font-weight: 300;
}

.reveal-word.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-subtitle {
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--grey);
    margin-bottom: 52px;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.7s 0.55s, transform 0.7s 0.55s var(--ease-out);
}

.hero-subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--white);
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.25);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.7s 0.75s, transform 0.7s 0.75s var(--ease-out),
                border-color 0.3s, gap 0.35s var(--ease);
}

.hero-cta.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-cta:hover {
    border-bottom-color: var(--cream);
    gap: 22px;
}

.cta-arrow {
    font-size: 1.1rem;
    line-height: 1;
}

/* Hero bottom meta */
.hero-meta {
    position: absolute;
    bottom: 44px;
    right: 48px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.8s 1.1s;
}

.hero-meta.visible { opacity: 1; }

.hero-meta span {
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--grey);
}


/* =========================================================
   WORK
   ========================================================= */
#work {
    padding: 120px 48px 100px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 60px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.section-label {
    font-size: 0.65rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--grey);
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 300;
    letter-spacing: -0.01em;
    line-height: 1;
}

/* Grid */
.work-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.work-card {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 2 / 3;
}

/* Image layer */
.card-image {
    position: absolute;
    inset: 0;
    transition: transform 0.75s var(--ease);
    will-change: transform;
}

.work-card:hover .card-image {
    transform: scale(1.07);
}

/* Gradient placeholders — each a distinct cinematic tone */
.gradient-1 { background: linear-gradient(150deg, #0d1b2a 0%, #1b2c46 50%, #080f18 100%); }
.gradient-2 { background: linear-gradient(160deg, #091a09 0%, #152915 45%, #0a1a0a 100%); }
.gradient-3 { background: linear-gradient(135deg, #181818 0%, #282828 60%, #0e0e0e 100%); }
.gradient-4 { background: linear-gradient(145deg, #1c0a0a 0%, #2e1212 55%, #0f0606 100%); }
.gradient-5 { background: linear-gradient(155deg, #091818 0%, #0f2828 50%, #061010 100%); }
.gradient-6 { background: linear-gradient(140deg, #181a09 0%, #26280e 55%, #101209 100%); }
.gradient-7 { background: linear-gradient(130deg, #160b1d 0%, #241232 55%, #0e0814 100%); }
.gradient-8 { background: linear-gradient(148deg, #1c1109 0%, #2c1c0f 50%, #140c07 100%); }
.gradient-9 { background: linear-gradient(125deg, #090e1a 0%, #0f1828 50%, #060910 100%); }

/* Hover overlay */
.card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.52);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s;
    z-index: 2;
}

.work-card:hover .card-overlay { opacity: 1; }

.card-year {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 300;
    color: rgba(255,255,255,0.55);
    letter-spacing: -0.02em;
}

/* Card info bar */
.card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 20px 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, transparent 100%);
    z-index: 3;
}

.card-tag {
    display: block;
    font-size: 0.58rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--cream);
    margin-bottom: 6px;
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.15;
    color: var(--white);
}


/* =========================================================
   ABOUT
   ========================================================= */
#about {
    padding: 120px 48px;
    border-top: 1px solid var(--border);
}

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

.portrait-placeholder {
    width: 100%;
    aspect-ratio: 3 / 4;
    background: linear-gradient(170deg, #0f1a2e 0%, #162440 40%, #0f2040 75%, #0a0a14 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    padding: 20px;
}

.portrait-placeholder::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 50%);
}

.portrait-label {
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.25);
    position: relative;
    z-index: 1;
}

.about-text .section-label {
    display: block;
    margin-bottom: 28px;
}

.about-heading {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 4.5vw, 4.5rem);
    font-weight: 300;
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin-bottom: 36px;
}

.about-heading .accent {
    color: var(--cream);
    font-weight: 300;
}

.about-bio {
    font-size: 0.9rem;
    line-height: 1.9;
    color: var(--grey-light);
    margin-bottom: 16px;
    max-width: 460px;
}

.about-credentials {
    display: flex;
    gap: 52px;
    margin-top: 52px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.credential {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.credential-number {
    font-family: var(--font-display);
    font-size: 2.8rem;
    font-weight: 300;
    line-height: 1;
    color: var(--white);
    letter-spacing: -0.02em;
}

.credential-label {
    font-size: 0.6rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--grey);
}


/* =========================================================
   CONTACT
   ========================================================= */
#contact {
    padding: 120px 48px;
    border-top: 1px solid var(--border);
}

.contact-inner {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.contact-inner .section-label {
    display: block;
    margin-bottom: 28px;
}

.contact-heading {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 300;
    line-height: 1.05;
    letter-spacing: -0.025em;
    margin-bottom: 72px;
}

.contact-heading .accent {
    color: var(--cream);
    font-weight: 300;
}

.contact-links {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.contact-link {
    display: flex;
    align-items: center;
    padding: 28px 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--white);
    transition: padding-left 0.35s var(--ease);
}

.contact-link:first-child {
    border-top: 1px solid var(--border);
}

.contact-link:hover { padding-left: 12px; }

.contact-link-label {
    font-size: 0.62rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--grey);
    min-width: 110px;
}

.contact-link-value {
    flex: 1;
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 400;
    transition: color 0.3s;
}

.contact-link:hover .contact-link-value { color: var(--cream); }

.contact-arrow {
    font-size: 1.1rem;
    opacity: 0.35;
    transition: opacity 0.3s, transform 0.35s var(--ease);
}

.contact-link:hover .contact-arrow {
    opacity: 1;
    transform: translateX(6px);
}


/* =========================================================
   FOOTER
   ========================================================= */
footer {
    padding: 28px 48px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: center;
}

footer p {
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    color: var(--grey);
}


/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1024px) {
    .work-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .about-inner {
        grid-template-columns: 1fr;
        gap: 56px;
    }

    .portrait-placeholder {
        aspect-ratio: 16 / 9;
    }
}

@media (max-width: 768px) {
    #nav { padding: 0 24px; }

    .nav-logo { font-size: 0.85rem; }

    .burger { left: 24px; }

    .menu-drawer { padding: 0 28px 28px; }

    #hero { padding: 0 24px; }

    .hero-meta {
        right: 24px;
        bottom: 28px;
    }

    #work, #about, #contact {
        padding-left: 24px;
        padding-right: 24px;
    }

    .work-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .work-card {
        aspect-ratio: 3 / 2;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .about-credentials { gap: 32px; }

    .contact-link-label { min-width: 80px; }

    footer { padding: 24px; }
}

@media (max-width: 480px) {
    .nav-links { gap: 18px; }

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

    .about-credentials { gap: 24px; flex-wrap: wrap; }
}
