/* ==========================================================================
   MVSP.ai — editorial design system
   Paper-white surface, ink text, one clear blue accent, serif headlines and
   monospace for metadata. Light by default, dark via prefers-color-scheme.
   Fonts are self-hosted (see assets/fonts/README.md): no third-party requests.
   ========================================================================== */

@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-tight-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif-italic-latin.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin.woff2") format("woff2");
}

:root {
  --bg: #f3f2ee;
  --surface: #fbfaf7;
  --surface-2: #eceae4;
  --ink: #111214;
  --ink-2: #2a2c30;
  --muted: #62646a;
  --line: #dcd9d1;
  --line-strong: #b9b6ad;
  --accent: #2438e8;
  --accent-ink: #ffffff;
  --accent-soft: #e6e8fd;
  --highlight: #d8f26a;
  --grid-line: rgba(17, 18, 20, 0.055);

  --f-sans: "Inter Tight", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-serif: "Instrument Serif", ui-serif, Georgia, "Times New Roman", serif;
  --f-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --wrap: 1180px;
  --radius: 10px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0e10;
    --surface: #15171a;
    --surface-2: #1c1f23;
    --ink: #eeede8;
    --ink-2: #d4d3cd;
    --muted: #9a9ca2;
    --line: #2a2d32;
    --line-strong: #3d4148;
    --accent: #8f9cff;
    --accent-ink: #0d0e10;
    --accent-soft: #1b2050;
    --grid-line: rgba(238, 237, 232, 0.05);
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: var(--f-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection {
  background: var(--highlight);
  color: #111214;
}
a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: color 0.15s, text-decoration-color 0.15s;
}
a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
strong {
  color: var(--ink);
  font-weight: 600;
}
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--bg);
  padding: 0.5rem 0.8rem;
  z-index: 50;
}
.skip:focus {
  left: 0.5rem;
  top: 0.5rem;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ------------------------------------------------------------ navigation -- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
}
.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--f-mono);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover {
  color: var(--ink);
}
.brand::before {
  content: "";
  width: 18px;
  height: 18px;
  flex: none;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--accent) 0 3px, transparent 3.5px);
}
.brand em {
  font-style: normal;
  color: var(--muted);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  font-size: 0.95rem;
}
.nav-links a {
  text-decoration: none;
  color: var(--ink-2);
}
.nav-links a:hover {
  color: var(--accent);
}

/* --------------------------------------------------------------- buttons -- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--ink);
  font-family: var(--f-sans);
  font-size: 0.97rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s var(--ease), background 0.15s, color 0.15s,
    border-color 0.15s;
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-ghost:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.nav-links a.btn-primary {
  color: var(--bg);
}
.nav-links a.btn-primary:hover {
  color: var(--accent-ink);
}
.nav .btn {
  padding: 0.5rem 0.95rem;
  font-size: 0.9rem;
}

/* ------------------------------------------------------------- primitives -- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--f-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow .num {
  color: var(--accent);
}
.eyebrow.dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

h1,
h2,
h3 {
  font-family: var(--f-serif);
  font-weight: 400;
  color: var(--ink);
  line-height: 1.04;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h1 em,
h2 em {
  font-style: italic;
}
.mark-hl {
  background: linear-gradient(transparent 58%, var(--highlight) 58% 92%, transparent 92%);
  padding: 0 0.08em;
  color: var(--ink);
}
@media (prefers-color-scheme: dark) {
  .mark-hl {
    color: #111214;
    background: var(--highlight);
    padding: 0 0.15em;
    border-radius: 3px;
  }
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--f-mono);
  font-size: 0.75rem;
  color: var(--ink-2);
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  white-space: nowrap;
}
.chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ------------------------------------------------------------------ hero -- */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: -1px -1px;
}
.hero::after {
  /* fade the grid out towards the content below */
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 40%;
  background: linear-gradient(transparent, var(--bg));
  pointer-events: none;
}
.hero .wrap {
  position: relative;
  z-index: 1;
  padding-top: clamp(4rem, 10vw, 8rem);
  padding-bottom: clamp(4rem, 9vw, 7rem);
}
.hero h1 {
  margin-top: 1.4rem;
  max-width: 14ch;
  font-size: clamp(3.2rem, 9vw, 7rem);
  line-height: 0.98;
}
.hero .lede {
  margin-top: 1.6rem;
  max-width: 56ch;
  font-size: clamp(1.1rem, 1.8vw, 1.3rem);
  line-height: 1.55;
  color: var(--ink-2);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.2rem;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
}

