:root {
  --bg-base: #0a0c12;
  --bg-surface: #111420;
  --bg-elevated: #181c2e;
  --accent-amber: #f5a623;
  --accent-amber-dim: rgba(245, 166, 35, 0.15);
  --accent-amber-glow: rgba(245, 166, 35, 0.4);
  --accent-teal: #00c6b8;
  --accent-teal-dim: rgba(0, 198, 184, 0.12);
  --text-primary: #f0f2ff;
  --text-secondary: #8b90a8;
  --text-muted: #4b5068;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-accent: rgba(245, 166, 35, 0.3);
  --mesh-purple: rgba(108, 69, 255, 0.18);
  --mesh-amber: rgba(245, 166, 35, 0.16);
  --mesh-teal: rgba(0, 198, 184, 0.14);
  --background: 224 27% 5%;
  --foreground: 235 40% 97%;
  --card: 227 31% 10%;
  --card-foreground: 235 40% 97%;
  --popover: 227 31% 10%;
  --popover-foreground: 235 40% 97%;
  --primary: 38 91% 55%;
  --primary-foreground: 222 47% 11%;
  --secondary: 227 29% 15%;
  --secondary-foreground: 235 40% 97%;
  --muted: 228 26% 12%;
  --muted-foreground: 229 15% 68%;
  --accent: 174 100% 39%;
  --accent-foreground: 222 47% 11%;
  --destructive: 0 63% 31%;
  --destructive-foreground: 0 0% 100%;
  --border: 228 22% 18%;
  --input: 228 22% 18%;
  --ring: 38 91% 55%;
  --radius: 0.6rem;
}

* {
  border-color: hsl(var(--border));
}

/* Smooth in-page scrolling for anchor links (e.g. hero -> #talk-to-us). The
   existing prefers-reduced-motion block below already forces
   scroll-behavior: auto for users who prefer reduced motion. */
html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: Inter, Arial, Helvetica, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  background-image:
    radial-gradient(circle at 12% 10%, var(--mesh-amber) 0, transparent 35%),
    radial-gradient(circle at 88% 76%, var(--mesh-teal) 0, transparent 34%),
    radial-gradient(circle at 50% 45%, var(--mesh-purple) 0, transparent 42%),
    linear-gradient(180deg, #0a0c12 0%, #0f1320 100%);
  background-attachment: fixed;
}

.font-mono-label {
  font-family: 'JetBrains Mono', 'IBM Plex Mono', 'SFMono-Regular', Menlo, monospace;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 11px;
}

/* Thinking index + article meta links (word / lens) */
.thinking-meta-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid rgba(245, 166, 35, 0.45);
  background: rgba(245, 166, 35, 0.14);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2) inset;
  text-decoration: none;
  line-height: 1.2;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.thinking-meta-pill:hover {
  background: rgba(245, 166, 35, 0.22);
  border-color: rgba(245, 166, 35, 0.65);
  box-shadow: 0 0 12px rgba(245, 166, 35, 0.15);
}

.bg-grid-pattern {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 0),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 0);
  background-size: 50px 50px;
  background-position: -1px -1px;
}

.mesh-background {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 20%, var(--mesh-amber) 0, transparent 32%),
    radial-gradient(circle at 83% 80%, var(--mesh-teal) 0, transparent 34%),
    radial-gradient(circle at 50% 40%, var(--mesh-purple) 0, transparent 38%);
  filter: blur(14px);
  opacity: 0.95;
  animation: meshShift 14s ease-in-out infinite alternate;
}

.glass-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.glass-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-accent);
  box-shadow: 0 24px 52px rgba(245, 166, 35, 0.12);
}

.glass-top-accent {
  position: relative;
  overflow: hidden;
}

.glass-top-accent::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, rgba(245, 166, 35, 0.9), rgba(0, 198, 184, 0.5));
}

.gradient-text {
  background-image: linear-gradient(90deg, #f5a623, #f4f1df 40%, #00c6b8 78%);
  background-size: 200% 100%;
  color: transparent;
  -webkit-text-fill-color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  padding-bottom: 0.2em;
}

.gradient-shimmer {
  animation: textShimmer 8s linear infinite;
}

.cta-shimmer {
  position: relative;
  overflow: hidden;
}

.cta-shimmer::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -120%;
  width: 45%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: transform 420ms ease;
}

