/* Off Grid Power — sistema de diseño "vidrio y luz" */
@view-transition { navigation: auto; }
@property --angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }

:root {
  color-scheme: dark;
  --night: #060B18;
  --night-2: #0A1428;
  --ink: #EAF2FF;
  --ink-2: #B9C6DC;
  --muted: #8C9BB5;
  --sun: #FFB21E;
  --sun-hot: #FFD36B;
  --volt: #5BE7FF;
  --volt-deep: #1E9BFF;
  --leaf: #2FB34A;
  --glass: rgba(255, 255, 255, .055);
  --glass-2: rgba(255, 255, 255, .09);
  --edge: rgba(255, 255, 255, .13);
  --edge-hi: rgba(255, 255, 255, .32);
  --shadow: 0 30px 60px -30px rgba(0, 0, 0, .75);
  --r-xl: 34px; --r-lg: 24px; --r-md: 16px; --r-sm: 12px;
  --font: "Urbanist", ui-sans-serif, -apple-system, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  --fs-hero: clamp(2.55rem, 1.2rem + 5.2vw, 5.6rem);
  --fs-h2: clamp(2rem, 1.2rem + 2.8vw, 3.5rem);
  --fs-h3: clamp(1.25rem, 1.1rem + .5vw, 1.5rem);
  --fs-lead: clamp(1.1rem, 1rem + .45vw, 1.35rem);
  --fs-body: 1.0625rem;
  --fs-sm: .9rem;
  --wrap: 1200px;
  --gutter: clamp(18px, 4vw, 40px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --sun-y: -12%;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 110px; }
body {
  margin: 0; min-height: 100vh;
  background: var(--night);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-body);
  font-weight: 450;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
/* Cielo: el sol baja mientras se recorre la página */
body::before {
  content: ""; position: fixed; inset: -10vh 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(60vmax 50vmax at 82% var(--sun-y), rgba(255, 178, 30, .20), rgba(255, 140, 20, .06) 40%, transparent 65%),
    radial-gradient(55vmax 45vmax at 6% 105%, rgba(91, 231, 255, .10), transparent 60%),
    radial-gradient(40vmax 30vmax at 40% 50%, rgba(30, 155, 255, .05), transparent 70%),
    linear-gradient(180deg, #071226 0%, var(--night) 55%, #040812 100%);
}
body::after { /* grano fino para que el vidrio tenga algo que refractar */
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--volt); outline-offset: 3px; border-radius: 8px; }
::selection { background: rgba(255, 178, 30, .35); }

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.03em; line-height: 1.05; text-wrap: balance; }
h1 { font-size: var(--fs-hero); letter-spacing: -.045em; line-height: .98; font-weight: 700; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); letter-spacing: -.02em; line-height: 1.2; }
p { margin: 0; text-wrap: pretty; }
.lead { font-size: var(--fs-lead); color: var(--ink-2); line-height: 1.5; max-width: 38ch; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; padding: 10px 16px; background: var(--sun); color: #1a1000; border-radius: 10px; font-weight: 700; }
.skip:focus { left: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
section { position: relative; }
.section { padding-block: clamp(72px, 10vw, 140px); }
.section-head { display: grid; gap: 18px; margin-bottom: clamp(36px, 5vw, 64px); max-width: 760px; }
.section-head p { color: var(--ink-2); font-size: var(--fs-lead); max-width: 56ch; }

/* ---------- Vidrio ---------- */
.glass {
  position: relative; isolation: isolate;
  background: linear-gradient(150deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .025) 55%, rgba(255, 255, 255, .05));
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  backdrop-filter: blur(22px) saturate(170%);
  border: 1px solid var(--edge);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 -1px 0 rgba(255, 255, 255, .05), inset 0 0 0 1px rgba(255, 255, 255, .02), var(--shadow);
}
/* reflejo especular que sigue la luz (el cursor) */
.glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 30%) var(--my, -20%), rgba(255, 220, 150, .16), rgba(255, 255, 255, .04) 35%, transparent 60%);
  opacity: var(--lit, .55); transition: opacity .5s var(--ease);
}
/* borde que se ilumina del lado de la luz */
.glass::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; padding: 1px;
  background: radial-gradient(260px circle at var(--mx, 30%) var(--my, -20%), rgba(255, 214, 120, .9), rgba(91, 231, 255, .35) 40%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: var(--lit, 0); transition: opacity .5s var(--ease);
}
.glass.is-lit { --lit: 1; }

/* ---------- Botones ---------- */
.btn {
  --h: 54px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--h); padding: 0 26px; border-radius: 999px; border: 0; cursor: pointer;
  font-weight: 650; font-size: 1.02rem; letter-spacing: -.01em; white-space: nowrap;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), background .35s var(--ease);
  position: relative; overflow: hidden; isolation: isolate;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:active { transform: scale(.97); }
