/*
 * Vigor public documentation — standalone stylesheet.
 *
 * These are static, crawlable, zero-JS marketing/docs pages served straight
 * from /docs/*. They deliberately anchor to the illustrated warm-paper LIGHT
 * brand palette used by the SPA Landing page (frontend/src/views/Landing.vue),
 * porting its tokens + "sketch" aesthetic here so the docs feel like the same
 * product without importing the Vue app. Colour is NEVER used alone — every
 * status/score signal is paired with a Material Symbols icon and a text label.
 */

/* ---------- Design tokens (fixed light — matches Landing) ---------- */
:root {
  --bg: #e7e5df;
  --card: #ffffff;
  --ink: #17161f;
  --muted: #62617a;
  --faint: #9594a6;
  --border: #e2e2ea;
  --line: #eaeaf0;
  --primary: #5a2de0;
  --primary-ink: #5126c9;
  --spark: #f5277c;
  --amber: #ff9f1c;
  --success: #1e9e5a;
  --success-bg: #e4f4eb;
  --warning: #b9791a;
  --critical: #cf3a22;
  --surface-tint: color-mix(in srgb, #5a2de0 4%, #fff);
  --gradient: linear-gradient(100deg, #5a2de0 0%, #f5277c 60%, #ff9f1c 100%);
  --font-display: "Bricolage Grotesque", "Segoe UI", sans-serif;
  --font-sans: "Hanken Grotesk", "Segoe UI", sans-serif;
  --font-mono: "Space Mono", ui-monospace, monospace;
  --font-hand: "Caveat", cursive;
  --ink-shadow: 5px 5px 0 #17161f;
  --ink-shadow-sm: 3px 3px 0 #17161f;
  --radius: 18px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* paper-dot texture, matches Landing .lx-paper */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(90, 45, 224, 0.05) 1px, transparent 1px);
  background-size: 26px 26px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--primary-ink);
  text-decoration: none;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.06;
  margin: 0;
}

p {
  margin: 0;
}

/* Material Symbols (loaded per page). Inline icons that always sit beside a
   label — never colour-alone signalling. */
.ms {
  font-family: "Material Symbols Outlined";
  font-weight: 500;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  font-variation-settings: "FILL" 0;
  -webkit-font-feature-settings: "liga";
  vertical-align: middle;
  user-select: none;
  /* Reserve the glyph's 1em footprint and clip the ligature source text. The icon
     font loads async (non-render-blocking), so until it arrives each .ms would
     otherwise render its literal ligature word ("arrow_forward") at word width,
     then collapse to a single glyph — a large layout shift (CWV: CLS). A fixed 1em
     box + overflow:hidden keeps the footprint constant across the swap. */
  width: 1em;
  overflow: hidden;
}
.ms.fill {
  font-variation-settings: "FILL" 1;
}

.font-hand {
  font-family: var(--font-hand);
}

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding-inline: 20px;
}
@media (min-width: 640px) {
  .wrap {
    padding-inline: 48px;
  }
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 12px 0;
  z-index: 100;
  font-weight: 700;
}
.skip-link:focus {
  left: 0;
}

/* ---------- Top nav (sticky) ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 2px dashed var(--faint);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 8px 20px;
  flex-wrap: wrap;
  padding-block: 14px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
}
.brand img {
  width: 28px;
  height: auto;
}
.brand .wm {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nav-links {
  display: none;
  align-items: center;
  gap: 4px;
}
@media (min-width: 860px) {
  .nav-links {
    display: inline-flex;
  }
}
.nav-links a {
  padding: 7px 12px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  transition: background 0.15s;
}
.nav-links a:hover {
  background: color-mix(in srgb, var(--primary) 9%, transparent);
}
.nav-links a[aria-current="page"] {
  color: var(--primary-ink);
  background: color-mix(in srgb, var(--primary) 11%, transparent);
}
.spacer {
  flex: 1;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 14px;
  padding: 13px 20px;
  border-radius: 13px;
  border: none;
  cursor: pointer;
  transition:
    transform 0.12s ease,
    filter 0.15s ease,
    background 0.15s ease;
  white-space: nowrap;
}
.btn .ms {
  font-size: 19px;
}
.btn-sm {
  padding: 9px 14px;
  font-size: 12.5px;
  border-radius: 11px;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}
.btn-ink {
  background: var(--ink);
  color: #fff;
  border: 2.5px solid var(--ink);
  box-shadow: var(--ink-shadow-sm);
}
.btn-ink:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 #17161f;
}
.btn-secondary {
  background: var(--card);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 #17161f;
}
.btn-secondary:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 #17161f;
}
.btn-ghost {
  background: transparent;
  color: var(--primary-ink);
  font-weight: 700;
}
.btn-ghost:hover {
  background: color-mix(in srgb, var(--primary) 9%, transparent);
}

/* ---------- Eyebrows / pills / badges ---------- */
.eyebrow {
  display: inline-block;
  font: 700 11px/1 var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--primary-ink);
  background: #ece7fb;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 7px 13px;
  box-shadow: 2px 2px 0 #17161f;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 700 11px/1 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 11px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: #fff;
  box-shadow: 2px 2px 0 #17161f;
}
.pill .ms {
  font-size: 14px;
}
.pill-live {
  color: var(--success);
  background: var(--success-bg);
}
.pill-spark {
  color: var(--spark);
  background: #fdeaf1;
}
.pill-amber {
  color: #9a5b12;
  background: #fbf0d9;
}
.hand-note {
  font-family: var(--font-hand);
  color: var(--spark);
  font-size: 19px;
  line-height: 1.1;
}
.hand-note.purple {
  color: var(--primary);
}