.cta-shimmer:hover::after {
  transform: translateX(360%);
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger > * {
  opacity: 0;
  transform: translateY(18px);
}

.reveal-stagger.is-visible > * {
  animation: revealIn 0.6s ease-out forwards;
}

.reveal-stagger.is-visible > *:nth-child(1) { animation-delay: 0.05s; }
.reveal-stagger.is-visible > *:nth-child(2) { animation-delay: 0.13s; }
.reveal-stagger.is-visible > *:nth-child(3) { animation-delay: 0.21s; }
.reveal-stagger.is-visible > *:nth-child(4) { animation-delay: 0.29s; }
.reveal-stagger.is-visible > *:nth-child(5) { animation-delay: 0.37s; }
.reveal-stagger.is-visible > *:nth-child(6) { animation-delay: 0.45s; }

.nav-shell {
  background: rgba(10, 12, 18, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(245, 166, 35, 0.2);
  transition: background-color 200ms ease, border-color 200ms ease;
}

.nav-inner {
  min-height: 60px;
  transition: min-height 200ms ease;
}

.nav-shell.nav-compressed .nav-inner {
  min-height: 48px;
}

.mobile-menu {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transition: max-height 240ms ease, opacity 180ms ease;
}

.mobile-menu.is-open {
  max-height: 360px;
  opacity: 1;
  pointer-events: auto;
}

.menu-toggle {
  width: 44px;
  height: 44px;
  position: relative;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.menu-toggle span,
.menu-toggle::before,
.menu-toggle::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  height: 2px;
  background: #f0f2ff;
  border-radius: 2px;
  transition: transform 220ms ease, opacity 220ms ease, top 220ms ease;
}

.menu-toggle span {
  top: 21px;
}

.menu-toggle::before {
  top: 15px;
}

.menu-toggle::after {
  top: 27px;
}

.menu-toggle.is-open span {
  opacity: 0;
}

.menu-toggle.is-open::before {
  top: 21px;
  transform: rotate(45deg);
}

.menu-toggle.is-open::after {
  top: 21px;
  transform: rotate(-45deg);
}

.scroll-cue {
  animation: cueBounce 1.8s ease-in-out infinite;
}

.ticker-track {
  display: flex;
  gap: 2rem;
  width: max-content;
  animation: tickerMove 22s linear infinite;
}

.ticker-chip {
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eight-words-section {
  background:
    radial-gradient(ellipse 70% 50% at 20% 0%, rgba(245, 166, 35, 0.06), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 80%, rgba(45, 212, 191, 0.05), transparent 50%),
    rgba(17, 20, 32, 0.65);
}

.eight-parts-rail {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  margin-bottom: 1.5rem;
  padding: 0.35rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.eight-rail-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.65rem;
  border-radius: 0.65rem;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(240, 242, 255, 0.65);
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.eight-rail-tab:hover {
  color: #f0f2ff;
  background: rgba(255, 255, 255, 0.05);
}

.eight-rail-tab.is-active,
.eight-rail-tab[aria-selected='true'] {
  color: #0f1419;
  background: rgba(245, 166, 35, 0.95);
  border-color: rgba(245, 166, 35, 0.5);
}

.eight-rail-num {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  opacity: 0.85;
}

.eight-rail-tab.is-active .eight-rail-num,
.eight-rail-tab[aria-selected='true'] .eight-rail-num {
  opacity: 1;
}

.eight-rail-label {
  display: none;
}

@media (min-width: 640px) {
  .eight-rail-label {
    display: inline;
  }

  .eight-rail-tab {
    padding: 0.5rem 0.85rem;
    font-size: 0.78rem;
  }
}

.eight-parts-stage {
  align-items: center;
}

.eight-diagram-wrap {
  display: flex;
  align-items: center;
}

.eight-diagram-bg {
  position: relative;
  width: 100%;
  border-radius: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(45deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    rgba(10, 12, 18, 0.5);
  background-size: 22px 22px, 22px 22px, auto;
  padding: 1.25rem 0.5rem 0.5rem;
}

.eight-diagram {
  overflow: visible;
  min-height: 340px;
}

.eight-diagram svg {
  overflow: visible;
}

.eight-node-num,
.eight-node-label {
  pointer-events: none;
  font-family: Inter, Arial, Helvetica, sans-serif;
}

.eight-diagram-hint {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin: 0.25rem 0 0.5rem;
}

.eight-kbd {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.7rem;
}

.eight-line {
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  opacity: 0.35;
  transition: opacity 220ms ease, stroke 220ms ease;
}

.eight-diagram.is-assembled .eight-line {
  animation: drawLine 1s ease forwards;
}

.eight-line.is-highlight {
  opacity: 1;
  stroke: rgba(245, 166, 35, 0.95);
  stroke-width: 2;
}

.eight-node {
  opacity: 0;
  transition: opacity 220ms ease;
  cursor: pointer;
  outline: none;
}

.eight-diagram.is-assembled .eight-node {
  opacity: 1;
}

.eight-diagram.is-assembled .eight-node.is-dim {
  opacity: 0.32;
}

.eight-node.is-active circle {
  stroke: rgba(245, 166, 35, 1);
  stroke-width: 2.5;
  filter: drop-shadow(0 0 12px rgba(245, 166, 35, 0.6));
}

.eight-node.is-active .eight-node-label {
  fill: #f5a623;
}

.eight-hub {
  transition: stroke 220ms ease;
}

.eight-diagram.is-assembled .eight-hub {
  stroke: rgba(245, 166, 35, 0.5);
}

.eight-inspector {
  position: relative;
  display: flex;
  flex-direction: column;
}

.eight-definition {
  display: none;
  flex-direction: column;
  gap: 0.85rem;
  animation: eightPanelIn 280ms ease;
}

.eight-definition.is-active,
.eight-definition:not([hidden]) {
  display: flex;
}

.eight-definition-eyebrow {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.eight-definition-eyebrow span:first-child {
  color: var(--primary);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.9rem;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.eight-definition-alias {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.eight-definition-summary {
  color: #8b90a8;
  font-size: 0.95rem;
  line-height: 1.65;
}

.eight-definition-meta {
  color: rgba(240, 242, 255, 0.55);
  font-size: 0.85rem;
  line-height: 1.6;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.eight-definition-meta strong {
  color: rgba(240, 242, 255, 0.78);
  font-weight: 600;
}

.eight-definition-link {
  margin-top: 0.25rem;
  font-size: 0.88rem;
  color: var(--primary);
}

.eight-mobile-btn {
  flex: 1;
  max-width: 9rem;
  padding: 0.65rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #f0f2ff;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease;
}

.eight-mobile-btn:hover {
  border-color: rgba(245, 166, 35, 0.45);
  background: rgba(245, 166, 35, 0.08);
}

.eight-mobile-dots {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.eight-mobile-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease;
}

.eight-mobile-dot.is-active {
  background: var(--primary);
  transform: scale(1.2);
}

@keyframes eightPanelIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.quote-grid-bg {
  background-image:
    linear-gradient(135deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(45deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.18;
}

.arrow-shift {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.arrow-shift::after {
  content: '→';
  display: inline-block;
  transform: translateX(0);
  transition: transform 180ms ease;
}

.arrow-shift:hover::after,
a:hover .arrow-shift::after {
  transform: translateX(4px);
}

@keyframes meshShift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-1.8%, 2.4%, 0) scale(1.04); }
  100% { transform: translate3d(2.2%, -2%, 0) scale(1.02); }
}

@keyframes textShimmer {
  0% { background-position: 0 50%; }
  100% { background-position: 180% 50%; }
}

@keyframes revealIn {
  0% {
    opacity: 0;
    transform: translateY(18px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cueBounce {
  0%, 100% { transform: translateY(0); opacity: 0.85; }
  50% { transform: translateY(6px); opacity: 1; }
}

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

@keyframes drawLine {
  to { stroke-dashoffset: 0; }
}

@media (max-width: 767px) {
  .mesh-background {
    filter: blur(22px);
    opacity: 0.78;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal,
  .reveal-stagger > *,
  .eight-definition,
  .eight-node {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }

  .eight-line {
    stroke-dashoffset: 0 !important;
  }
}

/* Blog post paragraph and heading spacing — avoids the need for the Typography plugin. */

/* Paragraphs and lists */
.prose p,
.prose li {
  margin-bottom: 1.1em;
}

.prose blockquote {
  margin-bottom: 1.4em;
  margin-top: 1.4em;
}

.prose ul,
.prose ol {
  margin-bottom: 1.1em;
}

/* Headings: more space above than below so they bind to their content. */
.prose h1 {
  font-size: 2em;
  font-weight: 700;
  line-height: 1.1;
  color: #fff;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

.prose h2 {
  font-size: 1.5em;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  margin-top: 1.75em;
  margin-bottom: 0.6em;
}

.prose h3 {
  font-size: 1.2em;
  font-weight: 600;
  line-height: 1.3;
  color: #fff;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

/* Voice feature flag (see api/flags.js): elements marked nb-voice-only render
   only when /api/flags enables voice; nb-voice-off elements are their
   replacements and render only when it doesn't. No-JS / endpoint-failure
   behaves like production (voice hidden). */
html:not(.nb-voice-on) .nb-voice-only { display: none !important; }
html.nb-voice-on .nb-voice-off { display: none !important; }
