/* Shared styles for every page. Styles used by only one page live in that page. */
:root {
  color-scheme: light dark;
  --bg: light-dark(#FEFEFD, #121412);
  --surface: light-dark(#FFFFFF, #1A1D19);
  --surface-2: light-dark(#F5F6F2, #22261F);
  --border: light-dark(#E1E3DA, #2E332B);
  --border-strong: light-dark(#CACDC2, #414738);
  --text: light-dark(#1F211E, #E9EBE6);
  --text-muted: light-dark(#5C6159, #A0A69B);
  --text-faint: light-dark(#868C82, #6E756A);
  --accent: light-dark(#2CA85F, #56D188);
  --accent-fill: light-dark(#2CA85F, #56D188);
  --accent-hover: light-dark(#4CBA80, #6FDD9B);
  --accent-text: light-dark(#1B7A44, #56D188);
  --accent-soft: light-dark(#E4F4EA, #1B2C22);
  --on-accent: #0E1A12;
  --focus: light-dark(#2CA85F, #56D188);
  /* WhatsApp brand green. As text it is slightly deeper on light backgrounds so it stays legible. */
  --wa-brand: #25D366;
  --wa-brand-hover: #4ADE85;
  --wa-brand-text: light-dark(#1DAA61, #25D366);

  --success: light-dark(#2CA85F, #56D188);
  --success-text: light-dark(#1B7A44, #56D188);
  --success-soft: light-dark(#E4F4EA, #1B2C22);
  --success-border: light-dark(#B9E2CB, #2C4735);
  --warning: light-dark(#C87A0A, #E8A33C);
  --warning-text: light-dark(#8F5806, #EDB65C);
  --warning-soft: light-dark(#FBF1DC, #2E2310);
  --warning-border: light-dark(#EDD7A8, #4A3818);
  --info: light-dark(#1A71D7, #79ADF4);
  --info-text: light-dark(#196DD0, #79ADF4);
  --info-soft: light-dark(#EDF5FF, #142338);
  --info-border: light-dark(#C2DBFE, #203C62);
  --on-info: light-dark(#F9FCFF, #0B1421);
  --neutral: light-dark(#6E756A, #8A9184);
  --neutral-text: light-dark(#5C6159, #A0A69B);
  --neutral-soft: light-dark(#F5F6F2, #22261F);
  --neutral-border: light-dark(#DCDFD4, #333930);

  /* The closing panel is a deep fern inverse surface built from the Fern ramp, the same in both themes. */
  --fern-100: #D2EEDE;
  --fern-200: #A3DDBD;
  --fern-800: #14512D;
  --fern-bright: #56D188;
  --fern-bright-hover: #6FDD9B;
  --on-forest: #FEFEFD;

  /* A drawn dash pattern, because CSS dashed borders give no control over the spacing. */
  --dashed-rule: repeating-linear-gradient(to right, var(--border-strong) 0 4px, transparent 4px 10px);

  --col: 1080px;
  /* A whole number of pixels, so the header's lines never fall between pixels. */
  --nav-height: 66px;
  /* The nav plus the header's top and bottom lines. The page script keeps it in step with the real header. */
  --header-height: 68px;
  --gutter-left: max(16px, env(safe-area-inset-left, 0px));
  --gutter-right: max(16px, env(safe-area-inset-right, 0px));
  --font-display: "Outfit", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html {
  /*
   * In-page links stop below the sticky header instead of underneath it. The section's top line tucks under the
   * header's bottom line, so the two read as one rail. The extra half pixel absorbs the rounding of the scroll
   * position, which would otherwise leave the section's line peeking out below the header's.
   */
  scroll-padding-top: calc(var(--header-height) - 1.5px);
  /* Space for the scrollbar is always kept, so the column rails sit in the same place on short and long pages. */
  scrollbar-gutter: stable;
}
/* The body fills at least the viewport so the footer sits at the bottom of short pages. */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--font-body);
  padding-left: var(--gutter-left);
  padding-right: var(--gutter-right);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent-soft); color: var(--text); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Each band spans the full viewport so its top rule crosses the column rails. */
.band {
  margin-left: calc(-1 * var(--gutter-left));
  margin-right: calc(-1 * var(--gutter-right));
  padding-left: var(--gutter-left);
  padding-right: var(--gutter-right);
  border-top: 1px solid var(--border);
}
.col {
  position: relative;
  max-width: var(--col);
  margin-inline: auto;
  border-inline: 1px solid var(--border);
}
/* A band that stretches to take up the spare height, so the column rails run down to the footer. */
.band.fill { flex: 1; display: flex; flex-direction: column; }
.band.fill > .col { flex: 1; width: 100%; }

/* A short tick at each rail crossing, drawn at the same -45 degree angle as the cut through the mark. */
.band .col::before, .band .col::after {
  content: "";
  position: absolute;
  top: -6px;
  width: 1.5px;
  height: 12px;
  background: var(--accent);
  transform: rotate(45deg);
}
.band .col::before { left: -1.5px; }
.band .col::after { right: -1.5px; }
.site-header .col::before, .site-header .col::after { top: auto; bottom: -6.5px; }
.band.after-header { border-top: 0; }
.band.after-header .col::before, .band.after-header .col::after { display: none; }

.pad { padding: clamp(40px, 7vw, 88px) clamp(20px, 5vw, 56px); }

.mono-label {
  font: 500 .75rem/1.4 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.lede { margin: 0; font-size: clamp(1.125rem, 2vw, 1.25rem); color: var(--text-muted); max-width: 46ch; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.wa-brand { color: var(--wa-brand-text); font-weight: 600; }

/* A small label for something that is not available yet, shown next to a heading. */
.badge {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  font: 500 .6875rem/1.3 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  vertical-align: middle;
  background: var(--accent-soft);
  color: var(--accent-text);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--bg);
  /* A line along the top edge too. It mostly sits at the screen's edge, and shows where the browser draws past it. */
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--nav-height);
  padding: 0 clamp(20px, 5vw, 56px);
}
/* The wordmark pushes everything else to the right, so the call to action always sits at the far right. */
.wordmark-link { display: block; margin-right: auto; }
.wordmark { display: block; height: 26px; width: auto; }
/*
 * The wordmark comes as one image per theme, and the page's theme picks which shows. A media query inside an SVG loaded
 * as an image follows the device setting rather than the theme switch, so a single adaptive file showed the wrong
 * colours whenever the two disagreed. Without the theme attribute (scripts off) the device setting decides.
 */
:root[data-theme="dark"] .wordmark-on-light,
:root[data-theme="light"] .wordmark-on-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .wordmark-on-light { display: none; }
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .wordmark-on-dark { display: none; }
}
/* On wide screens the menu panel dissolves into the nav row, and the buttons are ordered after the theme switch. */
.nav-menu { display: contents; }
.nav-actions, .nav > .btn-wa, .menu-toggle { order: 1; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: .9375rem;
}
.nav-links a:not(.btn) { text-decoration: none; color: var(--text-muted); }
.nav-links a:not(.btn):hover, .nav-links a[aria-current="page"] { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
/* A copy of the call to action that only shows inside the mobile menu. */
.nav-actions .menu-cta { display: none; }

/* The theme switch stays in the nav row at every width. */
.theme-row { display: flex; align-items: center; }
.theme-toggle {
  position: relative;
  display: block;
  flex: none;
  width: 38px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 150ms, transform 120ms ease-out;
}
/* The hit area reaches 44px tall while the visible switch stays compact. */
.theme-toggle::before { content: ""; position: absolute; inset: -11px -4px; }
.theme-toggle:hover { border-color: var(--text-faint); }
.theme-toggle:focus-visible { border-radius: 999px; }
/* The thumb shows the icon of the active theme and slides right for dark mode. */
.theme-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgb(0 0 0 / .18);
  transition: translate 200ms ease-out, background-color 150ms;
}
.theme-toggle-thumb svg { grid-area: 1 / 1; width: 11px; height: 11px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle-thumb { translate: 16px 0; background: var(--border-strong); }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }

.menu-toggle {
  position: relative;
  display: none;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 150ms, border-color 150ms, transform 120ms ease-out;
}
/* The hit area reaches 44px square while the visible button stays compact. */
.menu-toggle::before { content: ""; position: absolute; inset: -5px; }
.menu-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.menu-toggle svg { grid-area: 1 / 1; width: 18px; height: 18px; }
.menu-toggle .icon-close, .nav.is-open .menu-toggle .icon-menu { display: none; }
.nav.is-open .menu-toggle .icon-close { display: block; }

/* On narrow screens the links and buttons fold into a panel that drops down between the column rails. */
@media (max-width: 760px) {
  .nav { gap: 12px; }
  .menu-toggle { display: inline-grid; }
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 4px clamp(20px, 5vw, 56px) 16px;
    background: var(--bg);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 32px -8px rgb(0 0 0 / .22), 0 2px 6px rgb(0 0 0 / .08);
  }
  .nav.is-open .nav-menu { display: flex; }
  .nav-links { flex-direction: column; align-items: stretch; gap: 0; font-size: 1.0625rem; }
  .nav-links a:not(.btn) { display: block; padding: 12px 0; }
  .nav-links li + li { background: var(--dashed-rule) top / 100% 1px no-repeat; }
  /* The menu carries the call to action, so the header copy is hidden whenever the menu button shows. */
  .nav > .btn-wa { display: none; }
  .nav-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
  .nav-actions .btn { padding: 10px 12px; font-size: .9375rem; }
  .nav-actions .menu-cta { display: flex; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font: 600 .9375rem/1.2 var(--font-body);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 150ms, border-color 150ms, transform 120ms ease-out;
  white-space: nowrap;
}
.btn-primary { background: var(--accent-fill); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { border-color: var(--border-strong); color: var(--text); background: var(--surface); }
.btn-secondary:hover { border-color: var(--text-faint); }
.btn-sm { padding: 7px 14px; font-size: .875rem; }
.btn-wa { background: var(--wa-brand); color: var(--on-accent); }
.btn-wa:hover { background: var(--wa-brand-hover); }
/* Nudged up slightly so the icon lines up with the capitals rather than the line box, which includes descender space. */
.btn-icon { display: block; width: 1.15em; height: 1.15em; flex: none; translate: 0 -.06em; }

/* Page head on the secondary pages */
.page-head { display: grid; gap: 20px; margin-bottom: clamp(32px, 5vw, 56px); }
.page-head .mono-label { color: var(--accent-text); }
.page-head h1 {
  font: 700 clamp(2.5rem, 6vw, 4rem)/1.04 var(--font-display);
  letter-spacing: -0.035em;
  margin: 0;
  text-wrap: balance;
  max-width: 14ch;
}

.notice {
  margin: 0 0 clamp(32px, 5vw, 48px);
  padding: 12px 16px;
  border: 1px solid var(--warning-border);
  border-radius: 8px;
  background: var(--warning-soft);
  color: var(--warning-text);
  font-size: .9375rem;
  max-width: 68ch;
}

/* Long-form legal text */
.prose { max-width: 68ch; }
.prose section { padding-block: 28px; border-top: 1px dashed var(--border-strong); }
.prose section:first-child { border-top: 0; padding-top: 0; }
.prose h2 { font: 600 1.375rem/1.3 var(--font-display); margin: 0 0 10px; letter-spacing: -0.01em; }
.prose p, .prose ul { margin: 0 0 12px; color: var(--text-muted); }
.prose section > :last-child { margin-bottom: 0; }

/* Pricing: hairlines between cards come from the grid gap showing the border colour through. */
.plans {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.plan {
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 16px;
  padding: 28px 24px;
  background: var(--bg);
}
.plan-featured { background: var(--surface); }
.plan h3 { font: 600 1.25rem/1.25 var(--font-display); margin: 0; letter-spacing: -0.01em; }
.plan .price { margin: 0; font: 700 2.25rem/1 var(--font-display); letter-spacing: -0.03em; color: var(--text); }
.plan .price small { font: 400 .9375rem var(--font-body); color: var(--text-muted); letter-spacing: 0; }
.plan p { margin: 0; color: var(--text-muted); font-size: 1rem; }
.plan p strong { color: var(--text); font-weight: 600; }
.saving {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--info);
  color: var(--on-info);
  font-weight: 700;
  font-size: .875em;
  line-height: 1.5;
  white-space: nowrap;
}
.plan ul {
  list-style: none;
  margin: 0;
  padding: 16px 0 0;
  display: grid;
  gap: 8px;
  align-content: start;
  font-size: .9375rem;
  background: var(--dashed-rule) top / 100% 1px no-repeat;
}
.plan li { display: flex; gap: 10px; }
.plan li::before { content: "+"; font-family: var(--font-mono); color: var(--accent-text); }
@media (max-width: 1000px) { .plans { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .plans { grid-template-columns: 1fr; } }

/* Footer */
/* A line along the bottom edge too, like the header's top one, for where the browser draws past the page's end. */
.site-footer { border-bottom: 1px solid var(--border); }
.footer { display: grid; gap: 28px; padding: 40px clamp(20px, 5vw, 56px) 48px; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; }
.footer-row + .footer-row { padding-top: 24px; background: var(--dashed-rule) top / 100% 1px no-repeat; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: .875rem;
}
.footer-links a { text-decoration: none; color: var(--text-muted); }
.footer-links a:hover, .footer-links a[aria-current="page"] { color: var(--text); }
.footer small { font: 400 .75rem var(--font-mono); color: var(--text-muted); }
.footer .wordmark { height: 20px; }
.follow { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.follow-links { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.follow-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  color: var(--text-muted);
  transition: color 150ms, border-color 150ms, transform 120ms ease-out;
}
.follow-link:hover { color: var(--text); border-color: var(--border-strong); }
.follow-link svg { width: 16px; height: 16px; flex: none; fill: currentColor; }

/* Buttons press in slightly while held down. */
.btn:active, .theme-toggle:active, .menu-toggle:active, .follow-link:active {
  transform: scale(.96);
  transition-duration: 60ms;
}
@media (prefers-reduced-motion: reduce) {
  .btn:active, .theme-toggle:active, .menu-toggle:active, .follow-link:active { transform: none; }
  .theme-toggle-thumb { transition: none; }
}
