/* =========================================================
   HEXIFY CINEMATIC v22
   HTML/CSS editorial sobre un mundo Three.js fijo.
   ========================================================= */

:root {
  --bg: #040611;
  --bg-soft: #080b18;
  --panel: rgba(8, 12, 28, .72);
  --panel-strong: rgba(7, 10, 24, .9);
  --text: #f6f8ff;
  --muted: #9aa3ba;
  --muted-2: #6e7790;
  --line: rgba(255, 255, 255, .1);
  --line-strong: rgba(125, 94, 255, .32);
  --cyan: #20ddff;
  --cyan-soft: #55baff;
  --violet: #885dff;
  --magenta: #d633ff;
  --green: #45efc7;
  --header-h: 82px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --page-progress: 0;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-synthesis: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

::selection {
  color: #041016;
  background: var(--cyan);
}

/* ---------- Background ---------- */

.webgl-stage,
.webgl-backdrop,
.noise,
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.webgl-stage {
  z-index: 0;
}

.webgl-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.webgl-backdrop {
  z-index: 1;
  background:
    radial-gradient(circle at 12% 16%, rgba(18, 210, 237, .1), transparent 29%),
    radial-gradient(circle at 84% 72%, rgba(177, 41, 255, .13), transparent 36%),
    linear-gradient(180deg, rgba(4, 6, 17, .22), rgba(4, 6, 17, .62));
}

.noise {
  z-index: 3;
  opacity: .07;
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.58'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.vignette {
  z-index: 4;
  background:
    radial-gradient(circle at center, transparent 35%, rgba(1, 2, 8, .42) 100%),
    linear-gradient(90deg, rgba(2, 4, 12, .22), transparent 30%, transparent 72%, rgba(4, 2, 12, .22));
}

.webgl-status {
  position: fixed;
  z-index: 70;
  right: 24px;
  bottom: 24px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #b9c1d4;
  background: rgba(4, 7, 18, .74);
  backdrop-filter: blur(18px);
  font-size: .68rem;
  letter-spacing: .03em;
  transition: opacity .45s ease, transform .45s var(--ease);
}

.webgl-status span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  animation: statusPulse 1.4s ease-in-out infinite;
}

.webgl-status.is-ready {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

.webgl-status.is-error {
  color: #ffcfdd;
  border-color: rgba(255, 92, 145, .32);
}

.webgl-status.is-error span {
  background: #ff5c91;
  box-shadow: 0 0 12px #ff5c91;
  animation: none;
}

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  z-index: 60;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  padding: 0 clamp(22px, 4vw, 70px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  background:
    linear-gradient(180deg, rgba(3, 5, 14, .9), rgba(3, 5, 14, .3) 70%, transparent);
  pointer-events: none;
}

.site-header > * {
  pointer-events: auto;
}

.brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand__mark {
  color: transparent;
  font-size: 1.7rem;
  font-weight: 500;
  letter-spacing: -.09em;
  background: linear-gradient(135deg, var(--cyan), var(--violet) 55%, var(--magenta));
  background-clip: text;
  -webkit-background-clip: text;
}

.brand__name {
  font-size: .92rem;
  letter-spacing: .01em;
}

.site-nav {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 34px;
}

.site-nav a {
  position: relative;
  padding: 10px 0;
  color: #8f97ab;
  font-size: .78rem;
  font-weight: 700;
  transition: color .3s ease;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: #fff;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 2px;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  transition: right .4s var(--ease);
}

.site-nav a.is-active::after,
.site-nav a:hover::after {
  right: 0;
}

.header-progress {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #a5adc1;
  font-size: .64rem;
  letter-spacing: .17em;
}

.header-progress > i {
  position: relative;
  width: 54px;
  height: 1px;
  overflow: hidden;
  background: rgba(255, 255, 255, .16);
}

.header-progress > i b {
  position: absolute;
  inset: 0;
  transform: scaleX(var(--page-progress));
  transform-origin: left center;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 13px;
  place-items: center;
  gap: 5px;
  color: #fff;
  background: rgba(7, 10, 22, .7);
}

.menu-toggle i {
  display: block;
  width: 18px;
  height: 1px;
  background: currentColor;
}

/* ---------- Fixed rail ---------- */

.chapter-rail {
  position: fixed;
  z-index: 52;
  right: clamp(14px, 2vw, 30px);
  top: 50%;
  display: grid;
  gap: 10px;
  transform: translateY(-50%);
}

.chapter-rail a {
  min-width: 118px;
  display: grid;
  grid-template-columns: 22px 26px 1fr;
  align-items: center;
  gap: 6px;
  color: #687188;
  font-size: .53rem;
  letter-spacing: .06em;
  transition: color .3s ease, transform .35s var(--ease);
}

.chapter-rail a span {
  font-variant-numeric: tabular-nums;
}

.chapter-rail a i {
  height: 1px;
  background: rgba(255, 255, 255, .12);
  transition: background .3s ease, transform .3s var(--ease);
  transform-origin: right center;
}

.chapter-rail a strong {
  opacity: 0;
  font-weight: 600;
  transition: opacity .3s ease;
}

.chapter-rail a:hover,
.chapter-rail a.is-active {
  color: #eaf0ff;
  transform: translateX(-4px);
}

.chapter-rail a.is-active i {
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  transform: scaleX(1.3);
}

.chapter-rail a:hover strong,
.chapter-rail a.is-active strong {
  opacity: 1;
}

.scroll-progress {
  position: fixed;
  z-index: 50;
  left: 0;
  top: 0;
  width: 2px;
  height: 100vh;
  background: rgba(255, 255, 255, .04);
}

.scroll-progress i {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleY(var(--page-progress));
  transform-origin: top center;
  background: linear-gradient(180deg, var(--cyan), var(--violet), var(--magenta));
}

/* ---------- Narrative sections ---------- */

.experience {
  position: relative;
  z-index: 10;
}

.chapter {
  position: relative;
  min-height: 150svh;
}

.chapter--home {
  min-height: 160svh;
}

.chapter--projects {
  min-height: 165svh;
}

.chapter--contact {
  min-height: 145svh;
}

.chapter__sticky {
  position: sticky;
  top: 0;
  min-height: 100svh;
  display: grid;
  align-items: center;
  overflow: hidden;
}

.chapter__inner {
  width: min(1380px, calc(100% - clamp(56px, 9vw, 164px)));
  margin-inline: auto;
  padding-top: calc(var(--header-h) + 28px);
  padding-bottom: 50px;
}

.chapter__inner--hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(360px, .68fr);
  align-items: center;
  gap: clamp(56px, 8vw, 132px);
}

