/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg:       #0b0b0c;   /* casi negro */
  --granite:  #1b1c1e;   /* granito oscuro */
  --granite-2:#2b2c2f;   /* granito medio */
  --gray:     #8b8c90;   /* gris */
  --white:    #f2f2f0;   /* blanco */
  --line:     rgba(242,242,240,0.14);
  --orange:   #ff6a00;   /* naranja fuerte: solo al pulsar */
  --orange-rgb: 255,106,0;
  --serif: "Fraunces", Georgia, serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--bg); }
body {
  background: var(--bg);
  color: var(--white);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2 { font-family: var(--serif); font-weight: 300; line-height: 1; letter-spacing: -0.02em; }
::selection { background: var(--white); color: var(--bg); }
:focus-visible { outline: 2px solid var(--white); outline-offset: 4px; border-radius: 6px; }

.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 9999;
  padding: .6rem 1rem; background: var(--white); color: var(--bg); border-radius: 8px;
}
.skip-link:focus { top: 1rem; }

/* =============================================================
   3. Fondo animado: manchas de granito + grano
   ============================================================= */
.bg { position: fixed; inset: 0; z-index: -2; overflow: hidden; background: var(--bg); }
.blob {
  position: absolute;
  width: 70vmax; height: 70vmax;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
}
.blob-a {
  top: -25vmax; left: -20vmax;
  background: radial-gradient(circle, rgba(70,72,78,0.55) 0%, transparent 65%);
  animation: driftA 26s ease-in-out infinite alternate;
}
.blob-b {
  bottom: -30vmax; right: -25vmax;
  background: radial-gradient(circle, rgba(52,53,58,0.6) 0%, transparent 65%);
  animation: driftB 32s ease-in-out infinite alternate;
}
@keyframes driftA { to { translate: 22vmax 14vmax; scale: 1.25; } }
@keyframes driftB { to { translate: -20vmax -16vmax; scale: 1.2; } }

.grain { display: none; }
@keyframes grainShift {
  0%   { transform: translate(0,0); }
  20%  { transform: translate(-3%,2%); }
  40%  { transform: translate(2%,-3%); }
  60%  { transform: translate(-2%,-1%); }
  80%  { transform: translate(3%,3%); }
  100% { transform: translate(0,0); }
}



/* =============================================================
   4. Hero
   ============================================================= */
section { position: relative; }
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 2rem 1.25rem;
}
.title {
  font-size: clamp(3rem, 13vw, 9.5rem);
  display: flex; flex-wrap: wrap; justify-content: center; column-gap: 0.28em;
  will-change: transform;
}
.word { display: inline-flex; }
.ch {
  display: inline-block;
  opacity: 0;
  transform: translateY(70%) rotate(6deg);
  filter: blur(10px);
  animation:
    chIn 1.1s var(--ease-out) forwards,
    chWave 5s ease-in-out infinite,
    chTone 6s ease-in-out infinite;
  animation-delay: calc(var(--i) * 80ms + 200ms), calc(var(--i) * 80ms + 1.6s), calc(var(--i) * 90ms + 1.6s);
}
@keyframes chIn { to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes chWave { 0%,100% { translate: 0 0; } 50% { translate: 0 -0.06em; } }
@keyframes chTone { 0%,100% { color: var(--white); } 50% { color: var(--gray); } }

.subtitle {
  margin-top: clamp(1rem, 2.4vw, 1.75rem);
  font-size: clamp(0.72rem, 1.5vw, 0.9rem);
  font-weight: 300;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gray);
  opacity: 0;
  animation: subIn 1.4s var(--ease-out) 1.4s forwards;
}
@keyframes subIn { from { opacity: 0; letter-spacing: 0.6em; } to { opacity: 1; letter-spacing: 0.32em; } }



.scroll-line {
  position: absolute; left: 50%; bottom: 2.2rem;
  width: 1px; height: 56px; background: var(--line); overflow: hidden;
}
.scroll-line::after {
  content: ""; position: absolute; left: 0; top: -100%;
  width: 100%; height: 100%; background: var(--white);
  animation: scrollDrop 2.4s ease-in-out infinite;
}
@keyframes scrollDrop { 0% { top: -100%; } 60%,100% { top: 100%; } }

/* =============================================================
   5. Plataforma FOUBA
   ============================================================= */
