:root {
  --bg: #0f172a;
  --fg: #e9edf2;
  --accent: #5b8dff;
  --font-stack: "Space Grotesk","Lato",system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,Arial,sans-serif;
  --ease: cubic-bezier(.4,.14,.3,1);
  --transition: .55s var(--ease);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
}

body {
  background: radial-gradient(circle at 50% 50%, #162235 0%, #0f172a 80%);
  color: var(--fg);
  font-family: var(--font-stack);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
}

.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
}

.hero-canvas-wrapper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.spline-container,
canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: pinch-zoom;
  user-select: none;
  /* pointer-events: none; */ /* uncomment if scene is fully decorative */
}

.hero-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 50%, #161a24 0%, #0a0a0d 80%);
  transition: opacity var(--transition), visibility var(--transition);
  will-change: opacity;
  z-index: 10;
}

.hero-fallback.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-text {
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--fg);
  opacity: 0.85;
  animation: fadeblink 1.8s ease-in-out infinite;
  font-family: var(--font-stack);
  text-align: center;
  max-width: 22ch;
  padding: 0 1rem;
}

@keyframes fadeblink {
  0%,100% { opacity: 0.85; }
  50% { opacity: 0.35; }
}

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

.retry-btn {
  margin-top: 1rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 6px;
  padding: .55rem 1rem;
  font: 500 0.9rem/1 var(--font-stack);
  color: var(--fg);
  cursor: pointer;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background .25s, border-color .25s, opacity .25s;
}

.retry-btn:hover:not(:disabled) {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.35);
}

.retry-btn:disabled {
  opacity: .5;
  cursor: default;
}

.retry-btn:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(255,255,255,.25);
}

/* Smaller mobile loader font */
@media (max-width: 480px) {
  .loading-text {
    font-size: 1.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-text {
    animation: none;
    opacity: 0.85;
  }
  .hero-fallback,
  .retry-btn {
    transition: none;
  }
}
