/* ===========================================================
   ESSENCIA — Redesign sections
   Combina: glow Texly · bento Tracle · scroll-reveal Upmind ·
   órbita Tracle · wordmark gigante. Tipografía: Poppins.
   =========================================================== */

/* Glow strength is tweakable via --glow-boost (default 1) */

/* ---------- Shared aura / horizon ---------- */
.aura {
  position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
}
.aura__core {
  position: absolute; left: 50%; top: -8%;
  width: 120vw; max-width: 1500px; aspect-ratio: 1.4 / 1;
  transform: translateX(-50%);
  background: radial-gradient(ellipse 50% 50% at 50% 50%,
              oklch(0.64 0.16 var(--accent-h) / calc(0.30 * var(--glow-boost))) 0%,
              oklch(0.6 0.15 var(--accent-h) / calc(0.10 * var(--glow-boost))) 38%,
              transparent 66%);
  filter: blur(18px);
}
.aura__beam {
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 40% at 30% -5%, oklch(0.8 0.06 var(--accent-h) / calc(0.10 * var(--glow-boost))), transparent 60%),
    radial-gradient(60% 40% at 72% -8%, oklch(0.8 0.06 var(--accent-h) / calc(0.10 * var(--glow-boost))), transparent 60%);
}

/* ===========================================================
   HERO v2 — glow rising from black + mockup w/ reflection
   =========================================================== */
.hero--v2 {
  padding-top: clamp(150px, 18vh, 220px);
  background:
    radial-gradient(ellipse 52% 44% at 50% 32%,
      oklch(0.68 0.18 var(--accent-h) / calc(0.46 * var(--glow-boost))) 0%,
      oklch(0.56 0.17 var(--accent-h) / calc(0.18 * var(--glow-boost))) 30%,
      oklch(0.5 0.16 var(--accent-h) / calc(0.05 * var(--glow-boost))) 50%,
      transparent 66%),
    var(--bg);
}
.hero--v2 .hero__bg { z-index: -2; }
.hero__halo {
  position: absolute; left: 50%; top: -14%; z-index: -1;
  width: 150vw; max-width: 1800px; aspect-ratio: 1.5/1; transform: translateX(-50%);
  background: radial-gradient(ellipse 48% 52% at 50% 40%,
              oklch(0.7 0.18 var(--accent-h) / calc(0.62 * var(--glow-boost))) 0%,
              oklch(0.56 0.17 var(--accent-h) / calc(0.26 * var(--glow-boost))) 30%,
              oklch(0.5 0.16 var(--accent-h) / calc(0.08 * var(--glow-boost))) 50%,
              transparent 66%);
  filter: none;
  animation: haloPulse 9s var(--ease) infinite alternate;
}
@keyframes haloPulse {
  0% { opacity: 0.85; transform: translateX(-50%) scale(1); }
  100% { opacity: 1; transform: translateX(-50%) scale(1.08); }
}
.hero__badge {
  display: inline-flex; align-items: center; gap: 0.6em;
  padding: 0.5em 0.95em 0.5em 0.6em; border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(10px);
  font-size: 0.74rem; letter-spacing: 0.08em; color: var(--text);
  margin-bottom: 1.8rem;
}
.hero__badge .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent-bright);
  box-shadow: 0 0 0 3px oklch(0.7 0.15 var(--accent-h) / 0.25);
  animation: blip 2.4s var(--ease) infinite;
}
@keyframes blip { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.hero__badge .tag {
  font-size: 0.64rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted); padding-left: 0.7em; margin-left: 0.2em;
  border-left: 1px solid var(--line-strong);
}

/* Browser-chrome hero mockup */
.browser-bar {
  position: absolute; top: 0; left: 0; right: 0; height: 48px; z-index: 3;
  display: flex; align-items: center; gap: 16px; padding: 0 18px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border-bottom: 1px solid var(--line);
}
.browser-dots { display: flex; gap: 7px; }
.browser-dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--muted-2); opacity: 0.55; }
.browser-url {
  font-size: 0.74rem; letter-spacing: 0.03em; color: var(--muted);
  background: rgba(255,255,255,0.05); border: 1px solid var(--line);
  border-radius: 8px; padding: 0.4em 1.2em; display: inline-flex; align-items: center; gap: 0.5em;
}
.browser-url svg { width: 0.9em; height: 0.9em; stroke: var(--accent-bright); fill: none; stroke-width: 1.6; }
.browser-body { position: absolute; inset: 48px 0 0 0; }
.browser-body image-slot { width: 100%; height: 100%; }

/* Video frame: add a floor reflection + glow */
.video-frame--v2 { margin-top: clamp(3.2rem, 6vw, 5rem); }
.video-frame--v2::after {
  content: ""; position: absolute; left: 6%; right: 6%; bottom: -42%; height: 42%;
  background: inherit; opacity: 0.16; filter: blur(2px);
  transform: scaleY(-1);
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 78%);
          mask-image: linear-gradient(180deg, #000, transparent 78%);
  pointer-events: none;
}

