/* ─── Reset & Base ─── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0a0a0f;
  --bg-elevated: #12121a;
  --bg-card: #16161f;
  --bg-card-hover: #1c1c28;
  --text: #e8e8ed;
  --text-muted: #8888a0;
  --text-dim: #555570;
  --accent: #00d4ff;
  --accent-glow: rgba(0, 212, 255, 0.15);
  --accent-violet: #7c3aed;
  --accent-violet-glow: rgba(124, 58, 237, 0.15);
  --gradient-start: #00d4ff;
  --gradient-end: #7c3aed;
  --border: #1e1e2e;
  --radius: 12px;
  --radius-lg: 20px;
  --glow-border: rgba(0, 212, 255, 0.3);
  --glow-border-hover: rgba(0, 212, 255, 0.5);
  --glow-shadow: 0 0 30px var(--accent-glow), 0 0 60px rgba(0, 212, 255, 0.05);
  --glow-shadow-hover:
    0 0 40px var(--accent-glow), 0 0 80px rgba(0, 212, 255, 0.1);
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ─── Layout ─── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 120px 0;
  position: relative;
}

/* ─── Typography ─── */
h1,
h2,
h3,
h4 {
  line-height: 1.15;
  font-weight: 800;
}

h1 {
  font-size: clamp(3rem, 8vw, 6rem);
  letter-spacing: -0.03em;
}
h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: -0.02em;
}
h3 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  letter-spacing: -0.01em;
  font-weight: 700;
}

p {
  color: var(--text-muted);
  font-size: 1.125rem;
  max-width: 640px;
}
p.large {
  font-size: 1.25rem;
  line-height: 1.7;
}

.gradient-text {
  background: linear-gradient(
    135deg,
    var(--gradient-start),
    var(--gradient-end)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.accent {
  color: var(--accent);
}
.label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

/* ─── Shared glow ─── */
.glow {
  border: 1px solid var(--glow-border);
  box-shadow: var(--glow-shadow);
  transition:
    border-color 0.3s,
    box-shadow 0.3s,
    transform 0.2s;
}
.glow:hover {
  border-color: var(--glow-border-hover);
  box-shadow: var(--glow-shadow-hover);
  transform: translateY(-2px);
}

/* ─── Fade-in animation ─── */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.8s ease,
    transform 0.8s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Nav ─── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 20px 0;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(10, 10, 15, 0.8);
  border-bottom: 1px solid rgba(30, 30, 46, 0.5);
}
nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav-brand {
  display: flex;
  align-items: center;
  line-height: 0;
}
.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover {
  color: var(--text);
}

/* ─── Hero ─── */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 100px;
  position: relative;
  overflow: hidden;
}

#hero::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(
      ellipse at 50% 50%,
      rgba(0, 212, 255, 0.06) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 80% 20%,
      rgba(124, 58, 237, 0.04) 0%,
      transparent 40%
    );
  animation: heroGlow 8s ease-in-out infinite alternate;
}

@keyframes heroGlow {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(-2%, 2%) scale(1.05);
  }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.hero-content h1 {
  margin-bottom: 24px;
}

.hero-tagline {
  font-size: clamp(0.9rem, 1.8vw, 1.05rem);
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 24px;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

/* Ask M2 input */
.ask-input {
  display: inline-flex;
  align-items: center;
  background: var(--bg-elevated);
  border-radius: 50px;
  padding: 16px 32px;
  font-size: 1.1rem;
  color: var(--text-dim);
  gap: 8px;
  cursor: default;
  min-width: 440px;
}
.ask-prefix {
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}
.ask-typed {
  color: var(--text-muted);
  white-space: nowrap;
}
.ask-cursor {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  background: var(--accent);
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* ─── Problem ─── */
#problem {
  border-top: 1px solid var(--border);
}

.problem-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-top: 64px;
}

.problem-card {
  padding: 32px;
  background: var(--bg-card);
  border-radius: var(--radius);
}
.problem-card h3 {
  margin-bottom: 12px;
  font-size: 1.1rem;
}
.problem-card p {
  font-size: 1rem;
  color: var(--text-dim);
}

.problem-quote {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 24px;
  max-width: 700px;
}
.problem-quote em {
  font-style: normal;
  color: var(--accent);
}

/* ─── Shift ─── */
#shift {
  border-top: 1px solid var(--border);
}

