/* ══════════════════════════════════════════
   VARIABLES
══════════════════════════════════════════ */
:root {
  --git-orange: #f05032;
  --github-dark: #0d1117;
  --github-blue: #58a6ff;
  --github-green: #3fb950;
  --github-purple: #bc8cff;
  --github-yellow: #e3b341;
  --surface: #161b22;
  --surface2: #21262d;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
}

/* ══════════════════════════════════════════
   RESET Y BASE
══════════════════════════════════════════ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--github-dark);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  overflow-x: hidden;
}

/* ══════════════════════════════════════════
   CANVAS DE PARTÍCULAS
══════════════════════════════════════════ */
#canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ══════════════════════════════════════════
   NAVEGACIÓN
══════════════════════════════════════════ */
nav {
  position: fixed; top: 0; width: 100%;
  background: rgba(13,17,23,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  padding: 0 2rem;
  display: flex; align-items: center; gap: 2rem;
  height: 60px;
}

nav .logo {
  font-weight: 700; font-size: 1.1rem;
  display: flex; align-items: center; gap: .5rem;
}
nav .logo span.git { color: var(--git-orange); }
nav .logo span.amp { color: var(--text-muted); }
nav .logo span.hub { color: var(--github-blue); }

nav a {
  color: var(--text-muted); text-decoration: none;
  font-size: .9rem; transition: color .2s;
}
nav a:hover { color: var(--text); }

nav .spacer { flex: 1; }

nav .pill {
  background: var(--github-green);
  color: #000; font-weight: 600;
  padding: .3rem .9rem; border-radius: 20px;
  font-size: .8rem;
}

/* ══════════════════════════════════════════
   HERO
══════════════════════════════════════════ */
.hero {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 6rem 2rem 4rem;
  position: relative; z-index: 1;
}

.hero-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: .35rem .9rem;
  font-size: .82rem; color: var(--text-muted);
  margin-bottom: 2rem;
  animation: fadeDown .8s ease both;
}

.hero-badge .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--github-green);
  animation: pulse 2s infinite;
}

.hero h1 {
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 800; line-height: 1.05;
  letter-spacing: -2px;
  animation: fadeDown .8s .15s ease both;
}
.hero h1 .line-git { color: var(--git-orange); }
.hero h1 .line-amp { color: var(--text-muted); font-weight: 300; }
.hero h1 .line-hub { color: var(--github-blue); }

.hero p.subtitle {
  max-width: 600px; margin: 1.5rem auto;
  font-size: 1.15rem; color: var(--text-muted); line-height: 1.7;
  animation: fadeDown .8s .3s ease both;
}

.hero-btns {
  display: flex; gap: 1rem; flex-wrap: wrap;
  justify-content: center; margin-top: 2rem;
  animation: fadeDown .8s .45s ease both;
}

/* ══════════════════════════════════════════
   BOTONES
══════════════════════════════════════════ */
.btn {
  padding: .7rem 1.6rem; border-radius: 8px;
  font-size: .95rem; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: transform .15s, box-shadow .15s;
  border: none;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.4); }

.btn-primary { background: var(--github-blue); color: #000; }

.btn-secondary {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--github-blue); color: var(--github-blue); }

/* ══════════════════════════════════════════
   TERMINAL ANIMADO
══════════════════════════════════════════ */
.terminal-wrapper {
  animation: fadeDown .8s .6s ease both;
  margin-top: 3rem; width: 100%; max-width: 600px;
}

.terminal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
  text-align: left;
}

.terminal-header {
  background: var(--surface2);
  padding: .6rem 1rem;
  display: flex; align-items: center; gap: .5rem;
  border-bottom: 1px solid var(--border);
}

