/* ==========================================================================
   Portefólio · Diogo Silva
   Sistema visual editorial: Inter em todo o site (títulos com espaçamento
   apertado, texto em pesos regulares), superfícies claras em camadas e azul
   como cor de marca.
   ========================================================================== */

/* --- Tokens ------------------------------------------------------------- */
:root {
  color-scheme: light;

  /* escala neutra: o site é a preto e branco, sem cor de marca */
  --n-000: #ffffff;
  --n-050: #fafafa;
  --n-100: #f5f5f5;
  --n-150: #efefef;
  --n-200: #e5e5e5;
  --n-300: #d4d4d4;
  --n-400: #a3a3a3;
  --n-500: #737373;
  --n-600: #525252;
  --n-700: #404040;
  --n-800: #262626;
  --n-900: #171717;
  --n-950: #0a0a0a;
  --n-1000: #000000;

  /* os nomes --blue-* mantêm-se como aliases para não reescrever o CSS todo */
  --blue-900: var(--n-950);   /* blocos escuros: carrossel, contacto */
  --blue-800: var(--n-900);
  --blue-700: var(--n-900);   /* fundos sólidos: botões, lightbox */
  --blue-600: var(--n-800);   /* numeração, ícones, hover de links */
  --blue-500: var(--n-600);   /* secundário */
  --blue-300: var(--n-400);   /* texto atenuado sobre blocos escuros */
  --blue-100: var(--n-200);   /* linhas e detalhes claros */
  --blue-050: var(--n-100);   /* fundos suaves */

  --primary:   var(--n-900);
  --primary-deep: var(--n-950);
  --secondary: var(--n-500);

  /* superfícies */
  --bg:        var(--n-050);
  --white:     var(--n-000);
  --sc-low:    var(--n-100);
  --sc:        var(--n-150);
  --sc-high:   var(--n-200);
  --sc-highest:var(--n-300);

  /* texto */
  --text:      #1a1a1a;
  --text-var:  var(--n-600);
  --muted:     var(--n-500);
  --outline:   #8a8a8a;
  --outline-v: var(--n-300);
  --line:      var(--n-200);
  --line-soft: var(--n-150);

  /* blocos escuros (iguais nos dois temas) e texto sobre eles */
  --ink:       var(--n-950);
  --ink-2:     var(--n-900);
  --on-ink:    #ffffff;
  --on-ink-muted: var(--n-400);

  /* sólidos: fundo e texto dos botões cheios */
  --solid:     var(--n-900);
  --solid-hover: var(--n-700);
  --on-solid:  #ffffff;

  --glow: rgba(0, 0, 0, 0.05);
  --accent: var(--n-800);
  --accent-dark: var(--n-900);
  --accent-soft: rgba(0, 0, 0, 0.06);
  --project: var(--n-800);
  --project-soft: var(--accent-soft);
  --text-dim: var(--text-var);
  --surface: var(--white);
  --surface-2: var(--sc-low);
  --bg-soft: var(--sc-low);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "Fira Code", "SFMono-Regular", Menlo, Consolas, monospace;
  --tag: "Antic", var(--font);
  --script: "Caveat", "Brush Script MT", "Lucida Handwriting", cursive;
  --display: var(--font);
  --sans: var(--font);
  --serif: var(--font);

  --wrap: 1280px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.03), 0 12px 28px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.13);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.no-scroll { overflow: hidden; }

img, video, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

::selection { background: var(--blue-100); color: var(--blue-900); }

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

