/* =========================
        TOKENS
      ========================= */
:root {
  /* Brand */
  --primary: #14b8a6;
  --primary-700: #0d9488;
  --tint: #e6fffb;

  /* Neutrals */
  --bg: #ffffff;
  --section: #f5f7f9; /* gris frío (no beige) */
  --card: #ffffff;

  --text: #0f172a;
  --muted: #475569;

  --border: #e2e8f0;

  --shadow-sm: 0 10px 25px rgba(15, 23, 42, 0.06);
  --shadow: 0 14px 40px rgba(15, 23, 42, 0.08);

  --radius: 16px;
  --radius-lg: 22px;

  --max: 1100px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t: all 0.28s var(--ease);

  /* RGB for glass header */
  --bg-rgb: 255, 255, 255;
}

/* Dark mode tokens */
.dark-mode {
  --bg: #0b1220;
  --section: #0f172a;
  --card: #111b2e;

  --text: #e2e8f0;
  --muted: #94a3b8;

  --border: rgba(148, 163, 184, 0.14);

  --shadow-sm: 0 10px 25px rgba(0, 0, 0, 0.25);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);

  --bg-rgb: 11, 18, 32;

  --primary: #14b8a6;
  --primary-700: #2dd4bf;
  --tint: rgba(20, 184, 166, 0.12);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  transition: var(--t);
}

h1,
h2,
h3,
h4,
h5 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
  letter-spacing: -0.02em;
}

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

.container {
  width: 92%;
  max-width: var(--max);
  margin: 0 auto;
}

section {
  padding: 92px 0;
}

/* =========================
        THEME TOGGLE
      ========================= */
.theme-toggle {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 1000;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 60px;
  height: 34px;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 0 6px;
  box-shadow: var(--shadow-sm);
  transition: var(--t);
}

.theme-toggle:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.toggle-circle {
  width: 24px;
  height: 24px;
  background: var(--primary);
  border-radius: 50%;
  transition: transform 0.3s var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 12px;
}

.dark-mode .toggle-circle {
  transform: translateX(26px);
}

/* =========================
        HEADER / NAV
      ========================= */
header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 999;
  background: rgba(var(--bg-rgb), 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: var(--t);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0;
}

.logo {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}

.logo-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--primary);
  display: inline-block;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 28px;
}

.nav-links a {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--t);
  position: relative;
  padding: 6px 2px;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.25s var(--ease);
  border-radius: 2px;
}

.nav-links a:hover::after {
  width: 100%;
}

/* =========================
        HERO (con foto) - Ajustado
      ========================= */
.hero {
  padding-top: 140px;
  min-height: 92vh;
  display: flex;
  align-items: center;
  position: relative;
}

/* Glow más sutil */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(500px 280px at 70% 20%, rgba(20, 184, 166, 0.08), transparent 60%);
  pointer-events: none;
  z-index: -1;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 60px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.4rem, 4.3vw, 3.6rem);
  margin-bottom: 14px;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 18px;
}

.accent-line {
  width: 74px;
  height: 3px;
  background: var(--primary);
  margin: 22px 0 26px;
  border-radius: 3px;
}

.hero-description {
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: 34px;
  max-width: 58ch;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.98rem;
  transition: var(--t);
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(20, 184, 166, 0.18);
}

.btn-primary:hover {
  background: var(--primary-700);
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(20, 184, 166, 0.24);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: rgba(20, 184, 166, 0.45);
  background: rgba(20, 184, 166, 0.06);
  transform: translateY(-2px);
}

.hero-photo {
  position: relative;
}

.photo-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transform: translateY(0);
  transition: var(--t);
}

.photo-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.photo {
  width: 100%;
  display: block;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.1), rgba(15, 23, 42, 0.05));
}

