/* ==========================================================================
   nycconstructionpermit.com: navy & brass design system
   --------------------------------------------------------------------------
   One stylesheet for every page. The build hashes it to /css/site.<hash>.css.

   Colour contexts. Light is the default (white or cream background, ink
   text, dark brass for small accent text). Navy contexts (.band--navy,
   .hero, .page-head, .site-header, .site-footer) switch the same custom
   properties to cream text, white headings and brass accents, so the
   components below work unchanged on both.

   Markup the scripts and templates rely on:
     Menu       <button class="nav-toggle" aria-expanded="false"
                  aria-controls="site-nav">Menu</button>
                <nav class="nav" id="site-nav">...</nav>
                site.js adds .is-open to .nav. The toggle icon is drawn
                here (::before), so the button holds only its text.
                Below 1080px the menu is a full-screen panel (the links do
                not fit the bar on tablets); page content goes to one
                column below 760px.
     Dropdown   <li class="dropdown"><button type="button" aria-expanded="false">
                Services</button><ul>...</ul></li>
                The element after the button is the panel; it opens when the
                button has aria-expanded="true". On wide screens the four
                stage groups sit two across, then the For contractors group
                (.dropdown__audience) takes its own row; a panel taller than
                the window scrolls inside itself.
     Hero       <section class="hero" style="--hero-img:url(/images/...)">
                .page-head takes the same optional --hero-img.
                A page head with a photo per page (the borough pages) is
                <section class="page-head page-head--photo"
                  style="--photo-lg:url(...);--photo-sm:url(...)">; phones
                get the small one.
     FAQ        <details class="faq"><summary>Question</summary><div>...</div></details>
     Forms      <div class="field"><label for="x">Name</label><input id="x"></div>
                .field-error goes on the input (or on .field); aria-invalid
                styles the same way. Honeypot wrapper: .hp.

     Lead form  src/request-a-review.njk, driven by src/assets/js/forms.js:
                .lead-form, .form-row (two fields side by side), .field-message
                (the text under a field in error), .form-success, .form-error,
                .review-layout and .contact-list beside it.
     Wizard     <div id="permit-wizard"> is filled by src/assets/js/wizard.js
                with .wizard, .wizard__step, .wizard__option, .wizard__card ...

   Also available: .wordmark (__name, __tag), .actions, .inline-form,
   .prose, .skip-link, .visually-hidden.
   The footer's layout classes (.site-footer__about, __contact, __nav,
   __services, __stages, __all, __credentials, __legal) belong to
   src/_includes/partials/footer.njk.
   site.js marks the current page: aria-current="page" on its menu link and
   aria-current="true" on a menu link or the Services button for its section.
   ========================================================================== */

/* ---------- Fonts (self-hosted, copied to /fonts/ by scripts/assets.mjs) -- */

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

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/inter-latin-400-normal.woff2") format("woff2");
}

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

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/inter-latin-600-normal.woff2") format("woff2");
}

/* ---------- Tokens ------------------------------------------------------- */

:root {
  /* Brand colours (spec section 4). Dark brass is for small text on light. */
  --navy: #0b1f33;
  --cream: #f4f1ea;
  --brass: #b8925a;
  --brass-dark: #886839;
  --ink: #0b1f33;
  --muted: #5b6470;
  --white: #fff;
  --line: #dcd5c7;

  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: "DM Serif Display", Georgia, "Times New Roman", serif;

  /* Context colours: light by default, switched in navy contexts below. */
  --text: var(--ink);
  --text-soft: var(--muted);
  --heading: var(--ink);
  --accent-text: var(--brass-dark);
  --focus: var(--brass-dark);

  --gutter: clamp(20px, 4vw, 40px);
  --band-space: clamp(56px, 8vw, 104px);
  --header-h: 76px;
  --radius: 2px;
}

.band--navy,
.hero,
.page-head,
.site-header,
.site-footer {
  --text: var(--cream);
  --text-soft: var(--cream);
  --heading: var(--white);
  --accent-text: var(--brass);
  --focus: var(--brass);
  --line: rgb(244 241 234 / 20%);
  background-color: var(--navy);
  color: var(--text);
}

