/* ============================================================
   TACTO — Balones de cuero
   Landing 3D · Three.js + GSAP ScrollTrigger
   ============================================================ */

:root {
  --ink: #0c0b0a;
  --ink-2: #14110e;
  --cream: #f3ece3;
  --cream-dim: rgba(243, 236, 227, 0.66);
  --cream-faint: rgba(243, 236, 227, 0.4);
  --orange: #e2601a;
  --orange-soft: #f08a4b;
  --line: rgba(243, 236, 227, 0.14);
  --pad: clamp(20px, 5vw, 76px);

  --font-display: "Anton", Impact, sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

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

html {
  background: var(--ink);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::selection { background: var(--orange); color: #fff; }

a { color: inherit; text-decoration: none; }

.skip {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
}
.skip:focus { top: 16px; }

/* ---------- capas de fondo ---------- */

.fallback {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(80% 60% at 68% 38%, rgba(226, 96, 26, 0.16), transparent 62%),
    radial-gradient(120% 90% at 50% 100%, #1a1714 0%, #0c0b0a 70%);
}

#webgl {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}
body.is-ready #webgl { opacity: 1; }

.grain {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.14;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(115% 90% at 50% 46%, transparent 38%, rgba(0, 0, 0, 0.62) 100%);
}

/* ---------- barra superior ---------- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(16px, 2.4vw, 26px) var(--pad);
  pointer-events: none;
}
.topbar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 150px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(8, 7, 6, 0.82), rgba(8, 7, 6, 0));
}
.topbar > * { pointer-events: auto; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--cream);
}
.brand__mark {
  width: 22px;
  height: 22px;
  color: var(--orange);
  flex: none;
}
.brand__word {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.06em;
  line-height: 1;
  padding-top: 2px;
}
.brand__word sup {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0;
  vertical-align: super;
  margin-left: 2px;
  opacity: 0.65;
}

.topbar__meta {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cream-faint);
  white-space: nowrap;
}

.topbar__cta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cream);
  position: relative;
  padding-bottom: 5px;
}
.topbar__cta::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.topbar__cta:hover::after { transform: scaleX(1); }

/* ---------- tipografía compartida ---------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--cream-dim);
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 12px rgba(226, 96, 26, 0.9);
  flex: none;
}

/* ---------- HERO ---------- */

.hero {
  position: relative;
  z-index: 5;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  padding: clamp(96px, 14vh, 150px) var(--pad) clamp(30px, 6vh, 64px);
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 72%;
  background: linear-gradient(to top, rgba(8, 7, 6, 0.9) 4%, rgba(8, 7, 6, 0.45) 46%, transparent 100%);
  pointer-events: none;
  z-index: -1;
}

.hero__inner {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: clamp(22px, 4vh, 46px);
}

.hero__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 20px;
}

.hero__eyebrow { margin-bottom: 0; }

.hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(46px, 11.2vw, 176px);
  line-height: 0.88;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  text-wrap: balance;
}
.hero__title .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.045em;
  margin-bottom: -0.045em;
}
.hero__title.is-revealed .line { overflow: visible; }
.hero__title .line > span {
  display: block;
  will-change: transform;
}
.hero__title .serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  text-transform: none;
  letter-spacing: -0.025em;
  font-size: 0.93em;
  line-height: 0.95;
  color: var(--cream);
  padding-left: 0.06em;
}

.hero__foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(24px, 6vw, 90px);
  border-top: 1px solid var(--line);
  padding-top: clamp(16px, 2.4vh, 26px);
}
.hero__lead {
  margin: 0;
  max-width: 44ch;
  font-size: clamp(13px, 1.05vw, 15px);
  font-weight: 300;
  line-height: 1.7;
  color: var(--cream-dim);
  text-shadow: 0 1px 24px rgba(0, 0, 0, 0.6);
}

.scroll-hint {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cream-faint);
  white-space: nowrap;
}
.scroll-hint i {
  position: relative;
  display: block;
  width: clamp(36px, 5vw, 64px);
  height: 1px;
  background: rgba(243, 236, 227, 0.16);
  overflow: hidden;
}
.scroll-hint i::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 42%;
  background: var(--orange);
  animation: hint 2.4s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