.photo-caption {
  padding: 14px 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

/* =========================
        SECTION TITLES
      ========================= */
.section-title {
  font-size: clamp(1.9rem, 3.2vw, 2.5rem);
  text-align: center;
  margin-bottom: 12px;
}

.section-subtitle {
  text-align: center;
  color: var(--muted);
  max-width: 72ch;
  margin: 0 auto 56px;
  font-size: 1.05rem;
}

/* =========================
        SOBRE MÍ
      ========================= */
.about-section {
  background: var(--section);
}

.about-content {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: start;
}

.about-text h3 {
  font-size: 2rem;
  margin-bottom: 24px;
  color: var(--text);
}

.about-text p {
  color: var(--muted);
  margin-bottom: 20px;
  font-size: 1.05rem;
  line-height: 1.8;
}

.highlight {
  color: var(--primary-700);
  font-weight: 700;
}

/* ===== Enfoque card ===== */
.focus-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 26px 28px;
  box-shadow: var(--shadow-sm);
  transition: var(--t);
}

.focus-card:hover {
  box-shadow: var(--shadow);
}

.focus-card h3 {
  font-size: 1.15rem;
  color: var(--text);
  margin-bottom: 24px;
  padding-bottom: 24px;
  position: relative;
}

.focus-card h3::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--border);
}

.focus-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.focus-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.35;
}

.focus-list li i {
  color: var(--primary);
  font-size: 1rem;
  opacity: 0.9;
}

/* =========================
        HABILIDADES TÉCNICAS
      ========================= */
#habilidades {
  background: var(--bg);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-top: 50px;
}

.skill-category {
  background: var(--card);
  padding: 35px 30px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: var(--t);
  box-shadow: var(--shadow-sm);
}

.skill-category:hover {
  border-color: var(--primary);
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.skill-category h4 {
  font-size: 1.4rem;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
}

.skill-category h4 i {
  color: var(--primary);
}

.skill-list {
  list-style: none;
}

.skill-list li {
  margin-bottom: 15px;
  color: var(--muted);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 1rem;
  line-height: 1.6;
}

.skill-list li i {
  color: var(--primary);
  font-size: 0.8rem;
  margin-top: 6px;
}

/* =========================
        PROJECTS - Con Miniaturas
      ========================= */
.projects-section {
  background: var(--bg);
}

.projects-header {
  text-align: center;
  margin-bottom: 50px;
}

.projects-header h2 {
  font-size: 2rem;
  margin-bottom: 10px;
  font-weight: 700;
  color: var(--text);
}

.projects-header p {
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto;
  font-size: 1rem;
  line-height: 1.6;
}

/* Grid 2x2 con miniaturas */
.projects-grid-2x2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
  max-width: 1000px;
  margin: 0 auto;
}

/* Card con miniatura */
.project-with-thumb {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: var(--t);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-with-thumb:hover {
  border-color: rgba(20, 184, 166, 0.4);
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
}

/* Miniatura del proyecto */
.project-thumbnail {
  height: 200px;
  width: 100%;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.project-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.project-with-thumb:hover .project-thumbnail img {
  transform: scale(1.05);
}

/* Placeholder si no hay imagen */
.thumbnail-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.08), rgba(15, 23, 42, 0.03));
}

.thumbnail-placeholder i {
  font-size: 2.5rem;
  color: var(--primary);
  opacity: 0.8;
}

