/*
 * Shared base stylesheet. Loaded before each site's own stylesheet.
 *
 * Deliberately minimal: a reset, accessibility affordances, and the contact
 * form's state machine. Everything visual belongs in the per-site stylesheet.
 */

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

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

body {
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

ul[role='list'],
ol[role='list'] {
  list-style: none;
  margin: 0;
  padding: 0;
}

a {
  text-decoration: none;
}

/* --- Accessibility ------------------------------------------------------ */

/*
 * Visible focus ring on every interactive element. Uses the site's accent via
 * --focus-ring, falling back to currentColor so it is never invisible.
 */
:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--focus-ring, currentColor);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Screen-reader-only text that still receives focus. */
.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;
}

/* Skip link: off-screen until focused, then pinned to the top-left. */
.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 999;
  padding: 12px 20px;
  background: var(--skip-link-bg, #fff);
  color: var(--skip-link-fg, #000);
  transform: translateY(-120%);
  transition: transform 0.18s ease;
}

.skip-link:focus-visible {
  transform: translateY(0);
}

/*
 * Honour the OS "reduce motion" setting everywhere. Scripts that drive
 * animation imperatively (the OOD hero canvas, the scroll reveal) check the
 * same media query themselves rather than relying on this.
 */
@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;
  }
}

/* --- Contact form states ------------------------------------------------ */
/* Driven by contact-form.js, which toggles data-state on the form's wrapper. */

[data-contact-form] [data-contact-success] {
  display: none;
}

[data-contact-form][data-state='sent'] [data-contact-success] {
  display: block;
}

[data-contact-form][data-state='sent'] form {
  display: none;
}

/* The honeypot must be unreachable to people but present to naive bots: no
   display:none, which some bots detect and skip. */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

[data-contact-status] {
  min-height: 1.4em;
}

[data-contact-status][data-tone='error'] {
  color: var(--status-error, #d9534f);
}

[data-contact-status][data-tone='pending'] {
  color: var(--status-pending, inherit);
}

button[data-contact-submit][disabled] {
  opacity: 0.55;
  cursor: progress;
}
