/* ==========================================================================
   LAYOUT — wrap, sections, ledger strip, sticky masthead, site index, footer
   ========================================================================== */

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: var(--wrap-narrow); }
.wrap--wide { max-width: 1560px; }

.section { padding-block: var(--section); position: relative; }
.section--tight { padding-block: calc(var(--section) * .6); }
.section--flush-top { padding-top: 0; }
.bg-indigo { background: var(--indigo); color: var(--sand); }
.bg-sand { background: var(--sand); }
.bg-sage { background: var(--sage); }
.bg-white { background: var(--white); }
.bg-green { background: var(--green); color: var(--white); }

/* Section heading: label + furrow rule + page number */
.sec-head {
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 1rem 2rem;
  margin-bottom: clamp(2rem, 1.5rem + 2vw, 3.5rem);
}
.sec-head h2 { margin: 0; max-width: 18ch; }
.sec-head__folio {
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--slate); white-space: nowrap; padding-bottom: .5rem;
}
.on-dark .sec-head__folio { color: var(--sand); opacity: .8; }
.sec-head__rule { grid-column: 1 / -1; }
.sec-head--wide h2 { max-width: 26ch; }
.sec-head p.lede { grid-column: 1 / -1; margin-top: .6rem; }

/* ---------- Ledger strip (scrolls away above the sticky masthead) ---------- */
.ledger-strip {
  background: var(--indigo); color: var(--sand);
  font-size: .72rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
}
.ledger-strip .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: 34px; }
.ledger-strip span { white-space: nowrap; }
.ledger-strip .sep { width: 1px; height: 12px; background: var(--line-on-dark); }
.ledger-strip .push { margin-left: auto; color: var(--wheat); }

/* ---------- Sticky masthead ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(244, 239, 229, .94);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .3s var(--ease), background .3s var(--ease);
}
.site-header.is-scrolled { box-shadow: 0 10px 30px -18px rgba(24, 36, 58, .45); background: rgba(252, 251, 248, .97); }
.masthead { display: flex; align-items: center; gap: 1.5rem; height: var(--header-h); }

.brand { display: flex; align-items: center; gap: .85rem; text-decoration: none; color: var(--indigo); flex-shrink: 0; }
.brand:hover { color: var(--indigo); }
.brand__mark { width: 40px; height: 40px; flex: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__name { font-family: var(--serif); font-size: 1.6rem; letter-spacing: -.005em; }
.brand__sub { margin-top: .3rem; font-size: .66rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--slate); }

.primary-nav { margin-left: auto; }
.primary-nav ul { display: flex; align-items: center; gap: .15rem; list-style: none; margin: 0; padding: 0; }
.primary-nav li + li { margin: 0; }
.primary-nav a {
  position: relative; display: block; padding: .55rem .7rem;
  font-size: .86rem; font-weight: 600; letter-spacing: .04em; color: var(--charcoal); text-decoration: none;
}
.primary-nav a::after {
  content: ""; position: absolute; left: .7rem; right: .7rem; bottom: .25rem; height: 1px;
  background: var(--soil); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.primary-nav a:hover { color: var(--indigo); }
.primary-nav a:hover::after, .primary-nav a[aria-current="page"]::after { transform: scaleX(1); }
.primary-nav a[aria-current="page"] { color: var(--indigo); }

.index-toggle {
  display: inline-flex; align-items: center; gap: .7rem; margin-left: .5rem;
  min-height: 46px; padding: 0 1.05rem 0 .95rem;
  background: var(--indigo); color: var(--white); border: 0; border-radius: var(--radius);
  font: 700 .74rem/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; cursor: pointer;
  transition: background .25s var(--ease);
}
.index-toggle:hover { background: var(--green); }
.index-toggle__lines { position: relative; width: 22px; height: 12px; }
.index-toggle__lines i { position: absolute; left: 0; height: 1.5px; background: var(--wheat); transition: transform .3s var(--ease), width .3s var(--ease), top .3s var(--ease); }
.index-toggle__lines i:nth-child(1) { top: 0; width: 22px; }
.index-toggle__lines i:nth-child(2) { top: 5px; width: 15px; }
.index-toggle__lines i:nth-child(3) { top: 10px; width: 19px; }

.reading-line { position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; background: var(--wheat); transform-origin: left; transform: scaleX(0); }

/* ---------- Site index panel (hamburger destination at every size) ---------- */
.nav-panel {
  position: fixed; inset: 0; z-index: 200; overflow-y: auto; overscroll-behavior: contain;
  background: var(--indigo); color: var(--sand);
  opacity: 0; visibility: hidden; transition: opacity .35s var(--ease), visibility 0s linear .35s;
}
.nav-panel.is-open { opacity: 1; visibility: visible; transition: opacity .35s var(--ease); }
.nav-panel__bg {
  position: absolute; inset: auto 0 0 0; height: 45%; pointer-events: none; opacity: .5;
}
.nav-panel__inner { position: relative; min-height: 100%; display: flex; flex-direction: column; padding-block: 1.2rem 3rem; }
.nav-panel__top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 56px; }
.nav-panel__top .brand { color: var(--white); }
.nav-panel__top .brand__sub { color: var(--wheat); }
.nav-close {
  display: inline-flex; align-items: center; gap: .6rem; min-height: 46px; padding: 0 1rem;
  background: transparent; color: var(--white); border: 1px solid var(--line-on-dark); border-radius: var(--radius);
  font: 700 .74rem/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; cursor: pointer;
}
.nav-close:hover { border-color: var(--wheat); color: var(--wheat); }
.nav-close svg { width: 14px; height: 14px; }

