/* ============================================================
   BB4 — Sistema de diseño
   Concepto: plano técnico / diagrama de circuito. La empresa
   conecta sistemas y necesidades de negocio con software; la
   página usa el lenguaje visual de un plano de ingeniería para
   decirlo sin tener que decirlo.
   ============================================================ */

@font-face{
  font-family:'Barlow Condensed';font-style:normal;font-weight:500;font-display:swap;
  src:url(../fonts/barlow-condensed-500.woff2) format('woff2');
}
@font-face{
  font-family:'Barlow Condensed';font-style:normal;font-weight:600;font-display:swap;
  src:url(../fonts/barlow-condensed-600.woff2) format('woff2');
}
@font-face{
  font-family:'Barlow Condensed';font-style:normal;font-weight:700;font-display:swap;
  src:url(../fonts/barlow-condensed-700.woff2) format('woff2');
}
@font-face{
  font-family:'Newsreader';font-style:normal;font-weight:400;font-display:swap;
  src:url(../fonts/newsreader-400.woff2) format('woff2');
}
@font-face{
  font-family:'Newsreader';font-style:italic;font-weight:400;font-display:swap;
  src:url(../fonts/newsreader-400-italic.woff2) format('woff2');
}
@font-face{
  font-family:'IBM Plex Mono';font-style:normal;font-weight:400;font-display:swap;
  src:url(../fonts/ibm-plex-mono-400.woff2) format('woff2');
}
@font-face{
  font-family:'IBM Plex Mono';font-style:normal;font-weight:500;font-display:swap;
  src:url(../fonts/ibm-plex-mono-500.woff2) format('woff2');
}

:root{
  --bg:#EFF2ED;
  --surface:#FBFAF7;
  --surface-2:#E4E8E1;
  --text:#101E22;
  --text-muted:#4B5B57;
  --accent:#B8672F;
  --accent-ink:#8F4E22;
  --accent-2:#2B615C;
  --line:#B9C2BA;
  --line-strong:#8C978F;
  --on-accent:#FBF6EE;
  --shadow: 0 1px 0 rgba(16,30,34,.06);

  --font-display:'Barlow Condensed',system-ui,sans-serif;
  --font-body:'Newsreader',Georgia,serif;
  --font-mono:'IBM Plex Mono',ui-monospace,monospace;

  --container-max: 1180px;
  --radius: 3px;
}

@media (prefers-color-scheme: dark){
  :root{
    --bg:#0E1A1D;
    --surface:#142428;
    --surface-2:#0A1517;
    --text:#EDEFE9;
    --text-muted:#9FB0AA;
    --accent:#E08A4E;
    --accent-ink:#F3B27F;
    --accent-2:#5FB0A6;
    --line:#28393A;
    --line-strong:#3C504F;
    --on-accent:#0E1414;
    --shadow: 0 1px 0 rgba(0,0,0,.4);
  }
}
:root[data-theme="dark"]{
  --bg:#0E1A1D; --surface:#142428; --surface-2:#0A1517; --text:#EDEFE9;
  --text-muted:#9FB0AA; --accent:#E08A4E; --accent-ink:#F3B27F; --accent-2:#5FB0A6;
  --line:#28393A; --line-strong:#3C504F; --on-accent:#0E1414;
  --shadow: 0 1px 0 rgba(0,0,0,.4);
}
:root[data-theme="light"]{
  --bg:#EFF2ED; --surface:#FBFAF7; --surface-2:#E4E8E1; --text:#101E22;
  --text-muted:#4B5B57; --accent:#B8672F; --accent-ink:#8F4E22; --accent-2:#2B615C;
  --line:#B9C2BA; --line-strong:#8C978F; --on-accent:#FBF6EE;
  --shadow: 0 1px 0 rgba(16,30,34,.06);
}

