/* ===========================================================
   CAPES — Swiss / International Typographic Style
   Editorial, minimal, mucho blanco. Color como acento, no superficie.
   =========================================================== */

:root {
  --turquoise: #16A7B8;
  --orange: #F07A13;
  --white: #FFFFFF;
  --ink: #0D2226;          /* azul petróleo casi negro — texto principal */
  --ink-soft: #56676B;     /* gris-azul — texto secundario */
  --ink-faint: #8A9598;    /* gris — metadatos, captions */
  --line: #E4E8E9;         /* divisor muy claro */
  --surface: #F6F7F7;      /* fondo secundario muy claro */

  --font-sans: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --gutter: clamp(20px, 5vw, 72px);
  --col-gap: clamp(16px, 2vw, 28px);
  --section-space: clamp(64px, 10vw, 140px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  font-size: 16px;
  line-height: 1.55;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
  text-wrap: balance;
}
p { margin: 0; }

/* ---------- Layout primitives ---------- */
.wrap {
  width: 100%;
  max-width: 1360px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.grid12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--col-gap);
}

.section { padding-block: var(--section-space); }
.section-tight { padding-block: clamp(40px, 6vw, 72px); }
.section + .section { border-top: 1px solid var(--line); }
.bg-surface { background: var(--surface); }
.bg-ink { background: var(--ink); color: rgba(255,255,255,0.82); }
.bg-ink h1, .bg-ink h2, .bg-ink h3 { color: var(--white); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--turquoise);
}
.bg-ink .eyebrow { color: #6FD0DC; }

.kicker {
  display: block;
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  margin-top: 14px;
}

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 30px;
  font-weight: 700;
  font-size: 0.98rem;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.2s var(--ease);
}
.btn-primary { background: var(--orange); color: var(--white); }
.btn-primary:hover { background: #D9690D; }
.btn-line {
  border-color: var(--ink);
  color: var(--ink);
  background: transparent;
}
.btn-line:hover { background: var(--ink); color: var(--white); }
.bg-ink .btn-line { border-color: rgba(255,255,255,0.5); color: var(--white); }
.bg-ink .btn-line:hover { background: var(--white); color: var(--ink); }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), gap 0.2s var(--ease);
}
.text-link:hover { color: var(--orange); border-color: var(--orange); gap: 12px; }
.text-link.on-dark { color: var(--white); border-color: rgba(255,255,255,0.5); }
.text-link.on-dark:hover { color: var(--turquoise); border-color: var(--turquoise); }
.arrow { font-family: var(--font-mono); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand img { height: 30px; width: auto; display: block; }

.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
  position: relative;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-soft);
  transition: color 0.2s var(--ease);
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 18px; right: 18px; bottom: 4px;
  height: 2px;
  background: var(--turquoise);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.main-nav a:hover { color: var(--ink); }
.main-nav a:hover::after,
.main-nav a[aria-current="page"]::after { transform: scaleX(1); }
.main-nav a[aria-current="page"] { color: var(--ink); }

.header-actions { display: flex; align-items: center; gap: 18px; }
.header-actions .text-link { font-size: 0.92rem; }
[data-cart-count] {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 4px; margin-left: 6px;
  background: var(--orange); color: var(--white);
  font-family: var(--font-mono); font-size: 0.65rem; border-radius: 999px;
}

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  border: 1px solid var(--line);
  background: var(--white);
  align-items: center; justify-content: center;
  cursor: pointer;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; display: block; width: 18px; height: 1.5px; background: var(--ink);
  position: relative; transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(48px, 7vw, 96px) clamp(56px, 8vw, 110px); }
.hero-copy { grid-column: 1 / 8; display: flex; flex-direction: column; }
.hero-visual { grid-column: 8 / 13; position: relative; }
.hero h1 { font-size: clamp(2.4rem, 5vw, 4.4rem); margin-top: 20px; }
.hero .lede {
  margin-top: 24px;
  font-size: clamp(1.05rem, 1.3vw, 1.2rem);
  color: var(--ink-soft);
  max-width: 46ch;
}
.hero-actions { display: flex; align-items: center; gap: 28px; margin-top: 36px; flex-wrap: wrap; }