/* ---------- Base --------------------------------------------------------- */

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1,
h2,
h3 {
  margin: 0 0 0.5em;
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.005em;
  color: var(--heading);
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem);
}

h2 {
  font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.5rem);
}

h3 {
  font-size: clamp(1.25rem, 1.15rem + 0.4vw, 1.5rem);
}

h4 {
  margin: 0 0 0.5em;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--heading);
}

p,
ul,
ol,
dl,
blockquote,
figure {
  margin: 0 0 1em;
}

strong,
b {
  font-weight: 600;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--brass);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

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

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

::selection {
  background-color: var(--brass);
  color: var(--navy);
}

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

.skip-link:focus {
  top: 12px;
}

/* Keeps a short run of text on one line (a credential's closing parenthesis). */
.nowrap {
  white-space: nowrap;
}

.visually-hidden,
.hp {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Layout ------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.band {
  padding-block: var(--band-space);
  background-color: var(--white);
}

.band--cream {
  background-color: var(--cream);
}

.band--navy {
  background-color: var(--navy);
}

.band > .wrap > :last-child,
.card > :last-child,
.prose > :last-child {
  margin-bottom: 0;
}

.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: clamp(20px, 3vw, 32px);
}

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

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

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

:is(ul, ol):is(.grid-2, .grid-3, .grid-4) {
  padding: 0;
  list-style: none;
}

/* ---------- Type --------------------------------------------------------- */

.eyebrow,
.stage-label {
  display: block;
  margin: 0 0 14px;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.lead {
  max-width: 40em;
  font-size: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem);
  line-height: 1.55;
  color: var(--text-soft);
}

.rule {
  display: block;
  width: 48px;
  height: 1px;
  margin: 20px 0 24px;
  border: 0;
  background-color: var(--brass);
}

.prose {
  max-width: 68ch;
}

.prose h2 {
  margin-top: 1.6em;
  font-size: clamp(1.5rem, 1.3rem + 0.8vw, 2rem);
}

.prose h3 {
  margin-top: 1.4em;
}

.prose :is(ul, ol) {
  padding-left: 1.25em;
}

.prose li + li {
  margin-top: 0.35em;
}

.prose blockquote {
  padding-left: 20px;
  border-left: 2px solid var(--brass);
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.4;
}

