/* GLAYEL · Yelitza Manrique — portfolio */

:root {
  --ink: #080808;
  --wine: #3d0000;
  --wine-soft: #3d1717;
  --rust: #5e1900;
  --cream: #e9ddc2;
  --text: #fff;
  --muted: #a6a6a6;

  --font-display: "Lexend Tera", sans-serif;
  --font-body: "Inter", system-ui, sans-serif;

  --pad: 16px;          /* edge gutter: 16 / 24 / 40 by breakpoint */
  --max: 1600px;        /* content never grows past this (Framer's desktop frame) */
  /* Gutter that centers content once the viewport is wider than --max. The % resolves against the element it is used on. */
  --gutter: max(var(--pad), calc((100% - var(--max)) / 2 + var(--pad)));
  --radius: 8px;
  /* "GLAYEL" in Lexend Tera is ~5.3em wide: size it to fill the content width (cqi = hero width, scrollbar-safe) */
  --wordmark: calc((min(100cqi, var(--max)) - 2 * var(--pad)) / 5.3);

  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-line: cubic-bezier(0.44, 0, 0.56, 1);
  --ease-zoom: cubic-bezier(0, 0.57, 0.67, 0.98);
  --spring: cubic-bezier(0.34, 1.3, 0.64, 1);
}
@media (min-width: 810px) { :root { --pad: 24px; } }
@media (min-width: 1200px) { :root { --pad: 40px; } }

*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: clamp(88px, 11.8vw, 170px); /* anchors land below the fixed header */
}
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

.wordmark {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--wordmark);
  line-height: 1;
  white-space: nowrap;
  text-align: center;
}
.eyebrow {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Header: logo centered, menu button always in the top-right corner ── */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 2.8vw, 40px) var(--pad);
  pointer-events: none;
  view-transition-name: header; /* same header on every page: no crossfade on it */
}
/* Scrim for legibility once content scrolls under the header (hidden at the very top) */
.header::before {
  content: "";
  position: absolute;
  inset: 0 0 -32px;
  z-index: -1;
  background: linear-gradient(to bottom, rgba(8, 8, 8, 0.6), rgba(8, 8, 8, 0));
  opacity: 0;
  transition: opacity 0.3s;
}
.header.is-scrolled::before { opacity: 1; }
/* Inner pages (text under the header): once scrolled, the header is a solid band in the page colour
   with a short fade at its foot, so text slides under it instead of showing behind the logo. */
.inner .header::before { inset: 0 0 -24px; background: linear-gradient(to bottom, var(--ink) calc(100% - 24px), transparent); }
.inner .header.over-media::before { opacity: 0; } /* over pictures it fades out: just the logo (script.js) */
.header__logo { pointer-events: auto; }
.header__logo img {
  width: clamp(52px, 6vw, 84px);
  height: auto;
  transition: opacity 0.4s var(--ease-out);
}

/* ── Logo vector: the piece that plugs the open centre of the isotipo. Same width
   as the header mark and laid exactly over it at rest; script.js moves it with
   translate/rotate as you scroll (out to the right, vertical along the right edge,
   then horizontal onto the footer mark). Hidden without JS. ── */
.logo-vector {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 25;
  width: clamp(52px, 6vw, 84px);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transform-origin: center;
  will-change: transform;
}
.logo-vector img { display: block; width: 100%; height: auto; pointer-events: none; }
html:not(.js) .logo-vector { display: none; }
/* "About" in the top-left corner, level with the menu button on the right. It sits on the
   page, not in the fixed header, so it scrolls away instead of following you. Its top is
   the header's own centre line: top padding + half the logo's height (84 × 90 artwork). */
.corner-about {
  position: absolute;
  z-index: 21;
  left: calc(var(--pad) - 14px); /* the padding is the hit area; the text lines up with the gutter */
  top: calc(clamp(16px, 2.8vw, 40px) + clamp(52px, 6vw, 84px) * 45 / 84);
  translate: 0 -50%; /* not transform: the rise-in animation owns that */
  padding: 14px;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: var(--radius);
  transition: background 0.3s;
}
.corner-about:focus-visible { background: var(--rust); }
.hamburger {
  pointer-events: auto;
  position: absolute;
  right: var(--pad);
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  display: grid;
  place-content: center;
  gap: 12px;
}
.hamburger span {
  display: block;
  width: 48px;
  height: 2px;
  background: var(--text);
  transition: transform 0.3s var(--ease-out);
}
.hamburger[aria-expanded="true"] span:first-child { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:last-child { transform: translateY(-7px) rotate(-45deg); }

/* ── Menu overlay ───────────────────────────────────────────────────── */
.menu {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  background: var(--wine);
  font-family: var(--font-display);
  font-size: clamp(22px, 4vw, 48px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease-out), visibility 0s 0.4s;
}
.menu.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }
.menu a {
  padding: 0.3em 0.6em;
  border-radius: var(--radius);
  transition: background 0.3s, transform 0.3s var(--spring);
}
.menu a:focus-visible { background: var(--rust); }

