/* Portfolio Rui Alexandre — preto e branco, tipografia forte */
:root {
  --bg: #000; --fg: #fff; --muted: #8c8c8c; --line: #262626; --soft: #111;
  --pad: clamp(18px, 4vw, 56px);
  --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.2, .7, .1, 1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
::selection { background: #fff; color: #000; }

/* ---------- Cabeçalho ---------- */
.hdr { position: fixed; inset: 0 0 auto; z-index: 50; height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 var(--pad);
  transition: background .3s, height .3s, border-color .3s; border-bottom: 1px solid transparent; }
.hdr.solid { background: rgba(0,0,0,.86); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); height: 64px; border-bottom-color: var(--line); }
.hdr-logo img { height: 34px; width: auto; transition: height .3s; }
.hdr.solid .hdr-logo img { height: 30px; }
.hdr-nav { display: flex; align-items: center; gap: 34px; font-size: 14px; font-weight: 500; }
.hdr-nav a { position: relative; padding: 6px 0; }
.hdr-nav a::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: #fff; transform: scaleX(0); transform-origin: right; transition: transform .35s var(--ease); }
.hdr-nav a:hover::after { transform: scaleX(1); transform-origin: left; }
.lang { border: 1.5px solid #fff; background: none; border-radius: 999px; height: 34px; padding: 0 4px; display: inline-flex; align-items: center; cursor: pointer; font-size: 12px; font-weight: 700; }
.lang span { padding: 4px 9px; border-radius: 999px; transition: background .2s, color .2s; }
.lang span.on { background: #fff; color: #000; }
.burger { display: none; width: 44px; height: 44px; border: 0; background: none; position: relative; cursor: pointer; }
.burger i { position: absolute; left: 10px; right: 10px; height: 2px; background: #fff; transition: transform .3s var(--ease); }
.burger i:first-child { top: 17px; } .burger i:last-child { top: 25px; }
.burger[aria-expanded="true"] i:first-child { transform: translateY(4px) rotate(45deg); }
.burger[aria-expanded="true"] i:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ---------- Herói ---------- */
.hero { min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; padding: 120px var(--pad) 48px; position: relative; overflow: hidden; }
.hero-mark { position: absolute; right: -6vw; top: 50%; transform: translateY(-55%); width: min(62vw, 820px); opacity: .07; pointer-events: none; }
.hero h1, .hero-foot { position: relative; z-index: 1; }
/* Símbolo em vetor com luz a passar por trás (substitui o símbolo esbatido) */
.hero-glow { position: absolute; right: -24vw; top: 50%; transform: translateY(-46%); width: max(96vw, 140vh); aspect-ratio: 322 / 316; pointer-events: none; z-index: 0; }
.hero-glow svg { width: 100%; height: 100%; display: block; overflow: visible; }
.hero.has-glow .hero-mark { display: none; }
.hero h1 { font-size: clamp(46px, 9.4vw, 168px); line-height: .92; letter-spacing: -.045em; font-weight: 800; margin: 0; max-width: 14ch; cursor: default; }

.hero h1 .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .06em; margin-bottom: -.06em; }
.hero h1 .w > span { display: inline-block; transform: translateY(105%); animation: up .9s var(--ease) forwards; }
@keyframes up { to { transform: none; } }

/* Cursor personalizado (só em computador). Inverte a cor sobre fundos claros. */
.has-cursor, .has-cursor * { cursor: none !important; }
.has-cursor input, .has-cursor textarea { cursor: text !important; }
.cur-dot, .cur-ring { position: fixed; left: 0; top: 0; z-index: 9999; pointer-events: none; border-radius: 50%; mix-blend-mode: difference; will-change: transform; transition: opacity .25s; }
.cur-dot { width: 8px; height: 8px; margin: -4px 0 0 -4px; background: #fff; }
.cur-ring { width: 40px; height: 40px; margin: -20px 0 0 -20px; display: grid; place-items: center; }
.cur-ring::before { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid #fff; transition: transform .35s var(--ease), background .35s, border-color .35s; }
.cur-ring span { position: relative; font-size: 13px; font-weight: 700; color: #000; opacity: 0; transform: scale(.6); transition: opacity .25s, transform .35s var(--ease); }
.cur-ring.link::before { transform: scale(1.6); }
.cur-ring.view { mix-blend-mode: normal; }
.cur-ring.view::before { transform: scale(2.2); background: #fff; border-color: #fff; }
.cur-ring.view span { opacity: 1; transform: none; }
.cur-hide .cur-dot, .cur-hide .cur-ring, .cur-ring.view ~ .cur-dot { opacity: 0; }
.has-cursor .card .view { display: none; }
.hero-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-top: clamp(28px, 5vw, 64px); padding-top: 22px; border-top: 1px solid var(--line); }
.hero-foot p { margin: 0; max-width: 46ch; font-size: clamp(15px, 1.4vw, 19px); line-height: 1.5; color: #cfcfcf; font-weight: 300; }
.hero-foot .loc { font-size: 13px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.scroll-cue { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.scroll-cue i { width: 1px; height: 38px; background: linear-gradient(#fff, transparent); animation: cue 1.8s ease-in-out infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------- Faixa ---------- */
.band { background: #fff; color: #000; overflow: hidden; white-space: nowrap; border-block: 1px solid #fff; }
.band-track { display: inline-flex; animation: marquee 36s linear infinite; }
.band-track span { font-size: clamp(22px, 3.2vw, 44px); font-weight: 800; letter-spacing: -.02em; padding: 16px 0; text-transform: uppercase; }
.band-track b { display: inline-block; margin: 0 .7em; font-weight: 400; }
@keyframes marquee { to { transform: translateX(-50%); } }
/* ---------- Secções ---------- */
.sec { padding: clamp(80px, 12vw, 170px) var(--pad); }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: clamp(36px, 6vw, 80px); }
.sec-h h2 { font-size: clamp(36px, 6.4vw, 104px); line-height: .95; letter-spacing: -.04em; font-weight: 800; margin: 0; }
.sec-h .n { font-size: 14px; color: var(--muted); font-weight: 500; }

/* Projetos */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 4vw, 64px) clamp(16px, 3vw, 48px); }
.grid .card:nth-child(even) { margin-top: clamp(0px, 12vw, 180px); }
.card { display: block; }
.card .img { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--soft); border-radius: 6px; }
.card .img img, .card .img video { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease), filter .6s; }
.card:hover .img img, .card:hover .img video { transform: scale(1.05); }
.slides { position: relative; width: 100%; height: 100%; }
.slides img { position: absolute; inset: 0; opacity: 0; transition: opacity .9s var(--ease), transform 1.1s var(--ease); }
.slides img.on { opacity: 1; }
.card .view { position: absolute; left: 50%; top: 50%; width: 104px; height: 104px; margin: -52px 0 0 -52px; border-radius: 50%; background: #fff; color: #000; display: grid; place-items: center;
  font-size: 13px; font-weight: 700; transform: scale(0); transition: transform .45s var(--ease); }
.card:hover .view { transform: scale(1); }
.card .meta { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: baseline; padding-top: 18px; }
.card .num { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.card h3 { margin: 0; font-size: clamp(20px, 2.2vw, 30px); font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.card .cat { font-size: 13px; color: var(--muted); text-align: right; }
.empty { border: 1px dashed #333; border-radius: 12px; padding: 60px 24px; text-align: center; color: var(--muted); font-size: 16px; }

/* Faixa de logótipos */
.logos { margin-top: clamp(90px, 14vw, 200px); padding-top: clamp(28px, 4vw, 44px); border-top: 1px solid var(--line); }
.logos-h { margin: 0 0 clamp(24px, 3vw, 40px); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.logos-row { overflow: hidden; margin: 0 calc(var(--pad) * -1);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.logos-track { display: flex; align-items: center; width: max-content; animation: marquee var(--dur, 40s) linear infinite; }
.logos-row:hover .logos-track { animation-play-state: paused; }
.logo-item { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; height: 80px; padding: 0 clamp(32px, 4.5vw, 64px); opacity: .5; transition: opacity .3s; }
.logo-item:hover { opacity: 1; }
.logo-item img { height: var(--h, 48px); width: auto; max-width: none; filter: brightness(0) invert(1); }
@media (max-width: 820px) { .logo-item { height: 60px; } .logo-item img { height: calc(var(--h, 48px) * .72); } }
.logo-item.txt { font-size: clamp(20px, 2.2vw, 30px); font-weight: 800; letter-spacing: -.02em; text-transform: uppercase; white-space: nowrap; }

/* Sobre */
.about { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 110px); align-items: start; }
.about-photo { aspect-ratio: 4 / 5; background: var(--soft); border-radius: 6px; overflow: hidden; display: grid; place-items: center; position: sticky; top: 100px; }
.about-photo img.ph { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); }
.about-photo img.mk { width: 46%; opacity: .9; }
.about-txt .big { font-size: clamp(26px, 3.4vw, 50px); line-height: 1.12; letter-spacing: -.025em; font-weight: 600; margin: 0 0 clamp(26px, 4vw, 48px); }
.about-txt .body { font-size: clamp(16px, 1.3vw, 19px); line-height: 1.7; color: #cfcfcf; font-weight: 300; white-space: pre-line; max-width: 60ch; }
.about-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 20px; margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line); }
.about-facts div span { display: block; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.about-facts div b { font-weight: 600; font-size: 16px; }

/* Testemunhos */
.fb { padding-top: 0; }
.fb-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: clamp(16px, 2vw, 28px); align-items: stretch; }
.fb-card { position: relative; margin: 0; padding: clamp(28px, 3.4vw, 52px); border: 1px solid var(--line); border-radius: clamp(16px, 2vw, 24px); background: #0b0b0b;
  display: flex; flex-direction: column; justify-content: space-between; gap: 36px; transition: border-color .3s, transform .5s var(--ease); }
.fb-card:hover { border-color: #555; transform: translateY(-4px); }
.fb-mark { font-size: clamp(90px, 9vw, 150px); line-height: .7; font-weight: 800; color: #fff; display: block; height: .5em; }
.fb-card blockquote { margin: 0; font-size: clamp(19px, 1.9vw, 28px); line-height: 1.38; font-weight: 500; letter-spacing: -.015em; }
.fb-card.short blockquote { font-size: clamp(34px, 4.4vw, 68px); line-height: 1.02; font-weight: 800; letter-spacing: -.035em; }
.fb-card figcaption { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding-top: 22px; border-top: 1px solid var(--line); }
.fb-card figcaption b { display: block; font-size: 16px; font-weight: 700; }
.fb-card figcaption small { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.fb-card figcaption a { font-size: 13px; font-weight: 600; color: #cfcfcf; white-space: nowrap; border-bottom: 1px solid #555; padding-bottom: 2px; transition: color .2s, border-color .2s; }
.fb-card figcaption a:hover { color: #fff; border-color: #fff; }

/* Contacto */
.contact { background: #fff; color: #000; border-radius: clamp(18px, 3vw, 36px) clamp(18px, 3vw, 36px) 0 0; }
.contact .sec-h h2 { max-width: 12ch; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(36px, 6vw, 100px); align-items: start; }
.mail { font-size: clamp(22px, 3vw, 44px); font-weight: 700; letter-spacing: -.02em; display: inline-block; border-bottom: 3px solid #000; padding-bottom: 4px; word-break: break-all; }
.socials { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 999px; border: 1.5px solid #000; font-weight: 600; font-size: 14px; transition: background .2s, color .2s; }
.pill:hover { background: #000; color: #fff; }
.contact-lead { font-size: 17px; line-height: 1.6; color: #444; margin: 0 0 28px; max-width: 42ch; }
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #555; }
.form input, .form textarea { border: 0; border-bottom: 1.5px solid #c9c9c9; padding: 12px 0; font-size: 17px; background: transparent; outline: none; color: #000; transition: border-color .2s; text-transform: none; letter-spacing: 0; font-weight: 400; }
.form input:focus, .form textarea:focus { border-color: #000; }
.form textarea { min-height: 130px; resize: vertical; }
.form .hp { position: absolute; left: -9999px; }
.send { justify-self: start; height: 54px; padding: 0 30px; border-radius: 999px; border: 0; background: #000; color: #fff; font-weight: 700; font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; gap: 10px; margin-top: 8px; transition: transform .15s; }
.send:active { transform: scale(.97); }
.send:disabled { opacity: .5; cursor: default; }
.form-msg { font-size: 15px; font-weight: 500; margin: 4px 0 0; }
.form-msg:empty { display: none; }

/* Passos, testemunho e escolha rápida */
.steps { list-style: none; padding: 0; margin: 0 0 34px; display: grid; gap: 0; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 44px 1fr; gap: 14px; padding: 16px 0; border-top: 1px solid #e3e3e3; }
.steps li:last-child { border-bottom: 1px solid #e3e3e3; }
.steps span { font-size: 13px; font-weight: 700; color: #9a9a9a; padding-top: 2px; }
.steps b { display: block; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.steps div { font-size: 14.5px; color: #555; line-height: 1.5; }
.c-quote { margin: 0 0 30px; padding: 22px 24px; background: #000; color: #fff; border-radius: 18px; }
.c-quote blockquote { margin: 0; font-size: clamp(22px, 2.2vw, 30px); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.c-quote figcaption { margin-top: 10px; font-size: 13px; color: #a3a3a3; }
.form-wrap { background: #f4f4f4; border-radius: clamp(18px, 2.4vw, 28px); padding: clamp(22px, 3vw, 40px); }
.types { border: 0; padding: 0; margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 8px; }
.types legend { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #555; margin-bottom: 12px; padding: 0; }
.type { height: 40px; padding: 0 16px; border-radius: 999px; border: 1.5px solid #cfcfcf; background: #fff; color: #000; font-weight: 600; font-size: 14px; cursor: pointer; transition: background .2s, color .2s, border-color .2s, transform .15s; }
.type:hover { border-color: #000; }
.type:active { transform: scale(.96); }
.type[aria-pressed="true"] { background: #000; color: #fff; border-color: #000; }
.type[aria-pressed="true"]::before { content: '✓ '; }
.form input::placeholder, .form textarea::placeholder { color: #a5a5a5; }
.form input.bad, .form textarea.bad { border-color: #c92a2a; }
.send { width: 100%; justify-content: center; height: 60px; font-size: 16px; }
.send span { transition: transform .25s var(--ease); }
.send:hover span { transform: translateX(5px); }
.trust { margin: 2px 0 0; font-size: 13px; color: #777; text-align: center; }
.sent { text-align: center; padding: clamp(30px, 5vw, 60px) 10px; animation: fadeIn .6s var(--ease); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } }
.sent-ico { width: 72px; height: 72px; border-radius: 50%; background: #000; color: #fff; display: grid; place-items: center; font-size: 32px; font-weight: 700; margin: 0 auto 22px; }
.sent h3 { margin: 0 0 10px; font-size: clamp(24px, 2.6vw, 34px); font-weight: 800; letter-spacing: -.02em; }
.sent p { margin: 0 auto 26px; color: #555; max-width: 36ch; line-height: 1.55; }
.form-msg.ok { color: #12a150; } .form-msg.err { color: #c92a2a; }

/* ---------- Página de projeto ---------- */
.proj-hero { padding: 150px var(--pad) 0; }
.back { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 40px; transition: color .2s; }
.back:hover { color: #fff; }
.proj-hero h1 { font-size: clamp(44px, 9vw, 150px); line-height: .92; letter-spacing: -.045em; font-weight: 800; margin: 0; }
.proj-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 2fr); gap: 24px; margin-top: clamp(36px, 5vw, 70px); padding-top: 24px; border-top: 1px solid var(--line); }
.proj-meta span { display: block; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.proj-meta b { font-weight: 600; font-size: 16px; }
.proj-meta .sum { font-size: clamp(17px, 1.5vw, 22px); line-height: 1.45; font-weight: 400; color: #e6e6e6; }
.proj-cover { margin: clamp(40px, 6vw, 80px) var(--pad) 0; display: flex; justify-content: center; }
.proj-cover img, .proj-cover video { max-width: 100%; max-height: 88vh; width: auto; height: auto; border-radius: 6px; }
.proj-body { padding: clamp(60px, 9vw, 130px) var(--pad); display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 40px; }
.proj-body h2 { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 6px 0 0; font-weight: 600; }
.proj-body .txt { font-size: clamp(17px, 1.5vw, 22px); line-height: 1.65; font-weight: 300; color: #e2e2e2; white-space: pre-line; max-width: 62ch; }
.gallery { display: grid; gap: clamp(10px, 1.6vw, 22px); padding: 0 var(--pad); }
.gallery .g { border-radius: 6px; overflow: hidden; background: var(--soft); }
.gallery .g img, .gallery .g video { width: 100%; }
.gallery.cols-2 { grid-template-columns: 1fr 1fr; }
.gallery.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.gallery.cols-1 { max-width: 760px; margin: 0 auto; width: 100%; }
.next { display: block; margin-top: clamp(80px, 12vw, 160px); padding: clamp(50px, 8vw, 110px) var(--pad); border-top: 1px solid var(--line); }
.next span { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.next h3 { font-size: clamp(40px, 8vw, 130px); line-height: .95; letter-spacing: -.045em; font-weight: 800; margin: 10px 0 0; transition: transform .5s var(--ease); }
.next:hover h3 { transform: translateX(14px); }
.notfound { min-height: 80vh; display: grid; place-items: center; text-align: center; padding: 120px var(--pad); }

/* ---------- Rodapé ---------- */
.ftr { padding: 70px var(--pad) 34px; background: #fff; color: #000; }
body.on-project .ftr { background: #000; color: #fff; border-top: 1px solid var(--line); }
.ftr-mark { width: clamp(200px, 24vw, 340px); height: auto; filter: invert(1); margin-bottom: 40px; }
body.on-project .ftr-mark { filter: none; }
.ftr-row { display: flex; justify-content: space-between; gap: 20px; font-size: 13px; color: #666; padding-top: 20px; border-top: 1px solid #ddd; }
body.on-project .ftr-row { border-color: var(--line); color: var(--muted); }
.ftr-row a:hover { color: inherit; text-decoration: underline; }

/* Revelar ao fazer scroll */
.rv { opacity: 0; transform: translateY(40px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .rv { opacity: 1; transform: none; transition: none; }
  .hero h1 .w > span { animation: none; transform: none; }
  .band-track, .logos-track { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Telemóvel ---------- */
@media (max-width: 820px) {
  .hdr { height: 64px; }
  .hdr-logo img { height: 28px; }
  .burger { display: block; z-index: 2; }
  .hdr-nav { position: fixed; inset: 0; background: #000; flex-direction: column; justify-content: center; align-items: flex-start; gap: 6px; padding: 0 var(--pad);
    font-size: 44px; font-weight: 800; letter-spacing: -.03em; opacity: 0; pointer-events: none; transition: opacity .3s; }
  .hdr-nav.open { opacity: 1; pointer-events: auto; }
  .hdr-nav a::after { display: none; }
  .lang { margin-top: 26px; height: 40px; font-size: 14px; }
  .hero-foot { flex-direction: column; align-items: flex-start; }
  .hero { min-height: 0; justify-content: flex-start; padding-top: 150px; padding-bottom: 40px; }
  .hero-glow { width: 165vw; right: -62vw; top: 40px; transform: none; }
  .scroll-cue { display: none; }
  .grid { grid-template-columns: 1fr; }
  .grid .card:nth-child(even) { margin-top: 0; }
  .about, .contact-grid, .proj-body, .fb-grid { grid-template-columns: 1fr; }
  .about-photo { position: static; max-width: 420px; }
  .proj-meta { grid-template-columns: 1fr 1fr; }
  .proj-meta .sum-wrap { grid-column: 1 / -1; }
  .gallery.cols-2, .gallery.cols-3 { grid-template-columns: 1fr; }
  .ftr-row { flex-direction: column; }
}
