/* Of Heart and Hand — scroll-responsive homepage introduction.
   Version 20261112transform2: deploy with home-header.js and index.html.
   The home header is fixed only while JavaScript is available; an equally tall
   space remains in normal flow to prevent scroll anchoring or jumping. */
.home-page .home-header-shell {
  position: static;
  isolation: isolate;
  /* Match the page's solid paper. Translucent overlays and blur produced
     visible seams/edge shadows as the fixed header crossed content. */
  background: var(--paper);
  border-bottom: 1px solid transparent;
  box-shadow: none;
  transition: border-color 260ms ease;
}
.home-page .home-header-space { width: 100%; }
.home-page.has-home-header-js .home-header-shell {
  --home-progress: 0;
  --home-title-big: clamp(35px,5.7vw,56px);
  --home-title-small: clamp(22px,2.6vw,29px);
  --home-emblem-size: 40px;
  --home-hero-top: clamp(15px,2.5vh,28px);
  --home-hero-bottom: 14px;
  --home-nav-bottom: clamp(18px,3vh,26px);
  --home-nav-bottom-small: 7px;
  --home-nav-padding-y: 8px;
  --home-nav-padding-x: 12px;
  position: fixed;
  top: 0;
  left: 50%;
  width: calc(100vw - 2 * var(--page-padding));
  max-width: calc(var(--page-width) - 2 * var(--page-padding));
  transform: translateX(-50%);
  z-index: 106;
}
.home-page .home-header-shell.is-scrolled {
  background-color: var(--paper);
  border-color: rgba(85,118,105,.14);
  box-shadow: none;
}
/* Deliberately no backdrop-filter: a fixed translucent header casts ghost
   edges against the centred page, particularly while scrolling upwards. */
/* Values are smoothly interpolated with --home-progress, which the tiny
   homepage script updates using requestAnimationFrame on scroll. */
