/* =============================================================
   HIGOR RAMOS DE SOUZA — Portfólio V2 · Motion Edition
   Editorial premium + motion system. Zero dependências.
   Todas as animações usam apenas transform/opacity (60fps).
   ============================================================= */

:root {
  --bg: #f5f3ef;
  --bg-2: #efece6;
  --ink: #0f0e0c;
  --ink-soft: #55524a;
  --ink-faint: #8f8b81;
  --line: #e3e0d8;
  --line-strong: #c9c5bb;
  --green: #2f9e63;
  --max: 1400px;
  --gutter: clamp(20px, 5vw, 80px);
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

::selection { background: var(--ink); color: var(--bg); }

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

.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-faint);
}

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ---------------- Fundo vivo: ambiente + grão ---------------- */
.amb { position: fixed; inset: 0; z-index: -1; overflow: hidden; will-change: transform; }
.amb i {
  position: absolute; border-radius: 50%;
  width: 62vmax; height: 62vmax; top: -22vmax; left: -16vmax;
  background: radial-gradient(circle at 50% 50%, rgba(216, 198, 164, 0.5), rgba(216, 198, 164, 0) 62%);
  animation: drift-a 26s ease-in-out infinite alternate;
}
.amb i:nth-child(2) {
  left: auto; right: -24vmax; top: 34%;
  width: 56vmax; height: 56vmax;
  background: radial-gradient(circle at 50% 50%, rgba(196, 200, 216, 0.38), rgba(196, 200, 216, 0) 62%);
  animation: drift-b 34s ease-in-out infinite alternate;
}
@keyframes drift-a { to { transform: translate3d(9vmax, 7vmax, 0) scale(1.14); } }
@keyframes drift-b { to { transform: translate3d(-7vmax, -9vmax, 0) scale(1.1); } }

.grain {
  position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='160' height='160' filter='url(%23n)' opacity='0.6'/></svg>");
}

/* ---------------- Transição de página ---------------- */
.pt {
  position: fixed; inset: 0; z-index: 998; background: var(--ink);
  transform: scaleY(1); transform-origin: 50% 0;
  transition: transform 0.65s var(--ease-io);
  pointer-events: none;
}
body.pt-enter .pt { transform: scaleY(0); }
body.pt-leave .pt { transform-origin: 50% 100%; transform: scaleY(1); transition-duration: 0.45s; }
html.no-js .pt { display: none; }

/* ---------------- Barra de progresso de leitura ---------------- */
.progress {
  position: fixed; top: 0; left: 0; z-index: 300;
  width: 100%; height: 2px; background: var(--ink);
  transform: scaleX(0); transform-origin: 0 0;
}

/* ---------------- Cursor custom ---------------- */
#cur-dot, #cur-ring {
  position: fixed; top: 0; left: 0; z-index: 1000;
  pointer-events: none; border-radius: 999px;
  will-change: transform; display: none;
}
@media (pointer: fine) {
  html.js.cur-on body, html.js.cur-on a, html.js.cur-on button, html.js.cur-on figure { cursor: none; }
  #cur-dot { display: block; width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--ink); }
  #cur-ring {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; margin: -17px 0 0 -17px;
    border: 1px solid rgba(15, 14, 12, 0.4);
    transition: width 0.35s var(--ease), height 0.35s var(--ease), margin 0.35s var(--ease),
                background-color 0.35s var(--ease), border-color 0.35s var(--ease), opacity 0.3s;
  }
  #cur-ring span {
    font-size: 9px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--bg); opacity: 0; transition: opacity 0.2s; white-space: nowrap;
  }
  body.cur-link #cur-ring {
    width: 54px; height: 54px; margin: -27px 0 0 -27px;
    background: rgba(15, 14, 12, 0.06); border-color: rgba(15, 14, 12, 0.16);
  }
  body.cur-label #cur-dot { opacity: 0; }
  body.cur-label #cur-ring {
    width: 68px; height: 68px; margin: -34px 0 0 -34px;
    background: var(--ink); border-color: var(--ink);
  }
  body.cur-label #cur-ring span { opacity: 1; }
  body.cur-hide #cur-dot, body.cur-hide #cur-ring { opacity: 0; }
}

/* ---------------- Sistema de reveal ---------------- */
.rv {
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.95s var(--ease), transform 0.95s var(--ease);
  transition-delay: var(--d, 0ms);
}
.rv.in { opacity: 1; transform: none; }

