@font-face {
  font-family: "Rootcomputer";
  src:
    url("fonts/Quantify.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #050505;
  --text-primary: #eaeaea;
  --text-muted: #9a9a9a;
  --hairline: rgba(255, 255, 255, 0.08);
  --max-width: 1100px;
  --side-padding: clamp(1.5rem, 4vw, 4rem);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(255, 255, 255, 0.15);
}

html,
body {
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  user-select: none;
}

a,
a:visited,
a:hover,
a:active,
a:focus {
  text-decoration: none;
  color: inherit;
  outline: none;
}

a:focus {
  outline: none;
}

a:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.25);
  outline-offset: 2px;
}

/* ================= CUSTOM SCROLLBAR ================= */

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) rgba(255, 255, 255, 0.05);
}

/* WebKit (Chrome, Edge, Safari) */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
}

::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  border: 2px solid rgba(0, 0, 0, 0.6);
  transition: background-color 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.4);
}

::-webkit-scrollbar-thumb:active {
  background-color: rgba(255, 255, 255, 0.55);
}

@media (max-width: 768px) {
  ::-webkit-scrollbar {
    width: 0;
    height: 0;
  }
}

::-webkit-scrollbar-thumb {
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.08);
}

/* ===== Loader + Fade-in ===== */

/* Hide app until loader completes */
.app-hidden {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 700ms ease, transform 700ms ease;
}
.app-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Fullscreen overlay */
#siteLoader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(
    1200px 800px at 50% 40%,
    rgba(255, 255, 255, 0.06),
    rgba(5, 5, 5, 1) 55%
  );
  display: grid;
  place-items: center;
  overflow: hidden;
  transition: opacity 650ms ease, visibility 650ms ease;
  opacity: 1;
  visibility: visible;
}

/* Optional subtle moving noise (cheap + nice) */
#siteLoader::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(
      circle at 30% 30%,
      rgba(255, 255, 255, 0.05),
      transparent 40%
    ),
    radial-gradient(
      circle at 70% 60%,
      rgba(255, 255, 255, 0.04),
      transparent 45%
    ),
    radial-gradient(
      circle at 45% 80%,
      rgba(255, 255, 255, 0.03),
      transparent 55%
    );
  filter: blur(18px);
  opacity: 0.85;
  animation: loaderFloat 6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes loaderFloat {
  0% {
    transform: translate3d(-2%, -1%, 0) scale(1.02);
  }
  50% {
    transform: translate3d(2%, 1.5%, 0) scale(1.04);
  }
  100% {
    transform: translate3d(-2%, -1%, 0) scale(1.02);
  }
}

#siteLoader.loader-out {
  opacity: 0;
  visibility: hidden;
}

/* Inner layout */
.loader-inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 16px;
  justify-items: center;
  text-align: center;
  padding: 28px 26px;
}

.loader-title {
  font-size: 18px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: rgba(255, 255, 255, 0.92);
}

.loader-sub {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

/* SVG animations */
.loader-svg {
  display: block;
}

.spin {
  transform-origin: 60px 60px;
  animation: spin 1.35s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.orbit {
  transform-origin: 60px 60px;
  animation: orbit 1.05s ease-in-out infinite alternate;
}
@keyframes orbit {
  from {
    transform: rotate(0deg) scale(0.98);
    opacity: 0.75;
  }
  to {
    transform: rotate(65deg) scale(1.03);
    opacity: 1;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .spin,
  .orbit,
  #siteLoader::before {
    animation: none !important;
  }
  .app-hidden,
  .app-visible,
  #siteLoader {
    transition: none !important;
  }
}

/* ================= HERO ================= */

.hero {
  position: relative;
  height: 100vh;
  overflow: hidden;
  margin-top: 0px !important;
}

#neuralCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  height: 100vh;
  display: flex;
  align-items: center;
}

.hero-inner {
  max-width: var(--max-width);
  padding: 0 var(--side-padding);
}

h1 {
  font-family: Rootcomputer, Inter, sans-serif;
  letter-spacing: 0.18em;
  font-size: clamp(2.8rem, 6vw, 5.2rem);
  font-weight: 200;
  letter-spacing: -0.025em;
  margin: 0;
}

p {
  font-size: clamp(1rem, 1.1vw, 1.1rem);
  max-width: 70ch;
}

