:root {
  --color-primary: #7C3AED;
  --color-primary-bright: #A78BFA;
  --color-accent: #22D3EE;
  --color-bg: #06060C;
  --color-bg-elevated: #0D0D18;
  --color-surface: rgba(255, 255, 255, 0.04);
  --color-border: rgba(167, 139, 250, 0.22);
  --color-text: #F1F0FA;
  --color-text-muted: #A0A0B8;
  --color-danger: #F87171;
  --font-display: "Space Grotesk", -apple-system, sans-serif;
  --font-body: "DM Sans", -apple-system, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --space-4: 4px;
  --space-8: 8px;
  --space-16: 16px;
  --space-24: 24px;
  --space-32: 32px;
  --space-48: 48px;
  --space-64: 64px;
  --space-96: 96px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

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

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

h1, h2, h3 {
  font-family: var(--font-display);
  margin: 0;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
}

.eyebrow {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-16);
}

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.75rem);
  font-weight: 600;
  margin-bottom: var(--space-48);
  max-width: 40ch;
}

/* ---------- background field ---------- */

.bg-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-grid {
  position: absolute;
  inset: -1px;
  background-image:
    linear-gradient(rgba(167, 139, 250, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(167, 139, 250, 0.06) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, black 20%, transparent 75%);
}

.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  will-change: transform;
}

.bg-glow--a {
  width: 640px;
  height: 640px;
  top: -180px;
  left: -120px;
  background: radial-gradient(circle, var(--color-primary), transparent 70%);
  animation: drift-a 26s ease-in-out infinite;
}

.bg-glow--b {
  width: 560px;
  height: 560px;
  bottom: -160px;
  right: -140px;
  background: radial-gradient(circle, var(--color-accent), transparent 70%);
  animation: drift-b 30s ease-in-out infinite;
}

@keyframes drift-a {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(80px, 60px); }
}

@keyframes drift-b {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-60px, -50px); }
}

#starfield {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.6;
}

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-24) clamp(var(--space-24), 5vw, var(--space-96));
  border-bottom: 1px solid var(--color-border);
}

/* backdrop-filter on .nav itself would make it the containing block for any
   position:fixed descendant (the mobile nav-links panel), anchoring that
   panel to the header's own box instead of the viewport. Applying the blur
   via a ::before layer instead keeps .nav filter-free. */
.nav::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  backdrop-filter: blur(16px);
  background: rgba(6, 6, 12, 0.55);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
}

.brand-mark {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 12px 2px var(--color-accent);
}

.brand-sub {
  color: var(--color-text-muted);
  font-weight: 500;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-32);
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.nav-links a {
  cursor: pointer;
  transition: color 200ms var(--ease-out);
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--color-text);
}

.nav-cta {
  padding: var(--space-8) var(--space-16);
  border-radius: 999px;
  border: 1px solid var(--color-border);
  color: var(--color-text) !important;
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  flex-shrink: 0;
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

@media (max-width: 760px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(280px, 80vw);
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: var(--space-24);
    padding: 96px var(--space-24) var(--space-24);
    background: rgba(10, 10, 18, 0.97);
    backdrop-filter: blur(16px);
    border-left: 1px solid var(--color-border);
    transform: translateX(100%);
    transition: transform 260ms var(--ease-out);
    z-index: 60;
    font-size: 1rem;
  }

  .nav-links.is-open {
    transform: translateX(0);
  }

  .nav-cta {
    width: 100%;
    text-align: center;
  }
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  padding: 14px 28px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out), background 200ms var(--ease-out);
  border: 1px solid transparent;
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), #5B21B6);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.4), 0 12px 32px -8px rgba(124, 58, 237, 0.6);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.6), 0 16px 40px -6px rgba(124, 58, 237, 0.75);
}

.btn-ghost {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
}

.btn-ghost:hover {
  transform: translateY(-2px);
  border-color: var(--color-primary-bright);
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  z-index: 1;
  min-height: 92vh;
  --mx: 50%;
  --my: 40%;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(480px circle at var(--mx) var(--my), rgba(124, 58, 237, 0.16), transparent 70%);
  transition: background 80ms linear;
}

