/* ===== Design tokens ===== */
:root {
  --paper: #E1F2F1;
  --paper-alt: #D0E9E7;
  --ink: #10141C;
  --navy: #16233F;
  --teal: #0D7377;
  --signal: #FF5A36;
  --signal-hover: #E14A28;
  --slate: #5B6472;
  --hairline: #C3DBD9;
  --white: #FFFFFF;

  /* Simulation UI colors, reused for the header so it matches the product. */
  --sim-bg: #10131A;
  --sim-border: #262C3A;
  --sim-text: #E6E8EC;
  --sim-accent: #6FA8FF;

  --font-display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
  --space-24: 96px;
  --space-32: 128px;

  --container-max: 1180px;
  --radius: 6px;
}

/* ===== Reset ===== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); color: var(--ink); }
p { margin: 0; }
button { font: inherit; cursor: pointer; }

/* ===== Type scale ===== */
h1, .h1 {
  font-size: 2.75rem;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
}
h2, .h2 {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
h3, .h3 {
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.3;
}
.body-large {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--slate);
}
.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--teal);
  margin-bottom: var(--space-3);
}
.text-muted { color: var(--slate); }

@media (min-width: 860px) {
  h1, .h1 { font-size: 4rem; }
  h2, .h2 { font-size: 2.5rem; }
  h3, .h3 { font-size: 1.5rem; }
}
@media (min-width: 1180px) {
  h1, .h1 { font-size: 4.5rem; }
}

/* ===== Layout ===== */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-4);
}
@media (min-width: 1024px) {
  .container { padding: 0 var(--space-12); }
}
section {
  padding: var(--space-16) 0;
}
@media (min-width: 860px) {
  section { padding: var(--space-24) 0; }
}
.section-alt { background: var(--paper-alt); }
.section-dark {
  background: var(--navy);
  color: var(--white);
}
.section-dark h1, .section-dark h2, .section-dark h3 { color: var(--white); }
.section-dark .body-large, .section-dark .text-muted { color: rgba(255,255,255,0.7); }

.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 14px 28px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
  border: 1.5px solid transparent;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}
.btn-primary {
  background: var(--signal);
  color: var(--white);
}
.btn-primary:hover { background: var(--signal-hover); }
.btn-secondary {
  background: transparent;
  border-color: var(--navy);
  color: var(--navy);
}
.btn-secondary:hover { background: var(--navy); color: var(--white); }
.section-dark .btn-secondary { border-color: var(--white); color: var(--white); }
.section-dark .btn-secondary:hover { background: var(--white); color: var(--navy); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-4); }

/* ===== Header / nav ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(16, 19, 26, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--sim-border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--navy);
}
.site-header .wordmark { color: var(--sim-text); }
.wordmark .mesh-mark {
  flex-shrink: 0;
}

.nav-toggle { display: none; }
.nav-burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  cursor: pointer;
}
.nav-burger span {
  display: block;
  height: 2px;
  background: var(--sim-text);
  border-radius: 1px;
  transition: transform 150ms ease, opacity 150ms ease;
}

.nav-links {
  display: none;
  position: absolute;
  top: 72px;
  left: 0;
  right: 0;
  background: var(--sim-bg);
  border-bottom: 1px solid var(--sim-border);
  flex-direction: column;
  padding: var(--space-4);
  gap: var(--space-2);
}
.nav-toggle:checked ~ .nav-links { display: flex; }
.nav-links a {
  padding: var(--space-3) var(--space-2);
  font-weight: 500;
  color: var(--sim-text);
  border-radius: var(--radius);
}
.nav-links a.active { color: var(--sim-accent); font-weight: 600; }
.nav-links a:hover { background: rgba(255, 255, 255, 0.08); }
.nav-links .btn { margin-top: var(--space-2); }

@media (min-width: 860px) {
  .nav-burger { display: none; }
  .nav-links {
    display: flex !important;
    position: static;
    flex-direction: row;
    align-items: center;
    background: transparent;
    border: none;
    padding: 0;
    gap: var(--space-8);
  }
  .nav-links a { padding: var(--space-1) 0; }
  .nav-links .btn { margin-top: 0; padding: 10px 20px; }
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--hairline);
  padding: var(--space-12) 0;
}
.footer-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
}
.footer-links a { color: var(--slate); font-size: 0.9375rem; }
.footer-links a:hover { color: var(--teal); }
.footer-meta {
  font-size: 0.875rem;
  color: var(--slate);
}
@media (min-width: 720px) {
  .footer-grid {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* ===== Waypoint divider (signature element) ===== */
