/* =========================================================
   Capacitaciones Guatemala — styles
   Modern single-page site. Edit brand colors in :root.
   ========================================================= */

/* ---------- Design tokens ---------- */
:root {
  --primary: #0a3d62;      /* deep navy */
  --primary-2: #0e7c86;    /* teal */
  --accent: #f9a826;       /* amber */
  --accent-2: #13a0ac;

  --ink: #15232e;          /* main text */
  --muted: #5b6b78;        /* secondary text */
  --line: #e4e9ee;         /* borders */
  --bg: #ffffff;
  --bg-soft: #f4f7f9;
  --bg-dark: #0a3d62;
  --white: #ffffff;

  --grad: linear-gradient(135deg, var(--primary-2) 0%, var(--primary) 100%);
  --grad-accent: linear-gradient(135deg, var(--accent) 0%, #f57f17 100%);

  --shadow-sm: 0 2px 8px rgba(10, 61, 98, .06);
  --shadow: 0 10px 30px rgba(10, 61, 98, .10);
  --shadow-lg: 0 20px 50px rgba(10, 61, 98, .18);

  --radius: 16px;
  --radius-sm: 10px;
  --container: 1160px;

  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --header-h: 72px;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; color: var(--primary); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1rem; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 22px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .85rem 1.6rem; border-radius: 999px;
  font-weight: 600; font-size: .98rem; cursor: pointer;
  border: 2px solid transparent; transition: transform .2s, box-shadow .2s, background .2s, color .2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-3px); }
