/* MacroLogic — sitio web */
@font-face { font-family: Inter; src: url(../fonts/inter-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Inter; src: url(../fonts/inter-500.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: Inter; src: url(../fonts/inter-600.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: Montserrat; src: url(../fonts/montserrat-500.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: Montserrat; src: url(../fonts/montserrat-700.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: Montserrat; src: url(../fonts/montserrat-800.woff2) format('woff2'); font-weight: 800; font-display: swap; }

:root {
  --ink: #050c1d;        /* fondo del cerebro */
  --night: #0a1834;
  --navy: #28326e;       /* navy del membrete */
  --blue: #0496ff;       /* azul eléctrico de las barras */
  --cyan: #20aada;       /* cian de la marca */
  --ice: #c0e4ff;
  --paper: #f4f7fb;
  --text: #0f1a3d;
  --muted: #56618c;
  --line: #d9e1ee;
  --on-dark: #e8f0ff;
  --on-dark-muted: #9fb0d4;
  --radius-s: 6px; --radius-m: 14px;
  --display: Montserrat, 'Segoe UI', system-ui, sans-serif;
  --body: Inter, 'Segoe UI', system-ui, sans-serif;
  --wrap: min(1200px, calc(100vw - 48px));
  --ease: cubic-bezier(.22, .8, .2, 1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--body); font-size: 17px; line-height: 1.6; color: var(--text); background: var(--paper); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }
.wrap { width: var(--wrap); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; background: #fff; color: var(--text); padding: 10px 14px; border-radius: var(--radius-s); }
.skip:focus { top: 12px; }

/* ---------- tipografía ---------- */
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -0.025em; }
h1 { font-weight: 800; font-size: clamp(44px, 7.2vw, 104px); line-height: 0.98; }
h2 { font-weight: 800; font-size: clamp(34px, 4.6vw, 62px); line-height: 1.04; }
h3 { font-weight: 700; font-size: 21px; line-height: 1.25; letter-spacing: -0.01em; }
.lede { font-size: clamp(18px, 1.5vw, 21px); line-height: 1.55; max-width: 34em; }
p { margin: 0 0 1em; }

/* ---------- botones ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 15px 24px; border-radius: 999px; font-weight: 600; font-size: 16px; text-decoration: none; border: 1.5px solid transparent; cursor: pointer; transition: transform .25s var(--ease), background .25s, color .25s, border-color .25s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--cyan); color: #04122a; }
.btn-primary:hover { background: #4cc4ec; }
.btn-ghost { border-color: rgba(192, 228, 255, .35); color: var(--on-dark); }
.btn-ghost:hover { border-color: var(--ice); }
.btn-dark { background: var(--navy); color: #fff; }
.btn-dark:hover { background: #343f86; }

/* ---------- navegación ---------- */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 50; transition: background .35s, backdrop-filter .35s, border-color .35s; border-bottom: 1px solid transparent; }
.nav.solid { background: rgba(5, 12, 29, .72); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); border-color: rgba(192, 228, 255, .1); }
.nav.light { background: rgba(244, 247, 251, .82); border-color: var(--line); }
.nav-in { width: var(--wrap); margin-inline: auto; display: flex; align-items: center; gap: 28px; height: 74px; }
.nav-logo img { height: 40px; width: auto; }
.nav-logo .on-light { display: none; }
.nav.light .nav-logo .on-dark { display: none; }
.nav.light .nav-logo .on-light { display: block; }
.nav-links { display: flex; gap: 26px; margin-left: auto; }
.nav-links a { text-decoration: none; color: var(--on-dark-muted); font-size: 15px; font-weight: 500; transition: color .2s; }
.nav-links a:hover { color: #fff; }
.nav.light .nav-links a { color: var(--muted); }
.nav.light .nav-links a:hover { color: var(--text); }
.lang { display: flex; border: 1px solid rgba(192, 228, 255, .25); border-radius: 999px; padding: 3px; }
.nav.light .lang { border-color: var(--line); }
.lang button { background: none; border: 0; color: var(--on-dark-muted); padding: 4px 10px; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 600; }
.nav.light .lang button { color: var(--muted); }
.lang button[aria-pressed="true"] { background: rgba(192, 228, 255, .16); color: #fff; }
.nav.light .lang button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.nav .btn { padding: 10px 18px; font-size: 14px; }
.menu-btn { display: none; margin-left: auto; background: none; border: 1px solid rgba(192, 228, 255, .3); color: #fff; border-radius: 10px; width: 44px; height: 40px; cursor: pointer; }
.nav.light .menu-btn { color: var(--text); border-color: var(--line); }

/* ---------- héroe 3D ---------- */
.hero { position: relative; height: 330vh; background: var(--ink); color: var(--on-dark); }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage .fallback { position: absolute; right: 6vw; top: 50%; transform: translateY(-50%); width: min(46vw, 560px); opacity: .9; display: none; }
.no-webgl .stage .fallback { display: block; }
.stage::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 90% at 70% 45%, transparent 40%, rgba(5, 12, 29, .55) 75%, var(--ink) 100%); }
.hero-copy { position: absolute; z-index: 2; left: max(24px, calc((100vw - 1200px) / 2)); bottom: clamp(56px, 12vh, 130px); width: min(640px, calc(100vw - 48px)); transition: opacity .5s, transform .5s var(--ease); }
.hero-copy h1 { color: #fff; }
.hero-copy .lede { color: var(--on-dark-muted); margin: 26px 0 34px; }
.hero-copy .ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.hero.past-intro .hero-copy { opacity: 0; transform: translateY(-24px); pointer-events: none; }
.story { position: absolute; z-index: 2; left: max(24px, calc((100vw - 1200px) / 2)); bottom: clamp(56px, 12vh, 130px); width: min(520px, calc(100vw - 48px)); pointer-events: none; }
.story p { position: absolute; bottom: 0; left: 0; margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(26px, 3vw, 40px); line-height: 1.15; letter-spacing: -0.02em; color: #fff; opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.story p.on { opacity: 1; transform: none; }
.story-bar { position: absolute; z-index: 2; right: max(24px, calc((100vw - 1200px) / 2)); bottom: clamp(56px, 12vh, 130px); display: flex; gap: 6px; opacity: 0; transition: opacity .4s; }
.hero.past-intro .story-bar { opacity: 1; }
.story-bar i { width: 34px; height: 3px; border-radius: 2px; background: rgba(192, 228, 255, .2); overflow: hidden; position: relative; }
.story-bar i b { position: absolute; inset: 0; background: var(--cyan); transform-origin: left; transform: scaleX(0); }
.stages { position: absolute; z-index: 2; left: 0; right: 0; top: 18vh; height: 20px; opacity: 0; transition: opacity .5s; pointer-events: none; }
.stages span { position: absolute; transform: translateX(-50%); font-size: 13px; font-weight: 600; color: var(--ice); white-space: nowrap; letter-spacing: .01em; }
.hero.ordered .stages { opacity: 1; }
.scroll-cue { position: absolute; z-index: 2; right: max(24px, calc((100vw - 1200px) / 2)); bottom: clamp(56px, 12vh, 130px); color: var(--on-dark-muted); font-size: 14px; display: flex; align-items: center; gap: 10px; transition: opacity .4s; }
.scroll-cue::before { content: ''; width: 1px; height: 46px; background: linear-gradient(var(--cyan), transparent); animation: cue 2.4s var(--ease) infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }
.hero.past-intro .scroll-cue { opacity: 0; }

/* ---------- secciones claras ---------- */
section { position: relative; }
.sec { padding: clamp(90px, 12vw, 160px) 0; }
.sec-head { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: end; margin-bottom: clamp(44px, 6vw, 72px); }
.sec-head h2 { max-width: 12em; }
.sec-head p { color: var(--muted); max-width: 32em; margin: 0; }

/* resultados */
.res-sec { background: var(--paper); }
.res { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.res article { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); padding: 28px 30px; box-shadow: 0 24px 60px -44px rgba(20, 40, 100, .35); }
.res .lbl { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px; }
.res .before .lbl { color: var(--muted); }
.res .before p { color: var(--muted); font-size: 17px; margin: 0 0 22px; }
.res .after { border-top: 1px solid var(--line); padding-top: 18px; }
.res .after .lbl { color: var(--cyan); }
.res .after p { font-family: var(--display); font-weight: 700; font-size: 19px; color: var(--navy); margin: 0; line-height: 1.35; }
.res-foot { margin-top: 26px; color: var(--muted); font-size: 15px; }

/* calculadora */
.calc-sec { background: #fff; border-block: 1px solid var(--line); }
.calc { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 90px); align-items: center; }
.calc-in { display: grid; gap: 30px; }
.field label { display: flex; justify-content: space-between; font-weight: 500; margin-bottom: 10px; }
.field output { font-family: var(--display); font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
input[type=range] { width: 100%; appearance: none; -webkit-appearance: none; height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--cyan) var(--p, 50%), var(--line) var(--p, 50%)); outline-offset: 6px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 2px solid var(--navy); cursor: pointer; box-shadow: 0 2px 8px rgba(20, 40, 100, .2); }
input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 2px solid var(--navy); cursor: pointer; }
.calc-out { background: var(--ink); color: var(--on-dark); border-radius: var(--radius-m); padding: clamp(28px, 4vw, 48px); position: relative; overflow: hidden; }
.calc-out::before { content: ''; position: absolute; right: -80px; top: -80px; width: 260px; height: 260px; background: radial-gradient(circle, rgba(32, 170, 218, .35), transparent 70%); }
.calc-out .big { font-family: var(--display); font-weight: 800; font-size: clamp(54px, 7vw, 92px); line-height: 1; letter-spacing: -0.035em; color: #fff; font-variant-numeric: tabular-nums; }
.calc-out .lbl { color: var(--on-dark-muted); margin: 10px 0 28px; }
.calc-out .row { display: flex; gap: 36px; flex-wrap: wrap; border-top: 1px solid rgba(192, 228, 255, .14); padding-top: 22px; }
.calc-out .row div { font-family: var(--display); font-weight: 700; font-size: 28px; color: var(--ice); font-variant-numeric: tabular-nums; }
.calc-out .row small { display: block; font-family: var(--body); font-weight: 400; font-size: 14px; color: var(--on-dark-muted); }
.calc-note { font-size: 13.5px; color: var(--muted); margin-top: 18px; }

/* industrias y productos */
.ind { display: grid; grid-template-columns: 300px 1fr; gap: clamp(28px, 5vw, 70px); align-items: start; }
.tabs { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 100px; }
.tabs button { text-align: left; background: none; border: 0; border-left: 2px solid var(--line); padding: 12px 18px; cursor: pointer; color: var(--muted); font-size: 17px; font-weight: 500; transition: color .2s, border-color .2s; display: flex; justify-content: space-between; }
.tabs button span { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--text); border-color: var(--cyan); font-weight: 600; }
.panel-intro { color: var(--muted); max-width: 40em; margin-bottom: 26px; }
.prod { display: grid; grid-template-columns: 220px 1fr; gap: 28px; padding: 24px 0; border-top: 1px solid var(--line); }
.prod:last-child { border-bottom: 1px solid var(--line); }
.prod h3 { font-size: 22px; }
.prod .tag { font-size: 13px; color: var(--muted); margin-top: 6px; }
.prod .slogan { font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--navy); margin-bottom: 6px; letter-spacing: -0.01em; }
.prod p { color: var(--muted); margin: 0; font-size: 16px; }
.badge-live { display: inline-block; margin-top: 10px; font-size: 12.5px; font-weight: 600; color: #0b7fae; background: #e7f6fc; border-radius: 999px; padding: 3px 10px; }

/* método */
.method-sec { background: var(--ink); color: var(--on-dark); overflow: hidden; }
.method-sec .sec-head p { color: var(--on-dark-muted); }
.method { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; counter-reset: s; position: relative; }
.method li { padding: 0 28px 0 0; position: relative; }
.method li::before { counter-increment: s; content: counter(s); display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 1.5px solid var(--cyan); color: #fff; font-family: var(--display); font-weight: 700; margin-bottom: 28px; background: var(--ink); position: relative; z-index: 1; }
.method::before { content: ''; position: absolute; left: 23px; right: 0; top: 23px; height: 1px; background: linear-gradient(90deg, var(--cyan), rgba(32, 170, 218, .1)); }
.method h3 { color: #fff; margin-bottom: 10px; }
.method p { color: var(--on-dark-muted); font-size: 16px; }
.method .meta { color: var(--ice); font-size: 14px; font-weight: 500; }

/* principios */
.trust { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 64px; }
.trust div { padding: 26px 0; border-top: 1px solid var(--line); }
.trust h3 { margin-bottom: 8px; }
.trust p { color: var(--muted); margin: 0; }

/* fundador */
.founder-sec { background: #fff; border-top: 1px solid var(--line); }
.founder { display: grid; grid-template-columns: 300px 1fr; gap: clamp(36px, 6vw, 90px); align-items: center; }
.founder figure { margin: 0; position: relative; }
.founder img { border-radius: var(--radius-m); aspect-ratio: 1; object-fit: cover; object-position: center 20%; width: 100%; max-width: 300px; }
.founder figcaption { margin-top: 14px; font-size: 15px; color: var(--muted); }
.founder figcaption b { color: var(--text); display: block; font-size: 17px; }
.founder h2 { margin-bottom: 26px; }
.founder p { color: var(--muted); max-width: 36em; }

/* llamada final */
.cta-sec { background: var(--ink); color: var(--on-dark); text-align: left; overflow: hidden; }
.cta { display: grid; grid-template-columns: 1.3fr .7fr; gap: 48px; align-items: center; }
.cta h2 { color: #fff; max-width: 11em; }
.cta p { color: var(--on-dark-muted); max-width: 34em; margin: 24px 0 34px; }
.cta img { width: 100%; max-width: 320px; height: auto; aspect-ratio: 729 / 667; object-fit: contain; justify-self: end; filter: drop-shadow(0 0 60px rgba(32, 170, 218, .35)); }
.contact-lines { margin-top: 26px; color: var(--on-dark-muted); font-size: 15px; }
.contact-lines a { color: var(--ice); }

footer { background: #030817; color: var(--on-dark-muted); font-size: 14px; padding: 46px 0; }
.foot { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: center; }
.foot img { height: 34px; width: auto; }
.foot nav { display: flex; gap: 22px; }
.foot a { color: var(--on-dark-muted); text-decoration: none; }
.foot a:hover { color: #fff; }

/* ---------- responsivo ---------- */
@media (max-width: 1020px) {
  .nav-links, .nav .btn-primary { display: none; }
  .menu-btn { display: block; }
  .nav.open .nav-links { display: flex; position: absolute; top: 74px; left: 0; right: 0; flex-direction: column; gap: 0; background: rgba(5, 12, 29, .96); padding: 10px 24px 20px; }
  .nav.open .nav-links a { padding: 12px 0; color: #fff; font-size: 17px; }
  .nav.light.open .nav-links { background: rgba(244, 247, 251, .98); }
  .nav.light.open .nav-links a { color: var(--text); }
  .sec-head, .calc, .founder, .cta, .res { grid-template-columns: 1fr; }
  .ind { grid-template-columns: 1fr; }
  .tabs { position: static; flex-direction: row; overflow-x: auto; gap: 6px; scrollbar-width: none; }
  .tabs button { border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; padding: 9px 16px; font-size: 15px; gap: 8px; }
  .tabs button[aria-selected="true"] { border-color: var(--navy); background: var(--navy); color: #fff; }
  .tabs button[aria-selected="true"] span { color: var(--ice); }
  .method { grid-template-columns: 1fr 1fr; gap: 44px 0; }
  .method::before { display: none; }
  .cta img { display: none; }
  .founder img { max-width: 240px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { height: 300vh; }
  .hero-copy, .story { bottom: 40px; }
  .story-bar { bottom: 18px; right: 24px; }
  .scroll-cue { display: none; }
  .prod { grid-template-columns: 1fr; gap: 6px; }
  .trust { grid-template-columns: 1fr; }
  .method { grid-template-columns: 1fr; }
  .stages { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}
