:root {
  color-scheme: light dark;
  --bg: #050505;
  --surface: #0d0d11;
  --surface-alt: #16161f;
  --text: #f4f4f8;
  --muted: #c5c5d3;
  --accent: #4dd4ac;
  --accent-secondary: #5b7cfa;
  --stroke: rgba(255, 255, 255, 0.1);
  --shadow: 0 20px 60px rgba(3, 4, 16, 0.45);
  --radius: 1.4rem;
  font-size: 16px;
}

body.light-theme {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-alt: #edf0ff;
  --text: #141418;
  --muted: #5c6076;
  --stroke: rgba(13, 13, 17, 0.08);
  --shadow: 0 24px 50px rgba(18, 27, 94, 0.15);
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  background: radial-gradient(circle at top, rgba(93, 111, 255, 0.25), transparent 40%), var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

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

img {
  max-width: 100%;
}

main {
  display: flex;
  flex-direction: column;
  gap: 4rem;
  padding: 2rem clamp(1.5rem, 5vw, 5rem) 5rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem clamp(1.5rem, 4vw, 5rem);
  background: rgba(5, 5, 5, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--stroke);
}

body.light-theme .site-header {
  background: rgba(246, 247, 251, 0.9);
}

.logo {
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.primary-nav ul {
  list-style: none;
  display: flex;
  gap: 0.5rem;
  padding: 0;
  margin: 0;
}

.primary-nav a {
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  color: var(--muted);
  border: 1px solid transparent;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

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

.primary-nav a.active {
  color: var(--text);
  border-color: var(--stroke);
  background: rgba(255, 255, 255, 0.04);
}

.theme-toggle {
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.hero {
  min-height: 70vh;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 3rem;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.4rem, 4vw, 4rem);
  margin: 0 0 1rem;
}

.hero p {
  max-width: 520px;
}

.hero-visual {
  position: relative;
  min-height: 300px;
  border-radius: var(--radius);
  background: radial-gradient(circle at 30% 20%, rgba(92, 126, 255, 0.8), transparent 50%),
    linear-gradient(135deg, rgba(15, 15, 20, 0.9), rgba(11, 12, 18, 0.7));
  overflow: hidden;
  box-shadow: var(--shadow);
}

.orb {
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  filter: blur(1px);
  opacity: 0.75;
  animation: float 12s ease-in-out infinite;
}

.orb-one {
  background: var(--accent);
  top: 10%;
  left: 15%;
}

.orb-two {
  background: var(--accent-secondary);
  top: 30%;
  right: 10%;
  animation-delay: 2s;
}

.orb-three {
  background: #f7b500;
  bottom: 5%;
  left: 25%;
  animation-delay: 4s;
}

.hero-visual .grid {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 80px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 80px);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-top: 2rem;
  gap: 1.5rem;
}

.metric {
  display: block;
  font-size: 2rem;
  font-weight: 600;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.section {
  padding: 1rem 0;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 3.5rem);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.section.highlight {
  background: linear-gradient(135deg, rgba(77, 212, 172, 0.15), rgba(91, 124, 250, 0.25)), var(--surface-alt);
  border-color: transparent;
}

.section.hero.inner {
  text-align: left;
  background: transparent;
  box-shadow: none;
  border: none;
  padding-top: 2rem;
}

.section-heading {
  max-width: 650px;
}

.card-grid,
.project-grid,
.insights-list,
.insights-collection,
.engagement-grid,
.office-hours {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.card,
.project-card,
.insight-card,
.info-card,
.project-detail,
.result-card,
.contact-form,
.newsletter-form {
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 1.5rem;
  background: var(--surface-alt);
}

.project-card,
.project-detail {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.project-lab {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.project-app {
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 3rem);
  background: var(--surface-alt);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: var(--shadow);
}

.app-header h2 {
  margin-bottom: 0.4rem;
}

.copilot-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.copilot-questions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.copilot-response {
  border: none;
  border-radius: var(--radius);
  padding: 0;
  background: transparent;
  min-height: 240px;
  display: flex;
  flex-direction: column;
}

.mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  width: fit-content;
}

.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.toggle input {
  opacity: 0;
  position: absolute;
  inset: 0;
  cursor: pointer;
}

.toggle .switch {
  width: 52px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--stroke);
  display: inline-flex;
  align-items: center;
  padding: 3px;
  transition: background 0.3s ease;
}

.toggle .switch::after {
  content: '';
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(0);
  transition: transform 0.3s ease, background 0.3s ease;
}

.toggle input:checked + .switch {
  background: rgba(77, 212, 172, 0.2);
}

.persona-card {
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  padding: 1rem 1.2rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.persona-highlights {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
  display: grid;
  gap: 0.4rem;
}

.navigator-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  align-items: start;
}

.navigator-copy h3 {
  margin: 0 0 0.4rem;
}

#support-navigator {
  width: 100%;
}

#support-navigator .navigator-shell {
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: radial-gradient(circle at 20% 20%, rgba(91, 124, 250, 0.16), transparent 40%),
    linear-gradient(145deg, rgba(9, 9, 13, 0.9), rgba(17, 17, 24, 0.9));
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow);
}

