/* =========================================================
   nudo — laboratorio de creación editorial
   Paleta y tipografías del kit de branding básico. Sin esquinas redondeadas.
   ========================================================= */

@font-face { font-family: "DM Sans"; src: url("../fonts/DMSans-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("../fonts/DMSans-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Assistant"; src: url("../fonts/Assistant-Variable.ttf") format("truetype"); font-weight: 200 800; font-display: swap; }

:root {
  --rosa: #f5ecdf;
  --rosa-2: #e8d7cf;
  --vino: #701d3b;
  --lila: #e2a2d4;
  --naranja: #d8694e;
  --verde: #384f49;

  --ink: var(--vino);
  --gutter: clamp(20px, 4.5vw, 64px);
  --max: 1440px;
  --head: "DM Sans", system-ui, sans-serif;
  --body: "Assistant", system-ui, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  /* onda del subrayado cosido */
  --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 5'%3E%3Cpath d='M0 2.5 Q2.5 0 5 2.5 T10 2.5' fill='none' stroke='black' stroke-width='1.4'/%3E%3C/svg%3E");
  --ast-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-10 -10 20 20'%3E%3Cg stroke='black' stroke-width='2.6' stroke-linecap='round'%3E%3Cline x1='0' y1='-8.5' x2='0' y2='8.5'/%3E%3Cline x1='-7.4' y1='-4.25' x2='7.4' y2='4.25'/%3E%3Cline x1='-7.4' y1='4.25' x2='7.4' y2='-4.25'/%3E%3C/g%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  background: var(--rosa);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(17px, 1.2vw, 20px);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, video, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--vino); color: var(--rosa); }
:focus-visible { outline: 2px dashed var(--vino); outline-offset: 4px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--vino); color: var(--rosa); padding: 8px 14px; }
.skip:focus { top: 12px; }

/* ---------- hilo (canvas de yarn.js) ---------- */
/* por encima del contenido (pasa sobre las imágenes a sangre), por debajo del menú y el visor */
.yarn-thread { position: absolute; left: 0; top: 0; z-index: 5; pointer-events: none; will-change: transform; }
.has-yarn-underline { position: relative; }
.yarn-underline { position: absolute; left: 0; bottom: -9px; width: 100%; height: 14px; pointer-events: none; }

/* ---------- utilidades ---------- */
.ast { width: .8em; height: .8em; color: var(--lila); display: inline-block; vertical-align: -.05em; overflow: visible; }
.spin { animation: spin 14s linear infinite; }
.spin.rev { animation-direction: reverse; }
@keyframes spin { to { transform: rotate(360deg); } }

/* etiqueta de sección: el hilo hace un nudo en el hueco del principio */
.label {
  font-family: var(--head);
  font-size: 14px;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.label .knot { width: 26px; height: 26px; flex: none; margin: 0; }
.h2 {
  font-family: var(--head);
  font-weight: 400;
  font-size: clamp(28px, 3.6vw, 54px);
  line-height: 1.08;
  letter-spacing: -.025em;
  margin: 0;
  max-width: 22ch;
  text-wrap: balance;
}
.h2 a { text-decoration: none; }
section { padding: clamp(64px, 9vw, 140px) var(--gutter); max-width: var(--max); margin: 0 auto; position: relative; }
.section-head { margin-bottom: clamp(40px, 6vw, 88px); }
/* llamada a la acción: botón lleno con flecha; al pasar el cursor se vacía y la flecha avanza */
.cta {
  display: inline-flex; align-items: center; gap: .6em; margin-top: clamp(32px, 4vw, 56px);
  font-family: var(--head); font-size: clamp(18px, 1.5vw, 22px); letter-spacing: -.01em; text-decoration: none;
  background: var(--vino); color: var(--rosa); border: 1.5px solid var(--vino);
  padding: .7em 1.2em;
  transition: background-color .3s, color .3s;
}
.cta::after { content: "→"; transition: transform .35s var(--ease); }
.cta:hover { background: transparent; color: var(--vino); }
.cta:hover::after { transform: translateX(5px); }
.btn {
  display: inline-block; font-family: var(--head); font-size: 15px; text-decoration: none;
  border: 1.5px solid var(--vino); padding: 10px 18px;
  transition: background-color .3s, color .3s;
}
.btn:hover { background: var(--vino); color: var(--rosa); }

/* aparecer al hacer scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.cta.reveal { transition: opacity .9s var(--ease), transform .9s var(--ease), background-color .3s, color .3s; }

/* ---------- header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--gutter);
  transition: background-color .4s, box-shadow .4s;
}
.site-header.scrolled {
  background: color-mix(in srgb, var(--rosa) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--vino) 14%, transparent);
}
/* logo de hilo del encabezado: las letras ocupan el recuadro 146–1454 × 144–618
   del logo de 1600×757; se recorta el margen para que las letras midan --h de alto */
.brand { display: block; --h: 36px; }
.brand .brand-logo { display: block; width: calc(var(--h) * 1600 / 474); margin: calc(var(--h) * -144 / 474) calc(var(--h) * -146 / 474) calc(var(--h) * -139 / 474) calc(var(--h) * -146 / 474); }
.nav { display: flex; gap: clamp(18px, 2.4vw, 40px); font-family: var(--head); font-size: 16px; }
.nav a { text-decoration: none; padding-bottom: 2px; }
.nav a[aria-current="page"] { text-decoration: none; }

.menu-btn { display: none; align-items: center; gap: 10px; font-family: var(--head); font-size: 16px; padding: 8px 0; }
.menu-btn-icon { width: 30px; height: 22px; display: block; }

.menu {
  position: fixed; inset: 0; z-index: 45;
  background: var(--rosa);
  padding: 96px var(--gutter) 32px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.menu[hidden] { display: none; }
.menu nav { display: flex; flex-direction: column; gap: 6px; }
.menu nav a {
  font-family: var(--head); font-size: clamp(40px, 11vw, 64px); letter-spacing: -.03em; line-height: 1.1; text-decoration: none;
  opacity: 0; transform: translateY(20px); animation: menuIn .6s var(--ease) forwards;
}
.menu nav a:nth-child(2) { animation-delay: .05s; } .menu nav a:nth-child(3) { animation-delay: .1s; }
.menu nav a:nth-child(4) { animation-delay: .15s; } .menu nav a:nth-child(5) { animation-delay: .2s; }
@keyframes menuIn { to { opacity: 1; transform: none; } }
.menu-foot { font-size: 15px; margin: 0; }

/* ---------- logo de hilo ---------- */
.logo { position: relative; width: 100%; aspect-ratio: 1600 / 757; cursor: pointer; }
.logo .logo-fallback, .logo .logo-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.logo.is-yarn .logo-fallback { visibility: hidden; }

/* ---------- inicio ---------- */
.hero {
  min-height: 92vh; min-height: 92svh;
  display: grid; grid-template-rows: 1fr auto auto;
  align-items: center; justify-items: center;
  padding-top: 90px; padding-bottom: 40px;
}
.hero-logo { width: min(100%, 1180px); align-self: end; }
.hero-kicker {
  font-family: var(--head); font-size: clamp(17px, 2.4vw, 34px); letter-spacing: .01em; white-space: nowrap;
  display: flex; align-items: center; gap: .6em; margin: clamp(18px, 2.5vh, 32px) 0 clamp(20px, 3vh, 36px);
}
.hero-kicker .ast { width: .7em; height: .7em; }
.hero-foot { width: 100%; display: flex; justify-content: center; }
.hero-intro {
  margin: 0; max-width: 58ch; text-align: center; text-wrap: balance;
  font-size: clamp(19px, 1.65vw, 26px); line-height: 1.45;
}

/* ---------- palabras cosidas ---------- */
.statement {
  font-family: var(--head);
  font-size: clamp(30px, 4.6vw, 70px);
  line-height: 1.24;
  letter-spacing: -.03em;
  margin: 0 0 clamp(56px, 8vw, 120px);
  max-width: 24ch;
  text-wrap: pretty;
}
.ast-inline { width: .55em; height: .55em; vertical-align: .05em; margin: 0 .08em; }
/* palabras cosidas: van en su color y, al pasar el cursor, un hilo del mismo color
   se dibuja debajo (yarn.js, data-color) */
.sq { white-space: nowrap; }
.sq[data-color="--lila"] { color: var(--lila); }
.sq[data-color="--naranja"] { color: var(--naranja); }
.sq[data-color="--verde"] { color: var(--verde); }
.sq .yarn-underline { bottom: -.22em; }

/* ---------- sobre nudo ---------- */
.sobre-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.circulo { margin: 0; width: 100%; max-width: 640px; justify-self: center; }
#palabras { width: 100%; height: auto; overflow: visible; }
#palabras text { font-family: var(--body); font-weight: 600; font-size: 21px; letter-spacing: .01em; }
#palabras .w { cursor: default; transition: fill .3s; }
#palabras .w:hover { fill: var(--vino); }
.sobre-text p { margin: 0 0 1.2em; max-width: 44ch; font-size: clamp(18px, 1.45vw, 23px); }

/* ---------- tarjetas de proyecto ----------
   Sistema de miniaturas (pensado para WordPress): una sola imagen por proyecto.
   - .card-media.cutout  imagen con fondo transparente sobre un bloque de color (--c)
   - .card-media.photo   fotografía a sangre
   El color y la imagen son los únicos datos que necesita cada proyecto. */
.proyectos-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(48px, 5vw, 80px) clamp(20px, 2.6vw, 40px); padding-bottom: 110px; }
.proyectos-grid.featured { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.swipe-hint { display: none; }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(5px); } }
.card:nth-child(3n+2) { margin-top: 110px; margin-bottom: -110px; }
.card a { text-decoration: none; display: block; }
.card-media {
  display: block; width: 100%; aspect-ratio: 4 / 5; position: relative; overflow: hidden;
  background: var(--c, var(--rosa-2));
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .5s var(--ease);
}
.card-media img, .card-media video { position: absolute; transition: transform .8s var(--ease); }
.card-media.cutout img { inset: 12% 14%; width: 72%; height: 76%; object-fit: contain; filter: drop-shadow(0 18px 24px rgba(40, 6, 20, .28)); }
.card:hover .card-media.cutout img { transform: translateY(-8px) rotate(-1.5deg); }
.card-media.photo img, .card-media.photo video { inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card:hover .card-media.photo img, .card:hover .card-media.photo video { transform: scale(1.04); }
.card-info { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-top: 16px; flex-wrap: wrap; }
.card-info h3 { font-family: var(--head); font-weight: 700; font-size: clamp(22px, 2vw, 30px); letter-spacing: -.02em; margin: 0; }
.tags { margin: 0; font-size: 15px; opacity: .8; }

/* ---------- página de proyecto ----------
   Los proyectos se arman con bloques, como entradas: texto e imágenes en
   distintas disposiciones. Equivalen a bloques de WordPress (párrafo, imagen,
   galería, columnas, cita, video). */
.proyecto-head { padding-top: clamp(120px, 16vw, 200px); padding-bottom: clamp(32px, 5vw, 64px); }
.proyecto-head .h1 {
  font-family: var(--head); font-weight: 400; font-size: clamp(44px, 8vw, 128px); letter-spacing: -.04em; line-height: .95; margin: 0 0 20px;
}
.proyecto-meta { display: flex; flex-wrap: wrap; gap: 8px 32px; font-size: 16px; margin: 0 0 24px; padding: 0; list-style: none; }
.proyecto-meta li span { font-family: var(--head); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; display: block; opacity: .7; }
.proyecto-intro { font-size: clamp(19px, 1.7vw, 26px); max-width: 44ch; margin: 0; }
.blocks { padding-top: 0; display: grid; gap: clamp(28px, 4vw, 56px); }
.blocks figure { margin: 0; }
.blocks figcaption { font-size: 14px; margin-top: 8px; opacity: .8; }
.blocks p { margin: 0; }
.b-text { max-width: 60ch; font-size: clamp(17px, 1.3vw, 21px); }
.b-text.center { justify-self: center; text-align: center; }
.b-text p + p { margin-top: 1em; }
.b-full img, .b-full video { width: 100%; height: auto; }
.b-full.bleed { margin: 0 calc(var(--gutter) * -1); }
.b-row { display: flex; gap: clamp(12px, 2vw, 28px); align-items: stretch; }
.b-row figure { flex: var(--ar, 1) 1 0%; min-width: 0; }
.b-row img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: var(--ar, auto); }
.b-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 4vw, 64px); align-items: center; }
.b-cols.rev > :first-child { order: 2; }
.b-cols .b-text { font-size: clamp(17px, 1.3vw, 21px); }
.b-cols img { width: 100%; height: auto; }
.b-grid { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: clamp(12px, 2vw, 28px); }
.b-grid img, .b-grid video { width: 100%; height: auto; }
.b-grid.square img { aspect-ratio: 1; object-fit: cover; }
.b-quote { font-family: var(--head); font-size: clamp(26px, 3.4vw, 50px); letter-spacing: -.03em; line-height: 1.1; max-width: 24ch; margin: clamp(10px, 2vw, 30px) 0; }
.b-quote::before { content: ""; display: block; width: .6em; height: .6em; margin-bottom: .4em; background: var(--naranja); -webkit-mask: var(--ast-mask) center / contain no-repeat; mask: var(--ast-mask) center / contain no-repeat; }
.b-sticker { display: grid; place-items: center; padding: clamp(24px, 6vw, 80px); background: var(--c, var(--rosa-2)); }
.b-sticker img { width: min(60%, 420px); height: auto; filter: drop-shadow(0 18px 24px rgba(40, 6, 20, .25)); }
.b-pair { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(12px, 2vw, 28px); align-items: end; }
.b-pair.offset > :last-child { margin-top: clamp(40px, 8vw, 120px); }
.b-pair img { width: 100%; height: auto; }
.ph-block { border: 1.5px dashed var(--vino); display: grid; place-items: center; padding: 40px; min-height: 240px; font-family: var(--head); font-size: 14px; letter-spacing: .08em; text-transform: uppercase; text-align: center; }
.proyecto-next { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; border-top: 1.5px solid var(--vino); padding-top: 28px; flex-wrap: wrap; }
.proyecto-next a { text-decoration: none; font-family: var(--head); font-size: clamp(22px, 2.6vw, 38px); letter-spacing: -.02em; }

