/* Buldes 2006 — Audit inquiry mockup
   Evolution of existing palette; not a generic redesign. */

:root {
  --bg: #5c5b57;
  --bg-deep: #4e4c47;
  --bg-soft: #6a6862;
  --cream: #f2eedf;
  --cream-soft: #fff1c9;
  --sand: #a79f84;
  --stone: #9c998f;
  /* Logo / AD house blue (site accent #0a4f8d, logo dominant ~#084898) */
  --brand-blue: #0a4f8d;
  --brand-blue-deep: #084898;
  --brand-blue-soft: #1d5ba0;
  --text: #e6e5e3;
  --text-muted: #d0d0d0;
  --text-dim: #b4b2ab;
  --ink: #1c1c1a;
  --line: rgba(242, 238, 223, 0.22);
  --focus: #7aa3d4;
  --danger: #c9a090;
  --radius: 2px;
  /* Content column matches chrome (header/nav) width — one shared measure */
  --page: 58rem;
  --max: var(--page);
  --chrome-gutter: 0.5rem;
  --sticky-z: 40;
  --font-display: "Source Serif 4", "Times New Roman", serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text-muted);
  background-color: var(--bg);
  background-image:
    linear-gradient(180deg, rgba(78, 76, 71, 0.55) 0%, transparent 28%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 3px,
      rgba(0, 0, 0, 0.03) 3px,
      rgba(0, 0, 0, 0.03) 4px
    );
}

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

a {
  color: var(--cream-soft);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover,
a:focus-visible {
  color: var(--cream);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--cream);
  color: var(--ink);
  padding: 0.5rem 0.75rem;
  z-index: 1000;
}

.skip-link:focus {
  left: 0.75rem;
  top: 0.75rem;
}

.page {
  width: min(100% - 2rem, var(--page));
  margin: 0 auto;
  padding: 1.25rem 0 5rem;
}

/* Only the menu bar sticks; brand header scrolls away */

/* —— Top bar —— */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.92rem;
}

.langs {
  display: flex;
  gap: 0.65rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.langs a {
  color: var(--text-dim);
  text-decoration: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.langs a[aria-current="page"] {
  color: var(--cream);
  border-bottom: 1px solid var(--sand);
}

.contact-quick {
  color: var(--text-dim);
  text-decoration: none;
}

.contact-quick:hover {
  color: var(--cream);
}

/* —— Brand header —— */
.brand-header {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem 1.5rem;
  align-items: end;
  padding: 1.75rem 1.5rem 1.5rem;
  margin-bottom: 0;
  background-color: var(--cream);
  background-image:
    linear-gradient(135deg, rgba(242, 238, 223, 0.92), rgba(167, 159, 132, 0.35)),
    url("../images/headerbg.jpg");
  background-image:
    linear-gradient(135deg, rgba(242, 238, 223, 0.92), rgba(167, 159, 132, 0.35)),
    image-set(
      url("../images/headerbg.webp") type("image/webp"),
      url("../images/headerbg.jpg") type("image/jpeg")
    );
  background-size: cover;
  background-position: center;
  color: var(--ink);
  animation: fade-rise 0.7s ease-out both;
}

.brand-copy {
  min-width: 0;
}

.brand-name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.55rem, 3.2vw, 2.15rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.brand-tagline {
  margin: 0.45rem 0 0;
  font-size: 0.98rem;
  color: #4e4c47;
  letter-spacing: 0.02em;
}

.brand-logo {
  width: 5.5rem;
  height: auto;
  border-radius: 2px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}

/* Keep logo/grid layout when WebP <picture> wraps the img */
.brand-header > picture {
  display: contents;
}

.content-figure > picture {
  display: contents;
}

/* —— Nav —— */
.site-nav {
  position: sticky;
  top: 0;
  z-index: var(--sticky-z);
  display: flex;
  align-items: center;
  gap: 0.35rem 0.75rem;
  background: rgba(28, 28, 26, 0.96);
  border-top: 1px solid rgba(0, 0, 0, 0.18);
  border-bottom: 1px solid var(--line);
  margin-bottom: 2rem;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.28);
  /* sticky + relative: containing block for .site-nav-progress */
  isolation: isolate;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  flex: 1 1 auto;
  min-width: 0;
  gap: 0.15rem 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0.35rem var(--chrome-gutter);
}

/* Compact logo on the right — only while stuck (header scrolled away) */
.site-nav a.site-nav-logo {
  display: none;
  flex: 0 0 auto;
  align-items: center;
  margin: 0.25rem var(--chrome-gutter) 0.25rem 0;
  padding: 0;
  line-height: 0;
  text-decoration: none;
  box-shadow: none;
  color: inherit;
}
.site-nav a.site-nav-logo img {
  width: 2.55rem;
  height: auto;
  border-radius: 1px;
  box-shadow: 0 0 0 1px rgba(242, 238, 223, 0.12);
}
.site-nav.is-stuck a.site-nav-logo {
  display: inline-flex;
}

/* Mobile sticky bar wordmark — hidden on desktop */
.site-nav-brand {
  display: none;
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--cream);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-nav-brand:hover,
.site-nav-brand:focus-visible {
  color: #fff;
}

.site-nav ul a {
  position: relative;
  display: block;
  padding: 0.55rem 0.7rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
  /* Keyboard uses underline (::after); mouse click must not leave a ring */
  outline: none;
}

/* Underline: grow L→R on enter; shrink R→L on leave (transform-origin flip) */
.site-nav ul a::after {
  content: "";
  position: absolute;
  left: 0.7rem;
  right: 0.7rem;
  bottom: 0.22rem;
  height: 2.5px;
  background: var(--brand-blue);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.28s ease;
  pointer-events: none;
  z-index: 1;
}

.site-nav ul a:hover::after,
.site-nav ul a:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left center;
}

