/* ==========================================================================
   Rens — estilos (sistema de diseño "Air": lienzo oscuro, tipografía
   tranquila, tarjetas Haze planas y un acento en cursiva)
   ========================================================================== */

:root {
  /* Colores */
  --whiteout: #ffffff;
  --haze: #f5f5f5;
  --ink: #1b1b1b;
  --void: #000000;
  --twilight: #426188;   /* solo en texto grande sobre oscuro (contraste 3.3:1) */
  --signal: #2b7fff;     /* solo enlaces sobre oscuro */

  --text-on-dark: var(--whiteout);
  --muted-on-dark: rgba(255, 255, 255, 0.64);
  --hairline-dark: rgba(255, 255, 255, 0.14);
  --muted-on-light: rgba(27, 27, 27, 0.7);
  --hairline-light: rgba(0, 0, 0, 0.1);

  /* Tipografía (sustitutos de Control) */
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-compressed: "Anton", Impact, "Arial Narrow", sans-serif;
  --font-cursive: "Caveat", "Segoe Print", cursive;

  /* Radios */
  --radius-input: 4px;
  --radius-button: 8px;
  --radius-image: 11px;
  --radius-card: 12px;

  /* Layout */
  --max: 1150px;
  --gutter: 24px;
  --section-gap: 120px;
  --nav-h: 72px;

  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --focus: var(--whiteout);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--void);
  color: var(--text-on-dark);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

strong {
  font-weight: 500;
}

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

.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;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--haze);
  color: var(--ink);
  border-radius: var(--radius-button);
  font-weight: 500;
  text-decoration: none;
}

.skip-link:focus {
  top: 16px;
}

/* --------------------------------------------------------------------------
   Tipografía compartida
   -------------------------------------------------------------------------- */

.eyebrow {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-on-dark);
}

h2 {
  font-size: clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem); /* 36px → 56px */
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
}

h3 {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

/* Palabra en cursiva que rompe el titular */
.accent {
  font-family: var(--font-cursive);
  font-weight: 500;
  font-size: 1.18em;          /* compensa la altura x menor de la cursiva */
  letter-spacing: 0;
  line-height: 0.8;
  color: var(--twilight);
}

/* --------------------------------------------------------------------------
   Botones
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 168px;
  height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  font: inherit;
  font-weight: 500;
  font-size: 16px;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, scale 0.15s ease;
}

.btn:active {
  scale: 0.98;
}

/* Transparente con borde blanco, sobre oscuro */
.btn-ghost {
  background: transparent;
  color: var(--whiteout);
  border-color: var(--whiteout);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Relleno Haze con borde Ink */
.btn-light {
  background: var(--haze);
  color: var(--ink);
  border-color: var(--ink);
}

.btn-light:hover {
  background: var(--whiteout);
}

.btn-sm {
  min-width: 0;
  height: 40px;
  padding: 0 16px;
  font-size: 14px;
}

/* --------------------------------------------------------------------------
   Navegación
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.72);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--hairline-dark);
}

.nav {
  display: flex;
  align-items: center;
  gap: 32px;
  max-width: var(--max);
  height: var(--nav-h);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.wordmark {
  font-family: var(--font-compressed);
  font-size: 26px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1;
}

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-links a {
  display: block;
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: var(--muted-on-dark);
  transition: color 0.15s ease;
}

.nav-links a:hover {
  color: var(--whiteout);
}

.nav .btn {
  margin-left: auto;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.section {
  max-width: var(--max);
  margin: var(--section-gap) auto 0;
  padding: 0 var(--gutter);
}

/* Encabezado de sección centrado */
.section-head {
  display: grid;
  justify-items: center;
  gap: 16px;
  max-width: 760px;
  margin: 0 auto 48px;
  text-align: center;
}

.section-lead {
  font-size: 20px;
  line-height: 1.4;
  color: var(--muted-on-dark);
}

.grid-3,
.grid-2 {
  display: grid;
  gap: 24px;
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* --------------------------------------------------------------------------
   Imágenes y marcadores de posición
   -------------------------------------------------------------------------- */

.media {
  position: relative;
  overflow: hidden;
  background: #111111;
}

.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media.is-missing {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--hairline-dark);
}

.media.is-missing img {
  display: none;
}

.media.is-missing::after {
  content: attr(data-placeholder);
  padding: 8px;
  font-size: 13px;
  color: var(--muted-on-dark);
  text-align: center;
  word-break: break-word;
}

/* --------------------------------------------------------------------------
   Hero (a sangre, altura de pantalla)
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(720px, calc(100svh - var(--nav-h)), 1000px);
  padding: 200px var(--gutter);
  overflow: hidden;
  background: var(--void);
  /* Foto atmosférica opcional (cielo, nubes): guarda tu foto como
     assets/hero-bg.jpg y descomenta la línea siguiente.
  background: var(--void) url("assets/hero-bg.jpg") center / cover no-repeat; */
}

/* Velo plano para mantener el contraste del texto sobre la foto */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 720px;
  text-align: center;
}

