/*
 * Scrip design system.
 *
 * Adapted from the antseed.com reference: warm cream ground, near-black forest
 * ink, emerald brand, fully-rounded geometry, soft low-contrast shadows.
 *
 * Deliberately light-only. The reference commits to a single look and the
 * warm ground is load-bearing - a dark inversion would lose the thing that
 * makes it distinctive. Every colour is set explicitly so nothing inherits a
 * host background.
 */

:root {
  /* Ground and surfaces */
  --bg: #f6f4ec;
  --surface: #ffffff;
  --surface-sunken: #efece1;

  /* Ink */
  --ink: #072a1a;
  --ink-muted: #4a6659;
  --ink-faint: #86998f;

  /* Brand */
  --brand: #0fa968;
  --brand-bright: #34e29b;
  --brand-deep: #0b7a4b;

  /* Lines and depth */
  --border: rgba(7, 42, 26, 0.1);
  --border-strong: rgba(7, 42, 26, 0.16);
  --dot: rgba(7, 42, 26, 0.08);

  --shadow-card: 0 1px 2px rgba(7, 42, 26, 0.04),
    0 12px 32px rgba(7, 42, 26, 0.07);
  --shadow-float: 0 2px 6px rgba(7, 42, 26, 0.06),
    0 18px 44px rgba(7, 42, 26, 0.12);

  /* Geometry */
  --r-pill: 999px;
  --r-card: 28px;
  --r-inner: 18px;

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  --measure: 1120px;
}

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

body {
  margin: 0;
  background-color: var(--bg);
  /* The dot grid from the reference. Two layers so it fades toward the middle
     rather than tiling flatly across the fold. */
  background-image: radial-gradient(var(--dot) 1.5px, transparent 1.5px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.shell {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Floating pill nav ---------- */

.nav-wrap {
  position: relative;
  z-index: 40;
  padding-top: 18px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border-radius: var(--r-pill);
  padding: 12px 18px;
  box-shadow: var(--shadow-card);
}

/* Hamburger. Three bars that cross into an X when open, as in the reference. */
.nav-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 8px;
  margin: -8px;
  cursor: pointer;
  color: var(--ink);
  display: grid;
  gap: 6px;
  border-radius: 12px;
}

.nav-toggle span {
  display: block;
  width: 27px;
  height: 3px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.22s ease, opacity 0.16s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

.nav-toggle:focus-visible,
.nav-mark:focus-visible,
.menu a:focus-visible,
.nav-links a:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
}

.nav-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 19px;
  color: var(--ink);
  text-decoration: none;
}

.nav-links {
  margin-left: auto;
  display: none;
  gap: 26px;
  font-size: 15px;
  font-weight: 500;
  align-items: center;
}

.nav-links a {
  color: var(--ink-muted);
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--brand-deep);
}

.nav-cta {
  background: var(--ink);
  color: var(--surface) !important;
  padding: 10px 20px;
  border-radius: var(--r-pill);
  font-weight: 600;
}

.nav-cta:hover {
  background: #0b3b26;
}

@media (min-width: 800px) {
  .nav-links {
    display: flex;
  }
}

/* ---------- Menu panel ---------- */

.menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-float);
  padding: 12px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.menu a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--r-inner);
  color: var(--ink);
  text-decoration: none;
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.menu a:hover {
  background: var(--surface-sunken);
}

.menu a .hint {
  margin-left: auto;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-faint);
}

.menu-sep {
  height: 1px;
  background: var(--border);
  margin: 8px 14px;
}

.menu .menu-cta {
  background: var(--ink);
  color: var(--surface);
  justify-content: center;
  margin-top: 4px;
}

.menu .menu-cta:hover {
  background: #0b3b26;
}

.menu-scrim {
  position: fixed;
  inset: 0;
  background: rgba(7, 42, 26, 0.28);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s;
  z-index: 30;
}

.menu-scrim.is-open {
  opacity: 1;
  visibility: visible;
}

body.menu-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .menu,
  .menu-scrim,
  .nav-toggle span {
    transition: none;
  }
}

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

.hero {
  text-align: center;
  padding: 76px 0 0;
}

