:root {
  --bg: #0b0b0b;
  --fg: #f1f0ec;
  --muted: #8b8a86;
  --line: #222;
  --gap: 6px;
  --pad: clamp(16px, 3vw, 32px);
}

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

html { background: var(--bg); }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Jost", "Futura", "Century Gothic", sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  animation: fadein 1.2s ease both;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ---------- Header ---------- */
.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: clamp(28px, 5vw, 56px) var(--pad) clamp(28px, 4vw, 48px);
}
.nav { display: flex; gap: 22px; font-size: 15px; letter-spacing: .03em; text-transform: uppercase; }
.nav a { color: var(--muted); transition: color .2s; }
.nav a:hover, .nav a.active { color: var(--fg); }
.brand {
  font-size: clamp(22px, 2.6vw, 32px);
  font-weight: 400;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.social { display: flex; gap: 18px; justify-content: flex-end; }
.social a { color: var(--fg); opacity: .85; transition: opacity .2s; }
.social a:hover { opacity: 1; }
.social svg { width: 17px; height: 17px; display: block; }

/* ---------- Work grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  padding: 0 var(--pad);
}
.tile { position: relative; overflow: hidden; aspect-ratio: 16 / 9; background: #151515; }
.tile img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .8s cubic-bezier(.2,.7,.2,1), filter .5s;
}
.tile .label {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; text-align: center;
  font-size: 15px; letter-spacing: .06em; text-transform: uppercase;
  background: rgba(0,0,0,.5);
  opacity: 0; transition: opacity .4s;
}
.tile:hover img, .tile:focus-visible img { transform: scale(1.035); filter: grayscale(.3); }
.tile:hover .label, .tile:focus-visible .label { opacity: 1; }

/* ---------- Project page ---------- */
.project { width: min(1200px, 100%); margin: 0 auto; padding: 0 var(--pad); }
.player { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player img { width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.player .soon {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--fg);
}
.project h1 {
  margin-top: 36px;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 400; letter-spacing: .05em; text-transform: uppercase;
}
.project .meta { margin-top: 8px; color: var(--muted); font-size: 14px; letter-spacing: .08em; text-transform: uppercase; }
.project .desc { margin-top: 28px; max-width: 640px; font-size: 16px; line-height: 1.7; color: #cfcdc8; }
.credits { margin-top: 32px; display: grid; gap: 6px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.credits b { color: var(--fg); font-weight: 400; }
.project-nav {
  margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 16px;
  font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.project-nav a:hover { color: var(--fg); }

/* ---------- About ---------- */
.about {
  width: min(1100px, 100%); margin: 0 auto; padding: 0 var(--pad);
  display: grid; grid-template-columns: 5fr 6fr; gap: clamp(28px, 6vw, 80px); align-items: start;
}
.about img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 40%; }
.about { align-items: center; min-height: calc(100svh - 260px); }
.about h2 { font-size: 13px; font-weight: 400; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin: 40px 0 14px; }
.about h2:first-child { margin-top: 0; }
.about p { font-size: 16px; line-height: 1.75; color: #d6d4cf; margin-bottom: 14px; }
.about .lead { font-size: clamp(22px, 2.5vw, 30px); line-height: 1.35; color: var(--fg); margin-bottom: 26px; }
.jobs { list-style: none; display: grid; gap: 12px; }
.jobs li { display: flex; justify-content: space-between; gap: 16px; font-size: 15px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.jobs span { color: var(--muted); white-space: nowrap; font-size: 14px; }
.contact a { border-bottom: 1px solid #444; transition: border-color .2s; }
.contact a:hover { border-color: var(--fg); }
.contact p { margin-bottom: 6px; }
.contact small { display: block; color: var(--muted); font-size: 12px; letter-spacing: .15em; text-transform: uppercase; margin-top: 18px; margin-bottom: 4px; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: auto; padding: 72px var(--pad) 36px;
  text-align: center; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: #555;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .site-header { grid-template-columns: 1fr auto; row-gap: 18px; }
  .brand { grid-column: 1 / -1; grid-row: 1; text-align: center; }
  .nav { grid-row: 2; gap: 18px; font-size: 13px; }
  .social { grid-row: 2; }
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; gap: 22px; }
  .tile .label {
    position: static; opacity: 1; background: none; justify-content: flex-start;
    padding: 10px 0 0; font-size: 13px; color: var(--muted);
  }
  .tile { aspect-ratio: auto; background: none; }
  .tile img { aspect-ratio: 16 / 9; }
  .about { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  body { animation: none; }
  .tile img { transition: none; }
}

/* =========================================================
   Mistura com o estilo mac-scott: início em ecrã inteiro
   e lista tipográfica de projetos
   ========================================================= */

/* ---------- Início ---------- */
body.home { min-height: 100svh; overflow: hidden; }
.hero { position: fixed; inset: 0; background: #000; }
.hero img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.06);
  transition: opacity 1.6s ease, transform 7s linear;
}
.hero img.on { opacity: .72; transform: scale(1); }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.35) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,0) 55%, rgba(0,0,0,.55) 100%); }

.home-top { position: fixed; top: 0; left: 0; right: 0; padding: clamp(24px, 4vw, 44px) var(--pad); z-index: 2; }
.home-top .brand { display: inline-block; }
.home-top .role { margin-top: 6px; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: rgba(241,240,236,.75); }

.home-links {
  position: fixed; right: var(--pad); top: 50%; transform: translateY(-50%); z-index: 2;
  text-align: right; font-size: clamp(30px, 4.2vw, 56px); line-height: 1.15; letter-spacing: .005em;
}
.home-links a u { border-bottom-width: 2px !important; }
.home-ig {
  position: fixed; right: var(--pad); bottom: clamp(28px, 5vw, 52px); z-index: 2;
  font-size: clamp(15px, 1.4vw, 18px);
}
.home-ig u { text-decoration: none; border-bottom: 1.5px solid currentColor; font-weight: 500; }
.home-ig:hover { opacity: .7; }
.home-links a { display: block; }
.home-links a u { text-decoration: none; border-bottom: 1.5px solid currentColor; font-weight: 500; }
.home-links a:hover { opacity: .7; }
.now-showing {
  position: fixed; left: var(--pad); bottom: clamp(28px, 5vw, 52px); z-index: 2;
  font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: rgba(241,240,236,.6);
  transition: opacity .6s;
}

/* ---------- Lista de projetos ---------- */
.preview { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.preview img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.04); transition: opacity .6s ease, transform 1.2s ease;
}
.preview img.on { opacity: .5; transform: scale(1); }
body.work .site-header, body.work main, body.work .site-footer { position: relative; z-index: 1; }

.list {
  list-style: none;
  min-height: calc(100svh - 260px);
  display: flex; flex-direction: column; justify-content: center; align-items: flex-end;
  padding: 0 var(--pad);
}
.list li { text-align: right; }
.list a {
  display: inline-flex; align-items: baseline; gap: 14px;
  font-size: clamp(26px, 4.4vw, 58px); font-weight: 500; line-height: 1.12;
  letter-spacing: .01em; text-transform: uppercase;
  transition: opacity .35s, color .35s;
}
.list a small {
  font-size: 12px; font-weight: 400; letter-spacing: .16em; color: var(--muted);
  order: -1; transition: color .35s;
}
.list a .thumb { display: none; }
.list:hover a { opacity: .22; }
.list:hover a:hover, .list a:focus-visible { opacity: 1; }
.list a:hover small { color: var(--fg); }

@media (hover: none), (max-width: 640px) {
  .preview { display: none; }
  .list { align-items: stretch; min-height: 0; gap: 34px; padding-top: 8px; }
  .list li { text-align: left; }
  .list a { display: grid; gap: 10px; font-size: clamp(22px, 7vw, 32px); }
  .list a small { order: 2; }
  .list a .thumb { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; order: -2; }
  .list:hover a { opacity: 1; }
}

@media (max-width: 640px) { .now-showing { display: none; } }

/* ---------- Página de projeto, mais limpa ---------- */
.project { padding-top: 2vh; }
.project h1 { margin-top: 28px; font-weight: 500; }

.player { max-height: 78vh; margin: 0 auto; max-width: 100%; }
.player:has(iframe) { width: min(100%, calc(78vh * var(--r, 1.78))); }