/* ── Hero ───────────────────────────────────────────────────────────── */
/* hero-stack bounds how long the hero stays pinned: it holds the hero, .about and .works, so the
   hero (photo, GLAYEL) stays put while .about and then the whole wine body slide up over it and
   cover it completely; it only unpins once .works ends, already hidden behind the opaque wine. */
.hero-stack { position: relative; }
.hero {
  position: sticky;
  top: 0;
  min-height: 100svh;
  overflow: hidden;
  container-type: inline-size;
}
.hero__bg, .hero__bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero__bg img {
  object-fit: cover;
  object-position: 50% 42%;
  will-change: transform;
}
.hero__content {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  top: 58%;
  transform: translateY(-50%);
  text-align: center;
}
.hero__by {
  margin-top: clamp(20px, 5vh, 50px);
  font-size: clamp(14px, 1.25vw, 18px);
  letter-spacing: 0.02em;
}
/* The byline links to Sobre mí; a slow, endless pulse (below, JS only) draws the eye to it. */
.hero__by a { display: inline-block; padding: 10px 14px; border-radius: var(--radius); }
.hero__by a:focus-visible { outline: 1px solid var(--text); outline-offset: 2px; }
.chars span { display: inline-block; white-space: pre; }

/* ── About ──────────────────────────────────────────────────────────── */
.about {
  position: relative;
  z-index: 1;
  background: rgba(233, 221, 194, 0.55); /* --cream, translucent */
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--wine);
  padding: clamp(40px, 6vh, 64px) var(--gutter);
  min-height: 209px;
  display: grid;
  place-items: center;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -24px 48px rgba(0, 0, 0, 0.35);
}
.about__text {
  max-width: 1074px;
  text-align: center;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.about__text .line { display: block; }
.about__motto { font-style: italic; }
.smiley {
  width: 1.15em;
  height: 1.15em;
  display: inline-block;
  vertical-align: -0.1em;
  margin-left: 4px;
  transform-origin: 50% 50%;
  animation: smiley-pulse 1.8s var(--ease-line) infinite;
}
@keyframes smiley-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}
@media (max-width: 809px) { .about__text { font-size: 17px; } }

/* ── Works ──────────────────────────────────────────────────────────── */
.works {
  position: relative;
  z-index: 1;
  background: var(--wine); /* plain base wine: the monogram pattern was dropped on purpose */
  padding: 10px var(--gutter);
  display: grid;
  gap: 20px;
}
.card {
  display: block;
  background: var(--wine-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
.card__media {
  position: relative;
  height: min(468px, 60vh);
  overflow: hidden;
  border-radius: var(--radius);
}
.works__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.works__grid .card__media { height: min(320px, 38vh); }
@media (max-width: 809px) { .works__grid { grid-template-columns: 1fr; } }
.card__media > img:first-child {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--spring), opacity 0.4s var(--spring);
}
.works__title {
  padding: 40px 0 12px;
  text-align: center;
  font-size: clamp(16px, 1.6vw, 20px);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #b8a06a;
  opacity: 0.8;
}
/* The menu's Know-how jump lands with this title's own top edge at the top of the screen (its 40px
   padding is the breathing room), cancelling the page-wide anchor offset: by here the header mark has
   faded out, so nothing needs clearing, and the title plus the four cards fit without the end of the
   section above peeking in. */
#know-how { scroll-margin-top: calc(-1 * clamp(88px, 11.8vw, 170px)); }
.js #know-how.reveal { transform: none; } /* fades in without the 24px rise, so the jump lands where it measured */
.works__title-icon { vertical-align: -0.15em; margin-left: 6px; }
.card__caption {
  padding: 14px 20px;
  text-align: right;
  color: var(--muted);
}
.fig {
  position: absolute;
  bottom: 3%;
  height: 88%;
  width: auto;
  transform: translateX(-50%);
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35));
  transition: transform 0.4s var(--spring);
  pointer-events: none;
}
.fig--1 { left: 19.5%; }
.fig--2 { left: 50%; }
.fig--3 { left: 80%; }
@media (max-width: 809px) {
  .fig { height: 62%; }
  .fig--1 { left: 20%; }
  .fig--3 { left: 80%; }
}

