:root {
  --bg-main: #0b0f14;
  --bg-card: #111827;
  --bg-soft: #1f2937;

  --text-main: #f9fafb;
  --text-muted: #9ca3af;

  --accent: #38bdf8;
  --accent-hover: #0ea5e9;

  --border: #273449;
  --success: #22c55e;

  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);

  --font-main: "Inter", sans-serif;
  --font-code: "JetBrains Mono", monospace;
}

body.light-theme {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-soft: #e2e8f0;

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

  --accent: #2563eb;
  --accent-hover: #1d4ed8;

  --border: #cbd5e1;
  --shadow: 0 24px 80px rgba(15, 23, 42, 0.12);
}

/* RESET BÁSICO */

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.14), transparent 34rem),
    var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-main);
  line-height: 1.6;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

body.light-theme {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 34rem),
    var(--bg-main);
}

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

ul {
  list-style: none;
}

button,
a {
  font: inherit;
}

/* MATERIAL SYMBOLS */

.material-symbols-rounded {
  font-variation-settings:
    "FILL" 0,
    "wght" 500,
    "GRAD" 0,
    "opsz" 24;
}

/* HEADER */

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 15, 20, 0.82);
  backdrop-filter: blur(18px);
}

body.light-theme .header {
  background: rgba(248, 250, 252, 0.82);
}

.nav {
  width: min(1120px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-card);
  color: var(--accent);
  font-family: var(--font-code);
  font-weight: 700;
  box-shadow: var(--shadow);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.nav-links a {
  transition: color 0.2s ease;
}

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

.nav-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;

  min-height: 40px;
  padding: 0 12px;

  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);

  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 700;

  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    background-color 0.2s ease;
}

.social-link:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  color: var(--text-main);
  background: var(--bg-main);
}

.social-link i {
  color: var(--accent);
  font-size: 1.05rem;
  line-height: 1;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 44px;
  height: 44px;
  padding: 0;

  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-main);

  cursor: pointer;
  line-height: 1;

  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease;
}

.icon-button:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.icon-button .material-symbols-rounded {
  display: block;
  font-size: 22px;
  line-height: 1;
}

#languageToggle {
  width: 48px;
  font-weight: 700;
}

/* SECCIONES */

.section {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 96px 0;
}

.section-header {
  max-width: 760px;
  margin-bottom: 32px;
}

.eyebrow,
.card-label,
.project-type {
  color: var(--accent);
  font-family: var(--font-code);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section h2 {
  margin-top: 12px;
  color: var(--text-main);
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.1;
}

.section-text {
  max-width: 820px;
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* HERO */

.hero {
  min-height: calc(100vh - 72px);
  display: grid;
  grid-template-columns: 1.18fr 0.82fr;
  align-items: center;
  gap: 48px;
}

.hero h1 {
  margin-top: 18px;
  color: var(--text-main);
  font-size: clamp(3rem, 8vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.hero h2 {
  margin-top: 22px;
  color: var(--text-main);
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.25;
}

.hero-description {
  max-width: 720px;
  margin-top: 24px;
  color: var(--text-muted);
  font-size: 1.08rem;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  min-height: 48px;
  padding: 0 20px;

  border-radius: 999px;
  border: 1px solid transparent;

  font-weight: 700;

  transition:
    transform 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-icon {
  font-size: 20px;
  line-height: 1;
}

.button.primary {
  background: var(--accent);
  color: #020617;
}

.button.primary:hover {
  background: var(--accent-hover);
}

.button.secondary {
  border-color: var(--border);
  background: var(--bg-card);
  color: var(--text-main);
}

.button.secondary:hover {
  border-color: var(--accent);
}

.hero-card {
  border: 1px solid var(--border);
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    var(--bg-card);
  padding: 28px;
  box-shadow: var(--shadow);
}

.focus-list {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.focus-item {
  display: flex;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--bg-main);
}

.focus-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 16px;
  background: var(--bg-soft);
  color: var(--accent);
  font-size: 24px;
  line-height: 1;
}

.focus-item h3 {
  color: var(--text-main);
  font-size: 1rem;
}

.focus-item p {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* PROYECTOS */

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

.project-card {
  display: flex;
  flex-direction: column;
  min-height: 360px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--bg-card);
  box-shadow: var(--shadow);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
}

.project-card h3 {
  margin-top: 12px;
  color: var(--text-main);
  font-size: 1.35rem;
  line-height: 1.2;
}

.project-card p:not(.project-type) {
  margin-top: 16px;
  color: var(--text-muted);
}

.project-carousel {
  position: relative;
  width: 100%;
  height: 190px;
  margin-bottom: 18px;

  border: 1px solid var(--border);
  border-radius: 20px;

  overflow: hidden;
  background: var(--bg-main);
}

.project-image {
  display: none;
  width: 100%;
  height: 100%;

  object-fit: cover;
  object-position: top;
}

.project-image.active {
  display: block;
}

.carousel-button {
  position: absolute;
  top: 50%;
  z-index: 2;

  display: grid;
  place-items: center;

  width: 34px;
  height: 34px;

  border: 1px solid var(--border);
  border-radius: 999px;

  background: rgba(11, 15, 20, 0.72);
  color: var(--text-main);

  cursor: pointer;
  transform: translateY(-50%);

  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.carousel-button:hover {
  border-color: var(--accent);
  background: rgba(11, 15, 20, 0.9);
}

.carousel-button.previous {
  left: 10px;
}

.carousel-button.next {
  right: 10px;
}

.carousel-button .material-symbols-rounded {
  font-size: 22px;
  line-height: 1;
}

.carousel-dots {
  position: absolute;
  left: 50%;
  bottom: 10px;
  z-index: 2;

  display: flex;
  gap: 6px;

  transform: translateX(-50%);
}

.carousel-dot {
  width: 8px;
  height: 8px;

  border: 0;
  border-radius: 999px;

  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;

  transition:
    width 0.2s ease,
    background-color 0.2s ease;
}

.carousel-dot.active {
  width: 18px;
  background: var(--accent);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 24px;
}

.tag-list li,
.skills-list li {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-main);
  color: var(--text-muted);
  font-family: var(--font-code);
  font-size: 0.78rem;
}

.tag-list li {
  padding: 6px 10px;
}

.project-links {
  display: flex;
  gap: 14px;
  margin-top: 22px;
}

.project-links a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  font-weight: 700;
}

.project-links a:hover {
  color: var(--accent-hover);
}

.link-icon {
  font-size: 18px;
  line-height: 1;
}

/* OTHER PROJECTS */

.other-projects-list {
  display: grid;
  gap: 16px;
}

.other-project-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: start;

  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--bg-card);
  padding: 22px;
  box-shadow: var(--shadow);

  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
}

.other-project-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.other-project-content h3 {
  margin-top: 8px;
  color: var(--text-main);
  font-size: 1.35rem;
}

.other-project-content p:not(.project-type) {
  max-width: 760px;
  margin-top: 12px;
  color: var(--text-muted);
}

.tag-list.compact {
  margin-top: 16px;
  padding-top: 0;
}

.project-preview {
  min-width: 180px;
}

.project-preview summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  min-height: 42px;
  padding: 0 14px;

  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-main);

  color: var(--text-main);
  font-weight: 700;

  cursor: pointer;
  list-style: none;

  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.project-preview summary::-webkit-details-marker {
  display: none;
}

