/* ===========================================================================
   CONAFUT — Sitio estático
   Estilo inspirado en saybriefly.com con la paleta y marca de CONAFUT
   =========================================================================== */

:root {
  --cf-primary: #2E7CD6;
  --cf-ink: #0B2A5B;
  --cf-cream: #FCFAF5;
  --cf-cream-alt: #F3EFE6;
  --cf-highlight: #FFE95C;
  --cf-note-mint: #D5F5C2;
  --cf-note-teal: #A8E5E5;
  --cf-note-blush: #F6D0FF;
  --cf-note-terracotta: #CB5521;
  --cf-pencil: #B6B6B6;

  --cf-font-display: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif;
  --cf-font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --cf-font-mono: 'Roboto Mono', ui-monospace, monospace;

  --cf-radius-nav: 999px;
  --cf-radius-card: 12px;
  --cf-shadow-nav: 0 2px 12px rgba(11, 42, 91, 0.08);
  --cf-shadow-card: 0 2px 8px rgba(11, 42, 91, 0.06);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cf-cream);
  color: var(--cf-ink);
  font-family: var(--cf-font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

a { color: var(--cf-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--cf-font-display);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--cf-ink);
  margin: 0 0 0.5em;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------------------------------------------------------------------------
   Header: píldora sticky con glint + hide-on-scroll (estilo Say Briefly)
   ------------------------------------------------------------------------- */
.cf-header {
  position: sticky;
  top: 12px;
  z-index: 100;
  transition: transform 0.3s ease;
}

.cf-header.cf-header-hidden { transform: translateY(-115%); }

.cf-nav-pill {
  position: relative;
  overflow: hidden;
  max-width: 1180px;
  margin: 12px auto 0;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(252, 250, 245, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--cf-pencil);
  border-radius: var(--cf-radius-nav);
  box-shadow: var(--cf-shadow-nav);
}

.cf-nav-pill::before {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 233, 92, 0.45) 50%, transparent 100%);
  animation: cf-nav-glint 7s ease-in-out infinite;
  pointer-events: none;
}

@keyframes cf-nav-glint {
  0%, 70% { left: -60%; }
  85%, 100% { left: 130%; }
}

.cf-logo { display: flex; align-items: center; flex-shrink: 0; }
.cf-logo img { width: 140px; display: block; }

.cf-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cf-nav a {
  font-weight: 500;
  font-size: 14.5px;
  color: var(--cf-ink);
  padding: 6px 8px;
  border-radius: 8px;
  white-space: nowrap;
}

.cf-nav a:hover {
  background: var(--cf-highlight);
  text-decoration: none;
}

.cf-nav-ctas { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* ---------------------------------------------------------------------------
   Botones
   ------------------------------------------------------------------------- */
.btn {
  display: inline-block;
  font-family: var(--cf-font-body);
  font-weight: 600;
  font-size: 15px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1.5px solid var(--cf-ink);
  cursor: pointer;
  transition: letter-spacing 0.2s ease, transform 0.15s ease, background 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover { letter-spacing: 0.02em; text-decoration: none; }
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--cf-ink);
  color: var(--cf-cream);
}
.btn-primary:hover { background: var(--cf-primary); border-color: var(--cf-primary); color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--cf-ink);
}
.btn-outline:hover { background: var(--cf-highlight); color: var(--cf-ink); }

.btn-lg { padding: 14px 26px; font-size: 16px; }

.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: 8px; }

/* ---------------------------------------------------------------------------
   Menú móvil
   ------------------------------------------------------------------------- */
.cf-burger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 110;
}

.cf-burger svg { display: block; stroke: var(--cf-ink); }

.cf-mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 105;
  background: var(--cf-cream);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 90px 24px 40px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
}

.cf-mobile-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.cf-mobile-overlay a {
  font-family: var(--cf-font-display);
  font-weight: 700;
  font-size: 28px;
  color: var(--cf-ink);
  padding: 10px 16px;
  border-radius: 10px;
}

.cf-mobile-overlay a:hover { background: var(--cf-highlight); text-decoration: none; }

.cf-mobile-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.cf-mobile-close svg { stroke: var(--cf-ink); display: block; }

@media (max-width: 900px) {
  .cf-nav, .cf-nav-ctas { display: none; }
  .cf-burger { display: block; }
  .cf-nav-pill { margin: 8px 12px 0; padding: 8px 14px; }
  .cf-logo img { width: 120px; }
}

/* ---------------------------------------------------------------------------
   Secciones y utilidades de texto
   ------------------------------------------------------------------------- */
.cf-section { padding: 88px 0; }
@media (max-width: 900px) { .cf-section { padding: 48px 0; } }

.mono {
  font-family: var(--cf-font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cf-ink);
  opacity: 0.75;
  margin: 0 0 8px;
}

