/* FADUS Vision Book — camada partilhada pelas três direcções.
   Só o que é estrutural: reset, fontes, mecânica dos dois modos, chrome.
   Toda a identidade visual vive no CSS de cada direcção. */

@font-face {
  font-family: 'Satoshi';
  src: url('fonts/Satoshi-Variable.ttf') format('truetype-variations');
  font-weight: 300 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Prata';
  src: url('fonts/Prata-Regular.ttf') format('truetype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('fonts/JetBrainsMono-Light.ttf') format('truetype');
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('fonts/JetBrainsMono-Regular.ttf') format('truetype');
  font-weight: 400; font-style: normal; font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; }
body {
  background: var(--bg, #000);
  color: var(--fg, #fff);
  font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }
::selection { background: var(--accent, #C9A227); color: #000; }

/* ---------- cena ---------- */

.deck { position: relative; }

.scene { position: relative; }

/* o palco fixa-se enquanto a cena tem scroll por percorrer */
.stage {
  position: sticky; top: 0;
  height: 100svh; width: 100%;
  overflow: hidden;
  display: flex;
}

/* ---------- passos ---------- */

[data-step] {
  opacity: 0;
  transform: translate3d(0, var(--rise, 18px), 0);
  transition:
    opacity var(--dur, .95s) cubic-bezier(.16, 1, .3, 1) var(--d, 0s),
    transform var(--dur, .95s) cubic-bezier(.16, 1, .3, 1) var(--d, 0s),
    filter var(--dur, .95s) cubic-bezier(.16, 1, .3, 1) var(--d, 0s),
    clip-path var(--dur, .95s) cubic-bezier(.16, 1, .3, 1) var(--d, 0s),
    letter-spacing 1.6s cubic-bezier(.16, 1, .3, 1) var(--d, 0s);
  will-change: opacity, transform;
}
[data-step].is-in { opacity: 1; transform: translate3d(0, 0, 0); }

/* variantes de entrada, escolhidas por atributo no markup */
[data-in="blur"]        { filter: blur(14px); }
[data-in="blur"].is-in  { filter: blur(0); }
[data-in="wipe"]        { clip-path: inset(0 0 100% 0); transform: none; }
[data-in="wipe"].is-in  { clip-path: inset(0 0 0 0); }
[data-in="wipe-r"]      { clip-path: inset(0 100% 0 0); transform: none; }
[data-in="wipe-r"].is-in{ clip-path: inset(0 0 0 0); }
[data-in="track"]       { letter-spacing: .5em; }
[data-in="track"].is-in { letter-spacing: var(--ls, .18em); }
[data-in="scale"]       { transform: scale(1.06); }
[data-in="scale"].is-in { transform: scale(1); }
[data-in="fade"]        { transform: none; }
[data-in="line"]        { transform: scaleX(0); transform-origin: left center; }
[data-in="line"].is-in  { transform: scaleX(1); }

/* elemento marcado como transitório sai de cena quando fica dois passos atrás */
[data-transient].is-past { opacity: 0; transform: translate3d(0, -14px, 0); }

/* ---------- modo apresentação ---------- */

html.is-present, html.is-present body { height: 100%; overflow: hidden; }
html.is-present .scene {
  position: fixed; inset: 0; height: 100svh;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .5s ease;
  z-index: 1;
}
html.is-present .scene.is-shown { opacity: 1; visibility: visible; pointer-events: auto; z-index: 2; }
html.is-present .stage { position: absolute; inset: 0; height: 100%; }
html.is-present .deck { cursor: none; }
html.is-present .deck:hover { cursor: default; }

/* ---------- chrome ---------- */

.vb-progress {
  position: fixed; left: 0; right: 0; top: 0; height: 2px;
  z-index: 90; background: rgba(255, 255, 255, .07);
  pointer-events: none;
}
.vb-progress i {
  display: block; height: 100%;
  background: var(--accent, #C9A227);
  transform: scaleX(0); transform-origin: left center;
  transition: transform .5s cubic-bezier(.16, 1, .3, 1);
}

.vb-dots {
  position: fixed; right: 22px; top: 50%; transform: translateY(-50%);
  z-index: 90; display: flex; flex-direction: column; gap: 11px;
  opacity: 0; transition: opacity .6s ease;
}
html.is-ready .vb-dots { opacity: 1; }
.vb-dots button {
  width: 22px; height: 12px; padding: 0;
  display: flex; align-items: center; justify-content: flex-end;
  position: relative;
}
.vb-dots button::after {
  content: ''; width: 7px; height: 1px;
  background: rgba(255, 255, 255, .3);
  transition: width .4s cubic-bezier(.16, 1, .3, 1), background .4s ease;
}
.vb-dots button:hover::after { background: rgba(255, 255, 255, .7); width: 14px; }
.vb-dots button.is-on::after { background: var(--accent, #C9A227); width: 20px; }
.vb-dots span {
  position: absolute; right: 30px; top: 50%; transform: translateY(-50%) translateX(6px);
  white-space: nowrap; font-size: 9px; letter-spacing: .16em; text-transform: uppercase;
  color: rgba(255, 255, 255, .62);
  opacity: 0; transition: opacity .3s ease, transform .3s ease; pointer-events: none;
}
.vb-dots button:hover span { opacity: 1; transform: translateY(-50%) translateX(0); }

/* setas e contador — só no modo apresentação */
.vb-nav {
  position: fixed; right: clamp(18px, 3vw, 34px); bottom: clamp(16px, 3vh, 28px);
  z-index: 92; display: none; align-items: center; gap: 4px;
  opacity: 0; transition: opacity .6s ease;
}
html.is-present .vb-nav { display: flex; }
html.is-present.is-ready .vb-nav { opacity: .55; }
.vb-nav:hover { opacity: 1 !important; }
.vb-nav button {
  width: 34px; height: 34px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; color: rgba(255, 255, 255, .8);
  border: 1px solid rgba(255, 255, 255, .16); border-radius: 50%;
  transition: background .3s ease, border-color .3s ease, color .3s ease, opacity .3s ease;
}
.vb-nav button:hover:not(:disabled) { background: var(--accent, #C9A227); border-color: var(--accent, #C9A227); color: #000; }
.vb-nav button:disabled { opacity: .22; cursor: default; }
.vb-count {
  margin: 0 10px; font-size: 10px; letter-spacing: .16em;
  color: rgba(255, 255, 255, .4); font-variant-numeric: tabular-nums;
}
.vb-count b { font-weight: 400; color: var(--accent, #C9A227); }

.vb-hint {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(8px);
  z-index: 91; padding: 8px 16px;
  background: rgba(0, 0, 0, .58); backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .1); border-radius: 999px;
  font-size: 10px; letter-spacing: .13em; text-transform: uppercase;
  color: rgba(255, 255, 255, .72);
  opacity: 0; pointer-events: none;
  transition: opacity .5s ease, transform .5s ease;
}
.vb-hint.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- utilidades ---------- */

.bleed { position: absolute; inset: 0; }
.bleed img, .bleed video { width: 100%; height: 100%; object-fit: cover; }
.veil { position: absolute; inset: 0; pointer-events: none; }

.wrap {
  position: relative; z-index: 2;
  width: 100%; max-width: 1440px; margin: 0 auto;
  padding: clamp(28px, 5vw, 76px) clamp(24px, 6vw, 92px);
  display: flex; flex-direction: column; justify-content: center;
}

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (prefers-reduced-motion: reduce) {
  [data-step] { transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}

@media (max-width: 720px) {
  .vb-dots { display: none; }
  .vb-hint { bottom: 84px; max-width: 86vw; text-align: center; }
}

/* Em ecrã estreito os gradientes horizontais deixam de proteger o texto:
   junta-se uma camada vertical por cima da imagem, por baixo do conteúdo. */
@media (max-width: 900px) {
  .stage::after {
    content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background: linear-gradient(0deg, var(--bg) 3%, rgba(0, 0, 0, .62) 52%, rgba(0, 0, 0, .74) 100%);
  }
  .stage > .wrap { z-index: 3; }
}