.hero-webgl {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.85;
}

.hero-content {
  position: relative;
  z-index: 1;
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-96) clamp(var(--space-24), 6vw, var(--space-96)) var(--space-64);
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.75rem);
  font-weight: 700;
  max-width: 20ch;
  line-height: 1.05;
}

.hero-title-gradient {
  display: block;
  background: linear-gradient(100deg, var(--color-primary-bright), var(--color-accent), var(--color-primary-bright));
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradient-shimmer 6s ease-in-out infinite;
}

@keyframes gradient-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-sub {
  margin-top: var(--space-24);
  max-width: 56ch;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  color: var(--color-text-muted);
}

.hero-actions {
  margin-top: var(--space-48);
  display: flex;
  gap: var(--space-16);
  flex-wrap: wrap;
  justify-content: center;
}

.hero-orb {
  position: relative;
  margin-top: var(--space-96);
  width: 140px;
  height: 140px;
}

.hero-orb-core {
  position: absolute;
  inset: 38px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #C4B5FD, var(--color-primary) 55%, #3B0764 100%);
  box-shadow: 0 0 60px 10px rgba(124, 58, 237, 0.55);
  animation: orb-pulse 3.2s var(--ease-out) infinite, core-flicker 5s ease-in-out infinite;
}

.hero-orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(167, 139, 250, 0.35);
}

.hero-orb-ring--1 { animation: ring-spin 12s linear infinite; }
.hero-orb-ring--2 { inset: 14px; border-color: rgba(34, 211, 238, 0.3); animation: ring-spin 18s linear infinite reverse; }
.hero-orb-ring--3 { inset: 28px; border-color: rgba(167, 139, 250, 0.2); animation: ring-spin 24s linear infinite; }

.hero-orb-ring--segmented {
  inset: 18px;
  border: none;
  background: conic-gradient(from 0deg, var(--color-primary), var(--color-accent), var(--color-primary-bright), var(--color-primary));
  filter: blur(14px);
  opacity: 0.4;
  animation: ring-spin 6s linear infinite;
}

.hero-orb-ring--scan {
  inset: 4px;
  border: none;
  background: conic-gradient(from 180deg, var(--color-accent), transparent 60%, var(--color-primary-bright));
  filter: blur(20px);
  opacity: 0.28;
  animation: ring-spin 3.4s linear infinite reverse;
}

@keyframes orb-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 60px 10px rgba(124, 58, 237, 0.55); }
  50% { transform: scale(1.08); box-shadow: 0 0 80px 18px rgba(124, 58, 237, 0.75); }
}

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

@keyframes core-flicker {
  0%, 100% { filter: brightness(1); }
  45% { filter: brightness(1.08); }
  50% { filter: brightness(0.94); }
  56% { filter: brightness(1.04); }
}

/* ---------- generic HUD orb (reusable at any size) ---------- */

.hud-orb {
  position: relative;
  flex-shrink: 0;
}

.hud-orb--sm {
  width: 30px;
  height: 30px;
}

.hud-orb-core {
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #C4B5FD, var(--color-primary) 60%, #2E1065 100%);
  box-shadow: 0 0 12px 2px rgba(124, 58, 237, 0.6);
  animation: core-flicker 4.5s ease-in-out infinite;
}

.hud-orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.hud-orb-ring--segmented {
  inset: -4px;
  background: conic-gradient(from 0deg, var(--color-primary), var(--color-accent), var(--color-primary-bright), var(--color-primary));
  filter: blur(6px);
  opacity: 0.55;
  animation: ring-spin 5s linear infinite;
  transition: opacity 220ms ease-out, filter 220ms ease-out;
}

.hud-orb-ring--scan {
  inset: -7px;
  background: conic-gradient(from 180deg, var(--color-accent), transparent 60%, var(--color-primary-bright));
  filter: blur(9px);
  opacity: 0.35;
  animation: ring-spin 8s linear infinite reverse;
}

.hud-orb-ring--segmented.word-pulse {
  opacity: 0.95;
  filter: blur(8px);
}

