/* ==========================================================
   brayanvera.com — estilos compartidos
   ========================================================== */

:root {
  --bg: #05060b;
  --bg-2: #0a0c14;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eef0f7;
  --text-2: #a4a9bd;
  --text-3: #6b7088;
  --cyan: #5ee7ff;
  --violet: #9b7bff;
  --magenta: #ff5fd2;
  --amber: #ffc46b;
  --accent: var(--cyan);
  --grad: linear-gradient(120deg, #5ee7ff 0%, #9b7bff 50%, #ff5fd2 100%);
  --radius: 18px;
  --radius-lg: 28px;
  --max: 1180px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-serif: "Instrument Serif", "Times New Roman", serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
::selection { background: rgba(94, 231, 255, 0.3); }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .container { padding: 0 16px; } }

/* ---------- Navegación ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(5, 6, 11, 0.72);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom-color: var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; font-size: 18px; letter-spacing: -0.01em; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  background: var(--grad); color: #05060b; font-family: var(--font-serif); font-style: italic; font-size: 22px; line-height: 1;
}
.nav-links { display: flex; gap: 6px; align-items: center; }
.nav-links a {
  color: var(--text-2); font-size: 15px; padding: 8px 14px; border-radius: 999px; transition: color .2s, background .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--surface-2); }
.nav-links a.cta { color: #05060b; background: var(--text); font-weight: 500; }
.nav-links a.cta:hover { background: #fff; }
.nav-toggle { display: none; background: none; border: 0; color: var(--text); padding: 8px; cursor: pointer; }
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 68px; left: 12px; right: 12px; flex-direction: column; align-items: stretch;
    background: rgba(10, 12, 20, 0.96); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 10px; backdrop-filter: blur(20px);
    opacity: 0; pointer-events: none; transform: translateY(-8px); transition: .25s;
  }
  .nav.open .nav-links { opacity: 1; pointer-events: auto; transform: none; }
  .nav-links a { padding: 12px 16px; }
}

/* ---------- Tipografía y utilidades ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent);
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: currentColor; opacity: .7; }
.h-display { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.035em; line-height: 1.02; margin: 0; }
.h-section { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.03em; line-height: 1.08; font-size: clamp(34px, 5vw, 56px); margin: 16px 0 18px; }
.lead { color: var(--text-2); font-size: clamp(17px, 1.6vw, 20px); max-width: 680px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
.mono { font-family: var(--font-mono); }
section, header { position: relative; }
.katex { position: relative; }
.section { padding: 130px 0; }
@media (max-width: 760px) { .section { padding: 90px 0; } }

.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px; border-radius: 999px;
  font-weight: 500; font-size: 16px; transition: transform .2s, background .2s, box-shadow .2s, border-color .2s; cursor: pointer; border: 0;
  font-family: inherit;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--text); color: #05060b; }
.btn-primary:hover { box-shadow: 0 10px 40px -10px rgba(94, 231, 255, 0.6); }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.btn svg { width: 18px; height: 18px; }

.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.015));
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 30px;
  position: relative; overflow: hidden;
}

.tag {
  display: inline-block; font-family: var(--font-mono); font-size: 12px; color: var(--text-2);
  padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
}

/* Aparición al hacer scroll */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; } .reveal.d2 { transition-delay: .16s; } .reveal.d3 { transition-delay: .24s; } .reveal.d4 { transition-delay: .32s; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Ventana tipo macOS para capturas ---------- */
.mac-window {
  border-radius: 14px; overflow: hidden; background: #111318; border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 50px 120px -30px rgba(0,0,0,0.8), 0 0 0 1px rgba(0,0,0,0.6);
}
.mac-bar { height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 14px; background: rgba(255,255,255,0.04); border-bottom: 1px solid rgba(255,255,255,0.06); }
.mac-bar i { width: 12px; height: 12px; border-radius: 50%; display: block; }
.mac-bar i:nth-child(1) { background: #ff5f57; } .mac-bar i:nth-child(2) { background: #febc2e; } .mac-bar i:nth-child(3) { background: #28c840; }
.mac-bar span { margin-left: 10px; font-size: 12px; color: var(--text-3); }

/* ---------- Pie ---------- */
.footer { border-top: 1px solid var(--border); padding: 48px 0 56px; color: var(--text-3); font-size: 14px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; }
.footer a { color: var(--text-2); } .footer a:hover { color: var(--text); }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }

/* Fondo de ruido sutil */
.grain::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
