/* ==========================================================================
   Base — reset, document defaults, shared animations
   ========================================================================== */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
}

h1, h2, h3, h4, p, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }

a {
  color: var(--beacon-deep);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}
a:hover { color: var(--beacon); }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

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

/* Visible focus everywhere. Never remove this without a replacement. */
:focus-visible {
  outline: 2px solid var(--beacon);
  outline-offset: 2px;
  border-radius: 4px;
}

.u-visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.u-tabular { font-variant-numeric: tabular-nums; }
.u-mono { font-family: var(--font-mono); }


/* --- Animations ---------------------------------------------------------- */

@keyframes sx-rise {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: none; }
}
@keyframes sx-orbit { to { transform: rotate(360deg); } }
@keyframes sx-drop {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes sx-guide-in {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
@keyframes sx-dot {
  0%, 80%, 100% { opacity: .25; transform: translateY(0); }
  40%           { opacity: 1;   transform: translateY(-3px); }
}

/* Scroll-driven reveal.
   Pure CSS. Where animation-timeline is unsupported the animation resolves
   straight to its end state, so the content is simply visible — no JS
   fallback needed and nothing can leave a section stuck at opacity 0. */
.reveal {
  animation: sx-rise linear both;
  animation-timeline: view();
  animation-range: entry 0% cover 22%;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
