/* Load Boosting child theme.
   Colour and font values live in Elementor global variables (printed on :root as --surface, --ink, ...).
   This file only adds what Elementor can't hold: shadows, blur, font fallbacks, dark values, states and motion. */

/* ---------- Tokens Elementor has no variable type for ---------- */
:root {
  --shadow-card: 0 1px 2px rgba(31,26,22,0.06), 0 12px 32px rgba(31,26,22,0.08);
  --shadow-float: 0 24px 60px rgba(31,26,22,0.18);
  --glass-blur: 20px;
  --radius-sm: 8px; --radius-md: 16px; --radius-lg: 24px; --radius-xl: 32px; --radius-pill: 999px;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px; --space-8: 32px; --space-12: 48px; --space-16: 64px; --space-24: 96px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --lb-max: 1200px;
  --lb-gutter: 32px;
}
@media (max-width: 767px) { :root { --lb-gutter: 16px; } }

/* ---------- One layout grid: header, Elementor sections, archives and footer share the same 1200px column ---------- */
.elementor > .e-con {
  padding-inline: max(var(--lb-gutter), (100% - var(--lb-max)) / 2) !important;
}
#masthead :is(.site-primary-header-wrap, .ast-mobile-header-wrap .ast-builder-grid-row-container) {
  max-width: calc(var(--lb-max) + 2 * var(--lb-gutter));
  margin-inline: auto;
  padding-inline: var(--lb-gutter);
}
/* Elementor font variables hold a single family; restore the fallback stacks. */
html:root {
  --font-sans: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-ui: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
}

/* ---------- Dark theme: explicit choice, or system preference when no choice is saved ---------- */
html[data-theme="dark"] {
  --surface: #15110e; --surface-raised: #211b16; --surface-sand: #2b231c; --surface-espresso: #2c2119;
  --ink: #f3ece3; --ink-muted: #b4a797; --on-espresso: #f3ebe0; --on-espresso-muted: #c9b8a4;
  --line: #3b3129; --line-strong: #85766a;
  --caramel: #d3a372; --caramel-ink: #e2bb8f; --caramel-soft: #3a2c1f; --on-caramel: #15110e;
  --tide: #8badc8; --tide-ink: #a8c4da; --tide-soft: #1e2a33; --on-tide: #15110e;
  --clay: #c9967a; --success: #7cbf94; --danger: #ec8a72; --focus: #a8c4da;
  --caramel-tint: rgba(211,163,114,.16); --on-dark-tint: rgba(128,110,95,.2); --tide-tint: rgba(139,173,200,.14);
  --legacy-body: #f3ece3; --legacy-lilac: #1e2a33; --legacy-sage: #2b231c; --legacy-sage-ink: #e2bb8f;
  --legacy-terracotta: #3a2c1f; --legacy-terracotta-ink: #e2bb8f;
  --legacy-topic-1-bg: #8badc8; --legacy-topic-1-tint: #15110e; --legacy-topic-2-bg: #8badc8; --legacy-topic-2-tint: #15110e;
  --legacy-topic-6-bg: #8badc8; --legacy-topic-6-tint: #15110e;
  --legacy-topic-3-bg: #2c2119; --legacy-topic-4-bg: #2c2119; --legacy-topic-5-bg: #2c2119;
  --shadow-card: 0 1px 2px rgba(0,0,0,0.4), 0 12px 32px rgba(0,0,0,0.35);
  --shadow-float: 0 24px 60px rgba(0,0,0,0.5);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --surface: #15110e; --surface-raised: #211b16; --surface-sand: #2b231c; --surface-espresso: #2c2119;
    --ink: #f3ece3; --ink-muted: #b4a797; --on-espresso: #f3ebe0; --on-espresso-muted: #c9b8a4;
    --line: #3b3129; --line-strong: #85766a;
    --caramel: #d3a372; --caramel-ink: #e2bb8f; --caramel-soft: #3a2c1f; --on-caramel: #15110e;
    --tide: #8badc8; --tide-ink: #a8c4da; --tide-soft: #1e2a33; --on-tide: #15110e;
    --clay: #c9967a; --success: #7cbf94; --danger: #ec8a72; --focus: #a8c4da;
    --caramel-tint: rgba(211,163,114,.16); --on-dark-tint: rgba(128,110,95,.2); --tide-tint: rgba(139,173,200,.14);
    --legacy-body: #f3ece3; --legacy-lilac: #1e2a33; --legacy-sage: #2b231c; --legacy-sage-ink: #e2bb8f;
    --legacy-terracotta: #3a2c1f; --legacy-terracotta-ink: #e2bb8f;
    --legacy-topic-1-bg: #8badc8; --legacy-topic-1-tint: #15110e; --legacy-topic-2-bg: #8badc8; --legacy-topic-2-tint: #15110e;
    --legacy-topic-6-bg: #8badc8; --legacy-topic-6-tint: #15110e;
    --legacy-topic-3-bg: #2c2119; --legacy-topic-4-bg: #2c2119; --legacy-topic-5-bg: #2c2119;
    --shadow-card: 0 1px 2px rgba(0,0,0,0.4), 0 12px 32px rgba(0,0,0,0.35);
    --shadow-float: 0 24px 60px rgba(0,0,0,0.5);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
html body, body .site, body .site-content, body #content, .ast-separate-container, .ast-page-builder-template .site-content > .ast-container {
  background-color: var(--surface);
}
body {
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 400ms var(--ease-out), color 400ms var(--ease-out);
}
::selection { background: var(--caramel-soft); color: var(--ink); }
a { color: var(--tide-ink); }
a:hover { color: var(--ink); }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
:where(a, button, input, select, textarea, summary, [tabindex]):focus:not(:focus-visible) { outline: none; }
.lb-chapter-espresso :focus-visible { outline-color: var(--on-espresso); }
.lb-chapter-tide :focus-visible { outline-color: var(--on-tide); }
mark { background: var(--caramel-soft); color: var(--ink); border-radius: var(--radius-sm); padding: 0 2px; }
.screen-reader-text:focus { background: var(--surface-raised); color: var(--ink); border-radius: var(--radius-pill); box-shadow: var(--shadow-float); }

/* Headlines wrap evenly; long reads avoid orphans. */
.lb-h-hero, .lb-h-section, .lb-h-section-on-dark, .lb-h3 { text-wrap: balance; }
.lb-lede, .lb-body, .lb-lede-on-dark { text-wrap: pretty; }

/* Astra underlines every content link; Elementor layouts style their own, so only reading copy keeps underlines. */
.ast-single-post .entry-content .elementor a, .entry-content .elementor a { text-decoration: none; }
.entry-content .elementor :is(.lb-body, .lb-lede, .lb-lede-on-dark) a {
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat,
              linear-gradient(var(--caramel-soft), var(--caramel-soft)) 0 100% / 0 100% no-repeat;
  transition: background-size 400ms var(--ease-out);
}
.entry-content .elementor :is(.lb-body, .lb-lede, .lb-lede-on-dark) a:hover { background-size: 100% 1px, 100% 100%; }

@media (max-width: 767px) {
  /* Pill rows wrap left-aligned instead of stacking one per line. */
  :has(> .lb-pill) { flex-direction: row !important; flex-wrap: wrap !important; justify-content: flex-start !important; align-items: center !important; }
  /* List rows inside chapter bands read left-aligned on phones. */
  :is(.lb-chapter-espresso, .lb-chapter-tide) .lb-stagger > * { align-items: flex-start !important; text-align: left; }
}