.prose table {
  display: block;
  max-width: 100%;
  margin: 0 0 1.5em;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.prose :is(th, td) {
  padding: 10px 14px 10px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.prose th {
  font-weight: 600;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 48px;
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn--brass {
  border-color: var(--brass);
  background-color: var(--brass);
  color: var(--navy);
}

.btn--brass:hover {
  border-color: var(--brass);
  background-color: color-mix(in srgb, var(--brass) 78%, var(--white));
}

.btn--outline {
  border-color: var(--ink);
  background-color: transparent;
  color: var(--ink);
}

.btn--outline:hover {
  background-color: var(--ink);
  color: var(--white);
}

.btn--outline-light {
  border-color: rgb(244 241 234 / 55%);
  background-color: transparent;
  color: var(--cream);
}

.btn--outline-light:hover {
  border-color: var(--cream);
  background-color: var(--cream);
  color: var(--navy);
}

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

/* ---------- Cards -------------------------------------------------------- */

.card {
  position: relative;
  padding: 28px 24px 26px;
  border-top: 2px solid var(--brass);
  background-color: var(--cream);
}

.band--cream .card {
  background-color: var(--white);
}

.band--navy .card {
  border: 1px solid var(--line);
  border-top: 2px solid var(--brass);
  background-color: transparent;
}

.card h3 {
  margin-bottom: 0.4em;
}

.card > :is(img, picture):first-child {
  width: calc(100% + 48px);
  max-width: none;
  margin: -28px -24px 22px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.card > picture:first-child img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- FAQ ---------------------------------------------------------- */

details.faq {
  border-bottom: 1px solid var(--line);
}

details.faq:first-of-type {
  border-top: 1px solid var(--line);
}

.faq > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 56px;
  padding: 16px 0;
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.3;
  color: var(--heading);
  list-style: none;
  cursor: pointer;
}

.faq > summary::-webkit-details-marker {
  display: none;
}

/* A plus that turns into a minus. */
.faq > summary::after {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  background:
    linear-gradient(var(--accent-text), var(--accent-text)) center / 100% 2px no-repeat,
    linear-gradient(var(--accent-text), var(--accent-text)) center / 2px 100% no-repeat;
  transition: background-size 0.2s ease;
}

.faq[open] > summary::after {
  background-size: 100% 2px, 2px 0;
}

.faq > :not(summary) {
  max-width: 68ch;
  padding-bottom: 20px;
}

.faq > :not(summary) > :last-child {
  margin-bottom: 0;
}

/* ---------- Forms -------------------------------------------------------- */

:where(input:not([type="checkbox"], [type="radio"], [type="file"], [type="hidden"], [type="submit"], [type="button"], [type="reset"], [type="image"], [type="range"], [type="color"]), select, textarea) {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid var(--muted);
  border-radius: var(--radius);
  background-color: var(--white);
  color: var(--ink);
  font: inherit;
  line-height: 1.4;
}

:where(textarea) {
  min-height: 140px;
  resize: vertical;
}

:where(input, select, textarea):focus-visible {
  border-color: var(--ink);
  outline-offset: 1px;
}

:where(input[type="file"]) {
  width: 100%;
  /* Form controls do not inherit the page font by default; without this the
     button and "No file chosen" fall back to the system font. */
  font: inherit;
  font-size: 0.9375rem;
}

:where(input[type="file"])::file-selector-button {
  min-height: 44px;
  margin-right: 14px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background-color: var(--white);
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 20px;
}

.field > label {
  font-size: 0.9375rem;
  font-weight: 500;
}

.field small {
  color: var(--text-soft);
  font-size: 0.875rem;
}

:is(input, select, textarea):is(.field-error, [aria-invalid="true"]),
.field.field-error :is(input, select, textarea) {
  border-color: var(--brass-dark);
  box-shadow: inset 0 0 0 1px var(--brass-dark);
}

.form-success,
.form-error {
  margin: 16px 0 0;
  padding: 14px 18px;
  border-left: 4px solid var(--navy);
  background-color: var(--cream);
  color: var(--ink);
  font-weight: 500;
}

.form-error {
  border-left-color: var(--brass-dark);
}

/* An input and its button on one line, e.g. the property report search. */
.inline-form {
  display: flex;
  gap: 8px;
}

.inline-form > :is(input, select) {
  flex: 1 1 auto;
  min-width: 0;
}

.inline-form > .btn {
  flex: none;
}

/* ---------- Breadcrumb and credentials ----------------------------------- */

.breadcrumb {
  margin-bottom: 16px;
  font-size: 0.875rem;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumb li {
  display: flex;
  align-items: center;
}

.breadcrumb li + li::before {
  content: "\203A";
  content: "\203A" / "";
  margin: 0 0.6em;
  color: var(--accent-text);
}

.breadcrumb a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: inherit;
}

.breadcrumb [aria-current="page"] {
  min-width: 0;
  color: var(--heading);
  font-weight: 500;
}

/* A long current page name (an article title) stays on one line and ends in an
   ellipsis on narrow screens; the h1 right below gives it in full. */
.breadcrumb [aria-current="page"] > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.credentials {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.credentials > li {
  padding: 20px 20px 0 0;
  font-size: 0.9375rem;
  line-height: 1.45;
}

.credentials > li + li {
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

/* ---------- Header and menu ---------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
}

.site-header > .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: var(--header-h);
}

.wordmark {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-height: 44px;
  color: var(--white);
  line-height: 1;
  text-decoration: none;
}

.wordmark__name {
  font-family: var(--serif);
  font-size: 1.375rem;
  letter-spacing: 0.005em;
}

.wordmark__tag {
  margin-top: 6px;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--brass);
}

.nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav a:not(.btn),
.dropdown > button {
  color: inherit;
  text-decoration: none;
}

.dropdown > button {
  margin: 0;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
}

/* Caret on the dropdown button; points up while open. */
.dropdown > button::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--brass);
  border-bottom: 1.5px solid var(--brass);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.2s ease;
}

.dropdown > button[aria-expanded="true"]::after {
  transform: translateY(2px) rotate(225deg);
}

.dropdown > button + * {
  display: none;
}

.dropdown > button[aria-expanded="true"] + * {
  display: grid;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  min-width: 44px;
  min-height: 44px;
  margin-left: auto;
  padding: 0 14px;
  border: 1px solid rgb(244 241 234 / 35%);
  border-radius: var(--radius);
  background: none;
  color: var(--cream);
  font: 500 0.875rem / 1 var(--font);
  cursor: pointer;
}

/* Three bars, crossed while the menu is open. */
.nav-toggle::before {
  content: "";
  width: 18px;
  height: 14px;
  background:
    linear-gradient(currentColor, currentColor) top / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) bottom / 100% 2px no-repeat;
}

.nav-toggle[aria-expanded="true"]::before {
  height: 18px;
  background:
    linear-gradient(45deg, transparent calc(50% - 1px), currentColor calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(-45deg, transparent calc(50% - 1px), currentColor calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px));
}

/* Wide screens: the menu sits in the header bar. */
@media (min-width: 1080px) {
  .nav {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto;
  }

  .nav > ul {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .nav > ul > li > a:not(.btn),
  .dropdown > button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 12px;
    font-size: 0.9375rem;
    font-weight: 500;
    white-space: nowrap;
    color: var(--cream);
  }

  /* site.js sets aria-current="page" on the link for the current page and
     "true" on a link (or the Services button) whose section it is in. */
  .nav > ul > li > a:not(.btn):hover,
  .dropdown > button:hover,
  .nav > ul > li > a[aria-current]:not(.btn),
  .dropdown > button[aria-current] {
    color: var(--white);
    box-shadow: inset 0 -2px var(--brass);
  }

  .dropdown {
    position: relative;
  }

  /* The panel is a light surface floating over the page. It hangs from the
     sticky header, so scrolling the page never brings a cut-off panel into
     view: on a short window (1280x600, or a 1366x768 laptop at 125% zoom) it
     stops 28px above the bottom and scrolls inside itself. It starts at most
     header-h + 14px down, so the reserve must stay at least 14px. */
  .dropdown > button + * {
    --text: var(--ink);
    --text-soft: var(--muted);
    --heading: var(--ink);
    --accent-text: var(--brass-dark);
    --focus: var(--brass-dark);
    --line: #dcd5c7;
    position: absolute;
    top: calc(100% + 14px);
    left: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 32px;
    width: min(560px, calc(100vw - 2 * var(--gutter)));
    max-height: calc(100vh - var(--header-h) - 28px);
    max-height: calc(100dvh - var(--header-h) - 28px);
    padding: 24px 28px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-top: 2px solid var(--brass);
    background-color: var(--white);
    color: var(--text);
    box-shadow: 0 18px 40px rgb(11 31 51 / 18%);
  }

  .dropdown > button + * > a {
    grid-column: 1 / -1;
  }

  /* For contractors is an audience, not a fifth stage: its own row under the
     four stages, with a rule above and its two links side by side, each under
     a stage column. */
  .dropdown__audience {
    grid-column: 1 / -1;
    padding-top: 20px;
    border-top: 1px solid var(--line);
  }

  .dropdown__audience > ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 32px;
  }

  .dropdown > button + * a:not(.btn) {
    display: flex;
    align-items: center;
    min-height: 44px;
    /* As .link-list a: a link that wraps starts level with one-line links. */
    padding-block: 9px;
    font-size: 0.9375rem;
  }

  .dropdown > button + * a:not(.btn):hover {
    text-decoration: underline;
    text-decoration-color: var(--brass);
  }

  .nav > ul > li:has(> .btn) {
    margin-left: 12px;
  }

  .nav .btn {
    min-height: 44px;
    padding-inline: 18px;
    white-space: nowrap;
  }
}

/* Narrow screens: a full-screen panel under the header bar. */
@media (max-width: 1079px) {
  :root {
    --header-h: 68px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav {
    position: fixed;
    inset: var(--header-h) 0 0;
    z-index: 49;
    display: none;
    flex-direction: column;
    gap: 28px;
    padding: 16px var(--gutter) 40px;
    overflow-y: auto;
    background-color: var(--navy);
  }

  .nav.is-open {
    display: flex;
  }

  html:has(.nav.is-open) {
    overflow: hidden;
  }

  .nav > ul > li {
    border-bottom: 1px solid var(--line);
  }

  .nav > ul > li:has(> .btn) {
    padding-top: 24px;
    border-bottom: 0;
  }

  .nav > ul > li > a:not(.btn),
  .dropdown > button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 60px;
    padding: 0;
    font-family: var(--serif);
    font-size: 1.5rem;
    color: var(--white);
    text-align: left;
  }

  .dropdown > button[aria-expanded="true"] + * {
    gap: 16px;
    padding: 0 0 20px;
  }

  .dropdown > button + * a:not(.btn) {
    display: flex;
    align-items: center;
    min-height: 44px;
  }

  .nav .btn {
    width: 100%;
  }
}

/* ---------- Hero and page head ------------------------------------------- */

/* Set --hero-img to a url() on the element; without it the band is plain navy. */
.hero {
  padding-block: clamp(88px, 12vw, 152px);
  background-color: var(--navy);
  background-image:
    linear-gradient(90deg, var(--navy) 0%, var(--navy) 40%, rgb(11 31 51 / 55%) 72%, rgb(11 31 51 / 20%) 100%),
    var(--hero-img, none);
  background-position: center, right center;
  background-size: cover;
  background-repeat: no-repeat;
}

.hero h1 {
  max-width: 14em;
  font-size: clamp(2.5rem, 1.7rem + 3.4vw, 4rem);
  line-height: 1.05;
}

.hero .lead {
  max-width: 30em;
}

.page-head {
  padding-block: clamp(48px, 7vw, 88px) clamp(44px, 6vw, 72px);
  background-color: var(--navy);
  background-image:
    linear-gradient(90deg, var(--navy) 0%, var(--navy) 35%, rgb(11 31 51 / 70%) 70%, rgb(11 31 51 / 40%) 100%),
    var(--hero-img, none);
  background-position: center, right center;
  background-size: cover;
  background-repeat: no-repeat;
}

.page-head h1 {
  max-width: 18em;
}

.page-head .actions {
  margin-top: 24px;
}

/* ---------- Service pages and overview ----------------------------------- */

/* "What we do": the cards are numbered 01, 02, 03. The list stays an <ol>; the
   numbers are drawn here. */
.steps {
  counter-reset: step;
}

.steps > li::before {
  content: counter(step, decimal-leading-zero);
  content: counter(step, decimal-leading-zero) / "";
  counter-increment: step;
  display: block;
  margin-bottom: 16px;
  font-family: var(--serif);
  font-size: 1.75rem;
  line-height: 1;
  color: var(--accent-text);
}

/* A card that is one big link: the link in the title stretches over the card. */
.card--link {
  transition: box-shadow 0.2s ease;
}

.card--link h3 a {
  color: inherit;
  text-decoration: none;
}

.card--link h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.card--link:hover {
  box-shadow: 0 12px 28px rgb(11 31 51 / 10%);
}

.card--link:hover h3 a {
  text-decoration: underline;
  text-decoration-color: var(--brass);
}

/* The focus ring goes around the whole card, not just the title. */
.card--link h3 a:focus-visible {
  outline: none;
}

.card--link h3 a:focus-visible::after {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* Tools of a stage on the services overview, under its service cards. */
.stage-tools {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.stage-tools .eyebrow {
  margin-bottom: 4px;
}

.stage-tools ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stage-tools a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 500;
}

/* Closing call to action: text on the left, the button on the right. */
.cta-band > .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 28px clamp(32px, 5vw, 72px);
}

.cta-band__text {
  flex: 1 1 26em;
}

.cta-band h2 {
  margin-bottom: 0.35em;
}

.cta-band .lead {
  margin: 0;
}

.cta-band .actions {
  margin-top: 0;
}

/* ---------- Home and About ----------------------------------------------- */

/* The home hero photo; phones get the 800 px file (see "Phones" below). */
.hero--home {
  --hero-img: url("/images/hero-home-1600.webp");
}

/* The property report search (partials/report-search.njk) and its note. */
.report-search-form {
  max-width: 640px;
  margin-top: 28px;
}

/* The band that holds the report itself, right under the page head on
   /property-report: less space above it, so the report's address field is on
   the first screen of a phone and of a 1366x657 laptop. */
.band--report {
  padding-top: clamp(24px, 4vw, 48px);
}

.small-print {
  margin: 14px 0 0;
  font-size: 0.875rem;
  color: var(--text-soft);
}

/* A single link under a band's content, e.g. "About Oleg Semucov". The gap keeps
   the space before a trailing arrow, which a flex container would drop. */
.more-link {
  margin: 28px 0 0;
}

.more-link a {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  min-height: 44px;
  font-weight: 500;
}

/* About: the headshot beside the bio. */
.profile {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: 32px clamp(32px, 5vw, 72px);
  align-items: start;
}

.profile__photo img {
  width: 100%;
  border-bottom: 2px solid var(--brass);
}

.profile h3 {
  margin-top: 1.4em;
  font-size: 1.25rem;
}

/* The languages on one line, separated by brass dots. */
.languages {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

.languages > li + li::before {
  content: "\00b7";
  content: "\00b7" / "";
  margin: 0 0.6em;
  color: var(--accent-text);
}

/* ---------- Boroughs, Insights, tools and 404 ---------------------------- */

/* Borough pages: the head takes the borough photo. The page sets --photo-lg
   (1600 px) and --photo-sm (800 px) on the element; phones get the small one
   (see "Phones"). The fade into navy is the one .page-head already draws. */
.page-head--photo {
  --hero-img: var(--photo-lg);
}

/* Services by stage on a borough page: each stage card holds a list of links. */
.borough-stages .stage-label {
  margin-bottom: 8px;
}

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

.link-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  /* One line sits centred in the 44px target; the padding makes a link that
     wraps to two lines start at the same height as its one-line neighbours. */
  padding-block: 8px;
  font-weight: 500;
}

/* The boroughs overview: three cards across, then two wider ones. */
.borough-cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 32px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.borough-cards > li {
  grid-column: span 2;
}

.borough-cards > li:nth-child(n + 4) {
  grid-column: span 3;
}

/* Insights: a date line above the title, and a title a size down from a service
   card's, because article titles are long. */
.card-meta {
  margin: 0 0 8px;
  font-size: 0.875rem;
  color: var(--text-soft);
}

.article-cards h3 {
  font-size: 1.25rem;
  line-height: 1.25;
}

/* An article: the head and the text share one narrow column. The title is a size
   down from other pages' headings (it is a sentence, not a name). */
.wrap--reading {
  max-width: 780px;
}

.article-head h1 {
  max-width: none;
  font-size: clamp(2rem, 1.55rem + 1.9vw, 2.75rem);
}

.byline {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-soft);
}

