/* ============ Base ============ */
:root {
  --ink: #0d0b0a;
  --paper: #efe7da;
  --text: #1a1512;
  --muted: #7d7167;
  --line: rgba(26, 21, 18, .22);
  --accent: #d9481f;
  --glow: #f6d6b4;

  --f-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-serif: "Instrument Serif", Georgia, serif;
  --f-sans: "Instrument Sans", system-ui, sans-serif;

  --pad: clamp(1.25rem, 4vw, 4rem);
  --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--text);
  font-family: var(--f-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.display {
  font-family: var(--f-display);
  font-stretch: 125%;
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: .95;
}
.eyebrow {
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
}

/* ============ Grano ============ */
.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  z-index: 90;
  pointer-events: none;
  background-image: var(--noise);
  background-size: 180px;
  opacity: .085;
  animation: grain 1s steps(5) infinite;
}
@keyframes grain {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-4%, 3%); }
  40%  { transform: translate(3%, -5%); }
  60%  { transform: translate(-6%, -2%); }
  80%  { transform: translate(5%, 4%); }
  100% { transform: translate(0, 0); }
}

/* ============ Portada ============ */
.hero {
  position: relative;
  height: 200vh;
  background: var(--ink);
  color: var(--glow);
}
.hero-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.aura {
  position: absolute;
  inset: -40px;
  width: calc(100% + 80px);
  height: calc(100% + 80px);
  filter: blur(5px);
}
.hero-content {
  position: relative;
  text-align: center;
  width: min(36rem, 76vw);
  will-change: opacity, transform;
}
.hero-content .eyebrow { opacity: .8; margin-bottom: 1.6rem; }
.hero-name {
  font-size: clamp(2.8rem, 8vw, 7.4rem);
  line-height: .9;
  letter-spacing: -.02em;
}
.hero-name .w { display: block; white-space: nowrap; }
.hero-name .ch {
  display: inline-block;
  font-variation-settings: "wdth" var(--wd, 125), "wght" var(--wg, 800);
  transform: translateY(var(--ty, 0));
  opacity: 0;
  translate: 0 .55em;
  filter: blur(12px);
  transition: opacity 1s var(--ease), translate 1.3s var(--ease), filter 1s var(--ease);
  transition-delay: calc(var(--i) * 60ms + .15s);
}
.hero-name.on .ch { opacity: 1; translate: 0 0; filter: none; }
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 1.6rem;
  translate: -50% 0;
  display: flex; flex-direction: column; align-items: center; gap: .6rem;
  font-size: .68rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--glow);
  transition: opacity .4s;
}
.scroll-cue i {
  width: 1px; height: 38px; background: currentColor; opacity: .7;
  transform-origin: top; animation: cue 2.2s var(--ease) infinite;
}
@keyframes cue {
  0% { transform: scaleY(0); } 50% { transform: scaleY(1); transform-origin: top; }
  51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ============ Intro ============ */
.intro {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2rem;
  padding: clamp(4rem, 9vw, 9rem) var(--pad) clamp(5rem, 10vw, 10rem);
}
.intro-text {
  grid-column: 1 / span 10;
  font-family: var(--f-serif);
  font-size: clamp(2.2rem, 5.4vw, 5.8rem);
  line-height: 1.02;
  letter-spacing: -.01em;
  text-wrap: pretty;
}
.intro-text em { color: var(--accent); }
.intro-note {
  grid-column: 7 / span 5;
  margin-top: clamp(1rem, 3vw, 3rem);
  font-size: clamp(1rem, 1.35vw, 1.2rem);
  line-height: 1.5;
  color: var(--muted);
}
.intro-note a { color: var(--ink); border-bottom: 1px solid currentColor; transition: color .3s; }
.intro-note a:hover { color: var(--accent); }

/* ============ Apps ============ */
.elsewhere {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--ink);
  color: var(--glow);
  padding: clamp(5rem, 9vw, 8rem) var(--pad) 60vh;
  margin-top: -1px;
}
.elsewhere::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 75vh;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(244,150,140,.35), transparent 70%),
    linear-gradient(to bottom, rgba(239,231,218,0), rgba(239,231,218,.6) 55%, var(--paper));
}
.blobs { position: absolute; inset: 0; z-index: -1; }
.blobs i {
  position: absolute;
  width: 75vmax; height: 75vmax;
  border-radius: 50%;
  animation: drift 26s ease-in-out infinite alternate;
}
.blobs i:nth-child(1) { background: radial-gradient(circle, rgba(217,72,31,.85), transparent 62%); top: -8vmax; left: -26vmax; }
.blobs i:nth-child(2) { background: radial-gradient(circle, rgba(52,84,220,.8), transparent 62%); bottom: -40vmax; right: -25vmax; animation-duration: 31s; }
.blobs i:nth-child(3) { background: radial-gradient(circle, rgba(244,150,140,.55), transparent 60%); top: 20%; right: -40vmax; animation-duration: 23s; }
.blobs i:nth-child(4) { background: radial-gradient(circle, rgba(120,30,70,.7), transparent 60%); bottom: -30vmax; left: -30vmax; animation-duration: 35s; }
@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(8vmax, 6vmax) scale(1.12); }
  100% { transform: translate(-6vmax, 10vmax) scale(.95); }
}
.elsewhere-inner { max-width: 1400px; margin: 0 auto; }
.elsewhere h2 {
  font-size: clamp(2.2rem, 6vw, 6.4rem);
  max-width: 14ch;
  margin-top: 1.4rem;
  text-wrap: balance;
}
.elsewhere-sub { margin-top: 1.4rem; font-size: 1.1rem; opacity: .85; }
.apps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2.5vw, 2.5rem);
  margin-top: clamp(3.5rem, 7vw, 6rem);
}
.app {
  border-radius: 28px;
  overflow: hidden;
  background: rgba(13, 11, 10, .55);
  border: 1px solid rgba(246, 214, 180, .18);
  backdrop-filter: blur(6px);
}
.app-body {
  display: flex; justify-content: space-between; align-items: end; gap: 1.5rem;
  padding: 1.6rem 1.8rem 1.8rem;
}
.app h3 { font-size: clamp(1.8rem, 3vw, 2.8rem); margin-bottom: .5rem; }
.app p { opacity: .82; max-width: 30ch; }
.pill-link {
  flex: none;
  padding: .7rem 1.2rem;
  border-radius: 999px;
  background: var(--glow);
  color: var(--ink);
  font-weight: 500; font-size: .9rem;
  transition: transform .4s var(--ease);
}
.pill-link:hover { transform: translateY(-2px); }