/* -------------------------------------------------------------- sections -- */
.section {
  padding: clamp(4rem, 8vw, 6.5rem) 0 0;
}
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 2rem 3rem;
  align-items: end;
  margin-top: 1rem;
}
.section h2 {
  font-size: clamp(2.1rem, 4.6vw, 3.6rem);
  max-width: 16ch;
}
.section-head p {
  max-width: 54ch;
  color: var(--muted);
  font-size: 1.08rem;
}

/* ------------------------------------------------------------ comparison -- */
.compare {
  margin-top: 3rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.compare-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr) minmax(0, 1.2fr);
  border-top: 1px solid var(--line);
}
.compare-row:first-child {
  border-top: 0;
}
.compare-row > div {
  padding: 1.05rem 1.35rem;
  font-size: 0.98rem;
}
.compare-row > div + div {
  border-left: 1px solid var(--line);
}
.compare-head > div {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
}
.compare-head .us {
  color: var(--accent);
}
.compare-row .label {
  color: var(--ink);
  font-weight: 600;
}
.compare-row .us {
  background: var(--accent-soft);
  color: var(--ink);
}
.compare-head .us {
  background: var(--accent-soft);
}
.compare-row .them {
  color: var(--muted);
}

/* ---------------------------------------------------------- feature grid -- */
.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 3rem;
  background: var(--line-strong);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
}
.feature {
  background: var(--surface);
  padding: 1.75rem 1.6rem 2rem;
  transition: background 0.2s;
}
.feature:hover {
  background: var(--bg);
}
.feature .idx {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  color: var(--accent);
}
.feature h3 {
  margin-top: 1.6rem;
  font-size: 1.75rem;
}
.feature p {
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

/* ------------------------------------------------------------ code block -- */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 3rem;
  align-items: center;
  margin-top: 1rem;
}
.split p {
  margin-top: 1.1rem;
  color: var(--muted);
  max-width: 48ch;
}
.split ul {
  margin-top: 1.4rem;
  list-style: none;
  display: grid;
  gap: 0.6rem;
}
.split li {
  display: flex;
  gap: 0.7rem;
  color: var(--ink);
  font-size: 1rem;
}
.split li::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 0.55em;
  background: var(--accent);
  border-radius: 2px;
}
.code {
  background: #111214;
  color: #eeede8;
  border-radius: var(--radius);
  border: 1px solid var(--ink);
  overflow: hidden;
}
@media (prefers-color-scheme: dark) {
  .code {
    background: var(--surface);
    border-color: var(--line-strong);
  }
}
.code-bar {
  display: flex;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  font-family: var(--f-mono);
  font-size: 0.72rem;
  color: #9a9ca2;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.code pre {
  padding: 1.25rem 1.1rem;
  overflow-x: auto;
  font-family: var(--f-mono);
  font-size: 0.83rem;
  line-height: 1.75;
}
.code .c {
  color: #7d8087;
}
.code .a {
  color: #b3bcff;
}
.code .s {
  color: #d8f26a;
}

/* -------------------------------------------------------------- manifest -- */
.manifest {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}
.manifest > div {
  border-top: 1px solid var(--ink);
  padding-top: 1.1rem;
}
.manifest .step {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.manifest h3 {
  margin-top: 0.6rem;
  font-size: 2rem;
}
.manifest p {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.98rem;
}
.manifest .now h3 {
  color: var(--accent);
}

/* ------------------------------------------------------------------- CTA -- */
.cta {
  margin-top: clamp(4rem, 8vw, 6.5rem);
  padding: clamp(2.5rem, 6vw, 4.5rem);
  border-radius: calc(var(--radius) + 6px);
  background: var(--ink);
  color: var(--bg);
  position: relative;
  overflow: hidden;
}
.cta::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -80px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.85;
  filter: blur(2px);
}
.cta > * {
  position: relative;
  z-index: 1;
}
.cta h2 {
  color: var(--bg);
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  max-width: 16ch;
}
.cta p {
  margin-top: 1.1rem;
  max-width: 50ch;
  color: color-mix(in srgb, var(--bg) 75%, transparent);
}
.cta .hero-actions .btn-primary {
  background: var(--highlight);
  border-color: var(--highlight);
  color: #111214;
}
.cta .hero-actions .btn-primary:hover {
  background: var(--bg);
  border-color: var(--bg);
  color: var(--ink);
}
.cta .btn-ghost {
  color: var(--bg);
  border-color: color-mix(in srgb, var(--bg) 40%, transparent);
}
.cta .btn-ghost:hover {
  color: var(--bg);
  border-color: var(--bg);
}

