/* ============================================================
   NeuralDomotic v5.0 — Sistema de diseño profesional
   CSS unificado, sin duplicación, dark mode refinado
   ============================================================ */

/* --- Design Tokens --- */
:root {
  /* Backgrounds — más claros que antes, menos agresivos */
  --bg: #0a0e1a;
  --bg2: #0f1424;
  --bg-card: #141a2e;
  --bg-elevated: #1a2140;

  /* Texto — contraste AA+ garantizado */
  --text: #f1f5f9;
  --text2: #cbd5e1;
  --text-muted: #94a3b8;

  /* Colores acento */
  --blue: #2563eb;
  --blue-l: #60a5fa;
  --blue-glow: rgba(37,99,235,0.15);
  --cyan: #22d3ee;
  --cyan-l: #67e8f9;
  --cyan-dim: #0891b2;
  --green: #10b981;
  --amber: #f59e0b;
  --red: #ef4444;

  /* Bordes */
  --border: rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.12);

  /* Gradientes (solo para acentos, nunca para texto) */
  --grad: linear-gradient(135deg, #2563eb, #22d3ee);
  --grad-bg: linear-gradient(180deg, #0a0e1a, #0f1424);

  /* Tipografía */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Compatibilidad con clases inline del HTML v3 */
  --color-text-dim: var(--text-muted);
  --color-text-secondary: var(--text2);
  --color-text: var(--text);
  --color-bg-secondary: var(--bg2);
  --color-accent: var(--cyan);
  --color-info: var(--blue-l);
  --color-success: var(--green);
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --color-error: var(--red);

  /* Espaciado y geometría */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --max-w: 1200px;
  --max-w-sm: 700px;
  --nav-h: 3.75rem;
  --space: clamp(3rem, 6vw, 5rem);
  --space-sm: clamp(2rem, 3vw, 3rem);
}

/* --- Reset --- */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth;scroll-padding-top:calc(var(--nav-h) + 1rem)}
body{
  font-family:var(--font);background:var(--bg);color:var(--text);
  line-height:1.6;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;overflow-x:hidden
}
a{color:var(--blue-l);text-decoration:none;transition:color .15s}
a:hover{color:var(--cyan)}
img{max-width:100%;height:auto;display:block}
svg{display:block;flex-shrink:0}
::selection{background:rgba(37,99,235,.3);color:var(--text)}
:focus-visible{outline:2px solid var(--blue-l);outline-offset:2px;border-radius:var(--radius-sm)}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}

/* --- Utility --- */
.container{width:100%;max-width:var(--max-w);margin:0 auto;padding:0 clamp(1rem,3vw,2rem)}
.container-sm{max-width:var(--max-w-sm)}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}
.hidden{display:none!important}

/* --- Botones --- */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:.5rem;
  padding:.7rem 1.5rem;border-radius:var(--radius);
  font-family:var(--font);font-weight:600;font-size:.9375rem;
  border:none;cursor:pointer;transition:all .2s;position:relative;
  line-height:1.2;white-space:nowrap
}
.btn-primary{
  background:var(--grad);color:#fff;
  box-shadow:0 4px 20px var(--blue-glow)
}
.btn-primary:hover{transform:translateY(-1px);box-shadow:0 6px 28px var(--blue-glow)}
.btn-primary:active{transform:translateY(0)}
.btn-secondary{
  background:rgba(255,255,255,.04);color:var(--text2);
  border:1px solid var(--border)
}
.btn-secondary:hover{background:rgba(255,255,255,.08);border-color:var(--border-hover);color:var(--text)}
.btn-sm{padding:.5rem 1.1rem;font-size:.8125rem}
.btn-lg{padding:.9rem 1.8rem;font-size:1rem}
.btn-block{width:100%;justify-content:center}

/* --- NAVBAR --- */
.navbar{
  position:fixed;top:0;left:0;right:0;height:var(--nav-h);z-index:1000;
  background:rgba(10,14,26,.88);
  backdrop-filter:blur(16px) saturate(1.3);
  -webkit-backdrop-filter:blur(16px) saturate(1.3);
  border-bottom:1px solid var(--border)
}
.navbar-inner{display:flex;align-items:center;justify-content:space-between;height:var(--nav-h)}
.logo{display:flex;align-items:center;gap:.65rem;color:var(--text);font-weight:700;font-size:1.125rem}
.logo-icon{width:28px;height:28px;color:var(--cyan)}
.logo-text{color:var(--cyan);font-weight:800}
.nav-desktop{display:flex;align-items:center;gap:.25rem}
.nav-link{
  padding:.45rem .9rem;color:var(--text2);font-size:.875rem;
  font-weight:500;border-radius:var(--radius-sm);transition:all .15s
}
.nav-link:hover{color:var(--text);background:rgba(255,255,255,.04)}
.nav-link.active{color:var(--text);background:rgba(255,255,255,.06)}
.mobile-menu-btn{display:none;background:none;border:none;color:var(--text);cursor:pointer;padding:.5rem}
.mobile-menu{display:none}

