/* GA POL LLC — site styles
   Concept: the monogram as an instrument. The hero graticule is the one bold element;
   everything else is quiet chancery stationery. */

@font-face {
  font-family: "Montserrat";
  src: url("/assets/fonts/montserrat-latin-200-500.woff2") format("woff2");
  font-weight: 200 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/source-serif-4-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #1B2733;
  --chancery: #EDEFEA;
  --graphite: #5A6470;
  --rule: #C5CBC4;
  --grid: #9AA39B;
  --accent: #2E5E5C;
  --accent-on-dark: #8FC1BB;
  --paper: #FFFFFF;
  --error: #9B2C2C;
  --error-on-dark: #F2B8B5;

  --sans: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;

  /* Type scale: perfect fourth (1.333) from an 18px body. */
  --step--1: 0.844rem;
  --step-0: 1.125rem;
  --step-1: 1.5rem;
  --step-2: 2rem;
  --step-3: clamp(2rem, 1.4rem + 2.2vw, 2.666rem);
  --step-4: clamp(2.3rem, 1.4rem + 3vw, 3.7rem);

  --gutter: clamp(16px, 5vw, 64px);
  --max: 1240px;
  --section: clamp(4.5rem, 3rem + 6vw, 8.5rem);

  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 1.5rem;
}

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

body {
  margin: 0;
  background: var(--chancery);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--step-0);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

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

h1, h2, h3 {
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.12;
  letter-spacing: 0.01em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

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

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

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

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  background: var(--ink);
  color: var(--chancery);
  padding: 0.6rem 1rem;
  font-family: var(--sans);
  font-size: var(--step--1);
  z-index: 10;
}
.skip-link:focus { top: 1rem; }

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

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1.75rem;
}

.brand img { width: clamp(150px, 14vw, 190px); height: auto; }

.nav {
  display: flex;
  gap: clamp(1rem, 2.5vw, 2.25rem);
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--sans);
  font-size: var(--step--1);
  letter-spacing: 0.04em;
}

.nav a {
  color: var(--ink);
  text-decoration: none;
  padding-block: 0.4rem;
  border-bottom: 1px solid transparent;
}
.nav a:hover { border-bottom-color: var(--ink); }

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

.hero {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  align-items: center;
  min-height: min(84svh, 860px);
  padding-block: clamp(2rem, 4vw, 4rem) var(--section);
  position: relative;
  /* The bearing line may rise into the header but must stop at the end of the hero. */
  clip-path: inset(-12rem -100vw 0 -100vw);
  overflow-x: clip;
}

.hero-text {
  grid-column: 1 / span 6;
  grid-row: 1;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: var(--step-4);
  max-width: 15ch;
  margin-bottom: 1.75rem;
}

.lede {
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--graphite);
  max-width: 34ch;
  margin-bottom: 2rem;
}

.text-link {
  font-family: var(--sans);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 0.3rem;
}
.text-link:hover { border-bottom-width: 2px; }

.hero-figure {
  grid-column: 6 / -1;
  grid-row: 1;
  /* Let the globe run slightly past the content edge toward the viewport. */
  margin-right: calc(-1 * var(--gutter));
  color: var(--grid);
}

.graticule {
  width: 100%;
  height: auto;
  overflow: visible;
  pointer-events: none; /* the bearing line crosses the nav; never catch its clicks */
  transform-origin: 50% 50%;
}

.graticule-grid path,
.graticule-rim,
.graticule-bearing {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.graticule-rim { stroke: var(--ink); stroke-opacity: 0.55; }

@media (prefers-reduced-motion: no-preference) {
  .graticule { animation: settle 1.8s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .graticule-grid path,
  .graticule-rim { animation: draw 1.4s cubic-bezier(0.4, 0, 0.2, 1) both; }
  .graticule-bearing { animation: draw 0.9s 0.9s cubic-bezier(0.4, 0, 0.2, 1) both; }
  .graticule-mark { animation: appear 0.4s 1.6s ease-out both; }
}

@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes settle { from { transform: rotate(-7deg); } to { transform: rotate(0); } }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }

/* About -------------------------------------------------------------------- */

.about {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 2rem;
  padding-block: 0 var(--section);
}

.statement {
  grid-column: 1 / span 6;
  font-size: var(--step-3);
  max-width: 18ch;
}

.prose {
  grid-column: 8 / -1;
  max-width: 62ch;
  padding-top: 0.6rem;
}

/* Services ----------------------------------------------------------------- */

.services { padding-block: 0 var(--section); }

.services h2,
.approach h2 {
  font-size: var(--step-2);
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}

.service-list { margin: 0; }

.service {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 0.75rem;
  padding-block: 1.75rem;
  border-top: 1px solid var(--rule);
}
.service:last-child { border-bottom: 1px solid var(--rule); }

.services-note {
  margin-top: 1.75rem;
  max-width: 62ch;
  font-size: 1rem;
  color: var(--graphite);
}

.service dt {
  grid-column: 1 / span 4;
  font-family: var(--sans);
  font-size: var(--step-1);
  font-weight: 400;
  line-height: 1.25;
}

.service dd {
  grid-column: 6 / span 6;
  margin: 0;
  color: var(--graphite);
  max-width: 62ch;
}

/* Image band --------------------------------------------------------------- */

.band { margin: 0 0 var(--section); }

.band img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 1;
  object-fit: cover;
}

