/* Layout and navigation (owner: UI/UX). Mobile first, one page with six anchor links.
   Only uses the designer's tokens, with fallbacks so a palette change never breaks it. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 1rem; }

.skip-link { position: absolute; left: -999px; top: 0; padding: 0.5rem var(--space); background: var(--color-bg); color: var(--color-accent); border: 2px solid var(--color-accent); z-index: 20; }
.skip-link:focus { left: var(--space); top: var(--space); }

.site-header { z-index: 10; background: var(--color-bg); border-bottom: 3px solid var(--color-accent); }
.site-title { margin: 0 0 0.25rem; font-family: var(--font-heading); font-size: 1.35rem; font-weight: bold; color: var(--color-accent); line-height: 1.2; }
.site-header ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; }
.site-header nav a { display: block; padding: 0.6rem 0.75rem; min-height: 44px; text-decoration: none; border-bottom: 3px solid transparent; }
.site-header nav a:hover { border-bottom-color: var(--color-accent); }
.site-header nav a[aria-current="true"] { font-weight: bold; border-bottom-color: var(--color-accent); }
.site-header nav a:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }

main { max-width: 42rem; margin: 0 auto; padding: var(--space); overflow-wrap: break-word; }
main section { padding: 1.5rem 0; }
main section + section { border-top: 1px solid var(--color-accent); }
main h1 { font-size: 2rem; line-height: 1.2; margin-top: 0; }
main h2 { font-size: 1.5rem; line-height: 1.25; margin-top: 0; }
main :focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }

.site-footer { max-width: 42rem; margin: 1rem auto 0; font-size: 0.9rem; }

@media (min-width: 40rem) {
  /* Sticky only where the header is short; nav.js sets --header-h to its real height. */
  html { scroll-padding-top: calc(var(--header-h, 6rem) + 1rem); }
  .site-header { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: var(--space); }
  .site-title { margin: 0; font-size: 1.5rem; }
  main h1 { font-size: 2.75rem; }
  main section { padding: 2.5rem 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
