/* QuantEdge gate: self-hosted fonts (OFL), no external requests. Fallback fonts keep the page usable if a file fails. */
@font-face { font-family: "Vazirmatn"; src: url("/gate/fonts/vazirmatn-var-subset.woff2?v=20261019b") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Chakra Petch"; src: url("/gate/fonts/chakra-petch-700-latin.woff2?v=20261019b") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/gate/fonts/ibm-plex-mono-400-latin.woff2?v=20261019b") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/gate/fonts/ibm-plex-mono-500-latin.woff2?v=20261019b") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
html { color-scheme: dark; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
body { margin: 0; }
/* Concept: the wordmark is a Monte Carlo cloud that settles into letters above a normal distribution whose right tail (the "edge") glows.
   Below it the two markets are borderless light fields bent toward each other in 3D; the surface mesh behind them carries gold (global) on the left and turquoise (Tehran) on the right, meeting in a hot ridge. */
:root {
  --ink: #05060F;
  --ink-2: #0A1024;
  --text: #EAF1FF;
  --muted: #93A6C8;
  --firouzeh: #16F2D6;
  --zar: #FFB21A;
  --hot: #FF3D8B;
  --font-body: "Vazirmatn", "Noto Naskh Arabic", Tahoma, sans-serif;
  --font-display: "Chakra Petch", "IBM Plex Mono", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: dark;
}
html, body { height: 100%; }
body {
  background: var(--ink); color: var(--text); font-family: var(--font-body); font-size: 15px; line-height: 1.7;
  padding-block: 0;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  overflow-x: hidden;
}
* { box-sizing: border-box; }
#bg { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
.veil { position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 55%, rgba(5,6,15,0) 0%, rgba(5,6,15,.5) 68%, rgba(5,6,15,.92) 100%),
    linear-gradient(180deg, rgba(5,6,15,.6) 0%, rgba(5,6,15,0) 22%, rgba(5,6,15,0) 76%, rgba(5,6,15,.8) 100%); }
.stage { position: relative; z-index: 2; min-height: 100%; display: flex; flex-direction: column; max-width: 1140px; margin-inline: auto; padding-block: 18px 16px; gap: 10px; }
.top { display: flex; justify-content: flex-end; }
.meta { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .08em; color: var(--muted); direction: ltr; text-transform: uppercase; }

