/* ─── RESET & BASE ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0d1117;
  --bg2: #161b22;
  --bg3: #21262d;
  --accent: #39d353;
  --accent2: #58a6ff;
  --text: #e6edf3;
  --muted: #8b949e;
  --border: #30363d;
  --font-mono: 'JetBrains Mono', monospace;
  --font-sans: 'Inter', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.7;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ─── NAV ─── */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(13,17,23,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s;
}
#navbar.scrolled { box-shadow: 0 2px 20px rgba(0,0,0,0.4); }
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.9rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }

/* ─── HERO ─── */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 6rem 2rem 4rem;
  overflow: hidden;
}

.grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.25;
  pointer-events: none;
}
#hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 200px;
  background: linear-gradient(transparent, var(--bg));
  pointer-events: none;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 700px;
}

/* Terminal window */
.terminal-window {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(57,211,83,0.08);
  animation: fadeUp 0.8s ease both;
}
.terminal-bar {
  background: var(--bg3);
  padding: 0.7rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.dot {
  width: 12px; height: 12px;
  border-radius: 50%;
}
.dot.red    { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green  { background: #27c93f; }
.terminal-title {
  margin-left: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}
.terminal-body {
  padding: 1.5rem 1.8rem 2rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.9;
}
.terminal-line { display: flex; gap: 0.6rem; }
.prompt { color: var(--accent); user-select: none; }
.cmd { color: var(--accent2); }
.terminal-output { color: var(--text); padding-left: 1.5rem; }
.name-output {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  padding-left: 1.5rem;
  letter-spacing: -0.5px;
}
.cursor {
  display: inline-block;
  color: var(--accent);
  animation: blink 1s step-end infinite;
}

.fade-in-late { animation: fadeUp 0.6s ease 1.8s both; }

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}
.btn-primary {
  background: var(--accent);
  color: #000;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(57,211,83,0.3);
}
.btn-ghost {
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.75rem 2rem;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: border-color 0.2s, color 0.2s;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  font-size: 1.2rem;
  color: var(--muted);
  animation: bounce 2s infinite;
  z-index: 1;
}

/* ─── SECTIONS ─── */
.section { padding: 6rem 2rem; }
.dark-section { background: var(--bg2); }
.container { max-width: 1100px; margin: 0 auto; }

.section-title {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}
.section-subtitle {
  color: var(--muted);
  margin-bottom: 3rem;
  font-size: 1rem;
}

/* ─── ABOUT ─── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}
.about-text p { color: var(--muted); margin-bottom: 1rem; }
.about-text strong { color: var(--text); }
.badge-group { margin-bottom: 1.5rem; }
.label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.6rem;
}
.badge {
  display: inline-block;
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  margin: 0.2rem;
  color: var(--muted);
}
.accent-badge {
  border-color: rgba(57,211,83,0.3);
  color: var(--accent);
  background: rgba(57,211,83,0.05);
}
.badge-link {
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.badge-link:hover {
  border-color: rgba(88,166,255,0.5);
  color: var(--accent2);
}
.badge-inprogress {
  border-color: rgba(88,166,255,0.4);
  color: var(--accent2);
  background: rgba(88,166,255,0.08);
  font-weight: 600;
  animation: pulse-border 2s ease-in-out infinite;
}
@keyframes pulse-border {
  0%, 100% { border-color: rgba(88,166,255,0.4); }
  50% { border-color: rgba(88,166,255,0.9); }
}

/* ─── METRICS ─── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
.metric-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem 1.5rem;
  text-align: center;
  transition: border-color 0.3s, transform 0.3s;
  position: relative;
  overflow: hidden;
}
.metric-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  opacity: 0;
  transition: opacity 0.3s;
}
.metric-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.metric-card:hover::before { opacity: 1; }
.metric-icon { font-size: 1.8rem; margin-bottom: 0.8rem; }
.metric-value {
  font-family: var(--font-mono);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.metric-value span:last-child { font-size: 1.6rem; }
.metric-unit {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent2);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0.4rem 0;
}
.metric-label {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 0.6rem;
}

/* ─── TIMELINE ─── */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 1px;
  background: var(--border);
}
.timeline-item {
  position: relative;
  margin-bottom: 3rem;
}
.timeline-marker {
  position: absolute;
  left: -2.4rem;
  top: 0.5rem;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 10px rgba(57,211,83,0.5);
}
.timeline-content {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.8rem 2rem;
  transition: border-color 0.3s;
}
.timeline-content:hover { border-color: rgba(57,211,83,0.3); }
.job-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.job-title { font-size: 1.1rem; font-weight: 600; color: var(--text); }
.job-company {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  margin-top: 0.2rem;
}
.job-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  margin-top: 0.3rem;
}
.job-achievements {
  list-style: none;
  margin-bottom: 1.2rem;
}
.job-achievements li {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0.3rem 0 0.3rem 1.2rem;
  position: relative;
}
.job-achievements li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}
.job-achievements li strong { color: var(--text); }
.doi-link {
  color: var(--accent2);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  border-bottom: 1px dashed var(--accent2);
  transition: color 0.2s, border-color 0.2s;
}
.doi-link:hover { color: var(--accent); border-color: var(--accent); }
.job-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.job-tags span {
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 0.2rem 0.7rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent2);
}

/* ─── EDUCATION ─── */
.edu-laureado {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: linear-gradient(135deg, rgba(57,211,83,0.06), rgba(88,166,255,0.06));
  border: 1px solid rgba(57,211,83,0.25);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.2rem;
}
.laureado-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(57,211,83,0.12);
  border: 1px solid rgba(57,211,83,0.4);
  border-radius: 4px;
  padding: 0.25rem 0.6rem;
  white-space: nowrap;
  margin-top: 0.1rem;
}
.edu-laureado p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}
.edu-laureado p strong { color: var(--text); }

/* ─── SKILLS ─── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}
.skill-category {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color 0.3s;
}
.skill-category:hover { border-color: rgba(57,211,83,0.3); }
.skill-category h4 {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 1rem;
}
.skill-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pill {
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 0.3rem 0.9rem;
  border-radius: 20px;
  font-size: 0.82rem;
  color: var(--text);
  transition: border-color 0.2s, color 0.2s;
}
.pill:hover { border-color: var(--accent); color: var(--accent); }

/* ─── CONTACT ─── */
.contact-container { text-align: center; }
.contact-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 540px;
  margin: 0 auto;
}
.contact-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  transition: border-color 0.3s, color 0.3s, transform 0.2s;
}
.contact-card:hover {
  border-color: var(--accent);
  color: var(--text);
  transform: translateX(4px);
}
.contact-icon {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent);
  font-size: 1rem;
  min-width: 24px;
  text-align: center;
}

/* ─── FOOTER ─── */
footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}

/* ─── ACCENT GLOBAL ─── */
.accent { color: var(--accent); }

/* ─── REVEAL ANIMATION ─── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── KEYFRAMES ─── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes blink {
  50% { opacity: 0; }
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(8px); }
}

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid   { grid-template-columns: 1fr; gap: 2rem; }
  .skills-grid  { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .metrics-grid  { grid-template-columns: 1fr 1fr; }
  .nav-links     { display: none; }
  .name-output   { font-size: 1.2rem; }
  .terminal-body { font-size: 0.82rem; }
  .job-header    { flex-direction: column; }
  .section       { padding: 4rem 1.2rem; }
  .edu-laureado  { flex-direction: column; }
}
