/* =====================
   VARIABLES & RESET
   (Updated to DESIGN.md / code.html parameters)
===================== */
:root {
  --primary:      #245347; /* Deep Library Green */
  --primary-light: rgba(36, 83, 71, 0.08);
  --white:        #ffffff;
  --surface:      #faf9f6; /* Academic Off-White */
  --surface-low:  #f4f3f0; /* Transitional Background */
  --surface-high: #e9e8e5;
  --text-dark:    #1a1c1a;
  --text-mid:     #404945;
  --text-light:   #707975;
  --border:       rgba(0,0,0,0.05);
  
  --font-display: 'Newsreader', serif;
  --font-body:    'Manrope', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--surface);
  color: var(--text-dark);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
  text-align: justify;
}

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

/* Skip to content */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: white;
  padding: 8px;
  z-index: 101;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
}

/* =====================
   TYPOGRAPHY SCALE
===================== */
h1, h2, h3, .serif { font-family: var(--font-display); }

.eyebrow {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  font-weight: 700;
  margin-bottom: 1.5rem;
}

/* =====================
   NAV
===================== */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 6vw;
  background: rgba(36, 83, 71, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: none;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  font-style: italic;
  color: var(--white);
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  transition: color 0.2s;
  font-weight: 500;
}

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

.nav-hamburger {
  display: none;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0.4rem;
  color: var(--white);
  line-height: 1;
}
.nav-hamburger .material-symbols-outlined {
  font-size: 1.75rem;
  line-height: 1;
}

/* =====================
   HERO
===================== */
#hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  padding: 0 6vw;
  background: var(--white);
  overflow: hidden;
  position: relative;
  text-align: left;
}

.hero-content {
  padding: 10rem 0 6rem;
  max-width: 800px;
  z-index: 10;
}

.hero-title {
  font-size: clamp(3rem, 7vw, 6rem);
  font-weight: 400;
  line-height: 1.1;
  margin-bottom: 2rem;
}

.hero-title em {
  font-style: italic;
  color: var(--primary);
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-mid);
  max-width: 580px;
  margin-bottom: 3rem;
  line-height: 1.6;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--primary);
  color: var(--white);
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 1.25rem 2.5rem;
  border-radius: 2px;
  transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.3s;
}

.hero-cta:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(36, 83, 71, 0.15);
}

.hero-image-container {
  height: 100%;
  position: relative;
  overflow: hidden;
}

.hero-image-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--primary-light);
  z-index: 1;
}

.hero-texture {
  position: absolute;
  top: -10%;
  left: 0;
  width: 100%;
  height: 120%;
  object-fit: cover;
  filter: grayscale(100%);
  mix-blend-mode: multiply;
  opacity: 0.8;
  z-index: 2;
}

/* =====================
   SECTION COMMONS
===================== */
section {
  padding: 8rem 6vw;
}

.section-title {
  font-size: clamp(2.5rem, 4vw, 3.75rem);
  font-weight: 400;
  margin-bottom: 4rem;
  color: var(--primary);
}

/* =====================
   PILARES
===================== */
#pilares { background: var(--surface); }

.pilares-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.pilar-card {
  background: var(--surface);
  padding: 3rem 2.5rem;
  border-top: 3px solid var(--primary);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  transition: background 0.3s;
}

.pilar-card:hover { background: var(--primary-light); }

.pilar-icon {
  font-size: 2.5rem;
  color: var(--primary);
}

.pilar-title {
  font-size: 1.5rem;
  font-weight: 400;
}

.pilar-text {
  font-size: 1.125rem;
  color: var(--text-mid);
}

/* =====================
   CASOS
===================== */
#casos {
  background: var(--white);
  padding: 0;
}

.casos-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.casos-content {
  padding: 8rem 6vw;
  border-right: 1px solid var(--border);
}

.caso-list {
  display: flex;
  flex-direction: column;
  gap: 6rem;
}

.caso-sector {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: block;
}

.caso-title {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  transition: color 0.3s;
}

.caso-card:hover .caso-title { color: var(--primary); }

.caso-text {
  font-size: 1.125rem;
  color: var(--text-mid);
  font-style: italic;
  border-left: 1px solid rgba(36, 83, 71, 0.2);
  padding-left: 2rem;
}

