/* retr0 · levantamiento topográfico */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Gloock";
  src: url("../fonts/gloock.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --papel: #eef0ea;
  --paramo: #181b16;
  --tinta: #141512;
  --tinta-2: #55594d;
  --niebla: #aeb2a3;
  --volcan: #ff4d17;
  --volcan-papel: #d63b0b;
  --volcan-texto: #b33106;
  --linea: rgb(20 21 18 / 0.18);

  --f-sans: "Archivo", system-ui, sans-serif;
  --f-serif: "Gloock", Georgia, serif;

  --u: 0.5rem;
  --s1: var(--u);
  --s2: calc(var(--u) * 2);
  --s3: calc(var(--u) * 3);
  --s4: calc(var(--u) * 5);
  --s5: calc(var(--u) * 8);
  --s6: calc(var(--u) * 13);
  --s7: calc(var(--u) * 21);
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --max: 84rem;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  overflow-x: clip;
  scroll-padding-top: 5rem;
  scrollbar-color: var(--tinta-2) var(--papel);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-family: var(--f-sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  caret-color: var(--volcan);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--volcan); color: var(--tinta); }

h1, h2, h3, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

:focus-visible { outline: 2px solid var(--tinta); outline-offset: 4px; border-radius: 2px; }
[data-tema="paramo"] :focus-visible, .menu :focus-visible { outline-color: var(--volcan); }

