/* Másiv: the home's hero video and scroll motion (Tau, 2026-11-26). Loaded after site.css on the home page only.
   html.motion-on is set in the head when the visitor has not asked for reduced motion; motion.js adds motion-running
   when GSAP is there and the animations start. Without it, everything shows after 2.5 s. */

/* Tau's rule for every site: no selectable text or logos, no image or link dragging. Form fields stay usable. */
body {
  -webkit-user-select: none;
  user-select: none;
}
input,
textarea,
select,
[contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
}
img,
a,
video {
  -webkit-user-drag: none;
  user-drag: none;
}

/* The hero video takes the photo's place in the same frame: the same border, gold shadow and 4:3 box. */
.hero-media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--ink);
}
.hero-video-toggle {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}
.hero-video-toggle[hidden] {
  display: none;
}
.hero-video-toggle:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
/* Pause: two bars. Play: a triangle. */
.hero-video-toggle::before,
.hero-video-toggle::after {
  content: "";
  grid-area: 1 / 1;
}
.hero-video-toggle[aria-pressed="false"]::before {
  width: 12px;
  height: 14px;
  background: linear-gradient(90deg, currentColor 0 4px, transparent 4px 8px, currentColor 8px 12px);
}
.hero-video-toggle[aria-pressed="true"]::before {
  width: 0;
  height: 0;
  margin-left: 3px;
  border-style: solid;
  border-width: 8px 0 8px 13px;
  border-color: transparent transparent transparent currentColor;
}

/* Hidden before the first frame, so the hero does not show once and then jump: motion.js plays them in. */
.motion-on .hero-title > span,
.motion-on .hero .eyebrow,
.motion-on .hero-subtitle,
.motion-on .hero-actions,
.motion-on .vanguardia-vertical,
.motion-on .vanguardia-ribbon,
.motion-on [data-reveal] {
  opacity: 0;
}
.motion-on:not(.motion-running) .hero-title > span,
.motion-on:not(.motion-running) .hero .eyebrow,
.motion-on:not(.motion-running) .hero-subtitle,
.motion-on:not(.motion-running) .hero-actions,
.motion-on:not(.motion-running) .vanguardia-vertical,
.motion-on:not(.motion-running) .vanguardia-ribbon,
.motion-on:not(.motion-running) [data-reveal] {
  animation: motion-failsafe 0.01s linear 2.5s forwards;
}
@keyframes motion-failsafe {
  to {
    opacity: 1;
  }
}

/* The frame opens from the bottom up; the clip leaves room for its gold shadow (14 px right and down). */
.motion-on .hero-media {
  clip-path: inset(100% -20px -20px 0);
}
.motion-on:not(.motion-running) .hero-media {
  animation: motion-failsafe-frame 0.01s linear 2.5s forwards;
}
@keyframes motion-failsafe-frame {
  to {
    clip-path: inset(0 -20px -20px 0);
  }
}

/* The title's lines rise from behind their own edge. */
.motion-line-mask {
  display: block;
  overflow: hidden;
  padding-block: 0.12em;
  margin-block: -0.12em;
}

/* Project photos keep their hover zoom while the scroll moves them: both go through these two variables. */
.motion-running .project-media img {
  transform: translate3d(0, var(--motion-y, 0px), 0) scale(calc(var(--motion-scale, 1.06) * var(--motion-reveal, 1)));
}
.motion-running .project-card:hover .project-media img,
.motion-running .project-card:focus-visible .project-media img {
  --motion-scale: 1.1;
}

/* The numbers count up without the line shifting under them. */
.stat-number {
  font-variant-numeric: tabular-nums;
}

/* Words of the introduction light up as it scrolls by. */
.motion-word {
  display: inline-block;
}

@media (prefers-reduced-motion: reduce) {
  .hero-media video {
    animation: none;
  }
}