/* Word-pulse: a visible scale/brightness kick on the core, plus an
   expanding sonar-style ping ring — fired once per streamed/typed word. */
.hud-orb-core.word-pulse,
.jarvis-orb-core.word-pulse,
.jarvis-launcher-core.word-pulse {
  animation: orb-word-pulse-strong 380ms var(--ease-out);
}

@keyframes orb-word-pulse-strong {
  0% { transform: scale(1); filter: brightness(1); }
  30% { transform: scale(1.32); filter: brightness(1.5); }
  100% { transform: scale(1); filter: brightness(1); }
}


/* ---------- rotating typed subheading ---------- */

.rotator {
  margin-top: var(--space-24);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
  max-width: 44rem;
  margin-left: auto;
  margin-right: auto;
}

.rotator .hud-orb--sm {
  margin-top: 3px;
}

.rotator-body {
  position: relative;
  flex: 1;
  min-width: 0;
  text-align: left;
}

.rotator-sizer {
  visibility: hidden;
  display: block;
  font-size: 1.05rem;
  line-height: 1.6;
}

.rotator-line {
  position: absolute;
  inset: 0;
  display: block;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.rotator-caret::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 3px;
  vertical-align: -0.15em;
  background: var(--color-accent);
  animation: caret-breathe 1s ease-in-out infinite;
}

@keyframes caret-breathe {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.9; }
}

/* ---------- platforms ---------- */

.platforms, .approach, .workflow, .assistant-section, .contact {
  position: relative;
  z-index: 1;
  padding: var(--space-96) clamp(var(--space-24), 6vw, var(--space-96));
  max-width: 1280px;
  margin: 0 auto;
}

.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-24);
}

.platform-grid {
  perspective: 1200px;
}

.platform-card {
  position: relative;
  padding: var(--space-32);
  border-radius: 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  backdrop-filter: blur(10px);
  cursor: pointer;
  --rx: 0deg;
  --ry: 0deg;
  --ty: 0px;
  transform: rotateX(var(--ry)) rotateY(var(--rx)) translateY(var(--ty));
  transition: transform 250ms var(--ease-out), border-color 250ms var(--ease-out), box-shadow 250ms var(--ease-out);
  overflow: hidden;
}

.platform-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.18), transparent 60%);
  opacity: 0;
  transition: opacity 250ms var(--ease-out);
}

.platform-card:hover,
.platform-card:focus-visible {
  --ty: -6px;
  border-color: var(--color-primary-bright);
  box-shadow: 0 20px 48px -20px rgba(124, 58, 237, 0.5);
}

.platform-card:hover::before {
  opacity: 1;
}

.platform-card--muted {
  cursor: default;
}

.platform-card--muted:hover {
  transform: none;
  border-color: var(--color-border);
  box-shadow: none;
}

.platform-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(167, 139, 250, 0.12);
  color: var(--color-primary-bright);
  margin-bottom: var(--space-24);
}

.platform-icon svg {
  width: 24px;
  height: 24px;
}

.platform-card h3 {
  font-size: 1.35rem;
  margin-bottom: var(--space-8);
}

.tld {
  color: var(--color-accent);
  font-weight: 500;
  margin-left: 0.3ch;
}

.platform-card p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-bottom: var(--space-24);
}

.platform-link {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-accent);
}

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

/* ---------- spotlight ---------- */

.spotlight-grid {
  margin-top: var(--space-48);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-24);
}

.spotlight {
  padding: var(--space-32);
  border-radius: 20px;
  border: 1px solid var(--color-border);
  background: linear-gradient(180deg, rgba(167, 139, 250, 0.06), transparent 60%);
}

.spotlight-eyebrow {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  margin-bottom: var(--space-8);
}

.spotlight h3 {
  font-size: 1.35rem;
  margin-bottom: var(--space-16);
}

.spotlight-list {
  margin: 0;
  padding-left: 1.1em;
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  color: var(--color-text-muted);
  font-size: 0.92rem;
}

.spotlight-list li::marker {
  color: var(--color-primary-bright);
}

