:root {
  --bg: #05050b;
  --text: #f8fafc;
  --muted: #cbd5e1;
  --accent-a: #a855f7;
  --accent-b: #6d28d9;
  --hover-purple: rgba(167, 139, 250, 0.86);
  --hover-purple-strong: rgba(196, 181, 253, 0.96);
  --header-link: #e2e8f0;
  --brand-color: #a78bfa;
  --status-bg: rgba(255, 255, 255, 0.14);
  --status-text: #f8fafc;
  --cue: #cbd5e1;
  --cue-border: rgba(203, 213, 225, 0.55);
  --toggle-bg: rgba(248, 250, 252, 0.12);
  --toggle-fg: #f8fafc;
  --toggle-border: rgba(248, 250, 252, 0.35);
}

body[data-theme="light"] {
  --bg: #ececec;
  --text: #111318;
  --muted: #3e434b;
  --hover-purple: rgba(99, 102, 241, 0.72);
  --hover-purple-strong: rgba(99, 102, 241, 0.86);
  --header-link: #111318;
  --brand-color: #6d28d9;
  --status-bg: rgba(17, 19, 24, 0.8);
  --status-text: #ffffff;
  --cue: #787d84;
  --cue-border: #b9bdc3;
  --toggle-bg: rgba(17, 19, 24, 0.08);
  --toggle-fg: #111318;
  --toggle-border: rgba(17, 19, 24, 0.2);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  font-family: "DM Sans", "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

body {
  scroll-snap-type: y mandatory;
}

.landing-shell {
  position: relative;
  min-height: 300vh;
}

.viewer-panel {
  position: fixed;
  top: 90px;
  right: 0;
  bottom: 58px;
  width: min(56vw, 980px);
  z-index: 1;
  pointer-events: auto;
}

.canvas-wrap {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: auto;
  background: transparent;
  overflow: hidden;
}

#blob-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.topbar {
  position: fixed;
  top: 28px;
  left: 9vw;
  right: 9vw;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  color: var(--brand-color);
  text-decoration: none;
  font-weight: 800;
  font-size: clamp(2rem, 3.1vw, 3.2rem);
  letter-spacing: -0.03em;
  transition: color 220ms ease, opacity 220ms ease;
}

.menu {
  display: flex;
  gap: clamp(10px, 1.2vw, 24px);
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.menu a {
  text-decoration: none;
  color: var(--header-link);
  font-size: clamp(0.8rem, 0.8vw, 0.92rem);
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
  transition: color 220ms ease, opacity 220ms ease;
}

.brand:hover,
.menu a:hover {
  color: var(--hover-purple);
  opacity: 0.75;
}

.theme-toggle {
  border: 1px solid var(--toggle-border);
  background: var(--toggle-bg);
  color: var(--toggle-fg);
  border-radius: 999px;
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, background-color 220ms ease, color 220ms ease, border-color 220ms ease;
}

.theme-toggle:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.slide-section {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 15vh 0 12vh 9vw;
}

.story-copy {
  width: min(42vw, 560px);
  will-change: transform, opacity;
  transform: translate3d(0, 26vh, 0) scale(0.92);
  opacity: 0;
}

.story-copy .eyebrow {
  margin: 0 0 10px;
  font-size: 1.95rem;
  font-weight: 500;
}

.story-copy h1 {
  margin: 0 0 18px;
  font-size: clamp(4.2rem, 9.8vw, 10rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.story-copy h2 {
  margin: 0 0 18px;
  font-size: clamp(2rem, 4.4vw, 5rem);
  line-height: 0.9;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.story-copy p {
  margin: 0.65rem 0;
  font-size: clamp(1rem, 1.06vw, 1.34rem);
  line-height: 1.45;
  color: var(--muted);
}

.story-copy .lead {
  max-width: 40ch;
}

.cta-note {
  display: inline-block;
  margin-top: 1.35rem;
  color: var(--hover-purple-strong);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.01em;
  opacity: 0.9;
}

.service-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1.35rem;
  min-width: 190px;
  border-radius: 999px;
  padding: 0.78rem 1.4rem;
  text-decoration: none;
  color: #ffffff;
  font-weight: 700;
  font-size: 1rem;
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.28);
  transition: transform 180ms ease, opacity 180ms ease;
}

.service-btn:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}

.scroll-cue {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 8;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--cue);
  font-size: 1.05rem;
}

.scroll-cue .arrow {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--cue-border);
  font-size: 1.18rem;
}

.model-status {
  display: none;
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 30;
  font-size: 11px;
  line-height: 1.2;
  color: var(--status-text);
  background: var(--status-bg);
  border-radius: 8px;
  padding: 7px 8px;
}

@media (max-width: 1000px) {
  .viewer-panel {
    top: 115px;
    width: min(58vw, 720px);
    bottom: 50px;
  }

  .topbar {
    top: 20px;
    left: 5vw;
    right: 5vw;
  }

  .slide-section {
    padding: 18vh 5vw 12vh;
  }

  .story-copy {
    width: min(82vw, 640px);
  }

  .menu {
    gap: 16px;
  }
}

@media (max-width: 760px) {
  .landing-shell {
    min-height: 320vh;
  }

  .viewer-panel {
    left: 0;
    right: 0;
    width: 100vw;
    top: 58vh;
    bottom: 6vh;
    pointer-events: auto;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .brand {
    font-size: 2.1rem;
  }

  .menu {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
  }

  .theme-toggle {
    margin-top: 4px;
  }

  .story-copy {
    width: min(90vw, 560px);
    max-width: 100%;
  }

  .story-copy h1 {
    font-size: clamp(3.2rem, 15vw, 5.5rem);
  }

  .story-copy h2 {
    font-size: clamp(2rem, 10vw, 3.4rem);
  }

  .scroll-cue {
    font-size: 0.9rem;
    bottom: 8px;
  }

  .model-status {
    right: auto;
    left: 8px;
    max-width: calc(100vw - 16px);
  }
}
