/* ============================================================
   TURNIFY INC. — DESIGN SYSTEM v2.0
   Architecture: Sharlee-tier
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Syne:wght@700;800&display=swap');

/* ── TOKENS ──────────────────────────────────────────────── */
:root {
  --bg:          #050507;
  --surface-0:   #0a0a0f;
  --surface-1:   #0f0f16;
  --surface-2:   #14141d;
  --accent:      #2563eb;
  --accent-dim:  rgba(37, 99, 235, 0.12);
  --accent-glow: rgba(37, 99, 235, 0.25);
  --text-hi:     #f0f0f5;
  --text-md:     #8888a0;
  --text-lo:     #444458;
  --border-sub:  rgba(255, 255, 255, 0.05);
  --border-base: rgba(255, 255, 255, 0.09);
  --border-hi:   rgba(255, 255, 255, 0.15);
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   14px;
  --font-display:'Syne', system-ui, sans-serif;
  --font-body:   'Inter', -apple-system, sans-serif;
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --transition:  0.35s var(--ease-out);
}

/* ── RESET ───────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; overflow-x: hidden; max-width: 100%; }

body {
  background: var(--bg);
  color: var(--text-hi);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── NOISE LAYER ─────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

/* ── AMBIENT GRADIENT ────────────────────────────────────── */
body::after {
  content: '';
  position: fixed;
  top: -20vh;
  left: 50%;
  transform: translateX(-50%);
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── LAYOUT WRAPPER ──────────────────────────────────────── */
.site-wrap { position: relative; z-index: 1; }


/* ══════════════════════════════════════════════════════════
   NAVBAR
══════════════════════════════════════════════════════════ */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 8%;
  border-bottom: 1px solid var(--border-sub);
  background: rgba(5, 5, 7, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.logo {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-hi);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ── EFECTO SHARLEE — ver .sharlee-char arriba en hero-heading ── */
.logo-sharlee { display: inline-flex; align-items: center; }


.logo-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}

.nav-center {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  color: var(--text-md);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  letter-spacing: 0.01em;
}

.nav-link:hover {
  color: var(--text-hi);
  background: var(--border-sub);
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.2rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: transparent;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

.nav-cta:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}

.nav-cta-icon {
  display: flex;
  align-items: center;
  opacity: 0.85;
}
.nav-cta-icon svg {
  width: 14px; height: 14px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}


/* ══════════════════════════════════════════════════════════
   HERO
══════════════════════════════════════════════════════════ */

.hero {
  padding: 9rem 8% 6rem;
  position: relative;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 2rem;
}

.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.9rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 999px;
}

.eyebrow-divider {
  width: 32px;
  height: 1px;
  background: var(--border-hi);
}

.eyebrow-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-md);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hero-heading {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 750;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--text-hi);
  margin-bottom: 2rem;
  max-width: 14ch;
}

/* ── EFECTO SHARLEE — letras del hero se arman al cargar ── */
.sharlee-char {
  display: inline-block;
  opacity: 0;
  will-change: transform, opacity;
}
.sharlee-char.landed {
  animation: sharlee-land var(--dur, 0.7s) var(--delay, 0s) cubic-bezier(0.16,1,0.3,1) forwards;
}
@keyframes sharlee-land {
  0% {
    opacity: 0;
    transform: translate(var(--fx, 0px), var(--fy, 0px)) rotate(var(--fr, 0deg)) scale(0.6);
    filter: blur(6px);
  }
  60% { opacity: 1; filter: blur(0px); }
  100% {
    opacity: 1;
    transform: translate(0,0) rotate(0deg) scale(1);
    filter: blur(0px);
  }
}

.hero-heading .line-dim {
  color: var(--text-lo);
}

.hero-heading .word-accent {
  position: relative;
  display: inline-block;
}

.hero-heading .word-accent::after {
  content: '';
  position: absolute;
  bottom: 0.08em;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-md);
  max-width: 38ch;
  line-height: 1.7;
  margin-bottom: 3rem;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-hi);
  line-height: 1;
  letter-spacing: -0.03em;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-md);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 500;
}

.hero-meta-divider {
  width: 1px;
  height: 36px;
  background: var(--border-base);
}

/* Ticker */
.hero-ticker {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  background: var(--surface-1);
  border: 1px solid var(--border-base);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--text-md);
}

.ticker-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
  animation: live-pulse 1.6s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
  50%       { box-shadow: 0 0 0 5px rgba(34,197,94,0); }
}

.ticker-count {
  font-weight: 600;
  color: var(--text-hi);
}


/* ══════════════════════════════════════════════════════════
   DIVIDER
══════════════════════════════════════════════════════════ */