/* ── Book (Catarsis): each slide fills the open book, split at the spine; leaves turned by hand. Without JS, the slides stack. ── */
.book { position: relative; padding: 40px var(--pad); user-select: none; }
.book__pages { display: grid; gap: 4px; }
.book__pages img { width: 100%; aspect-ratio: 1600 / 1018; object-fit: cover; -webkit-user-drag: none; }
.book__arrow { display: none; }
.js .book__arrow { display: grid; }
.js .book__arrow:disabled { opacity: 0; pointer-events: none; }
/* Book arrows: a bit bigger than the carousel's, and they bounce (zoom in, settle back) on a
   loop so the book reads as something you can page through. `scale` leaves the centring
   transform alone; reduced motion turns it off with every other animation. */
.slider__arrow.book__arrow { width: 56px; height: 56px; }
.slider__arrow.book__arrow svg { width: 26px; height: 26px; }
@keyframes arrow-bounce {
  0%, 60%, 100% { scale: 1; }
  15% { scale: 1.22; }
  30% { scale: 0.94; }
  45% { scale: 1.08; }
}
.js .book__arrow { animation: arrow-bounce 1.8s ease-in-out infinite; }
.js .book__pages {
  display: block;
  position: relative;
  width: min(100%, calc(78vh * 1600 / 1018)); /* the slide's own ratio, kept inside the viewport */
  margin-inline: auto;
  aspect-ratio: 1600 / 1018;
  perspective: 4000px;
  touch-action: pan-y;
  cursor: pointer;
}
.js .book__leaf {
  position: absolute;
  inset: 0 0 0 50%;
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform 0.8s var(--ease-line);
}
.js .book__leaf.is-flipped { transform: rotateY(-180deg); }
.js .book__leaf.is-dragging { transition: none; }
.js .book__half { position: absolute; inset: 0; width: 100%; height: 100%; backface-visibility: hidden; }
.js .book__half--l { object-position: 0 50%; }    /* left half of the slide: a leaf's back, or the base page under the stack */
.js .book__half--r { object-position: 100% 50%; } /* right half: a leaf's front */
.js .book__leaf .book__half--l { transform: rotateY(180deg); }
.js .book__pages > .book__half { width: 50%; } /* base pages under the two stacks */
.js .book__pages::after { /* gutter shade: reads as the spine and hides the antialiased seam between the two stacks */
  content: "";
  position: absolute;
  inset: 0 calc(50% - 24px);
  z-index: 99;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.22) 50%, transparent);
}
.js .book__pages > .book__half--r { left: 50%; }
/* Under the book: flats, CLO collage and two looping clips side by side, same gap as the book's padding */
.extras { display: grid; gap: 40px; padding: 0 var(--pad) 40px; }
.extras img, .extras video { display: block; width: 100%; height: auto; border-radius: var(--radius); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.jewels { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.jewels__cell { position: relative; overflow: hidden; border-radius: var(--radius); }
.jewels__cell img { display: block; width: 100%; height: auto; border-radius: 0; transition: transform 0.4s var(--spring); }
.zoom-frame { overflow: hidden; border-radius: var(--radius); }
.zoom-frame img { border-radius: 0; transition: transform 0.4s var(--spring); }
@media (max-width: 809px) {
  .book { padding: 24px 0; }
  .extras { gap: 24px; padding: 0 0 24px; }
  .pair { grid-template-columns: 1fr; gap: 24px; }
  .jewels { gap: 12px; }
  .extras img, .extras video { border-radius: 0; }
}

/* ── Footer ─────────────────────────────────────────────────────────── */
.footer {
  position: relative;
  z-index: 1;
  background: var(--wine);
  padding: var(--pad) var(--gutter) clamp(48px, 8vh, 96px);
}
.footer__links {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 0 -14px clamp(48px, 12vh, 128px); /* negative margin keeps the text flush with the gutter */
  font-size: 16px;
}
.footer__links a {
  padding: 14px;
  border-radius: var(--radius);
  transition: background 0.3s, transform 0.3s var(--spring);
}
.footer__links a:focus-visible { background: var(--rust); }
.wordmark--footer {
  display: block;
  width: clamp(52px, 6vw, 84px);
  height: auto;
  margin-inline: auto;
}
/* The footer mark is a link: to the home page from inner pages; on the home page back to the top (script.js glides). */
.footer__top { display: block; width: fit-content; margin-inline: auto; border-radius: 8px; }
.footer__top:focus-visible { outline: 2px solid var(--text); outline-offset: 6px; }

/* ── Hover effects only on devices that hover (no sticky hover on touch) ── */
@media (hover: hover) {
  .card:hover .card__media > img:first-child { transform: scale(1.1); opacity: 0.7; }
  .card:hover .fig { transform: translateX(-50%) translateY(-8px); }
  .jewels__cell:hover img { transform: scale(1.1); }
  .zoom-frame:hover img { transform: scale(1.1); }
  .corner-about:hover { background: var(--rust); }
  .menu a:hover, .footer__links a:hover { background: var(--rust); transform: scale(1.04); }
  .tile a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
  .slider__arrow:hover { background: rgba(0, 0, 0, 0.5); }
  .thumbs button:hover { opacity: 1; }
  .duo:hover { z-index: 2; }
  .duo:hover .duo__fig { transform: translateX(var(--slide, 70%)); }
}

/* ── Animations (only when JS is running) ───────────────────────────── */
@keyframes zoom-in { from { opacity: 0; transform: scale(1.2); } to { opacity: 1; transform: none; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(var(--rise, 10px)); } to { opacity: 1; transform: none; } }
@keyframes line-in {
  from { opacity: 0; filter: blur(10px); transform: translateY(10px); }
  to { opacity: 1; filter: none; transform: none; }
}

.js .hero__bg img { animation: zoom-in 3s var(--ease-zoom) both; }
.js body:not(.inner) :is(.header, .corner-about) { animation: rise-in 0.7s var(--ease-out) 1s both; }
/* The logo piece rises in with the header; `translate` stacks on the transform script.js sets. */
@keyframes piece-in { from { opacity: 0; translate: 0 var(--rise, 10px); } to { opacity: 1; translate: none; } }
.js body:not(.inner) .logo-vector { animation: piece-in 0.7s var(--ease-out) 1s both; }
.js .chars span { animation: line-in 0.4s var(--ease-out) both; animation-delay: calc(var(--i) * 50ms + 0.3s); }
/* Once the byline has typed itself in, it breathes: a slight zoom in and out, on a loop. */
@keyframes by-pulse { 50% { scale: 1.08; } }
.js .hero__by a { animation: by-pulse 2.4s ease-in-out 2s infinite; }
/* Under the pointer (or keyboard focus) it stops breathing and holds a slight zoom, waiting for the click. */
.hero__by a { transition: scale 0.35s var(--ease-out); }
.js .hero__by a:focus-visible { animation: none; scale: 1.1; }
@media (hover: hover) { .js .hero__by a:hover { animation: none; scale: 1.1; } }
/* The G of GLAYEL alone turns about 30° on its own centre (counter-clockwise), springs back with a
   small overshoot and settles. Once as the page loads (with the hero's other entrances), slowly,
   then it stops (script.js marks it .is-done); after that it turns once more each time the pointer
   passes over it or it is clicked/tapped (.is-again). Two keyframe names, so the replay restarts.
   inline-block so it can turn without moving the other letters. */
.wordmark__g { display: inline-block; transform-origin: 50% 50%; }
@keyframes g-turn {
  0% { rotate: 0deg; animation-timing-function: ease-in-out; }
  45% { rotate: -30deg; animation-timing-function: cubic-bezier(0.34, 1.3, 0.64, 1); }
  80% { rotate: 3deg; animation-timing-function: ease-in-out; }
  100% { rotate: 0deg; }
}
@keyframes g-turn-again {
  0% { rotate: 0deg; animation-timing-function: ease-in-out; }
  45% { rotate: -30deg; animation-timing-function: cubic-bezier(0.34, 1.3, 0.64, 1); }
  80% { rotate: 3deg; animation-timing-function: ease-in-out; }
  100% { rotate: 0deg; }
}
.js .wordmark__g { animation: g-turn 2.4s 1; }
.js .wordmark__g.is-done { animation: none; }
.js .wordmark__g.is-again { animation: g-turn-again 2.4s 1; }

.js .about__text .line {
  opacity: 0;
  filter: blur(10px);
  transform: translateY(10px);
  transition: opacity 0.8s var(--ease-line), filter 0.8s var(--ease-line), transform 0.8s var(--ease-line);
}
.js .about__text .line:nth-child(2) { transition-delay: 75ms; }
.js .about__text .line:nth-child(3) { transition-delay: 150ms; }
.js .about__text.is-visible .line { opacity: 1; filter: none; transform: none; }

.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.8s var(--ease-line), transform 0.8s var(--ease-line); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* Inner pages enter rising and fading; title and description appear line by line (Framer values) */
.js .inner main { --rise: 140px; animation: rise-in 0.7s var(--ease-out) both; }
.js .intro__title { animation: line-in 0.8s var(--ease-line) both; }
/* Typewriter title: the letters appear one by one on load (70 ms apart) behind a blinking caret,
   which disappears once the last letter is in; then the title just stays. */
@keyframes type-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes caret-blink { 50% { opacity: 0; } }
.js .intro__title.type { animation: none; }
.js .type span { animation: type-in 1ms linear both; animation-delay: calc(var(--i) * 70ms + 400ms); }
.js .type::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 0.9em;
  margin-left: 4px;
  vertical-align: -0.08em;
  background: currentColor;
  animation: caret-blink 0.6s step-end infinite;
}
.js .type.is-typed::after { display: none; }
.js .intro__desc { animation: line-in 1s var(--ease-line) 75ms both; }

/* Cross-document crossfade between pages (Chrome/Safari); Firefox just navigates. */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.5s; }

