*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --black: #090C0A; --white: #FAFAF7; --accent: #00E5A0; --accent2: #FF4D6D;
  --surface: #131612; --muted: #888; --card-bg: #151814;
  --border: rgba(255,255,255,0.07);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}
html { scroll-behavior: smooth; }
body { font-family: 'DM Sans', sans-serif; background: var(--black); color: var(--white); font-size: 16px; line-height: 1.6; overflow-x: hidden; }

nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; display: flex; align-items: center; justify-content: space-between; padding: 1rem 2rem; background: rgba(10,10,10,0.85); backdrop-filter: blur(20px); border-bottom: 1px solid var(--border); }
.nav-logo { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1.25rem; letter-spacing: -0.03em; color: var(--white); text-decoration: none; }
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a { font-size: 0.875rem; color: var(--muted); text-decoration: none; font-weight: 400; letter-spacing: 0.02em; transition: color 0.2s; }
@media (hover: hover) and (pointer: fine) { .nav-links a:hover { color: var(--white); } }
.nav-links a:focus-visible { color: var(--white); outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
.nav-cta { background: var(--accent); color: var(--black) !important; padding: 0.5rem 1.25rem; border-radius: 100px; font-weight: 500; font-size: 0.875rem; text-decoration: none; transition: opacity 0.2s var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .nav-cta:hover { opacity: 0.85; } }
.nav-cta:active { opacity: 0.75; transform: scale(0.97); }
.nav-cta:focus-visible { outline: 2px solid var(--black); outline-offset: 3px; }

/* ===== HERO SPLIT LAYOUT ===== */
.hero {
  min-height: 100svh;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  padding: 0;
}
.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 9rem 2rem 6rem;
}
.hero-content { text-align: left; }
.hero-noise { position: absolute; inset: 0; background-image: radial-gradient(ellipse 100% 85% at 50% 0%, rgba(0,229,160,0.22) 0%, rgba(0,229,160,0.08) 45%, transparent 75%), radial-gradient(ellipse 40% 40% at 80% 80%, rgba(255,77,109,0.08) 0%, transparent 50%); }
.hero-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px); background-size: 60px 60px; }
.hero-tag { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); border: 1px solid rgba(0,229,160,0.25); padding: 0.4rem 1rem; border-radius: 100px; margin-bottom: 2rem; }
.hero-tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; flex-shrink: 0; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.hero-title { font-family: 'Syne', sans-serif; font-size: clamp(3rem, 7vw, 5.5rem); font-weight: 800; line-height: 0.95; letter-spacing: -0.04em; margin-bottom: 1.5rem; }
.hero-title .accent { color: var(--accent); }
.hero-sub { font-size: 1.05rem; color: rgba(250,250,247,0.55); max-width: 480px; font-weight: 300; margin-bottom: 2.5rem; line-height: 1.7; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn-primary { background: var(--accent); color: var(--black); padding: 0.875rem 2rem; border-radius: 100px; font-weight: 600; font-size: 0.9rem; text-decoration: none; transition: transform 160ms var(--ease-out), opacity 160ms var(--ease-out); display: inline-flex; align-items: center; gap: 0.5rem; }
@media (hover: hover) and (pointer: fine) { .btn-primary:hover { transform: translateY(-2px); opacity: 0.9; } }
.btn-primary:active { transform: scale(0.97); opacity: 0.85; }
.btn-primary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.btn-ghost { border: 1px solid rgba(255,255,255,0.15); color: var(--white); padding: 0.875rem 2rem; border-radius: 100px; font-weight: 400; font-size: 0.9rem; text-decoration: none; transition: border-color 160ms var(--ease-out), background 160ms var(--ease-out), transform 160ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .btn-ghost:hover { border-color: rgba(255,255,255,0.4); background: rgba(255,255,255,0.04); } }
.btn-ghost:active { transform: scale(0.97); }
.btn-ghost:focus-visible { outline: 2px solid rgba(255,255,255,0.5); outline-offset: 4px; }

/* ===== STATS STRIP ===== */
.stats-strip {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 1.375rem 2rem;
}
.stats-strip-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-sentence {
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0.03em;
  text-align: center;
  line-height: 1.9;
}
.stat-sentence strong {
  font-family: 'Syne', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.025em;
}

section { padding: 6rem 2rem; max-width: 1100px; margin: 0 auto; }
.section-label { font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); font-weight: 500; margin-bottom: 1rem; }
.section-title { font-family: 'Syne', sans-serif; font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; margin-bottom: 1.5rem; }
.section-desc { color: rgba(250,250,247,0.5); max-width: 560px; font-weight: 300; font-size: 1rem; line-height: 1.7; margin-bottom: 3rem; }