@keyframes hint {
  0% { transform: translateX(-120%); }
  60%, 100% { transform: translateX(280%); }
}

/* ---------- CAPÍTULOS ---------- */

.chapter {
  position: relative;
  z-index: 5;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: clamp(90px, 14vh, 160px) var(--pad);
}
.chapter::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(100deg, rgba(8, 7, 6, 0.78) 0%, rgba(8, 7, 6, 0.42) 34%, rgba(8, 7, 6, 0) 64%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 20%, #000 80%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 20%, #000 80%, transparent 100%);
  z-index: -1;
}

.chapter__inner {
  width: 100%;
  max-width: 620px;
}

.chapter__head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: clamp(18px, 3vh, 30px);
}
.chapter__num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--orange);
}
.chapter__kicker {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--cream-faint);
}
.chapter__head::after {
  content: "";
  height: 1px;
  width: clamp(40px, 7vw, 96px);
  background: linear-gradient(90deg, rgba(226, 96, 26, 0.55), transparent);
}

.chapter__title {
  margin: 0 0 clamp(20px, 3.4vh, 34px);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(38px, 5.6vw, 78px);
  line-height: 0.94;
  letter-spacing: -0.012em;
  text-transform: uppercase;
  text-shadow: 0 2px 40px rgba(0, 0, 0, 0.55);
}
.chapter__title em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  text-transform: none;
  letter-spacing: -0.02em;
  font-size: 0.92em;
  color: var(--orange-soft);
}

.chapter__body {
  margin: 0;
  max-width: 48ch;
  font-size: clamp(14px, 1.1vw, 16px);
  font-weight: 300;
  line-height: 1.75;
  color: rgba(243, 236, 227, 0.72);
  text-shadow: 0 1px 30px rgba(0, 0, 0, 0.7);
}

/* ---------- specs ---------- */

.specs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: clamp(26px, 4vh, 42px) 0 0;
  border-top: 1px solid var(--line);
  max-width: 620px;
}
.specs__item {
  padding: 14px 14px 0 16px;
  border-right: 1px solid var(--line);
}
.specs__item:first-child { padding-left: 0; }
.specs__item:last-child { border-right: 0; }
.specs__item dt {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cream-faint);
  margin-bottom: 7px;
}
.specs__item dd {
  margin: 0;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--cream);
  line-height: 1.35;
}

/* ---------- stats ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 2.4vw, 28px);
  margin-top: clamp(28px, 4vh, 44px);
  max-width: 580px;
}
.stats__item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.stats__num {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 0.9;
  letter-spacing: -0.01em;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}
.stats__label {
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.5;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream-faint);
}

/* ---------- facts ---------- */

.facts {
  list-style: none;
  margin: clamp(26px, 4vh, 42px) 0 0;
  padding: 0;
  max-width: 540px;
  border-top: 1px solid var(--line);
}
.facts li {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(243, 236, 227, 0.08);
  font-size: 13px;
  font-weight: 300;
  color: rgba(243, 236, 227, 0.7);
}
.facts li span {
  flex: none;
  width: 68px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--orange);
}

/* ---------- OUTRO ---------- */

.outro {
  position: relative;
  z-index: 5;
  min-height: 86svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(100px, 18vh, 190px) var(--pad) clamp(22px, 4vh, 38px);
}
.outro::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(100deg, rgba(8, 7, 6, 0.88) 0%, rgba(8, 7, 6, 0.42) 42%, rgba(8, 7, 6, 0) 76%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 26%, #000 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 26%, #000 100%);
}
.outro::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 190px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to top, rgba(8, 7, 6, 0.92), rgba(8, 7, 6, 0));
}
.outro__inner { max-width: 900px; }

.outro__title {
  margin: clamp(18px, 3vh, 30px) 0 clamp(26px, 5vh, 52px);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(50px, 9.4vw, 148px);
  line-height: 0.86;
  letter-spacing: -0.018em;
  text-transform: uppercase;
}
.outro__title em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  text-transform: none;
  font-size: 0.92em;
  color: var(--orange);
}