.site-nav ul a:hover,
.site-nav ul a:focus-visible {
  color: #ffffff;
  outline: none; /* underline is the keyboard affordance — no ring */
}

.site-nav ul a[aria-current="page"] {
  color: var(--brand-blue-soft);
}

.site-nav ul a[aria-current="page"]::after {
  transform: scaleX(1);
  transform-origin: left center;
}

.site-nav ul a[aria-current="page"]:hover,
.site-nav ul a[aria-current="page"]:focus-visible {
  color: #5d8fc4;
}

/*
 * Scroll progress — brand bar on the bottom edge of sticky nav.
 * Width matches .site-nav only (not 100vw). Stay INSIDE sticky (bottom:0):
 * Chrome clips overflow of position:sticky ancestors.
 */
.site-nav-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: auto;
  height: 6px; /* 2× previous 3px */
  margin: 0;
  pointer-events: none;
  background: transparent;
  overflow: hidden;
  z-index: 5;
}

.site-nav-progress-bar {
  display: block;
  height: 100%;
  width: 100%;
  background: #0a4f8d;
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .site-nav ul a::after {
    transition: none;
  }
}

/* —— Content —— */
/* Same column as header/nav (.page width); gutters match nav horizontal padding */
.main {
  width: 100%;
  max-width: none;
  padding-inline: var(--chrome-gutter);
  animation: fade-rise 0.85s ease-out 0.08s both;
}

.intro {
  display: flow-root; /* allow figure to sit inline with justified copy */
  margin-bottom: 2.25rem;
  max-width: none;
  width: 100%;
}

.intro-lead {
  margin: 0 0 1rem;
  font-size: 1.12rem;
  color: var(--text);
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

.page-title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.65rem, 3vw, 2.1rem);
  line-height: 1.25;
  color: var(--cream);
  text-align: left;
  clear: both;
}

.section {
  margin: 2.5rem 0;
  max-width: none;
  width: 100%;
}

.section h2,
.inquiry h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--cream);
}

.section h3 {
  margin: 1.5rem 0 0.6rem;
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--cream-soft);
}

.section p,
.inquiry p {
  margin: 0 0 1rem;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

.section h2,
.section h3,
.inquiry h2,
.page-title,
.inline-cta,
.form-grid,
.form-actions,
.consent,
.home-service-links {
  text-align: left;
  hyphens: manual;
}

/* Contemporary check bullets inspired by live check.png — logo blue, no overflow */
.service-list,
.criteria-list {
  margin: 0.5rem 0 0;
  padding-left: 0;
  list-style: none;
}

.service-list li,
.criteria-list li {
  position: relative;
  margin-bottom: 0.75rem;
  padding-left: 1.85rem; /* hanging indent — wrapped lines stay clear of bullet */
  list-style: none;
  list-style-type: none;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  overflow-wrap: anywhere;
}

.service-list li::before,
.criteria-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.32em;
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 3px;
  background-color: var(--brand-blue);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.2l2.8 2.8 6.2-6.2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 0.7rem 0.7rem;
  pointer-events: none;
}