.hero h1 {
  margin-top: 20px;
  font-size: clamp(2.75rem, 1.5rem + 5vw, 4.5rem); /* 44px → 72px */
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
}

.hero-lead {
  max-width: 480px;
  margin: 24px auto 0;
  font-size: 20px;
  line-height: 1.4;
  color: var(--muted-on-dark);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 40px;
}

.hero-thumbs {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* Cada movimiento usa su propia propiedad para no pisarse:
   rotate = inclinación fija · scale/opacity = entrada ·
   translate = flotación continua · transform = parallax con el cursor */
.thumb {
  position: absolute;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-image);
  border: 1px solid var(--hairline-dark);
  rotate: var(--r, 0deg);
  transform: translate3d(var(--px, 0px), var(--py, 0px), 0);
  transition: transform 0.9s var(--ease-out);
  animation:
    thumb-in 0.9s var(--ease-out) var(--in, 0s) both,
    thumb-float var(--dur, 6s) ease-in-out calc(var(--in, 0s) + 0.9s) infinite;
}

/* Bandas superior e inferior: miniaturas grandes.
   Banda central: miniaturas pequeñas pegadas a los bordes. */
.t1 { width: 120px; top: 32px;    left: 4%;    --r: -3deg; --in: 0.35s; --dur: 6.5s; }
.t2 { width: 72px;  top: 16px;    left: 28%;   --r: 2deg;  --in: 0.45s; --dur: 5.2s; }
.t3 { width: 92px;  top: 56px;    right: 26%;  --r: -2deg; --in: 0.55s; --dur: 7s; }
.t4 { width: 140px; top: 20px;    right: 4%;   --r: 4deg;  --in: 0.4s;  --dur: 6s; }
.t5 { width: 76px;  top: calc(50% - 48px); left: 2%;  --r: 3deg;  --in: 0.6s; --dur: 5.6s; }
.t6 { width: 96px;  top: calc(50% - 60px); right: 2%; --r: -4deg; --in: 0.5s; --dur: 6.8s; }
.t7 { width: 128px; bottom: 24px; left: 13%;   --r: 2deg;  --in: 0.65s; --dur: 7.4s; }
.t8 { width: 60px;  bottom: 48px; right: 19%;  --r: -3deg; --in: 0.7s;  --dur: 5s; }

@keyframes thumb-in {
  from { opacity: 0; scale: 0.8; }
  to   { opacity: 1; scale: 1; }
}

@keyframes thumb-float {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -10px; }
}

/* Entrada escalonada del texto del hero */
.hero-content > * {
  animation: rise 0.9s var(--ease-out) both;
}

.hero-content > :nth-child(1) { animation-delay: 0.05s; }
.hero-content > :nth-child(2) { animation-delay: 0.15s; }
.hero-content > :nth-child(3) { animation-delay: 0.28s; }
.hero-content > :nth-child(4) { animation-delay: 0.4s; }

@keyframes rise {
  from { opacity: 0; translate: 0 24px; }
  to   { opacity: 1; translate: 0 0; }
}

/* Aparición al hacer scroll (solo con JS activo; sin JS todo es visible) */
.js [data-reveal] {
  opacity: 0;
  translate: 0 32px;
  transition:
    opacity 0.8s var(--ease-out) var(--d, 0s),
    translate 0.8s var(--ease-out) var(--d, 0s);
}

.js [data-reveal].is-visible {
  opacity: 1;
  translate: 0 0;
}

/* --------------------------------------------------------------------------
   Tarjetas Haze: islas claras sobre el lienzo oscuro
   -------------------------------------------------------------------------- */

.card {
  --focus: var(--ink);
  background: var(--haze);
  color: var(--ink);
  border-radius: var(--radius-card);
  padding: 20px;
}

.card-media {
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-image);
}

.card-media.is-missing {
  background: var(--whiteout);
  border-color: var(--hairline-light);
}

.card-media.is-missing::after {
  color: var(--muted-on-light);
}

.card-media img {
  transition: scale 0.8s var(--ease-out);
}

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

.card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 4px 4px;
}

.tag {
  align-self: flex-start;
  padding: 2px 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-on-light);
  border: 1px solid var(--hairline-light);
  border-radius: var(--radius-input);
}

.card-desc {
  margin-top: 4px;
}

/* Proyecto destacado: todo el ancho, imagen y texto lado a lado en escritorio */
.card-featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  align-items: center;
  gap: 24px;
}

.card-featured .card-body {
  padding: 4px;
}

.card-cta {
  align-self: flex-start;
  margin-top: 8px;
}

.card-role,
.person-role {
  color: var(--muted-on-light);
}

.card-role span {
  color: var(--ink);
  font-weight: 500;
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 8px;
}

