/* ==========================================================
   Bala · Reformas Integrales, Aluminio y PVC
   ========================================================== */

:root {
  --bg: #0b0d0d;
  --bg-2: #121515;
  --bg-3: #1a1e1e;
  --line: rgba(255, 255, 255, 0.12);
  --text: #f3f5f2;
  --muted: #9aa39e;
  --lime: #c8ff3d;
  --light: #eef0ea;
  --ink: #0b0d0d;
  --radius: 22px;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "DM Mono", ui-monospace, "SFMono-Regular", monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
h1, h2, h3, p { margin: 0; }
em { font-style: italic; color: var(--lime); font-weight: 600; }

.page-shell { position: relative; }
.section-pad { padding: clamp(72px, 10vw, 140px) clamp(20px, 5vw, 72px); }

/* Fondo ambiental */
.ambient { position: absolute; border-radius: 50%; filter: blur(120px); opacity: 0.18; pointer-events: none; z-index: 0; }
.ambient--one { width: 480px; height: 480px; background: var(--lime); top: -120px; right: -100px; }
.ambient--two { width: 380px; height: 380px; background: #2f6f5e; top: 900px; left: -140px; }
main, .site-footer { position: relative; z-index: 1; }

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px clamp(20px, 5vw, 72px);
  background: rgba(11, 13, 13, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}
.site-header.is-scrolled { border-color: var(--line); background: rgba(11, 13, 13, 0.9); }

.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark {
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--lime); color: var(--ink);
  font-weight: 800; letter-spacing: -0.02em;
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.15; }
.brand-copy strong { font-size: 1.1rem; font-weight: 800; }
.brand-copy small { font-family: var(--mono); font-size: 0.68rem; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }

.main-nav { display: flex; align-items: center; gap: 30px; font-size: 0.95rem; font-weight: 500; }
.main-nav a:not(.nav-cta) { color: var(--muted); transition: color 0.25s; }
.main-nav a:not(.nav-cta):hover { color: var(--text); }
.nav-cta {
  padding: 10px 20px; border-radius: 999px;
  background: var(--lime); color: var(--ink); font-weight: 700;
  transition: transform 0.3s var(--ease);
}
.nav-cta:hover { transform: translateY(-2px); }

.menu-toggle { display: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 12px; position: relative; }
.menu-toggle span { position: absolute; left: 12px; right: 12px; height: 2px; background: var(--text); transition: transform 0.3s var(--ease); }
.menu-toggle span:first-child { top: 17px; }
.menu-toggle span:last-child { top: 25px; }
.menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ---------- Elementos comunes ---------- */
.eyebrow {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--lime); margin-bottom: 22px;
}
.eyebrow-line { width: 34px; height: 1px; background: currentColor; }

h1, h2 { font-weight: 800; letter-spacing: -0.035em; line-height: 1.02; }
h1 { font-size: clamp(2.8rem, 7vw, 5.6rem); }
h2 { font-size: clamp(2.1rem, 4.6vw, 3.8rem); }
h3 { font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 28px; border-radius: 999px; font-weight: 700;
  transition: transform 0.3s var(--ease), box-shadow 0.3s;
}
.button--primary { background: var(--lime); color: var(--ink); }
.button--primary:hover { transform: translateY(-3px); box-shadow: 0 14px 36px rgba(200, 255, 61, 0.25); }
.button--full { width: 100%; }

.text-link { display: inline-flex; gap: 8px; font-weight: 600; border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.text-link--dark { color: var(--ink); }

.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; margin-bottom: 56px; flex-wrap: wrap; }
.heading-note { max-width: 420px; color: var(--muted); }
.section-heading--light h2 { color: var(--text); }