/* ---------- servicios ---------- */
.serv-list { list-style: none; margin: 0; padding: 0; border-bottom: 1.5px solid var(--vino); }
.serv {
  display: grid; grid-template-columns: 90px minmax(0, 1fr) minmax(0, 1.3fr); gap: 24px; align-items: baseline;
  padding: clamp(22px, 3vw, 40px) clamp(8px, 1.5vw, 24px);
  border-top: 1.5px solid var(--vino);
  position: relative;
}
.serv-num { font-family: var(--head); font-size: 15px; }
.serv-title { font-family: var(--head); font-weight: 400; font-size: clamp(34px, 5vw, 76px); letter-spacing: -.035em; line-height: 1; margin: 0; display: inline-block; transition: transform .55s var(--ease); }
.serv:hover .serv-title { transform: translateX(12px); }
.serv-items { margin: 0; font-size: clamp(16px, 1.3vw, 20px); }
.serv-items i {
  display: inline-block; width: .55em; height: .55em; margin: 0 .4em; vertical-align: .02em;
  background: var(--naranja);
  -webkit-mask: var(--ast-mask) center / contain no-repeat; mask: var(--ast-mask) center / contain no-repeat;
  transition: transform .6s var(--ease), background-color .4s;
}
.serv:hover .serv-items i { background: var(--lila); transform: rotate(120deg); }
.serv .serv-line.has-yarn-underline { position: absolute; left: 0; right: 0; bottom: 0; height: 0; }
.serv .yarn-underline { bottom: -7px; }
.serv-summary { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.serv-summary li { border-top: 1.5px solid var(--vino); padding-top: 16px; }
.serv-summary strong { font-family: var(--head); font-weight: 400; font-size: clamp(26px, 2.6vw, 40px); letter-spacing: -.03em; display: block; margin-bottom: 8px; }
.serv-summary p { margin: 0; font-size: 16px; }

/* ---------- cómo trabajamos ---------- */
.steps { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 4vw, 64px); padding-top: 24px; }
.step { position: relative; }
.knot {
  width: 76px; height: 76px; display: grid; place-items: center; margin: 0 0 28px 40px;
  font-family: var(--head); font-size: 26px;
}
.step h3 { font-family: var(--head); font-weight: 700; font-size: clamp(22px, 2vw, 30px); letter-spacing: -.02em; margin: 0 0 10px; }
.step p { margin: 0; max-width: 34ch; }