*{box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{
  background:var(--bg);
  color:var(--text);
  font-family:var(--font-body);
  font-size:1.05rem;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}
::selection{ background:var(--accent); color:var(--on-accent); }

.container-bb{
  max-width:var(--container-max);
  margin:0 auto;
  padding:0 1.5rem;
}

h1,h2,h3,h4{
  font-family:var(--font-display);
  font-weight:600;
  line-height:1.05;
  letter-spacing:-0.01em;
  text-wrap:balance;
  margin:0;
  color:var(--text);
}
p{ margin:0; }
a{ color:inherit; }

.eyebrow{
  font-family:var(--font-mono);
  font-size:.72rem;
  font-weight:500;
  letter-spacing:.16em;
  text-transform:uppercase;
  color:var(--accent-ink);
  display:flex;
  align-items:center;
  gap:.55rem;
}
.eyebrow::before{
  content:"";
  width:7px;height:7px;
  background:var(--accent);
  transform:rotate(45deg);
  flex:none;
}

.lede{
  font-family:var(--font-body);
  font-style:italic;
  font-size:1.2rem;
  color:var(--text-muted);
  max-width:56ch;
}

.mono-tag{
  font-family:var(--font-mono);
  font-size:.68rem;
  letter-spacing:.1em;
  text-transform:uppercase;
  color:var(--text-muted);
}

section{ padding:6.5rem 0; border-bottom:1px solid var(--line); }
section:last-of-type{ border-bottom:none; }

/* ---------- reveal on scroll ---------- */
.reveal{
  opacity:0;
  transform:translateY(18px);
  transition:opacity .7s ease, transform .7s ease;
}
.reveal.is-visible{ opacity:1; transform:translateY(0); }
.reveal-stagger > * { transition-delay: calc(var(--i,0) * 90ms); }

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

/* ================= NAV ================= */
.bb-nav{
  position:fixed; top:0; left:0; right:0; z-index:40;
  background:color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter:blur(8px);
  border-bottom:1px solid var(--line);
}
.bb-nav-inner{
  display:flex; align-items:center; justify-content:space-between;
  height:64px;
}
.bb-mark{ display:flex; align-items:center; gap:.5rem; text-decoration:none; }
.bb-mark svg{ display:block; }
.bb-mark-text{
  font-family:var(--font-display); font-weight:700; font-size:1.2rem;
  letter-spacing:.02em; color:var(--text);
}
.bb-mark-text span{ color:var(--accent); }

.bb-links{ display:flex; align-items:center; gap:2rem; list-style:none; margin:0; padding:0; }
.bb-links a{
  font-family:var(--font-mono); font-size:.74rem; letter-spacing:.08em;
  text-transform:uppercase; text-decoration:none; color:var(--text-muted);
  position:relative; padding-bottom:3px;
}
.bb-links a::after{
  content:""; position:absolute; left:0; right:100%; bottom:0; height:1px;
  background:var(--accent); transition:right .25s ease;
}
.bb-links a:hover{ color:var(--text); }
.bb-links a:hover::after{ right:0; }

/* buttons */
.btn-bb{
  font-family:var(--font-mono); font-size:.76rem; letter-spacing:.08em; text-transform:uppercase;
  padding:.85rem 1.4rem; border-radius:var(--radius); text-decoration:none;
  display:inline-flex; align-items:center; gap:.6rem; border:1px solid transparent;
  transition:transform .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
  white-space:nowrap;
}
.btn-bb:active{ transform:translateY(1px); }
.btn-bb-primary{ background:var(--accent); color:var(--on-accent); }
.btn-bb-primary:hover{ background:var(--accent-ink); color:var(--on-accent); }
.btn-bb-ghost{ background:transparent; color:var(--text); border-color:var(--line-strong); }
.btn-bb-ghost:hover{ border-color:var(--accent); color:var(--accent-ink); }
.btn-bb-sm{ padding:.55rem 1rem; font-size:.68rem; }

.bb-burger{ display:none; background:none; border:1px solid var(--line-strong); border-radius:var(--radius); width:38px; height:38px; align-items:center; justify-content:center; color:var(--text); }

/* ================= HERO ================= */
.hero{
  padding:11rem 0 6rem;
  border-bottom:1px solid var(--line);
  position:relative;
}
.hero-grid{ display:grid; grid-template-columns:1.05fr .95fr; gap:3rem; align-items:center; }
.hero h1{ font-size:clamp(2.5rem, 4.6vw, 3.9rem); margin:1rem 0 1.4rem; }
.hero .lede{ margin-bottom:2.2rem; }
.hero-ctas{ display:flex; gap:1rem; flex-wrap:wrap; margin-bottom:2.4rem; }
.hero-trust-line{
  font-family:var(--font-mono); font-size:.7rem; letter-spacing:.06em; color:var(--text-muted);
  display:flex; gap:1.6rem; flex-wrap:wrap;
}
.hero-trust-line b{ color:var(--text); font-weight:500; }

.diagram-frame{
  border:1px solid var(--line); background:var(--surface);
  padding:1.1rem 1.1rem .8rem;
  position:relative;
}
.diagram-frame::before,.diagram-frame::after,
.corner-plate::before,.corner-plate::after{
  content:""; position:absolute; width:12px; height:12px;
  border-color:var(--line-strong); border-style:solid; border-width:0;
}
.diagram-frame::before{ top:-1px; left:-1px; border-top-width:2px; border-left-width:2px; }
.diagram-frame::after{ bottom:-1px; right:-1px; border-bottom-width:2px; border-right-width:2px; }
.diagram-label{
  display:flex; justify-content:space-between; font-family:var(--font-mono);
  font-size:.65rem; letter-spacing:.08em; text-transform:uppercase; color:var(--text-muted);
  margin-bottom:.4rem;
}
.diagram-label b{ color:var(--text); font-weight:500; }
.hero-diagram-svg{ width:100%; height:auto; display:block; }

.trace-path{
  fill:none; stroke:var(--line-strong); stroke-width:2;
  stroke-dasharray:100; stroke-dashoffset:100;
  animation:draw 1.8s ease forwards .3s;
}
.trace-path.accented{ stroke:var(--accent); }
@keyframes draw{ to{ stroke-dashoffset:0; } }

.node-pad{ fill:var(--surface); stroke:var(--line-strong); stroke-width:2; opacity:0; animation:pop .5s ease forwards; }
.node-pad.active{ fill:var(--accent); stroke:var(--accent-ink); }
@keyframes pop{ from{ opacity:0; transform:scale(.4);} to{ opacity:1; transform:scale(1);} }
.node-label{ font-family:var(--font-mono); font-size:11px; fill:var(--text); }
.node-label tspan.idx{ fill:var(--text-muted); }
.node-ring{ fill:none; stroke:var(--accent); stroke-width:1.5; opacity:0; animation:ring-in .6s ease forwards; }
@keyframes ring-in{ from{opacity:0; transform:scale(.5);} to{opacity:.55; transform:scale(1);} }

/* ================= SERVICIOS ================= */
.plate{
  border:1px solid var(--line); background:var(--surface);
  padding:1.5rem 1.4rem; height:100%;
  position:relative;
}
.plate::before,.plate::after{
  content:""; position:absolute; width:10px; height:10px;
  border-color:var(--line-strong); border-style:solid; border-width:0;
}
.plate::before{ top:-1px; left:-1px; border-top-width:2px; border-left-width:2px; }
.plate::after{ bottom:-1px; right:-1px; border-bottom-width:2px; border-right-width:2px; }
.plate .mod-code{ font-family:var(--font-mono); font-size:.68rem; color:var(--accent-ink); letter-spacing:.08em; }
.plate h4{ font-size:1.3rem; margin:.5rem 0 .5rem; }
.plate p{ color:var(--text-muted); font-size:.95rem; }

/* ================= PROCESO ================= */
.proc-rail{
  position:relative;
  display:grid; grid-template-columns:repeat(4,1fr); gap:1.6rem;
  margin-top:3.2rem;
}
.proc-rail::before{
  content:""; position:absolute; top:14px; left:0; right:0; height:1px;
  background:repeating-linear-gradient(to right, var(--line-strong) 0 6px, transparent 6px 11px);
}
.proc-step{ position:relative; padding-top:2.6rem; }
.proc-node{
  position:absolute; top:0; left:0; width:29px; height:29px;
  border:2px solid var(--accent); background:var(--surface);
  display:flex; align-items:center; justify-content:center;
  font-family:var(--font-mono); font-size:.72rem; color:var(--accent-ink); font-weight:500;
  transform:rotate(45deg);
}
.proc-node span{ transform:rotate(-45deg); }
.proc-step h4{ font-size:1.25rem; margin-bottom:.5rem; }
.proc-step p{ color:var(--text-muted); font-size:.92rem; }

@media (max-width: 860px){
  .proc-rail{ grid-template-columns:1fr; gap:2.2rem; }
  .proc-rail::before{ top:0; bottom:0; left:14px; right:auto; width:1px; height:auto;
    background:repeating-linear-gradient(to bottom, var(--line-strong) 0 6px, transparent 6px 11px); }
  .proc-step{ padding-top:0; padding-left:3rem; }
  .proc-node{ top:2px; left:0; }
}

/* ================= INDUSTRIAS ================= */
.ind-bus{
  height:1px; background:var(--line-strong); position:relative; margin:0 1.5rem 0;
}
.ind-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:1.5rem; margin-top:0; }
.ind-stem{ width:1px; height:28px; background:var(--line-strong); margin:0 auto; }
.ind-card{
  border:1px solid var(--line); background:var(--surface); padding:1.6rem 1.3rem; text-align:center; height:100%;
}
.ind-icon{ width:40px; height:40px; margin:0 auto 1rem; color:var(--accent); }
.ind-card h4{ font-size:1.15rem; margin-bottom:.5rem; }
.ind-card .sec-code{ font-family:var(--font-mono); font-size:.62rem; letter-spacing:.1em; color:var(--text-muted); display:block; margin-bottom:.6rem; }
.ind-card p{ font-size:.88rem; color:var(--text-muted); }
@media (max-width: 860px){
  .ind-grid{ grid-template-columns:1fr 1fr; }
}
@media (max-width: 560px){
  .ind-grid{ grid-template-columns:1fr; }
}

