/* ==== Tokens ==== */
:root {
  --grafito: #1B1F23;
  --grafito-deep: #14171A;
  --ambar: #E2762B;
  --ambar-soft: rgba(226, 118, 43, 0.16);
  --hueso: #F4F1EA;
  --hueso-dim: rgba(244, 241, 234, 0.72);
  --acero: #3A5A6D;
  --font-head: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --wrap: 1120px;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--grafito);
  color: var(--hueso);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 16px;
}
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.15rem; margin-bottom: 8px; }
p { margin: 0 0 16px; }

a { color: inherit; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ambar); color: var(--grafito); padding: 10px 16px; z-index: 200;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ==== Buttons ==== */
.btn {
  display: inline-block;
  text-decoration: none;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 22px;
  border-radius: 999px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: none;
  cursor: pointer;
}
.btn-amber { background: var(--ambar); color: var(--grafito-deep); }
.btn-amber:hover { transform: translateY(-1px); box-shadow: 0 8px 24px -8px var(--ambar); }
.btn-ghost { background: transparent; border: 1px solid var(--acero); color: var(--hueso); }
.btn-ghost:hover { border-color: var(--ambar); color: var(--ambar); }
.section-light .btn-ghost { border-color: rgba(27, 31, 35, 0.3); color: var(--grafito); }
.btn-lg { padding: 16px 30px; font-size: 1.05rem; }

/* ==== Header ==== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(27, 31, 35, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(244, 241, 234, 0.08);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px; position: relative;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; flex-shrink: 0; }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; letter-spacing: -0.01em; }
.brand-name-sm { font-family: var(--font-head); font-weight: 700; }

.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a { text-decoration: none; font-size: 0.95rem; color: var(--hueso-dim); }
.site-nav a:hover { color: var(--hueso); }
.site-nav a[aria-current="page"] { color: var(--ambar); }
.site-nav a.nav-cta { margin-left: 4px; }
.site-nav a.nav-cta, .site-nav a.nav-cta[aria-current="page"] { color: var(--grafito-deep); }

.nav-toggle-input { display: none; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 6px; }
.nav-toggle span { width: 22px; height: 2px; background: var(--hueso); display: block; }

@media (max-width: 780px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute; top: 72px; left: 0; right: 0;
    background: var(--grafito);
    flex-direction: column; align-items: flex-start; gap: 18px;
    padding: 20px 24px 28px;
    border-bottom: 1px solid rgba(244, 241, 234, 0.08);
    display: none;
  }
  .nav-toggle-input:checked ~ .site-nav { display: flex; }
  .site-nav a.nav-cta { margin-left: 0; }
}

/* ==== Hero ==== */
.hero { position: relative; overflow: hidden; padding: 96px 0 88px; }
.hero-inner { position: relative; z-index: 1; }
.glow {
  position: absolute; top: -180px; right: -120px;
  width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle, var(--ambar-soft), transparent 70%);
  pointer-events: none;
}
.glow-alt { top: auto; bottom: -220px; left: -160px; right: auto; }

.eyebrow, .kicker {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ambar);
  margin-bottom: 18px;
}

.hero-sub { font-size: 1.15rem; color: var(--hueso-dim); max-width: 640px; }
.hero-actions { margin-top: 28px; }
.hero-actions .btn + .btn, .hero-actions .btn + a { margin-left: 14px; }
.hero-note { font-size: 0.85rem; color: var(--hueso-dim); margin-top: 12px; }

/* ==== Page hero (inner pages) ==== */
.page-hero { position: relative; overflow: hidden; padding: 72px 0 60px; }
.page-hero h1 { max-width: 760px; }
.page-hero-sub { font-size: 1.05rem; color: var(--hueso-dim); max-width: 640px; }

/* ==== Sections generic ==== */
section { padding: 88px 0; }
.section-lead { font-size: 1.1rem; color: var(--hueso-dim); max-width: 680px; }

.problema, .metodo, .cta-final { background: var(--grafito); }
.servicios, .sobre-nosotros { background: var(--hueso); color: var(--grafito); }
.servicios .kicker, .sobre-nosotros .kicker { color: var(--ambar); }
.servicios .section-lead, .sobre-nosotros p { color: rgba(27, 31, 35, 0.72); }
.cta-final { position: relative; overflow: hidden; text-align: center; padding-bottom: 100px; }
.cta-final .section-lead { margin: 0 auto 8px; }
.cta-final .hero-actions { display: flex; flex-direction: column; align-items: center; }