.waypoint-divider {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-8) 0;
}
.waypoint-divider .line {
  flex: 1;
  height: 1px;
  background: var(--hairline);
}
.waypoint-divider .node {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--slate);
  background: var(--paper);
  flex-shrink: 0;
}
.waypoint-divider .node.filled {
  background: var(--signal);
  border-color: var(--signal);
}
.section-dark .waypoint-divider .line { background: rgba(255,255,255,0.2); }
.section-dark .waypoint-divider .node { border-color: rgba(255,255,255,0.4); background: transparent; }

@media (prefers-reduced-motion: no-preference) {
  .hero .waypoint-divider .line {
    animation: draw-line 900ms ease-out;
  }
}
@keyframes draw-line {
  from { transform: scaleX(0); transform-origin: left; }
  to { transform: scaleX(1); transform-origin: left; }
}

/* ===== Cards ===== */
.card {
  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: var(--space-8);
  transition: border-color 150ms ease, transform 150ms ease;
}
.card:hover {
  border-color: var(--navy);
  transform: translateY(-2px);
}
.card .eyebrow { margin-bottom: var(--space-2); }
.card h3 { margin-bottom: var(--space-3); }
.card p { color: var(--slate); }

/* ===== Stat row ===== */
.stat-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}
@media (min-width: 720px) {
  .stat-row { grid-template-columns: repeat(4, 1fr); }
}
.stat {
  padding-left: var(--space-4);
  border-left: 1px solid var(--hairline);
}
.stat:first-child { border-left: none; padding-left: 0; }
.section-dark .stat { border-left-color: rgba(255,255,255,0.2); }
.stat .number {
  display: block;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1.75rem;
  color: var(--navy);
}
.section-dark .stat .number { color: var(--white); }
.stat .label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--slate);
  margin-top: var(--space-1);
}

/* ===== Sequence steps ===== */
.sequence {
  display: grid;
  gap: var(--space-8);
  counter-reset: step;
}
@media (min-width: 720px) {
  .sequence { grid-template-columns: repeat(3, 1fr); }
}
.step {
  position: relative;
  padding-top: var(--space-8);
}
.step::before {
  counter-increment: step;
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--signal);
  color: var(--signal);
  font-family: var(--font-mono);
  font-weight: 500;
  margin-bottom: var(--space-4);
}
.step h3 { margin-bottom: var(--space-2); }
.step p { color: var(--slate); }

/* ===== Hero ===== */
.hero { padding-top: var(--space-16); }
.hero .eyebrow { margin-bottom: var(--space-4); }
.hero h1 { margin-bottom: var(--space-6); max-width: 16ch; }
.hero .body-large { max-width: 56ch; margin-bottom: var(--space-8); }

/* ===== Live simulation embed (Home hero) ===== */
.hero-demo {
  margin-top: var(--space-4);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
  background: #10131a;
  box-shadow: 0 24px 48px -24px rgba(16, 20, 28, 0.25);
  aspect-ratio: 16 / 10;
}
@media (min-width: 860px) {
  .hero-demo { aspect-ratio: 16 / 7; }
}
.hero-demo iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* ===== Screenshot frame ===== */
.screenshot-frame {
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-alt);
  box-shadow: 0 24px 48px -24px rgba(16, 20, 28, 0.25);
}
.screenshot-frame img { width: 100%; }
figcaption {
  margin-top: var(--space-3);
  font-size: 0.875rem;
  color: var(--slate);
  text-align: center;
}

/* ===== Forms ===== */
.contact-form {
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.contact-form .eyebrow { margin-bottom: 0; }
.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.form-field label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink);
}
.form-field input,
.form-field textarea {
  font: inherit;
  padding: 12px 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  resize: vertical;
}
.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13, 115, 119, 0.15);
}
.contact-form .btn { align-self: flex-start; }

/* ===== Utility ===== */
.center { text-align: center; }
.mt-8 { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }
.max-prose { max-width: 68ch; }