.hero-panel {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--ink);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(22px, 2.4vw, 34px);
}
.hero-panel::before {
  content: "";
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,0.05) 0 1px, transparent 1px 42px),
                     repeating-linear-gradient(90deg, rgba(255,255,255,0.05) 0 1px, transparent 1px 42px);
}
.hero-panel-tag {
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
}
.hero-panel-figure { position: relative; }
.hero-panel-figure strong {
  display: block;
  font-size: clamp(3rem, 6vw, 4.4rem);
  color: var(--white);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.hero-panel-figure span { color: rgba(255,255,255,0.6); font-size: 0.95rem; }
.hero-panel-bar { position: relative; height: 3px; width: 56px; background: var(--turquoise); }

/* ---------- Benefits strip ---------- */
.benefits-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.benefit-item {
  padding: 30px var(--col-gap);
  border-left: 1px solid var(--line);
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.benefit-item:first-child { border-left: none; padding-left: 0; }
.benefit-item svg { flex: none; margin-top: 2px; color: var(--turquoise); }
.benefit-item h3 { font-size: 1rem; font-weight: 700; }
.benefit-item p { color: var(--ink-soft); font-size: 0.92rem; margin-top: 4px; }

/* ---------- Section head ---------- */
.section-head { grid-column: 1 / 13; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head-flex {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}
.section-head p.desc { margin-top: 14px; color: var(--ink-soft); max-width: 56ch; }

/* ---------- Course cards (clean, minimal) ---------- */
.course-list { grid-column: 1 / 13; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--col-gap) var(--col-gap); }
.course-card {
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transition: border-color 0.25s var(--ease);
}
.course-card:hover { border-color: var(--ink); }
.course-thumb { aspect-ratio: 4/3; background: var(--surface); overflow: hidden; }
.course-thumb img { width: 100%; height: 100%; object-fit: cover; }
.course-thumb-fallback { width: 100%; height: 100%; background: var(--surface); position: relative; }
.course-thumb-fallback::after {
  content: "CAPES"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.1em; color: var(--ink-faint);
}
.course-body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.course-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.course-body h3 { font-size: 1.08rem; font-weight: 700; letter-spacing: -0.01em; }
.course-foot { margin-top: auto; padding-top: 12px; display: flex; justify-content: space-between; align-items: center; }
.course-foot .text-link { font-size: 0.85rem; }

/* ---------- Categories: editorial numbered rows ---------- */
.category-rows { grid-column: 1 / 13; }
.category-row {
  display: grid;
  grid-template-columns: 90px 1fr 2fr 40px;
  align-items: center;
  gap: var(--col-gap);
  padding-block: 28px;
  border-top: 1px solid var(--line);
  transition: background 0.2s var(--ease);
}
.category-rows a.category-row:hover { background: var(--surface); }
.category-rows :last-child { border-bottom: 1px solid var(--line); }
.category-num { font-family: var(--font-mono); font-size: 0.95rem; color: var(--ink-faint); }
.category-name { font-size: clamp(1.3rem, 2.2vw, 1.8rem); font-weight: 800; letter-spacing: -0.01em; }
.category-desc { color: var(--ink-soft); font-size: 0.95rem; }
.category-arrow { justify-self: end; font-family: var(--font-mono); font-size: 1.1rem; color: var(--ink-faint); transition: transform 0.2s var(--ease), color 0.2s var(--ease); }
.category-rows a.category-row:hover .category-arrow { transform: translateX(6px); color: var(--orange); }

/* ---------- How it works ---------- */
.steps-row { grid-column: 1 / 13; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--col-gap); }
.step { padding-top: 22px; border-top: 2px solid var(--ink); }
.step-num { font-family: var(--font-mono); font-size: 0.9rem; color: var(--orange); }
.step h3 { font-size: 1.15rem; margin-top: 14px; }
.step p { color: var(--ink-soft); margin-top: 8px; font-size: 0.95rem; }

/* ---------- Trust strip ---------- */
.trust-strip { grid-column: 1 / 13; }
.trust-label { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
.trust-row { display: flex; flex-wrap: wrap; align-items: center; gap: clamp(28px, 5vw, 56px); margin-top: 22px; }
.trust-row img { height: 26px; width: auto; filter: grayscale(1); opacity: 0.72; }

/* ---------- Testimonials ---------- */
.testimonial-grid { grid-column: 1 / 13; display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(28px, 4vw, 56px); }
.testimonial { padding-top: 26px; border-top: 1px solid var(--line); }
.testimonial blockquote { font-size: clamp(1.15rem, 1.7vw, 1.4rem); font-weight: 500; letter-spacing: -0.01em; line-height: 1.4; }
.testimonial-who { display: flex; align-items: center; gap: 12px; margin-top: 22px; }
.testimonial-who img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.testimonial-who strong { display: block; font-size: 0.92rem; }
.testimonial-who span { font-size: 0.85rem; color: var(--ink-soft); }

/* ---------- CTA band ---------- */
.cta-band { grid-column: 1 / 13; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cta-band h2 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); max-width: 20ch; }

/* ---------- Footer ---------- */
.site-footer { padding-block: clamp(56px, 7vw, 88px) 26px; }
.footer-top { grid-column: 1 / 13; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: clamp(24px, 4vw, 48px); }
.footer-brand img { height: 26px; margin-bottom: 18px; filter: brightness(0) invert(1); }
.footer-brand p.tagline { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; color: var(--white); max-width: 22ch; }
.footer-col h4 { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.5); margin-bottom: 16px; }
.footer-col ul { display: grid; gap: 12px; }
.footer-col a { font-size: 0.95rem; color: rgba(255,255,255,0.78); transition: color 0.2s var(--ease); }
.footer-col a:hover { color: var(--white); }
.footer-bottom {
  grid-column: 1 / 13;
  margin-top: clamp(40px, 6vw, 64px);
  padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,0.14);
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  font-size: 0.82rem; color: rgba(255,255,255,0.55);
}