.spotlight-mission {
  margin-top: var(--space-24);
  padding-top: var(--space-24);
  border-top: 1px solid var(--color-border);
  font-size: 0.9rem;
  color: var(--color-text);
  font-style: italic;
}

/* ---------- engineering panel ---------- */

.engineering-panel {
  margin-top: var(--space-64);
  padding: var(--space-32);
  border-radius: 20px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

.engineering-panel .eyebrow {
  margin-bottom: var(--space-24);
}

.engineering-list {
  margin: 0;
  padding-left: 1.1em;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-16) var(--space-32);
  color: var(--color-text-muted);
  font-size: 0.92rem;
}

.engineering-list li::marker {
  color: var(--color-accent);
}

/* ---------- workflow pain/fix ---------- */

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-24);
}

.workflow-card {
  padding: var(--space-24);
  border-radius: 18px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.workflow-pain,
.workflow-fix {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  display: flex;
  gap: 10px;
  align-items: baseline;
}

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

.workflow-fix {
  color: var(--color-text);
}

.workflow-tag {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
}

.workflow-tag--pain {
  color: #FCA5A5;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.workflow-tag--fix {
  color: var(--color-accent);
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.3);
}

/* ---------- approach ---------- */

.approach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-24);
}

.approach-card {
  padding: var(--space-32);
  border-radius: 20px;
  border: 1px solid var(--color-border);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent);
}

.approach-index {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--color-accent);
  font-weight: 700;
}

.approach-card h3 {
  margin-top: var(--space-16);
  font-size: 1.15rem;
}

.approach-card p {
  margin-top: var(--space-8);
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

/* ---------- org chart ---------- */

.org {
  position: relative;
  z-index: 1;
  padding: var(--space-96) clamp(var(--space-24), 6vw, var(--space-96));
  max-width: 1280px;
  margin: 0 auto;
  text-align: center;
}

.org .section-title {
  margin-left: auto;
  margin-right: auto;
}

.org-lede {
  max-width: 56ch;
  margin: 0 auto var(--space-64);
  color: var(--color-text-muted);
}

.org-chart {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.org-node {
  width: 220px;
  padding: var(--space-16);
  border-radius: 16px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  backdrop-filter: blur(8px);
  text-align: left;
  transition: transform 200ms var(--ease-out), border-color 200ms var(--ease-out);
}

.org-node:hover {
  transform: translateY(-3px);
  border-color: var(--color-primary-bright);
}

.org-node--human {
  width: 260px;
  text-align: center;
  padding: var(--space-24);
  background: linear-gradient(160deg, rgba(124, 58, 237, 0.14), rgba(34, 211, 238, 0.06));
  border-color: var(--color-primary-bright);
}

.org-node--human::after {
  content: "";
  display: block;
  width: 1px;
  height: 32px;
  margin: var(--space-16) auto 0;
  background: var(--color-border);
}

.org-node-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 8px 1px rgba(34, 211, 238, 0.6);
  margin-bottom: var(--space-8);
}

.org-node-icon--human {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(circle at 35% 30%, #C4B5FD, var(--color-primary) 60%, #2E1065 100%);
  color: #fff;
  box-shadow: 0 0 16px 2px rgba(124, 58, 237, 0.5);
  margin: 0 auto var(--space-8);
}

.org-node-icon--human svg {
  width: 20px;
  height: 20px;
}

.org-node-role {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.org-node--human .org-node-role {
  font-size: 1.05rem;
}

.org-node-desc {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.org-branches {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-32);
  margin-top: 32px;
}

.org-branches::before {
  content: "";
  position: absolute;
  top: -32px;
  left: 8%;
  right: 8%;
  height: 1px;
  background: var(--color-border);
}

.org-branch {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-16);
}

.org-branch::before {
  content: "";
  position: absolute;
  top: -32px;
  left: 50%;
  width: 1px;
  height: 32px;
  background: var(--color-border);
  transform: translateX(-50%);
}

.org-branch-label {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.org-node-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-12, 12px);
}

@media (max-width: 720px) {
  .org-branches::before {
    display: none;
  }
  .org-branch::before {
    display: none;
  }
}

/* ---------- assistant section ---------- */

.assistant-section {
  text-align: center;
}

.assistant-section .section-title {
  margin-left: auto;
  margin-right: auto;
}

.assistant-lede {
  max-width: 56ch;
  margin: 0 auto;
  color: var(--color-text-muted);
}

/* ---------- contact ---------- */

.contact {
  text-align: center;
  padding-bottom: var(--space-96);
}

.contact .section-title {
  margin-left: auto;
  margin-right: auto;
}

.contact-sub {
  color: var(--color-text-muted);
  margin-bottom: var(--space-32);
}

/* ---------- footer ---------- */

.footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-24) clamp(var(--space-24), 6vw, var(--space-96)) var(--space-48);
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  gap: var(--space-24);
}