/* Approach ----------------------------------------------------------------- */

.approach { padding-block: 0 var(--section); }

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  border-top: 1px solid var(--ink);
  padding-top: 1.5rem;
  padding-right: clamp(0rem, 2vw, 2rem);
}

.steps li::before {
  content: counter(step);
  display: block;
  font-family: var(--sans);
  font-weight: 200;
  font-size: var(--step-3);
  line-height: 1;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.steps h3 {
  font-size: var(--step-1);
  font-weight: 400;
  margin-bottom: 0.75rem;
}

.steps p { color: var(--graphite); max-width: 40ch; }

/* Contact ------------------------------------------------------------------ */

.contact {
  background: var(--ink);
  color: var(--chancery);
  padding-block: var(--section);
}

.contact :focus-visible { outline-color: var(--accent-on-dark); }
.contact a { color: var(--accent-on-dark); }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 3rem;
}

.contact-info { grid-column: 1 / span 5; }

.contact h2 {
  font-size: var(--step-3);
  margin-bottom: 1.25rem;
}

.contact-info > p { color: #C9D0D6; max-width: 36ch; }

.contact-direct { color: #C9D0D6; }

.office { margin: 2.5rem 0 0; }
.office dd + dt { margin-top: 1.5rem; }
.nowrap { white-space: nowrap; }

.office dt {
  font-family: var(--sans);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #C9D0D6;
  margin-bottom: 0.5rem;
}

.office dd { margin: 0; }
address { font-style: normal; line-height: 1.55; }

.contact-form {
  grid-column: 7 / -1;
  display: grid;
  gap: 1.25rem;
}

.field { display: grid; gap: 0.4rem; }

.field label {
  font-family: var(--sans);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.optional { font-weight: 400; color: #AEB7BF; }

.field input,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid transparent;
  border-radius: 2px;
  padding: 0.75rem 0.9rem;
}

.field textarea { resize: vertical; min-height: 9rem; line-height: 1.5; }

.field input:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--accent-on-dark);
  outline-offset: 2px;
}

.field [aria-invalid="true"] { border-color: var(--error-on-dark); box-shadow: inset 0 0 0 1px var(--error-on-dark); }

.field-error {
  margin: 0;
  font-family: var(--sans);
  font-size: var(--step--1);
  color: var(--error-on-dark);
}

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

.turnstile:empty { display: none; }

.form-note { font-size: 1rem; color: #C9D0D6; margin: 0; }

.button {
  justify-self: start;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--ink);
  background: var(--chancery);
  border: 0;
  border-radius: 2px;
  padding: 0.9rem 1.6rem;
  cursor: pointer;
}
.button:hover { background: var(--paper); }
.button[disabled] { opacity: 0.6; cursor: progress; }

.form-status {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.95rem;
  min-height: 1.5em;
}
.form-status[data-state="error"] { color: var(--error-on-dark); }

.form-sent {
  grid-column: 7 / -1;
  align-self: start;
  border-top: 1px solid var(--accent-on-dark);
  padding-top: 1.5rem;
}
.form-sent h3 { font-size: var(--step-1); font-weight: 400; margin-bottom: 0.75rem; }
.form-sent p { color: #C9D0D6; }

/* Footer ------------------------------------------------------------------- */

.site-footer {
  padding-block: 2.5rem 3rem;
  font-family: var(--sans);
  font-size: var(--step--1);
  color: var(--graphite);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem 2rem;
}

.site-footer > p { margin: 0; }

.legal { max-width: 68ch; }
.legal summary { cursor: pointer; color: var(--ink); }
.legal[open] summary { margin-bottom: 0.75rem; }
.legal p { font-family: var(--serif); font-size: 0.95rem; line-height: 1.55; }

/* Small screens ------------------------------------------------------------ */

@media (max-width: 900px) {
  .hero { min-height: 0; }
  .hero-text { grid-column: 1 / -1; grid-row: 2; }
  .hero-figure {
    grid-column: 3 / -1;
    grid-row: 1;
    margin-bottom: 1rem;
    margin-right: calc(-1 * var(--gutter) - 12%);
    /* Stop the bearing at the globe so it doesn't run through the headline below. */
    clip-path: inset(-12rem -100vw 0 -100vw);
  }
  .lede { font-size: 1.25rem; }
  .statement, .prose { grid-column: 1 / -1; }
  .service dt, .service dd { grid-column: 1 / -1; }
  .steps { grid-template-columns: 1fr; gap: 2.5rem; }
  .contact-info, .contact-form, .form-sent { grid-column: 1 / -1; }
  .band img { aspect-ratio: 2 / 1; }
}

@media (max-width: 520px) {
  .site-header { flex-wrap: wrap; row-gap: 0.75rem; }
  .nav { gap: 1.1rem; }
}

/* 404 ---------------------------------------------------------------------- */

.page-404 { min-height: 100svh; display: flex; flex-direction: column; }

.not-found {
  flex: 1;
  display: grid;
  place-content: center;
  text-align: center;
  padding-block: 2rem var(--section);
}
.not-found h1 { font-size: var(--step-3); margin-bottom: 1.25rem; }
.not-found p { max-width: 40ch; margin-inline: auto; color: var(--graphite); }