/* ===========================================================
   STATS v2 — big numbers band w/ trend chips (Upmind + Texly)
   =========================================================== */
.stats--v2 { background: linear-gradient(180deg, var(--surface), var(--bg)); }
.stats__lead {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 24px; flex-wrap: wrap; margin-bottom: clamp(40px, 5vw, 60px);
}
.stats__lead h2 { max-width: 16ch; }
.stat__chip {
  display: inline-flex; align-items: center; gap: 0.4em;
  font-size: 0.72rem; font-weight: 500; color: var(--accent-bright);
  padding: 0.3em 0.7em; border-radius: 999px;
  border: 1px solid oklch(0.7 0.14 var(--accent-h) / 0.3);
  background: var(--accent-soft); margin-top: 1.1rem;
}
.stat__chip svg { width: 0.95em; height: 0.95em; }

/* ===========================================================
   SERVICES — Bento grid (Tracle / Texly)
   =========================================================== */
.bento {
  display: grid; grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: minmax(168px, auto); gap: 14px;
}
.bento__cell {
  position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius);
  background:
    radial-gradient(120% 100% at 0% 0%, var(--surface), var(--bg) 70%);
  padding: clamp(24px, 2.4vw, 34px);
  display: flex; flex-direction: column; justify-content: flex-end;
  transition: border-color 0.5s var(--ease), transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.bento__cell::before {
  content: ""; position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(420px circle at var(--mx,50%) var(--my,50%), var(--accent-soft), transparent 60%);
  transition: opacity 0.5s var(--ease);
}
.bento__cell:hover {
  border-color: oklch(0.72 0.12 var(--accent-h) / 0.4);
  transform: translateY(-4px);
  box-shadow: 0 30px 70px -40px rgba(0,0,0,0.9), 0 0 60px -30px var(--accent-glow);
}
.bento__cell:hover::before { opacity: 1; }
.bento__cell > * { position: relative; z-index: 1; }

.bento__num {
  position: absolute; top: 22px; left: clamp(24px,2.4vw,34px); z-index: 1;
  font-size: 0.72rem; letter-spacing: 0.18em; color: var(--muted-2);
}
.bento__icon { width: 42px; height: 42px; color: var(--accent); margin-bottom: auto; }
.bento__icon svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 1.3; }
.bento__cell h3 { font-size: 1.16rem; font-weight: 500; margin: 1.4rem 0 0.6rem; }
.bento__cell p { color: var(--muted); font-size: 0.9rem; max-width: 34ch; }

/* sizing */
.b-wide { grid-column: span 4; }
.b-tall { grid-column: span 2; grid-row: span 2; }
.b-reg  { grid-column: span 2; }
.b-half { grid-column: span 3; }

/* feature spotlight cell (big one) */
.bento--feature {
  grid-column: span 4; grid-row: span 2;
  justify-content: space-between;
}
.bento--feature .bento__visual {
  position: relative; z-index: 1; align-self: stretch; flex: 1;
  margin: 0.4rem 0 1.4rem; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line); min-height: 120px;
}
.bento--feature .bento__visual image-slot { width: 100%; height: 100%; }
.bento--accent {
  background:
    radial-gradient(120% 120% at 100% 0%, oklch(0.5 0.13 var(--accent-h) / 0.32), transparent 60%),
    var(--surface);
}

/* ===========================================================
   METHODOLOGY — Apple-style pinned scroll-reveal (Upmind 1/5)
   =========================================================== */
.method { position: relative; background: var(--black); border-top: 1px solid var(--line); }
.method__inner { position: relative; }            /* tall scroll driver, height set inline */
.method__pin {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  display: flex; align-items: center; overflow: hidden;
}
.method__pin .aura__core { opacity: 0.5; }
.method__grid {
  width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter);
  display: grid; grid-template-columns: 0.92fr 1.08fr; gap: clamp(36px, 5vw, 80px);
  align-items: center;
}

.method__eyebrow { margin-bottom: 1.6rem; }
.method__counter {
  font-size: clamp(3.4rem, 7vw, 5.6rem); font-weight: 600; letter-spacing: -0.04em;
  line-height: 1; color: var(--text);
}
.method__counter .sep { color: var(--muted-2); font-weight: 200; margin: 0 0.12em; }
.method__counter .total { color: var(--muted-2); font-size: 0.42em; vertical-align: super; }

