/* ───────────────────────────────────────────
   Reset & Base
   ─────────────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --dark: #1a2332;
  --dark-light: #2d3748;
  --bg: #f8f7f4;
  --text: #4a5568;
  --text-light: #718096;
  --accent: #2a9d8f;
  --accent-hover: #228a7d;
  --accent-light: #e8f5f2;
  --accent-subtle: rgba(42, 157, 143, 0.08);
  --white: #ffffff;

  --font-display: 'Outfit', system-ui, sans-serif;
  --font-body: 'Libre Franklin', system-ui, sans-serif;

  --section-py: clamp(5rem, 12vw, 9rem);
  --container-max: 1100px;
  --container-px: clamp(1.25rem, 5vw, 2rem);
  --nav-height: 72px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.45, 0, 0.15, 1);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

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

p {
    white-space: pre-line;
}

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

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--white);
  border-radius: 0 0 6px 6px;
  font-size: 0.875rem;
  z-index: 200;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
}

/* ───────────────────────────────────────────
   Shared
   ─────────────────────────────────────────── */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-px);
}

.section-label {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--dark);
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.875rem 2rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition:
    transform 0.3s var(--ease-out),
    box-shadow 0.3s var(--ease-out),
    background-color 0.25s;
}

.btn-primary {
  background-color: var(--accent);
  color: var(--white);
}
.btn-primary:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(42, 157, 143, 0.3);
}
.btn-primary:active {
  transform: translateY(0);
}

/* ───────────────────────────────────────────
   Navigation
   ─────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  z-index: 100;
  transition:
    background-color 0.35s,
    box-shadow 0.35s;
}

.nav.scrolled {
  background-color: rgba(248, 247, 244, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--dark);
  letter-spacing: -0.02em;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
  flex-wrap: wrap;
}

.nav-menu a {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
  transition: color 0.2s;
}
.nav-menu a:hover {
  color: var(--dark);
}

.nav-menu .nav-cta {
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  background-color: var(--accent);
  color: var(--white);
  border-radius: 6px;
  transition:
    background-color 0.25s,
    transform 0.2s var(--ease-out);
}
.nav-menu .nav-cta:hover {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
}

.nav-lang {
  display: none;
  gap: 0.5rem;
  margin-left: auto;
  list-style: none;
}

.nav-lang-separator {
  display: none;
}

@media (min-width: 769px) {
  .nav-lang {
    display: flex;
  }
}

.lang-btn {
  padding: 0.4rem 0.6rem;
  font-size: 0.8125rem;
  font-weight: 700;
  background: none;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 4px;
  color: var(--text-light);
  cursor: pointer;
  transition:
    background-color 0.2s,
    border-color 0.2s,
    color 0.2s;
}

.lang-btn:hover {
  background-color: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

.lang-btn.active {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--dark);
  border-radius: 2px;
  transition:
    transform 0.3s var(--ease-out),
    opacity 0.2s;
  transform-origin: center;
}
.nav-toggle[aria-expanded='true'] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded='true'] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded='true'] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    justify-content: flex-start;
    padding: 2rem var(--container-px);
    gap: 0;
    background-color: rgba(248, 247, 244, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition:
      transform 0.4s var(--ease-out),
      opacity 0.3s;
    z-index: 110; /* Ensure menu is above the navigation bar */
  }

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

  .nav-menu li {
    width: 100%;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }

  .nav-menu a {
    display: block;
    padding: 1.25rem 0;
    font-size: 1.125rem;
  }

  .nav-menu .nav-cta {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    text-align: center;
  }

  .nav-lang-separator {
    display: block;
    width: 100%;
    height: 1px;
    background: rgba(0, 0, 0, 0.05);
    margin: 1rem 0;
  }

  .nav-lang {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    margin-left: 0;
    width: 100%;
  }

  .lang-btn {
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 600;
    background: none;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    color: var(--text);
    cursor: pointer;
    transition:
      background-color 0.2s,
      border-color 0.2s,
      color 0.2s;
  }

  .lang-btn:hover {
    background-color: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
  }

  .lang-btn.active {
    background-color: var(--accent);
    border-color: var(--accent);
    color: var(--white);
  }
}

/* ───────────────────────────────────────────
   Hero
   ─────────────────────────────────────────── */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(var(--nav-height) + 2rem) var(--container-px) 4rem;
  text-align: center;
  overflow: hidden;
}

/* Subtle background depth */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 25% 60%, rgba(42, 157, 143, 0.04) 0%, transparent 55%),
    radial-gradient(ellipse at 75% 30%, rgba(26, 35, 50, 0.03) 0%, transparent 50%);
  pointer-events: none;
}