.byline__dot {
  margin: 0 0.4em;
  color: var(--accent-text);
}

.article-figure {
  margin: 0 0 36px;
}

.article-figure img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 2px solid var(--brass);
}

/* Safety-log templates: a card per PDF; the file details and the button sit at
   the bottom of the card, so a row of cards lines up. */
.template-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.template-card h3 + p {
  flex-grow: 1;
}

.template-cite {
  margin: 0 0 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent-text);
}

.template-meta {
  margin: 0 0 18px;
  font-size: 0.875rem;
  color: var(--text-soft);
}

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

.site-footer {
  padding-block: clamp(56px, 7vw, 80px) 32px;
  font-size: 0.9375rem;
}

.site-footer :is(h2, h3) {
  margin-bottom: 12px;
  font-size: 1.25rem;
}

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

.site-footer li a:not(.btn) {
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  /* As .link-list a: a link that wraps starts level with one-line links. */
  padding-block: 9px;
}

.site-footer a:not(.btn) {
  color: var(--cream);
  text-decoration-color: transparent;
}

.site-footer a:not(.btn):hover {
  color: var(--white);
  text-decoration-color: var(--brass);
}

/* Top row: the firm on the left, its contact details on the right. */
.site-footer__about {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 24px clamp(32px, 5vw, 72px);
  padding-bottom: 48px;
}