.rw .w {
  display: inline-block; overflow: hidden; vertical-align: top;
  padding: 0 0.05em 0.13em; margin: 0 -0.05em -0.13em;
}
.rw .wi {
  display: inline-block; transform: translateY(118%) rotate(4deg);
  transform-origin: 0 100%;
  transition: transform 0.9s var(--ease);
  transition-delay: var(--wd, 0ms);
  will-change: transform;
}
.rw.in .wi { transform: none; }

html.no-js .rv, html.no-js .rw .wi { opacity: 1 !important; transform: none !important; }

/* ---------------- Header ---------------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  padding: 22px 0;
  transition: padding 0.45s var(--ease), background-color 0.45s var(--ease),
              border-color 0.45s var(--ease), transform 0.55s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(16px);
  border-bottom-color: var(--line);
  padding: 14px 0;
}
.site-header.hdr-hide { transform: translateY(-110%); }
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.brand { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; display: inline-flex; align-items: baseline; gap: 10px; }
.brand small { font-size: 11px; color: var(--ink-faint); font-weight: 500; letter-spacing: 0.06em; }
.nav { display: flex; gap: 30px; }
.nav a { font-size: 13.5px; color: var(--ink-soft); position: relative; padding: 4px 0; transition: color 0.3s var(--ease); }
.nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px;
  background: var(--ink); transform: scaleX(0); transform-origin: 100% 0;
  transition: transform 0.4s var(--ease);
}
.nav a:hover, .nav a.active { color: var(--ink); }
.nav a:hover::after, .nav a.active::after { transform: scaleX(1); transform-origin: 0 0; }

/* ---------------- Hero ---------------- */
.hero {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding-top: 110px; padding-bottom: 64px;
  position: relative;
}
.hero-inner { position: relative; z-index: 1; width: 100%; }
.hero h1 {
  font-weight: 700; letter-spacing: -0.05em; line-height: 0.94;
  font-size: clamp(38px, 7vw, 112px);
}

/* ----- Hero com vídeo de fundo (V3) -----
   O texto acompanha a luz do vídeo: fase escura = texto claro;
   quando a cena acende (body.hero-lit, via JS), tudo transiciona
   para tinta escura em sincronia. */
.hero-video {
  --hfg: #f5f3ef;
  --hfg-soft: rgba(245, 243, 239, 0.62);
  --hfg-line: rgba(245, 243, 239, 0.5);
  --hinv: #0f0e0c;
  color: var(--hfg);
  transition: color 0.8s var(--ease);
}
body.hero-lit .hero-video {
  --hfg: #0f0e0c;
  --hfg-soft: rgba(15, 14, 12, 0.6);
  --hfg-line: rgba(15, 14, 12, 0.45);
  --hinv: #f5f3ef;
}
.hero-bg {
  position: absolute; inset: 0; overflow: hidden;
  background: var(--ink);
}
.hero-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none;
}
.hero-bg video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
}
.hero-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, rgba(10, 9, 8, 0.55), rgba(10, 9, 8, 0.1) 46%, rgba(10, 9, 8, 0.25)),
    linear-gradient(100deg, rgba(10, 9, 8, 0.42) 0%, rgba(10, 9, 8, 0) 58%);
  opacity: 1; transition: opacity 0.9s var(--ease);
}
body.hero-lit .hero-scrim { opacity: 0; }
.hero-video .btn {
  border-color: var(--hfg); color: var(--hfg);
  transition: color 0.4s var(--ease), border-color 0.8s var(--ease);
}
.hero-video .btn::before { background: var(--hfg); transition: transform 0.45s var(--ease), background-color 0.8s var(--ease); }
.hero-video .btn:hover { color: var(--hinv); }
.hero-video .btn-ghost { border-color: var(--hfg-line); color: var(--hfg); }
.hero-video .scroll-cue { background: var(--hfg-line); transition: background-color 0.8s var(--ease); }
.hero-video .scroll-cue::after { background: var(--hfg); transition: background-color 0.8s var(--ease); }

/* header claro enquanto sobre o vídeo escuro (antes do scroll) */
body.video-top:not(.hero-lit) .site-header:not(.scrolled) .brand,
body.video-top:not(.hero-lit) .site-header:not(.scrolled) .nav a { color: var(--bg); }
body.video-top:not(.hero-lit) .site-header:not(.scrolled) .brand small { color: rgba(245, 243, 239, 0.55); }
body.video-top:not(.hero-lit) .site-header:not(.scrolled) .nav a::after { background: var(--bg); }
.site-header .brand, .site-header .nav a { transition: color 0.8s var(--ease); }
.hl { display: block; }
.hero h1 em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.02em; }

