/* Aquilvia LLC, aquilvia.com (design v4)
   One stylesheet for every page. The font is self-hosted, so the site makes
   no requests to third parties (Cloudflare Web Analytics is added by
   Cloudflare after deployment).

   Idea: the page is a map with north at the top. One thin line, the "via",
   runs from the Contact section at the bottom up to a north arrow beside
   the name. Light, open sky above; one deep band of ground below. */

@font-face {
  font-family: "Commissioner";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/commissioner-latin-flar-normal.woff2") format("woff2");
}

:root {
  /* Brand palette */
  --north-light: #f5f9fa; /* page: the cool, even light of a north window */
  --deepwater: #0b2e38;   /* text and the ground band */
  --aquilo: #0f5566;      /* brand color: links, button */
  --aquilo-deep: #0a4352;
  --bronze: #a8743a;      /* the route line and the north arrow only */
  --bronze-light: #d8a770;
  --stone: #53646a;       /* secondary text */
  --ice: #d6e4e8;         /* hairlines */
  --on-deep: #eaf2f4;
  --on-deep-muted: #a9c1c7;
  --deep-rule: #27474f;
  --placeholder: #f4e3a1;

  /* The pieces that change between sky and ground */
  --surface: var(--north-light);
  --route: var(--bronze);

  /* One family, two voices: flared for the name and headings, plain for text */
  --display: "Commissioner", Optima, Candara, "Segoe UI", sans-serif;
  --text: "Commissioner", "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --indent: clamp(2rem, 7vw, 5.5rem); /* text starts this far right of the line's margin */
  --line-x: 10px;                     /* centre of the route line */
  --sec-pad: clamp(3.25rem, 8vw, 6rem);
  --h2: clamp(1.75rem, 1.35rem + 1.7vw, 2.5rem);

  color-scheme: light;
}

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

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--surface);
  color: var(--deepwater);
  font-family: var(--text);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.62;
  font-kerning: normal;
}

h1,
h2,
h3,
.wordmark {
  font-family: var(--display);
  font-variation-settings: "FLAR" 100;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  line-height: 1.18;
  text-wrap: balance;
}

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

a {
  color: var(--aquilo);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--aquilo-deep);
  text-decoration-thickness: 2px;
}

/* Keep phone numbers on one line */
a[href^="tel:"] {
  white-space: nowrap;
}

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

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  background: var(--deepwater);
  color: var(--on-deep);
}

.skip:focus {
  top: 0.75rem;
  color: var(--on-deep);
}

/* Layout: every band of the page shares one column. Its left margin carries
   the route line; the text starts one indent to the right of it. */

.wrap {
  position: relative;
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: calc(var(--gutter) + var(--indent)) var(--gutter);
}

/* Each stretch of the line runs 1px past the bottom of its band, under the
   start of the next stretch, so no hairline gap can open where bands meet. */

.route::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: -1px;
  left: calc(var(--gutter) + var(--line-x) - 1px);
  width: 2px;
  background: var(--route);
}

/* A waypoint: the ring where a section meets the line */

.waypoint {
  position: relative;
}

.waypoint::before {
  content: "";
  position: absolute;
  top: calc(0.59em - 7px);
  left: calc(var(--line-x) - var(--indent) - 7px);
  width: 14px;
  height: 14px;
  border: 2px solid var(--route);
  border-radius: 50%;
  background: var(--surface);
}

/* Header */

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: 1.5rem;
}

/* The line starts just inside the notch of the arrow, which is drawn over it */

.header-inner.route::before {
  top: calc(1.5rem + 22px);
}

.wordmark {
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--deepwater);
  text-decoration: none;
}

.wordmark:hover {
  color: var(--deepwater);
}

/* The north arrow: where the line ends, and the firm's mark */

.north {
  position: absolute;
  top: 1.5rem;
  left: var(--gutter);
  width: 20px;
  height: 30px;
}

.north .lit {
  fill: var(--bronze);
}

.north .shade {
  fill: var(--deepwater);
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem clamp(1rem, 3.2vw, 1.75rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--deepwater);
  text-decoration: none;
}

.site-nav a:hover {
  text-decoration: underline;
  text-decoration-color: var(--bronze);
  text-decoration-thickness: 2px;
}

/* Hero: what the firm does is the first and largest thing on the page.
   The name stays in the header, beside the north arrow. */

.hero-inner {
  padding-block: clamp(2.5rem, 7.5vw, 5.75rem) 0;
}

.hero h1 {
  max-width: 21ch;
  margin-left: -0.03em;
  font-size: clamp(1.75rem, 1.2rem + 2.9vw, 3.5rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.018em;
}

.lead {
  max-width: 36em;
  margin: clamp(1.25rem, 2.6vw, 2rem) 0 0;
  font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem);
  line-height: 1.55;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
  margin: 2rem 0 0;
}

.button {
  display: inline-block;
  padding: 0.85rem 1.5rem;
  border-radius: 3px;
  background: var(--aquilo);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  background: var(--aquilo-deep);
  color: #fff;
}

.phone {
  color: var(--deepwater);
  font-weight: 600;
}

/* Sections */

.section-inner {
  padding-top: var(--sec-pad);
}

.section-inner--last {
  padding-bottom: var(--sec-pad);
}

