/* ==========================================================================
   FluvialTech — Home Technical Journey
   Port de design-lab/home/03-home-journey-prototype/journey.css
   Se carga SOLO en index.php (via $FT_HEAD_EXTRA).

   Todo está prefijado `ftj-` y anidado bajo `.ftj-shell` para no colisionar
   con Tailwind CDN ni con ft-theme.css. No hay reglas globales sobre
   html/body/a/h1/h2 fuera del shell.
   ========================================================================== */

.ftj-shell {
  --ftj-ink: #0f172a;
  --ftj-muted: #475569;
  --ftj-panel: #ffffff;
  --ftj-blue: #0ea5e9;
  --ftj-cyan: #0891b2;
  --ftj-amber: #c46a1a;
  --p: 0;

  position: relative;
  overflow: clip;
  color: var(--ftj-ink);
  line-height: 1.55;
  text-rendering: geometricPrecision;
  background:
    radial-gradient(circle at 18% 8%, rgba(196, 106, 26, .12), transparent 30rem),
    radial-gradient(circle at 86% 32%, rgba(14, 165, 233, .10), transparent 34rem),
    linear-gradient(90deg, rgba(100, 116, 139, .13) 1px, transparent 1px),
    linear-gradient(rgba(100, 116, 139, .10) 1px, transparent 1px),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 44%, #eef2f7 100%);
  background-size: auto, auto, 92px 92px, 92px 92px, auto;
}

.ftj-shell *,
.ftj-shell *::before,
.ftj-shell *::after { box-sizing: border-box; }

.ftj-shell a { color: inherit; text-decoration: none; }
.ftj-shell :focus-visible { outline: 2px solid var(--ftj-cyan); outline-offset: 4px; }

.ftj-shell h1,
.ftj-shell h2 {
  margin: 0;
  letter-spacing: -.06em;
  line-height: 1.08;
}

.ftj-eyebrow {
  margin: 0 0 1rem;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #c46a1a;
}

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

.ftj-hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  align-items: center;
  gap: clamp(2rem, 7vw, 6rem);
  padding: clamp(4rem, 9vw, 8rem) clamp(1rem, 7vw, 6rem) clamp(4rem, 7vw, 7rem);
  overflow: clip;
  isolation: isolate;
}

.ftj-hero-bg-sequence {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.ftj-hero-bg-state {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: ftj-hero-bg-cycle 24s linear infinite;
  will-change: opacity, transform;
}

.ftj-hero-bg-state:nth-child(1) { animation-delay: 0s; }
.ftj-hero-bg-state:nth-child(2) { animation-delay: 6s; }
.ftj-hero-bg-state:nth-child(3) { animation-delay: 12s; }
.ftj-hero-bg-state:nth-child(4) { animation-delay: 18s; }

.ftj-hero-bg-state img,
.ftj-hero-bg-state video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: right center;
  display: block;
  filter: saturate(.88) contrast(1.05) drop-shadow(0 24px 60px rgba(15, 23, 42, .18));
}

.ftj-hero-bg-video video {
  object-fit: cover;
  object-position: 70% center;
  /* Crop the lower edge of video-fea.mp4 where the generator watermark sits. */
  transform: translate3d(9%, 7%, 0) scale(1.14);
  opacity: .78;
  filter: saturate(.78) contrast(1.08) brightness(.88);
}

.ftj-hero-bg-fea img { transform: translate(22%, 4%) scale(.86); }
.ftj-hero-bg-tank img { transform: translate(17%, -1%) scale(.90); }
.ftj-hero-bg-pipe img { transform: translate(16%, 8%) scale(1.02); }

.ftj-hero-readability {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg,
      rgba(255, 255, 255, .98) 0%,
      rgba(255, 255, 255, .93) 38%,
      rgba(255, 255, 255, .74) 61%,
      rgba(255, 255, 255, .38) 100%),
    radial-gradient(ellipse at 86% 34%, rgba(14, 165, 233, .18), transparent 42%),
    radial-gradient(ellipse at 20% 84%, rgba(196, 106, 26, .13), transparent 40%);
}