/* ícones inline */
.ico { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico--sm { width: 1em; height: 1em; }

/* --- Tipografia --------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.035em;
  margin: 0;
  color: var(--text);
}

.display {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
  font-weight: 800;
}

.h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); letter-spacing: -0.045em; }
.h2 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); letter-spacing: -0.04em; }
.h3 { font-size: clamp(1.15rem, 1.9vw, 1.5rem); letter-spacing: -0.03em; }

.em, em { font-style: italic; }
/* destaque nos títulos: mesma família, peso leve e azul, em vez de serifa itálica */
.serif-em { font-family: inherit; font-style: normal; color: var(--muted); font-weight: 400; letter-spacing: inherit; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

.lead { font-size: clamp(1rem, 1.3vw, 1.0625rem); line-height: 1.65; color: var(--text-var); max-width: 62ch; }
.body-text { color: var(--text-var); max-width: 68ch; }
.body-text strong { color: var(--text); font-weight: 600; }

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--secondary);
  margin: 0 0 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.eyebrow a { color: inherit; }
.eyebrow a:hover { color: var(--blue-700); }

/* --- Layout ------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--wide { max-width: 1420px; }

section { position: relative; }

.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }

.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; gap: 1.75rem; } }

/* --- Cabeçalho fixo: menu, assinatura e interruptor de tema ------------ */
.top {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.5rem var(--gutter);
  pointer-events: none;
}

.top { transition: background 0.3s var(--ease), padding 0.3s var(--ease), box-shadow 0.3s var(--ease); }
.top.is-scrolled {
  padding-block: 0.6rem;
  background: rgba(250, 250, 250, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.top__inner {
  position: relative;
  max-width: 1536px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 48px;
}

.top__inner > * { pointer-events: auto; }

.menu { position: relative; }

.menu__btn {
  display: grid;
  place-items: center;
  width: 48px; height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.3s var(--ease);
}
.menu__btn:hover, .menu__btn:focus-visible { color: var(--text); }
.menu__btn svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.menu__btn .menu__ico--close { display: none; }
.menu.is-open .menu__btn .menu__ico--open { display: none; }
.menu.is-open .menu__btn .menu__ico--close { display: block; }

.menu__panel {
  position: absolute;
  top: 100%; left: 0;
  margin: 0.5rem 0 0 1rem;
  width: 240px;
  padding: 1rem;
  border-radius: 0.5rem;
  background: var(--bg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  display: none;
  flex-direction: column;
}
.menu.is-open .menu__panel { display: flex; }

.menu__panel a {
  display: block;
  padding: 0.375rem 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.3s var(--ease);
}
.menu__panel a:hover, .menu__panel a:focus-visible, .menu__panel a.is-current { color: var(--text); }

@media (max-width: 767px) { .menu__panel { width: 200px; } .menu__panel a { font-size: 1.125rem; } }

.top__sig {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--script);
  font-size: 2.25rem;
  font-weight: 600;
  line-height: 1;
  color: var(--text);
  white-space: nowrap;
  transition: opacity 0.3s var(--ease);
}
.top__sig:hover { opacity: 0.7; }

@media (max-width: 420px) { .top__sig { font-size: 1.75rem; } }

/* --- Chips e botões ----------------------------------------------------- */

.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue-800);
  background: var(--blue-050);
  border: 1px solid var(--blue-100);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--white);
  border: 1px solid var(--outline-v);
  color: var(--primary);
  border-radius: var(--r-sm);
  padding: 0.8rem 1.35rem;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.btn:hover { background: var(--sc-low); transform: translateY(-2px); box-shadow: var(--shadow); }
.btn .arrow, .btn .ico { transition: transform 0.3s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

.btn--solid { background: var(--solid); border-color: var(--solid); color: var(--on-solid); }
.btn--solid:hover { background: var(--solid-hover); border-color: var(--solid-hover); color: var(--on-solid); }

.p-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }

/* --- Hero (ecrã inteiro: nome centrado, foto em cápsula, frase e seta) ---- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.hero__center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  padding-inline: 1rem;
  text-align: center;
}

.hero__name {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(100px, 14.6vw, 210px);
  line-height: 0.75;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
}

.hero__line { display: block; }

.hero__ch, .hero__w {
  display: inline-block;
  opacity: 0;
  filter: blur(10px);
  transform: translateY(-20px);
  animation: blur-in 0.5s ease-out forwards;
  animation-delay: calc(var(--i, 0) * 100ms);
}
.hero__w { animation-delay: calc(0.9s + var(--i, 0) * 150ms); }

@keyframes blur-in { to { opacity: 1; filter: blur(0); transform: none; } }

.hero__photo {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  display: block;
  width: clamp(65px, 9vw, 129px);
  aspect-ratio: 129 / 218;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s var(--ease);
}
.hero__photo:hover { transform: translate(-50%, -50%) scale(1.1); }
.hero__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.hero__tag {
  position: absolute;
  left: 50%;
  bottom: clamp(4rem, 12vh, 9rem);
  transform: translateX(-50%);
  width: 100%;
  padding-inline: 1.5rem;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  font-family: var(--tag);
  font-size: clamp(15px, 1.5vw, 22px);
  text-align: center;
  color: var(--muted);
  transition: color 0.3s var(--ease);
}
.hero__tag:hover { color: var(--text); }

.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: clamp(1.5rem, 4vh, 2.5rem);
  transform: translateX(-50%);
  color: var(--muted);
  transition: color 0.3s var(--ease);
  animation: bob 2.2s ease-in-out infinite;
}
.hero__scroll:hover { color: var(--text); }
.hero__scroll svg { width: clamp(20px, 2.2vw, 32px); height: clamp(20px, 2.2vw, 32px); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

@keyframes bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 6px); } }

@media (prefers-reduced-motion: reduce) {
  .hero__ch, .hero__w { animation: none; opacity: 1; filter: none; transform: none; }
  .hero__scroll { animation: none; }
}

.icon-badge {
  width: 40px; height: 40px;
  border-radius: 9px;
  background: var(--blue-050);
  color: var(--blue-600);
  display: grid;
  place-items: center;
}

.icon-badge .ico { width: 20px; height: 20px; }

@media (max-width: 940px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__media { order: -1; max-width: 340px; margin-inline: auto; }
  .hero__col { align-items: flex-start; }
}

/* --- Marcas: carrossel infinito de logótipos ------------------------- */
.marcas { padding-block: clamp(2rem, 4vw, 3rem); background: var(--bg); border-bottom: 1px solid var(--line); }

.marcas__label {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.marcas .wrap { margin-bottom: clamp(1.25rem, 3vw, 2rem); }

.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.marquee__track { display: flex; width: max-content; animation: marquee 36s linear infinite; }

.marquee__list {
  --gap: clamp(3rem, 6vw, 5.5rem);
  display: flex;
  align-items: center;
  gap: var(--gap);
  padding: 0 calc(var(--gap) / 2);
  margin: 0;
  list-style: none;
}

/* os logótipos ficam a preto e recuperam a cor ao passar o rato */
.marquee__logo {
  display: block;
  height: 52px;
  width: auto;
  filter: brightness(0);
  opacity: 0.88;
  transition: filter 0.35s var(--ease), opacity 0.35s var(--ease);
}
.marquee__list li:hover .marquee__logo,
.marquee__list li.is-hot .marquee__logo { filter: none; opacity: 1; }
.marquee__logo--wide { height: 38px; }
.marquee__logo--tall { height: 64px; }

@keyframes marquee { to { transform: translateX(-50%); } }

@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none; width: auto; }
  .marquee__list { flex-wrap: wrap; justify-content: center; }
  .marquee__list[aria-hidden="true"] { display: none; }
}