/* ---------------------------------------------------------------- footer -- */
.footer {
  margin-top: clamp(4rem, 8vw, 6rem);
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--muted);
}
.footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-top: 1.75rem;
  padding-bottom: 2.25rem;
}
.footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}
.footer a {
  color: var(--muted);
}
.footer a:hover {
  color: var(--accent);
}

/* ------------------------------------------------------------ responsive -- */
@media (max-width: 900px) {
  .section-head,
  .split {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }
  .features,
  .manifest {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 680px) {
  .nav-links .hide-sm {
    display: none;
  }
  .compare-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .compare-row > div + div {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .compare-head {
    display: none;
  }
  .compare-row .us::before,
  .compare-row .them::before {
    display: block;
    margin-bottom: 0.15rem;
    font-family: var(--f-mono);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .compare-row .us::before {
    content: "MVSP.ai";
    color: var(--accent);
  }
  .compare-row .them::before {
    content: "Typical analytics";
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

/* ------------------------------------------------------- vintage CRT feel -- */
.bg-dots {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
/* scanlines + vignette over everything, never intercepting clicks */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.0125) 0,
      rgba(0, 0, 0, 0.0125) 1px,
      transparent 1px,
      transparent 3px
    ),
    radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.03) 100%);
}
@media (prefers-color-scheme: dark) {
  body::after {
    background:
      repeating-linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.07) 0,
        rgba(0, 0, 0, 0.07) 1px,
        transparent 1px,
        transparent 3px
      ),
      radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.1) 100%);
  }
  h1 em,
  .eyebrow .num {
    text-shadow: 0 0 14px color-mix(in srgb, var(--accent) 28%, transparent);
  }
}
/* terminal prompt + blinking block cursor */
.eyebrow.dot::before {
  border-radius: 0;
}
.hero h1::after {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 0.85em;
  margin-left: 0.12em;
  vertical-align: -0.05em;
  background: var(--accent);
  animation: crt-blink 1.1s steps(1) infinite;
}
.chip {
  border-radius: 2px;
}
.chip::before {
  border-radius: 0;
}
@keyframes crt-blink {
  50% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hero h1::after { animation: none; }
}

/* ------------------------------------------------------- motion / parallax -- */
.motion .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease) var(--d, 0ms),
    transform 0.7s var(--ease) var(--d, 0ms);
}
.motion .reveal.in {
  opacity: 1;
  transform: none;
}
.hero .wrap {
  will-change: transform;
}
.cta::after {
  transform: translateY(var(--py, 0px));
}
.feature {
  transition: transform 0.25s var(--ease), border-color 0.25s;
}
.motion .feature.in:hover {
  transform: translateY(-3px);
}

/* ------------------------------------------------------------ glitch-in -- */
.hero h1 {
  animation: glitch-in 0.18s steps(1, end) 0s both;
}
@keyframes glitch-in {
  0%   { opacity: 0; }
  15%  { opacity: 1; clip-path: inset(35% 0 40% 0); transform: translateX(-3px);
         text-shadow: 2px 0 #ff2bd6, -2px 0 #19e6ff; }
  35%  { clip-path: inset(0 0 0 0); transform: translateX(2px); opacity: 0.8;
         text-shadow: -2px 0 #ff2bd6, 2px 0 #19e6ff; }
  55%  { clip-path: inset(55% 0 15% 0); transform: translateX(-1px); opacity: 1;
         text-shadow: 1px 0 #ff2bd6, -1px 0 #19e6ff; }
  75%  { clip-path: inset(0 0 0 0); transform: none;
         text-shadow: 1px 0 #ff2bd6, -1px 0 #19e6ff; }
  100% { clip-path: none; transform: none; opacity: 1; text-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hero h1 { animation: none; }
}