.method__steps { position: relative; margin-top: 1.6rem; min-height: 8.5em; }
.method__step {
  position: absolute; inset: 0; opacity: 0; transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  pointer-events: none;
}
.method__step.is-active { opacity: 1; transform: none; position: relative; pointer-events: auto; }
.method__step h3 { font-size: clamp(1.6rem, 2.6vw, 2.3rem); font-weight: 500; letter-spacing: -0.02em; }
.method__step p { color: var(--muted); margin-top: 0.9rem; max-width: 42ch; }

.method__progress { display: flex; gap: 8px; margin-top: 2.4rem; }
.method__tick {
  flex: 1; height: 3px; border-radius: 2px; background: var(--line-strong);
  overflow: hidden; cursor: pointer;
}
.method__tick span { display: block; height: 100%; width: 0; background: var(--accent-bright); transition: width 0.5s var(--ease); }
.method__tick.is-done span { width: 100%; }
.method__tick.is-active span { width: 100%; }

/* stage with stacked frames */
.method__stage {
  position: relative; aspect-ratio: 4 / 3.1; border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: 0 50px 120px -50px rgba(0,0,0,0.95), 0 0 90px -40px var(--accent-glow);
}
.method__frame {
  position: absolute; inset: 0; opacity: 0; transform: scale(1.06);
  transition: opacity 0.8s var(--ease), transform 1.2s var(--ease);
}
.method__frame.is-active { opacity: 1; transform: none; }
.method__frame image-slot { width: 100%; height: 100%; }
.method__shot { width: 100%; height: 100%; object-fit: cover; display: block; }
.method__frame::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,0.55));
}
.method__tag {
  position: absolute; left: 20px; bottom: 18px; z-index: 2;
  font-size: 0.64rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--text);
  display: inline-flex; align-items: center; gap: 0.6em;
}
.method__tag::before { content:""; width: 22px; height: 1px; background: var(--accent-bright); }

/* mobile fallback: no pin, simple stacked steps */
.method__mobile { display: none; }

/* ===========================================================
   ORBIT — capability constellation (Tracle)
   =========================================================== */
.orbit-sec { text-align: center; }
.orbit {
  position: relative; width: min(620px, 90vw); aspect-ratio: 1; margin: clamp(40px,6vw,72px) auto 0;
}
.orbit__ring {
  position: absolute; inset: 0; border: 1px solid var(--line); border-radius: 50%;
}
.orbit__ring.r2 { inset: 14%; border-color: rgba(255,255,255,0.05); }
.orbit__ring.r3 { inset: 28%; border-color: rgba(255,255,255,0.04); }
.orbit__glow {
  position: absolute; inset: 24%; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  filter: blur(10px);
}
.orbit__core {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: 116px; height: 116px; border-radius: 22px; z-index: 3;
  display: grid; place-items: center;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-strong);
  box-shadow: 0 24px 60px -24px rgba(0,0,0,0.9), 0 0 60px -18px var(--accent-glow);
}
.orbit__core img { width: 60%; height: auto; }
.orbit__spin {
  position: absolute; inset: 0; animation: spin 38s linear infinite;
}
.orbit__spin.rev { animation-duration: 30s; }
.orbit:hover .orbit__spin { animation-play-state: paused; }
@keyframes spin { to { transform: rotate(360deg); } }
.orbit__node {
  position: absolute; left: 50%; top: 50%;
  width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 16px;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.03); border: 1px solid var(--line-strong);
  backdrop-filter: blur(6px); color: var(--accent);
  transition: border-color 0.4s var(--ease), color 0.4s var(--ease), background 0.4s var(--ease);
}
.orbit__node svg { width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 1.4; }
.orbit__node:hover { color: var(--accent-bright); border-color: oklch(0.72 0.12 var(--accent-h) / 0.5); background: var(--accent-soft); }
.orbit__node span {
  position: absolute; top: 110%; left: 50%; transform: translateX(-50%);
  font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
  white-space: nowrap;
}
/* counter-rotate label so text stays upright */
.orbit__spin .orbit__node { animation: spin 38s linear infinite reverse; }
.orbit__spin.rev .orbit__node { animation-duration: 30s; }

.orbit__list { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: clamp(40px,5vw,60px); }
.orbit__pill {
  font-size: 0.8rem; color: var(--muted); padding: 0.55em 1.1em; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
}
.orbit__pill em { font-style: normal; color: var(--accent-bright); }

/* ===========================================================
   TESTIMONIAL WALL — masonry columns (Tracle)
   =========================================================== */
.testi-wall { columns: 3; column-gap: 16px; }
.testi-wall .testi { break-inside: avoid; margin-bottom: 16px; display: inline-block; width: 100%; }
.testi-wall .testi p { font-size: 0.98rem; }

/* ===========================================================
   FAQ accordion (all refs)
   =========================================================== */
