/* ============================================================
   PALETTE — conservada del original, refinada
   ============================================================ */
:root {
  --bg:          #0d0b0b;
  --bg-card:     #161213;
  --bg-card2:    #1c1719;
  --magenta:     #f544fc;
  --green:       #00ce67;
  --blue:        #5fa0fe;
  --text:        #efe5e5;
  --text-muted:  #9e9090;
  --border:      rgba(245, 68, 252, 0.25);
  --border-hover:rgba(0, 206, 103, 0.5);
  --font-mono:   'JetBrains Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  --font-sans:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius:      6px;
  --max-w:       860px;
  --transition:  0.2s ease;
}

/* ============================================================
   RESET / BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  min-height: 100vh;
  padding-bottom: 60px;
}

/* ============================================================
   SCANLINE TEXTURE (signature element — sutil, no abruma)
   ============================================================ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.06) 2px,
    rgba(0,0,0,0.06) 4px
  );
  pointer-events: none;
  z-index: 0;
}

/* ============================================================
   HEADER
   ============================================================ */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 11, 11, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.language-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
}

.language-buttons img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  border: 1px solid transparent;
}

.language-buttons img:hover {
  transform: scale(1.15);
  border-color: var(--green);
  box-shadow: 0 0 8px rgba(0, 206, 103, 0.4);
}

.social-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.social-links a {
  display: flex;
  align-items: center;
  opacity: 0.8;
  transition: opacity var(--transition), transform var(--transition);
}

.social-links a:hover {
  opacity: 1;
  transform: scale(1.12);
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.site-main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 48px 24px 32px;
  position: relative;
  z-index: 1;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  margin-bottom: 48px;
}

.greeting {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--green);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.prompt-char {
  color: var(--magenta);
  margin-right: 6px;
}

h1 {
  font-family: var(--font-sans);
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  font-weight: 700;
  color: var(--magenta);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  text-shadow: 0 0 30px rgba(245, 68, 252, 0.3);
}

.intro {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text);
  line-height: 1.8;
  max-width: 640px;
}

.cv-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  color: var(--green);
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  border: 1px solid rgba(0, 206, 103, 0.4);
  padding: 6px 14px;
  border-radius: var(--radius);
  transition: all var(--transition);
}

.cv-link:hover {
  background: rgba(0, 206, 103, 0.1);
  border-color: var(--green);
  box-shadow: 0 0 12px rgba(0, 206, 103, 0.25);
}

.cv-link .arrow {
  transition: transform var(--transition);
}

.cv-link:hover .arrow {
  transform: translateX(3px);
}

/* ============================================================
   TABS NAV
   ============================================================ */
.tabs-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.tab {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 18px;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap;
}

.tab:hover {
  color: var(--text);
  border-color: var(--border);
}

.tab.active-tab {
  color: var(--green);
  border-color: rgba(0, 206, 103, 0.35);
  background: var(--bg-card);
}

.tab.active-tab::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--bg-card);
}

/* ============================================================
   TABS WRAPPER & PANELS
   Solución al bug: cada panel usa display:block/none,
   sin position:absolute, sin visibility trucos
   ============================================================ */
.tabs-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 32px;
  min-height: 320px;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.2s ease;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   GIF — responsive sin romperse
   ============================================================ */
.gif-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 0;
}

#miGif {
  width: 100%;
  max-width: 560px;
  height: auto;
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ============================================================
   TYPOGRAPHY INSIDE PANELS
   ============================================================ */
.tab-panel h2 {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--magenta);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 28px 0 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.tab-panel h2:first-child {
  margin-top: 0;
}

.tab-panel ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tab-panel ul li {
  font-size: 14px;
  color: var(--text);
  padding-left: 16px;
  position: relative;
  line-height: 1.6;
}

.tab-panel ul li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 700;
}

.tab-panel a {
  color: var(--blue);
  text-decoration: none;
  transition: color var(--transition);
}

.tab-panel a:hover {
  color: var(--green);
  text-decoration: underline;
}

