:root {
  --bg: #080b13;
  --bg-elevated: #0e1420;
  --panel: rgba(17, 24, 38, 0.86);
  --panel-solid: #111826;
  --panel-soft: rgba(255, 255, 255, 0.045);
  --text: #f5f7ff;
  --muted: #a7b1c8;
  --muted-strong: #cbd2e5;
  --line: rgba(223, 231, 255, 0.1);
  --line-strong: rgba(223, 231, 255, 0.18);
  --brand: #7d7aff;
  --brand-strong: #6767ef;
  --brand-soft: rgba(125, 122, 255, 0.16);
  --green: #61e29b;
  --green-soft: rgba(97, 226, 155, 0.13);
  --orange: #ffb078;
  --danger: #ff9f9f;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.3);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

html[data-theme="light"] {
  --bg: #f4f7fc;
  --bg-elevated: #e9eef9;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-solid: #ffffff;
  --panel-soft: rgba(24, 38, 64, 0.045);
  --text: #142038;
  --muted: #66748e;
  --muted-strong: #46536d;
  --line: rgba(27, 44, 74, 0.11);
  --line-strong: rgba(27, 44, 74, 0.19);
  --brand-soft: rgba(112, 104, 238, 0.12);
  --green-soft: rgba(55, 177, 108, 0.12);
  --shadow: 0 24px 60px rgba(53, 72, 105, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  scroll-padding-top: 104px;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  padding-right: var(--safe-right);
  padding-left: var(--safe-left);
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body.is-scroll-locked {
  overflow: hidden;
}

.page-loader {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 45%, rgba(119, 125, 255, 0.24), transparent 28%),
    var(--bg);
  transition: opacity 0.52s ease, visibility 0.52s step-end;
}

.page-loader.is-hidden {
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.52s ease, visibility 0.52s step-end;
}

.page-loader-inner {
  display: grid;
  justify-items: center;
  gap: 14px;
  color: var(--text);
}

.page-loader-mark {
  position: relative;
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
  padding: 6px;
  border: 1px solid rgba(239, 246, 255, 0.28);
  border-radius: 26px;
  background: linear-gradient(145deg, #95ffd6, #7c8cff 66%, #756bf0);
  box-shadow: 0 20px 48px rgba(102, 107, 240, 0.28);
  animation: loader-bob 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) infinite alternate;
}

.page-loader-mark::after {
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(137, 155, 255, 0.42);
  border-radius: 31px;
  content: "";
  animation: loader-ring 1.5s ease-out infinite;
}

.page-loader-mark img {
  width: 100%;
  height: 100%;
}

.page-loader-name {
  font-size: 20px;
  font-weight: 850;
  letter-spacing: -0.05em;
}

.page-loader-line {
  width: 120px;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
}

.page-loader-line::after {
  display: block;
  width: 50%;
  height: 100%;
  border-radius: inherit;
  content: "";
  background: linear-gradient(90deg, #82f5bc, #8796ff);
  animation: loader-line 0.92s ease-in-out infinite alternate;
}

@keyframes loader-bob {
  from { transform: translateY(-5px) rotate(-2deg); }
  to { transform: translateY(5px) rotate(2deg); }
}

@keyframes loader-ring {
  from { opacity: 0.7; transform: scale(0.84); }
  to { opacity: 0; transform: scale(1.25); }
}

@keyframes loader-line {
  from { transform: translateX(-100%); }
  to { transform: translateX(200%); }
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-old(root) {
  z-index: 1;
}

::view-transition-new(root) {
  z-index: 2;
}

.theme-ripple {
  position: fixed;
  z-index: 999;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0);
  transform-origin: center;
  transition: transform 0.68s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.theme-ripple.is-covering {
  transform: translate(-50%, -50%) scale(var(--ripple-scale, 85));
}

.theme-ripple.is-contracting {
  animation: theme-ripple-contract 0.68s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes theme-ripple-contract {
  from { transform: translate(-50%, -50%) scale(var(--ripple-scale, 85)); }
  to { transform: translate(-50%, -50%) scale(0); }
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid rgba(118, 132, 255, 0.72);
  outline-offset: 3px;
}

.container {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: 10px;
  color: #0e1320;
  background: #ffffff;
  transform: translateY(-160%);
  transition: transform 0.18s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.space-background {
  position: fixed;
  z-index: -2;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle at 16% 0%, rgba(88, 107, 255, 0.25), transparent 27%),
    radial-gradient(circle at 94% 5%, rgba(142, 94, 255, 0.2), transparent 24%),
    radial-gradient(circle at 56% 82%, rgba(59, 222, 161, 0.08), transparent 29%),
    var(--bg);
}

.space-background::before,
.space-background::after {
  position: absolute;
  content: "";
}

.space-background::before {
  inset: 0;
  opacity: 0.78;
  background-image:
    radial-gradient(circle at 8% 20%, rgba(218, 227, 255, 0.72) 0 1px, transparent 1.5px),
    radial-gradient(circle at 42% 72%, rgba(218, 227, 255, 0.45) 0 1px, transparent 1.5px),
    radial-gradient(circle at 74% 31%, rgba(218, 227, 255, 0.46) 0 1px, transparent 1.5px),
    radial-gradient(circle at 91% 78%, rgba(218, 227, 255, 0.55) 0 1px, transparent 1.5px);
  background-size: 150px 150px, 210px 210px, 175px 175px, 240px 240px;
  animation: star-drift 28s linear infinite;
}

.space-background::after {
  inset: 0;
  opacity: 0.44;
  background:
    radial-gradient(circle at 88% 66%, rgba(117, 136, 255, 0.18), transparent 24%),
    radial-gradient(circle at 15% 88%, rgba(87, 226, 161, 0.11), transparent 25%);
  transform: translateY(calc(var(--scroll-shift, 0px) * -0.22));
  transition: transform 0.45s ease-out;
}

.shooting-star {
  position: absolute;
  width: clamp(96px, 15vw, 190px);
  height: 2px;
  border-radius: 999px;
  opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(221, 231, 255, 0.96) 68%, transparent);
  box-shadow: 0 0 12px rgba(166, 186, 255, 0.75);
  transform: translate3d(0, calc(var(--scroll-shift, 0px) * -0.08), 0) rotate(-31deg);
  animation: shooting-star 12s ease-in-out infinite;
  will-change: transform, opacity;
}

.star-one {
  top: 14%;
  left: 82%;
  animation-delay: -1s;
}

.star-two {
  top: 39%;
  left: 64%;
  width: clamp(74px, 12vw, 150px);
  animation-delay: -5.1s;
  animation-duration: 14s;
}

.star-three {
  top: 68%;
  left: 89%;
  width: clamp(70px, 11vw, 132px);
  animation-delay: -8.4s;
  animation-duration: 15s;
}

.star-four {
  top: 80%;
  left: 32%;
  width: clamp(66px, 10vw, 118px);
  animation-delay: -10.5s;
  animation-duration: 16s;
}

body.is-scrolling .shooting-star {
  filter: brightness(1.28);
}

@keyframes shooting-star {
  0%,
  62%,
  100% {
    opacity: 0;
    transform: translate3d(0, calc(var(--scroll-shift, 0px) * -0.08), 0) rotate(-31deg);
  }

  66% {
    opacity: 0.78;
  }

  82% {
    opacity: 0;
    transform: translate3d(-52vw, calc(31vw + var(--scroll-shift, 0px) * -0.08), 0) rotate(-31deg);
  }
}

html[data-theme="light"] .space-background {
  background:
    radial-gradient(circle at 16% 0%, rgba(107, 130, 255, 0.17), transparent 29%),
    radial-gradient(circle at 94% 5%, rgba(190, 139, 255, 0.14), transparent 25%),
    radial-gradient(circle at 56% 82%, rgba(71, 194, 133, 0.09), transparent 29%),
    var(--bg);
}

html[data-theme="light"] .space-background::before {
  opacity: 0.38;
}

@keyframes star-drift {
  to { transform: translate3d(-36px, 54px, 0); }
}

body {
  opacity: 1;
  transition: opacity 0.32s ease, transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}

body.page-leaving {
  opacity: 0;
  transform: translateY(8px) scale(0.992);
}

html[data-theme="light"] .shooting-star {
  background: linear-gradient(90deg, transparent, rgba(79, 105, 188, 0.78) 68%, transparent);
  box-shadow: 0 0 12px rgba(92, 113, 198, 0.38);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 28px, 1180px);
  }
}