.btn-primary { background: var(--grad-accent); color: #1a1205; box-shadow: 0 8px 20px rgba(249,168,38,.35); }
.btn-primary:hover { box-shadow: 0 12px 26px rgba(249,168,38,.45); }
.btn-ghost { background: transparent; color: var(--white); border-color: rgba(255,255,255,.6); }
.btn-ghost:hover { background: rgba(255,255,255,.12); border-color: #fff; }
.btn-outline { background: transparent; color: var(--primary-2); border-color: var(--primary-2); }
.btn-outline:hover { background: var(--primary-2); color: #fff; }

/* ---------- Top bar ---------- */
.topbar {
  background: var(--primary);
  color: rgba(255,255,255,.9);
  font-size: .85rem;
}
.topbar .container { display: flex; gap: 1.5rem; justify-content: flex-end; align-items: center; min-height: 40px; flex-wrap: wrap; }
.topbar a { display: inline-flex; align-items: center; gap: .4rem; transition: color .2s; }
.topbar a:hover { color: var(--accent); }
.topbar svg { width: 16px; height: 16px; fill: currentColor; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: box-shadow .3s, border-color .3s;
}
.site-header.scrolled { box-shadow: var(--shadow-sm); border-color: var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: 1rem; }
.brand img { height: 40px; width: auto; }
.nav-links { display: flex; align-items: center; gap: .35rem; }
.nav-links a {
  padding: .55rem .9rem; border-radius: 999px; font-weight: 500; color: var(--ink);
  position: relative; transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--primary-2); }
.nav-links a.active { color: var(--primary-2); background: var(--bg-soft); }
.nav-cta { margin-left: .5rem; }

.nav-toggle {
  display: none; width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer;
  padding: 10px; border-radius: 10px;
}
.nav-toggle span { display: block; height: 2.5px; background: var(--primary); border-radius: 2px; transition: transform .3s, opacity .3s; }
.nav-toggle span + span { margin-top: 5px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { position: relative; background: var(--grad); color: #fff; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 10%, rgba(249,168,38,.25), transparent 45%),
              radial-gradient(circle at 0% 90%, rgba(19,160,172,.35), transparent 40%);
}
.hero .container { position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center; padding-block: clamp(3rem, 7vw, 6rem); }
.hero h1 { color: #fff; font-size: clamp(2.1rem, 5vw, 3.4rem); margin-bottom: .4em; }
.hero .eyebrow { display: inline-block; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; font-size: .8rem; color: var(--accent); background: rgba(255,255,255,.1); padding: .4rem .9rem; border-radius: 999px; margin-bottom: 1.2rem; }
.hero p.lead { font-size: 1.15rem; color: rgba(255,255,255,.9); max-width: 32ch; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.8rem; }
.hero-art { position: relative; }
.hero-art img { border-radius: 24px; box-shadow: var(--shadow-lg); }
.hero-badge {
  position: absolute; bottom: -22px; left: -22px; background: #fff; color: var(--primary);
  border-radius: 16px; padding: .9rem 1.2rem; box-shadow: var(--shadow); display: flex; gap: .7rem; align-items: center;
}
.hero-badge strong { font-size: 1.4rem; display: block; line-height: 1; }
.hero-badge span { font-size: .78rem; color: var(--muted); }
.hero-wave { position: relative; display: block; width: 100%; height: auto; margin-top: -1px; }

/* ---------- Section scaffolding ---------- */
.section { padding-block: clamp(3.5rem, 7vw, 6rem); }
.section.alt { background: var(--bg-soft); }
.section-head { max-width: 720px; margin: 0 auto 3rem; text-align: center; }
.section-head .eyebrow { color: var(--primary-2); font-weight: 600; letter-spacing: 2px; text-transform: uppercase; font-size: .8rem; }
.section-head p { color: var(--muted); font-size: 1.05rem; }

/* ---------- Nosotros ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.about-media { position: relative; }
.about-media img { border-radius: var(--radius); box-shadow: var(--shadow); }
.about-text h2 { text-align: left; }
.values { display: grid; gap: 1rem; margin-top: 1.5rem; }
.value { display: flex; gap: .9rem; align-items: flex-start; }
.value .ico { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; background: var(--bg-soft); display: grid; place-items: center; color: var(--primary-2); }
.value .ico svg { width: 22px; height: 22px; }
.value h3 { margin: 0 0 .15rem; font-size: 1.05rem; }
.value p { margin: 0; color: var(--muted); font-size: .95rem; }

/* ---------- Stats / counters ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; margin-top: 3.5rem; }
.stat { text-align: center; padding: 1.5rem 1rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.stat .num { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; color: var(--primary-2); line-height: 1; }
.stat .num::before { content: "+"; color: var(--accent); }
.stat .label { color: var(--muted); font-size: .9rem; margin-top: .4rem; }

/* ---------- Servicios ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem 1.6rem;
  box-shadow: var(--shadow-sm); transition: transform .25s, box-shadow .25s, border-color .25s;
  position: relative; overflow: hidden;
}
.card::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--grad-accent); transform: scaleX(0); transform-origin: left; transition: transform .3s; }
.card:hover { transform: translateY(-8px); box-shadow: var(--shadow); border-color: transparent; }
.card:hover::after { transform: scaleX(1); }
.card .ico { width: 56px; height: 56px; border-radius: 14px; background: var(--grad); display: grid; place-items: center; margin-bottom: 1.1rem; color: #fff; }
.card .ico svg { width: 28px; height: 28px; }
.card h3 { color: var(--primary); }
.card p { color: var(--muted); margin: 0; font-size: .96rem; }

/* ---------- Nuestro Trabajo ---------- */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.work {
  position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
  aspect-ratio: 4 / 3;
}
.work img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.work:hover img { transform: scale(1.08); }
.work .overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 1.2rem; color: #fff;
  background: linear-gradient(to top, rgba(10,61,98,.85), rgba(10,61,98,0) 65%);
  opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .3s;
}
.work:hover .overlay { opacity: 1; transform: translateY(0); }
.work .overlay h3 { color: #fff; margin: 0 0 .2rem; font-size: 1.1rem; }
.work .overlay span { font-size: .85rem; color: rgba(255,255,255,.85); }

/* ---------- Contacto ---------- */
.contact-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 2.5rem; align-items: start; }
.contact-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.5rem, 3vw, 2.5rem); box-shadow: var(--shadow-sm); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 500; font-size: .9rem; margin-bottom: .4rem; color: var(--ink); }
.field input, .field textarea {
  width: 100%; padding: .85rem 1rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  font: inherit; color: var(--ink); background: var(--bg-soft); transition: border-color .2s, background .2s, box-shadow .2s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--primary-2); background: #fff; box-shadow: 0 0 0 3px rgba(14,124,134,.12); }
.field textarea { resize: vertical; min-height: 130px; }
.field .error { color: #c0392b; font-size: .82rem; margin-top: .35rem; display: none; }
.field.invalid input, .field.invalid textarea { border-color: #c0392b; }
.field.invalid .error { display: block; }
.form-note { font-size: .82rem; color: var(--muted); margin-top: .5rem; }

.contact-info { display: grid; gap: 1.25rem; align-content: start; }
.info-item { display: flex; gap: .9rem; align-items: flex-start; }
.info-item .ico { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 12px; background: var(--grad); display: grid; place-items: center; color: #fff; }
.info-item .ico svg { width: 22px; height: 22px; }
.info-item h3 { font-size: 1rem; margin: 0 0 .15rem; }
.info-item a, .info-item p { color: var(--muted); margin: 0; }
.info-item a:hover { color: var(--primary-2); }
.socials { display: flex; gap: .6rem; margin-top: .3rem; }
.socials a { width: 42px; height: 42px; border-radius: 50%; background: var(--bg-soft); display: grid; place-items: center; color: var(--primary); transition: transform .2s, background .2s, color .2s; }
.socials a:hover { transform: translateY(-3px); background: var(--primary-2); color: #fff; }
.socials svg { width: 20px; height: 20px; fill: currentColor; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-dark); color: rgba(255,255,255,.8); padding-block: 2.5rem; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; }
.site-footer img { height: 38px; }
.site-footer a { color: rgba(255,255,255,.85); }
.site-footer a:hover { color: var(--accent); }
.site-footer small { color: rgba(255,255,255,.6); }

/* ---------- Floating WhatsApp ---------- */
.float-wa {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  width: 58px; height: 58px; border-radius: 50%; background: #25d366; color: #fff;
  display: grid; place-items: center; box-shadow: 0 10px 24px rgba(37,211,102,.45);
  transition: transform .2s; animation: wa-pulse 2.4s infinite;
}
.float-wa:hover { transform: scale(1.08); }
.float-wa svg { width: 32px; height: 32px; fill: #fff; }
@keyframes wa-pulse { 0% { box-shadow: 0 0 0 0 rgba(37,211,102,.5); } 70% { box-shadow: 0 0 0 16px rgba(37,211,102,0); } 100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); } }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }
.reveal.d4 { transition-delay: .32s; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero .container { grid-template-columns: 1fr; text-align: center; }
  .hero p.lead { max-width: none; margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .hero-art { max-width: 480px; margin: 0 auto; }
  .about-grid { grid-template-columns: 1fr; }
  .about-media { order: -1; }
  .cards, .gallery { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .nav-cta { display: none; }
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    padding: .5rem; transform-origin: top; max-height: 0; overflow: hidden;
    opacity: 0; transition: max-height .3s ease, opacity .25s ease;
  }
  .nav-links.open { max-height: 420px; opacity: 1; }
  .nav-links a { padding: .9rem 1rem; border-radius: 10px; }
  .nav-links a.active { background: var(--bg-soft); }
  .topbar .container { justify-content: center; gap: 1rem; }
}

@media (max-width: 520px) {
  .cards, .gallery, .form-row { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .hero-badge { left: 50%; transform: translateX(-50%); bottom: -26px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