/* Enlace subrayado: el subrayado es la señal, sin relleno */
.card-links a,
.inline-link,
.contact-mail {
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.card-links a {
  text-decoration-color: var(--hairline-light);
  transition: text-decoration-color 0.15s ease;
}

.card-links a:hover {
  text-decoration-color: currentColor;
}

.card-links a span[aria-hidden] {
  display: inline-block;
  transition: translate 0.25s var(--ease-out);
}

.card-links a:hover span[aria-hidden] {
  translate: 2px -2px;
}

/* --------------------------------------------------------------------------
   Cómo construimos
   -------------------------------------------------------------------------- */

.tools {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted-on-dark);
}

.tools span {
  color: var(--whiteout);
}

.ai-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-card h3 {
  margin-top: 8px;
}

.ai-note {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--hairline-light);
  font-size: 14px;
  color: var(--muted-on-light);
}

.ai-card p:not(.status):not(.ai-note) {
  padding-bottom: 8px;
}

.ai-note span {
  color: var(--ink);
  font-weight: 500;
}

.status {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 8px;
  padding: 2px 8px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--hairline-light);
  border-radius: var(--radius-input);
}

/* Estado sin color: punteado → contorno → relleno */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px dashed var(--ink);
}

.status[data-status="desarrollo"] .status-dot {
  border-style: solid;
}

.status[data-status="publicado"] .status-dot {
  border-style: solid;
  background: var(--ink);
}

.ai-next {
  max-width: 760px;
  margin: 48px auto 0;
  font-size: 20px;
  line-height: 1.4;
  text-align: center;
  color: var(--muted-on-dark);
}

/* --------------------------------------------------------------------------
   Estudio
   -------------------------------------------------------------------------- */

.studio-text {
  grid-column: span 2;
  display: grid;
  align-content: start;
  gap: 20px;
  max-width: 680px;
  font-size: 20px;
  line-height: 1.5;
  color: var(--muted-on-dark);
}

.studio-text a {
  color: var(--whiteout);
}

.inline-link {
  text-decoration-color: var(--signal);
  transition: color 0.15s ease;
}

.inline-link:hover {
  color: var(--signal);
}

.person {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 4px;
}

.person .eyebrow {
  color: var(--muted-on-light);
}

.person h3 {
  margin-top: 8px;
}

.person .btn {
  margin-top: 20px;
}

/* --------------------------------------------------------------------------
   Contacto
   -------------------------------------------------------------------------- */

.contact {
  display: grid;
  justify-items: center;
  gap: 16px;
  text-align: center;
}

.contact h2 {
  font-size: clamp(3rem, 2rem + 4vw, 4.5rem);
}

.contact-lead {
  font-size: 20px;
  color: var(--muted-on-dark);
}

.contact-mail {
  margin-top: 16px;
  font-size: clamp(1.25rem, 1rem + 1.2vw, 2rem);
  color: var(--signal);
  word-break: break-word;
  transition: color 0.15s ease;
}

.contact-mail:hover {
  color: var(--whiteout);
}

/* --------------------------------------------------------------------------
   Pie de página: titular comprimido a sangre como cierre
   -------------------------------------------------------------------------- */

.site-footer {
  margin-top: var(--section-gap);
  border-top: 1px solid var(--hairline-dark);
  overflow: hidden;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px var(--gutter) 0;
  color: var(--muted-on-dark);
  font-size: 14px;
  font-weight: 500;
}

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

.footer-info {
  display: grid;
  gap: 4px;
}

.footer-links a,
.footer-info a {
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.footer-links a:hover,
.footer-info a:hover {
  color: var(--whiteout);
}

.footer-display {
  margin: 24px 0 -0.08em;
  font-family: var(--font-compressed);
  font-size: clamp(7rem, 30vw, 26rem);
  line-height: 0.85;
  text-transform: uppercase;
  text-align: center;
  letter-spacing: -0.01em;
  color: var(--whiteout);
  user-select: none;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1080px) {
  .t2 { left: 22%; }
  .t3 { right: 20%; }
}

@media (max-width: 900px) {
  :root {
    --section-gap: 80px;
  }

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

  .card-featured {
    display: block;
  }

  .card-featured .card-body {
    padding: 20px 4px 4px;
  }

  .studio-text {
    grid-column: auto;
    max-width: none;
  }

  /* Hero: las miniaturas salen del fondo y pasan debajo del texto */
  .hero {
    flex-direction: column;
    gap: 48px;
    min-height: 0;
    padding: 72px var(--gutter) 64px;
  }

  .hero-thumbs {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 72px));
    justify-content: center;
    gap: 16px 12px;
    width: 100%;
  }

  .thumb {
    position: static;
    width: 100%;
  }

  /* Desfase vertical alterno para mantener el aire "flotante" */
  .thumb:nth-child(even) {
    margin-top: 12px;
  }
}

@media (max-width: 640px) {
  :root {
    --gutter: 16px;
    --nav-h: 64px;
  }

  .nav-links {
    display: none;
  }

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

  .hero-actions .btn {
    flex: 1 1 0;
    min-width: 0;
  }

  .hero-thumbs {
    grid-template-columns: repeat(4, minmax(0, 64px));
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .js [data-reveal] {
    opacity: 1;
    translate: none;
  }
}