.cred {
  clear: both; /* never sit beside a floated content figure */
  margin: 1rem 0 0;
  padding-left: 0.85rem;
  border-left: 2px solid var(--brand-blue);
  color: var(--text);
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

.inline-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  margin-top: 1.5rem;
  clear: both;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  padding: 0.55rem 1.2rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

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

.btn-primary {
  background: var(--brand-blue);
  color: #fff;
  border-color: var(--brand-blue-deep);
}

.btn-primary:hover {
  background: var(--brand-blue-soft);
  color: #fff;
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--cream);
  border-color: var(--brand-blue);
}

.btn-ghost:hover {
  border-color: var(--brand-blue-soft);
  color: #fff;
  background: rgba(10, 79, 141, 0.22);
}

/* Call button — variant 2: logo-blue outline + phone icon */
.btn-call {
  background: transparent;
  color: #f5f7fa;
  border-color: var(--brand-blue);
  gap: 0.5rem;
}

.btn-call-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.btn-call:hover,
.btn-call:focus-visible {
  color: #fff;
  border-color: var(--brand-blue);
  background: rgba(10, 79, 141, 0.28);
}

/* —— Inquiry form —— */
.inquiry {
  margin: 3rem 0 2rem;
  padding: 1.75rem 0 0;
  border-top: 1px solid var(--line);
  max-width: none;
  width: 100%;
  scroll-margin-top: 4.5rem; /* clear sticky nav */
  animation: fade-rise 0.9s ease-out 0.15s both;
}

.inquiry-lede {
  color: var(--text-dim);
  margin-bottom: 1.5rem;
  text-align: justify;
}

.form-grid {
  display: grid;
  gap: 1rem;
}

.field-group {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.field-group legend {
  padding: 0;
  margin: 0 0 0.55rem;
  font-size: 0.92rem;
  color: var(--cream);
}

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

.field.is-hidden,
.field-row.is-hidden {
  display: none !important;
}

.field label {
  font-size: 0.92rem;
  color: var(--cream);
}

.field .hint {
  font-size: 0.82rem;
  color: var(--text-dim);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--stone);
  border-radius: var(--radius);
  background: rgba(28, 28, 26, 0.35);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.35;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #8f8c84;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
  border-color: var(--brand-blue);
}

.field input.is-invalid,
.field select.is-invalid,
.field textarea.is-invalid {
  border-color: #d64545;
  outline: 2px solid #d64545;
  outline-offset: 0;
  box-shadow: none;
}

.field input.is-invalid:focus,
.field select.is-invalid:focus,
.field textarea.is-invalid:focus {
  border-color: #d64545;
  outline-color: #d64545;
}

.consent.is-invalid input,
.consent input.is-invalid {
  outline: 2px solid #d64545;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px rgba(214, 69, 69, 0.28);
}

.field select {
  appearance: none;
  /* Darker gray than shared field fill so dropdowns read clearly on taupe chrome */
  background-color: #3a3935;
  background-image: linear-gradient(45deg, transparent 50%, var(--cream) 50%),
    linear-gradient(135deg, var(--cream) 50%, transparent 50%);
  background-position: calc(100% - 1.15rem) 1.15rem, calc(100% - 0.75rem) 1.15rem;
  background-size: 0.4rem 0.4rem, 0.4rem 0.4rem;
  background-repeat: no-repeat;
  padding-right: 2.25rem;
}
.field select option {
  background-color: #3a3935;
  color: var(--text);
}

.field textarea {
  min-height: 7rem;
  resize: vertical;
}

.field-row {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .field-row {
    grid-template-columns: 1fr 1fr;
  }

  .field-row-3 {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  align-items: start;
  margin-top: 0.25rem;
}

.consent input {
  margin-top: 0.3rem;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--brand-blue);
}

.consent label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
  margin-top: 0.5rem;
}

.form-note {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.form-success {
  display: none;
  margin-top: 1rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
  color: var(--cream);
  font-family: var(--font-display);
}

.form-success.is-visible {
  display: block;
  animation: fade-rise 0.45s ease-out both;
}

.form-error {
  display: none;
  margin: 0.25rem 0 0;
  color: var(--danger);
  font-size: 0.9rem;
}

.form-error.is-visible {
  display: block;
}

/* —— Floating CTA (vertical side pill) —— */
.float-cta {
  position: fixed;
  right: 0;
  top: 50%;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 0.85rem 0.55rem;
  border: 1px solid var(--brand-blue-deep);
  border-right: 0;
  border-radius: 4px 0 0 4px;
  background: var(--brand-blue);
  color: #fff;
  text-decoration: none;
  box-shadow: -4px 6px 18px rgba(0, 0, 0, 0.28);
  transform: translateY(-50%);
  animation: float-in 0.55s ease-out 0.4s both;
  transition: background-color 0.2s ease, padding 0.2s ease;
}

.float-cta-text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.1;
  white-space: nowrap;
}