.especialidades-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.esp-card { background: var(--card-bg); padding: 2rem; cursor: pointer; transition: background 0.25s; display: flex; flex-direction: column; gap: 0.75rem; text-decoration: none; color: inherit; }
@media (hover: hover) and (pointer: fine) { .esp-card:hover { background: #1E1E1E; } }
.esp-card:active { background: #222; }
.esp-card:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 0; }
.esp-shield { width: 80px; height: 80px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; background: rgba(0,229,160,0.06); border: 1.5px solid rgba(0,229,160,0.20); margin-bottom: 0.25rem; flex-shrink: 0; transition: border-color 0.25s, background 0.25s; }
.esp-card:hover .esp-shield { background: rgba(0,229,160,0.12); border-color: rgba(0,229,160,0.4); }
.esp-shield img { width: 100%; height: 100%; object-fit: cover; filter: brightness(1.1); transition: filter 0.25s; }
.esp-card:hover .esp-shield img { filter: brightness(1.3) drop-shadow(0 0 8px rgba(0,229,160,0.6)); }
.esp-card h3 { font-family: 'Syne', sans-serif; font-size: 1rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.esp-card p { font-size: 0.8rem; color: var(--muted); font-weight: 300; line-height: 1.5; }
.esp-arrow { margin-top: auto; font-size: 0.75rem; color: var(--accent); font-weight: 500; letter-spacing: 0.05em; }
.turno-badge { display: inline-block; font-size: 0.7rem; padding: 0.2rem 0.6rem; border-radius: 100px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; }
.turno-d { background: rgba(0,229,160,0.12); color: var(--accent); }

.qa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem; }
.qa-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; padding: 1.5rem; text-decoration: none; color: inherit; transition: border-color 0.2s, transform 0.2s, background 0.2s; display: flex; flex-direction: column; gap: 0.5rem; }
@media (hover: hover) and (pointer: fine) { .qa-card:hover { border-color: rgba(0,229,160,0.3); transform: translateY(-3px); background: #1a1a1a; } }
.qa-card:active { transform: scale(0.97); }
.qa-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.qa-icon { width: 48px; height: 48px; object-fit: contain; margin-bottom: 0.25rem; border-radius: 8px; }
.qa-card h4 { font-family: 'Syne', sans-serif; font-size: 0.95rem; font-weight: 700; letter-spacing: -0.01em; }
.qa-card p { font-size: 0.78rem; color: var(--muted); font-weight: 300; }

.vm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border-radius: 16px; overflow: hidden; border: 1px solid var(--border); }
@media (max-width: 640px) { .vm-grid { grid-template-columns: 1fr; } }
.vm-card { background: var(--card-bg); padding: 2.5rem; }
.vm-card h3 { font-family: 'Syne', sans-serif; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 1rem; }
.vm-card p { color: rgba(250,250,247,0.7); font-size: 0.95rem; font-weight: 300; line-height: 1.8; }

.historia-block { display: grid; grid-template-columns: 1fr 2fr; gap: 4rem; align-items: start; }
@media (max-width: 700px) { .historia-block { grid-template-columns: 1fr; gap: 2rem; } }
.tl-item { display: flex; gap: 1rem; cursor: pointer; padding: 1rem; border-radius: 10px; transition: background 0.2s; }
.tl-item:hover, .tl-item.active { background: rgba(0,229,160,0.05); }
.tl-year { font-family: 'Syne', sans-serif; font-size: 0.85rem; font-weight: 700; color: var(--accent); min-width: 48px; padding-top: 2px; }
.tl-text { font-size: 0.85rem; color: var(--muted); line-height: 1.5; font-weight: 300; }
.tl-item.active .tl-text { color: var(--white); }
.historia-detail { background: var(--card-bg); border: 1px solid var(--border); border-radius: 16px; padding: 2.5rem; }
.historia-detail h3 { font-family: 'Syne', sans-serif; font-size: 1.75rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 1rem; color: var(--accent); }
.historia-detail p { color: rgba(250,250,247,0.65); font-size: 0.95rem; line-height: 1.8; font-weight: 300; }

.contacto-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: center; }
@media (max-width: 700px) { .contacto-grid { grid-template-columns: 1fr; } }
.contacto-items { display: flex; flex-direction: column; gap: 1rem; margin-top: 2rem; }
.contacto-item { display: flex; align-items: center; gap: 0.75rem; font-size: 0.9rem; color: rgba(250,250,247,0.7); }
.contacto-item .ic {
  width: 36px; height: 36px;
  background: rgba(0,229,160,0.08);
  border: 1px solid rgba(0,229,160,0.15);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(0,229,160,0.08);
}
.contacto-form { background: var(--card-bg); border: 1px solid var(--border); border-radius: 20px; padding: 2rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.78rem; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 0.5rem; }
.form-group input, .form-group textarea, .form-group select { width: 100%; background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: 10px; padding: 0.75rem 1rem; color: var(--white); font-family: 'DM Sans', sans-serif; font-size: 0.9rem; outline: none; transition: border-color 0.2s, background 0.2s; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: rgba(0,229,160,0.4); background: rgba(0,229,160,0.02); }
.form-group textarea { min-height: 100px; resize: vertical; }
.form-group select option { background: #1a1a1a; }

footer { border-top: 1px solid var(--border); padding: 2.5rem 2rem; max-width: 1100px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
footer p { font-size: 0.8rem; color: var(--muted); }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { font-size: 0.8rem; color: var(--muted); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--white); }
.divider { height: 1px; background: var(--border); max-width: 1100px; margin: 0 auto; }

.marquee-wrap { overflow: hidden; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 1rem 0; background: var(--surface); }
.marquee-wrap:hover .marquee-track { animation-play-state: paused; }
.marquee-track { display: flex; gap: 3rem; width: max-content; animation: marquee 20s linear infinite; }
.marquee-track span { font-family: 'Syne', sans-serif; font-size: 0.85rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; color: var(--muted); }
.marquee-track span.hl { color: var(--accent); }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out); }
.reveal.visible { opacity: 1; transform: translateY(0); }