.section-divider {
  display: grid;
  grid-template-columns: 8% 1fr 8%;
  align-items: center;
  gap: 1.5rem;
  padding: 0 0 4rem;
}

.divider-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-hi), transparent);
}

.divider-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-lo);
  font-weight: 600;
  white-space: nowrap;
}

.divider-label::before,
.divider-label::after {
  content: '—';
  opacity: 0.4;
}


/* ══════════════════════════════════════════════════════════
   BENTO GRID
══════════════════════════════════════════════════════════ */

.ecosystem {
  padding: 0 8% 8rem;
}

.ecosystem-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 3rem;
  gap: 2rem;
  flex-wrap: wrap;
}

.ecosystem-title {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-md);
}

.ecosystem-count {
  font-size: 0.75rem;
  color: var(--text-lo);
  font-variant-numeric: tabular-nums;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border-sub);
  border: 1px solid var(--border-sub);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* Unit Card */
.unit {
  position: relative;
  background: var(--surface-0);
  padding: 2.5rem 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
}

.unit::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
  opacity: 0;
  transform: scaleX(0);
  transition: opacity var(--transition), transform var(--transition);
}

.unit:hover {
  background: var(--surface-1);
  box-shadow: 0 0 0 1px var(--accent), 0 8px 32px rgba(37,99,235,.10);
  transform: translateY(-2px);
}

.unit:hover::before {
  opacity: 1;
  transform: scaleX(1);
}

.unit-index {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-lo);
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  margin-bottom: 2rem;
  font-family: var(--font-body);
}

.unit-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  border: 1px solid rgba(37, 99, 235, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  transition: background var(--transition), border-color var(--transition);
}

.unit-icon svg {
  width: 18px;
  height: 18px;
  stroke: var(--accent);
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.unit:hover .unit-icon {
  background: rgba(37, 99, 235, 0.2);
  border-color: rgba(37, 99, 235, 0.3);
}

.unit-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-hi);
  letter-spacing: -0.03em;
  margin-bottom: 0.65rem;
  line-height: 1.1;
}

.unit-desc {
  font-size: 0.85rem;
  color: var(--text-md);
  line-height: 1.65;
  flex: 1;
  margin-bottom: 2rem;
}

.unit-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-sub);
}

.unit-status {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.7rem;
  color: var(--text-lo);
  font-weight: 500;
  letter-spacing: 0.03em;
}

.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #22c55e;
}

.unit-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: gap var(--transition), opacity var(--transition);
}

.unit-link:hover {
  gap: 0.65rem;
}

.unit-link-arrow {
  font-size: 0.85rem;
  transition: transform var(--transition);
}

.unit:hover .unit-link-arrow {
  transform: translateX(3px);
}

/* Corner tag */
.unit-tag {
  position: absolute;
  top: 2rem;
  right: 2rem;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--border-base);
  border-radius: 3px;
  color: var(--text-lo);
  font-family: var(--font-body);
}


/* ══════════════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════════════ */

footer {
  padding: 2.5rem 8%;
  border-top: 1px solid var(--border-sub);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-lo);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--text-lo);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  font-size: 0.75rem;
  color: var(--text-lo);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-links a:hover { color: var(--text-md); }


/* ══════════════════════════════════════════════════════════
   ANIMATIONS ON LOAD
══════════════════════════════════════════════════════════ */

@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.anim {
  opacity: 0;
  animation: fade-up 0.7s var(--ease-out) forwards;
}

.anim-1 { animation-delay: 0.05s; }
.anim-2 { animation-delay: 0.15s; }
.anim-3 { animation-delay: 0.25s; }
.anim-4 { animation-delay: 0.38s; }
.anim-5 { animation-delay: 0.50s; }


/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .navbar {
    padding: 1rem 5%;
  }

  .hero {
    padding: 6rem 5% 4rem;
  }

  .ecosystem {
    padding: 0 5% 6rem;
  }

  footer {
    padding: 2rem 5%;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
  }
}