/* --- Cabeçalho de secção ------------------------------------------------ */
.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.section__head p { color: var(--text-var); max-width: 44ch; font-size: 14.5px; }

/* --- Sobre -------------------------------------------------------------- */
/* frase grande que se acende palavra a palavra com o scroll, ao estilo da Apple */
.about__lead {
  margin: 1.25rem 0 clamp(3rem, 6vw, 5rem);
  max-width: 22ch;
  font-size: clamp(1.9rem, 4.2vw, 3.3rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.08;
  color: var(--text);
}
.about__lead .w { color: var(--n-300, #d4d4d4); transition: color 0.35s var(--ease); }
.about__lead .w.is-on { color: var(--text); }

.about__cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 4rem);
  max-width: 1040px;
  margin-left: auto;
  font-size: clamp(1rem, 1.25vw, 1.125rem);
  line-height: 1.6;
  color: var(--text-var);
}
.about__cols strong { color: var(--text); font-weight: 600; }

.skills {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1.25rem, 3vw, 2.5rem);
  margin-top: clamp(3.5rem, 7vw, 6rem);
}

/* sem caixas: uma linha fina que se desenha quando a coluna entra no ecrã */
.skills__col { position: relative; padding-top: 1.25rem; }
.skills__col::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 1px;
  background: var(--text);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.1s var(--ease) 0.15s;
}
.skills__col.is-in::before, .skills__col.is-visible::before { transform: scaleX(1); }

