/* SweetFox's Pixel look (Settings > Browsing > Look). Off unless pixel.js sets html[data-px]: the
   Classic look is untouched by this file. In Pixel the layout, colours and glass stay as they are and
   the grain changes: a pixel typeface, corners cut in 2 px steps instead of curves, glass with a pixel
   frame, pixel icons (pixel.js) and loading states that move in steps. Sprites in assets/px. */

/* ---------- the typeface: Pixelify Sans (OFL, fonts/OFL-pixelify-sans.txt), served from here ---------- */
/* fetched only when something on the page uses it, so Classic never downloads it */
@font-face { font-family: "Pixelify Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/pixelify-sans-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; }
@font-face { font-family: "Pixelify Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/pixelify-sans-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Pixelify Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/pixelify-sans-cyrillic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
html[data-px], html[data-px][data-theme] {
  --font-body: "Pixelify Sans", "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-label: "Pixelify Sans", "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* corners: two steps of 2 px (controls), three (pictures and cards), and a single nick (small tags) */
  --px-step: polygon(6px 0, calc(100% - 6px) 0, calc(100% - 6px) 2px, calc(100% - 2px) 2px, calc(100% - 2px) 6px, 100% 6px, 100% calc(100% - 6px), calc(100% - 2px) calc(100% - 6px), calc(100% - 2px) calc(100% - 2px), calc(100% - 6px) calc(100% - 2px), calc(100% - 6px) 100%, 6px 100%, 6px calc(100% - 2px), 2px calc(100% - 2px), 2px calc(100% - 6px), 0 calc(100% - 6px), 0 6px, 2px 6px, 2px 2px, 6px 2px);
  --px-step3: polygon(10px 0, calc(100% - 10px) 0, calc(100% - 10px) 2px, calc(100% - 6px) 2px, calc(100% - 6px) 4px, calc(100% - 4px) 4px, calc(100% - 4px) 6px, calc(100% - 2px) 6px, calc(100% - 2px) 10px, 100% 10px, 100% calc(100% - 10px), calc(100% - 2px) calc(100% - 10px), calc(100% - 2px) calc(100% - 6px), calc(100% - 4px) calc(100% - 6px), calc(100% - 4px) calc(100% - 4px), calc(100% - 6px) calc(100% - 4px), calc(100% - 6px) calc(100% - 2px), calc(100% - 10px) calc(100% - 2px), calc(100% - 10px) 100%, 10px 100%, 10px calc(100% - 2px), 6px calc(100% - 2px), 6px calc(100% - 4px), 4px calc(100% - 4px), 4px calc(100% - 6px), 2px calc(100% - 6px), 2px calc(100% - 10px), 0 calc(100% - 10px), 0 10px, 2px 10px, 2px 6px, 4px 6px, 4px 4px, 6px 4px, 6px 2px, 10px 2px);
  --px-nick: polygon(2px 0, calc(100% - 2px) 0, calc(100% - 2px) 2px, 100% 2px, 100% calc(100% - 2px), calc(100% - 2px) calc(100% - 2px), calc(100% - 2px) 100%, 2px 100%, 2px calc(100% - 2px), 0 calc(100% - 2px), 0 2px, 2px 2px);
  /* a faint 2 px checker, for anything still loading */
  --px-dither: repeating-conic-gradient(rgba(255, 255, 255, .045) 0 25%, transparent 0 50%) 0 0 / 4px 4px;
}
html[data-px], html[data-px] :is(body, button, input, select, textarea) { font-family: var(--font-body); }
html[data-px] #kboot { font-family: "Pixelify Sans", "Plus Jakarta Sans", system-ui, sans-serif !important; }

/* ---------- no curves anywhere ---------- */
html[data-px] *, html[data-px] *::before, html[data-px] *::after { border-radius: 0 !important; }
html[data-px] input[type="range"]::-webkit-slider-thumb { border-radius: 0; }
html[data-px] input[type="range"]::-moz-range-thumb { border-radius: 0; }

/* ---------- pixel icons (pixel.js puts the sprite in --i; the icon takes its button's colour) ---------- */
svg[data-px] {
  display: inline-block;
  flex: none;
  background: currentColor;
  -webkit-mask: var(--i) 50% 50% / 100% 100% no-repeat;
  mask: var(--i) 50% 50% / 100% 100% no-repeat;
}

/* ---------- controls: stepped corners ---------- */
html[data-px] :is(.kbtn, .kbtn-round, .kh-toggle, .kh-rail-nav, .MediaRow-module__cgKaXa__nav, .kino-card-play, .kcard-mute, .btnPrimary, .btnGhost, .btnHeroGlass, .chip, .iconCircle, .iconCircleGlass, .ov-choice, .ov-toggle, .ov-pills, .ov-pill-ind, .kn-pill, .kn-hover, .kn-dpill, .kn-icon, .kn-dicon, .kn-search input, #toast) { clip-path: var(--px-step); }
html[data-px] :is(.ov-knob, .kn-badge, .MediaCard-module__ksxplG__flag:not(.MediaCard-module__ksxplG__flagRank), .kino-4k-tag, .kcard-timer) { clip-path: var(--px-nick); }
/* pictures on cards: three steps (ranked cards keep their own notched outline) */
html[data-px] .MediaCard-module__ksxplG__imageWrap:not([data-notch]) { clip-path: var(--px-step3); }

/* glass controls: the pixel frame in place of the soft ring */
html[data-px] :is(.kbtn-glass, .kbtn-round, .kh-toggle, .kh-rail-nav, .MediaRow-module__cgKaXa__nav, .iconCircleGlass, .btnHeroGlass, .kcard-mute) {
  border: 1px solid transparent;
  border-image: url(/assets/px/glass-s.svg) 14 / 14px stretch;
  box-shadow: none;
  image-rendering: pixelated;
}
/* the trailer's timer on the mute button: a stepped 2 px frame along the button's own outline that lights up
   clockwise, in place of the round ring (which the stepped corners cut into four arcs). kino.js gives --kring 0..1. */
@property --kring-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
html[data-px] .kring { inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); transform: none; animation: none; clip-path: polygon(evenodd, 6px 0, calc(100% - 6px) 0, calc(100% - 6px) 2px, calc(100% - 2px) 2px, calc(100% - 2px) 6px, 100% 6px, 100% calc(100% - 6px), calc(100% - 2px) calc(100% - 6px), calc(100% - 2px) calc(100% - 2px), calc(100% - 6px) calc(100% - 2px), calc(100% - 6px) 100%, 6px 100%, 6px calc(100% - 2px), 2px calc(100% - 2px), 2px calc(100% - 6px), 0 calc(100% - 6px), 0 6px, 2px 6px, 2px 2px, 6px 2px, 6px 0, 8px 2px, calc(100% - 8px) 2px, calc(100% - 8px) 4px, calc(100% - 4px) 4px, calc(100% - 4px) 8px, calc(100% - 2px) 8px, calc(100% - 2px) calc(100% - 8px), calc(100% - 4px) calc(100% - 8px), calc(100% - 4px) calc(100% - 4px), calc(100% - 8px) calc(100% - 4px), calc(100% - 8px) calc(100% - 2px), 8px calc(100% - 2px), 8px calc(100% - 4px), 4px calc(100% - 4px), 4px calc(100% - 8px), 2px calc(100% - 8px), 2px 8px, 4px 8px, 4px 4px, 8px 4px, 8px 2px); background: conic-gradient(rgba(255, 255, 255, .95) calc(var(--kring, 0) * 1turn), rgba(255, 255, 255, .22) 0); }
html[data-px] .kring circle { display: none; }
html[data-px] .kring.is-spin { background: conic-gradient(from var(--kring-a), rgba(255, 255, 255, .95) 0 18%, rgba(255, 255, 255, .22) 0); animation: pxRing 1s steps(12) infinite; }
@keyframes pxRing { to { --kring-a: 360deg; } }
html[data-px][data-perf="1"] .kring.is-spin { animation: none; }

/* quiet controls: one faint pixel line */
html[data-px] :is(.btnGhost, .chip, .iconCircle, .ov-choice:not(.is-on)) {
  border: 1px solid transparent;
  border-image: url(/assets/px/edge.svg) 14 / 14px stretch;
  box-shadow: none;
  image-rendering: pixelated;
}
/* solid white controls: a shaded foot, like a key */
html[data-px] :is(.kbtn-play, .btnPrimary, .kn-pill, .kn-dpill, .ov-pill-ind, .ov-choice.is-on, .ov-toggle.is-on) { box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .2); }
html[data-px] :is(.kbtn, .btnPrimary, .btnGhost):active { transform: translateY(2px); }

/* ---------- the nav: bars of pixel glass ---------- */
/* A stepped outline, a frame cut in nine from glass.svg, the page blurred behind, a tint, and a band of
   light that crosses now and then. pixel.js keeps the bars on whole pixels. */
html[data-px] :is(.kn-shell, .kn-dock, .kn-mbell, .kn-macct) {
  border: 1px solid transparent;
  border-image: url(/assets/px/glass.svg) 14 / 14px stretch;
  clip-path: var(--px-step);
  background: linear-gradient(180deg, rgba(196, 228, 255, .17), rgba(126, 170, 230, .06) 60%, rgba(90, 130, 200, .1)), rgba(16, 22, 36, .4);
  -webkit-backdrop-filter: blur(14px) saturate(1.8) brightness(1.08);
  backdrop-filter: blur(14px) saturate(1.8) brightness(1.08);
  box-shadow: none;
  image-rendering: pixelated;
}
html[data-px] .kn-wrap.is-scrolled .kn-shell, html[data-px] .kn-dock { background: linear-gradient(180deg, rgba(196, 228, 255, .14), rgba(126, 170, 230, .05) 60%, rgba(90, 130, 200, .08)), rgba(12, 16, 28, .8); }
html[data-px][data-lite="1"] :is(.kn-shell, .kn-dock, .kn-mbell, .kn-macct) { background: linear-gradient(180deg, rgba(196, 228, 255, .12), rgba(126, 170, 230, .04) 60%, rgba(90, 130, 200, .07)), rgba(13, 16, 26, .94); }
/* the band of light, moving in steps */
html[data-px] :is(.kn-shell, .kn-dock)::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -90px;
  width: 80px;
  background: url(/assets/px/sheen.svg) 0 0 / 80px 62px no-repeat;
  image-rendering: pixelated;
  pointer-events: none;
  animation: pxSheen 11s steps(44) infinite;
}
@keyframes pxSheen { 0%, 62% { left: -90px; } 100% { left: 100%; } }
html[data-px]:is([data-perf="1"], [data-light="1"], .k-on-watch) :is(.kn-shell, .kn-dock)::after { display: none; }
html[data-px] .kn-badge, html[data-px] .kn-mbell .kn-badge { box-shadow: none; top: 3px; right: 3px; }
html[data-px] .kn-div { width: 2px; }
html[data-px] :is(.kn-brand, .kn-mbrand) { letter-spacing: 0; }
/* the fox, drawn live by pixel.js in place of the picture */
.px-live > img { display: none; }
.px-fox { display: block; flex: none; width: 24px; height: 24px; overflow: visible; }
.px-hop .px-fox, .px-hop::before { animation: pxHop .34s steps(4); }
@keyframes pxHop { 40% { transform: translateY(-4px); } 70% { transform: translateY(-2px); } }

