/* Crusader Consulting — site styles.
   Layout: one 1120px column under a header that stays in view; the hero pairs the copy
   with a short at-a-glance ledger; sections below are left-aligned ledgers and tables,
   not card grids. The service-area chart has its own page (service-area.html).
   Palette is taken from nautical charts: chart ink, chart magenta for the one thing that
   matters (the service ring and the primary action), shoal blue and land buff on the map. */

/* Self-hosted fonts (SIL Open Font License; see assets/fonts/OFL-*.txt). */
@font-face {
  font-family: "Public Sans";
  src: url("fonts/public-sans-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Crimson Pro";
  src: url("fonts/crimson-pro-latin-500-italic.woff2") format("woff2");
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Crimson Pro";
  src: url("fonts/crimson-pro-latin-600-italic.woff2") format("woff2");
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}

:root {
  --paper: #fbfcfd;
  --ink: #14233a;
  --ink-soft: #4a5d73;
  --rule: #c9d5e1;
  --band: #eef4f9;
  --magenta: #a8146a;
  --magenta-ink: #ffffff;
  --link: #1f5a8c;
  --focus: #1f5a8c;
  --error: #b3261e;
  --ok: #1d6b45;

  --land: #f1e6c4;
  --land-grid: #e2d4a8;
  --water: #cfe3f2;
  --water-edge: #7fa9cc;
  --map-ink: #2c3b4e;
  --map-quiet: #4f5e6e;
  --map-water-label: #2f5f88;
  --logo-filter: none;

  --font-text: "Public Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-chart: "Crimson Pro", Georgia, "Times New Roman", serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.625rem;
  --step-3: 2.25rem;
  --step-4: clamp(2.5rem, 5.2vw, 4rem);

  --measure: 64ch;
  --header-h: 78px;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d1828;
    --ink: #e4ecf5;
    --ink-soft: #a3b4c7;
    --rule: #2b3e57;
    --band: #12223a;
    --magenta: #ef5fab;
    --magenta-ink: #1a0712;
    --link: #8cc2f0;
    --focus: #8cc2f0;
    --error: #ff8a80;
    --ok: #7fd3a3;
    --land: #182a40;
    --land-grid: #22385299;
    --water: #24486b;
    --water-edge: #4c7aa3;
    --map-ink: #d3dfeb;
    --map-quiet: #8ea3b9;
    --map-water-label: #7fb0da;
    --logo-filter: invert(0.93);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #0d1828;
  --ink: #e4ecf5;
  --ink-soft: #a3b4c7;
  --rule: #2b3e57;
  --band: #12223a;
  --magenta: #ef5fab;
  --magenta-ink: #1a0712;
  --link: #8cc2f0;
  --focus: #8cc2f0;
  --error: #ff8a80;
  --ok: #7fd3a3;
  --land: #182a40;
  --land-grid: #22385299;
  --water: #24486b;
  --water-edge: #4c7aa3;
  --map-ink: #d3dfeb;
  --map-quiet: #8ea3b9;
  --map-water-label: #7fb0da;
  --logo-filter: invert(0.93);
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  /* Anchor jumps and focused fields stop below the sticky header. */
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--step-0);
  line-height: 1.6;
  font-feature-settings: "kern", "liga";
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--link);
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.12;
  text-wrap: balance;
  letter-spacing: -0.015em;
}

h2 {
  font-size: var(--step-3);
  font-weight: 800;
}

h3 {
  font-size: var(--step-1);
  font-weight: 700;
  letter-spacing: -0.005em;
}

p {
  margin: 0;
}

/* Layout rules like display: grid would otherwise override the hidden attribute. */
[hidden] {
  display: none !important;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: var(--gutter-l);
  top: 8px;
  z-index: 20;
  background: var(--paper);
  padding: 8px 12px;
}

