/* ==========================================================================
   Reset — opinionated, minimal, accessibility-preserving
   ========================================================================== */

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

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: auto; /* Lenis owns smooth scrolling; native would double up. */
}

body {
  min-height: 100%;
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

/* `hidden` must beat component display rules — several panels are toggled
   with the attribute and are laid out with flex/grid when visible. */
[hidden] {
  display: none !important;
}

img,
video {
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  letter-spacing: inherit;
}

button {
  cursor: pointer;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: inherit;
  font-size: inherit;
  line-height: inherit;
}

ul[role="list"],
ol[role="list"],
ul.list-reset,
ol.list-reset {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Focus: one rule for the whole site. Never remove the ring, only replace it
   with a better one. `outline` follows border-radius natively, so rounded
   controls get a rounded ring without any per-component override. */
:focus-visible {
  outline: 2px solid var(--bs-lime);
  outline-offset: 3px;
}

.section--light :focus-visible {
  outline-color: #6f8a05;
}

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

/* Physical feedback on press — every button, one rule. */
button:active,
.btn:active,
[role="button"]:active {
  transform: scale(0.97);
}

/* Images resolve in rather than popping. Armed by js/main.js only once the
   load handlers are attached, so a dead script never hides the photography. */
html.img-fade img {
  opacity: 0;
  transition: opacity 520ms var(--ease-out-quart);
}

html.img-fade img.is-loaded {
  opacity: 1;
}

/* Anchor targets clear the fixed navbar. */
:target,
[id] {
  scroll-margin-top: calc(var(--nav-h) + 24px);
}

/* --- Branded scrollbar --------------------------------------------------- */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--bs-line) var(--bs-carbon);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bs-carbon);
}

::-webkit-scrollbar-thumb {
  background: var(--bs-line);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--bs-lime);
}

/* Visually hidden but available to assistive tech. */
.sr-only {
  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 {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: calc(var(--z-preloader) + 1);
  padding: 12px 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
  color: var(--bs-black);
  background: var(--bs-lime);
  transform: translate(-50%, -140%);
  transition: transform var(--dur) var(--ease-out-quart);
}

.skip-link:focus-visible {
  transform: translate(-50%, 0);
}

::selection {
  color: var(--bs-black);
  background: var(--bs-lime);
}