/* Reusable light/dark section utilities for inner pages */
.section-light { background: var(--hueso); color: var(--grafito); }
.section-light .kicker { color: var(--ambar); }
.section-light .section-lead,
.section-light p { color: rgba(27, 31, 35, 0.72); }
.section-light h1, .section-light h2, .section-light h3 { color: var(--grafito); }
.section-dark { background: var(--grafito); }

/* ==== Calculadora ==== */
.calc-card {
  background: var(--grafito-deep);
  border: 1px solid rgba(244, 241, 234, 0.1);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  align-items: center;
  justify-content: space-between;
  margin-top: 30px;
}
.calc-inputs { display: flex; gap: 24px; flex-wrap: wrap; }
.calc-inputs label {
  display: flex; flex-direction: column; gap: 8px;
  font-size: 0.85rem; color: var(--hueso-dim);
  font-family: var(--font-mono);
}
.calc-inputs input {
  width: 130px;
  background: var(--grafito);
  border: 1px solid var(--acero);
  color: var(--hueso);
  font-family: var(--font-mono);
  font-size: 1rem;
  padding: 10px 12px;
  border-radius: 8px;
}
.calc-inputs input:focus { outline: 2px solid var(--ambar); }
.calc-result { text-align: right; }
.calc-label { display: block; font-size: 0.85rem; color: var(--hueso-dim); margin-bottom: 6px; }
.calc-amount {
  display: block; font-family: var(--font-mono); font-weight: 600;
  font-size: 2.4rem; color: var(--ambar); line-height: 1;
}
.calc-fineprint { display: block; font-size: 0.75rem; color: var(--hueso-dim); margin-top: 8px; font-family: var(--font-mono); }
.calc-disclaimer { font-size: 0.85rem; color: var(--hueso-dim); margin-top: 18px; }

@media (max-width: 640px) {
  .calc-result { text-align: left; }
  .calc-card { flex-direction: column; align-items: flex-start; }
}

/* ==== Servicios / cards ==== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 32px;
}
.card {
  background: var(--grafito);
  color: var(--hueso);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
}
.card-featured { border: 1px solid var(--ambar); }
.card-tag {
  position: absolute; top: -12px; left: 24px;
  background: var(--ambar); color: var(--grafito-deep);
  font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 4px 10px; border-radius: 999px;
}
.card-icon { width: 36px; height: 36px; stroke: var(--ambar); fill: none; margin-bottom: 14px; }
.card p { color: var(--hueso-dim); font-size: 0.95rem; margin-bottom: 0; }
.card a.card-link { display: inline-block; margin-top: 12px; color: var(--ambar); font-size: 0.9rem; text-decoration: none; font-family: var(--font-mono); }
.card a.card-link:hover { text-decoration: underline; }

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

/* ==== Metodo ==== */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 36px; }
.step-num { font-family: var(--font-mono); color: var(--acero); font-size: 1.6rem; display: block; margin-bottom: 10px; }
.step p { color: var(--hueso-dim); }

@media (max-width: 780px) {
  .steps { grid-template-columns: 1fr; }
}

/* ==== Sobre nosotros ==== */
.sobre-nosotros-inner { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: center; }
.sobre-nosotros-mark svg { width: 100%; max-width: 260px; margin: 0 auto; display: block; opacity: 0.85; }

@media (max-width: 780px) {
  .sobre-nosotros-inner { grid-template-columns: 1fr; }
  .sobre-nosotros-mark { order: -1; }
  .sobre-nosotros-mark svg { max-width: 160px; }
}

/* ==== Tags / pills ==== */
.tag-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.tag {
  font-family: var(--font-mono); font-size: 0.8rem; padding: 6px 14px;
  border-radius: 999px; border: 1px solid var(--acero); color: var(--hueso-dim);
}
.section-light .tag,
.servicios .tag,
.sobre-nosotros .tag { border-color: rgba(27, 31, 35, 0.25); color: rgba(27, 31, 35, 0.65); }

/* ==== Note / disclaimer banner ==== */
.note-banner {
  border: 1px solid rgba(226, 118, 43, 0.4);
  background: var(--ambar-soft);
  border-radius: var(--radius);
  padding: 18px 22px;
  font-size: 0.9rem;
  color: var(--hueso-dim);
  margin: 28px 0;
}
.section-light .note-banner { color: rgba(27, 31, 35, 0.75); }