.hero-decoration {
  position: absolute;
  right: -80px;
  top: 50%;
  transform: translateY(-50%);
  width: 520px;
  height: 520px;
  pointer-events: none;
  opacity: 0.5;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 0 auto;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5.5vw, 3.25rem);
  font-weight: 700;
  color: var(--dark);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.hero-subtitle {
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
  color: var(--text);
  line-height: 1.7;
  max-width: 600px;
  margin: 0 auto 2.5rem;
}

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  animation: gentleBounce 2.5s ease-in-out infinite;

  /* New styles for better indication */
  padding: 0.75rem 1rem;
  background-color: var(--accent-light); /* Lighter background for subtlety */
  border: 1px solid var(--accent-subtle); /* Softer border */
  border-radius: 8px;
  color: var(--accent); /* Accent color for text/icon to contrast with lighter background */
  box-shadow: 0 4px 10px rgba(42, 157, 143, 0.1); /* Softer shadow */

  /* Transition for hiding/showing */
  transition:
    opacity 0.3s var(--ease-out),
    transform 0.3s var(--ease-out),
    visibility 0.3s;
}

/* Ensure SVG inherits the accent color and add animation */
.scroll-hint svg {
  color: var(--accent);
  animation: arrowNudge 1.5s var(--ease-out) infinite; /* New animation for the arrow */
}

/* Class to hide the scroll hint via JavaScript */
.scroll-hint.hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(10px); /* Move down slightly when hidden */
}

@keyframes gentleBounce {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(6px);
  }
}

/* New animation for the scroll arrow */
@keyframes arrowNudge {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(4px); /* Nudge down 4px */
  }
}

/* Hero entrance animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-animate {
  opacity: 0;
  animation: fadeInUp 0.9s var(--ease-out) forwards;
}
.hero-animate-1 {
  animation-delay: 0.15s;
}
.hero-animate-2 {
  animation-delay: 0.35s;
}
.hero-animate-3 {
  animation-delay: 0.55s;
}
.hero-animate-4 {
  animation-delay: 0.75s;
}

/* ───────────────────────────────────────────
   Modelo de Trabajo
   ─────────────────────────────────────────── */
.modelo {
  padding: var(--section-py) 0;
  background-color: var(--accent-light);
}

.modelo-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

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

.modelo-card {
  background: var(--white);
  border-radius: 12px;
  padding: 2.25rem 2rem;
  transition:
    transform 0.4s var(--ease-out),
    box-shadow 0.4s var(--ease-out);
}
.modelo-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(26, 35, 50, 0.06);
}

.modelo-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background-color: var(--accent-light);
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.modelo-card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 0.75rem;
}

.modelo-card p {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text);
}

/* Stagger reveal for cards */
.modelo-card:nth-child(2) {
  transition-delay: 0.1s;
}
.modelo-card:nth-child(3) {
  transition-delay: 0.2s;
}

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

.model-subtitle {
  font-size: 1.25rem;
  line-height: 1.7;
  color: var(--text);
  margin-top: 2rem;
  text-align: center;
}

/* ───────────────────────────────────────────
   Experiencia
   ─────────────────────────────────────────── */
.experiencia {
  padding: var(--section-py) 0;
  background-color: var(--bg);
}

.experiencia-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.experiencia-text p {
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.experiencia-aside {
  padding-top: 0.5rem;
}

.experiencia-aside-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 1.25rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-bottom: 2rem;
}

.tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  background-color: var(--accent-light);
  color: var(--accent);
  border-radius: 100px;
  transition:
    background-color 0.2s,
    color 0.2s;
}
.tag:hover {
  background-color: var(--accent);
  color: var(--white);
}

.client-profile {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text);
  padding-left: 1rem;
  border-left: 3px solid var(--accent-subtle);
}

@media (max-width: 768px) {
  .experiencia-layout {
    grid-template-columns: 1fr;
  }
}

/* ───────────────────────────────────────────
   Contacto (Footer)
   ─────────────────────────────────────────── */
.contacto {
  padding: var(--section-py) 0 3rem;
  background-color: var(--dark);
  color: rgba(255, 255, 255, 0.7);
}

.contacto-inner {
  text-align: center;
}

.contacto-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.75rem;
}

.contacto-subtitle {
  font-size: 1.0625rem;
  max-width: 520px;
  margin: 0 auto 3rem;
  line-height: 1.7;
}

.contact-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 4rem;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.85);
  transition: color 0.2s;
}
.contact-link:hover {
  color: var(--accent);
}

.contact-link svg {
  flex-shrink: 0;
  opacity: 0.7;
}
.contact-link:hover svg {
  opacity: 1;
}

.contacto-divider {
  width: 60px;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 auto 1.5rem;
}

.copyright {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.35);
}

/* ───────────────────────────────────────────
   Scroll Reveal
   ─────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.7s var(--ease-out),
    transform 0.7s var(--ease-out);
}

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

/* Stagger delays for modelo cards when revealed */
.reveal.delay-1 {
  transition-delay: 0.1s;
}
.reveal.delay-2 {
  transition-delay: 0.2s;
}

/* ───────────────────────────────────────────
   Focus & Accessibility
   ─────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
}