.float-cta:hover,
.float-cta:focus-visible {
  background: var(--brand-blue-soft);
  color: #fff;
  padding-right: 0.7rem;
}

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

.float-cta[hidden] {
  display: none !important;
}

/* —— Back to top (bottom-right; below float CTA lane) —— */
.back-to-top {
  position: fixed;
  right: 0.85rem;
  bottom: 1rem;
  z-index: 55;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--brand-blue-deep);
  border-radius: var(--radius);
  background: var(--brand-blue);
  color: #fff;
  cursor: pointer;
  box-shadow: -2px 4px 14px rgba(0, 0, 0, 0.28);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(0.5rem);
  transition:
    opacity 0.22s ease,
    visibility 0.22s ease,
    transform 0.22s ease,
    background-color 0.2s ease;
}
.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.back-to-top:hover,
.back-to-top:focus-visible {
  background: var(--brand-blue-soft);
  color: #fff;
}
.back-to-top:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.back-to-top-icon {
  width: 1.1rem;
  height: 1.1rem;
  display: block;
}
@media (max-width: 899px) {
  .back-to-top {
    /* Pin to far right; do not shift left for float CTA */
    right: max(0.5rem, env(safe-area-inset-right, 0px));
    bottom: max(0.85rem, env(safe-area-inset-bottom, 0px));
    width: 2.55rem;
    height: 2.55rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .back-to-top {
    transition: none;
  }
}

/* —— Footer —— */
.site-footer {
  margin-top: 3rem;
  padding: 1.25rem var(--chrome-gutter) 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 1rem;
  row-gap: 0.35rem;
  font-size: 0.88rem;
  color: var(--text-dim);
}

.site-footer > a:not(.cookie-settings-link) {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  white-space: nowrap;
  text-align: left;
}

.site-footer a {
  color: var(--text-dim);
  text-decoration: none;
}

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

.cookie-settings-link {
  appearance: none;
  grid-column: 1;
  grid-row: 2;
  justify-self: start;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: inherit;
  color: var(--text-dim);
  text-decoration: none;
  white-space: nowrap;
  text-align: left;
  cursor: pointer;
}
.cookie-settings-link:hover,
.cookie-settings-link:focus-visible {
  color: var(--cream);
  text-decoration: none;
}
.cookie-settings-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.site-footer > .footer-copy,
.site-footer > span {
  grid-column: 2;
  grid-row: 1 / -1;
  justify-self: end;
  align-self: start;
  white-space: nowrap;
  text-align: right;
}

@media (max-width: 720px) {
  .site-footer {
    font-size: 0.8rem;
    grid-template-columns: 1fr;
    row-gap: 0.45rem;
    column-gap: 0;
  }
  .site-footer > a:not(.cookie-settings-link) {
    grid-column: 1;
    grid-row: auto;
    white-space: normal;
    overflow-wrap: anywhere;
    max-width: 100%;
  }
  .cookie-settings-link {
    grid-column: 1;
    grid-row: auto;
    white-space: normal;
  }
  .site-footer > .footer-copy,
  .site-footer > span {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
    align-self: start;
    text-align: left;
    white-space: normal;
  }
}

/* —— Cookie consent banner (Consent Mode v2) —— */
.cookie-consent {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 300;
  padding: 1rem;
  pointer-events: none;
}
.cookie-consent[hidden] {
  display: none !important;
}
.cookie-consent-panel {
  pointer-events: auto;
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.15rem 1.25rem 1.25rem;
  background: #1c1c1a;
  border: 1px solid rgba(242, 238, 223, 0.22);
  border-top: 3px solid #0a4f8d;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.35);
  color: var(--text-muted);
}
.cookie-consent-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--cream);
}
.cookie-consent-body {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  line-height: 1.55;
  text-align: left;
}
.cookie-consent-policy {
  color: #7aa3d4;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.cookie-consent-policy:hover,
.cookie-consent-policy:focus-visible {
  color: #fff;
}
.cookie-consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.75rem;
}
.cookie-consent-btn {
  appearance: none;
  min-height: 44px;
  padding: 0.55rem 1.1rem;
  border-radius: 2px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
}
.cookie-consent-accept {
  background: #0a4f8d;
  border-color: #084898;
  color: #fff;
}
.cookie-consent-accept:hover,
.cookie-consent-accept:focus-visible {
  background: #1d5ba0;
}
.cookie-consent-reject {
  background: transparent;
  border-color: rgba(242, 238, 223, 0.35);
  color: var(--cream);
}
.cookie-consent-reject:hover,
.cookie-consent-reject:focus-visible {
  border-color: var(--cream);
}
.cookie-consent-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
@media (max-width: 520px) {
  .cookie-consent {
    padding: 0.65rem;
  }
  .cookie-consent-actions {
    flex-direction: column;
  }
  .cookie-consent-btn {
    width: 100%;
  }
}