/* Animación de entrada (solo si hay JS) */
.js .reveal { opacity: 0; transform: translateY(32px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }
.reveal-delay, .reveal-delay-1 { transition-delay: 0.12s !important; }
.reveal-delay-2 { transition-delay: 0.24s !important; }
.reveal-delay-3 { transition-delay: 0.36s !important; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(32px, 5vw, 80px); align-items: center; min-height: calc(100vh - 76px); }
.hero-text { margin: 28px 0 36px; max-width: 520px; font-size: 1.15rem; color: var(--muted); }
.hero-actions { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.hero-proof { display: flex; align-items: center; gap: 16px; margin-top: 48px; font-size: 0.92rem; color: var(--muted); }
.hero-proof strong { color: var(--text); }
.avatar-stack { display: flex; }
.avatar-stack span {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--bg-3); border: 2px solid var(--bg); margin-left: -10px;
  font-size: 0.8rem; font-weight: 700;
}
.avatar-stack span:first-child { margin-left: 0; }
.avatar-stack span:nth-child(2) { background: var(--lime); color: var(--ink); }

.hero-visual {
  position: relative; padding: 24px; border-radius: 32px;
  background: linear-gradient(160deg, var(--bg-2), var(--bg));
  border: 1px solid var(--line);
}
.visual-topline, .visual-bottomline { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.visual-label--lime { color: var(--lime); }
.logo-orbit { position: relative; aspect-ratio: 1; margin: 20px auto; width: min(100%, 420px); display: grid; place-items: center; }
.logo-orbit img { position: relative; z-index: 2; width: 52%; height: auto; object-fit: contain; }
.orbit { position: absolute; border-radius: 50%; border: 1px dashed rgba(255, 255, 255, 0.2); }
.orbit--outer { inset: 0; animation: spin 40s linear infinite; }
.orbit--inner { inset: 14%; border-color: rgba(200, 255, 61, 0.35); animation: spin 28s linear infinite reverse; }
.orbit-dot { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 18px var(--lime); }
.orbit-dot--one { top: 4%; left: 50%; animation: float 5s ease-in-out infinite; }
.orbit-dot--two { bottom: 18%; right: 10%; width: 8px; height: 8px; animation: float 6s ease-in-out infinite reverse; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 50% { transform: translateY(-14px); } }

/* ---------- Ticker ---------- */
.ticker { overflow: hidden; border-block: 1px solid var(--line); background: var(--bg-2); padding: 20px 0; }
.ticker-track { display: flex; align-items: center; gap: 36px; width: max-content; animation: marquee 32s linear infinite; font-family: var(--mono); font-size: 0.9rem; letter-spacing: 0.1em; white-space: nowrap; }
.ticker-track i { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); flex: none; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Servicios ---------- */
.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.service-card {
  position: relative; display: flex; flex-direction: column; gap: 14px;
  padding: 28px; min-height: 300px; border-radius: var(--radius);
  background: var(--bg-2); border: 1px solid var(--line); overflow: hidden;
  transition: transform 0.4s var(--ease), border-color 0.3s, background 0.3s;
}
.service-card:hover { transform: translateY(-6px); border-color: rgba(200, 255, 61, 0.5); }
.service-card.is-active { border-color: var(--lime); }
.service-card p { color: var(--muted); font-size: 0.97rem; }
.service-card h3 { font-size: 1.5rem; }
.service-card h3 em { font-weight: 600; }
.card-kicker { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }
.card-arrow { color: var(--lime); transition: transform 0.3s var(--ease); }
.service-card:hover .card-arrow { transform: translate(4px, -4px); }
.service-icon {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px;
  background: var(--bg-3); font-family: var(--mono); font-size: 0.85rem; margin-top: auto;
}
.service-icon--lime { background: var(--lime); color: var(--ink); }
.card-link { align-self: flex-start; margin-top: auto; font-weight: 700; color: var(--lime); display: inline-flex; gap: 8px; }
.card-link span { transition: transform 0.3s var(--ease); }
.card-link:hover span { transform: translateX(5px); }
.card-label { font-family: var(--mono); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--lime) !important; }

.service-card--featured { grid-column: span 2; background: linear-gradient(135deg, #16200f, var(--bg-2) 60%); }
.service-card--featured h3 { font-size: clamp(2rem, 4vw, 3.2rem); }
.service-card-content { display: flex; flex-direction: column; gap: 16px; max-width: 420px; height: 100%; position: relative; z-index: 2; }
.featured-shape { position: absolute; right: -30px; bottom: -30px; display: flex; gap: 10px; opacity: 0.9; }
.featured-shape span { width: 70px; border-radius: 40px 40px 0 0; background: rgba(200, 255, 61, 0.18); }
.featured-shape span:nth-child(1) { height: 120px; }
.featured-shape span:nth-child(2) { height: 190px; background: rgba(200, 255, 61, 0.32); }
.featured-shape span:nth-child(3) { height: 150px; }

.service-detail {
  display: grid; grid-template-columns: auto 1fr 1.2fr auto; align-items: center; gap: 32px;
  margin-top: 28px; padding: 32px 36px; border-radius: var(--radius);
  background: var(--lime); color: var(--ink);
}
.service-detail .card-label { color: rgba(11, 13, 13, 0.6) !important; margin-bottom: 6px; }
.service-detail h3 { font-size: 1.6rem; }
.detail-number { font-family: var(--mono); font-size: 2.6rem; font-weight: 500; }
.detail-text { font-size: 0.98rem; }
.detail-link { padding: 14px 24px; border-radius: 999px; background: var(--ink); color: var(--text); font-weight: 700; white-space: nowrap; }
.service-detail.is-changing > * { opacity: 0; transform: translateY(8px); }
.service-detail > * { transition: opacity 0.25s, transform 0.25s; }

/* ---------- Proyectos ---------- */
.project-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 260px; grid-auto-flow: dense; gap: 18px; }
.project-card { position: relative; margin: 0; overflow: hidden; border-radius: var(--radius); background: var(--bg-2); }
.project-card--wide { grid-column: span 2; }
.project-card--tall { grid-row: span 2; }
.project-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s var(--ease); }
.project-card:hover img { transform: scale(1.06); }
.project-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent 55%); pointer-events: none; }
.project-card figcaption { position: absolute; left: 20px; right: 20px; bottom: 18px; z-index: 2; display: flex; flex-direction: column; gap: 2px; }
.project-card figcaption span { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--lime); }
.project-card figcaption strong { font-size: 1.05rem; }

