/* Rapha Pessoa — site */
:root {
  --bg: #0a0a0a;
  --bg-2: #121212;
  --fg: #f3f1ee;
  --muted: #8d8a86;
  --line: rgba(243, 241, 238, .12);
  --red: #e5251f;
  --red-deep: #5a0907;
  --radius: 18px;
  --radius-lg: 28px;
  --pad: clamp(16px, 3.2vw, 48px);
  --sans: "Geist", "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { background: var(--bg); color: var(--fg); font-family: var(--sans); font-size: 16px; line-height: 1.5; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--red); color: #fff; }

.label { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.dot { color: var(--red); }

/* ---------- header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px var(--pad);
  mix-blend-mode: difference; color: #fff;
}
.brand { font-weight: 500; font-size: 15px; letter-spacing: -.01em; }
.site-nav { display: flex; gap: clamp(14px, 2.4vw, 32px); font-size: 13px; }
.site-nav a { opacity: .85; transition: opacity .2s; }
.site-nav a:hover { opacity: 1; }
.header-role { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
@media (max-width: 760px) { .header-role { display: none; } }

/* ---------- hero (reel intro, ref 04) ---------- */
.hero { position: relative; height: 100svh; min-height: 560px; overflow: hidden; background: #000; }
.slide { position: absolute; inset: 0; display: flex; align-items: center; opacity: 0; visibility: hidden; }
.slide.is-on { opacity: 1; visibility: visible; }
.slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); }
.slide.is-on img { animation: kb 2.2s cubic-bezier(.2,.6,.2,1) forwards; }
@keyframes kb { to { transform: scale(1); } }
.slide.has-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.55), rgba(0,0,0,0) 60%); }
.slide--white { background: #f4f3f1; color: #0a0a0a; }
.slide--black { background: #000; color: #fff; }
.slide-text { position: relative; z-index: 2; padding: 0 var(--pad); font-size: clamp(30px, 4.2vw, 68px); font-weight: 400; letter-spacing: -.02em; line-height: 1.1; }
.slide--big .slide-text { width: 100%; text-align: center; font-size: clamp(72px, 14vw, 220px); letter-spacing: -.05em; font-weight: 400; }
.slide-text small { font-size: .28em; letter-spacing: 0; margin-left: .3em; vertical-align: .9em; }
.slide.is-on .slide-text { animation: textIn .7s cubic-bezier(.2,.7,.1,1) both; }
@keyframes textIn { from { opacity: 0; filter: blur(10px); transform: translateY(14px); } }

.hero-ui {
  position: absolute; z-index: 5; left: 0; right: 0; bottom: 0;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  padding: 24px var(--pad);
  mix-blend-mode: difference; color: #fff;
}
.hero-ui p { font-size: 13px; max-width: 32ch; opacity: .85; }
.hero-progress { position: absolute; z-index: 6; left: var(--pad); right: var(--pad); bottom: 0; height: 2px; background: rgba(255,255,255,.15); }
.hero-progress i { display: block; height: 100%; width: 0; background: var(--red); }

.pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px; border-radius: 999px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  font-size: 13px; transition: background .25s, transform .25s;
}
.pill:hover { background: rgba(255,255,255,.2); }
.pill--solid { background: var(--fg); color: var(--bg); border-color: transparent; mix-blend-mode: normal; }
.pill--solid:hover { background: #fff; }
.pill svg { width: 14px; height: 14px; }
.hero-ui .pill { mix-blend-mode: normal; }

/* ---------- section heads ---------- */
.section { padding: clamp(80px, 12vw, 160px) var(--pad); position: relative; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: clamp(32px, 5vw, 64px); }
.section-title { font-size: clamp(28px, 3.4vw, 48px); font-weight: 400; letter-spacing: -.03em; line-height: 1.05; }
.section-title sup { font-family: var(--mono); font-size: 12px; color: var(--red); vertical-align: top; margin-left: 6px; letter-spacing: 0; }

/* ---------- featured carousel (ref 05) ---------- */
.featured { padding: clamp(80px, 10vw, 140px) 0 0; }
.featured .section-head { padding: 0 var(--pad); }
.featured-nav { display: flex; align-items: center; gap: 14px; }
.featured-nav button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; transition: background .2s, border-color .2s, opacity .2s; }
.featured-nav button:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.3); }
.featured-nav button:disabled { opacity: .3; cursor: default; }
.featured-nav svg { width: 16px; height: 16px; }
.featured-track {
  display: flex; gap: clamp(14px, 2vw, 28px);
  padding: 0 var(--pad) 8px; scroll-padding: 0 var(--pad);
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scrollbar-width: none;
  cursor: grab;
}
.featured-track::-webkit-scrollbar { display: none; }
.featured-track.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.featured-track.is-dragging a { pointer-events: none; }
.fcard { position: relative; flex: 0 0 auto; width: min(70vw, 1240px); aspect-ratio: 16 / 9; border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-2); scroll-snap-align: start; }
.fcard img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transition: transform 1.2s cubic-bezier(.2,.7,.1,1); -webkit-user-drag: none; user-select: none; }
.fcard:hover img { transform: scale(1.01); }
.fcard::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.75), rgba(0,0,0,0) 45%); }
.fcard-meta { position: absolute; z-index: 2; left: 24px; right: 24px; bottom: 22px; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.fcard-title { font-size: clamp(17px, 1.6vw, 24px); letter-spacing: -.02em; line-height: 1.15; }
.fcard-title span { display: block; color: rgba(255,255,255,.6); font-size: 13px; letter-spacing: 0; margin-top: 4px; }
.fcard-idx { position: absolute; z-index: 2; top: 20px; left: 24px; font-family: var(--mono); font-size: 11px; color: rgba(255,255,255,.75); }
.featured-count { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.featured-count b { color: var(--fg); font-weight: 400; }
@media (max-width: 760px) { .fcard { width: 84vw; aspect-ratio: 4 / 5; } .featured-nav button { display: none; } .featured .section-head { flex-direction: row; align-items: flex-end; } }

/* ---------- work grid (refs 01 + 03) ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button {
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line);
  font-size: 12px; color: var(--muted); transition: all .2s;
}
.filters button:hover { color: var(--fg); border-color: rgba(255,255,255,.3); }
.filters button.is-active { background: var(--fg); color: var(--bg); border-color: var(--fg); }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(12px, 1.6vw, 22px); }
@media (max-width: 1000px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; } }
.card { position: relative; display: block; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; background: var(--bg-2); isolation: isolate; }
.card img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s cubic-bezier(.2,.7,.1,1), filter .6s; }
.card::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(to top, rgba(0,0,0,.82) 0%, rgba(0,0,0,.25) 38%, rgba(0,0,0,0) 60%); }
.card::after { content: ""; position: absolute; inset: 0; z-index: 1; background: radial-gradient(120% 90% at 0% 100%, rgba(229,37,31,.55), rgba(229,37,31,0) 60%); opacity: 0; transition: opacity .5s; }
.card:hover img { transform: scale(1.05); }
.card:hover::after { opacity: 1; }
.card-cat { position: absolute; z-index: 2; top: 14px; left: 14px; padding: 5px 10px; border-radius: 999px; background: rgba(0,0,0,.35); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.85); }
.card-meta { position: absolute; z-index: 2; left: 18px; right: 18px; bottom: 16px; }
.card-title { font-size: 15px; letter-spacing: -.01em; line-height: 1.25; }
.card-client { font-size: 12px; color: rgba(255,255,255,.6); }
.card.is-hidden { display: none; }

/* ---------- tilted wall (ref 02) ---------- */
.wall { position: relative; height: 110svh; min-height: 640px; overflow: hidden; background: #050505; }
.wall-stage { position: absolute; inset: -20% -30%; perspective: 1600px; }
.wall-plane { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 22px; transform: rotateX(38deg) rotateZ(-16deg); transform-style: preserve-3d; }
.wall-row { display: flex; gap: 22px; width: max-content; }
.wall-row img { width: 340px; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 16px; filter: saturate(.9) brightness(.75); }
.wall::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(45% 40% at 50% 50%, rgba(5,5,5,.7), rgba(5,5,5,.35) 60%, rgba(5,5,5,.92) 90%),
    linear-gradient(to bottom, #050505 0%, rgba(5,5,5,0) 18%, rgba(5,5,5,0) 82%, var(--bg) 100%); }
.wall-copy { position: relative; z-index: 3; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 var(--pad); }
.wall-copy h2 { font-size: clamp(34px, 5.6vw, 88px); font-weight: 400; letter-spacing: -.045em; line-height: 1; max-width: 14ch; }
.wall-copy p { margin-top: 22px; color: rgba(255,255,255,.65); max-width: 46ch; }

/* ---------- clients ---------- */
.clients-grid { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
@media (max-width: 1000px) { .clients-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 560px) { .clients-grid { grid-template-columns: repeat(3, 1fr); } }
.client { min-width: 0; height: clamp(96px, 10vw, 150px); display: grid; place-items: center; padding: 16px 22%; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.client img { max-height: clamp(30px, 3.4vw, 52px); width: auto; max-width: 100%; object-fit: contain; opacity: .55; transition: opacity .3s; }
.client:hover img { opacity: 1; }

/* ---------- about (ref 06 gradient) ---------- */
.about { overflow: hidden; }
.about::before { content: ""; position: absolute; width: 80vw; height: 80vw; left: -30vw; bottom: -40vw; border-radius: 50%; background: radial-gradient(circle, rgba(229,37,31,.38), rgba(229,37,31,0) 60%); pointer-events: none; }
.about-grid { position: relative; display: grid; grid-template-columns: 5fr 7fr; gap: clamp(28px, 6vw, 96px); align-items: start; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } }
.about-photo { border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 4 / 5; }
.about-photo img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); }
.about h2 { font-size: clamp(30px, 3.8vw, 58px); font-weight: 400; letter-spacing: -.035em; line-height: 1.04; }
.about-lead { font-size: clamp(18px, 1.6vw, 22px); margin: 28px 0 18px; letter-spacing: -.01em; }
.about-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; color: rgba(255,255,255,.65); font-size: 15px; }
@media (max-width: 560px) { .about-cols { grid-template-columns: 1fr; } }
.stats { display: flex; gap: clamp(24px, 4vw, 56px); margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); }
.stat b { display: block; font-size: clamp(36px, 4vw, 56px); font-weight: 400; letter-spacing: -.04em; line-height: 1; }
.stat span { font-size: 12px; color: var(--muted); }

.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(12px, 1.6vw, 22px); margin-top: clamp(64px, 8vw, 120px); position: relative; }
@media (max-width: 860px) { .services { grid-template-columns: 1fr; } }
.service { position: relative; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 4 / 5; isolation: isolate; }
.service img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) brightness(.6); transition: transform 1s cubic-bezier(.2,.7,.1,1), filter .6s; z-index: -1; }
.service:hover img { transform: scale(1.05); filter: grayscale(.2) brightness(.6); }
.service::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(90,9,7,.85), rgba(0,0,0,0) 55%); }
.service-body { position: absolute; left: 24px; right: 24px; bottom: 24px; }
.service-body .label { color: var(--red); }
.service h3 { font-size: 24px; font-weight: 400; letter-spacing: -.02em; margin: 8px 0 4px; }
.service p { font-size: 14px; color: rgba(255,255,255,.7); }