/* ---------- Cards (sketch) ---------- */
.card {
  background: var(--card);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--ink-shadow);
  padding: 24px;
}
.card-soft {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 color-mix(in srgb, #5a2de0 30%, #17161f);
  padding: 22px;
}
.lift {
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease;
}
.lift:hover {
  transform: translate(-2px, -3px) rotate(0deg);
  box-shadow: 7px 8px 0 color-mix(in srgb, #5a2de0 34%, #17161f);
}

/* Icon chip */
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  color: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 16px;
  box-shadow: var(--ink-shadow-sm);
}
.chip .ms {
  font-size: 28px;
}
.chip-sm {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border-width: 2px;
  box-shadow: 2px 2px 0 #17161f;
}
.chip-sm .ms {
  font-size: 22px;
}
.chip-md {
  width: 62px;
  height: 62px;
}

/* soft icon square (tinted, no ink border) */
.ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex: none;
  background: color-mix(in srgb, var(--primary) 10%, #fff);
  color: var(--primary);
}
.ic .ms {
  font-size: 22px;
}

/* ---------- Section rhythm ---------- */
.section {
  padding-block: 56px;
}
.section-tight {
  padding-block: 36px;
}
.section-head {
  max-width: 640px;
}
.section-head.center {
  margin-inline: auto;
  text-align: center;
}
.section-head h2 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin-top: 12px;
}
.section-head p.lede {
  margin-top: 12px;
  font-size: 16px;
  font-weight: 500;
  color: var(--muted);
}

.hr-dash {
  border: none;
  border-top: 2px dashed var(--faint);
  margin: 0;
}

