/*
Theme Name: tavshh
Theme URI: https://tavshh.com
Author: Hector Tavera
Author URI: https://tavshh.com
Description: One-page portfolio for Hector Tavera (tavshh): motion reel, bio, services and floating pieces.
Version: 1.0.0
Requires at least: 6.3
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: tavshh
*/

/* ==========================================================================
   tavshh — one-pager
   Black background, white accents. Font: Archivo (variable width + weight).
   ========================================================================== */

:root {
  --bg: #000;
  --fg: #f5f5f2;
  --muted: rgba(245, 245, 242, 0.55);
  --gutter: clamp(16px, 4vw, 56px);
  --header-h: 64px;
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

/* No sideways scrolling, whatever flies off the edge (hidden = fallback for older Safari) */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: hidden; overflow-x: clip; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
figure { margin: 0; }
h1, h2, p { margin: 0; font-weight: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 4px; }
::selection { background: var(--fg); color: var(--bg); }

.wrap {
  width: 100%;
  max-width: 1680px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: -9999px; top: 8px; z-index: 100;
  background: var(--fg); color: var(--bg); padding: 8px 12px;
}
.skip:focus { left: 8px; }

/* Shared display type */
.hero__name, .svc, .contact__title, .wordmark, .outline, .sh--letter {
  font-stretch: 125%;
  font-variation-settings: "wdth" 125;
}
.hero__name, .svc, .contact__title, .wordmark { text-transform: uppercase; }

/* ---------- Icon buttons ---------- */
.icon-link {
  display: inline-grid; place-items: center;
  width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid currentColor;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), transform 0.4s var(--ease);
}
.icon-link svg { width: 22px; height: 22px; }
.icon-link:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); transform: translateY(-3px); }
.icon-link--sm { width: 34px; height: 34px; }
.icon-link--sm svg { width: 16px; height: 16px; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding-inline: var(--gutter);
  mix-blend-mode: difference;
  color: #fff;
  transition: opacity 0.3s var(--ease);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }

.wordmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: 0.04em; }
.wordmark__ufo { position: relative; width: 30px; height: 19px; }
.wordmark__ufo svg { width: 100%; height: 100%; animation: hover-bob 2.6s ease-in-out infinite alternate; }
.wordmark__ufo i {
  position: absolute; left: 50%; top: 80%; width: 26px; height: 22px; margin-left: -13px;
  background: linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0));
  clip-path: polygon(35% 0, 65% 0, 100% 100%, 0 100%);
  opacity: 0; transform: scaleY(0.3); transform-origin: top;
  transition: opacity 0.3s, transform 0.4s var(--ease);
}
.wordmark:hover .wordmark__ufo i { opacity: 1; transform: none; }
.wordmark__text { transition: transform 0.5s var(--ease); }
.wordmark:hover .wordmark__text { transform: translateY(-2px); }
@keyframes hover-bob { from { transform: translateY(-2px) rotate(-4deg); } to { transform: translateY(2px) rotate(4deg); } }

.header__right { display: flex; align-items: center; gap: 8px; }
.header__icon { display: none; }
.header__contact {
  margin-left: 12px;
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  padding-bottom: 2px;
  transition: background-size 0.4s var(--ease);
}
.header__contact:hover { background-size: 100% 1px; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow-x: clip; padding-top: calc(var(--header-h) + clamp(56px, 9vw, 120px)); }

.hero__name {
  margin-bottom: clamp(18px, 2.4vw, 32px);
  font-weight: 800;
  /* "HECTOR" is ~5.4em wide in Archivo Expanded ExtraBold: fill the content width */
  font-size: calc((min(100vw, 1680px) - 2 * var(--gutter)) / 5.62);
  line-height: 0.84;
  letter-spacing: -0.02em;
}
.hero__line { display: block; white-space: nowrap; }
.ch {
  display: inline-block;
  transition: transform 0.9s var(--ease), text-shadow 0.6s var(--ease);
}
.ch.is-abducted {
  transform: translate3d(0, -0.32em, 0) rotate(var(--tilt, 4deg));
  text-shadow: 0 0 28px rgba(245, 245, 242, 0.55);
  transition: transform 1.2s var(--ease), text-shadow 0.6s var(--ease);
}

/* The pilot UFO that beams letters up */
.pilot {
  position: absolute; left: 0; top: 0; z-index: 5;
  width: clamp(54px, 6vw, 92px);
  pointer-events: none;
  transform: translate3d(var(--px, -200px), var(--py, -200px), 0);
}
.pilot__ufo { display: block; width: 100%; aspect-ratio: 64 / 40; color: var(--fg); animation: hover-bob 2.2s ease-in-out infinite alternate; }
.pilot__beam {
  position: absolute; left: 50%; top: 62%;
  width: 230%; height: var(--beam, 120px); margin-left: -115%;
  background: linear-gradient(rgba(245, 245, 242, 0.42), rgba(245, 245, 242, 0.04));
  clip-path: polygon(36% 0, 64% 0, 100% 100%, 0 100%);
  transform-origin: top; transform: scaleY(0); opacity: 0;
  transition: transform 0.35s var(--ease), opacity 0.35s;
  z-index: -1;
}
.pilot.is-beaming .pilot__beam { transform: none; opacity: 1; }