/* ---------- Generic page hero (Cursos / Categoría / Nosotros / Contacto) ---------- */
.page-hero { padding-block: clamp(48px, 7vw, 84px) clamp(32px, 5vw, 56px); }
.page-hero h1 { font-size: clamp(2.2rem, 4.4vw, 3.4rem); margin-top: 16px; }
.page-hero .lede { margin-top: 18px; color: var(--ink-soft); font-size: 1.05rem; max-width: 60ch; }
.page-hero-media {
  margin-top: clamp(32px, 5vw, 48px);
  aspect-ratio: 21 / 8;
  background: var(--ink);
  position: relative;
  overflow: hidden;
}
.page-hero-media::before {
  content: "";
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,0.05) 0 1px, transparent 1px 42px),
                     repeating-linear-gradient(90deg, rgba(255,255,255,0.05) 0 1px, transparent 1px 42px);
}
.page-hero-media span {
  position: absolute; left: clamp(20px,3vw,34px); bottom: clamp(18px,3vw,28px);
  font-family: var(--font-mono); color: rgba(255,255,255,0.65); font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase;
}

/* ---------- Cursos: search + filters ---------- */
.catalog-toolbar { grid-column: 1 / 13; display: flex; align-items: center; gap: 20px; padding-block: 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: clamp(32px, 5vw, 48px); }
.search-field { flex: 1; display: flex; align-items: center; gap: 12px; }
.search-field svg { color: var(--ink-faint); flex: none; }
.search-field input {
  flex: 1; border: none; outline: none; background: transparent;
  font-family: var(--font-sans); font-size: 1.05rem; color: var(--ink);
}
.search-field input::placeholder { color: var(--ink-faint); }
.result-count { font-family: var(--font-mono); font-size: 0.82rem; color: var(--ink-faint); white-space: nowrap; }

.catalog-layout { grid-column: 1 / 13; display: grid; grid-template-columns: 220px 1fr; gap: clamp(32px, 4vw, 56px); align-items: start; }
.filter-col h4 { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 16px; }
.filter-list { display: grid; gap: 4px; }
.filter-btn {
  display: flex; justify-content: space-between; width: 100%; text-align: left;
  padding: 10px 0; border: none; background: none; cursor: pointer;
  font-size: 0.95rem; color: var(--ink-soft); border-bottom: 1px solid var(--line);
}
.filter-btn span.count { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-faint); }
.filter-btn.is-active { color: var(--ink); font-weight: 700; }
.filter-btn.is-active span.count { color: var(--orange); }
.catalog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--col-gap); }
.empty-state { padding-block: 60px; text-align: center; color: var(--ink-soft); font-size: 0.98rem; }

/* ---------- Two-column editorial (Nosotros) ---------- */
.editorial-2col { grid-column: 1 / 13; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 64px); }
.editorial-2col h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
.editorial-2col .col p + p { margin-top: 16px; }
.editorial-2col .col p { color: var(--ink-soft); font-size: 1.02rem; }