.nav-panel__body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.6fr); gap: 3rem; margin-top: clamp(2rem, 5vh, 4rem); }
.nav-panel__intro h2 { color: var(--white); font-size: var(--fs-2xl); margin-bottom: 1rem; }
.nav-panel__intro p { color: var(--sand); max-width: 30ch; }
.nav-panel__intro .meta { display: block; margin-top: 2rem; color: var(--wheat); }

.plots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line-on-dark); border-left: 1px solid var(--line-on-dark); }
.plot-group { border-right: 1px solid var(--line-on-dark); border-bottom: 1px solid var(--line-on-dark); padding: 1.3rem 1.2rem 1.4rem; }
.plot-group h3 { font-family: var(--sans); font-size: .7rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--wheat); margin: 0 0 1rem; }
.plot-group ul { list-style: none; margin: 0; padding: 0; }
.plot-group li + li { margin-top: 0; border-top: 1px solid rgba(232, 221, 200, .1); }
.plot-group a {
  display: grid; grid-template-columns: 2.1rem 1fr; align-items: baseline; padding: .6rem 0;
  color: var(--white); text-decoration: none; font-family: var(--serif); font-size: 1.32rem; line-height: 1.15;
}
.plot-group a span { font-family: var(--sans); font-size: .72rem; font-weight: 600; letter-spacing: .08em; color: var(--sand); opacity: .7; }
.plot-group a:hover, .plot-group a[aria-current="page"] { color: var(--wheat); }
.plot-group a[aria-current="page"] span { color: var(--wheat); opacity: 1; }

body.nav-open { overflow: hidden; }

/* ---------- Breadcrumbs ---------- */
.crumbs { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 0; padding: 0; }
.crumbs li + li { margin: 0; }
.crumbs li + li::before { content: "/"; margin-right: .4rem; opacity: .5; }
.crumbs a { color: inherit; text-decoration: none; opacity: .8; }
.crumbs a:hover { opacity: 1; text-decoration: underline; }
.crumbs [aria-current] { opacity: 1; }

/* ---------- Next-page pager ---------- */
.pager { border-top: 1px solid var(--line); }
.pager .wrap { display: grid; grid-template-columns: 1fr 1fr; }
.pager a { display: block; padding: 2.4rem 0; text-decoration: none; color: var(--indigo); }
.pager a + a { text-align: right; border-left: 1px solid var(--line); padding-left: 2rem; }
.pager a:first-child { padding-right: 2rem; }
.pager .meta { display: block; margin-bottom: .4rem; }
.pager strong { font-family: var(--serif); font-weight: 400; font-size: var(--fs-xl); line-height: 1.1; }
.pager a:hover strong { color: var(--green); }

/* ---------- Footer ---------- */
.site-footer { background: var(--indigo); color: var(--sand); position: relative; overflow: hidden; }
.footer-horizon { display: block; width: 100%; height: 90px; color: var(--wheat); }
.footer-main { display: grid; grid-template-columns: 1.35fr repeat(4, minmax(0, 1fr)); gap: 2.5rem 2rem; padding-block: 3rem 3.5rem; }
.footer-brand .brand { color: var(--white); }
.footer-brand .brand__sub { color: var(--wheat); }
.footer-brand p { margin-top: 1.4rem; font-size: var(--fs-sm); max-width: 34ch; color: var(--sand); }
.footer-col h2 { font-family: var(--sans); font-size: .7rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--wheat); margin: 0 0 1.1rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li + li { margin-top: .45rem; }
.footer-col a { color: var(--sand); text-decoration: none; font-size: .95rem; }
.footer-col a:hover { color: var(--white); text-decoration: underline; }

.footer-contact { display: grid; grid-template-columns: 1.35fr 2fr auto; gap: 2rem; align-items: center; padding-block: 2rem; border-top: 1px solid var(--line-on-dark); }
.footer-contact__label { font-family: var(--serif); font-size: 1.6rem; color: var(--white); line-height: 1.1; }
.footer-contact__label span { display: block; font-family: var(--sans); font-size: .7rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--wheat); margin-bottom: .45rem; }
.footer-contact__items { display: flex; flex-wrap: wrap; gap: .8rem 2.2rem; }
.footer-contact__items a { display: inline-flex; align-items: center; gap: .6rem; color: var(--white); text-decoration: none; font-weight: 600; }
.footer-contact__items a:hover { color: var(--wheat); }
.footer-contact__items svg { width: 18px; height: 18px; color: var(--wheat); flex: none; }

.social { display: flex; gap: .5rem; list-style: none; margin: 0; padding: 0; }
.social li + li { margin: 0; }
.social a {
  display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line-on-dark);
  border-radius: 50%; color: var(--sand); transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.social a:hover { background: var(--wheat); border-color: var(--wheat); color: var(--indigo); }
.social__off { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line-on-dark); border-radius: 50%; color: var(--sand); cursor: default; }
.social__off svg { width: 18px; height: 18px; }
.social svg { width: 18px; height: 18px; }

.footer-base { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem 2rem; padding-block: 1.4rem 1.8rem; border-top: 1px solid var(--line-on-dark); font-size: var(--fs-xs); letter-spacing: .06em; }
.footer-base p { margin: 0; }
.footer-base a { color: var(--wheat); }
.footer-base a:hover { color: var(--white); }
.footer-note { opacity: .85; max-width: 60ch; }
.lock-btn { background: none; border: 0; padding: .3rem 0; color: var(--sand); font: inherit; letter-spacing: inherit; text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
.lock-btn:hover { color: var(--white); }
