/* The subscription's card (15.1053, 15.1067, 15.1083) - the kit's `metalPlate()` (/kit/metalcard.js); moved from the
   subscription's module by 15.1171: the landing's tariff shows the same card */
/* the card: a plate with its own dark ground and white ink in both themes (contrast at its lightest corner - 7.9),
   a thickness under it, the glare after the pointer */
.sub-card-holder { position: relative; display: grid; place-items: center; perspective: 1100px; padding-block: var(--sp-200); }
/* 15.1283, 15.2445 («В мобилке нажимается не так как на лендинге»): a finger on the card turns it wherever the card stands -
   the page is not scrolled under it (the landing had it alone, «Подписка» gave the touch to the scroll) */
.sub-card-holder { touch-action: none; }
/* 15.3014 («На некоторых экранах есть прокрутка вправо»): the card's place leaning in 3D stood 44 px past a phone's edge and
   scrolled the screen sideways; its lean is cut sideways a gutter past the holder - the metal layer lives in the page */
.sub-card-holder { overflow-x: clip; overflow-clip-margin: var(--sp-300); }
/* 15.1083: the metal card (ui/metal.js) - a canvas over the place, the page's own drawing kept as the place */
.sub-metal { position: absolute; left: 50%; top: 50%; translate: -50% -50%; pointer-events: none;
             filter: drop-shadow(0 22px 28px rgba(8, 10, 30, 0.45)); }
/* 15.2101: the metal as a layer of the page over the screen and its head, laid over the card's place - nothing cuts it;
   15.2243: under the drawer, the menus, the windows and the notices, which it covered */