.platform {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 2rem;
  padding: 6rem 1.25rem;
  max-width: 1240px; margin-inline: auto;
}
a.platform-text, a.tooth-stage { display: block; color: inherit; cursor: pointer; }
a.platform-text { transition: transform .5s var(--ease-out); }
a.platform-text:hover { transform: translateX(8px); }
.platform-text h2 { font-size: clamp(2.4rem, 7vw, 5rem); }
.fouba {
  display: inline-block;
  background: linear-gradient(100deg, var(--gray) 0%, var(--white) 45%, var(--gray) 90%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: sheen 5s ease-in-out infinite;
}
@keyframes sheen { 0%,100% { background-position: 100% 0; } 50% { background-position: 0 0; } }

.rule {
  display: block; height: 1px; width: 90px; margin-top: 1.75rem;
  background: var(--white); transform-origin: left;
  animation: ruleGrow 4s ease-in-out infinite;
}
@keyframes ruleGrow { 0%,100% { transform: scaleX(0.25); } 50% { transform: scaleX(1); } }

.tooth-stage {
  position: relative;
  width: min(100%, 520px);
  aspect-ratio: 1 / 1.05;
  margin-inline: auto;
  display: grid; place-items: center;
}
.tooth-float { width: 82%; animation: toothFloat 7s ease-in-out infinite; }
.tooth {
  width: 100%;
  will-change: transform;
  filter: drop-shadow(0 40px 50px rgba(0,0,0,0.55));
  transition: filter .5s var(--ease-out);
}
@keyframes toothFloat {
  0%,100% { translate: 0 0; rotate: -2deg; }
  50%     { translate: 0 -22px; rotate: 2.5deg; }
}
.tooth-glow {
  position: absolute; inset: 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(242,242,240,0.16) 0%, transparent 65%);
  filter: blur(30px);
  animation: glowPulse 6s ease-in-out infinite;
}
@keyframes glowPulse { 0%,100% { opacity: .45; scale: .9; } 50% { opacity: 1; scale: 1.08; } }


.orbit { position: absolute; inset: 0; width: 100%; height: 100%; }
.orbit circle { fill: none; stroke: var(--line); stroke-width: 1; transform-origin: 200px 200px; }
.o1 { stroke-dasharray: 3 12; animation: spin 60s linear infinite; }
.o2 { stroke-dasharray: 80 40; animation: spin 40s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 860px) {
  .platform { grid-template-columns: 1fr 1fr; gap: 4rem; }
}


/* =============================================================
   Menú de 3 puntitos + ventana "Acerca de"
   ============================================================= */
.topbar { position: fixed; top: 0; right: 0; z-index: 900; }
.dots-btn {
  position: absolute; top: 1.1rem; right: 1.1rem; z-index: 2;
  width: 48px; height: 48px; border-radius: 50%;
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: 4.5px;
  background: rgba(11,11,12,0.55);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  cursor: pointer;
  transition: border-color .3s var(--ease-out), transform .3s var(--ease-out);
}
.js .dots-btn { display: flex; }
.dots-btn:hover { border-color: var(--white); transform: scale(1.06); }
.dots-btn span {
  display: block; width: 4px; height: 4px; border-radius: 50%; background: var(--white);
  animation: dotPulse 2.4s ease-in-out infinite;
}
.dots-btn span:nth-child(2) { animation-delay: .2s; }
.dots-btn span:nth-child(3) { animation-delay: .4s; }
@keyframes dotPulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.65); opacity: .55; } }

.menu {
  display: flex; gap: 1.25rem; padding: 1.4rem;
  font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gray);
}
.menu a:hover { color: var(--white); }
.js .menu {
  position: absolute; top: calc(1.1rem + 48px + .6rem); right: 1.1rem;
  flex-direction: column; gap: 0; padding: .4rem; min-width: 190px;
  background: rgba(19,19,20,0.94);
  border: 1px solid var(--line); border-radius: 16px;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 20px 50px rgba(0,0,0,.5);
  font-size: 1rem; letter-spacing: 0; text-transform: none; color: var(--white);
  opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.96); transform-origin: top right;
  transition: opacity .3s var(--ease-out), transform .3s var(--ease-out), visibility 0s linear .3s;
}
.js .menu.is-open { opacity: 1; visibility: visible; transform: none; transition: opacity .3s var(--ease-out), transform .3s var(--ease-out), visibility 0s; }
.js .menu a { padding: .8rem 1rem; border-radius: 10px; transition: background .25s, color .25s; }
.js .menu a:hover, .js .menu a:focus-visible { background: rgba(242,242,240,0.1); color: var(--white); }