/* ---------- Grids ---------- */
.grid {
  display: grid;
  gap: 18px;
}
@media (min-width: 720px) {
  .cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 980px) {
  .cols-3-lg {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- Feature list ---------- */
.feat {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.feat li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14.5px;
  font-weight: 600;
}
.feat .tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 8px;
  background: var(--success-bg);
  color: var(--success);
  margin-top: 1px;
}
.feat .tick .ms {
  font-size: 17px;
}

/* ---------- Numbered steps ---------- */
.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.step {
  counter-increment: step;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 14px;
  box-shadow: 3px 3px 0 color-mix(in srgb, #5a2de0 26%, #17161f);
  padding: 16px 18px;
}
.step::before {
  content: counter(step);
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  border: 2.5px solid var(--ink);
  box-shadow: 2px 2px 0 #17161f;
}
.step h3 {
  font-size: 17px;
}
.step p {
  margin-top: 4px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
}

/* ---------- Callout ---------- */
.callout {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border-radius: 14px;
  padding: 16px 18px;
  font-size: 14px;
  font-weight: 500;
  border: 2px solid;
}
.callout .ms {
  font-size: 22px;
  flex: none;
  margin-top: 1px;
}
.callout b {
  font-weight: 800;
}
.callout-lock {
  color: #14512f;
  background: var(--success-bg);
  border-color: var(--success);
}
.callout-lock .ms {
  color: var(--success);
}
.callout-tip {
  color: #4a2a06;
  background: #fbf0d9;
  border-color: var(--amber);
}
.callout-tip .ms {
  color: var(--warning);
}
.callout-info {
  color: #2a1f52;
  background: #ece7fb;
  border-color: var(--primary);
}
.callout-info .ms {
  color: var(--primary);
}

/* ---------- Mock (mini product preview) ---------- */
.mock {
  background: var(--surface-tint);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}
.bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.bar-row .lbl {
  width: 92px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.bar-row .lbl .ms {
  font-size: 15px;
  color: var(--muted);
}
.bar-track {
  height: 10px;
  flex: 1;
  border-radius: 5px;
  background: var(--line);
  overflow: hidden;
}
.bar-fill {
  display: block;
  height: 100%;
  border-radius: 5px;
  transform-origin: left;
  animation: grow 1.1s ease both;
}
.bar-row .pct {
  font: 700 10px var(--font-mono);
  color: var(--muted);
  width: 34px;
  text-align: right;
}

/* ---------- Table ---------- */
.table-scroll {
  overflow-x: auto;
  border: 2px solid var(--ink);
  border-radius: 14px;
  box-shadow: 3px 3px 0 #17161f;
  background: var(--card);
}
table.flow {
  border-collapse: collapse;
  width: 100%;
  min-width: 640px;
  font-size: 13px;
}
table.flow th,
table.flow td {
  text-align: left;
  padding: 12px 14px;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
table.flow thead th {
  font: 700 11px/1.2 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-ink);
  background: #f4f1fd;
}
table.flow tbody tr:last-child td {
  border-bottom: none;
}
table.flow td:first-child {
  font-weight: 800;
  white-space: nowrap;
}
table.flow .muted {
  color: var(--faint);
  font-style: italic;
}

/* ---------- Doc / feature cards on hub ---------- */
.doc-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
  text-decoration: none;
  color: inherit;
}
.doc-card .arrow {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 13.5px;
  color: var(--primary-ink);
}
.doc-card:hover .arrow .ms {
  transform: translateX(3px);
}
.doc-card .arrow .ms {
  transition: transform 0.15s ease;
  font-size: 18px;
}
.tag-mono {
  font: 700 10px var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---------- Breadcrumb ---------- */
.crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 700 12px var(--font-mono);
  letter-spacing: 0.06em;
  color: var(--muted);
  flex-wrap: wrap;
}
.crumb a {
  color: var(--muted);
}
.crumb a:hover {
  color: var(--primary-ink);
}
.crumb .ms {
  font-size: 15px;
  color: var(--faint);
}

/* ---------- Hero ---------- */
.hero {
  padding-block: 40px 20px;
}
.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  margin-top: 14px;
}
.hero .lede {
  margin-top: 18px;
  max-width: 560px;
  font-size: 18px;
  font-weight: 500;
  color: var(--muted);
}
.hero-cta {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.underline-word {
  position: relative;
  white-space: nowrap;
  color: var(--primary-ink);
}
.underline-word svg {
  position: absolute;
  left: -3px;
  bottom: -8px;
  width: 106%;
  height: 18px;
}
.underline-word path {
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
  animation: dash 1.1s ease-out 0.3s forwards;
}

/* ---------- Big CTA band ---------- */
.cta-band {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  background: var(--gradient);
  color: #fff;
  text-align: center;
  padding: 56px 24px;
  border: 2.5px solid var(--ink);
  box-shadow: var(--ink-shadow);
}
.cta-band::after {
  content: "";
  position: absolute;
  bottom: -150px;
  left: -80px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.3);
}
.cta-band h2 {
  color: #fff;
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  position: relative;
}
.cta-band p {
  position: relative;
  margin: 12px auto 0;
  max-width: 440px;
  font-size: 16px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
}
.cta-band .btn-secondary {
  position: relative;
  margin-top: 24px;
}

/* ---------- Stat strip ---------- */
.stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px 44px;
  text-align: center;
}
.stats .num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 34px;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stats .lbl {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

/* ---------- Dimension chips (Pulse) ---------- */
.dim-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}
@media (min-width: 560px) {
  .dim-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 900px) {
  .dim-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.dim {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 12px;
  background: var(--card);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 color-mix(in srgb, #5a2de0 24%, #17161f);
  font-weight: 700;
  font-size: 13.5px;
}
.dim .ms {
  font-size: 20px;
  color: var(--primary);
  flex: none;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 2px dashed var(--faint);
  padding-block: 34px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  align-items: center;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}
.footer-links a {
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
}
.footer-links a:hover {
  color: var(--primary-ink);
}
.footer small {
  color: var(--faint);
  font-size: 12px;
}

/* rotation helpers (sketch jaunt) */
.r-1 {
  transform: rotate(-1deg);
}
.r1 {
  transform: rotate(1deg);
}
.r-2 {
  transform: rotate(-2deg);
}
.r2 {
  transform: rotate(2deg);
}

/* ---------- Animations ---------- */
@keyframes grow {
  from {
    transform: scaleX(0.03);
  }
  to {
    transform: scaleX(1);
  }
}
@keyframes dash {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateY(-7px) rotate(2deg);
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.spin {
  animation: spin 18s linear infinite;
}
.float {
  animation: float 4s ease-in-out infinite;
}

/* Respect reduced motion — kill every animation + smooth scroll. */
@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;
  }
  .bar-fill {
    transform: none !important;
  }
}
