body {
  background: #000;
}

/* Login confirmation: a single neon tracer completes one lap in 1.5 seconds. */
.sl-login-toggle {
  position: relative;
  isolation: isolate;
  overflow: visible;
  min-width: 129px;
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease;
}

.sl-login-toggle:disabled {
  opacity: 1 !important;
}

.sl-login-toggle > .sl-login-icon,
.sl-login-toggle > .sl-login-label {
  position: relative;
  z-index: 1;
  transition:
    opacity 220ms ease,
    transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.sl-login-check {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  width: 13px;
  height: 22px;
  border-right: 3px solid #dcffe8;
  border-bottom: 3px solid #dcffe8;
  opacity: 0;
  filter: drop-shadow(0 0 5px rgba(65, 255, 137, 0.95));
  transform: translate(-50%, -60%) rotate(45deg) scale(0.25);
  transform-origin: 50% 50%;
}

.sl-login-check-active {
  opacity: 1;
  transform: translate(-50%, -60%) rotate(45deg) scale(1);
}

.sl-login-orbit {
  position: absolute;
  left: -4px;
  top: -4px;
  z-index: 3;
  width: calc(100% + 8px) !important;
  height: calc(100% + 8px) !important;
  overflow: visible;
  opacity: 0;
  pointer-events: none;
}

.sl-login-orbit rect {
  fill: none;
  stroke: #3dff8a;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 55 205;
  stroke-dashoffset: 260;
  vector-effect: non-scaling-stroke;
  filter:
    drop-shadow(0 0 3px rgba(255, 255, 255, 0.95))
    drop-shadow(0 0 8px rgba(33, 255, 116, 0.95));
}

.sl-login-toggle:is([data-state="pending"], [data-state="checked"]) {
  cursor: wait;
  border-color: rgba(72, 255, 140, 0.68);
  background-color: rgba(5, 32, 18, 0.86);
  box-shadow:
    0 0 16px rgba(44, 255, 122, 0.34),
    inset 0 0 18px rgba(32, 255, 112, 0.09);
  animation: sl-login-pulse 1.5s ease-in-out both;
}

.sl-login-toggle[data-state="pending"] > .sl-login-icon,
.sl-login-toggle[data-state="pending"] > .sl-login-label {
  opacity: 0;
  transform: translateY(-3px) scale(0.68);
}

.sl-login-toggle:is([data-state="pending"], [data-state="checked"]) > .sl-login-orbit {
  opacity: 1;
}

.sl-login-toggle:is([data-state="pending"], [data-state="checked"]) > .sl-login-orbit rect {
  animation: sl-login-orbit 1.5s linear both;
}

[class~="group/login"].sl-login-pending > .absolute {
  opacity: 0 !important;
  transform: translateY(-6px) !important;
  pointer-events: none !important;
}

@keyframes sl-login-orbit {
  from {
    stroke-dashoffset: 260;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes sl-login-pulse {
  0%,
  100% {
    box-shadow:
      0 0 12px rgba(44, 255, 122, 0.24),
      inset 0 0 14px rgba(32, 255, 112, 0.06);
  }
  48% {
    box-shadow:
      0 0 28px rgba(44, 255, 122, 0.58),
      inset 0 0 22px rgba(32, 255, 112, 0.16);
  }
}

/* Phone layout: one responsive site, with the desktop composition untouched. */
@media (max-width: 767.98px), (max-height: 520px) and (pointer: coarse) {
  html,
  body {
    width: 100%;
    min-height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }

  main.relative.min-h-screen {
    width: 100%;
    height: 100dvh;
    min-height: 100svh;
    isolation: isolate;
  }

  /* Keep the simulation pinned behind the mobile chrome. */
  main > .absolute.inset-0.z-0 {
    position: fixed;
    inset: 0;
    opacity: 0.82;
  }

  main > .absolute.inset-0.z-0 canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none;
  }

  /* Contact and access sit in a compact, thumb-friendly bottom row. */
  main > .absolute.left-6.top-8.z-20 {
    position: fixed;
    left: calc(env(safe-area-inset-left) + 20px);
    right: calc(env(safe-area-inset-right) + 20px);
    top: auto;
    bottom: calc(env(safe-area-inset-bottom) + 12px);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    z-index: 40;
  }

  main > .absolute.left-6.top-8.z-20 > .group > button {
    width: 100%;
    height: 44px;
    min-height: 44px;
    gap: 5px;
    padding-inline: 8px;
    border-radius: 12px;
    white-space: normal;
    font-size: clamp(0.56rem, 2.25vw, 0.66rem);
    line-height: 1.12;
    letter-spacing: 0.07em;
    background: rgba(3, 8, 12, 0.68);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.28);
  }

  main > .absolute.left-6.top-8.z-20 svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
  }

  main > .absolute.left-6.top-8.z-20 > .group > .absolute {
    top: auto;
    bottom: calc(100% + 6px);
    margin-top: 0;
    pointer-events: none;
  }

  main > .absolute.left-6.top-8.z-20 > .group:focus-within > .absolute {
    opacity: 1;
    pointer-events: auto;
  }

  /* Account controls become a notch-aware top dock. */
  main > .absolute.right-6.top-8.z-20 {
    position: fixed;
    left: calc(env(safe-area-inset-left) + 20px);
    right: calc(env(safe-area-inset-right) + 20px);
    top: calc(env(safe-area-inset-top) + 12px);
    bottom: auto;
    display: grid;
    grid-template-columns: 44px 44px minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(8, 14, 22, 0.84), rgba(2, 6, 10, 0.76));
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(18px) saturate(1.15);
    -webkit-backdrop-filter: blur(18px) saturate(1.15);
    z-index: 42;
  }

  main > .absolute.right-6.top-8.z-20 > div:nth-child(-n + 2) {
    width: 44px;
    height: 44px;
  }

  main > .absolute.right-6.top-8.z-20 > div:nth-child(-n + 2) svg {
    width: 20px;
    height: 20px;
  }

  main > .absolute.right-6.top-8.z-20 > [class~="group/login"] > button {
    width: 100%;
    height: 44px;
    min-height: 44px;
    padding-inline: 11px;
    border-radius: 12px;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
  }

  main > .absolute.right-6.top-8.z-20 > [class~="group/login"] > .absolute {
    top: calc(100% + 10px);
    right: 0;
    bottom: auto;
    margin-top: 0;
    width: min(196px, calc(100vw - 48px));
    gap: 6px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 15px;
    background: rgba(3, 8, 13, 0.92);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.52);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    transform: translateY(-6px);
    pointer-events: none;
  }

  main > .absolute.right-6.top-8.z-20 > [class~="group/login"] > .absolute > button {
    width: 100%;
    height: 44px;
    border-radius: 13px;
    font-size: 0.75rem;
  }

  main > .absolute.right-6.top-8.z-20 > [class~="group/login"]:focus-within > .absolute {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  /* The hero lives in the safe space between the account dock and action row. */
  main > .pointer-events-none.absolute.inset-0.z-10 {
    inset:
      calc(env(safe-area-inset-top) + 76px)
      12px
      calc(env(safe-area-inset-bottom) + 68px);
  }

  main > .pointer-events-none.absolute.inset-0.z-10 > div {
    box-sizing: border-box;
    width: min(88vw, 22rem);
    padding: clamp(22px, 5dvh, 38px) 14px;
    border-radius: 18px;
    border-color: rgba(18, 255, 112, 0.18);
    background:
      radial-gradient(circle at 50% 18%, rgba(8, 75, 38, 0.19), transparent 48%),
      rgba(3, 7, 13, 0.68);
    box-shadow:
      0 28px 80px rgba(0, 0, 0, 0.52),
      inset 0 1px 0 rgba(255, 255, 255, 0.05),
      0 0 44px rgba(0, 255, 96, 0.04);
    backdrop-filter: blur(18px) saturate(1.08);
    -webkit-backdrop-filter: blur(18px) saturate(1.08);
  }

  main > .pointer-events-none.absolute.inset-0.z-10 h1 {
    white-space: nowrap;
    font-size: clamp(1.7rem, 8.6vw, 2.55rem);
    line-height: 1.05;
    letter-spacing: clamp(0.12em, 2.2vw, 0.22em);
  }

  main > .pointer-events-none.absolute.inset-0.z-10 p {
    max-width: 16rem;
    margin-inline: auto;
    font-size: clamp(0.64rem, 2.5vw, 0.78rem);
    line-height: 1.55;
    letter-spacing: 0.14em;
  }

  main > .pointer-events-none.absolute.inset-0.z-10 .mt-10 {
    margin-top: clamp(18px, 3.5dvh, 26px);
  }

  button[aria-label="Learn more about Star Liquid"] {
    width: auto;
    min-width: 148px;
    height: 46px;
    min-height: 46px;
    padding-inline: 22px;
    touch-action: manipulation;
  }

  button:focus-visible,
  a:focus-visible {
    outline: 2px solid #00d62b;
    outline-offset: 3px;
  }
}

