/* ============================================================
   CINEMA — camada de efeitos sobre o mundo azul atmosférico.
   Carrega depois de style.css. Tudo que depende de JS fica
   atrás de .cinema (adicionada por cinema.js), então sem JS
   ou com movimento reduzido o site continua legível.
   ============================================================ */

:root {
  --cx: 50%;
  --cy: 50%;
  --glow: rgba(59, 130, 246, 0.55);
}

/* ── Seleção, caret, scrollbar: superfícies do navegador ── */
::selection { background: #2563eb; color: #fff; }
input, textarea { caret-color: #60a5fa; }
html { scrollbar-width: thin; scrollbar-color: #1d4ed8 #050a12; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #050a12; }
::-webkit-scrollbar-thumb { background: linear-gradient(#2563eb, #1d4ed8); border-radius: 10px; border: 2px solid #050a12; }
:focus-visible { outline: 2px solid #60a5fa; outline-offset: 3px; border-radius: 6px; }

/* ── Barra de progresso de leitura ── */
.progress {
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 200;
  background: linear-gradient(90deg, #1d4ed8, #60a5fa 60%, #bfdbfe);
  transform: scaleX(0); transform-origin: 0 50%;
  box-shadow: 0 0 14px rgba(96, 165, 250, 0.7);
  pointer-events: none;
}

/* ── HERO ─────────────────────────────────────────── */
.intro { isolation: isolate; }
.intro__stage { grid-template-columns: minmax(0, 1.7fr) minmax(250px, 0.62fr); align-items: center; }
.intro__copy { max-width: none; position: relative; z-index: 3; }

/* nome gigante: letras individuais, cor por proximidade do cursor */
.intro__title {
  font-size: clamp(4.25rem, 13.5vw, 11rem);
  line-height: 0.86;
  letter-spacing: -0.045em;
  margin-bottom: 1.6rem;
}
.cinema .intro__title-line { padding-bottom: 0.08em; margin-bottom: -0.08em; }
.cinema .intro__title-line > span {
  animation: none; opacity: 1; transform: none;
  background: none; -webkit-text-fill-color: currentColor; color: inherit;
  display: block; white-space: nowrap;
}
.cinema .intro__title-line:first-child > span { color: #f8fafc; }
.cinema .intro__title-line:nth-child(2) > span { color: #93c5fd; }
.char {
  display: inline-block; will-change: transform;
  transition: color .25s linear, text-shadow .25s linear;
  --p: 0;
  color: color-mix(in oklab, currentColor calc((1 - var(--p)) * 100%), #3b82f6);
  text-shadow: 0 0 calc(var(--p) * 38px) rgba(59, 130, 246, calc(var(--p) * 0.9));
}

.intro__role { font-size: clamp(1.05rem, 1.5vw, 1.3rem); max-width: 40ch; }

/* luz que segue o mouse dentro do hero */
.intro__spot {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(520px circle at var(--cx) var(--cy), rgba(96, 165, 250, 0.2), rgba(37, 99, 235, 0.07) 45%, transparent 70%);
  opacity: 0; transition: opacity .6s var(--ease);
  mix-blend-mode: screen;
}
.cinema .intro:hover .intro__spot { opacity: 1; }

/* retrato: moldura com borda de luz giratória + inclinação 3D */
.intro__visual { width: min(100%, 340px); }
.cinema .intro__visual { animation: none; opacity: 1; transform: none; }
.intro__photo {
  border-radius: 22px;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.85), 0 0 80px -20px rgba(37, 99, 235, 0.55);
  will-change: transform;
}
.intro__photo::before {
  content: ''; position: absolute; inset: -1px; z-index: 3; border-radius: inherit; padding: 2px; pointer-events: none;
  background: conic-gradient(from var(--ang, 0deg), transparent 0 55%, #93c5fd 72%, #fff 78%, #3b82f6 86%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin-ang 5s linear infinite;
}
@property --ang { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes spin-ang { to { --ang: 360deg; } }
.intro__photo img { transform: scale(1.12); will-change: transform; }

/* pista de scroll */
.intro__cue {
  position: absolute; z-index: 3; left: 50%; bottom: 1.1rem; width: 1px; height: 54px;
  background: linear-gradient(#60a5fa, transparent); transform-origin: top;
  animation: cue 2.2s var(--ease) infinite;
}
@keyframes cue { 0% { transform: scaleY(0); opacity: 0; } 40% { opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* ── TICKER (marquee guiado por scroll) ───────────── */
.ticker {
  position: relative; z-index: 2; overflow: hidden;
  padding: 1.6rem 0 1.4rem;
  background: linear-gradient(180deg, #060b14, #08101d);
  border-block: 1px solid rgba(148, 163, 184, 0.1);
}
.ticker__row { display: flex; overflow: hidden; }
.ticker__track { display: flex; flex: none; align-items: center; gap: 2.2rem; padding-right: 2.2rem; will-change: transform; }
.ticker__track span {
  font-family: var(--font-display); font-weight: 800; letter-spacing: -0.035em;
  font-size: clamp(2.6rem, 7.4vw, 6rem); line-height: 1.05; white-space: nowrap; color: #e2e8f0;
}
.ticker__track i { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: #2563eb; flex: none; box-shadow: 0 0 18px #3b82f6; }
.ticker__row--ghost .ticker__track span {
  color: transparent; -webkit-text-stroke: 1.2px rgba(147, 197, 253, 0.5);
  font-size: clamp(2rem, 5.2vw, 4.2rem); letter-spacing: 0; -webkit-text-stroke-width: 1px;
}
.ticker__row--ghost .ticker__track i { background: transparent; border: 1px solid #60a5fa; box-shadow: none; }

/* ── Títulos de seção: revelação por máscara ─────── */
.cinema .deliver__title, .cinema .work__title, .cinema .stack__title,
.cinema .xp__title, .cinema .study__title, .cinema .shelf__title {
  font-size: clamp(2.6rem, 7vw, 5.6rem);
  letter-spacing: -0.045em; line-height: 0.98;
  will-change: transform, clip-path;
}
.cinema .deliver__title.is-in, .cinema .work__title.is-in, .cinema .stack__title.is-in,
.cinema .xp__title.is-in, .cinema .study__title.is-in, .cinema .shelf__title.is-in { clip-path: inset(0 0 0 0); }

/* ── Revelações com mais corpo (substitui o fade tímido) ── */
.cinema .reveal-element:not(.is-visible) {
  opacity: 0; transform: translate3d(0, 40px, 0) scale(0.98); filter: blur(6px);
}
.cinema .reveal-element.is-visible:not(.is-settled) {
  transition:
    opacity .75s var(--ease-out, var(--ease)) var(--reveal-delay, 0ms),
    transform 1.1s var(--ease-out-expo, var(--ease)) var(--reveal-delay, 0ms),
    filter .7s var(--ease-out, var(--ease)) var(--reveal-delay, 0ms);
}
/* cabeçalhos de seção não sobem em bloco: o título tem a própria máscara (cinema.js) */
.cinema .deliver__head.reveal-element:not(.is-visible),
.cinema .cs-head.reveal-element:not(.is-visible),
.cinema .xp__head.reveal-element:not(.is-visible) { opacity: 1; transform: none; filter: none; }
/* cards de serviço convergem das laterais para o eixo */
.cinema .deliver__grid > .reveal-element:nth-child(2n+1):not(.glass-card--lead):not(.is-visible) { transform: translate3d(-28px, 32px, 0) scale(0.98); }
.cinema .deliver__grid > .reveal-element:nth-child(2n):not(.glass-card--lead):not(.is-visible) { transform: translate3d(28px, 32px, 0) scale(0.98); }

/* ── Spotlight de borda nos cards (segue o ponteiro) ── */
.glass-card, .display-card, .titanium, .stack-card {
  --mx: 50%; --my: 50%;
}
.glass-card { position: relative; overflow: hidden; }
.glass-card::after {
  content: ''; position: absolute; inset: 0; z-index: 4; pointer-events: none; border-radius: inherit;
  background: radial-gradient(340px circle at var(--mx) var(--my), rgba(96, 165, 250, 0.2), transparent 55%);
  opacity: 0; transition: opacity .35s var(--ease);
}
.glass-card:hover::after { opacity: 1; }
.glass-card { transition: transform .5s var(--ease), border-color .3s, box-shadow .5s var(--ease); }
.glass-card:hover {
  border-color: rgba(96, 165, 250, 0.55);
  box-shadow: 0 30px 70px -24px rgba(0, 0, 0, 0.7), 0 0 60px -24px rgba(59, 130, 246, 0.6);
}
.glass-card__title { font-size: 1.35rem; letter-spacing: -0.03em; }


/* ── Botões: brilho varrendo + magnético ── */
.btn--accent, .btn--primary, .contact__submit { isolation: isolate; }
.btn--accent::before, .contact__submit::before {
  content: ''; position: absolute; inset: 0; z-index: -1; transform: translateX(-120%) skewX(-18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.38), transparent);
  transition: transform .8s var(--ease);
}
.btn--accent:hover::before, .contact__submit:hover::before { transform: translateX(120%) skewX(-18deg); }
.btn--accent:hover { box-shadow: 0 14px 44px -10px rgba(59, 130, 246, 0.8); }
.btn, .contact__submit { will-change: transform; }
.contact__submit { position: relative; overflow: hidden; }

/* ── Contato: título monumental ── */
.cinema .contact__title { font-size: clamp(3rem, 8.5vw, 7rem); line-height: 0.92; letter-spacing: -0.045em; }

/* ── Mobile: tira o que pesa ── */
@media (max-width: 820px) {
  .intro__stage { grid-template-columns: 1fr; gap: 2rem; }
  .intro__visual { width: min(70%, 260px); justify-self: start; }
  .intro__cue { display: none; }
  .ticker__track span { font-size: clamp(2.2rem, 11vw, 3.4rem); }
}

@media (prefers-reduced-motion: reduce) {
  .intro__photo::before, .intro__cue { animation: none; }
  .cinema .deliver__title, .cinema .work__title, .cinema .stack__title,
  .cinema .xp__title, .cinema .study__title, .cinema .shelf__title { clip-path: none; }
  .cinema .reveal-element { filter: none; transform: none; opacity: 1; }
}