.site-footer__about .wordmark {
  margin-bottom: 18px;
}

.site-footer__about p {
  max-width: 34em;
  margin: 0;
  text-wrap: pretty;
}

.site-footer__contact {
  display: flex;
  flex-direction: column;
  font-style: normal;
}

.site-footer__contact a {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-width: 44px;
  min-height: 44px;
}

/* Services take half the width (two stages across), boroughs and company a quarter each. */
.site-footer__nav {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px clamp(24px, 3vw, 48px);
  padding-top: 48px;
  border-top: 1px solid var(--line);
}

.site-footer__nav h2:not(:first-child) {
  margin-top: 28px;
}

.site-footer__stages {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px clamp(24px, 3vw, 40px);
}

.site-footer__stages .stage-label {
  margin-bottom: 4px;
}

.site-footer__all {
  margin: 16px 0 0;
}

.site-footer__all a {
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
}

.site-footer__credentials {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.site-footer__credentials .stage-label {
  margin-bottom: 10px;
}

.site-footer__credentials ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 32px;
}

.site-footer__credentials li {
  font-size: 0.875rem;
}

.site-footer__legal {
  margin-top: 20px;
  font-size: 0.875rem;
}

.site-footer__legal p {
  max-width: 68ch;
  margin: 0;
}

/* ---------- Request a project review ------------------------------------- */