.skills__title { font-size: 0.8125rem; font-weight: 600; color: var(--n-500); margin: 0 0 1rem; }
.skills__list { list-style: none; margin: 0; padding: 0; }
.skills__list li {
  font-size: clamp(1rem, 1.3vw, 1.1875rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.3;
  padding-block: 0.4rem;
  color: var(--text);
  transition: transform 0.3s var(--ease), color 0.3s var(--ease);
}
.skills__list:hover li { color: var(--n-400, #a3a3a3); }
.skills__list li:hover { color: var(--text); transform: translateX(4px); }

@media (max-width: 900px) {
  .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 2.5rem; }
}
@media (max-width: 640px) {
  .about__cols { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .about__lead .w { color: var(--text); transition: none; }
  .skills__col::before { transform: none; transition: none; }
}

/* --- Ferramentas: fila de azulejos sobrepostos com nome ao passar o rato --- */
.stack { padding-block: clamp(2.5rem, 6vw, 4.5rem); background: var(--bg); border-top: 1px solid var(--line); }
.stack__title { text-align: center; font-size: 1rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: clamp(1.5rem, 3vw, 2.25rem); }

.stack__list {
  --tile: clamp(52px, 6vw, 64px);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0 0.5rem;
}

.stack__item { position: relative; z-index: calc(20 - var(--i, 0)); }
.stack__item + .stack__item { margin-left: calc(var(--tile) * -0.18); }
.stack__item:hover, .stack__item:focus-within { z-index: 30; }

.stack__tile {
  display: grid;
  place-items: center;
  width: var(--tile);
  height: var(--tile);
  border-radius: calc(var(--tile) * 0.26);
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm), 0 6px 18px rgba(0, 0, 0, 0.08);
  cursor: default;
  overflow: hidden;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.stack__tile img { width: 58%; height: 58%; object-fit: contain; display: block; }
.stack__tile--full img { width: 100%; height: 100%; object-fit: cover; }
.stack__tile--light { background: #ffffff; }
.stack__tile--dark { background: #171717; border-color: #262626; }

.stack__item:hover .stack__tile, .stack__tile:focus-visible { transform: translateY(-8px); box-shadow: var(--shadow-lg); outline: none; }
.stack__tile:focus-visible { border-color: var(--text); }

.stack__tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translate(-50%, 6px);
  padding: 0.35rem 0.7rem;
  border-radius: 0.5rem;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.stack__tip::after {
  content: "";
  position: absolute;
  top: 100%; left: 50%;
  width: 8px; height: 8px;
  background: inherit;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transform: translate(-50%, -50%) rotate(45deg);
}
.stack__item:hover .stack__tip, .stack__item:focus-within .stack__tip { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 560px) {
  .stack__list { row-gap: 0.75rem; }
  .stack__item + .stack__item { margin-left: calc(var(--tile) * -0.1); }
}

/* --- Projetos: fila de cartões ------------------------------------------ */
.proj { padding-block: clamp(3.5rem, 8vw, 6.5rem); background: var(--bg); border-top: 1px solid var(--line); overflow: hidden; }

.proj__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
}
.proj__title { font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 600; letter-spacing: -0.04em; margin-bottom: 0.75rem; }
.proj__intro { color: var(--muted); font-size: clamp(0.95rem, 1.1vw, 1.0625rem); line-height: 1.55; max-width: 56ch; margin: 0; }

/* fila de cartões de projetos (traduzida do carousel-08 do 21st.dev, estilo Apple) */
.acards { --edge: max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter))); }

.acards__scroller {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-padding-inline: var(--edge);
  padding: 1rem var(--edge);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}
.acards__scroller::-webkit-scrollbar { display: none; }
.acards__scroller.is-dragging { cursor: grabbing; }
.acards__scroller.is-dragging .acard { pointer-events: none; }
.acards__scroller:focus-visible { outline: 2px solid var(--text); outline-offset: -2px; }

.acards__track { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; width: max-content; }
.acards__item { flex: none; }

.acard {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 280px;
  height: 460px;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  overflow: hidden;
  color: #ffffff;
  background: var(--sc-low);
  isolation: isolate;
  transition: transform 0.3s var(--ease);
}
.acard:hover { transform: scale(1.02); }
.acard:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.acard__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
/* véu só no topo, para o texto branco se ler sobre os logótipos em fundo claro */
.acard::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.2) 30%, rgba(0, 0, 0, 0) 48%);
}

