/* ==========================================================================
   Jennifer Ellis Celebrant — base layer
   Reset, document defaults, accessibility helpers, print.
   Tokens live in tokens.css; components in components.css; pages in pages.css.
   ========================================================================== */

@layer reset, base, layout, components, pages, utilities;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body { min-height: 100svh; line-height: 1.5; -webkit-font-smoothing: antialiased; }
  img, picture, video, canvas, svg { display: block; max-width: 100%; }
  img, video { height: auto; }
  input, button, textarea, select { font: inherit; color: inherit; }
  button { background: none; border: 0; padding: 0; cursor: pointer; }
  p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
  ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
  a { color: inherit; }
  address { font-style: normal; }
  summary { cursor: pointer; list-style: none; }
  summary::-webkit-details-marker { display: none; }
  :target { scroll-margin-top: 6rem; }
}

@layer base {
  html {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 100%;
    scroll-behavior: smooth;
    hanging-punctuation: first last;
  }
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
  }
  body {
    font-size: var(--text-body);
    line-height: var(--leading-body);
    font-optical-sizing: auto;
    text-rendering: optimizeLegibility;
    font-kerning: normal;
    font-variant-ligatures: common-ligatures;
  }
  h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: var(--weight-display);
    line-height: var(--leading-display);
    letter-spacing: var(--tracking-display);
    color: var(--green);
    text-wrap: balance;
  }
  h1 { font-size: var(--text-h1); }
  h2 { font-size: var(--text-h2); }
  h3 { font-size: var(--text-h3); font-weight: var(--weight-display-strong); }
  h4 { font-size: var(--text-h4); font-weight: var(--weight-display-strong); }
  p, li { max-width: var(--measure); text-wrap: pretty; }
  p + p { margin-top: var(--space-m); }
  strong { font-weight: 600; }
  em { font-style: italic; }
  a:not([class]) {
    color: var(--green);
    text-decoration: underline;
    text-decoration-thickness: from-font;
    text-underline-offset: 0.18em;
    text-decoration-color: var(--sage);
    transition: color var(--dur-colour) var(--ease-still), text-decoration-color var(--dur-colour) var(--ease-still);
  }
  a:not([class]):hover { color: var(--green-deep); text-decoration-color: currentColor; }
  :focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
    border-radius: 2px;
  }
  ::selection { background: var(--mint); color: var(--green-deep); }
  hr {
    border: 0;
    height: 1px;
    background: var(--hairline);
    margin: var(--space-xl) 0;
  }
}

@layer utilities {
  .visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
    white-space: nowrap; border: 0;
  }
  .skip-link {
    position: absolute;
    top: 0; left: 0;
    z-index: 100;
    padding: var(--space-s) var(--space-m);
    background: var(--green);
    color: var(--paper);
    font-family: var(--font-ui);
    font-weight: 600;
    text-decoration: none;
    transform: translateY(-120%);
    transition: transform 150ms ease-out;
  }
  .skip-link:focus { transform: translateY(0); }
  .measure { max-width: var(--measure); }
  .measure-narrow { max-width: var(--measure-narrow); }
  .center { margin-inline: auto; }
  .text-center { text-align: center; }
  .flow > * + * { margin-top: var(--flow, var(--space-m)); }
  .flow-l { --flow: var(--space-l); }
  .mt-xl { margin-top: var(--space-xl); }
  .ui { font-family: var(--font-ui); }
  .small { font-size: var(--text-small); }
  .muted { color: var(--ink-muted); }
}

@media print {
  [data-ambient] video, .site-header__toggle, .skip-link, .hero__media { display: none !important; }
  body { background: #fff; color: #000; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; }
}