/* --- HERO --- */
.hero{
  position:relative;min-height:90vh;display:flex;align-items:center;
  background:var(--grad-bg);overflow:hidden;padding:var(--space) 0
}
.hero-bg-grid{
  position:absolute;inset:0;
  background-image:
    linear-gradient(rgba(37,99,235,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37,99,235,.04) 1px, transparent 1px);
  background-size:60px 60px;
  mask-image:radial-gradient(ellipse at 50% 0%, black 30%, transparent 70%);
  -webkit-mask-image:radial-gradient(ellipse at 50% 0%, black 30%, transparent 70%)
}
.hero-grid{
  display:grid;grid-template-columns:1fr 1fr;
  gap:3rem;align-items:center;position:relative;z-index:2
}
.hero-badge{
  display:inline-flex;align-items:center;gap:.4rem;
  padding:.35rem .85rem .35rem .4rem;
  background:rgba(37,99,235,.08);border:1px solid rgba(37,99,235,.15);
  border-radius:100px;font-size:.8125rem;color:var(--blue-l);margin-bottom:1.25rem
}
.hero-badge-dot{
  width:7px;height:7px;border-radius:50%;
  background:var(--green);box-shadow:0 0 8px rgba(16,185,129,.4);
  animation:pulse-dot 2s ease-in-out infinite
}
@keyframes pulse-dot{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.6;transform:scale(.85)}}
.hero-title{
  font-size:clamp(2.25rem,5vw,4rem);font-weight:900;
  letter-spacing:-.04em;line-height:1.05;margin-bottom:.75rem;color:var(--text)
}
.hero-highlight{color:var(--blue-l)}
.gradient{background:var(--grad);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;color:var(--blue-l)}
.hero-subtitle{
  font-size:clamp(1rem,1.8vw,1.25rem);color:var(--text2);
  max-width:520px;line-height:1.7;margin-bottom:1.75rem
}
.hero-actions{display:flex;gap:.75rem;flex-wrap:wrap}

/* Hero stats */
.hero-stats{
  display:flex;gap:2rem;margin-top:3rem;
  padding-top:1.75rem;border-top:1px solid var(--border)
}
.hero-stat-value{
  font-size:1.75rem;font-weight:800;color:var(--cyan)
}
.hero-stat-label{color:var(--text-muted);font-size:.8125rem;margin-top:.2rem}

/* Hero visual / cube */
.hero-visual{position:relative;display:flex;justify-content:center;align-items:center;min-height:380px}
.hero-cube-container{position:relative;width:260px;height:260px}
.hero-cube-glow{
  position:absolute;inset:-30px;
  background:radial-gradient(circle,rgba(6,182,212,.12) 0%,transparent 70%);
  border-radius:50%;animation:pulse-glow 4s ease-in-out infinite
}
@keyframes pulse-glow{0%,100%{opacity:.4;transform:scale(1)}50%{opacity:.8;transform:scale(1.08)}}
.hero-cube{position:relative;width:100%;height:100%}
.hero-cube svg{width:100%;height:100%;color:var(--cyan);filter:drop-shadow(0 0 15px rgba(6,182,212,.2));animation:float-cube 6s ease-in-out infinite}
@keyframes float-cube{0%,100%{transform:translateY(0)}50%{transform:translateY(-8px)}}

/* Floating stats en hero */
.floating-stat{
  position:absolute;display:flex;align-items:center;gap:.6rem;
  background:rgba(20,26,46,.92);backdrop-filter:blur(8px);
  border:1px solid var(--border);border-radius:var(--radius);
  padding:.6rem .85rem;animation:float-stat 4s ease-in-out infinite
}
.floating-stat-1{top:8%;right:5%;animation-delay:0s}
.floating-stat-2{top:38%;left:2%;animation-delay:.5s}
.floating-stat-3{bottom:12%;right:8%;animation-delay:1s}
.floating-stat-4{bottom:-8%;left:12%;animation-delay:1.5s}
.floating-stat-5{bottom:5%;left:35%;animation-delay:.25s}
.floating-stat-6{top:20%;left:0;animation-delay:.75s}
@keyframes float-stat{0%,100%{transform:translateY(0)}50%{transform:translateY(-6px)}}
.floating-stat-icon{
  width:32px;height:32px;border-radius:8px;
  display:flex;align-items:center;justify-content:center;flex-shrink:0;
  background:rgba(37,99,235,.08);border:1px solid rgba(37,99,235,.12)
}
.floating-stat-icon svg{width:16px;height:16px;color:var(--blue-l)}
.floating-stat-value{font-size:1rem;font-weight:700;color:var(--text);line-height:1.2}
.floating-stat-label{font-size:.6875rem;color:var(--text-muted);line-height:1.2}

/* --- Secciones comunes --- */
.section{padding:var(--space) 0;position:relative}
.section-alt{background:var(--bg2)}
.section-header{text-align:center;max-width:650px;margin:0 auto 2.5rem}
.section-label{
  display:inline-flex;align-items:center;gap:.4rem;
  padding:.3rem .85rem;background:rgba(37,99,235,.06);
  border:1px solid rgba(37,99,235,.12);
  border-radius:100px;color:var(--blue-l);
  font-size:.75rem;font-weight:500;margin-bottom:.75rem
}
.section-label svg{width:12px;height:12px}
.section-title{
  font-size:clamp(1.5rem,3vw,2.25rem);font-weight:800;
  letter-spacing:-.03em;line-height:1.15;color:var(--text)
}
.section-subtitle{color:var(--text2);font-size:1rem;margin-top:.75rem;line-height:1.7}
.section-divider{
  width:50px;height:3px;background:var(--grad);
  border-radius:2px;margin:1.25rem auto 0
}