/* Contenido del proyecto */
.project-content-compact {
  padding: 24px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

/* Encabezado con badge a la derecha */
.project-header-with-badge {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
  gap: 12px;
}

.project-title-with-badge h3 {
  font-size: 1.3rem;
  color: var(--text);
  font-weight: 700;
  margin: 0;
}

.project-badge-right {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-real {
  background: rgba(20, 184, 166, 0.15);
  color: var(--primary);
  border: 1px solid rgba(20, 184, 166, 0.3);
}

.badge-practice {
  background: rgba(148, 163, 184, 0.1);
  color: var(--muted);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.badge-freelance {
  background: rgba(147, 51, 234, 0.1);
  color: rgb(147, 51, 234);
  border: 1px solid rgba(147, 51, 234, 0.2);
}

.badge-learning {
  background: rgba(234, 88, 12, 0.1);
  color: rgb(234, 88, 12);
  border: 1px solid rgba(234, 88, 12, 0.2);
}

/* Descripción compacta */
.project-description-compact {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 18px;
  font-size: 0.95rem;
  flex-grow: 1;
}

/* Tech stack compacto */
.tech-stack-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.tech-tag-compact {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(20, 184, 166, 0.15);
  color: var(--primary-700);
  background: rgba(20, 184, 166, 0.05);
}

/* Botones más pequeños */
.project-actions-compact {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-xsmall {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  transition: var(--t);
  flex: 1;
  justify-content: center;
}

.btn-demo-xsmall {
  background: var(--primary);
  color: white;
  border: 1px solid transparent;
}

.btn-demo-xsmall:hover {
  background: var(--primary-700);
  transform: translateY(-1px);
}

.btn-code-xsmall {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-code-xsmall:hover {
  border-color: var(--primary);
  background: rgba(20, 184, 166, 0.05);
}

/* =========================
        CONTACT / CTA (Footer oscuro)
      ========================= */
.cta {
  background: #0b1220;
  color: #e2e8f0;
  border-top: 1px solid rgba(226, 232, 240, 0.08);
}

.dark-mode .cta {
  background: #090e1a;
}

.cta-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 40px;
  align-items: center;
}

.cta h3 {
  color: #ffffff;
  font-size: 2rem;
  margin-bottom: 12px;
}

.cta p {
  color: rgba(226, 232, 240, 0.8);
  max-width: 60ch;
  font-size: 1.05rem;
}

.cta .btn-primary {
  box-shadow: 0 10px 22px rgba(20, 184, 166, 0.25);
}

.cta .btn-secondary {
  color: #e2e8f0;
  border-color: rgba(226, 232, 240, 0.25);
}

.cta .btn-secondary:hover {
  border-color: rgba(20, 184, 166, 0.6);
  background: rgba(20, 184, 166, 0.12);
  color: #ffffff;
}

.social-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.social-link {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(226, 232, 240, 0.22);
  color: rgba(226, 232, 240, 0.9);
  transition: var(--t);
}

.social-link:hover {
  border-color: rgba(20, 184, 166, 0.7);
  color: #ffffff;
  transform: translateY(-2px);
  background: rgba(20, 184, 166, 0.12);
}

/* Footer final oscuro */
.footer-dark {
  background: #090e1a;
  color: rgba(226, 232, 240, 0.6);
  text-align: center;
  border-top: 1px solid rgba(226, 232, 240, 0.08);
  font-size: 0.9rem;
}

.dark-mode .footer-dark {
  background: #080c16;
}

/* =========================
        RESPONSIVE
      ========================= */
@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .about-content {
    grid-template-columns: 1fr;
  }
  .cta-grid {
    grid-template-columns: 1fr;
  }
  .social-links {
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  section {
    padding: 72px 0;
  }
  nav {
    padding: 16px 0;
  }
  .nav-links {
    display: none;
  }
  .hero {
    padding-top: 120px;
  }
  .theme-toggle {
    top: 16px;
    right: 16px;
  }

  .projects-grid-2x2 {
    grid-template-columns: 1fr;
    gap: 24px;
    max-width: 500px;
  }

  .project-content-compact {
    padding: 20px;
  }

  .project-thumbnail {
    height: 160px;
  }

  .about-content {
    gap: 24px;
  }

  .focus-card {
    padding: 22px;
  }
}

@media (max-width: 480px) {
  .projects-section {
    padding: 60px 0;
  }

  .projects-header h2 {
    font-size: 1.8rem;
  }

  .projects-header p {
    font-size: 0.95rem;
  }

  .project-title-with-badge h3 {
    font-size: 1.2rem;
  }

  .project-description-compact {
    font-size: 0.9rem;
  }

  .project-header-with-badge {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .project-badge-right {
    align-self: flex-start;
  }

  .btn-xsmall {
    padding: 7px 14px;
    font-size: 0.8rem;
  }
}