/* ---------- Component states for Elementor global classes ---------- */
.lb-btn-accent, .lb-btn-primary, .lb-pill, .lb-pill-active, .lb-tag-caramel, .lb-tag-tide, .lb-tag-on-dark {
  width: fit-content;
  max-width: 100%;
  white-space: nowrap;
}
.lb-btn-accent, .lb-btn-primary {
  cursor: pointer;
  text-decoration: none;
  transition: transform 200ms ease-out, filter 200ms ease-out, box-shadow 300ms var(--ease-out);
  will-change: transform;
}
.lb-btn-accent:hover, .lb-btn-primary:hover { filter: brightness(.92); box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--ink) 45%, transparent); }
.lb-btn-accent:active, .lb-btn-primary:active { transform: scale(.98); }
.lb-btn-accent::after, .lb-btn-primary::after {
  content: "";
  width: 16px; height: 16px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 300ms var(--ease-out);
}
.lb-btn-accent:hover::after, .lb-btn-primary:hover::after { transform: translateX(3px); }
.lb-chapter-espresso .lb-btn-primary, .lb-chapter-tide .lb-btn-primary { background-color: var(--on-espresso); color: var(--surface-espresso); }
.lb-chapter-tide .lb-btn-primary { background-color: var(--on-tide); color: var(--tide); }

.lb-pill, .lb-pill-active { cursor: pointer; text-decoration: none; transition: background-color 200ms ease-out, border-color 200ms ease-out, transform 200ms ease-out; }
.lb-pill:hover { border-color: var(--line-strong); }
.lb-pill:active, .lb-pill-active:active { transform: scale(.98); }

.lb-card { transition: transform 300ms var(--ease-out), box-shadow 300ms var(--ease-out); }
a.lb-card, .lb-card:has(a) { cursor: pointer; }
.lb-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-float); }

/* Image frames: a hairline edge so light photos never dissolve into the page. */
.lb-media-frame, .lb-media-frame-hero { outline: 1px solid color-mix(in srgb, var(--ink) 8%, transparent); outline-offset: -1px; }
/* Photos zoom gently inside tilting cards. */
.lb-tilt .lb-media-frame, .lb-card .lb-media-frame { transition: transform 700ms var(--ease-out), filter 700ms var(--ease-out); }
.lb-tilt:hover .lb-media-frame, .lb-card:hover .lb-media-frame { transform: scale(1.03); filter: saturate(1.08); }
.lb-tilt :is(.lb-card-title, .e-heading-base) { transition: color 200ms ease-out; }
.lb-tilt:hover :is(.lb-card-title, .e-heading-base) { color: var(--tide-ink); }

/* Chapter bands: soft top glow that drifts, plus a faint grain so large fills don't look flat. */
.lb-chapter-espresso, .lb-chapter-tide { isolation: isolate; }
.lb-chapter-espresso::before, .lb-chapter-tide::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto;
  height: 90%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse 60% 55% at 70% 0%, color-mix(in srgb, var(--caramel) 38%, transparent), transparent 70%);
  animation: lb-drift 18s ease-in-out infinite alternate;
}
.lb-chapter-tide::before {
  background: radial-gradient(ellipse 60% 55% at 30% 0%, color-mix(in srgb, var(--tide-soft) 28%, transparent), transparent 70%);
  animation-duration: 22s;
}
.lb-chapter-espresso::after, .lb-chapter-tide::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .08;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes lb-drift {
  from { transform: translate3d(-4%, 0, 0) scale(1); }
  to { transform: translate3d(6%, 4%, 0) scale(1.08); }
}

/* ---------- Header (Astra header builder) ---------- */
#masthead {
  position: sticky;
  top: 0;
  z-index: 100;
  transition: transform 400ms var(--ease-out), box-shadow 400ms var(--ease-out), background-color 400ms var(--ease-out);
}
.admin-bar #masthead { top: 32px; }
@media (max-width: 782px) { .admin-bar #masthead { top: 46px; } }
#masthead .main-header-bar, #masthead .ast-mobile-header-wrap .ast-primary-header-bar, #masthead .ast-primary-header-bar {
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(var(--glass-blur));
          backdrop-filter: saturate(1.4) blur(var(--glass-blur));
  border-bottom: 1px solid var(--line);
}
@supports not (backdrop-filter: blur(1px)) {
  #masthead .main-header-bar, #masthead .ast-primary-header-bar { background: var(--surface); }
}
#masthead.lb-header-hidden { transform: translateY(-100%); }
#masthead.lb-header-scrolled .main-header-bar, #masthead.lb-header-scrolled .ast-primary-header-bar { box-shadow: 0 8px 24px -16px color-mix(in srgb, var(--ink) 40%, transparent); }
/* Wordmark: one transparent mask painted in the theme's ink, so it follows light and dark mode.
   The link text stays in the DOM for screen readers and search engines. */
#masthead .site-title { margin: 0; line-height: 0; }
#masthead .site-title a, .lb-footer-wordmark {
  display: block;
  aspect-ratio: 725 / 131;
  font-size: 0;
  line-height: 0;
  color: transparent;
  text-decoration: none;
  background-color: var(--ink);
  -webkit-mask: url("../img/logo-wordmark.png") left center / contain no-repeat;
          mask: url("../img/logo-wordmark.png") left center / contain no-repeat;
  transition: opacity 200ms ease-out;
}
#masthead .site-title a { width: 176px; }
#masthead .site-title a:hover { opacity: .8; }
@media (max-width: 921px) { #masthead .site-title a { width: 150px; } }
#masthead .main-header-menu .menu-link, #masthead .ast-builder-menu .menu-item > .menu-link {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 400;
  color: var(--ink);
  position: relative;
}
#masthead .main-header-menu > .menu-item > .menu-link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 18%;
  width: 6px; height: 6px;
  border-radius: var(--radius-pill);
  background: var(--tide);
  transform: translateX(-50%) scale(0);
  transition: transform 300ms var(--ease-out);
}
#masthead .main-header-menu > .menu-item:hover > .menu-link::after,
#masthead .main-header-menu > .current-menu-item > .menu-link::after { transform: translateX(-50%) scale(1); }
#masthead .sub-menu {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
  padding: var(--space-2);
}
#masthead .sub-menu .menu-link { border-radius: var(--radius-sm); }
#masthead .sub-menu .menu-link:hover { background: var(--surface-sand); }
#masthead .menu-toggle, #masthead .ast-mobile-menu-trigger-minimal {
  min-height: 44px;
  min-width: 44px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
}
#masthead .menu-toggle svg { fill: currentColor; }
#ast-mobile-header .ast-mobile-header-content, #masthead .ast-mobile-header-content, .ast-mobile-popup-drawer .ast-mobile-popup-inner {
  background: var(--surface);
  color: var(--ink);
}
#masthead .ast-mobile-header-content .menu-link { font-size: 20px; line-height: 26px; padding-block: 14px; border-color: var(--line); color: var(--ink); }