/* —— Cookie policy modal —— */
.cookie-policy-modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.cookie-policy-modal[hidden] {
  display: none !important;
}
.cookie-policy-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 9, 0.72);
}
.cookie-policy-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(40rem, 100%);
  max-height: min(85vh, 44rem);
  background: #1c1c1a;
  border: 1px solid rgba(242, 238, 223, 0.22);
  border-top: 3px solid #0a4f8d;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  color: var(--text-muted);
}
.cookie-policy-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem 0.65rem 1.15rem;
  border-bottom: 1px solid rgba(242, 238, 223, 0.12);
  flex-shrink: 0;
}
.cookie-policy-heading {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--cream);
}
.cookie-policy-close {
  appearance: none;
  flex-shrink: 0;
  margin-left: auto;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(242, 238, 223, 0.28);
  border-radius: 2px;
  background: transparent;
  color: var(--cream);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.cookie-policy-close:hover,
.cookie-policy-close:focus-visible {
  border-color: var(--cream);
}
.cookie-policy-close:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.cookie-policy-scroll {
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0.85rem 1.15rem 1.25rem;
  outline: none;
}
.cookie-policy-body .page-title {
  margin-top: 0;
  font-size: 1.35rem;
}
.cookie-policy-body .section {
  margin: 0;
}
.cookie-policy-body h2 {
  margin-top: 1.15rem;
}
.cookie-policy-status {
  margin: 0.5rem 0;
}
html.cookie-policy-open {
  overflow: hidden;
}
@media (max-width: 520px) {
  .cookie-policy-modal {
    padding: 0.5rem;
  }
  .cookie-policy-panel {
    max-height: 92vh;
  }
}

.mockup-badge {
  margin-top: 1.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--stone);
}

@keyframes fade-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(12px);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 720px) {
  .page {
    width: min(100%, var(--page));
    padding-top: 0.85rem;
    /* L/R padding inherited from ≤899px — keep equal CTA-matched gutters */
  }

  .brand-header {
    grid-template-columns: 1fr;
    padding: 1.35rem 1.1rem 1.2rem;
  }

  .brand-logo {
    width: 4.5rem;
    order: -1;
  }

  .site-nav ul {
    gap: 0;
  }

  .site-nav ul a {
    padding: 0.5rem 0.55rem;
    font-size: 0.86rem;
  }

  .inline-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .inline-cta .btn {
    width: 100%;
  }

  .field-row-3 {
    grid-template-columns: 1fr;
  }

  .float-cta {
    padding: 0.7rem 0.45rem;
  }

  .float-cta-text {
    font-size: 0.86rem;
  }
}


/* —— Production additions: mobile nav panel (site-nav.js) —— */
.site-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--brand-blue-deep);
  border-radius: 3px;
  background: var(--brand-blue);
  cursor: pointer;
  z-index: 220; /* above drawer + backdrop; body-level fixed */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.site-nav-toggle-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.28rem;
  width: 1.15rem;
}
.site-nav-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: #fff;
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.site-nav-toggle.is-active .site-nav-bar:nth-child(1) {
  transform: translateY(0.34rem) rotate(45deg);
}
.site-nav-toggle.is-active .site-nav-bar:nth-child(2) { opacity: 0; }
.site-nav-toggle.is-active .site-nav-bar:nth-child(3) {
  transform: translateY(-0.34rem) rotate(-45deg);
}
.site-nav-toggle:hover,
.site-nav-toggle:focus-visible {
  background: var(--brand-blue-soft);
}
.site-nav-toggle:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.site-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(20, 20, 18, 0.55);
}
.site-nav-backdrop[hidden] { display: none !important; }

/* Scroll lock without inline body.style (friendlier on iOS fixed layers) */
html.site-nav-open,
html.site-nav-open body {
  overflow: hidden;
  touch-action: none;
}

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

