/* ─── Reset & tokens ──────────────────────────────────────────── */
:root {
  --bg: #0a0c0e;
  --bg-alt: #0f1214;
  --surface: #141820;
  --surface-2: #1a2030;
  --border: #1e2530;
  --border-2: #252e3d;
  --text: #e2e8f0;
  --text-muted: #7a8fa6;
  --text-faint: #3d4f63;
  --accent: #4ade80;
  --accent-dim: #166534;
  --accent-glow: rgba(74, 222, 128, 0.12);

  --font-sans: ui-sans-serif, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ─── Layout ──────────────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 6rem 0;
}

.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* ─── Nav ─────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 12, 14, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.nav.scrolled {
  border-bottom-color: var(--border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-logo {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
  text-decoration: none;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 0.25rem;
  margin-left: auto;
}

.nav-link {
  color: var(--text-muted);
  font-size: 0.875rem;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  text-decoration: none;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
}

.nav-link.active {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-muted);
  border-radius: 2px;
}

/* ─── Language toggle (segmented EN | ES) ─────────────────────── */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 999px;
  padding: 2px;
  margin-left: 1rem;
}

.lang-toggle-btn {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1.4;
  transition: background 0.15s, color 0.15s;
}

.lang-toggle-btn:hover {
  color: var(--text);
}

.lang-toggle-btn.active {
  background: var(--accent);
  color: #0a0c0e;
  font-weight: 600;
}

@media (max-width: 768px) {
  .lang-toggle {
    margin-left: 0;
    margin-top: 0.75rem;
  }
}

/* ─── Section headers ─────────────────────────────────────────── */
.section-header {
  margin-bottom: 3.5rem;
  max-width: 600px;
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

/* ─── Hero ────────────────────────────────────────────────────── */
.hero-section {
  padding-top: 9rem;
  padding-bottom: 0;
}

.hero {
  /* full-width: el título y el grid ocupan todo el container */
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: clamp(2.2rem, 6vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 2rem;
}

.accent {
  color: var(--accent);
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 2.25rem;
  max-width: 540px;
}

.hero-cta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ─── Hero two-column layout ──────────────────────────────────── */
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 3rem;
  align-items: start;
}

.hero-text {
  min-width: 0;
}

.hero-visual {
  display: flex;
  justify-content: center;
}

.agent-card {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  font-family: var(--font-mono);
}

.agent-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1rem;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.agent-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--border-2);
}

.agent-dot.red { background: #ff5f56; }
.agent-dot.amber { background: #ffbd2e; }
.agent-dot.green { background: #27c93f; }

.agent-bar-title {
  margin-left: 0.5rem;
  font-size: 0.72rem;
  color: var(--text-faint);
  letter-spacing: 0.04em;
}

.agent-body {
  padding: 1.25rem 1.25rem 1.5rem;
  font-size: 0.82rem;
  line-height: 1.85;
  color: var(--text-muted);
}

.agent-line { display: block; }
.agent-prompt { color: var(--accent); }
.agent-ok { color: var(--accent); }
.agent-arrow { color: var(--text-muted); }
.agent-dim { color: var(--text-faint); }

.agent-cursor {
  display: inline-block;
  width: 8px;
  height: 1em;
  background: var(--accent);
  vertical-align: text-bottom;
  margin-left: 3px;
  animation: agent-blink 1.1s steps(2, start) infinite;
}

@keyframes agent-blink {
  to { visibility: hidden; }
}

.agent-foot {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  text-align: center;
}

.agent-foot .stat-number {
  font-size: 1.05rem;
  margin-bottom: 0;
}

.agent-foot .stat-label {
  font-size: 0.6rem;
  letter-spacing: 0.08em;
}

.hero-stats {
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.stat-number {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ─── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, transform 0.1s;
  text-decoration: none;
}

.btn:hover {
  opacity: 0.85;
  transform: translateY(-1px);
  text-decoration: none;
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--accent);
  color: #0a0c0e;
  font-weight: 600;
}

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-2);
}

/* ─── Project cards ───────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, box-shadow 0.2s;
  overflow: hidden;
}

.project-card:hover {
  border-color: var(--border-2);
  box-shadow: var(--shadow-lg);
}

.project-header {
  padding: 1.75rem 1.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.project-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.project-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.project-tagline {
  color: var(--text-muted);
  font-size: 0.925rem;
  line-height: 1.55;
}

.project-body {
  padding: 1.5rem 1.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.project-desc {
  color: var(--text-muted);
  font-size: 0.925rem;
  line-height: 1.65;
}

.project-highlights {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.project-highlights li {
  position: relative;
  padding-left: 1.15rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.project-highlights li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.project-highlights strong {
  color: var(--text);
  font-weight: 600;
}

.project-highlights code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  padding: 0.08em 0.3em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  white-space: nowrap;
}

/* ─── Video slider (project card) ─────────────────────────────── */
.video-slider {
  margin-top: 1.25rem;
}

.video-slider-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #000;
}

