/* ==========================================================================
   The winter scene behind the sign-in, account and admin pages
   (Views/Shared/_WinterScene.cshtml): the landing hero's sky with a low sun, Ararat under snow on
   the horizon (Views/Shared/_AraratSvg.cshtml) and snow falling (js/pages/landing-snow.js). At
   night (html[data-theme="dark"]) the sky turns deep blue with stars and a full moon, and Ararat
   stands in moonlight; the sky, stars, moon and mountain colours repeat
   css/pages/landing-winter.css and landing-winter-night.css.

   .tw-scene--soft is the quieter day version for working pages (account, admin): a pale sky that
   keeps dark text readable, the mountains faint, and the snow in light blue so it shows on it.
   ========================================================================== */

/* ---------- The scene: fixed behind the whole page ---------- */
.tw-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  /* The landing hero's day sky */
  background:
    radial-gradient(46% 60% at 88% 6%, rgba(255, 246, 204, 0.6) 0%, transparent 62%),
    linear-gradient(180deg, #1b5fa6 0%, #2b78c0 40%, #559fd9 70%, #bfe0f5 100%);
}

/* The low sun's haze, top right, and a thin cloud drifting low on the left */
.tw-scene-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  will-change: transform;
}

.tw-scene-glow--sun {
  right: -8%;
  top: -18%;
  width: 560px;
  height: 560px;
  background: #fff3c4;
  opacity: 0.42;
  animation: tw-scene-drift 20s ease-in-out infinite alternate;
}

.tw-scene-glow--haze {
  left: -12%;
  bottom: 18%;
  width: 520px;
  height: 360px;
  background: #fff;
  opacity: 0.2;
  animation: tw-scene-drift 26s ease-in-out -8s infinite alternate-reverse;
}

/* Ararat stands on the bottom edge; its last dune is the snow the cookie link sits on */
.tw-scene .lp-ararat {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  width: 100%;
  height: clamp(190px, 34vh, 340px);
}

/* Wide screens: the card covers the middle of the screen, where the drawing's peaks are. Drawn
   1.6 screens wide from the left edge, the panorama puts Masis in the open sky right of the card. */
@media (min-width: 992px) {
  .tw-scene .lp-ararat {
    right: auto;
    width: 160%;
  }
}