@media (prefers-reduced-motion: reduce) {
  .js .wordmark__g { animation: none; }
  .js *, .js *::before, .js *::after { animation: none !important; transition: none !important; }
  .js .about__text .line, .js .reveal { opacity: 1; filter: none; transform: none; }
  html { scroll-behavior: auto; }
  @view-transition { navigation: none; }
}

/* ═══ Inner pages: shared intro (works/<slug>/, about/) ═══════════════ */
.intro {
  padding: clamp(128px, 17vh, 152px) var(--gutter) 10px;
  min-height: 322px;
}
.intro__title {
  font-family: "Milonga", var(--font-display);
  font-weight: 400;
  font-size: 40px;
  line-height: 1.4;
  color: rgba(237, 237, 237, 0.89);
}
.intro__desc {
  max-width: 726px;
  margin-top: 24px;
  line-height: 1.4;
  color: var(--muted);
}
@media (max-width: 809px) { .intro__title { font-size: 32px; } }
/* Intro in the body font (Inter, as the ABOUT link), same title size, laid out in two columns:
   the title on the left, the description on the right at a comfortable measure (~70 characters
   a line), and room before the carousel. One column on phones. */
.intro--plain {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  column-gap: clamp(32px, 6vw, 112px);
  align-items: start;
  min-height: 0;
  padding-top: clamp(176px, 24vh, 208px); /* more air between the header logo and the text */
  padding-bottom: 56px;
}
.intro--plain .intro__title { font-family: var(--font-body); line-height: 1.2; align-self: center; } /* level with the middle of the text */
.intro--plain .intro__desc {
  max-width: 68ch;
  margin-top: 0.45em; /* first line sits level with the title's text */
  font-size: 18px;
  line-height: 1.7;
  color: rgba(237, 237, 237, 0.78);
}
@media (max-width: 809px) {
  .intro--plain { grid-template-columns: 1fr; padding-top: 136px; padding-bottom: 32px; }
  .intro--plain .intro__desc { margin-top: 16px; font-size: 16px; line-height: 1.6; }
}