.navigator-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.navigator-titlebar h4 {
  margin: 0.2rem 0 0;
}

.navigator-titlebar .status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle, #4dd4ac 0%, #1f3d33 80%);
  box-shadow: 0 0 12px rgba(77, 212, 172, 0.8);
}

.navigator-persona-label {
  margin: 0.35rem 0 0;
}

.navigator-conversation {
  border: 1px solid var(--stroke);
  border-radius: calc(var(--radius) - 0.5rem);
  padding: 0.9rem;
  background: rgba(255, 255, 255, 0.02);
  min-height: 230px;
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.navigator-bubble {
  padding: 0.75rem 0.9rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--stroke);
  max-width: 90%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.navigator-bubble.bot {
  align-self: flex-start;
}

.navigator-bubble.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #5b7cfa, #7f9bff);
  color: #0b0d14;
  border: none;
}

.navigator-bubble ul {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.navigator-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.navigator-option,
.navigator-restart {
  width: 100%;
  border-radius: 0.9rem;
  border: 1px solid var(--stroke);
  background: rgba(91, 124, 250, 0.15);
  color: var(--text);
  padding: 0.75rem 1rem;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease;
}

.navigator-option:hover,
.navigator-option:focus-visible {
  transform: translateY(-1px);
  background: rgba(91, 124, 250, 0.25);
  border-color: rgba(91, 124, 250, 0.5);
}

.navigator-restart {
  background: transparent;
  border-style: dashed;
  text-align: center;
  color: var(--muted);
}

.navigator-restart:hover,
.navigator-restart:focus-visible {
  color: var(--text);
  border-color: var(--stroke);
}

body.light-theme #support-navigator .navigator-shell {
  background: radial-gradient(circle at 12% 20%, rgba(91, 124, 250, 0.18), transparent 42%),
    linear-gradient(155deg, #ffffff, #eef1ff);
  border-color: rgba(13, 13, 17, 0.08);
}

body.light-theme .navigator-conversation {
  background: rgba(13, 13, 17, 0.02);
  border-color: rgba(13, 13, 17, 0.08);
}

body.light-theme .navigator-bubble {
  background: rgba(91, 124, 250, 0.1);
  border-color: rgba(13, 13, 17, 0.08);
  box-shadow: 0 10px 30px rgba(18, 27, 94, 0.12);
}

body.light-theme .navigator-bubble.user {
  background: linear-gradient(135deg, #4dd4ac, #7ce6d0);
  color: #0b0d14;
  border: none;
}

body.light-theme .navigator-option,
body.light-theme .navigator-restart {
  background: rgba(91, 124, 250, 0.12);
  border-color: rgba(13, 13, 17, 0.1);
}

body.light-theme .navigator-option:hover,
body.light-theme .navigator-option:focus-visible {
  background: rgba(91, 124, 250, 0.18);
  border-color: rgba(91, 124, 250, 0.45);
}

body.light-theme .navigator-restart {
  background: rgba(13, 13, 17, 0.02);
  color: var(--muted);
  border-style: dashed;
}

body.light-theme .navigator-restart:hover,
body.light-theme .navigator-restart:focus-visible {
  color: var(--text);
  border-color: rgba(13, 13, 17, 0.2);
}

.toggle input:checked + .switch::after {
  transform: translateX(24px);
  background: var(--accent-secondary);
}

.muted {
  color: var(--muted);
}

.chat-message {
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.chat-message .chat-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 0.35rem;
}

.chat-message.bot {
  background: rgba(77, 212, 172, 0.08);
}

.chat-message.user {
  background: rgba(255, 255, 255, 0.05);
}

body.light-theme .chat-message {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(13, 13, 17, 0.08);
  box-shadow: 0 8px 26px rgba(18, 27, 94, 0.12);
}

body.light-theme .chat-message.bot {
  background: rgba(77, 212, 172, 0.12);
}

body.light-theme .chat-message.user {
  background: rgba(91, 124, 250, 0.16);
  border-color: rgba(91, 124, 250, 0.4);
  color: #0b0d14;
}

.copilot-response .pill {
  width: fit-content;
  margin-bottom: 0.2rem;
}

.question-buttons button[hidden] {
  display: none;
}

.question-buttons .btn.active {
  border-color: var(--accent);
  color: var(--accent);
}

.money-counter .counter-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  text-align: center;
}

.money-counter .value {
  font-size: 1.8rem;
  font-weight: 600;
}

.money-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.money-row {
  display: grid;
  grid-template-columns: 1fr 120px 120px;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

.money-row label {
  font-weight: 500;
}

.money-row input {
  width: 100%;
}

.money-row .row-total {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.money-row .row-total.rolling,
.counter-totals .value.rolling,
#grand-total.rolling {
  animation: rollUp 0.6s ease;
}

.bfact-card {
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.25);
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.project-detail {
  justify-content: space-between;
  gap: 2rem;
}

.project-detail ul {
  padding-left: 1.2rem;
}

.result-card {
  flex: 0 0 260px;
  background: rgba(0, 0, 0, 0.15);
}

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

.contact-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

input,
select,
textarea {
  font: inherit;
  padding: 0.8rem;
  border-radius: 0.9rem;
  border: 1px solid var(--stroke);
  background: transparent;
  color: var(--text);
}

textarea {
  resize: vertical;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.85rem 1.8rem;
  border: 1px solid transparent;
  transition: transform 0.2s ease, background 0.2s;
  font-weight: 500;
  cursor: pointer;
}

.btn.primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-secondary));
  color: #050505;
}

