/* Shared Thalamus theme – multi-page */
/* Theme: single source of truth for a formal, consistent look */
:root {
  /* Surfaces */
  --theme-bg: #0a0a0a;
  --theme-surface: #111111;
  --theme-surface-elevated: #0f1423;
  --theme-surface-mid: #0f172a;
  --theme-on-primary: #0a0f1c;

  /* Text */
  --theme-text: #f1f5f9;
  --theme-text-body: #e2e8f0;
  --theme-muted: #94a3b8;
  --theme-subtle: #64748b;

  /* Borders & overlays */
  --theme-border: rgba(255, 255, 255, 0.06);
  --theme-border-strong: rgba(255, 255, 255, 0.1);
  --theme-overlay: rgba(255, 255, 255, 0.02);

  /* Brand */
  --theme-primary: #b085ff;
  --theme-secondary: #818cf8;
  --theme-accent: #a78bfa;
  --theme-accent-deep: #c084fc;

  /* Semantic */
  --theme-success: #4ade80;
  --theme-danger: #f87171;
}

body {
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
}

/* Content images scale on small screens */
main img:not([width]):not([class*='w-']) {
  max-width: 100%;
  height: auto;
}

/* Responsive: mobile & tablet */
@media (max-width: 1023px) {
  main {
    padding-top: 6rem;
  }
}

@media (max-width: 767px) {
  main {
    padding-top: 5.5rem;
  }
}

/* Table scroll wrapper for comparison tables on small screens */
.table-scroll-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-left: -0.5rem;
  margin-right: -0.5rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}
@media (min-width: 768px) {
  .table-scroll-wrap {
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
  }
}

/* Touch-friendly tap targets */
@media (max-width: 1023px) {
  .btn-gradient-primary,
  a.btn-gradient-primary {
    min-height: 44px;
    padding: 0.75rem 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

/* Prevent any full-width container from causing horizontal scroll */
.container {
  box-sizing: border-box;
  max-width: 100%;
}

section[id],
div[id] {
  scroll-margin-top: 100px;
}

header {
  position: fixed !important;
  top: 0.5rem !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 9999 !important;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease,
    visibility 0.3s ease;
  will-change: transform, opacity;
}

header.hidden {
  opacity: 0 !important;
  transform: translateY(calc(-100% - 1rem)) !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Contact page: header scrolls with page so reCAPTCHA (inside HubSpot iframe) is never hidden behind navbar */
body.page-contact header {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  z-index: 100 !important;
}
body.page-contact main {
  padding-top: 1rem;
}

.font-heading-blend {
  font-family: 'Satoshi', 'Space Grotesk', 'Inter', sans-serif;
}

/* Earlier brand gradient: teal → purple → pink */
.gradient-endless,
.gradient-v2 {
  background: linear-gradient(90deg, #07bda7 0%, #7b66ff 58%, #ed597d 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pill-v2 {
  background: color-mix(in srgb, var(--theme-primary) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--theme-primary) 20%, transparent);
  color: var(--theme-primary);
}

.hero-grid-bg {
  background-image:
    linear-gradient(var(--theme-overlay) 1px, transparent 1px),
    linear-gradient(90deg, var(--theme-overlay) 1px, transparent 1px);
  background-size: 64px 64px;
}

/* Hero section: center block; allow growth when zoomed so CTAs stay visible */
#hero {
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 100vh;
  box-sizing: border-box;
  overflow: clip;
}
#hero .container {
  width: 100%;
  max-width: 100%;
  padding-left: 1rem;
  padding-right: 1rem;
  box-sizing: border-box;
}
#hero .container > div {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  min-width: 0;
}
/* Both columns must shrink on small viewports (prevent flex overflow) */
#hero .container > div > div.flex-1 {
  min-width: 0;
  max-width: 100%;
}

@media (min-width: 640px) {
  #hero .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  #hero .container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

@media (max-width: 1023px) {
  #hero {
    overflow: visible;
    isolation: isolate;
  }
  #hero .container {
    z-index: auto;
  }
  #hero .container > div {
    max-width: 100%;
  }
}

@media (max-width: 767px) {
  #hero {
    max-height: none;
    padding-left: 1rem;
    padding-right: 1rem;
    min-height: auto;
    padding-top: 5.5rem;
    padding-bottom: 4rem;
  }
  #hero .container {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    max-width: 100%;
  }
  #hero .container > div {
    gap: 1.5rem;
    max-width: 100%;
  }
  .hero-video-wrap {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    aspect-ratio: auto;
    max-height: none;
    overflow: visible;
  }
  .hero-video-wrap .hero-carousel-inner {
    order: 0;
    flex: 0 0 auto;
    aspect-ratio: 3 / 4;
    max-height: 55vh;
  }
  .hero-video-wrap .hero-overlay-doc-wrap {
    order: 1;
  }
}