.acard__text { display: flex; flex-direction: column; gap: 0.75rem; }
.acard__cat { font-size: 0.875rem; font-weight: 500; }
.acard__title { font-size: 1.5rem; font-weight: 500; letter-spacing: -0.025em; line-height: 1.25; }

.acard__go {
  align-self: flex-end;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #ffffff;
  color: #000000;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: background 0.2s;
}
.acard__go svg {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  transition: transform 0.3s var(--ease);
  will-change: transform;
}
.acard:hover .acard__go { background: rgba(255, 255, 255, 0.8); }
.acard:hover .acard__go svg { transform: rotate(45deg); }

.acards__nav { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1.5rem; }
.acards__btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}
.acards__btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.acards__btn:hover { background: var(--sc-low); }
.acards__btn:disabled { opacity: 0.5; pointer-events: none; }
.acards__btn:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

@media (min-width: 640px) {
  .acard { width: 320px; height: 520px; padding: 2rem; }
  .acard__cat { font-size: 1rem; }
  .acard__title { font-size: 1.875rem; }
}
@media (min-width: 1024px) {
  .acard { width: 370px; height: 600px; }
}

@media (max-width: 720px) {
  .proj__head { flex-direction: column; align-items: flex-start; gap: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .acard, .acard__go svg { transition: none; }
  .acard:hover { transform: none; }
}

/* --- Certificações ------------------------------------------------------ */
.certs { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1.25rem; }

.cert {
  background: var(--white);
  border: 1px solid var(--sc-high);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
}

.cert:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--blue-100); }

.cert__img { background: var(--sc-low); padding: 0.9rem; cursor: zoom-in; }
.cert__img img { width: 100%; height: auto; border: 1px solid var(--sc-high); border-radius: var(--r-sm); }

.cert__body { padding: 1.3rem 1.4rem 1.5rem; }
.cert__body h3 { font-size: 1.15rem; margin-bottom: 0.4rem; display: flex; align-items: center; gap: 0.5rem; }
.cert__body h3 .ico { color: var(--blue-600); }
.cert__body p { color: var(--text-var); font-size: 13px; }

/* --- Bloco de contacto -------------------------------------------------- */
.contact { background: var(--bg); }

.contact__block {
  background: var(--ink);
  color: var(--on-ink);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: clamp(2rem, 5vw, 3.5rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
}

@media (max-width: 860px) { .contact__block { grid-template-columns: 1fr; } }

.contact__block h2 { color: var(--on-ink); }
.contact__block .serif-em { color: var(--blue-300); }
.contact__block .eyebrow { color: var(--blue-300); }

.contact__links { display: grid; gap: 0.75rem; }

.contact__row {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--r);
  padding: 1rem 1.15rem;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease);
}