.wrap {
  max-width: 1120px;
  margin-inline: auto;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  padding-block: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand svg,
.brand-img {
  width: 40px;
  height: 45px;
  color: var(--ink);
}

.brand-img {
  filter: var(--logo-filter);
}

.brand-name {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  line-height: 1;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 24px;
  margin-left: auto;
  font-size: 0.975rem;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
  padding-block: 6px;
}

.site-nav a:hover {
  text-decoration: underline;
}

.site-header .phone {
  color: var(--ink);
  font-size: 0.975rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  white-space: nowrap;
  padding-block: 6px;
}

.site-header .phone:hover {
  text-decoration: underline;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 22px;
  border-radius: 6px;
  border: 2px solid var(--magenta);
  background: var(--magenta);
  color: var(--magenta-ink);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  filter: brightness(1.08);
}

.button.secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}

.button[disabled] {
  opacity: 0.6;
  cursor: progress;
}

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

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 64px;
  align-items: end;
  padding-block: 64px 72px;
}

.hero h1 {
  font-size: var(--step-4);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.02;
}

.hero h1 span {
  display: block;
}

.hero .lede {
  margin-top: 24px;
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 34em;
}

.hero .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.hero .reach {
  margin-top: 20px;
  font-size: var(--step--1);
  color: var(--ink-soft);
}

.hero .reach a {
  color: inherit;
  font-weight: 600;
  white-space: nowrap;
}

/* At a glance: a short ruled ledger beside the hero copy. */
.glance,
.area-notes {
  margin: 0;
  border-top: 2px solid var(--ink);
}

.glance > div,
.area-notes > div {
  padding-block: 14px;
  border-bottom: 1px solid var(--rule);
}

.glance dt,
.area-notes dt {
  font-weight: 700;
}

.glance dd,
.area-notes dd {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 0.975rem;
}

.map-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-weight: 700;
}

.map-link svg {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--magenta);
}

/* ---------- Chart ---------- */

.chart-figure {
  margin: 0;
  min-width: 0;
}

.chart {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.chart .land {
  fill: var(--land);
}

.chart .grid line {
  stroke: var(--land-grid);
  stroke-width: 1;
}

.chart .river,
.chart .river-edge,
.chart .creek {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart .river {
  stroke: var(--water);
  stroke-width: 7;
}

.chart .river-edge {
  stroke: var(--water-edge);
  stroke-width: 9.5;
}

.chart .river.big {
  stroke-width: 26;
}

.chart .river-edge.big {
  stroke-width: 29;
}

.chart .creek {
  stroke: var(--water-edge);
  stroke-width: 2.5;
}

.chart text {
  font-family: var(--font-chart);
  font-style: italic;
  font-weight: 500;
  fill: var(--map-ink);
}

.chart .water-labels text {
  fill: var(--map-water-label);
  font-size: 17px;
  letter-spacing: 0.04em;
}

.chart .regions text {
  fill: var(--map-quiet);
  font-size: 19px;
  letter-spacing: 0.06em;
}

.chart .towns circle {
  fill: var(--map-ink);
}

.chart .towns text,
.chart .regions text,
.chart .home text {
  paint-order: stroke;
  stroke: var(--land);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.chart .towns text {
  font-size: 17px;
}

.chart .home circle {
  fill: var(--paper);
  stroke: var(--magenta);
  stroke-width: 2.5;
}

.chart .home use {
  color: var(--ink);
}

.chart .home text {
  font-family: var(--font-text);
  font-style: normal;
  font-weight: 800;
  font-size: 17px;
  fill: var(--ink);
}

.chart .ring circle {
  fill: none;
  stroke: var(--magenta);
  stroke-width: 3;
  stroke-dasharray: 14 8;
}

.chart .ring-label {
  fill: var(--magenta);
  font-size: 19px;
  font-weight: 600;
}

.chart .ring-sweep {
  stroke-dasharray: 100 100;
  stroke-dashoffset: 0;
  transform: rotate(-90deg);
  transform-origin: center;
  transform-box: fill-box;
}

.chart .scale rect {
  fill: var(--map-ink);
}

.chart .scale rect.hollow {
  fill: var(--land);
  stroke: var(--map-ink);
  stroke-width: 1.5;
}

.chart .scale text,
.chart .ticks text,
.chart .north text {
  font-family: var(--font-text);
  font-style: normal;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  fill: var(--map-quiet);
}

.chart .north path {
  fill: var(--map-ink);
}

.chart .neatline {
  fill: none;
  stroke: var(--map-ink);
  stroke-width: 1.5;
}

@media (prefers-reduced-motion: no-preference) {
  .chart .ring-sweep {
    animation: sweep 1.6s cubic-bezier(0.45, 0, 0.2, 1) 0.3s both;
  }
}

@keyframes sweep {
  from {
    stroke-dashoffset: 100;
  }
  to {
    stroke-dashoffset: 0;
  }
}

.chart-figure figcaption {
  margin-top: 12px;
  font-size: var(--step--1);
  color: var(--ink-soft);
  max-width: 58ch;
}

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

.section {
  padding-block: 72px;
  border-top: 1px solid var(--rule);
}

.section.band {
  background: var(--band);
}

.section-head {
  display: grid;
  gap: 12px;
  max-width: var(--measure);
  margin-bottom: 40px;
}

.section-head p {
  color: var(--ink-soft);
}

/* Ledger: heading in the left column, explanation on the right, ruled rows. */
.ledger {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 2px solid var(--ink);
}

.ledger > li {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 8px 48px;
  padding-block: 24px;
  border-bottom: 1px solid var(--rule);
}

.ledger > li > div {
  min-width: 0;
  display: grid;
  gap: 12px;
  max-width: var(--measure);
}

.ledger h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}

.tag {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--magenta);
  border: 1.5px solid var(--magenta);
  border-radius: 999px;
  padding: 1px 9px;
}

.also {
  margin-top: 48px;
  display: grid;
  gap: 16px;
}

.also dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 48px;
}

