/* Conply marketing pages.
 *
 * Everything here is scoped to .mk and prefixed mk-, so the page carries its
 * own brand without touching the app theme (which is still on the old green)
 * and without colliding with the Tailwind component layer, where names like
 * .btn and .card are already taken.
 *
 * Loaded only by the pages that need it, via stylesheet_link_tag "marketing".
 */

.mk {
  --paper: #F4F5F8;
  --surface: #FFFFFF;
  --surface-2: #ECEFF5;
  --ink: #0B0E14;
  --muted: #5A6272;
  /* Brand hands us #838B99 here, which lands at 3.0:1 on the section
     backgrounds. This tier carries real copy — gate times, the trial note — so
     it is darkened to clear 4.5:1. Every other brand value is untouched. */
  --muted-2: #656D7B;
  --line: #DEE2EA;
  --accent: #0D4DBB;
  --accent-strong: #0A3B92;
  --accent-ink: #FFFFFF;
  --live-bg: #E7EEFB;
  --live-text: #0A3D96;
  --pending-bg: #FBF1E1;
  --pending-text: #8F5B12;
  --shadow: 0 1px 2px rgba(11, 14, 20, 0.06);
  --radius: 3px;

  --display: "Archivo", ui-sans-serif, system-ui, sans-serif;
  --body: "Public Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;
}

/* Signed-in users never reach the marketing page — /  routes them to the
   dashboard — so the theme class is only here for completeness; the media
   query is what anonymous visitors actually get. */
@media (prefers-color-scheme: dark) {
  .mk {
    --paper: #0A0D12;
    --surface: #12161D;
    --surface-2: #171C24;
    --ink: #EDF0F5;
    --muted: #98A1B0;
    --muted-2: #7D8593;
    --line: #232A35;
    --accent: #4C86EA;
    --accent-strong: #6B9CEF;
    --accent-ink: #06101F;
    --live-bg: #16233D;
    --live-text: #8FB3F5;
    --pending-bg: #2E2416;
    --pending-text: #EAB868;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  }
}

.dark .mk {
  --paper: #0A0D12;
  --surface: #12161D;
  --surface-2: #171C24;
  --ink: #EDF0F5;
  --muted: #98A1B0;
  --muted-2: #7D8593;
  --line: #232A35;
  --accent: #4C86EA;
  --accent-strong: #6B9CEF;
  --accent-ink: #06101F;
  --live-bg: #16233D;
  --live-text: #8FB3F5;
  --pending-bg: #2E2416;
  --pending-text: #EAB868;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.mk {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

/* The resets go through :where() so they carry no specificity: a component
   class below can set its own margin without having to out-specify them. */
.mk :where(h1, h2, h3) {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0;
}
.mk :where(p) { margin: 0; }
.mk :where(a) { color: inherit; }
/* The app stylesheet puts markers on list items; every list here is either
   navigation or a spec sheet, so none of them want bullets. */
.mk :where(ul, ol) { margin: 0; padding: 0; list-style: none; }

.mk a:focus-visible,
.mk button:focus-visible,
.mk summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Anchored sections must clear the sticky header. */
.mk [id] { scroll-margin-top: 84px; }

.mk-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px;
}

.mk-eyebrow {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.mk-mono { font-family: var(--mono); }

/* --- Header ------------------------------------------------------------- */

.mk-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.mk-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 24px;
}
/* The lockup partial sizes itself and its wordmark takes currentColor. */
.mk-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  color: var(--ink);
}

.mk-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
}
.mk-navlink {
  text-decoration: none;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 600;
}
.mk-navlink:hover { color: var(--ink); }
.mk-nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* --- Buttons ------------------------------------------------------------ */

.mk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--body);
  font-weight: 700;
  font-size: 14.5px;
  padding: 10px 18px;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.mk-btn--primary { background: var(--accent); color: var(--accent-ink); }
.mk-btn--primary:hover { background: var(--accent-strong); }
.mk-btn--ghost { color: var(--ink); border-color: var(--line); }
.mk-btn--ghost:hover { border-color: var(--muted); }
.mk-btn--lg { padding: 13px 24px; font-size: 15.5px; }

/* --- Hero --------------------------------------------------------------- */

.mk-hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
  padding: 72px 28px 68px;
}
.mk-hero h1 {
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.1;
  max-width: 14ch;
  margin-top: 14px;
}
.mk-lede {
  margin-top: 20px;
  color: var(--muted);
  font-size: 17px;
  max-width: 46ch;
}
.mk-hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 30px;
  flex-wrap: wrap;
}
.mk-note {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted-2);
}

@keyframes mk-rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .mk-hero-copy,
  .mk-board { animation: mk-rise 0.5s ease-out both; }
  .mk-board { animation-delay: 0.08s; }
}

/* --- Gate board (the hero's signature panel) ---------------------------- */

.mk-board {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.mk-board-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.mk-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--live-bg);
}
.mk-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pending-text);
  background: var(--pending-bg);
  padding: 2px 7px;
  border-radius: 2px;
}
.mk-board-head .mk-tag { margin-left: auto; }