/* Antes / después */
.ba {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  user-select: none;
}
.ba img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ba-before {
  filter: saturate(.72) contrast(.92) brightness(1.04) sepia(.08);
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}
.ba-line {
  position: absolute; top: 0; bottom: 0; left: var(--pos);
  width: 2px; translate: -1px 0; background: #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.08);
}
.ba-line::after {
  content: "↔"; position: absolute; top: 50%; left: 50%; translate: -50% -50%;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: #fff; color: var(--ink); font-size: 1rem;
}
.ba-tag {
  position: absolute; top: 1rem;
  padding: .3rem .7rem; border-radius: 999px;
  background: rgba(13,11,10,.55); color: #fff;
  font-size: .7rem; letter-spacing: .12em; text-transform: uppercase;
}
.ba-tag-l { left: 1rem; }
.ba-tag-r { right: 1rem; }
.ba input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: ew-resize; margin: 0;
}

/* Mini Dolf */
.dolf {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255,255,255,.55), transparent 60%),
    #f5efdf;
}
.dolf-level { width: 88%; height: auto; overflow: visible; }

/* ============ Contacto ============ */
.contact {
  padding: clamp(6rem, 12vw, 11rem) var(--pad) 2rem;
}
.contact-big {
  display: inline-block;
  margin: 1.6rem 0 clamp(4rem, 9vw, 8rem);
  font-size: clamp(3.2rem, 10.5vw, 12rem);
  cursor: default;
}
.contact-big span { display: block; width: fit-content; transition: color .5s; }
.contact-big span:hover { color: var(--accent); }
.contact-row {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: .85rem;
}
.contact-row span { color: var(--muted); }
.contact-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin-bottom: clamp(3rem, 6vw, 5rem);
  font-size: clamp(1rem, 1.6vw, 1.35rem);
}
.contact-cols span {
  display: block;
  font-size: .7rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: .4rem;
}
.contact-cols a { border-bottom: 1px solid var(--line); transition: color .3s; }
.contact-cols a:hover { color: var(--accent); }
.contact-cols em { display: block; margin-top: .35rem; font-style: normal; font-size: .8rem; color: var(--muted); }



