:root {
  --bg: #000000;
  --surface: #161617;
  --surface-2: #1d1d1f;
  --surface-3: #242426;
  --text: #f5f5f7;
  --muted: #a1a1a6;
  --border: rgba(255,255,255,.14);
  --accent: #2997ff;
  --accent-soft: rgba(41,151,255,.16);
  --shadow: 0 34px 90px rgba(0,0,0,.48);
  --radius: 34px;
}

html[data-theme="light"] {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #fbfbfd;
  --surface-3: #f0f0f2;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --border: rgba(0,0,0,.12);
  --accent: #0066cc;
  --accent-soft: rgba(0,102,204,.12);
  --shadow: 0 24px 70px rgba(0,0,0,.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

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

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

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  height: 48px;
  display: flex;
  justify-content: center;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(180%) blur(22px);
}

.nav-inner {
  width: min(1120px, calc(100% - 28px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: .86rem;
}

.brand {
  font-weight: 750;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  color: var(--muted);
}

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

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

.theme-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-weight: 900;
}

.hero {
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 7rem 1.25rem 5rem;
  background:
    linear-gradient(to bottom, rgba(0,0,0,.05), var(--bg) 95%),
    url("../img/header.png") center/cover no-repeat;
}

html[data-theme="light"] .hero {
  background:
    linear-gradient(to bottom, rgba(245,245,247,.16), var(--bg) 95%),
    url("../img/header.png") center/cover no-repeat;
}

.hero-content {
  width: min(1120px, 100%);
}

.hero h1 {
  max-width: 1120px;
  margin: 0 auto;
  font-size: clamp(3.4rem, 9vw, 8.8rem);
  line-height: .9;
  letter-spacing: -.078em;
  text-wrap: balance;
}

.hero h1 span {
  display: block;
  color: var(--accent);
}

.hero-actions {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .75rem 1.1rem;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-weight: 750;
  transition: transform .2s ease, filter .2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

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

section {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 5.8rem 0;
}

.section-head {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 2.5rem;
}

.eyebrow {
  margin: 0 0 .65rem;
  color: var(--accent);
  font-size: .78rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .13em;
}

h2 {
  margin: 0;
  font-size: clamp(2.5rem, 5.5vw, 4.8rem);
  line-height: .98;
  letter-spacing: -.06em;
}

.section-head p {
  color: var(--muted);
  font-size: 1.13rem;
  line-height: 1.58;
}

.profile-grid,
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.services-grid {
  grid-template-columns: repeat(4, 1fr);
}

.profile-card,
.service-card,
.timeline-card,
.project-card,
.cta {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.profile-card,
.service-card {
  min-height: 300px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: transform .25s ease, background .25s ease;
}

.profile-card:hover,
.service-card:hover,
.project-card:hover,
.timeline-card:hover {
  transform: translateY(-5px);
  background: color-mix(in srgb, var(--surface) 86%, var(--accent) 14%);
}

.profile-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: auto;
  border-radius: 18px;
  background: var(--surface-2);
  color: var(--accent);
  font-size: 1.8rem;
  font-weight: 900;
}

.profile-card h3,
.service-card h3,
.timeline-card h3,
.project-card h3 {
  margin: 0 0 .65rem;
  font-size: 1.45rem;
  letter-spacing: -.035em;
}

.profile-card p,
.service-card p,
.timeline-card p,
.project-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.service-card span {
  margin-bottom: auto;
  color: var(--accent);
  font-weight: 850;
}

.timeline {
  position: relative;
  display: grid;
  gap: 1.1rem;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 184px;
  width: 2px;
  background: linear-gradient(var(--accent), transparent);
}

.timeline-entry {
  position: relative;
  display: grid;
  grid-template-columns: 150px 40px 1fr;
  align-items: center;
  gap: 1rem;
}

.timeline-date {
  color: var(--muted);
  font-weight: 800;
  text-align: right;
}

.timeline-marker {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 8px var(--accent-soft);
  z-index: 2;
}

.timeline-card {
  padding: 1.55rem 1.8rem;
  transition: transform .25s ease, background .25s ease;
}

.role {
  margin: -.2rem 0 .55rem !important;
  font-weight: 750;
  color: var(--muted);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
}

.project-card {
  grid-column: span 2;
  min-height: 430px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, background .25s ease;
}

.project-card.featured {
  grid-column: span 3;
}

.project-card.wide {
  grid-column: span 6;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  min-height: 340px;
}

.project-image {
  height: 210px;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 10%, var(--accent-soft), transparent 34%),
    var(--surface-3);
  border-bottom: 1px solid var(--border);
}

.project-card.wide .project-image {
  height: 100%;
  border-bottom: 0;
  border-right: 1px solid var(--border);
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease, opacity .2s ease;
}

.project-image.missing::after {
  content: "Imagen pendiente";
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
}

.project-image.missing img {
  display: none;
}

.project-card:hover img {
  transform: scale(1.045);
}

.project-content {
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-type {
  color: var(--accent);
  font-weight: 850;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .7rem;
}

.project-content p {
  margin-bottom: auto;
}

.project-content strong {
  color: var(--accent);
  margin-top: 1.2rem;
}

.cta {
  text-align: center;
  padding: 4.5rem 2rem;
  background: var(--surface-2);
}

.cta p {
  max-width: 720px;
  margin: 1rem auto 2rem;
  color: var(--muted);
  line-height: 1.65;
}

footer {
  color: var(--muted);
  text-align: center;
  padding: 2.5rem 1rem;
  font-size: .9rem;
}

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s ease, transform .7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .profile-grid,
  .services-grid,
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .project-card,
  .project-card.featured,
  .project-card.wide {
    grid-column: span 1;
  }

  .project-card.wide {
    display: flex;
  }

  .project-card.wide .project-image {
    height: 210px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .timeline::before {
    left: 9px;
  }

  .timeline-entry {
    grid-template-columns: 24px 1fr;
    gap: .8rem;
  }

  .timeline-date {
    grid-column: 2;
    text-align: left;
  }

  .timeline-marker {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .timeline-card {
    grid-column: 2;
  }
}

@media (max-width: 680px) {
  .nav-links {
    gap: .75rem;
    font-size: .8rem;
  }

  .nav-links a:nth-child(2),
  .nav-links a:nth-child(3),
  .nav-links a:nth-child(5) {
    display: none;
  }

  .hero h1 {
    font-size: clamp(3rem, 15vw, 5rem);
  }

  section {
    padding: 4.2rem 0;
  }

  .profile-card,
  .service-card {
    min-height: 240px;
  }
}
