/* ==========================================================================
   TEND — V14 "War panels, reimagined transitions"
   Replaces V13's torn-paper seams with four distinct scroll-driven reveals.
   Layered on top of styles.css + v12.css + v13.css (v13 tear rules are
   neutralized here; the tear DOM is removed in markup).
   ========================================================================== */

/* Kill any leftover torn-paper visuals from v13. */
.war-panel .wp-tear { display: none !important; }

/* Each panel is its own clip/transform stage. The reveal progress is written
   by the v14 driver as the inline `clip-path` / transform / opacity — these
   are just safe defaults so nothing is ever stuck hidden before JS runs. */
.war-panel {
  will-change: clip-path, transform;
}
.war-panel .wp-bg { will-change: transform; }

/* ---- ZOOM panel (gorilla): content fades/rises with the zoom-out.
   Driver sets --reveal (0..1); we map it to opacity + translate here so the
   text arrives as the background settles. Default visible for no-JS safety. */
.war-panel[data-trans="zoom"] .wp-content {
  opacity: 1;
  transform: none;
}
body.is-ready .war-panel[data-trans="zoom"] .wp-content {
  opacity: var(--reveal, 1);
  transform: translateY(calc((1 - var(--reveal, 1)) * 40px));
  transition: opacity .2s linear, transform .2s linear;
}

/* ---- Soft edge melt for the zoom panel only: the animal emerges from /
   dissolves into the dreamy sky instead of a hard cut. The clip panels
   (wipe/shutter/slash) keep crisp edges so their geometry reads clearly. */
.war-panel[data-trans="zoom"] {
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 14%, #000 86%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 14%, #000 86%, transparent 100%);
}

/* A whisper-thin accent rule at the very top of each panel — a deliberate
   seam that reads as design, not a torn scrap. */
.war-panel::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 6;
  background: linear-gradient(90deg, transparent, rgba(255,46,139,.65), rgba(255,255,255,.5), rgba(40,180,200,.65), transparent);
  opacity: .8;
}
.war-panel[data-trans="zoom"]::before { display: none; } /* masked edges don't want a seam */

@media (prefers-reduced-motion: reduce) {
  .war-panel { clip-path: none !important; }
  .war-panel .wp-bg { transform: none !important; }
  body.is-ready .war-panel[data-trans="zoom"] .wp-content { opacity: 1; transform: none; }
}

/* ---- Brands that trust us: a seamless auto-scrolling marquee (ready to
   grow — add new brands to BOTH duplicate sets in the markup). Pauses on
   hover. No backing box; lives open on the sky. ---- */
#trust-bar { padding-top: 40px; padding-bottom: 16px; }
#trust-bar .trust-wrap { display: block; }
#trust-bar .trust-lead { text-align: center; margin-bottom: 26px; }
.trust-marquee-wrap {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
}
.trust-marquee {
  display: flex;
  align-items: center;
  width: max-content;
  animation: trust-scroll 38s linear infinite;
}
/* Each set carries its own inter-brand gap AND a trailing gap (padding-right)
   so two sets tile perfectly: translateX(-50%) lands exactly on the seam —
   no dead space after the last brand. */
.trust-set {
  display: flex;
  align-items: center;
  gap: 64px;
  padding-right: 64px;
  flex: 0 0 auto;
}
.trust-marquee-wrap:hover .trust-marquee { animation-play-state: paused; }
@keyframes trust-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
#trust-bar .trust-logo {
  flex: 0 0 auto;
  font-size: clamp(17px, 1.7vw, 24px);
  opacity: .95;
  text-shadow: 0 2px 16px rgba(20,40,80,.28);
}
#trust-bar .trust-logo:hover { opacity: 1; }
#trust-bar .trust-logo.tl-mono { font-size: clamp(15px, 1.5vw, 21px); }
@media (prefers-reduced-motion: reduce) {
  .trust-marquee { animation: none; flex-wrap: wrap; justify-content: center; }
  .trust-set { flex-wrap: wrap; justify-content: center; }
}