@media (max-width: 479px) {
  #hero {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    padding-top: 5rem;
  }
  #hero .container {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}

/* Tablet: hero still in flex-col (lg breakpoint = 1024px) so overlays need column layout */
@media (min-width: 768px) and (max-width: 1023px) {
  #hero {
    min-height: auto;
    padding-bottom: 4rem;
  }
  .hero-video-wrap {
    max-width: 480px;
    display: flex;
    flex-direction: column;
    aspect-ratio: auto;
    max-height: none;
    overflow: visible;
    border-radius: 1rem;
  }
  .hero-video-wrap .hero-carousel-inner {
    order: 0;
    flex: 0 0 auto;
    aspect-ratio: 3 / 4;
    max-height: 60vh;
    border-radius: 1rem;
  }
  .hero-video-wrap .hero-overlay-doc-wrap {
    order: 1;
  }
  .hero-carousel-slide,
  .hero-carousel-slide img,
  .hero-carousel-slide video {
    border-radius: 1rem;
  }
}

.btn-gradient-primary {
  background: var(--theme-primary);
  color: #fff;
  border: none;
  padding: 0.75rem 1.75rem;
  font-size: 0.9375rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  display: inline-block;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-gradient-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px
    color-mix(in srgb, var(--theme-primary) 35%, transparent);
}

.floating-cta-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 2rem;
  background: color-mix(in srgb, var(--theme-on-primary) 92%, transparent);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--theme-border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-cta-bar.visible {
  transform: translateY(0);
}

/* Cards */
.feature-card {
  background: var(--theme-bg);
  border-radius: 1.5rem;
  padding: 3rem 4rem;
  border: 1px solid var(--theme-border-strong);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8);
  position: relative;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--theme-secondary) 50%, transparent),
    transparent
  );
  opacity: 1;
}

.feature-card-blend:hover {
  border-color: var(--theme-border-strong);
  transform: translateY(-4px);
  transition:
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.35s ease;
}

.feature-card.feature-card-blend::before {
  background: linear-gradient(
    90deg,
    transparent,
    var(--theme-primary),
    var(--theme-secondary),
    transparent
  );
}

.section-headline {
  font-size: clamp(1.75rem, 4vw, 2.625rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--theme-text);
}

/* Page cards (Product / Why / About) */
.page-card {
  padding: 2rem 1.75rem;
  background: var(--theme-overlay);
  border: 1px solid var(--theme-border);
  border-radius: 1rem;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

.page-card:hover:not(.page-card-no-hover) {
  border-color: var(--theme-border-strong);
  background: color-mix(in srgb, white 3%, transparent);
}

/* Accordion (Product – What Thalamus Handles) – v2-style */
.accordion-capability-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

details.accordion-capability {
  padding: 2.5rem;
  border: 1px solid var(--theme-border);
  border-radius: 1rem;
  background: var(--theme-overlay);
  cursor: pointer;
  transition:
    border-color 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    background 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

details.accordion-capability::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--theme-primary),
    transparent
  );
  opacity: 0;
  transition: opacity 0.35s ease;
}

details.accordion-capability:hover,
details.accordion-capability[open] {
  border-color: var(--theme-border-strong);
  background: color-mix(in srgb, white 3%, transparent);
}

details.accordion-capability:hover::before,
details.accordion-capability[open]::before {
  opacity: 1;
}

details.accordion-capability .accordion-summary {
  list-style: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 0;
  cursor: pointer;
}

details.accordion-capability .accordion-summary::-webkit-details-marker,
details.accordion-capability .accordion-summary::marker {
  display: none;
}

.accordion-icon {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 0.875rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.accordion-icon-cyan {
  background: color-mix(in srgb, var(--theme-primary) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--theme-primary) 25%, transparent);
  color: var(--theme-primary);
}

.accordion-icon-indigo {
  background: color-mix(in srgb, var(--theme-secondary) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--theme-secondary) 25%, transparent);
  color: var(--theme-secondary);
}

.accordion-icon-accent {
  background: color-mix(in srgb, var(--theme-accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--theme-accent) 25%, transparent);
  color: var(--theme-accent);
}

.accordion-icon-accent-deep {
  background: color-mix(in srgb, var(--theme-accent-deep) 12%, transparent);
  border: 1px solid
    color-mix(in srgb, var(--theme-accent-deep) 25%, transparent);
  color: var(--theme-accent-deep);
}

