/* ==========================================================================
   Diogo Rodrigues — Portefólio audiovisual
   Estrutura deste ficheiro:
     1. Fontes e variáveis        6. Sobre
     2. Base                      7. Projetos + janela de detalhes
     3. Componentes (botões…)     8. Competências (timeline)
     4. Cabeçalho / menu          9. Contacto + rodapé
     5. Hero                     10. Animações e movimento reduzido
   ========================================================================== */

/* ---------- 1. Fontes e variáveis ---------- */
@font-face {
  font-family: "Instrument Sans";
  src: url("../assets/fonts/instrument-sans-400.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("../assets/fonts/instrument-sans-700.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../assets/fonts/ibm-plex-mono-400.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0b0b0c;
  --bg-1: #111113;
  --bg-2: #17171a;
  --bg-3: #1f1f23;
  --fg: #f2efe9;
  --fg-2: #bcb8b0;
  --fg-3: #8c8982;
  --line: rgba(242, 239, 233, 0.12);
  --line-2: rgba(242, 239, 233, 0.24);
  --accent: #e0b56a;
  --accent-soft: rgba(224, 181, 106, 0.14);
  --rec: #e5484d;
  --error: #ff8a8f;

  --font-display: "Instrument Sans", "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-body: "Instrument Sans", "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --gutter: clamp(20px, 5vw, 72px);
  --maxw: 1320px;
  --nav-h: 72px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- 2. Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
  scroll-padding-top: calc(var(--nav-h) + 8px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
html.is-locked,
html.menu-open { overflow: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
em { font-style: italic; }
h1 em, h2 em, h3 em, h4 em, .next__text em { font-style: normal; }
[hidden] { display: none !important; }

::selection { background: var(--accent); color: var(--bg); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.container {
  width: 100%;
  max-width: calc(var(--maxw) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -100px; left: 12px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--bg);
  font: 500 0.875rem var(--font-body);
}
.skip-link:focus { top: 12px; }

/* Grão de película (subtil) */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 90;
  pointer-events: none;
  background: url("../assets/grain.png") repeat;
  opacity: 0.55;
  animation: grain 0.9s steps(1) infinite;
}
@keyframes grain {
  0%   { transform: translate(0, 0); }
  17%  { transform: translate(-6%, 4%); }
  34%  { transform: translate(5%, -7%); }
  51%  { transform: translate(-3%, 8%); }
  68%  { transform: translate(7%, 2%); }
  85%  { transform: translate(-8%, -3%); }
  100% { transform: translate(0, 0); }
}

/* Barra de progresso do scroll, como o cursor numa timeline */
.progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 120;
  pointer-events: none;
}
.progress span {
  display: block;
  height: 100%;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

/* ---------- 3. Componentes ---------- */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font: 700 0.792rem/1.4 var(--font-body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.eyebrow::before {
  content: "";
  width: 28px; height: 1px;
  background: var(--line-2);
  flex: none;
}
.eyebrow span { color: var(--accent); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 28px;
  border: 1px solid transparent;
  border-radius: 2px;
  font: 700 0.825rem/1 var(--font-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.btn svg { transition: transform 0.3s var(--ease); flex: none; }
.btn:hover svg { transform: translateX(4px); }
.btn--primary { background: var(--accent); color: var(--bg); font-weight: 700; }
.btn--primary:hover { background: var(--fg); }
.btn--ghost { border-color: var(--line-2); color: var(--fg); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn[disabled] { opacity: 0.6; cursor: progress; }

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font: 700 0.792rem/1 var(--font-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg);
  border-bottom: 1px solid transparent;
  transition: color 0.25s, border-color 0.25s;
}
.link-btn:hover { color: var(--accent); border-color: var(--accent); }
.link-btn span { transition: transform 0.3s var(--ease); }
.link-btn:hover span { transform: translate(2px, -2px); }

.section {
  position: relative;
  padding-block: clamp(88px, 12vw, 176px);
  border-top: 1px solid var(--line);
}
.section__head {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
  gap: 20px 32px;
  margin-bottom: clamp(48px, 7vw, 96px);
  align-items: start;
}
.section__head .eyebrow { padding-top: 1.1em; }
.section__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 5.6vw, 4.8rem);
  line-height: 1.04;
  letter-spacing: -0.028em;
  word-spacing: 0.07em;
  text-wrap: balance;
}
.section__intro {
  margin-top: 24px;
  max-width: 56ch;
  color: var(--fg-2);
  font-size: 1.0625rem;
}

/* ---------- 4. Cabeçalho / menu ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
}
/* O fundo vai num pseudo-elemento para o backdrop-filter não afetar o menu móvel */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(11, 11, 12, 0.78);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}
.site-header.is-scrolled::before,
html.menu-open .site-header::before { opacity: 1; }

.nav {
  position: relative;
  height: 100%;
  max-width: calc(var(--maxw) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}
.brand__mark { color: var(--fg); flex: none; }
.brand__name { font: 500 0.875rem var(--font-body); letter-spacing: 0.01em; }
.brand:hover .brand__mark { color: var(--accent); }

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.6vw, 40px);
}
.nav__links a {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-height: 44px;
  align-items: center;
  font: 700 0.792rem/1 var(--font-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-2);
  transition: color 0.25s;
}
.nav__num { color: var(--fg-3); font-size: 0.62rem; }
.nav__links a:hover,
.nav__links a.is-active { color: var(--fg); }
.nav__links a.is-active .nav__num,
.nav__links a:hover .nav__num { color: var(--accent); }
.nav__links a:not(.nav__cta)::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 8px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.35s var(--ease);
}
.nav__links a:not(.nav__cta):hover::after,
.nav__links a.is-active:not(.nav__cta)::after { transform: scaleX(1); }
.nav__cta {
  padding-inline: 16px;
  border: 1px solid var(--line-2);
  border-radius: 2px;
}
.nav__cta:hover { border-color: var(--accent); color: var(--accent) !important; }

.nav__toggle {
  position: relative;
  z-index: 3;
  display: none;
  width: 44px; height: 44px;
  align-items: center;
  justify-content: center;
}
.nav__bars { position: relative; width: 24px; height: 12px; }
.nav__bars i {
  position: absolute;
  left: 0; right: 0;
  height: 1.5px;
  background: var(--fg);
  transition: transform 0.35s var(--ease), top 0.35s var(--ease);
}
.nav__bars i:first-child { top: 0; }
.nav__bars i:last-child { top: 10px; }
.nav__toggle[aria-expanded="true"] .nav__bars i:first-child { top: 5px; transform: rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__bars i:last-child { top: 5px; transform: rotate(-45deg); }

@media (max-width: 899px) {
  .nav__toggle { display: inline-flex; }
  .nav__links {
    position: fixed;
    inset: 0;
    z-index: 2;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    padding: calc(var(--nav-h) + 16px) var(--gutter) 48px;
    background: rgba(11, 11, 12, 0.98);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0s 0.35s;
  }
  .nav__links.is-open {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0s;
  }
  .nav__links li { width: 100%; }
  .nav__links a {
    width: 100%;
    min-height: 64px;
    gap: 18px;
    font: 700 clamp(2rem, 9vw, 3rem)/1 var(--font-display);
    letter-spacing: -0.01em;
    text-transform: none;
    color: var(--fg);
    border-bottom: 1px solid var(--line);
  }
  .nav__num { font: 400 0.7rem var(--font-mono); letter-spacing: 0.16em; }
  .nav__links a:not(.nav__cta)::after { display: none; }
  .nav__cta { padding-inline: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
}
@media (max-width: 419px) {
  .brand__name { display: none; }
}

/* ---------- 5. Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--nav-h) + clamp(28px, 6.5vh, 64px)) var(--gutter) clamp(72px, 10vh, 104px);
  overflow: hidden;
  border-top: 0;
}
.hero__wave {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 14%, #000 86%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 14%, #000 86%, transparent 100%);
}
.hero__shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(70% 60% at 82% 88%, rgba(224, 181, 106, 0.09), transparent 70%),
    radial-gradient(120% 90% at 30% 50%, transparent 45%, rgba(0, 0, 0, 0.55) 100%),
    linear-gradient(to bottom, rgba(11, 11, 12, 0.5), transparent 24%, transparent 76%, var(--bg));
}

/* Visor */
.vf {
  position: absolute;
  inset: calc(var(--nav-h) + 8px) clamp(12px, 2.2vw, 32px) clamp(14px, 2.4vw, 32px);
  z-index: 1;
  pointer-events: none;
  font: 400 0.68rem/1 var(--font-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(242, 239, 233, 0.62);
  background:
    linear-gradient(90deg, transparent calc(33.333% - 0.5px), rgba(242, 239, 233, 0.045) 0, rgba(242, 239, 233, 0.045) calc(33.333% + 0.5px), transparent 0),
    linear-gradient(90deg, transparent calc(66.666% - 0.5px), rgba(242, 239, 233, 0.045) 0, rgba(242, 239, 233, 0.045) calc(66.666% + 0.5px), transparent 0),
    linear-gradient(0deg, transparent calc(33.333% - 0.5px), rgba(242, 239, 233, 0.045) 0, rgba(242, 239, 233, 0.045) calc(33.333% + 0.5px), transparent 0),
    linear-gradient(0deg, transparent calc(66.666% - 0.5px), rgba(242, 239, 233, 0.045) 0, rgba(242, 239, 233, 0.045) calc(66.666% + 0.5px), transparent 0);
}
.vf__corner {
  position: absolute;
  width: 22px; height: 22px;
  border: 0 solid rgba(242, 239, 233, 0.5);
}
.vf__corner--tl { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.vf__corner--tr { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; }
.vf__corner--bl { bottom: 0; left: 0; border-bottom-width: 1px; border-left-width: 1px; }
.vf__corner--br { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }
.vf__tl, .vf__tr { position: absolute; top: 18px; display: flex; align-items: center; gap: 10px; }
.vf__tl { left: 24px; font-variant-numeric: tabular-nums; }
.vf__tr { right: 24px; }
.vf__rec {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--rec);
  animation: blink 1.6s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0.15; } }
.vf__br { position: absolute; right: 24px; bottom: 18px; display: flex; gap: 2px; }
.vf__br i { display: block; width: 14px; height: 9px; opacity: 0.7; }
.vf__br i:nth-child(1) { background: #b9b6ae; }
.vf__br i:nth-child(2) { background: #b8a35c; }
.vf__br i:nth-child(3) { background: #5c9aa0; }
.vf__br i:nth-child(4) { background: #5f9a6a; }
.vf__br i:nth-child(5) { background: #9b5f95; }
.vf__br i:nth-child(6) { background: #a35555; }
.vf__br i:nth-child(7) { background: #5a63a3; }

/* Marcadores de tracking: referência discreta a VFX (composição e rastreio de movimento) */
.vf__trkline { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; fill: rgba(224, 181, 106, 0.035); stroke: rgba(242, 239, 233, 0.2); stroke-width: 1; stroke-dasharray: 3 5; }
.vf__trkline polygon { vector-effect: non-scaling-stroke; }
.vf__trk { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border: 1px solid rgba(224, 181, 106, 0.6); }
.vf__trk::before, .vf__trk::after { content: ""; position: absolute; background: rgba(224, 181, 106, 0.6); }
.vf__trk::before { left: -7px; right: -7px; top: 50%; height: 1px; }
.vf__trk::after { top: -7px; bottom: -7px; left: 50%; width: 1px; }
.vf__trk i { position: absolute; left: 26px; top: -3px; font-style: normal; font-size: 0.58rem; letter-spacing: 0.2em; color: rgba(242, 239, 233, 0.45); white-space: nowrap; }
@media (max-width: 1099px) { .vf__trkline, .vf__trk { display: none; } }

.hero__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(0px, 1.5vw, 24px);
}
.hero__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3rem, min(17vw, 19vh), 13rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
  word-spacing: 0.06em;
}
.hero__name .line { display: block; overflow: hidden; padding: 0.04em 0.1em 0.3em 0; margin-bottom: -0.26em; }
.hero__name .line > span {
  display: block;
  transform: translateY(108%);
  animation: rise 1.15s var(--ease) 0.15s forwards;
}
.hero__name .line--it { padding-left: 0.4em; }
.hero__name .line--it > span { animation-delay: 0.3s; }
@keyframes rise { to { transform: translateY(0); } }

.hero__roles {
  margin-top: clamp(18px, 3.4vh, 36px);
  font: 700 clamp(0.8rem, 1.2vw, 0.95rem)/1.4 var(--font-body);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg);
}
.hero__roles i { font-style: normal; color: var(--accent); margin-inline: 0.5em; }
.hero__cta { margin-top: clamp(26px, 5vh, 48px); display: flex; flex-wrap: wrap; gap: 12px; }

.hero__roles, .hero__cta { opacity: 0; animation: fade 1s var(--ease) 0.7s forwards; }
.hero__cta { animation-delay: 1s; }
@keyframes fade { to { opacity: 1; } }

@media (max-width: 899px) {
  .hero { padding-bottom: 88px; }
  .vf__tr { display: none; }
  .vf__tl { left: 16px; top: 14px; }
  .vf__br { right: 16px; bottom: 14px; }
}

/* ---------- 6. Sobre ---------- */
.about {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: clamp(40px, 7vw, 120px);
  align-items: start;
}
.about__lead {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.9vw, 2.45rem);
  line-height: 1.28;
  letter-spacing: -0.01em;
  margin-bottom: clamp(32px, 4vw, 56px);
}
.prose { display: grid; gap: 1.25em; }
.prose p { max-width: 62ch; color: var(--fg-2); font-size: 1.0625rem; }

.slate { border: 1px solid var(--line-2); background: var(--bg-1); position: sticky; top: calc(var(--nav-h) + 24px); }
.slate__clapper {
  height: 22px;
  background: repeating-linear-gradient(-55deg, #d9d5cc 0 16px, #17171a 16px 32px);
  border-bottom: 1px solid var(--line-2);
  opacity: 0.9;
}
.slate__head {
  display: flex;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  font: 700 0.748rem/1 var(--font-body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.slate__list div { display: grid; grid-template-columns: 96px 1fr; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.slate__list div:last-child { border-bottom: 0; }
.slate__list dt { font: 400 0.726rem/1.7 var(--font-body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3); }
.slate__list dd { font-size: 0.95rem; line-height: 1.5; }

@media (max-width: 899px) {
  .section__head { grid-template-columns: 1fr; }
  .section__head .eyebrow { padding-top: 0; }
  .about { grid-template-columns: 1fr; }
  .slate { position: static; }
}

/* ---------- 7. Projetos ---------- */
.projects {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(56px, 7vw, 104px) clamp(20px, 3vw, 44px);
  align-items: start;
}
.project { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .project:nth-child(4n + 1) { grid-column: 1 / span 7; }
  .project:nth-child(4n + 2) { grid-column: 8 / span 5; margin-top: clamp(56px, 11vw, 168px); }
  .project:nth-child(4n + 3) { grid-column: 1 / span 5; }
  .project:nth-child(4n + 4) { grid-column: 6 / span 7; margin-top: clamp(56px, 11vw, 168px); }
}

.project__frame {
  position: relative;
  background: #060607;
  border: 1px solid var(--line);
}
/* Curta-metragem: fotograma numa tira de película, com perfurações */
.project[data-kind="curta"] .project__frame::before,
.project[data-kind="curta"] .project__frame::after {
  content: "";
  display: block;
  height: 20px;
  background: repeating-linear-gradient(90deg, transparent 0 9px, rgba(242, 239, 233, 0.2) 9px 17px, transparent 17px 26px) center / 100% 8px no-repeat;
}

.project__media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-2);
  color: var(--fg);
  text-align: left;
}
.poster {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding: clamp(14px, 2.4vw, 28px);
  background:
    radial-gradient(90% 120% at 85% 10%, rgba(224, 181, 106, 0.14), transparent 60%),
    repeating-linear-gradient(90deg, rgba(242, 239, 233, 0.07) 0 2px, transparent 2px 8px) 0 38% / 100% 22% no-repeat,
    linear-gradient(160deg, #1b1b1f, #0e0e10);
}
.project[data-kind="documentario"] .poster {
  background:
    radial-gradient(90% 120% at 15% 10%, rgba(140, 160, 190, 0.16), transparent 60%),
    repeating-linear-gradient(90deg, rgba(242, 239, 233, 0.07) 0 2px, transparent 2px 8px) 0 38% / 100% 22% no-repeat,
    linear-gradient(200deg, #1b1b1f, #0e0e10);
}
.poster__no { font: 700 clamp(3rem, 9vw, 7rem)/0.8 var(--font-display); color: rgba(242, 239, 233, 0.16); font-style: normal; }
.poster__title { font: 700 clamp(0.95rem, 1.7vw, 1.3rem)/1.2 var(--font-display); color: var(--fg-2); max-width: 22ch; }

.project__thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  filter: grayscale(0.35) contrast(1.02);
  transform: scale(1.001);
  transition: opacity 0.7s var(--ease), transform 1.1s var(--ease), filter 0.6s var(--ease);
}
.project__thumb.is-loaded { opacity: 1; }
.project__media:hover .project__thumb,
.project__media:focus-visible .project__thumb { transform: scale(1.04); filter: none; }

.project__veil { position: absolute; inset: 0; background: linear-gradient(to top, rgba(6, 6, 7, 0.72), transparent 45%); }
.project[data-kind="documentario"] .poster { padding-bottom: clamp(52px, 17%, 80px); }
/* VFX: cartaz com grelha de transparência e caixa de composição a tracejado */
.project[data-kind="vfx"] .poster {
  background:
    radial-gradient(90% 120% at 50% 0%, rgba(110, 175, 170, 0.16), transparent 60%),
    conic-gradient(rgba(242, 239, 233, 0.05) 25%, transparent 0 50%, rgba(242, 239, 233, 0.05) 0 75%, transparent 0) 0 0 / 28px 28px,
    linear-gradient(160deg, #1b1b1f, #0e0e10);
}
.project[data-kind="vfx"] .project__media::before {
  content: "";
  position: absolute;
  inset: 12px;
  z-index: 1;
  border: 1px dashed rgba(242, 239, 233, 0.22);
  pointer-events: none;
  transition: inset 0.45s var(--ease), border-color 0.3s;
}
.project[data-kind="vfx"] .project__media:hover::before,
.project[data-kind="vfx"] .project__media:focus-visible::before { inset: 20px; border-color: rgba(110, 175, 170, 0.7); }
.project[data-kind="vfx"] .project__tag { border-left: 2px solid #6eafaa; }
.project__no, .project__tag { z-index: 2; }
.project__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.project__chips li { padding: 6px 10px; border: 1px solid var(--line-2); font: 400 0.682rem/1 var(--font-body); letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-2); }
.project__no, .project__tag {
  position: absolute;
  top: 14px;
  padding: 6px 10px;
  background: rgba(11, 11, 12, 0.7);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font: 700 0.704rem/1 var(--font-body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.project__no { left: 14px; color: var(--accent); }
.project__tag { right: 14px; color: var(--fg); }

.project__play {
  position: absolute;
  left: 50%; top: 50%;
  width: 76px; height: 76px;
  display: grid;
  place-items: center;
  margin: -38px 0 0 -38px;
  border: 1px solid rgba(242, 239, 233, 0.7);
  border-radius: 50%;
  background: rgba(11, 11, 12, 0.35);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: transform 0.45s var(--ease), background-color 0.3s, border-color 0.3s;
}
.project__play svg { margin-left: 3px; }
.project__media:hover .project__play,
.project__media:focus-visible .project__play { transform: scale(1.1); background: var(--accent); border-color: var(--accent); color: var(--bg); }

/* Documentário: legenda em "lower third" */
.project__lower {
  position: absolute;
  left: 0; bottom: 8%;
  max-width: 82%;
  padding: 9px 18px 9px 14px;
  border-left: 3px solid var(--accent);
  background: rgba(11, 11, 12, 0.82);
  font: 400 0.704rem/1.4 var(--font-body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transform: translateX(0);
  transition: transform 0.45s var(--ease);
}
.project__media:hover .project__lower { transform: translateX(8px); }

.project__body { padding-top: clamp(20px, 2.4vw, 32px); }
.project__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 3.6vw, 3.1rem);
  line-height: 1.06;
  letter-spacing: -0.015em;
}
.project__title .suffix { color: var(--fg-3); font-style: normal; }

.credits { margin-top: 20px; border-top: 1px solid var(--line); }
.credits div { display: grid; grid-template-columns: 92px 1fr; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.credits dt { font: 400 0.726rem/1.8 var(--font-body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3); }
.credits dd { font-size: 0.95rem; line-height: 1.55; }

.project__desc { margin-top: 20px; max-width: 58ch; color: var(--fg-2); }
.project__actions { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px 28px; }

.noscript-list { display: grid; gap: 16px; color: var(--fg-2); }
.noscript-list a { color: var(--accent); text-decoration: underline; }

.next {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px 40px;
  margin-top: clamp(64px, 9vw, 128px);
  padding: clamp(28px, 4vw, 48px);
  border: 1px dashed var(--line-2);
}
.next .eyebrow { margin-bottom: 14px; }
.next__text { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.6rem, 3.4vw, 2.8rem); line-height: 1.1; letter-spacing: -0.015em; }

/* Janela de detalhes */
.dialog {
  width: min(1120px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100svh - 24px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line-2);
  background: var(--bg-1);
  color: var(--fg);
  overflow: hidden;
}
.dialog::backdrop { background: rgba(5, 5, 6, 0.86); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.dialog[open] { animation: dialog-in 0.4s var(--ease); }
.dialog[open]::backdrop { animation: fade-in 0.4s var(--ease); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(18px) scale(0.99); } }
@keyframes fade-in { from { opacity: 0; } }

.dialog__panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-height: calc(100svh - 26px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
@media (min-width: 1000px) {
  .dialog__panel { grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr); }
}
.dialog__close {
  position: absolute;
  top: 10px; right: 10px;
  z-index: 5;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  background: rgba(11, 11, 12, 0.8);
  border: 1px solid var(--line-2);
  border-radius: 50%;
  transition: border-color 0.25s, color 0.25s;
}
.dialog__close:hover { border-color: var(--accent); color: var(--accent); }

.dialog__media { align-self: center; min-width: 0; }
.dialog__stage { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.stage__item { position: absolute; inset: 0; margin: 0; }
.stage__item iframe, .stage__item video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.dialog__poster { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 28px; background: linear-gradient(160deg, #1b1b1f, #0e0e10); }
.dialog__thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.5s; }
.dialog__thumb.is-loaded { opacity: 1; }

.dialog__tabs { display: flex; flex-wrap: wrap; gap: 0 22px; padding: 0 clamp(16px, 2vw, 24px); border-bottom: 1px solid var(--line); background: var(--bg-1); }
.dialog__tabs button { min-height: 48px; margin-bottom: -1px; border-bottom: 2px solid transparent; font: 700 0.77rem/1 var(--font-body); letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-3); transition: color 0.25s, border-color 0.25s; }
.dialog__tabs button:hover { color: var(--fg); }
.dialog__tabs button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent); }
.dialog__caption { padding-inline: clamp(16px, 2vw, 24px); }
.dialog__caption:not(:empty) { padding-block: 16px 20px; }
.dialog__note { color: var(--fg-2); font-size: 0.9rem; line-height: 1.5; }
.stepbtns { display: flex; flex-wrap: wrap; gap: 8px; }
.stepbtn { min-height: 40px; padding: 0 14px; border: 1px solid var(--line-2); font: 700 0.726rem/1 var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-2); transition: background-color 0.25s, border-color 0.25s, color 0.25s; }
.stepbtn span { color: var(--fg-3); margin-right: 4px; }
.stepbtn:hover { border-color: var(--accent); color: var(--fg); }
.stepbtn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.stepbtn[aria-pressed="true"] span { color: var(--bg); }

/* Comparação interativa antes / depois */
.compare { --pos: 50%; background: #000; user-select: none; -webkit-user-select: none; }
.compare__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.compare__img--before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare__handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: var(--accent); pointer-events: none; }
.compare__handle svg { position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; padding: 12px; border-radius: 50%; background: var(--accent); color: var(--bg); }
.compare__tag { position: absolute; top: 14px; padding: 6px 10px; background: rgba(11, 11, 12, 0.74); font: 700 0.704rem/1 var(--font-body); letter-spacing: 0.12em; text-transform: uppercase; pointer-events: none; }
.compare__tag--before { left: 14px; color: var(--fg); }
.compare__tag--after { right: 14px; color: var(--accent); }
.compare__range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y; -webkit-appearance: none; appearance: none; }
.compare__range::-webkit-slider-thumb { -webkit-appearance: none; width: 44px; height: 100vh; }
.compare__range::-moz-range-thumb { width: 44px; height: 100vh; border: 0; }
.compare:focus-within { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Breakdown por etapas */
.breakdown { background: #000; }
.breakdown__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.breakdown__cap { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 4px; padding: 36px 18px 14px; background: linear-gradient(to top, rgba(6, 6, 7, 0.88), transparent); }
.breakdown__label { font: 700 0.726rem/1.3 var(--font-body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.breakdown__note { font-size: 0.9rem; line-height: 1.45; }
.breakdown__note:empty { display: none; }

.dialog__info { padding: clamp(24px, 3vw, 40px); display: flex; flex-direction: column; }
.dialog__kind { font: 700 0.748rem/1 var(--font-body); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.dialog__title { font: 700 clamp(1.7rem, 3vw, 2.4rem)/1.1 var(--font-display); letter-spacing: -0.015em; padding-right: 36px; }
.dialog__title .suffix { color: var(--fg-3); font-style: normal; }
.dialog__desc { margin-top: 20px; color: var(--fg-2); font-size: 0.98rem; }
.dialog__actions { margin-top: 28px; }
.dialog__pager { margin-top: auto; padding-top: 28px; display: flex; justify-content: space-between; gap: 12px; }
.dialog__pager button {
  min-height: 44px;
  font: 700 0.77rem/1 var(--font-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-2);
  transition: color 0.25s;
}
.dialog__pager button:hover { color: var(--accent); }
.dialog__pager[hidden] { display: none; }

/* Cartão alternativo quando o leitor do YouTube não pode ser usado */
.yt-fallback {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 12px;
  padding: clamp(20px, 5vw, 56px);
  background: linear-gradient(160deg, #1b1b1f, #0e0e10);
}
.yt-fallback__title { font: 400 clamp(1.1rem, 2.6vw, 1.8rem)/1.2 var(--font-display); color: var(--fg); }
.yt-fallback__text { max-width: 46ch; color: var(--fg-2); font-size: 0.95rem; line-height: 1.5; }
.yt-fallback .btn { margin-top: 6px; }

/* ---------- 8. Competências (timeline) ---------- */
.timeline {
  --label-w: 208px;
  position: relative;
  border: 1px solid var(--line-2);
  background: var(--bg-1);
}
.timeline__ruler {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  height: 40px;
  padding: 10px 14px 0 calc(var(--label-w) + 14px);
  border-bottom: 1px solid var(--line-2);
  font: 400 0.62rem/1 var(--font-mono);
  letter-spacing: 0.12em;
  color: var(--fg-3);
  background:
    repeating-linear-gradient(90deg, rgba(242, 239, 233, 0.34) 0 1px, transparent 1px calc((100% - var(--label-w)) / 4)) var(--label-w) 100% / calc(100% - var(--label-w)) 8px no-repeat,
    repeating-linear-gradient(90deg, rgba(242, 239, 233, 0.16) 0 1px, transparent 1px calc((100% - var(--label-w)) / 24)) var(--label-w) 100% / calc(100% - var(--label-w)) 5px no-repeat;
}
.timeline__playhead {
  position: absolute;
  top: 0; bottom: 0;
  left: var(--label-w);
  width: 1px;
  background: var(--accent);
  z-index: 2;
  opacity: 0;
  pointer-events: none;
}
.timeline__playhead::before {
  content: "";
  position: absolute;
  top: 0; left: -5px;
  border: 5px solid transparent;
  border-top: 8px solid var(--accent);
}
.timeline.is-in .timeline__playhead { animation: sweep 2.6s cubic-bezier(0.5, 0, 0.2, 1) 0.2s forwards; }
@keyframes sweep {
  0% { left: var(--label-w); opacity: 0; }
  8% { opacity: 1; }
  92% { opacity: 1; }
  100% { left: calc(100% - 1px); opacity: 0; }
}

.track { display: grid; grid-template-columns: var(--label-w) minmax(0, 1fr); border-bottom: 1px solid var(--line); }
.track:last-child { border-bottom: 0; }
.track__label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  border-right: 1px solid var(--line-2);
  background: var(--bg-2);
  font: 500 0.95rem/1.3 var(--font-body);
}
.track__id { font: 400 0.68rem/1 var(--font-mono); letter-spacing: 0.22em; color: var(--accent); }
.track__clips { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px; }
.clip {
  flex: calc(var(--w, 1) * 1) 1 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  min-height: 92px;
  padding: 12px 16px 14px;
  border: 1px solid var(--line-2);
  border-left-width: 3px;
  border-radius: 3px;
  font-size: 0.95rem;
  line-height: 1.4;
  transition: transform 0.35s var(--ease), border-color 0.3s, background-color 0.3s;
}
.clip:hover { transform: translateY(-3px); }
.clip__id { font: 400 0.6rem/1 var(--font-mono); letter-spacing: 0.2em; color: var(--fg-3); }
.track--audio .clip { background: rgba(224, 181, 106, 0.1); border-color: rgba(224, 181, 106, 0.38); }
.track--audio .clip:hover { background: rgba(224, 181, 106, 0.18); border-color: var(--accent); }
.track--video .clip { background: rgba(140, 160, 200, 0.09); border-color: rgba(140, 160, 200, 0.36); }
.track--video .clip:hover { background: rgba(140, 160, 200, 0.17); border-color: #9db0d8; }
.track--vfx .clip { position: relative; background: rgba(110, 175, 170, 0.09); border-color: rgba(110, 175, 170, 0.38); }
.track--vfx .clip:hover { background: rgba(110, 175, 170, 0.17); border-color: #6eafaa; }
/* grelha de transparência (canal alfa): referência a composição */
.track--vfx .clip::after { content: ""; position: absolute; top: 10px; right: 10px; width: 24px; height: 16px; opacity: 0.9; background: conic-gradient(rgba(242, 239, 233, 0.16) 25%, transparent 0 50%, rgba(242, 239, 233, 0.16) 0 75%, transparent 0) 0 0 / 8px 8px; }
.track--prod .clip { background: rgba(242, 239, 233, 0.045); border-color: var(--line-2); }
.track--prod .clip:hover { background: rgba(242, 239, 233, 0.09); border-color: var(--fg-2); }

@media (max-width: 759px) {
  .timeline { --label-w: 0px; }
  .timeline__ruler, .timeline__playhead { display: none; }
  .track { grid-template-columns: 1fr; }
  .track__label { flex-direction: row; align-items: center; justify-content: flex-start; gap: 14px; padding: 14px 16px; border-right: 0; border-bottom: 1px solid var(--line-2); }
  .clip { flex-basis: 100%; min-height: 0; }
}

/* ---------- 9. Contacto e rodapé ---------- */
.contact { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(40px, 7vw, 112px); align-items: start; }
.contact__invite { font: 400 clamp(1.25rem, 2.1vw, 1.7rem)/1.4 var(--font-display); color: var(--fg); max-width: 28em; margin-bottom: clamp(32px, 4vw, 56px); }
.contact__mail {
  display: inline-block;
  margin-top: 14px;
  font: 400 clamp(1.1rem, 2.1vw, 1.7rem)/1.3 var(--font-display);
  overflow-wrap: anywhere;
  border-bottom: 1px solid var(--line-2);
  transition: color 0.25s, border-color 0.25s;
}
.contact__mail:hover { color: var(--accent); border-color: var(--accent); }
.contact__actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }

.form { padding: clamp(24px, 3.4vw, 44px); border: 1px solid var(--line-2); background: var(--bg-1); }
.form__title { font: 700 1.6rem/1.2 var(--font-display); margin-bottom: 28px; }
.field { margin-bottom: 22px; }
.field label { display: block; margin-bottom: 8px; font: 400 0.748rem/1 var(--font-body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3); }
.field input, .field textarea {
  display: block;
  width: 100%;
  padding: 12px 0;
  background: transparent;
  color: var(--fg);
  border: 0;
  border-bottom: 1px solid var(--line-2);
  border-radius: 0;
  font: 400 1.0625rem/1.5 var(--font-body);
  transition: border-color 0.25s;
}
.field textarea { resize: vertical; min-height: 150px; }
.field input:hover, .field textarea:hover { border-color: var(--fg-3); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 1px 0 0 var(--accent); }
.field input:focus-visible, .field textarea:focus-visible { outline: none; }
.field.is-invalid input, .field.is-invalid textarea { border-color: var(--error); box-shadow: 0 1px 0 0 var(--error); }
.field__error { min-height: 0; margin-top: 6px; font-size: 0.84rem; line-height: 1.4; color: var(--error); }
.field__error:empty { display: none; }
.field--trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: 30px; }
.form__note { flex: 1 1 220px; font-size: 0.8rem; line-height: 1.5; color: var(--fg-3); }
.form__status { margin-top: 20px; font-size: 0.95rem; line-height: 1.55; }
.form__status:empty { display: none; }
.form__status.is-success { padding: 14px 16px; border-left: 3px solid var(--accent); background: var(--accent-soft); }
.form__status.is-error { padding: 14px 16px; border-left: 3px solid var(--error); background: rgba(255, 138, 143, 0.1); }
.form__status a { text-decoration: underline; color: var(--accent); }
@media (max-width: 899px) {
  .contact { grid-template-columns: 1fr; }
}

.footer { border-top: 1px solid var(--line); padding-block: clamp(56px, 7vw, 96px) 32px; background: var(--bg); }
.footer__top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 3fr) minmax(0, 4fr); gap: 40px; padding-bottom: clamp(40px, 6vw, 72px); }
.footer__name { font: 700 clamp(2rem, 4vw, 3.2rem)/1 var(--font-display); letter-spacing: -0.02em; }
.footer__area { margin-top: 14px; font: 400 0.792rem/1.4 var(--font-body); letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-2); }
.footer__nav { display: flex; flex-direction: column; align-items: flex-start; }
.footer__nav a, .footer__mail a { display: inline-flex; align-items: center; min-height: 40px; color: var(--fg-2); transition: color 0.25s; overflow-wrap: anywhere; }
.footer__nav a:hover, .footer__mail a:hover { color: var(--accent); }
.footer__mail .eyebrow { margin-bottom: 8px; }
.footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding-top: 24px; border-top: 1px solid var(--line); font: 400 0.77rem/1.5 var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-3); }
.footer__bottom a { color: var(--fg-2); min-height: 32px; display: inline-flex; align-items: center; }
.footer__bottom a:hover { color: var(--accent); }
@media (max-width: 899px) {
  .footer__top { grid-template-columns: 1fr; }
}

/* ---------- 10. Animações e movimento reduzido ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--d, 0ms);
}
.js .reveal.is-in { opacity: 1; transform: none; }

.js .timeline .clip { opacity: 0; transform: translateX(-14px); }
.js .timeline.is-in .clip {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease), border-color 0.3s, background-color 0.3s;
  transition-delay: calc(var(--i) * 80ms + 300ms), calc(var(--i) * 80ms + 300ms), 0s, 0s;
}
.js .timeline.is-in .clip:hover { transform: translateY(-3px); transition-delay: 0s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
  .grain { animation: none; }
  .js .reveal, .js .timeline .clip { opacity: 1; transform: none; }
  .hero__name .line > span { transform: none; }
  .hero__roles, .hero__cta { opacity: 1; }
  .timeline__playhead { display: none; }
  .vf__rec { animation: none; }
}

/* Impressão: página limpa */
@media print {
  .grain, .progress, .site-header, .hero__wave, .vf, .dialog { display: none !important; }
  body { background: #fff; color: #000; }
}