.chapter__inner--left,
.chapter__inner--right {
  min-height: 100svh;
  display: flex;
  align-items: center;
}

.chapter__inner--left {
  justify-content: flex-start;
}

.chapter__inner--right {
  justify-content: flex-end;
}

.chapter__inner--projects {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(290px, .58fr) minmax(620px, 1.2fr);
  align-items: center;
  gap: clamp(54px, 7vw, 112px);
}

.chapter__inner--contact {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(420px, .65fr);
  align-items: center;
  gap: clamp(52px, 8vw, 130px);
}

.chapter::after {
  content: "";
  position: absolute;
  left: 8vw;
  right: 8vw;
  bottom: 0;
  height: 1px;
  opacity: .35;
  background: linear-gradient(90deg, transparent, rgba(38, 224, 255, .25), rgba(183, 48, 255, .22), transparent);
}

/* ---------- Reveals ---------- */

.reveal-item {
  opacity: .14;
  transform: translate3d(0, 24px, 0);
  filter: blur(5px);
  transition:
    opacity .75s ease,
    transform .9s var(--ease),
    filter .75s ease;
}

.chapter.is-active .reveal-item {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  filter: blur(0);
}

.reveal-stack .reveal-item:nth-child(2) { transition-delay: .06s; }
.reveal-stack .reveal-item:nth-child(3) { transition-delay: .11s; }
.reveal-stack .reveal-item:nth-child(4) { transition-delay: .16s; }
.reveal-stack .reveal-item:nth-child(5) { transition-delay: .21s; }
.reveal-stack .reveal-item:nth-child(6) { transition-delay: .26s; }

.eyebrow,
.chapter-label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--cyan);
  font-size: .67rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.eyebrow::before,
.chapter-label::before {
  content: "";
  width: 30px;
  height: 1px;
  background: var(--cyan);
}

.gradient-text {
  color: transparent;
  background: linear-gradient(90deg, var(--cyan), #6d85ff 54%, var(--magenta));
  background-clip: text;
  -webkit-background-clip: text;
}

.gradient-text--cyan {
  background: linear-gradient(90deg, #20e0ff, #5aaaff);
  background-clip: text;
  -webkit-background-clip: text;
}

.gradient-text--violet {
  background: linear-gradient(90deg, #7774ff, var(--magenta));
  background-clip: text;
  -webkit-background-clip: text;
}

/* ---------- Hero ---------- */

.hero-copy h1,
.story-panel h2,
.projects-heading h2,
.contact-copy h2 {
  margin: 0;
  letter-spacing: -.062em;
}

.hero-copy h1 {
  max-width: 790px;
  margin-top: 18px;
  font-size: clamp(4rem, 6.5vw, 7.1rem);
  line-height: .93;
}

.hero-lead {
  max-width: 660px;
  margin: 26px 0 0;
  color: #a7afc2;
  font-size: clamp(.98rem, 1.12vw, 1.12rem);
  line-height: 1.65;
}

.hero-actions {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  min-height: 52px;
  padding: 0 22px;
  border: 1px transparent;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  cursor: pointer;
  color: #fff;
  font-size: .82rem;
  font-weight: 800;
  transition:
    transform .3s var(--ease),
    border-color .3s ease,
    background .3s ease,
    box-shadow .35s ease,
    opacity .3s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn--primary {
  background: linear-gradient(100deg, #22dfff, #685dff 58%, #d92cff);
  box-shadow: 0 15px 40px rgba(93, 59, 255, .2);
}

.btn--primary:hover {
  box-shadow: 0 18px 52px rgba(103, 59, 255, .34);
}

.btn--primary > span {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .13);
}

.btn--ghost {
  border-color: var(--line);
  background: rgba(7, 10, 22, .48);
  backdrop-filter: blur(18px);
}

.btn--ghost:hover {
  border-color: rgba(105, 206, 255, .28);
  background: rgba(13, 16, 34, .68);
}

.hero-services {
  max-width: 730px;
  margin-top: 42px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hero-services article {
  min-width: 0;
  padding: 15px 18px 0 0;
  display: grid;
  gap: 6px;
}

.hero-services article:not(:first-child) {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.hero-services strong {
  color: var(--cyan);
  font-size: .65rem;
}

.hero-services span {
  color: #b6bdce;
  font-size: .76rem;
}

.hero-readout {
  position: relative;
  justify-self: end;
  width: min(100%, 430px);
  padding: 18px;
  border: 1px solid rgba(100, 85, 255, .22);
  border-radius: 22px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(8, 15, 33, .72), rgba(9, 7, 25, .62));
  backdrop-filter: blur(20px);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, .28),
    inset 0 1px 0 rgba(255, 255, 255, .04),
    inset 0 -18px 32px rgba(116, 66, 255, .04);
}

.hero-readout::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      122deg,
      rgba(255, 255, 255, .12) 0%,
      rgba(255, 255, 255, .04) 20%,
      rgba(255, 255, 255, 0) 34%
    ),
    radial-gradient(circle at 22% 14%, rgba(51, 226, 255, .14), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(214, 60, 255, .10), transparent 24%);
  opacity: .8;
  pointer-events: none;
}

.hero-readout::after {
  content: "";
  position: absolute;
  left: -18%;
  top: -32%;
  width: 48%;
  height: 190%;
  transform: rotate(18deg);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, .12) 0%,
    rgba(255, 255, 255, .045) 18%,
    rgba(255, 255, 255, 0) 48%
  );
  filter: blur(2px);
  opacity: .7;
  pointer-events: none;
}

.hero-readout > * {
  position: relative;
  z-index: 1;
}

.hero-readout__top {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #8290ab;
  font-size: .55rem;
  letter-spacing: .12em;
}

.hero-readout__top i {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, .08);
}

.hero-readout__top strong {
  color: var(--green);
  font-size: .54rem;
}

