:root{--blue:#0066cc;--cyan:#00b4db;--navy:#0d1b2a;--gray:#6c757d;--light:#f4f8fc;--line:#dce6ef}*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;font-family:Montserrat,Arial,sans-serif;color:var(--navy);background:#fff}header{height:78px;display:flex;align-items:center;justify-content:space-between;padding:0 max(5vw,24px);border-bottom:1px solid #edf1f5;position:sticky;top:0;background:rgba(255,255,255,.96);z-index:20}.brand{font-weight:800;font-size:28px;color:#000;text-decoration:none;letter-spacing:-1px}.brand>span{color:var(--blue)}.brand small{font-size:10px;letter-spacing:2px;margin-left:5px;color:var(--navy)}nav{display:flex;gap:26px;align-items:center}nav a{text-decoration:none;color:var(--navy);font-size:14px;font-weight:600}.navcta{background:var(--blue);color:#fff!important;padding:11px 17px;border-radius:8px}.hero{min-height:650px;display:grid;grid-template-columns:1.02fr .98fr;gap:54px;align-items:center;padding:70px max(6vw,28px);background:linear-gradient(135deg,#fff 55%,#f1f8ff)}.eyebrow{color:var(--blue);font-weight:800;letter-spacing:2.2px;font-size:12px}.hero h1{font-size:clamp(45px,5vw,76px);line-height:1.02;letter-spacing:-3px;margin:14px 0 24px}.hero h1 em{font-style:normal;color:var(--blue)}.lead{font-size:19px;line-height:1.65;color:#435363;max-width:720px}.actions{display:flex;gap:12px;margin:30px 0}.btn{display:inline-block;text-decoration:none;font-weight:700;padding:15px 21px;border-radius:9px}.primary{background:var(--blue);color:#fff}.secondary{border:1px solid var(--blue);color:var(--blue)}.tags{display:flex;gap:9px;flex-wrap:wrap}.tags span{font-size:12px;font-weight:700;padding:7px 10px;border:1px solid var(--line);border-radius:20px;background:#fff}.heroimg{position:relative}.heroimg img{width:100%;height:500px;object-fit:cover;border-radius:18px;box-shadow:0 25px 65px #0d1b2a26}.badge{position:absolute;left:-24px;bottom:28px;background:#fff;padding:17px 20px;border-radius:12px;box-shadow:0 12px 35px #0d1b2a22;display:flex;flex-direction:column}.badge span{font-size:12px;color:var(--gray);margin-top:4px}.section{padding:90px max(6vw,28px)}.section h2,.project h2,.contact h2{font-size:clamp(32px,4vw,50px);letter-spacing:-1.5px;margin:10px 0 14px}.intro{color:var(--gray);font-size:18px;max-width:720px}.grid4{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-top:40px}.grid4 article{padding:28px;border:1px solid var(--line);border-radius:14px;background:#fff}.grid4 article>b{color:var(--blue);font-size:13px}.grid4 h3{font-size:19px}.grid4 p,.appgrid p{color:#5d6a77;line-height:1.6}.project{display:grid;grid-template-columns:.9fr 1.1fr;gap:55px;padding:90px max(6vw,28px);background:var(--light)}.projectcopy p,.projectcopy li{line-height:1.65;color:#4c5c6b}.projectcopy ul{padding-left:20px}.note{font-weight:700;color:var(--blue)!important}.photos{display:grid;grid-template-columns:1.3fr .7fr;gap:12px}.photos img{width:100%;height:100%;min-height:420px;object-fit:cover;border-radius:14px}.dark{background:var(--navy);color:#fff}.dark .eyebrow{color:var(--cyan)}.steps{display:grid;grid-template-columns:repeat(6,1fr);gap:10px;margin:38px 0}.steps span{border-top:2px solid var(--cyan);padding-top:14px;color:#7fcfe0;font-size:12px}.steps b{display:block;color:#fff;margin-top:7px;font-size:15px}.lab{width:100%;height:380px;object-fit:cover;border-radius:15px;margin-top:20px;opacity:.9}.appgrid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-top:35px}.appgrid>div{padding:24px;border-left:3px solid var(--blue);background:#f8fafc}.contact{text-align:center;padding:100px 24px;background:linear-gradient(135deg,var(--blue),#034a93);color:#fff}.contact .eyebrow{color:#9deafa}.contact p{font-size:18px;max-width:720px;margin:0 auto 28px;line-height:1.6}.white{background:#fff;color:var(--blue)}.domain{font-size:12px!important;margin-top:24px!important;opacity:.8}footer{padding:28px max(6vw,28px);display:flex;justify-content:space-between;gap:20px;font-size:12px;color:var(--gray);border-top:1px solid var(--line)}footer b{font-size:18px;color:#000}footer i{font-style:normal;color:var(--blue)}@media(max-width:900px){nav a:not(.navcta){display:none}.hero,.project{grid-template-columns:1fr}.hero{padding-top:45px}.heroimg img{height:380px}.badge{left:12px}.grid4,.appgrid{grid-template-columns:1fr 1fr}.steps{grid-template-columns:repeat(3,1fr)}.photos img{min-height:300px}}@media(max-width:560px){header{height:68px}.brand small{display:none}.hero{padding:42px 20px}.hero h1{letter-spacing:-2px}.lead{font-size:16px}.actions{flex-direction:column}.actions .btn{text-align:center}.section,.project{padding:65px 20px}.grid4,.appgrid,.photos{grid-template-columns:1fr}.photos img{height:300px;min-height:0}.steps{grid-template-columns:1fr 1fr}.lab{height:260px}footer{flex-direction:column}.contact{padding:75px 20px}.contact .btn{font-size:14px}}
/* V2 — galería del controlador: fotografías originales, sin recreación de hardware */
.projectgallery{display:grid;grid-template-columns:1.1fr .9fr;grid-template-rows:1fr 1fr;gap:12px;min-height:500px}.projectgallery figure{margin:0;position:relative;overflow:hidden;border-radius:14px;background:#0d1b2a}.projectgallery figure:first-child{grid-row:1/3}.projectgallery img{width:100%;height:100%;object-fit:cover;display:block}.projectgallery figcaption{position:absolute;left:0;right:0;bottom:0;padding:35px 18px 15px;background:linear-gradient(transparent,rgba(13,27,42,.92));color:#fff;display:flex;flex-direction:column;gap:3px}.projectgallery figcaption b{font-size:14px}.projectgallery figcaption span{font-size:11px;opacity:.85}.lab{object-position:center center}@media(max-width:900px){.projectgallery{min-height:430px}}@media(max-width:560px){.projectgallery{grid-template-columns:1fr;grid-template-rows:none;min-height:0}.projectgallery figure:first-child{grid-row:auto}.projectgallery figure{height:290px}}

/* V3: corrige orientación de la PCB real de la primera fotografía sin regenerarla */
.projectgallery .pcb-rotated img{transform:rotate(-90deg) scale(1.34);object-fit:contain;background:#0d1b2a}
@media(max-width:560px){.projectgallery .pcb-rotated img{transform:rotate(-90deg) scale(1.05)}}

/* V4: encuadre cerrado de la PCB sin componentes. Se conserva la fotografía original. */
.projectgallery .pcb-rotated img{
  transform:rotate(-90deg) scale(1.52);
  object-fit:contain;
  object-position:center center;
  background:#0d1b2a;
}
@media(max-width:560px){
  .projectgallery .pcb-rotated img{transform:rotate(-90deg) scale(1.22)}
}

/* V5: solo foto 1 del proyecto, conserva la proporción original completa */
.projectgallery figure.pcb-original { height: auto; }
.projectgallery figure.pcb-original img { width: 100%; height: auto; aspect-ratio: auto; object-fit: contain; display: block; transform: none; }

/* V6: galería del proyecto en cuatro espacios iguales. Las dos PCB reales ocupan
   la columna izquierda, sin relleno artificial alrededor de las fotografías. */
.projectgallery{grid-template-columns:1.1fr .9fr;grid-template-rows:1fr 1fr;min-height:500px}
.projectgallery figure:first-child{grid-row:auto}
.projectgallery figure.pcb-original,
.projectgallery figure.pcb-second{height:auto;background:transparent}
.projectgallery figure.pcb-original img,
.projectgallery figure.pcb-second img{width:100%;height:100%;object-fit:cover;display:block;transform:none}
.projectgallery .pcb-original{grid-column:1;grid-row:1}
.projectgallery .pcb-second{grid-column:1;grid-row:2}
.projectgallery figure:nth-child(3){grid-column:2;grid-row:1}
.projectgallery figure:nth-child(4){grid-column:2;grid-row:2}
@media(max-width:560px){
  .projectgallery .pcb-original,.projectgallery .pcb-second,
  .projectgallery figure:nth-child(3),.projectgallery figure:nth-child(4){grid-column:auto;grid-row:auto}
  .projectgallery figure.pcb-original,.projectgallery figure.pcb-second{height:290px}
}

/* V7: foto 4 combina esquemático y modelo 3D reales de Altium, conservando leyenda */
.projectgallery .altium-combo-images{width:100%;height:100%;display:grid;grid-template-rows:1fr 1fr;gap:2px;background:#0d1b2a}
.projectgallery .altium-combo-images img{width:100%;height:100%;min-height:0;object-fit:cover;object-position:center;display:block}


/* V8 — secuencia real del proyecto: diseño, 3D, PCB, hardware y application server */
.projectgallery.projectgallery-v8{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  grid-template-rows:repeat(3,260px);
  gap:14px;
  min-height:0;
}
.projectgallery.projectgallery-v8 figure,
.projectgallery.projectgallery-v8 figure:first-child,
.projectgallery.projectgallery-v8 figure:nth-child(3),
.projectgallery.projectgallery-v8 figure:nth-child(4){
  grid-column:auto;grid-row:auto;height:260px;margin:0;background:#0d1b2a;
}
.projectgallery.projectgallery-v8 figure:nth-child(5){grid-column:1/3;height:330px}
.projectgallery.projectgallery-v8 figure>img{width:100%;height:100%;object-fit:cover;transform:none}
.projectgallery.projectgallery-v8 figure:nth-child(1)>img{object-fit:cover;object-position:center}
.projectgallery.projectgallery-v8 figure:nth-child(2)>img{object-fit:cover;object-position:center}
.projectgallery.projectgallery-v8 figure:nth-child(3)>img{object-fit:cover;object-position:center 55%}
.projectgallery.projectgallery-v8 figure:nth-child(4)>img{object-fit:cover;object-position:center}
.dashboard-frame{height:100%;background:linear-gradient(145deg,#071525,#0d2842);padding:34px 16px 14px;position:relative}
.dashboard-top{position:absolute;top:8px;left:16px;right:16px;display:flex;justify-content:space-between;align-items:center;color:#fff;font-size:10px;font-weight:800;letter-spacing:1.4px}
.dashboard-top i{font-style:normal;color:#77d9ee;font-weight:600;letter-spacing:.2px}
.dashboard-crop{height:100%;overflow:hidden;border:1px solid rgba(0,180,219,.55);border-radius:9px;background:#000;box-shadow:0 8px 25px rgba(0,0,0,.28)}
.dashboard-crop img{width:100%;height:100%;object-fit:cover;object-position:center 43%;transform:scale(1.08);display:block}
@media(max-width:900px){.projectgallery.projectgallery-v8{grid-template-rows:repeat(3,230px)}.projectgallery.projectgallery-v8 figure,.projectgallery.projectgallery-v8 figure:first-child,.projectgallery.projectgallery-v8 figure:nth-child(3),.projectgallery.projectgallery-v8 figure:nth-child(4){height:230px}.projectgallery.projectgallery-v8 figure:nth-child(5){height:300px}}
@media(max-width:560px){.projectgallery.projectgallery-v8{grid-template-columns:1fr;grid-template-rows:none}.projectgallery.projectgallery-v8 figure,.projectgallery.projectgallery-v8 figure:first-child,.projectgallery.projectgallery-v8 figure:nth-child(3),.projectgallery.projectgallery-v8 figure:nth-child(4),.projectgallery.projectgallery-v8 figure:nth-child(5){grid-column:auto;grid-row:auto;height:290px}.dashboard-top{font-size:8px}.dashboard-top i{display:none}}

/* V8 - Ingeniería inversa */
.reverse-engineering{background:#f5f8fc}
.reverse-wrap{display:grid;grid-template-columns:minmax(300px,.88fr) minmax(0,1.25fr);gap:48px;align-items:center;margin-top:30px}
.reverse-copy h3{font-size:clamp(24px,2.2vw,34px);margin:0 0 14px;color:#0d1b2a}
.reverse-copy p{line-height:1.7;color:#405268}
.reverse-copy ul{padding-left:20px;line-height:1.75;color:#405268}
.reverse-flow{display:grid;grid-template-columns:1fr 54px 1fr;align-items:stretch;gap:12px}
.reverse-card{margin:0;background:#fff;border-radius:18px;overflow:hidden;box-shadow:0 14px 38px rgba(13,27,42,.12);display:flex;flex-direction:column}
.reverse-card img{width:100%;height:310px;object-fit:cover;display:block}
.reverse-card:first-child img{object-position:center 48%}
.reverse-card:last-child img{object-position:center 42%}
.reverse-card figcaption{padding:16px 18px 18px;display:flex;flex-direction:column;gap:4px}
.reverse-card figcaption b{color:#0d1b2a;font-size:15px}.reverse-card figcaption span{font-size:13px;color:#66788c;line-height:1.4}
.reverse-arrow{align-self:center;width:48px;height:48px;border-radius:50%;background:#0066cc;color:#fff;display:grid;place-items:center;font-size:26px;font-weight:700;box-shadow:0 8px 20px rgba(0,102,204,.25)}
.reverse-note{margin-top:22px;padding:15px 18px;border-left:4px solid #0066cc;background:#fff;border-radius:0 10px 10px 0;color:#34495e;font-size:14px;line-height:1.55}
@media(max-width:900px){.reverse-wrap{grid-template-columns:1fr}.reverse-flow{grid-template-columns:1fr}.reverse-arrow{transform:rotate(90deg);margin:auto}.reverse-card img{height:auto;max-height:420px;object-fit:contain;background:#eef3f8}}