.home-page.has-home-header-js .home-header-shell > header.home-intro {
  overflow: hidden;
  padding-top: calc(var(--home-hero-top) * (1 - var(--home-progress)) + 7px * var(--home-progress));
  padding-bottom: calc(var(--home-hero-bottom) * (1 - var(--home-progress)) + 1px * var(--home-progress));
}
.home-page.has-home-header-js .home-emblem {
  height: calc(var(--home-emblem-size) * (1 - var(--home-progress)));
  max-height: calc(var(--home-emblem-size) * (1 - var(--home-progress)));
  margin-bottom: calc(5px * (1 - var(--home-progress)));
  opacity: max(0, calc(1 - var(--home-progress) * 1.5));
  transform: translateY(calc(-7px * var(--home-progress)));
  overflow: hidden;
}
.home-page.has-home-header-js .home-header-shell > header.home-intro h1 {
  font-size: calc(var(--home-title-big) * (1 - var(--home-progress)) + var(--home-title-small) * var(--home-progress));
  margin-bottom: calc(7px * (1 - var(--home-progress)));
  color: var(--ink);
  transition: color 260ms ease;
}
.home-page.has-home-header-js .home-header-shell.is-scrolled > header.home-intro h1 {
  color: #465b50;
}
.home-page.has-home-header-js .home-header-shell > header.home-intro p {
  max-height: calc(var(--home-desc-height,85px) * (1 - var(--home-progress)));
  opacity: max(0, calc(1 - var(--home-progress) * 2.2));
  overflow: hidden;
}
.home-page.has-home-header-js .home-header-shell .home-collection-nav {
  margin-top: calc(3px + 1px * var(--home-progress));
  margin-bottom: calc(var(--home-nav-bottom) * (1 - var(--home-progress)) + var(--home-nav-bottom-small) * var(--home-progress));
}
.home-page.has-home-header-js .home-header-shell .home-collection-nav a {
  padding: calc(var(--home-nav-padding-y) * (1 - var(--home-progress)) + 5px * var(--home-progress))
           calc(var(--home-nav-padding-x) * (1 - var(--home-progress)) + 10px * var(--home-progress));
  transition: transform 200ms ease, background-color 230ms ease,
              border-color 230ms ease, color 230ms ease;
}
.home-page .home-header-shell.is-scrolled .home-collection-nav a { color: #6c7e73; }
.home-page .home-header-shell .home-collection-nav a.is-in-view {
  color: var(--accent-dark);
  background: #e9f1e8;
  border-color: #aec5b3;
}
.home-page .home-header-shell .home-collection-nav a:hover,
.home-page .home-header-shell .home-collection-nav a:focus-visible {
  color: var(--ink);
  background: #f2f7f0;
  border-color: #b9cbbc;
}
.home-page [id] { scroll-margin-top: calc(var(--home-sticky-height, 85px) + 15px); }
@media (max-width:650px) {
  .home-page.has-home-header-js .home-header-shell {
    --home-title-big: clamp(34px,9vw,43px);
    --home-title-small: clamp(20px,5.5vw,23px);
    --home-emblem-size: 36px;
    --home-hero-top: 15px;
    --home-hero-bottom: 12px;
    --home-nav-bottom: 18px;
    --home-nav-bottom-small: 4px;
    --home-nav-padding-y: 7px;
    --home-nav-padding-x: 10px;
  }
  .home-page.has-home-header-js .home-header-shell > header.home-intro {
    padding-top: calc(15px * (1 - var(--home-progress)) + 6px * var(--home-progress));
    padding-bottom: calc(12px * (1 - var(--home-progress)) + 2px * var(--home-progress));
  }
  .home-page.has-home-header-js .home-header-shell .home-collection-nav {
    margin-top: calc(3px * (1 - var(--home-progress)) + 2px * var(--home-progress));
  }
  /* On phones, free the reading area once the hero has compacted.
     Collapse the title's actual reserved height, rather than making it only
     transparent (which left a large blank band above the navigation). */
  .home-page.has-home-header-js .home-header-shell > header.home-intro .home-brand h1 {
    max-height: calc(var(--home-title-height, 100px) * (1 - var(--home-progress)));
    opacity: max(0, calc(1 - var(--home-progress) * 1.45));
    overflow: hidden;
    transform: translateY(calc(-5px * var(--home-progress)));
  }
  /* The mobile nav stays on a single, fully visible row at all scroll
     positions. The active collection uses an underline, not a pill. */
  .home-page .home-header-shell .home-collection-nav {
    display:flex; flex-wrap:nowrap; justify-content:space-between;
    width:100%; gap:clamp(2px,1vw,8px); padding:0 2px;
    overflow:visible;
  }
  .home-page .home-header-shell .home-collection-nav::after {
    display:none; content:none;
  }
  .home-page.has-home-header-js .home-header-shell .home-collection-nav a {
    min-height:40px; padding:calc(10px - 4px * var(--home-progress)) 1px
            calc(8px - 2px * var(--home-progress));
    border:0; border-bottom:2px solid transparent; border-radius:0;
    background:transparent;
    font-size:clamp(11px,3.15vw,13px);
    line-height:1.2; white-space:nowrap; letter-spacing:-.012em;
  }
  .home-page .home-header-shell .home-collection-nav a.is-in-view {
    color:var(--accent-dark); border-bottom-color:var(--accent-dark);
    background:transparent;
  }
  .home-page .home-header-shell .home-collection-nav a:hover,
  .home-page .home-header-shell .home-collection-nav a:focus-visible {
    color:var(--ink); background:transparent;
    border-bottom-color:#b9cbbc;
  }
}
@media (prefers-reduced-motion:reduce) {
  .home-page .home-header-shell,
  .home-page .home-header-shell :is(.home-emblem,h1,p,.home-collection-nav,.home-collection-nav a) {
    transition: none !important;
  }
}
@media print {
  .home-page .home-header-shell { position: static !important; background: transparent; box-shadow: none; }
  .home-page .home-header-space { height: auto !important; }
}

/* 20261112balanced1: centre the sprig above the site title, not beside it.
   Its reserved height and opacity ease to zero as the header compacts. */
.home-page .home-header-shell .home-brand {
  display:flex; flex-direction:column; justify-content:center; align-items:center;
  width:100%; max-width:100%; min-width:0; gap:0;
}
.home-page .home-header-shell .home-brand h1,
.home-page .home-header-shell > header.home-intro .home-brand h1 {
  width:100%; max-width:100%; flex:0 1 auto; margin:0 auto 7px;
  text-align:center; white-space:normal;
}
.home-page .home-header-shell .home-brand .home-emblem {
  display:block; position:static; flex:none;
  width:44px; height:42px; margin:0 auto 4px;
  overflow:visible;
}
.home-page.has-home-header-js .home-header-shell .home-brand .home-emblem {
  width:44px;
  height:calc(42px * (1 - var(--home-progress)));
  margin-bottom:calc(4px * (1 - var(--home-progress)));
  opacity:max(0,calc(1 - var(--home-progress) * 1.55));
  transform:translateY(calc(-4px * var(--home-progress)));
  transition:opacity 160ms ease;
}
@media (max-width:650px) {
  .home-page .home-header-shell .home-brand .home-emblem { width:37px; height:36px; }
  .home-page.has-home-header-js .home-header-shell .home-brand .home-emblem {
    width:37px; height:calc(36px * (1 - var(--home-progress)));
  }
}
@media (prefers-reduced-motion:reduce) {
  .home-page .home-header-shell .home-brand .home-emblem { transition:none !important; }
}