/* The contact details on the left, the form on the right. */
.review-layout {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

.review-layout h2 {
  font-size: clamp(1.5rem, 1.3rem + 0.8vw, 2rem);
}

.contact-list {
  margin: 0 0 1.5em;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.contact-list > li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
  min-height: 52px;
  border-bottom: 1px solid var(--line);
}

.contact-list__label {
  flex: 0 0 5.5em;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.contact-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* The form is a cream card with the brass rule on top. The messages sit on it in white. */
.lead-form {
  padding: clamp(24px, 4vw, 40px);
  border-top: 2px solid var(--brass);
  background-color: var(--cream);
}

.lead-form h2 {
  margin-bottom: 0.25em;
}

.lead-form > .small-print {
  margin: 0 0 24px;
}

.lead-form .btn {
  min-width: 240px;
}

.lead-form :is(.form-success, .form-error) {
  background-color: var(--white);
}

.lead-form .form-error {
  margin: 0 0 16px;
}

.form-success > p {
  margin-bottom: 0.5em;
}

.form-success > :last-child {
  margin-bottom: 0;
}

/* A send moves focus to the message so screen readers read it; it is not a control. */
.form-success:focus-visible {
  outline: none;
}

/* The extra line when a request arrived without its files: the visitor has something to do. */
.form-success__note {
  font-weight: 600;
}

/* Two fields side by side; one column on phones. A message under one field must not move the other. */
.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  column-gap: 20px;
}

/* The message under a field that failed the check; the field itself gets .field-error. */
.field .field-message {
  color: var(--brass-dark);
  font-weight: 500;
}

/* Below the menu breakpoint the form needs the full width: the contact details go above it. */
@media (max-width: 1079px) {
  .review-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 759px) {
  .form-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .contact-list__label {
    flex-basis: 100%;
  }

  .lead-form .btn {
    width: 100%;
  }
}

/* ---------- Permit Wizard ------------------------------------------------ */

/* A cream card with the brass rule on top; wizard.js draws everything inside it. */
.wizard {
  max-width: 820px;
  padding: clamp(24px, 4vw, 40px);
  border-top: 2px solid var(--brass);
  background-color: var(--cream);
}

.wizard__progress {
  height: 4px;
  margin-bottom: 28px;
  background-color: var(--line);
}

.wizard__bar {
  display: block;
  height: 100%;
  background-color: var(--brass);
  transition: width 0.3s ease;
}

/* A question or the result fades in. With reduced motion it simply appears. */
@media (prefers-reduced-motion: no-preference) {
  .wizard__step:not([hidden]),
  .wizard__result:not([hidden]) {
    animation: wizard-in 0.25s ease;
  }
}

@keyframes wizard-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* The question (and the result title) takes focus when it appears; it is not a control. */
.wizard__q {
  margin: 0 0 20px;
  font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.75rem);
}