.btn-sun {
  color: #241500;
  background: linear-gradient(180deg, #FFD36B, #FFB21E 55%, #F59A0B);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -2px 6px rgba(160, 80, 0, .35), 0 10px 30px -8px rgba(255, 170, 30, .55), 0 0 0 1px rgba(255, 190, 60, .5);
}
.btn-sun::after { /* destello que recorre el botón: carga */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .75) 48%, transparent 62%);
  transform: translateX(-120%); transition: transform .8s var(--ease);
}
.btn-sun:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -2px 6px rgba(160, 80, 0, .35), 0 14px 44px -6px rgba(255, 170, 30, .8), 0 0 0 1px rgba(255, 210, 90, .8); }
.btn-sun:hover::after { transform: translateX(120%); }
.btn-glass {
  color: var(--ink);
  background: rgba(255, 255, 255, .07);
  -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), inset 0 0 0 1px rgba(255, 255, 255, .14);
}
.btn-glass:hover { background: rgba(255, 255, 255, .12); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), inset 0 0 0 1px rgba(91, 231, 255, .45), 0 0 24px -4px rgba(91, 231, 255, .35); }
.btn-wa svg { color: #4BE38A; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Navegación ---------- */
.topbar {
  position: fixed; top: 14px; left: 50%; translate: -50% 0; z-index: 50;
  width: min(100% - 24px, 1080px);
  display: flex; align-items: center; gap: 8px;
  height: 64px; padding: 0 8px 0 18px; border-radius: 999px;
  view-transition-name: topbar;
}
.topbar .brand { display: flex; align-items: center; height: 100%; margin-right: auto; }
.topbar .brand img { height: 40px; width: auto; }
.nav { display: flex; gap: 2px; position: relative; }
.nav a {
  position: relative; padding: 9px 15px; border-radius: 999px; font-weight: 550; font-size: .97rem; color: var(--ink-2);
  transition: color .3s var(--ease), background .3s var(--ease);
}
.nav a:hover { color: var(--ink); background: rgba(255, 255, 255, .06); }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::before { /* lente activa: viaja entre páginas */
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1;
  background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .06));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 0 0 1px rgba(255, 255, 255, .12), 0 0 18px -6px rgba(255, 190, 70, .5);
  view-transition-name: nav-lens;
}
.topbar .btn { --h: 46px; padding: 0 20px; font-size: .96rem; margin-left: 6px; }
.topbar.is-scrolled { background: rgba(10, 18, 36, .55); }
.icon-btn { display: none; width: 46px; height: 46px; border-radius: 999px; align-items: center; justify-content: center; }
.icon-btn svg { width: 22px; height: 22px; }

.tabbar { display: none; }

@media (max-width: 900px) {
  .topbar { top: 10px; height: 58px; padding: 0 6px 0 16px; }
  .topbar .brand img { height: 34px; }
  .topbar .nav, .topbar .btn { display: none; }
  .icon-btn { display: inline-flex; background: rgba(75, 227, 138, .14); color: #4BE38A; box-shadow: inset 0 0 0 1px rgba(75, 227, 138, .35); }
  .topbar .about-link { display: inline-flex; padding: 9px 14px; font-weight: 600; font-size: .95rem; color: var(--ink-2); border-radius: 999px; }
  .topbar .about-link[aria-current="page"] { color: var(--ink); background: rgba(255, 255, 255, .1); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; z-index: 50; left: 50%; translate: -50% 0; bottom: calc(10px + env(safe-area-inset-bottom));
    width: min(100% - 20px, 520px); height: 68px; padding: 6px; border-radius: 26px;
    view-transition-name: tabbar;
  }
  .tabbar a { position: relative; display: grid; place-items: center; align-content: center; gap: 3px; border-radius: 20px; font-size: .72rem; font-weight: 600; color: var(--muted); }
  .tabbar svg { width: 23px; height: 23px; }
  .tabbar a[aria-current="page"] { color: var(--ink); }
  .tabbar a[aria-current="page"]::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1;
    background: linear-gradient(180deg, rgba(255, 255, 255, .17), rgba(255, 255, 255, .05));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 0 22px -6px rgba(255, 190, 70, .55);
    view-transition-name: tab-lens;
  }
  .tabbar a[aria-current="page"] svg { color: var(--sun); filter: drop-shadow(0 0 6px rgba(255, 178, 30, .6)); }
  body { padding-bottom: 96px; }
}
@media (min-width: 901px) { .topbar .about-link { display: none; } }