.hero h1 {
  font-size: clamp(2.6rem, 8.5vw, 5.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.98;
  margin: 0;
  text-wrap: balance;
}

.hero .sub {
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  color: var(--ink);
  font-weight: 400;
  margin: 20px 0 0;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--ink);
  color: var(--surface);
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: none;
  padding: 20px 38px;
  border-radius: var(--r-pill);
  margin-top: 38px;
  box-shadow: var(--shadow-card);
}

.cta:hover {
  background: #0b3b26;
}

.hero .note {
  color: var(--ink-muted);
  margin: 20px 0 0;
}

/* ---------- The demo card ---------- */

.demo {
  background: var(--surface-sunken);
  border-radius: var(--r-card);
  padding: 14px;
  margin: 56px auto 0;
  max-width: 720px;
  box-shadow: var(--shadow-card);
  position: relative;
}

.status-panel {
  background: linear-gradient(135deg, var(--brand-deep), var(--brand-bright));
  border-radius: 22px;
  height: 190px;
  display: grid;
  place-items: center;
}

.power {
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: var(--surface);
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.28),
    0 10px 30px rgba(7, 42, 26, 0.2);
  color: var(--brand);
}

.routing {
  display: flex;
  gap: 16px;
  background: var(--surface);
  border: 2px solid var(--brand-bright);
  border-radius: var(--r-inner);
  padding: 16px 20px;
  margin-top: -26px;
  position: relative;
  box-shadow: var(--shadow-card);
}

.routing .field {
  flex: 1;
}

.routing .label {
  font-size: 0.85rem;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.routing .value {
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dot-live {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand);
  flex: none;
}

/* Floating quote card - the one element that overlaps its container in the
   reference, which is what gives the composition depth. */
/*
 * Spans the panel, like the routing bar above it and the rows below. It used to
 * sit at 92% with an auto left margin, which left one element inset on one side
 * inside a panel where every other edge lines up - it read as a mistake rather
 * than as emphasis. The text stays right-aligned: the amount is a total, and
 * totals belong on the right.
 */
.quote {
  background: var(--surface);
  border-radius: var(--r-inner);
  padding: 18px 24px;
  box-shadow: var(--shadow-float);
  margin: 22px 0 0;
  text-align: right;
}

.quote .line {
  font-size: 1.05rem;
}

.quote .strike {
  color: var(--ink-faint);
  text-decoration: line-through;
}

.quote .headline {
  color: var(--brand);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  margin-top: 4px;
}

/* ---------- Client rows ---------- */

.clients {
  padding: 22px 10px 6px;
}

.client {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 12px;
  font-weight: 500;
}

.client + .client {
  border-top: 1px solid var(--border);
}

.client .connect {
  margin-left: auto;
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}

.more {
  display: block;
  text-align: center;
  color: var(--brand);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
  padding: 16px 0 8px;
}

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

.footer {
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.95rem;
  padding: 70px 0 50px;
}

.footer a {
  color: var(--brand-deep);
}

/* ---------- Docs ---------- */

.doc {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 0 0;
}

.doc h1 {
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 0 0 10px;
}

.doc h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 52px 0 14px;
}

.doc .lede {
  font-size: 1.2rem;
  color: var(--ink-muted);
  margin: 0 0 8px;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--r-inner);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  margin: 18px 0;
  font-size: 0.98rem;
}

.doc th,
.doc td {
  text-align: left;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
}

.doc th {
  background: var(--surface-sunken);
  font-weight: 600;
}

.doc tr:last-child td {
  border-bottom: none;
}

.doc pre {
  background: var(--ink);
  color: #d6f5e6;
  border-radius: var(--r-inner);
  padding: 20px 22px;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.55;
  box-shadow: var(--shadow-card);
}

.doc code {
  font-size: 0.92em;
}

.doc p code,
.doc li code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
}

.doc a {
  color: var(--brand-deep);
}

/* Addresses.
   A 42-character hex string has no break opportunity, so in a table cell it
   sets the column width and pushes the whole page wider than the viewport.
   Stacking label over value lets the address wrap instead. */

.addr {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.addr-row {
  background: var(--surface);
  border-radius: var(--r-inner);
  padding: 14px 18px;
  box-shadow: var(--shadow-card);
}

.addr-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 5px;
}