/* ==========================================================================
   V14 · TEND IN ACTION — transformation pairs (input → TEND → output)
   Reuses the v2 tab driver (script.js) + .tia-* chrome from styles.css;
   this block restyles each screen as a left/right transformation.
   ========================================================================== */
#tend-in-action .tia-screen {
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: 1fr auto;
  gap: 0 28px;
  align-items: center;
  padding: 36px 48px 26px;
}
#tend-in-action .tx-side {
  display: grid;
  gap: 12px;
  justify-items: center;
  align-content: center;
  min-width: 0;
}
#tend-in-action .tx-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 1.8px;
  color: rgba(255,255,255,.6);
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.14);
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
}
#tend-in-action .tx-tag.out {
  color: #fff;
  background: rgba(25,144,255,.22);
  border-color: rgba(25,144,255,.5);
}
#tend-in-action .tx-cap {
  grid-column: 1 / -1;
  text-align: center;
  font-family: 'Inter Tight', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,.62);
  padding-top: 16px;
}

/* ---- center beam ---- */
#tend-in-action .tx-mid {
  display: grid;
  grid-auto-flow: column;
  align-items: center;
  gap: 10px;
}
#tend-in-action .tx-beam {
  width: clamp(20px, 4vw, 64px);
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55));
}
#tend-in-action .tx-beam:last-child {
  background: linear-gradient(90deg, rgba(25,144,255,.9), transparent);
  box-shadow: 0 0 10px rgba(25,144,255,.5);
}
#tend-in-action .tx-node {
  font-family: 'League Spartan', sans-serif;
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  width: 52px; height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(25,144,255,.28);
  border: 1.5px solid rgba(255,255,255,.5);
  box-shadow: 0 0 26px rgba(25,144,255,.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ---- shared card shell ---- */
#tend-in-action .tx-card { width: 100%; max-width: 380px; }

/* 01-in / 04-in · article */
.txc-article {
  background: #F5F1EA;
  border-radius: 14px;
  padding: 22px 24px;
  min-height: 320px;
  box-shadow: 0 18px 44px rgba(10,16,30,.4);
  position: relative;
}
.txc-article .txa-stripe {
  display: inline-block;
  background: #DA291C; color: #fff;
  font-family: 'Inter Tight', sans-serif; font-weight: 700;
  font-size: 10px; letter-spacing: 1.5px;
  padding: 4px 8px; border-radius: 3px;
  margin-bottom: 14px;
}
.txc-article .txa-kicker {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 2px;
  color: #8a8675; margin-bottom: 14px;
}
.txc-article .txa-h {
  font-family: 'PT Serif', Georgia, serif;
  font-weight: 700;
  font-size: 24px; line-height: 1.15;
  color: #1B1F2A;
  margin-bottom: 16px;
}
.txc-article .txa-l {
  height: 9px; border-radius: 4px;
  background: #d9d3c4;
  margin-bottom: 9px;
}
.txc-article .txa-l.short { width: 62%; }

/* 01-out · carousel */
.txc-carousel { display: grid; gap: 14px; justify-items: center; }
.txq-deck { position: relative; width: 250px; height: 312px; }
.txq-slide {
  position: absolute; inset: 0;
  border-radius: 14px;
}
.txq-slide.back2 { transform: translateX(22px) scale(.92); background: rgba(255,255,255,.14); }
.txq-slide.back1 { transform: translateX(11px) scale(.96); background: rgba(255,255,255,.26); }
.txq-slide.front {
  background: linear-gradient(160deg, #1B1F2A 0%, #2a3550 100%);
  box-shadow: 0 18px 44px rgba(10,16,30,.5);
  display: grid;
  align-content: space-between;
  padding: 18px;
}
.txq-slide.front .txq-k {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 1.5px;
  color: rgba(255,255,255,.5);
}
.txq-slide.front .txq-quote {
  font-family: 'League Spartan', sans-serif;
  font-weight: 700;
  font-size: 24px; line-height: 1.05;
  letter-spacing: -.01em;
  color: #fff;
}
.txq-slide.front .txq-brand {
  font-family: 'Inter Tight', sans-serif;
  font-size: 11px; font-weight: 600;
  color: #6FB6FF;
}
.txq-dots { display: flex; gap: 5px; }
.txq-dots i {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,.25);
}
.txq-dots i.on { background: #fff; }

/* 02-in · landscape video */
.txc-video { display: grid; gap: 10px; }
.txv-frame {
  aspect-ratio: 16/9;
  border-radius: 12px;
  background: linear-gradient(135deg, #0a1a3a 0%, #1c2a4a 60%, #3a2c20 100%);
  position: relative;
  box-shadow: 0 18px 44px rgba(10,16,30,.45);
}
.txv-frame::after {
  content: ""; position: absolute; inset: 0;
  border-radius: 12px;
  background: radial-gradient(circle at 65% 35%, rgba(255,255,255,.16), transparent 55%);
}
.txv-play {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 54px; height: 54px; border-radius: 50%;
  background: rgba(255,255,255,.16);
  border: 1.5px solid rgba(255,255,255,.55);
  backdrop-filter: blur(6px);
  z-index: 1;
}
.txv-play::after {
  content: ""; position: absolute; top: 50%; left: 50%;
  transform: translate(-38%, -50%);
  border-left: 14px solid #fff;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
}
.txv-dur {
  position: absolute; right: 10px; bottom: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; color: #fff;
  background: rgba(0,0,0,.65);
  padding: 3px 7px; border-radius: 5px;
  z-index: 1;
}
.txv-bar {
  position: relative;
  height: 5px; border-radius: 3px;
  background: rgba(255,255,255,.16);
}
.txv-bar i {
  position: absolute; top: -2px;
  width: 3px; height: 9px; border-radius: 2px;
  background: var(--accent-blue);
  box-shadow: 0 0 8px rgba(25,144,255,.7);
}
.txv-meta {
  font-family: 'Inter Tight', sans-serif;
  font-size: 13px; font-weight: 600;
  color: rgba(255,255,255,.85);
}

/* 02-out · vertical clip */
.txc-clip { display: grid; justify-items: center; }
.txc-clip-frame {
  width: 210px;
  aspect-ratio: 9/16;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(10,14,24,.0) 40%, rgba(10,14,24,.7) 100%),
    linear-gradient(135deg, #2d1438 0%, #6b1b3f 55%, #c45a2b 100%);
  position: relative;
  box-shadow: 0 18px 44px rgba(10,16,30,.5);
  overflow: hidden;
}
.txcl-hook {
  position: absolute; left: 16px; right: 16px; bottom: 56px;
  font-family: 'League Spartan', sans-serif;
  font-weight: 800;
  font-size: 19px; line-height: 1.02;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,.5);
}
.txcl-dur {
  position: absolute; top: 12px; right: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; color: #fff;
  background: rgba(0,0,0,.6);
  padding: 3px 7px; border-radius: 5px;
}
.txcl-captions {
  position: absolute; left: 16px; bottom: 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #0d1622;
  background: #FFFE2C;
  padding: 4px 8px;
}

/* 03-in · podcast */
.txc-podcast {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 16px;
  align-items: center;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  padding: 18px;
}
.txp-art {
  width: 96px; height: 96px; border-radius: 12px;
  background: linear-gradient(135deg, #1c1138 0%, #582d6f 100%);
  display: grid; place-items: center;
}
.txp-play {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.18);
  border: 1.5px solid rgba(255,255,255,.55);
  position: relative;
}
.txp-play::after {
  content: ""; position: absolute; top: 50%; left: 50%;
  transform: translate(-35%, -50%);
  border-left: 9px solid #fff;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}
.txp-t {
  font-family: 'Inter Tight', sans-serif;
  font-weight: 700; font-size: 16px;
  color: #fff; margin-bottom: 12px;
}
.txp-wave { display: flex; align-items: center; gap: 3px; height: 34px; }
.txp-wave i {
  width: 4px; border-radius: 2px;
  background: rgba(255,255,255,.45);
  height: 30%;
}
.txp-wave i:nth-child(3n)  { height: 75%; background: rgba(255,255,255,.7); }
.txp-wave i:nth-child(4n)  { height: 50%; }
.txp-wave i:nth-child(5n)  { height: 95%; background: #6FB6FF; }
.txp-wave i:nth-child(7n)  { height: 40%; }

/* 03-out · social post */
.txc-post {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 14px;
  padding: 18px 20px;
  backdrop-filter: blur(10px);
  display: grid; gap: 12px;
}
.txs-head {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Inter Tight', sans-serif;
  font-size: 13px; color: #fff;
}
.txs-av {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #6FB6FF, #1990FF);
  flex: none;
}
.txs-h { color: rgba(255,255,255,.5); font-size: 12px; }
.txs-body {
  font-family: 'Inter', sans-serif;
  font-size: 14px; line-height: 1.5;
  color: rgba(255,255,255,.88);
}
.txs-body b { color: #fff; }
.txs-row {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: .5px;
  color: rgba(255,255,255,.5);
  border-top: 1px solid rgba(255,255,255,.12);
  padding-top: 10px;
}

/* 04-out · narrated video */
.txc-narr { display: grid; gap: 10px; }
.txn-frame {
  aspect-ratio: 16/9;
  border-radius: 12px;
  background:
    radial-gradient(circle at 70% 25%, rgba(111,182,255,.25), transparent 55%),
    linear-gradient(150deg, #101727 0%, #1d2b45 100%);
  position: relative;
  box-shadow: 0 18px 44px rgba(10,16,30,.45);
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  overflow: hidden;
}
.txn-headline {
  font-family: 'League Spartan', sans-serif;
  font-weight: 800;
  font-size: 27px; line-height: .95;
  letter-spacing: -.01em;
  color: #fff;
}
.txn-cap {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; letter-spacing: 1.5px;
  color: rgba(255,255,255,.55);
  text-transform: uppercase;
}
.txn-badge {
  position: absolute; top: 10px; left: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; letter-spacing: 1.2px;
  color: #fff;
  background: rgba(25,144,255,.85);
  padding: 4px 8px; border-radius: 5px;
}

/* 05-in · the week's stack */
.txc-stack { display: grid; gap: 9px; }
.txk-chip {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
  padding: 13px 15px;
  font-family: 'Inter Tight', sans-serif;
  font-weight: 600; font-size: 13px;
  color: #fff;
}
.txk-chip .d { width: 18px; height: 18px; border-radius: 5px; flex: none; }
.txk-chip:nth-child(2) { transform: translateX(10px); }
.txk-chip:nth-child(3) { transform: translateX(20px); }
.txk-chip:nth-child(4) { transform: translateX(30px); }

/* 05-out · newsletter */
.txc-news {
  background: #F5F1EA;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 18px 44px rgba(10,16,30,.4);
}
.txn-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 14px 18px;
  font-family: 'League Spartan', sans-serif;
  font-weight: 800; font-size: 16px; letter-spacing: .04em;
  color: #1B1F2A;
  border-bottom: 2px solid #1B1F2A;
}
.txn-head span {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500; font-size: 9px; letter-spacing: 1px;
  color: #8a8675;
}
.txn-hero {
  height: 86px;
  background: linear-gradient(135deg, #4a5d7e 0%, #8d6c4e 100%);
}
.txn-story {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 18px;
  border-top: 1px solid #e2dccb;
}
.txn-story i {
  width: 34px; height: 34px; border-radius: 7px; flex: none;
  background: linear-gradient(135deg, #6b3a20, #1a0c0a);
}
.txn-story i.i2 { background: linear-gradient(135deg, #0a1a3a, #1c2a4a); }
.txn-story i.i3 { background: linear-gradient(135deg, #1c1138, #582d6f); }
.txn-story b {
  display: block;
  font-family: 'Inter Tight', sans-serif;
  font-weight: 700; font-size: 12px;
  color: #1B1F2A;
}
.txn-story small {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; color: #8a8675;
}

/* Responsive: stack the pair vertically on narrow screens */
@media (max-width: 900px) {
  #tend-in-action .tia-screen {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    gap: 18px;
    overflow-y: auto;
  }
  #tend-in-action .tx-mid { justify-content: center; transform: rotate(90deg); height: 40px; }
}