/* ================= SECTIONS ================= */

section {
  margin: clamp(5rem, 12vh, 10rem) 0;
  z-index: 2;
  position: relative;
  background: transparent;
  overflow: visible;
}

/*
section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(5, 5, 5, 0.85),
    rgba(5, 5, 5, 0.6) 20%,
    rgba(5, 5, 5, 0.6) 80%,
    rgba(5, 5, 5, 0.85)
  );
  pointer-events: none;
  z-index: -1;
}
*/

section:not(.hero):not(.sub-hero):not(.visual-band) {
  margin: clamp(5rem, 12vh, 10rem) 0;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--side-padding);
}

.lead {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
}

.research-more {
  margin-top: 1.5rem;
}

.inline-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: color 0.2s ease;
}

.inline-link:hover {
  color: rgba(255,255,255,0.95);
}

/* ================= HEADINGS ================= */

h2 {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 2rem;
}

/* ================= LISTS ================= */

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

li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--hairline);
}

/* ================= MODELS ================= */

.model {
  margin-bottom: 3rem;
  transition: transform 0.3s ease;
}

.model:hover {
  transform: translateX(6px);
}

.model span {
  font-weight: 500;
  letter-spacing: 0.03em;
}

.model p {
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* ===== Model Labels ===== */

.model {
  position: relative;
}

/* Badge container */
.model-badge {
  position: absolute;
  top: 0.25rem;
  right: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 999px;
  user-select: none;
  pointer-events: none;
  opacity: 0.85;
}

/* Icon sizing */
.model-badge svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* Beta styling */
.model-badge.beta {
  color: rgba(180, 235, 255, 0.95);
  background: rgba(80, 180, 220, 0.12);
  border: 1px solid rgba(120, 210, 255, 0.35);
}

/* Research styling */
.model-badge.research {
  color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.model-cta-row {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* HARD RESET badge behavior inside CTA row */
.model-cta-row .model-badge {
  margin-left: 0 !important;
  float: none !important;
  position: static !important;
}

.model-action {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.18);
  transition: all 0.2s ease;
}

.model-action:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.4);
}

/* Subtle hover coherence */
.model:hover .model-badge {
  opacity: 1;
}

/* ================= MODEL COVER ================= */

.model-cover {
  position: relative;
  width: 100%;
  max-width: var(--max-width);
  height: 260px; /* tuned for half-sphere visibility */
  margin-bottom: -140px; /* pulls title upward into image */
  overflow: hidden;
  pointer-events: none;
  z-index: -10;
}

/* Image layer */
.model-cover-image {
  position: absolute;
  inset: 0;
  background-position: center top;
  background-repeat: no-repeat;
  background-size: 1200px auto; /* sphere scale */
  filter: brightness(0.9);
}

/* Fade mask */
.model-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    /* side fades */
    linear-gradient(to right,
      rgba(5,5,5,1) 0%,
      rgba(5,5,5,0) 18%,
      rgba(5,5,5,0) 82%,
      rgba(5,5,5,1) 100%
    ),
    /* bottom fade */
    linear-gradient(to bottom,
      rgba(5,5,5,0) 0%,
      rgba(5,5,5,0.6) 65%,
      rgba(5,5,5,1) 100%
    );
}

/* ================= VISUAL BAND ================= */

.visual-band {
  height: min(80vh, 900px);
  position: relative;
  overflow: hidden;
}

.visual-layer {
  position: absolute;
  inset: -15%;
  background: url("neural_volume.jpg") center / cover no-repeat;
  filter: brightness(0.3);
  will-change: transform;
}

/* === INTERACTIVE LAB SECTION === */
.neural-lab {
  position: relative;
  height: min(90vh, 900px);
  overflow: visible; /* allow the canvas to visually bleed */
  z-index: 1;
  margin-bottom: 0vh !important;
}

/* Make the canvas physically larger than the section */
#labCanvas {
  position: absolute;
  left: 0;
  top: -45vh; /* extend upward so it can sit behind MODELS */
  width: 100%;
  height: calc(100% + 90vh); /* extend downward so it can sit behind FOOTER */
  pointer-events: auto;
  background: transparent;
  z-index: 0;
}

/* Put text/content above the canvas */
.lab-overlay {
  position: relative;
  z-index: 2;
}

