/* ============================================================
   QuantX Global Styles + Utility Classes
   Replaces Tailwind CDN — no build step required
   ============================================================ */

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html {
  background-color: var(--color-surface);
  overflow-y: scroll;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) var(--color-surface-secondary);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
html::-webkit-scrollbar { width: 0.5rem; }
html::-webkit-scrollbar-track { background: var(--color-surface-secondary); }
html::-webkit-scrollbar-thumb {
  border: 2px solid var(--color-surface-secondary);
  border-radius: 999px;
  background: var(--color-border);
}
body {
  position: relative;
  isolation: isolate;
  font-family: var(--font-sans);
  color: var(--color-text);
  background-color: var(--color-surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  min-height: 100vh;
}

/* Shared ambient light field. It sits behind the public pages so the existing
   glass panels catch the same restrained cyan/lilac light without becoming a
   separate card or a hard-edged section background. */
body.qx-ambient-rays { background-color: transparent; }
.quantx-page-rays {
  position: fixed;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--color-surface);
  /* Ambient light supports the page. It must never become a second surface. */
  opacity: .24;
}
.quantx-page-rays canvas { display: block; width: 100%; height: 100%; }
[data-theme="light"] .quantx-page-rays { opacity: .12; mix-blend-mode: multiply; }
@media (prefers-reduced-motion: reduce) {
  .quantx-page-rays { opacity: .34; }
}

img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font-family: inherit; }
input, textarea { font-family: inherit; }

/* Body scroll lock when overlay open */
body.no-scroll { overflow: hidden; }

/* ---- Utility: Display ---- */
.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }
.inline { display: inline; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }

/* ---- Utility: Flexbox ---- */
.flex-row { flex-direction: row; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }
.flex-1 { flex: 1 1 0%; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }

/* ---- Utility: Grid columns ---- */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---- Utility: Gap ---- */
.gap-1 { gap: 0.25rem; }
.gap-1\.5 { gap: 0.375rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.gap-12 { gap: 3rem; }
.gap-15 { gap: 3.75rem; }

/* ---- Utility: Margin ---- */
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-12 { margin-top: 3rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-12 { margin-bottom: 3rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-auto { margin-left: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* ---- Utility: Padding ---- */
.p-6 { padding: 1.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.pt-16 { padding-top: 4rem; }
.pb-12 { padding-bottom: 3rem; }
.p-1 { padding: 0.25rem; }

/* ---- Utility: Text ---- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-5xl { font-size: 3rem; line-height: 1; }
.text-6xl { font-size: 3.75rem; line-height: 1; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-mono { font-family: var(--font-mono); }
.leading-relaxed { line-height: 1.625; }

/* ---- Utility: Width / Height ---- */
.w-full { width: 100%; }
.h-full { height: 100%; }
.w-2\.5 { width: 0.625rem; }
.h-2\.5 { height: 0.625rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }

/* ---- Utility: Rounded ---- */
.rounded-full { border-radius: var(--radius-full); }

/* ---- Utility: Overflow ---- */
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }

/* ---- Utility: Space-y (vertical rhythm for children) ---- */
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-24 > * + * { margin-top: 6rem; }

/* ---- Utility: Order ---- */
.order-1 { order: 1; }
.order-2 { order: 2; }

/* ---- Utility: Misc ---- */
.cursor-pointer { cursor: pointer; }
.bg-white { background-color: #fff; }
.relative { position: relative; }

/* ============================================================
   Responsive breakpoints
   sm: 576px | md: 768px | lg: 1024px | xl: 1280px
   ============================================================ */

/* ---- sm: ≥576px ---- */
@media (min-width: 576px) {
  .sm\:text-5xl { font-size: 3rem; line-height: 1; }
  .sm\:text-6xl { font-size: 3.75rem; line-height: 1; }
  .sm\:inline { display: inline; }
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- md: ≥768px ---- */
@media (min-width: 768px) {
  .md\:pt-24 { padding-top: 6rem; }
  .md\:pb-16 { padding-bottom: 4rem; }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .md\:flex-row { flex-direction: row; }
  .md\:items-center { align-items: center; }
  .md\:space-y-32 > * + * { margin-top: 8rem; }
  .md\:gap-12 { gap: 3rem; }
}

/* ---- lg: ≥1024px ---- */
@media (min-width: 1024px) {
  .lg\:flex { display: flex; }
  .lg\:grid { display: grid; }
  .lg\:block { display: block; }
  .lg\:hidden { display: none !important; }
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:gap-12 { gap: 3rem; }
  .lg\:gap-15 { gap: 3.75rem; }
  .lg\:items-center { align-items: center; }
  .lg\:mt-0 { margin-top: 0; }
  .lg\:order-1 { order: 1; }
  .lg\:order-2 { order: 2; }
  .lg\:justify-end { justify-content: flex-end; }
}

/* ---- xl: ≥1280px ---- */
@media (min-width: 1280px) {
  .xl\:text-6xl { font-size: 3.75rem; line-height: 1; }
}

/* ---- 2xl: ≥1536px ---- */
@media (min-width: 1536px) {
  .\2xl\:container { max-width: 90rem; }
}