/* ================= EQUIPO ================= */
.dim-line{
  display:flex; align-items:center; gap:.6rem; font-family:var(--font-mono);
  color:var(--text-muted); font-size:.8rem; margin:1.6rem 0 3rem;
}
.dim-line .cap{ width:1px; height:14px; background:var(--line-strong); }
.dim-line .bar{ flex:1; max-width:220px; height:1px; background:var(--line-strong); position:relative; }
.dim-line .num{ font-family:var(--font-display); font-weight:700; font-size:1.6rem; color:var(--text); letter-spacing:0; }
.dim-line .num span{ color:var(--accent); }

.team-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:1.6rem; }
.team-card{ border:1px solid var(--line); background:var(--surface); overflow:hidden; }
.team-photo{ position:relative; aspect-ratio:4/5; overflow:hidden; background:var(--surface-2); }
.team-photo img{
  width:100%; height:100%; object-fit:cover; display:block;
  filter:grayscale(1) contrast(1.05) brightness(.9) sepia(.18);
  mix-blend-mode:normal;
}
.team-photo::after{
  content:""; position:absolute; inset:0;
  background:linear-gradient(160deg, color-mix(in srgb, var(--accent-2) 55%, transparent), color-mix(in srgb, var(--accent) 40%, transparent));
  mix-blend-mode:multiply;
}
.team-photo .ref-tag{
  position:absolute; top:.6rem; left:.6rem; z-index:2;
  font-family:var(--font-mono); font-size:.6rem; letter-spacing:.08em;
  background:var(--bg); color:var(--text-muted); padding:.2rem .45rem; border:1px solid var(--line-strong);
}
.team-body{ padding:1.1rem 1.2rem 1.3rem; }
.team-body .role{ font-size:.98rem; font-weight:500; font-family:var(--font-display); font-size:1.15rem; }
.team-body .yrs{ font-family:var(--font-mono); font-size:.7rem; color:var(--accent-ink); letter-spacing:.06em; margin-top:.3rem; display:block; }
@media (max-width:860px){ .team-grid{ grid-template-columns:1fr 1fr; } }
@media (max-width:560px){ .team-grid{ grid-template-columns:1fr; } }