.hero-readout__metric {
  margin-top: 26px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.hero-readout__metric small {
  color: #8791a9;
  font-size: .68rem;
}

.hero-readout__metric strong {
  font-size: clamp(2.5rem, 4vw, 4.2rem);
  line-height: .85;
  letter-spacing: -.07em;
}

.hero-readout__line {
  position: relative;
  height: 92px;
  margin-top: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 100% 23px;
}

.hero-readout__line::before {
  content: "";
  position: absolute;
  left: 4%;
  right: 3%;
  top: 48%;
  height: 2px;
  border-radius: 999px;
  transform: rotate(-8deg);
  background: linear-gradient(90deg, var(--cyan), #6679ff, var(--magenta));
  box-shadow: 0 0 18px rgba(105, 77, 255, .34);
}

.hero-readout__line i {
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  border: 2px solid #dfffff;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}

.hero-readout__line i:nth-child(1) { left: 8%; top: 66%; }
.hero-readout__line i:nth-child(2) { left: 28%; top: 57%; }
.hero-readout__line i:nth-child(3) { left: 49%; top: 48%; }
.hero-readout__line i:nth-child(4) { left: 70%; top: 39%; }
.hero-readout__line i:nth-child(5) {
  right: 2%;
  top: 30%;
  background: var(--magenta);
  box-shadow: 0 0 10px var(--magenta);
}

.hero-readout__bottom {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  color: #747e98;
  font-size: .57rem;
}

.hero-readout__bottom span:nth-child(2) { text-align: center; }
.hero-readout__bottom span:nth-child(3) { text-align: right; }

.scroll-cue {
  position: absolute;
  left: 0;
  bottom: 28px;
  display: grid;
  grid-template-columns: auto 55px auto;
  align-items: center;
  gap: 11px;
  color: #798298;
  font-size: .55rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.scroll-cue i {
  height: 1px;
  overflow: hidden;
  background: rgba(255, 255, 255, .13);
}

.scroll-cue i::after {
  content: "";
  display: block;
  width: 50%;
  height: 100%;
  background: var(--cyan);
  animation: scrollSignal 2s ease-in-out infinite;
}

.scroll-cue small {
  color: #505970;
  font-size: .48rem;
}

/* ---------- Story panels ---------- */

.story-panel {
  width: min(560px, 45vw);
  padding: clamp(26px, 3vw, 42px);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(7, 12, 29, .8), rgba(8, 7, 22, .68));
  box-shadow: 0 38px 110px rgba(0, 0, 0, .32);
  backdrop-filter: blur(24px);
}

.story-panel h2,
.projects-heading h2,
.contact-copy h2 {
  margin-top: 19px;
  font-size: clamp(3rem, 4.8vw, 5.25rem);
  line-height: .95;
}

.story-panel > p,
.projects-heading > p,
.contact-copy > p {
  max-width: 640px;
  margin: 22px 0 0;
  color: #a2abc0;
  font-size: .96rem;
  line-height: 1.65;
}

.service-flow {
  margin-top: 30px;
  display: flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
}

.service-flow span {
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #c8cfdf;
  font-size: .53rem;
  background: rgba(255, 255, 255, .025);
}

.service-flow i {
  flex: 1;
  min-width: 11px;
  height: 1px;
  background: linear-gradient(90deg, rgba(32, 221, 255, .2), rgba(32, 221, 255, .8));
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.story-panel .tag-row {
  margin-top: 24px;
}

.tag-row span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #9ca6ba;
  font-size: .56rem;
  background: rgba(255, 255, 255, .02);
}

.funnel-ui,
.integration-ui {
  margin-top: 30px;
  display: grid;
  align-items: center;
  gap: 8px;
}

.funnel-ui {
  grid-template-columns: 1fr 30px 1fr 30px 1fr;
}

.funnel-ui > div,
.integration-ui > div {
  min-width: 0;
  padding: 14px 9px;
  border: 1px solid var(--line);
  border-radius: 13px;
  display: grid;
  gap: 5px;
  text-align: center;
  background: rgba(255, 255, 255, .025);
}

.funnel-ui small,
.integration-ui small {
  color: #77819a;
  font-size: .48rem;
  letter-spacing: .1em;
}

.funnel-ui strong,
.integration-ui strong {
  font-size: .79rem;
}

.funnel-ui > i,
.integration-ui > i {
  position: relative;
  height: 1px;
  background: rgba(255, 255, 255, .12);
}

.funnel-ui > i b,
.integration-ui > i b {
  position: absolute;
  top: -2px;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  animation: flowDot 1.5s linear infinite;
}

.funnel-ui > i:nth-of-type(2) b,
.integration-ui > i:nth-of-type(2) b {
  background: var(--magenta);
  box-shadow: 0 0 10px var(--magenta);
  animation-delay: .7s;
}

.integration-ui {
  grid-template-columns: 1fr 28px 58px 28px 1fr;
}

.integration-ui > span {
  width: 58px;
  height: 58px;
  border: 1px solid rgba(127, 91, 255, .34);
  border-radius: 17px;
  display: grid;
  place-items: center;
  color: var(--cyan);
  font-size: .62rem;
  font-weight: 900;
  background: linear-gradient(145deg, rgba(16, 39, 60, .8), rgba(40, 13, 65, .78));
  box-shadow: 0 0 28px rgba(99, 63, 241, .14);
}

.sync-status {
  margin-top: 17px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  color: #8e98ad;
  font-size: .62rem;
}

.sync-status i,
.contact-signals i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 11px var(--green);
}

.sync-status strong {
  color: #d8dfee;
}

/* ---------- Projects ---------- */

.projects-heading {
  max-width: 490px;
}

.project-deck {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  perspective: 1200px;
}

.project-card {
  position: relative;
  min-height: 330px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(145deg, rgba(9, 14, 31, .82), rgba(8, 7, 23, .76));
  backdrop-filter: blur(20px);
  overflow: hidden;
  transition:
    transform .55s var(--ease),
    border-color .35s ease,
    background .35s ease;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background:
    radial-gradient(circle at 20% 10%, rgba(31, 220, 255, .13), transparent 36%),
    radial-gradient(circle at 80% 85%, rgba(211, 50, 255, .14), transparent 38%);
  transition: opacity .4s ease;
}

.project-card:hover {
  border-color: rgba(101, 109, 255, .3);
  transform: translateY(-10px) rotateX(2deg);
}

.project-card:hover::before {
  opacity: 1;
}

.project-card > * {
  position: relative;
  z-index: 2;
}

.project-card__number {
  color: var(--cyan);
  font-size: .63rem;
  font-weight: 800;
}

.project-card > span {
  margin-top: auto;
  color: #717c95;
  font-size: .55rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.project-card h3 {
  margin: 9px 0 0;
  font-size: 1.25rem;
  letter-spacing: -.03em;
}

.project-card p {
  margin: 12px 0 20px;
  color: #959fb6;
  font-size: .78rem;
  line-height: 1.55;
}

/* ---------- Contact ---------- */

.contact-copy {
  max-width: 610px;
}

.contact-signals {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.contact-signals span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #929cb1;
  font-size: .67rem;
}

.contact-signals span:nth-child(2) i {
  background: var(--cyan);
  box-shadow: 0 0 11px var(--cyan);
}

.contact-signals span:nth-child(3) i {
  background: var(--magenta);
  box-shadow: 0 0 11px var(--magenta);
}

.contact-form {
  width: min(100%, 550px);
  justify-self: end;
  padding: clamp(22px, 3vw, 36px);
  border: 1px solid rgba(108, 85, 255, .25);
  border-radius: 28px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  background:
    linear-gradient(145deg, rgba(8, 14, 31, .88), rgba(8, 7, 23, .82));
  box-shadow: 0 34px 100px rgba(0, 0, 0, .34);
  backdrop-filter: blur(28px);
}

.form-heading,
.field--message,
.btn--submit,
.form-note {
  grid-column: 1 / -1;
}

.form-heading {
  padding-bottom: 17px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.form-heading span {
  color: var(--cyan);
  font-size: .58rem;
  letter-spacing: .14em;
}

.form-heading strong {
  font-size: 1.18rem;
}

.field {
  display: grid;
  gap: 8px;
}

.field > span:first-child {
  color: #abb3c5;
  font-size: .66rem;
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 13px;
  outline: none;
  color: #edf1fb;
  background: rgba(255, 255, 255, .035);
  transition: border-color .25s ease, background .25s ease, box-shadow .25s ease;
}

.field input,
.field select {
  height: 49px;
  padding: 0 14px;
}

.field textarea {
  min-height: 118px;
  padding: 13px 14px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #59637a;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: rgba(32, 221, 255, .45);
  background: rgba(255, 255, 255, .055);
  box-shadow: 0 0 0 4px rgba(32, 221, 255, .055);
}

.select-shell {
  position: relative;
  display: block;
}

.select-shell select {
  appearance: none;
  padding-right: 38px;
}

.select-shell > i {
  position: absolute;
  right: 15px;
  top: 50%;
  pointer-events: none;
  color: #8590a8;
  font-style: normal;
  transform: translateY(-55%);
}

.btn--submit {
  width: 100%;
}

.btn--submit:disabled {
  cursor: wait;
  opacity: .65;
  transform: none;
}

.form-note {
  margin: -3px 0 0;
  color: #626d84;
  text-align: center;
  font-size: .55rem;
}

.hp-field {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ---------- HUD ---------- */

.world-readout {
  position: fixed;
  z-index: 45;
  left: clamp(20px, 4vw, 66px);
  bottom: 24px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #68738a;
  font-size: .52rem;
  letter-spacing: .11em;
  pointer-events: none;
}

.world-readout i {
  width: 26px;
  height: 1px;
  background: rgba(255, 255, 255, .12);
}

.world-readout strong {
  color: #b8c2d5;
  font-size: .54rem;
}

.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 28px;
  width: min(430px, calc(100% - 34px));
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: #e8edf8;
  text-align: center;
  background: rgba(7, 10, 23, .95);
  box-shadow: 0 20px 70px rgba(0, 0, 0, .45);
  backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 14px);
  transition: opacity .3s ease, visibility .3s ease, transform .4s var(--ease);
}

.toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.toast.is-success {
  border-color: rgba(69, 239, 199, .35);
}

.toast.is-error {
  color: #ffe2ec;
  border-color: rgba(255, 82, 136, .46);
  background: rgba(29, 7, 18, .96);
}

/* ---------- Responsive ---------- */

@media (max-width: 1180px) {
  :root {
    --header-h: 72px;
  }

  .chapter-rail {
    display: none;
  }

  .chapter__inner {
    width: min(100% - 48px, 980px);
  }

  .chapter__inner--hero {
    grid-template-columns: minmax(0, 1fr) minmax(300px, .58fr);
    gap: 42px;
  }

  .hero-copy h1 {
    font-size: clamp(3.6rem, 7vw, 5.6rem);
  }

  .hero-readout {
    width: min(100%, 360px);
  }

  .story-panel {
    width: min(520px, 54vw);
  }

  .chapter__inner--projects {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .projects-heading {
    max-width: 700px;
  }

  .projects-heading h2 {
    max-width: 750px;
  }
}

@media (max-width: 900px) {
  .site-header {
    grid-template-columns: 1fr auto;
    padding-inline: 22px;
  }

  .header-progress {
    display: none;
  }

  .menu-toggle {
    display: grid;
    justify-self: end;
  }

  .site-nav {
    position: absolute;
    top: calc(100% - 3px);
    right: 18px;
    width: min(270px, calc(100vw - 36px));
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 17px;
    display: grid;
    gap: 3px;
    background: rgba(6, 9, 22, .96);
    box-shadow: 0 22px 70px rgba(0, 0, 0, .45);
    backdrop-filter: blur(24px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(.98);
    transition: opacity .25s ease, visibility .25s ease, transform .3s var(--ease);
  }

  .site-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
  }

  .site-nav a {
    padding: 12px 13px;
  }

  .site-nav a::after {
    display: none;
  }

  .chapter {
    min-height: 135svh;
  }

  .chapter--home,
  .chapter--projects {
    min-height: 145svh;
  }

  .chapter__inner {
    width: min(100% - 36px, 760px);
  }

  .chapter__inner--hero {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 30px;
  }

  .hero-copy h1 {
    max-width: 720px;
    font-size: clamp(3.3rem, 10vw, 5.25rem);
  }

  .hero-lead {
    max-width: 650px;
  }

  .hero-readout {
    justify-self: start;
    width: min(100%, 440px);
  }

  .scroll-cue {
    display: none;
  }

  .chapter__inner--left,
  .chapter__inner--right {
    justify-content: flex-start;
  }

  .story-panel {
    width: min(100%, 570px);
  }

  .chapter__inner--contact {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .contact-form {
    justify-self: start;
    width: min(100%, 620px);
  }

  .world-readout {
    display: none;
  }
}

@media (max-width: 640px) {
  .chapter {
    min-height: 128svh;
  }

  .chapter__sticky {
    position: relative;
    min-height: 100svh;
    overflow: visible;
  }

  .chapter__inner,
  .chapter__inner--hero,
  .chapter__inner--left,
  .chapter__inner--right,
  .chapter__inner--projects,
  .chapter__inner--contact {
    min-height: 100svh;
    padding-top: calc(var(--header-h) + 52px);
    padding-bottom: 64px;
  }

  .brand__name {
    display: none;
  }

  .hero-copy h1 {
    margin-top: 15px;
    font-size: clamp(3rem, 14vw, 4.4rem);
  }

  .hero-lead {
    margin-top: 18px;
    font-size: .93rem;
    line-height: 1.58;
  }

  .hero-actions {
    display: grid;
    gap: 10px;
  }

  .btn {
    width: 100%;
  }

  .hero-services {
    margin-top: 28px;
    grid-template-columns: 1fr;
  }

  .hero-services article,
  .hero-services article:not(:first-child) {
    padding: 10px 0;
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }

  .hero-services article:last-child {
    border-bottom: 0;
  }

  .hero-readout {
    display: none;
  }

  .story-panel {
    padding: 24px 20px;
    border-radius: 23px;
  }

  .story-panel h2,
  .projects-heading h2,
  .contact-copy h2 {
    font-size: clamp(2.9rem, 12vw, 4rem);
  }

  .service-flow {
    flex-wrap: wrap;
  }

  .service-flow i {
    display: none;
  }

  .funnel-ui,
  .integration-ui {
    gap: 5px;
  }

  .funnel-ui {
    grid-template-columns: 1fr 18px 1fr 18px 1fr;
  }

  .integration-ui {
    grid-template-columns: 1fr 18px 50px 18px 1fr;
  }

  .integration-ui > span {
    width: 50px;
    height: 50px;
  }

  .project-deck {
    grid-template-columns: 1fr;
  }

  .project-card {
    min-height: 250px;
  }

  .contact-form {
    grid-template-columns: 1fr;
    padding: 22px 18px;
  }

  .field,
  .form-heading,
  .field--message,
  .btn--submit,
  .form-note {
    grid-column: 1;
  }

  .webgl-backdrop {
    background:
      radial-gradient(circle at 50% 14%, rgba(18, 210, 237, .09), transparent 28%),
      radial-gradient(circle at 64% 75%, rgba(177, 41, 255, .11), transparent 34%),
      linear-gradient(180deg, rgba(4, 6, 17, .4), rgba(4, 6, 17, .7));
  }

  .webgl-status {
    right: 14px;
    bottom: 14px;
  }
}

@media (max-width: 400px) {
  .chapter__inner {
    width: calc(100% - 26px);
  }

  .eyebrow,
  .chapter-label {
    font-size: .59rem;
    letter-spacing: .13em;
  }

  .hero-copy h1 {
    font-size: clamp(2.65rem, 13.7vw, 3.55rem);
  }

  .story-panel h2,
  .projects-heading h2,
  .contact-copy h2 {
    font-size: clamp(2.55rem, 12.6vw, 3.4rem);
  }

  .funnel-ui small,
  .integration-ui small {
    font-size: .4rem;
  }

  .funnel-ui strong,
  .integration-ui strong {
    font-size: .68rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }

  .reveal-item {
    opacity: 1;
    filter: none;
    transform: none;
  }
}

/* ---------- Animations ---------- */

@keyframes statusPulse {
  0%, 100% { opacity: .45; transform: scale(.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

@keyframes scrollSignal {
  0% { transform: translateX(-110%); }
  50%, 100% { transform: translateX(210%); }
}

@keyframes flowDot {
  0% { opacity: 0; transform: translateX(0); }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translateX(25px); }
}


/* ---------- Custom select ---------- */

.custom-select {
  position: relative;
}

.native-select {
  position: absolute !important;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.custom-select__trigger {
  width: 100%;
  min-height: 49px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #edf1fb;
  background: rgba(255, 255, 255, .035);
  box-shadow: none;
  cursor: pointer;
  transition:
    border-color .25s ease,
    box-shadow .25s ease,
    background .25s ease,
    transform .25s var(--ease);
}

.custom-select__trigger:hover,
.custom-select.is-open .custom-select__trigger {
  border-color: rgba(84, 206, 255, .52);
  background:
    linear-gradient(145deg, rgba(18, 28, 58, .98), rgba(12, 15, 34, .98));
  box-shadow:
    0 0 0 4px rgba(32, 221, 255, .05),
    0 16px 36px rgba(0, 0, 0, .28),
    0 0 24px rgba(108, 85, 255, .12);
}

.custom-select__trigger:focus-visible {
  outline: none;
  border-color: rgba(84, 206, 255, .58);
  box-shadow:
    0 0 0 4px rgba(32, 221, 255, .08),
    0 16px 36px rgba(0, 0, 0, .28);
}

.custom-select__value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.custom-select__trigger > i {
  color: #94a0ba;
  font-style: normal;
  transition: transform .25s var(--ease), color .25s ease;
}

.custom-select.is-open .custom-select__trigger > i {
  color: var(--cyan);
  transform: rotate(180deg);
}

.custom-select__menu {
  position: absolute;
  z-index: 25;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  padding: 8px;
  border: 1px solid rgba(113, 88, 255, .26);
  border-radius: 13px;
  display: grid;
  gap: 4px;
  background:
    linear-gradient(165deg, rgba(8, 13, 31, .985), rgba(10, 10, 28, .985));
  box-shadow:
    0 24px 60px rgba(0, 0, 0, .4),
    0 0 40px rgba(91, 62, 255, .1);
  backdrop-filter: blur(22px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(.98);
  transition:
    opacity .22s ease,
    visibility .22s ease,
    transform .28s var(--ease);
}

.custom-select.is-open .custom-select__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.custom-select__option {
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  color: #dbe3f5;
  text-align: left;
  font-size: .9rem;
  background: transparent;
  cursor: pointer;
  transition:
    background .2s ease,
    color .2s ease,
    transform .2s ease;
}

.custom-select__option:hover,
.custom-select__option:focus-visible {
  outline: none;
  color: #fff;
  background: linear-gradient(90deg, rgba(33, 221, 255, .16), rgba(130, 86, 255, .22));
  transform: translateX(2px);
}

.custom-select__option.is-selected {
  color: #fff;
  background: linear-gradient(90deg, rgba(33, 221, 255, .18), rgba(130, 86, 255, .26));
}

.custom-select__option.is-placeholder {
  color: #7e89a2;
}

.custom-select.has-value .custom-select__option.is-placeholder {
  display: none;
}



/* ---------- v24 fix: custom select stacking ---------- */

.contact-form {
  position: relative;
  isolation: isolate;
  overflow: visible;
}

.field {
  position: relative;
  z-index: 1;
}

.field:focus-within {
  z-index: 10;
}

.field.field--message {
  z-index: 1;
}

.custom-select {
  position: relative;
  z-index: 8;
}

.custom-select.is-open {
  z-index: 120;
}

.custom-select__menu {
  z-index: 140;
}

.btn--submit {
  position: relative;
  z-index: 2;
}

/* En mobile el menú necesita todavía más prioridad visual */
@media (max-width: 640px) {
  .contact-form {
    overflow: visible;
  }

  .custom-select.is-open {
    z-index: 180;
  }

  .custom-select__menu {
    z-index: 200;
  }
}


/* ---------- v25: reflejo visual en hero card ---------- */

.hero-readout:hover::after {
  animation: heroReadoutReflect 1.35s var(--ease) 1;
}

@keyframes heroReadoutReflect {
  0% {
    transform: translateX(-14%) rotate(18deg);
    opacity: .25;
  }
  18% {
    opacity: .72;
  }
  100% {
    transform: translateX(220%) rotate(18deg);
    opacity: 0;
  }
}


/* ---------- v26: notebook / laptop responsive tuning ---------- */

@media (max-width: 1500px) {
  .chapter__inner {
    width: min(100% - 56px, 1260px);
  }

  .chapter__inner--hero {
    grid-template-columns: minmax(0, .86fr) minmax(320px, .62fr);
    gap: clamp(34px, 4vw, 72px);
  }

  .hero-copy h1 {
    max-width: 650px;
    font-size: clamp(3.85rem, 5.75vw, 6.05rem);
  }

  .hero-lead {
    max-width: 575px;
    margin-top: 22px;
    font-size: 1rem;
    line-height: 1.58;
  }

  .hero-actions {
    margin-top: 24px;
  }

  .hero-services {
    max-width: 620px;
    margin-top: 34px;
  }

  .hero-services article {
    padding-top: 12px;
  }

  .hero-readout {
    width: min(100%, 390px);
    padding: 16px;
  }

  .hero-readout__metric {
    margin-top: 20px;
    gap: 16px;
  }

  .hero-readout__metric strong {
    font-size: clamp(2.85rem, 3.8vw, 3.95rem);
  }
}

@media (max-width: 1500px) and (max-height: 900px) {
  .chapter--home {
    min-height: 152svh;
  }

  .chapter__inner {
    padding-top: calc(var(--header-h) + 16px);
    padding-bottom: 30px;
  }

  .chapter__inner--hero {
    grid-template-columns: minmax(0, .84fr) minmax(300px, .58fr);
    gap: 28px;
  }

  .hero-copy h1 {
    max-width: 590px;
    font-size: clamp(3.45rem, 5.15vw, 5.3rem);
    line-height: .915;
  }

  .hero-lead {
    max-width: 525px;
    margin-top: 18px;
    font-size: .95rem;
    line-height: 1.52;
  }

  .hero-actions {
    margin-top: 20px;
    gap: 10px;
  }

  .btn {
    min-height: 50px;
    padding-inline: 20px;
    font-size: .78rem;
  }

  .hero-services {
    max-width: 560px;
    margin-top: 26px;
  }

  .hero-services article {
    padding-top: 12px;
  }

  .hero-services article:not(:first-child) {
    padding-left: 14px;
  }

  .hero-services article:first-child {
    padding-right: 14px;
  }

  .hero-services strong {
    font-size: .61rem;
  }

  .hero-services span {
    font-size: .71rem;
  }

  .hero-readout {
    width: min(100%, 345px);
    padding: 14px 14px 12px;
    border-radius: 20px;
  }

  .hero-readout__top {
    font-size: .5rem;
  }

  .hero-readout__top strong {
    font-size: .5rem;
  }

  .hero-readout__metric {
    margin-top: 16px;
    gap: 12px;
  }

  .hero-readout__metric small {
    font-size: .62rem;
  }

  .hero-readout__metric strong {
    font-size: clamp(2.6rem, 3.6vw, 3.45rem);
  }

  .hero-readout__line {
    height: 84px;
    margin-top: 18px;
    background-size: 100% 21px;
  }

  .hero-readout__bottom {
    margin-top: 12px;
    font-size: .52rem;
  }
}

@media (max-width: 1366px) and (max-height: 820px) {
  .chapter__inner {
    width: min(100% - 48px, 1180px);
  }

  .chapter__inner--hero {
    grid-template-columns: minmax(0, .82fr) minmax(290px, .56fr);
    gap: 24px;
  }

  .hero-copy h1 {
    max-width: 550px;
    font-size: clamp(3.15rem, 4.7vw, 4.95rem);
  }

  .hero-lead {
    max-width: 490px;
  }

  .hero-services {
    max-width: 520px;
    margin-top: 22px;
  }

  .hero-readout {
    width: min(100%, 320px);
  }

  .scroll-cue {
    bottom: 6px;
  }
}


/* ---------- v27: form consistency ---------- */

.custom-select__trigger {
  height: 49px;
}

.custom-select__trigger:hover {
  border-color: rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .05);
  box-shadow: none;
}

.custom-select.is-open .custom-select__trigger,
.custom-select__trigger:focus-visible {
  border-color: rgba(32, 221, 255, .45);
  background: rgba(255, 255, 255, .055);
  box-shadow: 0 0 0 4px rgba(32, 221, 255, .055);
}


/* =========================================================
   v28 — Botones: centrado real y sin desfase visual
   ========================================================= */

/*
  Antes el texto y el círculo de la flecha formaban un único grupo flex.
  Eso desplazaba ópticamente el contenido y, durante el hover/reveal,
  podía dar la impresión de que quedaba una "cáscara" cian detrás.
  Ahora el label ocupa el centro real y el icono vive en su propia columna.
*/
.btn {
  transform: none;
}

.btn:hover {
  transform: none;
}

.btn--primary {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 25px minmax(0, auto) 25px;
  align-items: center;
  justify-content: center;
  column-gap: 12px;
  background:
    linear-gradient(
      90deg,
      #20ddff 0%,
      #4fa7ff 27%,
      #7369ff 52%,
      #a447ff 75%,
      #d92cff 100%
    );
  background-size: 100% 100%;
  background-position: center;
  box-shadow: 0 15px 40px rgba(93, 59, 255, .2);
  transition:
    filter .3s ease,
    box-shadow .35s ease,
    background-size .35s var(--ease),
    opacity .3s ease;
}

.btn--primary::before {
  content: "";
  width: 25px;
  height: 25px;
  grid-column: 1;
}

.btn--primary:hover {
  filter: brightness(1.07) saturate(1.04);
  background-size: 106% 100%;
  box-shadow: 0 18px 52px rgba(103, 59, 255, .3);
}

.btn__label {
  grid-column: 2;
  min-width: 0;
  text-align: center;
  white-space: nowrap;
}

.btn__icon {
  grid-column: 3;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .13);
  transition:
    transform .3s var(--ease),
    background .3s ease;
}

.btn--primary:hover .btn__icon {
  transform: rotate(5deg) scale(1.06);
  background: rgba(255, 255, 255, .18);
}

/* Neutraliza el selector antiguo que alcanzaba cualquier span directo. */
.btn--primary > span {
  flex: initial;
}

.btn--submit {
  grid-template-columns: 25px minmax(0, auto) 25px;
}

/* El texto técnico de seguridad ya no forma parte de la UI pública. */
.form-note {
  display: none !important;
}

@media (max-width: 640px) {
  .btn--primary {
    grid-template-columns: 24px minmax(0, auto) 24px;
    column-gap: 10px;
  }

  .btn--primary::before,
  .btn__icon {
    width: 24px;
    height: 24px;
  }
}


/* =========================================================
   v29 — WhatsApp contextual
   ========================================================= */

.btn--whatsapp {
  position: relative;
  grid-column: 1 / -1;
  overflow: hidden;
  width: 100%;
  min-height: 52px;
  display: grid;
  grid-template-columns: 25px minmax(0, auto) 25px;
  align-items: center;
  justify-content: center;
  column-gap: 12px;
  border: 1px solid rgba(255, 255, 255, .11);
  color: #eef3ff;
  background:
    linear-gradient(145deg, rgba(13, 19, 38, .9), rgba(9, 10, 26, .92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .035),
    0 12px 34px rgba(0, 0, 0, .18);
  transition:
    border-color .3s ease,
    background .3s ease,
    box-shadow .35s ease,
    filter .3s ease;
}

.btn--whatsapp::before {
  content: "";
  width: 25px;
  height: 25px;
  grid-column: 1;
}

.btn--whatsapp::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(
      90deg,
      rgba(32, 221, 255, .08),
      rgba(121, 92, 255, .09) 55%,
      rgba(69, 239, 199, .09)
    );
  transition: opacity .3s ease;
}

.btn--whatsapp:hover {
  border-color: rgba(69, 239, 199, .28);
  background:
    linear-gradient(145deg, rgba(14, 24, 42, .94), rgba(10, 12, 30, .96));
  box-shadow:
    0 16px 42px rgba(0, 0, 0, .24),
    0 0 28px rgba(69, 239, 199, .055);
  filter: brightness(1.05);
}

.btn--whatsapp:hover::after {
  opacity: 1;
}

.btn--whatsapp > * {
  position: relative;
  z-index: 1;
}

.btn--whatsapp .btn__label {
  grid-column: 2;
}

.btn--whatsapp .btn__icon {
  grid-column: 3;
}

.btn__icon--whatsapp {
  color: #dffff6;
  background: rgba(69, 239, 199, .11);
  box-shadow: inset 0 0 0 1px rgba(69, 239, 199, .08);
}

.btn--whatsapp:hover .btn__icon--whatsapp {
  transform: rotate(5deg) scale(1.06);
  background: rgba(69, 239, 199, .16);
}

@media (max-width: 640px) {
  .btn--whatsapp {
    grid-template-columns: 24px minmax(0, auto) 24px;
    column-gap: 10px;
  }

  .btn--whatsapp::before {
    width: 24px;
    height: 24px;
  }
}


/* =========================================================
   v30 — Fix definitivo de alineación en botones
   ========================================================= */

/*
  El desfase venía de una regla anterior:
  .btn--primary > span { width:25px; height:25px; ... }
  que seguía afectando también al texto (.btn__label).
  Acá neutralizamos explícitamente el label y dejamos la burbuja
  únicamente para el icono.
*/

.btn--primary > .btn__label,
.btn--whatsapp > .btn__label {
  width: auto !important;
  height: auto !important;
  min-width: 0;
  display: block !important;
  place-items: initial !important;
  border-radius: 0 !important;
  background: none !important;
  box-shadow: none !important;
  line-height: 1.1;
}

.btn--primary > .btn__icon,
.btn--whatsapp > .btn__icon {
  width: 25px !important;
  height: 25px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 50% !important;
}

.btn--primary,
.btn--whatsapp {
  padding-left: 22px;
  padding-right: 22px;
}

.btn--primary .btn__label,
.btn--whatsapp .btn__label {
  justify-self: center;
  align-self: center;
  padding-top: 1px;
}

@media (max-width: 640px) {
  .btn--primary > .btn__icon,
  .btn--whatsapp > .btn__icon {
    width: 24px !important;
    height: 24px !important;
  }
}


/* =========================================================
   v31 — Recuperación de la card original del Home
   Sólo afecta el visual derecho de la sección 01.
   ========================================================= */

.legacy-hero-visual {
  position: relative;
  justify-self: end;
  width: min(47vw, 660px);
  aspect-ratio: 1 / .92;
  display: grid;
  place-items: center;
  perspective: 1200px;
  isolation: isolate;
}

.legacy-orbit {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.legacy-orbit--outer {
  width: min(43vw, 620px);
  aspect-ratio: 1;
}

.legacy-orbit--inner {
  width: min(31vw, 455px);
  aspect-ratio: 1;
  border: 1px solid rgba(29, 232, 255, .2);
  box-shadow: inset 0 0 40px rgba(29, 232, 255, .025);
}

.legacy-orbit__rotator {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  transform: rotate(0deg);
  transform-origin: 50% 50%;
  transition: transform 2.2s cubic-bezier(.22, .72, .24, 1);
  will-change: transform;
}

.legacy-orbit__rotator::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    conic-gradient(
      from -28deg,
      rgba(208, 61, 255, .72) 0deg,
      rgba(137, 70, 255, .38) 62deg,
      rgba(91, 63, 214, .22) 118deg,
      rgba(22, 232, 255, .25) 188deg,
      rgba(22, 232, 255, .11) 248deg,
      rgba(126, 64, 223, .25) 305deg,
      rgba(208, 61, 255, .72) 360deg
    );
  -webkit-mask:
    radial-gradient(
      farthest-side,
      transparent calc(100% - 2px),
      #000 calc(100% - 1px)
    );
  mask:
    radial-gradient(
      farthest-side,
      transparent calc(100% - 2px),
      #000 calc(100% - 1px)
    );
}

.legacy-orbit__dot {
  position: absolute;
  top: -5px;
  left: 50%;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: #d83cff;
  box-shadow:
    0 0 7px rgba(216, 60, 255, .92),
    0 0 15px rgba(216, 60, 255, .42);
}

.legacy-dashboard-card {
  --tilt-x: 4deg;
  --tilt-y: -7deg;
  --shift-x: 0px;
  --shift-y: 0px;

  position: relative;
  z-index: 4;
  width: min(100%, 590px);
  aspect-ratio: 1.18 / .78;
  padding: clamp(20px, 1.7vw, 26px);
  border: 1px solid rgba(92, 188, 255, .2);
  border-radius: 25px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(16, 25, 52, .94), rgba(10, 7, 27, .9)),
    radial-gradient(circle at top right, rgba(172, 40, 255, .25), transparent 38%);
  box-shadow:
    0 42px 110px rgba(0, 0, 0, .5),
    0 0 80px rgba(89, 48, 232, .11);
  backdrop-filter: blur(28px);

  transform:
    perspective(1100px)
    translate3d(var(--shift-x), var(--shift-y), 0)
    rotateX(var(--tilt-x))
    rotateY(var(--tilt-y));

  scale: 1;
  translate: 0 0;

  transition:
    transform .22s ease-out,
    scale 2.2s cubic-bezier(.25, .1, .25, 1),
    translate 2.2s cubic-bezier(.25, .1, .25, 1),
    border-color .45s ease,
    box-shadow 2.2s cubic-bezier(.25, .1, .25, 1);
  will-change: transform, scale, translate;
}

.legacy-dashboard-card::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, .09),
      transparent 20%,
      transparent 72%,
      rgba(156, 49, 255, .13)
    );
}

.legacy-dashboard-card::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: -20%;
  top: -45%;
  width: 46%;
  height: 210%;
  pointer-events: none;
  opacity: .34;
  transform: rotate(17deg);
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, .12),
      rgba(255, 255, 255, .035) 24%,
      transparent 54%
    );
}