.terminal-header .dot { width: 12px; height: 12px; border-radius: 50%; }
.terminal-header .dot.r { background: #ff5f57; }
.terminal-header .dot.y { background: #febc2e; }
.terminal-header .dot.g { background: #28c840; }
.terminal-header .title {
  margin-left: auto; margin-right: auto;
  font-size: .8rem; color: var(--text-muted);
}

.terminal-body {
  padding: 1.2rem 1.4rem;
  font-family: 'Consolas', monospace;
  font-size: .88rem; line-height: 1.8;
  min-height: 160px;
}
.terminal-body .prompt { color: var(--github-green); }
.terminal-body .cmd    { color: var(--text); }
.terminal-body .out    { color: var(--text-muted); }
.terminal-body .branch { color: var(--github-purple); }

.cursor {
  display: inline-block; width: 8px; height: 1em;
  background: var(--github-green); vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

/* ══════════════════════════════════════════
   SECCIONES GENERALES
══════════════════════════════════════════ */
section { position: relative; z-index: 1; }

.section-title { text-align: center; margin-bottom: 3rem; }

.section-title .eyebrow {
  font-size: .8rem; font-weight: 600; letter-spacing: 2px;
  text-transform: uppercase; color: var(--github-blue);
  margin-bottom: .6rem;
}

.section-title h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700; letter-spacing: -1px;
}

.section-title p {
  color: var(--text-muted); margin-top: .8rem;
  font-size: 1.05rem; max-width: 550px; margin-inline: auto;
}

/* ══════════════════════════════════════════
   SECCIÓN GIT
══════════════════════════════════════════ */
#git {
  padding: 6rem 2rem;
  background: linear-gradient(180deg, transparent 0%, rgba(240,80,50,.03) 50%, transparent 100%);
}

.git-grid {
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 3rem; align-items: center;
}

.git-info .lead {
  font-size: 1.1rem; color: var(--text-muted); line-height: 1.8;
  margin-bottom: 1.5rem;
}

.concept-list {
  list-style: none; display: flex; flex-direction: column; gap: .8rem;
}

.concept-list li {
  display: flex; align-items: flex-start; gap: .8rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: .8rem 1rem;
  transition: border-color .2s, transform .2s;
  cursor: default;
}
.concept-list li:hover {
  border-color: var(--git-orange);
  transform: translateX(4px);
}

.concept-list .icon  { font-size: 1.3rem; flex-shrink: 0; margin-top: 1px; }
.concept-list .label { font-weight: 600; font-size: .9rem; }
.concept-list .desc  { font-size: .82rem; color: var(--text-muted); }

/* ══════════════════════════════════════════
   ÁRBOL DE COMMITS
══════════════════════════════════════════ */
.commit-tree {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 1.5rem;
}

.commit-tree h4 {
  font-size: .8rem; color: var(--text-muted);
  margin-bottom: 1.2rem; letter-spacing: 1px; text-transform: uppercase;
}

.branch-line { display: flex; flex-direction: column; gap: 0; }

.commit-row {
  display: flex; align-items: center; gap: .8rem;
  position: relative;
}

.c-dot {
  width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid;
  position: relative; z-index: 2;
}

.c-line {
  position: absolute; left: 7px; top: 16px;
  width: 2px; height: 32px; z-index: 1;
}

.main-dot  { border-color: var(--github-blue);   background: rgba(88,166,255,.2); }
.main-line { background: var(--github-blue); }
.feat-dot  { border-color: var(--github-purple); background: rgba(188,140,255,.2); }
.feat-line { background: var(--github-purple); }
.merge-dot { border-color: var(--github-green);  background: rgba(63,185,80,.2); }

.c-msg { font-size: .82rem; }
.c-msg .hash {
  color: var(--github-yellow); font-family: monospace;
  font-size: .78rem; margin-right: .4rem;
}
.c-msg .msg { color: var(--text); }
.c-msg .tag {
  margin-left: .4rem; font-size: .7rem; padding: .1rem .4rem;
  border-radius: 4px; font-weight: 600;
}

.tag-main  { background: rgba(88,166,255,.2);  color: var(--github-blue); }
.tag-feat  { background: rgba(188,140,255,.2); color: var(--github-purple); }
.tag-merge { background: rgba(63,185,80,.2);   color: var(--github-green); }

.branch-connector {
  margin-left: 7px;
  border-left: 2px solid var(--border);
  border-bottom: 2px solid var(--border);
  width: 24px; height: 24px;
  border-radius: 0 0 0 6px;
  margin-bottom: -4px;
}

/* ══════════════════════════════════════════
   SECCIÓN GITHUB
══════════════════════════════════════════ */
#github {
  padding: 6rem 2rem;
  background: linear-gradient(180deg, transparent 0%, rgba(88,166,255,.03) 50%, transparent 100%);
}

.github-grid {
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 3rem; align-items: start;
}

.feature-cards {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
}

.fcard {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 1.2rem;
  transition: border-color .2s, transform .2s;
  cursor: default;
}
.fcard:hover { border-color: var(--github-blue); transform: translateY(-3px); }
.fcard .ficon { font-size: 1.6rem; margin-bottom: .6rem; }
.fcard h4 { font-size: .9rem; font-weight: 600; margin-bottom: .3rem; }
.fcard p  { font-size: .8rem; color: var(--text-muted); line-height: 1.6; }

/* ── Perfil mock ── */
.profile-mock {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
}

.profile-header {
  background: linear-gradient(135deg, #0d419d 0%, #1c2f66 100%);
  height: 80px; position: relative;
}

.profile-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, var(--github-blue), var(--github-purple));
  border: 3px solid var(--surface);
  position: absolute; bottom: -24px; left: 1.2rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
}