/* Optional: soft fade edges so it blends into surrounding sections */
.neural-lab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -45vh;
  height: calc(100% + 90vh);
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(
    to bottom,
    rgba(5, 5, 5, 1) 0%,
    rgba(5, 5, 5, 0) 18%,
    rgba(5, 5, 5, 0) 82%,
    rgba(5, 5, 5, 1) 100%
  );
}

/* ================= FOOTER ================= */

footer {
  padding: 6rem var(--side-padding);
  text-align: center;
  color: #777;
  position: relative;
  z-index: 3;
  background: transparent;
}

/* ================= FOOTER DIRECTORY ================= */

.site-footer {
  padding: 5rem 0 3rem;
  position: relative;
  z-index: 3;
  background: transparent;
}

.site-footer li {
  border-bottom: none !important;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3rem;

  /* horizontal centering */
  justify-content: center;

  /* vertical alignment of columns */
  align-items: start;

  /* keep content centered within container */
  max-width: 900px;
  margin: 0 auto;
}

.footer-title {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 1.2rem;
}

.footer-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-list li {
  margin-bottom: 0.65rem;
}

.footer-list a {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  transition: opacity 0.2s ease;
}

.footer-list a:hover {
  opacity: 0.65;
}

.footer-muted {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.45);
}

.footer-bottom {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
}

/* Responsive */
@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
  }
}

@media (max-width: 500px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* ================= FOOTER BRANDING ================= */

.footer-branding {
  margin-top: 0px !important;
  padding: 3rem 0 4rem;
  background: transparent;
}

.branding-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 4vw, 4rem);

  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  gap: 3rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.75;
  transition: opacity 0.5s ease;
}

.brand-logo:hover {
  opacity: 1;
}

/* Normalize SVG sizing */
.brand-logo svg {
  max-width: 100%;
  height: auto;
}

/* Rootcomputer slightly smaller + tighter */
.brand-logo.rootcomputer svg {
  max-width: 300px;
}

/* Tablet */
@media (max-width: 200px) {
  .branding-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .brand-logo {
    justify-content: center;
  }
}

/* ================= RESPONSIVE ================= */

@media (max-width: 768px) {
  .hero {
    height: 85vh;
  }
  .model:hover {
    transform: none;
  }
}

/* ================= SUB PAGE ================= */

.sub-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(5, 5, 5, 0.85);
  backdrop-filter: blur(6px);
}

.sub-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}

.sub-logo-mark {
  font-family: Rootcomputer, Inter, sans-serif;
  font-size: 2rem;
  opacity: 0.9;
}

.sub-nav {
  display: flex;
  gap: 2rem;
}

.sub-nav-link {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.6;
  transition: opacity 0.25s ease;
}

.sub-nav-link:hover {
  opacity: 1;
}

.page-kicker {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.55;
  margin-top: 0.5rem;
}

/* Mobile reactive patch for topnav */

@media (max-width: 640px) {

  .sub-header-inner {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: unset;
    padding: 0.75rem 0;
    gap: 0.5rem;
  }

  .sub-nav {
    justify-content: center;
    gap: 1.25rem;
  }

  .sub-logo-mark {
    font-size: 1.5rem;
  }

}


/* Page intro */
.sub-hero {
  margin-top: 0;
  padding-top: clamp(4rem, 10vh, 7rem);
}

.sub-title {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont !important;
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  font-weight: 500;
  letter-spacing: -0.015em;
}

.sub-lead {
  margin-top: 1.5rem;
  font-size: clamp(1.05rem, 1.3vw, 1.15rem);
  color: var(--text-muted);
  max-width: 70ch;
}

/* ================= SOURCE ARCHIVE ================= */

.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2.5rem;
}

.source-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.75rem;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: rgba(255,255,255,0.015);
  transition: transform 0.35s ease, background 0.35s ease, border-color 0.35s ease;
    max-width: 500px;
}

.source-card:hover {
  transform: translateY(-6px);
  background: rgba(255,255,255,0.035);
  border-color: rgba(255,255,255,0.18);
}

.source-card.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.source-icon {
  width: 36px;
  height: 36px;
  color: rgba(255,255,255,0.75);
}

.source-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.6;
}

.source-meta .beta {
  color: rgba(180,235,255,0.95);
}

.source-card h3 {
  font-size: 1.05rem;
  font-weight: 500;
}

.source-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
}