.project-preview summary:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  color: var(--accent);
}

.project-preview summary .material-symbols-rounded {
  font-size: 20px;
  line-height: 1;
}

.other-project-image {
  display: block;

  width: 100%;
  max-width: 360px;
  height: 190px;

  margin-top: 16px;

  border: 1px solid var(--border);
  border-radius: 20px;

  object-fit: cover;
  object-position: top;

  background: var(--bg-main);
}

/* SKILLS */

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.skills-list li {
  padding: 10px 14px;
}

/* EDUCATION */

.education-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.education-card {
  display: flex;
  flex-direction: column;

  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--bg-card);
  padding: 24px;
  box-shadow: var(--shadow);

  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
}

.education-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.education-card h3 {
  margin-top: 10px;
  color: var(--text-main);
  font-size: 1.25rem;
  line-height: 1.2;
}

.education-card p:not(.project-type) {
  margin-top: 12px;
  color: var(--text-muted);
}

.education-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;

  margin-top: auto;
  padding-top: 22px;
}

.education-status {
  display: inline-flex;
  align-items: center;

  min-height: 34px;
  padding: 0 12px;

  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-main);

  color: var(--accent);
  font-family: var(--font-code);
  font-size: 0.78rem;
  font-weight: 700;
}

.certificate-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;

  min-height: 34px;
  padding: 0 12px;

  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-main);

  color: var(--text-main);
  font-size: 0.86rem;
  font-weight: 700;

  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    background-color 0.2s ease;
}

.certificate-link:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  color: var(--accent);
}

.certificate-link .material-symbols-rounded {
  font-size: 18px;
  line-height: 1;
}

/* CONTACTO */

.contact-section {
  padding-bottom: 72px;
}

.contact-card {
  border: 1px solid var(--border);
  border-radius: 34px;
  background: var(--bg-card);
  padding: clamp(28px, 6vw, 54px);
  box-shadow: var(--shadow);
}

.contact-card h2 {
  margin-top: 12px;
  color: var(--text-main);
  font-size: clamp(2.2rem, 6vw, 4rem);
  line-height: 1;
}

.contact-card p:not(.eyebrow) {
  max-width: 760px;
  margin-top: 20px;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.contact-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  min-height: 44px;
  padding: 0 16px;

  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-main);

  color: var(--text-main);
  font-weight: 700;

  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    background-color 0.2s ease;
}

.contact-links a:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-card);
}

