/* ============================================================
   M'ARRICRIO — BASE / RESET
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  width: 100%;
}

@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;
  }
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg-body);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
img { border-style: none; }
picture { display: contents; }

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  color: var(--text-heading);
  line-height: var(--lh-tight);
  margin: 0 0 var(--space-4);
  font-weight: 700;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
h1 { font-size: var(--fs-h1); font-weight: 600; }
h2 { font-size: var(--fs-h2); font-weight: 600; }
h3 { font-size: var(--fs-h3); font-weight: 600; }
h4 { font-size: var(--fs-h4); font-weight: 700; }

p { margin: 0 0 var(--space-4); color: var(--text-body); }
p:last-child { margin-bottom: 0; }

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

ul, ol { margin: 0; padding: 0; list-style: none; }

button {
  font-family: inherit;
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

svg { fill: currentColor; }

::selection {
  background: var(--c-orange);
  color: var(--c-white);
}

:focus-visible {
  outline: 2.5px solid var(--c-orange-dark);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  background: var(--c-espresso);
  color: var(--c-cream-soft);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  z-index: 200;
  transition: top var(--dur-base) var(--ease-out);
}
.skip-link:focus { top: var(--space-4); }

/* Screen-reader only */
.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;
}

/* ---- Layout helpers ---- */
.container {
  width: 100%;
  max-width: var(--container-w);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section {
  padding-block: var(--section-pad-y);
  position: relative;
}

.section--alt { background: var(--bg-surface-alt); }
.section--dark {
  background: var(--bg-inverse);
  color: var(--text-inverse);
}
.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4 {
  color: var(--text-inverse);
}
.section--dark p { color: rgb(247 239 220 / 0.82); }
.section--tight { padding-block: clamp(2.5rem, 2rem + 2vw, 4rem); }

/* Grid/flex children default to min-width:auto, which lets long headings
   blow out their track and overflow the viewport. Force them to respect
   the available column width everywhere in the layout. */
.container, .container * {
  min-width: 0;
}

main { display: block; }

.visually-hidden-focusable:not(:focus):not(:focus-within) {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}
