/* =================================================================
   RUI SILVA — versão "leque"
   Preto, uma cor de destaque (--accent). Muda-a aqui e muda em todo o site.
   ================================================================= */
:root {
  --bg: #060606;
  --fg: #f3f1ec;
  --mute: #85827b;
  --line: #1f1f1f;
  --accent: #ff4f1a;           /* laranja elétrico; azul elétrico: #2f5bff */
  --display: 'Syne', 'Arial Black', sans-serif;
  --text: 'Inter Tight', system-ui, sans-serif;
  --pad: clamp(16px, 3vw, 40px);
  --e-out: cubic-bezier(.16, 1, .3, 1);
  --e-back: cubic-bezier(.34, 1.45, .64, 1);
  --e-io: cubic-bezier(.77, 0, .18, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); color: var(--fg); scroll-behavior: smooth; }
body { font-family: var(--text); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body.locked { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
ul { list-style: none; }
::selection { background: var(--accent); color: #000; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- header ---------- */
.top {
  position: fixed; inset: 0 0 auto; z-index: 60;
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px var(--pad);
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.top::before { /* fundo suave para o header não colar aos títulos grandes */
  content: ''; position: absolute; inset: 0 0 -30px; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(6, 6, 6, .92) 40%, rgba(6, 6, 6, 0));
  opacity: 0; transition: opacity .4s;
}
.show-brand .top::before { opacity: 1; }
.brand {
  font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: -.01em;
}
.top nav { display: flex; gap: clamp(16px, 2.6vw, 34px); align-items: center; font-size: 14px; }
.top nav a { position: relative; }
.top nav a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: right; transition: transform .45s var(--e-out);
}
.top nav a:hover::after { transform: scaleX(1); transform-origin: left; }
.lang span { opacity: .4; transition: opacity .3s, color .3s; }
.lang span.on { opacity: 1; color: var(--accent); }

/* ---------- eyebrow (rótulos pequenos) ---------- */
.eyebrow {
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--mute);
}
.eyebrow span:first-child { color: var(--fg); }
.eyebrow span:first-child::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 10px; vertical-align: 1px; }
.eyebrow.pad { padding: 0 var(--pad); margin-bottom: 10px; }

/* =================================================================
   1. HERO em colagem: perfil, frase grande com etiquetas, rabiscos,
      dock de ícones e monte de projetos que se baralha
   ================================================================= */
.glass {
  background: rgba(30, 30, 32, .55);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, .09);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .06);
}
.hero {
  position: relative; height: 100svh; min-height: 680px; overflow: hidden;
  --px: 0; --py: 0;                             /* posição do rato (-1 a 1), para os rabiscos */
}
.hero::before { /* brilho suave atrás da frase */
  content: ''; position: absolute; left: 50%; top: 48%; width: 70vw; height: 60vh; transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(255, 79, 26, .13), rgba(255, 79, 26, 0));
  pointer-events: none;
}

/* frase grande + etiquetas */
.headline {
  position: absolute; left: 50%; top: 51%; z-index: 4; transform: translate(-50%, -50%);
  width: max-content; max-width: 94vw;
}
.hl {
  font-family: var(--display); font-weight: 800; text-transform: uppercase; text-align: center;
  font-size: clamp(46px, min(6.6vw, 13svh), 150px); line-height: .9; letter-spacing: -.045em;
}
.hl span { display: block; overflow: hidden; padding: 0 .04em .04em; }
.hl b { display: block; font-weight: inherit; transform: translateY(105%); transition: transform 1.1s var(--e-out); }
.hl span:nth-child(2) b { transition-delay: .08s; }
.hl span:nth-child(3) b { transition-delay: .16s; }
.go .hl b { transform: none; }