/* ---------- Mobile menu: full-screen sheet (Astra mobile header) ---------- */
@media (max-width: 921px) {
  body.ast-main-header-nav-open { overflow: hidden; }
  #masthead .ast-mobile-header-content {
    position: fixed;
    inset: var(--lb-header-h, 80px) 0 0;
    z-index: 99;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: var(--space-4) var(--space-4) calc(var(--space-12) + env(safe-area-inset-bottom));
    background: var(--surface);
    animation: lb-fade-in 300ms ease-out;
  }
  .admin-bar #masthead .ast-mobile-header-content { top: calc(var(--lb-header-h, 80px) + 46px); }
  #masthead .ast-mobile-header-content .main-header-menu { border: 0; background: transparent; }
  #masthead .ast-mobile-header-content .main-header-menu > .menu-item { border-bottom: 1px solid var(--line); animation: lb-menu-item 500ms var(--ease-out) both; }
  #masthead .ast-mobile-header-content .main-header-menu > .menu-item:nth-child(2) { animation-delay: 40ms; }
  #masthead .ast-mobile-header-content .main-header-menu > .menu-item:nth-child(3) { animation-delay: 80ms; }
  #masthead .ast-mobile-header-content .main-header-menu > .menu-item:nth-child(4) { animation-delay: 120ms; }
  #masthead .ast-mobile-header-content .main-header-menu > .menu-item:nth-child(n+5) { animation-delay: 160ms; }
  #masthead .ast-mobile-header-content .main-header-menu > .menu-item > .menu-link {
    padding: 16px 56px 16px 0;
    border: 0;
    background: transparent;
    font: 300 32px/38px var(--font-sans);
    letter-spacing: -0.01em;
    color: var(--ink);
  }
  #masthead .ast-mobile-header-content .menu-link::after { display: none; }
  #masthead .ast-mobile-header-content :is(.current-menu-item, .current_page_item) > .menu-link { color: var(--tide-ink); background: transparent; }
  #masthead .ast-mobile-header-content .sub-menu { margin: 0 0 var(--space-6); padding: 0; border: 0; box-shadow: none; background: transparent; }
  #masthead .ast-mobile-header-content .ast-submenu-expanded > .sub-menu { display: flex !important; flex-wrap: wrap; gap: var(--space-2); }
  #masthead .ast-mobile-header-content .sub-menu > .menu-item { width: auto; border: 0; animation: lb-menu-item 400ms var(--ease-out) both; }
  #masthead .ast-mobile-header-content .sub-menu .menu-link {
    display: inline-flex;
    align-items: center;
    height: 44px;
    padding: 0 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--surface-raised);
    font: 500 15px/22px var(--font-ui);
    color: var(--ink);
  }
  #masthead .ast-mobile-header-content .sub-menu .menu-link:hover { background: var(--surface-sand); color: var(--ink); }
  #masthead .ast-mobile-header-content .sub-menu :is(.ast-icon, .ast-arrow-svg, .menu-link > svg) { display: none; }
  #masthead .ast-mobile-header-content .ast-menu-toggle svg { transition: transform 300ms var(--ease-out); }
  #masthead .ast-mobile-header-content .ast-submenu-expanded > .ast-menu-toggle svg { transform: rotate(180deg); }
  #masthead .ast-mobile-header-content .ast-menu-toggle {
    top: 12px;
    width: 44px; height: 44px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    color: var(--ink);
    background: transparent;
  }
}
@keyframes lb-menu-item { from { opacity: 0; transform: translateY(12px); } }

/* ---------- Footer ---------- */
#colophon .site-below-footer-wrap { display: none !important; }
.site-footer, .lb-footer-bar { background: var(--surface); }
.lb-footer {
  width: min(var(--lb-max), 100% - 2 * var(--lb-gutter));
  margin: var(--space-24) auto 0;
  padding: var(--space-16) 0 var(--space-8);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--space-8);
  color: var(--ink);
}
.lb-footer-brand { grid-column: span 5; display: grid; gap: var(--space-4); align-content: start; }
.lb-footer-wordmark { width: 220px; max-width: 100%; }
.lb-footer-brand p { margin: 0; max-width: 40ch; font-size: 15px; line-height: 22px; color: var(--ink-muted); }
.lb-footer-nav { grid-column: 7 / span 6; }
.lb-footer-nav ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: var(--space-8); }
.lb-footer-nav li { break-inside: avoid; }
.lb-footer-nav a { display: inline-flex; min-height: 44px; align-items: center; font-size: 15px; color: var(--ink); text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 calc(100% - 10px) / 0 1px no-repeat; transition: background-size 300ms var(--ease-out); }
.lb-footer-nav a:hover { background-size: 100% 1px; }
.lb-footer-bar {
  width: min(var(--lb-max), 100% - 2 * var(--lb-gutter));
  margin: 0 auto;
  padding: var(--space-6) 0 var(--space-12);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-8);
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
}
.lb-footer-notes { display: grid; gap: var(--space-2); max-width: 72ch; }
.lb-footer-note { margin: 0; font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.lb-footer-note strong { color: var(--ink); font-weight: 600; }
.lb-footer-copy { margin: 0; font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.lb-theme-toggle { display: inline-flex; padding: var(--space-1); gap: var(--space-1); border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface-raised); }
.lb-theme-toggle button {
  min-height: 36px;
  padding: 0 var(--space-4);
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink-muted);
  font: 500 14px/20px var(--font-ui);
  cursor: pointer;
  transition: background-color 200ms ease-out, color 200ms ease-out;
}
.lb-theme-toggle button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
@media (max-width: 1023px) {
  .lb-footer { grid-template-columns: 1fr; padding: var(--space-12) 0 var(--space-6); margin-top: var(--space-12); }
  .lb-footer-brand, .lb-footer-nav { grid-column: auto; }
  .lb-footer-bar { padding: var(--space-6) 0 var(--space-12); }
}

/* ---------- Astra scroll-to-top ---------- */
#ast-scroll-top {
  width: 44px; height: 44px;
  place-items: center;
  border-radius: var(--radius-pill);
  background: var(--surface-raised);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-float);
  transition: transform 300ms var(--ease-out), background-color 200ms ease-out;
}
#ast-scroll-top:not([style*="none"]) { display: grid !important; }
#ast-scroll-top:hover { transform: translateY(-2px); background: var(--surface-sand); }
#ast-scroll-top .ast-icon svg { fill: currentColor; width: 14px; height: 14px; }

/* Elementor-built posts carry their own title and byline; Astra's entry header would duplicate them. */
body.elementor-page.single .entry-header { display: none; }

