/* Version 4 foundation. Every value here comes from rules.html (approved).
   Palette: Prussian. Type: Estedad 400/500/700. Spacing: 8 steps.
   Do not add colors, sizes, weights or spacings outside these tokens. */

/* 1. Font: hosted next to the site (rule 12). Estedad is a variable font, so one file covers 400 to 700. */
@font-face{
  font-family:"Estedad";font-style:normal;font-weight:400 700;font-display:swap;
  src:url(fonts/estedad-arabic.woff2) format("woff2");
  unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC,U+102E0-102FB,U+10E60-10E7E,U+10EC2-10EC4,U+10EFC-10EFF,U+1EE00-1EEFF;
}
@font-face{
  font-family:"Estedad";font-style:normal;font-weight:400 700;font-display:swap;
  src:url(fonts/estedad-latin.woff2) format("woff2");
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* 2. Tokens */
:root{
  /* palette: Prussian */
  --bg:#0b1324;       /* page */
  --bg2:#14213d;      /* cards, bar */
  --fg:#eef0f4;       /* headings, 16.3:1 */
  --fg2:#c3c9d6;      /* body, 11.2:1 */
  --muted:#8792a8;    /* labels and small text, 5.9:1 */
  --accent:#fca311;   /* one word per heading, primary button, live state, 9.2:1 */
  --on-accent:#000;   /* text on accent, 10.4:1 */
  --line:rgba(229,229,229,.13);
  --line2:rgba(229,229,229,.28);

  /* type */
  --font:"Estedad",Tahoma,system-ui,sans-serif;
  --t-display:clamp(2.25rem,4vw,3.5rem); /* 36-56px */
  --t-head:clamp(1.625rem,2.6vw,2.25rem); /* 26-36px */
  --t-body:1.0625rem;                    /* 17px, 16px on phones */
  --t-small:.875rem;                     /* 14px; 13px is the floor */

  /* spacing: the only allowed steps */
  --s1:8px;--s2:16px;--s3:24px;--s4:32px;--s5:48px;--s6:64px;--s7:96px;--s8:128px;
  --gut:20px;          /* side margin: 20 / 32 / 64 */
  --section:var(--s6); /* 64 on phones, 96 elsewhere */
  --maxw:1200px;
  --measure:34em;      /* longest line of body text */
  --bar-h:56px;

  /* motion */
  --ease:cubic-bezier(.2,.7,.2,1);
  --d-ui:200ms;
  --d-in:600ms;
}
@media (max-width:719px){:root{--t-body:1rem}}
@media (min-width:720px){:root{--gut:32px;--section:var(--s7);--bar-h:64px}}
@media (min-width:1100px){:root{--gut:64px}}

/* 3. Base */
*,*::before,*::after{box-sizing:border-box}
*{margin:0}
html{background:var(--bg);-webkit-text-size-adjust:100%;scroll-padding-top:var(--bar-h)}
body{
  background:var(--bg);color:var(--fg);
  font-family:var(--font);font-size:var(--t-body);font-weight:400;line-height:1.95;
  -webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;
}
img,svg,canvas{display:block;max-width:100%}
a{color:inherit}
button{font:inherit;color:inherit}
::selection{background:var(--accent);color:var(--on-accent)}
:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:2px}

/* 4. Type levels (rule 2: weights 400/500/700 only; rule 3: line heights) */
.t-display{font-size:var(--t-display);font-weight:400;line-height:1.35}
.t-head{font-size:var(--t-head);font-weight:500;line-height:1.45}
.t-body{font-size:var(--t-body);font-weight:400;line-height:1.95;color:var(--fg2);max-width:var(--measure)}
.t-small{font-size:var(--t-small);font-weight:500;line-height:1.7;color:var(--muted)}
.t-display em,.t-head em{font-style:normal;font-weight:700;color:var(--accent)}
/* rule 1: letter-spacing only for Latin, only in the English version */
:lang(en) .t-label{letter-spacing:.04em}

/* 5. Layout */
.wrap{max-width:var(--maxw);margin-inline:auto;padding-inline:var(--gut)}
.section{padding-block:var(--section)}

/* 6. Skip link */
.skip{position:absolute;inset-inline-start:var(--gut);top:-100px;z-index:50;background:var(--accent);color:var(--on-accent);
  font-size:var(--t-small);font-weight:700;padding:var(--s1) var(--s2);text-decoration:none;border-radius:2px}
.skip:focus{top:var(--s1)}

/* 7. Top bar */
.bar{position:fixed;inset:0 0 auto;z-index:20;height:var(--bar-h);
  border-bottom:1px solid transparent;
  transition:background-color var(--d-ui) var(--ease),border-color var(--d-ui) var(--ease)}
.bar .wrap{height:100%;display:flex;align-items:center;gap:var(--s3)}
.bar .who{font-weight:700;font-size:var(--t-body);text-decoration:none;margin-inline-end:auto;
  min-height:44px;display:inline-flex;align-items:center}
