/* Polish layer — injected into every generated page by scripts/build-site.py.
   The prototypes stay frozen; refinement lives here. Everything degrades
   gracefully: no JS -> static page, old browser -> no view transitions,
   reduced motion -> no animation. */

/* ---- cross-page transitions (Chrome 126+ / Safari 18.2+; others: instant) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .28s; }

/* ---- paper grain: the site should feel like stationery, not a screen */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  pointer-events: none;
  opacity: .022;
  mix-blend-mode: multiply;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media print { body::after { display: none; } }

/* ---- typography refinements */
h1, h2, h3, blockquote {
  font-kerning: normal;
  font-feature-settings: "liga" 1, "kern" 1;
}
h1, h2 { text-wrap: balance; }
::selection { background: #B99657; color: #FAF7F1; }

/* ---- hero entry choreography (gated on .pl-anim set by inline script) */
@media (prefers-reduced-motion: no-preference) {
  html.pl-anim .hero .inner > *:not(.rv),
  html.pl-anim .hero-copy > *:not(.rv) {
    animation: pl-rise .7s cubic-bezier(.22, .61, .36, 1) both;
  }
  html.pl-anim .hero .inner > *:nth-child(2):not(.rv),
  html.pl-anim .hero-copy > *:nth-child(2):not(.rv) { animation-delay: .09s; }
  html.pl-anim .hero .inner > *:nth-child(3):not(.rv),
  html.pl-anim .hero-copy > *:nth-child(3):not(.rv) { animation-delay: .18s; }
  html.pl-anim .hero .inner > *:nth-child(n+4):not(.rv),
  html.pl-anim .hero-copy > *:nth-child(n+4):not(.rv) { animation-delay: .27s; }

  /* hero photograph settles: a slow, quiet arrival. The containers clip so
     the scale never widens the page mid-animation. */
  html.pl-anim .hero,
  html.pl-anim .hero-ph { overflow: hidden; }
  html.pl-anim .hero > img,
  html.pl-anim .hero-ph img {
    animation: pl-settle 1.9s cubic-bezier(.22, .61, .36, 1) both;
  }
}
@keyframes pl-rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
@keyframes pl-settle {
  from { transform: scale(1.045); }
  to   { transform: scale(1); }
}

/* ---- scroll reveals: softer curve, sibling stagger in the shared grids */
.rv { transition: opacity .7s cubic-bezier(.22, .61, .36, 1), transform .7s cubic-bezier(.22, .61, .36, 1); }
.mom-grid  > .rv:nth-child(2), .chap-grid > .rv:nth-child(2), .how-row > .rv:nth-child(2) { transition-delay: .07s; }
.mom-grid  > .rv:nth-child(3), .chap-grid > .rv:nth-child(3), .how-row > .rv:nth-child(3) { transition-delay: .14s; }
.mom-grid  > .rv:nth-child(4), .chap-grid > .rv:nth-child(4), .how-row > .rv:nth-child(4) { transition-delay: .21s; }
.mom-grid  > .rv:nth-child(5), .chap-grid > .rv:nth-child(5), .how-row > .rv:nth-child(5) { transition-delay: .28s; }

/* ---- navigation: gold-thread underline that draws itself */
.nav-links a {
  position: relative;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .26s cubic-bezier(.22, .61, .36, 1);
}
.nav-links a:hover::after,
.nav-links a:focus-visible::after { transform: scaleX(1); }

/* ---- buttons: weight under the hand */
.btn { will-change: transform; }
.btn:hover:not(.link) { transform: translateY(-1px); }
.btn:active:not(.link) { transform: translateY(0) scale(.99); transition-duration: .06s; }
@media (prefers-reduced-motion: reduce) {
  .btn:hover:not(.link), .btn:active:not(.link) { transform: none; }
}

/* ---- images get a finishing touch when they arrive */
.mcard .ph img, .ccard .ph img { backface-visibility: hidden; }

/* ---- global navigation (injected on every page by the build) */
.gnav {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(250, 247, 241, .92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid #E8E2D5;
  font-family: 'Inter', sans-serif;
}
.gnav-in {
  max-width: 1180px; margin: 0 auto; padding: 0 34px;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 24px;
}
.gnav-brand {
  font-family: 'Cormorant Garamond', serif; font-size: 21px; font-weight: 500;
  color: #1B1A17 !important; text-decoration: none; white-space: nowrap;
}
.gnav-links {
  display: flex; align-items: center; gap: 30px;
  font-size: 14px; font-weight: 400; flex-wrap: nowrap;
}
.gnav-links a {
  color: #55524B !important; text-decoration: none; position: relative;
  transition: color .2s; white-space: nowrap;
}
.gnav-links a:hover { color: #1B1A17 !important; }
.gnav-links a:not(.gnav-cta)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px;
  background: #B99657; transform: scaleX(0); transform-origin: left center;
  transition: transform .26s cubic-bezier(.22, .61, .36, 1);
}
.gnav-links a:not(.gnav-cta):hover::after,
.gnav-links a:not(.gnav-cta):focus-visible::after { transform: scaleX(1); }
.gnav-cta {
  background: #181715; color: #fff !important;
  padding: 10px 18px; border-radius: 8px; font-weight: 500; font-size: 13.5px;
  transition: transform .2s, background .2s;
}
.gnav-cta:hover { background: #000; transform: translateY(-1px); }
.gnav-toggle { display: none; }
.gnav-burger { display: none; }
@media (max-width: 980px) {
  .gnav-burger {
    display: flex; flex-direction: column; gap: 5px; padding: 10px;
    cursor: pointer; border-radius: 6px;
  }
  .gnav-burger span {
    display: block; width: 20px; height: 1.5px; background: #1B1A17;
    transition: transform .25s, opacity .25s;
  }
  .gnav-links {
    display: none;
    position: absolute; top: 64px; left: 0; right: 0;
    background: #FAF7F1; border-bottom: 1px solid #E8E2D5;
    flex-direction: column; align-items: flex-start; gap: 0;
    padding: 8px 34px 18px;
  }
  .gnav-links a { padding: 12px 0; font-size: 15px; }
  .gnav-links a:not(.gnav-cta)::after { display: none; }
  .gnav-cta { margin-top: 10px; }
  .gnav-toggle:checked ~ .gnav-links { display: flex; }
  .gnav-toggle:checked ~ .gnav-burger span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  .gnav-toggle:checked ~ .gnav-burger span:nth-child(2) { opacity: 0; }
  .gnav-toggle:checked ~ .gnav-burger span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
}
@media (max-width: 600px) { .gnav-in { padding: 0 22px; } .gnav-links { padding: 8px 22px 18px; } }