/* ---------- loading: blocks, a checker grain, and motion in steps ---------- */
html[data-px] :is(#kboot .kb-hero, #kboot .kb-row i) { clip-path: var(--px-step3); background-image: var(--px-dither); }
html[data-px] #kboot .kb-h { clip-path: var(--px-nick); }
html[data-px] :is(#kboot .kb-hero, #kboot .kb-row i)::after { animation-timing-function: steps(9); }
html[data-px] .kh-wait { background-image: var(--px-dither); }
html[data-px] :is(.card-skeleton, .MediaCard-module__ksxplG__skelImg, .MediaCard-module__ksxplG__skelTitle, .MediaCard-module__ksxplG__skelYear, .kprof-skel i, .kprof-skel b, .kst-skel i, .kfr-skel) { background-image: var(--px-dither); animation-timing-function: steps(5) !important; }
html[data-px] :is(.card-skeleton, .MediaCard-module__ksxplG__skelImg, .kprof-skel b, .kst-skel i) { clip-path: var(--px-step3); }
html[data-px] .MediaCard-module__ksxplG__imageWrap:not(.kimg-in) { background-image: var(--px-dither); }
html[data-px] .MediaCard-module__ksxplG__imageWrap:not(.kimg-in)::after { animation-timing-function: steps(8); }
/* the spinner: eight blocks, one step at a time */
html[data-px] :is(.kspin, .kspin.is-sm) { position: relative; border: 0; background: none; animation: pxSpin .8s steps(8) infinite; }
html[data-px] .kspin::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  color: inherit;
  box-shadow: 0 -8px 0 var(--kino, #ff8a00), 6px -6px 0 currentColor, 8px 0 0 color-mix(in srgb, currentColor 75%, transparent), 6px 6px 0 color-mix(in srgb, currentColor 58%, transparent), 0 8px 0 color-mix(in srgb, currentColor 44%, transparent), -6px 6px 0 color-mix(in srgb, currentColor 32%, transparent), -8px 0 0 color-mix(in srgb, currentColor 22%, transparent), -6px -6px 0 color-mix(in srgb, currentColor 13%, transparent);
}
html[data-px] .kspin.is-sm::before { width: 2px; height: 2px; margin: -1px 0 0 -1px; box-shadow: 0 -6px 0 #7f82ff, 4px -4px 0 currentColor, 6px 0 0 color-mix(in srgb, currentColor 75%, transparent), 4px 4px 0 color-mix(in srgb, currentColor 58%, transparent), 0 6px 0 color-mix(in srgb, currentColor 44%, transparent), -4px 4px 0 color-mix(in srgb, currentColor 32%, transparent), -6px 0 0 color-mix(in srgb, currentColor 22%, transparent), -4px -4px 0 color-mix(in srgb, currentColor 13%, transparent); }
@keyframes pxSpin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  html[data-px] :is(.kn-shell, .kn-dock)::after { display: none; }
  .px-hop .px-fox, .px-hop::before { animation: none; }
}