.btn.ghost {
  border-color: var(--stroke);
}

.btn.link {
  padding: 0;
  border: none;
  color: var(--accent);
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
}

.text-link {
  color: var(--accent);
  font-weight: 500;
}

.pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 0.2rem 0.9rem;
  border: 1px solid var(--stroke);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.chip {
  border-radius: 999px;
  border: 1px solid var(--stroke);
  padding: 0.5rem 1.2rem;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.chip.active {
  background: rgba(77, 212, 172, 0.2);
  border-color: transparent;
}

.cta,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-footer {
  padding: 2rem clamp(1.5rem, 4vw, 5rem);
  border-top: 1px solid var(--stroke);
  margin-top: 2rem;
}

.footer-links {
  display: flex;
  gap: 1rem;
}

.metrics-grid .label,
.subtle {
  color: var(--muted);
  font-size: 0.9rem;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 0.3rem;
  background: transparent;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 0.5rem;
}

.nav-toggle .bar {
  width: 20px;
  height: 2px;
  background: var(--text);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-25px);
  }
  100% {
    transform: translateY(0px);
  }
}

@keyframes rollUp {
  0% {
    opacity: 0;
    transform: translateY(8px) rotateX(35deg);
  }
  60% {
    opacity: 1;
    transform: translateY(-4px) rotateX(0deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .site-header {
    flex-wrap: wrap;
  }

  .nav-toggle {
    display: flex;
  }

  .primary-nav ul {
    flex-direction: column;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    padding: 1rem;
    margin-top: 1rem;
    display: none;
  }

  .primary-nav.open ul {
    display: flex;
  }

  .cta,
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 600px) {
  .hero,
  .project-detail {
    grid-template-columns: 1fr;
  }

  main {
    padding-inline: 1rem;
  }

  .site-header {
    padding-inline: 1rem;
  }
}
