/* RockGamer — landing / portafolio (direccion C: estudio creativo editorial)
   Mobile-first. Sin build. Movimiento en CSS; JS solo enriquece. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../assets/fonts/bricolage-grotesque-latin.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --papel: #f1f0ec;
  --papel-2: #e4e2dc;
  --tinta: #141414;
  --tinta-2: #55524b;
  --linea: #c9c6bd;
  --naranja: #ff5a1f;
  --naranja-tinta: #b53a07;
  --sobre-tinta-2: #a8a49b;

  --g: clamp(1rem, 4vw, 3rem);
  --max: 90rem;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  --fuente: "Bricolage Grotesque", ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
  accent-color: var(--naranja);
  scrollbar-color: var(--tinta) var(--papel-2);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-block-start: 4.5rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-family: var(--fuente);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img { display: block; max-inline-size: 100%; block-size: auto; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 800; letter-spacing: -0.03em; text-wrap: balance; }
p { text-wrap: pretty; }
[hidden] { display: none !important; }
::selection { background: var(--naranja); color: var(--tinta); }

:focus-visible { outline: 3px solid var(--tinta); outline-offset: 3px; border-radius: .2rem; }
.mudanza :focus-visible, .contacto :focus-visible, .pie :focus-visible { outline-color: var(--naranja); }

.ico { inline-size: 1.1em; block-size: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.skip {
  position: absolute; z-index: 100; inset-inline-start: var(--g); inset-block-start: -5rem;
  background: var(--tinta); color: var(--papel); padding: .7rem 1rem; font-weight: 700; text-decoration: none;
}
.skip:focus { inset-block-start: 3.5rem; }

/* ---------- Aviso de mudanza (fijo arriba) ---------- */
.mudanza {
  position: sticky; inset-block-start: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .5rem var(--g);
  background: var(--tinta); color: var(--papel);
  font-size: .875rem; line-height: 1.3;
}
.mudanza-texto { display: flex; align-items: center; gap: .6rem; min-inline-size: 0; }
.mudanza-texto strong { font-weight: 600; }
.dominio { color: var(--naranja); font-weight: 600; }
.solo-ancho { display: none; }
.pulso { position: relative; inline-size: .55rem; block-size: .55rem; flex: none; border-radius: 50%; background: var(--naranja); }
.mudanza-cta {
  display: inline-flex; align-items: center; gap: .35rem; flex: none;
  min-block-size: 2.25rem; padding: .4rem .8rem;
  background: var(--naranja); color: var(--tinta);
  font-weight: 700; text-decoration: none; border-radius: .3rem; white-space: nowrap;
  transition: background-color .2s ease, color .2s ease;
}
.mudanza-cta .ico { transition: transform .25s var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .mudanza-cta:hover { background: var(--papel); }
  .mudanza-cta:hover .ico { transform: translate(2px, -2px); }
}
@media (min-width: 40em) { .solo-ancho { display: inline; } }

/* ---------- Cabecera ---------- */
.cabecera {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  max-inline-size: var(--max); margin-inline: auto; padding: 1rem var(--g);
}
.marca { display: inline-flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.125rem; letter-spacing: -0.02em; text-decoration: none; }
.marca img { inline-size: 2.5rem; block-size: 2.5rem; border-radius: .55rem; background: var(--tinta); }
.cabecera-nav { display: none; gap: 2rem; margin-inline-start: auto; font-weight: 500; }
.cabecera-nav a { text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .3s var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .cabecera-nav a:hover { background-size: 100% 1px; } }
@media (min-width: 48em) { .cabecera-nav { display: flex; } }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-block-size: 2.875rem; padding: .7rem 1.25rem;
  border: 1.5px solid transparent; border-radius: .35rem;
  font: inherit; font-weight: 700; font-size: 1rem; line-height: 1.2; text-decoration: none; text-align: center;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .12s var(--ease-out);
}
.btn:active { transform: scale(.97); }
.btn-sm { min-block-size: 2.5rem; padding: .5rem .9rem; font-size: .9375rem; }
.btn-naranja { background: var(--naranja); color: var(--tinta); }
.btn-tinta { background: var(--tinta); color: var(--papel); }
.btn-linea { border-color: var(--tinta); color: var(--tinta); }
.btn-claro { border-color: color-mix(in oklab, var(--papel) 45%, transparent); color: var(--papel); }
@media (hover: hover) and (pointer: fine) {
  .btn-naranja:hover { background: var(--tinta); color: var(--papel); }
  .btn-tinta:hover { background: var(--naranja); color: var(--tinta); }
  .btn-linea:hover { background: var(--tinta); color: var(--papel); }
  .btn-claro:hover { background: var(--papel); color: var(--tinta); border-color: var(--papel); }
  .contacto .btn-naranja:hover { background: var(--papel); color: var(--tinta); }
}
.acciones { display: flex; flex-wrap: wrap; gap: .75rem; }

