html { overflow-x: hidden; }

@supports (overflow: clip) {
  html { overflow-x: clip; }
}

body {
  background-color: #F9FBFF;
  color: #0D3C84;
}

.ambient-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
}

.ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  z-index: -1;
  opacity: 0.6;
  animation: pulse-slow 14s ease-in-out infinite;
  will-change: transform, opacity;
  transform: translateZ(0);
}

.noise-bg {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  opacity: 0.03;
  z-index: -2;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.glass {
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.glass-card {
  background-color: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 32px 0 rgba(142, 207, 255, 0.1);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
              scale 0.45s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.45s cubic-bezier(0.22, 1, 0.36, 1),
              background-color 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.float-card {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

@media (hover: hover) {
  .glass-card:hover {
    transform: translate3d(0, -6px, 0);
    box-shadow: 0 16px 44px 0 rgba(142, 207, 255, 0.28);
    background-color: rgba(255, 255, 255, 0.82);
  }

  .float-card:hover {
    scale: 1.05;
    box-shadow: 0 16px 44px 0 rgba(142, 207, 255, 0.28);
    background-color: rgba(255, 255, 255, 0.85);
  }
}

@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%      { transform: translate3d(0, -14px, 0); }
}

@keyframes float-slow {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%      { transform: translate3d(8px, -18px, 0); }
}

@keyframes pulse-slow {
  0%, 100% { transform: scale(1) translateZ(0); opacity: 0.5; }
  50%      { transform: scale(1.08) translateZ(0); opacity: 0.7; }
}

@keyframes wave {
  0%, 100% { border-radius: 42% 58% 62% 38% / 45% 42% 58% 55%; }
  33%      { border-radius: 62% 38% 42% 58% / 58% 55% 45% 42%; }
  66%      { border-radius: 48% 52% 58% 42% / 38% 62% 38% 62%; }
}

@keyframes wf-pulse {
  0%, 100% { transform: scaleY(0.42); }
  50%      { transform: scaleY(1); }
}

@keyframes tr-nudge {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(3px); }
}

@keyframes clover-rotate {
  0%   { transform: rotate(0deg); }
  75%  { transform: rotate(360deg); }
  100% { transform: rotate(360deg); }
}

@keyframes small-clover-hover {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-14px); }
}

@keyframes blink {
  0%, 90%, 100% { transform: scaleY(1); }
  95%           { transform: scaleY(0.1); }
}

.animate-float,
.animate-float-slow,
.animate-float-delayed,
.animate-pulse-slow {
  will-change: transform;
  backface-visibility: hidden;
}

.animate-float        { animation: float 6s ease-in-out infinite; }
.animate-float-slow   { animation: float-slow 8s ease-in-out infinite; }
.animate-float-delayed{ animation: float 7s ease-in-out infinite 2s; }
.animate-pulse-slow   { animation: pulse-slow 9s ease-in-out infinite; }

.clover-main {
  animation: clover-rotate 12s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  transform-origin: 100px 100px;
}

.small-clover-1 { animation: small-clover-hover 3.5s ease-in-out infinite; }
.small-clover-2 { animation: small-clover-hover 4.2s ease-in-out infinite 1.5s; }

.eye {
  transform-origin: center;
  animation: blink 4s ease-in-out infinite;
}

.eye-right { animation-delay: 0.05s; }

.tr-arrow {
  animation: tr-nudge 2.2s ease-in-out infinite;
  will-change: transform;
}