.hero-bottom {
  margin-top: clamp(44px, 6vw, 78px);
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 36px;
}
.hero-ctas { display: flex; align-items: center; gap: 18px; }
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 14px; font-weight: 500;
  border: 1px solid var(--ink); border-radius: 999px;
  padding: 15px 28px; position: relative; overflow: hidden;
  transition: color 0.4s var(--ease);
}
.btn::before {
  content: ""; position: absolute; inset: 0; background: var(--ink);
  transform: scaleY(0); transform-origin: 50% 100%;
  transition: transform 0.45s var(--ease);
}
.btn:hover { color: var(--bg); }
.btn:hover::before { transform: scaleY(1); }
.btn > * { position: relative; z-index: 1; }
.btn .arrow { transition: transform 0.35s var(--ease); }
.btn:hover .arrow { transform: translateY(3px); }
.btn-ghost { border-color: var(--line-strong); color: var(--ink-soft); }
.btn-ghost:hover { color: var(--bg); }

.scroll-cue {
  position: absolute; left: 50%; bottom: 22px; width: 1px; height: 58px;
  background: color-mix(in srgb, var(--ink) 35%, transparent); overflow: hidden;
}
.scroll-cue::after {
  content: ""; position: absolute; inset: 0; background: var(--ink);
  animation: cue 2.2s var(--ease-io) infinite;
}
@keyframes cue {
  0% { transform: translateY(-100%); }
  55% { transform: translateY(0); }
  100% { transform: translateY(102%); }
}

/* ---------------- Marquee ---------------- */
.marquee {
  border-block: 1px solid var(--line);
  padding: clamp(20px, 3vw, 36px) 0;
  overflow: hidden;
}
.mq-track { display: flex; align-items: baseline; white-space: nowrap; will-change: transform; width: max-content; }
/* O tracking aqui é positivo de propósito: com o texto vazado, um tracking
   negativo encosta as letras e os contornos vizinhos se cruzam, sujando o
   desenho. Aberto, cada letra fecha em si. */
.mq-item {
  font-size: clamp(38px, 6.5vw, 104px); font-weight: 700; letter-spacing: 0.015em; line-height: 1.1;
  color: transparent; -webkit-text-stroke: 1px rgba(15, 14, 12, 0.3);
  padding-right: 0.65em;
}
.mq-item.alt {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  letter-spacing: -0.02em;
  -webkit-text-stroke: 0; color: var(--ink);
}
.mq-item .dotsep { -webkit-text-stroke: 0; color: var(--ink-faint); font-family: var(--sans); }

/* ---------------- Seções ---------------- */
.section { padding-block: clamp(88px, 12vw, 176px); }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
  padding-bottom: 40px; margin-bottom: clamp(48px, 6vw, 80px);
  border-bottom: 1px solid var(--line);
}
.section-head h2 { font-size: clamp(30px, 4.4vw, 58px); font-weight: 650; letter-spacing: -0.035em; line-height: 1; }