.accordion-text {
  flex: 1;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

details.accordion-capability .accordion-chevron {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: color-mix(in srgb, white 4%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--theme-subtle);
  font-size: 0.875rem;
  transition: transform 0.3s ease;
}

details.accordion-capability[open] .accordion-chevron {
  transform: rotate(180deg);
}

details.accordion-capability .accordion-content {
  padding-top: 1.5rem;
  padding-left: 4.5rem;
  overflow: hidden;
}

.accordion-sublist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: #cbd5e1;
  line-height: 1.6;
}

.accordion-sublist li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.accordion-bullet {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 0.45rem;
  opacity: 0.7;
}

.accordion-bullet-cyan {
  background: var(--theme-primary);
}
.accordion-bullet-indigo {
  background: var(--theme-secondary);
}
.accordion-bullet-accent {
  background: var(--theme-accent);
}
.accordion-bullet-accent-deep {
  background: var(--theme-accent-deep);
}

@media (max-width: 640px) {
  details.accordion-capability {
    padding: 1.25rem;
  }
  details.accordion-capability .accordion-content {
    padding-left: 0;
    padding-top: 1rem;
  }
}

/* Stars (home only) */
.stars-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.star {
  position: absolute;
  background: white;
  border-radius: 50%;
  opacity: 0.6;
  animation: twinkle linear infinite;
}

.star-small {
  width: 1px;
  height: 1px;
}
.star-medium {
  width: 2px;
  height: 2px;
}
.star-large {
  width: 3px;
  height: 3px;
  opacity: 0.8;
}

@keyframes twinkle {
  0% {
    transform: translateY(100vh) translateX(0);
    opacity: 0.3;
  }
  50% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(-100vh) translateX(50px);
    opacity: 0.3;
  }
}

.star-slow {
  animation-duration: 45s;
}
.star-fast {
  animation-duration: 25s;
}

/* Hero data flow card (v2-style) */
.hero-flow-card {
  background: var(--theme-overlay);
  border: 1px solid var(--theme-border);
  border-radius: 1.25rem;
  padding: 2.5rem;
}
@media (max-width: 767px) {
  .hero-flow-card {
    padding: 1.5rem;
    border-radius: 1rem;
  }
}
.hero-flow-dot {
  animation: pulseGlow 2.5s ease infinite;
}

/* Hero video with overlay — portrait frame so full-page documents show complete */
.hero-video-wrap {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
  border-radius: 1.25rem;
  overflow: visible;
  border: 1px solid var(--theme-border);
  aspect-ratio: 3 / 4;
  max-height: 70vh;
}
.hero-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 1.25rem;
}
/* Doc context overlay: right of carousel, vertically centered */
.hero-overlay-doc-wrap {
  position: absolute;
  left: auto;
  right: -164px;
  top: 50%;
  transform: translateY(-50%);
  bottom: auto;
  width: 300px;
  max-width: min(300px, calc(100vw - 3rem));
  z-index: 10;
  pointer-events: none;
}
.hero-overlay-doc-wrap .hero-video-overlay {
  pointer-events: auto;
}

/* Chunk overlay: right of carousel, pushed a bit more on content */
.hero-overlays-wrap {
  position: absolute;
  right: -220px;
  top: 50%;
  transform: translateY(-50%);
  width: 360px;
  max-width: min(360px, calc(100vw - 3rem));
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 10;
  pointer-events: none;
}
.hero-overlays-wrap .hero-video-overlay {
  pointer-events: auto;
}