.contact__row:hover { background: rgba(255, 255, 255, 0.11); border-color: rgba(255, 255, 255, 0.28); transform: translateY(-2px); }

.contact__row .icon-badge { background: rgba(255, 255, 255, 0.14); color: var(--on-ink-muted); }
.contact__row .txt { display: flex; flex-direction: column; min-width: 0; }
.contact__row .label { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue-300); }
.contact__row .value { font-size: 14.5px; font-weight: 600; color: var(--on-ink); word-break: break-word; }
.contact__row .arrow { margin-left: auto; color: var(--blue-300); transition: transform 0.3s var(--ease); }
.contact__row:hover .arrow { transform: translateX(4px); }

/* --- Rodapé ------------------------------------------------------------- */
.footer__sig { display: inline-block; font-family: var(--script); font-size: 2rem; font-weight: 600; line-height: 1; color: var(--text); margin-bottom: 0.35rem; }
.footer__role { font-size: 10.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.9rem; }
.footer { background: var(--white); border-top: 1px solid var(--sc-high); padding-block: clamp(2.5rem, 5vw, 3.5rem) 1.75rem; font-size: 13.5px; color: var(--text-var); }

.footer__grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); gap: 2rem; }
@media (max-width: 780px) { .footer__grid { grid-template-columns: 1fr; gap: 1.75rem; } }

.footer__title { font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--secondary); margin-bottom: 0.9rem; }
.footer__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.footer__list a:hover { color: var(--blue-600); }

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: center;
  margin-top: 2.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line-soft);
  font-size: 12.5px;
  color: var(--muted);
}

.footer__inner { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; }

/* --- Páginas de projeto ------------------------------------------------- */
/* padding-top inclui o espaço do cabeçalho fixo */
.p-hero { padding-top: clamp(6.5rem, 14vh, 8.5rem); padding-bottom: clamp(2rem, 4vw, 3rem); position: relative; overflow: hidden; }

.p-hero::before {
  content: "";
  position: absolute;
  top: -220px; right: -80px;
  width: 520px; height: 520px;
  border-radius: 50%;
  background: var(--glow);
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}

.p-hero > .wrap { position: relative; z-index: 1; }

.p-hero__title { margin-bottom: 1.1rem; text-wrap: balance; }

.p-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: clamp(2rem, 4vw, 2.75rem);
}

.p-meta__item { background: var(--white); border: 1px solid var(--sc-high); border-radius: var(--r); padding: 1.1rem 1.2rem 1.25rem; box-shadow: var(--shadow-sm); }
.p-meta__label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--secondary); margin-bottom: 0.45rem; }
.p-meta__value { font-size: 14px; color: var(--text); line-height: 1.45; font-weight: 500; }

.p-cover { margin-block: clamp(1rem, 3vw, 1.75rem) 0; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--sc-high); background: var(--white); box-shadow: var(--shadow); }
.p-cover img { width: 100%; height: auto; }

.figure { margin: 0; }
.figure > img { width: 100%; height: auto; border-radius: var(--r); border: 1px solid var(--sc-high); background: var(--white); }

.figure figcaption, .caption { font-size: 12.5px; color: var(--muted); margin-top: 0.7rem; line-height: 1.5; }

.block { display: grid; grid-template-columns: minmax(0, 250px) minmax(0, 1fr); gap: clamp(1.5rem, 5vw, 3.5rem); }
@media (max-width: 860px) { .block { grid-template-columns: 1fr; gap: 1.25rem; } }

.block__aside { position: sticky; top: 100px; align-self: start; }
@media (max-width: 860px) { .block__aside { position: static; } }

/* passos */
.steps { counter-reset: step; display: grid; gap: 0.85rem; }