/* ---------- nosotras ---------- */
.nos-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 320px)) minmax(0, 1fr); gap: clamp(20px, 3vw, 48px); align-items: end; }
.retrato { margin: 0; }
.retrato-frame { aspect-ratio: 3 / 4; overflow: hidden; background: var(--rosa-2); }
.retrato-frame img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.retrato:hover img { transform: scale(1.04); }
.retrato figcaption { display: flex; flex-direction: column; padding-top: 14px; font-size: 16px; }
.retrato figcaption strong { font-family: var(--head); font-size: 20px; }
.retrato-ph .retrato-frame { border: 1.5px dashed var(--vino); background: transparent; display: grid; place-items: center; font-family: var(--head); font-size: 14px; letter-spacing: .08em; text-transform: uppercase; }
.ph-text { border-left: 1.5px dashed var(--vino); padding-left: 20px; font-style: italic; opacity: .75; margin: 0; }

/* ---------- contacto ---------- */
.contacto { padding-bottom: clamp(60px, 8vw, 110px); overflow: visible; }
.contacto.page { padding-top: clamp(120px, 16vw, 200px); min-height: 80vh; }
.contact-title {
  font-family: var(--head); font-weight: 400; font-size: clamp(44px, 7.5vw, 124px); line-height: .95; letter-spacing: -.045em;
  margin: 0 0 28px;
}
.ast-letter { display: inline-block; width: .5em; text-align: center; }
.ast-letter .ast { width: .5em; height: .5em; color: var(--naranja); animation: spin 10s linear infinite; transition: color .3s; }
.contact-title:hover .ast-letter .ast { animation-duration: 1.2s; color: var(--lila); }
.contact-lead { font-size: clamp(18px, 1.6vw, 24px); max-width: 36ch; margin: 0 0 40px; }
.contact-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin-bottom: 28px; }
.mail { font-family: var(--head); font-size: clamp(20px, 3vw, 44px); letter-spacing: -.02em; text-decoration: none; word-break: break-word; }
.mail .yarn-underline { bottom: -.3em; }
.copy { font-family: var(--head); font-size: 14px; border: 1.5px solid var(--vino); padding: 8px 16px; transition: background-color .3s, color .3s; }
.copy:hover { background: var(--vino); color: var(--rosa); }
.contact-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 12px 40px; font-size: 18px; }
.contact-list a { text-decoration: none; }

