/* -- 1. Box model + text sizing --- */
*,
*::before,
*::after { box-sizing: border-box; }

img {cursor: pointer !important;}

html {
  -webkit-text-size-adjust: 100%;   /* iOS Safari: stop auto-inflating text on rotate */
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Stop the sticky header covering #work / #connect when jumping to an anchor */
  scroll-padding-top: 88px;
}

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

/* -- 2. Mobile / touch --- */
a,
button,
[role="button"] { -webkit-tap-highlight-color: transparent; }

/* ---- 3. Media defaults ---- */
img { border-style: none; }

svg:not([fill]) { fill: currentColor; }

/* ---- 4. Form controls inherit typography (Safari/Firefox differ) ---------- */
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; }

/* ---- 5. Accessible focus ring (only for keyboard users) ------------------- */
:focus-visible {
  outline: 2px solid #5b7553;
  outline-offset: 2px;
  border-radius: 2px;
}

:focus:not(:focus-visible) { outline: none; }

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

/* ---- 6. Respect reduced-motion preferences ----- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- 7. Print ---------- */
@media print {
  body { background: #fff !important; }

  header,
  nav,
  footer,
  video,
  canvas { display: none !important; }

  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; }