.wizard__q:focus-visible {
  outline: none;
}

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

.wizard__option {
  min-height: 56px;
  padding: 12px 18px;
  border: 1px solid var(--muted);
  border-radius: var(--radius);
  background-color: var(--white);
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.wizard__option:hover {
  border-color: var(--ink);
  box-shadow: inset 3px 0 0 var(--brass);
}

.wizard__option.is-selected {
  border-color: var(--navy);
  background-color: var(--navy);
  color: var(--white);
  box-shadow: inset 3px 0 0 var(--brass);
}

.wizard__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
}

.wizard__back {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--brass);
  text-underline-offset: 0.22em;
  cursor: pointer;
}

.wizard__step-label {
  font-size: 0.875rem;
  color: var(--muted);
}

/* One card per part of the result: its list, then the service pages that help with it. */
.wizard__card {
  margin-bottom: 16px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  background-color: var(--white);
}

.wizard__card h3 {
  margin-bottom: 0.5em;
  font-size: 1.125rem;
}

.wizard__card ul {
  margin: 0 0 12px;
  padding-left: 1.25em;
}

.wizard__card li + li {
  margin-top: 0.4em;
}

.wizard__related {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--muted);
}

.wizard__related a {
  color: var(--ink);
  font-weight: 500;
}

.wizard__disclaimer {
  margin: 24px 0 0;
  font-size: 0.9375rem;
  color: var(--muted);
}