/* Carousel: native scroll-snap, JS only for arrows, dots and autoplay */
/* Marquee (project pages): the carousel images as tiles of one height, each at its own ratio, drifting
   left in a loop; script.js moves the track and grows the tile nearest the middle (the others shrink
   toward the sides). Without JS, or with reduced motion, it is a strip you scroll by hand. */
.marquee { --tile-h: clamp(260px, 38vw, 600px); --tile-gap: 24px; overflow-x: auto; scrollbar-width: none; padding-inline: var(--gutter); }
.marquee::-webkit-scrollbar { display: none; }
.marquee__track { display: flex; width: max-content; }
.marquee__tile { flex: none; height: var(--tile-h); margin: 0 var(--tile-gap) 0 0; border-radius: var(--radius); overflow: hidden; }
.marquee__tile img { display: block; height: 100%; width: auto; }
.js .marquee.is-looping { overflow: hidden; padding-inline: 0; }
.js .marquee.is-looping .marquee__track, .js .marquee.is-looping .marquee__tile { will-change: transform; }
@media (max-width: 809px) { .marquee { --tile-h: 44vw; --tile-gap: 10px; } } /* narrow enough that both neighbours peek in */
.slider { position: relative; }
.slider__track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.slider__track::-webkit-scrollbar { display: none; }
.slider__slide {
  flex: 0 0 100%;
  margin: 0;
  height: min(77.8vw, 1121px); /* Framer: 1440×1121; same ratio = same crop as the prototype */
  scroll-snap-align: start;
}
.slider__slide img { width: 100%; height: 100%; object-fit: cover; }
.slider__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.2);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s;
}
.slider__arrow--prev { left: 20px; }
.slider__arrow--next { right: 20px; }
.slider__dots {
  position: absolute;
  left: 0; right: 0; bottom: 8px;
  display: flex;
  justify-content: center;
}
.slider__dots button {
  width: 24px; height: 24px; /* 24px hit area, 8px dot */
  padding: 0;
  border: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.45) 4px, transparent 4.5px) center / 100% 100% no-repeat;
  cursor: pointer;
}
.slider__dots button[aria-current="true"] { background-image: radial-gradient(circle, var(--text) 5px, transparent 5.5px); }
.thumbs {
  display: flex;
  gap: 32px;
  padding: 56px var(--gutter) 0;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.thumbs::-webkit-scrollbar { display: none; }
.thumbs button {
  flex: 0 0 143px;
  height: 107px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  opacity: 0.5;
  scroll-snap-align: start;
  transition: opacity 0.3s;
}
.thumbs button[aria-current="true"], .thumbs button:focus-visible { opacity: 1; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 809px) { .thumbs { gap: 16px; padding-top: 32px; } .thumbs button { flex-basis: 100px; height: 75px; } }

.work__body {
  padding: 68px var(--gutter) 0;
  display: grid;
  gap: 24px;
}
.work__body figure { position: relative; margin: 0; }
.work__body figure > img:first-child { width: 100%; height: 100%; object-fit: cover; }
.work__banner { aspect-ratio: 1360 / 1202; }
/* Photo grid (Orfebrería): two per row, every photo in the same 4:5 frame */
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.gallery figure { aspect-ratio: var(--tile, 4 / 5); overflow: hidden; } /* --tile: per page (Orfebrería 9:16) */
.gallery .gallery__wide { grid-column: 1 / -1; } /* a landscape photo on its own row, uncropped (ratio inline) */
@media (max-width: 809px) { .gallery { gap: 10px; } }
/* Fotografía: rows of three, one tone per row, on a 6-track grid so a last row of two sits centred */
.gallery--3 { grid-template-columns: repeat(6, 1fr); }
.gallery--3 > figure { grid-column: span 2; }
.gallery--3 > figure:not(.gallery__pair):nth-last-child(2):nth-child(3n + 1) { grid-column: 2 / span 2; }
.gallery--3 .gallery__pair { grid-column: span 3; aspect-ratio: 3 / 2; } /* a row of two equal landscape tiles */
/* A full row of photos at one height, each whole: columns in fr proportional to each photo's ratio */
.gallery__band { grid-column: 1 / -1; display: grid; gap: inherit; }
.gallery .gallery__band figure { grid-column: auto; aspect-ratio: auto; margin: 0; overflow: hidden; }
/* Clips after the photos (Orfebrería): the same gap as between tiles */
.work__body + .clips { margin-top: 24px; }
@media (max-width: 809px) { .work__body + .clips { margin-top: 10px; } }
/* Clips (CLO3D): two looping videos under the carousel, like GIFs, in equal 9:16 tiles */
.clips { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; max-width: 800px; margin: clamp(32px, 4vw, 64px) auto 0; padding-inline: var(--gutter); box-sizing: content-box; }
.clips--3 { grid-template-columns: repeat(3, 1fr); max-width: 1200px; } /* two clips with a still between */
.clips__still { margin: 0; aspect-ratio: 9 / 16; overflow: hidden; border-radius: var(--radius); }
.clips__still img { display: block; width: 100%; height: 100%; object-fit: cover; }
.clips video { display: block; width: 100%; aspect-ratio: 9 / 16; height: auto; object-fit: cover; border-radius: var(--radius); background: var(--ink); }
.clips + .work__body { padding-top: 24px; } /* clips → collage: the same 24px as between tiles */
@media (max-width: 809px) { .clips { gap: 10px; } .clips + .work__body { padding-top: 10px; } }
/* Illustration grid (Ilustración de Moda): four equal 7:10 tiles a row; a wide piece spans two.
   On phones two a row, and `dense` lets a single fill the hole a wide piece leaves. */
.illus-wrap { container-type: inline-size; }
.illus { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; grid-auto-rows: calc((100cqi - 72px) / 4 * 10 / 7); }
.illus figure { overflow: hidden; border-radius: var(--radius); }
.illus .illus__wide { grid-column: span 2; }
@media (max-width: 809px) { .illus { grid-template-columns: 1fr 1fr; gap: 10px; grid-auto-flow: dense; grid-auto-rows: calc((100cqi - 10px) / 2 * 10 / 7); } }
/* Collage (CLO3D): renders three by three, every tile the same 9:16 frame (cover crops only side backdrop) */
.collage { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; max-width: 1200px; margin-inline: auto; }
.collage figure { aspect-ratio: 9 / 16; overflow: hidden; border-radius: var(--radius); }
@media (max-width: 809px) { .collage { gap: 10px; } }
.over {
  position: absolute;
  width: auto;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35));
  pointer-events: none;
}
/* Figurine + technical flat pairs on the "Lenguaje visual" banner: hover slides the figurine aside */
.duo {
  position: absolute;
  top: 11%;
  height: 78%;           /* all three figurines: same height, bottoms aligned */
  width: max-content;    /* size from the figurine, not from the space left of `left` */
  transform: translateX(-50%); /* `left` is the figurine's centre */
  z-index: 1;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35));
}
.duo__fig, .duo__flat { display: block; width: auto; max-width: none; }
.duo__fig { position: relative; z-index: 1; height: 100%; transition: transform 0.5s var(--spring); }
.duo__flat {
  position: absolute;
  left: 50%;
  top: 46%;
  height: 53%;           /* largest size that stays fully hidden behind every figurine */
  transform: translate(-50%, -50%);
}
@media (max-width: 809px) { .duo__flat { display: none; } }
.work__next { padding: 56px var(--gutter) 96px; display: grid; gap: 20px; }
.work__next .card__media { height: min(468px, 34vw); }
.work__next .card__caption { text-align: left; }
@media (max-width: 809px) { .work__next .card__media { height: 60vw; } }