.ftj-hero-technical-wash {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(100, 116, 139, .11) 1px, transparent 1px),
    linear-gradient(rgba(100, 116, 139, .08) 1px, transparent 1px);
  background-size: 92px 92px;
  opacity: .86;
  mix-blend-mode: multiply;
}

@keyframes ftj-hero-bg-cycle {
  0%, 1.5% { opacity: 0; transform: scale(1.025) translateY(8px); }
  4%, 23% { opacity: .58; transform: scale(1) translateY(0); }
  25%, 100% { opacity: 0; transform: scale(.992) translateY(-8px); }
}

.ftj-hero-orbit {
  position: absolute;
  width: min(76vw, 900px);
  aspect-ratio: 1;
  right: -22vw;
  top: 5vh;
  pointer-events: none;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(14, 165, 233, .16), transparent 45%),
    conic-gradient(from 210deg, transparent, rgba(34, 211, 238, .18), transparent, rgba(196, 106, 26, .14), transparent);
  opacity: .72;
  filter: blur(.2px);
  mask-image: radial-gradient(circle, transparent 0 38%, black 39% 42%, transparent 43% 100%);
  -webkit-mask-image: radial-gradient(circle, transparent 0 38%, black 39% 42%, transparent 43% 100%);
  z-index: 1;
}

.ftj-hero-copy { position: relative; z-index: 2; max-width: 860px; }
.ftj-hero-copy h1 { max-width: 18ch; font-size: clamp(2.2rem, 4.6vw, 4.4rem); }
.ftj-hero-lead {
  max-width: 44rem;
  margin-top: clamp(1rem, 2.2vw, 1.55rem);
  color: var(--ftj-muted);
  font-size: clamp(1.05rem, 1.65vw, 1.28rem);
  line-height: 1.62;
}
.ftj-hero-actions { display: flex; flex-wrap: wrap; gap: .85rem; margin-top: 2rem; }

