/* Guilherme Gomes Correia · Portfolio */

/* ==========================================================================
   Fontes (self-hosted, OFL)
   ========================================================================== */

@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-serif.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-serif-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter Tight"; src: url("../fonts/inter-tight.woff2") format("woff2"); font-weight: 300 600; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono.woff2") format("woff2"); font-weight: 100 800; font-style: normal; font-display: swap; }

/* ==========================================================================
   Tokens
   ========================================================================== */

:root {
    --bg: #0b0a09;
    --bg-2: #13110f;
    --paper: #f3efe7;
    --ink: #efe8dc;
    --ink-dim: rgba(239, 232, 220, .58);
    --ink-faint: rgba(239, 232, 220, .16);
    --ink-ghost: rgba(239, 232, 220, .07);
    --accent: #e0442b;
    --live: #6fd08c;

    --serif: "Instrument Serif", "Times New Roman", serif;
    --sans: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

    --gutter: clamp(16px, 2.6vw, 40px);
    --ease: cubic-bezier(.22, 1, .36, 1);
    --ease-io: cubic-bezier(.76, 0, .24, 1);
}

/* ==========================================================================
   Base
   ========================================================================== */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
em { font-style: italic; }
::selection { background: var(--accent); color: var(--ink); }

:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }

.skip {
    position: fixed; left: var(--gutter); top: -100px; z-index: 100;
    padding: 10px 14px; background: var(--ink); color: var(--bg);
    font: 500 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em;
}
.skip:focus { top: var(--gutter); }

.label, .section-head, .hero-kicker, .tc, .card-time, .card-n, .card-meta,
.index-n, .index-cat, .index-year, .work-count, .player-label, .next-label, .next-meta,
.footer-bar, .about-list h2, .about-list li span, .work-credits dt {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.dot-live {
    display: inline-block;
    width: 7px; height: 7px; margin-right: 10px;
    border-radius: 50%;
    background: var(--live);
    box-shadow: 0 0 0 0 rgba(111, 208, 140, .6);
    animation: pulse 2s infinite;
    vertical-align: 1px;
}
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(111, 208, 140, .55); }
    70%  { box-shadow: 0 0 0 9px rgba(111, 208, 140, 0); }
    100% { box-shadow: 0 0 0 0 rgba(111, 208, 140, 0); }
}

.sep { display: inline-block; width: 22px; height: 1px; margin: 0 12px; background: currentColor; opacity: .5; vertical-align: 3px; }

/* ==========================================================================
   Cursor
   ========================================================================== */

.cursor { position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; display: none; }
.has-cursor .cursor { display: block; }
.has-cursor, .has-cursor a, .has-cursor button { cursor: none; }

.cursor-dot {
    position: absolute; left: -5px; top: -5px;
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--ink);
    mix-blend-mode: difference;
    transition: transform .45s var(--ease), opacity .3s;
}
.cursor-label {
    position: absolute; left: -46px; top: -46px;
    width: 92px; height: 92px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--ink); color: var(--bg);
    font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
    transform: scale(0); transition: transform .5s var(--ease);
}
.cursor.is-label .cursor-label { transform: scale(1); }
.cursor.is-label .cursor-dot { transform: scale(0); }
.cursor.is-link .cursor-dot { transform: scale(3.2); }
.cursor.is-down .cursor-dot { transform: scale(.6); }

/* ==========================================================================
   Navegação
   ========================================================================== */

.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 50;
    display: flex; justify-content: space-between; align-items: center;
    padding: calc(var(--gutter) * .8) var(--gutter);
    color: #fff;
    mix-blend-mode: difference;
    pointer-events: none;
    transition: transform .7s var(--ease);
}
.nav > * { pointer-events: auto; }
.nav.is-hidden { transform: translateY(-110%); }

.nav-logo { display: flex; align-items: baseline; gap: 14px; }
.nav-logo-mark { font: 400 26px/1 var(--serif); letter-spacing: -.01em; }
.nav-logo-mark i, .footer-giant i { font-style: italic; }
.nav-logo-name { font: 400 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; opacity: .7; }

