/* Layout and components. Uses only variables from tokens.css. */

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

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

body {
  margin: 0;
  background: var(--color-ivory);
  color: var(--color-black);
  font-family: var(--font-body);
  font-weight: var(--weight-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
}

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

h1,
h2,
h3 {
  margin: 0 0 var(--space-5);
  font-family: var(--font-heading);
  font-weight: var(--weight-heading);
  line-height: var(--leading-heading);
}

h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }

h3 {
  font-family: var(--font-body);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

p {
  margin: 0 0 var(--space-4);
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
  text-decoration-thickness: var(--rule-width);
}

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

/* Utilities */

.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 10;
  padding: var(--space-2) var(--space-4);
  background: var(--color-ivory);
  color: var(--color-black);
  font-size: var(--text-sm);
}

.skip-link:focus {
  top: var(--space-4);
}

.eyebrow,
.label {
  font-family: var(--font-body);
  font-weight: var(--weight-medium);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

.eyebrow {
  display: block;
  margin-bottom: var(--space-4);
  color: var(--text-muted);
}

.muted {
  color: var(--text-muted);
}

.rule {
  height: 0;
  margin: var(--space-6) 0;
  border: 0;
  border-top: var(--rule-width) solid var(--rule);
}

/* Sections */

.section {
  background: var(--bg);
  color: var(--text);
  padding-block: var(--space-9);
}

/* Topographic texture (brand package). Stone lines on dark sections, Slate lines on
   ivory ones. The Slate band and the legal pages stay plain. Opacity is baked into each
   SVG and chosen so secondary text keeps WCAG AA contrast where it crosses a line. */
.section.section--dark {
  background-image: url("../img/textures/topo-lines-stone.svg");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.section.section--light:not(.legal) {
  background-image: url("../img/textures/topo-lines-slate.svg");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.section--tight {
  padding-block: var(--space-7);
}

.section-head {
  margin-bottom: var(--space-7);
}

/* Buttons */

.btn {
  display: inline-block;
  padding: var(--space-4) var(--space-6);
  border: var(--rule-width) solid var(--btn-border);
  border-radius: var(--radius);
  background: var(--btn-bg);
  color: var(--btn-text);
  font-family: var(--font-body);
  font-weight: var(--weight-semibold);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn:hover,
.btn:focus-visible {
  background: var(--btn-hover-bg);
  color: var(--btn-hover-text);
}

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

/* Header */

.site-header {
  background: var(--bg);
  color: var(--text);
  border-bottom: var(--rule-width) solid var(--rule);
}

.site-header .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4) var(--space-6);
  padding-block: var(--space-5);
}

/* Header/footer logo (brand package, horizontal light version). */
.logo-link {
  display: inline-block;
}

.logo-img {
  width: auto;
  height: 2.5rem;
}

.site-footer .logo-img {
  height: 2rem;
}

.nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav a {
  display: inline-block;
  padding-block: var(--space-2);
  border-bottom: var(--rule-width) solid transparent;
  color: var(--text);
  font-weight: var(--weight-medium);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  text-decoration: none;
}

.nav a:hover,
.nav a[aria-current="page"] {
  border-bottom-color: var(--accent);
}

/* Hero */

.hero {
  padding-block: var(--space-10);
}

.hero .tagline-sub {
  margin-bottom: var(--space-7);
  color: var(--text-muted);
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

/* Services */

.services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0;
  border-top: var(--rule-width) solid var(--rule);
  border-left: var(--rule-width) solid var(--rule);
}

.service {
  padding: var(--space-6);
  border-right: var(--rule-width) solid var(--rule);
  border-bottom: var(--rule-width) solid var(--rule);
}

/* Brand icons (decorative): fixed height, natural width. */
.service-icon,
.section-icon {
  width: auto;
  height: 3rem;
  margin-bottom: var(--space-5);
}

.service p {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* Band */

.band {
  text-align: center;
}

.band p {
  margin: 0;
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  line-height: var(--leading-heading);
}

/* CTA */

.cta {
  text-align: center;
}

.cta .prose {
  margin-inline: auto;
}

/* Two-column content */

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: var(--space-7);
}

/* Forms */

.form {
  display: grid;
  gap: var(--space-5);
  max-width: var(--prose-max);
}

.field {
  display: grid;
  gap: var(--space-2);
}

.field label {
  color: var(--text-muted);
}

.input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: var(--rule-width) solid var(--input-border);
  border-radius: var(--radius);
  background: var(--input-bg);
  color: var(--input-text);
  font: inherit;
}

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

select.input {
  appearance: none;
  padding-right: var(--space-7);
  background-image: linear-gradient(45deg, transparent 50%, var(--input-text) 50%),
    linear-gradient(135deg, var(--input-text) 50%, transparent 50%);
  background-position: right 1.25rem center, right 0.9rem center;
  background-size: 0.35rem 0.35rem;
  background-repeat: no-repeat;
  cursor: pointer;
}

select.input option {
  background: var(--input-bg);
  color: var(--input-text);
}

textarea.input {
  min-height: 10rem;
  resize: vertical;
}

/* Honeypot: off screen, not display:none (some bots skip hidden fields). */
.hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Turnstile widget slot: reserve its height to avoid layout shift. */
.captcha {
  min-height: 65px;
}

.form-status {
  min-height: 1.6em;
  margin: 0;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* Footer */

.site-footer {
  background: var(--bg);
  color: var(--text);
  border-top: var(--rule-width) solid var(--rule);
  padding-block: var(--space-7);
}

.site-footer .container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--space-6);
  align-items: start;
}

.footer-brand {
  display: grid;
  gap: var(--space-4);
  justify-items: start;
}

.site-footer p {
  margin: 0;
}

.footer-email,
.principal {
  font-size: var(--text-sm);
}

.principal {
  color: var(--text-muted);
}

.legal-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  margin: var(--space-4) 0 0;
  padding: 0;
  list-style: none;
}

.legal-nav a {
  font-weight: var(--weight-medium);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

.site-footer .descriptor {
  margin: 0;
  color: var(--text-muted);
}

.site-footer .copyright {
  grid-column: 1 / -1;
  padding-top: var(--space-5);
  border-top: var(--rule-width) solid var(--rule);
  margin: 0;
  color: var(--text-muted);
  font-size: var(--text-xs);
}

.form-after {
  margin-top: var(--space-6);
}

.form-after p {
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
}

.form-note {
  color: var(--text-muted);
}

/* Legal pages */

.legal .prose {
  max-width: 46rem;
}

.legal h2 {
  margin: var(--space-7) 0 var(--space-3);
  font-size: var(--text-lg);
}

.legal h3 {
  margin: var(--space-6) 0 var(--space-3);
}

.legal .updated {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.legal ul {
  margin: 0 0 var(--space-4);
  padding-left: var(--space-5);
}

.legal li {
  margin-bottom: var(--space-2);
}

.subsection {
  margin-top: var(--space-9);
}

/* 404 */

.not-found {
  min-height: 50vh;
}