/* ---------- footer ---------- */
.site-footer { padding: 40px var(--gutter) 28px; max-width: var(--max); margin: 0 auto; }
.footer-logo { width: 100%; }
.footer-row { display: flex; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; font-size: 15px; border-top: 1.5px solid var(--vino); padding-top: 18px; margin-top: 24px; }
.footer-row p { margin: 0; }
.footer-row nav { display: flex; flex-wrap: wrap; gap: 8px 22px; font-family: var(--head); }
.footer-row nav a { text-decoration: none; }
.footer-row nav a:hover { text-decoration: underline; text-underline-offset: .3em; }

/* ---------- visor ---------- */
.lightbox {
  width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; border: 0; padding: 20px var(--gutter);
  background: var(--rosa); color: var(--vino);
  display: none; flex-direction: column; gap: 12px;
}
.lightbox[open] { display: flex; animation: lbIn .4s var(--ease); }
.lightbox::backdrop { background: rgba(112, 29, 59, .3); }
@keyframes lbIn { from { opacity: 0; transform: translateY(16px); } }
.lb-close { align-self: flex-end; font-family: var(--head); font-size: 15px; border: 1.5px solid var(--vino); padding: 8px 16px; }
.lb-close:hover { background: var(--vino); color: var(--rosa); }
.lb-fig { flex: 1; min-height: 0; margin: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; place-items: center; gap: 8px; }
.lb-fig img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.lb-fig figcaption { font-size: 14px; }
.lb-foot[hidden] { display: none; }
.lb-foot { display: flex; justify-content: center; align-items: center; gap: 20px; font-family: var(--head); }
.lb-foot button { width: 46px; height: 46px; border: 1.5px solid var(--vino); font-size: 18px; transition: background-color .3s, color .3s; }
.lb-foot button:hover { background: var(--vino); color: var(--rosa); }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 80; pointer-events: none;
  background: var(--vino); color: var(--rosa); font-family: var(--head); font-size: 15px;
  padding: 10px 18px;
  transform: translate(-50%, calc(100% + 40px)); visibility: hidden;
  transition: transform .5s var(--ease), visibility 0s .5s;
}
.toast.on { transform: translate(-50%, 0); visibility: visible; transition: transform .5s var(--ease); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .proyectos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card:nth-child(3n+2) { margin: 0; }
  .card:nth-child(even) { margin-top: 110px; margin-bottom: -110px; }
  .serv-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .nav { display: none; }
  .menu-btn { display: inline-flex; }
  .hero { min-height: 0; }
  .sobre-grid { grid-template-columns: 1fr; }
  .circulo { max-width: 520px; }
  .serv { grid-template-columns: 48px minmax(0, 1fr); }
  .serv-items { grid-column: 2; }
  .nos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nos-text { grid-column: 1 / -1; }
  .steps { grid-template-columns: 1fr; gap: 56px; padding-top: 8px; }
  .step { display: grid; grid-template-columns: 96px minmax(0, 1fr); column-gap: 8px; }
  .knot { grid-row: 1 / span 2; margin: 0 0 0 12px; width: 66px; height: 66px; }
  .step h3 { align-self: end; margin-top: 8px; }
  .b-cols { grid-template-columns: 1fr; }
  .b-cols.rev > :first-child { order: 0; }
  .b-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* en pantallas táctiles el hilo pasa por detrás de las imágenes (sigue por encima del texto) */
  .yarn-thread { z-index: 0; }
  .card-media, .blocks figure, .blocks video, .b-sticker, .retrato-frame, .ph-block { position: relative; z-index: 1; }
}
@media (max-width: 640px) {
  .hero { padding-top: 84px; }
  .hero-logo { width: 100%; }
  .hero-kicker { margin-bottom: 20px; }
  .circulo { width: 118%; max-width: none; margin-left: -9%; }
  .proyectos-grid { grid-template-columns: 1fr; padding-bottom: 0; gap: 48px; }
  .card:nth-child(even), .card:nth-child(3n+2) { margin: 0; }
  /* destacados del inicio: una fila que se desliza, con la siguiente tarjeta asomando */
  .proyectos-grid.featured {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 76%; gap: 16px;
    overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter) 6px; scroll-padding: 0 var(--gutter);
  }
  .proyectos-grid.featured::-webkit-scrollbar { display: none; }
  .proyectos-grid.featured .card { scroll-snap-align: start; }
  /* aviso de que la fila se desliza; se apaga al llegar a la última tarjeta */
  .swipe-hint { display: flex; justify-content: flex-end; align-items: center; gap: .4em; margin: 14px 0 0; font-family: var(--head); font-size: 14px; letter-spacing: .02em; transition: opacity .4s; }
  .swipe-hint.is-end { opacity: 0; }
  .swipe-arrow { display: inline-block; animation: nudge 1.4s var(--ease) infinite; }
  .card-info { flex-direction: column; align-items: flex-start; gap: 4px; padding-top: 14px; }
  .serv-summary { grid-template-columns: 1fr; }
  .b-row { flex-wrap: wrap; }
  .b-row figure { flex-basis: calc(50% - 8px); }
  .b-row figure:only-child { flex-basis: 100%; }
  .b-pair.offset > :last-child { margin-top: 32px; }
  .nos-grid { grid-template-columns: 1fr; }
}

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

