[x-cloak] { display: none !important; }
.skip-link { position: fixed; top: 10px; left: 10px; z-index: 300; padding: 12px; background: var(--color-home-paper); color: var(--color-home-green); transform: translateY(-150%); }
.skip-link:focus { transform: none; }
:where(a, button):focus-visible { outline: 2px solid var(--color-orange); outline-offset: 5px; }

header.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  display: block;
  color: var(--color-home-green);
  background: transparent;
  isolation: isolate;
  transition: color 260ms ease;

  &::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--color-home-paper); opacity: 1; pointer-events: none; transition: opacity 260ms ease, box-shadow 260ms ease; }
  &.is-home { color: var(--color-home-white); }
  &.is-home::before { opacity: 0; }
  &.is-scrolled { color: var(--color-home-green); }
  &.is-scrolled::before { opacity: 1; box-shadow: 0 1px 12px rgb(0 0 0 / .08); }
  & .site-header__bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; min-height: 98px; padding-inline: 3vw; }
  & .site-header__toggle { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; margin-left: calc(3vw - 12px); border: 0; background: none; color: inherit; cursor: pointer; }
  & .site-header__toggle img, & .site-header__logo img { filter: brightness(0) saturate(100%); transition: filter 260ms ease; }
  &.is-home:not(.is-scrolled) .site-header__toggle img, &.is-home:not(.is-scrolled) .site-header__logo img { filter: brightness(1) saturate(100%); }
  & .site-header__logo { display: flex; align-items: center; gap: 12px; }
  & .site-header__logo img { display: block; max-width: none; }
  & .button { justify-self: end; margin: 0; }
  & .button .inner { padding: 15px 20px; background: var(--color-home-paper); color: var(--color-home-green); font-size: 16px; display: flex; align-items: center; }
  & .button .inner span { display: inline-flex; margin-left: 20px; }
  & .button::before { bottom: -4px; }
  & .site-header__flyout { position: fixed; inset: 0; z-index: 3; overflow: hidden; }
  & .site-header__overlay { position: absolute; inset: 0; background: rgb(0 0 0 / .25); }
  & .site-header__panel { position: relative; width: min(calc(100% - 24px), 32rem); height: 100dvh; padding: 24px 40px 40px; box-sizing: border-box; overflow-y: auto; overscroll-behavior: contain; background: var(--color-home-paper); color: var(--color-home-green); box-shadow: -200px 0 0 var(--color-home-paper), 8px 0 32px rgb(0 0 0 / .12); }
  & .site-header__panel-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 40px; }
  & .site-header__flyout-logo { display: flex; align-items: center; gap: 12px; min-width: 0; }
  & .site-header__flyout-logo img { display: block; max-width: none; filter: brightness(0) saturate(100%); }
  & .site-header__flyout-logo img:first-child { flex-shrink: 0; }
  & .site-header__flyout-logo img:last-child { min-width: 0; height: auto; }
  & .site-header__close { display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; }
  & .site-header__close:hover { background: var(--color-dark-creme); border-radius: 50%; }
  & .site-header__menu { padding: 0; display: grid; gap: 18px; white-space: normal; }
  & .site-header__menu a { padding: 8px 0; margin: 0; width: fit-content; max-width: 100%; overflow-wrap: anywhere; font-size: 22px; text-decoration: none; }
  & .site-header__menu a:first-child { margin-left: 0; }
  & .site-header__menu a:hover { text-decoration: underline; text-underline-offset: 5px; }
  /* Motion (global.js → siteNavigation) launches the panel with a bouncy spring. The panel's -200px
     paper-coloured shadow fills the gap the overshoot would otherwise open at the viewport's left edge.
     While the right edge bends (clip-path), a +96px paper shadow gives the outward bulge room to paint. */
  & .site-header__panel.is-bending { box-shadow: -200px 0 0 var(--color-home-paper), 96px 0 0 var(--color-home-paper); }
  & .site-header__flyout-logo img:first-child { transform-origin: 50% 100%; }
}

@media (prefers-reduced-motion: reduce) {
  header.site-header,
  header.site-header::before,
  header.site-header .site-header__toggle img,
  header.site-header .site-header__logo img { transition: none; }
}

footer.site-footer {
  display: flex;
  flex-direction: column;
  min-height: 495px;
  box-sizing: border-box;
  padding: 0;
  color: var(--color-home-white);
  background: var(--color-sea) url('/assets/img/footer-pattern.webp') center / cover;

  & .site-footer__center { flex: 1; display: flex; align-items: center; justify-content: center; gap: 24px; font-size: 20px; padding: 80px 6vw; }
  & .site-footer__center img { flex-shrink: 0; }
  & .site-footer__bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 24px; padding: 0 2vw 18px; font-size: 16px; }
  & nav { display: flex; flex-wrap: wrap; gap: 25px; }
  & nav a { text-decoration: none; }
  & nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
  & .site-footer__copyright { white-space: nowrap; }
}

@media screen and (max-width:800px) {
  header.site-header {
    & .site-header__bar { grid-template-columns: 44px minmax(0, 1fr) auto; min-height: 80px; padding-inline: 5vw; gap: 8px; }
    & .site-header__toggle { margin-left: -12px; }
    & .site-header__logo { gap: 6px; justify-self: center; }
    & .site-header__logo img:first-child { display: none; }
    & .button .inner { padding: 12px; font-size: 12px; white-space: normal; text-align: center; max-width: clamp(64px, calc(100vw - 270px), 190px); box-sizing: border-box; }
    & .button .inner span { display: none; }
    & .site-header__panel { padding: 18px 24px 32px; }
    & .site-header__flyout-logo { gap: 6px; }
  }
  footer.site-footer {
    min-height: 420px;
    & .site-footer__center { font-size: 16px; gap: 16px; padding-block: 72px; }
    & .site-footer__bottom { flex-direction: column; gap: 28px; padding: 0 6vw 28px; text-align: center; font-size: 14px; }
    & nav { justify-content: center; column-gap: 20px; row-gap: 16px; }
  }
}