/* ---------- contact ---------- */
.contact { padding-bottom: 40px; overflow: hidden; background:
  radial-gradient(90% 70% at 20% 110%, rgba(229,37,31,.55), rgba(229,37,31,0) 60%),
  radial-gradient(70% 60% at 100% 120%, rgba(90,9,7,.9), rgba(90,9,7,0) 60%), var(--bg); }
.contact-big { display: inline-flex; align-items: baseline; gap: .15em; font-size: clamp(64px, 13vw, 210px); font-weight: 400; letter-spacing: -.06em; line-height: .9; margin: 24px 0 56px; }
.contact-big .arrow { color: var(--red); font-size: .5em; transition: transform .4s; }
.contact-big:hover .arrow { transform: translate(8px, -8px); }
.contact-links { display: flex; flex-wrap: wrap; gap: 10px; }
.site-footer { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: clamp(80px, 10vw, 140px); padding-top: 20px; border-top: 1px solid var(--line); }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(28px); }

/* ---------- page transition (ref 07) ---------- */
.pt { position: fixed; inset: 0; z-index: 100; pointer-events: none; display: flex; align-items: flex-end; padding: var(--pad); background: var(--fg); color: var(--bg); transform: translateY(100%); }
.pt-text { overflow: hidden; font-size: clamp(40px, 7vw, 110px); letter-spacing: -.05em; line-height: 1; }
.pt-text span { display: inline-block; }
html.pt-in .pt { transform: translateY(0); }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 90; display: none; align-items: center; justify-content: center; padding: var(--pad); background: rgba(0,0,0,.88); backdrop-filter: blur(8px); }
.modal.is-open { display: flex; }
.modal-frame { width: min(1280px, 100%); aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; }
.modal-frame iframe { width: 100%; height: 100%; border: 0; }
.modal-close { position: absolute; top: 20px; right: var(--pad); }