.tag {
  position: absolute; z-index: 2; touch-action: none; user-select: none;
  --dx: 0px; --dy: 0px;
  transform: translate(var(--dx), var(--dy)) rotate(var(--r)) scale(0);
  transition: transform .8s var(--e-back);
}
.tag > span {
  display: block; padding: .55em 1.1em; border-radius: 99px; white-space: nowrap;
  background: var(--c); color: #0a0a0a; font-weight: 600; font-size: clamp(13px, 1.15vw, 19px);
  box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .8), inset 0 -2px 0 rgba(0, 0, 0, .12);
  animation: bob 5s ease-in-out infinite;
}
.go .tag { transform: translate(var(--dx), var(--dy)) rotate(var(--r)) scale(1); }
.tag.dragging { transition: none; z-index: 5; cursor: grabbing; }
.tag.dragging > span { animation-play-state: paused; box-shadow: 0 24px 40px -10px rgba(0, 0, 0, .9); }
@media (hover: hover) and (pointer: fine) { .tag { cursor: grab; } }
.t1 { left: 21%; top: -15%; transition-delay: .7s; }
.t2 { right: -6%; top: 31%; transition-delay: .82s; }
.t2 > span { animation-delay: -1.5s; }
.t3 { left: 4%; bottom: 8%; transition-delay: .94s; }
.t3 > span { animation-delay: -3s; }
.t4 { right: 8%; bottom: -9%; transition-delay: 1.06s; }
.t4 > span { animation-delay: -2.2s; }
@keyframes bob { 50% { transform: translateY(-7px) rotate(1.5deg); } }

