/* Órbita: 3D portfolio stage. Brand tokens live in /site/base.css. */
:root {
  --night: #00081f;
  --line: rgba(255, 255, 255, 0.16);
  --soft: rgba(255, 255, 255, 0.74);
  --pad: max(var(--m), calc(50% - 590px));
}
html { scroll-behavior: smooth; scroll-snap-type: y proximity; overflow-x: clip; }
body { background: var(--night); color: #fff; overflow-x: clip; }
/* Depth comes from the three brand blues; the warm corner sits on near-black so it never reads purple. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(90% 70% at 80% 14%, rgba(0, 36, 146, 0.6), transparent 62%),
    radial-gradient(60% 45% at 4% 100%, rgba(255, 91, 0, 0.1), transparent 62%),
    linear-gradient(180deg, #001447 0%, #000a24 46%, #00040f 100%);
}
.wrap { width: min(1180px, 100% - 2 * var(--m)); margin-inline: auto; }

.gl { position: fixed; top: 0; left: 0; z-index: 0; width: 100%; height: 100lvh; pointer-events: none; opacity: 0; transition: opacity 900ms ease; }
.gl.is-on { opacity: 1; }

header.top { position: fixed; inset: 0 0 auto; z-index: 20; height: 76px; background: linear-gradient(180deg, rgba(0, 8, 31, 0.78), rgba(0, 8, 31, 0)); }
header.top .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
header.top img { height: 34px; width: auto; }
.nav { display: flex; gap: 22px; align-items: center; font: 600 13px/1 var(--text); letter-spacing: 0.06em; text-transform: uppercase; }
.nav a { padding: 10px 0; color: #fff; text-decoration: none; transition: color 160ms ease; }
.nav a:hover { color: var(--laranja); }

main { position: relative; z-index: 1; }
.track { position: relative; height: calc((var(--n, 7) + 1) * 100svh); }
.stage { position: sticky; top: 0; height: 100svh; overflow: clip; --mx: 0; --my: 0; }
.snap { position: absolute; left: 0; top: calc(var(--k) * 100svh); width: 1px; height: 1px; scroll-snap-align: start; pointer-events: none; }

/* --t runs from -1 (scene still ahead) through 0 (in place) to 1 (scene left behind); --a is its absolute value. */
.scene { position: absolute; inset: 0; padding: 96px var(--pad) 48px; visibility: hidden; pointer-events: none; perspective: 1400px; --t: 1; --a: 1; }
.scene.is-live { visibility: visible; }
.scene.is-active { pointer-events: auto; }
.scene .copy { opacity: calc(1 - var(--a) * 2.4); transform: translate3d(0, calc(var(--t) * -64px), 0); }
.scene h1, .scene h2 { transform: translate3d(0, calc(var(--t) * -36px), 0); }

.kicker { display: flex; align-items: center; gap: 12px; font: 600 13px/1 var(--text); letter-spacing: 0.14em; text-transform: uppercase; color: var(--laranja); }
.kicker .count { display: inline-flex; align-items: center; gap: 12px; color: #fff; font-variant-numeric: tabular-nums; }
.kicker .count::after { content: ""; width: 28px; height: 2px; background: var(--laranja); }

.scene-open { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); align-items: center; gap: 32px; }
.scene-open .copy { display: grid; gap: 22px; justify-items: start; }
.scene-open h1 { font-size: clamp(56px, 7.4vw, 112px); line-height: 0.96; padding-bottom: 0.1em; }
.scene-open h1 span { display: block; color: var(--laranja); white-space: nowrap; }
.lede { max-width: 40ch; font-size: 18px; color: var(--soft); }
.start { display: inline-flex; align-items: center; gap: 22px; margin-top: 10px; color: #fff; font: 600 18px/1 var(--text); letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none; }
/* The down arrow never rests: it is the one instruction the page gives. */
.arrow { --size: 96px; --stroke: 7px; position: relative; display: block; flex: none; width: var(--size); height: var(--size); border-radius: 50%; background: var(--laranja); box-shadow: 0 14px 40px rgba(0, 2, 12, 0.5); animation: nudge 1.4s ease-in-out infinite; }
.arrow::before { content: ""; position: absolute; left: 50%; top: 22%; width: var(--stroke); height: 54%; translate: -50% 0; border-radius: 99px; background: #fff; }
.arrow::after { content: ""; position: absolute; left: 50%; top: 38%; width: 34%; height: 34%; translate: -50% 0; rotate: 45deg; border: solid #fff; border-width: 0 var(--stroke) var(--stroke) 0; border-radius: 3px; }
.start:hover .arrow { background: #e65200; }
.mark-slot { justify-self: center; width: min(56svh, 100%); aspect-ratio: 1; }

.scene-work { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 40px; padding-right: calc(var(--pad) + 64px); }
.lead { display: flex; flex-direction: column; gap: 4svh; min-width: 0; }
.num-slot { width: 100%; height: clamp(120px, 26svh, 260px); }
.scene-work .copy { display: grid; gap: 16px; justify-items: start; }
.scene-work h2 { max-width: 12ch; font-size: clamp(40px, 5vw, 76px); text-transform: uppercase; }
.desc { max-width: 38ch; font-size: 18px; color: var(--soft); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.ghost { display: inline-flex; align-items: center; height: 52px; padding: 0 22px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); color: #fff; font: 600 16px/1 var(--text); text-decoration: none; cursor: pointer; transition: border-color 160ms ease, transform 160ms var(--ease-out); }
.ghost:hover { border-color: var(--laranja); }
/* Paulo asked for round buttons on this page; base.css keeps them square for the pages that share it. */
.btn, .ghost { border-radius: 999px; }
.ghost:active { transform: scale(0.97); }

/* The deck flies in from depth and leans toward the pointer; cards keep their own z so the fan has real parallax. */
.deck {
  position: relative; justify-self: center; height: min(60svh, 540px, 36vw); aspect-ratio: var(--ratio, 4 / 5); transform-style: preserve-3d;
  touch-action: pan-y; user-select: none; -webkit-user-select: none;
  transform: translate3d(var(--dx, 0px), calc(var(--t) * -14svh), calc(var(--a) * -760px)) rotateY(calc(var(--t) * -46deg + var(--mx) * 9deg)) rotateX(calc(var(--t) * 14deg + var(--my) * -7deg));
}
.card {
  position: absolute; inset: 0; padding: 0; border: 0; border-radius: 18px; overflow: hidden; cursor: pointer;
  background: var(--azul-3); color: #fff; opacity: calc(1.2 - var(--a) * 2.2);
  box-shadow: 0 30px 80px rgba(0, 2, 12, 0.62), 0 0 0 1px var(--line);
  transition: transform 700ms var(--ease-out), filter 500ms ease;
}
.card img { width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; }
/* One dot per card of a fan; the lit one is the card in front. Dragging sideways turns the fan. */
.dots { position: absolute; left: 0; right: 0; bottom: -30px; display: flex; justify-content: center; gap: 8px; opacity: calc(1 - var(--a) * 2.4); transform: translateZ(70px); pointer-events: none; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.3); transition: background-color 200ms ease, width 200ms var(--ease-out); }
.dots i.is-on { width: 22px; border-radius: 99px; background: var(--laranja); }
.deck:has(.dots) { cursor: grab; }
.deck.is-drag { cursor: grabbing; }
.card::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0) 36%); }
.card[data-pos="0"] { transform: translate3d(0, 0, 70px); }
.card[data-pos="1"] { transform: translate3d(42%, -5%, -110px) rotateY(-16deg) rotateZ(4deg); filter: brightness(0.6); }
.card[data-pos="2"] { transform: translate3d(-42%, 6%, -230px) rotateY(16deg) rotateZ(-5deg); filter: brightness(0.42); }
.card:not([data-pos="0"]):hover { filter: brightness(0.92); }
.card:focus-visible { outline: 3px solid var(--laranja); outline-offset: 4px; }
.play { position: absolute; z-index: 2; left: 50%; top: 50%; width: 64px; height: 64px; translate: -50% -50%; border-radius: 50%; background: var(--laranja); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); transition: scale 200ms var(--ease-out); }
.play::after { content: ""; position: absolute; left: 26px; top: 20px; border-left: 18px solid #fff; border-top: 12px solid transparent; border-bottom: 12px solid transparent; }
.card.is-video:hover .play, .dcard:hover .play { scale: 1.08; }

.rail { position: fixed; z-index: 15; right: 18px; top: 50%; transform: translateY(-50%); display: grid; gap: 6px; padding: 8px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.rail a { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 999px; color: var(--soft); font: 600 10px/1 var(--text); text-decoration: none; transition: background-color 200ms ease, color 200ms ease; }
.rail a:hover { color: #fff; }
.rail a[aria-current="true"] { background: var(--laranja); color: #fff; }
.rail a span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.progress { position: fixed; z-index: 15; inset: auto 0 0; height: 3px; background: rgba(255, 255, 255, 0.08); }
.progress i { display: block; height: 100%; background: var(--laranja); transform-origin: left; transform: scaleX(var(--p, 0)); }

/* The ring is wider than a phone; clipping here keeps it from widening the page. */
.finale { position: relative; min-height: 100svh; display: grid; align-items: center; padding: 120px 0 96px; scroll-snap-align: start; overflow-x: clip; }
.finale h2 { max-width: 16ch; font-size: clamp(40px, 6vw, 76px); text-transform: uppercase; }
.finale h2 span { color: var(--laranja); }
.ring-wrap { position: relative; margin-top: 36px; }
.ring-view { --w: clamp(140px, 15vw, 210px); --r: calc(var(--w) * 1.74); position: relative; height: calc(var(--w) * 16 / 9 + 48px); perspective: 1200px; touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
.ring-view.is-drag { cursor: grabbing; }
.ring { position: absolute; left: 50%; top: 24px; width: 0; height: 0; margin: 0; padding: 0; list-style: none; transform-style: preserve-3d; transform: translateZ(calc(var(--r) * -1)) rotateY(var(--angle, 0deg)); }
.ring li { position: absolute; left: calc(var(--w) / -2); top: 0; width: var(--w); aspect-ratio: 9 / 16; transform: rotateY(calc(var(--i) * var(--step, 36deg))) translateZ(var(--r)); backface-visibility: hidden; --f: 1; }
.ring li.is-back { pointer-events: none; }
.dcard { position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 14px; overflow: hidden; cursor: pointer; background: var(--azul-2); color: #fff; text-align: left; filter: brightness(calc(0.3 + 0.7 * var(--f))); box-shadow: 0 0 0 1px var(--line); }
.dcard img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.dcard::after { content: ""; position: absolute; inset: 45% 0 0; background: linear-gradient(transparent, rgba(0, 12, 48, 0.94)); }
.dcard .play { top: 42%; width: 54px; height: 54px; }
.dcard .play::after { left: 22px; top: 17px; border-left-width: 15px; border-top-width: 10px; border-bottom-width: 10px; }
.dcard .cap { position: absolute; z-index: 2; left: 14px; right: 14px; bottom: 14px; font-size: 13px; line-height: 1.3; color: rgba(255, 255, 255, 0.82); }
.dcard .cap strong { display: block; margin-bottom: 4px; font: 400 21px/1.1 var(--display); color: #fff; }
.dcard:focus-visible { outline: 3px solid var(--laranja); outline-offset: 3px; }
.ring-btn { position: absolute; z-index: 3; top: 50%; translate: 0 -50%; width: 48px; height: 48px; border: 0; border-radius: 50%; background: var(--laranja); color: #fff; font-size: 18px; cursor: pointer; transition: transform 160ms var(--ease-out); }
.ring-btn:active { transform: scale(0.94); }
.ring-btn.prev { left: 0; }
.ring-btn.next { right: 0; }
.end-cta { margin-top: 36px; }

.vmodal { border: 0; padding: 0; background: transparent; max-width: none; overflow: visible; }
.vmodal::backdrop { background: rgba(0, 6, 26, 0.88); }
.vframe { width: min(960px, 92vw); aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.vframe.tall { width: auto; height: min(86svh, 900px); aspect-ratio: 9 / 16; }
.vframe.reel { width: min(400px, 92vw); height: min(720px, 82svh); aspect-ratio: auto; background: #fff; }
.vframe iframe { display: block; width: 100%; height: 100%; border: 0; }
.vclose { position: absolute; top: -48px; right: 0; width: 40px; height: 40px; border: 0; border-radius: 50%; background: #fff; color: var(--azul-3); font-size: 24px; line-height: 1; cursor: pointer; }

/* Without WebGL (or with reduced motion) the index number is plain type instead of particles. */
.dom-num .num-slot::before { content: attr(data-num); display: block; font: 400 clamp(110px, 24svh, 240px) / 0.84 var(--display); color: var(--laranja); }

@keyframes nudge {
  0%, 100% { transform: translateY(-9px); }
  50% { transform: translateY(11px); }
}

/* Between tablet and wide desktop the fan of cards needs the room the rail would take. */
@media (max-width: 1279px) {
  .rail { display: none; }
}
@media (max-width: 899px) {
  .scene { padding: 84px var(--m) 20px; }
  .nav span { display: none; }
  .nav { gap: 14px; font-size: 11px; letter-spacing: 0.04em; }
  header.top { height: 68px; }
  header.top .wrap { gap: 12px; }
  header.top img { height: 28px; }
  .scene-open { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; gap: 12px; }
  .scene-open .mark-slot { order: -1; align-self: center; width: min(31svh, 70vw); }
  .scene-open h1 { font-size: clamp(44px, 13.5vw, 84px); }
  .start { gap: 16px; font-size: 16px; }
  .start .arrow { --size: 76px; --stroke: 6px; }
  .lede, .desc { font-size: 15px; line-height: 1.45; }
  .scene-work { display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 14px; padding-right: var(--m); }
  .lead { display: contents; }
  .num-slot { order: 1; flex: none; height: clamp(52px, 9svh, 84px); }
  .deck { order: 2; flex: none; align-self: center; height: min(34svh, 74vw); margin-bottom: 30px; }
  .dots { bottom: -22px; }
  .scene-work .copy { order: 3; flex: none; gap: 10px; }
  .scene-work h2 { font-size: clamp(30px, 8.6vw, 44px); }
  .card[data-pos="1"] { transform: translate3d(30%, -5%, -110px) rotateY(-16deg) rotateZ(4deg); }
  .card[data-pos="2"] { transform: translate3d(-30%, 6%, -230px) rotateY(16deg) rotateZ(-5deg); }
  .btn, .ghost { height: 46px; padding: 0 18px; font-size: 15px; }
  .dom-num .num-slot::before { font-size: clamp(52px, 9svh, 84px); }
  .rail, .ring-btn { display: none; }
  .finale { padding: 96px 0 72px; }
}
@media (max-width: 359px) {
  .nav a:first-child { display: none; }
}
@media (max-width: 899px) and (max-height: 620px) {
  .scene-work .desc { display: none; }
}

/* Reduced motion: the pinned stage becomes ordinary stacked sections and nothing scrubs. */
html.flat { scroll-behavior: auto; scroll-snap-type: none; }
.flat .track { height: auto; }
.flat .stage { position: static; height: auto; overflow: visible; }
.flat .scene { position: relative; inset: auto; min-height: 100svh; visibility: visible; pointer-events: auto; --t: 0; --a: 0; }
.flat .gl { position: absolute; height: 100svh; }
.flat .rail, .flat .progress { display: none; }
.flat .arrow { animation: none; }
.flat .card { transition: none; }
