/* ============================================================
   Edney Hernández — Portfolio moderno estilo programador
   Design system: dark slate + run green | Space Grotesk / DM Sans
   ============================================================ */

:root {
  --bg: #0f172a;
  --bg-alt: #1e293b;
  --surface: #16213c;
  --border: #2b3a55;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --text-soft: #cbd5e1;
  --accent: #22c55e;
  --accent-dim: rgba(34, 197, 94, 0.12);
  --accent-glow: rgba(34, 197, 94, 0.35);
  --purple: #a78bfa;
  --cyan: #38bdf8;
  --amber: #fbbf24;
  --font-heading: "Space Grotesk", sans-serif;
  --font-body: "DM Sans", sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;
  --radius: 14px;
  --z-nav: 50;
  --z-overlay: 30;
}

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

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
}

h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.2; }

a { color: var(--accent); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: #4ade80; }

img { max-width: 100%; display: block; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.mono { font-family: var(--font-mono); }

::selection { background: var(--accent); color: var(--bg); }

/* Focus visible */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Fondo con grid sutil ---------- */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 55%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 55%, transparent 100%);
}

/* ---------- Navbar flotante ---------- */
.nav {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1120px, calc(100% - 32px));
  z-index: var(--z-nav);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 22px;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.nav-logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}
.nav-logo .prompt { color: var(--accent); }
.nav-logo .cursor-blink {
  display: inline-block;
  width: 9px; height: 1.1em;
  background: var(--accent);
  vertical-align: text-bottom;
  margin-left: 3px;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.nav-links {
  display: flex;
  gap: 6px;
  list-style: none;
}
.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--accent);
  background: var(--accent-dim);
}
.nav-links a .hash { color: var(--accent); opacity: 0.7; }

.nav-right { display: flex; align-items: center; gap: 10px; }

.lang-switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}
.lang-switch a {
  padding: 4px 9px;
  border-radius: 6px;
  color: var(--text-muted);
  transition: color 0.2s ease, background 0.2s ease;
}
.lang-switch a:hover { color: var(--accent); }
.lang-switch a.active {
  color: var(--accent);
  background: var(--accent-dim);
}