.hero-video-overlay {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  transform: none;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 1rem 1.25rem;
  overflow: clip;
  background: linear-gradient(
    to right,
    rgba(15, 15, 22, 0.78) 0%,
    rgba(15, 15, 22, 0.88) 50%,
    rgba(15, 15, 22, 0.96) 100%
  );
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: ui-monospace, 'SF Mono', 'Cascadia Code', Monaco, monospace;
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--theme-text-body);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.35s ease-out,
    visibility 0.35s ease-out;
}
.hero-video-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}
.hero-video-overlay .hero-overlay-heading {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--theme-primary);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 0.25s ease-out,
    transform 0.25s ease-out;
}
.hero-video-overlay .hero-overlay-heading.streamed {
  opacity: 1;
  transform: translateY(0);
}
.hero-video-overlay .overlay-line {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
  display: block;
  margin-bottom: 0.4rem;
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 0.25s ease-out,
    transform 0.25s ease-out;
}
.hero-video-overlay .overlay-line.streamed {
  opacity: 1;
  transform: translateY(0);
}
.hero-video-overlay .overlay-line:last-child,
.hero-video-overlay .mt-2 .overlay-line:last-child {
  margin-bottom: 0;
}
/* Section blocks: Document vs First Chunk */
.hero-video-overlay .overlay-section {
  padding-left: 0.75rem;
  border-left: 3px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 0.5rem;
}
.hero-video-overlay .overlay-section:last-child {
  margin-bottom: 0;
}
.hero-video-overlay .overlay-section-document {
  border-left-color: var(--v2-cyan);
}
.hero-video-overlay .overlay-section-chunk {
  border-left-color: var(--v2-indigo);
  margin-top: 0.75rem;
  padding: 0.65rem 0.75rem 0.6rem;
  padding-left: 0.9rem;
  border-radius: 8px;
  background: rgba(129, 140, 248, 0.06);
  border: 1px solid rgba(129, 140, 248, 0.15);
}
/* Subheading (Document / First Chunk) inside single overlay */
.hero-video-overlay .overlay-line.overlay-subheading {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--theme-subtle);
}
.hero-video-overlay
  .overlay-section-document
  .overlay-line.overlay-subheading
  .overlay-key {
  color: var(--v2-cyan);
}
.hero-video-overlay
  .overlay-section-chunk
  .overlay-line.overlay-subheading
  .overlay-key {
  color: var(--v2-indigo);
}
.hero-video-overlay .overlay-line.overlay-subheading .overlay-key {
  color: var(--theme-subtle);
}
/* custom_extract context (legal_context, visual_intent, logistics_intent) – pill style */
.hero-video-overlay .overlay-line.overlay-context {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--v2-indigo);
  margin-bottom: 0.6rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  background: rgba(129, 140, 248, 0.12);
  border: 1px solid rgba(129, 140, 248, 0.2);
  display: inline-block;
}
.hero-video-overlay .overlay-line.overlay-context .overlay-val {
  color: inherit;
}
/* custom_extract field (name: value) – row layout */
.hero-video-overlay .overlay-line.overlay-field {
  margin-bottom: 0.4rem;
  padding: 0.28rem 0;
  padding-left: 0.5rem;
  border-left: 2px solid rgba(129, 140, 248, 0.25);
  border-radius: 0 4px 4px 0;
  background: rgba(255, 255, 255, 0.02);
}
.hero-video-overlay .overlay-line.overlay-field:last-child {
  margin-bottom: 0;
}
.hero-video-overlay .overlay-line.overlay-field .overlay-key {
  display: inline-block;
  min-width: 5.5em;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: capitalize;
  color: var(--v2-indigo);
  opacity: 0.95;
}
.hero-video-overlay .overlay-line.overlay-field .overlay-val {
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
}
/* White divider inside First Chunk section */
.hero-video-overlay .overlay-line.overlay-divider {
  display: block;
  width: 100%;
  min-height: 1px;
  height: 1px;
  margin: 0.5rem 0 0.6rem;
  padding: 0;
  border: none;
  box-sizing: border-box;
  overflow: hidden;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0.4) 0%,
    rgba(255, 255, 255, 0.25) 50%,
    rgba(255, 255, 255, 0.12) 100%
  );
  flex-shrink: 0;
}
/* Content preview field */
.hero-video-overlay .overlay-line.overlay-content-preview {
  margin-bottom: 0.5rem;
  font-size: 0.6875rem;
  max-height: 6rem;
  overflow-y: auto;
}
.hero-video-overlay .overlay-line.overlay-content-preview .overlay-key {
  color: var(--v2-indigo);
  font-weight: 600;
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.hero-video-overlay .overlay-line.overlay-content-preview .overlay-val {
  color: rgba(255, 255, 255, 0.72);
  white-space: pre-wrap;
  word-break: break-word;
}
/* "Custom Extraction" label before formula boxes */
.hero-video-overlay .overlay-line.overlay-custom-label {
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 0.6rem;
  margin-bottom: 0.35rem;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.12);
  border-left: 3px solid var(--v2-cyan);
}
.hero-video-overlay .overlay-line.overlay-custom-label .overlay-key {
  color: var(--v2-cyan);
  font-weight: 800;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}
/* custom_extract formulation (formula + explanation) – card style */
.hero-video-overlay .overlay-line.overlay-formula {
  margin-bottom: 0.6rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
}
.hero-video-overlay .overlay-line.overlay-formula:last-child {
  margin-bottom: 0;
}
.hero-video-overlay .overlay-line.overlay-formula .overlay-formula-key {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  font-family: ui-monospace, 'SF Mono', Monaco, monospace;
  color: var(--v2-cyan);
  margin-bottom: 0.2rem;
  letter-spacing: 0.02em;
}
.hero-video-overlay .overlay-line.overlay-formula .overlay-val {
  font-size: 0.6875rem;
  font-weight: 400;
  line-height: 1.45;
  display: block;
  padding-left: 0;
  color: rgba(255, 255, 255, 0.8);
}
.hero-video-overlay
  .overlay-line.overlay-formula:not(.overlay-field-line)
  .overlay-formula-key,