.footer-links a:hover {
  color: var(--color-text);
}

/* ---------- reveal-on-scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
}

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

/* ================= Jarvis assistant widget ================= */

.jarvis {
  position: fixed;
  right: clamp(16px, 4vw, 32px);
  bottom: clamp(16px, 4vw, 32px);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-16);
}

.jarvis-launcher {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.jarvis-launcher-orb {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  transition: transform 200ms var(--ease-out);
}

.jarvis-launcher:hover .jarvis-launcher-orb {
  transform: scale(1.06);
}

.jarvis-launcher:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: 50%;
}

.jarvis-launcher-core {
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #C4B5FD, var(--color-primary) 60%, #2E1065 100%);
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.4), 0 12px 32px -6px rgba(124, 58, 237, 0.7);
  animation: launcher-pulse 2.4s var(--ease-out) infinite, core-flicker 4.6s ease-in-out infinite;
}

.jarvis-launcher-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.jarvis-launcher-ring--segmented {
  inset: -8px;
  background: conic-gradient(from 0deg, var(--color-primary), var(--color-accent), var(--color-primary-bright), var(--color-primary));
  filter: blur(11px);
  opacity: 0.5;
  animation: ring-spin 5s linear infinite;
}

.jarvis-launcher-ring--scan {
  inset: -13px;
  background: conic-gradient(from 180deg, var(--color-accent), transparent 60%, var(--color-primary-bright));
  filter: blur(16px);
  opacity: 0.32;
  animation: ring-spin 8s linear infinite reverse;
}

@keyframes launcher-pulse {
  0%, 100% { transform: scale(0.97); }
  50% { transform: scale(1); }
}

.jarvis-panel[hidden] {
  display: none;
}

.jarvis-panel {
  width: min(380px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 140px));
  display: flex;
  flex-direction: column;
  background: rgba(13, 13, 24, 0.92);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  backdrop-filter: blur(20px);
  box-shadow: 0 24px 64px -20px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: panel-in 260ms var(--ease-out);
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.jarvis-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-16) var(--space-16);
  border-bottom: 1px solid var(--color-border);
}

.jarvis-header-id {
  display: flex;
  align-items: center;
  gap: var(--space-16);
}

.jarvis-orb {
  position: relative;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.jarvis-orb-core {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #C4B5FD, var(--color-primary) 60%, #2E1065 100%);
  box-shadow: 0 0 14px 2px rgba(124, 58, 237, 0.6);
  animation: core-flicker 4.5s ease-in-out infinite;
}

.jarvis-orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.jarvis-orb-ring--segmented {
  inset: -4px;
  background: conic-gradient(from 0deg, var(--color-primary), var(--color-accent), var(--color-primary-bright), var(--color-primary));
  filter: blur(6px);
  opacity: 0.45;
  animation: ring-spin 5s linear infinite;
  transition: opacity 220ms ease-out, filter 220ms ease-out;
}

.jarvis-orb-ring--scan {
  inset: -7px;
  background: conic-gradient(from 180deg, var(--color-accent), transparent 60%, var(--color-primary-bright));
  filter: blur(9px);
  opacity: 0.3;
  animation: ring-spin 8s linear infinite reverse;
}

.jarvis-orb.is-thinking .jarvis-orb-core {
  animation: orb-pulse 1.1s var(--ease-out) infinite;
}

.jarvis-orb.is-thinking .jarvis-orb-ring--segmented {
  animation: ring-spin 1.8s linear infinite;
  opacity: 0.75;
  filter: blur(8px);
}

.jarvis-orb-ring--segmented.word-pulse {
  opacity: 1;
  filter: blur(9px);
}

.jarvis-status {
  font-size: 0.75rem;
  color: var(--color-accent);
  margin-top: 2px;
}

.jarvis-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 200ms, border-color 200ms;
}