/* ---------- Estado ---------- */
.estado {
  display: inline-flex; align-items: center; gap: .4em; vertical-align: .15em;
  padding: .2em .6em; border: 1px solid var(--linea); border-radius: 999px;
  font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; line-height: 1.2;
  color: var(--tinta); white-space: nowrap;
}
.estado::before { content: ""; inline-size: .5em; block-size: .5em; border-radius: 50%; background: var(--naranja); }
.estado[data-estado="Beta"]::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--tinta); }
.estado[data-estado="Proximamente"] { color: var(--tinta-2); }
.estado[data-estado="Proximamente"]::before { background: var(--linea); }

/* ---------- Hero ---------- */
.hero { max-inline-size: var(--max); margin-inline: auto; padding: clamp(2rem, 7vw, 5.5rem) var(--g) clamp(1rem, 3vw, 2rem); }
.hero-titulo {
  font-size: clamp(2.75rem, 1.4rem + 6vw, 5rem);
  font-weight: 760;
  line-height: 1.05;
  letter-spacing: -0.015em;
  text-wrap: balance;
  hyphens: manual;
  max-inline-size: 16ch;
}
/* Subrayado continuo: se repite en cada fragmento si la frase se parte. */
.hero-titulo mark {
  background: linear-gradient(var(--naranja), var(--naranja)) 0 92% / 100% .14em no-repeat;
  color: inherit;
  padding-inline: .04em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

.hero-media {
  margin: clamp(2.5rem, 7vw, 3.5rem) 0 0;
  aspect-ratio: 1120 / 860;
  background: var(--papel-2);
}
.hero-media img { inline-size: 100%; block-size: 100%; object-fit: cover; }
.hero-media:has(img[hidden]) { border: 1px solid var(--linea); }

.hero-pie { display: grid; gap: 1.25rem; margin-block-start: clamp(2rem, 5vw, 3rem); }
.hero-lead { font-size: clamp(1.125rem, 1rem + .6vw, 1.375rem); line-height: 1.45; max-inline-size: 38ch; }
.hero-firma { display: flex; align-items: center; gap: .75rem; color: var(--tinta-2); font-size: .9375rem; }
.hero-firma::before { content: ""; inline-size: 2.5rem; block-size: 1px; background: currentColor; }

@media (min-width: 64em) {
  .hero { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--g); align-items: center; }
  .hero-texto { grid-column: 1 / 8; }
  .hero-titulo { font-size: clamp(3.25rem, 1rem + 3.6vw, 5rem); max-inline-size: none; }
  .hero-media { grid-column: 8 / -1; margin: 0; background: transparent; }
  .indice { grid-column: 1 / -1; }
}

