/* ============================================================
   Justin Durazzo, ALT landing (MLF-inspired, cinematic)
   ============================================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #0d0d0c;
    --ink: #f2f0ea;
    --muted: rgba(242, 240, 234, 0.55);
    --faint: rgba(242, 240, 234, 0.30);
    --line: rgba(242, 240, 234, 0.14);
    --display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --pad: 4vw;
    /* theme-aware helpers (rgb triplets) */
    --scrim: 13, 13, 12;      /* hero/nav scrim tint */
    --overlay: 8, 8, 7;       /* lightbox backdrop */
    --shadow: 0, 0, 0;        /* text-shadow tint */
    --placeholder: #161614;   /* media placeholder */
}

/* Light mode, swap the palette; media still carries the color */
body.light {
    --bg: #efece3;
    --ink: #18160f;
    --muted: rgba(24, 22, 15, 0.62);
    --faint: rgba(24, 22, 15, 0.40);
    --line: rgba(24, 22, 15, 0.16);
    --scrim: 239, 236, 227;
    --overlay: 244, 242, 235;
    --shadow: 255, 255, 255;
    --placeholder: #e4e0d5;
}

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--ink);
    font-size: 16px;
    line-height: 1.5;
    overflow-x: hidden;
}
::selection { background: var(--ink); color: var(--bg); }
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ---------- Page-load wipe (Barba-style) ---------- */
.wipe {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(0);
    transition: transform 1.1s var(--ease);
}
.wipe.lift { transform: translateY(-100%); }
.wipe-name {
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--ink);
    opacity: 0;
    animation: wipeName 1.4s var(--ease) 0.1s forwards;
}
@keyframes wipeName {
    0% { opacity: 0; }
    35%, 70% { opacity: 1; }
    100% { opacity: 0.4; }
}

/* ---------- Nav ---------- */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 28px var(--pad) 40px;
    color: var(--ink);
    /* soft top scrim keeps the nav legible over any media as you scroll */
    background: linear-gradient(to bottom, rgba(var(--scrim),0.6) 0%, rgba(var(--scrim),0.28) 45%, rgba(var(--scrim),0) 100%);
    text-shadow: 0 1px 22px rgba(var(--shadow),0.45);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 1s var(--ease) 0.9s, transform 1s var(--ease) 0.9s, color 0.5s ease;
    pointer-events: none;
}
.nav > *, .nav-right > *, .nav-social > * { pointer-events: auto; }
body.loaded .nav { opacity: 1; transform: none; }
.nav-logo {
    font-family: var(--display);
    font-size: 19px;
    font-weight: 400;
    letter-spacing: -0.01em;
}
.nav-right { display: flex; align-items: center; gap: 26px; }
.nav-links { display: flex; gap: 26px; }
.nav-social { display: flex; align-items: center; gap: 20px; }
.nav-links a, .nav-social a {
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    position: relative;
    padding-bottom: 2px;
}
.nav-links a::after, .nav-social a::after {
    content: '';
    position: absolute; left: 0; bottom: 0;
    width: 100%; height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.5s var(--ease);
}
.nav-links a:hover::after, .nav-social a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav-icon {
    display: flex; align-items: center; justify-content: center;
    background: none; border: none; color: var(--ink);
    cursor: pointer; padding: 8px; opacity: 0.85;
    transition: opacity 0.3s ease;
}
.nav-icon:hover { opacity: 1; }
.nav-icon svg { display: block; width: 16px; height: 16px; }
@media (max-width: 640px) {
    .nav-right { gap: 16px; }
    .nav-links { gap: 16px; }
    .nav-social { gap: 14px; }
    .nav-social a { display: none; }
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    height: 100svh;
    min-height: 640px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0 var(--pad) 4vw;
    overflow: hidden;
}
.hero-media { position: absolute; inset: 0; z-index: -1; }
.hero-video {
    width: 100%; height: 100%;
    object-fit: cover;
    transform: scale(1.08);
    animation: heroDrift 24s ease-out forwards;
}
@keyframes heroDrift { to { transform: scale(1); } }
.hero-scrim {
    position: absolute; inset: 0;
    background:
        /* darken (or lighten) the left text column, whatever the video is doing */
        linear-gradient(to right, rgba(var(--scrim),0.9) 0%, rgba(var(--scrim),0.55) 30%, rgba(var(--scrim),0) 60%),
        /* floor + ceiling so the foot bar and top nav stay legible */
        linear-gradient(to top, rgba(var(--scrim),0.92) 0%, rgba(var(--scrim),0.15) 42%, rgba(var(--scrim),0.55) 100%);
}