.faq { max-width: 860px; margin-inline: auto; display: flex; flex-direction: column; gap: 12px; }
.faq__item {
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
  overflow: hidden; transition: border-color 0.4s var(--ease), background 0.4s var(--ease);
}
.faq__item.open { border-color: oklch(0.72 0.12 var(--accent-h) / 0.35); background: var(--surface-2); }
.faq__q {
  width: 100%; text-align: left; cursor: pointer; border: 0; background: none;
  font-family: var(--font); color: var(--text); font-size: clamp(0.98rem, 1.5vw, 1.12rem);
  font-weight: 400; padding: clamp(20px, 2.4vw, 28px) clamp(22px,2.6vw,30px);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.faq__icon { position: relative; width: 18px; height: 18px; flex-shrink: 0; }
.faq__icon::before, .faq__icon::after {
  content: ""; position: absolute; background: var(--accent-bright); border-radius: 2px;
  transition: transform 0.4s var(--ease), opacity 0.4s var(--ease);
}
.faq__icon::before { left: 0; top: 50%; width: 100%; height: 2px; transform: translateY(-50%); }
.faq__icon::after  { top: 0; left: 50%; width: 2px; height: 100%; transform: translateX(-50%); }
.faq__item.open .faq__icon::after { transform: translateX(-50%) scaleY(0); opacity: 0; }
.faq__a { max-height: 0; overflow: hidden; transition: max-height 0.5s var(--ease); }
.faq__a p {
  color: var(--muted); font-size: 0.95rem; line-height: 1.6;
  padding: 0 clamp(22px,2.6vw,30px) clamp(22px,2.6vw,28px); max-width: 60ch;
}

/* ===========================================================
   WORDMARK footer (Tracle / Upmind)
   =========================================================== */
.wordmark {
  position: relative; overflow: hidden; padding-top: clamp(40px, 6vw, 80px);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%);
}
.wordmark span {
  display: block; text-align: center; font-weight: 700; line-height: 0.78;
  font-size: clamp(4rem, 21vw, 19rem); letter-spacing: -0.04em;
  color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,0.10);
  background: linear-gradient(180deg, rgba(255,255,255,0.10), transparent);
  -webkit-background-clip: text; background-clip: text;
  user-select: none;
}

/* ===========================================================
   TWEAKS panel
   =========================================================== */
#tweaks {
  position: fixed; right: 18px; bottom: 18px; z-index: 9500; width: 280px;
  background: rgba(16,16,18,0.86); backdrop-filter: blur(20px) saturate(1.3);
  border: 1px solid var(--line-strong); border-radius: 18px;
  padding: 18px; color: var(--text);
  box-shadow: 0 30px 80px -30px rgba(0,0,0,0.9);
  font-size: 0.85rem; display: none;
}
#tweaks.show { display: block; animation: twIn 0.4s var(--ease); }
@keyframes twIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
#tweaks .tw__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
#tweaks .tw__title { font-weight: 600; letter-spacing: 0.02em; }
#tweaks .tw__x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1.1rem; line-height: 1; }
#tweaks .tw__group { margin-bottom: 16px; }
#tweaks .tw__label { font-size: 0.66rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin-bottom: 9px; }
#tweaks .tw__swatches { display: flex; gap: 8px; }
#tweaks .sw {
  width: 30px; height: 30px; border-radius: 9px; cursor: pointer; border: 2px solid transparent;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
#tweaks .sw:hover { transform: scale(1.1); }
#tweaks .sw.active { border-color: var(--white); }
#tweaks .tw__row { display: flex; align-items: center; gap: 10px; }
#tweaks input[type=range] { flex: 1; accent-color: var(--accent-bright); }
#tweaks .tw__val { font-size: 0.74rem; color: var(--muted); width: 2.4em; text-align: right; }

/* ===========================================================
   Responsive
   =========================================================== */
@media (max-width: 980px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .b-wide, .b-tall, .b-reg, .b-half, .bento--feature { grid-column: span 2; grid-row: auto; }
  .bento--feature .bento__visual { min-height: 160px; }
  .testi-wall { columns: 2; }

  /* methodology → stacked, no pin */
  .method__inner { height: auto !important; }
  .method__pin { position: static; height: auto; display: block; padding: clamp(60px,9vw,90px) 0; }
  .method__grid { grid-template-columns: 1fr; }
  .method__desktop { display: none; }
  .method__mobile { display: flex; flex-direction: column; gap: 60px; }
  .method__mrow { display: grid; gap: 22px; }
  .method__mrow .method__stage { box-shadow: 0 30px 80px -50px rgba(0,0,0,0.9); }
  .method__mrow .method__frame { position: relative; opacity: 1; transform: none; }
}
@media (max-width: 620px) {
  .bento { grid-template-columns: 1fr; }
  .b-wide, .b-tall, .b-reg, .b-half, .bento--feature { grid-column: span 1; }
  .testi-wall { columns: 1; }
  .stats__lead { flex-direction: column; align-items: flex-start; }
}