/* Indice de proyectos */
.indice { margin-block-start: clamp(3rem, 8vw, 6.5rem); }
.indice ol { list-style: none; margin: 0; padding: 0; border-block-start: 2px solid var(--tinta); }
.indice li { border-block-end: 1px solid var(--linea); }
.indice a {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 1rem; row-gap: .15rem;
  padding: .95rem 0; text-decoration: none;
  transition: opacity .25s ease;
}
.i-nombre { font-size: clamp(1.375rem, 1rem + 2.4vw, 3rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; transition: transform .35s var(--ease-out); }
.i-tag { grid-column: 1; grid-row: 2; color: var(--tinta-2); font-size: .9375rem; }
.indice .estado { grid-column: 2; grid-row: 1; justify-self: end; }
.indice a > .ico { grid-column: 2; grid-row: 2; justify-self: end; color: var(--tinta-2); }
@media (min-width: 48em) {
  .indice a { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto 1.5rem; padding: 1.15rem 0; }
  .i-tag, .indice .estado, .indice a > .ico { grid-row: 1; }
  .i-tag { grid-column: 2; }
  .indice .estado { grid-column: 3; }
  .indice a > .ico { grid-column: 4; }
}
@media (hover: hover) and (pointer: fine) {
  .indice ol:hover a:not(:hover) { opacity: .38; }
  .indice a:hover .i-nombre { transform: translateX(.6rem); }
}
.indice-preview {
  display: none; position: fixed; inset: 0 auto auto 0; z-index: 40;
  inline-size: 18rem; pointer-events: none;
  clip-path: inset(100% 0 0 0);
  transition: clip-path .5s var(--ease-out);
  will-change: transform;
}
.indice-preview img { inline-size: 100%; block-size: auto; box-shadow: 0 24px 48px -24px rgb(20 20 20 / .55); }
.con-preview .indice-preview { display: block; }
.indice-preview.visible { clip-path: inset(0 0 0 0); }

/* ---------- Secciones de proyectos ---------- */
.proyectos { max-inline-size: var(--max); margin-inline: auto; padding: clamp(3.5rem, 8vw, 6rem) var(--g) clamp(4rem, 9vw, 8rem); }
.seccion-cabeza { display: grid; gap: 1rem; padding-block-start: 1.25rem; border-block-start: 2px solid var(--tinta); margin-block-end: clamp(2.5rem, 7vw, 6rem); }
.seccion-cabeza h2 { font-size: clamp(2.25rem, 1.4rem + 4.5vw, 4.75rem); line-height: .95; letter-spacing: -0.04em; }
.seccion-cabeza p { color: var(--tinta-2); max-inline-size: 36ch; font-size: 1.125rem; }
@media (min-width: 64em) {
  .seccion-cabeza { grid-template-columns: 1fr auto; align-items: end; }
}

/* Media + fallback visible si la imagen falla */
.media {
  --radio-media: .875rem;
  position: relative; margin: 0; overflow: clip; background: var(--papel-2);
  border-radius: var(--radio-media);
  box-shadow: 0 1px 2px rgb(20 20 20 / .06), 0 4px 12px -4px rgb(20 20 20 / .12),
              0 24px 48px -20px color-mix(in oklab, var(--acento, var(--tinta)) 40%, rgb(20 20 20 / .55));
}
.media > a { display: block; border-radius: inherit; overflow: clip; }
.media img { inline-size: 100%; }
.media:has(img[hidden]) { aspect-ratio: 4 / 3; }
.media:has(img[hidden]) > a { position: absolute; inset: 0; }
.media:has(img[hidden])::before {
  content: attr(data-nombre);
  position: absolute; inset: 0; display: grid; place-items: center; padding: 1.5rem;
  background: var(--papel-2);
  border: 1px solid var(--linea);
  font-size: clamp(1.75rem, 5vw, 3rem); font-weight: 800; letter-spacing: -0.03em; text-align: center; color: var(--tinta-2);
}
.zoom { cursor: zoom-in; }
.zoom-hint {
  position: absolute; inset-inline-end: .75rem; inset-block-end: .75rem;
  display: inline-flex; padding: .4rem .75rem; border-radius: .3rem;
  background: var(--tinta); color: var(--papel); font-size: .8125rem; font-weight: 700;
}
.media:has(img[hidden]) .zoom-hint { z-index: 1; }

/* Capa a color revelada con mascara circular (solo escritorio con mouse; la crea JS) */
.media .capa-color { position: absolute; inset: 0; pointer-events: none; }
.media .capa-color img { inline-size: 100%; block-size: 100%; object-fit: cover; }
/* Color atenuado, no gris: el color de marca de cada proyecto se reconoce antes del hover */
.con-mascara .media.mascara-lista > a > img { filter: saturate(.5) contrast(1.04); }
.con-mascara .media .capa-color {
  clip-path: circle(0% at var(--mx, 50%) var(--my, 50%));
  transition: clip-path .65s var(--ease-out);
}
.con-mascara .media.revelada .capa-color { clip-path: circle(150% at var(--mx, 50%) var(--my, 50%)); }

/* Destacado RockGamer */
.destacado { display: grid; gap: 2rem; }
.media-poster { max-inline-size: 34rem; }
.titulo-grande { font-size: clamp(3rem, 1.6rem + 7vw, 6rem); line-height: .9; letter-spacing: -0.045em; }
.destacado-texto { display: grid; gap: 1.1rem; align-content: center; }
.destacado .desc { font-size: 1.1875rem; max-inline-size: 40ch; }
.mudo-nota { color: var(--tinta-2); margin-block-start: .75rem; }
.dominio-grande {
  display: inline-flex; align-items: center; gap: .3em; justify-self: start; max-inline-size: 100%;
  font-size: clamp(1.55rem, .9rem + 3.6vw, 2.625rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.05;
  text-decoration: none; overflow-wrap: anywhere;
}
.dominio-grande span {
  background: linear-gradient(var(--naranja), var(--naranja)) 0 92% / 100% .14em no-repeat;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  transition: background-size .35s var(--ease-out);
}
.dominio-grande .ico { stroke-width: 2.5; transition: transform .3s var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .dominio-grande:hover span { background-size: 100% .5em; }
  .dominio-grande:hover .ico { transform: translate(4px, -4px); }
}
@media (min-width: 64em) {
  .destacado { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--g); align-items: center; }
  .media-poster { grid-column: 1 / 6; max-inline-size: none; }
  .destacado-texto { grid-column: 7 / -1; }
  .dominio-grande { white-space: nowrap; }
}

/* Acento de marca por proyecto: franja sobre el titulo y tono de la sombra de su imagen */
.destacado { --acento: var(--naranja); }
#p-netmenu { --acento: #f26a10; --franja: linear-gradient(90deg, #f26a10 0 50%, #2a9d47 50% 100%); }
#p-kontar-flow { --acento: #1a8fe0; --franja: linear-gradient(90deg, #22c3ee, #2563eb); }
#p-control-de-inventarios { --acento: #188038; }
#p-nicapaypall { --acento: #f2b705; --franja: linear-gradient(90deg, #f2b705 0 50%, #0b1a3a 50% 100%); }
#p-wintoolkit { --acento: #0067c0; }

/* Obras: un proyecto por fila; imagen y texto siempre juntos */
.obras { display: grid; gap: clamp(3.5rem, 9vw, 6rem); margin-block-start: clamp(5rem, 12vw, 9rem); }
.obra {
  display: grid; gap: 1.5rem; align-content: start;
  padding-block-start: clamp(2rem, 5vw, 3rem); border-block-start: 1px solid var(--linea);
}
.obra-texto { display: grid; gap: .8rem; }
.obra-texto::before {
  content: ""; inline-size: 3.5rem; block-size: .375rem; border-radius: 999px;
  background: var(--franja, var(--acento));
}
.obra h3 { font-size: clamp(1.875rem, 1.3rem + 2.4vw, 2.875rem); line-height: 1; }
.obra-tag { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; color: var(--tinta-2); font-weight: 500; }
.destacado .obra-tag { font-size: 1.125rem; }
.desc { max-inline-size: 52ch; }
.chips { display: flex; flex-wrap: wrap; gap: .25rem .6rem; list-style: none; margin: 0; padding: 0; font-size: .875rem; font-weight: 600; color: var(--tinta-2); }
.chips li + li::before { content: "/"; margin-inline-end: .6rem; color: var(--linea); }
.obra .acciones { margin-block-start: .5rem; }
.obra-d .media { max-inline-size: 26rem; }   /* captura vertical: que no ocupe toda la pantalla en tablet */

@media (min-width: 64em) {
  .obras { row-gap: 6rem; }
  .obra { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--g); align-items: center; }
  .obra .media, .obra .obra-texto { grid-row: 1; }
  /* Alterna el lado de la imagen; el texto queda siempre junto a su propia imagen */
  .obra:nth-child(odd) .media { grid-column: 1 / 8; }
  .obra:nth-child(odd) .obra-texto { grid-column: 9 / -1; }
  .obra:nth-child(even) .media { grid-column: 6 / -1; }
  .obra:nth-child(even) .obra-texto { grid-column: 1 / 5; }
  /* NicaPaypall: poster vertical, centrado junto a su texto (sin hueco entre ambos) */
  .obra.obra-d .obra-texto { grid-column: 1 / 6; }
  .obra.obra-d .media { grid-column: 6 / 11; justify-self: center; inline-size: 100%; max-inline-size: 23rem; }
}