.sprite { display: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.icon { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.skip {
  position: fixed; left: var(--s2); top: -5rem; z-index: 60;
  padding: var(--s1) var(--s2); background: var(--volcan); color: var(--tinta); font-weight: 700;
}
.skip:focus { top: var(--s2); }

.wrap { width: min(100% - var(--gutter) * 2, var(--max)); margin-inline: auto; }
.cero { font-family: var(--f-serif); font-weight: 400; font-stretch: normal; letter-spacing: 0; }
.serif { font-family: var(--f-serif); font-weight: 400; font-stretch: normal; text-transform: none; letter-spacing: -0.01em; }

/* ───────── Escena WebGL fija ───────── */

.escena {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
main { position: relative; z-index: 1; }

[data-tema="papel"] { background: var(--papel); color: var(--tinta); }
[data-tema="paramo"] { background: var(--paramo); color: var(--papel); }
.gl [data-tema] { background: transparent; }

/* ───────── Cabecera ───────── */

.top {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: var(--s3) var(--gutter);
  color: #fff;
  mix-blend-mode: difference;
  pointer-events: none;
  transition: transform 450ms var(--ease);
}
.top.is-oculto { transform: translateY(-110%); }
.top > * { pointer-events: auto; }

.marca { display: grid; line-height: 1; }
.marca__alias {
  font-weight: 900;
  font-stretch: 125%;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.marca__nombre {
  font-family: var(--f-serif);
  font-size: 0.95rem;
  margin-top: 0.3rem;
  opacity: 0.8;
  transition: opacity 600ms var(--ease), clip-path 800ms var(--ease);
}
.gl:not(.revelado) .marca__nombre { opacity: 0; clip-path: inset(0 100% 0 0); }

.menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.9rem 0.6rem 1.1rem;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: 700 0.85rem var(--f-sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.menu-btn__lines { position: relative; width: 1.2rem; height: 0.55rem; }
.menu-btn__lines::before, .menu-btn__lines::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor;
  transition: transform 300ms var(--ease), top 300ms var(--ease);
}
.menu-btn__lines::before { top: 0; }
.menu-btn__lines::after { top: calc(100% - 1.5px); right: 35%; }
.menu-btn[aria-expanded="true"] .menu-btn__lines::before { top: 45%; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-btn__lines::after { top: 45%; right: 0; transform: rotate(-45deg); }

/* ───────── Menú ───────── */

.menu {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: grid;
  align-content: center;
  gap: var(--s5);
  padding: var(--s7) var(--gutter) var(--s5);
  background: rgb(24 27 22 / 0.9);
  backdrop-filter: blur(10px);
  color: var(--papel);
}
.menu[hidden] { display: none; }
.menu.is-open { animation: menu-in 420ms var(--ease); }
@keyframes menu-in { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }

.menu__list a {
  display: inline-block;
  font-weight: 900;
  font-stretch: 125%;
  font-size: clamp(2rem, 0.2rem + 7.6vw, 6rem);
  line-height: 1.02;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  transition: color 200ms;
}
.menu__list a:hover { color: var(--volcan); }
.menu__social { display: flex; flex-wrap: wrap; gap: var(--s2); }

/* ───────── Inicio ───────── */

.hero { height: 240vh; }
.hero__sticky {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
}

.hero__giant {
  position: absolute;
  left: 50%;
  bottom: -0.08em;
  transform: translateX(-50%);
  font-weight: 900;
  font-stretch: 125%;
  font-size: clamp(6rem, 25vw, 30rem);
  line-height: 1;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1.5px rgb(20 21 18 / 0.3);
  user-select: none;
}
.gl .hero__giant { visibility: hidden; }

.scan-readout {
  position: absolute;
  top: var(--s4);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5em;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tinta-2);
}
.scan-readout b { color: var(--tinta); font-weight: 800; }
.scan-readout .coord { margin-left: 1.2em; padding-left: 1.2em; border-left: 1px solid var(--linea); }

.reveal {
  --r: 0;
  position: absolute;
  right: var(--gutter);
  top: 50%;
  transform: translateY(-50%);
  width: min(18rem, 30vw);
  pointer-events: none;
}
.reveal > * {
  opacity: var(--r);
  transform: translateY(calc((1 - var(--r)) * 0.8rem));
  transition: opacity 120ms linear;
}
.reveal__name {
  font-family: var(--f-serif);
  font-size: clamp(1.8rem, 1.2rem + 1.4vw, 2.6rem);
  line-height: 1.02;
  clip-path: inset(0 calc((1 - var(--r)) * 100%) 0 0);
}
.reveal__role { margin-top: var(--s1); color: var(--tinta-2); font-weight: 500; }

.ahora {
  position: absolute;
  left: var(--gutter);
  bottom: var(--s4);
  display: grid;
  gap: 0.2rem;
  min-width: 13rem;
  padding: var(--s2);
  border: 1px solid var(--linea);
  border-radius: 6px;
  background: rgb(238 240 234 / 0.72);
  backdrop-filter: blur(6px);
}
.ahora__k { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--tinta-2); }
.ahora__v { font-weight: 700; font-stretch: 110%; line-height: 1.25; }
.ahora.is-pending .ahora__v { color: var(--tinta-2); font-weight: 500; }

.hint {
  position: absolute;
  right: var(--gutter);
  bottom: var(--s4);
  display: grid;
  justify-items: end;
  gap: var(--s1);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tinta-2);
}
.hint__track { width: 8rem; height: 2px; background: var(--linea); overflow: hidden; }
.hint__fill { display: block; height: 100%; width: 100%; background: var(--volcan); transform-origin: 0 50%; transform: scaleX(0); }

/* ───────── Manifiesto ───────── */

.manifiesto {
  min-height: 180vh;
  padding-inline: var(--gutter);
}
.manifiesto__text {
  position: sticky;
  top: 0;
  min-height: 100svh;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  column-gap: 0.26em;
  max-width: 16em;
  margin-inline: auto;
  font-weight: 800;
  font-stretch: 112%;
  font-size: clamp(2rem, 0.9rem + 4.4vw, 5.6rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  text-align: center;
}
.manifiesto__text em {
  font-family: var(--f-serif);
  font-style: normal;
  font-weight: 400;
  font-stretch: normal;
  text-transform: none;
  letter-spacing: -0.01em;
  color: var(--volcan);
}
.w { opacity: var(--o, 1); transition: opacity 160ms linear; }
.w--p { margin-left: -0.26em; }
.js .w { --o: 0.16; }

/* ───────── Encabezados de sección ───────── */

.trayectoria, .portafolio, .relaciones { padding-block: var(--s7) var(--s6); }

.sec-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 22rem);
  gap: var(--s2) var(--s5);
  align-items: end;
  margin-bottom: var(--s5);
}
.sec-title {
  display: grid;
  font-weight: 900;
  font-stretch: 125%;
  font-size: clamp(2.2rem, 0.4rem + 7.4vw, 6rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}
.sec-title .serif { font-size: 0.62em; line-height: 1.05; margin-top: 0.12em; color: var(--tinta-2); }
[data-tema="paramo"] .sec-title .serif { color: var(--niebla); }
.sec-note { color: var(--tinta-2); max-width: 30ch; }
[data-tema="paramo"] .sec-note { color: var(--niebla); }

/* ───────── Trayectoria ───────── */

.log { border-bottom: 1px solid var(--linea); }
.log__item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr) minmax(0, 1.6fr);
  gap: var(--s1) var(--s4);
  align-items: baseline;
  padding-block: var(--s4);
}
.log__item::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 1px; background: var(--tinta);
  opacity: 0.4; transform-origin: 0 50%; transition: transform 900ms var(--ease);
}
.js .log__item:not(.is-in)::before { transform: scaleX(0); }
.log__anio { font-family: var(--f-serif); font-size: clamp(1.8rem, 1.3rem + 1.6vw, 2.8rem); line-height: 1; }
.log__rol { font-weight: 800; font-stretch: 112%; font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.6rem); line-height: 1.15; }
.log__org { display: block; margin-top: 0.3rem; font-weight: 500; font-stretch: 100%; font-size: 1rem; color: var(--tinta-2); }
.log__det { color: var(--tinta-2); max-width: 52ch; }
.log__item.is-pending .log__anio, .log__item.is-pending .log__rol { color: var(--tinta-2); }
.log__item.is-pending::before { background: none; border-top: 1px dashed var(--tinta-2); opacity: 0.6; }