.hero-video-overlay
  .overlay-line.overlay-formula:not(.overlay-field-line)
  .overlay-val {
  margin-bottom: 0;
}
/* Physics formula cards: formula value (v = ds/dt, v = ma) same style as explanation and other values */
.hero-video-overlay
  .overlay-line.overlay-formula:not(.overlay-field-line)
  .overlay-formula-key {
  font-size: 0.6875rem;
  font-weight: 400;
  font-family: inherit;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: normal;
}
/* Formula block: keep "Formula : …" and "Explanation : …" each on one line, colon same as fields */
.hero-video-overlay .overlay-line.overlay-formula .overlay-formula-line {
  display: block;
  margin-bottom: 0.2rem;
}
.hero-video-overlay
  .overlay-line.overlay-formula
  .overlay-formula-line:last-child {
  margin-bottom: 0;
}
.hero-video-overlay
  .overlay-line.overlay-formula
  .overlay-formula-line
  .overlay-formula-key,
.hero-video-overlay
  .overlay-line.overlay-formula
  .overlay-formula-line
  .overlay-val {
  display: inline;
  margin-bottom: 0;
}
/* Field row: Name on first line, Value on second line */
.hero-video-overlay
  .overlay-line.overlay-formula.overlay-field-line
  .overlay-field-name-line,
.hero-video-overlay
  .overlay-line.overlay-formula.overlay-field-line
  .overlay-field-value-line {
  display: block;
}
.hero-video-overlay
  .overlay-line.overlay-formula.overlay-field-line
  .overlay-field-name-line
  .overlay-formula-key {
  display: inline;
  font-size: 0.6875rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.8);
}
.hero-video-overlay
  .overlay-line.overlay-formula.overlay-field-line
  .overlay-field-value-line
  .overlay-val {
  display: inline;
}
.hero-video-overlay
  .overlay-line.overlay-formula.overlay-field-line
  .overlay-field-value-line {
  margin-top: 0.2rem;
}
/* Name, Value, Formula, Explanation – all four labels same style */
.hero-video-overlay .overlay-formula-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--theme-subtle);
  margin-right: 0.2rem;
}
/* Time / timestamp (Clip) – badge style */
.hero-video-overlay .overlay-time {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--v2-indigo);
  margin-bottom: 0.5rem;
  padding: 0.22rem 0.45rem;
  border-radius: 6px;
  background: rgba(129, 140, 248, 0.1);
  display: inline-block;
}
.hero-video-overlay .overlay-time .overlay-val {
  color: inherit;
}
/* Description / content summary */
.hero-video-overlay .overlay-desc {
  font-size: 0.6875rem;
  line-height: 1.5;
  color: var(--theme-text);
  margin-bottom: 0.625rem;
  opacity: 0.95;
}
/* Key-value block separator */
.hero-video-overlay .mt-2.space-y-0\.5 {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.hero-video-overlay .mt-2.space-y-0\.5 .overlay-line {
  margin-bottom: 0.3rem;
  font-size: 0.6875rem;
}
/* Field label (key) */
.hero-video-overlay .overlay-key {
  color: var(--theme-primary);
  font-weight: 500;
  opacity: 0.95;
}
/* Field value */
.hero-video-overlay .overlay-val {
  color: var(--theme-text);
  font-weight: 400;
}
/* Small desktop: tighter right offset so overlay stays mostly visible (hero is row at lg:1024px+) */
@media (min-width: 1024px) and (max-width: 1199px) {
  .hero-overlay-doc-wrap {
    left: auto;
    right: -100px;
    top: 50%;
    transform: translateY(-50%);
    width: 280px;
    max-width: min(280px, calc(100vw - 420px));
  }
  .hero-overlays-wrap {
    right: -190px;
    width: 320px;
    max-width: min(320px, calc(100vw - 420px));
  }
}

@media (max-width: 767px) {
  .hero-video-wrap {
    border-radius: 1rem;
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
    aspect-ratio: auto;
    max-height: none;
    display: flex;
    flex-direction: column;
    overflow: visible;
  }
  .hero-carousel-inner,
  .hero-carousel-slide,
  .hero-carousel-slide img,
  .hero-carousel-slide video {
    border-radius: 1rem;
  }
  .hero-video-wrap video {
    border-radius: 1rem;
  }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .hero-video-wrap {
    aspect-ratio: auto;
    max-height: none;
    display: flex;
    flex-direction: column;
    overflow: visible;
  }
}

/* Hero carousel — fills wrap (portrait ratio from .hero-video-wrap) */
.hero-carousel-inner {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 1.25rem;
}
.hero-carousel-slides {
  display: flex;
  height: 100%;
  min-height: 0;
  transition: transform 0.5s ease;
  will-change: transform;
}
.hero-carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  min-height: 0;
  position: relative;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 1.25rem;
}
/* Full image visible: contain in portrait frame, no cropping */
.hero-carousel-slide img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 1.25rem;
}
.hero-carousel-slide video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  border-radius: 1.25rem;
}
.hero-carousel-dots {
  position: absolute;
  bottom: 0.75rem;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  z-index: 2;
  pointer-events: none;
}
.hero-carousel-dots .hero-carousel-dot {
  pointer-events: auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
  border: 1px solid rgba(0, 0, 0, 0.35);
  padding: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.hero-carousel-dots .hero-carousel-dot:hover {
  background: rgba(255, 255, 255, 0.7);
}
.hero-carousel-dots .hero-carousel-dot.is-active {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(0, 0, 0, 0.45);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  transform: scale(1.2);
}

.final-cta-glow {
  background: radial-gradient(
    ellipse,
    color-mix(in srgb, var(--theme-primary) 6%, transparent) 0%,
    transparent 70%
  );
}
@keyframes pulseGlow {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.8;
  }
}