.nav-links { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 36px); font-size: 13px; letter-spacing: .02em; }
.nav-links > a { position: relative; padding: 6px 0; }
.nav-links > a::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px;
    background: currentColor; transform: scaleX(0); transform-origin: right;
    transition: transform .6s var(--ease);
}
.nav-links > a:hover::after { transform: scaleX(1); transform-origin: left; }

.nav-langs { display: flex; gap: 2px; font: 400 11px/1 var(--mono); letter-spacing: .12em; }
.nav-langs a { padding: 6px 6px; opacity: .45; transition: opacity .3s; }
.nav-langs a:hover, .nav-langs a[aria-current] { opacity: 1; }

/* ==========================================================================
   Secções: cabeçalho comum
   ========================================================================== */

.section-head {
    display: flex; align-items: center; gap: 18px;
    padding-bottom: 18px; margin-bottom: clamp(28px, 5vw, 64px);
    border-bottom: 1px solid var(--ink-faint);
    color: var(--ink-dim);
}
.section-num { color: var(--accent); }
.section-count, .filters { margin-left: auto; }

/* ==========================================================================
   Loader
   ========================================================================== */

.loader { display: none; }
.is-loading .loader {
    display: block;
    position: fixed; inset: 0; z-index: 60;
    background: var(--paper);
}

/* Durante o loader, o vídeo do hero é uma caixa 16:9 ao centro (o plano inteiro, como na
   versão de fundo branco). O JS faz a caixa crescer até ao ecrã todo. */
.is-loading .hero-media {
    --fw: min(34vw, 560px);
    position: fixed; z-index: 61; inset: auto;
    width: var(--fw); height: calc(var(--fw) * .5625);
    left: calc(50% - var(--fw) / 2); top: calc(50% - var(--fw) * .28125);
}
.is-loading .hero-shade { opacity: 0; }
.hero-shade { transition: opacity 1.2s; }
@media (max-width: 720px) { .is-loading .hero-media { --fw: 72vw; } }
.is-loading { overflow: hidden; }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
    position: relative;
    height: 100vh; height: 100svh;
    min-height: 560px;
    overflow: hidden;
    background: var(--bg);
}
.hero-media { position: absolute; inset: 0; overflow: hidden; }
.hero-video {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.06);
    transition: opacity 1.4s var(--ease), transform 7s linear;
}
.hero-video.is-active { opacity: 1; transform: scale(1); }
.hero-shade {
    position: absolute; inset: 0; pointer-events: none;
    background:
        linear-gradient(180deg, rgba(11, 10, 9, .55) 0%, transparent 22%, transparent 48%, rgba(11, 10, 9, .82) 100%),
        radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, .35) 100%);
}

.hero-content {
    position: absolute; left: var(--gutter); right: var(--gutter);
    bottom: calc(var(--gutter) + 70px);
}
.hero-kicker { display: flex; align-items: center; flex-wrap: wrap; gap: 0; margin-bottom: 18px; color: var(--ink); }
.hero-title, .work-title {
    font: 400 clamp(58px, 11.2vw, 218px)/.84 var(--serif);
    letter-spacing: -.025em;
    margin-left: -.04em;
}
.hero-line { display: block; overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }
.hero-title em, .work-title em { color: var(--ink-dim); }
.hero-role { margin-top: 18px; font: 400 clamp(18px, 1.6vw, 24px)/1.2 var(--serif); font-style: italic; color: var(--ink-dim); }

.hero-reel {
    position: absolute; right: var(--gutter); bottom: calc(var(--gutter) + 82px);
    width: min(340px, 34vw);
}
.hero-reel-now { display: grid; gap: 6px; margin-bottom: 16px; }
.hero-reel-now .label { color: var(--ink-dim); }
.hero-reel-title { font: 400 clamp(24px, 2.2vw, 34px)/1 var(--serif); }
.hero-reel-meta { font: 400 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-dim); }
.hero-reel-bars { display: flex; gap: 5px; }
.reel-bar { flex: 1; height: 14px; position: relative; }
.reel-bar::before, .reel-bar i {
    content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 2px;
    background: var(--ink-faint);
}
.reel-bar i { background: var(--ink); transform: scaleX(0); transform-origin: left; }
.reel-bar.is-done i { transform: scaleX(1); }