.hero-content { max-width: min(92vw, 1200px); }
.hero-eyebrow {
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 26px;
    overflow: hidden;
}
.hero-title {
    font-family: var(--display);
    font-weight: 300;
    font-size: clamp(40px, 7.2vw, 112px);
    line-height: 1.0;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 50px rgba(var(--shadow), 0.4);
}
.hero-title em { font-style: italic; font-weight: 400; }
.hero-line { display: block; overflow: hidden; }
.hero-line > [data-line] { white-space: nowrap; padding-right: 0.06em; }

.hero-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 8vh;
    padding-top: 22px;
    border-top: 1px solid var(--line);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}
.hero-foot > span { overflow: hidden; }
.hero-scroll {
    display: flex; align-items: center; gap: 12px;
    color: var(--ink);
}
.hero-scroll-line {
    width: 44px; height: 1px; background: var(--ink); position: relative; overflow: hidden;
}
.hero-scroll-line::after {
    content: ''; position: absolute; inset: 0; background: var(--bg);
    animation: scrollLine 2.4s ease-in-out infinite;
}
@keyframes scrollLine {
    0% { transform: translateX(-100%); }
    50%, 100% { transform: translateX(100%); }
}
@media (max-width: 640px) {
    .hero-foot { flex-direction: column; align-items: flex-start; gap: 14px; }
    .hero-scroll { order: 3; }
}

/* line reveal primitives */
[data-line] {
    display: inline-block;
    transform: translateY(115%);
    transition: transform 1.05s var(--ease);
}
body.loaded [data-line] { transform: translateY(0); }
.hero-title .hero-line:nth-child(1) [data-line] { transition-delay: 0.15s; }
.hero-title .hero-line:nth-child(2) [data-line] { transition-delay: 0.27s; }
.hero-title .hero-line:nth-child(3) [data-line] { transition-delay: 0.39s; }
.hero-eyebrow [data-line] { transition-delay: 0.1s; }
.hero-foot [data-line] { transition-delay: 0.9s; }

/* ---------- Statement ---------- */
.statement {
    padding: 18vh var(--pad);
    max-width: 1100px;
}
.statement-text {
    font-family: var(--display);
    font-weight: 300;
    font-size: clamp(26px, 3.4vw, 52px);
    line-height: 1.28;
    letter-spacing: -0.01em;
}
.statement-text .sw {
    display: inline-block;
    opacity: 0.14;
    transition: opacity 0.6s var(--ease);
}
.statement-text.in .sw { opacity: 1; }
.statement-text.in .sw { transition-delay: calc(var(--wi, 0) * 34ms); }

/* ---------- Work grid ---------- */
.work { padding: 0 var(--pad) 12vh; }
.work-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 30px 0;
    border-top: 1px solid var(--line);
    margin-bottom: 5vh;
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8vh 4vw;
}
.card--wide { grid-column: 1 / -1; }

.card-media {
    display: block;
    position: relative;
    overflow: hidden;
    background: var(--placeholder);
    aspect-ratio: 4 / 3;
    clip-path: inset(0 0 100% 0);
    transition: clip-path 1.2s var(--ease);
}
.card--wide .card-media { aspect-ratio: 16 / 8; }
.card.in .card-media { clip-path: inset(0 0 0 0); }
.card-media video, .card-media img {
    width: 100%; height: 100%;
    object-fit: cover;
    transform: scale(1.04);
    transition: transform 1.4s var(--ease);
}
.card:hover .card-media video,
.card:hover .card-media img { transform: scale(1.0); }

.card-meta {
    margin-top: 22px;
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.9s var(--ease) 0.15s, transform 0.9s var(--ease) 0.15s;
}
.card.in .card-meta { opacity: 1; transform: none; }
.card-cat {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--faint);
    margin-bottom: 12px;
}
.card-title {
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(24px, 2.6vw, 40px);
    line-height: 1.05;
    letter-spacing: -0.015em;
    margin-bottom: 12px;
}
.card-desc { font-size: 15px; color: var(--muted); max-width: 42ch; line-height: 1.55; }

@media (max-width: 760px) {
    .grid { grid-template-columns: 1fr; gap: 6vh 0; }
    .card--wide { grid-column: auto; }
    .card-media, .card--wide .card-media { aspect-ratio: 4 / 3; }
}