/* ---------- Contacto ---------- */
.contacto {
  background: var(--tinta); color: var(--papel);
  padding: clamp(4rem, 12vw, 9rem) var(--g) clamp(3rem, 8vw, 6rem);
}
.contacto > * { max-inline-size: var(--max); margin-inline: auto; }
.contacto-titulo { font-size: clamp(2.5rem, 1.2rem + 7vw, 6rem); line-height: .92; letter-spacing: -0.045em; }
.contacto-pie { display: grid; gap: 1.5rem; margin-block-start: clamp(2rem, 5vw, 3.5rem); }
.contacto-pie p { color: var(--sobre-tinta-2); font-size: 1.125rem; max-inline-size: 40ch; }
@media (min-width: 64em) {
  .contacto-pie { grid-template-columns: 1fr auto; align-items: end; }
}

.pie {
  display: flex; flex-wrap: wrap; gap: .5rem 2rem; justify-content: space-between;
  padding: 1.5rem var(--g) 2rem; background: var(--tinta); color: var(--sobre-tinta-2);
  font-size: .875rem; border-block-start: 1px solid #2c2b28;
}
.pie a { text-decoration: none; }
.pie a:hover { color: var(--papel); }

/* ---------- Visor de infografias ---------- */
.visor {
  inline-size: min(100% - 1.5rem, 42rem); max-inline-size: none; max-block-size: 92dvh;
  padding: 0; border: 0; border-radius: .4rem; overflow: auto; overscroll-behavior: contain;
  background: var(--papel); color: var(--tinta);
  box-shadow: 0 40px 90px -30px rgb(0 0 0 / .6);
}
.visor.visor-ancho { inline-size: min(100% - 1.5rem, 76rem); }   /* infografias horizontales */
.visor::backdrop { background: rgb(20 20 20 / .82); }
.visor-barra {
  position: sticky; inset-block-start: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .5rem .5rem .5rem 1rem; background: var(--papel); border-block-end: 1px solid var(--linea);
}
.visor-titulo { font-weight: 700; }
.visor-cerrar {
  display: grid; place-items: center; inline-size: 2.75rem; block-size: 2.75rem; flex: none;
  border: 0; border-radius: .3rem; background: var(--tinta); color: var(--papel); cursor: pointer; font-size: 1.1rem;
}
.visor img { inline-size: 100%; }
::view-transition-group(visor-img) { animation-duration: .45s; animation-timing-function: var(--ease-in-out); }