/* ---------------- Grid de projetos ---------------- */
.work-wrap { will-change: transform; }
.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(44px, 6vw, 96px) clamp(24px, 3vw, 48px); }
.work-item { grid-column: span 1; }
.work-item.wide { grid-column: 1 / -1; }
.work-item a { display: block; }
.work-thumb { position: relative; overflow: hidden; background: var(--bg-2); aspect-ratio: 4 / 3; }
.work-item.wide .work-thumb { aspect-ratio: 16 / 8; }
.work-thumb .plx { position: absolute; inset: -7% 0; will-change: transform; }
.work-thumb img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.1s var(--ease), opacity 0.5s var(--ease-io);
}
.work-thumb img.alt-img { opacity: 0; }
.work-thumb img.show { opacity: 1; }
.work-item a:hover .work-thumb img { transform: scale(1.055); }
.work-ol {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(to top, rgba(10, 9, 8, 0.34), transparent 42%);
  opacity: 0; transition: opacity 0.55s var(--ease);
}
.work-item a:hover .work-ol { opacity: 1; }
.work-arrow {
  position: absolute; right: 18px; bottom: 16px; z-index: 3;
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); color: var(--ink); font-size: 18px;
  transform: translateY(14px) scale(0.85); opacity: 0;
  transition: transform 0.5s var(--ease), opacity 0.4s var(--ease);
}
.work-item a:hover .work-arrow { transform: none; opacity: 1; }
.work-meta {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 8px 22px; align-items: baseline; margin-top: 22px;
}
.work-num { font-size: 12px; letter-spacing: 0.14em; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.work-title { font-size: clamp(20px, 2.1vw, 28px); font-weight: 650; letter-spacing: -0.02em; line-height: 1.15; }
.work-cat { font-size: 12.5px; color: var(--ink-faint); letter-spacing: 0.04em; text-align: right; white-space: nowrap; }

/* ---------------- Sobre ---------------- */
.about { background: var(--ink); color: var(--bg); position: relative; }
.about .eyebrow { color: color-mix(in srgb, var(--bg) 52%, transparent); }
.about-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(40px, 6vw, 100px); align-items: center; }
.about-photo { position: relative; aspect-ratio: 4 / 5; background: #1b1a18; overflow: hidden; }
.about-photo .plx { position: absolute; inset: -8% 0; will-change: transform; }
.about-photo img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(1) contrast(1.04);
  transition: filter 0.9s var(--ease), transform 1.1s var(--ease);
}
.about-photo:hover img { filter: grayscale(0) contrast(1); transform: scale(1.03); }
.about-photo .placeholder {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 14px; text-align: center; padding: 24px;
}
.about-photo .placeholder .mono {
  font-family: var(--serif); font-style: italic; font-size: clamp(60px, 9vw, 128px);
  color: color-mix(in srgb, var(--bg) 28%, transparent); line-height: 1;
}
.about-photo .placeholder small { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: color-mix(in srgb, var(--bg) 40%, transparent); }
.about-content h2 {
  font-size: clamp(30px, 4.4vw, 62px); font-weight: 650; letter-spacing: -0.035em; line-height: 1.04;
  margin: 22px 0 32px;
}
.about-content h2 em { font-family: var(--serif); font-style: italic; font-weight: 400; }
.about-lead { font-size: clamp(17px, 1.6vw, 21px); line-height: 1.62; color: color-mix(in srgb, var(--bg) 82%, transparent); max-width: 56ch; }
.about-skills { margin-top: 42px; display: flex; flex-wrap: wrap; gap: 10px; }
.about-skills span {
  font-size: 12.5px; letter-spacing: 0.02em;
  border: 1px solid color-mix(in srgb, var(--bg) 22%, transparent);
  padding: 9px 18px; border-radius: 100px; color: color-mix(in srgb, var(--bg) 80%, transparent);
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease), border-color 0.4s var(--ease);
}
.about-skills span:hover { background: var(--bg); color: var(--ink); border-color: var(--bg); }

/* ---------------- Contato ---------------- */
.contact { padding-block: clamp(96px, 13vw, 190px); }
.contact h2 { font-size: clamp(42px, 8.8vw, 136px); font-weight: 700; letter-spacing: -0.05em; line-height: 0.94; }
.contact h2 em { font-family: var(--serif); font-style: italic; font-weight: 400; }
.contact-mail { display: inline-flex; align-items: center; gap: 18px; margin-top: 40px; }
.contact-mail a {
  font-size: clamp(20px, 3vw, 42px); font-weight: 500; letter-spacing: -0.02em;
  position: relative; padding-bottom: 8px;
}
.contact-mail a::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px;
  background: var(--ink); transform: scaleX(1); transform-origin: 0 0;
  transition: transform 0.5s var(--ease);
}
.contact-mail a:hover::after { transform: scaleX(0.2); }
.contact-mail .mail-arrow {
  font-size: clamp(20px, 2.6vw, 34px);
  transition: transform 0.4s var(--ease);
}
.contact-mail:hover .mail-arrow { transform: translate(6px, -6px); }

.contact-links {
  margin-top: 64px; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 32px; padding-top: 36px; border-top: 1px solid var(--line);
}
.contact-links .col small { display: block; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 10px; }
.contact-links .col a, .contact-links .col span { font-size: 16px; font-weight: 500; }
.contact-links .col a { display: inline-block; transition: transform 0.35s var(--ease), opacity 0.3s; }
.contact-links .col a:hover { transform: translateX(6px); opacity: 0.6; }

/* ---------------- Footer ---------------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 40px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer-inner small { color: var(--ink-faint); font-size: 13px; }
.to-top { font-size: 13px; letter-spacing: 0.04em; display: inline-flex; align-items: center; gap: 8px; }
.to-top .arrow { transition: transform 0.35s var(--ease); }
.to-top:hover .arrow { transform: translateY(-4px); }

/* ============================================================
   PÁGINA DE CASE
   ============================================================ */
