:root {
  --lasting-forest: #173f34;
  --lasting-ink: #243c30;
  --lasting-paper: #fff9ed;
  --lasting-brass: #a98247;
  --lasting-gilt: #e8cb8b;
  scroll-padding-top: calc(var(--lasting-header-height, 94px) + 14px);
}
body > header.lasting-header {
  position: sticky;
  top: 0;
  z-index: 30;
  width: calc(100% - 28px);
  max-width: 1240px;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 9px clamp(12px, 2vw, 24px);
  gap: 10px 22px;
  border: 1px solid #b6a479;
  border-top: 0;
  border-radius: 0 0 19px 19px;
  background: linear-gradient(110deg, #fffaee, #edf0e2 78%, #e1e9d9);
  box-shadow: 0 6px 20px #243c301f, inset 0 -3px #fff9edaa;
}
body > header.lasting-header.lasting-header-scrolled {
  box-shadow: 0 9px 25px #243c3033, inset 0 -3px #fff9edaa;
}
.lasting-header .brand { line-height: 1.25; }
.lasting-header .brand img, .lasting-header > a > img {
  display: block;
  width: clamp(108px, 13vw, 168px);
  height: auto;
}
.lasting-header > nav {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
body > header.lasting-header > nav > a,
body > header.lasting-header > .actions > button,
body > header.lasting-header > #familyButton {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 13px;
  border: 1px solid #b5af8a;
  border-radius: 8px 14px 8px 8px;
  background: linear-gradient(#fffdf4, #eee6ce);
  color: var(--lasting-ink);
  font: 650 .875rem/1.2 system-ui, sans-serif;
  text-decoration: none;
  box-shadow: 0 2px 0 #b5af8a75, inset 0 1px white;
}
body > header.lasting-header > nav > a[hidden],
body > header.lasting-header > button[hidden] { display: none; }
body > header.lasting-header > nav > a[aria-current],
body > header.lasting-header > nav > #signInNav,
body > header.lasting-header > #familyButton[aria-expanded=true] {
  border-color: #54705c;
  background: linear-gradient(135deg, #315c49, #173f34);
  color: #fff8e5;
  box-shadow: 0 2px 0 #15352b, inset 0 1px #e8cb8b42;
}
.lasting-header > nav > a[aria-current]::after {
  position: absolute;
  inset: auto 14px 3px;
  height: 2px;
  border-radius: 20px;
  background: var(--lasting-gilt);
  content: '';
}
.lasting-header :is(a, button):focus-visible, .book-quick-nav button:focus-visible {
  outline: 2px solid #714c21;
  outline-offset: 2px;
}
.lasting-scroll-progress {
  position: absolute;
  inset: auto 12px 0;
  height: 2px;
  pointer-events: none;
}
.lasting-scroll-progress::after {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #7d5b32, #dbbd79 72%, #a98247);
  border-radius: 9px;
  transform-origin: left center;
  transform: scaleX(var(--lasting-progress, 0));
  content: '';
}

.home-intro {
  position: relative;
  margin: clamp(14px, 3vw, 38px) 0 0;
  padding: clamp(23px, 5vw, 60px);
  gap: clamp(24px, 5vw, 60px);
  border-radius: 24px 48px 24px 24px;
  border: 1px solid #b5ae8a;
  background: linear-gradient(110deg, #fffaee 22%, #fff9edea 48%, #e4ebd9b8), url('/images/oak-background.webp') center/cover;
  box-shadow: 0 15px 36px #344a2e22, inset 0 0 0 5px #fffdf344;
}
.home-intro h1 { color: var(--lasting-forest); }
.home-intro .intro-book { margin: 4px auto; }
.home-intro .book-cover {
  background: radial-gradient(ellipse at 74% 12%, #6d85534f, transparent 62%), linear-gradient(90deg, #153329 0 12px, #517052 13px, #234638 20px, #294c39 100%);
  border-color: #a58b52;
  transition: box-shadow .3s, transform .3s;
}
.home-intro .book-cover:hover { transform: rotate(-2deg); box-shadow: 8px 8px 0 #c2b494, 12px 12px 0 #eee1c3, 16px 24px 42px #20372652; }
.home-steps .steps-grid article, .storybook-library .profile-card {
  border: 1px solid #c9bd9e;
  border-top: 3px solid #a98247;
  background: linear-gradient(145deg, #fffaf0, #f0eddc);
  box-shadow: 0 5px 16px #38452e12;
}
.storybook-spotlight {
  border: 1px solid #bcc4a3;
  border-radius: 24px 44px 24px 24px;
  padding: clamp(22px, 5vw, 52px);
  background: radial-gradient(ellipse at left top, #e4ecd3, transparent 75%), #fff9ed;
}
.lasting-section-heading::after {
  content: '';
  display: block;
  width: 64px;
  height: 2px;
  margin-top: 12px;
  background: linear-gradient(90deg, #79572f, #d9bd7e);
  border-radius: 2px;
  transform-origin: left;
}
.lasting-section-entered .lasting-section-heading::after { animation: lasting-gilt-line .7s ease-out both; }
@keyframes lasting-gilt-line { from { transform: scaleX(.15); opacity: .4; } to { transform: scaleX(1); opacity: 1; } }
@media (max-width: 760px) {
  body > header.lasting-header {
    width: calc(100% - 14px);
    padding: 6px 10px 8px;
    gap: 4px 10px;
  }
  body > header.lasting-header:has(> nav) {
    flex-wrap: wrap;
    justify-content: center;
  }
  .lasting-header > nav {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    justify-content: safe center;
    overflow-x: auto;
    padding: 4px 3px 5px;
    scrollbar-width: thin;
  }
  body > header.lasting-header > nav > a {
    flex: 0 0 auto;
    max-width: none;
    white-space: nowrap;
    padding-inline: 10px;
  }
  body > header.lasting-header > .actions { margin: 0; }
  .home-intro {
    padding: clamp(16px, 5vw, 30px);
    border-radius: 18px 32px 18px 18px;
    background-position: 56% center;
  }
}
@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  .lasting-section-entered .lasting-section-heading::after { animation: none; }
  .home-intro .book-cover:hover { transform: none; }
  .home-intro .book-cover { transition: none; }
}