/* ---------- Confianza (sección clara) ---------- */
.confidence { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); background: var(--light); color: var(--ink); }
.confidence .eyebrow { color: #4a6b00; }
.confidence em { color: #4f7300; }
.confidence-intro > p:not(.eyebrow) { margin: 26px 0 32px; max-width: 480px; color: #3d4440; }
.confidence-row { display: grid; grid-template-columns: 50px 1fr auto; gap: 20px; align-items: start; padding: 28px 0; border-top: 1px solid rgba(11, 13, 13, 0.15); }
.confidence-row:last-child { border-bottom: 1px solid rgba(11, 13, 13, 0.15); }
.confidence-index { font-family: var(--mono); font-size: 0.8rem; color: #5b635e; padding-top: 6px; }
.confidence-row h3 { font-size: 1.35rem; margin-bottom: 6px; }
.confidence-row p { color: #4a514d; font-size: 0.97rem; }
.confidence-symbol { font-size: 1.4rem; transition: transform 0.4s var(--ease); }
.confidence-row:hover .confidence-symbol { transform: rotate(90deg); }

/* ---------- Proceso ---------- */
.process-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.process-step span { font-family: var(--mono); font-size: 0.85rem; color: var(--lime); }
.step-line { height: 1px; background: var(--line); margin: 18px 0 24px; position: relative; }
.step-line::after { content: ""; position: absolute; left: 0; top: -1px; width: 40%; height: 3px; background: var(--lime); border-radius: 3px; }
.process-step h3 { font-size: 1.8rem; margin-bottom: 12px; }
.process-step p { color: var(--muted); max-width: 340px; }

/* ---------- Contacto ---------- */
.contact-panel {
  display: grid; grid-template-columns: 1fr; justify-items: center; text-align: center;
  padding: clamp(36px, 6vw, 80px) clamp(24px, 5vw, 64px); border-radius: 32px;
  background: var(--bg-2); border: 1px solid var(--line);
}
.contact-copy { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 720px; }
.contact-copy .eyebrow { justify-content: center; }
.contact-copy > p:not(.eyebrow) { margin-inline: auto; }
.contact-mini { text-align: left; }
.contact-phones { width: 100%; max-width: 600px; text-align: center; }
.contact-phones a { align-items: center; }
.contact-copy > p:not(.eyebrow) { margin: 24px 0; color: var(--muted); max-width: 440px; }
.contact-mini { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; font-size: 0.95rem; color: var(--muted); }
.contact-mini strong { color: var(--text); }
.mini-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 6px rgba(200, 255, 61, 0.18); }
.contact-phones { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.contact-phones a { display: flex; flex-direction: column; padding: 18px; border-radius: 16px; background: var(--bg-3); border: 1px solid var(--line); transition: border-color 0.3s, transform 0.3s var(--ease); }
.contact-phones a:hover { border-color: var(--lime); transform: translateY(-3px); }
.contact-phones span { font-family: var(--mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.contact-phones strong { margin-top: 4px; }
.contact-phones b { color: var(--lime); font-weight: 600; }

.contact-form { display: flex; flex-direction: column; gap: 18px; }
.contact-form label { display: flex; flex-direction: column; gap: 8px; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.contact-form input, .contact-form select, .contact-form textarea {
  width: 100%; padding: 14px 16px; border-radius: 14px;
  background: var(--bg); border: 1px solid var(--line);
  color: var(--text); font: inherit; font-size: 1rem; font-weight: 400;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.contact-form textarea { resize: vertical; min-height: 96px; }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus { outline: none; border-color: var(--lime); box-shadow: 0 0 0 4px rgba(200, 255, 61, 0.14); }
.form-note { font-size: 0.78rem; color: var(--muted); }
.form-success { padding: 14px 16px; border-radius: 12px; background: rgba(200, 255, 61, 0.12); color: var(--lime); font-size: 0.92rem; }
.form-error { padding: 14px 16px; border-radius: 12px; background: rgba(255, 90, 80, 0.12); color: #ff8a80; font-size: 0.92rem; }
.form-success[hidden], .form-error[hidden] { display: none; }
.button:disabled { opacity: 0.6; cursor: wait; transform: none; box-shadow: none; }

/* ---------- Footer ---------- */
.site-footer { padding: 72px clamp(20px, 5vw, 72px) 32px; border-top: 1px solid var(--line); }
.footer-top { display: flex; justify-content: space-between; align-items: center; gap: 32px; flex-wrap: wrap; margin-bottom: 56px; }
.footer-top p { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.footer-arrow { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--line); font-size: 1.3rem; transition: background 0.3s, color 0.3s; }
.footer-arrow:hover { background: var(--lime); color: var(--ink); }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 14px 32px; padding-top: 28px; border-top: 1px solid var(--line); font-size: 0.85rem; color: var(--muted); }
.footer-social { display: flex; flex-wrap: wrap; gap: 14px 28px; width: 100%; }
.footer-social a { display: inline-flex; flex-direction: column; transition: color 0.25s; }
.footer-social a:hover { color: var(--lime); }
.footer-social b { color: var(--text); font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .hero, .confidence { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .service-grid { grid-template-columns: repeat(2, 1fr); }
  .project-grid { grid-template-columns: repeat(2, 1fr); }
  .process-grid { grid-template-columns: 1fr; }
  .service-detail { grid-template-columns: 1fr; gap: 16px; }
  .detail-link { justify-self: start; }
}

@media (max-width: 820px) {
  .menu-toggle { display: block; }
  .main-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 18px;
    padding: 24px clamp(20px, 5vw, 72px) 32px;
    background: rgba(11, 13, 13, 0.97); border-bottom: 1px solid var(--line);
    transform: translateY(-12px); opacity: 0; visibility: hidden;
    transition: opacity 0.3s, transform 0.3s var(--ease), visibility 0.3s;
  }
  .main-nav.is-open { opacity: 1; transform: none; visibility: visible; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .service-grid, .project-grid, .contact-phones { grid-template-columns: 1fr; }
  .service-card--featured, .project-card--wide { grid-column: auto; }
  .project-grid { grid-auto-rows: 240px; }
  .project-card--tall { grid-row: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}