/* ---------- paleta (ayuda para probar colores) ---------- */
.paleta-btn {
  position: fixed; right: 16px; bottom: 16px; z-index: 70;
  font-family: var(--head); font-size: 13px; letter-spacing: .04em;
  background: var(--vino); color: var(--rosa); padding: 8px 12px;
  display: inline-flex; align-items: center; gap: 6px;
}
.paleta-btn .ast { width: 11px; height: 11px; color: var(--lila); }
.paleta {
  position: fixed; right: 16px; bottom: 56px; z-index: 70; width: 260px;
  background: var(--rosa); color: var(--vino); border: 1.5px solid var(--vino);
  padding: 16px; font-family: var(--head); font-size: 13px;
  display: grid; gap: 10px;
}
.paleta[hidden] { display: none; }
.paleta h2 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; font-weight: 400; margin: 0 0 4px; }
.paleta .presets { display: flex; flex-wrap: wrap; gap: 6px; }
.paleta .presets button { border: 1.5px solid var(--vino); padding: 5px 9px; font-size: 12px; }
.paleta .presets button:hover, .paleta .presets button[aria-pressed="true"] { background: var(--vino); color: var(--rosa); }
.paleta label { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; }
.paleta input[type="color"] { width: 32px; height: 24px; padding: 0; border: 1.5px solid var(--vino); background: none; cursor: pointer; }
.paleta code { font-family: ui-monospace, monospace; font-size: 11px; opacity: .75; }
.paleta .reset { justify-self: start; text-decoration: underline; font-size: 12px; }