.stat-row { grid-column: 1 / 13; display: grid; grid-template-columns: repeat(3, 1fr); }
.stat-item { padding: 0 var(--col-gap); border-left: 1px solid var(--line); }
.stat-item:first-child { padding-left: 0; border-left: none; }
.stat-item strong { display: block; font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 800; letter-spacing: -0.02em; }
.stat-item span { color: var(--ink-soft); font-size: 0.92rem; }

.team-grid { grid-column: 1 / 13; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--col-gap); }
.team-card .team-photo { aspect-ratio: 3/4; background: var(--surface); position: relative; overflow: hidden; }
.team-card .team-photo::after { content: attr(data-initials); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 1.6rem; color: var(--ink-faint); }
.team-card h3 { font-size: 0.98rem; margin-top: 14px; }
.team-card span { font-size: 0.85rem; color: var(--ink-soft); }

.values-list { grid-column: 1 / 13; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--col-gap); }
.value-item { padding-top: 18px; border-top: 1px solid var(--line); }
.value-item h3 { font-size: 1.02rem; }
.value-item p { color: var(--ink-soft); font-size: 0.9rem; margin-top: 6px; }

/* ---------- Contacto ---------- */
.contact-layout { grid-column: 1 / 13; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 64px); }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; }
.field label { font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); }
.field input, .field textarea {
  border: none; border-bottom: 1px solid var(--line); padding: 10px 2px;
  font-family: var(--font-sans); font-size: 1rem; color: var(--ink); background: transparent; outline: none;
  transition: border-color 0.2s var(--ease);
}
.field input:focus, .field textarea:focus { border-color: var(--ink); }
.field textarea { resize: vertical; min-height: 100px; }
.contact-info-list { display: grid; gap: 22px; }
.contact-info-item { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.contact-info-item h4 { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 8px; }
.contact-info-item p, .contact-info-item a { font-size: 1.02rem; }
.faq-item { padding-block: 18px; border-top: 1px solid var(--line); }
.faq-item summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-family: var(--font-mono); color: var(--ink-faint); }
.faq-item[open] summary::after { content: "–"; }
.faq-item p { margin-top: 12px; color: var(--ink-soft); font-size: 0.95rem; }

/* ---------- Reveal ---------- */
[data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity 0.35s var(--ease), transform 0.35s var(--ease); }
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .hero-copy { grid-column: 1 / 13; }
  .hero-visual { grid-column: 1 / 13; margin-top: 32px; aspect-ratio: 16/9; }
  .hero-panel { aspect-ratio: 16/9; }
  .footer-top { grid-template-columns: 1fr 1fr; row-gap: 32px; }
  .catalog-layout { grid-template-columns: 1fr; }
  .filter-list { display: flex; flex-wrap: wrap; gap: 10px; }
  .filter-btn { width: auto; border: 1px solid var(--line); padding: 8px 14px; gap: 8px; }
}

@media (max-width: 860px) {
  .benefits-strip { grid-template-columns: 1fr; }
  .benefit-item { border-left: none; border-top: 1px solid var(--line); padding-left: 0; padding-block: 24px; }
  .benefit-item:first-child { border-top: none; }
  .course-list, .catalog-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-row { grid-template-columns: 1fr; gap: 28px; }
  .testimonial-grid { grid-template-columns: 1fr; }
  .editorial-2col { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr; }
  .stat-item { border-left: none; border-top: 1px solid var(--line); padding: 22px 0 0; }
  .stat-item:first-child { border-top: none; }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
  .values-list { grid-template-columns: repeat(2, 1fr); }
  .contact-layout { grid-template-columns: 1fr; }
  .category-row { grid-template-columns: 50px 1fr 26px; }
  .category-desc { display: none; }
}

@media (max-width: 720px) {
  .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--white); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 8px var(--gutter) 18px; }
  .main-nav.is-open { display: flex; }
  .main-nav a { padding: 14px 4px; border-bottom: 1px solid var(--line); }
  .main-nav a::after { display: none; }
  .site-header { position: sticky; }
  .header-row { position: relative; height: 64px; }
  .header-actions .text-link { display: none; }
  .nav-toggle { display: inline-flex; }
  .course-list, .catalog-grid { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
  .values-list { grid-template-columns: 1fr; }
  .cta-band { flex-direction: column; align-items: flex-start; }
}