/* ---------- Archive (full body of work, compact tiles) ---------- */
.archive { padding: 0 var(--pad) 4vh; }
.archive-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6vh 3vw;
}
.tile { display: block; }
.tile-media {
    position: relative;
    overflow: hidden;
    background: var(--placeholder);
    aspect-ratio: 3 / 2;
    clip-path: inset(0 0 100% 0);
    transition: clip-path 1.1s var(--ease);
}
.tile.in .tile-media { clip-path: inset(0 0 0 0); }
.tile-media img, .tile-media video {
    width: 100%; height: 100%;
    object-fit: cover;
    transform: scale(1.05);
    transition: transform 1.2s var(--ease);
}
.tile:hover .tile-media img, .tile:hover .tile-media video { transform: scale(1); }
.tile-meta {
    margin-top: 16px;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.8s var(--ease) 0.12s, transform 0.8s var(--ease) 0.12s;
}
.tile.in .tile-meta { opacity: 1; transform: none; }
.tile-cat {
    display: block;
    font-size: 10.5px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--faint);
    margin-bottom: 9px;
}
.tile-title {
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(18px, 1.5vw, 25px);
    line-height: 1.12;
    letter-spacing: -0.01em;
    transition: opacity 0.3s ease;
}
.tile:hover .tile-title { opacity: 0.6; }
@media (max-width: 900px) { .archive-grid { grid-template-columns: repeat(2, 1fr); gap: 5vh 3vw; } }
@media (max-width: 560px) { .archive-grid { grid-template-columns: 1fr; } }

/* ---------- Outro ---------- */
.outro {
    padding: 16vh var(--pad);
    border-top: 1px solid var(--line);
    text-align: center;
}
.outro-eyebrow {
    font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase;
    color: var(--muted); margin-bottom: 28px;
}
.outro-mail {
    display: inline-block;
    font-family: var(--display);
    font-weight: 300;
    font-size: clamp(24px, 3.6vw, 50px);
    letter-spacing: -0.02em;
    line-height: 1.05;
    position: relative;
}
.outro-mail::after {
    content: ''; position: absolute; left: 0; bottom: 0.08em;
    width: 100%; height: 1px; background: currentColor;
    transform: scaleX(0); transform-origin: right;
    transition: transform 0.6s var(--ease);
}
.outro-mail:hover::after { transform: scaleX(1); transform-origin: left; }
.outro-links {
    display: flex; justify-content: center; gap: 30px;
    margin-top: 40px;
    font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.outro-links a { transition: color 0.3s ease; }
.outro-links a:hover { color: var(--ink); }

/* generic reveal */
[data-reveal] {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 1s var(--ease), transform 1s var(--ease);
}
[data-reveal].in { opacity: 1; transform: none; }
.statement-text[data-reveal] { transform: none; }  /* words handle their own */

/* ---------- Footer + back to top ---------- */
.foot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    padding: 40px var(--pad);
    border-top: 1px solid var(--line);
}
.foot-meta {
    width: 100%;
    display: flex;
    justify-content: space-between;
    font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint);
}
.back-to-top {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 11px;
    font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--muted);
    transition: color 0.3s ease;
}
.back-to-top:hover { color: var(--ink); }
.back-to-top-arrow {
    display: block;
    width: 9px; height: 9px;
    border-left: 1.5px solid currentColor;
    border-top: 1.5px solid currentColor;
    transform: rotate(45deg);
    animation: bounceUp 2s ease-in-out infinite;
}
@keyframes bounceUp {
    0%, 100% { transform: rotate(45deg) translate(0, 0); }
    50%      { transform: rotate(45deg) translate(3px, -3px); }
}
@media (max-width: 640px) { .foot-meta { flex-direction: column; align-items: center; gap: 8px; text-align: center; } }

/* ---------- Side scroll indicator (featured work) ---------- */
.side-nav {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 90;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    color: var(--ink);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s var(--ease);
}
.side-nav.visible { opacity: 1; pointer-events: auto; }
.side-dot {
    width: 2px; height: 16px;
    padding: 0; border: none; border-radius: 1px;
    background: currentColor;
    opacity: 0.5;
    cursor: pointer;
    transition: opacity 0.3s var(--ease), height 0.3s var(--ease);
}
.side-dot:hover { opacity: 0.8; }
.side-dot.active { opacity: 1; height: 26px; }
@media (max-width: 900px), (hover: none) { .side-nav { display: none; } }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    [data-line] { transform: none; }
    [data-reveal] { opacity: 1; transform: none; }
    .card-media, .tile-media { clip-path: none; }
    .card-meta, .tile-meta { opacity: 1; transform: none; }
    .tile-media img { transform: none; }
    .statement-text .sw { opacity: 1; }
    .hero-video { transform: none; }
    .wipe { display: none; }
}

/* ---------- Project lightbox ---------- */
.card, .tile { cursor: pointer; }
.card-media, .tile-media { cursor: pointer; }

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: rgba(var(--overlay), 0.94);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 7vh var(--pad);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s var(--ease), visibility 0.5s var(--ease);
}
.lightbox.open { opacity: 1; visibility: visible; }
body.lb-open { overflow: hidden; }