.mk-board li {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: baseline;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.mk-t-time {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}
.mk-badge {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--live-text);
  background: var(--live-bg);
  padding: 2px 7px;
  border-radius: 2px;
}
.mk-badge--pending {
  color: var(--pending-text);
  background: var(--pending-bg);
}
.mk-board-foot {
  padding: 13px 16px;
  background: var(--pending-bg);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--pending-text);
}

/* --- Sections ----------------------------------------------------------- */

/* Only vertical padding here: the gutter belongs to .mk-wrap, which every
   section carries, so banded sections line up with the hero instead of
   inheriting a doubled inset. */
.mk-section { padding: 64px 0; }
.mk-band {
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.mk-section-head {
  max-width: 62ch;
  margin-bottom: 34px;
}
.mk-section-head h2 {
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.2;
  margin-top: 10px;
}

/* A hairline grid: the gap shows the container's background as the rule. */
.mk-grid {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.mk-grid > * { background: var(--surface); }

.mk-stats { grid-template-columns: repeat(3, 1fr); }
.mk-stat { padding: 30px 26px; }
.mk-stat-num {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(30px, 4vw, 42px);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.mk-stat-label {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.mk-records { grid-template-columns: repeat(4, 1fr); }
.mk-record {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mk-record-icon {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: var(--live-bg);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mk-record-icon svg { width: 18px; height: 18px; }
.mk-record-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 14.5px;
}

/* --- Product shot ------------------------------------------------------- */

.mk-shot {
  max-width: 980px;
  margin: 0 auto;
}
.mk-shot img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
}
.mk-shot figcaption {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted-2);
  font-size: 13px;
}

/* --- Capability roster -------------------------------------------------- */

.mk-roster {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.mk-roster-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}
.mk-roster-row:last-child { border-bottom: none; }
.mk-r-code {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.03em;
  padding-top: 3px;
}
.mk-r-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 6px;
}
.mk-r-desc {
  color: var(--muted);
  font-size: 14.5px;
  max-width: 58ch;
}
.mk-r-note {
  color: var(--muted-2);
  font-size: 13px;
  margin-top: 6px;
}

/* --- Two apps ----------------------------------------------------------- */

.mk-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.mk-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}
.mk-card .mk-eyebrow { color: var(--accent); }
.mk-card h3 { font-size: 18px; margin: 10px 0; }
.mk-steps { margin-top: 18px; }
.mk-steps li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  font-size: 14.5px;
  color: var(--muted);
}
.mk-steps li b {
  color: var(--ink);
  font-weight: 600;
}
.mk-steps li > span:first-child {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}

/* --- Integrations ------------------------------------------------------- */

.mk-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.mk-chip {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 14px;
}
.mk-chip--accent {
  color: var(--live-text);
  background: var(--live-bg);
  border-color: transparent;
  font-weight: 600;
}
.mk-offline {
  margin-top: 22px;
  color: var(--muted-2);
  font-size: 14px;
  max-width: 60ch;
}

/* --- Closing CTA -------------------------------------------------------- */

.mk-cta {
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.mk-cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.mk-cta-inner h2 {
  font-size: clamp(24px, 3vw, 34px);
  max-width: 20ch;
}
.mk-cta-side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.mk-cta-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* --- Footer ------------------------------------------------------------- */

.mk-footer { padding: 40px 28px 56px; }
.mk-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}
.mk-footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.mk-footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
}
.mk-footer-links a:hover { color: var(--ink); }
.mk-footer-fine {
  color: var(--muted-2);
  font-size: 13px;
  max-width: 60ch;
  margin-top: 18px;
}
.mk-footer-fine a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.mk-footer-fine a:hover { color: var(--ink); }
.mk-colophon {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted-2);
}

/* --- Narrow ------------------------------------------------------------- */

@media (max-width: 860px) {
  .mk-hero { grid-template-columns: 1fr; padding-top: 44px; }
  .mk-stats { grid-template-columns: 1fr; }
  .mk-records { grid-template-columns: repeat(2, 1fr); }
  .mk-roster-row { grid-template-columns: 1fr; gap: 6px; }
  .mk-split { grid-template-columns: 1fr; }
  .mk-cta-inner { flex-direction: column; align-items: flex-start; }
  /* The section anchors go; sign in and the trial stay, because a phone is
     where most of this page gets read. */
  .mk-nav { gap: 18px; }
  .mk-nav .mk-navlink[href^="#"] { display: none; }
}

/* A phone still has to fit the wordmark, sign in and the trial button on one
   row, so the gutters and the header tighten up rather than the page growing
   a sideways scrollbar. */
@media (max-width: 560px) {
  .mk-wrap,
  .mk-hero,
  .mk-footer {
    padding-left: 20px;
    padding-right: 20px;
  }
  .mk-topbar-inner { gap: 12px; }
  .mk-nav { gap: 14px; }
  .mk-nav-actions { gap: 12px; }
  .mk-nav .mk-btn { padding: 9px 12px; font-size: 13.5px; }
  .mk-cta-buttons { width: 100%; }
  .mk-cta-buttons .mk-btn { flex: 1 1 auto; }
}
