/* On Safe Ground Ltd — site stylesheet */

@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/SourceSans3.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/SourceSans3-Italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/SourceSerif4-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy: #011529;
  --navy-2: #0b2340;
  --navy-3: #17325a;
  --green: #24b342;
  --green-pale: #b9ecc4;
  --green-ink: #166a2a;
  --ink: #1c2530;
  --ink-2: #3d4a57;
  --muted: #5b6771;
  --paper: #ffffff;
  --paper-2: #f3f5f4;
  --rule: #d7dde2;
  --rule-2: #b9c3cb;
  --focus: #ffbf47;
  --sans: "Source Sans 3", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --wrap: 1120px;
  --gutter: 24px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--green-ink); text-decoration: underline; text-underline-offset: 0.15em; text-decoration-thickness: 1px; }
a:hover { color: var(--navy); }

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

h1, h2, h3, h4 { color: var(--navy); line-height: 1.2; margin: 0 0 0.5em; }
h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.005em; }
h1 { font-size: clamp(2rem, 1.35rem + 2.2vw, 2.9rem); }
h2 { font-size: clamp(1.55rem, 1.25rem + 1vw, 1.95rem); }
h3 { font-family: var(--sans); font-weight: 600; font-size: 1.2rem; }
h4 { font-family: var(--sans); font-weight: 600; font-size: 1.05rem; }

p, ul, ol, dl, table, figure { margin: 0 0 1.1em; }
ul, ol { padding-left: 1.3em; }
li { margin: 0.3em 0; }
li::marker { color: var(--green-ink); }

.lead { font-size: 1.2rem; line-height: 1.55; color: var(--ink-2); max-width: 46em; }
.small { font-size: 0.9rem; color: var(--muted); }

hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.prose { max-width: 68ch; }
.prose h2 { margin-top: 2em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.6em; }

.skip {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--focus); color: var(--navy); padding: 8px 12px; font-weight: 600; text-decoration: none;
}
.skip:focus { left: 8px; }

