/* Rony Lucas. — portfolio
   Medidas tiradas dos designs a 1920px de largura; --s escala-as em ecrãs mais pequenos. */

@font-face {
  font-family: 'Right Grotesk Spatial';
  src: url('../fonts/PPRightGrotesk-SpatialBlack.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --s: clamp(0.62px, calc(100vw / 1920), 1px);
  --pad: calc(20 * var(--s));
  --ink: #000;
  --paper: #fff;
  --muted: #d4d4d4;
  --line: #3a3a3a;
  --display: 'Right Grotesk Spatial', Arial, sans-serif;
  --body: Arial, Helvetica, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.no-scroll { overflow: hidden; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 15px/1.35 var(--body); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p, ul, dl, dd, figure { margin: 0; }
ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.display { font-family: var(--display); font-weight: 900; letter-spacing: -0.01em; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

/* ---------------- Cabeçalho ---------------- */
.site-header {
  position: relative; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(18 * var(--s)) var(--pad);
}
.logo { font: 900 calc(23 * var(--s))/1 var(--display); text-decoration: none; letter-spacing: -0.01em; }
.site-nav { display: flex; gap: calc(22 * var(--s)); font-size: 15px; }
.site-nav a { text-decoration: none; padding-bottom: 2px; border-bottom: 1px solid transparent; }
.site-nav a[aria-current="page"], .site-nav a:hover { border-bottom-color: currentColor; }
.menu-toggle, .menu-close { display: none; position: relative; width: 44px; height: 44px; }
.menu-toggle span, .menu-close span { position: absolute; left: 50%; top: 50%; width: 40px; height: 2px; background: currentColor; translate: -50% -50%; }
.menu-toggle span:last-child { rotate: 90deg; }
.menu-close span:first-child { rotate: 45deg; width: 38px; }
.menu-close span:last-child { rotate: -45deg; width: 38px; }

.menu { position: fixed; inset: 0; z-index: 50; background: #fff; color: #000; display: flex; flex-direction: column; }
.menu[hidden] { display: none; }
.menu__top { display: flex; align-items: center; justify-content: space-between; padding: 18px var(--pad); }
.menu__top .logo { font-size: 20px; }
.menu .menu-close { display: block; }
.menu nav { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding-bottom: 60px; }
.menu nav a { font-size: 34px; text-decoration: none; }
.menu nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }

/* ---------------- Rodapé ---------------- */
.site-footer {
  display: grid; grid-template-columns: var(--footer-cols, 50% 20.4% 1fr); align-items: start;
  padding: calc(60 * var(--s)) var(--pad) calc(70 * var(--s));
  background: var(--paper); color: var(--ink);
}
.footer__logo { font: 900 calc(64 * var(--s))/1 var(--display); text-decoration: none; letter-spacing: -0.015em; margin-top: calc(-6 * var(--s)); }
.footer__links, .footer__contact { font-size: 15px; line-height: 1.33; }
.footer__links a { text-underline-offset: 2px; }
.footer__contact a { text-decoration: none; }
.footer__contact a:hover, .footer__links a:hover { opacity: .6; }

/* ---------------- Início (fundo preto) ---------------- */
body.dark { color: #fff; }
body.dark .site-header, body.dark main { background: #000; }
body.dark .site-footer { background: #fff; color: #000; }
.about {
  display: grid; grid-template-columns: 50.3% 1fr;
  grid-template-rows: auto auto auto 1fr;
  min-height: calc(708 * var(--s));
  padding: calc(100 * var(--s)) var(--pad) calc(40 * var(--s));
}
.about__label { font: 400 calc(24 * var(--s))/1.2 var(--body); }
.about > .about__label:first-child { grid-column: 1; grid-row: 1; padding-left: calc(78 * var(--s)); padding-top: calc(4 * var(--s)); }
.about__text { grid-column: 2; grid-row: 1 / 3; font-size: calc(14.6 * var(--s)); line-height: 1.33; }
.about__text p + p { margin-top: calc(10 * var(--s)); }
.rings { grid-column: 1; grid-row: 2 / 5; align-self: start; margin: calc(185 * var(--s)) 0 0 calc(66 * var(--s)); width: calc(180 * var(--s)); }
.rings svg { width: 122.4%; margin: -11.2%; overflow: visible; display: block; }
.rings circle, .ring-cursor circle { fill: none; stroke: #fff; }
.rings .dot, .ring-cursor .dot { fill: #fff; stroke: none; }
html.has-ring-cursor .rings { visibility: hidden; }
/* o círculo é o rato: segue-o e inverte as cores por baixo */
.ring-cursor { position: fixed; left: 0; top: 0; z-index: 9999; width: 0; height: 0; pointer-events: none; mix-blend-mode: difference; opacity: 1; transition: opacity .2s; }
.ring-cursor svg { position: absolute; left: 0; top: 0; width: var(--size, 135px); translate: -50% -50%; overflow: visible; }
html.has-ring-cursor, html.has-ring-cursor * { cursor: none !important; }
/* foto: da frase "o chão fosse lava" até um pouco abaixo dos logótipos (posição calculada em pages.js) */
.about { position: relative; }
.about__photo { position: absolute; margin: 0; left: calc(var(--pad) + 78 * var(--s)); top: var(--photo-top, 160px); height: var(--photo-h, 340px);
  aspect-ratio: 852 / 988; max-width: calc(50.3% - var(--pad) - 120 * var(--s)); overflow: hidden; border-radius: calc(14 * var(--s)); background: #c00; }
.about__photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.about:has(.about__photo) .rings { visibility: hidden; }
.about:has(.about__photo) { padding-bottom: calc(110 * var(--s)); }
.about__brands-label { grid-column: 2; grid-row: 3; margin-top: calc(100 * var(--s)); }
.brands { grid-column: 2; grid-row: 4; display: grid; grid-template-columns: 1fr 1fr; gap: calc(12 * var(--s)) calc(10 * var(--s)); align-content: start; margin-top: calc(70 * var(--s)); }
.brands { grid-template-columns: 1fr !important; }
.marquee { --logo: max(40px, calc(66 * var(--s))); height: calc(var(--logo) * 1.6); margin-block: calc(var(--logo) * -0.15); overflow: hidden; mix-blend-mode: screen; -webkit-mask: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.marquee__track { display: flex; width: max-content; height: 100%; animation: marquee var(--speed, 40s) linear infinite; }
.marquee__set { display: flex; align-items: center; height: 100%; gap: calc(80 * var(--s)); padding-right: calc(80 * var(--s)); }
/* os logótipos já vêm brancos e sem fundo (painel → Marcas) */
.marquee__set img { width: auto; max-width: none; opacity: .9; flex: none; }
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(-50%); } to { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { .marquee__track { animation-duration: 160s; } }
.together {
  position: relative; display: block; color: #fff; text-decoration: none; white-space: nowrap;
  line-height: .74; padding: 0 0 0 calc(4 * var(--s)); margin-bottom: -1px; overflow-x: clip;
}
.together > span { display: inline-block; transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
/* ao passar o rato: o texto sobe e aparece um sublinhado fino só por baixo de "WORK TOGETHER".
   Medidas em em (= tamanho da letra): o traço tem 75% da grossura da perna do J (0.225em) e o espaço
   texto→traço é igual ao espaço traço→rodapé. */
.together__u { font-style: normal; position: relative; }
.together__u::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -.105em; height: .225em;
  background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .55s cubic-bezier(.65, 0, .25, 1);
}
.together:hover > span, .together:focus-visible > span { transform: translateY(-.425em); }
.together:hover .together__u::after, .together:focus-visible .together__u::after { transform: scaleX(1); transition-delay: .08s; }
.together:not(:hover) .together__u::after { transform-origin: right; }

/* ---------------- Portfolio ---------------- */
.intro { max-width: calc(1290 * var(--s)); margin: calc(105 * var(--s)) auto 0; text-align: center; font-size: calc(41 * var(--s)); line-height: 1.22; padding: 0 var(--pad); }
.tabs { display: flex; justify-content: space-between; padding: 0 calc(70 * var(--s)) 0 var(--pad); margin-top: calc(232 * var(--s)); }
.tabs button { font: inherit; font-size: calc(46 * var(--s)); line-height: 1.1; color: var(--muted); text-align: left; transition: color .2s; }
.tabs button[aria-selected="true"], .tabs button:hover { color: var(--ink); }
/* barra por baixo do separador ativo (a mesma animação do "trabalhar juntos"):
   a antiga sai para a direita e a nova enche-se da esquerda logo a seguir */
.tabs button { position: relative; }
.tabs button::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -.12em; height: .09em;
  background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .45s cubic-bezier(.65, 0, .25, 1);
}
.tabs button[aria-selected="true"]::after { transform: scaleX(1); transform-origin: left; transition-duration: .55s; transition-delay: .3s; }
/* troca de separador: os projetos desfocam e somem, e os novos entram um a um */
.works { transition: opacity .3s ease, filter .3s ease, translate .3s ease; }
.works.is-out { opacity: 0; filter: blur(10px); translate: 0 calc(20 * var(--s)); }
.works.is-in > * { animation: work-in .7s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 90ms); }
@keyframes work-in { from { opacity: 0; filter: blur(10px); translate: 0 calc(40 * var(--s)); } }
@media (prefers-reduced-motion: reduce) { .works, .works.is-in > * { transition: none; animation: none; } .tabs button::after { transition-duration: 0s; transition-delay: 0s; } }
.works { padding: calc(60 * var(--s)) var(--pad) calc(160 * var(--s)); display: flex; flex-direction: column; gap: calc(115 * var(--s)); }
.work { display: grid; grid-template-columns: calc(1172 * var(--s)) 1fr; gap: calc(90 * var(--s)); align-items: end; }
.work__img { display: block; aspect-ratio: 1172 / 606; overflow: hidden; }
.work__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.work__img:hover img { transform: scale(1.03); }
.work__info h2 { font: 900 calc(38 * var(--s))/1.1 var(--display); margin-bottom: calc(80 * var(--s)); }
.work__info h2 a { text-decoration: none; }
.work__info dl { font-size: calc(15 * var(--s)); line-height: 1.35; }
.work__info dl div + div { margin-top: calc(12 * var(--s)); }
.work__info dt { display: inline; font-weight: 700; }
.work__info dd { display: inline; }
.empty { color: #888; }

/* ---------------- Página do projeto ---------------- */
.feature { display: grid; grid-template-columns: calc(614 * var(--s)) 1fr; gap: calc(99 * var(--s)); padding: calc(57 * var(--s)) var(--pad) 0; }
.feature__eyebrow { color: var(--muted); font-size: 15px; }
.feature__title { font-size: calc(64 * var(--s)); line-height: 1; margin-top: calc(32 * var(--s)); }
.feature__areas { font-size: 13px; margin-top: calc(110 * var(--s)); }
.feature__client { font-size: 13px; margin-top: calc(22 * var(--s)); line-height: 1.6; }
.acc { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: calc(22 * var(--s)); }
.acc__head { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: calc(18 * var(--s)) 0; font-size: 13px; text-align: left; }
.acc__icon { position: relative; width: 12px; height: 12px; }
.acc__icon::before, .acc__icon::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: currentColor; transition: rotate .2s; }
.acc__icon::after { rotate: 90deg; }
.acc.is-open .acc__icon::after { rotate: 0deg; }
.acc__body { font-size: 13px; padding: calc(14 * var(--s)) 0 calc(70 * var(--s)); }
.acc__body p + p { margin-top: calc(18 * var(--s)); }
.acc:not(.is-open) .acc__body { display: none; }
.feature__actions { display: flex; align-items: center; justify-content: space-between; margin-top: calc(108 * var(--s)); }
.social { display: flex; gap: 14px; }
.social svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.social .fill { fill: currentColor; stroke: none; }
.social a:hover { opacity: .6; }
.pill { display: inline-flex; align-items: center; justify-content: center; width: calc(217 * var(--s)); min-width: 150px; height: 40px; border: 1px solid #000; border-radius: 999px; text-decoration: none; font-size: 14px; letter-spacing: .02em; transition: background .2s, color .2s; }
.pill:hover { background: #000; color: #fff; }
.feature__video { padding-top: calc(65 * var(--s)); }

.video { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.video > img { width: 100%; height: 100%; object-fit: cover; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video__play { position: absolute; inset: 0; display: grid; place-items: center; }
.video__play::before { content: ""; width: calc(64 * var(--s)); min-width: 40px; aspect-ratio: 1; border-radius: 50%; background: rgba(0, 0, 0, .35) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M8 5v14l11-7z'/%3E%3C/svg%3E") center / 55% no-repeat; transition: transform .2s, background-color .2s; }
.video:hover .video__play::before { transform: scale(1.08); background-color: rgba(0, 0, 0, .55); }
.video--soon .video__play { cursor: default; }
/* estas imagens já trazem o botão do YouTube */
.video--baked .video__play::before { opacity: 0; }
.video__bar { position: absolute; left: 16px; right: 16px; bottom: 14px; color: #fff; font-size: 11px; pointer-events: none; }
.video__bar i { display: block; height: 3px; margin-top: 8px; background: rgba(255, 255, 255, .55); border-radius: 2px; }

.reel { margin-top: calc(209 * var(--s)); }
.reel + .reel { margin-top: calc(112 * var(--s)); }
.reel__title { display: inline-block; margin-left: var(--pad); font-size: calc(64 * var(--s)); line-height: 1; padding-bottom: calc(6 * var(--s)); border-bottom: 1px solid #000; }
.reel__title a { text-decoration: none; }
.reel__link { display: table; margin: calc(8 * var(--s)) 0 0 var(--pad); color: var(--muted); font-size: 13px; text-underline-offset: 2px; }
.reel__link:hover { color: #000; }
.strip { margin-top: calc(18 * var(--s)); overflow: hidden; touch-action: pan-y; cursor: grab; }
.strip__track { display: flex; height: calc(373 * var(--s)); transition: transform .6s cubic-bezier(.3, .7, .2, 1); will-change: transform; }
.strip__track img { height: 100%; width: auto; max-width: none; flex: none; user-select: none; -webkit-user-drag: none; }
.arrows { display: flex; gap: 18px; padding: calc(28 * var(--s)) var(--pad) 0 calc(26 * var(--s)); font-size: 22px; }
.arrows button { padding: 2px 4px; transition: transform .15s; }
.arrows button:hover { transform: translateX(var(--nudge, 3px)); }
.arrows button:first-child { --nudge: -3px; }
body[data-page="projeto"] .site-footer { margin-top: calc(110 * var(--s)); }

/* ---------------- Ver projeto ---------------- */
.case { max-width: calc(1408 * var(--s) + 2 * var(--pad)); margin: 0 auto; padding: calc(58 * var(--s)) var(--pad) 0; }
.case__title { font-size: calc(64 * var(--s)); line-height: 1; padding-bottom: calc(40 * var(--s)); border-bottom: 1px solid var(--line); }
.case__section { padding: calc(40 * var(--s)) 0 calc(36 * var(--s)); }
.case__section h2 { font-size: max(18px, calc(22 * var(--s))); font-weight: 700; }
.case__section p, .case__section ul { font-size: 15px; line-height: 1.45; margin-top: calc(16 * var(--s)); }
.case__section.has-rule { border-bottom: 1px solid var(--line); margin-bottom: calc(20 * var(--s)); }
.case__section.has-rule:first-of-type { padding-bottom: calc(80 * var(--s)); }
.case__section:not(.has-rule) { padding-top: calc(80 * var(--s)); }
.case__media { display: flex; flex-direction: column; gap: calc(11 * var(--s)); }
.case__row { display: flex; gap: calc(11 * var(--s)); }
.cell { position: relative; min-width: 0; overflow: hidden; background: #f2f2f2; }
.cell > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cell--video { background: #000; }
.cell--empty { background: none; }
.cell .video { position: absolute; inset: 0; aspect-ratio: auto; }
/* medidas do design */
.case__row--custom { aspect-ratio: 1408 / var(--h); }
.case__row--custom .cell { flex: var(--w) 1 0; }
/* formato fixo (reel, 4:5, quadrado, 16:9) com 1 a 4 colunas */
.case__row--grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); }
.case__row--grid .cell { aspect-ratio: var(--ar); }
/* proporção original de cada imagem, todas à mesma altura */
.case__row--original { align-items: flex-start; }
.case__row--original .cell { flex: var(--r) 1 0; aspect-ratio: var(--r); }
.more { display: inline-block; margin: calc(170 * var(--s)) 0 0 var(--pad); font-size: calc(38 * var(--s)); color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--muted); }
.more:hover { color: #000; border-color: #000; }
body[data-page="ver-projeto"] .site-footer { margin-top: calc(120 * var(--s)); }

/* ---------------- Contacto ---------------- */
.contact { display: grid; grid-template-columns: 50.3% 1fr; padding: calc(68 * var(--s)) var(--pad) calc(150 * var(--s)); }
.contact__title { font-size: calc(84 * var(--s)); line-height: .95; max-width: 6em; }
.contact__form { display: flex; flex-direction: column; gap: calc(24 * var(--s)); padding-top: calc(8 * var(--s)); }
.field { border: 0; margin: 0; padding: 0; min-width: 0; display: block; }
.field legend, .field__label { display: block; font-size: 15px; margin-bottom: 8px; padding: 0; }
.field small { color: #666; font-size: 12px; margin-left: 4px; }
.field__two { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.contact input, .contact textarea {
  width: 100%; height: 46px; border: 1px solid #b7b7b7; background: #fafafa; border-radius: 0;
  padding: 0 12px; font: 15px var(--body); color: #000; outline: none;
}
.contact textarea { height: 100px; padding: 10px 12px; resize: vertical; }
.contact input:focus, .contact textarea:focus { border-color: #000; background: #fff; }
.contact .is-invalid { border-color: #c62828; }
.send { align-self: flex-start; width: 122px; height: 65px; border-radius: 999px; background: #000; color: #fff; font-size: 16px; letter-spacing: .02em; font-stretch: condensed; transition: transform .15s, opacity .15s; }
.send:hover { opacity: .85; }
.send:active { transform: scale(.97); }
.form-msg { font-size: 14px; }

/* ---------------- Telemóvel ---------------- */
@media (max-width: 760px) {
  :root { --pad: 20px; }
  .site-nav { display: none; }
  .menu-toggle { display: block; margin-right: -6px; }
  .site-header { padding: 18px var(--pad); }
  .logo { font-size: 20px; }

  .site-footer { grid-template-columns: 1fr; gap: 40px; padding: 30px var(--pad) 40px; }
  .footer__logo { font-size: 44px; margin: 0 0 30px; }
  .footer__links, .footer__contact { font-size: 17px; }

  .about { display: block; padding: 70px var(--pad) 70px; position: relative; }
  .about > .about__label:first-child { padding: 0; }
  .about__label { font-size: 22px; }
  .rings { position: absolute; right: 22%; top: 46px; width: 130px; margin: 0; }
  .about:has(.about__photo) .rings { visibility: visible; }
  .about__photo { position: static; width: 100%; height: auto; max-width: none; aspect-ratio: 852 / 988; margin-top: 50px; border-radius: 10px; }
  .about__text { font-size: 17px; line-height: 1.4; margin-top: 40px; }
  .about__brands-label { margin-top: 90px; }
  .brands { grid-template-columns: 1fr; gap: 42px; margin-top: 60px; }
  .marquee { --logo: 44px; }
  .together { padding: 0 var(--pad); line-height: .8; }

  .intro { font-size: 22px; line-height: 1.12; margin-top: 50px; }
  .tabs { flex-direction: column; gap: 14px; margin-top: 70px; padding: 0 var(--pad); }
  .tabs button { font-size: 22px; }
  .works { padding-top: 50px; gap: 90px; }
  .work { grid-template-columns: 1fr; gap: 10px; }
  .work__info h2 { font-size: 24px; margin-bottom: 26px; }
  .work__info dl { font-size: 13px; }

  .feature { grid-template-columns: 1fr; gap: 0; padding-top: 16px; }
  .feature__info { display: contents; }
  .feature__eyebrow { order: 1; }
  .feature__title { order: 2; font-size: 40px; margin-top: 12px; }
  .feature__video { order: 3; padding-top: 18px; }
  .feature__areas { order: 4; margin-top: 42px; }
  .feature__client { order: 5; }
  .acc { order: 6; }
  .acc__body { padding-bottom: 40px; }
  .feature__actions { order: 7; flex-direction: column; align-items: flex-start; gap: 46px; margin-top: 24px; }
  .pill { width: 132px; height: 46px; }
  .reel { margin-top: 60px; }
  .reel + .reel { margin-top: 50px; }
  .reel__title { font-size: 40px; }
  .strip__track { height: 72vw; }
  .strip__track img { width: 100vw; object-fit: cover; }

  .case { padding-top: 20px; }
  .case__title { font-size: 40px; padding-bottom: 20px; }
  .case__section p, .case__section ul { font-size: 14px; }
  .case__media, .case__row { gap: 6px; }
  .case__row--grid[data-cols="4"], .case__row--grid[data-cols="3"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .more { font-size: 26px; margin-top: 90px; }

  .contact { grid-template-columns: 1fr; gap: 20px; padding-top: 30px; }
  .contact__title { font-size: 66px; }
  .field legend, .field__label { font-size: 19px; }
  .field small { font-size: 18px; }
  .contact input { height: 56px; }
  .contact textarea { height: 120px; }
  .send { width: 150px; height: 82px; font-size: 20px; }
}

/* ---------- Partículas (página inicial) ---------- */
/* passam por cima do conteúdo (foto incluída) e invertem a cor por baixo, como o rato;
   o preto do canvas não muda nada. O rodapé branco fica por cima delas. */
.particles { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; mix-blend-mode: difference; }
html.has-particles body.dark { display: flex; flex-direction: column; min-height: 100vh; background: #000; }
html.has-particles body.dark .site-header,
html.has-particles body.dark main { background: transparent; }
html.has-particles body.dark .site-footer { position: relative; z-index: 3; }

/* ---------- Reels e animações (vídeos próprios) ---------- */
.video--clip { background: #000; }
.video--clip video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
/* botões do vídeo: play/pausa, som, ecrã inteiro */
.video__ctrls { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 8px; z-index: 2; }
.video__btn {
  width: 34px; height: 34px; border-radius: 50%; background: rgba(0, 0, 0, .55) center / 18px no-repeat;
  transition: background-color .2s, transform .2s, opacity .2s;
}
.video__btn:hover { background-color: rgba(0, 0, 0, .8); transform: scale(1.08); }
.video__toggle { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E"); }
.video__toggle[aria-pressed="true"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Crect x='6' y='5' width='4' height='14' rx='1'/%3E%3Crect x='14' y='5' width='4' height='14' rx='1'/%3E%3C/svg%3E"); }
.video__full { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5'/%3E%3C/svg%3E"); }
:fullscreen .video__full, :-webkit-full-screen .video__full, .is-zoomed .video__full { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M9 4v5H4M15 4v5h5M9 20v-5H4M15 20v-5h5'/%3E%3C/svg%3E"); }
/* em ecrã inteiro: mostra tudo, sem cortar */
.video:fullscreen, .cell:fullscreen { background: #000; }
.video:-webkit-full-screen, .cell:-webkit-full-screen { background: #000; }
.video:fullscreen video, .cell:fullscreen > img { object-fit: contain; }
.video:-webkit-full-screen video, .cell:-webkit-full-screen > img { object-fit: contain; }
.is-zoomed { position: fixed !important; inset: 0 !important; z-index: 10000; background: #000 !important; aspect-ratio: auto !important; }
.is-zoomed video, .is-zoomed > img { object-fit: contain !important; }
.video__sound {
  background: rgba(0, 0, 0, .55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M11 5 6 9H3v6h3l5 4z' fill='white'/%3E%3Cpath d='m17 9 5 6m0-6-5 6'/%3E%3C/svg%3E") center / 18px no-repeat;
  transition: background-color .2s, transform .2s;
}
.video__sound[aria-pressed="true"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M11 5 6 9H3v6h3l5 4z' fill='white'/%3E%3Cpath d='M15.5 8.5a5 5 0 0 1 0 7M18.5 5.5a9 9 0 0 1 0 13'/%3E%3C/svg%3E"); }
.video__sound:hover { background-color: rgba(0, 0, 0, .8); transform: scale(1.08); }
.feature__video .video--clip { aspect-ratio: var(--ratio, 16 / 9); width: min(100%, calc(78vh * var(--ratio, 1.7778))); margin-inline: auto; }

/* vídeos do "ver projeto": parados até a pessoa carregar; clicar no vídeo = play/pausa */
.video--clip { cursor: pointer; }
.video__bigplay { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 1; opacity: 0; transition: opacity .25s; }
.video__bigplay::before { content: ""; width: calc(72 * var(--s)); min-width: 46px; aspect-ratio: 1; border-radius: 50%; background: rgba(0, 0, 0, .45) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E") 58% 50% / 45% no-repeat; }
.video--clip.is-paused .video__bigplay { opacity: 1; }

/* fotos do "ver projeto": clica para ampliar */
img[data-zoom] { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 9990; background: rgba(10, 10, 10, 0); cursor: zoom-out; transition: background-color .45s ease; }
.lightbox.is-open { background: rgba(10, 10, 10, .82); }
.lightbox img { position: fixed; object-fit: cover; cursor: default; box-shadow: 0 20px 80px rgba(0, 0, 0, .4);
  transition: left .5s cubic-bezier(.2, .8, .2, 1), top .5s cubic-bezier(.2, .8, .2, 1), width .5s cubic-bezier(.2, .8, .2, 1), height .5s cubic-bezier(.2, .8, .2, 1); }
html.has-lightbox { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .lightbox, .lightbox img { transition-duration: .01s; } }

/* ---------- Como trabalho (início): MacBook abre e o painel de cor ganha cor com o scroll ---------- */
.flow { position: relative; height: 480vh; }
.flow__sticky { position: sticky; top: 0; height: 100vh; height: 100svh; display: grid; grid-template-columns: 42% 1fr; align-items: center;
  gap: calc(40 * var(--s)); padding: 0 var(--pad); overflow: hidden; }
.flow__label { margin-bottom: calc(46 * var(--s)); padding-left: calc(78 * var(--s)); }
.flow__steps { list-style: none; margin: 0; padding: 0 0 0 calc(78 * var(--s)); }
.flow__title { display: flex; align-items: flex-start; gap: calc(14 * var(--s)); margin: 0; font: 900 max(26px, calc(58 * var(--s)))/.98 var(--display);
  letter-spacing: -0.01em; color: color-mix(in srgb, color-mix(in srgb, #fff calc(var(--in, 0) * 100%), #2e2e2e), #7a7a7a calc(var(--out, 0) * 100%)); }
.flow__num { font: 400 calc(14 * var(--s))/1 var(--body); padding-top: .55em; min-width: 2.2em; letter-spacing: 0; }
.flow__text { margin: 0; max-height: 0; overflow: hidden; opacity: 0; padding-left: calc(14 * var(--s) + 2.2 * calc(14 * var(--s)));
  font-size: max(14px, calc(14.6 * var(--s))); line-height: 1.38; max-width: 36em;
  /* abre e aparece em gradiente com o scroll (--vis vem de pages.js) */
  --th: 7.2em; height: calc(var(--vis, 0) * var(--th)); max-height: none; opacity: var(--vis, 0); margin: calc(var(--vis, 0) * 10 * var(--s)) 0 calc(var(--vis, 0) * 20 * var(--s));
  transform: translateY(calc((1 - var(--vis, 0)) * 8px)); }
.flow__time { display: block; opacity: .55; margin-bottom: 2px; }
/* guarda o lugar de um texto aberto quando nenhum está (antes da 1.ª fase): assim o bloco centrado não salta */
.flow__steps::after { content: ''; display: block; font-size: max(14px, calc(14.6 * var(--s))); height: calc(var(--rest, 1) * (7.2em + 30 * var(--s))); }
.flow__intro { margin: calc(44 * var(--s)) 0 0; padding-left: calc(78 * var(--s)); max-width: 32em; font-size: max(13px, calc(14.6 * var(--s))); opacity: .55; }
.flow__stage { height: 100%; display: grid; place-items: center; }
/* o texto fica preso ao topo (não se centra de novo quando um texto abre, nem deixa um vazio grande por cima) */
.flow__copy { align-self: center; padding-top: 0; }

/* MacBook em CSS 3D */
.mac { --open: 0; width: min(86%, 98vh); perspective: 2600px; perspective-origin: 50% -20%; }
.mac__rig { position: relative; aspect-ratio: 16 / 10.4; transform-style: preserve-3d;
  transform: translateY(calc(-16% - (1 - var(--open)) * 26%)) rotateX(calc(-10deg - (1 - var(--open)) * 52deg)) scale(calc(.9 + var(--open) * .1)); }
.mac__lid { position: absolute; inset: 0; transform-origin: 50% 100%; transform-style: preserve-3d; transform: rotateX(calc(-88deg + var(--open) * 88deg)); }
.mac__screen, .mac__back { position: absolute; inset: 0; border-radius: 2.6% / 4%; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.mac__screen { background: #0b0b0c; padding: 2% 2% 3.2%; box-shadow: inset 0 0 0 1px #2c2c2f, 0 0 0 1px #6a6b70; }
.mac__back { transform: rotateY(180deg); background: linear-gradient(160deg, #e3e4e7, #b8babf 60%, #a9abb0); box-shadow: inset 0 0 0 1px rgba(255,255,255,.5); }
.mac__deck { position: absolute; left: -1.5%; right: -1.5%; top: 100%; height: 100%; transform-origin: 50% 0; transform: rotateX(90deg);
  border-radius: 0 0 3% 3% / 0 0 4% 4%; background: linear-gradient(#cfd1d5, #b4b6bb); box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); }
.mac__keys { position: absolute; left: 10%; right: 10%; top: 7%; height: 44%; border-radius: 1.2%;
  background: repeating-linear-gradient(90deg, transparent 0 5.6%, #9c9ea3 5.6% 6.2%), repeating-linear-gradient(#26272a 0 15%, #9c9ea3 15% 16.6%); opacity: .9; }
.mac__pad { position: absolute; left: 31%; right: 31%; top: 58%; height: 34%; border-radius: 3%; background: #bfc1c5; box-shadow: inset 0 0 0 1px #a4a6ab; }

/* painel tipo "rodas de cor" */
.dv { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 3px; background: #1a1a1c; container-type: size;
  display: grid; grid-template-rows: 40% minmax(0, 1fr); color: #b9b9be; font: 400 min(1.05cqw, 1.75cqh)/1.15 var(--body);
  opacity: clamp(0, calc(var(--open) * 2.2 - 1.2), 1); }
.dv__viewer { position: relative; overflow: hidden; background: #000; }
.dv__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dv__img--raw { filter: grayscale(1) contrast(.9) brightness(1.05); }
.dv__img--graded { opacity: var(--g, 0); }
.dv__split { position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: #fff; opacity: .7; }
.dv__panel { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 2cqh; padding: 2cqh 2cqw 2.4cqh; min-height: 0; background: #232326; border-top: 1px solid #333; }
.dv__head { display: flex; align-items: center; gap: 1cqw; color: #ececef; font-weight: 700; padding-bottom: .9cqh; border-bottom: 1px solid #333; }
.dv__head i { width: 1.3cqw; height: 1.3cqw; border-radius: 50%; border: 1px solid #555; }
.dv__head i:first-of-type { margin-left: auto; }
.dv__row { display: flex; justify-content: space-between; align-items: center; gap: .8cqw; white-space: nowrap; min-width: 0; }
.dv__f { display: flex; align-items: center; gap: .6cqw; }
.dv__f b, .dvw__nums b { font-weight: 500; color: #e9e9ec; background: #141416; padding: .25cqh .45cqw; border-bottom: .3cqh solid color-mix(in srgb, var(--c, #ddd) calc(var(--f, 0) * 100%), #48484c);
  font-variant-numeric: tabular-nums; min-width: 3.2cqw; text-align: center; }
.dv__wheels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.6cqw; align-items: center; min-height: 0; }
.dvw { display: grid; justify-items: center; gap: 1.6cqh; min-width: 0; }
.dvw__label { color: #ececef; }
.dvw__wheel { position: relative; width: min(72%, 27cqh); aspect-ratio: 1; border-radius: 50%; background: conic-gradient(#5d5d61, #7d7d81, #5d5d61, #6f6f73, #5d5d61); }
.dvw__hue { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 90deg, #f2213a, #ff2bd6, #3b3bff, #1fd7ff, #23e05a, #ffe12b, #f2213a);
  -webkit-mask: conic-gradient(#000 calc(var(--f, 0) * 360deg), transparent 0); mask: conic-gradient(#000 calc(var(--f, 0) * 360deg), transparent 0); }
.dvw__inner { position: absolute; inset: 7%; border-radius: 50%; overflow: hidden; background: radial-gradient(circle, #3b3b3f, #1c1c1f 72%); }
.dvw__inner::after { content: ''; position: absolute; inset: 0; border-radius: 50%; opacity: calc(var(--f, 0) * .5);
  background: conic-gradient(from 90deg, #f2213a, #ff2bd6, #3b3bff, #1fd7ff, #23e05a, #ffe12b, #f2213a);
  -webkit-mask: radial-gradient(circle, transparent 10%, #000 100%); mask: radial-gradient(circle, transparent 10%, #000 100%); }
.dvw__inner::before { content: ''; position: absolute; inset: 0; z-index: 1; opacity: .35;
  background: linear-gradient(#aaa, #aaa) center / 1px 100% no-repeat, linear-gradient(#aaa, #aaa) center / 100% 1px no-repeat; }
.dvw__dot { position: absolute; left: 50%; top: 50%; width: 5%; aspect-ratio: 1; border-radius: 50%; background: #fff; z-index: 2;
  transform: translate(-50%, -50%) translate(calc(var(--dx, 0) * var(--f, 0) * 1000%), calc(var(--dy, 0) * var(--f, 0) * 1000%)); }
.dvw__nums { display: flex; gap: .3cqw; font-size: .9em; }
.dvw__nums b { min-width: 0; padding-inline: .3cqw; }
.dvw__jog { width: 74%; height: 1.4cqh; border-radius: 1cqh; background: repeating-linear-gradient(90deg, #5a5a5e 0 1px, #2a2a2d 1px 4px); }
.c-y { --c: #e6e6e6; } .c-r { --c: #ff4747; } .c-g { --c: #2fd468; } .c-b { --c: #4b8cff; }

@media (max-width: 760px) {
  .flow { height: 440vh; }
  .flow__sticky { grid-template-columns: 1fr; grid-template-rows: auto 1fr; align-items: start; gap: 18px; padding: 70px var(--pad) 24px; }
  .flow__label, .flow__steps, .flow__intro { padding-left: 0; }
  .flow__label { margin-bottom: 22px; font-size: 22px; }
  .flow__title { font-size: 24px; gap: 10px; }
  .flow__num { font-size: 12px; padding-top: .45em; min-width: 1.8em; }
  .flow__text { padding-left: 32px; font-size: 15px; }
  .flow__intro { display: none; }
  .flow__stage { place-items: start center; padding-top: 6vh; }
  .mac { width: 100%; }
}

/* MacBook 3D (js/mac3d.js): quando carrega, substitui o desenho em CSS */
.mac.mac--3d { width: 100%; height: 100%; perspective: none; }
.mac--3d .mac__rig { display: none; }
.mac__gl { display: block; width: 100%; height: 100%; }
/* a luz vermelha em si: um brilho suave atrás do portátil, vindo do topo direito */
.mac--3d { background: radial-gradient(ellipse 55% 45% at 72% 30%, rgba(200, 18, 15, .22), transparent 70%); }
@media (max-width: 760px) { .mac.mac--3d { height: 100%; } }


/* ---------- Site todo a preto (todas as páginas usam body.dark) ---------- */
body.dark { --ink: #fff; --paper: #000; --muted: #5a5a5a; background: #000; }
body.dark .empty { color: #777; }
body.dark .pill { border-color: #fff; }
body.dark .pill:hover { background: #fff; color: #000; }
body.dark .reel__title { border-bottom-color: #fff; }
body.dark .reel__link:hover, body.dark .more:hover { color: #fff; border-color: #fff; }
body.dark .cell { background: #111; }
body.dark .cell--empty { background: none; }
body.dark .field small { color: #888; }
body.dark .contact input, body.dark .contact textarea { background: #0e0e0e; border-color: #3a3a3a; color: #fff; }
body.dark .contact input:focus, body.dark .contact textarea:focus { border-color: #fff; background: #000; }
body.dark .send { background: #fff; color: #000; }

/* ---------- Como trabalho: as fases entram e saem com foco/desfoque (como os projetos no portfólio) ---------- */
.flow__title { filter: blur(calc((1 - var(--in, 0) + var(--out, 0)) * 2.5px)); }
.flow__text { filter: blur(calc((1 - var(--vis, 0)) * 10px)); }

/* Tablet (ecrã tátil, mais largo que um telemóvel): fases e portátil no mesmo ecrã, uma fase de cada vez */
@media (max-width: 760px), (min-width: 761px) and (hover: none), (min-width: 761px) and (pointer: coarse) {
  .flow { height: 480vh; }
  .flow__sticky { grid-template-columns: 1fr; grid-template-rows: auto 1fr; align-items: start; gap: 10px; padding: 56px var(--pad) 24px; }
  .flow__copy { padding-top: 0; align-self: start; }
  .flow__steps::after { display: none; }
  .flow__label, .flow__steps, .flow__intro { padding-left: 0; }
  .flow__label { margin-bottom: 22px; }
  .flow__intro { display: none; }
  .flow__steps { display: grid; }
  .flow__step { grid-area: 1 / 1; opacity: var(--vis, 0); filter: blur(calc((1 - var(--vis, 0)) * 14px));
    transform: translateY(calc((1 - var(--vis, 0)) * 14px)); }
  .flow__title { color: #fff; filter: none; font-size: 44px; }
  .flow__text { height: auto; max-height: none; opacity: 1; filter: none; transform: none; margin: 12px 0 0; font-size: 17px; }
  .flow__stage { height: 100%; min-height: 0; }
  .mac, .mac.mac--3d { width: 100%; height: 100%; }
  .rings, .about:has(.about__photo) .rings { display: none; }
}
@media (max-width: 760px) {
  .flow { height: 440vh; }
  .flow__sticky { padding: 64px var(--pad) 16px; }
  .flow__title { font-size: 30px; }
  .flow__text { font-size: 15px; }
}

/* Frase grande do fim: em tablet e telemóvel, "FALA COMIGO" (mais curta, por isso em letra maior) */
.together > .together__short { display: none; }
@media (max-width: 760px), (min-width: 761px) and (hover: none), (min-width: 761px) and (pointer: coarse) {
  .together > .together__long { display: none; }
  .together > .together__short { display: inline-block; }
}

/* Telemóvel: "FALA COMIGO" fica no fundo do ecrã do "como trabalho" (e não repetido por baixo) */
.together--flow { display: none; }
@media (max-width: 760px) {
  .flow__sticky { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
  .together--flow { display: block; min-width: 0; overflow: hidden; margin: 0 calc(-1 * var(--pad)) -16px; }
  .together--flow > .together__short { display: inline-block; }
  main > .together { display: none; }
}

/* ---------- Tablet e telemóvel: menu, contacto e rodapé ---------- */
body.dark .menu { background: #000; color: #fff; }
.menu nav a { font: 900 40px/1 var(--display); letter-spacing: -0.01em; text-transform: uppercase; }
@media (max-width: 760px), (hover: none), (pointer: coarse) {
  .site-nav { display: none; }
  .menu-toggle { display: block; margin-right: -6px; }
  .site-footer { grid-template-columns: 1fr; gap: 32px; padding: 34px var(--pad) 40px; }
  .footer__logo { font-size: 48px; margin: 0 0 8px; }
  .footer__links, .footer__contact { font-size: 17px; }
}
@media (max-width: 1024px), (hover: none), (pointer: coarse) {
  .contact { display: block; padding: 40px var(--pad) 70px; }
  .contact__title { font-size: clamp(54px, 11vw, 96px); max-width: none; margin-bottom: 36px; }
  .contact__form { gap: 22px; padding-top: 0; max-width: 720px; }
  .field legend, .field__label { font-size: 16px; margin-bottom: 8px; }
  .field small { font-size: 14px; }
  .field__two { grid-template-columns: 1fr 1fr; gap: 12px; }
  .contact input { height: 54px; font-size: 16px; }
  .contact textarea { height: 150px; font-size: 16px; }
  .send { width: 200px; height: 62px; font-size: 18px; }
}
@media (max-width: 560px) {
  .field__two { grid-template-columns: 1fr; gap: 22px; }
  .send { width: 100%; }
}

/* PC: o "sobre mim" ocupa o ecrã (abaixo do cabeçalho) com o conteúdo centrado; o "como trabalho" só aparece com o scroll */
@media (min-width: 761px) and (hover: hover) and (pointer: fine) {
  .about, .about:has(.about__photo) {
    min-height: calc(100vh - 50px); min-height: calc(100svh - 50px);
    grid-template-rows: auto auto auto auto; align-content: center;
    padding-top: calc(40 * var(--s)); padding-bottom: calc(80 * var(--s));
  }
  .brands { min-height: calc(194 * var(--s)); }   /* mantém o tamanho da foto como estava */
}

/* Rodapé igual em todas as páginas e sempre encostado ao fundo (sem faixa preta por baixo nas páginas curtas) */
body.dark { display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; }
body.dark > main { flex: 1 0 auto; }
body.dark > .site-footer { flex: none; }

/* Formulário: só um traço por baixo (como o das tabs do portfólio). Ao clicar não muda nada, só aparece o cursor. */
.contact input, .contact textarea,
body.dark .contact input, body.dark .contact textarea,
body.dark .contact input:focus, body.dark .contact textarea:focus {
  background: transparent; border: 0; border-bottom: 2px solid #fff; border-radius: 0;
  padding: 6px 0; outline: none; box-shadow: none; color: #fff; caret-color: #fff;
}
.contact input { height: 44px; }
.contact textarea { height: 96px; resize: none; padding-top: 8px; }
.contact .is-invalid, body.dark .contact .is-invalid { border-bottom-color: #e5484d; }
.contact input:-webkit-autofill { -webkit-text-fill-color: #fff; -webkit-box-shadow: 0 0 0 1000px #000 inset; transition: background-color 9999s; }
@media (max-width: 1024px), (hover: none), (pointer: coarse) {
  .contact input { height: 48px; font-size: 16px; }
  .contact textarea { height: 110px; font-size: 16px; }
}
@media (max-width: 760px) {
  /* a área do portátil vai de ponta a ponta do ecrã (o portátil deixa de ser cortado pela margem lateral) */
  .flow__stage { margin-inline: calc(-1 * var(--pad)); width: calc(100% + 2 * var(--pad)); }
}
