*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--label);
  font: var(--t-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "ss01";
  overflow: hidden;
}

/* Ambient light + film grain behind every screen. Fixed layers, so they
   cost one composite and never repaint while content scrolls. */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
body::before {
  background:
    radial-gradient(60vmax 50vmax at 12% -8%, var(--ambient-1), transparent 60%),
    radial-gradient(55vmax 45vmax at 105% 10%, var(--ambient-3), transparent 62%),
    radial-gradient(50vmax 40vmax at 60% 115%, var(--ambient-2), transparent 60%);
  filter: saturate(110%);
  animation: ambient-drift 38s var(--ease) infinite alternate;
}
body::after {
  background-image: var(--grain);
  opacity: var(--grain-opacity);
  mix-blend-mode: overlay;
}
@keyframes ambient-drift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(-2%, 1.5%, 0) scale(1.04);
  }
  100% {
    transform: translate3d(1.5%, -1%, 0) scale(1.02);
  }
}

#root {
  position: relative;
  z-index: 1;
  height: 100%;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}
h1,
h2,
h3 {
  letter-spacing: var(--tracking-tight);
}

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

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: default;
}

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

::selection {
  background: color-mix(in srgb, var(--brand) 26%, transparent);
}

:focus {
  outline: none;
}

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

/* Scrollbars: thin overlay style */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--fill) transparent;
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: var(--fill);
  border-radius: 10px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-track {
  background: transparent;
}

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

.muted {
  color: var(--label-2);
}
.faint {
  color: var(--label-3);
}
.num {
  font-variant-numeric: tabular-nums;
}
.t-hero {
  font: var(--t-hero);
  letter-spacing: -0.035em;
}
.t-large {
  font: var(--t-large);
  letter-spacing: var(--tracking-tight);
}
.t-title1 {
  font: var(--t-title1);
  letter-spacing: var(--tracking-tight);
}
.t-title2 {
  font: var(--t-title2);
}
.t-title3 {
  font: var(--t-title3);
}
.t-headline {
  font: var(--t-headline);
}
.t-callout {
  font: var(--t-callout);
}
.t-subhead {
  font: var(--t-subhead);
}
.t-footnote {
  font: var(--t-footnote);
}
.t-caption {
  font: var(--t-caption);
}

/* Gradient text, used sparingly for a single hero word at most. */
.text-vibe {
  background: var(--vibe-gradient);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: vibe-pan 9s var(--ease) infinite alternate;
}
@keyframes vibe-pan {
  to {
    background-position: 100% 0;
  }
}

.scroll {
  overflow: auto;
  overscroll-behavior: contain;
}

.stack {
  display: flex;
  flex-direction: column;
}
.hstack {
  display: flex;
  align-items: center;
}
.spacer {
  flex: 1;
}
.gap-1 {
  gap: var(--s-1);
}
.gap-2 {
  gap: var(--s-2);
}
.gap-3 {
  gap: var(--s-3);
}
.gap-4 {
  gap: var(--s-4);
}

/* Entrance choreography: add .reveal to a container and its direct
   children rise in one after another (--i set inline, or nth-child). */
.reveal > * {
  animation: rise-in var(--d-slow) var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}
.reveal > *:nth-child(1) { --i: 0; }
.reveal > *:nth-child(2) { --i: 1; }
.reveal > *:nth-child(3) { --i: 2; }
.reveal > *:nth-child(4) { --i: 3; }
.reveal > *:nth-child(5) { --i: 4; }
.reveal > *:nth-child(6) { --i: 5; }
.reveal > *:nth-child(7) { --i: 6; }
.reveal > *:nth-child(8) { --i: 7; }
.reveal > *:nth-child(n + 9) { --i: 8; }

.boot {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
}
.boot-mark {
  width: 48px;
  height: 48px;
  animation: boot-pulse 1.6s var(--ease) infinite;
  filter: drop-shadow(0 10px 30px rgba(255, 130, 80, 0.35));
}
@keyframes boot-pulse {
  0%,
  100% {
    opacity: 0.6;
    transform: scale(0.94);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}
@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
    filter: blur(4px);
  }
}
@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(4px);
    filter: blur(2px);
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes shimmer {
  from {
    background-position: -200% 0;
  }
  to {
    background-position: 200% 0;
  }
}
@keyframes spin-border {
  to {
    --spin: 360deg;
  }
}
@keyframes float-y {
  50% {
    transform: translateY(-6px);
  }
}
@keyframes twinkle {
  0%,
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
  50% {
    transform: scale(0.82) rotate(18deg);
    opacity: 0.75;
  }
}

@media (prefers-reduced-motion: reduce) {
  body::before,
  .text-vibe {
    animation: none;
  }
  .reveal > * {
    animation: none;
  }
}
:root[data-motion="reduced"] body::before,
:root[data-motion="reduced"] .text-vibe,
:root[data-motion="reduced"] .reveal > * {
  animation: none;
}