body > *:not(.stars-container) {
  position: relative;
  z-index: 1;
}

/* Logo marquee (home) */
.logo-marquee-container {
  overflow: hidden;
  width: 100%;
  mask-image: linear-gradient(
    to right,
    transparent,
    black 10%,
    black 90%,
    transparent
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    black 10%,
    black 90%,
    transparent
  );
}

.logo-marquee {
  display: flex;
  gap: 3rem;
  width: fit-content;
  animation: marquee 10s linear infinite;
}

.logo-marquee-item {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 80px;
  width: 200px;
}

.logo-marquee-item img {
  max-height: 60px;
  max-width: 180px;
  object-fit: contain;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.logo-marquee-item img[alt='crew-link-icon'] {
  max-height: 50px;
  filter: brightness(0) invert(1);
}

.logo-marquee-item img:hover {
  opacity: 1;
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

@media (max-width: 768px) {
  .feature-card {
    padding: 2rem;
  }
  .logo-marquee {
    gap: 1rem;
    animation-duration: 14s;
  }
  .logo-marquee-item {
    width: 100px;
    height: 50px;
  }
  .logo-marquee-item img {
    max-height: 40px;
    max-width: 90px;
  }
}

/* Pain points (home / problem section) */
.pain-point {
  padding: 1.25rem 1.5rem;
  border-left: 2px solid
    color-mix(in srgb, var(--theme-danger) 50%, transparent);
  background: color-mix(in srgb, var(--theme-danger) 3%, transparent);
  border-radius: 0 8px 8px 0;
  transition: all 0.3s;
}
.pain-point:hover {
  border-left-color: var(--theme-danger);
  background: color-mix(in srgb, var(--theme-danger) 6%, transparent);
}

/* Build trap steps (why page) */
.trap-step {
  padding: 1.25rem 1.75rem;
  border-left: 2px solid
    color-mix(in srgb, var(--theme-danger) 40%, transparent);
  background: color-mix(in srgb, var(--theme-danger) 2%, transparent);
  border-radius: 0 10px 10px 0;
  position: relative;
  padding-left: 2.5rem;
}
.trap-step-num {
  position: absolute;
  left: -14px;
  top: 18px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--theme-bg);
  border: 2px solid color-mix(in srgb, var(--theme-danger) 40%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--theme-danger);
}

/* Timeline bars (why page) */
.timeline-bar {
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  font-size: 13px;
  font-weight: 600;
  transition: transform 0.3s;
}

@media (max-width: 640px) {
  footer .flex {
    flex-direction: column;
    gap: 1.5rem;
  }
}

/* Mobile menu: larger tap targets */
@media (max-width: 767px) {
  #mobileMenu a {
    padding: 0.75rem 0.5rem;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  #mobileMenu a:not(.btn-gradient-primary) {
    justify-content: flex-start;
  }
  header button[aria-label='Menu'] {
    min-width: 44px;
    min-height: 44px;
    padding: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* Section padding: reduce on mobile/tablet */
@media (max-width: 767px) {
  section.py-24 {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }
  section.py-28 {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }
  section.py-20 {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }
  section.px-6 {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}
@media (min-width: 768px) and (max-width: 1023px) {
  section.py-24,
  section.py-28 {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
  section.py-20 {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }
}

/* Inner table keeps min-width so wrapper scrolls horizontally on small screens */
.table-scroll-wrap .table-scroll-inner {
  min-width: 480px;
}

/* Contact page form loader */
.contact-form-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: var(--theme-bg);
  border-radius: 0.75rem;
  z-index: 10;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}
.contact-form-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.contact-form-loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--theme-border);
  border-top-color: var(--theme-primary);
  border-radius: 50%;
  animation: contact-loader-spin 0.8s linear infinite;
}
.contact-form-loader-text {
  font-size: 0.875rem;
  color: var(--theme-muted);
}
@keyframes contact-loader-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ========== Responsive: Mobile & Tablet (full pass) ========== */

/* Base: prevent horizontal scroll, safe area */
@media (max-width: 1023px) {
  body {
    overflow-x: hidden;
  }
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}
@media (max-width: 479px) {
  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  section.px-6 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

/* Header: logo and nav on small screens */
@media (max-width: 639px) {
  header img[alt='Thalamus'] {
    max-width: 100px;
    height: auto;
  }
  header .container.mx-auto,
  header nav.container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}
@media (max-width: 380px) {
  header {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  header img[alt='Thalamus'] {
    max-width: 88px;
  }
  header .container.mx-auto,
  header nav.container {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}
@media (min-width: 768px) and (max-width: 1023px) {
  header .container.mx-auto,
  header nav.container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Hero: heading scale down on very small screens */
@media (max-width: 479px) {
  #hero .text-4xl,
  #hero h1 {
    font-size: 1.75rem;
    line-height: 1.2;
  }
  #hero .text-lg {
    font-size: 0.9375rem;
  }
  #hero .flex.flex-wrap.gap-4 {
    flex-direction: column;
    align-items: stretch;
  }
  #hero .flex.flex-wrap.gap-4 a {
    text-align: center;
  }
}

/* Hero overlays: below carousel on mobile/tablet (hero is column until lg:1024px) */
@media (max-width: 1023px) {
  .hero-overlay-doc-wrap {
    position: static;
    left: auto;
    top: auto;
    transform: none;
    width: 100%;
    max-width: 100%;
    margin-top: 1rem;
    margin-bottom: 2rem;
    z-index: auto;
  }
  .hero-overlays-wrap {
    position: static;
    right: auto;
    bottom: auto;
    transform: none;
    width: 100%;
    max-width: 100%;
    margin-top: 0.75rem;
    margin-bottom: 0;
    gap: 0.5rem;
    z-index: auto;
  }
  .hero-overlays-wrap .hero-video-overlay {
    position: relative;
    z-index: auto;
  }
  .hero-video-overlay {
    width: 100%;
    max-width: 100%;
    margin-top: 0;
    margin-bottom: 0;
    font-size: 0.6875rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    overflow: visible;
    max-height: none;
  }
  .hero-video-overlay .overlay-time {
    margin-bottom: 0.25rem;
  }
  .hero-video-overlay .overlay-desc {
    margin-bottom: 0.25rem;
  }
  .hero-video-overlay .overlay-line {
    white-space: normal;
    word-break: break-word;
    overflow: visible;
  }
}

/* Very small screens: slightly smaller overlays */
@media (max-width: 479px) {
  .hero-video-overlay {
    font-size: 0.625rem;
    padding: 0.5rem 0.75rem;
  }
}

/* Social proof: stats row wrap and spacing */
@media (max-width: 639px) {
  #social-proof .flex.flex-wrap.justify-center.gap-12,
  #social-proof .flex.flex-wrap.justify-center.gap-16 {
    gap: 1.5rem;
    flex-direction: column;
    align-items: center;
  }
  #social-proof .gradient-v2.text-3xl,
  #social-proof .gradient-v2.text-4xl {
    font-size: 1.75rem;
  }
}

