/* =====================================================================
   Online Tijara — "Commerce Cosmos" shared design system
   Loads on futuristic pages (home, course, pricing). All classes are
   .ot- prefixed to avoid clashing with WooCommerce / Tutor LMS.
   Tokens map to theme.json presets (single source of truth).
   ===================================================================== */

:root {
  --ot-bg:          var(--wp--preset--color--base, #070709);
  --ot-bg-2:        var(--wp--preset--color--base-2, #0d0d14);
  --ot-surface:     var(--wp--preset--color--surface, #15151f);
  --ot-orange:      var(--wp--preset--color--brand, #ff6b1a);
  --ot-orange-2:    var(--wp--preset--color--brand-2, #ff8a3d);
  --ot-orange-soft: var(--wp--preset--color--brand-soft, #ffb380);
  --ot-orange-deep: var(--wp--preset--color--brand-deep, #b84a0a);
  --ot-gold:        var(--wp--preset--color--gold, #ffd27a);
  --ot-gold-soft:   var(--wp--preset--color--gold-soft, #ffe7c2);
  --ot-text:        var(--wp--preset--color--contrast, #f6f5f3);
  --ot-text-dim:    var(--wp--preset--color--contrast-dim, #9a9aa8);

  --ot-glow:        rgba(255,107,26,.5);
  --ot-glow-gold:   rgba(255,210,122,.45);
  --ot-border:      rgba(255,255,255,.08);
  --ot-glass:       linear-gradient(160deg, rgba(26,26,38,.72), rgba(13,13,20,.60));
  --ot-glass-rim:   linear-gradient(140deg, rgba(255,210,122,.55), rgba(255,107,26,.18) 30%, rgba(255,255,255,0) 55%, rgba(255,138,61,.30));
  --ot-num:         'Sora', ui-monospace, system-ui, sans-serif;
  --ot-ease:        cubic-bezier(.2,.8,.2,1);
}

/* Latin digits everywhere, even though the document is RTL Arabic. */
.ot-num, .ot-futuristic .ot-num { font-family: var(--ot-num); font-variant-numeric: lining-nums tabular-nums; }

/* =====================================================================
   COSMOS BACKDROP — fixed, behind all content (injected at wp_body_open)
   Back→front: CSS gradient → 3D grid → WebGL canvas → embers.
   The CSS gradient is the guaranteed fallback if WebGL/JS is unavailable.
   ===================================================================== */
.ot-scene-bg {
  position: fixed; inset: 0; z-index: -7; pointer-events: none;
  background:
    radial-gradient(120% 90% at 30% 6%, rgba(255,107,26,.18), transparent 46%),
    radial-gradient(90% 80% at 82% 84%, rgba(255,138,61,.10), transparent 50%),
    radial-gradient(140% 60% at 50% 122%, rgba(255,107,26,.22), rgba(255,138,61,.06) 32%, transparent 60%), /* dark-earth launch horizon */
    radial-gradient(60% 60% at 50% 46%, rgba(255,210,122,.05), transparent 60%),
    linear-gradient(180deg, #050507 0%, var(--ot-bg) 42%, #0a0a10 100%);
}

/* Far parallax starfield — tiled radial dots, cheap, with a slow drift +
   gentle twinkle. Two densities give a hint of depth. */
.ot-stars {
  position: fixed; inset: -10% 0; z-index: -6; pointer-events: none; opacity: .55;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, rgba(255,235,205,.9), transparent),
    radial-gradient(1.5px 1.5px at 75% 18%, rgba(255,220,180,.7), transparent),
    radial-gradient(1px 1px at 40% 72%, rgba(255,255,255,.7), transparent),
    radial-gradient(1px 1px at 88% 64%, rgba(255,225,190,.6), transparent),
    radial-gradient(1.5px 1.5px at 60% 48%, rgba(255,240,215,.75), transparent),
    radial-gradient(1px 1px at 12% 88%, rgba(255,255,255,.6), transparent);
  background-size: 540px 540px, 700px 700px, 480px 480px, 620px 620px, 560px 560px, 660px 660px;
  animation: ot-starDrift 120s linear infinite, ot-twinkle 7s ease-in-out infinite alternate;
}
@keyframes ot-starDrift { from { background-position: 0 0,0 0,0 0,0 0,0 0,0 0; } to { background-position: 0 -540px,0 -700px,0 -480px,0 -620px,0 -560px,0 -660px; } }
@keyframes ot-twinkle { from { opacity: .4; } to { opacity: .65; } }

/* Volumetric light shafts (god-rays) drifting from the top-start. Very
   subtle at "balanced" intensity; they sell atmospheric depth. */
.ot-shafts { position: fixed; inset: 0; z-index: -4; pointer-events: none; overflow: hidden; mix-blend-mode: screen; opacity: .6; }
.ot-shafts span {
  position: absolute; top: -30%; width: 42vw; height: 150vh; transform-origin: top center;
  background: linear-gradient(180deg, rgba(255,170,90,.10), rgba(255,210,122,.03) 40%, transparent 72%);
  filter: blur(8px);
}
.ot-shafts span:nth-child(1) { right: 8%;  transform: rotate(14deg);  animation: ot-shaft 16s ease-in-out infinite; }
.ot-shafts span:nth-child(2) { right: 34%; transform: rotate(7deg);   animation: ot-shaft 21s ease-in-out infinite reverse; opacity: .7; }
.ot-shafts span:nth-child(3) { right: 62%; transform: rotate(-5deg);  animation: ot-shaft 26s ease-in-out infinite; opacity: .5; }
@keyframes ot-shaft { 0%,100% { transform: rotate(8deg) translateX(0); opacity: .5; } 50% { transform: rotate(11deg) translateX(-30px); opacity: .85; } }

/* =====================================================================
   HUD FRAME — whisper-subtle sci-fi instrumentation over the viewport.
   Corner brackets + a faint top scan-rule + a tiny Latin readout. Fixed,
   non-interactive, RTL-symmetric. "Balanced" intensity = low opacity.
   ===================================================================== */
.ot-hud { position: fixed; inset: 0; z-index: 150; pointer-events: none; }
.ot-hud-c { position: absolute; width: 26px; height: 26px; opacity: .5; }
.ot-hud-c::before, .ot-hud-c::after { content: ''; position: absolute; background: linear-gradient(90deg, var(--ot-gold), transparent); }
.ot-hud-c::before { width: 100%; height: 1.5px; }
.ot-hud-c::after  { width: 1.5px; height: 100%; background: linear-gradient(180deg, var(--ot-gold), transparent); }
.ot-hud-tr { top: 16px; right: 16px; }
.ot-hud-tl { top: 16px; left: 16px;  transform: scaleX(-1); }
.ot-hud-br { bottom: 16px; right: 16px; transform: scaleY(-1); }
.ot-hud-bl { bottom: 16px; left: 16px;  transform: scale(-1,-1); }
.ot-hud-read {
  position: absolute; top: 14px; inset-inline-start: 52px;
  font-family: var(--ot-num); font-size: .58rem; letter-spacing: .26em; text-transform: uppercase;
  /* Subtle FUI telemetry chip. A near-opaque dark backing guarantees the gold
     readout meets contrast (~10:1) over ANY scene — incl. the molten Core on
     the course page — so low-vision users can read it (axe color-contrast is
     a visual rule, evaluated even on aria-hidden decoration). */
  color: #d9b873; background: rgba(5,5,8,.86); white-space: nowrap;
  padding: 3px 9px; border-radius: 5px; border: 1px solid rgba(255,210,122,.12);
}
.ot-hud-scan {
  position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,210,122,.5), transparent);
  opacity: .35; animation: ot-scan 9s linear infinite;
}
@keyframes ot-scan { 0% { top: 0; opacity: 0; } 6% { opacity: .4; } 94% { opacity: .4; } 100% { top: 100%; opacity: 0; } }

/* A soft legibility scrim helper: place behind text that floats over the
   brightest scene areas so copy never loses contrast on the glow. */
.ot-scrim { position: relative; }
.ot-scrim::before {
  content: ''; position: absolute; inset: -8% -12%; z-index: -1; pointer-events: none;
  background: radial-gradient(60% 70% at 50% 50%, rgba(5,5,7,.62), transparent 72%);
}
.ot-grid-3d {
  position: fixed; inset: 0; z-index: -3; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,107,26,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,107,26,.05) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: perspective(520px) rotateX(62deg) translateZ(-90px) scale(2);
  transform-origin: center 78%;
  mask-image: linear-gradient(180deg, transparent, #000 38%, #000 64%, transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 38%, #000 64%, transparent);
  animation: ot-gridMove 22s linear infinite;
}
@keyframes ot-gridMove { from { background-position: 0 0; } to { background-position: 0 64px; } }

.ot-webgl-mount { position: fixed; inset: 0; z-index: -5; pointer-events: none; }
.ot-webgl-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: .6; }

.ot-embers { position: fixed; inset: 0; z-index: -2; pointer-events: none; overflow: hidden; }
.ot-embers span {
  position: absolute; bottom: -40px; width: 6px; height: 6px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--ot-gold-soft), var(--ot-orange) 70%);
  box-shadow: 0 0 12px var(--ot-glow);
  opacity: 0; animation: ot-ember 14s ease-in infinite;
}
.ot-embers span:nth-child(1) { left: 12%; animation-delay: 0s;    transform: scale(1.1); }
.ot-embers span:nth-child(2) { left: 28%; animation-delay: -3.5s; transform: scale(.7); }
.ot-embers span:nth-child(3) { left: 47%; animation-delay: -7s;   transform: scale(1.4); }
.ot-embers span:nth-child(4) { left: 63%; animation-delay: -10s;  transform: scale(.85); }
.ot-embers span:nth-child(5) { left: 78%; animation-delay: -5s;   transform: scale(1.2); }
.ot-embers span:nth-child(6) { left: 90%; animation-delay: -12s;  transform: scale(.6); }
@keyframes ot-ember {
  0%   { opacity: 0; transform: translateY(0) translateX(0) scale(.6); }
  12%  { opacity: .9; }
  100% { opacity: 0; transform: translateY(-110vh) translateX(40px) scale(1.1); }
}

/* Fine film grain to defeat banding on the deep background. */
.ot-futuristic main::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* =====================================================================
   GLASS SYSTEM — frosted obsidian panels with a thin gold rim-light
   ===================================================================== */
.ot-glass {
  position: relative;
  background: var(--ot-glass);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  backdrop-filter: blur(18px) saturate(135%);
  border: 1px solid var(--ot-border);
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.05);
}
.ot-glass::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: var(--ot-glass-rim);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none; opacity: .9; transition: opacity .5s var(--ot-ease);
}
.ot-glass:hover::before { opacity: 1; }

/* 3D tilt target (driven by app.js, fine pointers only). */
.ot-tilt { transform-style: preserve-3d; transition: transform .4s var(--ot-ease); will-change: transform; }

/* =====================================================================
   SECTION SHELL + TITLES
   ===================================================================== */
.ot-section { padding: clamp(80px, 12vh, 150px) 6%; position: relative; }
.ot-section > * { position: relative; z-index: 1; }
.ot-section-title { text-align: center; margin-bottom: clamp(48px, 7vw, 84px); }
.ot-section-title .ot-pre {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ot-gold); font-size: .8rem; font-weight: 800; letter-spacing: .28em;
  text-transform: uppercase; margin-bottom: 18px;
  padding: 7px 16px; border-radius: 50px;
  background: rgba(255,210,122,.06); border: 1px solid rgba(255,210,122,.18);
}
.ot-section-title h2 { font-size: clamp(2.2rem, 5vw, 3.8rem); line-height: 1.08; }
.ot-section-title p { color: var(--ot-text-dim); margin: 20px auto 0; max-width: 620px; font-size: 1.1rem; }
.ot-hl {
  background: linear-gradient(120deg, var(--ot-orange) 0%, var(--ot-orange-2) 45%, var(--ot-gold) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* =====================================================================
   BUTTONS — molten primary + glass secondary
   ===================================================================== */
.ot-btn-primary,
.ot-btn-secondary,
.ot-btn-pricing {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  text-decoration: none; border: none; cursor: pointer; position: relative; overflow: hidden;
  font-weight: 800; border-radius: 50px; transition: transform .4s var(--ot-ease), box-shadow .4s var(--ot-ease);
}
.ot-btn-primary {
  background: linear-gradient(135deg, var(--ot-orange), var(--ot-orange-2) 60%, var(--ot-gold));
  color: #160a02; padding: 18px 38px; font-size: 1.05rem;
  box-shadow: 0 16px 40px var(--ot-glow), inset 0 1px 0 rgba(255,255,255,.35);
}
.ot-btn-primary::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .7s var(--ot-ease);
}
.ot-btn-primary:hover { transform: translateY(-4px) scale(1.02); box-shadow: 0 26px 64px var(--ot-glow); }
.ot-btn-primary:hover::after { transform: translateX(120%); }
.ot-btn-secondary {
  background: rgba(255,255,255,.04); border: 1px solid var(--ot-border); color: var(--ot-text);
  padding: 18px 34px; font-size: 1rem; font-weight: 700;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.ot-btn-secondary:hover { background: rgba(255,107,26,.10); border-color: var(--ot-orange); transform: translateY(-2px); color: #fff; }

/* =====================================================================
   PRICING CARD — shared molten-rim component (home #pricing + /pricing/)
   ===================================================================== */
.ot-pricing-wrap { max-width: 600px; margin: 0 auto; perspective: 1000px; }
.ot-price-card-3d {
  position: relative; overflow: hidden; border-radius: 32px; padding: 50px 40px;
  background-image: linear-gradient(150deg, rgba(26,26,38,.92), rgba(13,13,20,.92)), linear-gradient(135deg, var(--ot-orange), var(--ot-gold), var(--ot-orange));
  background-origin: border-box; background-clip: padding-box, border-box; border: 2px solid transparent;
  box-shadow: 0 50px 120px rgba(255,107,26,.28); transition: transform .5s var(--ot-ease);
}
.ot-price-card-3d:hover { transform: translateY(-6px); }
.ot-price-card-3d::before { content: ''; position: absolute; top: -150px; right: -150px; width: 400px; height: 400px; border-radius: 50%; background: radial-gradient(circle, var(--ot-glow), transparent 60%); pointer-events: none; }
.ot-price-card-3d > * { position: relative; z-index: 2; }
.ot-price-badge { display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px; border-radius: 50px; background: linear-gradient(135deg, var(--ot-orange), var(--ot-gold)); color: #160a02; font-weight: 800; font-size: .82rem; margin-bottom: 24px; box-shadow: 0 8px 20px var(--ot-glow); }
.ot-price-card-3d h3 { font-size: 2rem; margin-bottom: 10px; }
.ot-price-card-3d .ot-sub-desc { color: var(--ot-text-dim); margin-bottom: 34px; }
.ot-price-row { display: flex; align-items: baseline; gap: 12px; margin-bottom: 34px; flex-wrap: wrap; }
.ot-price-old { color: var(--ot-text-dim); text-decoration: line-through; font-size: 1.5rem; }
.ot-price-new { font-family: var(--ot-num); font-size: clamp(3.4rem,8vw,4.6rem); font-weight: 800; line-height: 1; background: linear-gradient(135deg, var(--ot-orange), var(--ot-gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ot-price-currency { color: var(--ot-text); font-size: 1.3rem; font-weight: 800; }
.ot-price-features { list-style: none; margin: 0 0 38px; padding: 0; }
.ot-price-features li { padding: 13px 0; border-bottom: 1px solid var(--ot-border); display: flex; align-items: center; gap: 14px; font-size: .98rem; }
.ot-price-features li:last-child { border: none; }
.ot-check-3d { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; background: radial-gradient(circle at 30% 30%, #fff7ec, var(--ot-orange)); color: #160a02; display: flex; align-items: center; justify-content: center; font-size: .85rem; font-weight: 900; box-shadow: 0 6px 14px var(--ot-glow); }
.ot-btn-pricing { width: 100%; box-sizing: border-box; background: linear-gradient(135deg, var(--ot-orange), var(--ot-orange-2) 60%, var(--ot-gold)); color: #160a02; padding: 22px 24px; border-radius: 50px; font-family: 'Cairo', sans-serif; font-weight: 900; font-size: 1.15rem; line-height: 1.2; box-shadow: 0 20px 50px var(--ot-glow); text-decoration: none; display: flex; align-items: center; justify-content: center; gap: 8px; text-align: center; transition: transform .4s var(--ot-ease), box-shadow .4s var(--ot-ease); }
.ot-btn-pricing:hover { transform: translateY(-4px) scale(1.02); box-shadow: 0 28px 60px var(--ot-glow); }
.ot-guarantee-row { text-align: center; margin-top: 18px; color: var(--ot-text-dim); font-size: .88rem; }

/* =====================================================================
   SCROLL REVEAL — hidden only when JS is active (html.js)
   ===================================================================== */
.js .ot-reveal { opacity: 0; transform: translateY(42px); transition: opacity .9s var(--ot-ease), transform .9s var(--ot-ease); }
.js .ot-reveal.ot-in { opacity: 1; transform: none; }
.js .ot-reveal[data-d="1"] { transition-delay: .08s; }
.js .ot-reveal[data-d="2"] { transition-delay: .16s; }
.js .ot-reveal[data-d="3"] { transition-delay: .24s; }
.js .ot-reveal[data-d="4"] { transition-delay: .32s; }

/* =====================================================================
   PERFORMANCE / MOTION GUARDS (shared)
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  .ot-grid-3d, .ot-embers span, .ot-stars, .ot-shafts span, .ot-hud-scan { animation: none; }
  .ot-embers { display: none; }
  .js .ot-reveal { opacity: 1; transform: none; }
}

@media (max-width: 900px) {
  .ot-embers { display: none; }            /* drop continuous GPU work on mobile */
  .ot-grid-3d { animation: none; opacity: .45; }
  .ot-stars { animation: ot-twinkle 9s ease-in-out infinite alternate; opacity: .4; } /* drop the drift, keep faint twinkle */
  .ot-shafts { opacity: .35; }
  .ot-shafts span { animation: none; }
  .ot-hud-scan { animation: none; opacity: .2; }
  .ot-hud-read { display: none; }          /* avoid clutter on small screens */
  .ot-glass { -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
  .ot-price-card-3d { padding: 40px 22px; }  /* symmetric padding so the CTA centers (home + /pricing/) */
}
