/* ============================================================
   NEXOCS — Sistema de diseño táctico / HUD competitivo
   ============================================================ */
:root {
  --bg:        #0a0c0f;
  --bg-2:      #0d1014;
  --panel:     #10151d;
  --panel-2:   #0e131a;
  --line:      #1b222d;
  --line-2:    #29323f;
  --text:      #e7ebf0;
  --muted:     #8a94a3;
  --dim:       #586274;
  --red:       #ff3b3b;
  --red-2:     #e01e2b;
  --red-deep:  #4e0d15;
  --green:     #31d07f;
  --amber:     #f6a723;
  --blue:      #4a9eff;
  --purple:    #a855f7;
  --gold:      #e8b53a;
  --silver:    #b8c0cc;

  --radius:    4px;
  --radius-lg: 6px;
  --maxw:      1180px;

  --f-head: 'Space Grotesk', -apple-system, sans-serif;
  --f-body: 'Inter', -apple-system, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--f-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Fondo: glows + rejilla HUD enmascarada */
body::before {
  content: ''; position: fixed; inset: -8%; z-index: -2; pointer-events: none;
  background:
    radial-gradient(1100px 560px at 78% -8%, rgba(255,59,59,.11), transparent 62%),
    radial-gradient(900px 520px at -5% 108%, rgba(46,74,110,.13), transparent 60%),
    var(--bg);
  animation: bg-breathe 22s ease-in-out infinite;
  will-change: transform, opacity;
}
@keyframes bg-breathe {
  0%, 100% { transform: translate3d(-1.6%, .6%, 0) scale(1.02); opacity: .82; }
  50%      { transform: translate3d(1.8%, -1.4%, 0) scale(1.09); opacity: 1; }
}
body::after {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px);
  background-size: 54px 54px;
  -webkit-mask-image: radial-gradient(ellipse 100% 80% at 50% -5%, #000 35%, transparent 92%);
          mask-image: radial-gradient(ellipse 100% 80% at 50% -5%, #000 35%, transparent 92%);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::selection { background: var(--red); color: #fff; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Utilidades tácticas ---------- */
.mono { font-family: var(--f-mono); }
.dim  { color: var(--dim); }
.muted{ color: var(--muted); }

.label {
  font-family: var(--f-mono); font-size: .72rem; font-weight: 600;
  letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
  display: inline-flex; align-items: center; gap: 9px;
}
.label .slash { color: var(--red); }
.label .idx { color: var(--dim); }

/* Corchetes de esquina (TL + BR) */
.brk { position: relative; }
.brk::before, .brk::after {
  content: ''; position: absolute; width: 13px; height: 13px;
  border: 1.5px solid var(--red); opacity: .8; pointer-events: none;
}
.brk::before { top: -1px;  left: -1px;  border-width: 1.5px 0 0 1.5px; }
.brk::after  { bottom: -1px; right: -1px; border-width: 0 1.5px 1.5px 0; }

/* Iconos SVG */
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor;
      stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.ic-fill { fill: currentColor; stroke: none; }
.ic-sm { width: 15px; height: 15px; }

/* ---------- Botones ---------- */
.btn {
  --notch: 9px;
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--f-mono); font-size: .8rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  padding: 13px 22px; cursor: pointer; border: none;
  transition: transform .18s ease, background .18s, color .18s, box-shadow .18s;
  clip-path: polygon(0 0, calc(100% - var(--notch)) 0, 100% var(--notch), 100% 100%, var(--notch) 100%, 0 calc(100% - var(--notch)));
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--red-2); color: #fff; }
.btn-primary:hover { background: var(--red); box-shadow: 0 0 0 1px var(--red), 0 8px 30px -8px rgba(255,59,59,.6); }
.btn-ghost {
  background: transparent; color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.btn-ghost:hover { color: #fff; box-shadow: inset 0 0 0 1px var(--red); }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 9px 16px; font-size: .72rem; }

/* ---------- NAV ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(10,12,15,.72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px; height: 62px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand .mark { height: 34px; width: auto; display: block; }
.brand .name {
  font-family: var(--f-head); font-weight: 700; font-size: 1.12rem;
  letter-spacing: .04em; color: #fff;
}
.brand .name b { color: var(--red); }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a {
  font-family: var(--f-mono); font-size: .78rem; letter-spacing: .04em;
  color: var(--muted); transition: color .18s; text-transform: uppercase;
}
.nav-links a:hover { color: #fff; }
.status-dot {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--f-mono); font-size: .68rem; letter-spacing: .1em;
  color: var(--muted); text-transform: uppercase;
}
.status-dot i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 3px rgba(49,208,127,.18); animation: pulse 2.4s infinite;
}
@keyframes pulse { 50% { opacity: .45; } }

/* ---------- HERO ---------- */
.hero { padding: 140px 0 96px; position: relative; }
.hero-grid {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center;
}
.hero h1 {
  font-family: var(--f-head); font-weight: 700;
  font-size: clamp(2.6rem, 5.2vw, 4.15rem); line-height: 1.04;
  letter-spacing: -.02em; color: #fff; margin: 20px 0 20px;
}
.hero h1 em { font-style: normal; color: var(--red); position: relative; }
.hero h1 em::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 6px; height: 10px;
  background: rgba(255,59,59,.16); z-index: -1;
}
.hero-sub { font-size: 1.1rem; color: var(--muted); max-width: 480px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 30px; }

.hero-stats {
  display: flex; gap: 0; margin-top: 40px;
  border-top: 1px solid var(--line);
}
.hero-stats .st { padding: 18px 26px 0 0; margin-right: 26px; border-right: 1px solid var(--line); }
.hero-stats .st:last-child { border-right: none; }
.hero-stats .st b {
  display: block; font-family: var(--f-mono); font-weight: 700;
  font-size: 1.7rem; color: #fff; line-height: 1;
}
.hero-stats .st span {
  font-family: var(--f-mono); font-size: .66rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--dim);
}

/* Tarjeta HUD del hero (mock de perfil) */
.hud {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line-2); padding: 22px; position: relative;
}
.hud .scan {
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,.012) 3px 4px);
}
.hud-head {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--f-mono); font-size: .68rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--dim); margin-bottom: 18px;
}
.hud-stage::after { content: '▌'; margin-left: 1px; color: var(--red); animation: blink .85s steps(2) infinite; }
.hud-status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.hud-status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.hud-status.st-scan { color: var(--amber); }
.hud-status.st-scan i { animation: blink .6s steps(2) infinite; }
.hud-status.st-ok { color: var(--green); }
@keyframes blink { 50% { opacity: .2; } }
.hud-id { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.hud-av {
  width: 54px; height: 54px; flex-shrink: 0;
  background: linear-gradient(135deg, #1a2432, #0f1620);
  border: 1px solid var(--line-2); display: grid; place-items: center;
  color: var(--red); clip-path: polygon(0 0, 100% 0, 100% 78%, 78% 100%, 0 100%);
}
.hud-name { font-family: var(--f-head); font-weight: 600; font-size: 1.12rem; color: #fff; }
.hud-id .rank-chip { margin-left: auto; }
.hud-elo {
  display: flex; padding: 12px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.hud-elo .eo { flex: 1; }
.hud-elo .eo + .eo { border-left: 1px solid var(--line); padding-left: 16px; }
.hud-elo .eo span { display: block; font-family: var(--f-mono); font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin-bottom: 5px; }
.hud-elo .eo b { font-family: var(--f-mono); font-weight: 700; font-size: 1.4rem; color: #fff; font-variant-numeric: tabular-nums; }
.hud-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
#hud-badges .chip { transition: opacity .35s ease, transform .35s ease; }
html.js #hud-badges .chip { opacity: 0; transform: translateY(4px); }
html.js #hud-badges .chip.show { opacity: 1; transform: none; }

/* Chips de estado */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--f-mono); font-size: .68rem; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; padding: 5px 10px;
  border: 1px solid var(--line-2); color: var(--muted);
}
.chip.ok   { color: var(--green); border-color: rgba(49,208,127,.35); background: rgba(49,208,127,.07); }
.chip.warn { color: var(--amber); border-color: rgba(246,167,35,.35); background: rgba(246,167,35,.07); }
.chip.bad  { color: var(--red);   border-color: rgba(255,59,59,.35);  background: rgba(255,59,59,.07); }

/* Chips de rango */
.rank-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--f-mono); font-size: .7rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; padding: 6px 12px;
  border: 1px solid currentColor; position: relative;
}
.rank-chip::before { content: ''; width: 8px; height: 8px; background: currentColor; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.rank-recluta     { color: var(--steel); }
.rank-promesa     { color: var(--green); }
.rank-competitivo { color: var(--blue); }
.rank-avanzado    { color: var(--purple); }
.rank-elite       { color: var(--amber); }
.rank-leyenda     { color: var(--red); }

/* ---------- Secciones ---------- */
section { position: relative; }
.sec { padding: 92px 0; }
.sec-head { margin-bottom: 44px; }
.sec-head h2 {
  font-family: var(--f-head); font-weight: 700; font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  letter-spacing: -.01em; color: #fff; margin-top: 14px; max-width: 620px;
}
.sec-head p { color: var(--muted); margin-top: 12px; max-width: 560px; }

/* Features */
.features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.feature {
  background: var(--panel-2); padding: 30px 26px; position: relative;
  transition: background .25s;
  --mx: 50%; --my: 0%;
}
.feature::before {
  content: ''; position: absolute; inset: 0; opacity: 0; transition: opacity .35s; pointer-events: none;
  background: radial-gradient(340px circle at var(--mx) var(--my), rgba(255,59,59,.10), transparent 70%);
}
.feature:hover { background: var(--panel); }
.feature:hover::before { opacity: 1; }
.feature .fi {
  width: 46px; height: 46px; display: grid; place-items: center; color: var(--red);
  border: 1px solid var(--line-2); margin-bottom: 20px; position: relative; z-index: 1;
  clip-path: polygon(0 0, 100% 0, 100% 72%, 72% 100%, 0 100%);
}
.feature .fx { font-family: var(--f-mono); font-size: .68rem; color: var(--dim); letter-spacing: .1em; position: relative; z-index: 1; }
.feature h3 { font-family: var(--f-head); font-weight: 600; font-size: 1.12rem; color: #fff; margin: 8px 0 9px; position: relative; z-index: 1; }
.feature p { font-size: .92rem; color: var(--muted); position: relative; z-index: 1; }

/* Cómo funciona */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.step { position: relative; padding: 26px 24px; border: 1px solid var(--line); background: var(--panel-2); }
.step .num {
  font-family: var(--f-mono); font-weight: 700; font-size: 2.2rem; color: var(--line-2);
  line-height: 1; margin-bottom: 16px;
}
.step h3 { font-family: var(--f-head); font-weight: 600; font-size: 1.08rem; color: #fff; margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.step h3 .ic { color: var(--red); }
.step p { font-size: .9rem; color: var(--muted); }

/* Escalera de rangos */
.ladder { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.rung {
  border: 1px solid var(--line); background: var(--panel-2); padding: 22px 18px;
  display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden;
}
.rung::before { content: ''; position: absolute; top: 0; left: 0; width: 3px; height: 100%; background: currentColor; }
.rung .rn { font-family: var(--f-head); font-weight: 700; font-size: 1.05rem; color: #fff; }
.rung .re { font-family: var(--f-mono); font-size: .74rem; color: var(--muted); }
.rung .rbars { display: flex; gap: 3px; align-items: flex-end; height: 22px; }
.rung .rbars i { width: 6px; background: currentColor; opacity: .35; }
.rung.on-recluta     { color: var(--steel); }
.rung.on-promesa     { color: var(--green); }
.rung.on-competitivo { color: var(--blue); }
.rung.on-avanzado    { color: var(--purple); }
.rung.on-elite       { color: var(--amber); }
.rung.on-leyenda     { color: var(--red); }

/* Ticker de verificados */
.ticker-wrap { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; position: relative; }
.ticker-wrap::before, .ticker-wrap::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 90px; z-index: 2; pointer-events: none;
}
.ticker-wrap::before { left: 0;  background: linear-gradient(90deg, var(--bg), transparent); }
.ticker-wrap::after  { right: 0; background: linear-gradient(270deg, var(--bg), transparent); }
.ticker { display: flex; gap: 40px; padding: 16px 0; width: max-content; animation: ticker 34s linear infinite; }
.ticker:hover { animation-play-state: paused; }
@keyframes ticker { to { transform: translateX(-50%); } }
.ticker .tk {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--f-mono); font-size: .82rem; color: var(--muted); white-space: nowrap;
}
.ticker .tk .tk-i { color: var(--green); }
.ticker .tk b { color: var(--text); font-weight: 600; }
.ticker .tk .tk-lv { color: var(--red); }
.ticker-empty { text-align: center; color: var(--dim); font-family: var(--f-mono); font-size: .82rem; padding: 18px 0; }

/* CTA band */
.cta {
  border: 1px solid var(--line-2); background: linear-gradient(180deg, var(--panel), var(--panel-2));
  padding: 54px 40px; text-align: center; position: relative;
}
.cta h2 { font-family: var(--f-head); font-weight: 700; font-size: clamp(1.6rem, 3.4vw, 2.4rem); color: #fff; }
.cta p { color: var(--muted); margin: 12px auto 26px; max-width: 460px; }

/* ---------- FOOTER ---------- */
.footer { border-top: 1px solid var(--line); padding: 44px 0 40px; margin-top: 20px; }
.footer-inner { display: flex; justify-content: space-between; align-items: flex-start; gap: 30px; flex-wrap: wrap; }
.footer .tagline { color: var(--muted); font-size: .9rem; max-width: 300px; margin-top: 12px; }
.footer-cols { display: flex; gap: 60px; flex-wrap: wrap; }
.footer-col h4 { font-family: var(--f-mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); margin-bottom: 14px; }
.footer-col a { display: block; color: var(--muted); font-size: .88rem; padding: 4px 0; transition: color .18s; }
.footer-col a:hover { color: var(--red); }
.footer-base { border-top: 1px solid var(--line); margin-top: 34px; padding-top: 20px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.footer-base span { font-family: var(--f-mono); font-size: .72rem; color: var(--dim); letter-spacing: .04em; }

/* ============================================================
   DASHBOARD / VERIFY
   ============================================================ */
.page { max-width: 940px; margin: 0 auto; padding: 120px 24px 70px; min-height: 82vh; }
.dash-loading { text-align: center; color: var(--dim); font-family: var(--f-mono); padding: 90px 0; letter-spacing: .1em; text-transform: uppercase; font-size: .8rem; }

.dash-top {
  display: flex; align-items: center; gap: 20px; padding: 26px; margin-bottom: 22px;
  background: linear-gradient(180deg, var(--panel), var(--panel-2)); border: 1px solid var(--line-2);
}
.dash-av { width: 76px; height: 76px; border: 1px solid var(--line-2); object-fit: cover;
  clip-path: polygon(0 0, 100% 0, 100% 80%, 80% 100%, 0 100%); background: var(--panel); }
.dash-who h1 { font-family: var(--f-head); font-weight: 700; font-size: 1.5rem; color: #fff; }
.dash-who .sid { font-family: var(--f-mono); font-size: .78rem; color: var(--dim); margin-top: 3px; }
.dash-lv { margin-left: auto; text-align: right; }
.dash-lv b { font-family: var(--f-mono); font-weight: 700; font-size: 2.4rem; color: var(--red); line-height: 1; display: block; }
.dash-lv span { font-family: var(--f-mono); font-size: .64rem; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }

.grid-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.card { border: 1px solid var(--line); background: var(--panel-2); padding: 22px; }
.card .ct { font-family: var(--f-mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.card .ct .ic { color: var(--red); }
.card .cv { font-family: var(--f-mono); font-weight: 700; font-size: 1.7rem; color: #fff; }
.card .cs { font-size: .84rem; color: var(--muted); margin-top: 3px; }
.card-wide { grid-column: 1 / -1; }

/* XP */
.xp { margin: 4px 0; }
.xp-track { height: 8px; background: var(--line); overflow: hidden; margin: 8px 0 6px; }
.xp-fill { height: 100%; background: linear-gradient(90deg, var(--red-deep), var(--red)); transition: width .6s ease; }
.xp-meta { display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: .74rem; color: var(--muted); }

/* Estados (login / no verificado / error) */
.state { text-align: center; padding: 70px 26px; border: 1px solid var(--line-2); background: linear-gradient(180deg, var(--panel), var(--panel-2)); }
.state .si { width: 52px; height: 52px; margin: 0 auto 20px; display: grid; place-items: center; color: var(--red); border: 1px solid var(--line-2);
  clip-path: polygon(0 0, 100% 0, 100% 74%, 74% 100%, 0 100%); }
.state h2 { font-family: var(--f-head); font-weight: 700; font-size: 1.4rem; color: #fff; margin-bottom: 10px; }
.state p { color: var(--muted); margin-bottom: 24px; max-width: 420px; margin-left: auto; margin-right: auto; }
.state .btn { margin: 0 auto; }
.verify-error {
  font-family: var(--f-mono); font-size: .84rem; text-align: left; color: #ffb4b4;
  background: rgba(255,59,59,.06); border: 1px solid rgba(255,59,59,.3);
  padding: 14px 16px; margin: 0 auto 22px; max-width: 460px; line-height: 1.7;
}

/* Aviso de rango pendiente (Premier >15k) */
.pending {
  font-family: var(--f-mono); font-size: .82rem; color: #ffd6a3;
  background: rgba(246,167,35,.07); border: 1px solid rgba(246,167,35,.3);
  padding: 12px 14px; margin-top: 14px; line-height: 1.6;
}
.pending a { color: var(--amber); text-decoration: underline; }

/* Input táctico */
.tin {
  flex: 1; min-width: 130px; background: var(--panel); color: var(--text);
  border: 1px solid var(--line-2); font-family: var(--f-mono); font-size: .9rem;
  padding: 10px 12px;
}
.tin:focus { outline: none; border-color: var(--red); }
.frow { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* ---------- Reveal (entrada por CSS en carga: nunca deja contenido oculto) ---------- */
.reveal { animation: rise .7s cubic-bezier(.2,.7,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero { padding-top: 120px; }
  .hud { max-width: 420px; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .ladder { grid-template-columns: repeat(3, 1fr); }
  .nav-links .hide-sm { display: none; }
}
@media (max-width: 560px) {
  .features-grid { grid-template-columns: 1fr; }
  .ladder { grid-template-columns: repeat(2, 1fr); }
  .grid-cards { grid-template-columns: 1fr; }
  .hero-stats { flex-wrap: wrap; gap: 14px; }
  .dash-top { flex-wrap: wrap; }
  .dash-lv { margin-left: 0; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
