/* =========================================================
   luisrosero.dev — workspace de developer
   Near-black ground, brand greens (BUDO / Klonyx), Geist + Geist Mono.
   Mobile first.
   ========================================================= */

:root {
  --bg: #07090B;
  --bg-2: #0A0E0D;
  --panel: #0D1311;
  --panel-2: #121A17;
  --line: rgba(220, 240, 228, 0.08);
  --line-2: rgba(220, 240, 228, 0.15);
  --text: #E8F0EB;
  --muted: #9AA9A1;
  --dim: #85948B;

  --g1: #8BD45A;   /* light brand green */
  --g2: #10B981;   /* emerald */
  --g3: #0B6B45;   /* deep brand green */
  --g4: #5EE6B8;   /* mint, data accent */
  --grad: linear-gradient(100deg, var(--g1) 0%, #3CCB6E 45%, var(--g2) 100%);
  --sky: #7DD3FC;
  --amber: #F5C04E;
  --red: #FF6B6B;
  --violet: #C792EA;

  --font: "Geist", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r: 14px;
  --r-sm: 10px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --gutter: 16px;

  --bs-body-font-family: var(--font);
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
}

/* ---------- base ---------- */
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 1rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
main { overflow-x: clip; }
::selection { background: var(--g2); color: #04130C; }
:focus-visible { outline: 2px solid var(--g1); outline-offset: 3px; border-radius: 6px; }
* { scrollbar-color: #23302A var(--bg); }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { text-wrap: pretty; }
img { max-width: 100%; height: auto; }
.mono { font-family: var(--mono); }
.container-xxl { padding-left: var(--gutter); padding-right: var(--gutter); max-width: 1240px; }
@media (min-width: 768px) { :root { --gutter: 32px; } }
svg { stroke-linecap: round; stroke-linejoin: round; }

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 2000;
  background: var(--g1); color: #04130C; padding: 10px 16px; border-radius: 8px; font-weight: 700; text-decoration: none;
  transition: top 160ms var(--ease-out);
}
.skip-link:focus { top: 12px; }

/* faint editor grid + one brand glow behind everything */
.bg-grid {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(640px 440px at 12% -6%, rgba(139, 212, 90, 0.14), transparent 70%),
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 56px 56px,
    var(--bg);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.5) 55%, rgba(0, 0, 0, 0.3) 100%);
          mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.5) 55%, rgba(0, 0, 0, 0.3) 100%);
}

/* marks drawn in dark ink (AWS wordmark, MySQL, Instagram glyph) disappear on the dark ground */
img[src$="aws.svg"], img[src$="mysql.svg"], img[src$="instagram.svg"] { filter: brightness(0) invert(0.86); }

/* ---------- buttons ---------- */
.btn-brand, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border-radius: var(--r-sm); text-decoration: none; font-weight: 700; line-height: 1;
  transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-out), border-color 160ms var(--ease-out), box-shadow 200ms var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.btn-brand {
  background: var(--grad); color: #04130C; padding: 16px 22px; font-size: 1rem;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.7);
}
.btn-brand img { flex: none; filter: brightness(0) saturate(100%) invert(5%) sepia(30%) saturate(1500%) hue-rotate(100deg); }
.btn-brand:hover { color: #04130C; transform: translateY(-2px); box-shadow: 0 16px 30px -12px rgba(0, 0, 0, 0.8); }
.btn-brand:active { transform: scale(0.97); }
.btn-brand--sm { padding: 10px 14px; font-size: 0.875rem; gap: 8px; }
.btn-brand--lg { padding: 18px 26px; font-size: 1.0625rem; }

.btn-ghost {
  color: var(--text); padding: 15px 20px; font-size: 0.9375rem;
  border: 1px solid var(--line-2); background: rgba(13, 19, 17, 0.6);
}
.btn-ghost svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform 200ms var(--ease-out); }
.btn-ghost:hover { color: var(--text); border-color: rgba(139, 212, 90, 0.5); transform: translateY(-2px); }
.btn-ghost:hover svg { transform: translateY(2px); }
.btn-ghost:active { transform: scale(0.97); }

.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; flex: none;
  background: transparent; color: var(--text); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  transition: transform 160ms var(--ease-out), border-color 160ms var(--ease-out);
}
.icon-btn:hover { border-color: rgba(139, 212, 90, 0.5); }
.icon-btn:active { transform: scale(0.95); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }

