/* =============================================================
   05.4 OCEAN TRANSIT — cloud / aircraft / white content reveal
   =============================================================
   2026-11-02 V2 cloud re-layering:
     air(-2) < cloudshade(-1) < clouds(0) < cloudhaze(0, later in DOM)
       < white(1) < cloudreveal(1, later in DOM) < shadow(2) < plane(3)

   2026-11-11 brand pass:
     white(1) < cloudreveal(1) < brand(2, after shadow in DOM) < shadow(2) < plane(3)
     The white background moved to .tj-brand-veil (inside .tj-ocean-white);
     .tj-ocean-white is now a transparent transform/clip container. The
     network clone stays inside it, under the veil. The brand layer is a
     sibling of the white panel (does not inherit its transform), so the
     lockup stays centered while the white page is pulled by the aircraft.
     box-shadow stays on .tj-ocean-white (a child shadow would be clipped
     by the panel's overflow:hidden).

   The reveal curtain is the ONLY cloud layer above the white panel.
   It sits below the aircraft shadow/plane and contains cloud alpha only.
   No canvas / renderer / RAF is created here.
   ============================================================= */

.tj-ocean-reveal {
  position: absolute;
  inset: 0;
  z-index: 6;
  overflow: hidden;
  pointer-events: none;
  isolation: isolate;
}

.tj-ocean-reveal[hidden] { display: none; }

.tj-ocean-clouds {
  position: absolute;
  inset: 0;
  z-index: 0;
  /* Paint containment: without it, "canvas filter + full-bleed translucent clouds"
     can trigger a ~0.65s long task on the first 05.4 frame (Chromium has to
     re-rasterize the filtered backdrop). With it, ~0.10s in the P5 baseline. */
  contain: paint;
}
.tj-ocean-clouds[hidden] { display: none; }

/* ── 2026-11-02 V2: sea air / cloud shade / cloud haze ─────────────────────
   air and cloudshade are below the clouds (z negative): they grade the sea and
   the cargo ship, never the aircraft or white panel. cloudhaze is above clouds
   but still below white. The deep-violet air is calibrated against the target
   sea rgb(0.192,0.212,0.420); see SOLUTION §9. */
.tj-ocean-air {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(120% 90% at 22% 6%, rgba(150, 163, 205, 0.12) 0%, rgba(150, 163, 205, 0) 62%),
    linear-gradient(180deg, rgba(54, 44, 92, 0.18) 0%, rgba(46, 38, 82, 0.22) 100%);
  opacity: 0;
  pointer-events: none;
}
.tj-ocean-air[hidden] { display: none; }

.tj-ocean-cloudshade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(46% 30% at 18% 58%, rgba(22, 32, 64, 0.50) 0%, rgba(22, 32, 64, 0) 70%),
    radial-gradient(40% 26% at 36% 84%, rgba(22, 32, 64, 0.44) 0%, rgba(22, 32, 64, 0) 70%),
    radial-gradient(34% 24% at 66% 96%, rgba(22, 32, 64, 0.38) 0%, rgba(22, 32, 64, 0) 70%),
    radial-gradient(30% 22% at 8% 26%, rgba(22, 32, 64, 0.30) 0%, rgba(22, 32, 64, 0) 70%);
  opacity: 0;
  pointer-events: none;
}
.tj-ocean-cloudshade[hidden] { display: none; }

.tj-ocean-cloudhaze {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, rgba(158, 172, 214, 0.12) 0%, rgba(120, 132, 178, 0.08) 100%);
  opacity: 0;
  pointer-events: none;
}
.tj-ocean-cloudhaze[hidden] { display: none; }

/* Pure white content panel.  Its right edge is written by JS as
   translateX(seamPx − viewportWidth); the left part is always offscreen.
   Since 2026-11-11 the background lives on .tj-brand-veil (below); this
   element is only the transform/clip container for the network clone.
   The box-shadow stays here: a child shadow would be clipped by the
   panel's overflow:hidden (see home-trade-lane.css). */
.tj-ocean-white {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: transparent;
  transform-origin: 0 0;
  box-shadow: 16px 0 36px rgba(4, 16, 34, 0.14);
}
.tj-ocean-white[hidden] { display: none; }

/* Opaque white sheet that hides the network clone until the brand exits.
   It is the white field the aircraft pulls out; the brand layer is above
   it, the clone below it. `overflow:hidden` on .tj-ocean-white clips the
   clone to the pulled page. */
.tj-brand-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #ffffff;
  pointer-events: none;
  will-change: opacity;
}
.tj-brand-veil[hidden] { display: none; }

/* ── 2026-11-11 brand pass ───────────────────────────────────────────────
   The brand layer is a sibling of .tj-ocean-white and does not inherit its
   translate3d(seamPx − vw); the lockup is always centered in the viewport.
   z=2 + DOM after .tj-ocean-plane-shadow (same z) paints above the shadow;
   .tj-ocean-plane z=3 paints above the brand. */
