/* =====================================================================
   AI Vision training hub and module pages.
   Loaded only by /training/ and /training/<module>/ (body.tx-page), so
   activity pages and the rest of the site never inherit it.
   Same glass vocabulary as the cube homepage (home.css): soft grey ground,
   frosted cards, one restrained red. 3D is CSS transforms only; motion is
   switched off under prefers-reduced-motion.
   ===================================================================== */

.tx-page {
  --tx-bg: #eef0f2;
  --tx-ink: #0d0d0f;
  --tx-muted: #55585e;
  --tx-soft: #7c8087;
  --tx-night: #0a0b0d;
  --tx-night-2: #15171c;
  --tx-glass: linear-gradient(145deg, rgba(255, 255, 255, .8), rgba(255, 255, 255, .46));
  --tx-glass-border: rgba(255, 255, 255, .95);
  --tx-glass-shadow: 0 24px 60px rgba(18, 22, 30, .08), inset 0 1px 0 rgba(255, 255, 255, .95);
  --tx-lift-shadow: 0 40px 80px rgba(18, 22, 30, .16), inset 0 1px 0 #fff;
  --tx-radius: 26px;
  --tx-mono: ui-monospace, "SFMono-Regular", "Cascadia Code", Consolas, monospace;
  background: var(--tx-bg);
  color: var(--tx-ink);
}

/* Frosted header, as on the homepage. */
.tx-page .site-header { background: transparent; }
.tx-page .site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(238, 240, 242, .7);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid rgba(255, 255, 255, .75);
}

.tx-page .site-main { overflow-x: clip; }

/* ------------------------------------------------------------ Shared */
.tx-orb {
  position: absolute;
  z-index: 0;
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
}
.tx-orb--red { width: min(62vw, 820px); right: -12%; top: -20%; background: radial-gradient(circle, rgba(226, 35, 26, .24), rgba(226, 35, 26, 0) 66%); }
.tx-orb--soft { width: min(60vw, 760px); left: -18%; bottom: -40%; background: radial-gradient(circle, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 64%); }
.tx-orb--red-low { width: min(56vw, 720px); left: -16%; top: 30%; background: radial-gradient(circle, rgba(226, 35, 26, .1), rgba(226, 35, 26, 0) 66%); }

.tx-section {
  position: relative;
  padding: clamp(4rem, 9vh, 7rem) 0;
}
.tx-section > .container { position: relative; z-index: 1; }

.tx-head { margin-bottom: clamp(2rem, 5vh, 3.2rem); }
.tx-head--row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
}
.tx-head--split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.2rem, 4vw, 3rem);
  align-items: end;
}

.tx-page .tx-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  margin: 0 0 1.2rem;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--tx-soft);
}
.tx-page .tx-eyebrow::before {
  content: "";
  flex: none;
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(226, 35, 26, .12);
}
.tx-page .tx-eyebrow--dark { color: rgba(255, 255, 255, .62); }
.lang-ar.tx-page .tx-eyebrow { letter-spacing: 0; font-size: .85rem; }

.tx-page .tx-title {
  font-size: clamp(2.7rem, 6.2vw, 5.4rem);
  font-weight: 800;
  line-height: .98;
  letter-spacing: -.05em;
  color: var(--tx-ink);
  max-width: 13ch;
}
.lang-ar.tx-page .tx-title { line-height: 1.3; letter-spacing: 0; max-width: 16ch; font-size: clamp(2.3rem, 5vw, 4.3rem); }
.tx-accent { color: var(--accent); }

.tx-page .tx-h2 {
  max-width: 20ch;
  font-size: clamp(2rem, 4.2vw, 3.3rem);
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: 1.04;
  color: var(--tx-ink);
}
.lang-ar.tx-page .tx-h2 { line-height: 1.35; letter-spacing: 0; }

.tx-lead {
  max-width: 52ch;
  margin-top: 1.4rem;
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  line-height: 1.65;
  color: var(--tx-muted);
}
.tx-copy {
  max-width: 56ch;
  font-size: clamp(1rem, 1.25vw, 1.08rem);
  line-height: 1.65;
  color: var(--tx-muted);
}

.tx-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .9rem;
  margin-top: 2.1rem;
}
.tx-page .tx-btn-glass {
  --btn-bg: rgba(255, 255, 255, .62);
  --btn-bd: rgba(13, 13, 15, .14);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.lang-ar .tx-arrow { display: inline-block; transform: scaleX(-1); }
.lang-ar .btn:hover .tx-arrow { transform: scaleX(-1) translateX(4px); }

.tx-icon { width: 1.25em; height: 1.25em; flex: none; }

.tx-chip {
  display: inline-flex;
  align-items: center;
  padding: .28rem .65rem;
  border-radius: 999px;
  background: var(--tx-ink);
  color: #fff;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

/* Activity kind pills */
.tx-kinds { display: flex; flex-wrap: wrap; gap: .45rem; }
.tx-kind {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .32rem .7rem .32rem .5rem;
  border-radius: 999px;
  background: rgba(13, 13, 15, .055);
  color: var(--tx-ink);
  font-size: .78rem;
  font-weight: 700;
}
.tx-kind .tx-icon { width: 1.05rem; height: 1.05rem; }
.tx-kind.tx-kind--game .tx-icon { color: var(--accent); }
.tx-kinds--dark .tx-kind { background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .86); }

/* Whole-card link: the title link stretches over its card. */
.tx-stretch { color: inherit; }
.tx-stretch::after { content: ""; position: absolute; inset: 0; z-index: 3; border-radius: inherit; }
.tx-stretch:focus-visible { outline: none; }
.tx-card:has(.tx-stretch:focus-visible),
.tx-step__card:has(.tx-stretch:focus-visible),
.tx-next__card:has(.tx-stretch:focus-visible) { outline: 2px solid var(--accent); outline-offset: 4px; }

/* Progress bar + ring (values set by training.js through --p, 0..1) */
.tx-prog { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.tx-prog__bar {
  display: none;
  width: 72px;
  height: 6px;
  border-radius: 99px;
  background: rgba(13, 13, 15, .1);
  overflow: hidden;
}
.tx-prog__bar i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: var(--accent); border-radius: inherit; transition: width .8s var(--ease-out); }
.tx-prog.is-started .tx-prog__bar { display: block; }
.tx-prog__label { font-size: .78rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; color: var(--tx-soft); }
.tx-prog.is-started .tx-prog__label { color: var(--tx-ink); }
.tx-prog.is-complete .tx-prog__label { color: var(--accent); }

.tx-ring {
  --size: 58px;
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--p, 0) * 1turn), rgba(13, 13, 15, .1) 0);
  font-size: .8rem;
  font-weight: 850;
  color: var(--tx-ink);
}
.tx-ring::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: #fff; }
.tx-ring > span { position: relative; }