/* --- Service Cards --- */
.services-grid{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:1.25rem
}
.card{
  background:var(--bg-card);border:1px solid var(--border);
  border-radius:var(--radius-lg);
  transition:all .25s;position:relative;overflow:hidden
}
.card::before{
  content:'';position:absolute;top:0;left:0;right:0;height:3px;
  background:var(--grad);opacity:0;transition:opacity .25s
}
.card:hover{border-color:var(--border-hover);transform:translateY(-3px)}
.card:hover::before{opacity:1}
.card-icon{
  width:44px;height:44px;border-radius:10px;
  background:rgba(37,99,235,.08);border:1px solid rgba(37,99,235,.12);
  display:flex;align-items:center;justify-content:center;
  color:var(--blue-l);margin-bottom:.75rem
}
.card-icon svg{width:22px;height:22px}
.card-title{font-size:1.0625rem;font-weight:700;margin-bottom:.4rem;color:var(--text)}
.card-desc{color:var(--text2);font-size:.875rem;line-height:1.65}

/* --- Service Cards (extends .card) --- */
.service-card{
  background:var(--bg-card);border:1px solid var(--border);
  border-radius:var(--radius-lg);padding:1.75rem;
  transition:all .25s;position:relative;overflow:hidden
}
.service-card:hover{border-color:var(--border-hover);transform:translateY(-2px);box-shadow:0 8px 30px rgba(0,0,0,.3)}
.service-card-title{font-size:1.15rem;font-weight:700;color:var(--text);margin-bottom:.5rem}
.service-card-desc{font-size:.9rem;color:var(--text2);line-height:1.6}
.service-icon{
  width:44px;height:44px;border-radius:var(--radius);
  display:flex;align-items:center;justify-content:center;
  background:rgba(37,99,235,.1);color:var(--blue-l);margin-bottom:1rem
}
.service-icon svg{width:22px;height:22px}
.service-features{
  list-style:none;margin-top:1rem;display:flex;
  flex-direction:column;gap:.35rem
}
.service-features li{
  font-size:.8125rem;color:var(--text2);
  display:flex;align-items:center;gap:.4rem
}
.service-features li::before{
  content:'✓';color:var(--cyan);font-weight:700;font-size:.75rem
}

/* --- Project Cards --- */
.projects-grid{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:1.25rem
}
.project-card{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-lg);overflow:hidden;transition:all .25s}
.project-card:hover{border-color:var(--border-hover);transform:translateY(-3px)}
.project-image{position:relative;height:180px;overflow:hidden;border-bottom:1px solid var(--border)}
.project-image img{width:100%;height:100%;object-fit:cover}
.project-image-placeholder{width:100%;height:100%;background:var(--grad);opacity:.1;display:flex;align-items:center;justify-content:center}
.project-image-overlay{
  position:absolute;inset:0;
  background:linear-gradient(to top,rgba(10,14,26,.7),transparent 50%);
  display:flex;align-items:flex-end;padding:.75rem
}
.project-body{padding:1.25rem}
.project-title{font-size:1.0625rem;font-weight:700;margin-bottom:.35rem}
.project-subtitle{color:var(--text2);font-size:.8125rem;line-height:1.6;margin-bottom:.75rem}
.project-tech{display:flex;flex-wrap:wrap;gap:.35rem;margin-bottom:.75rem}
.tag{
  display:inline-flex;align-items:center;padding:.2rem .65rem;
  background:rgba(37,99,235,.06);border:1px solid rgba(37,99,235,.1);
  border-radius:100px;font-size:.6875rem;font-weight:500;color:var(--blue-l)
}
.tag-cyan{background:rgba(6,182,212,.08);border-color:rgba(6,182,212,.12);color:var(--cyan)}
.project-link{color:var(--blue-l);font-weight:600;font-size:.8125rem;display:inline-flex;align-items:center;gap:.25rem}
.project-link:hover{color:var(--cyan)}
.project-link svg{width:12px;height:12px;transition:transform .2s}
.project-link:hover svg{transform:translateX(3px)}