/* Contacts map + details — legacy side-by-side layout (map left, details right) */
.contacts-map-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1.75rem 2.75rem;
  margin: 1.35rem 0 1.85rem;
  padding: 1.15rem 1.1rem 1.35rem 1.15rem; /* room for legacy map frame shadow */
}
#map-canvas {
  position: relative;
  flex: 0 0 350px;
  width: 350px;
  height: 370px;
  margin: 0.35rem 0;
  padding: 0;
  background: #e8e4d8;
  overflow: hidden;
  /* Match live/main frame: thin black + taupe mat + outer drop */
  border-radius: 5px;
  box-shadow:
    0 0 0 2px #000,
    0 0 0 15px #75726b,
    2px 2px 5px 17px rgba(0, 0, 0, 0.85);
}
#map-canvas * {
  border-style: none;
  border-radius: 0;
  box-shadow: none;
  text-shadow: none;
}
#contacts {
  position: relative;
  flex: 1 1 16rem;
  min-width: min(100%, 14rem);
  margin: 0.35rem 0 0;
  color: var(--cream);
}
#contacts .contacts-line {
  margin: 0 0 0.85rem;
  line-height: 1.45;
  text-align: left;
}
#contacts .contacts-line strong {
  color: var(--cream-soft);
  font-weight: 600;
}
#contacts .contacts-social {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  margin: 0.35rem 0 0.9rem;
}
#contacts .contacts-social img {
  display: block;
  width: 16px;
  height: 16px;
}
#contacts .contacts-qr {
  display: block;
  width: 140px;
  height: 140px;
  margin: 0.35rem 0 0;
  border-radius: 1px;
  outline: 1px solid rgba(242, 238, 223, 0.12);
}
@media (max-width: 900px) {
  .contacts-map-row {
    flex-direction: column;
    gap: 1.5rem;
  }
  #map-canvas {
    flex: 0 0 auto;
    width: min(100%, 22rem);
    max-width: 100%;
    height: 320px;
    margin: 0.5rem auto;
  }
  #contacts {
    width: 100%;
  }
}

/* Inline photos — sit in the text column, not floating cards */
.content-figure {
  float: left;
  width: min(100%, 13.5rem);
  margin: 0.15rem 1.35rem 0.95rem 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.content-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 1px;
  border: 0;
  outline: 1px solid rgba(242, 238, 223, 0.12);
  outline-offset: 0;
  box-shadow: none;
  /* Soften into taupe/cream chrome — not a floating card */
  filter: saturate(0.88) contrast(0.95) brightness(0.97);
  opacity: 0.97;
}
.intro .content-figure,
.section .content-figure {
  shape-outside: margin-box;
}
.intro::after,
.section::after {
  content: "";
  display: table;
  clear: both;
}
/* Home C1: office photo floats; «За нас» wraps like old live Home */
.home-about-figure {
  float: left;
  width: min(100%, 14.5rem);
  margin: 0.15rem 1.35rem 0.95rem 0;
}
.home-about .inline-cta,
.home-about .home-service-links {
  clear: both;
}
.home-hero .intro-lead {
  max-width: none;
  width: 100%;
  margin-bottom: 0;
}

.topbar {
  position: relative;
}