/* ------------------------------------------------------------ Tilt cards */
.tx-tilt {
  --rx: 0deg;
  --ry: 0deg;
  --lift: 0px;
  position: relative;
  transform: perspective(1100px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(var(--lift));
  transition: transform .6s var(--ease-out), box-shadow .4s var(--ease);
  will-change: transform;
}
.tx-tilt.is-tilting { transition: transform .12s linear, box-shadow .4s var(--ease); }
.tx-tilt::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 55%);
  transition: opacity .4s var(--ease);
}
.tx-tilt:hover { --lift: -6px; }
.tx-tilt:hover::before { opacity: 1; }

/* ------------------------------------------------------------ Covers + scenes */
.tx-cover {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border-radius: 20px;
  container-type: inline-size;
  isolation: isolate;
}
.tx-tone--light {
  background:
    radial-gradient(circle at 84% 12%, rgba(226, 35, 26, .2), rgba(226, 35, 26, 0) 46%),
    linear-gradient(rgba(13, 13, 15, .045) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(90deg, rgba(13, 13, 15, .045) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(160deg, #fbfbfc, #e4e7ea);
  color: var(--tx-ink);
}
.tx-tone--dark {
  background:
    radial-gradient(circle at 80% 10%, rgba(226, 35, 26, .32), rgba(226, 35, 26, 0) 48%),
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(160deg, #1b1e24, #0b0c0f);
  color: #fff;
}
.tx-cover__icon {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(255, 255, 255, .95);
  color: var(--tx-ink);
  box-shadow: 0 8px 20px rgba(18, 22, 30, .1);
}
.tx-tone--dark .tx-cover__icon { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); color: #fff; box-shadow: none; }
.tx-flag {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  padding: .35rem .7rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  box-shadow: 0 8px 22px rgba(226, 35, 26, .35);
}

.tx-scene {
  position: absolute;
  inset: 0;
  direction: ltr;
  font-size: 13px;
  font-size: clamp(8px, 3.15cqw, 19px);
}
.tx-l {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%) translate3d(calc(var(--px, 0) * var(--d) * -.7px), calc(var(--py, 0) * var(--d) * -.7px), 0);
  transition: transform .5s var(--ease-out);
}
.tx-tilt.is-tilting .tx-l { transition: transform .12s linear; }
.tx-l > * { display: block; }
.tx-card:hover .tx-l:nth-child(2) > *,
.tx-hero-card .tx-l:nth-child(2) > * { animation: txFloat 4.5s ease-in-out infinite; }
@keyframes txFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-.45em); } }

.tx-pill {
  display: inline-flex !important;
  align-items: center;
  padding: .5em .95em;
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  border: 1px solid rgba(255, 255, 255, .95);
  color: var(--tx-ink);
  font-size: .8em;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 .6em 1.6em rgba(18, 22, 30, .14);
}
.tx-tone--dark .tx-pill { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .2); color: #fff; box-shadow: none; }
.tx-tone--light .tx-pill--red,
.tx-tone--dark .tx-pill--red { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 .6em 1.6em rgba(226, 35, 26, .35); }