/* --- Hardware Grid --- */
.hardware-grid{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:1.25rem
}
.hardware-card{
  background:var(--bg-card);border:1px solid var(--border);
  border-radius:var(--radius-lg);padding:1.5rem;text-align:center;transition:all .25s
}
.hardware-card:hover{border-color:var(--border-hover);transform:translateY(-2px)}
.hardware-icon{
  width:50px;height:50px;border-radius:12px;
  background:var(--grad);display:flex;align-items:center;
  justify-content:center;margin:0 auto .75rem
}
.hardware-icon svg{width:24px;height:24px;color:#fff}
.hardware-name{font-size:.9375rem;font-weight:700;margin-bottom:.2rem}
.hardware-spec{color:var(--text-muted);font-size:.75rem}
.hardware-temp{font-size:1.125rem;font-weight:700;color:var(--cyan);margin-top:.5rem}
.hardware-footer{
  display:flex;justify-content:center;gap:.75rem;flex-wrap:wrap;
  margin-top:.75rem;padding-top:.75rem;border-top:1px solid var(--border)
}

/* --- Dashboard / Sensors (ponytail: flat, no nesting) --- */
.dash-card{
  background:var(--bg-card);border:1px solid var(--border);
  border-radius:var(--radius-lg);padding:1.1rem;transition:all .2s
}
.dash-card:hover{border-color:var(--border-hover)}
.dash-offline{opacity:.55}
.dash-head{display:flex;align-items:center;gap:.55rem;margin-bottom:.3rem}
.dash-icon{
  width:28px;height:28px;border-radius:7px;flex-shrink:0;
  background:rgba(6,182,212,.08);border:1px solid rgba(6,182,212,.12);
  display:flex;align-items:center;justify-content:center;color:var(--cyan)
}
.dash-icon svg{width:14px;height:14px}
.dash-head-body{flex:1;min-width:0}
.dash-name{font-weight:600;font-size:.8125rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dash-meta{font-size:.625rem;color:var(--text-muted)}
.dash-badge{
  font-size:.5625rem;font-weight:600;padding:.15rem .5rem;border-radius:100px;flex-shrink:0
}
.dash-badge-on{background:rgba(16,185,129,.1);color:var(--green)}
.dash-badge-off{background:rgba(100,116,139,.1);color:var(--text-muted)}
.dash-head-sub{
  display:flex;align-items:center;justify-content:space-between;
  font-size:.625rem;color:var(--text-muted);margin-bottom:.55rem
}
.dash-wifi{display:flex;align-items:flex-end;gap:2px;height:18px}
.dash-wb{width:3px;background:var(--cyan);border-radius:2px}
.dash-h8{height:8px}.dash-h12{height:12px}.dash-h16{height:16px}.dash-h20{height:20px}
.dash-op0{opacity:0}.dash-op01{opacity:.1}.dash-op02{opacity:.2}.dash-op04{opacity:.4}.dash-op1{opacity:1}
.dash-sensors{display:flex;flex-direction:column;gap:.3rem;margin-bottom:.55rem}
.dash-row{
  display:flex;justify-content:space-between;align-items:center;
  padding:.3rem .55rem;background:rgba(255,255,255,.02);border-radius:var(--radius-sm)
}
.dash-row-l{
  font-size:.6875rem;color:var(--text2);overflow:hidden;
  text-overflow:ellipsis;white-space:nowrap;min-width:0;flex:1
}
.dash-val{font-weight:700;font-size:.8125rem;white-space:nowrap;flex-shrink:0;margin-left:.5rem}
.dash-val.dash-hot{color:var(--red)}
.dash-val.dash-warm{color:var(--amber)}
.dash-val.dash-cool{color:var(--cyan)}
.dash-val.dash-on{color:var(--green)}
.dash-val.dash-off{color:var(--text-muted)}
.dash-foot{
  display:flex;gap:.75rem;padding-top:.5rem;margin-top:.5rem;
  border-top:1px solid var(--border);font-size:.625rem;color:var(--text-muted);flex-wrap:wrap
}
.dash-bar{
  margin-top:1.25rem;padding:.65rem 1rem;
  background:var(--bg-card);border:1px solid var(--border);
  border-radius:var(--radius);text-align:center;
  font-size:.6875rem;color:var(--text-muted);display:flex;align-items:center;justify-content:center;gap:.3rem;flex-wrap:wrap
}
.dash-bar b{color:var(--text2);font-weight:500}

/* Dashboard grid */
.dashboard-grid{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:1.1rem
}
.dashboard-grid.loading{opacity:.5}

/* --- Contact Section --- */
.contact-grid{display:grid;grid-template-columns:1fr 1fr;gap:2.5rem;align-items:start}
.contact-info{display:flex;flex-direction:column;gap:1rem}
.contact-info-item{
  display:flex;gap:.85rem;align-items:flex-start;
  padding:.85rem;background:rgba(255,255,255,.02);
  border-radius:var(--radius-lg);transition:all .2s
}
.contact-info-item:hover{background:rgba(37,99,235,.04)}
.contact-info-icon{
  width:40px;height:40px;border-radius:10px;flex-shrink:0;
  background:rgba(37,99,235,.08);border:1px solid rgba(37,99,235,.1);
  display:flex;align-items:center;justify-content:center;color:var(--blue-l)
}
.contact-info-icon svg{width:18px;height:18px}
.contact-info-title{font-weight:600;font-size:.875rem;margin-bottom:.1rem}
.contact-info-text{font-size:.8125rem;color:var(--text2);line-height:1.5}

/* --- Formularios (unificados) --- */
.form-wrap{
  background:var(--bg-card);border:1px solid var(--border);
  border-radius:var(--radius-lg);padding:1.75rem
}
.form{display:flex;flex-direction:column;gap:.85rem}
.form-row{display:grid;grid-template-columns:1fr 1fr;gap:.85rem}
.form-group{display:flex;flex-direction:column;gap:.3rem}
.form-label{font-size:.75rem;font-weight:500;color:var(--text2)}
.form-input,.form-select,.form-textarea{
  width:100%;padding:.7rem .9rem;
  background:var(--bg);border:1px solid var(--border);
  border-radius:var(--radius);color:var(--text);
  font-family:var(--font);font-size:.875rem;
  outline:none;transition:border-color .2s,box-shadow .2s
}
.form-input:focus,.form-select:focus,.form-textarea:focus{
  border-color:var(--blue);box-shadow:0 0 0 2px var(--blue-glow)
}
.form-select{
  appearance:none;-webkit-appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%2394a3b8' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right .7rem center;
  padding-right:2.25rem
}
.form-textarea{resize:vertical;min-height:100px}

/* Form success */
.form-success{text-align:center;padding:2rem 1rem}
.form-success-icon{
  width:56px;height:56px;margin:0 auto .75rem;
  background:rgba(16,185,129,.1);border-radius:50%;
  display:flex;align-items:center;justify-content:center;color:var(--green)
}
.form-success-icon svg{width:28px;height:28px}
.form-success-title{font-size:1.25rem;font-weight:700;margin-bottom:.4rem;color:var(--text)}
.form-success-text{color:var(--text2);font-size:.875rem}

/* --- Footer --- */
.footer{
  background:var(--bg2);border-top:1px solid var(--border);
  padding:3rem 0 1.5rem;margin-top:var(--space)
}
.footer-accent-line{height:3px;background:var(--grad);margin-bottom:0}
.footer-grid{
  display:grid;grid-template-columns:2fr 1fr 1fr 1fr;gap:1.5rem;
  padding-bottom:1.5rem;border-bottom:1px solid var(--border);margin-bottom:1.5rem
}
.footer-brand{margin-bottom:.75rem}
.footer-logo{display:flex;align-items:center;gap:.5rem;font-weight:700;font-size:1rem;color:var(--text)}
.footer-logo svg{width:24px;height:24px;color:var(--cyan)}
.footer-logo-text{color:var(--cyan)}
.footer-desc{color:var(--text2);font-size:.8125rem;line-height:1.7;max-width:300px;margin-top:.65rem}
.footer-col-title{font-weight:600;font-size:.8125rem;margin-bottom:.75rem;color:var(--text)}
.footer-links{display:flex;flex-direction:column;gap:.4rem}
.footer-link{color:var(--text2);font-size:.8125rem;transition:color .15s}
.footer-link:hover{color:var(--blue-l)}
.footer-social{display:flex;gap:.6rem;margin-top:.75rem}
.footer-social-link{
  width:32px;height:32px;border-radius:7px;
  background:rgba(255,255,255,.04);border:1px solid var(--border);
  display:flex;align-items:center;justify-content:center;
  color:var(--text2);transition:all .15s
}
.footer-social-link:hover{background:rgba(37,99,235,.12);border-color:rgba(37,99,235,.2);color:var(--blue-l)}
.footer-bottom{text-align:center;color:var(--text-muted);font-size:.75rem;padding-top:1rem}
.footer-copyright{color:var(--text-muted);font-size:.75rem}

/* --- Tech Stack Section --- */
.tech-grid{display:grid;grid-template-columns:1fr 1fr;gap:1.5rem}
.tech-category{
  background:var(--bg-card);border:1px solid var(--border);
  border-radius:var(--radius-lg);padding:1.5rem
}
.tech-category-title{
  font-size:.9375rem;font-weight:700;margin-bottom:.75rem;
  display:flex;align-items:center;gap:.4rem;color:var(--text)
}
.tech-category-title::before{
  content:'';width:3px;height:18px;background:var(--grad);border-radius:2px;flex-shrink:0
}
.tech-badges{display:flex;flex-wrap:wrap;gap:.4rem}
.tech-badge{
  display:inline-flex;align-items:center;gap:.3rem;
  padding:.3rem .75rem;background:rgba(255,255,255,.03);
  border:1px solid var(--border);border-radius:100px;
  font-size:.75rem;font-weight:500;color:var(--text2);transition:all .2s
}
.tech-badge:hover{background:rgba(37,99,235,.08);border-color:rgba(37,99,235,.15);color:var(--text)}
.tech-badge-dot{width:6px;height:6px;border-radius:50%;flex-shrink:0}
.tech-cta{
  text-align:center;margin-top:2.5rem;padding:1.75rem;
  background:var(--bg-card);border:1px solid var(--border);
  border-radius:var(--radius-lg)
}
.tech-cta p{font-size:1rem;margin-bottom:1rem;color:var(--text2)}

/* --- Page Hero (inner pages) --- */
.page-hero{
  position:relative;padding:7rem 0 2.5rem;overflow:hidden;
  background:var(--grad-bg)
}
.page-hero-content{max-width:var(--max-w-sm);margin:0 auto;text-align:center}
.page-hero-title{
  font-size:clamp(1.75rem,3.5vw,2.5rem);font-weight:800;
  letter-spacing:-.03em;line-height:1.1;margin-bottom:.75rem;color:var(--text)
}
.page-hero-subtitle{color:var(--text2);font-size:1rem;line-height:1.7}
.page-hero-content .section-label{margin:0 auto .75rem;display:inline-flex}

/* --- Casos de uso --- */
.casos-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:1.25rem}
.caso-card{
  background:var(--bg-card);border:1px solid var(--border);
  border-radius:var(--radius-lg);padding:1.75rem;transition:all .25s
}
.caso-card:hover{border-color:var(--border-hover);transform:translateY(-2px)}
.caso-number{
  font-size:2.5rem;font-weight:900;color:var(--cyan);
  line-height:1;margin-bottom:.4rem;opacity:.4
}
.caso-title{font-size:1.0625rem;font-weight:700;margin-bottom:.65rem}
.caso-desc{color:var(--text2);font-size:.8125rem;line-height:1.7;margin-bottom:.75rem}
.caso-tech{display:flex;gap:.4rem;flex-wrap:wrap}

/* --- CTA Section --- */
.cta-section{padding:3rem 0}
.cta-box{
  text-align:center;padding:2.5rem 2rem;
  background:var(--bg-card);border:1px solid var(--border);
  border-radius:var(--radius-xl);
  background-image:
    radial-gradient(ellipse at 30% 50%, rgba(37,99,235,.05) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 50%, rgba(6,182,212,.05) 0%, transparent 60%)
}
.cta-title{font-size:1.5rem;font-weight:800;margin-bottom:.65rem}
.cta-text{color:var(--text2);font-size:.9375rem;margin-bottom:1.25rem;max-width:480px;margin-left:auto;margin-right:auto}

/* --- Info Cards (presupuesto page) --- */
.presupuesto-container{display:grid;grid-template-columns:1fr 1fr;gap:2rem;align-items:start}
.presupuesto-info{position:sticky;top:5rem}
.info-cards{display:grid;grid-template-columns:1fr;gap:.85rem}
.info-card{
  display:flex;align-items:center;gap:.65rem;
  background:var(--bg-card);border:1px solid var(--border);
  border-radius:var(--radius-lg);padding:.85rem
}
.info-card-icon{
  width:38px;height:38px;border-radius:9px;flex-shrink:0;
  display:flex;align-items:center;justify-content:center
}
.info-card-icon svg{width:18px;height:18px}
.info-card-icon--cyan{background:rgba(6,182,212,0.1);color:var(--cyan)}
.info-card-icon--green{background:rgba(16,185,129,0.1);color:var(--green)}
.info-card-icon--amber{background:rgba(245,158,11,0.1);color:var(--amber)}
.info-card-value{font-weight:700;font-size:.875rem}
.info-card-label{font-size:.6875rem;color:var(--text-muted)}

/* --- Blog --- */
.blog-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:1.25rem}
.blog-card{
  background:var(--bg-card);border:1px solid var(--border);
  border-radius:var(--radius-lg);padding:1.5rem;transition:all .25s
}
.blog-card:hover{border-color:var(--border-hover);transform:translateY(-2px)}
.blog-card-tag{display:inline-block;padding:.2rem .65rem;background:rgba(37,99,235,.08);border:1px solid rgba(37,99,235,.1);border-radius:100px;font-size:.625rem;font-weight:500;color:var(--blue-l);margin-bottom:.65rem}
.blog-card-title{font-size:1.0625rem;font-weight:700;margin-bottom:.4rem}
.blog-card-desc{font-size:.8125rem;color:var(--text2);line-height:1.65;margin-bottom:.65rem}
.blog-card-meta{font-size:.6875rem;color:var(--text-muted);display:flex;gap:.75rem}

