/* ============================================================
   TRALKA — estilos del sitio (static landing)
   Black & white minimal, tipografía editorial, dark mode.
   ============================================================ */

/* ------------------------------------------------------------------
  ⚡  Hello Stranger !

⚡⚡⚡⚡⚡  ⚡⚡⚡⚡     ⚡    ⚡      ⚡  ⚡     ⚡
  ⚡    ⚡   ⚡   ⚡ ⚡   ⚡      ⚡ ⚡     ⚡ ⚡
  ⚡    ⚡⚡⚡⚡   ⚡⚡⚡⚡⚡  ⚡      ⚡⚡     ⚡⚡⚡⚡⚡
  ⚡    ⚡  ⚡   ⚡   ⚡  ⚡      ⚡ ⚡    ⚡   ⚡
  ⚡    ⚡   ⚡  ⚡   ⚡  ⚡⚡⚡⚡⚡  ⚡  ⚡   ⚡   ⚡
------------------------------------------------------------------ */

:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --muted: #8a8a8a;
  --faint: #b9b9b9;
  --border: #ececec;
  --section-alt: #fafafa;
  --cta-bg: #f5f5f5;
  --aura: rgba(0, 0, 0, 0.035);
  --shadow: 0 24px 60px -40px rgba(0, 0, 0, 0.35);
  --def-color: #1a1a1a;
  --form-text: #1a1a1a;
  --form-label: rgba(0, 0, 0, 0.72);
  --glass-bg: rgba(255, 255, 255, 0.16);
  --glass-border: rgba(255, 255, 255, 0.55);
  --glass-highlight: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0) 46%);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

.dark {
  --bg: #0b0b0b;
  --text: #f0f0f0;
  --muted: #9a9a9a;
  --faint: #555;
  --border: #222;
  --section-alt: #111;
  --cta-bg: #141414;
  --aura: rgba(255, 255, 255, 0.03);
  --shadow: 0 24px 60px -40px rgba(0, 0, 0, 0.9);
  --def-color: #c9cdd4;
  --form-text: #f0f0f0;
  --form-label: rgba(255, 255, 255, 0.85);
  --glass-bg: rgba(10, 14, 26, 0.30);
  --glass-border: rgba(255, 255, 255, 0.16);
  --glass-highlight: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 46%);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: #e8e8e8; color: #1a1a1a; }