.ui-ic { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.4; vertical-align: -1px; }
.dots { display: inline-flex; gap: 7px; flex: none; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: #FF5F57; }
.dots i:nth-child(2) { background: #FEBC2E; }
.dots i:nth-child(3) { background: #28C840; }

/* =========================================================
   NAV
   ========================================================= */
.topbar { position: sticky; top: 0; z-index: 1030; background: rgba(7, 9, 11, 0.94); border-bottom: 1px solid var(--line); }
.topbar nav { min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 1rem; text-decoration: none; white-space: nowrap; letter-spacing: -0.01em; }
.brand:hover { color: var(--text); }
.brand img { border-radius: 7px; }
.nav-links { list-style: none; margin: 0; padding: 0; gap: 2px; }
.nav-links a {
  position: relative; display: block; padding: 8px 12px; font-size: 0.9375rem; font-weight: 500;
  color: var(--muted); text-decoration: none; transition: color 160ms var(--ease-out);
}
.nav-links a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; border-radius: 2px;
  background: var(--g1); transform: scaleX(0); transform-origin: left; transition: transform 220ms var(--ease-out);
}
.nav-links a:hover, .nav-links a.is-active { color: var(--text); }
.nav-links a:hover::after, .nav-links a.is-active::after { transform: scaleX(1); }

.menu.offcanvas { --bs-offcanvas-width: min(86vw, 340px); background: var(--bg-2); color: var(--text); border-left: 1px solid var(--line); }
.menu .offcanvas-header { padding: 18px 20px; }
.menu .offcanvas-body { padding: 8px 20px 24px; }
.menu .offcanvas-title { font-weight: 700; margin: 0; }
.menu-list { list-style: none; padding: 0; margin: 0; }
.menu-list a { display: block; padding: 14px 4px; color: var(--text); text-decoration: none; font-size: 1.125rem; font-weight: 600; border-bottom: 1px solid var(--line); }
.menu-list a:hover { color: var(--g1); }

/* =========================================================
   HERO — the workspace
   ========================================================= */
.hero { padding: 20px 0 0; }
@media (min-width: 992px) { .hero { padding: 40px 0 0; } }

.ide {
  border: 1px solid var(--line-2); border-radius: 16px; overflow: hidden;
  background: rgba(10, 14, 13, 0.94);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.9);
}
.ide-bar { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: rgba(18, 26, 23, 0.7); }
.ide-title { flex: 1; text-align: center; font-size: 0.75rem; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ide-branch { font-size: 0.75rem; color: var(--g1); }

.ide-body { display: grid; grid-template-columns: 1fr; }
@media (min-width: 992px) { .ide-body { grid-template-columns: 220px 1fr; } }

/* explorer: a tab row on phones, a file tree on desktop */
.explorer { border-bottom: 1px solid var(--line); background: rgba(13, 19, 17, 0.6); min-width: 0; }
.explorer-title { display: none; margin: 0; padding: 14px 16px 8px; font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.tree { list-style: none; margin: 0; padding: 0 8px; display: flex; overflow-x: auto; scrollbar-width: none; }
.tree::-webkit-scrollbar { display: none; }
.tree a {
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 10px 10px; font-size: 0.8125rem; color: var(--muted); text-decoration: none;
  border-bottom: 2px solid transparent; transition: color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}
.tree a:hover { color: var(--text); }
.tree a.is-open { color: var(--text); border-bottom-color: var(--g1); }
.ft { width: 9px; height: 9px; border-radius: 2px; flex: none; background: var(--muted); }
.ft-md { background: var(--sky); } .ft-yml { background: var(--violet); } .ft-log { background: var(--dim); }
.ft-git { background: #F97362; } .ft-json { background: var(--amber); } .ft-dir { background: var(--g2); }
.ft-ts { background: #4F9CF9; } .ft-sh { background: var(--g1); }
@media (min-width: 992px) {
  .explorer { border-bottom: 0; border-right: 1px solid var(--line); }
  .explorer-title { display: block; }
  .tree { display: block; padding: 0 8px 16px; overflow: visible; }
  .tree a { border-bottom: 0; border-radius: 6px; padding: 7px 10px; }
  .tree a:hover { background: rgba(220, 240, 228, 0.04); }
  .tree a.is-open { background: rgba(139, 212, 90, 0.1); }
}

.ide-main { min-width: 0; display: flex; flex-direction: column; }
.doc { padding: 26px 20px 28px; }
@media (min-width: 992px) { .doc { padding: 40px 48px 36px; } }
.doc-head { display: flex; align-items: center; gap: 18px; }
.doc-photo { width: 76px; height: 76px; border-radius: 16px; flex: none; border: 1px solid var(--line-2); object-fit: cover; }
@media (min-width: 576px) { .doc-photo { width: 104px; height: 104px; border-radius: 20px; } }
@media (min-width: 992px) { .doc-head { gap: 28px; } .doc-photo { width: 132px; height: 132px; border-radius: 24px; } }

.md { font-family: var(--mono); font-weight: 500; color: var(--g1); letter-spacing: 0; margin-right: 0.12em; }
.name { font-weight: 800; letter-spacing: -0.035em; line-height: 1; font-size: clamp(2.5rem, 11vw, 5.25rem); }
.name .md { font-size: 0.55em; vertical-align: 0.28em; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.role { margin: 12px 0 0; font-size: 0.9375rem; color: var(--g4); min-height: 3.2em; }
@media (min-width: 576px) { .role { min-height: 1.6em; } }
.role-prompt { color: var(--dim); }
.caret { display: inline-block; width: 8px; height: 1.1em; margin-left: 2px; vertical-align: -0.18em; background: var(--g1); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero-bio { margin: 22px 0 0; font-size: 1.0625rem; color: var(--muted); max-width: 62ch; }
.hero-bio strong { color: var(--text); font-weight: 600; }
@media (min-width: 992px) { .hero-bio { font-size: 1.1875rem; } }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hero-actions .btn-brand { flex: 1 1 100%; }
@media (min-width: 480px) { .hero-actions .btn-brand { flex: 0 0 auto; } }

/* integrated terminal panel */
.panel { border-top: 1px solid var(--line); background: rgba(7, 9, 11, 0.7); }
.panel-tabs { display: flex; gap: 18px; padding: 9px 16px 0; font-size: 0.6875rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); }
.panel-tabs span { padding-bottom: 7px; border-bottom: 1px solid transparent; }
.panel-tabs .is-active { color: var(--text); border-bottom-color: var(--g1); }
.panel-tabs b { font-weight: 500; color: var(--g1); }
.terminal-body { height: 240px; overflow: auto; padding: 12px 16px 6px; font-size: 0.8125rem; line-height: 1.65; color: var(--text); overscroll-behavior: contain; }
@media (min-width: 992px) { .terminal-body { height: 230px; padding: 12px 24px 6px; } }
@media (max-width: 991.98px) { .terminal-body { overscroll-behavior: auto; } } /* on phones a swipe that reaches the end of the terminal keeps scrolling the page */
.terminal-body p { margin: 0; white-space: pre-wrap; word-break: break-word; }
.terminal-body p.t-pre { white-space: pre; word-break: normal; }
.t-ok { color: var(--g1); } .t-dim { color: var(--dim); } .t-muted { color: var(--muted); }
.t-cyan { color: var(--g4); } .t-err { color: var(--red); } .t-amb { color: var(--amber); }
.t-strong { color: var(--text); font-weight: 600; } .t-sky { color: var(--sky); }
.terminal-body a { color: var(--g1); text-underline-offset: 3px; }
.term-line { display: flex; align-items: center; gap: 8px; padding: 2px 0 10px; }
.term-prompt { color: var(--g1); white-space: nowrap; margin: 0; }
.term-prompt span { color: var(--g4); }
.term-input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: var(--text); font: inherit; caret-color: var(--g1); padding: 0; }
.panel-chips { display: flex; gap: 8px; padding: 10px 16px 14px; border-top: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.panel-chips::-webkit-scrollbar { display: none; }
@media (min-width: 992px) { .panel-chips { flex-wrap: wrap; padding: 12px 24px 16px; } }
.panel-chips button {
  flex: none; font-family: var(--mono); font-size: 0.75rem; color: var(--text);
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 6px; padding: 7px 10px;
  transition: transform 160ms var(--ease-out), border-color 160ms var(--ease-out), color 160ms var(--ease-out);
}
.panel-chips button:hover { border-color: rgba(139, 212, 90, 0.55); color: var(--g1); transform: translateY(-1px); }
.panel-chips button:active { transform: scale(0.96); }

.ide-status { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 6px 14px; font-size: 0.6875rem; color: #04130C; background: var(--g2); }

/* ---------- ticker ---------- */
.ticker { margin-top: 48px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; background: rgba(10, 14, 13, 0.6);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.ticker-track { display: flex; gap: 40px; width: max-content; list-style: none; margin: 0; padding: 16px 0; animation: ticker 44s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track li { display: inline-flex; align-items: center; gap: 10px; font-size: 0.8125rem; color: var(--muted); white-space: nowrap; }
.ticker-track img { width: auto; height: 18px; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* =========================================================
   Sections — headings speak Markdown
   ========================================================= */
.section { padding: 80px 0; }
.section--tight { padding-top: 24px; }
@media (min-width: 992px) { .section { padding: 112px 0; } .section--tight { padding-top: 32px; } }
.section-title { font-weight: 700; font-size: clamp(2rem, 7vw, 3.5rem); line-height: 1.05; letter-spacing: -0.03em; margin-bottom: 20px; max-width: 22ch; }
.section-title .md { font-size: 0.6em; vertical-align: 0.18em; }
.section-lead { color: var(--muted); font-size: 1.0625rem; max-width: 60ch; margin: 0 0 36px; }
@media (min-width: 992px) { .section-lead { font-size: 1.1875rem; margin-bottom: 48px; } }
.note { margin: 0; padding-left: 14px; border-left: 1px solid var(--g1); color: var(--muted); font-size: 0.9375rem; }

/* reveal on scroll — content is visible by default, JS adds the hidden state */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* =========================================================
   SISTEMA — running diagram
   ========================================================= */
.system { display: grid; gap: 18px; }
.sys-diagram { display: grid; gap: 0; padding: 20px 16px; border: 1px solid var(--line-2); border-radius: var(--r); background: rgba(10, 14, 13, 0.85); }
.sys-col { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sys-label { flex-basis: 100%; display: inline-flex; align-items: center; gap: 6px; font-size: 0.6875rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); }
.sys-cluster { padding: 14px; border: 1px dashed rgba(16, 185, 129, 0.45); border-radius: 12px; background: rgba(16, 185, 129, 0.04); }
.pods { display: flex; flex-wrap: wrap; gap: 6px; flex-basis: 100%; }

/* links between layers: a lane with packets flowing through it */
.sys-link { position: relative; height: 34px; }
.sys-link::before { content: ""; position: absolute; left: 28px; top: 0; bottom: 0; width: 2px; background: var(--line-2); }
.sys-link i { position: absolute; left: 25px; top: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--g1); animation: packet-v 1.6s var(--ease-out) infinite; }
.sys-link:nth-of-type(4) i { animation-delay: 0.4s; } .sys-link:nth-of-type(6) i { animation-delay: 0.8s; }
@keyframes packet-v { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { transform: translateY(26px); opacity: 0; } }

.node {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 9px 13px;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line-2); border-radius: 10px;
  font-family: var(--font); font-weight: 600; font-size: 0.875rem; line-height: 1.1;
  transition: transform 180ms var(--ease-out), border-color 180ms var(--ease-out), background-color 180ms var(--ease-out), color 180ms var(--ease-out);
}
.node img { flex: none; width: auto; height: 18px; }
.node:hover { transform: translateY(-2px); border-color: rgba(139, 212, 90, 0.5); }
.node:active { transform: scale(0.97); }
.node--pod { font-family: var(--mono); font-weight: 500; font-size: 0.75rem; min-height: 38px; }
.node.is-pulse { border-color: var(--g2); }
.node[aria-pressed="true"] { background: var(--g1); color: #04130C; border-color: var(--g1); }
.node[aria-pressed="true"] img[src$="aws.svg"] { filter: none; }

.sys-rail { display: flex; flex-wrap: wrap; gap: 8px; }
.node--rail { background: transparent; }

.sys-detail {
  border: 1px solid var(--line-2); border-radius: var(--r); background: var(--panel);
  padding: 14px 18px 16px;
  position: sticky; bottom: 12px; z-index: 2; order: 3;
  box-shadow: 0 -10px 30px -12px rgba(0, 0, 0, 0.8);
}
.sys-detail { padding: 0 !important; overflow: hidden; }
.sys-detail-bar { padding: 9px 16px; font-size: 0.6875rem; color: var(--dim); border-bottom: 1px solid var(--line); background: rgba(18, 26, 23, 0.6); }
.sys-detail-body { padding: 14px 18px 16px; }
@media (min-width: 992px) { .sys-detail-body { padding: 20px 24px 24px; } }
.sys-detail h3 { font-size: 1.125rem; font-weight: 700; letter-spacing: -0.01em; }
.sys-detail p:last-child { margin: 6px 0 0; color: var(--muted); font-size: 0.9375rem; }

@media (min-width: 992px) {
  .system { grid-template-columns: 1fr 320px; column-gap: 24px; }
  .sys-diagram { grid-column: 1; grid-template-columns: auto 48px auto 48px 1.6fr 48px auto; align-items: center; padding: 28px 24px; }
  .sys-col { flex-direction: column; align-items: stretch; flex-wrap: nowrap; }
  .sys-label { flex-basis: auto; }
  .pods { flex-direction: column; }
  .sys-link { height: 100%; min-height: 60px; }
  .sys-link::before { left: 0; right: 0; top: 50%; bottom: auto; width: auto; height: 2px; }
  .sys-link i { left: 0; top: 50%; margin-top: -4px; animation-name: packet-h; }
  .sys-rail { grid-column: 1; }
  .sys-detail { grid-column: 2; grid-row: 1 / span 2; align-self: start; position: sticky; top: 96px; bottom: auto; order: 0; padding: 22px 24px 24px; box-shadow: none; }
  .sys-detail h3 { font-size: 1.375rem; }
}
@keyframes packet-h { 0% { transform: translateX(0); opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { transform: translateX(40px); opacity: 0; } }

/* =========================================================
   IA — work log
   ========================================================= */
.worklog { border: 1px solid var(--line-2); border-radius: var(--r); background: rgba(10, 14, 13, 0.9); overflow: hidden; }
.worklog-bar { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--line); font-size: 0.75rem; color: var(--dim); background: rgba(18, 26, 23, 0.6); }
.worklog-list { list-style: none; margin: 0; padding: 0; }
.worklog-list li { padding: 18px 18px 20px; border-bottom: 1px solid var(--line); }
.worklog-list li:last-child { border-bottom: 0; }
.wl-use { display: inline-block; margin-bottom: 10px; font-size: 0.6875rem; color: var(--g4); border: 1px solid rgba(94, 230, 184, 0.35); border-radius: 999px; padding: 2px 9px; }
.wl-ask, .wl-ans { margin: 0; font-size: 1rem; }
.wl-ask { color: var(--text); }
.wl-ans { margin-top: 4px; color: var(--muted); }
.wl-ask .mono { color: var(--g1); font-size: 0.8125rem; margin-right: 6px; }
.wl-ans .mono { color: var(--g4); font-size: 0.8125rem; margin-right: 6px; }
@media (min-width: 992px) { .worklog-list li { padding: 20px 24px 22px; } .section .col-lg-5 .note { margin-top: 8px; } }

/* =========================================================
   TRAYECTORIA — git log
   ========================================================= */
.gitlog { list-style: none; margin: 16px 0 0; padding: 0 0 0 28px; position: relative; }
.gitlog::before { content: ""; position: absolute; left: 7px; top: 12px; bottom: 12px; width: 2px; background: linear-gradient(180deg, var(--g1), var(--g2) 60%, var(--g3)); border-radius: 2px; }
.commit { position: relative; padding-bottom: 20px; }
.commit-node { position: absolute; left: -28px; top: 24px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 2px solid var(--c); box-shadow: 0 0 0 4px var(--bg); }
.commit-card { border: 1px solid var(--line-2); border-radius: var(--r); background: rgba(13, 19, 17, 0.8); padding: 22px 20px; transition: border-color 200ms var(--ease-out); }
.commit-card:hover { border-color: rgba(139, 212, 90, 0.3); }
.commit-meta { margin: 0; font-size: 0.75rem; color: var(--c); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--c); font-size: 0.6875rem; }
.commit-card h3 { margin: 12px 0 4px; font-size: 1.375rem; font-weight: 700; letter-spacing: -0.02em; }
.commit-org { margin: 0 0 14px; color: var(--muted); font-size: 0.9375rem; }
.commit-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.commit-list li { position: relative; padding-left: 22px; color: var(--muted); font-size: 0.9375rem; }
.commit-list li::before { content: "+"; position: absolute; left: 0; top: -1px; color: var(--c); font-family: var(--mono); font-weight: 700; }
.commit-list strong { color: var(--text); font-weight: 600; }
@media (min-width: 992px) {
  .gitlog { padding-left: 52px; }
  .gitlog::before { left: 13px; }
  .commit-node { left: -52px; width: 28px; height: 28px; top: 22px; border-width: 3px; }
  .commit-card { padding: 28px 32px; }
  .commit-list { grid-template-columns: 1fr 1fr; column-gap: 32px; }
}

/* =========================================================
   STACK — htop monitor
   ========================================================= */
.htop { border: 1px solid var(--line-2); border-radius: var(--r); background: rgba(10, 14, 13, 0.92); overflow: hidden; }
.htop-bar { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--line); background: rgba(18, 26, 23, 0.6); font-size: 0.75rem; color: var(--dim); }
.htop-uptime { color: var(--g1); }
.htop-tools { display: grid; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.htop-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.htop-tabs::-webkit-scrollbar { display: none; }
.htop-tabs button {
  flex: none; font-family: var(--mono); font-size: 0.75rem; color: var(--muted);
  background: transparent; border: 1px solid var(--line-2); border-radius: 999px; padding: 7px 12px;
  transition: color 160ms var(--ease-out), border-color 160ms var(--ease-out), background-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.htop-tabs button:hover { color: var(--text); border-color: rgba(139, 212, 90, 0.45); }
.htop-tabs button:active { transform: scale(0.96); }
.htop-tabs button[aria-selected="true"] { color: #04130C; background: var(--g1); border-color: var(--g1); }
.htop-search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.8125rem; }
.htop-search input { flex: 1 1 150px; }
.htop-search label { color: var(--g1); white-space: nowrap; margin: 0; }
.htop-search input {
  flex: 1; min-width: 0; font: inherit; color: var(--text); caret-color: var(--g1);
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px;
}
.htop-search input::placeholder { color: var(--dim); }
.htop-search input:focus { outline: none; border-color: var(--g1); }
.htop-sort { flex: none; font: inherit; font-size: 0.75rem; color: var(--muted); background: transparent; border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; transition: color 160ms var(--ease-out), border-color 160ms var(--ease-out); }
.htop-sort:hover { color: var(--text); border-color: rgba(139, 212, 90, 0.45); }
@media (min-width: 992px) {
  .htop-tools { grid-template-columns: 1fr 380px; align-items: center; padding: 16px 24px; }
  .htop-tabs { flex-wrap: wrap; }
}

.htop-head, .htop-row { display: grid; grid-template-columns: minmax(120px, 34%) 1fr 76px; column-gap: 14px; align-items: center; }
.htop-head { padding: 10px 16px 8px; font-size: 0.6875rem; letter-spacing: 0.06em; text-transform: uppercase; color: #04130C; background: var(--g2); }
.htop-list { list-style: none; margin: 0; padding: 6px 0; }
@media (min-width: 768px) { .htop-list { max-height: 470px; overflow-y: auto; } }
.htop-row {
  width: 100%; padding: 9px 16px; border: 0; background: transparent; color: var(--text); text-align: left;
  font-family: var(--font); font-size: 0.9375rem; transition: background-color 140ms var(--ease-out);
}
.htop-row:hover { background: rgba(220, 240, 228, 0.04); }
.htop-row[aria-pressed="true"] { background: rgba(139, 212, 90, 0.12); }
.htop-name { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.htop-name img { flex: none; width: 18px; height: 18px; object-fit: contain; }
.htop-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 575.98px) { .htop-head, .htop-row { grid-template-columns: minmax(0, 1.3fr) minmax(48px, 1fr) 64px; column-gap: 10px; } }
.meter { position: relative; height: 10px; border-radius: 3px; background: rgba(220, 240, 228, 0.06); overflow: hidden; }
.meter i {
  position: absolute; inset: 0; border-radius: 3px;
  background: repeating-linear-gradient(90deg, var(--g1) 0 6px, transparent 6px 8px);
  clip-path: inset(0 100% 0 0); transition: clip-path 900ms var(--ease-out);
}
.meter--active i { display: none; }
.meter--active::after { content: ""; position: absolute; left: 0; top: 4px; width: 16px; height: 2px; border-radius: 1px; background: var(--dim); }
.htop.is-live .meter i { clip-path: inset(0 calc((1 - var(--v)) * 100%) 0 0); }
.htop-years { font-family: var(--mono); font-size: 0.8125rem; color: var(--g1); text-align: right; white-space: nowrap; }
.htop-years--soft { color: var(--dim); }
.htop-empty { margin: 0; padding: 18px 16px; color: var(--dim); font-size: 0.8125rem; }
@media (min-width: 992px) {
  .htop-head, .htop-row { grid-template-columns: 260px 1fr 96px; column-gap: 24px; }
  .htop-head { padding: 10px 24px 8px; }
  .htop-row { padding: 10px 24px; }
}

.htop-detail { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px 16px 16px; border-top: 1px solid var(--line); background: var(--panel); }
.htop-detail img { width: 28px; height: 28px; object-fit: contain; }
.htop-detail p { margin: 0; }
.htop-detail-name { font-weight: 700; }
.htop-detail-note { color: var(--muted); font-size: 0.9375rem; }
.htop-detail-years { color: var(--g1); font-size: 0.875rem; white-space: nowrap; }
@media (min-width: 992px) { .htop-detail { padding: 18px 24px 20px; } }

/* =========================================================
   STACK — network graph (+ htop list as the alternate view)
   ========================================================= */
.stackview { border: 1px solid var(--line-2); border-radius: var(--r); background: rgba(10, 14, 13, 0.92); overflow: hidden; }
.stackview .htop { border: 0; border-radius: 0; background: transparent; }
.sv-bar { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line); background: rgba(18, 26, 23, 0.6); font-size: 0.75rem; color: var(--dim); }
.sv-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sv-toggle { display: inline-flex; padding: 3px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); flex: none; }
.sv-toggle button { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); background: transparent; border: 0; border-radius: 6px; padding: 5px 12px; transition: color 160ms var(--ease-out), background-color 160ms var(--ease-out); }
.sv-toggle button[aria-pressed="true"] { color: #04130C; background: var(--g1); }

.graph-legend { display: flex; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.graph-legend::-webkit-scrollbar { display: none; }
.graph-legend button {
  flex: none; display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 0.75rem; color: var(--muted);
  background: transparent; border: 1px solid var(--line-2); border-radius: 999px; padding: 6px 11px;
  transition: color 160ms var(--ease-out), border-color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}
.graph-legend button i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.graph-legend button:hover { color: var(--text); border-color: var(--c); }
.graph-legend button[aria-pressed="true"] { color: var(--text); border-color: var(--c); background: rgba(220, 240, 228, 0.05); }

/* the canvas itself never captures gestures: a finger on empty space or an edge scrolls the page.
   Only the nodes take the touch (drag / tap). */
.graph { position: relative; height: 760px; touch-action: pan-x pan-y; user-select: none; -webkit-user-select: none; }
.g-node { touch-action: none; cursor: grab; }
.g-node:active { cursor: grabbing; }
.g-edge { pointer-events: none; }
@media (min-width: 992px) { .graph { height: 620px; } }
.graph-svg { display: block; width: 100%; height: 100%; }
.graph-hint { position: absolute; right: 14px; bottom: 10px; margin: 0; font-size: 0.6875rem; color: var(--dim); pointer-events: none; }

.g-edge { stroke: rgba(220, 240, 228, 0.13); stroke-width: 1; transition: stroke 200ms var(--ease-out), opacity 200ms var(--ease-out); }
.g-edge--hub { stroke: rgba(220, 240, 228, 0.2); stroke-dasharray: 3 4; }
.g-edge.is-hot { stroke: var(--g1); stroke-width: 1.6; stroke-dasharray: 5 7; animation: g-flow 0.9s linear infinite; }
@keyframes g-flow { to { stroke-dashoffset: -24; } }
.g-node { cursor: pointer; outline: none; }
.g-node circle.g-ring { fill: var(--bg); stroke: var(--c); stroke-width: 1.5; transition: stroke-width 160ms var(--ease-out); }
.g-node circle.g-halo { fill: var(--c); opacity: 0; transition: opacity 200ms var(--ease-out); }
.g-node text { font-family: var(--mono); font-size: 10.5px; fill: var(--muted); text-anchor: middle; pointer-events: none; transition: fill 160ms var(--ease-out); }
.g-node image.ink { filter: brightness(0) invert(0.86); }
.g-node:hover circle.g-ring, .g-node:focus-visible circle.g-ring { stroke-width: 2.5; }
.g-node:focus-visible circle.g-halo { opacity: 0.18; }
.g-node.is-on circle.g-halo { opacity: 0.16; }
.g-node.is-on text, .g-node.is-near text { fill: var(--text); }
.g-hub rect { fill: var(--panel-2); stroke: var(--c); stroke-width: 1.2; }
.g-hub text { fill: var(--text); font-size: 11px; }
.g-core circle.g-ring { stroke: var(--g1); stroke-width: 2; }
.graph.is-focus .g-node:not(.is-on):not(.is-near) { opacity: 0.22; }
@media (max-width: 575.98px) {
  .g-tech > text { opacity: 0; transition: opacity 200ms var(--ease-out); }
  .g-tech.is-on > text, .g-tech.is-near > text { opacity: 1; }
  .graph:not(.is-focus) .g-tech[data-major] > text { opacity: 1; }
}
.graph.is-focus .g-edge:not(.is-hot) { opacity: 0.25; }
.g-node, .g-edge { transition: opacity 220ms var(--ease-out); }

.graph-detail { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start; padding: 14px 16px 16px; border-top: 1px solid var(--line); background: var(--panel); }
.graph-detail > img { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; background: var(--bg); border: 1px solid var(--line-2); padding: 6px; }
.graph-detail > img.is-photo { padding: 0; object-fit: cover; }
.graph-detail > img.ink { filter: brightness(0) invert(0.86); }
.graph-detail p { margin: 0; }
.graph-detail-name { font-weight: 700; font-size: 1.0625rem; }
.graph-detail-note { color: var(--muted); font-size: 0.9375rem; margin-top: 2px !important; }
.graph-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; font-size: 0.75rem; }
.graph-links button { font-family: var(--mono); font-size: 0.6875rem; color: var(--muted); background: transparent; border: 1px solid var(--line-2); border-radius: 6px; padding: 3px 8px; transition: color 160ms var(--ease-out), border-color 160ms var(--ease-out); }
.graph-links button:hover { color: var(--g1); border-color: rgba(139, 212, 90, 0.5); }
.graph-detail-years { color: var(--g1); font-size: 0.875rem; white-space: nowrap; padding-top: 2px; }
@media (min-width: 992px) { .graph-detail { padding: 18px 24px 20px; } }

/* =========================================================
   PRODUCTOS
   ========================================================= */
.project { height: 100%; display: flex; flex-direction: column; border: 1px solid var(--line-2); border-radius: var(--r); background: rgba(13, 19, 17, 0.85); overflow: hidden; transition: transform 220ms var(--ease-out), border-color 220ms var(--ease-out); }
.project:hover { transform: translateY(-3px); border-color: rgba(139, 212, 90, 0.35); }
.project-cover { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-bottom: 1px solid var(--line); }
.project-cover > img:first-child { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease-out); }
.project:hover .project-cover > img:first-child { transform: scale(1.03); }
.project-logo { position: absolute; left: 18px; bottom: 18px; width: 64px; height: 64px; border-radius: 14px; border: 1px solid var(--line-2); box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.8); object-fit: cover; }
.project-logo--light { background: #fff; object-fit: contain; padding: 4px; }
.project-body { display: flex; flex-direction: column; gap: 10px; padding: 22px 22px 24px; flex: 1; }
.project h3 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.03em; }
.project-meta { margin: -4px 0 0; font-size: 0.875rem; color: var(--g1); }
.project-body > p:not(.project-meta) { margin: 0; color: var(--muted); }
.tags { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-size: 0.6875rem; color: var(--muted); border: 1px solid var(--line-2); border-radius: 6px; padding: 3px 8px; }
.project-link { margin-top: auto; padding-top: 8px; align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-weight: 600; text-decoration: none; }
.project-link svg { width: 16px; height: 16px; fill: none; stroke: var(--g1); stroke-width: 2; transition: transform 200ms var(--ease-out); }
.project-link:hover { color: var(--g1); }
.project-link:hover svg { transform: translate(2px, -2px); }
@media (min-width: 992px) { .project-body { padding: 26px 28px 28px; } .project-logo { width: 76px; height: 76px; left: 24px; bottom: 22px; } }

/* =========================================================
   SECTORES — editor
   ========================================================= */
.editor { margin-top: 16px; border: 1px solid var(--line-2); border-radius: var(--r); background: rgba(10, 14, 13, 0.92); overflow: hidden; }
.editor-bar { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--line); background: rgba(18, 26, 23, 0.6); }
.editor-tab { font-size: 0.75rem; color: var(--text); padding: 4px 10px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line); }
.editor-code { margin: 0; padding: 18px 16px 20px 0; font-size: 0.8125rem; line-height: 1.85; color: var(--text); counter-reset: ln; white-space: pre-wrap; overflow-wrap: anywhere; }
.editor-code .cl { display: block; padding-left: 44px; text-indent: -44px; }
@media (min-width: 992px) { .editor-code .cl { padding-left: 56px; text-indent: -56px; } }
.editor-code .ln { display: inline-block; width: 44px; padding-right: 16px; text-align: right; color: var(--dim); user-select: none; }
.editor-code .ln::before { counter-increment: ln; content: counter(ln); }
.kw { color: var(--violet); } .var { color: var(--g4); } .str { color: var(--g1); } .prop { color: var(--sky); } .num { color: var(--amber); }
@media (min-width: 992px) { .editor-code { font-size: 0.9375rem; padding: 24px 24px 26px 0; } .editor-code .ln { width: 56px; } }

/* =========================================================
   FORMACIÓN
   ========================================================= */
.oneline { list-style: none; margin: 16px 0 0; padding: 0; border-top: 1px solid var(--line); }
.oneline li { display: grid; grid-template-columns: 56px 1fr; column-gap: 14px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 0.8125rem; }
.year { color: var(--g1); }
.msg { color: var(--text); font-family: var(--font); font-size: 1rem; }
@media (min-width: 768px) { .oneline li { grid-template-columns: 80px 1fr; padding: 16px 0; } .msg { font-size: 1.0625rem; } }

/* =========================================================
   CONTACTO
   ========================================================= */
.contact {
  position: relative; border: 1px solid var(--line-2); border-radius: 20px; padding: 36px 22px;
  background: radial-gradient(520px 260px at 100% 0%, rgba(16, 185, 129, 0.14), transparent 70%), rgba(13, 19, 17, 0.92);
  overflow: hidden;
}
@media (min-width: 992px) { .contact { padding: 72px 64px; } }
.contact-title { font-weight: 800; font-size: clamp(2.125rem, 8.4vw, 5rem); line-height: 1; letter-spacing: -0.035em; margin-bottom: 20px; max-width: 14ch; }
.intents { display: flex; flex-wrap: wrap; gap: 8px; border: 0; margin: 0; padding: 0; min-width: 0; }
.intent { position: relative; cursor: pointer; }
.intent input { position: absolute; opacity: 0; pointer-events: none; }
.intent span { display: inline-block; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 0.875rem; font-weight: 600; color: var(--muted); background: var(--panel-2); transition: color 160ms var(--ease-out), border-color 160ms var(--ease-out), background-color 160ms var(--ease-out), transform 160ms var(--ease-out); }
.intent:hover span { color: var(--text); border-color: rgba(139, 212, 90, 0.45); }
.intent:active span { transform: scale(0.97); }
.intent input:checked + span { color: #04130C; background: var(--g1); border-color: var(--g1); }
.intent input:focus-visible + span { outline: 2px solid var(--g1); outline-offset: 3px; }
.cmd { margin: 18px 0 0; padding: 14px 16px; border-radius: var(--r-sm); background: var(--bg); border: 1px solid var(--line); font-size: 0.8125rem; color: var(--muted); word-break: break-word; }
.cmd-prompt { color: var(--g1); }
[data-msg-preview] { color: var(--g4); }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.contact-actions .btn-brand { flex: 1 1 100%; }
@media (min-width: 480px) { .contact-actions .btn-brand { flex: 0 0 auto; } }
.contact-data { margin: 30px 0 0; padding-top: 22px; border-top: 1px solid var(--line); display: grid; gap: 12px; font-size: 0.9375rem; }
.contact-data dt { color: var(--dim); font-weight: 400; font-size: 0.75rem; }
.contact-data dd { margin: 2px 0 0; color: var(--text); word-break: break-word; }
.contact-data .soon { color: var(--muted); }
.contact-data .soon img { vertical-align: -2px; }
.contact-data .soon span { margin-left: 6px; color: var(--dim); }
@media (min-width: 992px) { .contact-data { grid-template-columns: auto auto 1fr; column-gap: 56px; } }


/* AI providers row in the system diagram + integrations on products */
.sys-ai { display: grid; gap: 8px; padding: 14px; border: 1px dashed rgba(199, 146, 234, 0.45); border-radius: 12px; background: rgba(199, 146, 234, 0.04); }
.sys-ai-nodes { display: flex; flex-wrap: wrap; gap: 8px; }
.node--ai .ui-ic { width: 16px; height: 16px; color: var(--violet); }
.node--ai[aria-pressed="true"] .ui-ic { color: #04130C; }
.node--prov { font-size: 0.8125rem; min-height: 40px; }
img.ink { filter: brightness(0) invert(0.86); }
.node[aria-pressed="true"] img.ink { filter: none; }
@media (min-width: 992px) { .sys-ai { grid-column: 1; grid-template-columns: auto 1fr; align-items: center; column-gap: 16px; } }
.integrations { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.integrations li { display: inline-flex; align-items: center; gap: 7px; font-size: 0.8125rem; color: var(--text); padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); }
.integrations img { width: auto; height: 16px; }

.keep { white-space: nowrap; }
@media (min-width: 576px) { .graph { height: 640px; } }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 28px 0 36px; color: var(--muted); font-size: 0.875rem; }
.footer p { margin: 0; }
.footer-small { color: var(--dim); font-size: 0.8125rem; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .ticker-track { flex-wrap: wrap; width: auto; justify-content: center; row-gap: 14px; padding: 16px var(--gutter); }
  .sys-link i { display: none; }
  .meter i { clip-path: inset(0 calc((1 - var(--v)) * 100%) 0 0) !important; }
}