.hero-foot {
    position: absolute; left: var(--gutter); right: var(--gutter); bottom: var(--gutter);
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 14px; border-top: 1px solid var(--ink-faint);
    font: 400 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-dim);
}
.tc { font-variant-numeric: tabular-nums; }
.hero-scroll { display: flex; align-items: center; gap: 12px; }
.hero-scroll i { position: relative; width: 48px; height: 1px; background: var(--ink-faint); overflow: hidden; }
.hero-scroll i::after {
    content: ""; position: absolute; inset: 0; background: var(--ink);
    animation: scrollcue 2.2s var(--ease-io) infinite;
}
@keyframes scrollcue { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(100%); } }

/* ==========================================================================
   Índice
   ========================================================================== */

.index { position: relative; background: var(--bg); }
/* Contentor absoluto do tamanho da secção; lá dentro o fundo cola ao ecrã */
.index-media { position: absolute; inset: 0; overflow: clip; }
.index-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.index-video {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    opacity: 0; transform: scale(1.08);
    transition: opacity .9s var(--ease), transform 1.6s var(--ease);
}
.index-video.is-active { opacity: 1; transform: scale(1); }
.index-shade { position: absolute; inset: 0; background: rgba(11, 10, 9, .52); transition: background .8s; }
.index.has-active .index-shade { background: rgba(11, 10, 9, .38); }

.index-inner {
    position: relative;
    min-height: 100vh; min-height: 100svh;
    padding: calc(var(--gutter) * 4) var(--gutter) calc(var(--gutter) * 2);
    display: flex; flex-direction: column; justify-content: center;
}

.index-list { border-top: 1px solid var(--ink-faint); }
.index-list li { border-bottom: 1px solid var(--ink-faint); overflow: hidden; }
.index-item {
    position: relative;
    display: grid; grid-template-columns: 70px 1fr 220px 70px; align-items: center; gap: 16px;
    padding: clamp(10px, 1.4vw, 20px) 0;
    transition: opacity .5s var(--ease);
}
.index-list.is-hovering .index-item { opacity: .28; }
.index-list.is-hovering .index-item.is-active { opacity: 1; }
.index-n { color: var(--ink-dim); }
.index-title { display: flex; align-items: baseline; gap: 22px; min-width: 0; }
.index-title-main {
    font: 400 clamp(40px, 6.6vw, 118px)/.95 var(--serif); letter-spacing: -.02em;
    white-space: nowrap;
    transition: transform .8s var(--ease);
}
.index-title-sub {
    font: italic 400 clamp(16px, 1.6vw, 26px)/1 var(--serif); color: var(--ink-dim);
    white-space: nowrap;
    opacity: 0; transform: translateX(-16px);
    transition: opacity .6s var(--ease), transform .8s var(--ease);
}
.index-item.is-active .index-title-main { transform: translateX(28px); }
.index-item.is-active .index-title-sub { opacity: 1; transform: translateX(28px); }
.index-cat, .index-year { color: var(--ink-dim); }
.index-year { text-align: right; }
.index-thumb { display: none; }

/* ==========================================================================
   Grelha
   ========================================================================== */

.grid-section { padding: calc(var(--gutter) * 4) var(--gutter); }

.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filter {
    padding: 8px 14px; border: 1px solid var(--ink-faint); border-radius: 100px;
    font: 400 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim);
    transition: background .4s, color .4s, border-color .4s;
}
.filter:hover { border-color: var(--ink-dim); color: var(--ink); }
.filter.is-active { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(36px, 5vw, 80px) clamp(14px, 1.6vw, 24px); }
.card { grid-column: span 6; display: block; }
.card-wide { grid-column: span 12; }
.grid.is-filtered .card { grid-column: span 6; }
.card.is-hidden { display: none; }

.card-media {
    position: relative; overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--bg-2);
}
.card-wide .card-media { aspect-ratio: 2.39 / 1; }
.grid.is-filtered .card-media { aspect-ratio: 16 / 9; }
.card-media img, .card-media video {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    transition: transform 1.4s var(--ease), opacity .6s var(--ease), filter .8s;
}
.card-media video { opacity: 0; }
.card.is-playing .card-media video { opacity: 1; }
.card:hover .card-media img, .card:hover .card-media video { transform: scale(1.04); }
.card-time {
    position: absolute; top: 14px; right: 14px; z-index: 1;
    padding: 6px 9px; background: rgba(11, 10, 9, .55); backdrop-filter: blur(8px);
    color: var(--ink);
}

