/* The site's video player, for /js/player.js. Hand-written, not a build output: the porter does
   not write this file. It reads the site's own tokens from system.css (the accent, the text and
   numeral faces, the card radius) and falls back to plain values if a page has not loaded them.
   Every number a reader sees is on the numeral face, as everywhere else on the site. */
.vp{
  --vp-accent:var(--accent,#FF8A56);
  --vp-ink:#FFFFFF;
  --vp-dim:rgba(255,255,255,.72);
  --vp-panel:rgba(18,18,20,.94);
  --vp-lift:0px;
  position:relative; display:block; width:100%; aspect-ratio:16/9; max-width:100%;
  background:#000; color:var(--vp-ink); border-radius:var(--r-card,8px); overflow:hidden;
  container-type:inline-size; isolation:isolate;
  font:400 14px/1.35 var(--f-text,system-ui,-apple-system,"Segoe UI",sans-serif);
  -webkit-tap-highlight-color:transparent; outline:none;
}
.vp video{display:block; width:100%; height:100%; object-fit:contain; background:#000}
.vp--on{aspect-ratio:auto}
.vp--on video{cursor:pointer}
.vp__stage{position:relative; aspect-ratio:16/9; overflow:hidden; background:#000}
.vp:focus-visible{box-shadow:0 0 0 3px var(--vp-accent)}
.vp:fullscreen, .vp--full{border-radius:0; width:100%; height:100%}
.vp--full .vp__stage{position:absolute; inset:0; aspect-ratio:auto}
.vp--full.vp--idle, .vp--full.vp--idle video{cursor:none}

/* The cover, laid over the picture again when the film has ended. Clicks pass through to the film. */
.vp__cover{position:absolute; inset:0; z-index:1; width:100%; height:100%; object-fit:contain; pointer-events:none; display:none}
.vp--cover .vp__cover{display:block}

/* The large play button, over the cover before the film plays and again once it has ended. It is light with a shadow so
   that it reads on a dark frame and on the film's white pages alike. After that the bar's own
   button plays, pauses and plays again, so a paused frame and the last frame are left clean; in
   full screen, where the bar hides, the large button comes back whenever the film is paused. */
.vp__big{
  position:absolute; left:50%; top:50%; z-index:3; width:clamp(56px,8cqw,80px); aspect-ratio:1;
  margin:0; padding:0; transform:translate(-50%,-50%); border:0; border-radius:50%;
  background:rgba(255,255,255,.94); color:#111; cursor:pointer; display:grid; place-items:center;
  box-shadow:0 6px 22px rgba(0,0,0,.32); transition:background-color .15s, color .15s, transform .15s, opacity .2s;
}
.vp__big svg{width:44%; height:44%; margin-left:7%}
.vp__big:hover{background:var(--vp-accent); color:#FFFFFF}
.vp__big:focus-visible{outline:3px solid var(--vp-accent); outline-offset:3px}
.vp:not(.vp--paused) .vp__big, .vp:not(.vp--fresh):not(.vp--full) .vp__big, .vp--ended .vp__big{
  opacity:0; pointer-events:none; transform:translate(-50%,-50%) scale(.9)}

/* The control bar: below the picture on the page, over it in full screen. */
.vp__bar{position:relative; z-index:4; padding:4px 8px 4px; background:#111214}
.vp--full .vp__bar{
  position:absolute; left:0; right:0; bottom:0; padding:30px 12px 8px;
  background:linear-gradient(to top,rgba(0,0,0,.78),rgba(0,0,0,.4) 62%,rgba(0,0,0,0));
  transition:opacity .25s, transform .25s;
}
.vp--full.vp--idle .vp__bar{opacity:0; transform:translateY(8px); pointer-events:none}
.vp__row{display:flex; align-items:center; gap:2px}
.vp__gap{flex:1}
.vp__btn{
  width:40px; height:40px; margin:0; padding:0; border:0; border-radius:var(--r-sq,5px);
  background:transparent; color:var(--vp-ink); cursor:pointer; display:grid; place-items:center;
  flex:none; transition:background-color .15s, color .15s;
}
.vp__btn svg{width:22px; height:22px}
.vp__btn:hover{background:rgba(255,255,255,.14)}
.vp__btn:focus-visible{outline:2px solid var(--vp-ink); outline-offset:-2px}
.vp__cc[aria-pressed="true"]{color:var(--vp-accent)}
.vp__set[aria-expanded="true"], .vp__voice[aria-expanded="true"]{background:rgba(255,255,255,.14)}

/* The narration button, on a film narrated in more than one language: the narration playing, named in
   its own language and face, beside the captions button. On a small player it shrinks to the code. */
.vp__voice{width:auto; padding:0 11px 0 9px; display:inline-flex; gap:7px; white-space:nowrap; font:inherit; font-size:13px; line-height:1}
.vp__voice svg{width:20px; height:20px; flex:none}
.vp__voice:lang(ar) .vp__vl{font-family:"Vazirmatn",var(--f-text,"Rubik"),system-ui,"Segoe UI",sans-serif; font-size:14px}
.vp__vs{display:none; letter-spacing:.04em}
.vp__time{
  margin:0 8px; white-space:nowrap; color:var(--vp-dim);
  font:400 13px/1 var(--f-num,"IBM Plex Mono",ui-monospace,monospace); font-variant-numeric:tabular-nums;
}

/* Ranges: the seek bar and the volume. Both are real <input type=range>, so the keyboard and
   assistive technology get a slider for nothing; the look is drawn over them. */
.vp__range{
  -webkit-appearance:none; appearance:none; margin:0; padding:0; background:transparent;
  cursor:pointer; height:18px; outline:none;
}
.vp__range::-webkit-slider-runnable-track{height:4px; border-radius:2px; background:transparent}
.vp__range::-moz-range-track{height:4px; border-radius:2px; background:transparent}
.vp__range::-webkit-slider-thumb{
  -webkit-appearance:none; appearance:none; width:14px; height:14px; margin-top:-5px; border:0;
  border-radius:50%; background:var(--vp-ink); box-shadow:0 0 0 1px rgba(0,0,0,.25);
}
.vp__range::-moz-range-thumb{width:14px; height:14px; border:0; border-radius:50%; background:var(--vp-ink)}
.vp__range:focus-visible::-webkit-slider-thumb{box-shadow:0 0 0 3px var(--vp-accent)}
.vp__range:focus-visible::-moz-range-thumb{box-shadow:0 0 0 3px var(--vp-accent)}

.vp__seek{position:relative; height:18px; margin:0 6px 2px; --p:0%; --b:0%}
.vp__seek::before, .vp__buf, .vp__seek::after{
  content:""; position:absolute; left:0; top:7px; height:4px; border-radius:2px; pointer-events:none;
  transition:height .12s, top .12s;
}
.vp__seek::before{right:0; background:rgba(255,255,255,.26)}
.vp__buf{width:var(--b); background:rgba(255,255,255,.46)}
.vp__seek::after{width:var(--p); background:var(--vp-accent)}
.vp__seek:hover::before, .vp__seek:hover .vp__buf, .vp__seek:hover::after{top:6px; height:6px}
.vp__range--seek{position:absolute; inset:0; width:100%; height:18px}
.vp__range--seek::-webkit-slider-thumb{transform:scale(0); transition:transform .12s}
.vp__seek:hover .vp__range--seek::-webkit-slider-thumb,
.vp__range--seek:focus-visible::-webkit-slider-thumb,
.vp__range--seek:active::-webkit-slider-thumb{transform:scale(1)}
.vp__tip{
  position:absolute; bottom:22px; transform:translateX(-50%); padding:4px 7px; border-radius:4px;
  background:var(--vp-panel); color:var(--vp-ink); pointer-events:none; opacity:0; transition:opacity .12s;
  font:400 12px/1 var(--f-num,"IBM Plex Mono",ui-monospace,monospace); font-variant-numeric:tabular-nums;
}
.vp__seek--hover .vp__tip{opacity:1}

.vp__vol{display:flex; align-items:center; --v:100%}
.vp__range--vol{
  width:0; opacity:0; transition:width .18s, opacity .18s, margin .18s;
  background:linear-gradient(to right,var(--vp-ink) var(--v),rgba(255,255,255,.3) var(--v)) center/100% 4px no-repeat;
}
.vp__vol:hover .vp__range--vol, .vp__vol:focus-within .vp__range--vol{width:76px; opacity:1; margin:0 8px 0 2px}

/* The menu: captions, speed and quality. */
.vp__menu{
  position:absolute; right:10px; bottom:68px; z-index:5; min-width:180px; max-height:calc(100% - 84px);
  overflow-y:auto; padding:6px; border-radius:var(--r-card,8px); background:var(--vp-panel);
  box-shadow:0 12px 30px rgba(0,0,0,.35);
}
.vp__menu[hidden]{display:none}
.vp__mg + .vp__mg{margin-top:4px; padding-top:4px; border-top:1px solid rgba(255,255,255,.14)}
.vp__mh{margin:0; padding:8px 10px 4px; color:var(--vp-dim); font-size:12px; letter-spacing:.04em}
.vp__mi{
  display:flex; align-items:center; gap:10px; width:100%; margin:0; padding:8px 10px 8px 30px;
  border:0; border-radius:var(--r-sq,5px); background:transparent; color:var(--vp-ink); text-align:left;
  font:inherit; cursor:pointer; position:relative;
}
.vp__mi:hover, .vp__mi:focus-visible{background:rgba(255,255,255,.12); outline:none}
.vp__mi[aria-checked="true"]::before{
  content:""; position:absolute; left:11px; top:50%; width:9px; height:5px; margin-top:-4px;
  border:solid var(--vp-accent); border-width:0 0 2px 2px; transform:rotate(-45deg);
}

.vp--full .vp__menu{bottom:100px}

/* Captions, drawn by the player, at the foot of the picture where the film was laid out to take
   them. In full screen they rise above the controls while the controls show. */
.vp__cap{position:absolute; inset:0; z-index:2; pointer-events:none}
.vp--full:not(.vp--idle) .vp__cap, .vp--full.vp--paused .vp__cap{--vp-lift:96px}
.vp__capfoot{
  position:absolute; left:4%; right:4%; bottom:calc(.6% + var(--vp-lift)); display:flex;
  flex-direction:column; align-items:center; gap:.2em; transition:bottom .25s;
}
.vp__cue{
  max-width:100%; text-align:center; white-space:pre-line;
  font-size:max(13px,2.7cqw); line-height:1.38;
}
.vp__cue--at{position:absolute; left:5%; right:5%}

/* Captions in Latin letters are in the site's text face, Rubik, at 400 and never heavier. Arabic and Farsi
   captions are in Vazirmatn, and so are their names in the caption menu. The face covers only the Arabic
   script, so a Latin word inside an Arabic line, the product's name, stays in Rubik. A browser fetches it
   only when an Arabic or Farsi track is turned on. */
@font-face{
  font-family:"Vazirmatn";
  src:url("/fonts/Vazirmatn-regular.woff2") format("woff2");
  font-weight:400; font-style:normal; font-display:swap;
  unicode-range:U+0600-06FF,U+0750-077F,U+08A0-08FF,U+FB50-FDFF,U+FE70-FEFF,U+200C-200F;
}
.vp__cue:lang(ar), .vp__cue:lang(fa), .vp__mi:lang(ar), .vp__mi:lang(fa){
  font-family:"Vazirmatn",var(--f-text,"Rubik"),system-ui,"Segoe UI",sans-serif; font-weight:400}
.vp__cuetext{
  background:rgba(0,0,0,.74); color:#FFFFFF; padding:.06em .38em; border-radius:2px;
  -webkit-box-decoration-break:clone; box-decoration-break:clone;
}

/* Waiting for data, a jump flash on double tap, and an error. */
.vp__wait{
  position:absolute; left:50%; top:50%; z-index:3; width:44px; height:44px; margin:-22px 0 0 -22px;
  border:3px solid rgba(255,255,255,.28); border-top-color:var(--vp-ink); border-radius:50%;
  opacity:0; pointer-events:none; animation:vp-spin .8s linear infinite;
}
.vp--wait:not(.vp--paused) .vp__wait{opacity:1}
@keyframes vp-spin{to{transform:rotate(360deg)}}
.vp__flash{
  position:absolute; top:50%; z-index:3; padding:10px 16px; border-radius:999px; margin-top:-20px;
  background:rgba(0,0,0,.6); opacity:0; pointer-events:none;
  font:400 15px/1 var(--f-num,"IBM Plex Mono",ui-monospace,monospace);
}
.vp__flash--l{left:12%}
.vp__flash--r{right:12%}
.vp__flash--go{animation:vp-flash .6s ease-out}
@keyframes vp-flash{0%{opacity:1}70%{opacity:1}100%{opacity:0}}
.vp__note{
  position:absolute; left:50%; bottom:50%; z-index:6; transform:translate(-50%,50%); max-width:80%;
  margin:0; padding:12px 16px; border-radius:var(--r-card,8px); background:var(--vp-panel); text-align:center;
}
.vp__note:empty{display:none}
.vp__sr{position:absolute; width:1px; height:1px; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap}

/* A film set as a page's figure, and the narration beneath it for a reader who cannot play sound. */
.band--film .figwide{margin-top:0}
.vp-script{margin:var(--s3,12px) 0 0; font:var(--fx-desc,400 13px/1.55 system-ui); color:var(--ink-mid,#4B5563)}
.vp-script summary{cursor:pointer; color:var(--accent-text,#C55213); width:max-content; max-width:100%}
.vp-script summary:focus-visible{outline:2px solid var(--accent-text,#C55213); outline-offset:3px}
.vp-script__b{max-width:var(--measure,68ch); padding-top:var(--s3,12px)}
.vp-script__b p{margin:0 0 .8em; font-size:var(--t-small,14.5px); line-height:1.65; color:var(--ink-mid,#4B5563)}

/* Small players and touch screens: bigger targets, fewer controls. */
@container (max-width:560px){
  .vp__back, .vp__fwd, .vp__pip{display:none}
  .vp__time{font-size:12px; margin:0 4px}
  .vp__vl{display:none}
  .vp__vs{display:inline}
  .vp__voice{padding:0 8px 0 7px; gap:5px}
}
/* A phone-sized player: the row must hold play, the time, the narration, captions, settings and full
   screen. A 360 px phone had no room for the full-screen button even before the narration came. */
@container (max-width:420px){
  .vp__row{gap:0}
  .vp__time{margin:0 3px}
  .vp__voice svg{display:none}
  .vp__voice{padding:0 7px}
}
@container (max-width:300px){
  .vp__voice{display:none}                         /* the settings menu still offers the narration */
}
@media (pointer:coarse){
  .vp__btn{width:44px; height:44px}
  .vp__voice{width:auto; min-width:44px}
  .vp__range--vol{display:none}
  /* A phone has its own volume buttons, so a small touch player gives the mute button's room to the rest. */
  @container (max-width:420px){ .vp__vol{display:none} }
  @container (max-width:340px){ .vp__btn{width:40px} .vp__voice{min-width:40px} }
}
@media (prefers-reduced-motion:reduce){
  .vp *, .vp *::before, .vp *::after{transition:none !important; animation-duration:0s !important}
  .vp__wait{animation:none}
}