.shift-columns {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 48px;
  align-items: start;
  margin-top: 64px;
}

.shift-before,
.shift-after {
  padding: 40px;
  border-radius: var(--radius-lg);
}
.shift-before {
  background: var(--bg-card);
  border: 1px solid var(--border);
  opacity: 0.7;
}
.shift-after {
  background: linear-gradient(
    135deg,
    rgba(0, 212, 255, 0.05),
    rgba(124, 58, 237, 0.05)
  );
}
.shift-before h3,
.shift-after h3 {
  margin-bottom: 16px;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.shift-before h3 {
  color: var(--text-dim);
}
.shift-after h3 {
  color: var(--accent);
}

.shift-before ul,
.shift-after ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.shift-before li,
.shift-after li {
  font-size: 1rem;
  color: var(--text-muted);
  padding-left: 20px;
  position: relative;
}
.shift-before li::before {
  content: "×";
  position: absolute;
  left: 0;
  color: #ff4444;
  font-weight: 700;
}
.shift-after li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.shift-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--text-dim);
  padding-top: 60px;
}

/* ─── Brain ─── */
#brain {
  border-top: 1px solid var(--border);
  overflow: hidden;
}

.brain-intro {
  max-width: 700px;
  margin-bottom: 80px;
}

.brain-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 80px;
}

.brain-card {
  padding: 40px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}
.brain-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-violet));
  opacity: 0;
  transition: opacity 0.3s;
}
.brain-card:hover::before {
  opacity: 1;
}

.brain-card h3 {
  margin-bottom: 16px;
  font-size: 1.25rem;
}
.brain-card p {
  font-size: 1rem;
  color: var(--text-dim);
  max-width: none;
}

.brain-card .icon {
  font-size: 1.5rem;
  margin-bottom: 16px;
  display: block;
}

/* Persona layers */
.persona-layers {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.persona-layer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(0, 212, 255, 0.04);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
}
.persona-layer:nth-child(2) {
  border-left-color: var(--accent-violet);
}
.persona-layer:nth-child(3) {
  border-left-color: #ff6b6b;
}
.persona-layer strong {
  color: var(--text);
  font-size: 0.9rem;
}
.persona-layer span {
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* Graph visualisation */
.graph-container {
  position: relative;
  width: 100%;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.graph-svg {
  width: 100%;
  height: 100%;
}

.graph-node {
  animation: nodePulse 3s ease-in-out infinite;
}
.graph-node:nth-child(2n) {
  animation-delay: 0.5s;
}
.graph-node:nth-child(3n) {
  animation-delay: 1s;
}
.graph-node:nth-child(5n) {
  animation-delay: 1.5s;
}

@keyframes nodePulse {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

.graph-edge {
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  animation: edgeDraw 4s ease-in-out infinite;
}
.graph-edge:nth-child(2n) {
  animation-delay: 1s;
}
.graph-edge:nth-child(3n) {
  animation-delay: 2s;
}

@keyframes edgeDraw {
  0% {
    stroke-dashoffset: 200;
    opacity: 0.2;
  }
  50% {
    stroke-dashoffset: 0;
    opacity: 0.6;
  }
  100% {
    stroke-dashoffset: -200;
    opacity: 0.2;
  }
}

/* ─── Control ─── */
#control {
  border-top: 1px solid var(--border);
}

.control-intro {
  max-width: 700px;
  margin-bottom: 64px;
}

.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px;
}

.control-card {
  padding: 40px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  text-align: center;
}
.control-card h3 {
  margin-bottom: 12px;
  font-size: 1.15rem;
}
.control-card p {
  font-size: 0.95rem;
  color: var(--text-dim);
  max-width: none;
  margin: 0 auto;
}

/* Toggle visual */
.control-visual {
  margin-top: 64px;
  padding: 40px;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.toggle-row:last-child {
  border-bottom: none;
}
.toggle-label {
  font-size: 0.95rem;
  color: var(--text-muted);
}
.toggle-label .tag {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
  font-weight: 600;
}
.tag-tool {
  background: rgba(0, 212, 255, 0.1);
  color: var(--accent);
}
.tag-data {
  background: rgba(124, 58, 237, 0.1);
  color: var(--accent-violet);
}
.tag-persona {
  background: rgba(255, 107, 107, 0.1);
  color: #ff6b6b;
}

.toggle-switch {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: var(--text-dim);
  position: relative;
  transition: background 0.3s;
}
.toggle-switch.on {
  background: var(--accent);
}
.toggle-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  transition: transform 0.3s;
}
.toggle-switch.on::after {
  transform: translateX(20px);
}

/* ─── How It Works ─── */
#how {
  border-top: 1px solid var(--border);
}