.tr-tab {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
  color: rgba(13, 60, 132, 0.5);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid #EAF5FF;
  cursor: pointer;
  transition: background-color 0.25s ease,
              border-color 0.25s ease,
              color 0.25s ease,
              scale 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.tr-tab.is-active {
  color: #fff;
  background: #4FA8FF;
  border-color: #4FA8FF;
}

.tr-tab[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (hover: hover) {
  .tr-tab:not([disabled]):not(.is-active):hover {
    color: #0D3C84;
    border-color: #8ECFFF;
    scale: 1.04;
  }
}

.tr-tab:focus-visible {
  outline: 2px solid #4FA8FF;
  outline-offset: 2px;
}

.tr-swap {
  transition: opacity 0.18s ease,
              translate 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.tr-target.is-swapping .tr-swap {
  opacity: 0;
  translate: 0 8px;
}

.animated-orb {
  animation: wave 12s ease-in-out infinite;
  background: linear-gradient(135deg, #4FA8FF, #8ECFFF);
  box-shadow: 0 0 60px rgba(79, 168, 255, 0.4);
  will-change: border-radius;
}

.wf-track {
  display: flex;
  align-items: center;
  gap: 1.1%;
}

.wf-bar {
  flex: 1 1 0;
  min-width: 2px;
  height: var(--h, 40%);
  border-radius: 999px;
  background: currentColor;
  transform-origin: center;
  animation: wf-pulse 1.5s ease-in-out infinite;
  will-change: transform;
}

.wf-bar.is-rest {
  height: auto;
  aspect-ratio: 1;
  animation: none;
  opacity: 0.5;
}

.wf-bar:nth-child(3n+1) { animation-duration: 1.35s; }
.wf-bar:nth-child(3n+2) { animation-duration: 1.7s; }
.wf-bar:nth-child(3n)   { animation-duration: 1.5s; }

.wf-bar:nth-child(7n+1) { animation-delay: -0.10s; }
.wf-bar:nth-child(7n+2) { animation-delay: -0.75s; }
.wf-bar:nth-child(7n+3) { animation-delay: -0.35s; }
.wf-bar:nth-child(7n+4) { animation-delay: -1.05s; }
.wf-bar:nth-child(7n+5) { animation-delay: -0.50s; }
.wf-bar:nth-child(7n+6) { animation-delay: -0.90s; }
.wf-bar:nth-child(7n)   { animation-delay: -0.25s; }

.js .fade-up {
  opacity: 0;
  translate: 0 24px;
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0s),
              translate 0.8s cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0s);
}

.js .fade-up.is-visible {
  opacity: 1;
  translate: 0 0;
}

.js .glass-card.fade-up {
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0s),
              translate 0.8s cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0s),
              transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
              scale 0.45s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.45s cubic-bezier(0.22, 1, 0.36, 1),
              background-color 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-link {
  position: relative;
  transition: color 0.25s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-link:hover::after { transform: scaleX(1); }

.nav-menu {
  opacity: 0;
  translate: 0 -8px;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease,
              translate 0.25s cubic-bezier(0.22, 1, 0.36, 1),
              visibility 0s linear 0.25s;
}

.nav-menu.is-open {
  opacity: 1;
  translate: 0 0;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.25s ease,
              translate 0.25s cubic-bezier(0.22, 1, 0.36, 1),
              visibility 0s;
}

@media (min-width: 768px) {
  #nav-menu.nav-menu { display: none; }
}

@supports (min-height: 100svh) {
  .hero-vh { min-height: 100svh; }
}

.js [data-stream] .stream-word {
  display: inline-block;
  opacity: 0;
  translate: 0 0.12em;
  transition: opacity 0.2s ease-out,
              translate 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.js [data-stream] .stream-word.is-shown {
  opacity: 1;
  translate: 0 0;
}

.stream-actions { pointer-events: none; }
.stream-actions.is-done { pointer-events: auto; }

.js .stream-actions > button {
  opacity: 0;
  translate: 0 6px;
  transition: opacity 0.4s ease-out var(--d, 0s),
              translate 0.4s cubic-bezier(0.22, 1, 0.36, 1) var(--d, 0s),
              color 0.2s ease;
}

.js .stream-actions.is-done > button {
  opacity: 1;
  translate: 0 0;
}

.fs-note {
  max-width: 28rem;
  margin-inline: auto;
  border-radius: 1rem;
  padding: 0.85rem 1.15rem;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
}

.fs-note:empty { display: none; }

.fs-note--ok {
  margin-bottom: 1.25rem;
  color: #15803d;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.28);
}

.fs-note--err {
  margin-top: 1.25rem;
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.24);
}

.fs-field-error {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: #b91c1c;
}

.fs-field-error:empty { display: none; }

.fs-note--ok:not(:empty) ~ form { display: none; }

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

  .js .fade-up { opacity: 1; translate: 0 0; }

  .js [data-stream] .stream-word,
  .js .stream-actions > button { opacity: 1; translate: 0 0; }
}