.outro__row {
  display: flex;
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 17px 26px;
  border: 1px solid rgba(243, 236, 227, 0.28);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cream);
  transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease, transform 0.4s ease;
}
.btn span { transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
.btn:hover {
  background: var(--orange);
  border-color: var(--orange);
  color: #120d09;
}
.btn:hover span { transform: translateX(4px); }

.outro__note {
  margin: 0;
  font-size: 12px;
  font-weight: 300;
  line-height: 1.7;
  color: rgba(243, 236, 227, 0.56);
}

.outro__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: clamp(50px, 10vh, 110px);
  padding-top: 18px;
  padding-right: 165px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(243, 236, 227, 0.34);
}
.outro__links a { transition: color 0.3s ease; }
.outro__links a:hover { color: var(--orange); }

/* ---------- HUD ---------- */

.hud {
  position: fixed;
  right: var(--pad);
  bottom: clamp(18px, 3.4vh, 32px);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  padding: 10px 14px 12px;
  border: 1px solid rgba(243, 236, 227, 0.16);
  border-radius: 3px;
  background: rgba(10, 9, 8, 0.52);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.hud__bounce {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}
.hud__count {
  font-size: 15px;
  letter-spacing: 0.04em;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.hud__total { color: rgba(255, 255, 255, 0.38); }
.hud__label { margin-left: 4px; color: rgba(255, 255, 255, 0.38); }

.hud__bar {
  width: 92px;
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
}
.hud__bar i {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
}

/* ---------- fallback sin GSAP / sin WebGL ---------- */

html.no-gsap .hero__title .line,
html.no-webgl .hero__title .line { overflow: visible; }
html.no-gsap .hero__title .line > span,
html.no-webgl .hero__title .line > span {
  transform: none !important;
  opacity: 1 !important;
}
html.no-gsap .reveal,
html.no-webgl .reveal {
  opacity: 1 !important;
  transform: none !important;
}

.noscript {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 50;
  padding: 12px 20px;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  border-radius: 2px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1080px) {
  .topbar__meta { display: none; }
  .chapter__inner { max-width: 560px; }
  .specs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .specs__item:nth-child(2) { border-right: 0; }
  .specs__item:nth-child(odd) { padding-left: 0; }
}

@media (max-width: 860px) {
  /* En móvil, un único velo inferior fijo: legibilidad sin cortes entre secciones */
  .chapter::before { display: none; }
  body::after {
    content: "";
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 78vh;
    z-index: 3;
    pointer-events: none;
    opacity: var(--scrim-opacity, 0);
    background: linear-gradient(
      to top,
      rgba(8, 7, 6, 0.95) 0%,
      rgba(8, 7, 6, 0.85) 40%,
      rgba(8, 7, 6, 0.55) 70%,
      rgba(8, 7, 6, 0) 100%
    );
  }
  .btn {
    background: rgba(10, 9, 8, 0.72);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-color: rgba(243, 236, 227, 0.3);
  }
  .chapter { align-items: flex-end; padding-bottom: clamp(60px, 9vh, 100px); }
  .hero__foot { flex-direction: column; align-items: flex-start; gap: 24px; }
  .scroll-hint { display: none; }
  .hud { display: none; }
  .hero { padding-bottom: clamp(28px, 5vh, 46px); }
  .hero__title { font-size: clamp(44px, 13vw, 110px); }
  .specs__item { padding: 12px 12px 0 16px; }
  .stats { gap: 14px; }
  .stats__num { font-size: clamp(24px, 6vw, 34px); }
  .outro { min-height: 90svh; }
  .outro__bottom { padding-right: 0; }
}

@media (max-width: 560px) {
  .topbar__cta { font-size: 9px; }
  .brand__word { font-size: 17px; }
  .hero__lead { font-size: 13px; max-width: 34ch; }
  .chapter__title { font-size: clamp(34px, 9.6vw, 54px); }
  .chapter__body { font-size: 13.5px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats__item:last-child { grid-column: span 2; }
  .facts li { font-size: 12px; gap: 12px; }
  .facts li span { width: 56px; }
  .outro__bottom { font-size: 8px; letter-spacing: 0.1em; padding-right: 0; }  .outro__bottom span:last-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-hint i::after { animation: none; }
  #webgl { transition: none; }
  * { scroll-behavior: auto !important; }
}