.how-steps {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px;
  margin-top: 64px;
  margin-bottom: 64px;
}

.how-step {
  text-align: center;
  padding: 40px 24px;
}
.how-step .step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-violet));
  color: var(--bg);
  font-weight: 800;
  font-size: 1.25rem;
  margin-bottom: 24px;
}
.how-step h3 {
  margin-bottom: 12px;
}
.how-step p {
  margin: 0 auto;
  font-size: 1rem;
  color: var(--text-dim);
  max-width: none;
}

/* Screenshot placeholders */
.screenshots {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
}

.screenshot-placeholder {
  aspect-ratio: 16/10;
  background: var(--bg-card);
  border-style: dashed;
  border-width: 2px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* ─── Blog / Building in Public ─── */
#blog {
  border-top: 1px solid var(--border);
  background: linear-gradient(
    180deg,
    var(--bg) 0%,
    var(--bg-elevated) 50%,
    var(--bg) 100%
  );
}

.blog-intro {
  max-width: 700px;
  margin-bottom: 64px;
}

.blog-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 48px;
}

.blog-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.blog-card:hover {
  transform: translateY(-3px);
}

.blog-date {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}
.blog-card h3 {
  margin-bottom: 12px;
  font-size: 1.15rem;
  color: var(--text);
}
.blog-card p {
  font-size: 0.95rem;
  color: var(--text-dim);
  max-width: none;
  flex: 1;
}
.blog-read-more {
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
}

.blog-cta {
  text-align: center;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s;
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-violet));
  color: var(--bg);
}
.btn-primary:hover {
  box-shadow:
    0 0 30px var(--accent-glow),
    0 0 60px var(--accent-violet-glow);
  transform: translateY(-1px);
}
.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ─── Roadmap ─── */
#roadmap {
  border-top: 1px solid var(--border);
}

.roadmap-track {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  margin-top: 64px;
  position: relative;
}

.roadmap-track::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: var(--border);
}

.roadmap-phase {
  text-align: center;
  padding: 0 24px;
  position: relative;
}

.phase-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--border);
  margin: 0 auto 16px;
  position: relative;
  z-index: 1;
}
.phase-dot.active {
  background: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}
.phase-dot.active::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0.4;
  animation: ringPulse 2s ease-in-out infinite;
}
@keyframes ringPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.4;
  }
  50% {
    transform: scale(1.3);
    opacity: 0;
  }
}

.phase-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}
.phase-label.active {
  color: var(--accent);
}

.roadmap-phase h3 {
  margin: 16px 0 8px;
  font-size: 1.25rem;
}
.roadmap-phase p {
  font-size: 0.95rem;
  margin: 0 auto;
  color: var(--text-dim);
  max-width: none;
}

.you-are-here {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: rgba(0, 212, 255, 0.1);
  padding: 4px 12px;
  border-radius: 20px;
  margin-top: 16px;
}

/* ─── Footer ─── */
footer {
  border-top: 1px solid var(--border);
  padding: 60px 0;
  text-align: center;
}

.footer-brand {
  font-size: 1.5rem;
  font-weight: 900;
  margin-bottom: 16px;
}
.footer-powered {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 24px;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 32px;
  list-style: none;
}
.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}
.footer-links a:hover {
  color: var(--accent);
}

.footer-domain {
  margin-top: 32px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
  section {
    padding: 80px 0;
  }

  .problem-grid,
  .brain-grid,
  .control-grid,
  .how-steps,
  .screenshots,
  .blog-grid,
  .roadmap-track {
    grid-template-columns: 1fr;
  }

  .shift-columns {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .shift-arrow {
    padding-top: 0;
    transform: rotate(90deg);
  }

  .ask-input {
    min-width: auto;
    width: 100%;
    max-width: 440px;
  }

  .nav-links {
    display: none;
  }

  .roadmap-track::before {
    display: none;
  }

  .graph-container {
    height: 300px;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 0 16px;
  }
  section {
    padding: 64px 0;
  }
  .brain-card,
  .control-card,
  .blog-card {
    padding: 24px;
  }
}