.case-hero { padding-top: 150px; }
.back-link {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 13.5px; color: var(--ink-soft);
  margin-bottom: clamp(40px, 7vw, 88px);
  transition: gap 0.3s var(--ease), color 0.3s;
}
.back-link:hover { gap: 15px; color: var(--ink); }
.case-title { font-size: clamp(42px, 8.2vw, 126px); font-weight: 700; letter-spacing: -0.05em; line-height: 0.93; }
.case-title em { font-family: var(--serif); font-style: italic; font-weight: 400; }
.case-tagline {
  font-family: var(--serif); font-size: clamp(19px, 2.4vw, 30px);
  line-height: 1.4; max-width: 32ch; margin-top: 36px; color: var(--ink-soft);
}
.case-meta {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px;
  margin-top: clamp(48px, 7vw, 92px); padding-top: 34px; border-top: 1px solid var(--line);
}
.case-meta .col small { display: block; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 9px; }
.case-meta .col p { font-size: 16px; font-weight: 500; letter-spacing: -0.01em; }

.case-lead { margin-top: clamp(48px, 7vw, 88px); }
.case-lead-img {
  position: relative; overflow: hidden; background: var(--bg-2); cursor: zoom-in;
  aspect-ratio: 16 / 9;
}
.case-lead-img .plx { position: absolute; inset: -8% 0; will-change: transform; }
.case-lead-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.case-lead-img:hover img { transform: scale(1.025); }

.case-body { padding-block: clamp(72px, 11vw, 150px); }
.case-overview { display: grid; grid-template-columns: 1.55fr 0.9fr; gap: clamp(40px, 7vw, 110px); align-items: start; }
.case-label { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; margin-bottom: 22px; }
.case-copy p { font-size: clamp(16px, 1.35vw, 19px); line-height: 1.66; }
.case-copy p + p { margin-top: 20px; }
.case-copy-en { margin-top: 36px; padding-top: 30px; border-top: 1px solid var(--line); }
.case-copy-en p { color: var(--ink-soft); font-size: clamp(14.5px, 1.15vw, 16.5px); line-height: 1.6; }
.case-lang { display: block; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; margin-bottom: 16px; }
.case-note { margin-top: 34px; font-family: var(--serif); font-style: italic; font-size: clamp(17px, 1.7vw, 21px); line-height: 1.45; color: var(--ink-soft); }