.card-caption {
    display: grid; grid-template-columns: 48px 1fr auto; align-items: baseline; gap: 12px;
    padding-top: 16px;
}
.card-n { color: var(--accent); }
.card-title { font: 400 clamp(26px, 2.6vw, 42px)/1 var(--serif); }
.card-title em { color: var(--ink-dim); font-size: .62em; margin-left: .3em; }
.card-meta { color: var(--ink-dim); }

/* ==========================================================================
   Faixa
   ========================================================================== */

.marquee {
    overflow: hidden; padding: clamp(18px, 3vw, 40px) 0;
    border-top: 1px solid var(--ink-faint); border-bottom: 1px solid var(--ink-faint);
}
.marquee-track { display: flex; width: max-content; will-change: transform; }
.marquee-set { display: flex; align-items: center; }
.marquee span {
    font: 500 clamp(44px, 8.4vw, 148px)/1 var(--sans); letter-spacing: -.045em;
    padding: 0 .28em; white-space: nowrap;
}
.marquee span.serif { font: italic 400 clamp(48px, 9vw, 160px)/1 var(--serif); letter-spacing: -.02em; color: var(--ink-dim); }
.marquee i { flex: none; width: clamp(12px, 1.4vw, 22px); height: clamp(12px, 1.4vw, 22px); border-radius: 50%; background: var(--accent); }

/* ==========================================================================
   Sobre
   ========================================================================== */

.about { padding: calc(var(--gutter) * 4) var(--gutter) calc(var(--gutter) * 3); overflow: hidden; }
.about-text {
    max-width: 22ch;
    font: 400 clamp(34px, 5vw, 86px)/1.04 var(--serif); letter-spacing: -.015em;
    text-indent: 2.2em;
}
.about-text .w { opacity: .16; }
.no-js .about-text .w, .about-text.is-static .w { opacity: 1; }

.about-cols {
    display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: clamp(24px, 4vw, 64px);
    margin-top: clamp(48px, 8vw, 120px);
}
.about-more { max-width: 34ch; font-size: clamp(17px, 1.35vw, 21px); line-height: 1.45; color: var(--ink-dim); }
.about-list h2 { color: var(--ink-dim); margin-bottom: 14px; }
.about-list li {
    display: flex; gap: 14px; align-items: baseline;
    padding: 11px 0; border-top: 1px solid var(--ink-faint);
    font-size: 17px;
}
.about-list li span { color: var(--accent); }

.about-strip {
    display: grid; grid-template-columns: 1.1fr .8fr 1fr .7fr 1fr; gap: clamp(10px, 1.4vw, 20px);
    align-items: center;
    margin-top: clamp(60px, 9vw, 140px);
}
.about-still { overflow: hidden; background: var(--bg-2); }
.about-still img { width: 100%; height: 100%; object-fit: cover; }
.about-still:nth-child(1) { aspect-ratio: 4 / 5; }
.about-still:nth-child(2) { aspect-ratio: 1 / 1; }
.about-still:nth-child(3) { aspect-ratio: 3 / 4; }
.about-still:nth-child(4) { aspect-ratio: 4 / 5; }
.about-still:nth-child(5) { aspect-ratio: 5 / 6; }

/* ==========================================================================
   Contacto + rodapé
   ========================================================================== */

.contact { position: relative; padding: calc(var(--gutter) * 2.5) var(--gutter) 0; overflow: hidden; background: var(--bg); }
.contact-big {
    font: 400 clamp(56px, 10.4vw, 200px)/.88 var(--serif); letter-spacing: -.03em;
    max-width: 12ch;
}
.contact-grid {
    display: grid; grid-template-columns: 1fr 1.4fr; gap: clamp(24px, 4vw, 64px);
    margin-top: clamp(40px, 6vw, 90px);
}
.contact-text { max-width: 34ch; font-size: clamp(17px, 1.35vw, 21px); line-height: 1.45; color: var(--ink-dim); }
.contact-email {
    display: inline-block;
    font: 400 clamp(26px, 3.4vw, 60px)/1.1 var(--serif);
    border-bottom: 1px solid var(--ink-faint); padding-bottom: 6px; margin-bottom: 26px;
}
.contact-links ul { display: flex; flex-wrap: wrap; gap: 10px 30px; }
.contact-links li a { display: inline-flex; align-items: center; gap: 8px; font-size: 18px; padding: 6px 0; }