/* ==== Values grid (sobre nosotros) ==== */
.values-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 36px; }
.value-item h3 { font-size: 1.05rem; }
.value-item p { font-size: 0.95rem; }
@media (max-width: 780px) { .values-grid { grid-template-columns: 1fr; } }

/* ==== Service detail rows ==== */
.service-detail {
  display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center;
  padding: 52px 0; border-bottom: 1px solid rgba(244, 241, 234, 0.08);
}
.service-detail:last-child { border-bottom: none; }
.service-detail-icon { width: 44px; height: 44px; stroke: var(--ambar); fill: none; margin-bottom: 14px; }
.service-detail-meta {
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--acero);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; display: block;
}
.service-detail h2 { margin-bottom: 10px; }
.service-detail ul { margin: 16px 0; padding-left: 20px; color: var(--hueso-dim); }
.service-detail li { margin-bottom: 8px; }

@media (max-width: 780px) {
  .service-detail { grid-template-columns: 1fr; gap: 18px; }
}

/* ==== Case cards ==== */
.cases-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 32px; }
.case-card {
  background: var(--grafito-deep); border: 1px solid rgba(244, 241, 234, 0.1);
  border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
}
.case-card-image { width: 100%; height: 160px; object-fit: cover; display: block; }
.case-card-body { padding: 24px 28px 28px; display: flex; flex-direction: column; flex: 1; }
.case-card-tag {
  font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--acero); margin-bottom: 12px;
}
.case-card h3 { color: var(--hueso); }
.case-card p { color: var(--hueso-dim); font-size: 0.92rem; }
.case-stat-row { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid rgba(244, 241, 234, 0.08); }
.case-stat-row > div { display: flex; align-items: baseline; gap: 8px; }
.case-stat { font-family: var(--font-mono); font-size: 1.25rem; color: var(--ambar); font-weight: 600; }
.case-stat-label { font-size: 0.75rem; color: var(--hueso-dim); text-transform: uppercase; letter-spacing: 0.04em; }

@media (max-width: 640px) { .cases-grid { grid-template-columns: 1fr; } }

/* ==== Contact layout ==== */
.contact-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: start; margin-top: 16px; }
.contact-form { display: flex; flex-direction: column; gap: 16px; }
.contact-form .field { display: flex; flex-direction: column; }
.contact-form label {
  font-size: 0.85rem; color: var(--hueso-dim); font-family: var(--font-mono);
  margin-bottom: 6px;
}
.contact-form input, .contact-form select, .contact-form textarea {
  width: 100%; background: var(--grafito-deep); border: 1px solid var(--acero); color: var(--hueso);
  font-family: var(--font-body); font-size: 1rem; padding: 12px 14px; border-radius: 8px;
}
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus { outline: 2px solid var(--ambar); }
.contact-form textarea { min-height: 130px; resize: vertical; }
.contact-form button { align-self: flex-start; margin-top: 6px; }
.form-status { font-size: 0.85rem; color: var(--hueso-dim); min-height: 1.2em; }

.contact-info {
  background: var(--grafito-deep); border: 1px solid rgba(244, 241, 234, 0.1);
  border-radius: var(--radius); padding: 32px;
}
.contact-info h3 { margin-bottom: 6px; }
.contact-info a { color: var(--ambar); text-decoration: none; }
.contact-info a:hover { text-decoration: underline; }
.contact-info-item { margin-bottom: 22px; }
.contact-info-item:last-child { margin-bottom: 0; }
.contact-info-item p { margin-bottom: 6px; }

@media (max-width: 860px) {
  .contact-grid { grid-template-columns: 1fr; }
}

/* ==== Footer ==== */
.site-footer { background: var(--grafito-deep); border-top: 1px solid rgba(244, 241, 234, 0.08); }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 32px; padding: 44px 0 28px; }
.footer-brand .brand { margin-bottom: 10px; }
.footer-brand p { color: var(--hueso-dim); font-size: 0.85rem; margin-top: 10px; margin-bottom: 0; }
.footer-heading {
  font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--hueso-dim); margin-bottom: 14px;
}
.footer-nav, .footer-contact { display: flex; flex-direction: column; gap: 10px; font-size: 0.9rem; }
.footer-nav a, .footer-contact a { color: var(--hueso-dim); text-decoration: none; }
.footer-nav a:hover, .footer-contact a:hover { color: var(--hueso); }
.footer-bottom {
  border-top: 1px solid rgba(244, 241, 234, 0.08); padding: 18px 0;
  font-size: 0.8rem; color: var(--hueso-dim);
}