.step {
  background: var(--white);
  border: 1px solid var(--sc-high);
  border-radius: var(--r);
  padding: 1.3rem 1.4rem 1.45rem;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  box-shadow: var(--shadow-sm);
}

.step::before {
  counter-increment: step;
  content: "0" counter(step);
  font-family: var(--display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--blue-600);
  background: var(--blue-050);
  border: 1px solid var(--blue-100);
  border-radius: var(--r-sm);
  height: 32px;
  display: grid;
  place-items: center;
}

.step h4 { font-family: var(--sans); font-size: 15px; font-weight: 700; letter-spacing: 0; margin-bottom: 0.4rem; color: var(--text); }
.step p { color: var(--text-var); font-size: 14px; max-width: 68ch; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; }

.kpi { background: var(--white); border: 1px solid var(--sc-high); border-radius: var(--r); padding: 1.4rem 1.4rem 1.55rem; box-shadow: var(--shadow-sm); }

.kpi__value {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.9rem, 3.2vw, 2.6rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.kpi__value .unit { color: var(--blue-500); }
.kpi__label { font-size: 12.5px; color: var(--text-var); line-height: 1.45; }

/* paleta */
.palette { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.9rem; }
.swatch { border: 1px solid var(--sc-high); border-radius: var(--r); overflow: hidden; background: var(--white); box-shadow: var(--shadow-sm); }
.swatch__chip { height: 88px; border-bottom: 1px solid var(--sc-high); }
.swatch__meta { padding: 0.8rem 0.95rem 0.95rem; }
.swatch__name { font-size: 13px; font-weight: 600; margin-bottom: 0.15rem; }
.swatch__hex { font-size: 11.5px; color: var(--muted); letter-spacing: 0.06em; font-variant-numeric: tabular-nums; }

/* tipografia da marca */
.type-spec { display: grid; gap: 0.75rem; }
.type-spec__row {
  background: var(--white);
  border: 1px solid var(--sc-high);
  border-radius: var(--r);
  padding: 1.2rem 1.35rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.85rem;
  box-shadow: var(--shadow-sm);
}
.type-spec__name { font-size: 1.35rem; font-weight: 600; letter-spacing: -0.03em; color: var(--primary); }
.type-spec__use { font-size: 13px; color: var(--text-var); text-align: right; max-width: 44ch; }

/* --- Galerias ----------------------------------------------------------- */
.gallery { display: grid; gap: clamp(0.8rem, 1.5vw, 1.1rem); }
.gallery--2 { grid-template-columns: repeat(2, 1fr); }
.gallery--3 { grid-template-columns: repeat(3, 1fr); }
.gallery--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) { .gallery--3, .gallery--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) {
  .gallery--2, .gallery--3, .gallery--4 { grid-template-columns: 1fr; }
}

.shot {
  position: relative;
  margin: 0;
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--sc-high);
  background: var(--white);
  cursor: zoom-in;
  box-shadow: var(--shadow-sm);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
}

.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s var(--ease); }
.shot:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--blue-100); }
.shot:hover img { transform: scale(1.03); }

.shot--tall { aspect-ratio: 4 / 5; }
.shot--square { aspect-ratio: 1; }
.shot--wide { aspect-ratio: 16 / 10; }


/* vídeo */
.video-card { border-radius: var(--r); overflow: hidden; border: 1px solid var(--sc-high); background: #000000; box-shadow: var(--shadow); }
.video-card video { width: 100%; height: auto; display: block; }


/* conclusões */
.learnings { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }

.learnings li {
  background: var(--white);
  border: 1px solid var(--sc-high);
  border-radius: var(--r);
  position: relative;
  padding: 1.1rem 1.3rem 1.15rem 3rem;
  color: var(--text-var);
  font-size: 14px;
  box-shadow: var(--shadow-sm);
}

.learnings li::before {
  content: "";
  position: absolute;
  left: 1.25rem;
  top: 1.45rem;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--blue-600);
}