/* tokens */
.tx-bubble {
  display: flex !important;
  gap: .18em;
  padding: .75em .85em;
  border-radius: 1em 1em 1em .25em;
  background: #fff;
  box-shadow: 0 1em 2.4em rgba(18, 22, 30, .14);
  white-space: nowrap;
}
.tx-tok {
  padding: .3em .35em;
  border-radius: .35em;
  background: rgba(13, 13, 15, .07);
  font-family: var(--tx-mono);
  font-size: 1.15em;
  font-weight: 700;
}
.tx-tok--b { background: rgba(226, 35, 26, .13); color: #b8160f; }
.tx-mini {
  width: 9.5em;
  padding: .7em .8em;
  border-radius: .7em;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 .8em 2em rgba(18, 22, 30, .12);
}
.tx-mini__bar { display: block; height: .5em; width: var(--w); margin-bottom: .4em; border-radius: 99px; background: #c9ccd1; }
.tx-mini__bar--red { background: var(--accent); }
.tx-mini__cap { display: block; font-size: .62em; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--tx-soft); }

/* network */
.tx-examples { display: flex !important; }
.tx-ex {
  display: grid;
  place-items: center;
  width: 2.8em;
  height: 2.8em;
  margin-right: -.6em;
  border-radius: .55em;
  background: #fff;
  box-shadow: 0 .6em 1.4em rgba(18, 22, 30, .14);
}
.tx-ex:nth-child(1) { transform: rotate(-9deg); }
.tx-ex:nth-child(3) { transform: rotate(8deg) translateY(.3em); }
.tx-shape { display: block; width: 1.2em; height: 1.2em; }
.tx-shape--circle { border-radius: 50%; border: .2em solid var(--accent); }
.tx-shape--tri { background: var(--tx-ink); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.tx-net { width: 13em; height: auto; overflow: visible; }
.tx-net__lines path { stroke: rgba(13, 13, 15, .22); stroke-width: 1.4; fill: none; }
.tx-net__hot { stroke: var(--accent); stroke-width: 2.6; fill: none; stroke-dasharray: 6 5; animation: txDash 1.6s linear infinite; }
.tx-net__nodes circle { fill: #fff; stroke: var(--tx-ink); stroke-width: 1.4; }
.tx-net__out { fill: var(--accent); }
@keyframes txDash { to { stroke-dashoffset: -22; } }

/* timeline */
.tx-line { position: relative; width: 21em; height: 2px; background: rgba(13, 13, 15, .28); }
.tx-yr {
  position: absolute;
  left: var(--at);
  top: 0;
  transform: translateX(-50%);
  padding-top: 1.1em;
  font-size: .82em;
  font-weight: 800;
  white-space: nowrap;
}
.tx-yr::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: .95em;
  height: .95em;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--tx-ink);
  transform: translate(-50%, -50%);
}
.tx-yr--red::before { background: var(--accent); border-color: var(--accent); }
.tx-yr--red { color: var(--accent); }
.tx-yr--gap::before { width: 1.5em; height: 1.5em; border: 2px dashed var(--accent); background: rgba(226, 35, 26, .08); }
.tx-drag {
  padding: .55em 1em;
  border-radius: .55em;
  background: #fff;
  border-top: .25em solid var(--accent);
  font-size: 1.15em;
  font-weight: 850;
  transform: rotate(-7deg);
  box-shadow: 0 1.2em 2.6em rgba(18, 22, 30, .2);
}

/* nightjar */
.tx-photo {
  position: relative;
  width: 12em;
  height: 8.6em;
  border-radius: .6em;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 62% 58%, rgba(226, 35, 26, .55), rgba(226, 35, 26, 0) 22%),
    radial-gradient(ellipse at 30% 75%, #3b4049, rgba(59, 64, 73, 0) 40%),
    linear-gradient(170deg, #4a515c, #1e2229 70%);
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: 0 1.2em 2.6em rgba(0, 0, 0, .5);
}
.tx-photo__corner,
.tx-photo__corner::after { position: absolute; width: 1.1em; height: 1.1em; border: 2px solid #fff; }
.tx-photo__corner { top: .5em; left: .5em; border-right: 0; border-bottom: 0; }
.tx-photo__corner::after { content: ""; top: 6.2em; left: 9.3em; border: 2px solid #fff; border-left: 0; border-top: 0; }
.tx-photo__cross { position: absolute; left: 62%; top: 58%; width: 2.6em; height: 2.6em; transform: translate(-50%, -50%); border: 2px solid var(--accent); border-radius: 50%; }
.tx-photo__cross::before,
.tx-photo__cross::after { content: ""; position: absolute; background: var(--accent); }
.tx-photo__cross::before { left: 50%; top: -.7em; bottom: -.7em; width: 2px; transform: translateX(-50%); }
.tx-photo__cross::after { top: 50%; left: -.7em; right: -.7em; height: 2px; transform: translateY(-50%); }
.tx-photo__cap { position: absolute; left: .6em; bottom: .45em; font-family: var(--tx-mono); font-size: .62em; color: rgba(255, 255, 255, .85); }
.tx-term {
  min-width: 13.5em;
  padding: .75em .95em;
  border-radius: .7em;
  background: rgba(8, 9, 11, .94);
  border: 1px solid rgba(255, 255, 255, .16);
  color: #d9dbe0;
  font-family: var(--tx-mono);
  font-size: .74em;
  box-shadow: 0 1.2em 2.8em rgba(0, 0, 0, .45);
}
.tx-term p { display: flex; align-items: baseline; gap: .4em; margin: 0; line-height: 1.75; white-space: nowrap; }
.tx-term b { color: var(--accent); }
.tx-term em { color: var(--accent); font-style: normal; font-weight: 800; }
.tx-dots { flex: 1; min-width: 1.5em; border-bottom: 1px dotted rgba(255, 255, 255, .35); }
.tx-caret { display: inline-block; width: .55em; height: 1em; background: #d9dbe0; vertical-align: middle; animation: txBlink 1.1s steps(1) infinite; }
@keyframes txBlink { 50% { opacity: 0; } }
.tx-term--wide { font-size: 1em; min-width: 0; }

/* lost device */
.tx-phone {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .6em;
  width: 6.6em;
  height: 12em;
  border-radius: 1.3em;
  border: .35em solid #2c3038;
  background: linear-gradient(180deg, #1a1d23, #101216);
  box-shadow: 0 1.4em 3em rgba(0, 0, 0, .55);
}
.tx-phone__lock { display: grid; place-items: center; width: 3em; height: 3em; border-radius: 50%; background: rgba(226, 35, 26, .16); color: var(--accent); }
.tx-phone__lock .tx-icon { width: 1.8em; height: 1.8em; }
.tx-phone__txt { font-size: .66em; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: rgba(255, 255, 255, .8); text-align: center; }
.tx-steps {
  display: grid !important;
  gap: .55em;
  margin: 0;
  padding: .9em 1em;
  list-style: none;
  border-radius: .8em;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.tx-steps li { display: flex; align-items: center; gap: .6em; font-size: .82em; font-weight: 700; white-space: nowrap; }
.tx-steps b { display: grid; place-items: center; width: 1.7em; height: 1.7em; border-radius: 50%; background: var(--accent); font-size: .85em; }

/* account alert */
.tx-mail {
  width: 15.5em;
  padding: 1em 1.05em;
  border-radius: .75em;
  background: #fff;
  color: var(--tx-ink);
  box-shadow: 0 1.4em 3em rgba(0, 0, 0, .45);
}
.tx-mail p { margin: 0; }
.tx-mail__sub { font-size: .95em; font-weight: 800; }
.tx-mail__from { margin-top: .2em !important; font-size: .7em; color: var(--tx-soft); }
.tx-mail__btn { display: inline-block; margin-top: .8em; padding: .45em .9em; border-radius: 999px; border: 2px dashed var(--accent); color: var(--accent); font-size: .72em; font-weight: 800; }
.tx-attach {
  display: inline-flex !important;
  align-items: center;
  gap: .45em;
  padding: .5em .85em;
  border-radius: .5em;
  background: #fff;
  color: var(--tx-ink);
  font-family: var(--tx-mono);
  font-size: .78em;
  white-space: nowrap;
  box-shadow: 0 1em 2.4em rgba(0, 0, 0, .4);
}
.tx-attach b { padding: .1em .25em; border-radius: .25em; background: rgba(226, 35, 26, .14); color: var(--accent); }
.tx-lens { position: relative; width: 4.2em; height: 4.2em; border-radius: 50%; border: .38em solid var(--accent); background: rgba(255, 255, 255, .08); }
.tx-lens::after { content: ""; position: absolute; right: -1.6em; bottom: -.9em; width: 1.9em; height: .45em; border-radius: 99px; background: var(--accent); transform: rotate(45deg); }

/* permissions */
.tx-perm { font-size: 1.45em; letter-spacing: .04em; }
.tx-perm span { padding: 0 .12em; border-radius: .2em; }
.tx-perm__o { background: rgba(226, 35, 26, .25); color: #ff8f88; }
.tx-perm__g { background: rgba(255, 255, 255, .12); color: #fff; }
.tx-perm__x { background: rgba(255, 255, 255, .05); color: rgba(255, 255, 255, .45); }
.tx-who { display: flex !important; gap: .5em; }
.tx-who span { padding: .45em .9em; border-radius: 999px; font-size: .86em; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.tx-who__o { background: var(--accent); }
.tx-who__g { background: rgba(255, 255, 255, .16); }
.tx-who__x { background: rgba(255, 255, 255, .06); color: rgba(255, 255, 255, .6); }
.lang-ar .tx-who, .lang-ar .tx-steps, .lang-ar .tx-mail { direction: rtl; }

.tx-monogram { font-size: 7em; font-weight: 900; line-height: 1; opacity: .9; }

/* ===================================================== HUB: hero + cube */
.tx-hero {
  position: relative;
  padding: clamp(3rem, 8vh, 6rem) 0 clamp(3.5rem, 8vh, 6rem);
  overflow: clip;
}
.tx-hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}

.tx-stats {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  margin: 2.3rem 0 0;
  padding: 0;
  list-style: none;
}
.tx-stats li {
  display: flex;
  flex-direction: column;
  min-width: 108px;
  padding: .85rem 1.1rem;
  border-radius: 18px;
  background: var(--tx-glass);
  border: 1px solid var(--tx-glass-border);
  box-shadow: var(--tx-glass-shadow);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--tx-soft);
}
.tx-stats b { font-size: 1.6rem; letter-spacing: -.03em; line-height: 1.15; text-transform: none; color: var(--tx-ink); }
.lang-ar .tx-stats li { letter-spacing: 0; font-size: .85rem; }

.tx-resume {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .9rem 1.1rem;
  max-width: 560px;
  margin-top: 1.6rem;
  padding: .9rem 1rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, .86);
  border: 1px solid #fff;
  box-shadow: var(--tx-lift-shadow);
  animation: txRise .7s var(--ease-out) both;
}
.tx-resume[hidden] { display: none; }
.tx-resume .tx-ring { --size: 52px; font-size: .74rem; }
.tx-resume__copy p { margin: 0; }
.tx-resume__label { font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.tx-resume__title { font-weight: 800; line-height: 1.3; }
.tx-resume__btn { min-height: 46px; padding: .6rem 1.2rem; }
.tx-resume__reset {
  grid-column: 2 / -1;
  justify-self: end;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: .78rem;
  color: var(--tx-soft);
  text-decoration: underline;
  cursor: pointer;
}
@keyframes txRise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Hero TV: green phosphor CRT, one channel per module (training.js).
   No casing: just the curved glass and a small remote underneath.
   Font: JetBrains Mono, same file Operation Nightjar ships (OFL). */
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/training/fonts/jetbrains-mono.woff") format("woff");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

.tx-tv { position: relative; min-width: 0; }
.tx-tv__glow {
  position: absolute;
  inset: -14% -10% -6%;
  z-index: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 44%, rgba(57, 255, 122, .2), rgba(226, 35, 26, .12) 46%, rgba(226, 35, 26, 0) 68%);
  filter: blur(14px);
  pointer-events: none;
  transition: opacity .8s var(--ease);
}
.tx-tv.is-off .tx-tv__glow { opacity: .35; }

.tx-tv__screen {
  --ph: #4dff8a;
  --ph-dim: #2fae5f;
  --ph-soft: #bff5cf;
  position: relative;
  z-index: 1;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 6% / 8%;
  background: #010402;
  box-shadow: 0 44px 90px rgba(6, 20, 12, .34), 0 0 0 1px rgba(0, 0, 0, .7);
  container-type: inline-size;
  color: var(--ph);
  font-family: "JetBrains Mono", var(--tx-mono);
  direction: ltr;
  text-align: left;
  outline: none;
}
.tx-tv__screen:focus-visible { box-shadow: 0 44px 90px rgba(6, 20, 12, .34), 0 0 0 3px var(--accent); }
.tx-tv .ar { font-family: "Noto Kufi Arabic", "JetBrains Mono", var(--tx-mono); }

.tx-tv__tube {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 42%, #0c2c17, #03110a 68%, #010603);
  transform-origin: 50% 50%;
  animation: txFlicker 6s steps(1) infinite;
}
@keyframes txFlicker { 0%, 100% { opacity: 1; } 31% { opacity: .96; } 32% { opacity: 1; } 77% { opacity: .975; } 78% { opacity: 1; } }
.tx-tv__tube::before,
.tx-tv__tube::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}
.tx-tv__tube::before { background: repeating-linear-gradient(180deg, rgba(0, 0, 0, .3) 0 1px, rgba(0, 0, 0, 0) 1px 3px); }
.tx-tv__tube::after {
  background: linear-gradient(180deg, rgba(77, 255, 138, 0), rgba(77, 255, 138, .06) 50%, rgba(77, 255, 138, 0)) 0 -30% / 100% 26% no-repeat;
  box-shadow: inset 0 0 14cqw rgba(0, 0, 0, .9);
  animation: txRoll 6.5s linear infinite;
}
@keyframes txRoll { to { background-position: 0 130%; } }
.tx-tv__glass {
  position: absolute;
  inset: 0;
  z-index: 6;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(ellipse 70% 45% at 28% 8%, rgba(255, 255, 255, .11), rgba(255, 255, 255, 0) 70%);
  box-shadow: inset 0 0 0 1px rgba(77, 255, 138, .08), inset 0 0 4cqw rgba(0, 0, 0, .5);
}

/* Channel */
.tx-tv__channel {
  position: absolute;
  inset: 0;
  z-index: 1;
  font-size: 13px;
  font-size: clamp(8.5px, 2.1cqw, 14px);
}
.tx-ch__pic { position: absolute; inset: 0; overflow: hidden; }
.tx-ch__pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.35) brightness(.8);
  transform: scale(1.04);
}
/* Light pages become dark screens with glowing lines. */
.tx-ch__pic img.is-light { filter: grayscale(1) invert(1) contrast(1.3) brightness(.62); }
.tx-ch__pic::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #3dff80;
  mix-blend-mode: multiply;
}
.tx-ch__pic::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(2, 9, 5, .92) 0%, rgba(2, 9, 5, .62) 24%, rgba(2, 9, 5, .12) 40%, rgba(2, 9, 5, .2) 48%, rgba(2, 9, 5, .9) 64%, rgba(2, 9, 5, .97));
}
/* Bespoke game emblems keep their mint light and charcoal detail. */
.tx-ch__pic--artwork img { filter: none; transform: none; }
.tx-ch__pic--artwork::after { content: none; }
.tx-ch__pic--artwork::before {
  background: linear-gradient(180deg, rgba(1, 4, 2, .2), transparent 18%, transparent 52%, rgba(1, 4, 2, .5) 68%, rgba(1, 4, 2, .9));
}
.tx-ch__glyph { position: absolute; left: 50%; top: 42%; width: 22%; transform: translate(-50%, -50%); color: var(--ph); opacity: .55; }
.tx-ch__glyph .tx-icon { width: 100%; height: auto; }

.tx-ch__osd,
.tx-ch__top,
.tx-ch__info { position: absolute; z-index: 2; left: 6%; right: 6%; }
.tx-ch__osd {
  top: 5.5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.6em;
  font-weight: 700;
  text-shadow: 0 0 .45em rgba(77, 255, 138, .8);
}
.tx-ch__num { letter-spacing: .06em; }
.tx-ch__tag {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  padding: .3em .7em;
  border: 1px solid rgba(77, 255, 138, .6);
  border-radius: .3em;
  font-size: .5em;
  letter-spacing: .16em;
}
.tx-ch__tag i { width: .7em; height: .7em; border-radius: 50%; background: #ff4f45; box-shadow: 0 0 .7em #ff4f45; animation: txBlink 1.4s steps(1) infinite; }
.tx-ch__top { top: 17%; }
.tx-ch__cmd,
.tx-ch__tease { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-ch__cmd { color: #dcffe6; font-weight: 700; text-shadow: 0 0 .5em rgba(77, 255, 138, .6); }
.tx-ch__prompt { color: var(--ph); }
.tx-ch__tease { margin-top: .25em; color: var(--ph-dim); }
.tx-ch__info { bottom: 6.5%; }
.tx-ch__info p { margin: 0; }
.tx-ch__track { font-size: .78em; letter-spacing: .2em; text-transform: uppercase; color: var(--ph-dim); }
.tx-ch__title {
  margin: .15em 0 .25em !important;
  color: #ebfff0;
  font-size: 2.35em;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.01em;
  text-shadow: 0 0 .35em rgba(77, 255, 138, .75);
}
.tx-ch__meta { font-size: .88em; color: var(--ph); }
.tx-ch__info--artwork .tx-ch__title {
  font-family: "Inter", "Noto Kufi Arabic", sans-serif;
  letter-spacing: -.035em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .7);
}
.lang-ar .tx-ch__info--artwork .tx-ch__title { letter-spacing: 0; }
.tx-ch__brief {
  margin-top: .55em !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--ph-soft);
  font-size: .92em;
  line-height: 1.5;
}
.tx-ch__row { display: flex; flex-wrap: wrap; align-items: center; gap: .6em 1.3em; margin-top: 1em; }
.tx-ch__play {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  padding: .5em .95em;
  border-radius: .3em;
  background: var(--ph);
  color: #021006;
  font-weight: 700;
  box-shadow: 0 0 1.3em rgba(77, 255, 138, .55);
  transition: background .2s var(--ease), box-shadow .2s var(--ease);
}
.tx-ch__play:hover,
.tx-ch__play:focus-visible { background: #fff; box-shadow: 0 0 1.8em rgba(77, 255, 138, .8); outline: none; }
.tx-ch__key { opacity: .7; }
.tx-meter { font-size: .86em; color: var(--ph); text-shadow: 0 0 .4em rgba(77, 255, 138, .5); }
.tx-meter.is-complete { color: #fff; }
.lang-ar .tx-ch__info { direction: rtl; text-align: right; }
.lang-ar .tx-ch__track { letter-spacing: 0; }
.lang-ar .tx-ch__title { line-height: 1.35; }

/* Small screens: drop the fine print, enlarge the rest. */
@container (max-width: 480px) {
  .tx-tv__channel { font-size: 3.1cqw; }
  .tx-ch__tease,
  .tx-ch__brief { display: none; }
  .tx-ch__title { font-size: 2.2em; }
  .lang-ar .tx-ch__pic--artwork img { height: 84%; object-fit: contain; }
  .lang-ar .tx-ch__info--artwork .tx-ch__title { font-size: 1.7em; line-height: 1.5; }
}

/* Typing */
.tx-ch__cursor { display: inline-block; width: .6em; height: 1.05em; margin-left: .1em; vertical-align: -.18em; background: #dcffe6; box-shadow: 0 0 .5em rgba(77, 255, 138, .8); animation: txBlink 1s steps(1) infinite; }
.tx-tv .is-pending { visibility: hidden; }
.tx-tv .is-shown { animation: txBloom .35s var(--ease-out) both; }
@keyframes txBloom { from { opacity: 0; filter: brightness(2.4) blur(1px); } to { opacity: 1; filter: none; } }

/* Boot screen, static, power flash */
.tx-tv__boot {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-content: center;
  gap: .6em;
  background: radial-gradient(ellipse at 50% 45%, #0b2815, #020a05 70%);
  color: var(--ph);
  font-size: clamp(10px, 2.5cqw, 17px);
  font-weight: 700;
  letter-spacing: .2em;
  text-align: center;
  text-shadow: 0 0 .5em rgba(77, 255, 138, .8);
  opacity: 0;
  visibility: hidden;
}
.tx-tv__boot p { margin: 0; }
.tx-tv__boot p + p { color: var(--ph-dim); font-size: .75em; }
.tx-tv.is-booting .tx-tv__boot { opacity: 1; visibility: visible; }
.tx-tv__dots { display: inline-block; width: 3ch; text-align: left; animation: txDots 1s steps(4) infinite; overflow: hidden; vertical-align: bottom; }
@keyframes txDots { from { width: 0; } to { width: 4ch; } }

.tx-tv__static {
  position: absolute;
  inset: -40%;
  z-index: 3;
  opacity: 0;
  visibility: hidden;
  background: #020a05 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='.25 0 0 0 0 1 0 0 0 0 .5 0 0 0 0 0 0 0 0 1'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E") 0 0 / 220px 220px;
}
.tx-tv.is-tuning .tx-tv__static { opacity: .92; visibility: visible; animation: txStatic .24s steps(4) infinite; }
.tx-tv.is-tuning .tx-tv__channel { transform: translateX(-1.5%) skewX(-2deg); filter: brightness(1.6); }
@keyframes txStatic {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-7%, 5%); }
  50% { transform: translate(6%, -6%); }
  75% { transform: translate(-4%, 7%); }
  100% { transform: translate(5%, 2%); }
}
.tx-tv__flash {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse at 50% 50%, #f2fff5, rgba(77, 255, 138, .6) 35%, rgba(77, 255, 138, 0) 72%);
}

/* Power: the picture opens from a line, and collapses back to a dot. */
.tx-tv.is-off .tx-tv__tube { transform: scale(0, .004); opacity: 0; animation: none; }
.tx-tv.is-powering-on .tx-tv__tube { animation: txOn 1s cubic-bezier(.2, .8, .2, 1) both; }
.tx-tv.is-powering-on .tx-tv__flash { animation: txFlash 1s ease-out both; }
.tx-tv.is-powering-off .tx-tv__tube { animation: txOff .55s ease-in both; }
.tx-tv__dot {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  width: 2.2cqw;
  height: 2.2cqw;
  margin: -1.1cqw 0 0 -1.1cqw;
  border-radius: 50%;
  background: #f2fff5;
  box-shadow: 0 0 2cqw 1cqw rgba(77, 255, 138, .8);
  opacity: 0;
  pointer-events: none;
}
.tx-tv.is-powering-off .tx-tv__dot { animation: txDot 1.5s .42s ease-out both; }
@keyframes txOn {
  0% { transform: scale(0, .004); opacity: 1; filter: brightness(8); }
  28% { transform: scale(1, .006); filter: brightness(6); }
  55% { transform: scale(1, 1); filter: brightness(2.4); }
  100% { transform: none; filter: none; }
}
@keyframes txOff {
  0% { transform: none; opacity: 1; filter: none; }
  45% { transform: scale(1, .006); filter: brightness(5); }
  80% { transform: scale(0, .004); opacity: 1; filter: brightness(8); }
  100% { transform: scale(0, .004); opacity: 0; }
}
@keyframes txFlash { 0%, 20% { opacity: 0; } 45% { opacity: .65; } 100% { opacity: 0; } }
@keyframes txDot { 0% { opacity: 1; transform: scale(1.2); } 100% { opacity: 0; transform: scale(.2); } }

/* Remote */
.tx-remote {
  position: relative;
  direction: ltr;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin-top: 1.4rem;
  font-family: "JetBrains Mono", var(--tx-mono);
}
.tx-remote button {
  border: 1px solid #fff;
  background: rgba(255, 255, 255, .75);
  color: var(--tx-ink);
  font: inherit;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(18, 22, 30, .08);
  transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.tx-remote button:hover { background: #fff; transform: translateY(-1px); }
.tx-remote button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tx-remote__power {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  color: var(--accent) !important;
}
.tx-remote__power svg { width: 18px; height: 18px; }
.tx-remote__power[aria-pressed="false"] { background: var(--accent) !important; color: #fff !important; animation: txPulseBtn 1.8s var(--ease) infinite; }
@keyframes txPulseBtn { 0%, 100% { box-shadow: 0 0 0 0 rgba(226, 35, 26, .45); } 50% { box-shadow: 0 0 0 8px rgba(226, 35, 26, 0); } }
.tx-remote__step { height: 42px; padding: 0 1rem; border-radius: 999px; }
.tx-remote__chs {
  display: flex;
  gap: .25rem;
  padding: .25rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .5);
  border: 1px solid #fff;
}
.tx-remote .tx-remote__ch {
  position: relative;
  width: 34px;
  height: 34px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  color: var(--tx-muted);
}
.tx-remote .tx-remote__ch.is-active { background: var(--tx-ink); color: #fff; }
.tx-remote__timer { position: absolute; left: 0; bottom: 0; width: 0; height: 3px; background: var(--accent); }
.tx-remote__ch.is-active.is-timing .tx-remote__timer { animation: txTimer var(--tx-hold, 7s) linear forwards; }
@keyframes txTimer { to { width: 100%; } }

/* ===================================================== HUB: how it works */
.tx-how { padding-bottom: clamp(2rem, 5vh, 3.5rem); }
.tx-how__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tx-how__item {
  position: relative;
  padding: 1.6rem 1.5rem 1.7rem;
  border-radius: var(--tx-radius);
  background: var(--tx-glass);
  border: 1px solid var(--tx-glass-border);
  box-shadow: var(--tx-glass-shadow);
}
.tx-how__icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 1.3rem;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(18, 22, 30, .08);
  transform: perspective(300px) rotateX(12deg) rotateY(-14deg);
}
.tx-how__icon .tx-icon { width: 1.5rem; height: 1.5rem; }
.tx-how__icon.tx-kind--game { background: var(--accent); color: #fff; }
.tx-how__icon.tx-kind--practice { background: var(--tx-ink); color: #fff; }
.tx-how__icon.tx-kind--quiz { color: var(--accent); }
.tx-how__num {
  position: absolute;
  top: 1.4rem;
  right: 1.5rem;
  font-size: 2.4rem;
  font-weight: 900;
  letter-spacing: -.05em;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(13, 13, 15, .16);
}
.lang-ar .tx-how__num { right: auto; left: 1.5rem; }
.tx-how__item h3 { font-size: 1.2rem; letter-spacing: -.02em; }
.tx-how__item p { margin-top: .45rem; color: var(--tx-muted); font-size: .96rem; line-height: 1.55; }

/* ===================================================== HUB: paths + cards */
.tx-paths { padding-top: clamp(3rem, 7vh, 5rem); overflow-x: clip; }
.tx-track + .tx-track { margin-top: clamp(3.5rem, 8vh, 5.5rem); }
.tx-track__head {
  display: grid;
  grid-template-columns: auto minmax(0, .9fr) minmax(0, 1fr);
  grid-template-areas: "icon titles copy" "icon titles facts";
  gap: .4rem clamp(1rem, 3vw, 2.2rem);
  align-items: center;
  padding-bottom: 1.6rem;
  border-bottom: 1px solid rgba(13, 13, 15, .1);
}
.tx-track__icon {
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 22px;
  box-shadow: 0 18px 40px rgba(18, 22, 30, .14);
  transform: perspective(400px) rotateX(10deg) rotateY(-16deg);
}
.tx-track__icon.tx-tone--light { background: #fff; }
.tx-track__icon.tx-tone--dark { background: linear-gradient(145deg, #23262d, #0e1013); }
.tx-track__icon .tx-icon { width: 2rem; height: 2rem; color: var(--accent); }
.tx-tone--dark.tx-track__icon .tx-icon { color: #ff6b62; }
.tx-track__titles { grid-area: titles; }
.tx-track__titles .tx-eyebrow { margin-bottom: .5rem; }
.tx-page .tx-track__title { font-size: clamp(1.9rem, 3.6vw, 2.8rem); font-weight: 800; letter-spacing: -.045em; line-height: 1.05; }
.lang-ar.tx-page .tx-track__title { letter-spacing: 0; line-height: 1.35; }
.tx-track__head .tx-copy { grid-area: copy; }
.tx-track__facts {
  grid-area: facts;
  display: flex;
  gap: .5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tx-track__facts li { padding: .3rem .75rem; border-radius: 999px; background: rgba(255, 255, 255, .7); border: 1px solid #fff; font-size: .78rem; font-weight: 750; color: var(--tx-muted); }

.tx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  gap: 1.3rem;
  margin-top: 1.8rem;
}
.tx-card-wrap { display: flex; }
.tx-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: .65rem;
  border-radius: var(--tx-radius);
  background: var(--tx-glass);
  border: 1px solid var(--tx-glass-border);
  box-shadow: var(--tx-glass-shadow);
}
.tx-card:hover { box-shadow: var(--tx-lift-shadow); }
.tx-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: .75rem;
  padding: 1.15rem .9rem .8rem;
}
.tx-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem;
  font-size: .78rem;
  font-weight: 750;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--tx-soft);
}
.tx-page .tx-card__title { font-size: clamp(1.4rem, 2.2vw, 1.7rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.1; }
.lang-ar.tx-page .tx-card__title { letter-spacing: 0; line-height: 1.4; }
.tx-card__desc { color: var(--tx-muted); font-size: .97rem; line-height: 1.55; }
.tx-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
  padding-top: .9rem;
  border-top: 1px solid rgba(13, 13, 15, .08);
}
.tx-go {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  flex: none;
  padding: .55rem 1rem;
  border-radius: 999px;
  background: var(--tx-ink);
  color: #fff;
  font-size: .88rem;
  font-weight: 750;
  transition: background .25s var(--ease), transform .25s var(--ease);
}
.tx-card:hover .tx-go { background: var(--accent); }
.tx-card:hover .tx-go .tx-arrow { transform: translateX(3px); }
.lang-ar .tx-card:hover .tx-go .tx-arrow { transform: scaleX(-1) translateX(3px); }
.tx-go .tx-arrow { transition: transform .25s var(--ease); }

.tx-card--more {
  justify-content: center;
  gap: .9rem;
  padding: 2rem 1.8rem;
  background: rgba(255, 255, 255, .35);
  border: 1.5px dashed rgba(13, 13, 15, .18);
  box-shadow: none;
}
.tx-card--more:hover { background: rgba(255, 255, 255, .7); }
.tx-card--more .tx-card__title { margin-top: .4rem; }
.tx-card__plus {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: var(--tx-ink);
  color: #fff;
  font-size: 1.8rem;
  font-weight: 400;
  line-height: 1;
  transform: perspective(300px) rotateX(10deg) rotateY(-14deg);
}
.tx-card--more:hover .tx-card__plus { background: var(--accent); }
.tx-card--more .tx-go { align-self: flex-start; margin-top: .4rem; }

/* ===================================================== HUB: team CTA */
.tx-cta-section { padding-top: clamp(2rem, 5vh, 3rem); }
.tx-cta {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto;
  gap: 2rem clamp(2rem, 5vw, 4rem);
  align-items: end;
  overflow: hidden;
  padding: clamp(2rem, 5vw, 4rem);
  border-radius: 34px;
  background: linear-gradient(150deg, #17191e, #08090b);
  color: #fff;
  box-shadow: 0 40px 90px rgba(10, 12, 16, .25);
}
.tx-cta__glow { position: absolute; right: -10%; top: -60%; width: 60%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(226, 35, 26, .35), rgba(226, 35, 26, 0) 66%); pointer-events: none; }
.tx-cta__copy,
.tx-cta__actions { position: relative; }
.tx-cta .tx-h2 { color: #fff; max-width: 18ch; }
.tx-cta .tx-copy { margin-top: 1.1rem; color: rgba(255, 255, 255, .66); }
.tx-cta__actions { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: flex-end; }

/* ===================================================== MODULE PAGE */
.tx-mhero {
  position: relative;
  padding: clamp(2rem, 5vh, 3rem) 0 clamp(3.5rem, 8vh, 5.5rem);
  overflow: clip;
}
.tx-mhero > .container { position: relative; z-index: 1; }
.tx-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-bottom: clamp(1.8rem, 5vh, 3rem);
  font-size: .86rem;
  font-weight: 650;
  color: var(--tx-soft);
}
.tx-crumbs a:hover { color: var(--accent); }
.tx-mhero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .95fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.tx-page .tx-title--module { max-width: 14ch; font-size: clamp(2.6rem, 5.6vw, 4.8rem); }
.tx-mhero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem 1.1rem;
  margin: 1.7rem 0 0;
  padding: 0;
  list-style: none;
  font-size: .82rem;
  font-weight: 750;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--tx-muted);
}
.tx-hero-card {
  padding: .75rem;
  border-radius: 32px;
  background: var(--tx-glass);
  border: 1px solid var(--tx-glass-border);
  box-shadow: var(--tx-lift-shadow);
}
.tx-cover--xl { border-radius: 24px; }
.tx-hero-card__foot {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: .4rem 1rem;
  padding: 1.1rem .8rem .5rem;
}
.tx-hero-card__foot p { margin: 0; }
.tx-hero-card__foot .tx-kinds { grid-column: 1 / -1; margin-top: .5rem; }
.tx-hero-card__label { font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--tx-soft); }
.tx-hero-card__value { font-size: 1.1rem; font-weight: 800; }
.tx-hero-card__foot.is-complete .tx-hero-card__value { color: var(--accent); }

.tx-outcomes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tx-outcome {
  padding: 1.4rem 1.4rem 1.5rem;
  border-radius: 22px;
  background: var(--tx-glass);
  border: 1px solid var(--tx-glass-border);
  box-shadow: var(--tx-glass-shadow);
}
.tx-outcome__num {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 1rem;
  border-radius: 13px;
  background: var(--tx-ink);
  color: #fff;
  font-size: .9rem;
  font-weight: 850;
  box-shadow: 0 10px 22px rgba(18, 22, 30, .16);
  transform: perspective(300px) rotateX(12deg) rotateY(-14deg);
}
.tx-outcome:first-child .tx-outcome__num { background: var(--accent); }
.tx-outcome p { font-size: 1.02rem; line-height: 1.5; font-weight: 600; }

.tx-path-section {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .6) 30%, rgba(255, 255, 255, 0));
}
.tx-path {
  --node: 64px;
  position: relative;
  display: grid;
  gap: 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tx-path::before,
.tx-path::after {
  content: "";
  position: absolute;
  top: calc(var(--node) / 2);
  inset-inline-start: calc(var(--node) / 2 - 1.5px);
  width: 3px;
  border-radius: 3px;
}
.tx-path::before { bottom: calc(var(--node) / 2); background: rgba(13, 13, 15, .1); }
.tx-path::after { height: calc((100% - var(--node)) * var(--p, 0)); background: var(--accent); transition: height 1s var(--ease-out); }
.tx-step {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--node) minmax(0, 1fr);
  gap: clamp(.8rem, 2vw, 1.4rem);
  align-items: center;
}
.tx-step__node {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--node);
  height: var(--node);
  border-radius: 50%;
  background: #fff;
  border: 1px solid rgba(13, 13, 15, .12);
  box-shadow: 0 10px 26px rgba(18, 22, 30, .1);
  font-weight: 850;
  transition: background .4s var(--ease), color .4s var(--ease), border-color .4s var(--ease);
}
.tx-step__check { display: none; width: 1.6rem; height: 1.6rem; stroke-width: 2.4; }
.tx-step.is-done .tx-step__node { background: var(--accent); border-color: var(--accent); color: #fff; }
.tx-step.is-done .tx-step__num { display: none; }
.tx-step.is-done .tx-step__check { display: block; }
.tx-step.is-next .tx-step__node { border-color: var(--accent); color: var(--accent); }
.tx-step.is-next .tx-step__node::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 2px solid rgba(226, 35, 26, .4);
  animation: txPulse 2s var(--ease) infinite;
}
@keyframes txPulse { 0% { transform: scale(.9); opacity: 1; } 100% { transform: scale(1.25); opacity: 0; } }
.tx-step__card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: clamp(.9rem, 2.4vw, 1.6rem);
  align-items: center;
  padding: clamp(1.1rem, 2.4vw, 1.5rem);
  border-radius: 24px;
  background: var(--tx-glass);
  border: 1px solid var(--tx-glass-border);
  box-shadow: var(--tx-glass-shadow);
  transition: transform .35s var(--ease-out), box-shadow .35s var(--ease);
}
.tx-step__card:hover { transform: translateX(6px); box-shadow: var(--tx-lift-shadow); }
.lang-ar .tx-step__card:hover { transform: translateX(-6px); }
.tx-step.is-next .tx-step__card { border-color: rgba(226, 35, 26, .35); box-shadow: 0 0 0 4px rgba(226, 35, 26, .07), var(--tx-glass-shadow); }
.tx-step__kind {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(18, 22, 30, .1);
  transform: perspective(300px) rotateX(10deg) rotateY(-14deg);
}
.tx-step__kind .tx-icon { width: 1.6rem; height: 1.6rem; }
.tx-step__kind.tx-kind--game { background: var(--accent); color: #fff; }
.tx-step__kind.tx-kind--practice { background: var(--tx-ink); color: #fff; }
.tx-step__kind.tx-kind--quiz { color: var(--accent); }
.tx-step__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem .7rem;
  font-size: .78rem;
  font-weight: 750;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--tx-soft);
}
.tx-step__flag { display: none; padding: .2rem .55rem; border-radius: 999px; font-size: .66rem; font-weight: 850; }
.tx-step__flag--next { background: rgba(226, 35, 26, .12); color: var(--accent); }
.tx-step__flag--done { background: rgba(13, 13, 15, .07); color: var(--tx-ink); }
.tx-step.is-next .tx-step__flag--next,
.tx-step.is-done .tx-step__flag--done { display: inline-flex; }
.tx-page .tx-step h3 { margin: .45rem 0 .25rem; font-size: clamp(1.25rem, 2vw, 1.6rem); font-weight: 800; letter-spacing: -.03em; }
.lang-ar.tx-page .tx-step h3 { letter-spacing: 0; }
.tx-step p { color: var(--tx-muted); line-height: 1.5; }
.tx-step__btn { min-height: 46px; padding: .6rem 1.3rem; white-space: nowrap; }
.tx-step__again { display: none; }
.tx-step.is-done .tx-step__start { display: none; }
.tx-step.is-done .tx-step__again { display: inline; }
.tx-step__card:hover .tx-step__btn { background: var(--accent); border-color: var(--accent); color: #fff; }

.tx-next { padding-top: clamp(1rem, 3vh, 2rem); }
.tx-next__card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: clamp(1.4rem, 4vw, 3rem);
  align-items: center;
  padding: .75rem;
  border-radius: 32px;
  background: var(--tx-glass);
  border: 1px solid var(--tx-glass-border);
  box-shadow: var(--tx-glass-shadow);
  transition: transform .4s var(--ease-out), box-shadow .4s var(--ease);
}
.tx-next__card:hover { transform: translateY(-5px); box-shadow: var(--tx-lift-shadow); }
.tx-next__body { display: flex; flex-direction: column; align-items: flex-start; gap: .9rem; padding: 1rem 1.5rem 1rem 0; }
.lang-ar .tx-next__body { padding: 1rem 0 1rem 1.5rem; }
.tx-next__body .tx-eyebrow { margin-bottom: 0; }
.tx-page .tx-next__title { font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 800; letter-spacing: -.045em; line-height: 1.05; }
.lang-ar.tx-page .tx-next__title { letter-spacing: 0; line-height: 1.35; }
.tx-next__card:hover .btn { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ===================================================== Responsive */
@media (max-width: 1100px) {
  .tx-how__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .tx-hero__grid,
  .tx-mhero__grid { grid-template-columns: 1fr; }
  .tx-tv { max-width: 640px; width: 100%; margin-inline: auto; }
  .tx-head--split { grid-template-columns: 1fr; }
  .tx-track__head {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "icon titles" "copy copy" "facts facts";
  }
  .tx-track__head .tx-copy { margin-top: .8rem; }
  .tx-cta { grid-template-columns: 1fr; align-items: start; }
  .tx-cta__actions { justify-content: flex-start; }
  .tx-next__card { grid-template-columns: 1fr; }
  .tx-next__body,
  .lang-ar .tx-next__body { padding: .5rem 1rem 1.2rem; }
}

@media (max-width: 640px) {
  .tx-page .tx-title { font-size: clamp(2.4rem, 11vw, 3.2rem); }
  .lang-ar.tx-page .tx-title { font-size: clamp(2rem, 9vw, 2.7rem); }
  .tx-stats li { min-width: 0; flex: 1 1 40%; }
  .tx-remote { gap: .4rem; }
  .tx-remote__step { padding: 0 .75rem; }
  .tx-remote .tx-remote__ch { width: 30px; height: 30px; }
  .tx-remote__chs { order: 3; }
  .tx-how__grid { grid-template-columns: 1fr; }
  .tx-resume { grid-template-columns: auto minmax(0, 1fr); }
  .tx-resume__btn { grid-column: 1 / -1; }
  .tx-resume__reset { grid-column: 1 / -1; justify-self: start; }
  .tx-path { --node: 46px; }
  .tx-step__card { grid-template-columns: minmax(0, 1fr); }
  .tx-step__kind { display: none; }
  .tx-step__btn { justify-self: start; }
  .tx-step__card:hover,
  .lang-ar .tx-step__card:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .tx-tv__tube,
  .tx-tv__tube::after,
  .tx-ch__tag i,
  .tx-ch__cursor,
  .tx-remote__power,
  .tx-tv .is-shown,
  .tx-net__hot,
  .tx-caret,
  .tx-step.is-next .tx-step__node::after,
  .tx-l > * { animation: none !important; }
  .tx-tilt,
  .tx-tv__glow { transition: none; }
}