/* --- Toast --- */
#toast-container,.toast-container{
  position:fixed;bottom:1.5rem;right:1.5rem;z-index:9999;
  display:flex;flex-direction:column;gap:.4rem
}
.toast{
  padding:.65rem 1.1rem;border-radius:var(--radius);
  font-size:.8125rem;font-weight:500;color:#fff;
  box-shadow:0 4px 20px rgba(0,0,0,.5);
  animation:slide-in .25s ease;transition:all .25s
}
.toast-success{background:var(--green)}
.toast-error{background:var(--red)}
@keyframes slide-in{from{opacity:0;transform:translateX(100%)}to{opacity:1;transform:translateX(0)}}

/* --- Modal --- */
.modal-overlay{
  position:fixed;inset:0;
  background:rgba(0,0,0,.65);
  backdrop-filter:blur(4px);
  -webkit-backdrop-filter:blur(4px);
  display:flex;align-items:center;justify-content:center;
  z-index:1000;opacity:0;pointer-events:none;transition:opacity .25s
}
.modal-overlay.open{opacity:1;pointer-events:all}
.modal{
  background:var(--bg-card);border:1px solid var(--border-hover);
  border-radius:var(--radius-lg);padding:1.75rem;
  max-width:500px;width:92%;max-height:80vh;overflow-y:auto;
  animation:modal-in .25s ease-out
}
@keyframes modal-in{
  from{opacity:0;transform:scale(.95) translateY(8px)}
  to{opacity:1;transform:scale(1) translateY(0)}
}
.modal h2{font-size:1.125rem;font-weight:700;margin-bottom:.65rem}
.modal p{color:var(--text2);font-size:.875rem;line-height:1.7;margin-bottom:1.25rem}
.modal-close{
  float:right;background:none;border:none;
  color:var(--text-muted);font-size:1.375rem;
  cursor:pointer;line-height:1;padding:0 0 0 .75rem;transition:color .15s
}
.modal-close:hover{color:var(--text)}
.modal-actions{display:flex;gap:.65rem;justify-content:flex-end}

