:root {
  --bg: #0d111b;
  --surface: #131926;
  --text: #f2f4f8;
  --muted: #a5adbb;
  --primary: #ff7f50;
  --primary-strong: #f26b3f;
  --border: #20283a;
  --max-width: 1120px;
  --radius: 14px;
}

:root.light {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --primary: #ff7f50;
  --primary-strong: #f26b3f;
  --border: #dbe2ee;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

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

.container {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
}

.section {
  padding: 4.5rem 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  min-height: 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-right {
  display: flex;
  align-items: center;
}

.nav {
  display: flex;
  gap: 1rem;
}

.nav a {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

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

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1rem;
}

.language-toggle {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  min-width: 2.2rem;
  height: 2.2rem;
  padding: 0 0.55rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 800;
}

.language-toggle:hover,
.theme-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.hero {
  min-height: calc(100vh - 72px);
  display: grid;
  align-items: center;
}

.hero-grid {
  display: grid;
  grid-template-columns: 72px 1.15fr 1fr;
  align-items: center;
  gap: 2rem;
}

.hero-social {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.hero-social a {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--text);
}

.hero-social a:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.hero-social svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.availability {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.availability-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: #35c759;
  box-shadow: 0 0 0 0 rgba(53, 199, 89, 0.65);
  animation: availability-pulse 1.8s infinite;
}

@keyframes availability-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(53, 199, 89, 0.65);
  }
  70% {
    box-shadow: 0 0 0 0.55rem rgba(53, 199, 89, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(53, 199, 89, 0);
  }
}

.eyebrow {
  position: relative;
  display: inline-block;
  margin: 0 0 1.5rem 0.75rem;
  padding: 0.65rem 1rem;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--primary);
  border-radius: 4px 4px 4px 0;
  box-shadow: 8px 8px 0 color-mix(in srgb, var(--primary) 35%, transparent);
}

.eyebrow::after {
  content: "";
  position: absolute;
  bottom: -9px;
  left: 0;
  border-top: 9px solid var(--primary-strong);
  border-right: 9px solid transparent;
}

.hero h1 {
  margin: 0;
  line-height: 1.08;
  font-size: clamp(2.2rem, 5vw, 4rem);
}

.hero h2 {
  margin: 0.7rem 0 1rem;
  color: var(--text);
  font-weight: 700;
  font-size: clamp(1rem, 2.2vw, 1.4rem);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.hero p {
  max-width: 52ch;
  color: var(--text);
  margin-bottom: 1.8rem;
}

.talk-btn {
  width: 108px;
  height: 108px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  text-align: center;
  font-weight: 700;
  line-height: 1.1;
  border: 5px solid color-mix(in srgb, var(--primary) 65%, #fff);
}

.talk-btn:hover {
  background: var(--primary-strong);
}

.hero-image-wrap {
  justify-self: center;
}

.hero-image {
  width: min(100%, 520px);
  max-height: 70vh;
  object-fit: contain;
}

h3 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.section-subtitle {
  color: var(--muted);
  margin: 0 0 1.4rem;
}

.skills-grid,
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.card,
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.project-card .project-stack {
  font-size: 0.9em;
  font-weight: 600;
  color: #669bbc;
  margin-top: 8px;
}

.cv-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 2rem;
  align-items: center;
}

.hero-image,
.cv-photo {
  background: transparent;
  border: 0;
  box-shadow: none;
}
.btn {
  display: inline-block;
  padding: 0.72rem 1.05rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 700;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-strong);
}

.project-links {
  display: flex;
  gap: 1rem;
  margin-top: 0.75rem;
}

.project-links a {
  color: var(--primary);
  font-weight: 700;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding-bottom: 5rem;
}

.site-footer p {
  color: var(--muted);
}

@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .hero-social {
    flex-direction: row;
    justify-content: flex-start;
  }

  .hero-image {
    width: min(100%, 360px);
    max-height: none;
  }

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

@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    justify-content: center;
    gap: 0.7rem;
    padding: 0.8rem 0;
  }

  .header-right,
  .nav {
    flex-wrap: wrap;
  }

  .header-actions {
    gap: 0.5rem;
  }

  .section {
    padding: 3.4rem 0;
  }

  .talk-btn {
    width: 92px;
    height: 92px;
    font-size: 0.95rem;
  }
}
.menu-toggle {
  display: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
}

/* móvil */
@media (max-width: 640px) {
  .site-header {
    position: static; /* quita sticky en móvil */
  }

  .header-inner {
    min-height: 64px;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .menu-toggle {
    display: inline-grid;
    place-items: center;
  }

  .header-right {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    width: 100%;
    padding: 1rem;
    background: var(--bg);
    border-top: 1px solid var(--border);
    z-index: 110;
    isolation: isolate;
  }

  .header-right.is-open {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    align-items: flex-start;
  }

  .nav {
    width: 100%;
    flex-direction: column;
    gap: 0.7rem;
  }
}