/* Social proof strip: mobile responsive */
@media (max-width: 767px) {
  #social-proof {
    padding-top: 4rem;
    padding-bottom: 2rem;
    padding-left: 1rem;
    padding-right: 1rem;
    overflow-x: hidden;
  }
  #social-proof .container {
    max-width: 100%;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  #social-proof .text-xs.uppercase {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    line-height: 1.4;
    margin-bottom: 1.5rem;
  }
  .logo-marquee-container {
    margin-bottom: 1.5rem;
    padding-left: 0;
    padding-right: 0;
  }
}

@media (max-width: 479px) {
  #social-proof {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    padding-top: 4rem;
    padding-bottom: 1.5rem;
  }
  #social-proof .container {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  .logo-marquee-item {
    width: 80px;
    height: 44px;
  }
  .logo-marquee-item img {
    max-height: 32px;
    max-width: 72px;
  }
  .logo-marquee {
    gap: 0.75rem;
  }
}

/* Table scroll: ensure wrapper doesn't cause page overflow */
@media (max-width: 767px) {
  .table-scroll-wrap {
    width: 100%;
    margin-left: -1rem;
    margin-right: -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .table-scroll-inner {
    min-width: 320px;
  }
  .table-scroll-wrap .grid.grid-cols-3 > * {
    padding: 0.75rem 0.5rem;
    font-size: 0.8125rem;
  }
}

/* Build vs buy / final CTA stat boxes (target by attribute for Tailwind classes) */
@media (max-width: 639px) {
  [class*='from-theme-secondary'] .flex.flex-wrap,
  [class*='from-theme-secondary'] .flex.flex-wrap.justify-center {
    flex-direction: column;
    gap: 1rem;
  }
  [class*='from-theme-secondary'] .gradient-v2.text-3xl,
  [class*='from-theme-secondary'] .gradient-v2.text-5xl,
  [class*='from-theme-secondary'] .text-2xl,
  [class*='from-theme-secondary'] .text-4xl {
    font-size: 1.75rem;
  }
  div[class*='from-theme-secondary'].rounded-2xl,
  div[class*='bg-white/5'].rounded-2xl.border {
    padding: 1.25rem 1rem;
  }
}

/* Floating CTA bar */
@media (max-width: 767px) {
  .floating-cta-bar {
    flex-direction: column;
    padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
    gap: 0.75rem;
    align-items: stretch;
  }
  .floating-cta-bar .btn-gradient-primary,
  .floating-cta-bar a {
    width: 100%;
    justify-content: center;
  }
}

/* Section padding: tablet */
@media (min-width: 768px) and (max-width: 1023px) {
  section.px-6 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/* Page cards: tighter padding on mobile */
@media (max-width: 639px) {
  .page-card {
    padding: 1.25rem 1rem;
  }
}

/* Pain points & trap steps: avoid overflow */
@media (max-width: 639px) {
  .pain-point {
    padding: 1rem 1rem 1rem 1.25rem;
  }
  .trap-step {
    padding: 1rem 1rem 1rem 2.25rem;
  }
  .trap-step-num {
    left: -12px;
    width: 24px;
    height: 24px;
    font-size: 10px;
  }
}

/* Timeline bars: smaller text and padding on mobile */
@media (max-width: 639px) {
  .timeline-bar {
    height: 36px;
    padding: 0 0.75rem;
    font-size: 0.75rem;
  }
}

/* Why page: license list rows – allow text to wrap and shrink */
.flex.gap-3.p-4 {
  min-width: 0;
}
.flex.gap-3.p-4 > span:not([class*='flex-shrink-0']) {
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Product architecture grid: single column on tablet, hide arrows */
@media (min-width: 768px) and (max-width: 1023px) {
  #architecture .grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  #architecture .grid > .flex.items-center.justify-center.shrink-0 {
    display: none;
  }
  #architecture .page-card {
    min-width: 0;
  }
}

/* Architecture: allow card labels to wrap on small screens, legend wrap */
@media (max-width: 639px) {
  #architecture .whitespace-nowrap {
    white-space: normal;
  }
  #architecture .grid {
    gap: 0.5rem;
  }
  #architecture .flex.justify-center.gap-8 {
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
  }
}