/* wordmark */
.gate { display: flex; flex-direction: column; gap: 14px; flex: 1; justify-content: center; }
.gate[hidden], .sub[hidden] { display: none; }
.boot { margin: 0; font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em; color: var(--muted); direction: ltr; text-align: center; min-height: 1.5em; }
.boot .ok { color: var(--firouzeh); }
.boot .cur { display: inline-block; width: .55em; height: 1em; background: var(--hot); vertical-align: -2px; margin-inline-start: 3px; animation: blink 1s steps(2) infinite; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.mark { position: relative; width: 100%; max-width: 980px; margin-inline: auto; height: clamp(150px, 23vw, 240px); }
.mark canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.formula { margin: 0; text-align: center; direction: ltr; font-family: var(--font-mono); font-size: 13px; letter-spacing: .03em; color: var(--muted); }
.formula b { font-weight: 500; color: var(--text); }
.formula i { font-style: italic; color: var(--firouzeh); }
.formula em { font-style: normal; color: var(--hot); }
.formula .sep { color: var(--zar); padding-inline: .6em; }

/* 3D deck: two borderless light fields */
.stage3d { perspective: 1400px; padding-block: 4px; }
.deck { --rx: 0deg; --ry: 0deg; position: relative; height: clamp(450px, 50vw, 520px); direction: ltr;
  transform-style: preserve-3d; transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .35s cubic-bezier(.2,.7,.2,1); }
.half { --c: var(--firouzeh); --tilt: -9deg; position: absolute; top: 0; bottom: 0; width: 50%; display: flex; color: var(--text); text-decoration: none; cursor: pointer;
  transform-style: preserve-3d; transform: rotateY(var(--tilt)); transition: transform .4s cubic-bezier(.2,.7,.2,1); animation: rise .9s cubic-bezier(.2,.7,.2,1) both; outline: none; }
.half.global { --c: var(--zar); left: 0; --tilt: 9deg; transform-origin: 100% 50%; animation-delay: .12s; }
.half.tehran { right: 0; transform-origin: 0% 50%; }
.half:hover, .half:focus-visible { transform: rotateY(calc(var(--tilt) * .4)) translateZ(46px) scale(1.02); }
.half::before { content: ""; position: absolute; inset: -6% -8%; pointer-events: none; transform: translateZ(-30px);
  background: radial-gradient(ellipse 62% 58% at 50% 50%, color-mix(in srgb, var(--c) 34%, transparent) 0%, color-mix(in srgb, var(--c) 13%, transparent) 52%, transparent 76%); transition: opacity .4s; opacity: .85; }
.half::after { content: ""; position: absolute; inset: 2% 0; pointer-events: none; transform: translateZ(-12px);
  background:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px) 0 0 / 100% 36px,
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px) 0 0 / 36px 100%;
  -webkit-mask-image: radial-gradient(ellipse 60% 56% at 50% 50%, #000 0%, transparent 78%);
  mask-image: radial-gradient(ellipse 60% 56% at 50% 50%, #000 0%, transparent 78%); }
.half:hover::before, .half:focus-visible::before { opacity: 1; }
.merge { position: absolute; left: 50%; top: 4%; bottom: 4%; width: 16%; transform: translateX(-50%) translateZ(24px); pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(ellipse at center, rgba(255,61,139,.5) 0%, rgba(255,61,139,.16) 46%, transparent 72%); filter: blur(14px); }
.content { position: relative; display: flex; flex-direction: column; gap: 14px; width: 100%; padding: 26px 44px 22px; transform-style: preserve-3d; text-align: start; }
.half.tehran .content { direction: rtl; }
.half.global .content { direction: ltr; }
.p-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; transform: translateZ(18px); }
.tag { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; color: var(--c); direction: ltr; }
.chip { box-shadow: 0 0 16px -2px var(--c); font-size: 12px; font-weight: 600; padding: 1px 10px; border: 1px solid color-mix(in srgb, var(--c) 65%, transparent); color: var(--c); border-radius: 99px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.chip.live::before { animation: pulse 1.8s ease-in-out infinite; }
.p-viz { position: relative; flex: 1; min-height: 130px; transform: translateZ(8px); }
.p-viz canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.p-title { transform: translateZ(80px); transform-style: preserve-3d; }
.p-title h2 { margin: 0; font-size: clamp(28px, 3.6vw, 40px); font-weight: 800; line-height: 1.25; }
.half.global .p-title h2 { font-family: var(--font-display); font-weight: 700; letter-spacing: .01em; }
.p-title .en { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .12em; color: var(--muted); direction: ltr; text-align: start; text-transform: uppercase; }
.p-desc { margin: 0; color: var(--muted); font-size: 13.5px; transform: translateZ(14px); }
.half.global .p-desc { font-family: var(--font-mono); font-size: 12.5px; line-height: 1.65; }
.p-tags { display: flex; flex-wrap: wrap; gap: 6px; transform: translateZ(14px); }
.p-tags span { font-size: 12.5px; padding: 0 10px; border-radius: 3px; color: var(--text); background: color-mix(in srgb, var(--c) 14%, rgba(5,6,15,.6)); }
.half.global .p-tags span { font-family: var(--font-mono); font-size: 11.5px; }
.p-cta { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; transform: translateZ(26px); }
.p-cta strong { font-weight: 800; font-size: 16px; color: var(--c); text-shadow: 0 0 18px color-mix(in srgb, var(--c) 75%, transparent); }
.half.global .p-cta strong { font-family: var(--font-display); letter-spacing: .02em; }
.p-cta .arrow { font-family: var(--font-mono); color: var(--c); font-size: 20px; transition: transform .3s; }
.half.tehran:hover .arrow { transform: translateX(-6px); }
.half.global:hover .arrow { transform: translateX(6px); }
.last { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; color: var(--muted); direction: ltr; }

/* extruded lettering for panel titles */
.ext-c { color: #fff; text-shadow: 1px 1px 0 color-mix(in srgb, var(--c) 87%, #000), 2px 2px 0 color-mix(in srgb, var(--c) 74%, #000), 3px 3px 0 color-mix(in srgb, var(--c) 61%, #000), 4px 4px 0 color-mix(in srgb, var(--c) 48%, #000), 5px 5px 0 color-mix(in srgb, var(--c) 35%, #000), 6px 6px 0 color-mix(in srgb, var(--c) 22%, #000), 7px 7px 0 color-mix(in srgb, var(--c) 8%, #000), 0 0 28px color-mix(in srgb, var(--c) 65%, transparent), 10px 14px 20px rgba(0,0,0,.7); transition: text-shadow .35s; }
.half:hover .ext-c, .half:focus-visible .ext-c { text-shadow: 1px 1px 0 color-mix(in srgb, var(--c) 93%, #000), 2px 2px 0 color-mix(in srgb, var(--c) 85%, #000), 3px 3px 0 color-mix(in srgb, var(--c) 77%, #000), 4px 4px 0 color-mix(in srgb, var(--c) 70%, #000), 5px 5px 0 color-mix(in srgb, var(--c) 62%, #000), 6px 6px 0 color-mix(in srgb, var(--c) 54%, #000), 7px 7px 0 color-mix(in srgb, var(--c) 47%, #000), 8px 8px 0 color-mix(in srgb, var(--c) 39%, #000), 9px 9px 0 color-mix(in srgb, var(--c) 31%, #000), 10px 10px 0 color-mix(in srgb, var(--c) 24%, #000), 11px 11px 0 color-mix(in srgb, var(--c) 16%, #000), 12px 12px 0 color-mix(in srgb, var(--c) 8%, #000), 0 0 42px color-mix(in srgb, var(--c) 85%, transparent), 16px 22px 28px rgba(0,0,0,.8); }

/* global sub-markets (English) */
.sub { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 22px; direction: ltr; animation: fade .6s ease both; }
.back { align-self: flex-start; font-family: var(--font-mono); font-size: 13px; color: var(--muted); background: none; border: 0; border-bottom: 1px solid rgba(147,166,200,.4); padding: 2px 2px; cursor: pointer; }
.back:hover, .back:focus-visible { color: var(--text); border-color: var(--zar); outline: none; }
.sub h2 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(30px, 5vw, 52px); line-height: 1.15; color: #fff; text-shadow: 1px 1px 0 color-mix(in srgb, var(--zar) 89%, #000), 2px 2px 0 color-mix(in srgb, var(--zar) 77%, #000), 3px 3px 0 color-mix(in srgb, var(--zar) 66%, #000), 4px 4px 0 color-mix(in srgb, var(--zar) 54%, #000), 5px 5px 0 color-mix(in srgb, var(--zar) 43%, #000), 6px 6px 0 color-mix(in srgb, var(--zar) 31%, #000), 7px 7px 0 color-mix(in srgb, var(--zar) 20%, #000), 8px 8px 0 color-mix(in srgb, var(--zar) 8%, #000), 0 0 34px rgba(255,178,26,.5), 12px 16px 24px rgba(0,0,0,.7); }
.sub p.note { margin: 0; color: var(--muted); max-width: 62ch; font-family: var(--font-mono); font-size: 13px; }
.sub-wrap { perspective: 1200px; }
.sub-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; transform-style: preserve-3d; transform: rotateX(8deg); }
.sm { position: relative; display: flex; flex-direction: column; gap: 8px; min-height: 170px; padding: 18px 16px; color: var(--text);
  background: radial-gradient(ellipse 90% 80% at 50% 20%, rgba(255,178,26,.20), rgba(10,16,36,.55) 70%); box-shadow: 0 24px 40px -24px rgba(255,178,26,.45); }
.sm .code { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; color: var(--zar); }
.sm h3 { margin: 0; font-family: var(--font-display); font-size: 19px; font-weight: 700; line-height: 1.3; }
.sm small { color: var(--muted); font-family: var(--font-mono); font-size: 11.5px; line-height: 1.55; }
.sm .soon { margin-top: auto; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--zar); }

.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }

@keyframes rise { from { opacity: .5; translate: 0 26px; } to { opacity: 1; translate: 0 0; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse { 50% { opacity: .25; } }

@media (max-width: 820px) {
  .deck { height: 960px; transform: none !important; }
  .stage3d { perspective: 900px; }
  .half { width: 100%; height: 50%; top: auto; bottom: auto; left: 0; right: 0; transform-origin: 50% 50%; }
  .half.tehran { top: 0; --tilt: 0deg; transform: rotateX(-6deg); transform-origin: 50% 100%; }
  .half.global { bottom: 0; --tilt: 0deg; transform: rotateX(6deg); transform-origin: 50% 0%; }
  .half:hover, .half:focus-visible { transform: translateZ(30px) scale(1.01); }
  .merge { left: 4%; right: 4%; width: auto; top: 50%; bottom: auto; height: 12%; transform: translateY(-50%) translateZ(24px); }
  .content { padding: 22px 22px 18px; }
  .sub-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px) { .sub-grid { grid-template-columns: 1fr; } .formula { font-size: 11.5px; } }
@media (prefers-reduced-motion: reduce) {
  .half, .sub { animation: none; }
  .deck, .half { transition: none; }
  .boot .cur { animation: none; }
}

/* accessibility: visible keyboard focus (the cards have no border, so the ring is drawn on the content box) */
.half:focus-visible .content { outline: 2px solid var(--c); outline-offset: 2px; border-radius: 8px; }
.back:focus-visible { outline: 2px solid var(--zar); outline-offset: 3px; }
.sm[aria-disabled="true"] { cursor: default; }
.ns { position: relative; z-index: 3; margin: 24px auto; text-align: center; font-size: 18px; }
.ns a { color: var(--firouzeh); }
.ns a:focus-visible { outline: 2px solid var(--firouzeh); outline-offset: 3px; }

/* Global markets (links appear only when /global_enabled.json has "gate_links": true; see gate.js) */
a.sm { text-decoration: none; cursor: pointer; }
a.sm:hover { box-shadow: 0 24px 44px -20px rgba(255,178,26,.7); }
a.sm:focus-visible { outline: 2px solid var(--zar); outline-offset: 3px; }
a.sm .soon { color: var(--firouzeh); }
.sub-grid.five { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 900px) { .sub-grid.five { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .sub-grid.five { grid-template-columns: 1fr; } }

/* m42-overflow: پیام ۴۲ */
html{overflow-x:hidden}