.wizard__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

@media (max-width: 759px) {
  .wizard__options {
    grid-template-columns: minmax(0, 1fr);
  }

  .wizard__actions > .btn {
    flex: 1 1 100%;
  }
}

/* ---------- Medium screens ----------------------------------------------- */

/* Card grids drop columns before the cards get narrow: four across only at the
   full .wrap width (1180px and up), three across from 1024px, two across below
   that, and one below 760px (Phones). */
@media (max-width: 1179px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1023px) {
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .borough-cards > li,
  .borough-cards > li:nth-child(n + 4) {
    grid-column: auto;
  }

  .borough-cards > li:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

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

  .credentials > li,
  .credentials > li + li {
    padding: 16px 0;
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .site-footer__services {
    grid-column: 1 / -1;
  }
}

/* ---------- Phones: one column ------------------------------------------- */

@media (max-width: 759px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: minmax(0, 1fr);
  }

  .borough-cards {
    grid-template-columns: minmax(0, 1fr);
  }

  .borough-cards > li:last-child:nth-child(odd) {
    grid-column: auto;
  }

  .credentials,
  .site-footer__about,
  .site-footer__nav,
  .site-footer__stages {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-footer__credentials ul {
    flex-direction: column;
  }

  .actions > .btn {
    flex: 1 1 100%;
  }

  .cta-band .actions {
    width: 100%;
  }

  .inline-form {
    flex-direction: column;
  }

  .hero {
    padding-block: 72px 64px;
    background-image:
      linear-gradient(180deg, rgb(11 31 51 / 80%) 0%, rgb(11 31 51 / 92%) 100%),
      var(--hero-img, none);
    background-position: center;
  }

  .hero--home {
    --hero-img: url("/images/hero-home-800.webp");
  }

  .page-head {
    background-image:
      linear-gradient(180deg, rgb(11 31 51 / 85%) 0%, rgb(11 31 51 / 94%) 100%),
      var(--hero-img, none);
  }

  .page-head--photo {
    --hero-img: var(--photo-sm);
  }

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

  .profile__photo {
    max-width: 360px;
  }

  .faq > summary {
    font-size: 1.125rem;
  }
}

/* ---------- Motion ------------------------------------------------------- */

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