.casos-visual {
  position: relative;
  overflow: hidden;
  min-height: 800px;
}

.casos-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%);
  mix-blend-mode: multiply;
  opacity: 0.9;
  transform: scale(1.1);
}

.casos-overlay {
  position: absolute;
  inset: 0;
  background: var(--primary);
  opacity: 0.1;
  mix-blend-mode: overlay;
}

/* =====================
   CREDENCIALES
===================== */
#credenciales { background: var(--white); }

.cred-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6rem;
  align-items: start;
}

.cred-title-sm {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  margin-bottom: 2.5rem;
}

.cred-item { margin-bottom: 3rem; }

.cred-degree {
  font-size: 1.25rem;
  font-family: var(--font-display);
  margin-bottom: 0.5rem;
}

.cred-school {
  font-size: 0.875rem;
  color: var(--text-mid);
}

.companies-list {
  display: flex;
  flex-wrap: wrap;
  gap: 3rem;
  align-items: center;
  justify-content: center;
  margin-bottom: 3rem;
}

.company-logo-marquee {
  width: 100%;
  height: auto;
  max-width: 800px;
  filter: grayscale(100%) opacity(0.6);
  transition: all 0.4s ease;
}

.company-logo-marquee:hover {
  filter: grayscale(0%) opacity(1);
}

.cred-summary {
  font-size: 1.125rem;
  color: var(--text-mid);
  line-height: 1.8;
}

/* =====================
   NEWSLETTER
===================== */
#newsletter {
  background: var(--surface);
  position: relative;
}

.newsletter-bg {
  position: absolute;
  left: 0; top: 0;
  width: 33%; height: 100%;
  opacity: 0.1;
  pointer-events: none;
}

.newsletter-bg img { width: 100%; height: 100%; object-fit: cover; }

.newsletter-card {
  max-width: 900px;
  margin: 0 auto;
  border: 1px solid rgba(36, 83, 71, 0.2);
  padding: 5rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(4px);
  position: relative;
}

.newsletter-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--primary-light);
  z-index: -1;
}

.newsletter-name {
  font-size: clamp(4rem, 8vw, 6rem);
  font-style: italic;
  color: var(--primary);
  margin-bottom: 1.5rem;
}

.newsletter-tagline {
  font-size: 1.25rem;
  font-style: italic;
  margin-bottom: 2rem;
}

.newsletter-description {
  color: var(--text-mid);
  max-width: 600px;
  margin: 0 auto 3rem;
}

/* =====================
   SOBRE MÍ
===================== */
#sobre-mi { background: var(--surface); }

.sobre-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 6rem;
  align-items: start;
}

.sobre-profile {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.profile-img-wrap {
  width: 240px;
  height: 240px;
  background: var(--surface);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  box-shadow: 0 10px 40px rgba(0,0,0,0.03);
  overflow: hidden;
  transition: transform 0.4s ease;
  margin-bottom: 2rem;
}

.profile-img-wrap:hover {
  transform: scale(1.02);
}

.profile-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.sobre-name { font-size: 2.25rem; line-height: 1.2; }
.sobre-role {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  margin-top: 0.5rem;
}

.sobre-text {
  font-size: 1.125rem;
  color: var(--text-mid);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* =====================
   CONTACTO
===================== */
#contacto {
  background: var(--white);
  text-align: center;
  position: relative;
  padding: 12rem 6vw;
  overflow: hidden;
}

.contact-bg {
  position: absolute;
  right: 0; bottom: 0;
  width: 50%; height: 100%;
  opacity: 0.05;
  pointer-events: none;
}

.contact-bg img { width: 100%; height: 100%; object-fit: cover; }

.contact-title {
  font-size: clamp(4rem, 10vw, 6rem);
  margin-bottom: 2.5rem;
  color: var(--primary);
}

.contact-text {
  font-size: 1.5rem;
  color: var(--text-mid);
  max-width: 700px;
  margin: 0 auto 4rem;
}

.contact-btn {
  display: inline-block;
  background: var(--primary);
  color: var(--white);
  padding: 1.5rem 3.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  transition: all 0.5s;
}

.contact-btn:hover {
  box-shadow: 0 20px 40px rgba(36, 83, 71, 0.2);
}

/* =====================
   FOOTER
===================== */
footer {
  padding: 4rem 6vw;
  background: var(--surface-low);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-copy {
  font-size: 1.25rem;
  font-style: italic;
}

.footer-links {
  display: flex;
  gap: 4rem;
}

.footer-links a {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-mid);
  transition: color 0.3s;
}

.footer-links a:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 8px; }