.legacy-dashboard-card > * {
  position: relative;
  z-index: 1;
}

.legacy-dashboard-card__top,
.legacy-dashboard-card__bottom,
.legacy-metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.legacy-mini-logo {
  color: #b95dff;
  font-size: 1.55rem;
  font-weight: 600;
  font-style: italic;
  letter-spacing: -.09em;
}

.legacy-status-dot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #aeb7cf;
  font-size: .7rem;
}

.legacy-status-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 14px var(--cyan);
}

.legacy-metric {
  align-items: end;
  margin-top: clamp(24px, 3vh, 38px);
}

.legacy-metric span {
  color: var(--muted);
  font-size: clamp(.72rem, .85vw, .9rem);
}

.legacy-metric strong {
  font-size: clamp(2.7rem, 4vw, 4.3rem);
  line-height: .9;
  letter-spacing: -.07em;
}

.legacy-chart {
  height: clamp(132px, 14vw, 188px);
  margin-top: 18px;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, .07);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 100% 42px;
}

.legacy-chart svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.legacy-chart__line {
  fill: none;
  stroke: url(#legacyChartGradient);
  stroke-width: 4;
  stroke-linecap: round;
  filter: drop-shadow(0 0 8px rgba(97, 73, 255, .8));
}

.legacy-chart__area {
  fill: url(#legacyAreaGradient);
}

.legacy-chart__point {
  fill: var(--cyan);
  stroke: #eaffff;
  stroke-width: 2;
  filter: drop-shadow(0 0 8px var(--cyan));
}

.legacy-chart__point--last {
  fill: var(--magenta);
  filter: drop-shadow(0 0 9px var(--magenta));
}

.legacy-dashboard-card__bottom {
  margin-top: 14px;
  gap: 10px;
  color: #8088a3;
  font-size: clamp(.52rem, .65vw, .68rem);
}

.legacy-dashboard-card__bottom span:nth-child(2) {
  text-align: center;
}

.legacy-dashboard-card__bottom span:nth-child(3) {
  text-align: right;
}

.legacy-floating-card {
  position: absolute;
  z-index: 6;
  padding: 14px 17px;
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(8, 11, 26, .78);
  box-shadow: 0 20px 54px rgba(0, 0, 0, .32);
  backdrop-filter: blur(18px);
  translate: 0 0;
  transition:
    translate 2.2s cubic-bezier(.25, .1, .25, 1),
    border-color .35s ease,
    background .35s ease;
}

.legacy-floating-card--dev {
  left: -2%;
  top: 25%;
}

.legacy-floating-card--mkt {
  right: -2%;
  bottom: 19%;
}

.legacy-floating-card__icon {
  color: var(--cyan);
  font-size: 1.15rem;
}

.legacy-floating-card small,
.legacy-floating-card strong {
  display: block;
}

.legacy-floating-card small {
  color: var(--muted);
  font-size: .62rem;
}

.legacy-floating-card strong {
  margin-top: 2px;
  font-size: .75rem;
}

/* Animación original: órbita media vuelta + crecimiento de card. */
.legacy-hero-visual.is-orbit-hover .legacy-orbit__rotator {
  transform: rotate(180deg);
}

.legacy-hero-visual.is-orbit-hover .legacy-dashboard-card {
  scale: 1.055;
  translate: 10px -8px;
  border-color: rgba(122, 91, 255, .32);
  box-shadow:
    0 54px 140px rgba(0, 0, 0, .62),
    0 0 76px rgba(101, 58, 224, .18);
}

.legacy-hero-visual.is-orbit-hover .legacy-floating-card--dev {
  translate: -5px -3px;
}

.legacy-hero-visual.is-orbit-hover .legacy-floating-card--mkt {
  translate: 6px 4px;
}

/* Notebook */
@media (max-width: 1500px) {
  .legacy-hero-visual {
    width: min(43vw, 570px);
  }

  .legacy-orbit--outer {
    width: min(39vw, 540px);
  }

  .legacy-orbit--inner {
    width: min(29vw, 405px);
  }

  .legacy-dashboard-card {
    width: min(100%, 510px);
  }

  .legacy-floating-card {
    padding: 11px 13px;
  }

  .legacy-floating-card strong {
    font-size: .69rem;
  }
}

@media (max-width: 1366px) and (max-height: 820px) {
  .legacy-hero-visual {
    width: min(41vw, 500px);
  }

  .legacy-orbit--outer {
    width: min(37vw, 475px);
  }

  .legacy-orbit--inner {
    width: min(27vw, 350px);
  }

  .legacy-dashboard-card {
    width: min(100%, 455px);
    padding: 17px;
  }

  .legacy-chart {
    height: 126px;
    margin-top: 12px;
  }

  .legacy-metric {
    margin-top: 20px;
  }

  .legacy-floating-card--dev {
    left: -1%;
  }

  .legacy-floating-card--mkt {
    right: -1%;
  }
}

/* Tablet: la card baja debajo del copy, como el readout anterior. */
@media (max-width: 900px) {
  .legacy-hero-visual {
    justify-self: start;
    width: min(100%, 570px);
    aspect-ratio: 1 / .9;
    margin-top: 6px;
  }

  .legacy-orbit--outer {
    width: min(78vw, 520px);
  }

  .legacy-orbit--inner {
    width: min(58vw, 385px);
  }

  .legacy-dashboard-card {
    width: min(88vw, 500px);
  }
}

/* Mobile: conserva el comportamiento previo de ocultar el visual pesado. */
@media (max-width: 640px) {
  .legacy-hero-visual {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .legacy-orbit__rotator,
  .legacy-dashboard-card,
  .legacy-floating-card {
    transition-duration: 0s !important;
  }
}
