/* Hamyari film (DESIGN.md: one moment per viewport, alternating alignment, --sw-dur-film).
   Page mode: sections in the Community page. Reel mode: full screen, one moment at a time. */
.hf{position:relative;margin-block:3rem;color:var(--text)}
.hf-moment{min-height:min(78svh,720px);display:flex;flex-direction:column;justify-content:center;gap:1.1rem;padding:3rem clamp(1rem,5vw,4rem);
  transition:opacity var(--sw-dur-film) var(--sw-ease-out),translate var(--sw-dur-film) var(--sw-ease-out)}
/* hidden only once sw-film.js has armed the section: without the script every moment is simply shown */
.hf.is-armed .hf-moment:not(.is-in){opacity:0;translate:0 calc(16px * var(--sw-move))}
.hf-m1{align-items:center;text-align:center}
.hf-m2{align-items:flex-start;text-align:start}
.hf-m3{align-items:flex-end;text-align:end}
.hf-m4{align-items:center;text-align:center}
.hf-kicker{display:inline-flex;gap:.5rem;align-items:center;color:var(--neon);font-weight:700;font-size:.95rem}
.hf-statement{max-width:22ch;font-size:clamp(2rem,5.4vw,4.2rem);font-weight:800;line-height:1.25;text-wrap:balance}
[lang="en"] .hf-statement{max-width:24ch;line-height:1.12;letter-spacing:-.02em}
.hf-title{max-width:28ch;font-size:clamp(1.5rem,3.2vw,2.4rem);font-weight:800;line-height:1.4;text-wrap:balance}
.hf-label{font-size:clamp(1.3rem,2.6vw,1.9rem);font-weight:800;color:var(--neon)}
.hf-number{display:flex;align-items:baseline;gap:.7rem;direction:inherit;font-variant-numeric:tabular-nums;line-height:1}
.hf-number span{font-size:clamp(3.6rem,12vw,9rem);font-weight:800;transition:color var(--sw-dur-base)}
.hf-number small{font-size:clamp(1rem,2.2vw,1.5rem);color:var(--muted);font-weight:700}
.hf.is-zero .hf-number span{color:var(--neon);text-shadow:0 0 42px var(--accent-shadow)}
.hf-sub{color:var(--muted);font-size:1.05rem;max-width:40ch}
.hf-close{max-width:26ch;font-size:clamp(1.6rem,3.8vw,3rem);font-weight:800;line-height:1.35;text-wrap:balance}
.hf-cta{margin-top:.4rem}
.hf-fine{max-width:52ch;color:var(--muted);font-size:.92rem;line-height:1.9}

/* The diagram: real mechanism, pulses travel along the wires in reading order. */
.hf-diagram{position:relative;width:min(100%,760px);aspect-ratio:640/300;margin:0}
.hf-diagram svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
[dir="rtl"] .hf-diagram svg{transform:scaleX(-1)}
.hf-wires path{fill:none;stroke:color-mix(in oklab,var(--neon) 22%,transparent);stroke-width:2;stroke-linecap:round}
.hf-pulses path{fill:none;stroke:var(--neon);stroke-width:3;stroke-linecap:round;stroke-dasharray:46 900;stroke-dashoffset:946;opacity:0;
  filter:drop-shadow(0 0 6px var(--accent-shadow))}
.hf-m2.is-in .hf-pulses path{opacity:1;animation:hf-pulse 2.8s var(--sw-ease-in-out) var(--d,0s) infinite}
@keyframes hf-pulse{0%{stroke-dashoffset:946}70%,100%{stroke-dashoffset:0}}
.hf-nodes{list-style:none;margin:0;padding:0}
.hf-node{position:absolute;display:flex;flex-direction:column;align-items:center;gap:.35rem;width:8.5rem;text-align:center;
  translate:calc(-50% * var(--sw-dir)) -50%;font-size:.88rem;font-weight:700;
  transition:opacity var(--sw-dur-slow) var(--sw-ease-out),scale var(--sw-dur-slow) var(--sw-ease-spring)}
.hf-node i{display:grid;place-items:center;width:3.3rem;height:3.3rem;border-radius:1rem;background:var(--glass);border:1px solid var(--line);color:var(--neon);font-size:1.15rem;
  box-shadow:0 10px 30px rgba(0,0,0,.25)}