/* ================= GARANTÍA ================= */
.warranty-grid{ display:grid; grid-template-columns:1fr .8fr; gap:3.5rem; align-items:center; }
.stamp-wrap{ display:flex; justify-content:center; }
.stamp{
  width:230px; height:230px; border-radius:50%;
  border:2px dashed var(--accent);
  display:flex; align-items:center; justify-content:center;
  transform:rotate(-9deg);
  position:relative;
  opacity:0; transform:rotate(-9deg) scale(.85);
}
.stamp.is-visible{ animation:stamp-in .5s cubic-bezier(.2,1.4,.4,1) forwards; }
@keyframes stamp-in{ to{ opacity:1; transform:rotate(-9deg) scale(1);} }
.stamp-inner{
  width:186px; height:186px; border-radius:50%; border:1px solid var(--accent);
  display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center;
  font-family:var(--font-mono); color:var(--accent-ink);
}
.stamp-inner strong{ font-family:var(--font-display); font-size:1.6rem; color:var(--accent-ink); letter-spacing:.02em; display:block; }
.stamp-inner small{ font-size:.6rem; letter-spacing:.12em; text-transform:uppercase; display:block; margin-top:.35rem; }

.title-block{
  border:1px solid var(--line); font-family:var(--font-mono); font-size:.74rem;
  margin-top:2.4rem;
}
.title-block-row{ display:flex; border-bottom:1px solid var(--line); }
.title-block-row:last-child{ border-bottom:none; }
.title-block-row div{ padding:.6rem .8rem; flex:1; }
.title-block-row div:first-child{ color:var(--text-muted); border-right:1px solid var(--line); max-width:180px; letter-spacing:.06em; text-transform:uppercase; font-size:.66rem; }
.title-block-row div:last-child b{ color:var(--accent-ink); }