.step-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.step-card { background: var(--card-bg); padding: 2rem; transition: background 0.2s; }
.step-card:hover { background: #1a1a1a; }
.step-num { font-family: 'Syne', sans-serif; font-size: 2.5rem; font-weight: 800; color: var(--accent); opacity: 0.3; margin-bottom: 0.5rem; }
.step-card h4 { font-family: 'Syne', sans-serif; font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; }
.step-card p { font-size: 0.82rem; color: var(--muted); line-height: 1.6; }
.step-card a { color: var(--accent); font-size: 0.8rem; text-decoration: none; font-weight: 500; display: inline-block; margin-top: 1rem; transition: opacity 0.2s; }
.step-card a:hover { opacity: 0.7; }

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {

  /* NAV */
  nav { padding: 0.875rem 1.25rem; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; gap: 0;
    position: fixed; top: 57px; left: 0; right: 0; bottom: 0;
    background: rgba(10,10,10,0.97); backdrop-filter: blur(20px);
    padding: 2rem 1.5rem; z-index: 99;
  }
  .nav-links.open li { border-bottom: 1px solid var(--border); }
  .nav-links.open a { display: block; padding: 1rem 0; font-size: 1.1rem; color: var(--white); }
  .nav-links.open .nav-cta { margin-top: 1rem; display: inline-block; text-align: center; }
  .hamburger { display: flex; flex-direction: column; gap: 5px; cursor: pointer; padding: 4px; background: none; border: none; z-index: 101; }
  .hamburger span { display: block; width: 24px; height: 2px; background: var(--white); border-radius: 2px; transition: transform 0.3s, opacity 0.3s; }
  .hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .hamburger.open span:nth-child(2) { opacity: 0; }
  .hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* HERO */
  .hero-inner { padding: 6rem 1.25rem 4rem; }
  .hero-tag { font-size: 0.65rem; padding: 0.35rem 0.85rem; }
  .hero-title { font-size: clamp(2.6rem, 13vw, 4rem); letter-spacing: -0.03em; }
  .hero-sub { font-size: 1rem; }
  .hero-actions { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .btn-primary, .btn-ghost { width: 100%; max-width: 280px; justify-content: center; text-align: center; }

  /* Stats strip móvil: 2x2 */
  .stats-strip { padding: 1.5rem 1.25rem; }
  .stats-strip-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; justify-items: center; }
  .stat-sep-v { display: none; }
  .stat-num { font-size: 1.75rem; }
  .stat-label { font-size: 0.68rem; }

  /* SECTIONS */
  section { padding: 4rem 1.25rem; }
  .section-title { font-size: clamp(1.75rem, 7vw, 2.5rem); }
  .section-desc { font-size: 0.9rem; margin-bottom: 2rem; }

  /* ESPECIALIDADES */
  .especialidades-grid { grid-template-columns: 1fr 1fr; }
  .esp-card { padding: 1.25rem; gap: 0.5rem; }
  .esp-shield { width: 52px; height: 52px; }
  .esp-card h3 { font-size: 0.875rem; }
  .esp-card p { font-size: 0.73rem; }

  /* QA GRID */
  .qa-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .qa-card { padding: 1.1rem; }
  .qa-card h4 { font-size: 0.85rem; }
  .qa-card p { font-size: 0.72rem; }

  /* MISION/VISION */
  .vm-grid { grid-template-columns: 1fr; }
  .vm-card { padding: 1.75rem 1.25rem; }

  /* HISTORIA */
  .historia-block { grid-template-columns: 1fr; gap: 1.5rem; }
  .historia-detail { padding: 1.5rem; }
  .historia-detail h3 { font-size: 1.4rem; }

  /* ADMISION STEPS */
  .step-grid { grid-template-columns: 1fr 1fr; }
  .step-card { padding: 1.25rem; }
  .step-num { font-size: 1.8rem; }
  .step-card h4 { font-size: 0.9rem; }
  .step-card p { font-size: 0.78rem; }

  /* CONTACTO */
  .contacto-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .contacto-form { padding: 1.5rem; }
}

@media (max-width: 420px) {
  .especialidades-grid { grid-template-columns: 1fr; }
  .qa-grid { grid-template-columns: 1fr; }
  .step-grid { grid-template-columns: 1fr; }
}

/* ===== HERO ANIMATED BACKGROUND ===== */
.hero-bg-canvas {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%;
}
.hero-noise { z-index: 1; }
.hero-grid { z-index: 1; }
.hero-inner { position: relative; z-index: 2; }

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
  .hero-tag::before { animation: none; }
  .reveal { transition: opacity 0.2s ease; transform: none; }
  .reveal.visible { opacity: 1; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ===== STEP CARD LINKS ===== */
.step-card a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

/* ── HERO CHILDREN STAGGER ── */
@keyframes heroSlide {
  from { transform: translateY(14px); }
  to   { transform: none; }
}
.hero-content.visible .hero-tag     { animation: heroSlide 500ms var(--ease-out) 50ms  both; }
.hero-content.visible .hero-title   { animation: heroSlide 650ms var(--ease-out) 150ms both; }
.hero-content.visible .hero-sub     { animation: heroSlide 600ms var(--ease-out) 260ms both; }
.hero-content.visible .hero-actions { animation: heroSlide 550ms var(--ease-out) 360ms both; }

/* ── STEP CARDS STAGGER ── */
@keyframes cardSlide {
  from { transform: translateY(13px); }
  to   { transform: none; }
}
.step-grid.visible .step-card               { animation: cardSlide 500ms var(--ease-out) both; }
.step-grid.visible .step-card:nth-child(1)  { animation-delay: 0ms; }
.step-grid.visible .step-card:nth-child(2)  { animation-delay: 80ms; }
.step-grid.visible .step-card:nth-child(3)  { animation-delay: 160ms; }
.step-grid.visible .step-card:nth-child(4)  { animation-delay: 240ms; }

/* ── VM CARDS STAGGER ── */
.vm-grid.visible .vm-card              { animation: cardSlide 520ms var(--ease-out) both; }
.vm-grid.visible .vm-card:nth-child(1) { animation-delay: 0ms; }
.vm-grid.visible .vm-card:nth-child(2) { animation-delay: 110ms; }

/* ── HISTORIA DETAIL TRANSITION ── */
#historia-detail {
  transition: opacity 200ms var(--ease-out), filter 180ms var(--ease-out), transform 220ms var(--ease-out);
}

/* ── PREFERS REDUCED MOTION — animations ── */
@media (prefers-reduced-motion: reduce) {
  .hero-content.visible .hero-tag,
  .hero-content.visible .hero-title,
  .hero-content.visible .hero-sub,
  .hero-content.visible .hero-actions,
  .step-grid.visible .step-card,
  .vm-grid.visible .vm-card { animation: none; }
  #historia-detail { transition: none; }
}