.hf.is-armed .hf-m2:not(.is-in) .hf-node{opacity:0;scale:calc(1 - .15 * var(--sw-move))}
.hf-node.n1{inset-inline-start:14.06%;top:26.7%;transition-delay:0ms}
.hf-node.n2{inset-inline-start:50%;top:26.7%;transition-delay:120ms}
.hf-node.n3{inset-inline-start:85.94%;top:26.7%;transition-delay:240ms}
.hf-node.n4{inset-inline-start:85.94%;top:73.3%;transition-delay:360ms}
.hf-node.n5{inset-inline-start:50%;top:73.3%;transition-delay:480ms}
.hf-node.n6{inset-inline-start:14.06%;top:80%;transition-delay:600ms}
@media (max-width:560px){.hf-node{width:5.6rem;font-size:.74rem}.hf-node i{width:2.6rem;height:2.6rem;font-size:.95rem}}

/* Reel: full screen, one moment at a time (recording). */
.hf-reel{position:fixed;inset:0;z-index:9500;margin:0;overflow:hidden;background:var(--page)}
.hf-reel .hf-moment{position:absolute;inset:0;min-height:0;padding:clamp(1.5rem,6vw,6rem)}
/* one scene at a time: the old one fades out first, the new one fades in after it (no double image) */
.hf-reel .hf-moment:not(.is-current){opacity:0;translate:0 0;pointer-events:none;transition:opacity 380ms var(--sw-ease-in-out)}
.hf-reel .hf-moment.is-current{opacity:1;transition:opacity 620ms var(--sw-ease-out) 400ms,translate var(--sw-dur-film) var(--sw-ease-out) 400ms}
.hf-reel .hf-moment.hf-m2,.hf-reel .hf-moment.hf-m3{align-items:center;text-align:center}
@media (orientation:portrait){
  .hf-reel .hf-statement{font-size:clamp(2.2rem,9vw,4.6rem)}
  .hf-reel .hf-number span{font-size:clamp(4rem,19vw,9rem)}
  .hf-reel .hf-diagram{width:100%}
}
@media (prefers-reduced-motion:reduce){
  .hf-moment{translate:none}
  .hf-m2.is-in .hf-pulses path{animation:none;stroke-dasharray:none;stroke-dashoffset:0;opacity:.6}
  .hf-node{scale:1}
}
/* Reel mode covers the whole screen, so nothing under it needs painting: the animated dragon
   background, the header's glass blur and the support button cost ~80% of each frame in headless
   recording (12 fps -> 60 fps measured on 2026-11-12). Visually identical. */