/* ================= CONTACTO / FOOTER ================= */
.cta-band{
  background:var(--surface-2);
  border-top:1px solid var(--line); border-bottom:1px solid var(--line);
  padding:5.5rem 0;
  text-align:center;
}
.cta-band h2{ font-size:clamp(2rem,4vw,3rem); margin-bottom:1.2rem; }
.cta-band .lede{ margin:0 auto 2rem; text-align:center; }
.cta-band .hero-ctas{ justify-content:center; }

footer{ padding:3.5rem 0 2.5rem; }
.footer-grid{ display:flex; justify-content:space-between; flex-wrap:wrap; gap:2rem; margin-bottom:2.4rem; }
.footer-col h5{ font-family:var(--font-mono); font-size:.68rem; letter-spacing:.1em; text-transform:uppercase; color:var(--text-muted); margin-bottom:.9rem; }
.footer-col a{ display:block; text-decoration:none; color:var(--text); font-size:.92rem; margin-bottom:.5rem; }
.footer-col a:hover{ color:var(--accent-ink); }
.footer-bottom{
  display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:1rem;
  padding-top:1.6rem; border-top:1px solid var(--line);
  font-family:var(--font-mono); font-size:.7rem; color:var(--text-muted); letter-spacing:.04em;
}

/* responsive */
@media (max-width: 991px){
  .bb-links{ display:none; }
  .bb-burger{ display:flex; }
  .hero-grid{ grid-template-columns:1fr; }
  .warranty-grid{ grid-template-columns:1fr; }
  .diagram-frame{ max-width:420px; margin:0 auto; }
}
@media (max-width: 767px){
  section{ padding:4rem 0; }
  .hero{ padding-top:8.5rem; }
}
