/* =====================================================================
   styles.css
   ---------------------------------------------------------------------
   Índice:
     1. Fuentes
     2. Variables (colores, medidas)  ← cambia aquí la identidad
     3. Base
     4. Cabecera y menú burger
     5. Portada (hero) y botones
     6. Secciones comunes
     7. Proyectos: filtros y cuadrícula
     8. Servicios, sobre mí, proceso, opinión
     9. Contacto y formulario
    10. Pie de página
    11. Página de proyecto (texto fijo)
    12. Adaptación a móvil
    13. Movimiento reducido
    14. Animaciones (revelados, cursor, marquesina, transición de página)
   ===================================================================== */


/* ---------- 1. Fuentes ----------
   Copia tus archivos .woff2 de Neue Montreal a la carpeta fonts/.
   Si no están, el navegador usa la siguiente fuente de la lista (Helvetica / Arial). */
@font-face {
  font-family: "Neue Montreal";
  src: url("../fonts/NeueMontreal-Light-1.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Neue Montreal";
  src: url("../fonts/NeueMontreal-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Neue Montreal";
  src: url("../fonts/NeueMontreal-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Neue Montreal";
  src: url("../fonts/NeueMontreal-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}


/* ---------- 2. Variables ---------- */
:root {
  /* Colores del tema oscuro (el de partida) */
  --bg: #151515;
  --bg-alt: #1E2125;
  --text: #FFFFFF;
  --muted: #A4A4A4;
  --line: #2E3136;
  --accent: #D3A726;

  /* Medidas */
  --pad: clamp(20px, 4vw, 45px);      /* margen lateral de la página */
  --header-h: 72px;                   /* altura de la cabecera */
  --ease: cubic-bezier(0.7, 0, 0.2, 1);

  --font: "Neue Montreal", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  color-scheme: dark;
}

/* Colores del tema claro: solo se redefinen las variables */
[data-theme="light"] {
  --bg: #FFFFFF;
  --bg-alt: #F6F6F6;
  --text: #000000;
  --muted: #6B6C70;
  --line: #D2D2D2;
  --accent: #9A7500;
  color-scheme: light;
}


/* ---------- 3. Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  scrollbar-gutter: stable;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s, color 0.3s;
}

body.menu-open {
  overflow: hidden;           /* bloquea el scroll mientras el menú está abierto */
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

h1, h2, h3 {
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

h2 {
  font-size: clamp(32px, 4.6vw, 64px);
  letter-spacing: -0.03em;
}

.lead {
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.3;
  letter-spacing: -0.015em;
}


/* ---------- 4. Cabecera y menú burger ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-bar {
  position: relative;
  z-index: 2;                 /* por encima del menú desplegado */
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 var(--pad);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  transition: background 0.3s;
}

.logo {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.logo {
  display: flex;
  align-items: center;
}

.logo-img {
  display: block;
  height: 22px;
  width: auto;
}

.logo-for-light {
  display: none;
}

[data-theme="light"] .logo-for-dark {
  display: none;
}

[data-theme="light"] .logo-for-light {
  display: block;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 15px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Botón burger: dos líneas que se cruzan y forman una X */
.burger {
  position: relative;
  width: 44px;
  height: 44px;
  background: none;
  border: 0;
  cursor: pointer;
}

.burger-line {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: top 0.45s var(--ease), transform 0.45s var(--ease), background 0.2s;
}

.burger-line:nth-child(1) { top: 17px; }
.burger-line:nth-child(2) { top: 25px; }

.burger:hover .burger-line {
  background: var(--accent);
}

.menu-open .burger-line:nth-child(1) { top: 21px; transform: rotate(45deg); }
.menu-open .burger-line:nth-child(2) { top: 21px; transform: rotate(-45deg); }

/* Menú a pantalla completa: se despliega desde arriba */
.menu {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: calc(var(--header-h) + 40px) var(--pad) 40px;
  background: var(--bg);
  overflow-y: auto;

  visibility: hidden;                   /* cerrado: no se puede tabular ni leer */
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.7s var(--ease), visibility 0s linear 0.7s;
}

.menu-open .menu {
  visibility: visible;
  clip-path: inset(0);
  transition: clip-path 0.7s var(--ease), visibility 0s;
}

.menu ul {
  list-style: none;
  padding: 0;
}

.menu li {
  overflow: hidden;                     /* oculta el enlace mientras sube */
}

.menu li a {
  display: block;
  padding: 0.04em 0;
  font-size: clamp(40px, 9vw, 112px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.03em;
  text-decoration: none;
  transform: translateY(110%);
  transition: transform 0.7s var(--ease), color 0.2s, opacity 0.3s;
}

/* Al abrir, cada enlace sube con un pequeño retraso respecto al anterior */
.menu-open .menu li a {
  transform: none;
  transition: transform 0.7s var(--ease) calc(0.25s + var(--i) * 0.07s), color 0.2s, opacity 0.3s;
}

.menu li a:hover {
  color: var(--accent);
}

.menu-mail {
  align-self: flex-start;
  color: var(--muted);
  text-decoration: none;
}

.menu-mail:hover {
  color: var(--accent);
}


/* ---------- 5. Portada (hero) y botones ---------- */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 64px;
  min-height: calc(100svh - var(--header-h));
  padding: clamp(48px, 8vw, 100px) var(--pad) 48px;
}

.hero-title {
  font-size: clamp(46px, 10.5vw, 168px);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

/* Cada línea del título sube desde una "máscara" al cargar la página */
.line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
}

.line > span {
  display: block;
  transform: translateY(105%);
  animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.1, 1) forwards;
}

.line:nth-child(1) > span { animation-delay: 0.45s; }
.line:nth-child(2) > span { animation-delay: 0.55s; }
.line:nth-child(3) > span { animation-delay: 0.65s; }

@keyframes rise {
  to { transform: none; }
}

.hero-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}

.hero-text {
  max-width: 46ch;
  color: var(--muted);
  font-size: 20px;
}

.button {
  display: inline-block;
  padding: 14px 28px;
  background: var(--text);
  color: var(--bg);
  border: 0;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.button:hover {
  background: var(--accent);
  color: #151515;
}


/* ---------- 6. Secciones comunes ---------- */
.section {
  padding: clamp(64px, 9vw, 128px) var(--pad);
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(32px, 5vw, 64px);
}

.section-intro {
  max-width: 36ch;
  color: var(--muted);
}


/* ---------- 7. Proyectos: filtros y cuadrícula ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter {
  background: none;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 16px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.filter:hover {
  color: var(--text);
  border-color: var(--text);
}

.filter[aria-pressed="true"] {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 48px 30px;
}

.card {
  display: block;
  text-decoration: none;
}

.card-media {
  overflow: hidden;
  background: var(--bg-alt);
}

.card-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.card:hover .card-media img {
  transform: scale(1.04);
}

.card-info {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
}

.card-info h3 {
  font-size: 22px;
}

.card-info span {
  color: var(--muted);
  font-size: 16px;
  white-space: nowrap;
}


/* ---------- 8. Servicios, sobre mí, proceso, opinión ---------- */
.rows {
  list-style: none;
  padding: 0;
  border-top: 1px solid var(--line);
}

.row {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
  align-items: baseline;
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
}

.row h3 {
  font-size: clamp(24px, 2.6vw, 36px);
}

.row p {
  max-width: 52ch;
  color: var(--muted);
}

.about {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 48px;
}

.about-body {
  display: grid;
  gap: 22px;
  max-width: 62ch;
}

.tools {
  color: var(--muted);
}

.steps {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.step {
  padding-top: 20px;
  border-top: 1px solid var(--text);
}

.step-number {
  display: block;
  margin-bottom: 48px;
  color: var(--accent);
}

.step h3 {
  margin-bottom: 12px;
  font-size: clamp(26px, 2.8vw, 38px);
}

.step p {
  color: var(--muted);
  max-width: 36ch;
}

.quote-block blockquote {
  max-width: 1100px;
}

.quote-block p {
  font-size: clamp(26px, 3.6vw, 52px);
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.quote-block footer {
  margin-top: 28px;
  color: var(--muted);
}


/* ---------- 9. Contacto y formulario ---------- */
.contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px clamp(32px, 6vw, 96px);
}

.contact-intro {
  display: grid;
  align-content: start;
  gap: 24px;
}

.form {
  display: grid;
  gap: 28px;
  align-content: start;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  color: var(--muted);
  font-size: 16px;
}

.field input,
.field textarea {
  width: 100%;
  padding: 10px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  font-size: 20px;
  resize: vertical;
  transition: border-color 0.2s;
}

.field input:focus,
.field textarea:focus {
  border-bottom-color: var(--accent);
}

.form .button {
  justify-self: start;
}


/* ---------- 10. Pie de página ---------- */
.site-footer {
  padding: clamp(56px, 8vw, 112px) var(--pad) 32px;
  border-top: 1px solid var(--line);
}

.footer-cta {
  margin-bottom: 8px;
  color: var(--muted);
}

.footer-mail {
  display: inline-block;
  font-size: clamp(28px, 6.4vw, 104px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.035em;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color 0.2s;
}

.footer-mail:hover {
  color: var(--accent);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px 32px;
  margin-top: clamp(48px, 7vw, 96px);
  color: var(--muted);
  font-size: 16px;
}

.footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.footer-bottom a {
  text-decoration: none;
}

.footer-bottom a:hover {
  color: var(--text);
  text-decoration: underline;
}


/* ---------- 11. Página de proyecto (texto fijo) ---------- */
.project {
  padding: 0 var(--pad);
}

/* Dos columnas: imágenes a la izquierda, texto a la derecha */
.project-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: start;                 /* IMPRESCINDIBLE para que el texto pueda quedarse fijo */
  padding: 32px 0 80px;
}

.project-gallery {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  gap: 16px;
}

.project-gallery img {
  width: 100%;
  height: auto;
  background: var(--bg-alt);
}

/* El texto se queda pegado arriba mientras se baja por las imágenes.
   Cuando termina la columna de imágenes, deja de ser fijo y la página sigue hacia el pie. */
.project-info {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: calc(var(--header-h) + 32px);
  display: grid;
  gap: 24px;
  max-height: calc(100svh - var(--header-h) - 64px);
  overflow-y: auto;                   /* si el texto es muy largo, se desplaza dentro */
  scrollbar-width: thin;
}

.project-info h1 {
  font-size: clamp(34px, 4vw, 60px);
  letter-spacing: -0.03em;
}

.back {
  justify-self: start;
  color: var(--muted);
  font-size: 16px;
  text-decoration: none;
}

.back:hover {
  color: var(--text);
  text-decoration: underline;
}

.meta {
  display: grid;
  border-top: 1px solid var(--line);
}

.meta > div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
}

.meta dt {
  color: var(--muted);
}

.meta dd {
  margin: 0;
}

.next {
  border-top: 1px solid var(--line);
}

.next-link {
  display: block;
  padding: clamp(56px, 8vw, 112px) var(--pad);
  text-decoration: none;
}

.next-label {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
}

.next-title {
  display: block;
  font-size: clamp(36px, 8vw, 128px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.035em;
  transition: color 0.2s;
}

.next-link:hover .next-title {
  color: var(--accent);
}

.not-found {
  display: grid;
  gap: 16px;
  padding: 96px var(--pad);
}


/* ---------- 12. Adaptación a móvil ---------- */
@media (max-width: 900px) {
  .about,
  .contact {
    grid-template-columns: 1fr;
  }

  .steps {
    grid-template-columns: 1fr;
  }

  /* En móvil no hay dos columnas: primero el texto y debajo las imágenes */
  .project-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .project-info {
    grid-column: 1;
    grid-row: 1;
    position: static;
    max-height: none;
    overflow: visible;
  }

  .project-gallery {
    grid-column: 1;
    grid-row: 2;
  }
}

@media (max-width: 700px) {
  :root {
    --header-h: 64px;
  }

  body {
    font-size: 17px;
  }

  .row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .step-number {
    margin-bottom: 20px;
  }

  /* Portada en móvil: más compacta y ordenada, para que lo siguiente asome
     en la primera pantalla y se note que hay más abajo. */
  .hero {
    justify-content: flex-start;
    gap: 32px;
    min-height: 0;                       /* ya no ocupa toda la pantalla */
    padding-top: 32px;
    padding-bottom: 40px;
  }

  .hero-title {
    font-size: max(12.5vw, 40px);        /* titular grande: ocupa casi todo el ancho sin partirse */
    line-height: 1;
  }

  /* Texto y botón en columna, separados del titular por una línea */
  .hero-foot {
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
  }

  .hero-text {
    font-size: 16px;
  }

  .hero .button {
    padding: 18px 28px;
    text-align: center;                  /* botón a todo el ancho: fácil de pulsar */
  }

  .marquee {
    padding: 16px 0;
  }

  .marquee-group span {
    font-size: 40px;
  }

  .section {
    padding-top: 48px;
    padding-bottom: 56px;
  }

  /* Cabecera de proyectos: título y, debajo, filtros en una sola fila que se desliza.
     El último filtro queda cortado en el borde: así se nota que hay más. */
  .section-head {
    flex-direction: column;
    flex-wrap: nowrap;                   /* sin esto, la columna se ensancha hasta el contenido */
    align-items: stretch;
    gap: 20px;
    margin-bottom: 28px;
  }

  .filters {
    flex-wrap: nowrap;
    margin: 0 calc(var(--pad) * -1);
    padding: 0 var(--pad);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .filters::-webkit-scrollbar {
    display: none;
  }

  .filter {
    flex: none;
  }
}


/* ---------- 13. Movimiento reducido ----------
   Si la persona tiene activada la opción "reducir movimiento" en su sistema,
   se quitan las animaciones. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
}


/* ---------- 14. Animaciones ----------
   Los estados "ocultos" solo existen cuando <html> tiene la clase .anim,
   que añade main.js únicamente si la persona NO ha pedido reducir el movimiento.
   Así, sin JavaScript o con movimiento reducido, todo se ve normal. */
:root {
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Texto solo para lectores de pantalla */
.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;
}

/* ----- Palabras que suben desde una máscara ----- */
.word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding: 0 0.05em 0.14em 0;
  margin: 0 -0.05em -0.14em 0;
}

.word > span {
  display: inline-block;
}

.anim [data-reveal="split"] .word > span {
  transform: translateY(115%);
  transition: transform 1s var(--ease-out) calc(var(--d, 0ms) + min(var(--w), 18) * 55ms);
}

.anim [data-reveal="split"].is-visible .word > span {
  transform: none;
}

/* ----- Aparecer subiendo ----- */
.anim [data-reveal="rise"] {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.9s ease var(--d, 0ms),
              transform 1.1s var(--ease-out) var(--d, 0ms),
              color 0.2s;
}

.anim [data-reveal="rise"].is-visible {
  opacity: 1;
  transform: none;
}

/* ----- Líneas que se dibujan (servicios y proceso) ----- */
.anim .row[data-reveal="line"] {
  position: relative;
  border-bottom-color: transparent;
}

.anim .step[data-reveal="line"] {
  position: relative;
  border-top-color: transparent;
}

.anim .row[data-reveal="line"]::after,
.anim .step[data-reveal="line"]::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.3s var(--ease-out) var(--d, 0ms);
}

.anim .row[data-reveal="line"]::after {
  bottom: -1px;
  background: var(--line);
}

.anim .step[data-reveal="line"]::before {
  top: -1px;
  background: var(--text);
}

.anim .row[data-reveal="line"].is-visible::after,
.anim .step[data-reveal="line"].is-visible::before {
  transform: none;
}

/* El contenido de cada fila entra una vez dibujada la línea */
.anim [data-reveal="line"] > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s ease calc(var(--d, 0ms) + 150ms + var(--c, 0) * 90ms),
              transform 1s var(--ease-out) calc(var(--d, 0ms) + 150ms + var(--c, 0) * 90ms);
}

.anim [data-reveal="line"].is-visible > * {
  opacity: 1;
  transform: none;
}

.row > :nth-child(2),
.step > :nth-child(2) { --c: 1; }
.step > :nth-child(3) { --c: 2; }

/* ----- Imágenes que se destapan ----- */
.shot {
  margin: 0;
}

.reveal-mask {
  position: relative;
  overflow: hidden;
}

/* Un panel del color del fondo tapa la imagen y se retira hacia abajo */
.anim .reveal-mask::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--bg);
  transform-origin: bottom;
  transition: transform 1.2s var(--ease-out) var(--d, 0ms);
  pointer-events: none;
}

/* La imagen empieza ampliada y se asienta mientras se destapa */
.anim .reveal-mask img {
  scale: 1.25;
  transition: scale 1.6s var(--ease-out) var(--d, 0ms), transform 0.6s var(--ease);
}

.anim [data-reveal="card"].is-visible .reveal-mask::after,
.anim [data-reveal="media"].is-visible::after {
  transform: scaleY(0);
}

.anim [data-reveal="card"].is-visible .reveal-mask img,
.anim [data-reveal="media"].is-visible img {
  scale: 1;
}

/* El título de la tarjeta entra después que la imagen */
.anim [data-reveal="card"] .card-info {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.8s ease calc(var(--d, 0ms) + 400ms),
              transform 0.9s var(--ease-out) calc(var(--d, 0ms) + 400ms);
}

.anim [data-reveal="card"].is-visible .card-info {
  opacity: 1;
  transform: none;
}

.card-info h3 {
  transition: transform 0.4s var(--ease-out);
}

.card:hover .card-info h3 {
  transform: translateX(8px);
}

/* ----- Marquesina entre la portada y los proyectos ----- */
.marquee {
  overflow: hidden;
  padding: clamp(24px, 4vw, 48px) 0;
  border-top: 1px solid var(--line);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 40s linear infinite;
}

.marquee:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-group {
  display: flex;
  flex-shrink: 0;
}

.marquee-group span {
  display: flex;
  align-items: center;
  padding-right: 0.5em;
  font-size: clamp(44px, 8vw, 120px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.035em;
  white-space: nowrap;
}

.marquee-group span::after {
  content: "";
  width: 0.2em;
  height: 0.2em;
  margin-left: 0.5em;
  border-radius: 50%;
  background: var(--accent);
}

/* Se desplaza justo la mitad (un grupo entero) y vuelve a empezar sin saltos */
@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ----- Barra de progreso de lectura ----- */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 300;
  height: 2px;
  background: var(--accent);
  transform: scaleX(var(--p, 0));
  transform-origin: left;
  pointer-events: none;
}

/* ----- Botones magnéticos ----- */
.magnetic {
  transition: transform 0.45s var(--ease-out), background 0.2s, color 0.2s, border-color 0.2s;
}

/* ----- Cursor propio ----- */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 500;
  pointer-events: none;
  mix-blend-mode: difference;           /* se invierte según el fondo que tenga debajo */
}

.cursor-ball {
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  translate: -50% -50%;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  transition: width 0.35s var(--ease-out), height 0.35s var(--ease-out), opacity 0.3s;
}

.cursor.is-on .cursor-ball {
  opacity: 1;
}

.cursor.is-link .cursor-ball {
  width: 48px;
  height: 48px;
}

.cursor.is-view .cursor-ball {
  width: 96px;
  height: 96px;
}

.cursor-label {
  color: #000;
  font-size: 15px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.25s;
}

.cursor.is-view .cursor-label {
  opacity: 1;
}

@media (hover: none), (pointer: coarse) {
  .cursor {
    display: none;
  }
}

/* ----- Transición entre páginas ----- */
.curtain {
  position: fixed;
  inset: 0;
  z-index: 600;                         /* por encima del cursor (500) */
  background: var(--accent);
  transform: translateY(100%);          /* en reposo está fuera de pantalla, abajo */
  transition: transform 0.8s var(--ease);
  pointer-events: none;
}

/* ----- Menú: al pasar sobre un enlace, los demás se atenúan ----- */
.menu ul:hover a {
  opacity: 0.3;
}

.menu ul a:hover {
  opacity: 1;
}


/* Movimiento reducido: la marquesina se queda quieta.
   Va al final del archivo para que no la pise la regla de la marquesina. */
@media (prefers-reduced-motion: reduce) {
  .marquee-track {
    animation: none;
  }
}
