*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--color-ink);
  background: var(--color-cream);
  font-family: var(--font-sans);
  line-height: 1.5;
  /* Defensive: a full-bleed section's negative margin (e.g.
     .featured-categories) or any other edge-to-edge visual effect must
     never let the whole page scroll horizontally at narrow widths. */
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

/* The `hidden` attribute is how every page here toggles optional blocks, but
   the browser's own `[hidden] { display: none }` loses to any class that sets
   `display` (`.alert { display: flex }`, `.chip-list { display: flex }`…) —
   which silently revealed blocks meant to stay hidden until an action, such
   as the contact panel on a professional's profile. */
[hidden] {
  display: none !important;
}

.container {
  max-width: var(--layout-max);
  margin: 0 auto;
  padding-left: var(--layout-gutter);
  padding-right: var(--layout-gutter);
}

/* Full-bleed band whose *content* still lines up with .container. Used by the
   redesigned header, hero and the dark sections of the public pages so a
   coloured background can run edge to edge without a wrapper element in every
   page's markup. */
.bleed {
  padding-left: max(var(--layout-gutter), calc((100% - var(--layout-max)) / 2 + var(--layout-gutter)));
  padding-right: max(var(--layout-gutter), calc((100% - var(--layout-max)) / 2 + var(--layout-gutter)));
}

/* Vertical rhythm for the long public pages (home, professional profile). */
.section {
  padding: var(--space-8) 0;
}

.section__head {
  max-width: 640px;
  margin: 0 0 var(--space-6);
}

.section__head h2 {
  margin: 0 0 var(--space-3);
  font-size: var(--font-heading-lg);
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.section__head p {
  margin: 0;
  color: var(--color-muted);
  font-size: var(--font-body-lg);
}

/* Centred variant for the wide, banded sections (trust). */
.section__head--center {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.section__head--center .eyebrow {
  justify-content: center;
}

/* Title on the left, a "see everything" link on the right. */
.section__head--row {
  max-width: none;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
}

.section__head--row > div {
  max-width: 640px;
}

@media (max-width: 700px) {
  :root {
    --layout-gutter: 20px;
  }

  .section {
    padding: var(--space-7) 0;
  }
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-ink);
  color: var(--color-white);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  z-index: 100;
}

.skip-link:focus {
  left: var(--space-3);
  top: var(--space-3);
}

/* Visible focus ring on every interactive element (Design System §4.2). */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--color-accent-dark);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