/* Astra previous / next post links as a pair of cards. */
.single .post-navigation { width: min(var(--lb-max), 100% - 2 * var(--lb-gutter)); max-width: none; margin: var(--space-16) auto 0; padding: 0; border: 0; }
.single .post-navigation .nav-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6); }
.single .post-navigation :is(.nav-previous, .nav-next) { width: auto; margin: 0; padding: 0; }
.single .post-navigation a {
  display: grid; gap: var(--space-2); height: 100%;
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  box-shadow: var(--shadow-card);
  color: var(--ink);
  text-decoration: none;
  transition: transform 300ms var(--ease-out), box-shadow 300ms var(--ease-out);
}
.single .post-navigation a:hover { transform: translateY(-2px); box-shadow: var(--shadow-float); color: var(--ink); }
.single .post-navigation a p { margin: 0; font: 500 20px/26px var(--font-sans); letter-spacing: -0.005em; color: var(--ink); }
.single .post-navigation .ast-post-nav { font: 600 12px/16px var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
.single .post-navigation .nav-next a { text-align: right; }
@media (max-width: 639px) {
  .single .post-navigation { margin-top: var(--space-12); }
  .single .post-navigation .nav-links { grid-template-columns: 1fr; gap: var(--space-4); }
  .single .post-navigation .nav-next a { text-align: left; }
}

/* Comments. */
.single :is(#comments, .comment-respond) { max-width: 760px; margin-inline: auto; padding-inline: var(--space-8); background: transparent; }
.single .comment-respond { margin-top: var(--space-16); }
.single :is(.comment-reply-title, .comments-title) { font: 300 32px/38px var(--font-sans); letter-spacing: -0.01em; color: var(--ink); }
.single .comment-form :is(p, label) { font: 400 15px/22px var(--font-ui); color: var(--ink-muted); }
.single .comment-form :is(input[type="text"], input[type="email"], input[type="url"], textarea) {
  width: 100%;
  padding: 12px 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface-raised);
  color: var(--ink);
  font: 400 16px/22px var(--font-ui);
}
.single .comment-form textarea { border-radius: var(--radius-md); min-height: 160px; }
.single .comment-form :is(input, textarea):focus { outline: 2px solid var(--focus); outline-offset: 2px; border-color: var(--line-strong); }
.single .comment-form #submit, .single .comment-form .submit {
  height: 44px;
  padding: 0 var(--space-6);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--surface);
  font: 500 15px/22px var(--font-ui);
  cursor: pointer;
  transition: filter 200ms ease-out, transform 200ms ease-out;
}
.single .comment-form #submit:hover { filter: brightness(.92); }
.single .comment-form #submit:active { transform: scale(.98); }
@media (max-width: 639px) { .single :is(#comments, .comment-respond) { padding-inline: var(--space-4); } }

/* ---------- Table of contents (single posts) ---------- */
html { scroll-behavior: smooth; }
.single-post .elementor h2 { scroll-margin-top: 96px; }
.lb-toc {
  position: fixed;
  top: 120px;
  width: 200px;
  max-height: calc(100vh - 200px);
  overflow: auto;
  z-index: 50;
  display: none;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 400ms var(--ease-out), transform 400ms var(--ease-out);
}
.lb-toc.is-available { display: block; }
.lb-toc-visible .lb-toc { opacity: 1; transform: none; }
.lb-toc-label { margin: 0 0 var(--space-3); font: 600 12px/16px var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
.lb-toc ol, .lb-toc-sheet ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.lb-toc a, .lb-toc-sheet a {
  position: relative;
  display: block;
  padding: 6px 0 6px 16px;
  font: 400 14px/20px var(--font-ui);
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 200ms ease-out;
}
.lb-toc a::before, .lb-toc-sheet a::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 6px; height: 6px;
  margin-top: -3px;
  border-radius: var(--radius-pill);
  background: var(--line-strong);
  transform: scale(.5);
  transition: transform 300ms var(--ease-out), background-color 300ms var(--ease-out);
}
.lb-toc a:hover, .lb-toc-sheet a:hover { color: var(--ink); }
.lb-toc a[aria-current="true"], .lb-toc-sheet a[aria-current="true"] { color: var(--ink); font-weight: 500; }
.lb-toc a[aria-current="true"]::before, .lb-toc-sheet a[aria-current="true"]::before { background: var(--tide); transform: scale(1); }

.lb-toc-pill {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 60;
  display: none;
  align-items: center;
  gap: var(--space-2);
  height: 44px;
  padding: 0 var(--space-6) 0 var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--surface-raised) 72%, transparent);
  -webkit-backdrop-filter: blur(var(--glass-blur));
          backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-float);
  color: var(--ink);
  font: 500 15px/22px var(--font-ui);
  cursor: pointer;
  opacity: 0;
  transform: translate(-50%, 24px);
  pointer-events: none;
  transition: opacity 400ms var(--ease-out), transform 400ms var(--ease-out);
}
@supports not (backdrop-filter: blur(1px)) { .lb-toc-pill { background: var(--surface-raised); } }
.lb-toc-pill.is-available { display: inline-flex; }
.lb-toc-visible .lb-toc-pill { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.lb-toc-pill:active { transform: translate(-50%, 0) scale(.98); }

.lb-toc-sheet {
  margin: auto auto 0;
  width: 100%;
  max-width: 640px;
  max-height: 80vh;
  padding: var(--space-6) var(--space-6) calc(var(--space-8) + env(safe-area-inset-bottom));
  border: 0;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background: var(--surface-raised);
  color: var(--ink);
  box-shadow: var(--shadow-float);
}
.lb-toc-sheet[open] { animation: lb-sheet-in 400ms var(--ease-out); }
.lb-toc-sheet::backdrop { background: color-mix(in srgb, var(--ink) 40%, transparent); animation: lb-fade-in 400ms ease-out; }
.lb-toc-sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-3); }
.lb-toc-sheet-head .lb-toc-label { margin: 0; }
.lb-toc-close { min-height: 44px; padding: 0 var(--space-4); border: 1px solid var(--line-strong); border-radius: var(--radius-pill); background: transparent; color: var(--ink); font: 500 14px/20px var(--font-ui); cursor: pointer; }
.lb-toc-sheet a { font-size: 17px; line-height: 24px; padding-block: 12px; border-top: 1px solid var(--line); }
.lb-sheet-open body { overflow: hidden; }
@keyframes lb-sheet-in { from { transform: translateY(100%); } }
@keyframes lb-fade-in { from { opacity: 0; } }

/* ---------- Archives and search (Astra blog loop) ---------- */
.lb-archive-head { grid-column: 1 / -1; display: grid; gap: var(--space-4); padding: var(--space-16) 0 var(--space-12); max-width: 760px; }
.lb-archive-label { margin: 0; font: 600 12px/16px var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--caramel-ink); }
.lb-archive-title { margin: 0; font: 300 72px/72px var(--font-sans); letter-spacing: -0.03em; color: var(--ink); text-wrap: balance; }
.lb-archive-lede { margin: 0; max-width: 48ch; font: 400 22px/32px var(--font-serif); color: var(--ink-muted); text-wrap: pretty; }
.lb-archive-topics { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
.lb-archive-topics a {
  display: inline-flex; align-items: center; height: 44px; padding: 0 20px;
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  background: var(--surface-raised); color: var(--ink);
  font: 500 15px/22px var(--font-ui); text-decoration: none;
  transition: background-color 200ms ease-out, border-color 200ms ease-out, transform 200ms ease-out;
}
.lb-archive-topics a:hover { background: var(--surface-sand); border-color: var(--line-strong); color: var(--ink); }
.lb-archive-topics a:active { transform: scale(.98); }
.lb-archive-topics a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }

body:is(.blog, .archive, .search) .site-content > .ast-container { display: block; width: min(var(--lb-max), 100% - 2 * var(--lb-gutter)); max-width: none; margin: 0 auto; padding: 0; }
body:is(.blog, .archive, .search) #primary { margin: 0; padding: 0 0 var(--space-16); width: 100%; }
:is(.blog, .archive, .search) #main > .ast-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6);
  margin: 0;
}
:is(.blog, .archive, .search) #main > .ast-row > .ast-article-post { width: auto; max-width: none; margin: 0; padding: 0; float: none; }
:is(.blog, .archive, .search) .ast-article-post .ast-article-inner {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-raised);
  box-shadow: var(--shadow-card);
  transition: transform 300ms var(--ease-out), box-shadow 300ms var(--ease-out);
}
:is(.blog, .archive, .search) .ast-article-post .ast-article-inner:hover { transform: translateY(-2px); box-shadow: var(--shadow-float); }
:is(.blog, .archive, .search) .ast-article-post .post-content { display: flex; flex-direction: column; gap: var(--space-2); padding: 0 0 var(--space-6); background: transparent; }
:is(.blog, .archive, .search) .ast-article-post .post-content > :not(.ast-blog-featured-section) { margin: 0; padding-inline: var(--space-6); }
:is(.blog, .archive, .search) .ast-blog-featured-section { margin: 0 0 var(--space-4) !important; overflow: hidden; }
:is(.blog, .archive, .search) .ast-blog-featured-section img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform 700ms var(--ease-out); }
:is(.blog, .archive, .search) .ast-article-inner:hover .ast-blog-featured-section img { transform: scale(1.03); }
:is(.blog, .archive, .search) .cat-links, :is(.blog, .archive, .search) .cat-links a {
  font: 600 12px/16px var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--tide-ink); text-decoration: none;
  position: relative; z-index: 1;
}
:is(.blog, .archive, .search) .entry-title { margin: 0; font: 500 20px/26px var(--font-sans); letter-spacing: -0.005em; }
:is(.blog, .archive, .search) .entry-title a { color: var(--ink); text-decoration: none; }
/* The whole card is the link. */
:is(.blog, .archive, .search) .entry-title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
:is(.blog, .archive, .search) .entry-title a:focus-visible { outline: none; }
:is(.blog, .archive, .search) .ast-article-inner:has(.entry-title a:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
:is(.blog, .archive, .search) .entry-meta, :is(.blog, .archive, .search) .entry-meta * { font: 400 13px/18px var(--font-ui); color: var(--ink-muted); text-decoration: none; }
:is(.blog, .archive, .search) .ast-excerpt-container, :is(.blog, .archive, .search) .ast-excerpt-container p { margin: 0; font: 400 15px/22px var(--font-ui); color: var(--ink-muted); }
:is(.blog, .archive, .search) .read-more { display: none; }
.ast-pagination { margin-top: var(--space-12); }
.ast-pagination .nav-links { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: center; }
.ast-pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 var(--space-4);
  border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface-raised); color: var(--ink);
  font: 500 15px/22px var(--font-ui); text-decoration: none;
}
.ast-pagination .page-numbers:hover { background: var(--surface-sand); color: var(--ink); }
.ast-pagination .page-numbers.current { background: var(--ink); border-color: var(--ink); color: var(--surface); }
@media (max-width: 1023px) {
  :is(.blog, .archive, .search) #main > .ast-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lb-archive-head { padding: var(--space-12) 0 var(--space-8); }
  .lb-archive-title { font-size: 48px; line-height: 52px; }
  .lb-archive-lede { font-size: 20px; line-height: 30px; }
}
@media (max-width: 639px) {
  body:is(.blog, .archive, .search) #primary { padding-bottom: var(--space-12); }
  :is(.blog, .archive, .search) #main > .ast-row { grid-template-columns: 1fr; }
  .lb-archive-topics { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(var(--space-4) * -1); padding: 0 var(--space-4) var(--space-2); scrollbar-width: none; }
  .lb-archive-topics a { flex: none; }
}