/* Texto que rola para cima em hover */
.roll { display: inline-block; overflow: hidden; vertical-align: bottom; }
.roll > span { display: inline-block; position: relative; transition: transform .6s var(--ease); }
.roll > span::after { content: attr(data-text); position: absolute; left: 0; top: 100%; }
a:hover .roll > span { transform: translateY(-100%); }

.footer-bar {
    display: flex; justify-content: space-between; align-items: center; gap: 20px;
    margin-top: clamp(60px, 8vw, 120px); padding: 18px 0;
    border-top: 1px solid var(--ink-faint);
    color: var(--ink-dim);
}
.footer-langs { display: flex; gap: 10px; }
.footer-langs a { opacity: .5; }
.footer-langs a[aria-current], .footer-langs a:hover { opacity: 1; color: var(--ink); }
.footer-top { display: inline-flex; align-items: center; gap: 8px; }
.footer-top:hover { color: var(--ink); }

.footer-giant {
    font: 400 37vw/.74 var(--serif); letter-spacing: -.05em;
    text-align: center;
    margin: 2vw 0 -6.4vw;
    color: transparent;
    background: linear-gradient(180deg, rgba(239, 232, 220, .2), rgba(239, 232, 220, .02) 80%);
    -webkit-background-clip: text; background-clip: text;
    user-select: none;
}

/* ==========================================================================
   Página de projeto
   ========================================================================== */

.work-hero { position: relative; height: 100vh; height: 100svh; min-height: 560px; overflow: hidden; }
.work-hero-media { position: absolute; inset: 0; }
.work-hero-media video { width: 100%; height: 100%; object-fit: cover; }
.work-hero-shade {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(11, 10, 9, .6) 0%, transparent 25%, transparent 45%, rgba(11, 10, 9, .85) 100%);
}
.work-hero-top {
    position: absolute; left: var(--gutter); right: var(--gutter); top: calc(var(--gutter) * 3.2);
    display: flex; justify-content: space-between; align-items: center;
}
.back {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 10px 16px; border: 1px solid var(--ink-faint); border-radius: 100px;
    background: rgba(11, 10, 9, .25); backdrop-filter: blur(8px);
    font: 400 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
    transition: background .4s, color .4s;
}
.back:hover { background: var(--ink); color: var(--bg); }
.work-count { color: var(--ink-dim); }
.work-hero-title { position: absolute; left: var(--gutter); right: var(--gutter); bottom: calc(var(--gutter) * 2); }
.work-title { font-size: clamp(54px, 10vw, 190px); padding-right: 300px; }
.work-title .hero-line + .hero-line { font-size: .58em; margin-top: .06em; }
.work-watch {
    position: absolute; right: var(--gutter); bottom: calc(var(--gutter) * 2.2);
    display: flex; align-items: center; gap: 14px;
    font: 400 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
}
.work-watch .dim { color: var(--ink-dim); }
.work-watch-ring {
    display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
    border: 1px solid var(--ink-dim);
    transition: background .4s, color .4s, transform .6s var(--ease);
}
.work-watch:hover .work-watch-ring { background: var(--ink); color: var(--bg); transform: scale(1.08); }

.work-film { padding: calc(var(--gutter) * 3) var(--gutter); }
.player {
    position: relative; max-width: 1680px; margin: 0 auto;
    aspect-ratio: 16 / 9; background: #000; overflow: hidden;
}
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-poster { position: absolute; inset: 0; width: 100%; display: block; }
.player-poster img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.72); transition: transform 1.6s var(--ease), filter .8s; }
.player-poster:hover img { transform: scale(1.03); filter: brightness(.6); }
.player-btn {
    position: absolute; left: 50%; top: 50%;
    width: clamp(84px, 9vw, 128px); height: clamp(84px, 9vw, 128px); margin: 0;
    transform: translate(-50%, -50%);
    display: grid; place-items: center; border-radius: 50%;
    background: rgba(239, 232, 220, .14); backdrop-filter: blur(14px);
    border: 1px solid rgba(239, 232, 220, .35);
    transition: background .4s, color .4s, transform .6s var(--ease);
}
.player-poster:hover .player-btn { background: var(--ink); color: var(--bg); transform: translate(-50%, -50%) scale(1.06); }
.player-label { position: absolute; left: 50%; top: calc(50% + clamp(60px, 6vw, 84px)); transform: translateX(-50%); color: var(--ink); }
.player-noscript { padding-top: 16px; text-align: center; }