.case-credits { position: sticky; top: 110px; }
.case-credits .credit-row { display: flex; flex-direction: column; gap: 3px; padding: 16px 0; border-top: 1px solid var(--line); }
.case-credits .credit-row:last-child { border-bottom: 1px solid var(--line); }
.case-credits .credit-role { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
.case-credits .credit-name { font-size: 16px; font-weight: 500; letter-spacing: -0.01em; }

/* Galeria */
.case-gallery { padding-bottom: clamp(72px, 11vw, 150px); }
.gallery-head { margin-bottom: 44px; }
.gallery-head .eyebrow { margin-bottom: 12px; }
.gallery-head h2 { font-size: clamp(24px, 3vw, 40px); font-weight: 650; letter-spacing: -0.02em; }
.gallery-grid { columns: 2; column-gap: clamp(16px, 2.4vw, 32px); }
.gallery-grid figure {
  break-inside: avoid; margin-bottom: clamp(16px, 2.4vw, 32px);
  background: var(--bg-2); overflow: hidden; cursor: zoom-in; position: relative;
}
.gallery-grid img { width: 100%; height: auto; transition: transform 1s var(--ease); }
.gallery-grid figure:hover img { transform: scale(1.035); }

/* Próximo case */
.next-case { border-top: 1px solid var(--line); }
.next-case a {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding-block: clamp(64px, 10vw, 140px);
  transition: background-color 0.55s var(--ease), color 0.55s var(--ease);
}
.next-case a:hover { background: var(--ink); color: var(--bg); }
.next-case small { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); }
.next-case h2 { font-size: clamp(34px, 6vw, 92px); font-weight: 700; letter-spacing: -0.045em; line-height: 1; margin-top: 14px; }
.next-case .arrow-lg { font-size: clamp(34px, 6vw, 80px); transition: transform 0.45s var(--ease); }
.next-case a:hover .arrow-lg { transform: translateX(18px); }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(12, 11, 10, 0.96);
  display: flex; align-items: center; justify-content: center; padding: 5vw;
  opacity: 0; pointer-events: none; transition: opacity 0.4s var(--ease);
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img {
  max-width: 100%; max-height: 88vh; width: auto; height: auto; object-fit: contain;
  transform: scale(0.965); transition: transform 0.45s var(--ease);
}
.lightbox.open img { transform: scale(1); }
.lightbox .lb-close { position: absolute; top: 22px; right: 26px; color: #fff; font-size: 30px; line-height: 1; opacity: 0.8; z-index: 2; }
.lightbox .lb-close:hover { opacity: 1; }
.lightbox .lb-nav { position: absolute; top: 50%; transform: translateY(-50%); color: #fff; font-size: 38px; opacity: 0.6; padding: 20px; z-index: 2; }
.lightbox .lb-nav:hover { opacity: 1; }
.lightbox .lb-prev { left: 10px; }
.lightbox .lb-next { right: 10px; }
.lightbox .lb-count {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7); font-size: 12.5px; letter-spacing: 0.14em; font-variant-numeric: tabular-nums;
}

/* ---------------- Responsivo ---------------- */
@media (max-width: 900px) {
  .nav { gap: 20px; }
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { max-width: 400px; }
  .case-meta { grid-template-columns: repeat(2, 1fr); }
  .case-overview { grid-template-columns: 1fr; gap: 48px; }
  .case-credits { position: static; }
}
@media (max-width: 680px) {
  .brand { font-size: 13.5px; white-space: nowrap; }
  .brand small { display: none; }
  .nav { gap: 14px; }
  .nav a { font-size: 12.5px; }
  .work-grid { grid-template-columns: 1fr; }
  .work-item.wide { grid-column: auto; }
  .work-item .work-thumb, .work-item.wide .work-thumb { aspect-ratio: 4 / 3; }
  .gallery-grid { columns: 1; }
  .hero-bottom { flex-direction: column; align-items: flex-start; gap: 36px; }
  .scroll-cue { display: none; }
  .work-meta { grid-template-columns: 1fr; gap: 6px; }
  .work-cat { text-align: left; }
}

/* ----- Hero em viewport retrato -----
   O vídeo é 16:9 e o retrato ocupa a faixa dos 48% aos 87% da largura
   do quadro — a metade esquerda é parede vazia, que no desktop serve de
   espaço negativo para o texto. Em retrato o `cover` escala pela altura
   e o recorte central cai justamente na parede, deixando o rosto fora
   da tela. Reancoramos o recorte no sujeito. */
@media (max-width: 900px) and (orientation: portrait) {
  .hero-bg video { object-position: 66% center; }
}

@media (max-width: 680px) {
  /* Num telefone só ~26% da largura do quadro cabe na tela, então texto
     e retrato não convivem lado a lado: o texto desce para a base, sobre
     o gradiente, e o retrato fica com o resto. */
  .hero-bg video { object-position: 76% center; }
  .hero-video { justify-content: flex-end; padding-bottom: 56px; }
  .hero-scrim {
    background: linear-gradient(to top,
      rgba(10, 9, 8, 0.92) 0%, rgba(10, 9, 8, 0.7) 30%,
      rgba(10, 9, 8, 0.3) 55%, rgba(10, 9, 8, 0.36) 84%, rgba(10, 9, 8, 0.62) 100%);
  }
  /* aqui o texto assenta sobre o retrato, não sobre a parede que acende:
     fica claro nas duas fases, e o scrim não some junto com hero-lit */
  body.hero-lit .hero-video {
    --hfg: #f5f3ef;
    --hfg-soft: rgba(245, 243, 239, 0.62);
    --hfg-line: rgba(245, 243, 239, 0.5);
    --hinv: #0f0e0c;
  }
  body.hero-lit .hero-scrim { opacity: 1; }
  body.video-top.hero-lit .site-header:not(.scrolled) .brand,
  body.video-top.hero-lit .site-header:not(.scrolled) .nav a { color: var(--bg); }
  body.video-top.hero-lit .site-header:not(.scrolled) .brand small { color: rgba(245, 243, 239, 0.55); }
  body.video-top.hero-lit .site-header:not(.scrolled) .nav a::after { background: var(--bg); }
}

/* ---------------- Acessibilidade: reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .rv, .rw .wi { opacity: 1 !important; transform: none !important; }
  .pt, .scroll-cue, #cur-dot, #cur-ring, .amb { display: none !important; }
}