/* Final CTA glow: scale down on mobile */
@media (max-width: 767px) {
  .final-cta-glow {
    width: 320px;
    height: 320px;
  }
}

/* Inner page hero headings (about, product, why) */
@media (max-width: 479px) {
  main .hero-grid-bg h1 {
    font-size: 1.5rem;
    line-height: 1.25;
  }
}

/* Final CTA heading */
@media (max-width: 479px) {
  #final-cta h2,
  #final-cta .text-3xl {
    font-size: 1.5rem;
    line-height: 1.3;
  }
}

/* Footer: spacing and links */
@media (max-width: 767px) {
  footer {
    padding-top: 2rem;
    padding-bottom: 2rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }
  footer .flex.flex-wrap.gap-4,
  footer .flex.flex-wrap.gap-6 {
    gap: 0.75rem;
  }
  footer img[alt='Thalamus'] {
    max-width: 100px;
    height: auto;
  }
}

/* Contact form container and iframe responsiveness */
#contact-form iframe,
#contact-form .hs-form-frame iframe {
  max-width: 100%;
}
@media (max-width: 639px) {
  #contact-form .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  #contact-form .text-3xl {
    font-size: 1.5rem;
  }
  #contact-form .w-full.flex {
    padding-left: 0;
    padding-right: 0;
  }
}

/* Accordion summary: allow wrap on small screens */
@media (max-width: 639px) {
  .accordion-summary {
    flex-wrap: wrap;
  }
  .accordion-summary .accordion-icon {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1rem;
  }
  details.accordion-capability .accordion-content {
    padding-top: 0.75rem;
  }
}