/* nota */
.note { border: 1px solid var(--blue-100); border-left: 3px solid var(--blue-600); border-radius: var(--r-sm); padding: 1.15rem 1.35rem; color: var(--text-var); font-size: 13.5px; background: var(--blue-050); }
.note strong { color: var(--blue-800); font-weight: 700; }
.note a { color: var(--blue-600); font-weight: 600; }

/* projeto seguinte */
.p-next { border-top: 1px solid var(--sc-high); background: var(--sc-low); }
.p-next__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem; padding-block: clamp(2.25rem, 5vw, 3.5rem); }
.p-next__label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--secondary); margin-bottom: 0.45rem; }
.p-next__title { font-size: clamp(1.5rem, 3.2vw, 2.3rem); transition: color 0.3s var(--ease); }
.p-next a:hover .p-next__title { color: var(--blue-600); }

/* --- Mosaicos de logótipo ---------------------------------------------- */
.logo-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: var(--white);
  border: 1px solid var(--sc-high);
  border-radius: var(--r);
  cursor: zoom-in;
  box-shadow: var(--shadow-sm);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
}

.logo-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--blue-100); }
.logo-tile img { max-height: 92px; width: auto; max-width: 100%; object-fit: contain; }
.logo-tile--light { background: var(--sc-low); }


/* --- Lightbox ----------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--bg) 96%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: clamp(1rem, 4vw, 3rem);
}

.lightbox.is-open { display: flex; }

.lightbox__stage { max-width: min(1200px, 100%); max-height: 100%; display: flex; flex-direction: column; gap: 0.85rem; align-items: center; }

.lightbox__img {
  max-width: 100%;
  max-height: calc(100svh - 9rem);
  width: auto; height: auto;
  object-fit: contain;
  border-radius: var(--r);
  border: 1px solid var(--sc-high);
  box-shadow: var(--shadow);
  animation: lb-in 0.35s var(--ease);
}

@keyframes lb-in { from { opacity: 0; transform: scale(0.985); } to { opacity: 1; transform: scale(1); } }

.lightbox__cap { font-size: 13.5px; color: var(--text-var); text-align: center; max-width: 70ch; }

.lightbox__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px; height: 46px;
  border-radius: var(--r-sm);
  border: 1px solid var(--outline-v);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease);
}

.lightbox__btn:hover { background: var(--solid); border-color: var(--solid); color: var(--on-solid); }
.lightbox__prev { left: clamp(0.6rem, 2vw, 1.75rem); }
.lightbox__next { right: clamp(0.6rem, 2vw, 1.75rem); }

.lightbox__close {
  position: absolute;
  top: clamp(0.75rem, 2vw, 1.5rem);
  right: clamp(0.75rem, 2vw, 1.5rem);
  width: 44px; height: 44px;
  border-radius: var(--r-sm);
  border: 1px solid var(--outline-v);
  background: var(--white);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease);
}

.lightbox__close:hover { background: var(--solid); border-color: var(--solid); color: var(--on-solid); }

.lightbox__count { position: absolute; bottom: clamp(0.75rem, 2vw, 1.5rem); left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 600; letter-spacing: 0.12em; color: var(--muted); font-variant-numeric: tabular-nums; }

@media (max-width: 560px) {
  .lightbox__btn { top: auto; bottom: clamp(0.75rem, 2vw, 1.5rem); transform: none; width: 42px; height: 42px; }
  .lightbox__prev { left: 20%; }
  .lightbox__next { right: 20%; }
  .lightbox__count { bottom: 4.2rem; }
}

/* --- Revelação em scroll ------------------------------------------------ */
[data-reveal] { opacity: 0; transform: translateY(20px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
[data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
}

/* --- Impressão ---------------------------------------------------------- */
@media print {
  .top, .lightbox, .hero__scroll { display: none !important; }
  body { background: #fff; color: #111; }
}