/* =====================
   RESPONSIVE — TABLET (≤1024px)
===================== */
@media (max-width: 1024px) {

  /* Hero: columna única, imagen visible debajo del contenido */
  #hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 0 6vw;
  }
  .hero-content {
    padding: 9rem 0 3rem;
  }
  .hero-image-container {
    display: flex;               /* visible en tablet/móvil */
    height: 45vw;
    min-height: 260px;
    max-height: 420px;
    margin: 0 -6vw;
    width: calc(100% + 12vw);
  }
  .hero-image-container::before {
    display: none;               /* quitamos el desplazamiento decorativo */
  }
  .hero-texture {
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin-top: 0;
  }

  /* Casos: columna única, imagen visible con altura fija */
  .casos-layout {
    grid-template-columns: 1fr;
  }
  .casos-visual {
    display: block;              /* visible en tablet/móvil */
    min-height: 280px;
    height: 50vw;
    max-height: 440px;
    order: -1;                   /* imagen arriba del texto en móvil */
  }
  .casos-content {
    border-right: none;
    border-top: 1px solid var(--border);
    padding: 5rem 6vw;
  }

  /* Credenciales y Sobre mí: columna única */
  .cred-grid  { grid-template-columns: 1fr; gap: 3rem; }
  .sobre-grid { grid-template-columns: 1fr; gap: 3rem; }
}

/* =====================
   RESPONSIVE — MÓVIL (≤768px)
===================== */
@media (max-width: 768px) {

  /* Navegación: hamburguesa */
  nav { padding: 1rem 5vw; }
  .nav-hamburger { display: block; }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: rgba(36, 83, 71, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem 5vw 2rem;
    gap: 1.25rem;
  }
  .nav-links.nav-open { display: flex; }

  /* Secciones: padding reducido */
  section { padding: 4rem 5vw; }

  /* Hero */
  #hero { padding: 0 5vw; }
  .hero-content { padding: 7rem 0 2rem; }
  .hero-image-container {
    margin: 0 -5vw;
    width: calc(100% + 10vw);
    height: 55vw;
    min-height: 220px;
  }
  .hero-title {
    font-size: clamp(2.25rem, 9vw, 3.5rem);
  }
  .hero-subtitle {
    font-size: 1.05rem;
    margin-bottom: 2rem;
  }
  .hero-cta {
    padding: 1rem 2rem;
    font-size: 0.8rem;
  }

  /* Títulos de sección */
  .section-title {
    font-size: clamp(1.75rem, 7vw, 2.75rem);
    margin-bottom: 2rem;
  }

  /* Casos */
  .casos-visual { height: 60vw; }
  .casos-content { padding: 4rem 5vw; }
  .caso-list { gap: 3.5rem; }
  .caso-title { font-size: 1.4rem; margin-bottom: 1rem; }

  /* Newsletter */
  .newsletter-card { padding: 2.5rem 1.5rem; }
  .newsletter-name { font-size: clamp(2.5rem, 11vw, 4.5rem); }
  .newsletter-tagline { font-size: 1.05rem; }

  /* Sobre mí: perfil en columna */
  .sobre-profile {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
  }
  .profile-img-wrap {
    width: 140px;
    height: 140px;
    margin-bottom: 0.5rem;
  }
  .sobre-name { font-size: 1.75rem; }

  /* Contacto */
  #contacto { padding: 7rem 5vw; }
  .contact-title { font-size: clamp(2.5rem, 13vw, 5rem); }
  .contact-text { font-size: 1.05rem; margin-bottom: 2.5rem; }
  .contact-btn { padding: 1.25rem 2.5rem; font-size: 0.8rem; }

  /* Footer */
  footer { flex-direction: column; gap: 2rem; text-align: center; }
}