/* ═══ About page (about/) ════════════════════════════════════════════ */
.about-page main { padding-bottom: 96px; }
/* "Hola soy": the presentation slide itself (1600×900), so its typography stays exactly as designed; the text is repeated hidden for readers and search. */
.hello { padding: clamp(128px, 17vh, 152px) var(--gutter) 0; }
.hello__slide { display: block; width: 100%; height: auto; border-radius: 12px; }
@media (max-width: 809px) { .hello { padding-inline: 0; } .hello__slide { border-radius: 0; } }
/* A looping clip between the hello board and the contact tiles: centred, never wider than its own 480 px
   (the source is 480x480, shown as is: no upscaling, no re-encode), same 26px gap as the tiles. */
.about-clip { padding: 26px var(--gutter) 0; }
.about-clip video { display: block; width: min(100%, 480px); height: auto; aspect-ratio: 1; margin-inline: auto; border-radius: 12px; }
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 16px;
  padding: 26px var(--gutter) 0;
}
.tile {
  padding: 32px;
  background: #121212;
  border-radius: 12px;
}
.tile svg { width: 28px; height: 28px; fill: var(--muted); }
.tile h2 { margin-top: 24px; font-size: 19px; font-weight: 500; }
.tile p, .tile a { display: block; margin-top: 4px; font-size: 16px; color: var(--muted); }
.tile a:focus-visible { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.services { padding: 58px var(--gutter) 0; }
.services__label {
  display: inline-block;
  padding: 16px;
  background: #141414;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 400;
}
.services__list { margin-top: 23px; }
.service {
  padding: 32px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.service:last-child { border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.service h3 { font-size: 19px; font-weight: 500; }
.service p { margin-top: 24px; font-size: 16px; line-height: 1.4; letter-spacing: -0.02em; }
@media (max-width: 809px) {
  .service { padding: 28px 16px; }
}

/* ═══ Book projects (Colección 2025): one beige board from the cover to the last photo; black only outside ═══ */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.book-page main { padding-top: 0; }                       /* the cover starts at the very top, under the header */
.board {
  --paper: #f3e6bd;                                       /* the cream of the PDF's work boards */
  margin: 0 var(--gutter);
  background: var(--paper);
}
.board .book { display: grid; gap: 10px; padding: 0; margin-top: 10px; }      /* every gap on the board is 10px */

/* Láminas rehechas por componentes (build-works.py: SLIDES). Cada lámina es la mesa de trabajo de 1920×1080 del PSD:
   el fondo aplanado va a sangre y cada elemento se coloca con su caja (--x --y --w --h en px del PSD) convertida a %. */
.slide { position: relative; container-type: inline-size; isolation: isolate; }   /* isolate: the blends stay inside */
.slide + .slide { margin-top: -1px; }                                            /* the artwork continues from one to the next: no hairline */
.slide__art { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.slide__bg { display: block; width: 100%; height: 100%; object-fit: cover; }
.slide__title { margin: 0; }
.slide__el {
  position: absolute;
  left: calc(var(--x) / 1920 * 100%);
  top: calc(var(--y) / 1080 * 100%);
  width: calc(var(--w) / 1920 * 100%);
  height: calc(var(--h) / 1080 * 100%);
  display: block;
  margin: 0;
}
.words img { display: block; width: 100%; height: 100%; }
svg.slide__el { overflow: visible; }
.palette, .words { margin: 0; padding: 0; list-style: none; }
.dot { border-radius: 50%; background: var(--c); }
.cover__c { mix-blend-mode: hard-light; }
/* Photoshop's Linear Light / Vivid Light of the cream #f3e6bd: with the colour 2c−1 (= #e7cd7b) they are exactly
   plus-lighter (additive) and color-dodge, which CSS does have. */
.cover__word { color: #e7cd7b; mix-blend-mode: plus-lighter; }
.cover__year { color: #e7cd7b; mix-blend-mode: color-dodge; }
.fem__word { color: #441c11; }
.slide__text {
  position: absolute;
  left: calc(var(--x) / 1920 * 100%);
  top: calc(var(--y) / 1080 * 100%);
  width: calc(var(--w) / 1920 * 100%);
  font: italic 600 calc(29.17cqw / 19.2) / 1.2 "Crimson Pro", "Minion Pro", Georgia, serif;   /* 29.17 pt on 1920 */
  color: rgb(73 34 23 / 0.9);
  text-align: justify;
}
.slide__text p + p { margin-top: 1.2em; }                                        /* the PSD's blank line */
.book__sheet { margin: 0; background: var(--paper); }
.book__sheet img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* A clip between a sheet and its photos, on the same cream, lined up with the sheet above: from where the
   figurine starts (6% of the sheet's width) to where the technical sheet ends (96.92%), measured on nouveau-09.
   The sheet spans the board, so the same percentages hold at every width. */
/* Spacing: the sheet already ends in its own cream margin under the tables (143 of 2400 px, the same as its
   top margin), so the clip adds none above (and swallows the board's 10px gap) and repeats that margin below:
   sheet → clip → photos read evenly. Percent padding is of the board's width, like the sheet's own margin. */
.book__clip { margin: -10px 0 0; padding: 0 0 calc(143 / 2400 * 100% - 10px); background: var(--paper); }
.book__clip video { display: block; width: 90.92%; margin-left: 6%; height: auto; aspect-ratio: 832 / 464; border-radius: var(--radius); }
.row { display: flex; gap: 10px; }
.row img { flex: var(--ar) 1 0; width: 0; min-width: 0; height: auto; display: block; }
@media (max-width: 809px) {
  .board { margin: 0; }
  .row { flex-direction: column; }
  .row img { flex: none; width: 100%; }
  /* On a phone the slide's 29 pt text would be 6px: the paragraph leaves the artwork and flows on the board below it */
  .slide__text { position: static; width: auto; padding: 28px 16px 14px; font-size: 17px; line-height: 1.5; text-align: left; }
  .slide__text p + p { margin-top: 1em; }
}
