/* =============================================================
   jimmeralba.me: estética terminal heredada de SANG
   flat · sin sombras · sin gradientes · esquinas casi rectas
   ============================================================= */

:root {
  --green:   #00FF00;
  --black:   #0D1117;
  --white:   #FFFFFF;

  --dark-gray:  #161B22;
  --mid-gray:   #21262D;
  --light-gray: #8B949E;
  --gray-light: #C9D1D9;

  --cyan:    #00FFFF;
  --magenta: #FF00FF;
  --yellow:  #FFFF00;
  --orange:  #FF6600;

  --font-display:  'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-mono:     'Courier Prime', 'Courier New', Courier, monospace;
  --font-terminal: 'JetBrains Mono', Consolas, 'SF Mono', monospace;

  /* Semánticos (dark por defecto) */
  --bg: #0D1117; --bg-alt: #0A0E13; --surface: #161B22; --border: #21262D;
  --text: #C9D1D9; --text-strong: #FFFFFF; --muted: #8B949E;
  --accent: #00FF00; --line-green: #00FF00;
  --c-green: #00FF00; --c-cyan: #00FFFF; --c-magenta: #FF00FF; --c-yellow: #FFFF00; --c-orange: #FF6600;

  --container: 1160px;
  --pad-x: 48px;
}

/* Paleta clara del Design System (mismo verde fosforescente de SANG) */
html[data-theme="light"] {
  --bg: #FFFFFF; --bg-alt: #F6F8FA; --surface: #F6F8FA; --border: #D0D7DE;
  --text: #1F2328; --text-strong: #0E0E10; --muted: #57606A;
  --accent: #00FF00; --line-green: #00FF00;
  --c-green: #00FF00; --c-cyan: #00798C; --c-magenta: #B000B0; --c-yellow: #8A7600; --c-orange: #CC4D00;
}
html[data-theme="light"] .section-alt { --surface: #FFFFFF; }
html[data-theme="light"] .term-code { color: #C9D1D9; }

/* ---------- Idioma ---------- */
html[data-l="en"] .es { display: none !important; }
html[data-l="es"] .en { display: none !important; }

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  transition: background-color 160ms ease-out, color 160ms ease-out;
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-mono); font-size: 17px; line-height: 1.7;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }
em { font-style: italic; }

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 1000; background: var(--green); color: #0D1117; font-family: var(--font-display); font-weight: 700; padding: 10px 16px; }
.skip-link:focus { left: 8px; top: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--pad-x); }
.narrow { max-width: 860px; }
.c-green { color: var(--accent); } .c-cyan { color: var(--cyan); } .c-magenta { color: var(--magenta); }
.c-yellow { color: var(--c-yellow); } .c-orange { color: var(--c-orange); } .c-gray { color: var(--muted); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 100; background: var(--bg); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding-top: 16px; padding-bottom: 16px; gap: 16px; }
.wordmark { font-family: var(--font-terminal); font-weight: 700; font-size: 18px; color: var(--text-strong); letter-spacing: -0.01em; }
.wordmark .dot, .footer-name .dot { color: var(--accent); }
.cursor { color: var(--accent); animation: blink 1.1s steps(1) infinite; }
.nav { display: flex; align-items: center; gap: 26px; }
.nav a { font-family: var(--font-mono); font-size: 14px; color: var(--muted); transition: color 120ms ease-out; }
.nav a:hover { color: var(--accent); }
.lang-toggle {
  background: none; border: 1px solid var(--border); border-radius: 4px; color: var(--accent);
  font-family: var(--font-terminal); font-weight: 700; font-size: 13px; padding: 5px 10px; cursor: pointer;
  transition: background-color 120ms ease-out, border-color 120ms ease-out;
}
.theme-toggle { margin-left: -14px; }
html[data-theme="dark"] .to-dark, html[data-theme="light"] .to-light { display: none; }
.lang-toggle:hover { background: var(--surface); border-color: var(--accent); }