.nav-cta {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  padding: 9px 18px;
  border-radius: 9px;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.nav-cta:hover { background: #4ade80; color: var(--bg); box-shadow: 0 0 24px var(--accent-glow); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1.3rem;
  padding: 6px 10px;
  cursor: pointer;
}

@media (max-width: 1024px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: calc(100% + 10px);
    left: 0; right: 0;
    flex-direction: column;
    background: rgba(15, 23, 42, 0.97);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-cta { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 140px 0 80px;
  position: relative;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}
.hero-inner > * { min-width: 0; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(34, 197, 94, 0.3);
  padding: 7px 16px;
  border-radius: 999px;
  margin-bottom: 24px;
}
.hero-eyebrow .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50% { box-shadow: 0 0 0 6px transparent; }
}

.hero h1 {
  font-size: clamp(2.5rem, 5.5vw, 4.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.hero h1 .accent { color: var(--accent); }

.hero-role {
  font-family: var(--font-mono);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  color: var(--text-soft);
  margin-bottom: 22px;
  min-height: 1.6em;
}
.hero-role .typed-cursor { color: var(--accent); }

.hero-desc {
  color: var(--text-muted);
  font-size: 1.06rem;
  max-width: 54ch;
  margin-bottom: 34px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 38px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 13px 26px;
  border-radius: 11px;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { background: #4ade80; color: var(--bg); box-shadow: 0 0 30px var(--accent-glow); }
.btn-ghost { border: 1px solid var(--border); color: var(--text-soft); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

.hero-socials { display: flex; gap: 10px; }
.hero-socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--text-muted);
  font-size: 1.2rem;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.hero-socials a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

/* Terminal window */
.terminal {
  background: #0b1120;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(34, 197, 94, 0.06);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.83rem;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
.terminal-bar .tdot { width: 12px; height: 12px; border-radius: 50%; }
.tdot.red { background: #ef4444; }
.tdot.yellow { background: #f59e0b; }
.tdot.green { background: #22c55e; }
.terminal-bar .title {
  margin-left: 10px;
  color: var(--text-muted);
  font-size: 0.78rem;
}
.terminal-body { padding: 22px 24px; line-height: 1.85; overflow-x: auto; }
.terminal-body .ln { white-space: pre; }
.tk-key { color: var(--cyan); }
.tk-str { color: var(--accent); }
.tk-num { color: var(--amber); }
.tk-punc { color: var(--text-muted); }
.tk-const { color: var(--purple); }
.tk-comment { color: #64748b; font-style: italic; }
.tk-prompt { color: var(--accent); font-weight: 700; }

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.scroll-hint i { animation: bob 1.8s ease-in-out infinite; font-size: 1.1rem; color: var(--accent); }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

@media (max-width: 900px) {
  .hero { padding-top: 150px; }
  .hero-inner { grid-template-columns: 1fr; gap: 44px; }
  .scroll-hint { display: none; }
}
@media (max-width: 480px) {
  .hero-eyebrow { font-size: 0.75rem; }
  .terminal { font-size: 0.72rem; }
}

/* ---------- Secciones ---------- */
.section { padding: 110px 0; }

.section-head { margin-bottom: 56px; }
.section-head.center { text-align: center; }
.section-head.center .section-sub { margin-left: auto; margin-right: auto; }
.section-tag {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  display: block;
  margin-bottom: 10px;
}
.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.section-sub { color: var(--text-muted); margin-top: 12px; max-width: 62ch; }

/* ---------- About / Stats ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 48px;
  align-items: start;
}

.about-text p { color: var(--text-soft); margin-bottom: 18px; }
.about-text .hl { color: var(--accent); font-weight: 600; }

.about-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 28px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.about-meta li {
  list-style: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 9px;
}
.about-meta li i { color: var(--accent); }

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 22px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.stat-card:hover { border-color: rgba(34, 197, 94, 0.45); background: var(--bg-alt); }
.stat-value {
  font-family: var(--font-heading);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
  font-family: var(--font-mono);
}

@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .stats, .about-meta { grid-template-columns: 1fr; }
}

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.skill-card:hover {
  border-color: rgba(34, 197, 94, 0.45);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.skill-icon {
  width: 48px; height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 1.4rem;
  margin-bottom: 18px;
}
.skill-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.skill-card > p { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 16px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-soft);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 5px 11px;
  border-radius: 7px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.chip:hover { color: var(--accent); border-color: var(--accent); }

@media (max-width: 900px) { .skills-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .skills-grid { grid-template-columns: 1fr; } }

/* ---------- Experiencia (timeline) ---------- */
.timeline { position: relative; padding-left: 34px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 8px; top: 6px; bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--border));
}
.tl-item { position: relative; padding-bottom: 52px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -34px; top: 8px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 5px var(--accent-dim);
}

.tl-period {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(34, 197, 94, 0.3);
  padding: 4px 12px;
  border-radius: 999px;
  display: inline-block;
  margin-bottom: 12px;
}
.tl-item h3 { font-size: 1.3rem; margin-bottom: 4px; }
.tl-company {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  margin-bottom: 14px;
}
.tl-points { list-style: none; margin-bottom: 16px; }
.tl-points li {
  color: var(--text-soft);
  font-size: 0.96rem;
  padding-left: 22px;
  position: relative;
  margin-bottom: 8px;
}
.tl-points li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent);
}
.tl-points strong { color: var(--text); }

/* ---------- Proyectos / Portfolio ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.pf-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  color: inherit;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.pf-card:hover {
  transform: translateY(-6px);
  border-color: rgba(34, 197, 94, 0.55);
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.45);
  color: inherit;
}
.pf-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.pf-media {
  height: 256px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, rgba(34, 197, 94, 0.08), rgba(56, 189, 248, 0.05) 55%, rgba(15, 23, 42, 0.4));
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.pf-media img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: transform 0.3s ease;
}
.pf-card:hover .pf-media img { transform: scale(1.05); }

.pf-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 22px 24px 24px;
}
.pf-cat {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.pf-body h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
  transition: color 0.2s ease;
}
.pf-card:hover .pf-body h3 { color: var(--accent); }
.pf-body p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 18px;
  flex: 1;
}
.pf-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: auto;
}
.pf-link i { transition: transform 0.25s ease; }
.pf-card:hover .pf-link i { transform: translateX(6px); }

@media (max-width: 1024px) { .projects-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .projects-grid { grid-template-columns: 1fr; } }

/* ---------- Educación ---------- */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.edu-card {
  display: flex;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: border-color 0.2s ease;
}
.edu-card:hover { border-color: rgba(34, 197, 94, 0.45); }
.edu-card .skill-icon { flex-shrink: 0; margin-bottom: 0; }
.edu-card h3 { font-size: 1.05rem; margin-bottom: 4px; }
.edu-card p { color: var(--text-muted); font-size: 0.9rem; }
.edu-card .when {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  margin-top: 6px;
  display: block;
}
@media (max-width: 700px) { .edu-grid { grid-template-columns: 1fr; } }

/* ---------- Contacto ---------- */
.contact-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: clamp(32px, 6vw, 64px);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.contact-wrap::before {
  content: "";
  position: absolute;
  top: -120px; left: 50%;
  transform: translateX(-50%);
  width: 480px; height: 240px;
  background: radial-gradient(ellipse, var(--accent-glow), transparent 70%);
  opacity: 0.5;
  pointer-events: none;
}
.contact-wrap .section-tag { margin-bottom: 14px; }
.contact-wrap h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); margin-bottom: 16px; }
.contact-wrap > p {
  color: var(--text-muted);
  max-width: 56ch;
  margin: 0 auto 34px;
}
.contact-channels {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 36px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
}
.contact-channels a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text-soft);
  border: 1px solid var(--border);
  padding: 11px 20px;
  border-radius: 11px;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.contact-channels a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}
.contact-channels a i { color: var(--accent); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 34px 0;
  margin-top: 40px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
}
.footer-inner .status { display: inline-flex; align-items: center; gap: 8px; }
.footer-inner .status .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- Scroll top ---------- */
.scroll-top {
  position: fixed;
  right: 22px; bottom: 22px;
  width: 46px; height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 12px;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease, background 0.2s ease;
  z-index: var(--z-overlay);
}
.scroll-top.show { opacity: 1; visibility: visible; }
.scroll-top:hover { background: #4ade80; }