/* ---------- Option B: the hero is the video, edge to edge (the client chooses between A and B). ---------- */
.theme-vanguardia .hero--video-full {
  min-height: 100svh;
  align-items: flex-end;
  background: var(--ink);
  color: var(--paper);
}
.theme-vanguardia .hero--video-full .hero-media {
  inset: 0;
  width: auto;
  height: auto;
  aspect-ratio: auto;
  border: 0;
  box-shadow: none;
  opacity: 1;
}
/* The shade sits inside the frame, under the pause button, so the button stays clickable and bright. */
.theme-vanguardia .hero--video-full .hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* Darker behind the words (left and bottom), clear on the right, so the small lines stay readable on bright shots. */
  background:
    linear-gradient(90deg, rgba(56, 55, 61, 0.62) 0%, rgba(56, 55, 61, 0.28) 45%, rgba(56, 55, 61, 0) 72%),
    linear-gradient(180deg, rgba(56, 55, 61, 0.45) 0%, rgba(56, 55, 61, 0.08) 28%, rgba(56, 55, 61, 0.16) 55%, rgba(56, 55, 61, 0.84) 100%);
}
.theme-vanguardia .hero--video-full .hero-content {
  padding-top: 120px;
  padding-bottom: 150px;
}
.theme-vanguardia .hero--video-full .hero-title {
  width: auto;
  font-size: clamp(64px, min(15vw, 22svh), 230px);
  color: var(--paper);
}
.theme-vanguardia .hero--video-full .hero-title .outline {
  -webkit-text-stroke: 2px var(--paper);
}
.theme-vanguardia .hero--video-full .eyebrow,
.theme-vanguardia .hero--video-full .hero-subtitle,
.theme-vanguardia .hero--video-full .vanguardia-vertical {
  color: var(--paper);
}
.theme-vanguardia .hero--video-full .button-secondary {
  border-color: var(--paper);
  color: var(--paper);
}
.theme-vanguardia .hero--video-full .hero-video-toggle {
  right: clamp(16px, 3vw, 40px);
  bottom: 128px;
}
.motion-on .hero--video-full .hero-media,
.motion-on:not(.motion-running) .hero--video-full .hero-media {
  clip-path: none;
  animation: none;
}
@media (max-width: 680px) {
  .theme-vanguardia .hero--video-full {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
  }
  .theme-vanguardia .hero--video-full .hero-content {
    padding-top: 110px;
    padding-bottom: 28px;
  }
  .theme-vanguardia .hero--video-full .hero-title {
    font-size: clamp(68px, 24vw, 120px);
  }
  /* On a phone the words fill the lower half: the shade darkens from a quarter down. */
  .theme-vanguardia .hero--video-full .hero-media::after {
    background: linear-gradient(180deg, rgba(56, 55, 61, 0.45) 0%, rgba(56, 55, 61, 0.2) 22%, rgba(56, 55, 61, 0.6) 45%, rgba(56, 55, 61, 0.9) 100%);
  }
  .theme-vanguardia .hero--video-full .hero-video-toggle {
    top: 82px;
    right: 16px;
    bottom: auto;
  }
}

/* ---------- Projects (Raul, 2026-11-26): no numbers on the cards, so none reads as ranked above another; a fourth card,
   Valentina Ocean Living, marked new. ---------- */
.theme-vanguardia .projects-section .project-card .project-meta-wrap::before {
  content: "PROYECTO";
}
.theme-vanguardia .projects-section .project-card:nth-child(even) .project-meta-wrap::before {
  color: var(--gold);
}
.project-badge {
  align-self: flex-start;
  display: inline-block;
  margin: 14px 0 0;
  padding: 7px 12px 6px;
  border: 2px solid var(--ink);
  background: var(--gold);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3em;
  line-height: 1;
  text-transform: uppercase;
}
/* "VALENTINA" is one long word: smaller on laptops so it stays inside its column instead of running under the photo. */
@media (min-width: 681px) {
  .theme-vanguardia .project-card--long-title h3 {
    font-size: clamp(44px, 5.2vw, 78px);
  }
}