.addr-value {
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--brand-deep);
  text-decoration: none;
  word-break: break-all;
}

a.addr-value:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.addr-value.muted {
  color: var(--ink-faint);
  font-family: var(--font);
  word-break: normal;
}

/* Any remaining table stays inside its own scroller rather than widening the
   page - the body must never scroll sideways. */
.table-wrap {
  overflow-x: auto;
  margin: 18px 0;
}

.table-wrap table {
  margin: 0;
}

.pill {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: var(--r-pill);
  padding: 4px 12px;
  background: var(--brand);
  color: #fff;
}

.pill.pending {
  background: var(--surface-sunken);
  color: var(--ink-muted);
}

/* ---------- Current page in the nav ---------- */

.nav-links a[aria-current="page"] {
  color: var(--ink);
  font-weight: 700;
}

.menu a[aria-current="page"] {
  background: var(--surface-sunken);
}

/* ---------- Sub-page header ---------- */

.page-head {
  max-width: 760px;
  margin: 0 auto;
  padding: 60px 0 0;
  text-align: center;
}

.page-head .eyebrow {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-deep);
  margin: 0 0 14px;
}

/* h2 as well as h1: a section heading on a page that already has an h1 must
   not claim a second one just to get the size. */
.page-head h1,
.page-head h2 {
  font-size: clamp(2.1rem, 6vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.02;
  margin: 0;
  text-wrap: balance;
}

.page-head .lede {
  font-size: 1.15rem;
  color: var(--ink-muted);
  margin: 18px 0 0;
  text-wrap: pretty;
}

/* ---------- Card grid ---------- */

.cards {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin: 22px 0;
}

.card {
  background: var(--surface);
  border-radius: var(--r-card);
  padding: 26px 26px 28px;
  box-shadow: var(--shadow-card);
}

.card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.card p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.98rem;
}

.card .card-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--surface-sunken);
  color: var(--brand-deep);
  margin-bottom: 16px;
  font-weight: 800;
}

/* ---------- Stat tiles ---------- */

.stats {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin: 26px 0;
}

.stat {
  background: var(--surface);
  border-radius: var(--r-inner);
  padding: 20px 22px;
  box-shadow: var(--shadow-card);
}

.stat .stat-value {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.1;
}

.stat .stat-label {
  font-size: 0.86rem;
  color: var(--ink-muted);
  margin-top: 6px;
}

/* ---------- Numbered steps ---------- */

.steps {
  display: grid;
  gap: 14px;
  margin: 22px 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  background: var(--surface);
  border-radius: var(--r-inner);
  padding: 20px 24px 20px 66px;
  box-shadow: var(--shadow-card);
  position: relative;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 20px;
  top: 20px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  font-size: 0.92rem;
  display: grid;
  place-items: center;
}

.steps h3 {
  margin: 0 0 5px;
  font-size: 1.05rem;
  font-weight: 700;
}

.steps p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.98rem;
}

/* ---------- Callout ---------- */

.callout {
  background: var(--surface);
  border-left: 4px solid var(--brand);
  border-radius: var(--r-inner);
  padding: 18px 22px;
  margin: 22px 0;
  box-shadow: var(--shadow-card);
}

.callout p {
  margin: 0;
}

.callout p + p {
  margin-top: 10px;
}

.callout.warn {
  border-left-color: #c98a1b;
}

.callout .callout-title {
  font-weight: 700;
  display: block;
  margin-bottom: 6px;
}

/* ---------- Two-column compare (permit vs intent) ---------- */

.compare {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  margin: 22px 0;
}

.compare .side {
  background: var(--surface);
  border-radius: var(--r-inner);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
}

.compare .side h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.compare .side .who {
  font-size: 0.82rem;
  color: var(--ink-faint);
  font-family: var(--mono);
  margin-bottom: 12px;
}

