/* ════════════════════════════════════════════════════════════
   ERNESTO ARGÜELLES — estrategia e ia aplicada
   Brand system: dark mode
   ════════════════════════════════════════════════════════════ */

:root {
  --bg:           #0A0E14;
  --bg-surface:   #111827;
  --text:         #FFFFFF;
  --text-muted:   rgba(255, 255, 255, 0.55);
  --text-faint:   rgba(255, 255, 255, 0.30);
  --primary:      #2563EB;
  --cyan:         #00D4FF;
  --border:       rgba(255, 255, 255, 0.08);
  --gradient-slash: linear-gradient(135deg, #2563EB 0%, #3B82F6 50%, #00D4FF 100%);

  --sans:      'Plus Jakarta Sans', system-ui, sans-serif;
  --sans-body: 'DM Sans', system-ui, sans-serif;

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

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans-body);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(37, 99, 235, 0.35); color: #fff; }

/* ── Fondo ambiental ─────────────────────────────────────── */

#mesh {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='128' height='128'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 0.9s steps(2) infinite;
}

@keyframes grain-shift {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-1.5%, 1%); }
  50%  { transform: translate(1%, -1.5%); }
  75%  { transform: translate(-1%, -1%); }
  100% { transform: translate(1.5%, 1%); }
}

/* ── Cursor custom ───────────────────────────────────────── */

.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0;                       /* oculto hasta el primer mousemove */
  transition: opacity 0.3s var(--ease-out);
}

.cursor-dot {
  width: 5px;
  height: 5px;
  background: var(--cyan);
}

.cursor-ring {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  transition: opacity 0.3s var(--ease-out),
              width 0.35s var(--ease-out),
              height 0.35s var(--ease-out),
              border-color 0.35s var(--ease-out);
}

body.cursor-active .cursor-dot,
body.cursor-active .cursor-ring { opacity: 1; }

body.cursor-hover .cursor-ring {
  width: 56px;
  height: 56px;
  border-color: rgba(0, 212, 255, 0.55);
}

@media (hover: none), (pointer: coarse) {
  .cursor-dot, .cursor-ring { display: none; }
}

@media (hover: hover) and (pointer: fine) {
  body { cursor: none; }
  a { cursor: none; }
}

/* ── Composición central ─────────────────────────────────── */

.stage {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 6vh, 4rem) 1.5rem;
}

.composition {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 720px;
  width: 100%;
}

/* Estado inicial de los elementos animados — el JS los revela.
   Safety net en CSS: si GSAP no carga, una animación los muestra. */
.reveal {
  opacity: 0;
  animation: reveal-fallback 0.1s linear 2.8s forwards;
}

@keyframes reveal-fallback {
  to { opacity: 1; }
}

body.gsap-ready .reveal { animation: none; }

/* ── Logo E/A ────────────────────────────────────────────── */

.logo-wrap {
  margin-bottom: clamp(2.2rem, 5.5vh, 3.4rem);
  background: transparent;
}

.logo-ea {
  height: clamp(163px, 27vh, 235px);
  width: auto;
  display: block;
  user-select: none;
}

/* ── Nombre ──────────────────────────────────────────────── */

.name {
  font-family: var(--sans);
  font-weight: 200;
  font-size: clamp(0.78rem, 2.3vw, 1.3rem);
  letter-spacing: 0.34em;
  margin-left: 0.34em;              /* compensa el tracking del último carácter */
  line-height: 1.25;
  margin-bottom: clamp(0.9rem, 2vh, 1.2rem);
}

/* ── Tagline ─────────────────────────────────────────────── */

.tagline {
  font-family: var(--sans-body);
  font-weight: 300;
  font-size: clamp(0.92rem, 2vw, 1.08rem);
  letter-spacing: 0.16em;
  margin-left: 0.16em;
  color: var(--text-muted);
}

.tagline .ia {
  color: var(--cyan);
  font-weight: 400;
}

/* ── Hairline de gradiente ───────────────────────────────── */

.rule {
  width: clamp(120px, 22vw, 200px);
  height: 1px;
  background: var(--gradient-slash);
  margin: clamp(2.6rem, 6vh, 4rem) 0;
  transform-origin: center;
}

/* ── Ventures ────────────────────────────────────────────── */

.ventures {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(2.2rem, 5.5vw, 3.8rem);
  flex-wrap: wrap;
  margin-bottom: clamp(2.8rem, 6.5vh, 4.2rem);
}

.venture {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  background: transparent;
  text-decoration: none;
  filter: grayscale(1) brightness(1.6);
  opacity: 0.38;
  transition: filter 0.5s var(--ease-out),
              opacity 0.5s var(--ease-out),
              transform 0.5s var(--ease-out);
}

.venture-caption {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  color: var(--text-faint);
  white-space: nowrap;
  transition: color 0.5s var(--ease-out);
}

.venture:hover .venture-caption { color: var(--text-muted); }

.venture img {
  display: block;
  user-select: none;
}

.venture--ayentik img { height: 38px; width: auto; }
.venture--aixr img    { height: 58px; width: auto; }   /* protagonista, al centro */
.venture--kubik img   { height: 20px; width: auto; }

a.venture:hover,
a.venture:focus-visible {
  filter: grayscale(0) brightness(1);
  opacity: 1;
  transform: translateY(-2px);
  outline: none;
}

.venture--static:hover {
  filter: grayscale(0) brightness(1);
  opacity: 0.85;
}

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

.contact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
}

.contact-sep {
  width: 1px;
  height: 14px;
  background: var(--border);
}

.linkedin {
  display: inline-flex;
  align-items: center;
  color: var(--text-faint);
  transition: color 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}

.linkedin:hover,
.linkedin:focus-visible {
  color: var(--cyan);
  transform: translateY(-1px);
  outline: none;
}

.email {
  font-family: var(--sans-body);
  font-weight: 300;
  font-size: clamp(0.82rem, 1.7vw, 0.92rem);
  letter-spacing: 0.14em;
  color: var(--text-muted);
  text-decoration: none;
  position: relative;
  padding-bottom: 6px;
  transition: color 0.4s var(--ease-out);
}

.email::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--gradient-slash);
  transform: translateX(-50%) scaleX(0);
  transform-origin: center;
  transition: transform 0.55s var(--ease-out);
}

.email:hover,
.email:focus-visible {
  color: var(--text);
  outline: none;
}

.email:hover::after,
.email:focus-visible::after {
  transform: translateX(-50%) scaleX(1);
}

/* ── Mobile ──────────────────────────────────────────────── */

@media (max-width: 560px) {
  .name { letter-spacing: 0.24em; margin-left: 0.24em; }

  .ventures {
    gap: 2rem;
  }

  .venture--ayentik img { height: 31px; }
  .venture--aixr img    { height: 46px; }
  .venture--kubik img   { height: 17px; }
}

/* ── Reduced motion: solo efectos intrusivos ─────────────── */

@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
}