.sub-metal.sub-metal-top { position: fixed; left: 0; top: 0; translate: none; z-index: calc(var(--z-drawer) - 2); }
.sub-metal.sub-metal-top[hidden] { display: none; }
/* 15.2485, 15.2487: inside what holds the card (the landing, «Подписка»), the layer scrolls with it, never a frame late */
.sub-metal.sub-metal-top.sub-metal-page { position: absolute; }
/* 15.2243: the phone's drawer lives in the shell's own layer: the card goes while the drawer is open */
.sub-metal.sub-metal-top { transition: opacity var(--dur-fold) var(--ease-out); }
html[data-nav="drawer"][data-nav-open] .sub-metal.sub-metal-top { opacity: 0; }
.sub-card.sub-card-cast { visibility: hidden; animation: none; }
.sub-card {
  --lean-x: 0deg; --lean-y: 0deg; --glare-x: 30%; --glare-y: 20%;
  position: relative; width: 100%; max-width: 440px; aspect-ratio: 1.586;
  border-radius: 24px; /* вне шкалы: a card's corner as a payment card's */
  color: #fff;
  transform-style: preserve-3d;
  transform: rotateX(var(--lean-x)) rotateY(var(--lean-y));
  transition: transform 0.7s var(--ease-out);
  animation: sub-card-float 7s ease-in-out infinite;
}
.sub-card.held { transition: transform 0.12s linear; }
@keyframes sub-card-float {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -10px; }
}
.sub-card-depth, .sub-card-face, .sub-card-glare { position: absolute; inset: 0; border-radius: inherit; }
.sub-card-depth {
  transform: translateZ(-10px);
  background: color-mix(in srgb, var(--acc-solid) 30%, #05060a);
  box-shadow: 0 34px 60px -24px rgba(8, 10, 30, 0.6), 0 14px 26px -14px rgba(8, 10, 30, 0.45);
}
.sub-card-face {
  display: flex; flex-direction: column; gap: var(--sp-100); padding: var(--sp-300);
  background:
    linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.10) 44%, transparent 58%),
    radial-gradient(90% 120% at 100% 0%, color-mix(in srgb, var(--acc) 72%, transparent) 0%, transparent 62%),
    radial-gradient(70% 90% at 0% 100%, color-mix(in srgb, var(--acc-solid) 40%, transparent) 0%, transparent 70%),
    linear-gradient(140deg, color-mix(in srgb, var(--acc-solid) 62%, #07080d) 0%, #0b0c13 82%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.sub-card-glare {
  transform: translateZ(1px); pointer-events: none;
  background: radial-gradient(circle at var(--glare-x) var(--glare-y), rgba(255, 255, 255, 0.30), transparent 46%);
  mix-blend-mode: soft-light;
}
.sub-card-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-200); }
.sub-card-mark { display: block; color: #fff; }
.sub-card-mark > svg { display: block; width: 104px; height: auto; }
.sub-card-plan {
  padding: var(--sp-050) var(--sp-150); border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.14); color: #fff; font-size: var(--fs-s); line-height: var(--lh-s);
}
.sub-card-company {
  margin-top: auto; color: #fff;
  font-family: Manrope, Inter, sans-serif; font-weight: var(--fw-semi); font-size: var(--fs-num-s); line-height: 1.2;
  overflow-wrap: anywhere;
}
.sub-card-foot { display: flex; justify-content: space-between; gap: var(--sp-200); }
.sub-card-label { color: rgba(255, 255, 255, 0.72); font-size: var(--fs-s); line-height: var(--lh-s); }
.sub-card-value { color: #fff; font-size: var(--fs-l); line-height: var(--lh-l); font-weight: var(--fw-semi); }

@media (prefers-reduced-motion: reduce) { .sub-card { animation: none; } }
[data-motion="calm"] .sub-card { animation: none; }

/* 15.2106: the page's own card as the metal, flat - what shows while the metal loads and where it cannot - so the card never
   changes into another one: the metal's colour brushed, the words pressed in a darker shade */
.sub-card.sub-card-metal { color: rgba(18, 18, 22, 0.82); }
.sub-card.sub-card-metal .sub-card-depth { background: color-mix(in srgb, var(--metal) 55%, #000); }
.sub-card.sub-card-metal .sub-card-face {
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.045) 0 1px, rgba(0, 0, 0, 0.03) 1px 2px),
    linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.28) 44%, transparent 58%),
    linear-gradient(140deg, color-mix(in srgb, var(--metal) 86%, #000) 0%, color-mix(in srgb, var(--metal) 76%, #000) 50%, color-mix(in srgb, var(--metal) 60%, #000) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}
.sub-card.sub-card-metal :is(.sub-card-mark, .sub-card-company, .sub-card-value, .sub-card-plan) {
  color: rgba(18, 18, 22, 0.78); text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}
.sub-card.sub-card-metal .sub-card-label { color: rgba(18, 18, 22, 0.62); text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4); }
.sub-card.sub-card-metal .sub-card-plan { background: none; padding-inline: 0; }
/* 15.2981 («либо загрузка карточки либо сама карточка. что на лендинге что на экране подписки»): the landing's
   waiting place moved into the kit - «Подписка» waits the same way. 15.1364 («в загрузке вот эта хуйня висит зачем-то»), 15.2631 («УБРАТЬ ЕЁ… ОСТАВИТЬ ТОЛЬКО НОРМАЛЬНУЮ, А ПОКА ГРУЗИТСЯ -
   СВЕЧЕНИЕ, А НЕ… РАМКУ»): the page's own flat drawing of the card is never shown while the metal can be made; its place
   holds a glow and nothing else - no outline, no shape of a card: a halo with a bright heart that breathes and a thin
   streak of light across it (15.2629: «Какое-нибудь свечение, сияние… Будто бы она сейчас там появится»); the made card comes out of
   that light. The kit says the state on the holder (`data-metal`: wait, made, none) and on the layer
   (`sub-metal-wait`, `sub-metal-in`) */
.sub-card-holder { --metal-seed-heart: color-mix(in srgb, var(--metal, var(--acc)) 16%, #fff); /* own colour: the white heart of the metal's light */
  --metal-seed-body: color-mix(in srgb, var(--metal, var(--acc)) 58%, transparent);
  --metal-seed-ray: color-mix(in srgb, var(--metal, var(--acc)) 34%, #fff); } /* own colour: the white heart of the metal's light */
/* on a light ground white light is not seen: the glow takes the metal's colour */
html[data-theme="light"] .sub-card-holder { --metal-seed-heart: color-mix(in srgb, var(--metal, var(--acc)) 78%, #fff); /* own colour: the white heart of the metal's light */
  --metal-seed-body: color-mix(in srgb, var(--metal, var(--acc)) 46%, transparent);
  --metal-seed-ray: color-mix(in srgb, var(--metal, var(--acc)) 88%, #fff); } /* own colour: the white heart of the metal's light */
.sub-card-holder > .sub-card { grid-area: 1 / 1; }
.sub-card-holder::before,
.sub-card-holder::after {
  content: ""; grid-area: 1 / 1; width: 100%; max-width: 440px; aspect-ratio: 1.586; pointer-events: none; opacity: 0;
}
.sub-card-holder::before {
  background: radial-gradient(closest-side, var(--metal-seed-heart) 0%, var(--metal-seed-body) 30%,
    color-mix(in srgb, var(--metal-seed-body) 34%, transparent) 62%, transparent 100%);
  filter: blur(20px); /* вне шкалы: the glow's softness */
}
.sub-card-holder::after {
  background:
    radial-gradient(closest-side, var(--metal-seed-ray) 0%, color-mix(in srgb, var(--metal-seed-ray) 55%, transparent) 30%, transparent 100%)
      center / 100% 6px no-repeat,
    radial-gradient(closest-side, var(--metal-seed-ray) 0%, transparent 100%) center / 46% 26px no-repeat;
  filter: blur(2.5px); /* вне шкалы: the streak's softness */
}
.sub-card-holder:not([data-metal="none"]) > .sub-card:not(.sub-card-cast) { opacity: 0; }
.sub-card-holder[data-metal="wait"]::before { opacity: 1; animation: metal-seed-breathe 3.2s ease-in-out infinite; }
.sub-card-holder[data-metal="wait"]::after {
  opacity: 1; animation: metal-seed-shine 3.2s ease-in-out infinite; }
/* the card has come: the light swells once and is gone */
.sub-card-holder[data-metal="made"]::before { animation: metal-seed-burst .8s var(--ease-out) both; }
.sub-card-holder[data-metal="made"]::after { animation: metal-seed-burst .5s var(--ease-out) both; }
/* no metal at all (a browser without WebGL): the page's own drawing is the only card there can be */
.sub-card-holder[data-metal="none"] > .sub-card:not(.sub-card-cast) {
  animation: sub-card-float 7s ease-in-out infinite, metal-plate-late .5s var(--ease-out) backwards; }
@keyframes metal-plate-late { from { opacity: 0; } }
@keyframes metal-seed-breathe { 0%, 100% { opacity: .62; scale: .9; } 50% { opacity: 1; scale: 1.06; } }
@keyframes metal-seed-shine { 0%, 100% { opacity: .45; scale: .62 1; } 50% { opacity: 1; scale: 1 1; } }
@keyframes metal-seed-burst { 0% { opacity: .9; scale: 1; } 30% { opacity: 1; scale: 1.18; } 100% { opacity: 0; scale: 1.5; } }
/* the metal's layer: unseen until the card arrives, then it comes out of the light */
.sub-metal.sub-metal-wait { opacity: 0; }
.sub-metal.sub-metal-in { animation: metal-arrive .9s var(--ease-out) both; }
@keyframes metal-arrive {
  0%   { opacity: 0; scale: .92; filter: drop-shadow(0 22px 28px rgba(8, 10, 30, 0)) brightness(1.8) blur(8px); } /* own colour: the card's shadow, as .sub-metal's */
  45%  { opacity: 1; filter: drop-shadow(0 22px 28px rgba(8, 10, 30, 0.2)) brightness(1.28) blur(0); } /* own colour: the card's shadow, as .sub-metal's */
  100% { opacity: 1; scale: 1; filter: drop-shadow(0 22px 28px rgba(8, 10, 30, 0.45)) brightness(1) blur(0); } /* own colour: the card's shadow, as .sub-metal's */
}
@media (prefers-reduced-motion: reduce) {
  .sub-card-holder::before, .sub-card-holder::after, .sub-metal.sub-metal-in { animation: none !important; }
  .sub-card-holder[data-metal="wait"]::after { opacity: .7; }
  .sub-card-holder[data-metal="made"]::before, .sub-card-holder[data-metal="made"]::after { opacity: 0; }
}
html[data-motion="calm"] .sub-card-holder::before, html[data-motion="calm"] .sub-card-holder::after,
html[data-motion="calm"] .sub-metal.sub-metal-in { animation: none; }
html[data-motion="calm"] .sub-card-holder[data-metal="made"]::before,
html[data-motion="calm"] .sub-card-holder[data-metal="made"]::after { opacity: 0; }