.compare .side ul {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

/* ---------- Flow diagram ---------- */

.flow {
  background: var(--surface);
  border-radius: var(--r-card);
  padding: 26px 22px;
  box-shadow: var(--shadow-card);
  margin: 22px 0;
  overflow-x: auto;
}

.flow svg {
  display: block;
  min-width: 560px;
  width: 100%;
  height: auto;
}

/* ---------- Verified check list ---------- */

.checks {
  list-style: none;
  margin: 22px 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.checks li {
  background: var(--surface);
  border-radius: var(--r-inner);
  padding: 15px 18px 15px 50px;
  box-shadow: var(--shadow-card);
  position: relative;
  font-size: 0.98rem;
}

.checks li::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 17px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brand);
  /* A tick drawn with two borders, so the list needs no icon font. */
  box-shadow: inset 0 0 0 2px var(--brand);
}

.checks li::after {
  content: "";
  position: absolute;
  left: 23px;
  top: 22px;
  width: 8px;
  height: 4px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
}

/* ---------- Site footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 80px;
  padding: 44px 0 56px;
}

.footer-cols {
  display: grid;
  gap: 30px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.footer-col h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  margin: 0 0 12px;
  font-weight: 700;
}

.footer-col a {
  display: block;
  color: var(--ink-muted);
  text-decoration: none;
  padding: 5px 0;
  font-size: 0.96rem;
}

.footer-col a:hover {
  color: var(--brand-deep);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.footer-note {
  color: var(--ink-faint);
  font-size: 0.88rem;
  margin: 34px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.footer-note a {
  color: var(--brand-deep);
}

@media (max-width: 620px) {
  .nav-links {
    display: none;
  }
  .routing {
    flex-direction: column;
    gap: 12px;
  }

  /*
   * Two columns of prose do not fit on a phone. Left as a table it either
   * scrolls sideways - which hides the half that says whether a thing works - or
   * squeezes both columns into a few words per line.
   *
   * So each row becomes a block: what the piece is, then its state underneath.
   * The header row is dropped rather than repeated, because "Piece" and "State"
   * only earn their space when the columns are side by side, and stacked rows
   * are self-describing.
   */
  .table-wrap {
    overflow-x: visible;
  }

  .doc table,
  .doc tbody,
  .doc tr,
  .doc td {
    display: block;
    width: 100%;
  }

  .doc thead {
    display: none;
  }

  .doc tr {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
  }

  .doc tr:last-child {
    border-bottom: none;
  }

  .doc td {
    padding: 0;
    border-bottom: none;
  }

  /* The name of the thing, then a gap, then its state. */
  .doc td:first-child {
    font-weight: 600;
    margin-bottom: 9px;
  }

  /* A pill sized to its text wraps mid-phrase at this width; let it use the
     row and keep the words together. */
  .pill {
    font-size: 0.78rem;
    line-height: 1.45;
  }

  .steps li {
    padding: 56px 20px 20px;
  }
}

/*
 * A card heading can be a link (the 404 page uses them as its index). Without
 * this it renders as default browser blue and underlined, which is the one
 * thing on the site that would not look designed.
 */
.card h3 a {
  color: inherit;
  text-decoration: none;
}

.card h3 a:hover {
  color: var(--brand-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/*
 * The routing panel can carry a link (the live facilitator endpoint). Same
 * reason as .card h3 a: unstyled it renders browser-blue and underlined, which
 * is the one thing on the page that would not look designed.
 */
.routing .value a {
  color: var(--brand-deep);
  text-decoration: none;
  border-bottom: 2px solid var(--brand-bright);
  padding-bottom: 1px;
}

.routing .value a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* ---------- Accessibility ---------- */

/*
 * A keyboard reader arriving on any page lands on the menu button and then has
 * to tab through the whole nav before reaching the text. This gives them one
 * key to skip it. It is offscreen until focused, not display:none - hidden
 * elements are not focusable, which would defeat the point.
 */
.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 60;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  padding: 12px 22px;
  font-weight: 650;
  text-decoration: none;
  box-shadow: var(--shadow-float);
  transition: top 0.16s ease;
}

.skip-link:focus {
  top: 16px;
}

/*
 * The nav already had focus rings; everything else did not, so tabbing through
 * the body of a page showed the browser default or nothing at all. One rule for
 * every interactive element, using :focus-visible so a mouse click does not
 * leave a ring behind.
 */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .skip-link {
    transition: none;
  }
}