/* ============================================================
   PROJECTS GRID
   ============================================================ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  padding-top: 4px;
}

.project-card {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.project-card:hover {
  border-color: rgba(0, 206, 103, 0.45);
  box-shadow: 0 0 18px rgba(0, 206, 103, 0.08);
}

.project-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.project-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--magenta);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.85;
}

.project-card h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: -0.01em;
}

.project-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.project-tech span {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--blue);
  background: rgba(95, 160, 254, 0.1);
  border: 1px solid rgba(95, 160, 254, 0.2);
  border-radius: 3px;
  padding: 2px 7px;
}

.project-link {
  display: inline-block;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--green);
  text-decoration: none;
  border: 1px solid rgba(0, 206, 103, 0.3);
  border-radius: 3px;
  padding: 4px 10px;
  transition: all var(--transition);
  align-self: flex-start;
}

.project-link:hover {
  background: rgba(0, 206, 103, 0.1);
  border-color: var(--green);
  letter-spacing: 0.02em;
}

/* ============================================================
   PUBLICATIONS LIST
   ============================================================ */
.pub-list {
  display: flex;
  flex-direction: column;
  gap: 14px !important;
}

.pub-list li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 0 !important;
}

.pub-list li::before {
  display: none !important;
}

.pub-title {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
}

.pub-link {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--green) !important;
  transition: letter-spacing var(--transition) !important;
}

.pub-link:hover {
  letter-spacing: 0.03em;
  text-decoration: none !important;
}

/* ============================================================
   EXPERIENCE LIST
   ============================================================ */
.exp-list {
  display: flex;
  flex-direction: column;
  gap: 0 !important;
}

.exp-list li {
  padding: 14px 0 14px 16px !important;
  border-bottom: 1px solid rgba(245, 68, 252, 0.1);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.exp-list li:last-child {
  border-bottom: none;
}

.exp-company {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.exp-period {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--green);
}

.exp-stack {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--blue);
  margin-top: 2px;
}

/* ============================================================
   CONTACT FORM
   ============================================================ */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--magenta);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 10px 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: rgba(0, 206, 103, 0.5);
  box-shadow: 0 0 10px rgba(0, 206, 103, 0.12);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

#send-button {
  background: transparent;
  border: 1px solid rgba(245, 68, 252, 0.5);
  border-radius: var(--radius);
  color: var(--magenta);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 28px;
  cursor: pointer;
  transition: all var(--transition);
}

#send-button:hover {
  background: rgba(245, 68, 252, 0.1);
  border-color: var(--magenta);
  box-shadow: 0 0 14px rgba(245, 68, 252, 0.2);
}

/* ============================================================
   MODAL
   ============================================================ */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 1000;
  padding: 24px;
  overflow-y: auto;
}

.modal[style*="display: block"],
.modal[style*="display:block"],
.modal.open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 420px;
  width: 90%;
  text-align: center;
}

.modal-content p {
  color: var(--text);
  font-size: 15px;
  margin-bottom: 20px;
}

#modal-button {
  background: transparent;
  border: 1px solid rgba(0, 206, 103, 0.5);
  border-radius: var(--radius);
  color: var(--green);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 24px;
  cursor: pointer;
  transition: all var(--transition);
}

#modal-button:hover {
  background: rgba(0, 206, 103, 0.1);
  border-color: var(--green);
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  text-align: center;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

footer p {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================================
   RESPONSIVE — mobile first adjustments
   ============================================================ */
@media (max-width: 600px) {
  .site-main {
    padding: 32px 16px 24px;
  }

  .tabs-wrapper {
    padding: 20px 16px;
  }

  .tabs-nav {
    gap: 4px;
  }

  .tab {
    font-size: 12px;
    padding: 8px 12px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2.2rem;
  }

  .header-inner {
    gap: 12px;
  }

  .social-links a svg {
    width: 26px;
    height: 26px;
  }
}

@media (max-width: 400px) {
  .tab {
    font-size: 11px;
    padding: 7px 9px;
  }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