.profile-body { padding: 2rem 1.2rem 1.2rem; }
.profile-body h3 { font-size: 1rem; margin-bottom: .2rem; }
.profile-body .handle { font-size: .85rem; color: var(--text-muted); margin-bottom: 1rem; }

.contrib-grid {
  display: grid; grid-template-columns: repeat(26, 1fr);
  gap: 3px; margin-top: .8rem;
}

.contrib-cell {
  aspect-ratio: 1;
  border-radius: 2px;
  background: var(--surface2);
}

.contrib-label { font-size: .75rem; color: var(--text-muted); margin-bottom: .4rem; }

.repo-list { margin-top: 1rem; display: flex; flex-direction: column; gap: .6rem; }

.repo-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px; padding: .7rem .9rem;
  display: flex; align-items: center; gap: .6rem;
}
.repo-item .repo-icon { color: var(--text-muted); font-size: .9rem; }
.repo-item .repo-name { font-size: .85rem; color: var(--github-blue); font-weight: 600; }
.repo-item .repo-lang {
  margin-left: auto; font-size: .75rem; color: var(--text-muted);
  display: flex; align-items: center; gap: .3rem;
}

.lang-dot { width: 8px; height: 8px; border-radius: 50%; }

/* ══════════════════════════════════════════
   TABLA DE DIFERENCIAS
══════════════════════════════════════════ */
#diferencias { padding: 6rem 2rem; }

.diff-table {
  max-width: 900px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 1px; background: var(--border);
  border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border);
}

.diff-cell {
  background: var(--surface);
  padding: 1.2rem;
}

.diff-cell.header {
  background: var(--surface2);
  font-weight: 700; font-size: .9rem;
  text-align: center;
}
.diff-cell.header.git-h  { color: var(--git-orange); }
.diff-cell.header.git-hub { color: var(--github-blue); }

.diff-cell.category {
  color: var(--text-muted); font-size: .82rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
  display: flex; align-items: center;
}

.diff-cell.value { font-size: .85rem; line-height: 1.6; }
.diff-cell.git-val { border-left: 2px solid rgba(240,80,50,.3); }
.diff-cell.hub-val { border-left: 2px solid rgba(88,166,255,.3); }

/* ══════════════════════════════════════════
   FLUJO DE TRABAJO
══════════════════════════════════════════ */
#flujo { padding: 6rem 2rem; }

.flow-steps {
  max-width: 900px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 0;
}

.flow-step {
  display: grid; grid-template-columns: 60px 1fr;
  gap: 1.5rem; position: relative;
}

.step-left { display: flex; flex-direction: column; align-items: center; }

.step-num {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem; flex-shrink: 0;
  border: 2px solid;
}