.work-info { padding: calc(var(--gutter) * 2) var(--gutter) calc(var(--gutter) * 3); }
.work-tagline { font: 400 clamp(38px, 5.6vw, 96px)/1 var(--serif); letter-spacing: -.02em; max-width: 18ch; }
.work-info-cols { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 90px); margin-top: clamp(36px, 5vw, 80px); }
.work-about { max-width: 40ch; font-size: clamp(17px, 1.4vw, 22px); line-height: 1.45; color: var(--ink-dim); }
.work-credits div { display: grid; grid-template-columns: 140px 1fr; gap: 16px; padding: 13px 0; border-top: 1px solid var(--ink-faint); align-items: baseline; }
.work-credits div:last-child { border-bottom: 1px solid var(--ink-faint); }
.work-credits dt { color: var(--ink-dim); }
.work-credits dd { font-size: 17px; }
.work-credits a { border-bottom: 1px solid var(--ink-faint); transition: border-color .3s; }
.work-credits a:hover { border-color: var(--ink); }

.work-stills { padding: 0 var(--gutter) calc(var(--gutter) * 4); }
.stills { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(10px, 1.4vw, 20px); }
.still { overflow: hidden; background: var(--bg-2); }
.still img { width: 100%; height: 100%; object-fit: cover; }
.still-1 { grid-column: span 12; aspect-ratio: 2.39 / 1; }
.still-2 { grid-column: span 7; aspect-ratio: 4 / 3; }
.still-3 { grid-column: span 5; aspect-ratio: 4 / 5; align-self: end; }
.still-4 { grid-column: 3 / span 8; aspect-ratio: 16 / 9; }

.next {
    position: relative; display: grid; place-content: center; text-align: center; gap: 18px;
    height: 80vh; height: 80svh; min-height: 460px;
    overflow: hidden; border-top: 1px solid var(--ink-faint);
}
.next-media { position: absolute; inset: 0; }
.next-media video { width: 100%; height: 100%; object-fit: cover; opacity: .32; transform: scale(1.08); transition: opacity 1s var(--ease), transform 1.6s var(--ease); }
.next:hover .next-media video { opacity: .7; transform: scale(1); }
.next > span { position: relative; }
.next-label { color: var(--accent); }
.next-title { font: 400 clamp(54px, 10vw, 190px)/.88 var(--serif); letter-spacing: -.025em; }
.next-title em { display: block; font-size: .36em; color: var(--ink-dim); letter-spacing: 0; margin-top: .3em; }
.next-meta { color: var(--ink-dim); }

/* ==========================================================================
   404
   ========================================================================== */

.notfound {
    position: relative; min-height: 100vh; min-height: 100svh;
    display: grid; place-content: center; justify-items: center; gap: 20px;
    padding: var(--gutter); text-align: center; overflow: hidden;
}
.notfound-media { position: absolute; inset: 0; }
.notfound-media video { width: 100%; height: 100%; object-fit: cover; opacity: .22; filter: grayscale(1); }
.notfound > *:not(.notfound-media) { position: relative; }
.notfound-text { color: var(--ink-dim); font-size: 18px; }

/* ==========================================================================
   Estados iniciais das animações (só com JS; boot.js liberta se algo falhar)
   ========================================================================== */

.js:not(.js-free) [data-fade] { opacity: 0; transform: translateY(28px); }
.js:not(.js-free) [data-reveal-media] { clip-path: inset(100% 0 0 0); }
.js:not(.js-free) [data-hero-in] { opacity: 0; }
.js:not(.js-free):not(.js-ready) [data-hero-title],
.js:not(.js-free):not(.js-ready) [data-split-lines] { visibility: hidden; }

/* ==========================================================================
   Transições entre páginas
   ========================================================================== */