/* ============ Look vintage: bloom + halation ============ */
/* Texto claro sobre fondo oscuro: núcleo que "quema" + halo rojizo de película */
.hero-content, .elsewhere-inner > :not(.apps) {
  text-shadow:
    0 0 1px rgba(255, 244, 228, .55),
    0 0 .08em rgba(255, 170, 120, .55),
    0 0 .3em rgba(232, 92, 44, .38),
    0 0 .9em rgba(217, 72, 31, .22);
}
.hero-name .ch {
  text-shadow:
    0 0 2px rgba(255, 244, 228, .6),
    0 0 .06em rgba(255, 170, 120, .6),
    0 0 .22em rgba(232, 92, 44, .42),
    0 0 .7em rgba(217, 72, 31, .26);
}
/* Fichas de apps: sin halo; el título con registro desfasado, como una impresión offset antigua */
.app-body { color: #fbf7f1; }
.app h3 {
  text-shadow:
    -.035em .01em 0 rgba(217, 72, 31, .55),
    .035em -.01em 0 rgba(52, 84, 220, .45);
  transition: text-shadow .6s var(--ease);
}
.app:hover h3 { text-shadow: -.06em .015em 0 rgba(217, 72, 31, .6), .06em -.015em 0 rgba(52, 84, 220, .5); }
/* Texto oscuro sobre papel: tinta que se corre un poco, con un borde cálido */
.intro, .contact {
  text-shadow:
    0 0 .6px rgba(13, 11, 10, .45),
    0 0 .06em rgba(217, 72, 31, .16);
}
.intro-text {
  text-shadow:
    -.02em .005em 0 rgba(217, 72, 31, .38),
    .02em -.005em 0 rgba(52, 84, 220, .3);
  transition: opacity 1.1s var(--ease), transform 1.3s var(--ease), text-shadow .6s var(--ease);
}
.intro-text:hover { text-shadow: -.035em .008em 0 rgba(217, 72, 31, .45), .035em -.008em 0 rgba(52, 84, 220, .36); }
.contact-big span { text-shadow: 0 0 1px rgba(13, 11, 10, .4), 0 0 .05em rgba(217, 72, 31, .22), 0 0 .25em rgba(217, 72, 31, .08); }
.contact-big span:hover { text-shadow: 0 0 1px rgba(217, 72, 31, .6), 0 0 .08em rgba(255, 140, 90, .5), 0 0 .35em rgba(217, 72, 31, .3); }
/* Viñeta suave en los bordes de la pantalla */
.vignette {
  position: fixed; inset: 0; z-index: 89; pointer-events: none;
  background: radial-gradient(ellipse 120% 100% at 50% 50%, transparent 55%, rgba(40, 22, 12, .28) 100%);
}

/* ============ Visor ============ */
.lightbox {
  position: fixed; inset: 0; z-index: 80;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  background: rgba(13, 11, 10, .96);
  color: var(--glow);
  opacity: 0; transition: opacity .35s;
}
.lightbox[hidden] { display: none; }
.lightbox.open { opacity: 1; }
.lb-figure {
  grid-column: 2;
  height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 4.5rem 0 2rem;
  gap: .9rem;
  min-width: 0;
}
.lb-figure img { max-height: calc(100svh - 9rem); width: auto; object-fit: contain; }
.lb-figure figcaption { font-size: .78rem; letter-spacing: .06em; opacity: .75; }
.lb-close {
  position: absolute; top: 1.1rem; right: var(--pad);
  font-size: .85rem; letter-spacing: .08em; text-transform: uppercase;
}
.lb-nav { padding: 2rem var(--pad); font-size: 1.6rem; opacity: .7; transition: opacity .3s; }
.lb-nav:hover { opacity: 1; }

/* ============ Animación de entrada ============ */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 1.1s var(--ease), transform 1.3s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ============ Móvil ============ */
@media (max-width: 760px) {
  .intro-text, .intro-note { grid-column: 1 / -1; }
  .elsewhere { padding-bottom: 40vh; }
  .elsewhere::after { height: 50vh; }
  .apps { grid-template-columns: 1fr; }
  .contact-cols { grid-template-columns: 1fr; }
  .app-body { flex-direction: column; align-items: start; }
  .lightbox { grid-template-columns: 1fr; }
  .lb-figure { grid-column: 1; grid-row: 1; padding: 4rem 1rem 5rem; }
  .lb-nav { position: absolute; bottom: 0; }
  .lb-prev { left: 0; } .lb-next { right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grain, .blobs i, .scroll-cue i { animation: none; }
  .hero-name .ch { transition: none; opacity: 1; translate: 0 0; filter: none; }
  .reveal { transition: none; transform: none; opacity: 1; filter: none; }
}