@media (max-width: 899px) {
  .page {
    /* Equal L/R content gutter — same inset as full-width CTA buttons */
    display: flex;
    flex-direction: column;
    width: min(100%, var(--page));
    margin-inline: auto;
    padding-top: 0.5rem;
    padding-left: max(1.125rem, env(safe-area-inset-left, 0px));
    padding-right: max(1.125rem, env(safe-area-inset-right, 0px));
  }
  /* Sticky nav above headerbg: topbar → nav → brand-header → main → footer */
  .page > .topbar { order: 1; }
  .page > .site-nav { order: 2; }
  .page > .brand-header { order: 3; }
  .page > .main { order: 4; }
  .page > .site-footer { order: 5; }
  .main {
    padding-inline: 0; /* page owns the mobile gutter */
  }
  .site-footer {
    padding-left: 0;
    padding-right: 0;
  }
  .topbar {
    padding-right: 0;
  }
  /* Duplicate logo lives in sticky nav — hide brand-header mark on mobile */
  .brand-header .brand-logo {
    display: none;
  }
  .brand-header {
    grid-template-columns: 1fr;
    /* Same content column as .main text — page gutters, not full-bleed */
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
  }
  /* Sticky gray mobile bar: logo + brand left, burger right, progress bottom */
  .site-nav {
    --mobile-nav-h: 3.35rem;
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    z-index: 220; /* above drawer + backdrop */
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.55rem;
    min-height: var(--mobile-nav-h);
    margin-bottom: 0; /* headerbg sits directly under the bar */
    /* Full-bleed across page gutters */
    margin-left: calc(-1 * max(1.125rem, env(safe-area-inset-left, 0px)));
    margin-right: calc(-1 * max(1.125rem, env(safe-area-inset-right, 0px)));
    padding: 0.35rem max(0.65rem, env(safe-area-inset-right, 0px)) 0.45rem max(0.75rem, env(safe-area-inset-left, 0px));
    background: #3f3e3a; /* same gray as mobile drawer */
    border-top: 1px solid #c9c5b8; /* light-gray outline */
    border-bottom: 1px solid #c9c5b8;
    border-left: none;
    border-right: none;
    box-shadow: none;
    isolation: isolate;
  }
  .site-nav a.site-nav-logo,
  .site-nav.is-stuck a.site-nav-logo {
    display: inline-flex !important;
    order: 1;
    margin: 0;
    flex: 0 0 auto;
  }
  .site-nav a.site-nav-logo img {
    width: 2.15rem;
  }
  .site-nav-brand {
    display: block;
    order: 2;
    flex: 1 1 auto;
  }
  .site-nav-toggle {
    display: inline-flex;
    order: 3;
    position: relative;
    top: auto;
    right: auto;
    flex: 0 0 auto;
    margin-left: auto;
    width: 2.55rem;
    height: 2.55rem;
    min-width: 0;
    min-height: 0;
    z-index: 221;
  }
  .site-nav-progress {
    display: block; /* same scroll progress as desktop sticky nav */
  }
  .site-nav ul {
    position: fixed;
    /* JS sets --mobile-nav-offset to sticky bar bottom (handles pre-stick layout) */
    top: var(--mobile-nav-offset, var(--mobile-nav-h));
    right: 0;
    left: auto;
    z-index: 210;
    display: block !important;
    width: min(20.5rem, 88vw);
    height: calc(100vh - var(--mobile-nav-offset, var(--mobile-nav-h)));
    height: calc(100dvh - var(--mobile-nav-offset, var(--mobile-nav-h)));
    margin: 0;
    padding: 0.5rem 0 1.75rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    background: #3f3e3a; /* previous drawer gray — distinct from page/nav */
    border-left: 1px solid rgba(242, 238, 223, 0.18);
    box-shadow: -10px 0 28px rgba(0, 0, 0, 0.35);
    transform: translate3d(105%, 0, 0);
    transition: transform 0.22s ease, visibility 0.22s;
    pointer-events: none;
    visibility: hidden; /* keep closed drawer out of tab order */
  }
  html.site-nav-open .site-nav ul,
  .site-nav.is-open ul,
  body.site-nav-open .site-nav ul {
    transform: translate3d(0, 0, 0);
    pointer-events: auto;
    visibility: visible;
  }
  .site-nav li {
    display: block;
    width: 100%;
  }
  .site-nav ul a {
    display: flex;
    align-items: center;
    min-height: 48px; /* touch-friendly hit target */
    padding: 0.85rem 1.25rem;
    font-size: 1.05rem;
    border-bottom: 1px solid rgba(242, 238, 223, 0.12);
  }
  /* Mobile drawer: solid left rail for current; underline still for keyboard */
  .site-nav ul a::after {
    left: 1.25rem;
    right: 1.25rem;
    bottom: 0.45rem;
  }
  .site-nav ul a[aria-current="page"] {
    background: rgba(10, 79, 141, 0.35);
    box-shadow: inset 3px 0 0 var(--brand-blue);
    color: #fff;
  }
  .inline-cta {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .inline-cta .btn {
    width: 100%;
    max-width: none;
    min-width: 0;
  }
  /*
   * Content photos: same full column width as stacked CTA buttons.
   * Clears the desktop float/min-width caps for all service/home figures.
   */
  .content-figure,
  .home-about-figure,
  .home-offer .content-figure {
    float: none;
    width: 100%;
    max-width: none;
    margin: 0.35rem 0 1rem;
    shape-outside: none;
  }
  .content-figure img,
  .home-about-figure img,
  .home-offer .content-figure img {
    width: 100%;
    max-width: none;
    height: auto;
  }
  .home-offer {
    grid-template-columns: 1fr;
  }
  /*
   * Pages with sticky float-cta: inset body prose + inline CTAs equally
   * L/R so they clear the side pill. Buttons stay full-width inside that lane.
   */
  body:has(#float-cta) {
    --prose-clear-float: 1.4rem; /* ~float lane + gap; mirrored both sides */
  }
  body:has(#float-cta) .brand-header,
  body:has(#float-cta) .intro-lead,
  body:has(#float-cta) .page-title,
  body:has(#float-cta) .section h2,
  body:has(#float-cta) .section h3,
  body:has(#float-cta) .section p,
  body:has(#float-cta) .cred,
  body:has(#float-cta) .inquiry-lede,
  body:has(#float-cta) .inquiry p,
  body:has(#float-cta) .content-figure,
  body:has(#float-cta) .home-about-figure,
  body:has(#float-cta) .home-offer .content-figure,
  body:has(#float-cta) .service-list,
  body:has(#float-cta) .criteria-list,
  body:has(#float-cta) .inline-cta {
    margin-inline: var(--prose-clear-float);
    max-width: calc(100% - 2 * var(--prose-clear-float));
    width: auto;
  }
}

/* Ensure form fonts match mockup */
.inquiry,
.field input,
.field select,
.field textarea,
.btn {
  font-family: var(--font-body);
}


/* —— Home hero + sitewide polish (phases B–C) —— */
.home-hero .brand-hero-title {
  font-size: clamp(1.85rem, 4vw, 2.55rem);
  margin-bottom: 0.85rem;
}
.home-service-links {
  margin: 1.1rem 0 0;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}
.home-service-links a {
  color: var(--cream);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-color: rgba(10, 79, 141, 0.65);
}
.home-service-links a:hover {
  color: #fff;
  text-decoration-color: var(--brand-blue);
}
.home-service-links span {
  margin: 0 0.45rem;
  opacity: 0.55;
}
.section h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  margin: 1.75rem 0 0.65rem;
  color: var(--cream);
}
/* Home “We offer” — image + bullets same row (grid on desktop; stack on mobile) */
.home-offer {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem 1.25rem;
  margin: 0 0 1.75rem;
  align-items: start;
}
.home-offer:last-child {
  margin-bottom: 0;
}
.home-offer h3 {
  grid-column: 1 / -1;
  clear: both;
  margin-top: 0.35rem;
  margin-bottom: 0.15rem;
}
.home-offer .content-figure {
  float: none;
  /* Mobile-first: full content/CTA column. Desktop caps in ≥721px below.
     Do NOT use min(100%, 11.5rem) here — it sits after the ≤899px full-width
     rules and would keep offer photos at ~184px on phones. */
  width: 100%;
  max-width: none;
  margin: 0.15rem 0 0.35rem;
  shape-outside: none;
}
.home-offer .service-list {
  clear: none;
  margin: 0.15rem 0 0;
  overflow: visible;
}
.home-offer .service-list li {
  text-align: left; /* short bullets — avoid justify rivers beside image */
  overflow-wrap: break-word;
}
.home-offer .inline-cta {
  grid-column: 1 / -1;
  clear: both;
  margin-top: 0.85rem;
}

@media (min-width: 721px) {
  .home-offer {
    grid-template-columns: min(11.5rem, 32%) minmax(0, 1fr);
  }
  .home-offer .content-figure {
    width: 100%;
    max-width: 11.5rem;
    margin: 0.15rem 0 0;
  }
  .home-offer .service-list {
    margin-top: 0.15rem;
  }
}
img[loading="lazy"] {
  content-visibility: auto;
}

@media (max-width: 720px) {
  /* Stack spacing + reassert full CTA width (beats any earlier desktop cap) */
  .home-offer .content-figure {
    width: 100%;
    max-width: none;
    margin: 0.35rem 0 0.85rem;
  }
  .home-offer .service-list {
    overflow: visible;
  }
  /* Mobile: justify body copy like the old site (not buttons/nav) */
  .intro-lead,
  .home-about p,
  .section p,
  .cred,
  .inquiry-lede {
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
    overflow-wrap: break-word;
  }
  .service-list li,
  .criteria-list li {
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
    overflow-wrap: break-word;
    padding-left: 1.9rem;
  }
  /* Keep float-CTA clear aligned with ≤899px figure/CTA lane */
  body:has(#float-cta) .content-figure,
  body:has(#float-cta) .home-about-figure,
  body:has(#float-cta) .home-offer .content-figure {
    margin-left: var(--prose-clear-float);
    margin-right: var(--prose-clear-float);
    max-width: calc(100% - 2 * var(--prose-clear-float));
  }
  body:has(#float-cta) .brand-header,
  body:has(#float-cta) .intro-lead,
  body:has(#float-cta) .home-about p,
  body:has(#float-cta) .page-title,
  body:has(#float-cta) .section h2,
  body:has(#float-cta) .section h3,
  body:has(#float-cta) .section p,
  body:has(#float-cta) .cred,
  body:has(#float-cta) .inquiry-lede,
  body:has(#float-cta) .inquiry p,
  body:has(#float-cta) .service-list,
  body:has(#float-cta) .criteria-list,
  body:has(#float-cta) .inline-cta {
    margin-inline: var(--prose-clear-float);
    max-width: calc(100% - 2 * var(--prose-clear-float));
    width: auto;
  }
}