.bar nav{display:flex;gap:var(--s1)}
.bar nav a{font-size:var(--t-small);font-weight:500;color:var(--fg2);text-decoration:none;
  min-height:44px;min-width:44px;padding-inline:var(--s1);display:inline-flex;align-items:center;justify-content:center;
  transition:color var(--d-ui) var(--ease)}
.bar nav a:hover{color:var(--fg)}
/* solid state: opaque enough to read without backdrop-filter (rule 14) */
.bar.solid{background:rgba(11,19,36,.94);border-bottom-color:var(--line)}
@supports (backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px)){
  .bar.solid{background:rgba(11,19,36,.8);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)}
}

/* 8. Reduced motion (rule 9): sections add their own still versions too */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:1ms!important;animation-iteration-count:1!important;animation-delay:0s!important;
    transition-duration:1ms!important;transition-delay:0s!important;scroll-behavior:auto!important}
}

/* 9. Hero (step 2)
   Many threads (sources, articles) converge on one point, and one orange thread runs from it to the name (rule 6).
   Wide screens: copy at inline-start, lines arrive from the inline-end edge.
   Narrow screens: copy below, lines arrive from the top. */
.hero{position:relative;min-height:100vh;min-height:100svh;display:flex;align-items:center;overflow:hidden}
.hero canvas{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.hero .wrap{position:relative;z-index:1;width:100%}
.hero .copy{width:min(100%,560px);padding-block:calc(var(--bar-h) + var(--s5)) var(--s6)}
.who-row{display:flex;align-items:center}
.who-row .name{margin-inline-end:var(--s2);font-weight:700;font-size:var(--t-body);line-height:1.7;color:var(--fg);white-space:nowrap}
.who-row .thread{flex:1;height:1px;background:var(--accent)}
/* invisible anchor: the threads converge here and continue as the one straight line */
.who-row .node{flex:none;width:0;height:1px}
.hero h1{margin-top:var(--s2)}
.hero .lead{margin-top:var(--s3)}
.hero .role{margin-top:var(--s2);color:var(--fg2)}
.cta{display:flex;flex-wrap:wrap;gap:var(--s2);margin-top:var(--s4)}
.btn{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding-inline:var(--s3);
  font-size:var(--t-small);font-weight:700;line-height:1.7;text-decoration:none;border-radius:2px;
  border:1px solid var(--line2);color:var(--fg);background:transparent;cursor:pointer;
  transition:border-color var(--d-ui) var(--ease),background-color var(--d-ui) var(--ease)}
.btn:hover{border-color:var(--fg)}
.btn.pri{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
.btn.pri:hover{background:#ffb534;border-color:#ffb534}

@media (max-width:959px){
  .hero{align-items:flex-end}
  /* room above the copy for the lines to arrive from the top */
  .hero .copy{width:100%;max-width:560px;padding-top:calc(var(--bar-h) + max(30svh,calc(var(--s8) + var(--s6))))}
}

/* 10. Outlets strip (step 3)
   One list for screen readers; a second, hidden copy makes the loop seamless.
   In RTL the names drift toward inline-start, so new names enter from the reading end.
   Reduced motion: no animation, the list wraps and the copy is hidden (rule 9).
   Off screen or hovered: paused (rule 10). */
.strip{border-block:1px solid var(--line);padding-block:var(--s3)}
.strip .wrap{display:flex;align-items:center;gap:var(--s4)}
.strip .label{flex:none;font-size:var(--t-small);font-weight:500;line-height:1.7;color:var(--muted)}
.strip .view{flex:1;min-width:0;overflow:hidden;
  -webkit-mask-image:linear-gradient(90deg,transparent,#000 var(--s6),#000 calc(100% - var(--s6)),transparent);
          mask-image:linear-gradient(90deg,transparent,#000 var(--s6),#000 calc(100% - var(--s6)),transparent)}
.strip .track{display:flex;width:max-content;animation:drift 50s linear infinite}
.strip ul{display:flex;gap:var(--s5);list-style:none;padding:0;padding-inline-end:var(--s5);white-space:nowrap}
.strip li{font-size:var(--t-body);font-weight:400;line-height:1.7;color:var(--fg2)}
.strip li.key{font-weight:700;color:var(--fg)}
.strip:hover .track,.strip.off .track{animation-play-state:paused}
@keyframes drift{to{transform:translateX(var(--drift,50%))}}
[dir="ltr"] .strip .track{--drift:-50%}
@media (max-width:719px){
  .strip .wrap{flex-direction:column;align-items:stretch;gap:var(--s1)}
  .strip .view{margin-inline:calc(var(--gut) * -1)}
}
@media (prefers-reduced-motion:reduce){
  .strip .track{animation:none;width:auto}
  .strip ul{flex-wrap:wrap;white-space:normal;column-gap:var(--s4);row-gap:0;padding-inline-end:0}
  .strip ul[aria-hidden]{display:none}
  .strip .view{-webkit-mask-image:none;mask-image:none;margin-inline:0}
}
/* On wide screens the strip shares the first screen with the hero, inviting the scroll. */
@media (min-width:960px){
  .hero{min-height:calc(100vh - var(--s6) - var(--t-body) * 1.7 - 2px);min-height:calc(100svh - var(--s6) - var(--t-body) * 1.7 - 2px)}
}

/* 11. Work stage (step 4), after the reference the user chose (four quadrants around a hub).
   Adapted to the approved rules: weight 400 instead of 200, no letter-spacing on hover (rule 1),
   dimmed titles use the muted color instead of opacity (rule 4), every target at least 44px (rule 11).
   Without JavaScript the grid is a plain 2 x 2 with every text open (rule 14). */
:root{
  /* quadrant states, mixed from the palette (no new hues) */
  --q-spot:var(--bg);--q-active:var(--bg2);--q-dim:var(--bg);
  --q-spot:color-mix(in srgb,var(--bg) 72%,var(--bg2));
  --q-active:color-mix(in srgb,var(--bg) 45%,var(--bg2));
  --q-dim:color-mix(in srgb,var(--bg) 60%,#000);
  --q-ease:cubic-bezier(.16,1,.3,1);
}
.vh{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.stage{position:relative;--hub:88px;--arm:80px;--pad:var(--s5);outline:0}
.quads{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr}
/* One pinned screen holds hero, strip and stage; the runway after it is the scroll distance of the hand-over.
   The next section then slides over the pinned stage. Without JavaScript the three simply stack. */
.runway{display:none}
.js .scene{position:sticky;top:0;z-index:0;height:100vh;height:100svh;min-height:560px;overflow:hidden}
.js .runway{display:block;height:110vh;height:110svh}
.js .scene>.hero{position:absolute;inset:0 0 var(--strip-h,120px);z-index:2;min-height:0}
.js .scene>.strip{position:absolute;inset:auto 0 0;z-index:2}
.js .scene>.stage{position:absolute;inset:0;z-index:1}
.js .quads{height:100%}
.hero.gone{pointer-events:none}
.js .stage:not(.on) .quad{pointer-events:none}
/* the orange line folds back into the name */
.who-row .thread{transform-origin:100% 50%}
[dir="ltr"] .who-row .thread{transform-origin:0 50%}
@media (max-width:959px){.js .scene .hero .copy{padding-top:calc(var(--bar-h) + var(--s6))}}
.after{position:relative;z-index:2;background:var(--bg)}

.quad{position:relative;display:flex;align-items:flex-end;justify-content:flex-start;overflow:hidden;cursor:pointer;
  background:var(--bg);transition:background-color .45s}
.quad:nth-child(even){justify-content:flex-end}
.quad::after{content:"";position:absolute;inset:0;z-index:1;pointer-events:none;opacity:0; /* ok:decor */
  transition:opacity .5s;
  background:radial-gradient(340px circle at var(--mx,50%) var(--my,50%),rgba(238,240,244,.085),rgba(238,240,244,.035) 42%,transparent 72%)}
@media (hover:hover){
  .quad.is-spot:not(.is-active){background:var(--q-spot)}
  .quad.is-spot:not(.is-active)::after{opacity:1} /* ok:decor */
  .quad.is-spot:not(.is-active) .quad-inner{transform:translateY(-4px)}
  .quad.is-spot:not(.is-active) .more{color:var(--fg)}
  .quad.is-spot:not(.is-active) .chev{animation:none;transform:translateX(calc(4px * var(--sx)))}
}
.quad.is-active{background:var(--q-active)}
.quad.is-dim{background:var(--q-dim)}
.quad.is-dim .quad-title{color:var(--muted)}

.quad-inner{position:relative;z-index:2;display:flex;flex-direction:column;align-items:flex-start;text-align:start;
  width:100%;max-width:calc(520px + 2 * var(--pad));padding:var(--s5) var(--pad) var(--pad);
  transition:transform .45s var(--q-ease),background-color .45s}
.quad:nth-child(even) .quad-inner{align-items:flex-end;text-align:end}
/* the open text sits on its own background where it meets the demo above it */
.quad.is-active .quad-inner{background:linear-gradient(to top,var(--q-active) 72%,transparent)}
.quad-title{font-size:var(--t-display);font-weight:400;line-height:1.35;color:var(--fg)}
.qt{background:none;border:0;padding:0;font:inherit;line-height:inherit;color:inherit;text-align:inherit;cursor:pointer;min-height:44px}
.qt:focus-visible{outline:2px solid var(--accent);outline-offset:4px}

/* «برای دیدن کلیک کنید» */
.more{display:flex;align-items:center;gap:var(--s1);margin-top:var(--s1);max-height:3em;overflow:hidden;
  font-size:var(--t-small);font-weight:500;line-height:1.7;color:var(--muted);
  transition:max-height .38s,margin-top .38s,color var(--d-ui) var(--ease)}
.quad.is-active .more{max-height:0;margin-top:0;transition:max-height .45s,margin-top .45s}
.quad.is-active .more>*,.quad.is-dim .more>*{opacity:0;transition:opacity .22s} /* ok:motion */
.chev{--sx:-1;position:relative;flex:none;width:9px;height:9px;animation:nudge 2.6s ease-in-out infinite;transition:transform .35s var(--q-ease)}
[dir="ltr"] .chev{--sx:1}
.chev::before{content:"";position:absolute;top:1px;inset-inline-start:2px;width:6px;height:6px;
  border-block-start:1px solid var(--accent);border-inline-end:1px solid var(--accent);transform:rotate(-45deg)}
[dir="ltr"] .chev::before{transform:rotate(45deg)}
.quad:nth-child(2) .chev{animation-delay:.5s}.quad:nth-child(3) .chev{animation-delay:1s}.quad:nth-child(4) .chev{animation-delay:1.5s}
@keyframes nudge{50%{transform:translateX(calc(4px * var(--sx)))}}
.m-tap{display:none}
@media (hover:none){.m-click{display:none}.m-tap{display:inline}}

/* opened text */
.reveal{max-height:0;margin-top:0;overflow:hidden;visibility:hidden;transform:translateY(8px);opacity:0; /* ok:motion */
  transition:max-height .38s,margin-top .38s,opacity .35s,transform .35s,visibility 0s .38s}
.quad.is-active .reveal{max-height:24em;margin-top:var(--s2);visibility:visible;transform:none;opacity:1; /* ok:motion */
  transition:max-height .45s,margin-top .45s,opacity .4s .1s,transform .4s .1s,visibility 0s}
.reveal .kick{font-size:var(--t-small);font-weight:500;line-height:1.7;color:var(--muted)}
.reveal .desc{margin-top:var(--s1);font-size:var(--t-body);line-height:1.95;color:var(--fg2);max-width:var(--measure)}
.reveal .tools{margin-top:var(--s1);font-size:var(--t-small);line-height:1.7;color:var(--muted)}
.reveal .acts{display:flex;flex-wrap:wrap;gap:var(--s2);margin-top:var(--s3)}
.quad:nth-child(even) .reveal .acts{justify-content:flex-end}
html:not(.js) .reveal{max-height:none;visibility:visible;transform:none;margin-top:var(--s2);opacity:1} /* ok:motion */
html:not(.js) .more{display:none}

/* small demo in each quadrant, decorative (aria-hidden) */
.viz{position:absolute;left:50%;top:var(--s5);z-index:1;pointer-events:none;transform:translateX(-50%);transform-origin:50% 0; /* ok:center */
  transition:transform .6s var(--q-ease),opacity .45s}
.quad:nth-child(-n+2) .viz{top:calc(var(--bar-h) + var(--s3))}
.quad.is-active .viz{transform:translateX(-50%) scale(1.08)}
/* Persian descriptions run longer than the reference's two lines: below 1000px of height the open text needs the demo's place */
@media (max-height:999px){.quad.is-active .viz{opacity:0}} /* ok:decor */
.quad.is-dim .viz{opacity:0} /* ok:decor */
.js .stage:not(.on) .viz{opacity:0} /* ok:decor */
.stage.on .viz{animation:viz-in .6s calc(1s + var(--i) * .06s) backwards}
@keyframes viz-in{from{opacity:0}} /* ok:decor */

/* cross and hub. Forced LTR inside: the drawing is symmetric, so physical sides are simpler here */
.cross{position:absolute;inset:0;z-index:3;pointer-events:none;direction:ltr}
.cross .hl{position:absolute;top:50%;inset-inline:0;height:1px;display:flex}
.cross .vl{position:absolute;inset-block:0;left:50%;width:1px;display:flex;flex-direction:column} /* ok:center */
.cross .hl i,.cross .vl i{flex:1;background:var(--fg2)}
.cross .hl b{flex:none;width:calc(var(--arm) * 2)}
.cross .vl b{flex:none;height:calc(var(--arm) * 2)}
.cross .hl i:first-child{transform-origin:100% 50%}.cross .hl i:last-child{transform-origin:0 50%}
.cross .vl i:first-child{transform-origin:50% 100%}.cross .vl i:last-child{transform-origin:50% 0}
.js .stage .hl i{transform:scaleX(0)}
.js .stage .vl i{transform:scaleY(0)}
.stage.on .hl i,.stage.on .vl i{transform:none;transition:transform .55s var(--q-ease) .6s}

.hub{position:absolute;left:50%;top:50%;width:var(--hub);height:var(--hub);border-radius:50%; /* ok:center */
  display:grid;place-items:center;transform:translate(-50%,-50%)}
.hub .ring{position:absolute;inset:0;width:100%;height:100%;overflow:visible;transform:rotate(-90deg)}
.hub .ring circle{fill:none;stroke-width:1;vector-effect:non-scaling-stroke}
.hub .trace{stroke:var(--fg2)}
.hub .comet{stroke:var(--accent);stroke-width:2;stroke-dasharray:14 86;opacity:0} /* ok:motion */
.js .stage .hub .trace{stroke-dasharray:100;stroke-dashoffset:100}
.stage.on .hub .trace{stroke-dashoffset:0;transition:stroke-dashoffset .6s cubic-bezier(.65,0,.35,1)}
.stage.on .hub .comet{animation:comet .6s cubic-bezier(.65,0,.35,1)}
@keyframes comet{0%{stroke-dashoffset:14;opacity:1} /* ok:motion */
  85%{opacity:1} /* ok:motion */
  100%{stroke-dashoffset:-86;opacity:0}} /* ok:motion */
.hub .arc{position:absolute;inset:-5px;border-radius:50%;border:1px solid transparent;border-top-color:var(--accent);transform:rotate(28deg)}
.hub .dot{position:absolute;top:0;right:6px;width:6px;height:6px;border-radius:50%;background:var(--accent)} /* ok:center */
.hub .nm{direction:rtl;font-size:13px;font-weight:700;line-height:1.7;color:var(--fg);white-space:nowrap;transition:opacity .3s} /* ok:motion */
.js .stage .hub .arc,.js .stage .hub .dot{opacity:0} /* ok:motion */
.stage.on .hub .arc,.stage.on .hub .dot{opacity:1;transition:opacity .4s .55s} /* ok:motion */
/* with JavaScript the hero's own name travels into the hub and becomes its label */
.js .hub .nm{visibility:hidden}

/* corner cues beside the hub: point at the hub, turn toward a quadrant when it opens */
.cue{position:absolute;width:16px;height:16px;transform:rotate(180deg);opacity:0; /* ok:motion */
  transition:transform .5s var(--q-ease),opacity .4s}
.cue::before,.cue::after{content:"";position:absolute;background:var(--accent);
  transition:width .4s var(--q-ease),height .4s var(--q-ease),background-color .3s}
.cue::before{width:11px;height:1px}.cue::after{width:1px;height:11px}
.cue.tl,.cue.bl{left:calc(50% - var(--arm) * .7 - 16px)} /* ok:center */
.cue.tr,.cue.br{left:calc(50% + var(--arm) * .7)} /* ok:center */
.cue.tl,.cue.tr{top:calc(50% - var(--arm) * .7 - 16px)}
.cue.bl,.cue.br{top:calc(50% + var(--arm) * .7)}
.cue.tl::before,.cue.tl::after{top:0;left:0} /* ok:center */
.cue.tr::before,.cue.tr::after{top:0;right:0} /* ok:center */
.cue.bl::before,.cue.bl::after{bottom:0;left:0} /* ok:center */
.cue.br::before,.cue.br::after{bottom:0;right:0} /* ok:center */
.cue.tl{animation:cue-tl 2.6s ease-in-out infinite}.cue.tr{animation:cue-tr 2.6s ease-in-out infinite}
.cue.bl{animation:cue-bl 2.6s ease-in-out infinite}.cue.br{animation:cue-br 2.6s ease-in-out infinite}
@keyframes cue-tl{50%{translate:-3px -3px}}@keyframes cue-tr{50%{translate:3px -3px}}
@keyframes cue-bl{50%{translate:-3px 3px}}@keyframes cue-br{50%{translate:3px 3px}}
.stage.on .cue{opacity:1;transition:transform .5s var(--q-ease),opacity .4s 1.1s} /* ok:motion */
.cue.is-open{transform:none;animation:none}
.cue.is-open::before,.cue.is-open::after{background:var(--fg2)}
@media (hover:hover){
  .cue.is-hint:not(.is-open){transform:rotate(112deg) scale(1.45)}
  .cue.is-hint:not(.is-open)::before{width:17px}
  .cue.is-hint:not(.is-open)::after{height:17px}
  .cue.is-hint:not(.is-open)::before,.cue.is-hint:not(.is-open)::after{background:var(--fg)}
}

/* cue to keep scrolling, once the stage has settled and nothing is open */
.onward{position:absolute;left:50%;bottom:var(--s4);z-index:4;display:flex;flex-direction:column;align-items:center;gap:var(--s1); /* ok:center */
  pointer-events:none;transform:translateX(-50%);translate:0 12px;opacity:0; /* ok:motion */
  transition:opacity .3s,translate .6s var(--q-ease)}
.stage.on.at:not(.has-active) .onward{translate:0 0;opacity:1; /* ok:motion */
  transition:opacity .7s 1.8s,translate .7s var(--q-ease) 1.8s}
.onward .txt{font-size:13px;font-weight:500;line-height:1.7;color:var(--fg);white-space:nowrap;
  background:var(--bg2);border:1px solid var(--line2);border-radius:999px;padding:var(--s1) var(--s2)}
.onward .txt b{font-weight:700;color:var(--accent)}
.onward .arrow{direction:ltr;position:relative;width:1px;height:40px;background:linear-gradient(var(--line2),var(--fg2));animation:fall 2.2s ease-in-out infinite}
.onward .arrow::after{content:"";position:absolute;bottom:1px;left:-4px;width:9px;height:9px; /* ok:center */
  border-block-end:1px solid var(--fg2);border-inline-end:1px solid var(--fg2);transform:rotate(45deg)}
@keyframes fall{50%{transform:translateY(6px)}}

/* everything that moves inside the stage holds still while it is off screen or covered (rule 10) */
.stage.off .viz *,.stage.off .chev,.stage.off .cue,.stage.off .onward .arrow{animation-play-state:paused}

/* demo 1: a newspaper page being set */
.v-news{width:220px;height:150px;padding:var(--s2);display:flex;flex-direction:column;gap:var(--s1);
  border:1px solid var(--line2);border-radius:2px;background:var(--bg2)}
.v-news .mast{height:3px;background:var(--fg2)}
.v-news .hl{height:8px;width:72%;background:var(--accent);transform-origin:100% 50%;animation:set-hl 6s var(--ease) infinite}
[dir="ltr"] .v-news .hl{transform-origin:0 50%}
.v-news .cols{flex:1;display:grid;grid-template-columns:repeat(3,1fr);gap:var(--s1)}
.v-news .cols i{background:repeating-linear-gradient(to bottom,var(--line2) 0 2px,transparent 2px 9px);animation:set-col 6s steps(9,end) infinite}
.v-news .cols i:nth-child(2){animation-delay:.6s}.v-news .cols i:nth-child(3){animation-delay:1.2s}
@keyframes set-hl{0%{transform:scaleX(0)}15%{transform:none}}
@keyframes set-col{0%{clip-path:inset(0 0 100% 0)}45%{clip-path:inset(0)}}

/* demo 2: the agent's queue (labelled «نمایشی», rule 13; rejected rows muted, never faded, rule 4) */
.v-feed{width:300px;text-align:start;border:1px solid var(--line2);border-radius:4px;background:var(--bg2)}
.v-feed .hd{display:flex;align-items:center;gap:var(--s1);padding:var(--s1) var(--s2);border-bottom:1px solid var(--line2)}
.v-feed .hd b{font-size:13px;font-weight:700;line-height:1.7;color:var(--fg)}
.v-feed .demo{margin-inline-start:auto;font-size:13px;font-weight:500;line-height:1.5;color:var(--muted);
  border:1px solid var(--line2);border-radius:999px;padding-inline:var(--s1)}
.v-feed ol{list-style:none;padding:0;height:120px;overflow:hidden}
.v-feed li{display:grid;grid-template-columns:1fr auto;align-items:center;gap:var(--s1);height:40px;padding-inline:var(--s2);
  border-bottom:1px solid var(--line);font-size:13px;line-height:1.5}
.v-feed li:last-child{border-bottom:0}
.v-feed .t{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--fg2)}
.v-feed .v{white-space:nowrap;color:var(--muted)}
.v-feed li.no .t{color:var(--muted);text-decoration:line-through}
.v-feed li.wait .v{color:var(--accent);font-weight:500}
.v-feed li.in{animation:row-in var(--d-in) var(--ease) both}
@keyframes row-in{from{transform:translateY(-8px);opacity:0 /* ok:motion */}}

/* demo 3: posts sliding past, a new one enters from the reading end */
.v-posts{--sx:1;width:236px;height:120px;overflow:hidden;
  -webkit-mask-image:linear-gradient(90deg,transparent,#000 24px,#000 calc(100% - 24px),transparent);
          mask-image:linear-gradient(90deg,transparent,#000 24px,#000 calc(100% - 24px),transparent)}
[dir="ltr"] .v-posts{--sx:-1}
.v-posts .tr{display:flex;gap:var(--s2);width:max-content;animation:posts 7.5s cubic-bezier(.65,0,.35,1) infinite}
.v-posts i{flex:none;width:64px;height:104px;margin-top:var(--s1);border:1px solid var(--line2);border-radius:4px;
  background:linear-gradient(var(--line2),var(--line2)) 50% 8px/46px 46px no-repeat,
    linear-gradient(var(--fg2),var(--fg2)) 50% 64px/46px 3px no-repeat,
    linear-gradient(var(--line2),var(--line2)) 50% 74px/46px 3px no-repeat,var(--bg2)}
.v-posts i:nth-child(3n+2){background:linear-gradient(var(--line2),var(--line2)) 50% 8px/46px 46px no-repeat,
    linear-gradient(var(--accent),var(--accent)) 50% 64px/46px 3px no-repeat,
    linear-gradient(var(--line2),var(--line2)) 50% 74px/46px 3px no-repeat,var(--bg2)}
@keyframes posts{20%{transform:none}33%,53%{transform:translateX(calc(80px * var(--sx)))}
  66%,86%{transform:translateX(calc(160px * var(--sx)))}100%{transform:translateX(calc(240px * var(--sx)))}}

/* demo 4: a page and a phone screen being assembled */
.v-build{display:flex;align-items:flex-end;gap:var(--s2)}
.v-build .win{position:relative;width:200px;height:128px;padding:var(--s3) var(--s1) var(--s1);display:grid;
  grid-template:10px 1fr 22px / 1fr 1fr;gap:var(--s1);border:1px solid var(--line2);border-radius:4px;background:var(--bg2)}
.v-build .win::before{content:"";position:absolute;top:8px;inset-inline-start:8px;width:24px;height:6px;
  background:radial-gradient(circle,var(--line2) 2.5px,transparent 3px) 0 0/8px 6px repeat-x}
.v-build .ph{width:56px;height:100px;padding:var(--s1);display:flex;flex-direction:column;gap:var(--s1);
  border:1px solid var(--line2);border-radius:8px;background:var(--bg2)}
.v-build i{display:block;border-radius:2px;background:var(--line2);animation:pop 6s var(--ease) infinite}
.v-build .win i:nth-child(1),.v-build .win i:nth-child(2){grid-column:1/-1}
.v-build .win i:nth-child(2),.v-build .ph i:nth-child(2){background:transparent;border:1px solid var(--accent)}
.v-build .ph i:nth-child(1){height:8px}.v-build .ph i:nth-child(2){flex:1}.v-build .ph i:nth-child(3){height:14px}
.v-build .win i:nth-child(2){animation-delay:.3s}.v-build .win i:nth-child(3){animation-delay:.6s}.v-build .win i:nth-child(4){animation-delay:.9s}
.v-build .ph i:nth-child(1){animation-delay:1.2s}.v-build .ph i:nth-child(2){animation-delay:1.5s}.v-build .ph i:nth-child(3){animation-delay:1.8s}
@keyframes pop{0%,8%{transform:scale(.85);opacity:0} /* ok:motion */
  20%{transform:none;opacity:1}} /* ok:motion */

/* titles and labels arrive after the cross is drawn */
.quad:nth-child(1){--i:0}.quad:nth-child(2){--i:1}.quad:nth-child(3){--i:2}.quad:nth-child(4){--i:3}
.js .stage .quad-title,.js .stage .more{opacity:0} /* ok:motion */
.stage.on .quad-title{opacity:1;transition:opacity .45s calc(.95s + var(--i) * .06s),color .4s} /* ok:motion */
.stage.on .more{opacity:1;transition:opacity .45s calc(1.15s + var(--i) * .06s),max-height .38s,margin-top .38s,color var(--d-ui) var(--ease)} /* ok:motion */
.stage.on .quad.is-active .more{transition:max-height .45s,margin-top .45s}

/* shorter screens: smaller titles and demos */
@media (min-width:701px) and (max-height:760px){
  .quad-title{font-size:var(--t-head)}
  .viz{transform:translateX(-50%) scale(.8)}
  .quad.is-active .viz{transform:translateX(-50%) scale(.86)}
}
@media (min-width:701px) and (max-height:600px){.viz{display:none}}
@media (min-width:701px) and (max-width:1024px){
  .stage{--pad:var(--s4)}
  .viz{transform:translateX(-50%) scale(.8)}  /* keeps the demos clear of the corner cues */
  .quad.is-active .viz{transform:translateX(-50%) scale(.86)}
}

/* phones: the 2 x 2 stays; a tap opens the quadrant in a full-screen card */
@media (max-width:700px){
  .stage{--hub:72px;--arm:52px;--pad:var(--s2)}
  .quad-inner{padding-bottom:var(--s3)}
  .quad-title{font-size:var(--t-head)}
  .more{font-size:13px}
  .viz{transform:translateX(-50%) scale(.56)}
  .onward,.cue{display:none}  /* as in the reference's phone layout */
}
.qpop{position:fixed;inset:var(--bar-h) 0 0;width:100%;max-width:none;height:auto;max-height:none;margin:0;padding:0;border:0;
  background:var(--bg);color:inherit;transform:scale(.5);opacity:0; /* ok:motion */
  transition:opacity .2s linear,transform .35s cubic-bezier(.4,0,.2,1)}
.qpop.on{transform:none;opacity:1} /* ok:motion */
.qpop::backdrop{background:transparent}
.qpop-scroll{position:absolute;inset:0;overflow-y:auto;overscroll-behavior:contain;padding:var(--s6) var(--s2) var(--s4)}
.qpop-x{position:absolute;top:var(--s1);inset-inline-end:var(--s1);z-index:5;width:44px;height:44px;border:0;border-radius:50%;background:var(--bg2);cursor:pointer}
.qpop-x i{position:absolute;left:50%;top:50%;width:18px;height:2px;border-radius:1px;background:var(--fg);transform:translate(-50%,-50%) rotate(45deg)} /* ok:center */
.qpop-x i+i{transform:translate(-50%,-50%) rotate(-45deg)}
.qpop .quad{width:min(100%,480px);min-height:calc(100svh - var(--bar-h) - var(--s8));margin-inline:auto;cursor:auto;
  border:1px solid var(--line2);border-radius:18px;background:var(--q-active)}
.qpop .quad-inner{max-width:none;align-items:flex-start;text-align:start;padding:var(--s5) var(--s3) var(--s3)}
.qpop .quad-title{font-size:var(--t-head);opacity:1} /* ok:motion */
.qpop .qt{cursor:default}
.qpop .more{display:none}
.qpop .reveal{max-height:none;margin-top:var(--s2);visibility:visible;transform:none;opacity:1} /* ok:motion */
.qpop .reveal .acts{justify-content:flex-start}
.qpop .viz,.qpop .quad.is-active .viz{top:var(--s4);transform:translateX(-50%) scale(.9);opacity:1} /* ok:decor */

/* 12. Contact and footer (step 5)
   The contact section slides over the pinned stage, so it is at least one screen tall and opaque (.after).
   Wide: copy at inline-start; threads leave the node after the email and spread to the inline-end edge. */
.contact{min-height:100vh;min-height:100svh;display:flex;align-items:center;overflow:hidden;
  padding-block:calc(var(--bar-h) + var(--s6)) var(--s7);scroll-margin-top:calc(var(--bar-h) * -1)}
.contact .wrap{position:relative;z-index:1;width:100%}
.contact .col{width:min(100%,600px)}
.contact .kick{font-size:var(--t-small);font-weight:500;line-height:1.7;color:var(--muted)}
.contact h2{margin-top:var(--s2);text-wrap:balance}
.contact .sub{margin-top:var(--s3)}
.mail-row{display:flex;align-items:center;margin-top:var(--s5)}
.mail{display:inline-flex;align-items:center;min-height:44px;unicode-bidi:isolate;
  font-size:min(var(--t-head),7vw);font-weight:500;line-height:1.45;color:var(--fg);text-decoration:none;
  transition:color var(--d-ui) var(--ease)}
.mail:hover{color:var(--accent)}
.mail-row .thread{flex:1;height:1px;margin-inline-start:var(--s2);background:var(--accent);transform-origin:100% 50%}
[dir="ltr"] .mail-row .thread{transform-origin:0 50%}
.mail-row .node{flex:none;width:0;height:1px}
.mail-acts{display:flex;align-items:center;gap:var(--s2);margin-top:var(--s2)}
.copied{font-size:var(--t-small);font-weight:500;line-height:1.7;color:var(--muted)}
html:not(.js) #copy{display:none}
.paths{display:grid;grid-template-columns:1fr 1fr;gap:var(--s2);margin-top:var(--s5)}
.path{display:flex;flex-direction:column;gap:var(--s1);min-height:44px;padding:var(--s3);text-decoration:none;
  border:1px solid var(--line2);border-radius:4px;background:var(--bg2);transition:border-color var(--d-ui) var(--ease)}
.path:hover{border-color:var(--fg)}
.path b{font-size:var(--t-body);font-weight:700;line-height:1.7;color:var(--fg)}
.path span{font-size:var(--t-small);font-weight:400;line-height:1.7;color:var(--fg2)}
.path .go{margin-top:auto;padding-top:var(--s1);font-style:normal;font-size:var(--t-small);font-weight:700;line-height:1.7;color:var(--accent)}
.path .go::after{content:" \2190"}
[dir="ltr"] .path .go::after{content:" \2192"}
@media (max-width:719px){.paths{grid-template-columns:1fr}}
@media (max-width:959px){.mail-row .thread{display:none}}

.fan{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible}
.fan path{fill:none;stroke:var(--fg);stroke-width:1;stroke-opacity:var(--a)} /* ok:decor */
.fan path.hot{stroke:var(--accent);stroke-opacity:.5} /* ok:decor */
.fan path.pulse{stroke:var(--accent);stroke-width:2;stroke-dasharray:4 96;stroke-dashoffset:4;stroke-opacity:1; /* ok:decor */
  animation:pulse 3.4s linear var(--dl) infinite}
@keyframes pulse{from{stroke-dashoffset:4}to{stroke-dashoffset:-96}}
/* arrival: the orange line grows out of the email, then the threads draw outward */
.js .contact:not(.drawn) .mail-row .thread{transform:scaleX(0)}
.contact.drawn .mail-row .thread{transition:transform .6s var(--q-ease)}
.js .fan path:not(.pulse){stroke-dasharray:100;stroke-dashoffset:100}
.contact.drawn .fan path:not(.pulse){stroke-dashoffset:0;transition:stroke-dashoffset 1.4s var(--q-ease) var(--dl)}
.js .contact:not(.drawn) .fan .pulse{visibility:hidden}
.contact.off .fan .pulse{animation-play-state:paused}
@media (prefers-reduced-motion:reduce){.fan .pulse{display:none}}

.foot{border-top:1px solid var(--line);padding-block:var(--s3)}
.foot .wrap{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:var(--s2)}
.foot p{font-size:var(--t-small);font-weight:400;line-height:1.7;color:var(--muted)}
.foot b{font-weight:700;color:var(--fg2)}
.foot a{display:inline-flex;align-items:center;min-height:44px;font-size:var(--t-small);font-weight:500;line-height:1.7;color:var(--fg2);text-decoration:none}
.foot a:hover{color:var(--fg)}