/* ---------- 404 ---------- */
.lb-404 { width: min(var(--lb-max), 100% - 2 * var(--lb-gutter)); margin: 0 auto; padding: var(--space-16) 0 0; }
.lb-404-hero { display: grid; gap: var(--space-4); max-width: 720px; }
.lb-404-code { margin: 0; font: 600 12px/16px var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--caramel-ink); }
.lb-404 h1 { margin: 0; font: 300 72px/72px var(--font-sans); letter-spacing: -0.03em; color: var(--ink); text-wrap: balance; }
.lb-404-lede { margin: 0; max-width: 44ch; font: 400 22px/32px var(--font-serif); color: var(--ink-muted); }
.lb-404-search { display: flex; gap: var(--space-2); max-width: 560px; margin-top: var(--space-4); }
.lb-404-search input[type="search"] {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 var(--space-6);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface-raised);
  color: var(--ink);
  font: 400 16px/22px var(--font-ui);
}
.lb-404-search input[type="search"]::placeholder { color: var(--ink-muted); }
.lb-404-btn, .lb-404-search button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: 48px; padding: 0 var(--space-6);
  border: 1px solid transparent; border-radius: var(--radius-pill);
  font: 500 15px/22px var(--font-ui); text-decoration: none; cursor: pointer;
  transition: transform 200ms ease-out, filter 200ms ease-out;
}
.lb-404-search button { background: var(--surface-raised); color: var(--ink); border-color: var(--line-strong); }
.lb-404-btn { width: fit-content; background: var(--ink); color: var(--surface); }
.lb-404-btn:hover { filter: brightness(.92); color: var(--surface); }
.lb-404-btn:active, .lb-404-search button:active { transform: scale(.98); }
.lb-404-pills { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-4) 0 var(--space-6); padding: 0; list-style: none; }
.lb-404-pills a { display: inline-flex; align-items: center; height: 44px; padding: 0 var(--space-5, 20px); border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface-raised); color: var(--ink); font: 500 15px/22px var(--font-ui); text-decoration: none; transition: background-color 200ms ease-out, border-color 200ms ease-out; }
.lb-404-pills a:hover { background: var(--surface-sand); border-color: var(--line-strong); color: var(--ink); }
.lb-404-popular { margin-top: var(--space-24); }
.lb-404-popular h2 { margin: 0 0 var(--space-6); font: 300 48px/52px var(--font-sans); letter-spacing: -0.02em; color: var(--ink); }
.lb-404-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-6); list-style: none; margin: 0; padding: 0; }
.lb-404-card {
  display: flex; flex-direction: column; height: 100%;
  border-radius: var(--radius-lg); overflow: hidden;
  background: var(--surface-raised); color: var(--ink);
  box-shadow: var(--shadow-card); text-decoration: none;
  transition: transform 300ms var(--ease-out), box-shadow 300ms var(--ease-out);
}
.lb-404-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-float); color: var(--ink); }
.lb-404-card-media { aspect-ratio: 4 / 3; background: var(--surface-sand) center / cover no-repeat; }
.lb-404-card:nth-child(3n+2) .lb-404-card-media { background-color: var(--tide-soft); }
.lb-404-card:nth-child(3n+3) .lb-404-card-media { background-color: var(--caramel-soft); }
.lb-404-card-body { display: grid; gap: var(--space-2); padding: var(--space-6); }
.lb-404-card-kicker { font: 600 12px/16px var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--tide-ink); }
.lb-404-card-title { margin: 0; font: 500 20px/26px var(--font-sans); letter-spacing: -0.005em; }
.lb-404-card-meta { font: 400 13px/18px var(--font-ui); color: var(--ink-muted); }
@media (max-width: 1023px) {
  .lb-404 { padding: var(--space-12) 0 0; }
  .lb-404 h1 { font-size: 48px; line-height: 52px; }
  .lb-404-lede { font-size: 20px; line-height: 30px; }
  .lb-404-popular { margin-top: var(--space-12); }
  .lb-404-popular h2 { font-size: 40px; line-height: 44px; }
  .lb-404-grid { grid-auto-flow: column; grid-auto-columns: 264px; grid-template-columns: none; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: calc(var(--space-4) * -1); padding: 0 var(--space-4) var(--space-4); }
  .lb-404-grid > li { scroll-snap-align: start; }
}

/* ---------- Reading progress (single posts) ---------- */
.lb-progress { position: fixed; inset: 0 0 auto; height: 3px; z-index: 200; pointer-events: none; }
.lb-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--caramel), var(--tide)); transform-origin: 0 50%; transform: scaleX(var(--lb-progress, 0)); }
.admin-bar .lb-progress { top: 32px; }

/* ---------- Motion ---------- */
/* Hidden only while the motion script is expected; the head script removes .lb-motion if it never runs. */
.lb-motion :is(.lb-h-hero, .lb-h-section, .lb-h-section-on-dark, .lb-reveal, .lb-stagger > *, .lb-card, .lb-media-frame-hero, .lb-chapter-espresso, .lb-chapter-tide, .lb-chapter-sand),
.lb-motion :has(> .lb-h-hero) > *,
.lb-motion :is(.blog, .archive, .search) #main > .ast-row > .ast-article-post { visibility: hidden; }
.lb-split-line { display: block; }
.lb-tilt, .lb-card { position: relative; transform-style: preserve-3d; }
.lb-glare { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255,255,255,.18), transparent 55%); opacity: 0; transition: opacity 300ms ease-out; mix-blend-mode: soft-light; }
.lb-card:hover > .lb-glare, .lb-tilt:hover > .lb-glare { opacity: 1; }

