/* ============================================================
   BULUTRA — BASE: reset, typography, utilities
   ============================================================ */

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

* { margin: 0; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink-200);
  background: var(--bg-900);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  position: relative;
  min-height: 100vh;
}

/* Ambient page background: layered radial fields + deep base.
   This gives the "infrastructure depth" without any 3D. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 600px at 78% -8%, rgba(42, 80, 232, 0.16), transparent 60%),
    radial-gradient(1100px 700px at 12% 8%, rgba(56, 232, 255, 0.08), transparent 55%),
    radial-gradient(1200px 900px at 50% 120%, rgba(42, 80, 232, 0.10), transparent 60%),
    var(--bg-900);
}

/* faint engineered grid over the whole page */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  /* two grid scales for layered depth — coarse over fine, both very faint */
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    linear-gradient(to right, rgba(255, 255, 255, 0.012) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.012) 1px, transparent 1px);
  background-size: 64px 64px, 64px 64px, 16px 16px, 16px 16px;
  mask-image: radial-gradient(circle at 50% 30%, black, transparent 88%);
  -webkit-mask-image: radial-gradient(circle at 50% 30%, black, transparent 88%);
}

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

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

button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }

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

::selection { background: rgba(58, 99, 255, 0.35); color: #fff; }

/* ---- Headings ------------------------------------------- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  color: var(--ink-100);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: var(--lh-snug);
  text-wrap: balance;
}

/* ---- Reusable bits -------------------------------------- */
.u-mono {
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-300);
}
.eyebrow__idx { color: var(--accent, var(--blue-400)); }
.eyebrow__pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--cyan-500);
  box-shadow: 0 0 0 0 var(--glow-cyan);
  animation: pulse 2.6s var(--ease-out) infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(56, 232, 255, 0.5); }
  70%  { box-shadow: 0 0 0 9px rgba(56, 232, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(56, 232, 255, 0); }
}

.grad {
  background: linear-gradient(100deg, var(--blue-400) 0%, var(--cyan-500) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.dim { color: var(--ink-300); }

/* ---- Layout primitives ---------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.skip-link {
  position: absolute;
  left: 50%; top: -60px;
  transform: translateX(-50%);
  z-index: var(--z-intro);
  background: var(--blue-600);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  transition: top var(--dur-mid) var(--ease-out);
}
.skip-link:focus { top: 12px; }

/* visible focus everywhere (a11y) */
:focus-visible {
  outline: 2px solid var(--cyan-400);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---- Reveal animation primitive ------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity var(--dur-reveal) var(--ease-out),
    transform var(--dur-reveal) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
[data-reveal].in {
  opacity: 1;
  transform: none;
}

.reduced-motion [data-reveal] {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

/* hard failsafe: if the JS modules never booted (file/CDN failure), an
   inline head script adds .js-dead — all gated content becomes visible */
.js-dead [data-reveal],
.js-dead .hero [data-enter],
.js-dead .hero__title .hero__line > span {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

/* clear the fixed nav on anchor jumps */
main > section[id] { scroll-margin-top: 88px; }