.contact-links i,
.contact-links .material-symbols-rounded {
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
}

/* FOOTER */

.footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* PERSONALITY EFFECTS */

.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;

  width: 360px;
  height: 360px;

  border-radius: 999px;
  background: radial-gradient(
    circle,
    rgba(56, 189, 248, 0.08),
    transparent 65%
  );

  pointer-events: none;
  transform: translate(-50%, -50%);
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

body.light-theme .cursor-glow {
  background: radial-gradient(
    circle,
    rgba(37, 99, 235, 0.12),
    transparent 65%
  );
}

.hero-content,
.hero-card,
.project-card,
.other-project-card,
.education-card,
.contact-card,
.skills-list li {
  animation: fadeUp 0.7s ease both;
}

.hero-card {
  animation-delay: 0.12s;
}

.project-card:nth-child(1) {
  animation-delay: 0.05s;
}

.project-card:nth-child(2) {
  animation-delay: 0.12s;
}

.project-card:nth-child(3) {
  animation-delay: 0.19s;
}

.education-card:nth-child(1) {
  animation-delay: 0.05s;
}

.education-card:nth-child(2) {
  animation-delay: 0.1s;
}

.education-card:nth-child(3) {
  animation-delay: 0.15s;
}

.education-card:nth-child(4) {
  animation-delay: 0.2s;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.project-card,
.other-project-card,
.education-card,
.focus-item,
.contact-links a,
.button {
  position: relative;
  overflow: hidden;
}

.project-card::before,
.other-project-card::before,
.education-card::before,
.focus-item::before {
  content: "";
  position: absolute;
  inset: 0;

  background: linear-gradient(
    120deg,
    transparent,
    rgba(56, 189, 248, 0.08),
    transparent
  );

  opacity: 0;
  transform: translateX(-100%);
  transition:
    opacity 0.3s ease,
    transform 0.55s ease;

  pointer-events: none;
}

.project-card:hover::before,
.other-project-card:hover::before,
.education-card:hover::before,
.focus-item:hover::before {
  opacity: 1;
  transform: translateX(100%);
}

.logo {
  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.logo:hover {
  transform: rotate(-4deg) scale(1.04);
  border-color: var(--accent);
  box-shadow: 0 0 32px rgba(56, 189, 248, 0.22);
}

/* CV DROPDOWN */

.cv-dropdown {
  position: relative;
}

.cv-button {
  width: 100%;
}

.cv-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 10;

  min-width: 220px;
  padding: 8px;

  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--bg-card);
  box-shadow: var(--shadow);

  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);

  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.cv-menu.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.cv-menu a {
  display: flex;
  align-items: center;
  gap: 8px;

  padding: 10px 12px;
  border-radius: 12px;

  color: var(--text-main);
  font-weight: 700;

  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.cv-menu a:hover {
  background: var(--bg-main);
  color: var(--accent);
}

.cv-menu .material-symbols-rounded {
  font-size: 20px;
  line-height: 1;
}

/* RESPONSIVE */

@media (max-width: 1080px) {
  .nav {
    gap: 14px;
  }

  .nav-links {
    gap: 14px;
    font-size: 0.9rem;
  }

  .social-link span {
    display: none;
  }

  .social-link {
    width: 44px;
    height: 44px;
    padding: 0;
  }

  .social-link i {
    font-size: 1.05rem;
  }
}

@media (max-width: 900px) {
  .cursor-glow {
    display: none;
  }

  .nav-links {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 64px;
  }

  .hero-card {
    max-width: 680px;
  }

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

  .project-carousel {
    height: 220px;
  }

  .other-project-card {
    grid-template-columns: 1fr;
  }

  .project-preview {
    min-width: 0;
  }

  .project-preview summary {
    width: 100%;
  }

  .other-project-image {
    max-width: 100%;
    height: 190px;
  }
}

@media (max-width: 520px) {
  .nav {
    width: min(100% - 20px, 1120px);
  }

  .nav-actions {
    gap: 6px;
  }

  .social-link {
    width: 40px;
    height: 40px;
  }

  .social-link i {
    font-size: 1rem;
  }

  .icon-button {
    width: 40px;
    height: 40px;
  }

  #languageToggle {
    width: 44px;
  }

  .section {
    width: min(100% - 20px, 1120px);
    padding: 72px 0;
  }

  .hero h1 {
    font-size: 3.1rem;
  }

  .hero-buttons,
  .contact-links {
    flex-direction: column;
  }

  .button,
  .contact-links a {
    width: 100%;
  }

  .hero-card,
  .project-card,
  .contact-card,
  .other-project-card,
  .education-card {
    border-radius: 24px;
  }

  .project-carousel {
    height: 190px;
  }

  .cv-dropdown,
  .cv-button,
  .cv-menu {
    width: 100%;
  }

  .education-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .education-status,
  .certificate-link {
    justify-content: center;
    width: 100%;
  }
}