/* =============================================================
   Training: course page
   A lab-bench look: an oscilloscope plays waveforms from the course,
   the tracks read as day-by-day rails, the close eases to paper.
   ============================================================= */
.tr-page { --tr-scr: #061015; --tr-g: #5dd2a6; --tr-a: #e9a566; --tr-b: #8ec5ff; }
.tr-h2 { font-family: var(--font-display); font-weight: 500; font-size: clamp(30px, 3.8vw, 54px); line-height: 1.06; letter-spacing: -0.03em; text-wrap: balance; max-width: 15em; }
.tr-h2 em { font-style: normal; color: var(--copper-hi); }
.tr-c-head { text-align: center; }
.tr-c-head .section-label { justify-content: center; }
.tr-c-head .tr-h2 { margin: 0 auto; }

/* ---------- Hero ---------- */
.tr-hero { position: relative; overflow: hidden; isolation: isolate; padding: clamp(40px, 5vw, 64px) 0 clamp(56px, 7vw, 96px);
  background: radial-gradient(70% 70% at 85% 30%, rgba(93,210,166,0.07), transparent 60%), radial-gradient(60% 60% at 0% 100%, rgba(201,123,61,0.10), transparent 60%), var(--ink);
  border-bottom: 1px solid var(--line); }
.tr-hero::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px; -webkit-mask-image: radial-gradient(80% 80% at 70% 40%, #000 30%, transparent 80%); mask-image: radial-gradient(80% 80% at 70% 40%, #000 30%, transparent 80%); }
.tr-hg { margin-top: clamp(30px, 4vw, 56px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.04fr); gap: clamp(32px, 4.5vw, 72px); align-items: center; }
.tr-hc h1 { font-family: var(--font-display); font-weight: 500; font-size: clamp(34px, 3.8vw, 54px); line-height: 1.04; letter-spacing: -0.035em; text-wrap: balance; }
.tr-hc h1 em { font-style: normal; color: var(--copper-hi); }
.tr-sub { margin-top: 22px; max-width: 30em; font-size: clamp(17px, 1.5vw, 20px); line-height: 1.5; color: var(--text-mute); }
.tr-sub strong { color: var(--text); font-weight: 500; }
.tr-btns { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 14px; }
.tr-btns .btn-ghost { color: var(--text); border-color: var(--line-2); }
.tr-btns .btn-ghost:hover { color: var(--ink); }
.tr-link { display: inline-flex; align-items: center; gap: 10px; margin-top: 26px; font-size: 15px; color: var(--text-mute); text-decoration: none; border-bottom: 1px solid var(--line-2); padding-bottom: 3px; transition: color .3s, border-color .3s; }
.tr-link i { font-style: normal; color: var(--copper-hi); transition: transform .3s var(--ease); }
.tr-link:hover { color: var(--text); border-color: var(--copper); }
.tr-link:hover i { transform: translateX(4px); }
html[dir="rtl"] .tr-link:hover i { transform: translateX(-4px); }

/* the oscilloscope */
.tr-scope { margin: 0; background: linear-gradient(180deg, #121b26, #0c131b); border: 1px solid rgba(255,255,255,0.1); border-radius: 18px; padding: 14px;
  box-shadow: 0 50px 110px -50px rgba(0,0,0,0.95), inset 0 1px 0 rgba(255,255,255,0.05); }
.sc-head { display: flex; align-items: center; gap: 14px; padding: 4px 6px 12px; font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); }
.sc-ch { display: inline-flex; align-items: center; gap: 7px; flex: none; color: var(--tr-g); }
.sc-ch i { width: 7px; height: 7px; border-radius: 50%; background: var(--tr-g); box-shadow: 0 0 8px var(--tr-g); animation: scBlink 2s ease infinite; }
.sc-t { flex: 1; min-width: 0; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-div { flex: none; border: 1px solid rgba(255,255,255,0.12); border-radius: 5px; padding: 3px 7px; }
.sc-screen { display: block; width: 100%; height: auto; background: radial-gradient(90% 90% at 50% 50%, #0a1a1d, var(--tr-scr)); border-radius: 10px;
  box-shadow: inset 0 0 40px rgba(0,0,0,0.7), inset 0 0 0 1px rgba(93,210,166,0.12); }
.sc-grid { fill: none; stroke: rgba(93,210,166,0.12); stroke-width: 1; }
.sc-axis { fill: none; stroke: rgba(93,210,166,0.28); stroke-width: 1; }
.sc-s { opacity: 0; transition: opacity .6s ease; }
.sc-s.is-on { opacity: 1; }
.tr-scope:not(.js) .sc-s:first-of-type { opacity: 1; }
.sc-tr { fill: none; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.sc-tr.g { stroke: var(--tr-g); filter: drop-shadow(0 0 3px rgba(93,210,166,0.55)); }
.sc-tr.a { stroke: var(--tr-a); filter: drop-shadow(0 0 3px rgba(233,165,102,0.5)); }
.sc-tr.b { stroke: var(--tr-b); filter: drop-shadow(0 0 3px rgba(142,197,255,0.5)); }
.sc-tr.f { opacity: 0.55; stroke-width: 1.3; }
.sc-tr.d { stroke-dasharray: 6 5; }
.sc-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.sc-b { position: relative; overflow: hidden; font: inherit; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; color: var(--text-dim);
  background: rgba(255,255,255,0.025); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; padding: 9px 8px; cursor: pointer; transition: color .3s, border-color .3s, background .3s; }
.sc-b:hover { color: var(--text); border-color: rgba(93,210,166,0.4); }
.sc-b.is-on { color: var(--tr-g); border-color: rgba(93,210,166,0.5); background: rgba(93,210,166,0.07); }
.sc-prog { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--tr-g); transform: scaleX(0); transform-origin: left; }
html[dir="rtl"] .sc-prog { left: auto; right: 0; transform-origin: right; }
.tr-scope.is-auto .sc-b.is-on .sc-prog { animation: scProg 5.5s linear forwards; }
.tr-scope:hover .sc-prog, .tr-scope:focus-within .sc-prog, .tr-scope.is-offscreen .sc-prog { animation-play-state: paused !important; }
.sc-cap { margin-top: 10px; padding: 0 6px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); }

/* credentials strip */
.tr-cred { border-bottom: 1px solid var(--line); background: var(--ink-2); }
.tr-cg { display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content max-content; }
.tr-cc { padding: clamp(22px, 2.6vw, 34px) clamp(16px, 2vw, 28px); border-inline-start: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tr-cc:first-child { border-inline-start: 0; padding-inline-start: 0; }
.tr-cc b { white-space: nowrap; font-family: var(--font-display); font-weight: 500; font-size: clamp(26px, 2.6vw, 38px); line-height: 1; letter-spacing: -0.03em; color: var(--copper-hi); }
.tr-cc > span { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); }
.tr-aud { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 16px; }
.tr-aud li { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--text); min-width: 0; }
.tr-aud svg { flex: none; width: 28px; height: 28px; padding: 5px; border-radius: 8px; color: var(--copper-hi); background: rgba(201,123,61,0.12); }

/* ---------- Tracks ---------- */
.tr-tracks { padding: clamp(80px, 10vw, 136px) 0; background: var(--ink); scroll-margin-top: 60px; }
.tr-tabs { margin: clamp(40px, 5vw, 60px) auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 920px; }
.tr-tab { position: relative; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; align-items: center; gap: 6px 16px; text-align: start; font: inherit; color: var(--text);
  background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.12); border-radius: 14px; padding: 18px 20px; cursor: pointer; transition: border-color .3s, background .3s, transform .3s var(--ease); }
.tr-tab:hover { border-color: rgba(201,123,61,0.5); transform: translateY(-2px); }
.tr-tab[aria-selected="true"] { border-color: var(--copper); background: linear-gradient(160deg, rgba(201,123,61,0.14), rgba(201,123,61,0.03)); }
.tr-tab .tk { grid-column: 1; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); }
.tr-tab[aria-selected="true"] .tk { color: var(--copper-hi); }
.tr-tab .tn { grid-column: 1; font-family: var(--font-display); font-weight: 500; font-size: clamp(19px, 1.9vw, 25px); line-height: 1.15; letter-spacing: -0.02em; }
.tr-tab .tn em { font-style: normal; color: var(--copper-hi); }
.tr-tab svg { grid-column: 2; grid-row: 1 / 3; width: 46px; height: 46px; color: var(--copper-hi); opacity: 0.85; }
.tr-panel { margin-top: clamp(34px, 4vw, 50px); }
.tr-panel[hidden] { display: none; }
.tr-panel.sw { animation: trIn .45s var(--ease-out); }
.tr-rail { list-style: none; position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; padding-top: 30px; }
.tr-rail::before { content: ''; position: absolute; top: 8px; left: 7px; right: 7px; height: 2px; border-radius: 2px; background: rgba(255,255,255,0.1); }
.tr-rail::after { content: ''; position: absolute; top: 8px; left: 7px; right: 7px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--copper), var(--tr-g)); transform-origin: left; }
html[dir="rtl"] .tr-rail::after { transform-origin: right; background: linear-gradient(270deg, var(--copper), var(--tr-g)); }
.tr-rail.reveal:not(.in)::after { transform: scaleX(0); }
.tr-rail.reveal.in::after { animation: trFill 1.4s var(--ease) both; }
.tr-mod { position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.1); border-radius: 14px; padding: 18px 18px 18px; }
.tr-mod::before { content: ''; position: absolute; top: -29px; inset-inline-start: 18px; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); border: 2px solid var(--copper-hi); }
.tm-day { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--copper-hi); }
.tm-viz { width: 100%; height: 46px; display: block; }
.tm-viz path, .tm-viz circle, .tm-viz rect { fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tm-viz .g { stroke: var(--tr-g); } .tm-viz .a { stroke: var(--tr-a); } .tm-viz .b { stroke: var(--tr-b); } .tm-viz .m { stroke: rgba(232,229,223,0.25); }
.tm-viz .d { stroke-dasharray: 4 3; }
.tm-viz .fill { fill: var(--tr-g); stroke: none; }
.tr-mod h3 { font-family: var(--font-display); font-weight: 500; font-size: 18px; line-height: 1.25; letter-spacing: -0.01em; }
.tm-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.tm-chips li { font-size: 12.5px; line-height: 1.3; color: rgba(232,229,223,0.82); border: 1px solid rgba(255,255,255,0.12); border-radius: 30px; padding: 5px 10px; }
.tr-outs-k { margin-top: 30px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); }
html[dir="rtl"] .tr-outs-k { letter-spacing: 0; font-size: 12.5px; }
.tr-outs { margin-top: 12px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tr-outs > div { padding: 18px 18px 16px; border-radius: 14px; background: linear-gradient(160deg, rgba(93,210,166,0.08), rgba(93,210,166,0.015)); border: 1px solid rgba(93,210,166,0.22); }
.tr-outs b { display: block; font-family: var(--font-display); font-weight: 500; font-size: clamp(24px, 2.4vw, 32px); line-height: 1; letter-spacing: -0.03em; color: var(--tr-g); }
.tr-outs span { display: block; margin-top: 8px; font-size: 14px; line-height: 1.4; color: var(--text-mute); }
.tr-more { margin-top: 22px; text-align: center; }
.tr-more a { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; color: var(--text-mute); text-decoration: none; border-bottom: 1px solid var(--line-2); padding-bottom: 3px; }
.tr-more a i { font-style: normal; color: var(--copper-hi); }
.tr-more a:hover { color: var(--text); border-color: var(--copper); }

/* ---------- Close (paper): bespoke programmes + call ---------- */
.tr-close .cta-c { background: transparent; border-top: 1px solid var(--tp-line); padding: clamp(70px, 8vw, 110px) 0; }
.tr-prog { padding: clamp(80px, 10vw, 130px) 0 clamp(64px, 8vw, 100px); }
.tr-prog .tr-h2 { color: var(--tp-ink); }
.tr-prog .tr-h2 em { color: var(--tp-acc); }
.tr-steps { list-style: none; position: relative; margin-top: clamp(44px, 5vw, 64px); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 2vw, 28px); }
.tr-steps::before { content: ''; position: absolute; top: 27px; left: 12.5%; right: 12.5%; height: 2px; background: var(--tp-line); }
.tr-steps::after { content: ''; position: absolute; top: 27px; left: 12.5%; right: 12.5%; height: 2px; background: var(--tp-acc); transform-origin: left; }
html[dir="rtl"] .tr-steps::after { transform-origin: right; }
.tr-steps.reveal:not(.in)::after { transform: scaleX(0); }
.tr-steps.reveal.in::after { animation: trFill 1.6s var(--ease) .2s both; }
.tr-steps li { position: relative; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.tr-steps li > b { position: relative; z-index: 1; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-mono); font-weight: 500; font-size: 14px;
  color: var(--tp-acc); background: var(--tp-bg); border: 1.5px solid var(--tp-acc); }