@media (max-width: 780px) {
  .footer-grid { grid-template-columns: 1fr; gap: 24px; padding: 36px 0 20px; }
}

/* ==== Reveal animation (progressive enhancement — visible by default without JS) ==== */
.reveal { opacity: 1; transform: none; }
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ==== Asistente de chat ==== */
.molvana-chat-toggle {
  position: fixed; right: 20px; bottom: 20px; z-index: 150;
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--ambar); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.6);
  transition: transform 0.15s ease;
}
.molvana-chat-toggle:hover { transform: translateY(-2px); }
.molvana-chat-toggle svg { width: 26px; height: 26px; stroke: var(--grafito-deep); fill: none; }

.molvana-chat-panel {
  position: fixed; right: 20px; bottom: 90px; z-index: 150;
  width: min(360px, calc(100vw - 40px)); height: min(500px, calc(100vh - 140px));
  background: var(--grafito-deep); border: 1px solid rgba(244, 241, 234, 0.12);
  border-radius: var(--radius); box-shadow: 0 24px 60px -16px rgba(0, 0, 0, 0.65);
  display: flex; flex-direction: column; overflow: hidden;
}

.molvana-chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid rgba(244, 241, 234, 0.1);
}
.molvana-chat-header-title { font-family: var(--font-head); font-weight: 700; font-size: 1rem; color: var(--hueso); }
.molvana-chat-close {
  background: none; border: none; color: var(--hueso-dim); font-size: 1.4rem;
  line-height: 1; cursor: pointer; padding: 4px;
}
.molvana-chat-close:hover { color: var(--hueso); }

.molvana-chat-messages {
  flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px;
}
.molvana-chat-msg {
  max-width: 85%; padding: 10px 14px; border-radius: 14px;
  font-size: 0.92rem; line-height: 1.45; word-wrap: break-word;
}
.molvana-chat-msg a { color: inherit; text-decoration: underline; }
.molvana-chat-msg-bot {
  align-self: flex-start; background: var(--grafito); color: var(--hueso);
  border-bottom-left-radius: 4px;
}
.molvana-chat-msg-user {
  align-self: flex-end; background: var(--ambar); color: var(--grafito-deep);
  border-bottom-right-radius: 4px;
}
.molvana-chat-typing { display: flex; gap: 4px; align-items: center; padding: 12px 14px; }
.molvana-chat-typing span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--hueso-dim);
  animation: molvana-chat-blink 1.2s infinite ease-in-out;
}
.molvana-chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.molvana-chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes molvana-chat-blink {
  0%, 80%, 100% { opacity: 0.3; }
  40% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .molvana-chat-typing span { animation: none; opacity: 0.7; }
}

.molvana-chat-form {
  display: flex; gap: 8px; padding: 12px 16px;
  border-top: 1px solid rgba(244, 241, 234, 0.1);
}
.molvana-chat-input {
  flex: 1; background: var(--grafito); border: 1px solid var(--acero); color: var(--hueso);
  font-family: var(--font-body); font-size: 0.9rem; padding: 10px 12px; border-radius: 999px;
}
.molvana-chat-input:focus { outline: 2px solid var(--ambar); }
.molvana-chat-send {
  width: 38px; height: 38px; border-radius: 50%; background: var(--ambar); border: none;
  display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
}
.molvana-chat-send svg { width: 18px; height: 18px; stroke: var(--grafito-deep); fill: none; }

.molvana-chat-footer {
  padding: 10px 16px; border-top: 1px solid rgba(244, 241, 234, 0.1);
  text-align: center;
}
.molvana-chat-footer a { color: var(--ambar); font-size: 0.85rem; text-decoration: none; }
.molvana-chat-footer a:hover { text-decoration: underline; }

@media (max-width: 480px) {
  .molvana-chat-toggle { right: 16px; bottom: 16px; }
  .molvana-chat-panel { right: 12px; bottom: 84px; }
}