.tj-brand {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  direction: ltr;
}
.tj-brand[hidden] { display: none; }
.tj-brand.is-visible { visibility: visible; opacity: 1; }
.tj-brand__lockup {
  width: var(--brand-w, 62vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.tj-brand__mark {
  display: block;
  width: 51.45%;
  height: auto;
  flex: none;
  overflow: visible;
}
.tj-brand__cn,
.tj-brand__en {
  margin: 0;
  color: #000;
  text-align: center;
  white-space: nowrap;
  font-variant-ligatures: none;
  text-rendering: geometricPrecision;
}
.tj-brand__cn {
  margin-top: calc(var(--brand-w, 62vw) * 0.039);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", sans-serif;
  font-size: calc(var(--brand-w, 62vw) * 0.0571);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0;
}
.tj-brand__en {
  margin-top: calc(var(--brand-w, 62vw) * 0.012);
  font-family: "DSR Inter", Inter, ui-sans-serif, system-ui, "Segoe UI", Arial, sans-serif;
  font-size: calc(var(--brand-w, 62vw) * 0.034);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: 0;
}
/* Only used if the 05.4 white/aircraft path is unavailable: the brand
   supplies its own white field so it never plays over clouds/ocean. */
.tj-brand.is-fallback::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #ffffff;
}

/* ── 2026-11-02 V2: white-reveal cloud edge ────────────────────────────────
   A narrow 20vw seam band, left edge at seam - 5vw (inside the white page) and
   fading right, so it does not create its own vertical edge. 06 is not mirrored:
   object-position left bottom puts the cloud body on the blue/right side. The
   wrapper is 0.95 opaque at the seam so the white page and the band match, then
   the background fades; the image is 0.35 so it reads as cloud-edge fog.
   z=1 after white, below the aircraft shadow (2) and plane (3). */
.tj-ocean-cloudreveal {
  position: absolute;
  left: 0;
  top: 0;
  /* 2026-11-02 V2: a narrow seam band, not a wide sliding cloud column.
     Left edge sits on the seam; the band fades to transparent on the blue side
     so it can never create its own visible right edge (the 46vw/radial attempt
     produced a vertical cut at x≈1607 in the real-site probe). */
  width: 20vw;
  height: 100%;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  contain: layout paint;
  background: linear-gradient(90deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 1) 25%, rgba(255, 255, 255, 0) 100%);
  /* 2026-11-02 V2.1 wing-shadow fix: the band's left 5vw sits inside the
     white page; keep 0-20% fully transparent so the cold fog / cloud image
     cannot paint a hard-edged rectangle on the white page. The 20-35% fade
     lands on the seam (25% of 20vw = 5vw). */
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, transparent 20%, #000 35%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, transparent 20%, #000 35%, transparent 100%);
}
.tj-ocean-cloudreveal[hidden] { display: none; }

/* Very light cold fog over the top half of the seam. Empty content only:
   the overlay block must never inject text (tests assert this). */
.tj-ocean-cloudreveal::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(225, 235, 248, 0.35) 0%, rgba(225, 235, 248, 0) 35%);
}

.tj-ocean-cloudreveal__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: left bottom;
  opacity: 0.35;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  image-rendering: auto;
}

.tj-ocean-plane-shadow {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  max-width: none;
  height: auto;
  transform-origin: 0 0;
  opacity: 0.15;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.tj-ocean-plane-shadow[hidden] { display: none; }

.tj-ocean-plane {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  max-width: none;
  height: auto;
  transform-origin: 0 0;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  image-rendering: auto;
}
.tj-ocean-plane[hidden] { display: none; }

/* Full-bleed V2 cloud layer. JS sets width/height/left/top/transform-origin on
   resize, then only transform/opacity per frame. Never width/height in the tick. */
.tj-ocean-cloud {
  position: absolute;
  left: 0;
  top: 0;
  max-width: none;
  height: auto;
  transform-origin: 50% 50%;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  image-rendering: auto;
}

/* Only the active 05.4 window gets compositor hints. Do NOT put will-change on
   7 cloud layers: the P5 baseline showed 21 will-change layers caused a ~0.65s
   first-frame long task. Cloud transforms are written every frame and Chromium
   still promotes them; leaving will-change off keeps entry cheap. */
.tj-ocean-reveal.is-active .tj-ocean-white,
.tj-ocean-reveal.is-active .tj-ocean-plane,
.tj-ocean-reveal.is-active .tj-ocean-plane-shadow,
.tj-ocean-reveal.is-active .tj-ocean-cloudreveal {
  will-change: transform, opacity;
}

/* New color layers only carry opacity; no per-frame filters. */
.tj-ocean-reveal.is-active .tj-ocean-air,
.tj-ocean-reveal.is-active .tj-ocean-cloudshade,
.tj-ocean-reveal.is-active .tj-ocean-cloudhaze {
  will-change: opacity;
}

/* Reduced motion: keep the composition/opacity, dampen scale/translate in JS. */
@media (prefers-reduced-motion: reduce) {
  .tj-ocean-reveal {
    --tj-motion-scale: 0.35;
  }
}
