/*
 * Marketing site only. Loaded by layouts/marketing.html.haml and layouts/legal.html.haml
 * and nowhere else.
 *
 * Layout, rhythm and surface treatment only. Every color, font, space,
 * radius and shadow value comes from shared-styles/tokens.css: nothing
 * here defines or overrides a token. This file has no React twin and never
 * will, so it is exempt from the "document it in both style guides" rule.
 *
 * Copied from Cedarras's marketing.css and cut to what these pages use. Narrow
 * screens are the first-class case: a stranger usually sees the site on a phone.
 */


/* CED-111: one page frame. Two widths only (wide 1120px, reading 680px), one
 * type scale, one spacing scale (8px base: 4, 8, 12, 16, 24, 32, 48, 64, 96).
 * --m-max and --m-prose are the content widths. The wraps add the page
 * padding on top, so the text itself is 1120px / 680px wide. */
.m-nav,
.marketing,
.site-footer {
  --m-max: 70rem; /* wide: 1120px */
  --m-prose: 42.5rem; /* reading: 680px */
  --m-band-y: 6rem; /* section top and bottom: 96px */
  --m-space-9: 4rem; /* 64px */
  --m-space-10: 6rem; /* 96px */

  /* Type scale, desktop. Phones override it in the media query below. */
  --m-fs-display: 4.5rem; /* 72px, home hero */
  --m-fs-h1: 3.5rem; /* 56px, page heroes */
  --m-fs-h2: 2.5rem; /* 40px, section heads */
  --m-fs-h3: 1.25rem; /* 20px, card titles */
  --m-fs-lead: 1.25rem; /* 20px, hero paragraph */
  --m-fs-body: 1.0625rem; /* 17px */
  --m-fs-small: 0.875rem; /* 14px: captions, table cells, footer. Nothing a buyer must read goes below this. */
  --m-slate: #3d4440; /* body text a buyer must read (CED-112): slate, never light gray */
}

@media (max-width: 48rem) {
  .m-nav,
  .marketing,
  .site-footer {
    --m-band-y: 4rem; /* sections 64px on phones */
    --m-fs-display: 2.75rem; /* 44px */
    --m-fs-h1: 2.375rem; /* 38px */
    --m-fs-h2: 1.875rem; /* 30px */
    --m-fs-h3: 1.1875rem; /* 19px */
    --m-fs-lead: 1.125rem; /* 18px */
  }
}

.marketing {
  width: 100%;
  flex: 1;
  font-size: var(--m-fs-body);
  line-height: 1.6;
}

.site-footer {
  font-size: var(--m-fs-small);
  line-height: 1.5;
}

/* ---- Width ---- */

/* Wide: heroes, card grids, tables, product frames. */
.m-wrap {
  width: 100%;
  max-width: calc(var(--m-max) + var(--space-5) * 2);
  margin: 0 auto;
  padding-inline: var(--space-5);
}

/* Reading: running text. The column is centered on the page, heading
 * included, because the heading sits inside the same wrap. */
.m-wrap--prose {
  max-width: calc(var(--m-prose) + var(--space-5) * 2);
  margin-inline: auto;
}

@media (max-width: 30rem) {
  .m-wrap {
    padding-inline: var(--space-4);
  }
}

/* ---- Navigation ----
 * Sticky and translucent. Under 48rem it is one row (CED-111): mark and
 * wordmark on the left, the signup button, and one Menu button that opens the
 * page links in a panel under the header. The Menu is a visually hidden
 * checkbox plus its label, so it needs no JavaScript. */

.m-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--color-page-bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--color-border);
}

.m-nav__inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  max-width: calc(var(--m-max) + var(--space-5) * 2);
  margin: 0 auto;
  padding: var(--space-3) var(--space-5);
}

.m-nav__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  margin-right: auto;
  text-decoration: none;
  color: var(--color-primary-hover);
}

.m-nav__brand img {
  display: block;
  width: 2rem;
  height: 2rem;
}

.m-nav__wordmark {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--font-size-xl);
  letter-spacing: -0.01em;
  line-height: 1;
}

/* Desktop order: brand, links, signup button. The Menu toggle is phone-only. */
.m-nav__links {
  order: 1;
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.m-nav__cta {
  order: 2;
  white-space: nowrap;
}

.m-nav__toggle,
.m-nav__menu {
  display: none;
}

.m-nav__links a {
  text-decoration: none;
  font-weight: 500;
  color: var(--color-text-muted);
  padding-block: var(--space-1);
}

.m-nav__links a:hover,
.m-nav__links a[aria-current="page"] {
  color: var(--color-primary-hover);
}

.m-nav__links a[aria-current="page"] {
  box-shadow: inset 0 -2px 0 var(--color-primary);
}

@media (max-width: 48rem) {
  .m-nav__inner {
    padding-inline: var(--space-4);
    gap: var(--space-3);
  }
  .m-nav__wordmark {
    font-size: var(--font-size-lg);
  }
  .m-nav__cta {
    order: 1;
    padding-inline: var(--space-4);
  }

  /* The checkbox stays focusable but invisible; its label is the button. */
  .m-nav__toggle {
    display: block;
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
  }
  .m-nav__menu {
    order: 2;
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0 var(--space-4);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-default);
    background: var(--color-surface);
    color: var(--color-text);
    font-weight: 600;
    cursor: pointer;
  }
  .m-nav__toggle:focus-visible + .m-nav__menu {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
  }
  .m-nav__toggle:checked + .m-nav__menu {
    background: var(--color-primary-tint);
    border-color: var(--color-primary);
  }

  /* The page links drop into a panel under the one-row header. */
  .m-nav__links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-2) var(--space-4) var(--space-4);
    background: var(--color-page-bg);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
  }
  .m-nav__toggle:checked ~ .m-nav__links {
    display: flex;
  }
  .m-nav__links a {
    padding-block: var(--space-3);
    border-bottom: 1px solid var(--color-border);
  }
  .m-nav__links a:last-child {
    border-bottom: 0;
  }
  .m-nav__links a[aria-current="page"] {
    box-shadow: none;
    color: var(--color-primary-hover);
    font-weight: 700;
  }
}