@property --mx { syntax: "<number>"; inherits: false; initial-value: 72; }
@property --my { syntax: "<number>"; inherits: false; initial-value: 18; }
.lb-spotlight {
  background-image: radial-gradient(640px circle at calc(var(--mx) * 1%) calc(var(--my) * 1%), color-mix(in srgb, var(--surface-raised) 60%, transparent), transparent 62%);
}

/* Cross-document page transitions (supporting browsers only). */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 280ms ease-out both lb-vt-out; }
::view-transition-new(root) { animation: 420ms var(--ease-out) both lb-vt-in; }
@keyframes lb-vt-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes lb-vt-in { from { opacity: 0; transform: translateY(12px); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #masthead .ast-mobile-header-content, #masthead .ast-mobile-header-content .main-header-menu > .menu-item { animation: none; }
  .lb-toc, .lb-toc-pill, .lb-toc-sheet[open], .lb-toc-sheet::backdrop, .lb-tilt .lb-media-frame, .lb-card .lb-media-frame, .lb-404-card { transition: none; animation: none; }
  .lb-tilt:hover .lb-media-frame, .lb-card:hover .lb-media-frame { transform: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  .lb-chapter-espresso::before, .lb-chapter-tide::before { animation: none; }
  body, .lb-btn-accent, .lb-btn-primary, .lb-btn-accent::after, .lb-btn-primary::after, .lb-pill, .lb-pill-active, .lb-card, #masthead, .lb-footer-nav a, .lb-theme-toggle button { transition: none; }
  .lb-card:hover { transform: none; }
  #masthead.lb-header-hidden { transform: none; }
}

/* =====================================================================
   Signature layer
   ===================================================================== */

/* Smooth scroll (Lenis) */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* Film grain: a barely-there texture over everything. */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 9990;
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: lb-grain 1.2s steps(6) infinite;
}
html[data-theme="dark"] body::after { opacity: .05; mix-blend-mode: screen; }
@keyframes lb-grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 2%); } 100% { transform: translate(0, 0); }
}

/* Intro curtain: shown once per session while motion is on. */
.lb-intro { display: none; }
.lb-intro-on .lb-intro {
  display: grid;
  place-items: center;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--surface-espresso);
  animation: lb-intro-failsafe 0s 3.4s forwards;
}
.lb-intro-mark {
  width: min(560px, 70vw);
  aspect-ratio: 725 / 131;
  background: var(--on-espresso);
  -webkit-mask: url("../img/logo-wordmark.png") center / contain no-repeat;
          mask: url("../img/logo-wordmark.png") center / contain no-repeat;
}
.lb-intro-line {
  position: absolute;
  left: 50%;
  top: calc(50% + min(60px, 9vw));
  width: min(560px, 70vw);
  height: 1px;
  margin-left: calc(min(560px, 70vw) / -2);
  background: linear-gradient(90deg, transparent, var(--caramel), transparent);
  transform-origin: 50% 50%;
}
@keyframes lb-intro-failsafe { to { visibility: hidden; opacity: 0; } }

/* Floating header: condenses into a glass pill once you scroll. */
#masthead .main-header-bar, #masthead .ast-primary-header-bar {
  transition: margin 500ms var(--ease-out), border-radius 500ms var(--ease-out), box-shadow 500ms var(--ease-out), max-width 500ms var(--ease-out), border-color 500ms var(--ease-out);
}
#masthead.lb-header-scrolled .main-header-bar,
#masthead.lb-header-scrolled .ast-mobile-header-wrap .ast-primary-header-bar {
  max-width: calc(var(--lb-max) + 2 * var(--lb-gutter));
  margin: 10px auto 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  box-shadow: 0 18px 40px -24px color-mix(in srgb, var(--ink) 55%, transparent);
}
@media (max-width: 921px) {
  #masthead.lb-header-scrolled .ast-mobile-header-wrap .ast-primary-header-bar { margin: 8px 10px 0; }
}
#masthead.lb-header-scrolled .site-primary-header-wrap { padding-inline: 28px; }

/* Cursor follower (fine pointers only; the system cursor stays visible). */
.lb-cursor {
  position: fixed;
  left: 0; top: 0;
  z-index: 9995;
  width: 36px; height: 36px;
  margin: -18px 0 0 -18px;
  border: 1px solid color-mix(in srgb, var(--ink) 45%, transparent);
  border-radius: var(--radius-pill);
  pointer-events: none;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(.4);
  transition: opacity 300ms ease-out, width 400ms var(--ease-out), height 400ms var(--ease-out), margin 400ms var(--ease-out), background-color 400ms var(--ease-out), border-color 400ms var(--ease-out);
}
.lb-cursor.is-visible { opacity: 1; }
.lb-cursor.is-link { width: 56px; height: 56px; margin: -28px 0 0 -28px; border-color: var(--caramel); background: color-mix(in srgb, var(--caramel) 12%, transparent); }
.lb-cursor.is-card { width: 88px; height: 88px; margin: -44px 0 0 -44px; border-color: transparent; background: var(--ink); }
.lb-cursor.is-down { width: 28px; height: 28px; margin: -14px 0 0 -14px; }
.lb-cursor.is-hidden { opacity: 0; }
.lb-cursor-label { font: 600 12px/1 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--surface); opacity: 0; transition: opacity 250ms ease-out; }
.lb-cursor.is-card .lb-cursor-label { opacity: 1; }

/* Hero panel: two soft light orbs drift behind the text. */
.lb-hero-panel { position: relative; overflow: hidden; isolation: isolate; }
.lb-hero-panel::before, .lb-hero-panel::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 60%;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  opacity: .55;
}
.lb-hero-panel::before { left: -10%; top: -30%; background: radial-gradient(circle, color-mix(in srgb, var(--caramel) 45%, transparent), transparent 65%); animation: lb-orb-a 22s ease-in-out infinite alternate; }
.lb-hero-panel::after { right: -15%; bottom: -40%; background: radial-gradient(circle, color-mix(in srgb, var(--tide) 30%, transparent), transparent 65%); animation: lb-orb-b 26s ease-in-out infinite alternate; }
@keyframes lb-orb-a { to { transform: translate(18%, 22%) scale(1.15); } }
@keyframes lb-orb-b { to { transform: translate(-20%, -18%) scale(1.1); } }