/* --- Tooltip --- */
[data-tooltip]{position:relative;cursor:help}
[data-tooltip]::after{
  content:attr(data-tooltip);
  position:absolute;bottom:calc(100% + 5px);left:50%;
  transform:translateX(-50%);
  padding:3px 8px;background:var(--bg-elevated);color:var(--text);
  border:1px solid var(--border);border-radius:var(--radius-sm);
  font-size:.6875rem;white-space:nowrap;
  opacity:0;pointer-events:none;transition:opacity .15s;z-index:100
}
[data-tooltip]:hover::after{opacity:1}

/* --- Empty State --- */
.empty-state{text-align:center;padding:2.5rem 1rem}
.empty-state-icon{
  width:56px;height:56px;margin:0 auto .75rem;
  background:rgba(37,99,235,.06);border-radius:14px;
  display:flex;align-items:center;justify-content:center;color:var(--text-muted)
}
.empty-state-icon svg{width:28px;height:28px}
.empty-state-text{color:var(--text2);font-size:.875rem}

/* --- Skeleton --- */
.skeleton{
  background:linear-gradient(90deg,
    rgba(255,255,255,.02) 25%,
    rgba(255,255,255,.05) 50%,
    rgba(255,255,255,.02) 75%);
  background-size:200% 100%;
  animation:skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius:var(--radius-sm)
}
.skeleton-card{height:180px;margin-bottom:.75rem}
.skeleton-text{height:12px;margin-bottom:6px;width:80%}
.skeleton-text:last-child{width:60%}
.skeleton-avatar{width:40px;height:40px;border-radius:50%;flex-shrink:0}
@keyframes skeleton-shimmer{
  0%{background-position:-200% 0}
  100%{background-position:200% 0}
}