/* ---------- Hero ---------- */
.hero { padding: 96px 0 104px; }
.hero-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 56px; align-items: center; }
.eyebrow { font-family: var(--font-terminal); font-weight: 700; font-size: 15px; color: var(--accent); }
.hero-headline {
  font-family: var(--font-display); font-weight: 800; color: var(--text-strong);
  font-size: clamp(34px, 5.4vw, 64px); line-height: 1.02; letter-spacing: -0.03em;
}
.hero-headline .period { color: var(--line-green); }
.hero-sub { font-size: 18px; line-height: 1.6; color: var(--text); max-width: 560px; margin-top: 28px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.chips li { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; color: var(--text); font-size: 13px; padding: 4px 10px; }
.chips .chip-live { color: var(--accent); border-color: var(--accent); }
.chips .chip-live::before { content: "● "; }

/* Terminal */
.terminal { background: var(--dark-gray); border: 1px solid var(--mid-gray); border-radius: 12px; padding: 22px 24px; overflow-x: auto; }
.term-dots { display: flex; gap: 8px; margin-bottom: 18px; }
.term-dots span { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.dot-o { background: var(--orange); } .dot-y { background: var(--yellow); } .dot-g { background: var(--green); }
.term-code { margin: 0; font-family: var(--font-terminal); font-size: 13.5px; line-height: 1.8; color: var(--gray-light); }
.term-code code { white-space: pre; }
.t-p { color: var(--light-gray); } .t-g { color: var(--green); } .t-c { color: var(--cyan); } .t-y { color: var(--yellow); }
.cursor-block { background: var(--green); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Sections ---------- */
.section { padding: 100px 0; border-top: 1px solid var(--border); }
.section-alt { background: var(--bg-alt); }
.section-title { font-family: var(--font-terminal); font-weight: 700; font-size: 22px; color: var(--accent); margin-bottom: 36px; }
.section-sub { font-size: 17px; color: var(--text); max-width: 680px; margin: -12px 0 40px; }

/* Thread */
.prose p { margin-bottom: 22px; font-size: 18px; line-height: 1.75; }
.prose .lede { font-family: var(--font-display); font-weight: 700; font-size: clamp(24px, 3.4vw, 34px); line-height: 1.25; letter-spacing: -0.015em; color: var(--text-strong); margin-bottom: 36px; }
.prose .coda { color: var(--text-strong); margin-top: 36px; margin-bottom: 0; }
.gt { color: var(--accent); font-weight: 700; }

/* Numbers */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stat { display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 28px 26px; transition: border-color 120ms ease-out; }
.stat:hover { border-color: var(--accent); }
.stat-n { font-family: var(--font-display); font-weight: 800; font-size: clamp(34px, 4vw, 46px); line-height: 1; letter-spacing: -0.03em; color: var(--accent); }
.stat-d { font-size: 15px; line-height: 1.6; color: var(--text); }
.stat-t { margin-top: auto; padding-top: 6px; font-family: var(--font-terminal); font-size: 12px; color: var(--muted); }

/* Path */
.steps { margin-top: 8px; }
.step { display: flex; gap: 24px; position: relative; }
.step-num { flex: 0 0 auto; align-self: flex-start; background: var(--magenta); color: var(--bg); font-family: var(--font-mono); font-weight: 700; font-size: 13px; border-radius: 4px; padding: 5px 9px; }
.step-content { padding-bottom: 52px; position: relative; flex: 1; min-width: 0; }
.step:not(:last-child) .step-content::before { content: ""; position: absolute; left: -38.5px; top: 34px; bottom: 10px; width: 2px; background: var(--line-green); }
.step-when { font-family: var(--font-terminal); font-size: 13px; color: var(--muted); }
.step-content h3 { font-family: var(--font-display); font-weight: 700; font-size: 24px; line-height: 1.2; letter-spacing: -0.01em; color: var(--text-strong); margin-top: 4px; }
.step-content h3 .at { color: var(--accent); font-weight: 600; }
.step-role { font-size: 15px; color: var(--muted); margin-top: 6px; }

.bullets { margin-top: 14px; }
.bullets li { position: relative; padding-left: 22px; margin-bottom: 8px; font-size: 16px; line-height: 1.6; }
.bullets li::before { content: "●"; position: absolute; left: 0; top: 0; color: var(--line-green); font-size: 11px; line-height: 1.95; }

/* Toolkit */
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px 28px; }
.tool-title { font-family: var(--font-terminal); font-weight: 700; font-size: 16px; margin-bottom: 14px; }
.tool-title::before { content: "/ "; color: var(--muted); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills li { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; color: var(--text); font-size: 14px; padding: 4px 11px; }

/* Foundation */
.found-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.found { border: 1px solid var(--border); border-radius: 8px; padding: 28px 26px; background: var(--surface); }
.found h3 { font-family: var(--font-display); font-weight: 700; font-size: 21px; color: var(--text-strong); line-height: 1.2; }
.found-sub { font-size: 14px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.found .bullets li { font-size: 15px; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 32px 0 40px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-left { display: flex; flex-direction: column; gap: 4px; }
.footer-name { font-family: var(--font-terminal); font-weight: 700; font-size: 16px; color: var(--text-strong); }
.footer-line { font-size: 13px; color: var(--muted); max-width: 560px; line-height: 1.5; }
.footer-links { font-size: 15px; display: flex; gap: 10px; flex-wrap: wrap; }
.footer-links .sep { color: var(--muted); }
.link-green { color: var(--accent); }
.link-green:hover { text-decoration: underline; }

/* ---------- WhatsApp bubble ---------- */
.wa-bubble {
  position: fixed; right: 22px; bottom: 22px; z-index: 150;
  display: inline-flex; align-items: center; gap: 0;
  height: 56px; min-width: 56px; padding: 0 15px; border-radius: 28px;
  background: var(--green); color: #0D1117; justify-content: center;
  font-family: var(--font-terminal); font-weight: 700; font-size: 14px;
  transition: background-color 120ms ease-out;
}
.wa-bubble:hover { background: #00e000; }
.wa-label { max-width: 0; overflow: hidden; white-space: nowrap; transition: max-width 200ms ease-out, margin 200ms ease-out; }
.wa-bubble:hover .wa-label, .wa-bubble:focus-visible .wa-label { max-width: 120px; margin-left: 10px; }
.wa-bubble:focus-visible { outline: 2px solid var(--text-strong); outline-offset: 3px; }
@media (max-width: 640px) { .wa-bubble { right: 16px; bottom: 16px; } }

/* ---------- Reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 500ms ease-out, transform 500ms ease-out; }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  :root { --pad-x: 28px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .stats, .found-grid { grid-template-columns: 1fr 1fr; }
  .tool-grid { grid-template-columns: 1fr 1fr; }
  .nav a { display: none; }
}
@media (max-width: 640px) {
  :root { --pad-x: 20px; }
  body { font-size: 16px; }
  .hero { padding: 56px 0 64px; }
  .section { padding: 68px 0; }
  .stats, .found-grid, .tool-grid { grid-template-columns: 1fr; }
  .step { gap: 14px; }
  .step:not(:last-child) .step-content::before { left: -28px; }
  .step-content h3 { font-size: 20px; }
  .term-code { font-size: 12px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor, .cursor-block { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}