.step-connector { width: 2px; flex: 1; min-height: 40px; }

.step-content {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 1.2rem 1.4rem;
  margin-bottom: 1.5rem;
  transition: border-color .2s;
}
.step-content:hover { border-color: var(--github-blue); }
.step-content h4 { font-size: .95rem; font-weight: 600; margin-bottom: .3rem; }
.step-content p  { font-size: .85rem; color: var(--text-muted); line-height: 1.6; }

.step-content .code-tag {
  display: inline-block; margin-top: .6rem;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 5px; padding: .2rem .6rem;
  font-family: monospace; font-size: .8rem;
  color: var(--github-green);
}

.s1 .step-num       { border-color: var(--git-orange);    color: var(--git-orange); }
.s1 .step-connector { background: var(--git-orange);    opacity: .3; }
.s2 .step-num       { border-color: var(--github-purple); color: var(--github-purple); }
.s2 .step-connector { background: var(--github-purple); opacity: .3; }
.s3 .step-num       { border-color: var(--github-green);  color: var(--github-green); }
.s3 .step-connector { background: var(--github-green);  opacity: .3; }
.s4 .step-num       { border-color: var(--github-yellow); color: var(--github-yellow); }
.s4 .step-connector { background: var(--github-yellow); opacity: .3; }
.s5 .step-num       { border-color: var(--github-blue);   color: var(--github-blue); }
.s5 .step-connector { background: var(--github-blue);   opacity: .3; }

/* ══════════════════════════════════════════
   CTA
══════════════════════════════════════════ */
#cta {
  padding: 6rem 2rem; text-align: center;
  background: radial-gradient(ellipse at center, rgba(88,166,255,.07) 0%, transparent 70%);
}

#cta h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 800; letter-spacing: -1px; margin-bottom: 1rem;
}

#cta p { color: var(--text-muted); font-size: 1.1rem; margin-bottom: 2rem; }

.command-block {
  display: inline-flex; align-items: center; gap: 1rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: .8rem 1.4rem;
  font-family: monospace; font-size: 1rem;
  margin-bottom: 2rem;
}
.command-block .ps  { color: var(--github-green); }
.command-block .cmd { color: var(--text); }

/* ══════════════════════════════════════════
   FOOTER
══════════════════════════════════════════ */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem; text-align: center;
  font-size: .82rem; color: var(--text-muted);
  position: relative; z-index: 1;
}

/* ══════════════════════════════════════════
   ANIMACIONES DE SCROLL
══════════════════════════════════════════ */
.reveal {
  opacity: 0; transform: translateY(30px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

.reveal-left {
  opacity: 0; transform: translateX(-30px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal-left.visible { opacity: 1; transform: translateX(0); }

.reveal-right {
  opacity: 0; transform: translateX(30px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal-right.visible { opacity: 1; transform: translateX(0); }

/* ══════════════════════════════════════════
   KEYFRAMES
══════════════════════════════════════════ */
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(63,185,80,.4); }
  50%      { box-shadow: 0 0 0 6px rgba(63,185,80,0); }
}

@keyframes blink { 50% { opacity: 0; } }

@keyframes typeLine {
  from { width: 0; } to { width: 100%; }
}

/* ══════════════════════════════════════════
   TOOLTIP
══════════════════════════════════════════ */
[data-tip] { position: relative; }
[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute; bottom: 110%; left: 50%; transform: translateX(-50%);
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); font-size: .75rem; padding: .3rem .6rem;
  border-radius: 5px; white-space: nowrap; z-index: 50;
  pointer-events: none;
}

/* ══════════════════════════════════════════
   SCROLLBAR PERSONALIZADA
══════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--github-dark); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 768px) {
  .git-grid, .github-grid { grid-template-columns: 1fr; }
  .feature-cards           { grid-template-columns: 1fr; }
  .diff-table              { grid-template-columns: 1fr; }
  .contrib-grid            { grid-template-columns: repeat(13, 1fr); }
  nav a                    { display: none; }
}