.video-slider-track {
  display: flex;
  transition: transform 0.35s ease;
}

.video-slide {
  flex: 0 0 100%;
  width: 100%;
}

.video-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}

.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-slide-thumb {
  position: relative;
  display: block;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  border: 0;
  cursor: pointer;
  background-color: #000;
  background-size: cover;
  background-position: center;
}

.video-slide-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.45) 100%);
}

.play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(74, 222, 128, 0.92);
  color: #0a0c0e;
  font-size: 1.4rem;
  line-height: 1;
  text-indent: 4px;
  z-index: 1;
  transition: transform 0.2s ease, background 0.2s ease;
}

.video-slide-thumb:hover .play-icon {
  transform: translate(-50%, -50%) scale(1.08);
  background: var(--accent);
}

.video-slider-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.65rem;
}

.slider-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-2);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.slider-arrow:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.slider-info {
  flex: 0 0 auto;
  min-width: 120px;
  text-align: center;
}

.slider-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.slider-dots {
  display: flex;
  gap: 0.35rem;
}

.slider-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: var(--border-2);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.slider-dot:hover { background: var(--text-faint); }
.slider-dot.active { background: var(--accent); transform: scale(1.25); }

@media (max-width: 480px) {
  .slider-info { display: none; }
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

.tech-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 4px;
  color: var(--text-muted);
}

.project-footer {
  padding: 1.25rem 1.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 1rem;
  align-items: center;
}

.project-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.15s;
}

.project-link:hover {
  opacity: 0.75;
  text-decoration: none;
}

.project-link-ghost {
  color: var(--text-muted);
}

/* ─── About ───────────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.about-text p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 1.1rem;
}

.about-links {
  margin-top: 1.75rem;
  display: flex;
  gap: 0.75rem;
}

/* ─── About highlights ────────────────────────────────────────── */
.about-highlights {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.highlights-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.9rem;
}

.highlights-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem 1.5rem;
}

.highlights-list li {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  font-size: 0.93rem;
  color: var(--text);
  line-height: 1.5;
}

.highlights-list li::before {
  content: "✓";
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.about-skills {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.skills-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.6rem;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* ─── WIP ─────────────────────────────────────────────────────── */
.wip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}

.wip-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.2s;
}

.wip-card:hover {
  border-color: var(--border-2);
}

.wip-card-placeholder {
  opacity: 0.45;
  border-style: dashed;
}

.wip-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  width: fit-content;
}

.wip-status::before {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.wip-status-idea {
  color: var(--text-faint);
}

.wip-status-idea::before {
  background: var(--text-faint);
  animation: none;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

.wip-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.wip-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  flex: 1;
}

/* ─── Footer ──────────────────────────────────────────────────── */
.footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text);
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ─── Responsive ──────────────────────────────────────────────── */
@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .hero-visual {
    display: none;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(10, 12, 14, 0.97);
    flex-direction: column;
    padding: 1rem 1.5rem 1.5rem;
    border-bottom: 1px solid var(--border);
    gap: 0.25rem;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  .hero-section {
    padding-top: 7rem;
    min-height: auto;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .highlights-list {
    grid-template-columns: 1fr;
  }

  .wip-grid {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    gap: 1.75rem;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }

  .section {
    padding: 4rem 0;
  }

  .hero-section {
    padding-bottom: 0;
  }

  .hero-cta {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}