.highlight {
  background: var(--cf-highlight);
  padding: 0 8px;
  border-radius: 4px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.hero-title {
  font-size: clamp(38px, 6vw, 64px);
  margin: 0 0 20px;
}

.section-title { font-size: clamp(30px, 4vw, 48px); }

.subhead {
  font-size: 18px;
  color: var(--cf-ink);
  opacity: 0.85;
  max-width: 640px;
}

.badge {
  display: inline-block;
  font-family: var(--cf-font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--cf-highlight);
  color: var(--cf-ink);
  border: 1px solid var(--cf-ink);
  border-radius: 999px;
  padding: 8px 18px;
  margin-bottom: 28px;
}

/* ---------------------------------------------------------------------------
   Héroe
   ------------------------------------------------------------------------- */
.cf-hero { padding: 110px 0 72px; text-align: center; }
.cf-hero .subhead { margin: 0 auto 32px; }
.cf-hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
@media (max-width: 900px) { .cf-hero { padding: 72px 0 48px; } }

/* ---------------------------------------------------------------------------
   Tarjetas "nota" (pastel, estilo Say Briefly)
   ------------------------------------------------------------------------- */
.cf-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 900px) { .cf-cards { grid-template-columns: 1fr; } }

.note {
  border-radius: var(--cf-radius-card);
  padding: 24px;
  box-shadow: var(--cf-shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.note:hover {
  transform: translateY(-3px) rotate(-0.4deg);
  box-shadow: 0 8px 24px rgba(11, 42, 91, 0.12);
}

.note-mint { background: var(--cf-note-mint); }
.note-teal { background: var(--cf-note-teal); }
.note-blush { background: var(--cf-note-blush); }
.note-yellow { background: var(--cf-highlight); }
.note-alt { background: var(--cf-cream-alt); }
.note-ink { background: var(--cf-ink); color: var(--cf-cream); }
.note-ink h3, .note-ink .note-tag { color: var(--cf-cream); }
.note-ink a { color: var(--cf-highlight); }

.note-tag {
  display: inline-block;
  font-family: var(--cf-font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 4px 12px;
  margin: 0 0 14px;
  opacity: 0.8;
}

.note h3 { font-size: 22px; margin: 0 0 10px; }
.note p { font-size: 16px; margin: 0 0 14px; }
.note p:last-child { margin-bottom: 0; }
.note a { font-weight: 600; }

/* ---------------------------------------------------------------------------
   Bloques de contenido (páginas internas)
   ------------------------------------------------------------------------- */
.cf-page-head { padding: 96px 0 40px; }
@media (max-width: 900px) { .cf-page-head { padding: 64px 0 28px; } }

.cf-prose { max-width: 760px; }
.cf-prose p { margin: 0 0 18px; }
.cf-prose ul, .cf-prose ol { margin: 0 0 18px; padding-left: 22px; }
.cf-prose li { margin-bottom: 8px; }
.cf-prose h2 { font-size: clamp(24px, 3vw, 34px); margin-top: 40px; }
.cf-prose h3 { font-size: 22px; margin-top: 28px; }

.cf-split {
  display: grid;
  grid-template-columns: 55% 45%;
  gap: 48px;
  align-items: center;
}
@media (max-width: 900px) { .cf-split { grid-template-columns: 1fr; gap: 28px; } }

.cf-stack { display: flex; flex-direction: column; gap: 16px; }

/* ---------------------------------------------------------------------------
   Banda CTA
   ------------------------------------------------------------------------- */
.cta-band {
  background: var(--cf-highlight);
  border-top: 1.5px solid var(--cf-ink);
  border-bottom: 1.5px solid var(--cf-ink);
  text-align: center;
  padding: 72px 0;
}

.cta-band h2 { font-size: clamp(28px, 4vw, 44px); margin-bottom: 12px; }
.cta-band p { max-width: 560px; margin: 0 auto 28px; font-size: 18px; }

/* ---------------------------------------------------------------------------
   Consulta de certificados
   ------------------------------------------------------------------------- */
.consulta-form {
  display: flex;
  gap: 12px;
  max-width: 560px;
  margin: 0 auto;
}

.consulta-form input {
  flex: 1;
  font-family: var(--cf-font-body);
  font-size: 16px;
  padding: 14px 18px;
  border: 1.5px solid var(--cf-ink);
  border-radius: 10px;
  background: #fff;
  color: var(--cf-ink);
}

.consulta-form input:focus { outline: 2px solid var(--cf-primary); outline-offset: 1px; }

/* honeypot */
.consulta-hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

.consulta-msg {
  max-width: 760px;
  margin: 24px auto 0;
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 15px;
}
.consulta-msg.error { background: #FDE2E2; border: 1px solid #C0392B; color: #7B241C; }
.consulta-msg.info { background: var(--cf-note-teal); border: 1px solid var(--cf-ink); }

.consulta-result { max-width: 860px; margin: 32px auto 0; text-align: left; }
.consulta-result h3 { font-size: 24px; margin: 24px 0 8px; }
.consulta-result .nombre { font-size: 18px; font-weight: 600; }

.consulta-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  margin: 12px 0 8px;
  background: #fff;
  border: 1px solid var(--cf-pencil);
  border-radius: 10px;
  overflow: hidden;
  display: block;
  overflow-x: auto;
}

.consulta-table table { width: 100%; border-collapse: collapse; }
.consulta-table th {
  font-family: var(--cf-font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: left;
  padding: 12px 14px;
  background: var(--cf-ink);
  color: var(--cf-cream);
  white-space: nowrap;
}
.consulta-table td { padding: 12px 14px; border-top: 1px solid #E8E2D5; }
.consulta-table tr:hover td { background: var(--cf-cream); }

.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2.5px solid var(--cf-pencil);
  border-top-color: var(--cf-ink);
  border-radius: 50%;
  animation: cf-spin 0.7s linear infinite;
  vertical-align: middle;
}
@keyframes cf-spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------- */
.cf-footer {
  background: var(--cf-ink);
  color: var(--cf-cream);
  padding: 64px 0 36px;
  margin-top: 88px;
}

.cf-footer a { color: var(--cf-cream); opacity: 0.85; }
.cf-footer a:hover { color: var(--cf-highlight); opacity: 1; text-decoration: none; }

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
}
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-grid h4 {
  font-family: var(--cf-font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cf-highlight);
  margin: 0 0 14px;
}

.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 8px; font-size: 15px; }

.footer-logo { width: 150px; filter: brightness(0) invert(1); margin-bottom: 14px; }

.footer-bottom {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid rgba(252, 250, 245, 0.2);
  font-size: 13px;
  opacity: 0.7;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------------------------
   Animaciones de scroll (reveal estilo Say Briefly)
   ------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(28px) scale(0.98);
  transition: opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1), transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal-left { transform: translateX(-32px); }
.reveal-right { transform: translateX(32px); }
.reveal-zoom { transform: scale(0.94); }

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------------------------------------------------------------------------
   Entrada del héroe al cargar (como heroFadeUp/heroScaleIn de Say Briefly):
   cascada badge → titular → subhead → botones
   ------------------------------------------------------------------------- */
@keyframes cf-heroFadeUp {
  from { opacity: 0; transform: translateY(26px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.hero-anim {
  opacity: 0;
  animation: cf-heroFadeUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-d1 { animation-delay: 0.05s; }
.hero-d2 { animation-delay: 0.2s; }
.hero-d3 { animation-delay: 0.35s; }
.hero-d4 { animation-delay: 0.5s; }
.hero-d5 { animation-delay: 0.65s; }

/* Punto con pulso (ping) para badges */
.ping-dot {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--cf-ink);
  vertical-align: middle;
}

.ping-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--cf-ink);
  animation: cf-ping 1.6s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes cf-ping {
  0% { transform: scale(1); opacity: 0.7; }
  75%, 100% { transform: scale(2.6); opacity: 0; }
}

/* ---------------------------------------------------------------------------
   Doodles: ilustraciones sketch de fondo con movimiento continuo
   (el "movimiento" característico de Say Briefly son sus dibujos animados)
   Estructura: <div class="doodle" data-parallax="0.03"><svg class="doodle-float">…
   — el wrapper recibe el parallax del mouse (JS), el svg flota (CSS)
   ------------------------------------------------------------------------- */
.cf-hero, .cf-page-head, .cta-band, .cf-sketch-zone { position: relative; }
.cf-hero .container, .cf-page-head .container, .cta-band .container { position: relative; z-index: 1; }

.doodle {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  color: var(--cf-ink);
  opacity: 0.32;
  will-change: transform;
}

.doodle svg { display: block; overflow: visible; }

@keyframes cf-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(3deg); }
}

@keyframes cf-wobble {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}

.doodle-float > svg, svg.doodle-float { animation: cf-float 7s ease-in-out infinite; }
.doodle-wobble > svg, svg.doodle-wobble { animation: cf-wobble 5s ease-in-out infinite; }
.doodle-slow > svg, svg.doodle-slow { animation-duration: 11s; }
.doodle-delay-1 > svg, svg.doodle-delay-1 { animation-delay: 0.9s; }
.doodle-delay-2 > svg, svg.doodle-delay-2 { animation-delay: 1.8s; }
.doodle-delay-3 > svg, svg.doodle-delay-3 { animation-delay: 2.7s; }

@media (max-width: 900px) {
  .doodle { opacity: 0.18; }
}

/* Trazo que se dibuja solo (como los sketches de la referencia) */
.draw-in {
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: cf-draw 1.4s 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes cf-draw {
  to { stroke-dashoffset: 0; }
}

/* Respeto a usuarios con movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cf-nav-pill::before { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-anim { opacity: 1; animation: none; }
  .ping-dot::after { animation: none; }
  .doodle-float > svg, svg.doodle-float,
  .doodle-wobble > svg, svg.doodle-wobble { animation: none; }
  .draw-in { animation: none; stroke-dashoffset: 0; }
  .btn, .note, .cf-header { transition: none; }
}