.leyenda {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 3fr);
  gap: var(--s2) var(--s4);
  margin-top: var(--s5);
}
.leyenda__t { font-family: var(--f-serif); font-weight: 400; font-size: clamp(1.8rem, 1.3rem + 1.6vw, 2.8rem); line-height: 1; }
.leyenda__l { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: var(--s2) var(--s4); }
.leyenda__i { display: flex; align-items: center; gap: 0.8em; font-weight: 700; font-stretch: 112%; font-size: 1.05rem; padding-block: var(--s1); border-bottom: 1px solid var(--linea); }
/* símbolo de leyenda: una curva índice y dos finas */
.leyenda__s {
  flex: none; width: 1.8rem; height: 0.9rem;
  background:
    linear-gradient(var(--tinta), var(--tinta)) 0 50% / 100% 2px no-repeat,
    linear-gradient(var(--tinta-2), var(--tinta-2)) 0 10% / 100% 1px no-repeat,
    linear-gradient(var(--tinta-2), var(--tinta-2)) 0 90% / 100% 1px no-repeat;
  border-radius: 1px;
}

/* ───────── Relaciones ───────── */

.relaciones { padding-bottom: 0; }
.split {
  display: flex;
  min-height: max(54vh, 26rem);
  border-top: 1px solid rgb(238 240 234 / 0.16);
}
.split__item {
  flex: 1 1 0;
  min-width: 0;
  transition: flex-grow 700ms var(--ease);
}
.split__item + .split__item { border-left: 1px solid rgb(238 240 234 / 0.16); }
.split:hover .split__item:hover, .split__item:focus-within { flex-grow: 1.7; }

.split__link {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--s4);
  height: 100%;
  padding: var(--s5) var(--gutter);
}
.split__name {
  font-weight: 900;
  font-stretch: 125%;
  font-size: clamp(2.4rem, 0.6rem + 4.6vw, 5rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--papel);
  transition: color 400ms var(--ease), -webkit-text-stroke-color 400ms;
  overflow-wrap: break-word;
}
.split:has(> :nth-child(3)) .split__name { font-size: clamp(2rem, 0.3rem + 3vw, 4.2rem); overflow-wrap: normal; }
.split:has(> :nth-child(3)) .split__link { padding-inline: var(--s4); }
.split__item:hover .split__name, .split__link:focus-visible .split__name { color: var(--volcan); -webkit-text-stroke-color: var(--volcan); }
.split__rol { font-family: var(--f-serif); font-size: clamp(1.4rem, 1.1rem + 1vw, 2rem); line-height: 1.15; }
.split__item.is-pending .split__rol { font-family: var(--f-sans); font-size: 1rem; color: var(--niebla); }
.split__dom {
  display: inline-flex; align-items: center; gap: 0.4em; margin-top: var(--s2);
  font-weight: 700; font-size: 0.85rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--niebla);
}
.split__item:hover .split__dom { color: var(--papel); }

/* ───────── Portafolio ───────── */