.also dl > div {
  min-width: 0;
}

.also dt {
  font-weight: 700;
}

.also dd {
  margin: 2px 0 0;
  color: var(--ink-soft);
}

/* Process: a real sequence, so it is numbered. */
.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
}

.steps li {
  counter-increment: step;
  display: grid;
  align-content: start;
  gap: 8px;
  padding-top: 16px;
  border-top: 2px solid var(--ink);
}

.steps li::before {
  content: counter(step);
  font-weight: 800;
  font-size: var(--step-2);
  line-height: 1;
  color: var(--magenta);
  font-variant-numeric: tabular-nums;
}

.steps p {
  color: var(--ink-soft);
}

/* Pricing models */
.fine {
  margin-top: 20px;
  max-width: var(--measure);
  font-size: var(--step--1);
  color: var(--ink-soft);
}

.section-cta {
  margin-top: 28px;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 48px;
  align-items: start;
}

.about-grid .copy {
  display: grid;
  gap: 16px;
  max-width: var(--measure);
}

.pull {
  margin: 0;
  font-family: var(--font-chart);
  font-style: italic;
  font-weight: 500;
  font-size: var(--step-2);
  line-height: 1.3;
  padding-left: 20px;
  border-left: 3px solid var(--magenta);
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 56px;
  align-items: start;
}

.form {
  display: grid;
  gap: 20px;
}

.form .row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field label {
  font-weight: 700;
  font-size: 0.975rem;
}

.field .optional {
  font-weight: 400;
  color: var(--ink-soft);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--ink-soft);
  border-radius: 6px;
  padding: 11px 12px;
  min-height: 48px;
}

.field textarea {
  min-height: 160px;
  resize: vertical;
}

.field [aria-invalid="true"] {
  border-color: var(--error);
  border-width: 2px;
}

.field .error {
  color: var(--error);
  font-size: var(--step--1);
  font-weight: 600;
}

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
}

.form-foot p {
  font-size: var(--step--1);
  color: var(--ink-soft);
}

.form-status {
  padding: 14px 16px;
  border-radius: 6px;
  border: 1.5px solid currentColor;
  font-weight: 600;
}