/* ---------- Hero ---------- */
.hero { min-height: min(100svh, 980px); display: grid; align-items: center; padding: 120px 0 64px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.hero-copy { display: grid; gap: 26px; position: relative; z-index: 2; }
.hero-copy h1 { max-width: 11ch; }
.hero-copy .lead { max-width: 34ch; }
.hero-proof { display: flex; flex-wrap: wrap; gap: 10px 22px; color: var(--ink-2); font-size: var(--fs-sm); font-weight: 550; }
.hero-proof span { display: inline-flex; align-items: center; gap: 8px; }
.hero-proof svg { width: 18px; height: 18px; color: var(--sun); }

.array { position: relative; aspect-ratio: 1 / .92; width: 100%; }
.array canvas { position: absolute; inset: -8% -14% -8% -8%; width: 122%; height: 116%; }
.meter {
  position: absolute; right: 2%; bottom: 6%; z-index: 3;
  width: 210px; padding: 18px 18px 16px; border-radius: var(--r-lg);
  display: grid; gap: 10px;
}
.meter-top { display: flex; align-items: center; justify-content: space-between; font-size: .82rem; color: var(--ink-2); font-weight: 600; }
.meter-top svg { width: 18px; height: 18px; color: var(--volt); }
.meter-w { font-size: 2.1rem; font-weight: 700; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.meter-w small { font-size: .95rem; font-weight: 600; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.cell-bar { height: 12px; border-radius: 6px; background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); overflow: hidden; }
.cell-bar i { display: block; height: 100%; width: var(--charge, 40%); border-radius: inherit; background: linear-gradient(90deg, var(--volt-deep), var(--volt)); box-shadow: 0 0 14px rgba(91, 231, 255, .8); transition: width .6s var(--ease); }
.meter-foot { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.array-hint { position: absolute; left: 4%; top: 2%; z-index: 3; font-size: .82rem; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.array-hint svg { width: 16px; height: 16px; color: var(--sun); }

@media (max-width: 900px) {
  .hero { padding-top: 100px; min-height: auto; }
  .hero-grid { grid-template-columns: 1fr; }
  .array { aspect-ratio: 1 / .78; margin-top: 8px; }
  .array canvas { inset: -6% -10%; width: 120%; height: 112%; }
  .meter { width: 180px; padding: 14px; right: 0; bottom: 0; }
  .meter-w { font-size: 1.7rem; }
}

/* ---------- Cifras ---------- */
.proof { display: grid; grid-template-columns: repeat(3, 1fr); border-radius: var(--r-xl); overflow: hidden; }
.proof > div { padding: clamp(22px, 3vw, 34px); display: grid; gap: 6px; }
.proof > div + div { border-left: 1px solid rgba(255, 255, 255, .08); }
.proof b { font-size: clamp(2.2rem, 1.6rem + 2vw, 3.4rem); font-weight: 700; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.proof span { color: var(--ink-2); max-width: 24ch; }
@media (max-width: 720px) { .proof { grid-template-columns: 1fr; } .proof > div + div { border-left: 0; border-top: 1px solid rgba(255, 255, 255, .08); } }

/* ---------- Soluciones ---------- */
.solutions { display: grid; grid-template-columns: 1.25fr 1fr 1fr; grid-template-rows: auto auto; gap: 16px; }
.sol { border-radius: var(--r-xl); padding: clamp(24px, 2.6vw, 34px); display: flex; flex-direction: column; gap: 14px; min-height: 280px; overflow: hidden; }
.sol .ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: rgba(255, 178, 30, .12); box-shadow: inset 0 0 0 1px rgba(255, 178, 30, .3); color: var(--sun); }
.sol .ico svg { width: 26px; height: 26px; }
.sol p { color: var(--ink-2); }
.sol .more { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 650; color: var(--sun-hot); }
.sol .more svg { width: 18px; height: 18px; transition: translate .3s var(--ease); }
.sol:hover .more svg { translate: 4px 0; }
.sol-feature { grid-row: span 2; padding: 0; }
.sol-feature .media { position: relative; flex: 1; min-height: 260px; }
.sol-feature .media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sol-feature .media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(6, 11, 24, .95)); }
.sol-feature .body { padding: 0 clamp(24px, 2.6vw, 34px) clamp(24px, 2.6vw, 34px); margin-top: -70px; position: relative; display: grid; gap: 14px; }
.sol.volt .ico { background: rgba(91, 231, 255, .1); box-shadow: inset 0 0 0 1px rgba(91, 231, 255, .3); color: var(--volt); }
@media (max-width: 960px) { .solutions { grid-template-columns: 1fr 1fr; } .sol-feature { grid-column: 1 / -1; grid-row: auto; } }
@media (max-width: 600px) { .solutions { grid-template-columns: 1fr; } .sol { min-height: 0; } }

/* ---------- Flujo de energía (cómo funciona) ---------- */
.flow { border-radius: var(--r-xl); padding: clamp(24px, 4vw, 56px); overflow: hidden; }
.flow-track { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 10px 0 36px; }
.flow-wire { position: absolute; left: 10%; right: 10%; top: 42px; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .08); --p: 0; }
.flow-wire .fill { position: absolute; inset: 0; border-radius: inherit; transform-origin: left center; transform: scaleX(var(--p));
  background: linear-gradient(90deg, var(--sun), var(--sun-hot) 25%, var(--volt) 45%, var(--volt-deep)); box-shadow: 0 0 14px rgba(91, 231, 255, .7), 0 0 4px rgba(255, 210, 120, .8); }
.flow-wire .spark { position: absolute; top: 50%; left: 0; width: 46px; height: 7px; margin-top: -3.5px; border-radius: 4px; opacity: 0;
  background: radial-gradient(closest-side, #fff, rgba(91, 231, 255, .8) 50%, transparent); filter: blur(.3px); }
.flow-wire.live .spark { animation: run-x 2.4s linear infinite; }
.flow-wire.live .spark:nth-child(3) { animation-delay: .8s; } .flow-wire.live .spark:nth-child(4) { animation-delay: 1.6s; }
@keyframes run-x { 0% { left: -4%; opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { left: 100%; opacity: 0; } }
@keyframes run-y { 0% { top: -4%; opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { top: 100%; opacity: 0; } }
.flow-node { position: relative; display: grid; justify-items: center; gap: 12px; text-align: center; background: none; border: 0; padding: 0; cursor: pointer; color: var(--muted); font-weight: 600; font-size: .95rem; }
.flow-node .orb {
  width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: radial-gradient(circle at 35% 25%, rgba(255, 255, 255, .18), rgba(255, 255, 255, .03) 60%), rgba(10, 20, 40, .7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), inset 0 0 0 1px rgba(255, 255, 255, .12), 0 10px 30px -10px rgba(0, 0, 0, .8);
  transition: box-shadow .6s var(--ease), color .6s var(--ease);
}
.flow-node .orb svg { width: 34px; height: 34px; }
.flow-node.on { color: var(--ink); }
.flow-node.on .orb { color: var(--sun-hot); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 0 0 1px rgba(255, 210, 110, .55), 0 0 0 6px rgba(255, 178, 30, .07), 0 0 40px -4px rgba(255, 178, 30, .55); }
.flow-node.on:nth-child(n+3) .orb { color: var(--volt); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 0 0 1px rgba(91, 231, 255, .55), 0 0 0 6px rgba(91, 231, 255, .06), 0 0 40px -4px rgba(91, 231, 255, .55); }
.flow-node .step { font-size: .78rem; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.flow-detail { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 4vw, 56px); align-items: start; min-height: 150px; }
.flow-detail h3 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2.1rem); letter-spacing: -.03em; }
.flow-detail p { color: var(--ink-2); max-width: 52ch; }
.flow-detail [data-panel] { display: none; }
.flow-detail [data-panel].active { display: contents; }
@media (max-width: 760px) {
  .flow-track { grid-template-columns: 1fr; gap: 14px; margin-bottom: 24px; }
  .flow-wire { left: 42.5px; right: auto; top: 44px; bottom: 44px; width: 3px; height: auto; }
  .flow-wire .fill { transform-origin: center top; transform: scaleY(var(--p)); background: linear-gradient(180deg, var(--sun), var(--volt) 45%, var(--volt-deep)); }
  .flow-wire .spark { left: 50%; top: 0; width: 7px; height: 46px; margin: 0 0 0 -3.5px; }
  .flow-wire.live .spark { animation-name: run-y; }
  .flow-node { grid-template-columns: 88px 1fr; justify-items: start; align-items: center; text-align: left; gap: 16px; }
  .flow-node .step { display: none; }
  .flow-detail { grid-template-columns: 1fr; }
}

/* ---------- Galería de trabajos ---------- */
.works { display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-rows: 130px; gap: 14px; }
.work { position: relative; border-radius: var(--r-lg); overflow: hidden; margin: 0; background: var(--night-2); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), var(--shadow); }
.work img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease), filter .8s var(--ease); filter: saturate(.92); }
.work:hover img { transform: scale(1.04); filter: saturate(1.08); }
.work figcaption {
  position: absolute; left: 12px; bottom: 12px; right: 12px; width: fit-content; max-width: calc(100% - 24px);
  padding: 8px 14px; border-radius: 999px; font-size: .86rem; font-weight: 600;
  background: rgba(8, 14, 30, .5); -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.w1 { grid-column: span 7; grid-row: span 4; } .w2 { grid-column: span 5; grid-row: span 2; } .w3 { grid-column: span 5; grid-row: span 2; }
.w4 { grid-column: span 4; grid-row: span 3; } .w5 { grid-column: span 4; grid-row: span 3; } .w6 { grid-column: span 4; grid-row: span 3; }
@media (max-width: 760px) { .works { grid-template-columns: 1fr 1fr; grid-auto-rows: 120px; } .work { grid-column: span 1 !important; grid-row: span 2 !important; } .w1 { grid-column: 1 / -1 !important; grid-row: span 3 !important; } }

/* ---------- Marcas ---------- */
.brands { display: grid; grid-template-columns: repeat(4, 1fr); border-radius: var(--r-xl); overflow: hidden; }
.brands > div { padding: clamp(22px, 2.6vw, 32px); display: grid; align-content: start; gap: 14px; }
.brands > div + div { border-left: 1px solid rgba(255, 255, 255, .08); }
.brands h3 { font-size: 1rem; color: var(--muted); font-weight: 600; letter-spacing: 0; display: flex; align-items: center; gap: 10px; }
.brands h3 svg { width: 20px; height: 20px; color: var(--sun); }
.brands ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.brands li { font-size: 1.2rem; font-weight: 650; letter-spacing: -.02em; }
@media (max-width: 900px) { .brands { grid-template-columns: 1fr 1fr; } .brands > div:nth-child(3) { border-left: 0; } .brands > div:nth-child(n+3) { border-top: 1px solid rgba(255, 255, 255, .08); } }
@media (max-width: 520px) { .brands { grid-template-columns: 1fr; } .brands > div + div { border-left: 0; border-top: 1px solid rgba(255, 255, 255, .08); } }

/* ---------- Split: texto + imagen ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 80px); align-items: center; }
.split.rev > :first-child { order: 2; }
.split-copy { display: grid; gap: 22px; }
.split-copy p { color: var(--ink-2); max-width: 54ch; }
.frame { border-radius: var(--r-xl); overflow: hidden; position: relative; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), var(--shadow); aspect-ratio: 4 / 4.6; }
.frame img { width: 100%; height: 100%; object-fit: cover; }
.frame.wide { aspect-ratio: 4 / 3; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } .split.rev > :first-child { order: 0; } .frame { aspect-ratio: 4 / 3.4; } }

.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.checks li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; color: var(--ink-2); }
.checks li strong { color: var(--ink); font-weight: 650; }
.checks svg { width: 22px; height: 22px; color: var(--volt); margin-top: 2px; }

/* ---------- Tiles (servicios, valores) ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.tile { border-radius: var(--r-lg); padding: 26px; display: grid; align-content: start; gap: 12px; }
.tile .ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: var(--volt); background: rgba(91, 231, 255, .08); box-shadow: inset 0 0 0 1px rgba(91, 231, 255, .25); }
.tile .ico svg { width: 24px; height: 24px; }
.tile.sunny .ico { color: var(--sun); background: rgba(255, 178, 30, .1); box-shadow: inset 0 0 0 1px rgba(255, 178, 30, .28); }
.tile p { color: var(--ink-2); font-size: 1rem; }
.steps { counter-reset: s; }
.steps .tile { counter-increment: s; }
.steps .tile .n { font-size: .85rem; font-weight: 700; color: var(--sun); font-variant-numeric: tabular-nums; }
.steps .tile .n::before { content: "Paso " counter(s); }

/* ---------- Preguntas ---------- */
.faq { display: grid; gap: 10px; max-width: 880px; }
.faq details { border-radius: var(--r-lg); padding: 0; overflow: hidden; }
.faq summary {
  list-style: none; cursor: pointer; padding: 22px 26px; display: flex; justify-content: space-between; align-items: center; gap: 20px;
  font-size: 1.12rem; font-weight: 650; letter-spacing: -.015em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .pm { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); transition: rotate .4s var(--ease), background .4s var(--ease); }
.faq summary .pm svg { width: 16px; height: 16px; }
.faq details[open] summary .pm { rotate: 45deg; background: rgba(255, 178, 30, .2); color: var(--sun-hot); }
.faq .ans { padding: 0 26px 24px; color: var(--ink-2); max-width: 70ch; }
.faq details::details-content { block-size: 0; overflow: hidden; transition: block-size .45s var(--ease), content-visibility .45s allow-discrete; }
.faq details[open]::details-content { block-size: auto; }
@supports (interpolate-size: allow-keywords) { :root { interpolate-size: allow-keywords; } }

/* ---------- CTA con borde eléctrico ---------- */
.cta {
  position: relative; border-radius: var(--r-xl); padding: clamp(32px, 6vw, 80px); overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: end;
}
.cta::before { /* corriente que recorre el borde */
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; z-index: 1; pointer-events: none;
  background: conic-gradient(from var(--angle), transparent 0 70%, rgba(91, 231, 255, .0) 72%, var(--volt) 82%, #fff 84%, var(--sun) 86%, transparent 92%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: spin 6s linear infinite;
}
.cta-glow { position: absolute; inset: 0; z-index: -1; background: radial-gradient(500px 300px at 85% 0%, rgba(255, 178, 30, .25), transparent 70%), radial-gradient(500px 300px at 0% 100%, rgba(91, 231, 255, .14), transparent 70%); }
.cta h2 { max-width: 14ch; }
.cta p { color: var(--ink-2); margin-top: 16px; max-width: 46ch; }
.cta .btn-row { justify-content: flex-end; }
@keyframes spin { to { --angle: 360deg; } }
@media (max-width: 820px) { .cta { grid-template-columns: 1fr; } .cta .btn-row { justify-content: flex-start; } }

/* ---------- Cabecera de páginas internas ---------- */
.page-hero { padding: clamp(130px, 16vw, 190px) 0 clamp(40px, 6vw, 80px); }
.page-hero .wrap { display: grid; gap: 22px; }
.page-hero h1 { font-size: clamp(2.4rem, 1.3rem + 4.4vw, 4.8rem); max-width: 16ch; }
.page-hero .lead { max-width: 52ch; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: .88rem; color: var(--muted); list-style: none; margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; margin-right: 6px; opacity: .5; }
.crumbs a:hover { color: var(--ink); }

/* ---------- Blog ---------- */
.posts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.post-card { border-radius: var(--r-xl); overflow: hidden; display: grid; grid-template-rows: auto 1fr; }
.post-card .media { aspect-ratio: 16 / 9; overflow: hidden; }
.post-card .media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.post-card:hover .media img { transform: scale(1.04); }
.post-card .body { padding: 24px 26px 28px; display: grid; gap: 12px; align-content: start; }
.post-card h2, .post-card h3 { font-size: 1.45rem; letter-spacing: -.025em; line-height: 1.2; }
.post-card p { color: var(--ink-2); font-size: 1rem; }
.post-meta { font-size: .85rem; color: var(--muted); display: flex; gap: 14px; }
@media (max-width: 760px) { .posts { grid-template-columns: 1fr; } }

.article-hero img { border-radius: var(--r-xl); width: 100%; aspect-ratio: 16 / 8; object-fit: cover; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), var(--shadow); }
.prose { max-width: 70ch; margin-inline: auto; font-size: 1.12rem; line-height: 1.75; color: #D4DEEE; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem); margin-top: 2.2em; color: var(--ink); line-height: 1.15; }
.prose h3 { margin-top: 1.8em; color: var(--ink); }
.prose a { color: var(--sun-hot); text-decoration: underline; text-decoration-color: rgba(255, 211, 107, .4); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: currentColor; }
.prose strong { color: var(--ink); font-weight: 650; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .45em; }
.prose li::marker { color: var(--sun); }
.prose .note { border-radius: var(--r-lg); padding: 22px 24px; font-size: 1.02rem; }
.prose .formula { font-size: 1.15rem; font-weight: 650; color: var(--ink); text-align: center; padding: 22px; border-radius: var(--r-lg); }
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.prose table { width: 100%; border-collapse: collapse; font-size: 1rem; min-width: 520px; }
.prose th, .prose td { text-align: left; padding: 14px 16px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.prose th { color: var(--ink); font-weight: 650; background: rgba(255, 255, 255, .05); }
.prose tr:last-child td { border-bottom: 0; }
.prose td { font-variant-numeric: tabular-nums; }

/* ---------- Formulario → WhatsApp ---------- */
.quote { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; align-items: start; }
.form { border-radius: var(--r-xl); padding: clamp(22px, 3.4vw, 40px); display: grid; gap: 22px; }
.field { display: grid; gap: 8px; }
.field > label, .field > legend { font-weight: 600; font-size: .95rem; color: var(--ink-2); padding: 0; }
.field .opt { color: var(--muted); font-weight: 500; }
fieldset.field { border: 0; margin: 0; padding: 0; min-width: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.input {
  width: 100%; min-height: 54px; padding: 14px 18px; border-radius: var(--r-md); border: 0;
  background: rgba(4, 9, 20, .45);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .4), inset 0 0 0 1px rgba(255, 255, 255, .12);
  transition: box-shadow .3s var(--ease), background .3s var(--ease);
}
.input::placeholder { color: #6E7D97; }
.input:focus { outline: none; background: rgba(4, 9, 20, .6); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .4), inset 0 0 0 1px rgba(91, 231, 255, .7), 0 0 0 4px rgba(91, 231, 255, .14); }
textarea.input { min-height: 120px; resize: vertical; line-height: 1.5; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B9C6DC' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; background-size: 18px; padding-right: 44px; }
select.input option { background: #0A1428; }
.input[aria-invalid="true"] { box-shadow: inset 0 0 0 1px rgba(255, 120, 100, .8), 0 0 0 4px rgba(255, 120, 100, .12); }
.err { color: #FF9C8A; font-size: .88rem; min-height: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 16px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: .95rem; color: var(--ink-2);
  background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .13);
  transition: all .3s var(--ease);
}
.chip span:hover { background: rgba(255, 255, 255, .09); color: var(--ink); }
.chip input:checked + span { color: #241500; background: linear-gradient(180deg, #FFD36B, #FFB21E); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 6px 20px -6px rgba(255, 170, 30, .7); }
.chip input:focus-visible + span { outline: 2px solid var(--volt); outline-offset: 2px; }
.preview { position: sticky; top: 100px; border-radius: var(--r-xl); padding: 22px; display: grid; gap: 16px; }
.preview-head { display: flex; align-items: center; gap: 12px; }
.preview-head img { width: 44px; height: 44px; border-radius: 50%; background: #fff; padding: 4px; }
.preview-head b { display: block; font-size: 1rem; }
.preview-head small { color: #4BE38A; font-weight: 600; }
.bubble {
  position: relative; padding: 14px 16px 22px; border-radius: 18px 18px 6px 18px; white-space: pre-wrap; font-size: .97rem; line-height: 1.5;
  background: linear-gradient(180deg, rgba(37, 170, 100, .32), rgba(20, 120, 70, .28)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), inset 0 0 0 1px rgba(75, 227, 138, .3);
  min-height: 140px; word-break: break-word;
}
.bubble::after { content: "✓✓"; position: absolute; right: 12px; bottom: 5px; font-size: .7rem; color: var(--volt); letter-spacing: -2px; }
.bubble .ph { color: rgba(234, 242, 255, .45); }
.preview .btn { width: 100%; }
.preview .fine { font-size: .84rem; color: var(--muted); text-align: center; }
.contact-alt { display: grid; gap: 10px; margin-top: 18px; }
.contact-alt a { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: var(--r-md); font-weight: 600; }
.contact-alt svg { width: 22px; height: 22px; color: var(--sun); }
@media (max-width: 920px) { .quote { grid-template-columns: 1fr; } .preview { position: relative; top: 0; } }
@media (max-width: 560px) { .row2 { grid-template-columns: 1fr; } }

/* ---------- Pie ---------- */
.footer { padding: 80px 0 40px; margin-top: 40px; border-top: 1px solid rgba(255, 255, 255, .07); background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .25)); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.footer img.logo { height: 56px; width: auto; }
.footer p { color: var(--muted); font-size: .95rem; margin-top: 16px; max-width: 34ch; }
.footer h2 { font-size: .95rem; color: var(--ink); letter-spacing: 0; margin-bottom: 14px; font-weight: 650; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer a { color: var(--muted); font-size: .95rem; transition: color .3s var(--ease); }
.footer a:hover { color: var(--ink); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 56px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .07); color: var(--muted); font-size: .86rem; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

/* ---------- Transiciones entre páginas ---------- */
::view-transition-old(root) { animation: vt-out .35s var(--ease) both; }
::view-transition-new(root) { animation: vt-in .55s var(--ease) both; }
::view-transition-group(nav-lens), ::view-transition-group(tab-lens) { animation-duration: .55s; animation-timing-function: cubic-bezier(.3, 1.3, .4, 1); }
@keyframes vt-out { to { opacity: 0; transform: scale(.985); filter: blur(6px); } }
@keyframes vt-in { from { opacity: 0; transform: scale(1.015); filter: blur(8px) brightness(1.3); } }

/* Entrada orquestada del hero (una sola, al cargar) */
.hero-copy > * { animation: rise .9s var(--ease) both; }
.hero-copy > :nth-child(2) { animation-delay: .08s; } .hero-copy > :nth-child(3) { animation-delay: .16s; } .hero-copy > :nth-child(4) { animation-delay: .24s; }
.array { animation: power-on 1.6s .2s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } }
@keyframes power-on { from { opacity: 0; filter: brightness(2.2) blur(10px); } 30% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  @view-transition { navigation: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .glass, .btn-glass, .work figcaption { -webkit-backdrop-filter: none; backdrop-filter: none; background: #101B33; }
}

/* ---------- Ajustes ---------- */
[hidden] { display: none !important; }
.hero h1 { font-size: clamp(2.5rem, 1.2rem + 4.6vw, 5.1rem); max-width: 13ch; }
.hint-touch { display: none; }
@media (hover: none) { .hint-fine { display: none; } .hint-touch { display: inline; } }
.array canvas {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent), linear-gradient(180deg, transparent, #000 16%, #000 88%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent), linear-gradient(180deg, transparent, #000 16%, #000 88%, transparent);
  mask-composite: intersect;
}
@media (max-width: 900px) {
  .tabbar, .topbar { background: linear-gradient(150deg, rgba(22, 34, 62, .78), rgba(8, 14, 30, .82)); -webkit-backdrop-filter: blur(28px) saturate(180%); backdrop-filter: blur(28px) saturate(180%); }
}
.quote > aside { position: sticky; top: 100px; }
.quote .preview { position: relative; top: 0; }
@media (max-width: 920px) { .quote > aside { position: relative; top: 0; } }
img[src*="paneles-solares-techo"] { object-position: center 78%; }

/* ---------- Sol en pantallas táctiles ---------- */
.array { touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.tilt-btn {
  position: absolute; left: 3%; top: 0; z-index: 4; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 999px; border: 0; cursor: pointer; font-weight: 600; font-size: .86rem; color: var(--ink);
}
.tilt-btn svg { width: 18px; height: 18px; color: var(--sun); }
@media (max-width: 900px) {
  .hero { padding-top: 92px; }
  .hero-grid { gap: 18px; }
  .hero-copy { display: contents; }
  .hero-copy h1 { order: 1; }
  .array { order: 2; margin-top: 0; }
  .hero-copy .lead { order: 3; }
  .hero-copy .btn-row { order: 4; }
  .hero-proof { order: 5; }
  .meter { width: 160px; padding: 12px; gap: 7px; }
  .meter-w { font-size: 1.5rem; }
}

/* ---------- Galería de trabajos ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.g-item {
  position: relative; aspect-ratio: 1; border: 0; padding: 0; cursor: zoom-in; border-radius: 20px; overflow: hidden; background: var(--night-2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), 0 20px 40px -24px rgba(0, 0, 0, .8);
}
.g-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease), filter .6s var(--ease); }
.g-item::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25); background: linear-gradient(160deg, rgba(255, 220, 150, .14), transparent 40%); opacity: 0; transition: opacity .5s var(--ease); }
.g-item:hover img { transform: scale(1.05); }
.g-item:hover::after { opacity: 1; }
.gallery:not(.open) .g-item.extra { display: none; }
.gallery.open .g-item.extra { animation: rise .6s var(--ease) both; }
.gallery-more { display: flex; justify-content: center; margin-top: 22px; }
@media (max-width: 760px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } .g-item { border-radius: 16px; } }

.lightbox {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: var(--ink);
  overflow: hidden;
}
.lightbox[open] { display: grid; place-items: center; animation: lb-in .35s var(--ease); }
.lightbox::backdrop { background: rgba(3, 6, 14, .82); -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%); }
.lightbox figure { margin: 0; display: grid; gap: 14px; justify-items: center; padding: 70px 16px 40px; max-width: 100%; pointer-events: none; }
.lightbox img { max-width: min(1400px, 100%); max-height: calc(100dvh - 170px); width: auto; height: auto; border-radius: 18px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .9); opacity: 0; transform: scale(.98); transition: opacity .35s var(--ease), transform .35s var(--ease); }
.lightbox img.in { opacity: 1; transform: none; }
.lightbox figcaption { color: var(--ink-2); font-weight: 550; text-align: center; }
.lb-count { position: fixed; top: 24px; left: 24px; font-size: .9rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.lb-btn {
  position: fixed; width: 50px; height: 50px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; color: var(--ink);
  background: rgba(255, 255, 255, .1); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), inset 0 0 0 1px rgba(255, 255, 255, .15);
}
.lb-btn:hover { background: rgba(255, 255, 255, .18); }
.lb-btn svg { width: 22px; height: 22px; }
.lb-close { top: 16px; right: 16px; } .lb-close svg { rotate: 45deg; }
.lb-prev { left: 16px; top: 50%; translate: 0 -50%; } .lb-prev svg { rotate: 180deg; }
.lb-next { right: 16px; top: 50%; translate: 0 -50%; }
@media (max-width: 760px) { .lb-prev, .lb-next { top: auto; bottom: 20px; translate: none; } .lb-prev { left: calc(50% - 62px); } .lb-next { right: calc(50% - 62px); } .lightbox img { max-height: calc(100dvh - 210px); } }
@keyframes lb-in { from { opacity: 0; } }

img.swapping { opacity: 0; }
img.swapped { animation: fade-in .6s var(--ease) both; }
@keyframes fade-in { from { opacity: 0; } }