/* Ararat by day (the drawing's own colours are its night ones) */
.tw-scene .lp-ar-rock-1 { stop-color: #7fa3c2; }
.tw-scene .lp-ar-rock-2 { stop-color: #557fa3; }
.tw-scene .lp-ar-rock-3 { stop-color: #3d6489; }
.tw-scene .lp-ar-far-1 { stop-color: #a9cde8; }
.tw-scene .lp-ar-far-2 { stop-color: #7fb0d6; }
.tw-scene .lp-ar-far { opacity: 0.8; }
.tw-scene .lp-ar-shade { fill: #1d4268; opacity: 0.22; }
.tw-scene .lp-ar-hill { fill: #2a4f72; }

/* The stars and the moon belong to the night */
.tw-scene .lp-night-stars,
.tw-scene .lp-moon {
  display: none;
}

.tw-scene-snow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* The close flakes fall in front of the card */
.tw-scene-snow--front {
  position: fixed;
  z-index: 4;
  pointer-events: none;
}

/* ---------- The scene at night ---------- */
html[data-theme="dark"] .tw-scene {
  background:
    radial-gradient(34% 40% at 90% 74%, rgba(150, 200, 245, 0.2) 0%, transparent 70%),
    radial-gradient(60% 70% at 88% 4%, rgba(229, 238, 128, 0.12) 0%, transparent 60%),
    radial-gradient(70% 46% at 50% 100%, rgba(110, 190, 225, 0.3) 0%, transparent 70%),
    linear-gradient(180deg, #030a14 0%, #06142a 32%, #0b2440 62%, #153d5b 86%, #1f526f 100%);
}

html[data-theme="dark"] .tw-scene-glow--sun {
  background: #e5ee80;
  opacity: 0.14;
}

html[data-theme="dark"] .tw-scene-glow--haze {
  background: #4aa6d8;
  opacity: 0.18;
}

/* Stars: two tiled fields of dots, thinning out towards the horizon; the second one twinkles */
html[data-theme="dark"] .tw-scene .lp-night-stars {
  display: block;
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.4px 1.4px at 22px 34px, #fff 55%, transparent 60%),
    radial-gradient(1px 1px at 96px 118px, #dff2ff 55%, transparent 60%),
    radial-gradient(1.6px 1.6px at 168px 52px, #fff 55%, transparent 60%),
    radial-gradient(1px 1px at 236px 146px, #fff 55%, transparent 60%),
    radial-gradient(1.2px 1.2px at 304px 86px, #dff2ff 55%, transparent 60%),
    radial-gradient(1.4px 1.4px at 372px 22px, #fff 55%, transparent 60%);
  background-size: 420px 180px;
  opacity: 0.75;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 40%, transparent 80%);
  mask-image: linear-gradient(180deg, #000 0%, #000 40%, transparent 80%);
}

html[data-theme="dark"] .tw-scene .lp-night-stars::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.8px 1.8px at 64px 78px, #fff 55%, transparent 60%),
    radial-gradient(1.2px 1.2px at 212px 26px, #cfeaff 55%, transparent 60%),
    radial-gradient(2px 2px at 388px 164px, #fff 55%, transparent 60%),
    radial-gradient(1.2px 1.2px at 470px 96px, #fdf9d2 55%, transparent 60%),
    radial-gradient(1.6px 1.6px at 548px 214px, #fff 55%, transparent 60%);
  background-size: 610px 260px;
  animation: tw-scene-twinkle 4.6s ease-in-out infinite alternate;
}

@keyframes tw-scene-twinkle {
  from {
    opacity: 0.25;
  }
  to {
    opacity: 1;
  }
}

/* The moon: a full disc with three faint seas and a wide halo, low on the right over the hills */
html[data-theme="dark"] .tw-scene .lp-moon {
  display: block;
  position: absolute;
  right: 8%;
  bottom: calc(clamp(190px, 34vh, 340px) - 30px);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 64% 30%, rgba(150, 176, 202, 0.42) 0 10%, transparent 12%),
    radial-gradient(circle at 34% 60%, rgba(150, 176, 202, 0.36) 0 14%, transparent 16%),
    radial-gradient(circle at 70% 70%, rgba(150, 176, 202, 0.3) 0 7%, transparent 9%),
    radial-gradient(circle at 36% 30%, #ffffff 0%, #f1f6fb 40%, #d6e3ef 76%, #bccfe1 100%);
  box-shadow:
    0 0 0 8px rgba(200, 225, 250, 0.05),
    0 0 40px 10px rgba(190, 220, 250, 0.34),
    0 0 130px 46px rgba(120, 180, 240, 0.2);
  animation: tw-scene-moon 7s ease-in-out infinite alternate;
}

@keyframes tw-scene-moon {
  to {
    box-shadow:
      0 0 0 10px rgba(200, 225, 250, 0.07),
      0 0 52px 14px rgba(190, 220, 250, 0.42),
      0 0 150px 56px rgba(120, 180, 240, 0.24);
  }
}

@media (max-width: 575.98px) {
  html[data-theme="dark"] .tw-scene .lp-moon {
    width: 40px;
    height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme="dark"] .tw-scene .lp-night-stars::after,
  html[data-theme="dark"] .tw-scene .lp-moon {
    animation: none;
  }
}

/* Ararat in moonlight; the snowy plain in blue shade, its last dune the page's night colour */
html[data-theme="dark"] .tw-scene .lp-ar-rock-1 { stop-color: #46708a; }
html[data-theme="dark"] .tw-scene .lp-ar-rock-2 { stop-color: #24465c; }
html[data-theme="dark"] .tw-scene .lp-ar-rock-3 { stop-color: #132c3d; }
html[data-theme="dark"] .tw-scene .lp-ar-far-1 { stop-color: #3f7389; }
html[data-theme="dark"] .tw-scene .lp-ar-far-2 { stop-color: #1c4257; }
html[data-theme="dark"] .tw-scene .lp-ar-far { opacity: 0.5; }
html[data-theme="dark"] .tw-scene .lp-ar-shade { fill: #050f1a; opacity: 0.34; }
html[data-theme="dark"] .tw-scene .lp-ar-hill { fill: #07131f; }
html[data-theme="dark"] .tw-scene .lp-ar-dune-1 { stop-color: #6f93b3; }
html[data-theme="dark"] .tw-scene .lp-ar-dune-2 { stop-color: #35577a; }
html[data-theme="dark"] .tw-scene .lp-ar-front-1 { stop-color: #84a6c4; }
html[data-theme="dark"] .tw-scene .lp-ar-front-2 { stop-color: #12263b; }


@keyframes tw-scene-drift {
  to {
    transform: translate(-9%, 12%) scale(1.15);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tw-scene-glow {
    animation: none;
  }
}

/* ---------- The soft day version, for working pages ---------- */
.tw-scene--soft {
  background:
    radial-gradient(46% 50% at 92% 0%, rgba(255, 246, 204, 0.55) 0%, transparent 62%),
    linear-gradient(180deg, #d5e8f5 0%, #e9f2f8 30%, #f4f8fa 62%);
}

.tw-scene--soft .tw-scene-glow--sun {
  opacity: 0.3;
}

.tw-scene--soft .tw-scene-glow--haze {
  opacity: 0.12;
}

.tw-scene--soft .lp-ararat {
  height: clamp(150px, 26vh, 260px);
  opacity: 0.38;
}

/* At night the working pages take the full night scene, mountains included */
html[data-theme="dark"] .tw-scene--soft .lp-ararat {
  opacity: 0.7;
}

html[data-theme="dark"] .tw-scene--soft {
  background:
    radial-gradient(60% 70% at 88% 4%, rgba(229, 238, 128, 0.1) 0%, transparent 60%),
    radial-gradient(70% 46% at 50% 100%, rgba(110, 190, 225, 0.22) 0%, transparent 70%),
    linear-gradient(180deg, #030a14 0%, #06142a 32%, #0b2440 62%, #10304b 100%);
}

/* ---------- The light snowfall in front of every page (Views/Shared/_WinterSnow.cshtml) ---------- */
.tw-snow-veil {
  position: fixed;
  inset: 0;
  z-index: 1080; /* over everything, sticky bars and dialogs included; it never takes a click */
  width: 100%;
  height: 100%;
  pointer-events: none;
}

@media print {
  .tw-scene,
  .tw-snow-veil {
    display: none !important;
  }
}

/* ---------- The short band at the top of the hotel pages (Views/Shared/_Layout.cshtml) ----------
   The same scene, held in a strip that runs up behind the floating header (80px: 10px above, the
   60px bar, 10px below) instead of filling the screen */
.tw-scene-band {
  position: relative;
  height: calc(80px + 140px);
  margin-top: -80px;
  overflow: hidden;
}

.tw-scene-band .tw-scene {
  position: absolute;
  z-index: 0;
}

/* The whole panorama across the band: in a short strip, the wide-screen shift (160% wide, Masis
   beside the sign-in card) would make the drawing too tall and crop the peaks */
.tw-scene-band .tw-scene .lp-ararat {
  right: 0;
  width: 100%;
  height: 120px;
}

@media (min-width: 992px) {
  .tw-scene-band {
    height: calc(80px + 170px);
  }

  .tw-scene-band .tw-scene .lp-ararat {
    right: 0;
    width: 100%;
    height: 150px;
  }
}

html[data-theme="dark"] .tw-scene-band .tw-scene .lp-moon {
  bottom: 96px;
  width: 44px;
  height: 44px;
}