.modal {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center; padding: 1.25rem;
  opacity: 0; visibility: hidden;
  transition: opacity .4s var(--ease-out), visibility 0s linear .4s;
}
.modal.is-open, .modal:target { opacity: 1; visibility: visible; transition: opacity .4s var(--ease-out), visibility 0s; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal-card {
  position: relative; width: min(100%, 480px);
  padding: clamp(1.75rem, 5vw, 2.5rem);
  background: #121213; border: 1px solid var(--line); border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  transform: translateY(24px) scale(.96);
  transition: transform .5s var(--ease-out);
}
.modal.is-open .modal-card, .modal:target .modal-card { transform: none; }
.modal-card h2 { font-size: clamp(1.8rem, 5vw, 2.4rem); }
.modal-card p { margin-top: 1.1rem; color: var(--gray); font-weight: 300; line-height: 1.75; }
.modal-close {
  display: inline-block; margin-top: 1.75rem;
  padding: .7rem 1.6rem; border: 1px solid var(--line); border-radius: 999px;
  transition: background .3s var(--ease-out), color .3s var(--ease-out), border-color .3s;
}
.modal-close:hover, .modal-close:focus-visible { background: var(--white); color: var(--bg); border-color: var(--white); }
html.menu-open { overflow: hidden; }

/* =============================================================
   6. Contacto (solo iconos)
   ============================================================= */
.contact {
  min-height: 70vh;
  min-height: 70svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.5rem;
  padding: 4rem 1.25rem 6rem;
}
.contact-title { font-size: clamp(2.2rem, 6vw, 4rem); text-align: center; }
.contact-icons { display: flex; align-items: center; justify-content: center; gap: 3rem; }
.icon-btn {
  position: relative;
  width: 72px; height: 72px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--white);
  background: rgba(27,28,30,0.6);
  transition: background .4s var(--ease-out), color .4s var(--ease-out), transform .4s var(--ease-out), border-color .4s var(--ease-out);
  animation: iconFloat 5s ease-in-out infinite;
}
.icon-btn:nth-child(2) { animation-delay: -2.5s; }
.icon-btn svg { width: 30px; height: 30px; }
.icon-btn::after {
  content: ""; position: absolute; inset: -1px; border-radius: 50%;
  border: 1px solid var(--white);
  animation: ring 3.2s ease-out infinite;
  pointer-events: none;
}
.icon-btn:nth-child(2)::after { animation-delay: -1.6s; }
@keyframes iconFloat { 0%,100% { translate: 0 0; } 50% { translate: 0 -10px; } }
@keyframes ring { 0% { transform: scale(1); opacity: .5; } 100% { transform: scale(1.7); opacity: 0; } }
.icon-btn:hover, .icon-btn:focus-visible {
  background: var(--white); color: var(--bg); border-color: var(--white);
  transform: scale(1.12) rotate(-6deg);
}


/* =============================================================
   Efecto naranja al pulsar (dedo o mouse): pequeño, intenso, dura mientras se mantiene
   ============================================================= */
.tap-glow {
  position: fixed; z-index: 2000; pointer-events: none;
  width: 40px; height: 40px; margin: -20px 0 0 -20px;
  border-radius: 50%;
  /* un solo color: naranja */
  background: radial-gradient(circle, rgba(var(--orange-rgb),1) 0%, rgba(var(--orange-rgb),0.7) 40%, rgba(var(--orange-rgb),0) 72%);
  box-shadow: 0 0 11px 3px rgba(var(--orange-rgb),0.8);
  opacity: 1; transform: scale(1); filter: blur(0);
  will-change: transform, opacity, filter;
}
/* al soltar: se difumina de forma continua durante medio segundo */
.tap-glow.out {
  opacity: 0; transform: scale(1.25); filter: blur(4px);
  transition: opacity .5s ease-out, transform .5s ease-out, filter .5s ease-out;
}

/* brillo naranja mientras se mantiene presionado */
.icon-btn:active, .dots-btn:active, .modal-close:active {
  border-color: var(--orange); color: var(--white);
  background: rgba(var(--orange-rgb),0.4);
  box-shadow: 0 0 0 2px rgba(var(--orange-rgb),0.6), 0 0 22px 4px rgba(var(--orange-rgb),0.95);
  transform: scale(.94);
}
.js .menu a:active { background: rgba(var(--orange-rgb),0.35); box-shadow: inset 0 0 0 1px var(--orange), 0 0 18px rgba(var(--orange-rgb),0.85); }
a.tooth-stage:active .tooth { filter: drop-shadow(0 0 22px rgba(var(--orange-rgb),1)) drop-shadow(0 0 48px rgba(var(--orange-rgb),0.7)); }
a.tooth-stage:active .tooth-glow { background: radial-gradient(circle, rgba(var(--orange-rgb),0.5) 0%, transparent 65%); }
a.platform-text:active .fouba { -webkit-text-fill-color: var(--orange); color: var(--orange); background: none; text-shadow: 0 0 22px rgba(var(--orange-rgb),1); }

/* =============================================================
   7. Reveal al hacer scroll (solo con JS activo)
   ============================================================= */
.js .reveal {
  opacity: 0; transform: translateY(40px);
  transition: opacity 1.1s var(--ease-out), transform 1.1s var(--ease-out);
}
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .tooth-stage.reveal { transform: translateY(60px) scale(.94); }
.js .tooth-stage.reveal.is-visible { transform: none; }

/* =============================================================
   8. Reduced-motion — solo lo intrusivo (el movimiento suave se mantiene)
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
  .tap-glow { display: none; }
  .scroll-line::after { animation-duration: 4s; }
}