body[data-film="reel"] :is(.dragon-overlay,.site-header,.site-footer,.support-widget,.skip-link,#loader){display:none!important}

/* ---- Reel scale (recording only; page mode untouched). The frame is the canvas: landscape is sized
   from the height (vh), portrait from the width (vw), about 2x the page sizes. The closing scene shows
   headline, button and one short condition from the terms; the legal paragraph stays on the page. */
.hf-cond{display:none}
.hf-reel .hf-cond{display:block;max-width:none;font-size:3.9vh;line-height:1.6;color:color-mix(in oklab,var(--muted) 70%,var(--text));font-weight:600}
/* the note breaks only at its <br> (no word left alone on the last line) */
.hf-reel .hf-cond span{white-space:nowrap}
.hf-reel .hf-fine,.hf-reel .hf-m3 .hf-sub{display:none}
.hf-reel .hf-moment{gap:4vh;padding:6vh 6vw}
.hf-reel .hf-kicker{font-size:3.2vh;gap:1vh}
.hf-reel .hf-statement{max-width:20ch;font-size:8.6vh;line-height:1.32}
.hf-reel .hf-title{max-width:26ch;font-size:5.4vh;line-height:1.4}
.hf-reel .hf-diagram{width:min(84vw,138vh)}
.hf-reel .hf-node{width:26vh;font-size:3.8vh;gap:1.1vh;line-height:1.25;text-wrap:balance}
/* the larger labels cross the wires: a page-coloured backing keeps them clean (the wire passes behind) */
.hf-reel .hf-node span{background:var(--page);padding:.15vh .9vh;border-radius:1vh}
.hf-reel .hf-node i{width:8.4vh;height:8.4vh;border-radius:2.2vh;font-size:3.6vh}
.hf-reel .hf-label{font-size:5.2vh}
.hf-reel .hf-number{gap:2vh}
.hf-reel .hf-number span{font-size:26vh}
.hf-reel .hf-number small{font-size:4vh}
.hf-reel .hf-close{max-width:20ch;font-size:8.4vh;line-height:1.35}
.hf-reel .hf-cta{font-size:3.4vh;padding:2vh 4.4vh;border-radius:2.2vh;gap:1.4vh}
@media (orientation:portrait){
  .hf-reel .hf-moment{gap:4.5vh;padding:9vh 6vw}
  .hf-reel .hf-kicker{font-size:4.2vw}
  .hf-reel .hf-statement{max-width:13ch;font-size:11vw;line-height:1.36}
  [lang="en"] .hf-reel .hf-statement{max-width:14ch;font-size:10.4vw;line-height:1.14}
  .hf-reel .hf-title{max-width:16ch;font-size:7.6vw}
  .hf-reel .hf-diagram{width:96vw}
  .hf-reel .hf-node{width:22vw;font-size:3.4vw;gap:1.4vw}
  .hf-reel .hf-node i{width:10.5vw;height:10.5vw;border-radius:2.8vw;font-size:4.6vw}
  .hf-reel .hf-label{font-size:7.4vw}
  .hf-reel .hf-number{flex-direction:column;align-items:center;gap:1.5vh}
  .hf-reel .hf-number span{font-size:21vw}
  .hf-reel .hf-number small{font-size:5.4vw}
  .hf-reel .hf-close{max-width:13ch;font-size:10.6vw}
  .hf-reel .hf-cta{font-size:4.8vw;padding:2.6vw 6vw;border-radius:3vw;gap:2vw}
  .hf-reel .hf-cond{font-size:5.6vw;max-width:none}
}
/* the count ends on a word, not a digit (a Persian zero reads as a bullet) */
.hf-reel .hf-number span.is-word{letter-spacing:0}
/* with the word, "Toman / month" would read "free Toman a month": the unit goes in the same frame
   as the swap to the word, so the word sits centred */
.hf-reel.is-zero .hf-number small{display:none}

/* Portrait reel: the six steps as a tall vertical chain (icon + label per row, reading order) instead
   of the wide diagram, so the scene fills a phone screen; a light pulse runs down the line. */
@media (orientation:portrait){
  .hf-reel .hf-diagram{width:max-content;max-width:88vw;aspect-ratio:auto;align-self:center}
  .hf-reel .hf-diagram svg{display:none}
  .hf-reel .hf-nodes{position:relative;display:flex;flex-direction:column;gap:3.4vh}
  .hf-reel .hf-node{position:relative;inset:auto;top:auto;translate:none;width:auto;flex-direction:row;align-items:center;
    text-align:start;gap:5vw;font-size:5.4vw;line-height:1.3}
  .hf-reel .hf-node{z-index:1}
  .hf-reel .hf-node i{flex:none;width:15vw;height:15vw;border-radius:4vw;font-size:6.4vw;background:linear-gradient(var(--glass),var(--glass)),var(--page)}
  .hf-reel .hf-nodes::before,.hf-reel .hf-nodes::after{content:"";position:absolute;inset-inline-start:7.5vw;width:4px;margin-inline-start:-2px;border-radius:4px}
  .hf-reel .hf-nodes::before{top:7.5vw;bottom:7.5vw;background:color-mix(in oklab,var(--neon) 22%,transparent)}
  .hf-reel .hf-nodes::after{top:7.5vw;height:12vh;background:linear-gradient(transparent,var(--neon),transparent);opacity:0;
    filter:drop-shadow(0 0 6px var(--accent-shadow))}
  .hf-reel .hf-m2.is-in .hf-nodes::after{opacity:1;animation:hf-run 2.8s var(--sw-ease-in-out) .6s infinite}
}
@keyframes hf-run{from{top:7.5vw}to{top:calc(100% - 7.5vw - 12vh)}}