.form-status:empty {
  padding: 0;
  border: 0;
}

.button[aria-disabled="true"] {
  opacity: 0.6;
  cursor: progress;
}

.form-status.is-error {
  color: var(--error);
}

.form-status.is-ok {
  color: var(--ok);
}

.done {
  display: grid;
  gap: 12px;
  padding: 28px;
  border: 2px solid var(--ok);
  border-radius: 8px;
}

.done h3 {
  color: var(--ok);
}

.done .button {
  justify-self: start;
  margin-top: 4px;
}

.details {
  margin: 0;
  display: grid;
  gap: 20px;
}

.details dt {
  font-weight: 700;
}

.details dd {
  margin: 2px 0 0;
  color: var(--ink-soft);
}

.details dd a {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Footer */
.site-footer {
  border-top: 2px solid var(--ink);
  padding-block: 32px 40px;
  font-size: var(--step--1);
  color: var(--ink-soft);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px 32px;
}

.site-footer .brand svg {
  width: 30px;
  height: 34px;
}

.site-footer .brand-name {
  font-size: 1rem;
}

.site-footer .motto {
  margin-top: 6px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: start;
}

/* Service area page */
.area {
  padding-block: 56px 72px;
}

.area-head {
  display: grid;
  gap: 16px;
  max-width: var(--measure);
  margin-bottom: 40px;
}

.area-head h1 {
  font-size: var(--step-3);
  font-weight: 800;
}

.area-head p {
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--ink-soft);
}

.area-grid {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
  gap: 48px;
  align-items: start;
}

.area-cta {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  color: var(--ink-soft);
}

.area-cta span a {
  font-weight: 600;
  white-space: nowrap;
}

/* Text pages (privacy, terms, 404) */
.doc {
  padding-block: 56px 72px;
}

.doc article {
  max-width: var(--measure);
  display: grid;
  gap: 16px;
}

.doc h1 {
  font-size: var(--step-3);
  font-weight: 800;
}

.doc h2 {
  font-size: var(--step-1);
  margin-top: 16px;
}

.doc ul {
  margin: 0;
  padding-left: 1.2em;
  display: grid;
  gap: 6px;
}

.doc .updated {
  color: var(--ink-soft);
  font-size: var(--step--1);
}

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

@media (max-width: 900px) {
  .hero .wrap,
  .about-grid,
  .contact-grid,
  .area-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero .wrap {
    gap: 40px;
    padding-block: 40px 48px;
  }

  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  /* Small screens: the header stays pinned, so keep it to two short rows:
     name and phone number, then the section links. */
  :root {
    --header-h: 88px;
  }

  .site-header .wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand phone"
      "nav nav";
    gap: 2px 12px;
    padding-block: 8px 4px;
  }

  .site-header .brand {
    grid-area: brand;
    gap: 10px;
  }

  .site-header .brand svg,
  .site-header .brand-img {
    width: 30px;
    height: 34px;
  }

  .site-header .brand-name {
    font-size: 1.05rem;
  }

  .site-header .phone {
    grid-area: phone;
  }

  .site-nav {
    grid-area: nav;
    margin-left: 0;
    flex-wrap: nowrap;
    gap: 0 20px;
    overflow-x: auto;
    font-size: 0.95rem;
  }
}

@media (max-width: 640px) {
  .ledger > li,
  .also dl,
  .form .row,
  .steps {
    grid-template-columns: minmax(0, 1fr);
  }

  .section {
    padding-block: 52px;
  }


  /* On a phone the chart shrinks to about half size: drop minor labels and enlarge the rest. */
  .chart .minor,
  .chart .ticks,
  .chart .grid {
    display: none;
  }

  .chart .towns text,
  .chart .home text {
    font-size: 26px;
  }

  .chart .regions text,
  .chart .water-labels text {
    font-size: 24px;
  }

  .chart .ring-label {
    font-size: 26px;
  }

  .chart .towns circle {
    r: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