@view-transition { navigation: auto; }
::view-transition-old(root) { animation: .6s var(--ease-io) both vt-out; }
::view-transition-new(root) { animation: .9s var(--ease-io) both vt-in; }
@keyframes vt-out { to { opacity: .2; transform: translateY(-6%) scale(.98); } }
@keyframes vt-in  { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }

/* ==========================================================================
   Ecrãs médios e telemóvel
   ========================================================================== */

@media (max-width: 1024px) {
    .index-item { grid-template-columns: 50px 1fr 70px; }
    .index-cat { display: none; }
    .about-cols { grid-template-columns: 1fr 1fr; }
    .about-more { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
    body { font-size: 14px; }
    .nav-logo-name { display: none; }
    .nav-links { gap: 14px; font-size: 12px; }
    .nav-links > a:nth-child(2) { display: none; }

    /* No telemóvel o vídeo não corta: caixa 16:9 com o frame inteiro, texto por baixo */
    .hero-media { inset: auto; left: var(--gutter); right: var(--gutter); top: 14%; aspect-ratio: 16 / 9; }
    .hero-shade { background: linear-gradient(180deg, transparent 70%, rgba(11, 10, 9, .25)); }
    .hero-content { bottom: calc(var(--gutter) + 150px); }
    .hero-title, .work-title { font-size: clamp(54px, 17vw, 100px); }
    .hero .k-extra { display: none; }
    .hero-reel { left: var(--gutter); right: var(--gutter); width: auto; bottom: calc(var(--gutter) + 46px); }
    .hero-reel-now { grid-template-columns: auto 1fr; align-items: baseline; column-gap: 12px; margin-bottom: 10px; }
    .hero-reel-now .label { grid-column: 1 / -1; }
    .hero-reel-title { font-size: 24px; }

    .index-inner { padding-top: calc(var(--gutter) * 6); }
    .index-item { grid-template-columns: 34px 1fr 96px; gap: 12px; padding: 14px 0; }
    .index-year { display: none; }
    .index-title { flex-direction: column; gap: 4px; }
    .index-title-main { font-size: clamp(34px, 10vw, 54px); white-space: normal; }
    .index-title-sub { opacity: 1; transform: none; font-size: 15px; }
    .index-item.is-active .index-title-main, .index-item.is-active .index-title-sub { transform: none; }
    .index-thumb { display: block; width: 96px; height: 54px; object-fit: cover; }

    .section-head { flex-wrap: wrap; }
    .filters { margin-left: 0; width: 100%; }
    .grid { grid-template-columns: 1fr; }
    .card, .card-wide, .grid.is-filtered .card { grid-column: auto; }
    .card-wide .card-media { aspect-ratio: 16 / 9; }
    .card-caption { grid-template-columns: 34px 1fr; }
    .card-meta { grid-column: 2; }

    .about-text { text-indent: 0; }
    .about-cols, .contact-grid, .work-info-cols { grid-template-columns: 1fr; }
    .about-strip { grid-template-columns: 1fr 1fr; }
    .about-still:nth-child(5) { display: none; }

    .footer-bar { flex-wrap: wrap; }
    .footer-langs { order: 3; }

    /* Hero do projeto no telemóvel: coluna simples, vídeo 16:9 sem cortes */
    .work-hero {
        height: auto; min-height: 0;
        display: flex; flex-direction: column; gap: 24px;
        padding: calc(var(--gutter) * 4.4) var(--gutter) 36px;
    }
    .work-hero-top, .work-hero-title, .work-watch { position: static; }
    .work-hero-top { order: -1; }
    .work-hero-media { position: relative; inset: auto; aspect-ratio: 16 / 9; overflow: hidden; }
    .work-hero-shade { background: linear-gradient(180deg, transparent 70%, rgba(11, 10, 9, .25)); }
    .work-title { padding-right: 0; }

    .work-watch-ring { width: 52px; height: 52px; }
    .work-credits div { grid-template-columns: 110px 1fr; }
    .stills { grid-template-columns: 1fr 1fr; }
    .still-1, .still-4 { grid-column: 1 / -1; }
    .still-2, .still-3 { grid-column: auto; aspect-ratio: 4 / 5; }
}

/* Quem pede menos movimento vê tudo parado e já composto */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
    @view-transition { navigation: none; }
}