/* ---------- project page ---------- */
.p-hero { position: relative; height: 92svh; min-height: 520px; padding: 0 var(--pad) var(--pad); display: flex; align-items: flex-end; }
.p-hero-media { position: absolute; inset: 72px var(--pad) var(--pad); border-radius: var(--radius-lg); overflow: hidden; }
.p-hero-media img { width: 100%; height: 100%; object-fit: cover; }
.p-hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.8), rgba(0,0,0,0) 55%); }
.p-hero-copy { position: relative; z-index: 2; padding: 0 28px 28px; }
.p-hero-copy h1 { font-size: clamp(40px, 7vw, 112px); font-weight: 400; letter-spacing: -.05em; line-height: .95; }
.p-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding: 40px var(--pad); border-bottom: 1px solid var(--line); }
@media (max-width: 700px) { .p-meta { grid-template-columns: 1fr; } }
.p-meta div p { margin-top: 6px; }
.p-video { padding: clamp(48px, 7vw, 96px) var(--pad); }
.p-video-frame { border-radius: var(--radius-lg); overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.p-video-frame.is-vertical { aspect-ratio: 9 / 16; max-width: 440px; margin: 0 auto; }
.p-video-frame iframe { width: 100%; height: 100%; border: 0; }
.p-video-empty { display: grid; place-items: center; height: 100%; color: var(--muted); font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.p-desc { padding: 0 var(--pad) clamp(48px, 7vw, 96px); display: grid; grid-template-columns: 1fr 2fr; gap: 24px; }
.p-desc p { font-size: clamp(18px, 1.7vw, 24px); letter-spacing: -.015em; max-width: 36ch; }
@media (max-width: 700px) { .p-desc { grid-template-columns: 1fr; } }
.p-next { position: relative; display: block; margin: 0 var(--pad) var(--pad); border-radius: var(--radius-lg); overflow: hidden; height: 60svh; min-height: 360px; }
.p-next img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.55); transition: transform 1s cubic-bezier(.2,.7,.1,1); }
.p-next:hover img { transform: scale(1.04); }
.p-next-copy { position: absolute; left: 28px; bottom: 28px; right: 28px; }
.p-next-copy h2 { font-size: clamp(36px, 6vw, 96px); font-weight: 400; letter-spacing: -.05em; line-height: .95; margin-top: 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- mobile tweaks ---------- */
.pill { white-space: nowrap; }
@media (max-width: 760px) {
  .section-head { flex-direction: column; align-items: flex-start; }
  .hero-ui p { font-size: 12px; }
}

/* ---------- vertical films in the grid ---------- */
.grid { grid-auto-flow: dense; }
.card.is-vertical { grid-row: span 2; aspect-ratio: auto; }
@media (max-width: 600px) { .card.is-vertical { grid-row: auto; aspect-ratio: 4 / 5; } }