.dark ::selection { background: #333; color: #f0f0f0; }

a { color: inherit; }

/* ---------- Theme toggle ---------- */
.theme-toggle {
  position: fixed;
  top: 24px;
  right: 32px;
  z-index: 100;
  width: 58px;
  height: 32px;
  border-radius: 100px;
  background: rgba(0, 0, 0, 0.10);
  border: 1px solid rgba(0, 0, 0, 0.12);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: all 0.3s var(--ease);
}

.dark .theme-toggle {
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.theme-toggle:hover { opacity: 0.9; }
.theme-toggle:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

.theme-toggle .thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.35s var(--ease), background 0.35s var(--ease);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

.dark .theme-toggle .thumb { transform: translateX(26px); }

@media (max-width: 768px) {
  .theme-toggle { top: 16px; right: 18px; }
}

/* ---------- Layout ---------- */
main { flex: 1 0 auto; display: flex; flex-direction: column; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 56px 24px 72px;
  overflow: hidden;
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 720px;
  margin: clamp(24px, 4vh, 48px) clamp(18px, 4vw, 32px);
  perspective: 1600px;
}

@keyframes floatLeve {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

/* Sin marco de vidrio: el contenido flota directo sobre el fondo (Vanta). */

/* Contenedor del fondo animado (Vanta) */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* Bolt */
.hero-bolt {
  width: 72px;
  height: 96px;
  margin-bottom: 14px;
  color: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dark .hero-bolt { color: #f0f0f0; }
.bolt-svg { width: 100%; height: auto; display: block; }

@keyframes boltFlicker {
  0%, 100% { opacity: 1; }
  3% { opacity: 0; }
  6% { opacity: 1; }
  9% { opacity: 0; }
  12% { opacity: 1; }
  50% { opacity: 1; }
  53% { opacity: 0; }
  56% { opacity: 1; }
  90% { opacity: 1; }
  93% { opacity: 0; }
  96% { opacity: 1; }
}
.bolt-flicker { animation: boltFlicker 6s steps(1) infinite; }

/* Title */
.hero-title {
  font-family: 'Jersey 10', cursive;
  font-size: clamp(2.7rem, 8.5vw, 5.4rem);
  letter-spacing: 0.16em;
  color: var(--text);
  line-height: 1;
  margin-bottom: 14px;
  transition: color 0.5s var(--ease);
  user-select: none;
}

/* Definición (cita) */
.hero-def-line {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(0.9rem, 1.3vw, 1.05rem);
  color: var(--def-color);
  max-width: 480px;
  margin: 0 auto 20px;
  line-height: 1.6;
  font-weight: 300;
  letter-spacing: 0;
  transition: color 0.5s var(--ease);
}

/* Descripción */
.hero-desc-block {
  font-size: clamp(0.95rem, 1.35vw, 1.1rem);
  font-weight: 300;
  color: var(--text);
  max-width: 440px;
  margin: 0 auto;
  line-height: 1.7;
  letter-spacing: 0.005em;
  opacity: 0.9;
  text-align: center;
  transition: color 0.5s var(--ease);
}

/* Typewriter */
.tw-wrap {
  font-family: 'Nova Mono', monospace;
  font-size: clamp(1.28rem, 2.8vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  min-height: 1.4em;
  width: 100%;
  text-align: center;
  margin-top: 24px;
  transition: color 0.5s var(--ease);
}

.tw-cursor {
  display: inline-block;
  width: 2px;
  height: 0.85em;
  background: var(--text);
  margin-left: 3px;
  vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
  transition: background 0.5s var(--ease);
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ---------- Contacto (iconos, sin borde) ---------- */
.socials {
  display: flex;
  gap: 18px;
  margin-top: 30px;
  align-items: center;
  justify-content: center;
}
.socials .soc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  text-decoration: none;
  transition: color 0.3s var(--ease), transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.socials .soc svg { width: 24px; height: 24px; }
.socials .soc:hover { color: var(--muted); transform: translateY(-3px); opacity: 0.85; }
.socials .soc:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

/* ---------- Flip real 3D sobre la tarjeta (gira en Y) ---------- */
.flip-inner {
  position: relative;
  width: 100%;
  transform-style: preserve-3d;
  transition: transform 0.8s var(--ease);
}
.hero-inner.flipped .flip-inner { transform: rotateY(180deg); }

.flip-face {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}

.flip-front {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(40px, 7vw, 76px) clamp(26px, 6vw, 60px);
  background: transparent;
  animation: floatLeve 5s ease-in-out infinite;
}

.flip-back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: auto;
  background: transparent;
}
.flip-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.flip-close:hover { color: var(--text); }

.mini-form { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 340px; }
.mini-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.06rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--form-text);
  line-height: 1.25;
  margin-bottom: 2px;
}
.mini-field { display: flex; flex-direction: column; gap: 5px; text-align: left; }
.mini-field span {
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--form-label);
}
.mini-field input,
.mini-field textarea {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  resize: none;
  transition: border-color 0.3s var(--ease);
}
.mini-field input:focus,
.mini-field textarea:focus {
  outline: none;
  border-color: var(--text);
}
.mini-submit {
  margin-top: 2px;
  padding: 11px 16px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.mini-submit:hover {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.mini-note {
  font-size: 0.66rem;
  color: var(--form-label);
  letter-spacing: 0.03em;
}

/* ---------- Hover leve sobre el logo TRALKA ---------- */
.hero-title {
  cursor: pointer;
  transition: color 0.5s var(--ease), opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.hero-title:hover,
.hero-title:focus-visible {
  opacity: 0.86;
  transform: scale(1.02);
}

/* ---------- Nota sobre el fondo ---------- */
.hero-footnote {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--text);
  opacity: 0.85;
  white-space: nowrap;
}
.hero-footnote a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--glass-border);
  transition: border-color 0.3s var(--ease);
}
.hero-footnote a:hover { border-color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  .flip-inner { transition: none; }
}

/* ---------- Reveal on load ---------- */
/* Solo se oculta/revela cuando JS está presente (clase .js).
   Sin JS (crawlers que leen HTML, accesibilidad) el contenido queda visible. */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
}
.js body.loaded .reveal {
  opacity: 1;
  transform: none;
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.js body.loaded .reveal-1 { transition-delay: 0.05s; }
.js body.loaded .reveal-2 { transition-delay: 0.15s; }
.js body.loaded .reveal-3 { transition-delay: 0.28s; }
.js body.loaded .reveal-4 { transition-delay: 0.40s; }
.js body.loaded .reveal-5 { transition-delay: 0.52s; }
.js body.loaded .reveal-6 { transition-delay: 0.64s; }
.js body.loaded .reveal-7 { transition-delay: 0.72s; }

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .hero { padding: 48px 16px 72px; }
  .hero-inner { margin: 16px 12px; }
  .flip-front { padding: 40px 22px; }
  .hero-def-line { max-width: 320px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-inner,
  .flip-front,
  .bolt-flicker,
  .tw-cursor {
    animation: none !important;
  }
}