@media (max-width: 600px) {
  .hero-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .hero-meta-divider { display: none; }

  .nav-center { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .anim { animation: none; opacity: 1; }
  .logo-dot, .ticker-dot { animation: none; }
}
/* ═══════════════════════════════════════════════
   LIGHT MODE
═══════════════════════════════════════════════ */
html[data-theme="light"] {
  --bg:          #f5f3ef;
  --surface-0:   #faf9f7;
  --surface-1:   #eeecea;
  --surface-2:   #e4e2de;
  --accent:      #2563eb;
  --accent-dim:  rgba(37, 99, 235, 0.08);
  --accent-glow: rgba(37, 99, 235, 0.18);
  --text-hi:     #1a1814;
  --text-md:     #5a5650;
  --text-lo:     #a09c98;
  --border-sub:  rgba(0,0,0,.05);
  --border-base: rgba(0,0,0,.09);
  --border-hi:   rgba(0,0,0,.15);
}
html[data-theme="light"] body { color-scheme: light; }

/* ═══════════════════════════════════════════════
   CUSTOM CURSOR
═══════════════════════════════════════════════ */
@media (hover: hover) and (pointer: fine) {
  body { cursor: none; }
  a, button, .nav-cta, .unit-link, .btn-toggle { cursor: none; }
  .unit-clickable { cursor: pointer; }

  .cursor-dot, .cursor-ring {
    position: fixed; top: 0; left: 0;
    pointer-events: none; z-index: 9999;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    will-change: transform;
  }
  .cursor-dot {
    width: 6px; height: 6px;
    background: var(--text-hi);
    transition: opacity .2s;
  }
  .cursor-ring {
    width: 32px; height: 32px;
    border: 1px solid var(--border-hi);
    transition: width .25s var(--ease-out), height .25s var(--ease-out),
                border-color .25s var(--ease-out), background .25s var(--ease-out),
                opacity .2s;
  }
  .cursor-ring.hovering {
    width: 56px; height: 56px;
    border-color: var(--accent);
    background: var(--accent-dim);
  }
  body.cursor-hidden .cursor-dot,
  body.cursor-hidden .cursor-ring { opacity: 0; }
}

/* ═══════════════════════════════════════════════
   TEXT HOVER REVEAL — letters spread apart
═══════════════════════════════════════════════ */
.reveal-text {
  display: inline-flex;
}
.reveal-text .char {
  display: inline-block;
  transition: transform .5s var(--ease-out), letter-spacing .5s var(--ease-out);
  transform: translateX(0);
}
.reveal-text:hover .char {
  transform: translateX(calc(var(--dir, 0) * 6px));
}

/* ═══════════════════════════════════════════════
   SCROLL REVEAL
═══════════════════════════════════════════════ */
.reveal-up {
  opacity: 1; /* fallback visible si JS no corre */
}
.js .reveal-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
}
.js .reveal-up.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ═══════════════════════════════════════════════
   MAGNETIC BUTTONS
═══════════════════════════════════════════════ */
.magnetic {
  display: inline-flex;
  transition: transform .25s var(--ease-out);
  will-change: transform;
}

/* ═══════════════════════════════════════════════
   INTRO LOADER
═══════════════════════════════════════════════ */
.intro-loader {
  position: fixed; inset: 0; z-index: 10000;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .6s var(--ease-out), visibility .6s var(--ease-out);
}
.intro-loader.hidden {
  opacity: 0; visibility: hidden; pointer-events: none;
}
.intro-loader-logo {
  font-family: var(--font-display);
  font-size: 1.6rem; font-weight: 800; letter-spacing: -0.03em;
  color: var(--text-hi);
  opacity: 0;
  animation: loader-fade 1.1s var(--ease-out) forwards;
}
.intro-loader-logo span { color: var(--accent); }
@keyframes loader-fade {
  0%   { opacity: 0; transform: translateY(8px) scale(.96); }
  40%  { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ═══════════════════════════════════════════════
   NAV TOGGLES (lang / theme)
═══════════════════════════════════════════════ */
.nav-toggles {
  display: flex; align-items: center; gap: 0.5rem;
}
.btn-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: var(--surface-1);
  border: 1px solid var(--border-sub);
  color: var(--text-md);
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.02em;
  cursor: none;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.btn-toggle:hover {
  color: var(--text-hi);
  border-color: var(--border-hi);
}
.btn-toggle svg {
  width: 16px; height: 16px;
  stroke: currentColor; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
html[data-theme="light"] .icon-moon { display: none; }
html[data-theme="light"] .icon-sun  { display: block; }
html:not([data-theme="light"]) .icon-sun  { display: none; }
html:not([data-theme="light"]) .icon-moon { display: block; }

@media (max-width: 860px) {
  .nav-toggles { display: none; }
}

/* ═══════════════════════════════════════════════
   MODE LABELS (Easy / Hardcore / Dark / God Mode)
═══════════════════════════════════════════════ */
.mode-label {
  margin: 3.5rem 0 1.25rem;
}
.mode-label-first { margin-top: 0; }

.mode-pill {
  display: inline-flex;
  align-items: center;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: .4rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border-base);
  color: var(--text-md);
  background: var(--surface-1);
}

.mode-easy     { border-color: rgba(37, 99, 235, .3);  color: #5b8def; }
.mode-hardcore { border-color: rgba(255, 122, 48, .3); color: #ff7a30; }
.mode-god      { border-color: rgba(234, 179, 8, .35); color: #facc15; }