/* Compact landscape phones and short browser viewports. */
@media (max-height: 520px) and (pointer: coarse) {
  main > .absolute.left-6.top-8.z-20 {
    top: auto;
    bottom: calc(env(safe-area-inset-bottom) + 8px);
  }

  main > .absolute.left-6.top-8.z-20 > .group > button,
  main > .absolute.right-6.top-8.z-20 > div:nth-child(-n + 2),
  main > .absolute.right-6.top-8.z-20 > [class~="group/login"] > button {
    height: 42px;
    min-height: 42px;
  }

  main > .absolute.right-6.top-8.z-20 {
    top: calc(env(safe-area-inset-top) + 8px);
    bottom: auto;
    grid-template-columns: 42px 42px minmax(0, 1fr);
    padding: 6px;
  }

  main > .pointer-events-none.absolute.inset-0.z-10 {
    inset:
      calc(env(safe-area-inset-top) + 66px)
      12px
      calc(env(safe-area-inset-bottom) + 60px);
  }

  main > .pointer-events-none.absolute.inset-0.z-10 > div {
    width: min(100%, 34rem);
    padding: 18px;
  }

  main > .pointer-events-none.absolute.inset-0.z-10 h1 {
    font-size: clamp(1.7rem, 6vw, 2.35rem);
  }

  main > .pointer-events-none.absolute.inset-0.z-10 p {
    margin-top: 8px;
    font-size: 0.68rem;
  }

  main > .pointer-events-none.absolute.inset-0.z-10 .mt-10 {
    margin-top: 14px;
  }

  button[aria-label="Learn more about Star Liquid"] {
    min-height: 44px;
  }
}