.vitrina {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  gap: var(--s2);
}
.pieza {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  aspect-ratio: 1 / 1.08;
  border-radius: 6px;
  overflow: hidden;
  background: var(--paramo);
  color: var(--papel);
  transition: transform 500ms var(--ease), box-shadow 500ms var(--ease);
}
.pieza:hover, .pieza:focus-within { transform: translateY(-6px); box-shadow: 0 24px 40px -24px rgb(0 0 0 / 0.55); }
.pieza__relieve { width: 100%; height: 100%; color: rgb(238 240 234 / 0.38); transition: color 400ms; }
.pieza:hover .pieza__relieve, .pieza:focus-within .pieza__relieve { color: var(--volcan); }
.pieza__relieve path { fill: none; stroke: currentColor; stroke-width: 1; vector-effect: non-scaling-stroke; }
.pieza__relieve path.mayor { stroke-width: 1.8; }
.pieza__img { width: 100%; height: 100%; object-fit: cover; }
.pieza__pie {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2);
  padding: var(--s2);
  border-top: 1px solid rgb(238 240 234 / 0.14);
}
.pieza__nombre { font-weight: 800; font-stretch: 112%; font-size: 1.1rem; line-height: 1.2; }
.pieza__meta { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--niebla); white-space: nowrap; }
.pieza__link { position: absolute; inset: 0; z-index: 1; }
.pieza.is-pending { background: transparent; color: var(--tinta); outline: 1.5px dashed rgb(20 21 18 / 0.35); outline-offset: -1.5px; }
.pieza.is-pending .pieza__relieve { color: rgb(20 21 18 / 0.1); }
.pieza.is-pending:hover .pieza__relieve { color: rgb(214 59 11 / 0.45); }
.pieza.is-pending .pieza__pie { border-top: 1.5px dashed rgb(20 21 18 / 0.25); }
.pieza.is-pending .pieza__nombre { font-weight: 500; color: var(--tinta-2); }
.pieza.is-pending:hover { box-shadow: none; }

/* ───────── Contacto ───────── */

.contacto { padding-top: var(--s7); }
.contacto__title {
  font-weight: 900;
  font-stretch: 125%;
  font-size: clamp(2rem, 0.2rem + 7.6vw, 6rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.contacto__lede { margin-top: var(--s3); max-width: 36ch; color: var(--niebla); font-size: 1.15rem; }

.canales { margin-top: var(--s5); border-bottom: 1px solid rgb(238 240 234 / 0.16); }
.canal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s2);
  padding-block: var(--s3);
  border-top: 1px solid rgb(238 240 234 / 0.16);
  font-weight: 800;
  font-stretch: 112%;
  font-size: clamp(1.4rem, 1rem + 1.6vw, 2.4rem);
  line-height: 1.1;
  transition: color 250ms;
}
.canal__l { display: inline-flex; align-items: center; gap: 0.6em; min-width: 0; overflow-wrap: anywhere; transition: transform 400ms var(--ease); }
.canal__l .icon { width: 0.8em; height: 0.8em; }
.canal > .icon { width: 0.9em; height: 0.9em; transition: transform 400ms var(--ease); }
a.canal:hover { color: var(--volcan); }
a.canal:hover .canal__l { transform: translateX(var(--s2)); }
a.canal:hover > .icon { transform: translate(4px, -4px); }
.canal.is-pending { color: var(--niebla); font-weight: 600; border-top-style: dashed; }
.canal.is-pending .canal__suf { font-family: var(--f-serif); font-weight: 400; font-stretch: normal; font-size: 0.6em; margin-left: 0.4em; }

.pie {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s2);
  padding: var(--s6) var(--gutter) var(--s3);
  font-size: 0.85rem; color: var(--niebla);
}
.pie__alias { font-weight: 900; font-stretch: 125%; text-transform: uppercase; color: var(--papel); }

/* redes del menú */
.red { display: inline-flex; align-items: center; gap: 0.5em; padding: 0.55em 0.9em; border: 1px solid rgb(238 240 234 / 0.3); border-radius: 999px; font-weight: 600; font-size: 0.9rem; }
.red:hover { border-color: var(--volcan); color: var(--volcan); }

/* ───────── Sin WebGL ───────── */

html:not(.gl) .hero { height: auto; }
html:not(.gl) .hero__sticky { position: relative; height: 100svh; min-height: 34rem; }
html:not(.gl) .reveal { --r: 1; }
html:not(.gl) .scan-readout, html:not(.gl) .hint { display: none; }

/* ───────── Adaptación ───────── */

@media (max-width: 900px) {
  .sec-head { grid-template-columns: 1fr; }
  .log__item { grid-template-columns: 1fr; gap: var(--s1); }
  .leyenda { grid-template-columns: 1fr; }
  .split { flex-direction: column; min-height: 0; }
  .split__item + .split__item { border-left: 0; border-top: 1px solid rgb(238 240 234 / 0.16); }
  .split__link { min-height: 38svh; }
  .reveal { top: auto; bottom: 8.5rem; right: auto; left: var(--gutter); width: auto; }
  .ahora { min-width: 0; max-width: 55vw; }
  .hint__track { width: 5rem; }
  .hint { top: 5.6rem; bottom: auto; left: var(--gutter); right: auto; justify-items: start; }
}

@media (max-width: 600px) {
  .scan-readout { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .split__item, .pieza, .canal, .log__item::before { transition: none; }
  .menu.is-open { animation: none; }
}