.section h2 {
  font-size: var(--h2);
  font-weight: 550;
  letter-spacing: -0.012em;
  scroll-margin-top: 1.5rem;
}

.section-body {
  max-width: 58rem;
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
}

.services {
  display: grid;
  gap: 2.25rem 3.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 44rem) {
  .services {
    grid-template-columns: 1fr 1fr;
  }
}

.services h3,
.steps h3 {
  margin-bottom: 0.45rem;
  font-size: 1.3125rem;
}

.services p,
.steps p {
  margin: 0;
}

/* The three steps are a true sequence, so they are numbered */

.steps {
  display: grid;
  gap: 2.25rem 3rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  display: block;
  margin-bottom: 0.6rem;
  font-family: var(--display);
  font-variation-settings: "FLAR" 100;
  font-size: 2.75rem;
  font-weight: 300;
  line-height: 1;
  color: var(--aquilo);
}

@media (min-width: 52rem) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

.person {
  font-size: 1.5rem;
}

.role {
  margin: 0.2rem 0 1.25rem;
  color: var(--stone);
}

.about p {
  max-width: 43em;
}

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

/* Ground: the one deep band. The route starts here, at Contact. */

.ground {
  --surface: var(--deepwater);
  --route: var(--bronze-light);
  background: var(--surface);
  color: var(--on-deep);
}

.ground a {
  color: var(--on-deep);
  text-decoration-color: var(--bronze-light);
}

.ground a:hover {
  color: #fff;
}

.ground :focus-visible {
  outline-color: var(--bronze-light);
}

/* In Contact the line stops at the heading: this is where the path begins */

.contact-inner.route::before {
  bottom: auto;
  height: calc(var(--sec-pad) + 0.59 * var(--h2));
}

.waypoint--origin::before {
  background: var(--route);
}

.contact-inner {
  padding-bottom: clamp(2.75rem, 6vw, 4.5rem);
}

.contact-card {
  display: grid;
  gap: 1.5rem 3rem;
  font-style: normal;
}

.contact-card p {
  margin: 0;
}

.contact-card dl {
  display: grid;
  gap: 0.5rem;
  margin: 0;
}

.contact-card dl div {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 1rem;
}

.contact-card dt {
  color: var(--on-deep-muted);
}

.contact-card dd {
  margin: 0;
}

@media (min-width: 44rem) {
  .contact-card {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  }
}

@media (max-width: 26rem) {
  .contact-card dl div {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

.sms {
  max-width: 42rem;
  margin: 2.25rem 0 0;
  font-size: 0.9375rem;
  color: var(--on-deep-muted);
}

.sms strong {
  color: var(--on-deep);
}

/* Legal pages and the 404 page. On a short page the footer still sits at
   the bottom of the window, and the line runs all the way down to it. */

main {
  flex: 1 0 auto;
}

.legal {
  display: flex;
  flex-direction: column;
}

.legal-inner {
  flex: 1 0 auto;
}

.legal-inner {
  padding-block: clamp(2.25rem, 7vw, 5rem) var(--sec-pad);
}

.legal-body {
  max-width: 42rem;
}

.legal h1 {
  max-width: 22ch;
  font-size: var(--h2);
  font-weight: 550;
  letter-spacing: -0.012em;
}

.effective {
  margin: 0.75rem 0 2.25rem;
  color: var(--stone);
}

mark.placeholder {
  padding: 0 0.2em;
  background: var(--placeholder);
  color: var(--deepwater);
}

/* Footer */

.site-footer {
  font-size: 0.875rem;
  color: var(--on-deep-muted);
}

.footer-inner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: 1.5rem 2.5rem;
  border-top: 1px solid var(--deep-rule);
}

.footer-inner p {
  margin: 0;
}

.footer-meta,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
}

.footer-links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer a {
  color: var(--on-deep-muted);
}

.site-footer a:hover {
  color: var(--on-deep);
}

/* On pages without a Contact section the line ends in the footer instead */

.site-footer--origin .footer-inner {
  border-top: 0;
  padding-top: 2rem;
}

.site-footer--origin .route::before {
  bottom: auto;
  height: calc(2rem + 0.81em);
}

.site-footer--origin .footer-inner::before {
  content: "";
  position: absolute;
  top: calc(2rem + 0.81em - 7px);
  left: calc(var(--line-x) - var(--indent) - 7px);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--route);
}

/* One moment of motion, on the home page only: the line is drawn north
   and the arrow arrives. */

@media (prefers-reduced-motion: no-preference) {
  .home .hero-inner.route::before {
    transform-origin: 50% 100%;
    animation: draw 0.85s cubic-bezier(0.4, 0, 0.7, 1) backwards;
  }

  .home .header-inner.route::before {
    transform-origin: 50% 100%;
    animation: draw 0.12s 0.85s linear backwards;
  }

  .home .north {
    animation: arrive 0.45s 0.95s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
  }
}

@keyframes draw {
  from {
    transform: scaleY(0);
  }
}

@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media print {
  .ground {
    --surface: #fff;
    --route: var(--bronze);
    color: var(--deepwater);
  }

  .ground a,
  .site-footer,
  .site-footer a,
  .sms,
  .sms strong,
  .contact-card dt {
    color: var(--deepwater);
  }
}