.lightbox-close {
    position: absolute;
    top: 26px;
    right: var(--pad);
    background: none;
    border: none;
    color: var(--ink);
    font-family: var(--sans);
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    padding: 10px;
    z-index: 2;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}
.lightbox-close:hover { opacity: 1; }

.lightbox-inner {
    width: 100%;
    max-width: 1080px;
    margin-block: auto;
    transform: translateY(24px);
    transition: transform 0.6s var(--ease);
}
.lightbox.open .lightbox-inner { transform: none; }

.lightbox-media {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
    margin-bottom: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox-media video, .lightbox-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}
.lightbox-meta { display: flex; flex-direction: column; gap: 12px; }
.lightbox-cat {
    font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint);
}
.lightbox-title {
    font-family: var(--display); font-weight: 400;
    font-size: clamp(24px, 3vw, 38px); line-height: 1.06; letter-spacing: -0.015em;
}
.lightbox-desc { font-size: 16px; line-height: 1.6; color: var(--muted); max-width: 64ch; }

@media (max-width: 640px) {
    .lightbox { padding: 9vh 6vw; }
    .lightbox-media { aspect-ratio: 4 / 3; }
}
@media (prefers-reduced-motion: reduce) {
    .lightbox, .lightbox-inner { transition: none; }
}

/* ============================================================ */
/* About page (about-alt.html)                                  */
/* ============================================================ */
.about-page { padding-top: 0; }

.about-hero {
    padding: 24vh var(--pad) 9vh;
    max-width: 1180px;
}
.about-eyebrow {
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 30px;
}
.about-lead {
    font-family: var(--display);
    font-weight: 300;
    font-size: clamp(28px, 4vw, 60px);
    line-height: 1.18;
    letter-spacing: -0.015em;
    max-width: 20ch;
}
.about-lead em { font-style: italic; font-weight: 400; }

.about-body { padding: 0 var(--pad) 6vh; }
.about-block {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr);
    gap: 3vw;
    padding: 6vh 0;
    border-top: 1px solid var(--line);
}
.about-label {
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--faint);
    position: sticky;
    top: 100px;
    align-self: start;
}
.about-content { max-width: 62ch; }
.about-content p {
    font-size: clamp(16px, 1.5vw, 20px);
    line-height: 1.62;
    color: var(--muted);
    margin-bottom: 20px;
}
.about-content p:last-child { margin-bottom: 0; }
.about-content em { font-family: var(--display); font-style: italic; color: var(--ink); }
.about-list { color: var(--ink) !important; letter-spacing: 0.01em; }

.about-block--cta .about-content { display: flex; flex-direction: column; gap: 10px; }
.about-mail {
    display: inline-block;
    align-self: flex-start;
    font-family: var(--sans);
    font-weight: 400;
    font-size: clamp(16px, 1.5vw, 20px);
    letter-spacing: 0;
    line-height: 1.4;
    color: var(--ink);
    position: relative;
}
.about-mail::after {
    content: ''; position: absolute; left: 0; bottom: 0.06em;
    width: 100%; height: 1px; background: currentColor;
    transform: scaleX(0); transform-origin: right;
    transition: transform 0.6s var(--ease);
}
.about-mail:hover::after { transform: scaleX(1); transform-origin: left; }
.about-loc { font-size: 14px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.1em; }

.foot a { position: relative; }
.foot a:hover { color: var(--ink); }

@media (max-width: 760px) {
    .about-hero { padding-top: 20vh; }
    .about-block { grid-template-columns: 1fr; gap: 18px; padding: 5vh 0; }
    .about-label { position: static; }
}

/* ---------- Lab (external experiments & side projects) ---------- */
.lab { padding: 0 var(--pad) 8vh; }
.lab-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4vw;
}
.lab-col-label {
    display: block;
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--faint);
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}
.lab-item {
    display: flex;
    align-items: baseline;
    gap: 20px;
    padding: 22px 4px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    transition: padding-left 0.4s var(--ease);
}
.lab-name {
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(20px, 2vw, 30px);
    letter-spacing: -0.015em;
    line-height: 1.05;
}
.lab-host {
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--faint);
    transition: color 0.3s ease;
}
.lab-arrow {
    margin-left: auto;
    font-family: var(--sans);
    font-size: 20px;
    color: var(--muted);
    transition: transform 0.4s var(--ease), color 0.3s ease;
}
.lab-item:hover { padding-left: 14px; }
.lab-item:hover .lab-host { color: var(--muted); }
.lab-item:hover .lab-arrow { transform: translate(4px, -4px); color: var(--ink); }
@media (max-width: 760px) { .lab-cols { grid-template-columns: 1fr; gap: 5vh; } }
@media (max-width: 640px) {
    .lab-item { gap: 12px; padding: 18px 2px; }
}