/* Header */
.site-header {
  background: var(--navy);
  color: #fff;
  border-bottom: 3px solid var(--green);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  min-height: 78px;
}
.brand {
  display: flex; align-items: center; gap: 14px;
  color: #fff; text-decoration: none;
}
.brand img { width: 60px; height: 53px; object-fit: contain; }
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 1.3rem; line-height: 1.1; }
.brand-sub { display: block; font-size: 0.8rem; color: #c8d3dc; letter-spacing: 0.01em; margin-top: 3px; }

.site-nav { display: flex; align-items: center; gap: 4px 28px; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 26px; }
.site-nav li { margin: 0; }
.site-nav a { color: #fff; text-decoration: none; font-weight: 600; font-size: 1rem; padding: 6px 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: #fff; border-bottom-color: var(--green-pale); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--green); }

.nav-toggle {
  display: none; background: none; border: 1px solid #5a6b80; color: #fff; border-radius: 3px;
  font: inherit; font-weight: 600; padding: 8px 12px; cursor: pointer; align-items: center; gap: 10px;
}
.nav-toggle .bars { display: inline-block; width: 18px; height: 2px; background: #fff; position: relative; }
.nav-toggle .bars::before, .nav-toggle .bars::after { content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: #fff; }
.nav-toggle .bars::before { top: -6px; }
.nav-toggle .bars::after { top: 6px; }

/* Buttons */
.btn {
  display: inline-block; padding: 12px 20px; border-radius: 3px; border: 2px solid var(--navy);
  background: var(--navy); color: #fff; font-weight: 600; text-decoration: none; line-height: 1.2;
  max-width: 100%; overflow-wrap: anywhere;
}
.btn:hover { background: var(--navy-3); border-color: var(--navy-3); color: #fff; }
.btn-green { background: var(--green); border-color: var(--green); color: var(--navy); }
.btn-green:hover { background: #1fa03b; border-color: #1fa03b; color: var(--navy); }
.btn-outline { background: transparent; color: var(--navy); }
.btn-outline:hover { background: var(--paper-2); color: var(--navy); }
.on-dark .btn-outline { color: #fff; border-color: #fff; }
.on-dark .btn-outline:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.6rem; }

/* Sections */
.section { padding: 64px 0; }
.section + .section { border-top: 1px solid var(--rule); }
.section-tint { background: var(--paper-2); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.section-head { max-width: 62ch; margin-bottom: 2rem; }
.section-head p { color: var(--ink-2); }

.two-col > *, .three-col > *, .card-grid > *, .footer-grid > *, .steps > * { min-width: 0; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 56px; align-items: start; }
.two-col-even { grid-template-columns: 1fr 1fr; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }

/* Hero */
.hero { padding: 56px 0 64px; }
.hero .two-col { align-items: center; gap: 48px; }
.hero h1 { margin-bottom: 0.6em; }
.hero .lead { margin-bottom: 0; }
.hero-photo img { aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 78%; width: 100%; }

/* Photos */
.photo { border: 1px solid var(--rule); background: var(--paper-2); overflow: hidden; }
.photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photo-portrait img { aspect-ratio: 4 / 5; }
.photo-wide img { aspect-ratio: 21 / 9; }
figure.photo { margin: 0; }
figure.photo figcaption { font-size: 0.9rem; color: var(--muted); padding: 10px 14px; border-top: 1px solid var(--rule); background: #fff; }

/* Service cards */
.card-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card-grid li { margin: 0; }
.card { display: block; height: 100%; padding: 22px 24px 24px; border: 1px solid var(--rule); background: #fff; text-decoration: none; color: var(--ink); border-top: 3px solid var(--navy); }
.card:hover { border-color: var(--rule-2); border-top-color: var(--green); color: var(--ink); }
.card h3 { margin: 0 0 0.4em; color: var(--navy); }
.card p { margin: 0 0 0.8em; color: var(--ink-2); font-size: 1rem; }
.card .more { color: var(--green-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 0.15em; }
.card:hover .more { color: var(--navy); }

/* Definition-style facts */
.facts { border: 1px solid var(--rule); background: var(--paper-2); padding: 20px 22px; }
.facts h3 { margin-top: 0; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-2); }
.facts dl { margin: 0; }
.facts dt { font-weight: 600; color: var(--navy); margin-top: 0.9em; }
.facts dt:first-of-type { margin-top: 0; }
.facts dd { margin: 0.15em 0 0; color: var(--ink-2); }

/* Page head (inner pages) */
.page-head { background: var(--paper-2); border-bottom: 1px solid var(--rule); padding: 36px 0 44px; }
.page-head h1 { margin-bottom: 0.4em; }
.page-head .lead { margin-bottom: 0; }
.crumbs { list-style: none; padding: 0; margin: 0 0 1.2rem; display: flex; flex-wrap: wrap; gap: 6px; font-size: 0.92rem; color: var(--muted); }
.crumbs li { margin: 0; }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--rule-2); }
.crumbs a { color: var(--ink-2); }

/* Sidebar */
.sidebar > * + * { margin-top: 24px; }
.linklist { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule); }
.linklist li { margin: 0; border-bottom: 1px solid var(--rule); }
.linklist a { display: block; padding: 10px 2px; text-decoration: none; color: var(--navy); font-weight: 600; }
.linklist a:hover { color: var(--green-ink); }
.linklist a[aria-current="page"] { color: var(--muted); font-weight: 400; }

/* Steps */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.steps li { margin: 0; counter-increment: step; padding-top: 14px; border-top: 3px solid var(--navy); }
.steps li::before { content: counter(step); display: block; font-family: var(--serif); font-weight: 600; font-size: 1.6rem; color: var(--green-ink); margin-bottom: 0.25em; }
.steps h3 { margin-bottom: 0.3em; }
.steps p { margin: 0; color: var(--ink-2); font-size: 1rem; }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.table th, .table td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--rule); }
.table th { background: var(--paper-2); color: var(--navy); font-weight: 600; width: 30%; }
.table thead th { border-bottom: 2px solid var(--rule-2); }

/* Contact block */
.contact-block { border: 1px solid var(--rule); padding: 26px 28px; background: #fff; }
.contact-block dt { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-top: 1.1em; }
.contact-block dt:first-child { margin-top: 0; }
.contact-block dd { margin: 0.15em 0 0; font-size: 1.15rem; font-weight: 600; }
.contact-block dd a { text-decoration: none; color: var(--navy); }
.contact-block dd a:hover { text-decoration: underline; }
.contact-block dd .small { display: block; font-weight: 400; font-size: 0.95rem; color: var(--ink-2); }

/* CTA band */
.cta { background: var(--navy); color: #fff; padding: 56px 0; }
.cta h2 { color: #fff; }
.cta p { color: #d3dce4; max-width: 60ch; }
.cta a:not(.btn) { color: #fff; }
.cta .two-col { align-items: center; }

/* Footer */
.site-footer { background: var(--navy); color: #c8d3dc; font-size: 0.95rem; padding: 48px 0 28px; border-top: 3px solid var(--green); }
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--green-pale); }
.site-footer h3 { color: #fff; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.9em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 0.35em 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.footer-brand { display: flex; gap: 14px; align-items: flex-start; }
.footer-brand img { width: 64px; height: 57px; object-fit: contain; flex: none; }
.footer-brand strong { color: #fff; font-family: var(--serif); font-size: 1.15rem; display: block; margin-bottom: 4px; }
.footer-bottom { border-top: 1px solid #1e3552; margin-top: 36px; padding-top: 20px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; font-size: 0.88rem; color: #9fb0bf; }
.footer-bottom a { color: #c8d3dc; }

/* Utilities */
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Responsive */
@media (max-width: 960px) {
  .two-col, .two-col-even { grid-template-columns: 1fr; gap: 36px; }
  .three-col { grid-template-columns: 1fr; gap: 28px; }
  .card-grid { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero-photo img { aspect-ratio: 3 / 2; }
  .photo-portrait img { aspect-ratio: 3 / 2; }
}

@media (max-width: 760px) {
  body { font-size: 1rem; }
  .section { padding: 48px 0; }
  .hero { padding: 40px 0 48px; }
  .site-header .wrap { flex-wrap: wrap; gap: 12px; min-height: 70px; padding-top: 10px; padding-bottom: 10px; }
  .brand { gap: 10px; }
  .brand img { width: 50px; height: 44px; }
  .brand-name { font-size: 1.15rem; }
  .brand-sub { display: none; }
  .nav-toggle { display: inline-flex; }
  .site-nav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 0; padding: 8px 0 12px; border-top: 1px solid #1e3552; margin-top: 10px; }
  .site-nav.is-open { display: flex; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav a { display: block; padding: 12px 4px; border-bottom: 1px solid #1e3552; }
  .site-nav a[aria-current="page"] { border-bottom-color: #1e3552; color: var(--green-pale); }
  .site-nav .btn { margin-top: 14px; text-align: center; }
  .card-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .table th, .table td { display: block; width: auto; }
  .table th { border-bottom: 0; padding-bottom: 4px; }
  .table td { padding-top: 4px; }
  .table thead { display: none; }
}

@media (min-width: 761px) {
  .site-nav .btn { padding: 9px 16px; margin-left: 8px; }
}

@media print {
  .site-header, .site-footer, .cta, .skip, .nav-toggle { display: none; }
  a { color: inherit; text-decoration: none; }
  .page-head { background: none; }
}