/* --- Animaciones globales --- */
.animate-fade-in-up{opacity:0;transform:translateY(24px);animation:fade-in-up .5s forwards}
.animate-fade-in{opacity:0;animation:fade-in .5s forwards}
@keyframes fade-in-up{to{opacity:1;transform:translateY(0)}}
@keyframes fade-in{to{opacity:1}}
.reveal{opacity:0;transform:translateY(24px);transition:all .5s}
.reveal.visible{opacity:1;transform:translateY(0)}
.animate-float{animation:float 4s ease-in-out infinite}
@keyframes float{0%,100%{transform:translateY(0)}50%{transform:translateY(-6px)}}
.animate-pulse-soft{animation:pulse-soft 2s ease-in-out infinite}
@keyframes pulse-soft{0%,100%{opacity:1}50%{opacity:.6}}
.animate-scale-in{animation:scale-in .25s ease-out}
@keyframes scale-in{from{transform:scale(0)}to{transform:scale(1)}}

/* --- Floating stat icon variants --- */
.floating-stat-icon--green{background:rgba(16,185,129,0.15);color:var(--green)}
.floating-stat-icon--blue{background:rgba(59,130,246,0.15);color:var(--blue-l)}
.floating-stat-icon--cyan{background:rgba(20,184,166,0.15);color:var(--cyan)}
.floating-stat-icon--amber{background:rgba(245,158,11,0.15);color:var(--amber)}
.floating-stat-icon--purple{background:rgba(139,92,246,0.15);color:#a78bfa}
.floating-stat-icon--cyan-l{background:rgba(34,211,238,0.15);color:var(--cyan-l)}

/* Animation delay utilities */
.delay-1{animation-delay:0.1s !important}
.delay-2{animation-delay:0.2s !important}
.delay-3{animation-delay:0.3s !important}
.delay-4{animation-delay:0.4s !important}
.delay-5{animation-delay:0.5s !important}
.delay-6{animation-delay:0.6s !important}

/* Live dot para botón Sensores en Vivo */
.live-dot{width:8px;height:8px;border-radius:50%;background:var(--cyan);display:inline-block;box-shadow:0 0 8px rgba(6,182,212,0.5);flex-shrink:0}

/* --- Scrollbar --- */
::-webkit-scrollbar{width:6px;height:6px}
::-webkit-scrollbar-track{background:var(--bg)}
::-webkit-scrollbar-thumb{background:var(--border-hover);border-radius:3px}
::-webkit-scrollbar-thumb:hover{background:var(--text-muted)}

/* --- Navbar spacer --- */
.navbar-spacer{height:4rem}

/* --- Text utilities --- */
.text-center{text-align:center}

/* --- Section variants --- */
.section-bb-0{padding-bottom:0}

/* --- Section label centered --- */
.section-label--centered{margin:0 auto 1rem}

/* --- Page hero compact variant --- */
.page-hero--compact{min-height:auto;padding:6rem 0 3rem}

/* --- Tech badge dot color modifiers --- */
.tech-badge-dot--cyan{background:#06b6d4}
.tech-badge-dot--green{background:#10b981}
.tech-badge-dot--amber{background:#f59e0b}
.tech-badge-dot--red{background:#ef4444}
.tech-badge-dot--purple{background:#8b5cf6}
.tech-badge-dot--blue{background:#3b82f6}
.tech-badge-dot--teal{background:#14b8a6}
.tech-badge-dot--pink{background:#ec4899}
.tech-badge-dot--orange{background:#f97316}

/* --- Hardware icon wrap color modifiers --- */
.hardware-icon-wrap{color:var(--text-muted)}
.hardware-icon-wrap--accent{color:var(--color-accent)}
.hardware-icon-wrap--info{color:var(--color-info)}
.hardware-icon-wrap--success{color:var(--color-success)}
.hardware-icon-wrap--dim{color:var(--color-text-dim)}

/* --- Card animation via CSS custom property --- */
.hardware-card.reveal{animation-delay:calc(var(--card-index,0)*0.1s)}
.project-card.reveal{animation-delay:calc(var(--card-index,0)*0.1s)}

/* --- Footer inline style migrations --- */
.footer-link--status{display:flex;align-items:center;gap:0.5rem}
.footer-status-dot{width:7px;height:7px;border-radius:50%;background:var(--green);box-shadow:0 0 6px rgba(16,185,129,0.5);flex-shrink:0}

/* ============================================================
   Responsive
   ============================================================ */
@media(max-width:768px){
  .nav-desktop{display:none}
  .mobile-menu-btn{display:flex}
  .mobile-menu{
    display:block;position:fixed;top:var(--nav-h);left:0;right:0;
    background:rgba(10,14,26,.98);backdrop-filter:blur(16px);
    border-bottom:1px solid var(--border);
    transform:translateY(-100%);opacity:0;transition:all .3s;pointer-events:none
  }
  .mobile-menu.active{transform:translateY(0);opacity:1;pointer-events:all}
  .mobile-menu-inner{display:flex;flex-direction:column;padding:.75rem 0;gap:.2rem}
  .mobile-nav-link{
    padding:.65rem 1rem;color:var(--text2);font-size:1rem;font-weight:500;border-radius:var(--radius-sm);display:block
  }
  .mobile-nav-link:hover{color:var(--text);background:rgba(255,255,255,.04)}

  .section{padding:var(--space-sm) 0}
  .section-title{font-size:clamp(1.35rem,4vw,1.75rem)}
  .hero{min-height:auto;padding:4rem 0 2.5rem;text-align:center}
  .hero-grid{grid-template-columns:1fr;gap:1.5rem}
  .hero-subtitle{margin-left:auto;margin-right:auto}
  .hero-actions{justify-content:center}
  .hero-visual{display:none}
  .hero-stats{justify-content:center;flex-wrap:wrap;gap:1.25rem}
  .hero-stat-value{font-size:1.5rem}

  .contact-grid{grid-template-columns:1fr;gap:1.5rem}
  .presupuesto-container{grid-template-columns:1fr}
  .footer-grid{grid-template-columns:1fr 1fr;gap:1rem}
  .tech-grid{grid-template-columns:1fr}
  .form-row{grid-template-columns:1fr}
  .dashboard-grid{grid-template-columns:1fr;gap:1rem}
  .info-cards{grid-template-columns:1fr}
  .projects-grid{grid-template-columns:1fr}
  .hardware-grid{grid-template-columns:1fr 1fr}
  .modal{padding:1.25rem;margin:.75rem}
  .page-hero{padding:5.5rem 0 2rem}
}
@media(max-width:480px){
  .hero-title{font-size:1.75rem}
  .hardware-grid{grid-template-columns:1fr}
  .services-grid{grid-template-columns:1fr}
  .casos-grid{grid-template-columns:1fr}
  .blog-grid{grid-template-columns:1fr}
  .footer-grid{grid-template-columns:1fr}

  /* Dashboard mobile — compact */
  .dash-card{padding:.85rem}
  .dash-head{gap:.45rem}
  .dash-icon{width:24px;height:24px}
  .dash-icon svg{width:12px;height:12px}
  .dash-name{font-size:.75rem}
  .dash-meta{font-size:.5625rem}
  .dash-badge{font-size:.5rem;padding:.1rem .4rem}
  .dash-head-sub{gap:.45rem;font-size:.5625rem}
  .dash-wifi{height:14px}
  .dash-wb{width:2px}
  .dash-row{padding:.25rem .45rem}
  .dash-row-l{font-size:.625rem}
  .dash-val{font-size:.75rem}
  .dash-foot{gap:.5rem;font-size:.5625rem}
  .dash-bar{font-size:.625rem;padding:.5rem .75rem}
  .dashboard-grid{gap:.85rem}

  .page-hero-title{font-size:1.5rem}
}