.tr-steps h3 { font-family: var(--font-display); font-weight: 500; font-size: 20px; line-height: 1.2; color: var(--tp-ink); }
.tr-steps p { font-size: 15px; line-height: 1.5; color: var(--tp-mute); max-width: 17em; }
.tr-formats { margin-top: clamp(30px, 4vw, 44px); display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.tr-formats span { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tp-mute); border: 1px solid var(--tp-line); border-radius: 30px; padding: 8px 14px; }
.tr-ask { margin-top: 30px; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; }
.tr-ask span { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tp-mute); border: 1px solid var(--tp-line); border-radius: 30px; padding: 8px 14px; }
.tr-ask span i { font-style: normal; color: var(--tp-acc); margin-inline-end: 7px; }
.tr-ask span.out { color: var(--tp-ok); border-color: var(--tp-ok); }
.tr-ask b { font-weight: 400; color: var(--tp-acc); }
html[dir="rtl"] .tr-ask b { display: inline-block; transform: scaleX(-1); }

/* ---------- Motion ---------- */
@keyframes scBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@keyframes scProg { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes trFill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes trIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.is-offscreen, .is-offscreen * { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) {
  .sc-ch i { animation: none; }
}

/* ---------- Arabic ---------- */
html[dir="rtl"] :is(.sc-head, .sc-b, .sc-cap, .tr-cc > span, .tr-tab .tk, .tm-day, .tr-formats span, .tr-ask span) { letter-spacing: 0; }
html[dir="rtl"] .tr-cc > span, html[dir="rtl"] .tm-day, html[dir="rtl"] .tr-tab .tk { font-size: 12px; }
html[dir="rtl"] .sc-b { font-size: 12px; }
html[dir="rtl"] .tr-hc h1 { line-height: 1.3; }
html[dir="rtl"] .tr-h2 { line-height: 1.35; }
html[dir="rtl"] .sc-div, html[dir="rtl"] .sc-ch { direction: ltr; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .tr-rail, .tr-outs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tr-cg { grid-template-columns: max-content minmax(0, 1fr); }
  .tr-rail::before, .tr-rail::after, .tr-mod::before { display: none; }
  .tr-rail { padding-top: 0; }
  .tr-cg { grid-template-columns: 1fr 1fr; }
  .tr-cc:nth-child(3) { border-inline-start: 0; padding-inline-start: 0; }
  .tr-cc:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 980px) {
  .tr-hg { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .tr-tabs { grid-template-columns: minmax(0, 1fr); }
  .tr-steps { grid-template-columns: 1fr 1fr; row-gap: 34px; }
  .tr-steps::before, .tr-steps::after { display: none; }
  .tr-cg { grid-template-columns: minmax(0, 1fr); }
  .tr-cc { border-inline-start: 0; padding-inline-start: 0; border-top: 1px solid var(--line); }
  .tr-cc:first-child { border-top: 0; }
}
@media (max-width: 600px) {
  .tr-rail, .tr-outs { grid-template-columns: minmax(0, 1fr); }
  .tr-outs { grid-template-columns: 1fr 1fr; }
  .tr-outs > div { padding: 14px; }
  .tr-outs span { font-size: 13px; }
  .sc-tabs { grid-template-columns: 1fr 1fr; }
  .sc-head { font-size: 10px; gap: 10px; }
  .tr-scope { padding: 10px; border-radius: 14px; }
  .tr-steps h3 { font-size: 17px; }
  .tr-steps p { font-size: 13.5px; }
}