.jarvis-close:hover {
  color: var(--color-text);
  border-color: var(--color-primary-bright);
}

.jarvis-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-16);
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.jarvis-msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  animation: msg-in 220ms var(--ease-out);
}

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

.jarvis-msg--bot {
  align-self: flex-start;
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid var(--color-border);
  border-bottom-left-radius: 4px;
}

.jarvis-msg--user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--color-primary), #5B21B6);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.jarvis-msg--system {
  align-self: center;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  text-align: center;
}

.jarvis-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.jarvis-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary-bright);
  animation: typing-bounce 1.1s ease-in-out infinite;
}

.jarvis-typing span:nth-child(2) { animation-delay: 0.15s; }
.jarvis-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.jarvis-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 var(--space-16) var(--space-8);
}

.jarvis-chip {
  font-family: var(--font-body);
  font-size: 0.76rem;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: rgba(167, 139, 250, 0.08);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: border-color 180ms var(--ease-out), color 180ms var(--ease-out), background 180ms var(--ease-out);
}

.jarvis-chip:hover,
.jarvis-chip:focus-visible {
  border-color: var(--color-primary-bright);
  color: var(--color-text);
  background: rgba(167, 139, 250, 0.16);
}

.jarvis-chips.is-hidden {
  display: none;
}

.jarvis-throttle {
  margin: 0 var(--space-16) var(--space-8);
  padding: var(--space-8) var(--space-16);
  border-radius: 10px;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #FCA5A5;
  font-size: 0.8rem;
}

.jarvis-input-row {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-16);
  border-top: 1px solid var(--color-border);
}

.jarvis-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.9rem;
}

.jarvis-input:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.jarvis-input:disabled {
  opacity: 0.5;
}

.jarvis-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--color-primary), #5B21B6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 150ms var(--ease-out), opacity 150ms;
}

.jarvis-send:hover {
  transform: scale(1.06);
}

.jarvis-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.jarvis-disclaimer {
  padding: 0 var(--space-16) var(--space-16);
  font-size: 0.7rem;
  color: var(--color-text-muted);
  text-align: center;
}

/* ---------- custom cursor ---------- */
/* Only enabled by JS on fine-pointer, hover-capable, non-reduced-motion
   devices — the JS adds .has-custom-cursor to <html> before these rules
   take visual effect, so touch devices never see cursor:none. */

.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 200;
  opacity: 0;
  transition: opacity 200ms var(--ease-out);
}

.cursor-dot {
  width: 6px;
  height: 6px;
  background: var(--color-accent);
  transform: translate(-50%, -50%);
}

.cursor-ring {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(167, 139, 250, 0.55);
  transform: translate(-50%, -50%);
  transition: opacity 200ms var(--ease-out), width 220ms var(--ease-out), height 220ms var(--ease-out), border-color 220ms var(--ease-out), background 220ms var(--ease-out);
}

html.has-custom-cursor {
  cursor: none;
}

html.has-custom-cursor a,
html.has-custom-cursor button,
html.has-custom-cursor input,
html.has-custom-cursor .platform-card,
html.has-custom-cursor .org-node {
  cursor: none;
}

html.has-custom-cursor .cursor-dot,
html.has-custom-cursor .cursor-ring {
  opacity: 1;
}

.cursor-ring.is-hover {
  width: 56px;
  height: 56px;
  border-color: var(--color-accent);
  background: rgba(34, 211, 238, 0.08);
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
  html.has-custom-cursor {
    cursor: auto;
  }
  .cursor-dot,
  .cursor-ring {
    display: none;
  }
}

@media (max-width: 480px) {
  .jarvis-panel {
    width: calc(100vw - 24px);
    height: min(70vh, 560px);
  }
}