/* Roles ticker under the name (right → left; the brands row runs the other way) */
.roles {
  width: calc(100vw - var(--sbw, 0px)); margin-left: calc(50% - 50vw + var(--sbw, 0px) / 2);
  overflow: hidden;
  margin-bottom: clamp(20px, 3vw, 40px);
  font-weight: 600; font-size: clamp(17px, 2.2vw, 30px); line-height: 1;
  font-stretch: 125%; font-variation-settings: "wdth" 125;
  text-transform: uppercase; white-space: nowrap;
}
.roles__track { display: flex; width: max-content; animation: marquee-rtl 30s linear infinite; }
.roles__group { display: flex; align-items: center; }
.roles i { font-style: normal; font-size: 0.5em; margin-inline: 0.9em; color: var(--muted); }
@keyframes marquee-rtl { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Reel ---------- */
.reel { position: relative; aspect-ratio: 16 / 9; background: #0b0b0b; }
.reel__frame { position: absolute; inset: 0; background: #0b0b0b; }
.reel__facade, .reel iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.reel__facade { display: block; overflow: hidden; }
.reel__poster {
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0.78;
  transition: transform 1.2s var(--ease), opacity 0.6s var(--ease);
}
.reel__facade:hover .reel__poster { transform: scale(1.03); opacity: 0.6; }

.reel__play {
  position: absolute; left: 50%; top: 50%;
  width: clamp(84px, 11vw, 148px); aspect-ratio: 1;
  transform: translate(-50%, -50%);
  display: grid; place-items: center; text-align: center;
  border-radius: 50%;
  border: 1px solid var(--fg);
  background: rgba(0, 0, 0, 0.25);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  font-size: clamp(11px, 1vw, 13px); font-weight: 600; line-height: 1.2;
  letter-spacing: 0.14em; text-transform: uppercase;
  transition: background 0.4s var(--ease), color 0.4s var(--ease), transform 0.5s var(--ease);
}
.reel__facade:hover .reel__play { background: var(--fg); color: var(--bg); transform: translate(-50%, -50%) scale(1.08); }

/* Floating players (pinned reel + work videos): small, top-center by default,
   draggable by the bar underneath (--fx/--fy), and an enlarged "big view" with a dimmed page */
.reel.is-pinned .reel__frame,
.mini-player {
  position: fixed; z-index: 60;
  top: 12px; left: 50%; right: auto; bottom: auto;
  width: min(440px, 58vw); aspect-ratio: 16 / 9;
  transform: translateX(-50%);
  translate: var(--fx, 0px) var(--fy, 0px);
  background: #0b0b0b;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(245, 245, 242, 0.14);
  animation: pin-in 0.45s var(--ease);
}
.admin-bar .reel.is-pinned .reel__frame, .admin-bar .mini-player { top: 44px; }
.mini-player[hidden] { display: none; }
.mini-player.is-vertical { width: auto; height: min(52vh, 460px); aspect-ratio: 9 / 16; }
.mini-player__frame, .mini-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.is-dragging iframe { pointer-events: none; } /* keep the drag from getting lost inside the video */
@keyframes pin-in {
  from { opacity: 0; transform: translate(-50%, -18px) scale(0.96); }
  to   { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

/* Control bar under the video: drag grip on the left, buttons on the right */
.float-tools {
  display: none;
  position: absolute; left: 0; right: 0; top: 100%;
  height: 36px; padding: 0 5px 0 10px;
  align-items: center; justify-content: space-between;
  background: #111;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(245, 245, 242, 0.14);
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
}
.reel.is-pinned .float-tools, .mini-player .float-tools { display: flex; }
.is-dragging .float-tools { cursor: grabbing; }
.float-grip { display: flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.float-grip b { font-size: 15px; letter-spacing: 0; color: var(--fg); }
.float-btns { display: flex; gap: 5px; }
.float-tool {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--fg); color: var(--bg);
  font-size: 15px; line-height: 1; cursor: pointer;
  transition: transform 0.3s var(--ease);
}
.float-tool svg { width: 14px; height: 14px; }
.float-tool:hover { transform: scale(1.1); }
.float-tool .i-shrink, .is-theater .float-tool .i-expand { display: none; }
.is-theater .float-tool .i-shrink { display: block; }

/* Big view */
.player-dim {
  position: fixed; inset: 0; z-index: 61;
  background: rgba(0, 0, 0, 0.88);
  animation: fade-in 0.3s var(--ease);
}
.player-dim[hidden] { display: none; }
.reel.is-pinned .reel__frame.is-theater,
.mini-player.is-theater {
  z-index: 62;
  top: 50%; left: 50%;
  width: min(94vw, calc((100vh - 150px) * 16 / 9));
  transform: translate(-50%, calc(-50% - 18px));
  translate: none;
  animation: theater-in 0.35s var(--ease);
}
.mini-player.is-vertical.is-theater { width: auto; height: min(calc(100vh - 150px), calc(94vw * 16 / 9)); }
.is-theater .float-tools { cursor: default; }
.is-theater .float-grip { visibility: hidden; }
@keyframes theater-in { from { opacity: 0; transform: translate(-50%, calc(-50% - 18px)) scale(0.92); } }

@media (max-width: 699px) {
  .player-floating .site-header { opacity: 0; pointer-events: none; }
  .float-grip span { display: none; } /* just the grip icon on phones */
}

/* ---------- About ---------- */
.about { padding-block: clamp(120px, 18vw, 260px) clamp(80px, 10vw, 160px); }
.about__text {
  max-width: 16em;
  font-weight: 600;
  font-size: clamp(30px, 6.4vw, 80px);
  line-height: 1.04;
  letter-spacing: -0.02em;
}
.outline { color: transparent; -webkit-text-stroke: 1.5px var(--fg); }

.about__body {
  margin-top: clamp(40px, 6vw, 88px);
  max-width: 32em;
  font-size: clamp(17px, 1.7vw, 24px); line-height: 1.5;
  color: var(--muted);
}

/* Words split by JS so UFO gravity can pull them individually */
.gw { display: inline-block; }

.brands { margin-top: clamp(64px, 9vw, 140px); }
.brands__label { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); text-align: center; }
/* Full-bleed marquee moving left → right. Extra top padding (cancelled by margin)
   leaves room inside the clipping box for the abducting UFOs. */
.brands__marquee {
  /* Full-bleed: 100vw minus the scrollbar (--sbw is set by JS) */
  width: calc(100vw - var(--sbw, 0px)); margin-left: calc(50% - 50vw + var(--sbw, 0px) / 2);
  overflow: hidden;
  padding-block: 150px 24px; margin-top: -136px; margin-bottom: -24px;
}
.brands__track { position: relative; display: flex; width: max-content; animation: marquee-ltr 46s linear infinite; }
.brands__list {
  --logo-h: clamp(30px, 3.2vw, 50px);
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: center;
  font-size: var(--logo-h); line-height: 1;
}
.brands__list li { display: flex; align-items: center; flex: none; }
/* Logos in white to match the site; their real colors show on hover */
.brands__list img {
  display: block; width: auto; height: calc(var(--logo-h) * var(--s, 1));
  filter: brightness(0) invert(1); opacity: 0.55;
  transition: opacity 0.3s, filter 0.3s;
}
.brands__list li:hover img { filter: none; opacity: 1; }
.brands__list li::after { content: "✦"; margin-inline: 1.1em; font-size: 0.32em; color: rgba(245, 245, 242, 0.3); }
@keyframes marquee-ltr { from { transform: translateX(-50%); } to { transform: translateX(0); } }
@media (max-width: 699px) {
  .brands__list { --logo-h: 26px; }
  .brands__list img { opacity: 0.7; }
}

/* UFO that abducts a brand (lives inside the moving track) */
.brand-ufo {
  position: absolute; z-index: 2;
  width: clamp(48px, 5vw, 76px); aspect-ratio: 64 / 40;
  color: var(--fg); pointer-events: none;
}
.brand-ufo svg { display: block; width: 100%; height: 100%; }
.brand-ufo i {
  position: absolute; left: 50%; top: 62%; z-index: -1;
  width: 260%; margin-left: -130%; height: var(--beam, 80px);
  background: linear-gradient(rgba(245, 245, 242, 0.45), rgba(245, 245, 242, 0.04));
  clip-path: polygon(36% 0, 64% 0, 100% 100%, 0 100%);
  transform-origin: top; transform: scaleY(0); opacity: 0;
  transition: transform 0.35s var(--ease), opacity 0.35s;
}
.brand-ufo.is-beaming i { transform: none; opacity: 1; }

/* ---------- What I do: scroll-driven services ---------- */
/* Fallback (no JS / reduced motion): a simple centered list */
.work { position: relative; }
.work__pin { position: relative; }
.work__track {
  list-style: none; margin: 0; padding: 0 var(--gutter);
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.2em 0.8em;
  position: relative; z-index: 2;
}
.svc {
  font-weight: 700;
  font-size: clamp(28px, 4.4vw, 64px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  white-space: nowrap;
  opacity: 0.28;
  cursor: default;
  transition: opacity 0.45s var(--ease);
}
.svc.is-active { opacity: 1; }
.work__media, .work__descs { display: none; }

/* Pinned mode (set by JS): the row slides sideways while the section is stuck */
.work--pinned .work__pin {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  overflow: hidden;
  display: flex; align-items: center;
}
.work--pinned .work__track {
  flex-wrap: nowrap; justify-content: flex-start; gap: clamp(48px, 8vw, 140px);
  padding-inline: 0;
  will-change: transform;
  mix-blend-mode: difference;
}
.work--pinned .work__media { display: block; position: absolute; inset: 0; pointer-events: none; }
.work--pinned .work__descs {
  display: grid;
  position: absolute; z-index: 2; left: 50%;
  top: calc(50% + clamp(40px, 4.4vw, 64px));
  width: min(34em, 84vw);
  transform: translateX(-50%);
  text-align: center;
  font-size: clamp(16px, 1.3vw, 19px); line-height: 1.5;
  color: rgba(245, 245, 242, 0.8);
  mix-blend-mode: difference;
  pointer-events: none;
}
.work__descs p { grid-area: 1 / 1; opacity: 0; transform: translateY(8px); transition: opacity 0.4s var(--ease), transform 0.5s var(--ease); }
.work__descs p.is-active { opacity: 1; transform: none; }

@media (max-width: 699px) {
  /* Long names wrap onto two centered lines on phones */
  .work--pinned .work__track li { flex: none; width: 80vw; }
  .work--pinned .svc { display: block; width: 100%; white-space: normal; text-align: center; }
  .work--pinned .work__track { gap: 12vw; }
  .work--pinned .work__descs { top: calc(50% + 50px); width: 88vw; font-size: 17px; color: rgba(245, 245, 242, 0.9); }
}

.svc-media { position: absolute; inset: 0; }
.shot {
  position: absolute;
  height: var(--h);
  transform: translate3d(calc(var(--mx, 0) * var(--d, 14) * 1px), calc(var(--my, 0) * var(--d, 14) * 1px), 0);
  transition: transform 0.8s var(--ease);
}
.shot__in {
  position: relative;
  height: 100%;
  opacity: 0;
  transform: translate3d(0, 40px, 0) scale(0.88) rotate(var(--r, 0deg));
  transition: opacity 0.45s var(--ease), transform 0.9s var(--ease);
}
.svc-media.is-active .shot.is-shown .shot__in { opacity: 1; transform: rotate(var(--r, 0deg)); }
.shot:not([data-slot]) { visibility: hidden; } /* waiting in the rotation */
.svc-media.is-active .shot[data-slot="2"] .shot__in { transition-delay: 0.06s; }
.svc-media.is-active .shot[data-slot="3"] .shot__in { transition-delay: 0.12s; }
.svc-media.is-active .shot[data-slot="4"] .shot__in { transition-delay: 0.18s; }
.shot img, .shot video, .shot .ph { height: 100%; width: auto; max-width: none; }
.shot .ph, .shot img, .shot video { animation: bob 7s ease-in-out infinite alternate; }
.shot[data-slot="2"] .ph, .shot[data-slot="2"] img, .shot[data-slot="2"] video { animation-delay: -2s; animation-duration: 8s; }
.shot[data-slot="3"] .ph, .shot[data-slot="3"] img, .shot[data-slot="3"] video { animation-delay: -4s; }
.shot[data-slot="4"] .ph, .shot[data-slot="4"] img, .shot[data-slot="4"] video { animation-delay: -1s; animation-duration: 9s; }
@keyframes bob {
  from { transform: translate3d(0, -8px, 0); }
  to   { transform: translate3d(0, 8px, 0); }
}

/* Playable pieces: a play badge with a pulsing ring */
.svc-media.is-active .shot.is-playable.is-shown { pointer-events: auto; }
.shot__play { position: absolute; inset: 0; display: grid; place-items: center; }
.shot__badge {
  position: relative;
  width: clamp(46px, 4.4vw, 64px); aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--fg); color: var(--bg);
  transition: transform 0.4s var(--ease);
}
.shot__badge svg { width: 42%; height: 42%; margin-left: 8%; }
.shot__badge::before, .shot__badge::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px solid var(--fg);
  animation: pulse 2.2s var(--ease) infinite;
}
.shot__badge::after { animation-delay: 1.1s; }
.shot__play:hover .shot__badge { transform: scale(1.12); }
.shot.is-playable .ph { border-style: solid; border-color: rgba(245, 245, 242, 0.55); }

/* "PLAY" bubble that follows the cursor over playable pieces (desktop) */
.cursor-play {
  position: fixed; left: 0; top: 0; z-index: 70;
  width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--fg); color: var(--bg);
  font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  pointer-events: none;
  opacity: 0; scale: 0.4;
  transition: opacity 0.25s, scale 0.35s var(--ease);
}
.cursor-play.is-on { opacity: 1; scale: 1; }
@media (hover: hover) and (pointer: fine) {
  .cursor-on .shot.is-playable, .cursor-on .shot.is-playable * { cursor: none; }
}

/* Two scatter layouts, alternating per service. Images sit above and below the row. */
.svc-media:nth-child(odd) .shot[data-slot="1"] { left: 5%;  top: 8vh;     --h: 30vh; --r: -5deg; --d: 18; }
.svc-media:nth-child(odd) .shot[data-slot="2"] { right: 6%; top: 5vh;     --h: 26vh; --r: 4deg;  --d: -12; }
.svc-media:nth-child(odd) .shot[data-slot="3"] { left: 22%; bottom: 6vh;  --h: 26vh; --r: 3deg;  --d: -20; }
.svc-media:nth-child(odd) .shot[data-slot="4"] { right: 4%; bottom: 9vh;  --h: 29vh; --r: -4deg; --d: 24; }
.svc-media:nth-child(even) .shot[data-slot="1"] { left: 30%; top: 6vh;    --h: 28vh; --r: 3deg;  --d: -16; }
.svc-media:nth-child(even) .shot[data-slot="2"] { right: 4%; top: 10vh;   --h: 29vh; --r: -6deg; --d: 20; }
.svc-media:nth-child(even) .shot[data-slot="3"] { left: 4%;  bottom: 8vh; --h: 29vh; --r: 5deg;  --d: 14; }
.svc-media:nth-child(even) .shot[data-slot="4"] { right: 14%; bottom: 5vh; --h: 24vh; --r: -3deg; --d: -22; }

/* Phones: two pieces above the row, two below */
@media (max-width: 699px) {
  .shot { height: auto; width: var(--w); }
  .shot img, .shot video, .shot .ph { width: 100%; height: auto; max-height: 26vh; object-fit: cover; }
  .svc-media:nth-child(odd) .shot[data-slot="1"]  { right: auto; left: 4%;  top: 9vh;     --w: 42vw; }
  .svc-media:nth-child(odd) .shot[data-slot="2"]  { right: auto; left: 53%; top: 13vh;    --w: 42vw; }
  .svc-media:nth-child(odd) .shot[data-slot="3"]  { right: auto; left: 5%;  bottom: 7vh;  --w: 42vw; }
  .svc-media:nth-child(odd) .shot[data-slot="4"]  { right: auto; left: 53%; bottom: 4vh;  --w: 42vw; }
  .svc-media:nth-child(even) .shot[data-slot="1"] { right: auto; left: 53%; top: 9vh;     --w: 42vw; }
  .svc-media:nth-child(even) .shot[data-slot="2"] { right: auto; left: 4%;  top: 13vh;    --w: 42vw; }
  .svc-media:nth-child(even) .shot[data-slot="3"] { right: auto; left: 53%; bottom: 7vh;  --w: 42vw; }
  .svc-media:nth-child(even) .shot[data-slot="4"] { right: auto; left: 5%;  bottom: 4vh;  --w: 42vw; }
  .svc-media .shot[data-slot="3"] :is(.ph, img, video), .svc-media .shot[data-slot="4"] :is(.ph, img, video) { max-height: 22vh; }
}

/* Placeholder card (remove once real GIFs/PNGs are in) */
.ph {
  position: relative;
  aspect-ratio: var(--ar, 1);
  display: grid; place-items: center;
  overflow: hidden;
  background: radial-gradient(120% 90% at 30% 20%, #1c1c1c 0%, #0c0c0c 70%);
  border: 1px dashed rgba(245, 245, 242, 0.3);
}
.ph__label {
  position: absolute; left: 10px; bottom: 8px;
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
  white-space: nowrap;
}
.sh { display: block; position: relative; }
.sh--orbit { width: 38%; aspect-ratio: 1; border-radius: 50%; border: 1px solid var(--fg); animation: spin 4s linear infinite; }
.sh--orbit::after {
  content: ""; position: absolute; top: -6px; left: 50%;
  width: 12px; height: 12px; margin-left: -6px; border-radius: 50%;
  background: var(--fg);
}
.sh--pulse { width: 30%; aspect-ratio: 1; border-radius: 50%; background: var(--fg); }
.sh--pulse::before, .sh--pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid var(--fg); animation: pulse 2.4s var(--ease) infinite;
}
.sh--pulse::after { animation-delay: 1.2s; }
.sh--square { width: 32%; aspect-ratio: 1; background: var(--fg); animation: spin 6s var(--ease) infinite; }
.sh--bars { display: flex; gap: 6px; align-items: flex-end; height: 34%; }
.sh--bars b { width: 10px; height: 100%; background: var(--fg); transform-origin: bottom; animation: eq 1.1s ease-in-out infinite alternate; }
.sh--bars b:nth-child(2) { animation-delay: -0.3s; }
.sh--bars b:nth-child(3) { animation-delay: -0.6s; }
.sh--bars b:nth-child(4) { animation-delay: -0.9s; }
.sh--star { width: 40%; aspect-ratio: 1; background: var(--fg); clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); }
.sh--letter {
  font-weight: 900; font-size: 9vh; line-height: 1;
  color: transparent; -webkit-text-stroke: 1.5px var(--fg);
  text-shadow: 6px 6px 0 rgba(245, 245, 242, 0.12);
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { from { transform: scale(1); opacity: 1; } to { transform: scale(2.2); opacity: 0; } }
@keyframes eq { from { transform: scaleY(0.2); } to { transform: scaleY(1); } }

/* ---------- Contact ---------- */
.contact { position: relative; padding-block: clamp(72px, 9vw, 140px) clamp(64px, 8vw, 120px); }

/* A saucer shining its beam on the closing headline (fills the space above it) */
.contact__ufo {
  position: relative;
  width: clamp(120px, 15vw, 210px); aspect-ratio: 64 / 40;
  margin: 0 0 clamp(12px, 2vw, 24px) clamp(8px, 6vw, 120px);
  color: var(--fg);
  animation: hover-bob 2.6s ease-in-out infinite alternate;
}
.contact__ufo svg { position: relative; display: block; width: 100%; height: 100%; }
.contact__ufo i {
  position: absolute; left: 50%; top: 60%;
  width: 360%; margin-left: -180%; height: clamp(260px, 32vw, 460px);
  background: linear-gradient(rgba(245, 245, 242, 0.24), rgba(245, 245, 242, 0.05) 70%, rgba(245, 245, 242, 0));
  clip-path: polygon(40% 0, 60% 0, 100% 100%, 0 100%);
  animation: beam-flicker 3.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes beam-flicker { 0%, 100% { opacity: 1; } 47% { opacity: 0.75; } 50% { opacity: 0.45; } 53% { opacity: 0.85; } }
.contact__title, .contact__lead, .contact__email, .socials { position: relative; z-index: 1; }

.contact__title {
  max-width: 11em;
  font-weight: 800;
  font-size: clamp(40px, 8.4vw, 136px);
  line-height: 0.92;
  letter-spacing: -0.02em;
}
.contact__lead { margin-top: clamp(24px, 3vw, 40px); font-size: clamp(18px, 2vw, 28px); color: var(--fg); }
.contact__hand { display: inline-block; animation: point 1.1s ease-in-out infinite alternate; }
@keyframes point { from { transform: translateY(-3px); } to { transform: translateY(5px); } }
.contact__email {
  display: inline-flex; gap: 0.3em; align-items: baseline;
  margin-top: 12px;
  font-weight: 500;
  font-size: clamp(22px, 4.6vw, 56px);
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  padding-bottom: 4px;
  transition: background-size 0.5s var(--ease);
  word-break: break-all;
}
.contact__email span { transition: transform 0.4s var(--ease); }
.contact__email:hover { background-size: 0 1px; background-position: 100% 100%; }
.contact__email:hover span { transform: translate(4px, -4px); }

.socials { display: flex; align-items: center; gap: 12px; margin-top: clamp(32px, 4vw, 48px); }
.socials__handle { margin-left: 8px; font-size: 14px; letter-spacing: 0.08em; color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px;
  padding-block: 24px 32px;
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.site-footer { position: relative; }
.site-footer__hint { order: 3; width: 100%; display: grid; text-transform: none; letter-spacing: 0.02em; color: rgba(245, 245, 242, 0.35); }
.hint__text, .hint__after { grid-area: 1 / 1; justify-self: start; white-space: nowrap; }
.hint__text { display: inline-block; }
.hint__after { animation: fade-in 0.8s var(--ease); }
.hint__after[hidden] { display: none; }
@keyframes fade-in { from { opacity: 0; } }

/* Footer alien */
.alien {
  position: absolute; left: 0; top: 0; z-index: 2;
  width: 34px; aspect-ratio: 40 / 58;
  pointer-events: none; visibility: hidden;
}
.alien.is-on { visibility: visible; }
.alien svg { display: block; width: 100%; height: 100%; overflow: visible; fill: none; stroke: var(--fg); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.alien .alien__fill { fill: var(--bg); }
.alien .alien__dot { fill: var(--fg); stroke: none; }
.alien__leg { transform-box: fill-box; transform-origin: top; }
.alien__arm { transform-box: fill-box; transform-origin: right; transition: transform 0.25s var(--ease); }
.alien.is-walking .alien__leg--l { animation: step 0.32s ease-in-out infinite alternate; }
.alien.is-walking .alien__leg--r { animation: step 0.32s ease-in-out infinite alternate-reverse; }
.alien.is-walking svg { animation: waddle 0.32s ease-in-out infinite alternate; }
.alien.is-grabbing .alien__arm { transform: rotate(-18deg) scaleX(1.25); }
@keyframes step { from { transform: rotate(-22deg); } to { transform: rotate(22deg); } }
@keyframes waddle { from { transform: translateY(0) rotate(-3deg); } to { transform: translateY(-2px) rotate(3deg); } }
.site-footer a { white-space: nowrap; }
.site-footer a:hover { color: var(--fg); }
.has-ufos .site-footer { padding-bottom: 84px; } /* room for the UFO counter */

/* ---------- UFO flybys + catch game ---------- */
.ufo-sky { position: fixed; inset: 0; z-index: 56; pointer-events: none; overflow: hidden; } /* above the header */
.flyby {
  position: absolute; left: 0; top: 0;
  width: var(--s, 48px); aspect-ratio: 64 / 40;
  padding: 0; color: var(--fg);
  pointer-events: auto; cursor: crosshair;
  will-change: transform;
}
.flyby::before { /* hover area (catching itself uses an even wider radius in JS) */
  content: ""; position: absolute; inset: -26px;
}
.flyby::after { /* speed trail */
  content: ""; position: absolute; top: 55%; height: 2px; width: 260%;
  right: 85%;
  background: linear-gradient(90deg, rgba(245, 245, 242, 0), rgba(245, 245, 242, 0.5));
}
.flyby.is-rtl::after { right: auto; left: 85%; background: linear-gradient(270deg, rgba(245, 245, 242, 0), rgba(245, 245, 242, 0.5)); }
/* Faster saucers leave longer, brighter trails */
.flyby.is-fast::after { width: 420%; }
.flyby.is-streak::after { width: 760%; height: 3px; opacity: 1; filter: drop-shadow(0 0 4px rgba(245, 245, 242, 0.8)); }
.flyby svg { width: 100%; height: 100%; display: block; position: relative; }
/* Gravity ring: a faint warped halo around the saucer */
.flyby__lens {
  position: absolute; left: 50%; top: 50%;
  width: 220%; aspect-ratio: 1; margin: -110% 0 0 -110%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 245, 242, 0) 54%, rgba(245, 245, 242, 0.08) 62%, rgba(245, 245, 242, 0) 70%);
  animation: lens 1.4s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes lens { from { transform: scale(0.85) rotate(0deg); opacity: 0.6; } to { transform: scale(1.1, 0.95) rotate(20deg); opacity: 1; } }
.flyby.is-caught { pointer-events: none; }
.flyby.is-caught::after { display: none; }
.flyby.is-caught svg { animation: caught 0.7s var(--ease) forwards; }
.flyby.is-caught::before {
  inset: -30%; border-radius: 50%; border: 2px solid var(--fg);
  animation: pulse 0.7s var(--ease) forwards;
}
@keyframes caught {
  30% { transform: scale(1.4) rotate(-20deg); }
  to { transform: scale(0) rotate(540deg); opacity: 0; }
}

.ufo-counter {
  position: fixed; left: var(--gutter); bottom: 20px; z-index: 55;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px 8px 10px; border-radius: 999px;
  background: var(--fg); color: var(--bg);
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  animation: pop 0.5s var(--ease);
}
.ufo-counter[hidden] { display: none; }
.ufo-counter svg { width: 30px; aspect-ratio: 64 / 40; color: var(--bg); --ufo-fill: var(--fg); }
.ufo-counter.is-bump { animation: pop 0.5s var(--ease); }
@keyframes pop { 0% { transform: scale(0.6); } 60% { transform: scale(1.12); } 100% { transform: none; } }

/* Reward popup: an 80s declassified case file */
.ufo-win {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: rgba(0, 0, 0, 0.84); overflow: hidden;
}
.ufo-win[open] { display: grid; place-items: center; }
.ufo-win::backdrop { background: transparent; }
.ufo-win__rain { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

/* Falling evidence: polaroids of saucers mixed with work pieces */
.evidence {
  position: absolute; left: 0; top: 0;
  width: clamp(76px, 11vw, 150px);
  padding: 6px 6px 20px;
  background: #f1ece0;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
  will-change: transform;
}
.evidence > * { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; overflow: hidden; }
.evidence .ph { height: auto; border: 0; animation: none; }
.evidence .ph__label { display: none; }
.evidence::after {
  content: attr(data-label); position: absolute; left: 8px; bottom: 4px;
  font: 10px/1 "Special Elite", "Courier New", monospace; color: #3a342a;
}
.ufo-shot { position: relative; display: grid; place-items: center; background: #1b1b1b radial-gradient(circle at 50% 30%, #3a3a3a, #111 70%); filter: grayscale(1) contrast(1.15); }
.ufo-shot svg { width: 64%; aspect-ratio: 64 / 40; color: #eee; position: relative; transform: rotate(-8deg); }
.ufo-shot i {
  position: absolute; left: 50%; top: 46%; width: 70%; height: 60%; margin-left: -35%;
  background: linear-gradient(rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0));
  clip-path: polygon(38% 0, 62% 0, 100% 100%, 0 100%);
}

/* The paper file */
.dossier {
  --ink: #1f1b14;
  --red: #b3261e;
  position: relative; z-index: 1;
  width: min(580px, calc(100vw - 28px));
  max-height: calc(100dvh - 40px); overflow: auto;
  padding: clamp(28px, 5vw, 44px) clamp(22px, 5vw, 44px) clamp(26px, 4vw, 36px);
  color: var(--ink);
  font-family: "Special Elite", "Courier New", Courier, monospace;
  background-color: #ece2c8;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .28 0 0 0 0 .16 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(circle at 82% 88%, rgba(120, 82, 30, 0.18), transparent 22%),
    radial-gradient(circle at 12% 8%, rgba(120, 82, 30, 0.12), transparent 18%),
    linear-gradient(90deg, transparent 49.6%, rgba(60, 40, 10, 0.12) 50%, transparent 50.4%);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.7), inset 0 0 60px rgba(90, 60, 20, 0.25);
  transform: rotate(-1.2deg);
  animation: file-in 0.7s var(--ease);
}
@keyframes file-in { from { opacity: 0; transform: translateY(40px) rotate(-6deg) scale(0.94); } }
.dossier ::selection { background: var(--ink); color: #ece2c8; }

.dossier__close { position: absolute; top: 10px; right: 14px; z-index: 3; font-size: 28px; line-height: 1; color: var(--ink); }
.dossier__head { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.6; border-bottom: 1px dashed rgba(31, 27, 20, 0.5); padding-bottom: 10px; padding-right: 30%; }
.dossier__title {
  margin-top: 22px; padding-right: 32%;
  font-family: var(--font); font-weight: 800; font-size: clamp(24px, 4.4vw, 34px); line-height: 1;
  font-stretch: 125%; font-variation-settings: "wdth" 125; text-transform: uppercase;
}
.dossier__meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; margin: 20px 0 0; }
.dossier__meta div { border-bottom: 1px dotted rgba(31, 27, 20, 0.55); padding-bottom: 4px; }
.dossier__meta dt { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.7; }
.dossier__meta dd { margin: 2px 0 0; font-size: 16px; }
.dossier__body { margin-top: 20px; font-size: 15px; line-height: 1.6; }
.redact { background: var(--ink); color: transparent; border-radius: 1px; padding: 0 0.15em; user-select: none; }

.dossier__stamp {
  position: absolute; z-index: 2;
  padding: 4px 12px;
  border: 3px solid var(--red); border-radius: 4px;
  color: var(--red);
  font-family: var(--font); font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  font-stretch: 125%; font-variation-settings: "wdth" 125;
  mix-blend-mode: multiply; opacity: 0.85;
  pointer-events: none;
}
.dossier__stamp--secret { top: 70px; left: 46%; font-size: 15px; transform: rotate(9deg); text-decoration: line-through 3px; opacity: 0.55; }
.dossier__stamp--declass {
  top: 46%; left: 50%; font-size: clamp(28px, 6vw, 46px);
  transform: translate(-50%, -50%) rotate(-14deg);
  animation: stamp 0.45s cubic-bezier(.3, 1.6, .5, 1) 0.6s both;
}
@keyframes stamp { from { opacity: 0; transform: translate(-50%, -50%) rotate(-14deg) scale(2.4); } }

.dossier__photo {
  position: absolute; z-index: 1; top: 34px; right: clamp(14px, 4vw, 34px);
  width: clamp(104px, 24%, 140px);
  padding: 7px 7px 26px; background: #f6f2e8;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  transform: rotate(5deg);
}
.dossier__pic { position: relative; display: grid; place-items: center; aspect-ratio: 1; overflow: hidden; background: #161616 radial-gradient(circle at 50% 30%, #444, #111 70%); }
.dossier__pic svg { position: relative; width: 66%; aspect-ratio: 64 / 40; color: #eee; transform: rotate(-10deg); }
.dossier__pic i { position: absolute; left: 50%; top: 44%; width: 70%; height: 60%; margin-left: -35%; background: linear-gradient(rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0)); clip-path: polygon(38% 0, 62% 0, 100% 100%, 0 100%); }
.dossier__photo figcaption { position: absolute; left: 10px; bottom: 5px; font-size: 12px; }
.dossier__clip {
  position: absolute; top: -14px; left: 18px; z-index: 2;
  width: 14px; height: 40px; border: 2.5px solid #8b8f96; border-radius: 8px;
  box-shadow: inset 0 0 0 3px transparent;
}

.dossier__cta {
  display: inline-block; margin-top: 24px;
  padding: 12px 18px;
  border: 2px solid var(--ink);
  font-size: 15px; letter-spacing: 0.1em; text-transform: uppercase;
  transition: background 0.25s, color 0.25s;
}
.dossier__cta:hover { background: var(--ink); color: #ece2c8; }
.dossier__sign { margin-top: 22px; text-align: right; font-family: "Caveat", "Segoe Script", cursive; font-size: 30px; line-height: 1; transform: rotate(-3deg); }
.dossier__sign span { display: block; margin-bottom: 4px; font-family: "Special Elite", "Courier New", monospace; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; }

@media (max-width: 520px) {
  .dossier__photo { width: 92px; top: 52px; }
  .dossier__head { padding-right: 0; }
  .dossier__title { padding-right: 104px; }
  .dossier__stamp--secret { top: 150px; left: 30%; }
  .dossier__meta { grid-template-columns: 1fr; }
}

/* ---------- Reveal on scroll (only when JS is on) ---------- */
.js [data-reveal] {
  opacity: 0; transform: translate3d(0, 32px, 0);
  transition: opacity 1s var(--ease), transform 1.1s var(--ease);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ==========================================================================
   Tablet / desktop
   ========================================================================== */
@media (min-width: 700px) {
  .header__icon { display: inline-grid; }
  .site-footer__hint { order: 0; width: auto; }
}

@media (min-width: 900px) {
  /* "HECTOR TAVERA" is ~11.1em wide on one line (letters are split for the UFO, so no kerning) */
  .hero__name {
    font-size: calc((min(100vw, 1680px) - 2 * var(--gutter) - 16px) / 11.25);
    line-height: 0.86; white-space: nowrap;
  }
  .hero__line { display: inline; }
  .svc { cursor: pointer; }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .pilot { display: none; }
}

/* ==========================================================================
   404: "This page was abducted"
   ========================================================================== */
.page-404 {
  min-height: 100vh; min-height: 100svh;
  background:
    radial-gradient(1px 1px at 12% 22%, rgba(245, 245, 242, 0.6), transparent),
    radial-gradient(1px 1px at 78% 14%, rgba(245, 245, 242, 0.5), transparent),
    radial-gradient(1.5px 1.5px at 64% 72%, rgba(245, 245, 242, 0.45), transparent),
    radial-gradient(1px 1px at 28% 84%, rgba(245, 245, 242, 0.4), transparent),
    radial-gradient(1px 1px at 90% 56%, rgba(245, 245, 242, 0.5), transparent),
    var(--bg);
}
.lost {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding-block: calc(var(--header-h) + 24px) 48px;
  text-align: center;
}
.lost__scene { position: relative; display: flex; flex-direction: column; align-items: center; }
.lost__ufo {
  position: relative; z-index: 1;
  width: clamp(110px, 16vw, 200px); aspect-ratio: 64 / 40;
  color: var(--fg);
  animation: hover-bob 2.4s ease-in-out infinite alternate;
}
.lost__ufo svg { position: relative; display: block; width: 100%; height: 100%; }
.lost__ufo i {
  position: absolute; left: 50%; top: 62%; z-index: -1;
  width: 330%; margin-left: -165%; height: clamp(170px, 24vw, 330px);
  background: linear-gradient(rgba(245, 245, 242, 0.32), rgba(245, 245, 242, 0.05) 75%, rgba(245, 245, 242, 0));
  clip-path: polygon(40% 0, 60% 0, 100% 100%, 0 100%);
  animation: beam-flicker 3.2s ease-in-out infinite;
}
.lost__digits {
  display: flex; gap: 0.04em;
  margin-top: clamp(-40px, -2vw, -16px);
  font-weight: 900; font-size: clamp(110px, 26vw, 360px); line-height: 0.9;
  font-stretch: 125%; font-variation-settings: "wdth" 125;
}
/* Each digit gets pulled up the beam, then drops back */
.lost__digits span { display: inline-block; animation: beamed-up 4.2s var(--ease) infinite; }
.lost__digits span:nth-child(2) { animation-delay: 0.35s; }
.lost__digits span:nth-child(3) { animation-delay: 0.7s; }
@keyframes beamed-up {
  0%, 18%, 100% { transform: none; opacity: 1; text-shadow: none; }
  45% { transform: translateY(-0.22em) rotate(-6deg) scale(0.88); opacity: 0.75; text-shadow: 0 0 40px rgba(245, 245, 242, 0.6); }
  60% { transform: translateY(-0.26em) rotate(5deg) scale(0.86); opacity: 0.7; }
}
.lost__title {
  margin-top: clamp(20px, 3vw, 36px);
  font-weight: 800; font-size: clamp(26px, 4.4vw, 56px); line-height: 1;
  font-stretch: 125%; font-variation-settings: "wdth" 125; text-transform: uppercase;
}
.lost__text { margin-top: 14px; max-width: 30em; font-size: clamp(16px, 1.6vw, 20px); color: var(--muted); }
.lost__btn {
  margin-top: clamp(28px, 4vw, 44px);
  padding: 14px 26px; border-radius: 999px;
  background: var(--fg); color: var(--bg);
  font-weight: 600; letter-spacing: 0.04em;
  transition: transform 0.3s var(--ease);
}
.lost__btn:hover { transform: translateY(-3px); }
@media (prefers-reduced-motion: reduce) { .lost__digits span { animation: none; } }