/* Topic marquee */
.lb-marquee.is-running {
  display: flex !important;
  flex-wrap: nowrap !important;
  flex-direction: row !important;
  gap: 0 !important;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.lb-marquee .lb-marquee-track {
  display: flex !important;
  flex: none;
  flex-wrap: nowrap !important;
  flex-direction: row !important;
  align-items: center;
  gap: var(--space-2);
  padding-right: var(--space-2);
  animation: lb-marquee 42s linear infinite;
}
.lb-marquee:hover .lb-marquee-track, .lb-marquee:focus-within .lb-marquee-track { animation-play-state: paused; }
@keyframes lb-marquee { to { transform: translateX(-100%); } }

/* Pull quotes */
.lb-quote-reveal {
  font-family: var(--font-serif) !important;
  font-style: italic;
  font-size: clamp(26px, 2.6vw, 36px) !important;
  line-height: 1.25 !important;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.lb-quote-word { display: inline-block; will-change: opacity; }

/* Article photo preview beside the cursor */
.lb-preview {
  position: fixed;
  left: 0; top: 0;
  z-index: 9980;
  width: 260px;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  pointer-events: none;
  box-shadow: var(--shadow-float);
  opacity: 0;
  visibility: hidden;
  transform: scale(.9);
}
.lb-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-hover-row { position: relative; transition: padding-left 400ms var(--ease-out), color 300ms ease-out; }
/* The whole row is the link. */
.lb-hover-row a::after { content: ""; position: absolute; inset: 0; }
.lb-hover-row :is(h2, h3) a { color: inherit; }
.lb-row-arrow { display: block; flex: none; width: 20px; height: 20px; margin-top: 4px; opacity: .45; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat; }
.lb-hover-row:hover .lb-num-lg, .lb-hover-row:focus-within .lb-num-lg { color: var(--caramel); transform: translateX(6px); }
.lb-hover-row .lb-num-lg { transition: color 400ms var(--ease-out), transform 500ms var(--ease-out); }

/* Footer wordmark: spans the grid, rising into place. */
.lb-footer-giant {
  width: min(var(--lb-max), 100% - 2 * var(--lb-gutter));
  margin: var(--space-12) auto 0;
  overflow: hidden;
}
.lb-footer-giant span {
  display: block;
  width: 100%;
  aspect-ratio: 725 / 131;
  background: linear-gradient(180deg, var(--ink), color-mix(in srgb, var(--ink) 55%, var(--caramel)));
  -webkit-mask: url("../img/logo-wordmark.png") left bottom / contain no-repeat;
          mask: url("../img/logo-wordmark.png") left bottom / contain no-repeat;
}

/* 404: oversized numerals drift behind the message. */
.lb-404 { position: relative; isolation: isolate; --lx: 0; --ly: 0; }
.lb-404::before {
  content: "404";
  position: absolute;
  z-index: -1;
  right: 0;
  top: 0;
  font: 300 clamp(180px, 32vw, 440px)/0.8 var(--font-sans);
  letter-spacing: -0.06em;
  color: transparent;
  -webkit-text-stroke: 1px var(--line-strong);
  opacity: .5;
  transform: translate(calc(var(--lx) * 1px), calc(var(--ly) * 1px));
  pointer-events: none;
}

/* Refined scrollbar */
@supports (scrollbar-color: auto) { html { scrollbar-color: color-mix(in srgb, var(--ink) 30%, transparent) transparent; scrollbar-width: thin; } }

@media (prefers-reduced-motion: reduce) {
  body::after, .lb-hero-panel::before, .lb-hero-panel::after, .lb-marquee .lb-marquee-track { animation: none; }
  .lb-intro-on .lb-intro, .lb-cursor, .lb-preview { display: none; }
  #masthead .main-header-bar, #masthead .ast-primary-header-bar, .lb-hover-row { transition: none; }
}

/* Author avatar: byline and end-of-article author box (Elementor classes lb-byline, lb-author-box). */
.lb-byline { display: flex !important; align-items: center; gap: var(--space-3); }
.lb-byline::before {
  content: "";
  flex: none;
  width: 40px; height: 40px;
  border-radius: var(--radius-pill);
  background: url("../img/author.webp") center / cover no-repeat;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line-strong);
}
.lb-author-box {
  display: grid !important;
  grid-template-columns: 72px minmax(0, 1fr);
  column-gap: var(--space-6);
  row-gap: var(--space-2);
  align-items: start;
}
.lb-author-box::before {
  content: "";
  grid-row: 1 / span 2;
  width: 72px; height: 72px;
  border-radius: var(--radius-pill);
  background: url("../img/author.webp") center / cover no-repeat;
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--caramel);
}
.lb-author-box > * { grid-column: 2; }

/* ---------- Full-screen home hero ---------- */
.elementor > .e-con.lb-hero-full {
  min-height: 100svh;
  margin-top: calc(var(--lb-header-h, 80px) * -1);
  padding: calc(var(--lb-header-h, 80px) + 48px) max(var(--lb-gutter), (100% - var(--lb-max)) / 2) 72px !important;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: var(--surface-espresso);
  color: var(--on-espresso);
  isolation: isolate;
}
.lb-hero-full .lb-hero-bg {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none;
  object-fit: cover;
  object-position: 62% 38%;
  z-index: -2;
  transform-origin: 62% 40%;
}
.lb-hero-full .lb-hero-scrim {
  position: absolute !important;
  inset: 0;
  z-index: -1;
  padding: 0 !important;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--surface-espresso) 90%, transparent) 0%, color-mix(in srgb, var(--surface-espresso) 60%, transparent) 40%, transparent 72%),
    linear-gradient(0deg, color-mix(in srgb, var(--surface-espresso) 94%, transparent) 0%, transparent 58%),
    radial-gradient(ellipse 55% 45% at 18% 100%, color-mix(in srgb, var(--caramel) 30%, transparent), transparent 70%);
}
.lb-hero-full .lb-hero-content {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  align-items: end;
  column-gap: 56px;
  row-gap: 32px;
  width: 100%;
  padding: 0 !important;
}
.lb-hero-full .lb-hero-copy { display: flex !important; flex-direction: column !important; align-items: flex-start; gap: 20px; max-width: 800px; padding: 0 !important; }
.lb-hero-full .lb-hero-title {
  font-size: clamp(56px, 8.6vw, 136px) !important;
  line-height: .92 !important;
  letter-spacing: -0.045em !important;
  color: var(--on-espresso) !important;
  margin: 0;
}
.lb-hero-full .lb-tag-on-dark { white-space: normal; }
.lb-hero-full .lb-lede-on-dark { max-width: 46ch; color: color-mix(in srgb, var(--on-espresso) 90%, transparent); }
.lb-hero-full .lb-hero-actions { display: flex !important; flex-direction: row !important; flex-wrap: wrap; gap: 12px; padding: 0 !important; margin-top: 8px; }
.elementor .lb-btn-ghost {
  display: inline-flex !important;
  align-items: center;
  height: 44px;
  padding: 0 24px !important;
  border-radius: var(--radius-pill);
  border: 1px solid color-mix(in srgb, var(--on-espresso) 60%, transparent);
  color: var(--on-espresso) !important;
  background: color-mix(in srgb, var(--on-espresso) 8%, transparent);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  font: 500 15px/22px var(--font-ui);
  text-decoration: none;
  transition: background-color 200ms ease-out, transform 200ms ease-out;
}
.elementor .lb-btn-ghost:hover { background: color-mix(in srgb, var(--on-espresso) 18%, transparent); }
.elementor .lb-btn-ghost:active { transform: scale(.98); }
.lb-hero-full .lb-hero-proof { display: flex !important; flex-direction: row !important; flex-wrap: wrap; gap: 8px 22px; padding: 0 !important; margin-top: 6px; }
.lb-hero-proof p { display: inline-flex; align-items: center; gap: 8px; font: 500 13px/18px var(--font-ui); color: color-mix(in srgb, var(--on-espresso) 85%, transparent); }
.lb-hero-proof p::before { content: ""; width: 6px; height: 6px; border-radius: var(--radius-pill); background: var(--caramel); }
.lb-hero-full .lb-hero-card {
  position: relative;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px;
  padding: 24px !important;
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface-raised) 74%, transparent);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
          backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
  border: 1px solid color-mix(in srgb, var(--surface-raised) 45%, transparent);
  box-shadow: var(--shadow-float);
  color: var(--ink);
  transition: transform 400ms var(--ease-out);
}
@supports not (backdrop-filter: blur(1px)) { .lb-hero-card { background: var(--surface-raised); } }
.lb-hero-card:hover { transform: translateY(-4px); }
.lb-hero-card a { color: var(--ink); text-decoration: none; }
.lb-hero-card a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.lb-scroll-cue {
  position: absolute !important;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  padding-bottom: 30px;
  font: 600 11px/16px var(--font-ui);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--on-espresso) 75%, transparent);
}
.lb-scroll-cue::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 1px;
  height: 24px;
  background: currentColor;
  animation: lb-cue 1.8s var(--ease-out) infinite;
}
@keyframes lb-cue { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }
@media (max-width: 1023px) {
  .lb-hero-full .lb-hero-content { grid-template-columns: minmax(0, 1fr); }
  .lb-hero-full .lb-hero-card { max-width: 440px; }
}
/* Phones: the photo becomes a clean band at the top that fades into espresso,
   and the copy sits below it on solid colour instead of over the busy middle of the image. */