/* ---- Bands ----
 * Every page is a stack of full-bleed bands; the wrap inside sets the
 * measure. Alternating surfaces give the page rhythm without rules. */

.m-band {
  padding-block: var(--m-band-y);
}

/* A page hero that is followed by another band (CED-111). The hero and the
 * band after it split one section gap between them: half each, so the two
 * paddings together are 96px on desktop and 64px on phones (the spacing rule).
 * The hero's last paragraph keeps no bottom margin of its own, or it would add
 * its 32px on top of that (About showed about 100px too much). */
.m-band--hero {
  padding-bottom: calc(var(--m-band-y) / 2);
}

.m-band--hero .m-wrap > :last-child {
  margin-bottom: 0;
}

.m-band--hero + .m-band {
  padding-top: calc(var(--m-band-y) / 2);
}

.m-band--surface {
  background: var(--color-surface);
  border-block: 1px solid var(--color-border);
}

.m-band--tint {
  background: linear-gradient(180deg, var(--color-primary-tint), var(--color-page-bg));
}

.m-band--dark {
  position: relative;
  overflow: hidden;
  background: var(--color-primary-hover);
  color: var(--color-surface);
}

.m-band--dark h2,
.m-band--dark h3 {
  color: var(--color-surface);
}

.m-band--dark p {
  color: color-mix(in srgb, var(--color-surface) 82%, transparent);
}

.m-band__head {
  max-width: var(--m-prose);
  margin-bottom: var(--space-6);
}

.m-band__head p {
  color: var(--color-text-muted);
  font-size: var(--m-fs-lead);
  line-height: 1.55;
  margin: 0;
}

.m-band--dark .m-band__head p {
  color: color-mix(in srgb, var(--color-surface) 82%, transparent);
}

/* ---- Type ---- */

.m-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--m-fs-small);
  line-height: 1.5;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-secondary);
  margin: 0 0 var(--space-4);
}

/* H1, page heroes: 56px / 1.1, phone 38px. */
.m-display {
  font-family: var(--font-heading);
  font-size: var(--m-fs-h1);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--color-primary-hover);
  margin: 0 0 var(--space-5);
  text-wrap: balance;
}

/* Display, the home hero only: 72px / 1.05, phone 44px. */
.m-hero .m-display {
  font-size: var(--m-fs-display);
  line-height: 1.05;
}

/* H2, section heads: 40px / 1.15, phone 30px. */
.m-title {
  font-size: var(--m-fs-h2);
  line-height: 1.15;
  margin: 0 0 var(--space-4);
  text-wrap: balance;
}

/* Lead, the hero paragraph: 20px / 1.55, phone 18px. */
.m-lede {
  font-size: var(--m-fs-lead);
  line-height: 1.55;
  color: var(--color-text-muted);
  max-width: var(--m-prose);
  margin: 0 0 var(--space-6);
}

.m-note {
  font-size: var(--m-fs-small);
  line-height: 1.5;
  color: var(--color-text-muted);
}

.marketing p {
  max-width: var(--m-prose);
}

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

.m-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(170deg, var(--color-primary-tint) 0%, var(--color-page-bg) 58%);
  padding-top: var(--space-8);
  padding-bottom: var(--m-band-y);
  text-align: center;
}

.m-hero .m-display {
  margin-inline: auto;
  max-width: 18ch;
}

.m-hero .m-lede {
  margin-inline: auto;
  text-align: center;
}

.m-hero .m-eyebrow {
  justify-content: center;
}

/* ---- Calls to action ---- */

.m-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
}

.m-hero .m-cta-row {
  justify-content: center;
}

/* Buttons are links here, so the inherited underline has to go everywhere,
 * not just inside a call-to-action row. */
a.btn {
  text-decoration: none;
}

.m-textlink {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  text-decoration: none;
}

.m-textlink:hover {
  text-decoration: underline;
}

.m-textlink::after {
  content: "\2192";
  transition: transform 0.15s ease;
}

.m-textlink:hover::after {
  transform: translateX(2px);
}

.m-band--dark .m-textlink {
  color: var(--color-surface);
}

.m-band--dark .btn--primary {
  background: var(--color-surface);
  color: var(--color-primary-hover);
}

.m-band--dark .btn--primary:hover:not(:disabled) {
  background: var(--color-primary-tint);
}

/* ---- Cards ---- */

.m-cards {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
}

.m-cards--two {
  grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr));
}

.m-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius-default) * 2);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}

.m-band--surface .m-card {
  background: var(--color-page-bg);
}

/* H3, card titles: 20px / 1.3, phone 19px. */
.m-card h3 {
  font-size: var(--m-fs-h3);
  line-height: 1.3;
  margin: 0 0 var(--space-2);
}

.m-card p {
  margin: 0 0 var(--space-3);
  color: var(--color-text-muted);
}

.m-card p:last-child {
  margin-bottom: 0;
}

.m-contact {
  display: inline-block;
  font-size: var(--font-size-lg);
  font-weight: 600;
}

/* ---- Motion ---- */

@media (prefers-reduced-motion: reduce) {
  .m-textlink::after {
    transition: none;
  }
}
