/* =========================================================================
   base.css — reset, document defaults, typography, motion primitives
   ========================================================================= */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink-950);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

button {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

::selection {
  background: rgba(212, 160, 23, 0.35);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--gold-400);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- layout helpers ---------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  position: relative;
  padding-block: 6rem;
}

.section--tight {
  padding-block: 4rem;
}

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

/* ---------- type -------------------------------------------------------- */
.display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.06;
}

.section-title {
  margin-top: 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--fg);
  text-wrap: balance;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--gold-400);
}

.section-sub {
  max-width: 34rem;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 1rem;
}

.mono {
  font-family: var(--font-mono);
}

.text-gradient {
  background: linear-gradient(180deg, #ffffff 8%, var(--gold-200) 54%, var(--gold-400) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- decorative layers ------------------------------------------- */
.aurora {
  position: absolute;
  border-radius: 999px;
  filter: blur(2px);
  pointer-events: none;
}

.aurora--a {
  background: radial-gradient(closest-side, rgba(212, 160, 23, 0.36), transparent);
  animation: drift-a 16s ease-in-out infinite;
}

.aurora--b {
  background: radial-gradient(closest-side, rgba(110, 78, 10, 0.45), transparent);
  animation: drift-b 20s ease-in-out infinite;
}

.grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(212, 160, 23, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(212, 160, 23, 0.07) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 28%, #000 35%, transparent 100%);
  mask-image: radial-gradient(70% 60% at 50% 28%, #000 35%, transparent 100%);
  animation: grid-pan 6s linear infinite;
  pointer-events: none;
}

.rule-glow {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-400) 50%, transparent);
  box-shadow: 0 0 18px 1px rgba(212, 160, 23, 0.55);
}

/* ---------- motion ------------------------------------------------------ */
@keyframes rise {
  from {
    opacity: 0;
    filter: blur(6px);
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    filter: none;
    transform: none;
  }
}

@keyframes drift-a {
  0%,
  100% {
    transform: translate(-10%, -6%) scale(1);
  }
  50% {
    transform: translate(12%, 8%) scale(1.15);
  }
}

@keyframes drift-b {
  0%,
  100% {
    transform: translate(10%, 4%) scale(1.1);
  }
  50% {
    transform: translate(-14%, -8%) scale(0.95);
  }
}

@keyframes grid-pan {
  to {
    background-position: 56px 56px;
  }
}

@keyframes pulse-dot {
  0%,
  100% {
    box-shadow: 0 0 rgba(74, 222, 128, 0.55);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(74, 222, 128, 0);
  }
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@keyframes logo-enter {
  from {
    opacity: 0;
    filter: blur(14px);
    transform: scale(0.7) translateY(30px);
  }
  to {
    opacity: 1;
    filter: none;
    transform: none;
  }
}

@keyframes logo-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

@keyframes card-idle {
  0%,
  100% {
    --rx: 7deg;
    --ry: -18deg;
    --px: 22%;
    --py: 30%;
  }
  50% {
    --rx: -6deg;
    --ry: 18deg;
    --px: 80%;
    --py: 68%;
  }
}

.rise {
  animation: rise 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
  animation-delay: var(--d, 0s);
}

/* scroll reveal — .js adds [data-revealed] */
[data-reveal] {
  opacity: 0;
  filter: blur(8px);
  transform: translateY(26px) scale(0.985);
  transition:
    opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 1s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.8s ease;
  transition-delay: var(--delay, 0ms);
  will-change: opacity, transform, filter;
}

[data-reveal][data-revealed] {
  opacity: 1;
  filter: none;
  transform: none;
}

/* section rule — draws outward from the centre */
[data-reveal="rule"] {
  opacity: 0;
  filter: none;
  transform: scaleX(0);
  transform-origin: center;
  transition:
    transform 1.4s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.6s ease;
  transition-delay: var(--delay, 0ms);
}

[data-reveal="rule"][data-revealed] {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] {
    opacity: 1;
    filter: none;
    transform: none;
  }
}