/* ---------- Movimiento (solo si el usuario no pidio reducirlo) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero-titulo { animation: aparecer .8s var(--ease-out) both; }
  .hero-titulo mark { animation: trazo .8s var(--ease-out) .45s both; }
  .hero-pie { animation: aparecer .8s var(--ease-out) .15s both; }
  .hero-media img { animation: aparecer .9s var(--ease-out) .25s both; }

  .pulso::after {
    content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--naranja);
    animation: latido 2.4s var(--ease-out) infinite;
  }

  @supports (animation-timeline: view()) {
    /* El recorte va en el enlace interior: en .media taparia la sombra. */
    .proyectos .media > a { animation: revelar linear both; animation-timeline: view(); animation-range: entry 0% entry 80%; }
    .proyectos .media img { animation: acercar linear both; animation-timeline: view(); animation-range: entry 0% cover 50%; }
  }

  .visor[open] { animation: aparecer .3s var(--ease-out); }
}

@keyframes trazo { from { background-size: 0% .14em; } to { background-size: 100% .14em; } }
@keyframes aparecer { from { opacity: 0; transform: translateY(.75rem); } to { opacity: 1; transform: none; } }
@keyframes latido { from { transform: scale(1); opacity: .7; } to { transform: scale(3.2); opacity: 0; } }
@keyframes revelar { from { clip-path: inset(14% 0 0 0 round var(--radio-media)); } to { clip-path: inset(0 0 0 0 round var(--radio-media)); } }
@keyframes acercar { from { scale: 1.12; } to { scale: 1; } }

@media (prefers-reduced-motion: reduce) {
  .btn, .indice a, .i-nombre, .mudanza-cta .ico, .dominio-grande span, .dominio-grande .ico { transition: none; }
  .btn:active { transform: none; }
  .con-mascara .media .capa-color { clip-path: none; opacity: 0; transition: opacity .2s ease; }
  .con-mascara .media.revelada .capa-color { opacity: 1; }
  .indice-preview { clip-path: none; opacity: 0; transition: opacity .15s ease; }
  .indice-preview.visible { opacity: 1; }
}