@media (max-width: 767px) {
  .lb-hero-full { --lb-band: calc(var(--lb-header-h, 64px) + min(84vw, 400px)); }
  .elementor > .e-con.lb-hero-full {
    min-height: 0;
    justify-content: flex-start;
    padding: calc(var(--lb-band) - 72px) var(--lb-gutter) 40px !important;
  }
  .lb-hero-full .lb-hero-bg {
    inset: 0 0 auto 0;
    height: var(--lb-band) !important;
    object-position: 70% 30%;
    transform-origin: 50% 0;
    -webkit-mask-image: linear-gradient(180deg, #000 62%, transparent 96%);
            mask-image: linear-gradient(180deg, #000 62%, transparent 96%);
  }
  .lb-hero-full .lb-hero-scrim {
    inset: 0 0 auto 0;
    height: calc(var(--lb-band) + 2px);
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--surface-espresso) 70%, transparent) 0%, transparent calc(var(--lb-header-h, 64px) + 40px)),
      linear-gradient(0deg, var(--surface-espresso) 0%, color-mix(in srgb, var(--surface-espresso) 88%, transparent) 72px, transparent 58%);
  }
  .lb-hero-full .lb-hero-content { row-gap: 28px; }
  .lb-hero-full .lb-hero-copy { gap: 16px; }
  .lb-hero-full .lb-hero-title { font-size: clamp(44px, 13vw, 64px) !important; line-height: .96 !important; letter-spacing: -0.035em !important; }
  .lb-hero-full .lb-lede-on-dark { font-size: 17px; line-height: 26px; }
  .lb-hero-full .lb-hero-actions { width: 100%; }
  .lb-hero-full .lb-hero-actions > * { flex: 1 1 auto; justify-content: center; }
  .lb-hero-full .lb-hero-card { max-width: none; background: var(--surface-raised); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }
  .lb-scroll-cue { display: none !important; }
}

/* Header sits transparent over the hero until you scroll. */
body:has(.lb-hero-full) #masthead:not(.lb-header-scrolled) :is(.main-header-bar, .ast-primary-header-bar) {
  background: transparent;
  border-bottom-color: transparent;
  -webkit-backdrop-filter: none;
          backdrop-filter: none;
  box-shadow: none;
}
body:has(.lb-hero-full) #masthead:not(.lb-header-scrolled) .site-title a { background-color: var(--on-espresso); }
body:has(.lb-hero-full) #masthead:not(.lb-header-scrolled) .main-header-menu > .menu-item > .menu-link { color: var(--on-espresso); }
body:has(.lb-hero-full) #masthead:not(.lb-header-scrolled) .main-header-menu > .menu-item > .menu-link .ast-icon svg { fill: var(--on-espresso); }
body:has(.lb-hero-full) #masthead:not(.lb-header-scrolled) .menu-toggle { color: var(--on-espresso); border-color: color-mix(in srgb, var(--on-espresso) 60%, transparent); }
body:has(.lb-hero-full).ast-main-header-nav-open #masthead .site-title a { background-color: var(--ink); }
body:has(.lb-hero-full).ast-main-header-nav-open #masthead .menu-toggle { color: var(--ink); border-color: var(--line-strong); }
body:has(.lb-hero-full).ast-main-header-nav-open #masthead :is(.main-header-bar, .ast-primary-header-bar) { background: var(--surface); }

@media (prefers-reduced-motion: reduce) { .lb-scroll-cue::after { animation: none; } }

.lb-hover-row :is(h2, h3) a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size 500ms var(--ease-out); }
.lb-hover-row:hover :is(h2, h3) a, .lb-hover-row:focus-within :is(h2, h3) a { background-size: 100% 1px; }

/* ---------- Long-form article components ---------- */
.lb-tldr-item::before {
  content: "";
  position: absolute;
  left: 0; top: 2px;
  width: 20px; height: 20px;
  background: var(--tide-ink);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.lb-li::before { content: ""; position: absolute; left: 4px; top: 13px; width: 7px; height: 7px; border-radius: var(--radius-pill); background: var(--caramel); }
.lb-prose { scroll-margin-top: 110px; }
.lb-prose h2[id] { scroll-margin-top: 110px; }
.lb-prose sup a { font: 600 11px/0 var(--font-ui); color: var(--tide-ink); text-decoration: none; padding: 0 1px; }
.lb-prose sup a:hover { color: var(--ink); }
.lb-toc-link a { color: inherit; text-decoration: none; display: block; transition: color 200ms ease-out; }
.lb-toc-link:has(a[aria-current="true"]) { color: var(--ink); border-left-color: var(--caramel); font-weight: 500; }
.lb-toc-link:hover { color: var(--ink); }
.lb-source a { color: var(--tide-ink); text-underline-offset: 2px; }
.lb-source:target { background: var(--caramel-soft); border-radius: 8px; }

/* Interactive checklist */
.lb-check-item { transition: border-color 200ms ease-out, background-color 200ms ease-out; user-select: none; }
.lb-check-item::before {
  content: "";
  position: absolute;
  left: 16px; top: 50%;
  width: 20px; height: 20px;
  margin-top: -10px;
  border: 1.5px solid var(--line-strong);
  border-radius: 6px;
  transition: background-color 200ms ease-out, border-color 200ms ease-out;
}
.lb-check-item:hover { border-color: var(--line-strong); }
.lb-check-item[aria-checked="true"] { border-color: var(--caramel); background: color-mix(in srgb, var(--caramel-soft) 60%, transparent); }
.lb-check-item[aria-checked="true"]::before {
  background: var(--caramel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f1a16' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 14px no-repeat;
  border-color: var(--caramel);
}
.lb-check-advice { display: none; }
.lb-checklist.is-flagged .lb-check-advice { display: block; }

/* FAQ and myth accordions (Elementor e-accordion) */
.lb-faq details { border-bottom: 1px solid var(--line); }
.lb-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 18px 0;
  cursor: pointer;
  list-style: none;
  font: 500 18px/26px var(--font-sans);
  color: var(--ink);
}
.lb-faq summary::-webkit-details-marker { display: none; }
.lb-faq summary::after {
  content: "+";
  flex: none;
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  font: 300 20px/1 var(--font-sans);
  transition: transform 300ms var(--ease-out), background-color 200ms ease-out;
}
.lb-faq details[open] > summary::after { content: "–"; background: var(--surface-sand); }
.lb-faq summary > * { font: inherit; }
.lb-faq details > :not(summary) { padding: 0 0 20px; }
.lb-faq details > :not(summary) .lb-body, .lb-faq .e-accordion-item-content p { font: 400 17px/28px var(--font-serif); color: var(--ink); }
.lb-faq [class*="e-accordion-item-icon"] { display: none; }

/* Article tables: any column count; labelled cards on phones. */
.lb-table-head, .lb-table-row { display: grid !important; grid-template-columns: none !important; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
@media (max-width: 640px) {
  .lb-table.has-labels { overflow: visible !important; }
  .lb-table.has-labels .lb-table-head { display: none !important; }
  .elementor .lb-table.has-labels .lb-table-row { min-width: 0 !important; width: auto !important; }
  .lb-table.has-labels .lb-table-row { display: flex !important; flex-direction: column !important; gap: 6px !important; padding: 16px 18px !important; }
  .lb-table.has-labels .lb-table-row > :first-child { font-weight: 600; font-size: 17px; }
  .lb-table.has-labels .lb-table-row > [data-label]:not(:first-child)::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    font: 600 11px/16px var(--font-ui);
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ink-muted);
  }
}