/* rabiscos */
.doodles { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.dd {
  position: absolute; display: block; color: var(--c);
  translate: calc(var(--px) * var(--d) * 1px) calc(var(--py) * var(--d) * 1px);
  transition: translate .9s var(--e-out);
}
.dd svg { display: block; width: 100%; height: auto; overflow: visible; transform: rotate(var(--rot)); animation: drift 7s ease-in-out infinite; }
.dd:nth-child(2n) svg { animation-duration: 9s; animation-direction: reverse; }
@keyframes drift { 50% { transform: rotate(calc(var(--rot) + 10deg)) translateY(-8px); } }
.draw path, .draw circle { fill: none; stroke: currentColor; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.draw .fill { fill: currentColor; stroke: none; }
.draw .ln { stroke-dasharray: 1 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.4s var(--e-out) var(--wait, 1s); }
.go .draw .ln, .piece.in .draw .ln { stroke-dashoffset: 0; }
.draw .fill { transform-box: fill-box; transform-origin: center; transform: scale(0); transition: transform .8s var(--e-back) var(--wait, 1s); }
.go .draw .fill, .piece.in .draw .fill { transform: none; }

/* frase em baixo à esquerda */
.tagline {
  position: absolute; left: var(--pad); bottom: clamp(26px, 4svh, 40px); z-index: 5; max-width: 250px;
  font-size: 14px; line-height: 1.4; color: #bdbab3;
  opacity: 0; transition: opacity .8s 1.1s;
}
.tagline::before { content: '↘'; display: block; color: var(--accent); margin-bottom: 6px; }
.go .tagline { opacity: 1; }

/* dock de ícones */
.dock {
  position: absolute; left: 50%; bottom: clamp(22px, 3.6svh, 36px); z-index: 7;
  display: flex; align-items: flex-end; gap: 10px; padding: 9px; border-radius: 22px;
  transform: translate(-50%, 140%); transition: transform 1s var(--e-back) .9s;
}
.go .dock { transform: translate(-50%, 0); }
.dk {
  position: relative; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 14px;
  background: #1c1c1e; transition: transform .35s var(--e-back), margin .35s var(--e-back);
}
.dk svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.dk-mail { background: var(--accent); color: #0a0a0a; }
.dk-in { background: #2f5bff; }
.dk-ig { background: linear-gradient(135deg, #ffb400, #e0405c 50%, #8a3cff); }
.dk-tt { background: #f3f1ec; color: #0a0a0a; }
.dk::after {                                     /* etiqueta por cima */
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 12px);
  padding: 5px 10px; border-radius: 8px; background: var(--fg); color: #0a0a0a;
  font-size: 12px; font-weight: 600; white-space: nowrap; pointer-events: none;
  opacity: 0; transform: translate(-50%, 4px); transition: opacity .2s, transform .3s var(--e-out);
}
.dk:hover::after, .dk:focus-visible::after, .dk.tip::after { opacity: 1; transform: translate(-50%, 0); }
@media (hover: hover) and (pointer: fine) {
  .dk:hover { transform: translateY(-10px) scale(1.18); margin: 0 6px; }
}

/* =================================================================
   2. PROJETOS em colagem: cada um "cola" ao entrar no ecrã
   ================================================================= */
.work { padding: clamp(100px, 13vw, 190px) var(--pad) clamp(200px, 22vw, 360px); }
.work-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; flex-wrap: wrap; margin-bottom: clamp(60px, 8vw, 120px); }
.work-title {
  font-family: var(--display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(40px, 6.4vw, 112px); line-height: .9; letter-spacing: -.045em;
}
.work-hint { font-size: 14px; color: var(--mute); max-width: 260px; }
.work-hint::before { content: '↓ '; color: var(--accent); }

.pieces {
  display: grid; grid-template-columns: 1fr 1fr;
  column-gap: clamp(40px, 7vw, 140px); row-gap: clamp(80px, 10vw, 170px);
  max-width: 1500px; margin: 0 auto;
}
.piece:nth-child(even) { translate: 0 clamp(90px, 13vw, 230px); }   /* coluna da direita desencontrada */

.collage { position: relative; aspect-ratio: 1.3; }
.ph {
  position: absolute; display: block; overflow: hidden; border-radius: 6px; background: #151515;
  box-shadow: 0 30px 50px -24px rgba(0, 0, 0, .95), 0 0 0 1px rgba(255, 255, 255, .06);
  opacity: 0;
  transform: translate3d(0, -50px, 0) rotate(calc(var(--r) * -3)) scale(1.28);
  transition: transform 1s var(--e-back) var(--d), opacity .25s var(--d), box-shadow .3s;
}
.ph img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ph-1 { left: 0; top: 12%; width: 72%; aspect-ratio: 1.5; z-index: 1; }
.ph-2 { right: 0; top: 0; width: var(--w); z-index: 2; }
.ph-3 { right: 9%; bottom: 0; width: var(--w); z-index: 3; }
.alt .ph-1 { left: auto; right: 0; }
.alt .ph-2 { right: auto; left: 0; }
.alt .ph-3 { right: auto; left: 9%; }
.piece.in .ph { opacity: 1; transform: rotate(var(--r)); }
.piece.settled .ph { --d: 0s; }
.piece.settled .ph:hover, .piece.settled .ph:focus-visible {
  z-index: 6; transform: rotate(0deg) scale(1.05);
  box-shadow: 0 40px 70px -24px rgba(0, 0, 0, .95), 0 0 0 2px var(--c);
}

/* fita-cola, número e rabisco */
.tape {
  position: absolute; z-index: 4; left: 26%; top: 7%; width: 20%; height: 9%;
  background: rgba(243, 241, 236, .22); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  transform: rotate(-6deg) scaleX(0); transform-origin: left; transition: transform .5s var(--e-out) .55s;
}
.alt .tape { left: auto; right: 30%; transform: rotate(5deg) scaleX(0); transform-origin: right; }
.piece.in .tape { transform: rotate(-6deg); }
.piece.in.alt .tape { transform: rotate(5deg); }
.num {
  position: absolute; z-index: 5; left: -2%; bottom: 14%; display: grid; place-items: center;
  width: clamp(54px, 5vw, 78px); aspect-ratio: 1; border-radius: 50%;
  background: var(--c); color: #0a0a0a; font-family: var(--text); font-weight: 600; letter-spacing: -.02em; font-size: clamp(18px, 1.7vw, 26px);
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, .8);
  transform: rotate(-30deg) scale(0); transition: transform .7s var(--e-back) .5s;
}
.alt .num { left: auto; right: -2%; }
.piece.in .num { transform: rotate(-10deg); }
.collage .dd { z-index: 5; width: 16%; --wait: .75s; translate: none; }
.collage .dd.a { right: 34%; bottom: -6%; }
.alt .collage .dd.a { right: auto; left: 34%; }

/* texto */
.info { position: relative; margin-top: clamp(30px, 3.4vw, 52px); max-width: 560px; }
.alt .info { margin-left: auto; text-align: right; }
.ptags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.alt .ptags { justify-content: flex-end; }
.ptags li {
  padding: 5px 12px; border-radius: 99px; font-size: 13px; font-weight: 600;
  background: var(--c); color: #0a0a0a;
  transform: rotate(var(--tr)) scale(0); transition: transform .6s var(--e-back);
  transition-delay: calc(.6s + var(--ti) * 80ms);
}
.ptags li:nth-child(2n) { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1.5px var(--c); }
.piece.in .ptags li { transform: rotate(var(--tr)); }
.ptitle {
  font-family: var(--display); font-weight: 800; font-size: clamp(30px, 3.4vw, 58px);
  line-height: .95; letter-spacing: -.04em;
}
.pcat { margin-top: 8px; color: var(--mute); font-size: 15px; }
.popen { margin-top: 18px; font-size: 15px; font-weight: 600; border-bottom: 1.5px solid var(--c); padding-bottom: 2px; transition: color .3s; }
.popen:hover { color: var(--c); }
.info > * { opacity: 0; transform: translateY(18px); transition: opacity .6s, transform .8s var(--e-out); }
.piece.in .info > * { opacity: 1; transform: none; }
.piece.in .info > :nth-child(2) { transition-delay: .5s; }
.piece.in .info > :nth-child(3) { transition-delay: .58s; }
.piece.in .info > :nth-child(4) { transition-delay: .66s; }
.info > .ptags { opacity: 1; transform: none; }

/* =================================================================
   4. CONTACTO
   ================================================================= */
.contact { padding: clamp(90px, 12vw, 170px) var(--pad) 32px; border-top: 1px solid var(--line); }
.contact h2 {
  font-family: var(--display); font-weight: 800; font-size: clamp(34px, 5vw, 84px);
  line-height: .95; letter-spacing: -.04em; max-width: 14ch;
}
.mail {
  display: inline-block; margin-top: clamp(28px, 4vw, 48px);
  font-family: var(--display); font-weight: 700; font-size: clamp(22px, 3.6vw, 56px); letter-spacing: -.02em;
  color: var(--accent); border-bottom: 2px solid currentColor; padding-bottom: 2px;
  transition: color .3s;
}
.mail:hover { color: var(--fg); }
.mail-note { margin-top: 12px; font-size: 13px; color: var(--mute); transition: color .3s; }
.mail-note.ok { color: var(--accent); }
.cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-top: clamp(70px, 9vw, 120px); }
.cols h3 { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); font-weight: 500; margin-bottom: 14px; }
.cols li { padding: 3px 0; }
.about { max-width: 46ch; font-size: clamp(17px, 1.5vw, 21px); line-height: 1.4; }
.links a:hover { color: var(--accent); }
.foot { display: flex; justify-content: space-between; margin-top: clamp(70px, 9vw, 120px); color: var(--mute); font-size: 13px; }
.foot a:hover { color: var(--fg); }

/* =================================================================
   PROJETO aberto
   ================================================================= */
.project {
  --pc: var(--accent);
  position: fixed; inset: 0; z-index: 100; background: #0a0a0a;
  display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr);
  clip-path: inset(100% 0 0 0); visibility: hidden;
  transition: clip-path .85s var(--e-io), visibility 0s .85s;
}
.project.open { clip-path: inset(0 0 0 0); visibility: visible; transition: clip-path .85s var(--e-io); }
.pj-bar { display: flex; justify-content: space-between; align-items: center; padding: 20px var(--pad); font-size: 14px; }
.pj-num { color: var(--accent); font-weight: 600; letter-spacing: .04em; }
.pj-close:hover { color: var(--accent); }
.pj-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 40px;
  padding: clamp(8px, 2svh, 24px) var(--pad) 0;
}
.pj-title {
  font-family: var(--display); font-weight: 800; font-size: clamp(44px, 7.6vw, 136px);
  line-height: .88; letter-spacing: -.045em;
}
.pj-meta { max-width: 340px; flex: none; font-size: 15px; color: #bdbab3; padding-bottom: .4em; }
.pj-cat { display: flex; align-items: center; gap: 9px; color: var(--fg); font-weight: 600; margin-bottom: 6px; }
.pj-cat i { width: 9px; height: 9px; border-radius: 50%; background: var(--pc); }
.pj-head > * { transition: transform .8s var(--e-out), opacity .6s; }
.project:not(.ready) .pj-head > * { transform: translateY(30px); opacity: 0; }
.pj-meta { transition-delay: .08s; }

.pj-gallery {
  display: flex; align-items: center; gap: clamp(12px, 1.6vw, 24px);
  overflow-x: auto; overflow-y: hidden; overscroll-behavior: contain;
  padding: clamp(18px, 4svh, 44px) var(--pad);
  scrollbar-width: none; cursor: grab; user-select: none;
}
.pj-gallery::-webkit-scrollbar { display: none; }
.pj-gallery.dragging { cursor: grabbing; }
.pj-gallery figure {
  flex: none; height: 100%; max-height: 64svh; border-radius: 8px; overflow: hidden; background: #151515;
  transform: translateX(calc(-1 * var(--i) * 60%)) rotate(var(--r)) scale(.9); opacity: 0;
  transition: transform 1s var(--e-out), opacity .5s;
  transition-delay: calc(var(--i) * 60ms + 150ms);
}
.pj-gallery.in figure { transform: none; opacity: 1; }
.pj-gallery img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }

.pj-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding: 16px var(--pad) 22px; font-size: 14px; border-top: 1px solid var(--line);
}
.pj-foot button:hover { color: var(--accent); }
.pj-drag { display: flex; align-items: center; gap: 14px; color: var(--mute); font-size: 13px; }
.pj-bar-track { width: clamp(80px, 16vw, 220px); height: 2px; background: #262626; position: relative; overflow: hidden; }
.pj-bar-track i { position: absolute; inset: 0; background: var(--pc); transform-origin: left; transform: scaleX(0); }

/* =================================================================
   MOBILE
   ================================================================= */
@media (max-width: 900px) {
  .tagline { display: none; }
}
@media (max-width: 700px) {
  .hero { height: auto; min-height: 100svh; display: flex; flex-direction: column; padding: 76px var(--pad) 110px; }
  .headline { position: relative; left: auto; top: auto; transform: none; margin: auto; padding: 96px 0 70px; max-width: 100%; }
  .hl { font-size: 13.2vw; }
  .t1 { left: -2%; top: 14px; } .t2 { right: -2%; top: 52px; } .t3 { left: 0; bottom: 26px; } .t4 { right: 4%; bottom: 4px; }
  .dock { gap: 7px; padding: 7px; border-radius: 18px; }
  .dk { width: 44px; height: 44px; border-radius: 12px; }
  .dk::after { display: none; }
  .work-title { font-size: 8.6vw; }
  .pieces { grid-template-columns: 1fr; row-gap: 90px; }
  .piece:nth-child(even) { translate: none; }
  .work { padding-bottom: 110px; }
  .cols { grid-template-columns: 1fr; gap: 36px; }
  .pj-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .pj-title { font-size: 10.5vw; }
  .pj-meta { flex: initial; }
  .pj-gallery figure { max-height: 52svh; }
  .pj-drag > span:first-child { display: none; }
}

/* menos movimento */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01s !important; transition-delay: 0s !important; animation: none !important; }
}
