/* ==========================================================================
   Universe — base.css
   Design tokens, reset, typography, utility classes
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Palette */
  --bg: #06060d;
  --bg-deep: #030308;
  --bg-soft: #0a0a14;
  --surface: #0d0d19;
  --surface-raised: #12121f;
  --cream: #f0ebdf;
  --cream-deep: #e5ddcc;

  --text: #f3f0ff;
  --text-dim: #b4aecb;
  --text-muted: #8a84a3;
  --ink: #0a0a12;
  --ink-dim: #4d4a5c;

  --violet: #8b5cf6;
  --violet-soft: #a78bfa;
  --indigo: #6366f1;
  --cyan: #22d3ee;
  --cyan-soft: #67e8f9;
  --pink: #f472b6;
  --orange: #fb923c;
  --lime: #d9f99d;

  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.2);
  --line-soft: rgba(255, 255, 255, 0.055);

  --gradient: linear-gradient(112deg, var(--violet-soft) 0%, var(--cyan) 100%);
  --gradient-warm: linear-gradient(112deg, var(--pink) 0%, var(--orange) 100%);

  /* Type */
  --font-display: "Space Grotesk", "Be Vietnam Pro", "Helvetica Neue", sans-serif;
  --font-body: "Be Vietnam Pro", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;

  /* Layout */
  --container: 1280px;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --header-h: 76px;
  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 32px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

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

* {
  margin: 0;
}

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

[hidden] {
  display: none !important;
}

[id] {
  scroll-margin-top: calc(var(--header-h) + 1.5rem);
}

body {
  min-height: 100svh;
  padding-top: var(--header-h);
  overflow-x: hidden;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.nav-open,
body.modal-open {
  overflow: hidden;
}

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

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

button {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

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

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

address {
  font-style: normal;
}

::selection {
  background: var(--violet);
  color: #fff;
}

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

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-deep);
}

::-webkit-scrollbar-thumb {
  border: 2px solid var(--bg-deep);
  border-radius: 999px;
  background: #2a2740;
}

/* Typography ------------------------------------------------------------- */
h1,
h2,
h3,
h4,
h5 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.9rem, 7.4vw, 6.5rem);
}

h2 {
  font-size: clamp(2.1rem, 4.7vw, 3.9rem);
}

h3 {
  font-size: clamp(1.2rem, 1.9vw, 1.6rem);
  line-height: 1.16;
  letter-spacing: -0.02em;
}

h4 {
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

p {
  color: var(--text-dim);
  line-height: 1.72;
  text-wrap: pretty;
}

strong {
  font-weight: 500;
  color: var(--text);
}

em {
  font-style: italic;
}

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

.section {
  position: relative;
  padding-block: clamp(4.5rem, 9vw, 8.5rem);
}

.section--tight {
  padding-block: clamp(3rem, 6vw, 5.5rem);
}

.section--flush-top {
  padding-top: 0;
}

.section-head {
  display: grid;
  gap: 1.75rem;
  align-items: end;
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

@media (min-width: 900px) {
  .section-head {
    grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.55fr);
    gap: 3rem;
  }
}

.section-head__aside {
  display: grid;
  gap: 1.25rem;
  justify-items: start;
}

.section-head__aside p {
  max-width: 38ch;
}

.section-head .eyebrow {
  margin-bottom: 1rem;
}

/* Eyebrow / labels ------------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.67rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  flex: 0 0 auto;
  background: var(--cyan);
  opacity: 0.75;
}

.eyebrow--accent {
  color: var(--cyan-soft);
}

.eyebrow--plain::before {
  display: none;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Text helpers ----------------------------------------------------------- */
.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.text-muted {
  color: var(--text-muted);
}

.lead {
  color: var(--text);
  font-size: clamp(1.12rem, 1.7vw, 1.4rem);
  font-weight: 300;
  line-height: 1.62;
  letter-spacing: -0.01em;
}

.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;
}

/* Buttons ---------------------------------------------------------------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.95rem 1.5rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition:
    background-color 0.35s var(--ease-out),
    border-color 0.35s var(--ease-out),
    color 0.35s var(--ease-out),
    box-shadow 0.35s var(--ease-out),
    transform 0.35s var(--ease-out);
}

.btn svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  transition: transform 0.35s var(--ease-out);
}

.btn:hover svg {
  transform: translateX(3px);
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--text);
  color: var(--ink);
}

.btn--primary:hover {
  background: #fff;
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.07),
    0 14px 44px rgba(139, 92, 246, 0.35);
}

.btn--gradient {
  background: var(--gradient);
  color: #060610;
  font-weight: 600;
}

.btn--gradient:hover {
  box-shadow: 0 12px 40px rgba(34, 211, 238, 0.25);
  filter: brightness(1.06);
}

.btn--ghost {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
}

.btn--ghost:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.065);
}

.btn--dark {
  background: var(--ink);
  color: var(--text);
}

.btn--dark:hover {
  background: #1b1930;
  box-shadow: 0 12px 36px rgba(10, 10, 18, 0.28);
}

.btn--sm {
  padding: 0.72rem 1.1rem;
  font-size: 0.8rem;
}

.btn--lg {
  padding: 1.1rem 1.75rem;
  font-size: 0.98rem;
}

.btn--block {
  width: 100%;
}

.btn[disabled] {
  opacity: 0.55;
  pointer-events: none;
}

.link-arrow {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.3rem;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 400;
  letter-spacing: -0.005em;
}

.link-arrow::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--violet-soft), var(--cyan));
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.45s var(--ease-out);
}

.link-arrow svg {
  width: 14px;
  height: 14px;
  transition: transform 0.4s var(--ease-out);
}

.link-arrow:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.link-arrow:hover svg {
  transform: translate(2px, -2px);
}

/* Tags & pills ----------------------------------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.72rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.63rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.status__dot {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6ee7b7;
  box-shadow: 0 0 10px rgba(110, 231, 183, 0.75);
}

.status__dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid rgba(110, 231, 183, 0.45);
  border-radius: 50%;
  animation: pulseRing 2.4s var(--ease-out) infinite;
}

/* Reveal animation ------------------------------------------------------- */
.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.9s var(--ease-out),
    transform 0.9s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@keyframes pulseRing {
  0% {
    opacity: 0.8;
    transform: scale(0.7);
  }
  70%,
  100% {
    opacity: 0;
    transform: scale(1.5);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes floatY {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Accessibility ---------------------------------------------------------- */
.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 10000;
  padding: 0.85rem 1.2rem;
  border-radius: 999px;
  background: var(--text);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 500;
  transition: top 0.25s var(--ease-out);
}

.skip-link:focus {
  top: 1rem;
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