.ftj-btn-primary,
.ftj-btn-secondary {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .85rem 1.4rem;
  border-radius: 999px;
  text-transform: uppercase;
  font-weight: 800;
  font-size: .78rem;
  letter-spacing: .1em;
  transition: opacity .2s ease;
}
.ftj-btn-primary { background: var(--ftj-amber); color: #ffffff; box-shadow: 0 18px 45px rgba(196, 106, 26, .18); }
.ftj-btn-secondary { border: 1px solid rgba(100, 116, 139, .28); color: rgba(15, 23, 42, .86); background: rgba(255, 255, 255, .66); }
.ftj-btn-primary:hover,
.ftj-btn-secondary:hover { opacity: .9; }

.ftj-hero-note {
  position: relative;
  z-index: 2;
  padding: 1.2rem;
  border-left: 1px solid rgba(14, 165, 233, .34);
  background: linear-gradient(90deg, rgba(255, 255, 255, .72), rgba(248, 250, 252, .18));
}
.ftj-hero-note span {
  display: block;
  font: 600 .68rem/1 "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ftj-muted);
}
.ftj-hero-note strong { display: block; margin-top: .7rem; font-size: clamp(1.3rem, 2.2vw, 1.9rem); letter-spacing: -.045em; line-height: 1.15; }
.ftj-hero-note p { margin: .4rem 0 0; color: var(--ftj-muted); font-size: .95rem; }

/* --------------------------------------------------------------------------
   Escenas con scroll (compartido)
   -------------------------------------------------------------------------- */

.ftj-scene {
  --p: 0;
  position: relative;
  min-height: 320vh;
  color: var(--ftj-ink);
}

.ftj-scene-fea {
  background:
    radial-gradient(ellipse at 67% 42%, rgba(255, 255, 255, .98) 0%, rgba(248, 250, 252, .88) 35%, rgba(226, 232, 240, .48) 62%, transparent 82%),
    radial-gradient(ellipse at 50% 72%, rgba(14, 165, 233, .08), transparent 48%);
}

.ftj-progress {
  position: sticky;
  top: 0;
  z-index: 35;
  height: 2px;
  background: rgba(100, 116, 139, .15);
}
.ftj-progress span {
  display: block;
  width: calc(var(--p) * 100%);
  height: 100%;
  background: linear-gradient(90deg, #c46a1a, #22d3ee);
}

.ftj-atmosphere { position: absolute; inset: 0; overflow: clip; pointer-events: none; }
.ftj-beam { position: absolute; display: block; filter: blur(28px); opacity: .55; }
.ftj-beam-a { width: 70vw; height: 22vh; top: 24%; left: -12%; background: linear-gradient(90deg, rgba(196, 106, 26, .12), transparent); transform: rotate(-12deg); }
.ftj-beam-b { width: 80vw; height: 26vh; top: 45%; right: -24%; background: linear-gradient(90deg, transparent, rgba(14, 165, 233, .14)); transform: rotate(9deg); }

.ftj-grid-plane {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 12%;
  height: 34vh;
  opacity: .34;
  background:
    linear-gradient(rgba(100, 116, 139, .22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100, 116, 139, .20) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: perspective(900px) rotateX(62deg) translateY(calc(var(--p) * -60px));
  transform-origin: bottom center;
  mask-image: linear-gradient(transparent, black 28%, transparent 90%);
  -webkit-mask-image: linear-gradient(transparent, black 28%, transparent 90%);
}

.ftj-sticky {
  position: sticky;
  top: 0;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(230px, .62fr) minmax(420px, 1.38fr);
  align-items: center;
  gap: clamp(1rem, 5vw, 4rem);
  padding: clamp(5rem, 8vw, 7rem) clamp(1rem, 5vw, 5rem);
}

.ftj-copy { position: relative; z-index: 5; max-width: 30rem; transform: translateY(calc(var(--p) * -18px)); }
.ftj-copy h2 {
  font-size: clamp(1.9rem, 3.65vw, 3.45rem);
  max-width: 14ch;
}
.ftj-copy p:not(.ftj-eyebrow) {
  margin-top: clamp(.9rem, 1.8vw, 1.25rem);
  color: var(--ftj-muted);
  font-size: 1rem;
  line-height: 1.65;
}
.ftj-copy .ftj-scene-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.6rem; }

.ftj-caption {
  position: absolute;
  z-index: 9;
  left: 7%;
  bottom: 6%;
  padding: .5rem .75rem;
  border-radius: 999px;
  color: rgba(15, 23, 42, .78);
  background: rgba(255, 255, 255, .58);
  border: 1px solid rgba(100, 116, 139, .18);
  backdrop-filter: blur(12px);
  font: 500 .68rem/1 "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.ftj-stages {
  position: absolute;
  z-index: 8;
  right: clamp(1rem, 5vw, 5rem);
  bottom: clamp(4rem, 9vh, 7rem);
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .55rem;
  max-width: 460px;
}

.ftj-pill {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 34px;
  padding: .45rem .65rem;
  border-radius: 999px;
  color: rgba(51, 65, 85, .72);
  background: rgba(255, 255, 255, .58);
  border: 1px solid rgba(100, 116, 139, .18);
  backdrop-filter: blur(14px);
  font-size: .78rem;
}
.ftj-pill em { font: 600 .64rem/1 "IBM Plex Mono", ui-monospace, monospace; color: #c46a1a; font-style: normal; }

/* --------------------------------------------------------------------------
   Escena 1 — FEA
   -------------------------------------------------------------------------- */

.ftj-fea-object {
  position: relative;
  z-index: 4;
  margin: 0;
  width: min(100%, 980px);
  aspect-ratio: 3 / 2;
  transform:
    translate3d(calc(var(--p) * -1.5%), calc(var(--p) * -2%), 0)
    scale(calc(.94 + var(--p) * .08));
  transform-origin: 50% 48%;
  filter: drop-shadow(0 36px 64px rgba(15, 23, 42, .24)) drop-shadow(0 0 90px rgba(14, 165, 233, .10));
}
.ftj-fea-object::before {
  content: "";
  position: absolute;
  inset: 5% 4% 2%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(ellipse at 52% 62%, rgba(14, 165, 233, .12), rgba(196, 106, 26, .08) 34%, transparent 68%);
  filter: blur(30px);
  transform: scale(1.06);
}

.ftj-fea-state,
.ftj-fea-state img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.ftj-fea-state img { object-fit: cover; }
.ftj-fea-state { z-index: 1; overflow: visible; }

.ftj-fea-base { opacity: .98; }
.ftj-fea-mesh { z-index: 2; opacity: clamp(0, calc((var(--p) - .18) / .22), 1); }
.ftj-fea-stress { z-index: 3; opacity: clamp(0, calc((var(--p) - .50) / .24), 1); }

.ftj-pill-base {
  color: #0f172a;
  border-color: rgba(14, 165, 233, .24);
  opacity: calc(1 - clamp(0, calc((var(--p) - .22) / .22), .45));
}
.ftj-pill-mesh {
  opacity: clamp(.44, calc((var(--p) - .18) / .22), 1);
  border-color: rgba(34, 211, 238, calc(.12 + clamp(0, calc((var(--p) - .20) / .28), .3)));
}
.ftj-pill-stress {
  opacity: clamp(.38, calc((var(--p) - .50) / .22), 1);
  border-color: rgba(196, 106, 26, calc(.12 + clamp(0, calc((var(--p) - .52) / .28), .36)));
}
.ftj-pill-critical {
  opacity: clamp(.34, calc((var(--p) - .70) / .2), 1);
  border-color: rgba(15, 23, 42, calc(.12 + clamp(0, calc((var(--p) - .72) / .2), .28)));
}

/* --------------------------------------------------------------------------
   Puente entre escenas
   -------------------------------------------------------------------------- */

.ftj-bridge {
  position: relative;
  min-height: 90svh;
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(260px, .62fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 6rem);
  padding: clamp(5rem, 8vw, 8rem) clamp(1rem, 7vw, 6rem);
  background:
    radial-gradient(circle at 72% 42%, rgba(14, 165, 233, .12), transparent 30rem),
    linear-gradient(180deg, rgba(248, 250, 252, 0), #eef6fb 48%, #f8fafc 100%);
}
.ftj-bridge-rail {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(transparent, rgba(14, 165, 233, .34), transparent);
  opacity: .6;
}
.ftj-bridge-copy { position: relative; z-index: 2; max-width: 820px; }
.ftj-bridge-copy h2 { max-width: 16ch; font-size: clamp(2rem, 4.4vw, 4.2rem); }
.ftj-bridge-copy p:not(.ftj-eyebrow) { color: var(--ftj-muted); max-width: 38rem; }

.ftj-next-card {
  position: relative;
  z-index: 2;
  min-height: 260px;
  display: grid;
  align-content: center;
  padding: 1.5rem;
  border-radius: 28px;
  background:
    radial-gradient(circle at 16% 22%, rgba(196, 106, 26, .11), transparent 36%),
    linear-gradient(135deg, rgba(255, 255, 255, .78), rgba(226, 232, 240, .32));
  border: 1px solid rgba(100, 116, 139, .30);
  box-shadow: 0 24px 80px rgba(15, 23, 42, .10);
}
.ftj-next-label {
  font: 600 .72rem/1 "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #c46a1a;
}
.ftj-next-card strong { display: block; margin-top: 1rem; font-size: clamp(1.4rem, 2.4vw, 2rem); letter-spacing: -.04em; line-height: 1.1; }
.ftj-next-card p { color: var(--ftj-muted); font-size: .95rem; }

/* --------------------------------------------------------------------------
   Escena 2 — Tanques API 650 / NCh2369
   -------------------------------------------------------------------------- */

.ftj-scene-tank {
  min-height: 340vh;
  background:
    radial-gradient(ellipse at 66% 44%, rgba(255, 255, 255, .98) 0%, rgba(248, 250, 252, .92) 36%, rgba(226, 232, 240, .50) 64%, transparent 84%),
    radial-gradient(ellipse at 38% 70%, rgba(14, 165, 233, .09), transparent 50%),
    radial-gradient(ellipse at 82% 20%, rgba(196, 106, 26, .08), transparent 42%);
}
.ftj-tank-sticky { grid-template-columns: minmax(250px, .58fr) minmax(520px, 1.42fr); }
.ftj-tank-copy h2 { max-width: 13ch; }
.ftj-tank-copy p:not(.ftj-eyebrow) { max-width: 32rem; }
.ftj-tank-grid {
  opacity: .30;
  transform: perspective(900px) rotateX(62deg) translateY(calc(var(--p) * -86px));
}

.ftj-tank-object {
  --ftj-tank-zoom: clamp(0, calc((var(--p) - .52) / .28), 1);
  position: relative;
  z-index: 4;
  margin: 0;
  width: min(100%, 1060px);
  aspect-ratio: 3 / 2;
  overflow: visible;
  transform:
    translate3d(calc(var(--p) * -1%), calc(var(--p) * -1.2%), 0)
    scale(calc(.94 + var(--p) * .06));
  transform-origin: 52% 50%;
  filter: drop-shadow(0 34px 58px rgba(15, 23, 42, .16));
}
.ftj-tank-object::before {
  content: "";
  position: absolute;
  inset: 8% 6% 7%;
  z-index: -1;
  border-radius: 44px;
  background: radial-gradient(ellipse at 58% 54%, rgba(14, 165, 233, .13), rgba(196, 106, 26, .08) 34%, transparent 72%);
  filter: blur(34px);
  transform: scale(1.04);
}
.ftj-tank-object::after {
  content: "";
  position: absolute;
  z-index: 5;
  left: 8%;
  right: 8%;
  top: calc(12% + clamp(0, calc((var(--p) - .06) / .34), 1) * 68%);
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(14, 165, 233, .88), rgba(196, 106, 26, .74), transparent);
  box-shadow: 0 0 18px rgba(14, 165, 233, .30);
  opacity: clamp(0, calc((var(--p) - .05) / .12), .78);
}

.ftj-tank-state,
.ftj-tank-state img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.ftj-tank-state {
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
  transform-origin: 58% 50%;
  will-change: opacity, transform;
}
.ftj-tank-state img {
  object-fit: cover;
  object-position: center center;
  filter: saturate(.96) contrast(1.02) brightness(1.01);
}

.ftj-tank-trace {
  z-index: 1;
  opacity: calc(1 - clamp(0, calc((var(--p) - .20) / .28), 1));
  transform: scale(calc(1 + var(--p) * .025));
}
.ftj-tank-api650 {
  z-index: 2;
  opacity: clamp(0, calc((var(--p) - .18) / .28), 1);
  transform:
    translate3d(calc(var(--ftj-tank-zoom) * -4.5%), calc(var(--ftj-tank-zoom) * -3.5%), 0)
    scale(calc(1 + var(--ftj-tank-zoom) * .20));
}
.ftj-tank-seismic {
  z-index: 3;
  opacity: clamp(0, calc((var(--p) - .70) / .18), 1);
  transform:
    translate3d(calc(var(--ftj-tank-zoom) * -4.5%), calc(var(--ftj-tank-zoom) * -3.5%), 0)
    scale(calc(1 + var(--ftj-tank-zoom) * .20));
}

.ftj-tank-caption { left: 8%; bottom: 7%; background: rgba(255, 255, 255, .72); }
.ftj-tank-stages { max-width: 620px; }
.ftj-tank-pill-1 { opacity: calc(1 - clamp(0, calc((var(--p) - .24) / .24), .42)); }
.ftj-tank-pill-2 { opacity: clamp(.42, calc((var(--p) - .20) / .24), 1); border-color: rgba(14, 165, 233, calc(.12 + clamp(0, calc((var(--p) - .24) / .25), .30))); }
.ftj-tank-pill-3 { opacity: clamp(.36, calc((var(--p) - .52) / .20), 1); border-color: rgba(15, 23, 42, calc(.12 + clamp(0, calc((var(--p) - .54) / .22), .30))); }
.ftj-tank-pill-4 { opacity: clamp(.30, calc((var(--p) - .70) / .20), 1); border-color: rgba(196, 106, 26, calc(.12 + clamp(0, calc((var(--p) - .72) / .22), .34))); }

/* --------------------------------------------------------------------------
   Escena 3 — Flexibilidad de cañerías
   -------------------------------------------------------------------------- */

.ftj-scene-flex {
  min-height: 340vh;
  background:
    radial-gradient(ellipse at 64% 46%, rgba(255, 255, 255, .98) 0%, rgba(248, 250, 252, .92) 36%, rgba(226, 232, 240, .50) 64%, transparent 84%),
    radial-gradient(ellipse at 40% 72%, rgba(14, 165, 233, .09), transparent 50%),
    radial-gradient(ellipse at 80% 18%, rgba(196, 106, 26, .08), transparent 42%);
}
.ftj-flex-sticky { grid-template-columns: minmax(250px, .56fr) minmax(540px, 1.44fr); }
.ftj-flex-copy h2 { max-width: 13ch; }
.ftj-flex-copy p:not(.ftj-eyebrow) { max-width: 32rem; }
.ftj-flex-grid {
  opacity: .28;
  transform: perspective(900px) rotateX(62deg) translateY(calc(var(--p) * -86px));
}

.ftj-flex-object {
  --ftj-flex-wipe: clamp(0, calc((var(--p) - .22) / .52), 1);
  position: relative;
  z-index: 4;
  margin: 0;
  width: min(100%, 1060px);
  aspect-ratio: 1376 / 707;
  transform:
    translate3d(calc(var(--p) * -1%), calc(var(--p) * -1.1%), 0)
    scale(calc(.94 + var(--p) * .06));
  transform-origin: 50% 52%;
  filter: drop-shadow(0 34px 58px rgba(15, 23, 42, .16));
}
.ftj-flex-object::before {
  content: "";
  position: absolute;
  inset: 10% 6% 8%;
  z-index: -1;
  border-radius: 44px;
  background: radial-gradient(ellipse at 55% 58%, rgba(14, 165, 233, .12), rgba(196, 106, 26, .07) 36%, transparent 72%);
  filter: blur(34px);
  transform: scale(1.03);
}

.ftj-flex-state,
.ftj-flex-state img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.ftj-flex-state {
  overflow: visible;
  background: transparent;
  will-change: opacity, mask-image, -webkit-mask-image;
}
.ftj-flex-state img { object-fit: contain; object-position: center center; }

.ftj-flex-base { z-index: 1; opacity: calc(.92 + clamp(0, calc((var(--p) - .10) / .25), .08)); }

/* Forma deformada oliva: se revela a lo largo de la línea (wipe izq -> der)
   más una rampa global de opacidad para que aparezca gradualmente. */
.ftj-flex-deform {
  z-index: 2;
  opacity: clamp(0, calc((var(--p) - .20) / .20), .96);
  -webkit-mask-image: linear-gradient(98deg,
    black 0%,
    black calc(var(--ftj-flex-wipe) * 118% - 16%),
    transparent calc(var(--ftj-flex-wipe) * 118% + 4%),
    transparent 130%);
  mask-image: linear-gradient(98deg,
    black 0%,
    black calc(var(--ftj-flex-wipe) * 118% - 16%),
    transparent calc(var(--ftj-flex-wipe) * 118% + 4%),
    transparent 130%);
}

.ftj-flex-caption { left: 8%; bottom: 7%; background: rgba(255, 255, 255, .72); }
.ftj-flex-stages { max-width: 560px; }
.ftj-flex-pill-1 { opacity: calc(1 - clamp(0, calc((var(--p) - .30) / .26), .34)); }
.ftj-flex-pill-2 {
  opacity: clamp(.40, calc((var(--p) - .24) / .24), 1);
  border-color: rgba(146, 146, 32, calc(.14 + clamp(0, calc((var(--p) - .28) / .26), .36)));
}

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

@media (max-width: 980px) {
  .ftj-hero,
  .ftj-sticky,
  .ftj-bridge,
  .ftj-tank-sticky,
  .ftj-flex-sticky { grid-template-columns: 1fr; }
  .ftj-hero-bg-state img,
  .ftj-hero-bg-state video { object-position: center bottom; }
  .ftj-hero-bg-video video {
    object-fit: cover;
    object-position: center center;
    transform: translate3d(0, 9%, 0) scale(1.18);
  }
  .ftj-hero-bg-fea img,
  .ftj-hero-bg-tank img,
  .ftj-hero-bg-pipe img { transform: translate(0, 18%) scale(.84); }
  .ftj-hero-readability {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, .98) 0%, rgba(255, 255, 255, .92) 56%, rgba(255, 255, 255, .70) 100%),
      radial-gradient(ellipse at 60% 74%, rgba(14, 165, 233, .14), transparent 44%);
  }
  .ftj-scene { min-height: 250vh; }
  .ftj-scene-tank,
  .ftj-scene-flex { min-height: 260vh; }
  .ftj-stages { position: relative; right: auto; bottom: auto; justify-content: flex-start; margin-top: -2rem; }
  .ftj-tank-object,
  .ftj-flex-object { width: min(100%, 880px); }
}

@media (max-width: 640px) {
  .ftj-hero-copy h1 { font-size: 2.1rem; line-height: 1.12; }
  .ftj-copy h2,
  .ftj-bridge-copy h2 { font-size: 1.9rem; line-height: 1.12; }
  .ftj-hero-note { display: none; }
  .ftj-scene,
  .ftj-scene-tank,
  .ftj-scene-flex { min-height: 220vh; }
  .ftj-sticky { padding-inline: 1rem; }
  .ftj-caption { display: none; }
  .ftj-btn-primary,
  .ftj-btn-secondary { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .ftj-shell *,
  .ftj-shell *::before,
  .ftj-shell *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .ftj-scene { --p: 1 !important; min-height: auto; }
  .ftj-hero-bg-state { animation: none !important; opacity: 0; transform: none; }
  .ftj-hero-bg-video { opacity: .50; }
  .ftj-sticky { position: relative; min-height: auto; }
  .ftj-fea-object,
  .ftj-tank-object,
  .ftj-flex-object { transform: none; }
  .ftj-flex-base { opacity: 1; }
  .ftj-flex-deform {
    opacity: 1;
    -webkit-mask-image: none;
    mask-image: none;
  }
}


/* ==========================================================================
   Sello de marca (esquina superior derecha del hero)
   Solo aparece dentro de #inicio. Grande: muestra solo una porción del
   engranaje. El mark (río FT) se posiciona al tamaño exacto del diámetro
   interior del gear (~43% del contenedor) para tocar el borde interno.
   ========================================================================== */
.ftj-brand-stamp {
  position: absolute;
  top: -22%;
  right: -22%;
  width: clamp(560px, 62vw, 820px);
  height: clamp(560px, 62vw, 820px);
  pointer-events: none;
  z-index: 3;
  opacity: 0.6;
  filter: drop-shadow(0 12px 36px rgba(15, 23, 42, .18));
  animation: ftj-brand-stamp__pulse 6s ease-in-out infinite;
  transform-origin: 50% 50%;
}
.ftj-brand-stamp__gear {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: ftj-brand-stamp__spin 15s linear infinite;
  will-change: transform;
}
/* mark (río FT) ocupa el diámetro interior del engranaje (~43% del wrap).
   object-fit: contain con width/height = 86% lo posiciona tocando el
   borde interior del gear sin salirse. */
.ftj-brand-stamp__mark {
  position: absolute;
  top: 7%;
  left: 7%;
  width: 86%;
  height: 86%;
  object-fit: contain;
  pointer-events: none;
}
@keyframes ftj-brand-stamp__spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes ftj-brand-stamp__pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.05); }
}
@media (prefers-reduced-motion: reduce) {
  .ftj-brand-stamp,
  .ftj-brand-stamp__gear { animation: none; }
}
