/* Shared structural rules for jameshwade.com (Light & Dark aware via CSS tokens) */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--s-bg);
  color: var(--s-ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* 5-Color Geological Strata Ribbon integrated cleanly atop #quarto-header */
#quarto-header::before {
  content: "";
  display: block;
  height: 6px;
  width: 100%;
  background: linear-gradient(
    to right,
    var(--c-pine) 0% 20%,
    var(--c-lake) 20% 40%,
    var(--c-ochre) 40% 60%,
    var(--c-copper) 60% 80%,
    var(--c-plum) 80% 100%
  );
}

#quarto-header.headroom--unpinned {
  transform: translateY(-115%);
}

/* Handcrafted Masthead Navbar */
#quarto-header .navbar {
  background-color: var(--s-paper) !important;
  border-bottom: 1.5px solid var(--s-border-ink);
  box-shadow: none;
}

#quarto-header .navbar .navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  font-weight: 700;
  font-size: 1.28rem;
  letter-spacing: -0.015em;
  color: var(--s-ink) !important;
}

#quarto-header .navbar .navbar-brand .navbar-logo {
  max-height: 34px;
  height: 34px;
  width: 34px;
  transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#quarto-header .navbar .navbar-brand:hover .navbar-logo {
  transform: rotate(45deg);
}

#quarto-header .navbar .navbar-nav .nav-link {
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.87rem;
  letter-spacing: 0.01em;
  color: var(--s-ink-soft) !important;
  padding: 0.45rem 0.75rem;
  border-bottom: 2px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}

#quarto-header .navbar .navbar-nav .nav-link:hover,
#quarto-header .navbar .navbar-nav .nav-link.active {
  color: var(--c-copper) !important;
}

#quarto-header .navbar .navbar-nav .nav-link.active {
  border-bottom-color: var(--c-copper);
}

#quarto-header .navbar .quarto-color-scheme-toggle,
#quarto-header .navbar .aa-DetachedSearchButton {
  color: var(--s-ink) !important;
}

/* Atlas Homepage Shell */
body.atlas-page main.content {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.atlas-opener {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(295px, 0.95fr);
  gap: 2rem;
  align-items: end;
  padding: 1.5rem 0 1.85rem;
  border-bottom: 1.5px solid var(--s-border);
}

.atlas-headline {
  font-family: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--s-ink);
  margin: 0 0 0.85rem;
}

.atlas-lead {
  font-family: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--s-ink-soft);
  max-width: 66ch;
  margin: 0;
}

.survey-colophon {
  background: var(--s-paper);
  border: 1.5px solid var(--s-border-ink);
  box-shadow: var(--s-shadow);
  padding: 0.95rem 1.15rem;
  transform: rotate(-0.6deg);
}

.survey-colophon .colophon-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  white-space: nowrap;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--c-copper);
  margin-bottom: 0.4rem;
}

.survey-colophon .colophon-body {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--s-ink-soft);
  margin: 0 0 0.55rem;
}

.survey-colophon .colophon-body strong {
  color: var(--s-ink);
}

.survey-colophon .colophon-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.45rem;
  border-top: 1px solid var(--s-border);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.75rem;
}

.survey-colophon .colophon-links a {
  color: var(--c-lake);
  font-weight: 600;
}

.survey-colophon .colophon-links a:hover {
  color: var(--c-copper);
}

.survey-colophon .colophon-links .llms-link {
  color: var(--s-ink-faint);
  font-weight: 500;
}

/* Interactive Atlas Workbench */
.atlas-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.36fr) minmax(350px, 1fr);
  border: 1.5px solid var(--s-border-ink);
  box-shadow: var(--s-shadow);
  margin: 1.75rem 0 2.5rem;
  background: var(--s-paper);
}

.atlas-map-pane {
  background: var(--s-tint);
  padding: 1.15rem 1.2rem;
  border-right: 1.5px solid var(--s-border-ink);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.85rem;
  min-width: 0;
}

.atlas-map-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem 0.75rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.69rem;
  letter-spacing: 0.04em;
  color: var(--s-ink-soft);
}

.atlas-bearing {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  color: var(--s-ink);
}

.bearing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-copper);
  flex-shrink: 0;
  transition: background-color 0.25s ease;
}

.atlas-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.67rem;
  font-weight: 600;
  padding: 0.16rem 0.45rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--s-ink-soft);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.legend-chip:hover,
.legend-chip.is-highlighted {
  background: var(--s-paper);
  border-color: var(--s-border-ink);
  color: var(--s-ink);
}

.legend-chip i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border: 1px solid var(--s-border-ink);
}

.atlas-svg-frame {
  border: 1.5px solid var(--s-border-ink);
  background: var(--s-water);
  overflow: hidden;
  position: relative;
}

.atlas-svg-frame svg {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
}

.atlas-svg-frame .night-stars {
  opacity: var(--s-star-opacity);
  transition: opacity 0.35s ease;
}

@keyframes atlasTwinkle {
  0%, 100% { opacity: 0.95; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}

.atlas-svg-frame .star-twinkle {
  transform-box: fill-box;
  transform-origin: center;
  animation: atlasTwinkle 4.6s ease-in-out infinite;
}

.atlas-svg-frame .star-twinkle-delay {
  animation-delay: -2.2s;
}

.atlas-svg-frame .atlas-decor {
  pointer-events: none;
}

.atlas-svg-frame .region-label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 9.2px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.atlas-svg-frame .map-coord {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 7.4px;
  font-weight: 600;
  letter-spacing: 0.08em;
  fill: var(--s-ink-faint);
  opacity: 0.85;
}

.atlas-svg-frame .compass-dir {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 8px;
  font-weight: 700;
}

.atlas-svg-frame .compass-needle {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.65s cubic-bezier(0.34, 1.42, 0.64, 1);
}

.atlas-svg-frame .atlas-region {
  transition: opacity 0.22s ease, filter 0.22s ease;
}

.atlas-svg-frame.is-region-focused .atlas-region:not(.is-region-match) {
  opacity: 0.42;
}

.atlas-svg-frame.is-region-focused .atlas-pin:not(.is-region-match) {
  opacity: 0.38;
}

.atlas-svg-frame .atlas-route {
  stroke: var(--s-border-ink);
  stroke-width: 1.25;
  stroke-dasharray: 3.5 4.5;
  opacity: 0.32;
  transition: stroke 0.25s ease, opacity 0.25s ease, stroke-width 0.25s ease;
}

@keyframes routeFlow {
  from { stroke-dashoffset: 24; }
  to { stroke-dashoffset: 0; }
}

.atlas-svg-frame .atlas-route.is-connected {
  stroke-width: 1.9;
  stroke-dasharray: 5 4;
  opacity: 0.85;
  animation: routeFlow 1.8s linear infinite;
}

.atlas-svg-frame .atlas-pin {
  cursor: pointer;
  pointer-events: bounding-box;
  transition: opacity 0.2s ease;
}

.atlas-svg-frame .atlas-pin * {
  pointer-events: all;
}

.atlas-svg-frame .atlas-pin:focus {
  outline: none;
}

.atlas-svg-frame .atlas-pin:focus-visible .pin-reticle {
  opacity: 1;
  transform: scale(1.1);
}

.atlas-svg-frame .pin-marker {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.atlas-svg-frame .atlas-pin:hover .pin-marker {
  transform: scale(1.14);
}

.atlas-svg-frame .atlas-pin.is-active .pin-marker {
  transform: scale(1.16);
}

.atlas-svg-frame .pin-ring {
  transition: stroke-width 0.2s ease, fill 0.2s ease;
}

.atlas-svg-frame .atlas-pin.is-active .pin-ring {
  stroke-width: 2.8;
}

.atlas-svg-frame .pin-core-bg {
  transition: fill-opacity 0.2s ease;
}

.atlas-svg-frame .atlas-pin:hover .pin-core-bg,
.atlas-svg-frame .atlas-pin.is-active .pin-core-bg {
  fill-opacity: 0.3;
}

.atlas-svg-frame .pin-reticle {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0.82);
  transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.atlas-svg-frame .atlas-pin:hover .pin-reticle {
  opacity: 0.72;
  transform: scale(1.02);
}

.atlas-svg-frame .atlas-pin.is-active .pin-reticle {
  opacity: 1;
  transform: scale(1.08);
}

@keyframes pinPulse {
  0% { transform: scale(0.86); opacity: 0.78; }
  75% { transform: scale(1.42); opacity: 0; }
  100% { transform: scale(1.42); opacity: 0; }
}

.atlas-svg-frame .pin-pulse {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

.atlas-svg-frame .atlas-pin.is-active .pin-pulse {
  animation: pinPulse 2.4s cubic-bezier(0.2, 0.6, 0.35, 1) infinite;
}

.atlas-svg-frame .pin-title {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
  fill: var(--s-ink);
  paint-order: stroke fill;
  stroke: var(--s-paper);
  stroke-width: 3.2px;
  stroke-linejoin: round;
  stroke-opacity: 0.78;
  transition: fill 0.18s ease;
}

.atlas-svg-frame .pin-title-plum {
  fill: var(--c-plum);
}

.atlas-svg-frame .pin-sub {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 8.6px;
  font-weight: 500;
  fill: var(--s-ink-soft);
  paint-order: stroke fill;
  stroke: var(--s-paper);
  stroke-width: 2.6px;
  stroke-linejoin: round;
  stroke-opacity: 0.72;
}

body.quarto-dark .atlas-svg-frame .pin-title,
body.quarto-dark .atlas-svg-frame .pin-sub {
  stroke: var(--s-bg);
  stroke-opacity: 0.85;
}

.atlas-svg-frame .atlas-pin:hover .pin-title,
.atlas-svg-frame .atlas-pin.is-active .pin-title {
  stroke-width: 4px;
}

.atlas-nav-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.55rem;
}

.atlas-tab-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex: 1 1 auto;
}

.lm-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  padding: 0.28rem 0.58rem;
  border: 1px solid var(--s-border-ink);
  background: var(--s-paper);
  color: var(--s-ink);
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease, transform 0.14s ease, border-color 0.16s ease;
}

.lm-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background-color 0.16s ease;
}

.lm-btn:hover {
  transform: translateY(-1px);
}

.lm-btn.is-active {
  font-weight: 700;
  color: var(--s-active-tab-ink) !important;
}

.lm-btn.is-active .lm-dot {
  background: var(--s-active-tab-ink) !important;
}

.atlas-step-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.atlas-step-btn {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  width: 26px;
  height: 26px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--s-border-ink);
  background: var(--s-paper);
  color: var(--s-ink);
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease, transform 0.12s ease;
}

.atlas-step-btn:hover {
  background: var(--s-ink);
  color: var(--s-paper);
}

.atlas-counter {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.68rem;
  color: var(--s-ink-faint);
  min-width: 2.1rem;
  text-align: center;
}

/* Right Field Sheet */
.atlas-sheet-pane {
  background: var(--s-paper);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.sheet-banner {
  padding: 0.72rem 1.3rem;
  border-bottom: 1px solid var(--s-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.71rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--c-copper-bg);
  color: var(--c-copper);
  transition: background-color 0.22s ease, color 0.22s ease;
}

.stamp-badge {
  display: inline-block;
  border: 1.5px dashed currentColor;
  padding: 0.12rem 0.45rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.3;
}

@keyframes sheetFadeIn {
  from { opacity: 0.35; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.sheet-body {
  padding: 1.25rem 1.3rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.95rem;
  min-width: 0;
}

.sheet-body > div {
  min-width: 0;
}

.sheet-body.is-switching {
  animation: sheetFadeIn 0.22s ease-out;
}

.sheet-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.sheet-title-row h2 {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.65rem;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  color: var(--s-ink);
}

.sheet-updated {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  color: var(--s-ink-faint);
  white-space: nowrap;
}

.sheet-desc {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 0.92rem;
  line-height: 1.58;
  color: var(--s-ink-soft);
  margin: 0 0 0.85rem;
}

.sheet-widget {
  border: 1px solid var(--s-border-ink);
  background: var(--s-tint);
  padding: 0.85rem 0.95rem;
  margin-bottom: 0.85rem;
}

.sheet-widget .widget-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.68rem;
  margin-bottom: 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px dashed var(--s-border);
  letter-spacing: 0.04em;
}

.sheet-widget .widget-head strong { color: var(--s-ink); }
.sheet-widget .widget-head span { color: var(--s-ink-faint); }

.sheet-code-wrap {
  position: relative;
  min-width: 0;
  max-width: 100%;
}

.sheet-code {
  background: var(--s-code-bg);
  color: var(--s-code-ink);
  border: 1px solid var(--s-border-ink);
  padding: 0.8rem 3.5rem 0.8rem 0.95rem;
  margin: 0;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  line-height: 1.52;
  overflow-x: auto;
  max-width: 100%;
  box-sizing: border-box;
  border-radius: 0;
}

.sheet-copy-btn {
  position: absolute;
  top: 0.42rem;
  right: 0.42rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.63rem;
  font-weight: 600;
  padding: 0.16rem 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.07);
  color: var(--s-code-ink);
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.sheet-copy-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.38);
}

.sheet-footer {
  padding-top: 0.8rem;
  border-top: 1px solid var(--s-border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-size: 0.84rem;
  font-weight: 600;
}

.sheet-ext-links {
  display: flex;
  gap: 0.85rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.73rem;
  font-weight: 500;
}

.sheet-ext-links a {
  color: var(--s-ink-soft);
}

.sheet-ext-links a:hover {
  color: var(--c-copper);
}

/* Interactive Widget Primitives */
.w-stack {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.w-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.w-pill {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.22rem 0.52rem;
  border: 1px solid var(--s-border-ink);
  background: var(--s-paper);
  color: var(--s-ink);
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease, transform 0.1s ease;
}

.w-pill:hover {
  transform: translateY(-1px);
}

.w-pill.is-on {
  background: var(--w-accent, var(--c-copper));
  border-color: var(--w-accent, var(--c-copper));
  color: var(--s-active-tab-ink);
}

.w-pill-subtle {
  border-color: var(--s-border);
  color: var(--s-ink-soft);
}

.w-pill-subtle.is-on {
  background: var(--w-accent, var(--c-pine));
  border-color: var(--w-accent, var(--c-pine));
  color: var(--s-active-tab-ink);
}

.w-btn {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.69rem;
  font-weight: 700;
  padding: 0.26rem 0.62rem;
  border: 1px solid var(--s-border-ink);
  background: var(--s-paper);
  color: var(--s-ink);
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease, transform 0.1s ease, opacity 0.14s ease;
}

.w-btn:hover {
  transform: translateY(-1px);
}

.w-btn.is-solid {
  background: var(--w-accent, var(--c-pine));
  border-color: var(--w-accent, var(--c-pine));
  color: var(--s-active-tab-ink);
}

.w-btn.is-ghost {
  background: transparent;
  border-color: var(--s-border);
  color: var(--s-ink-soft);
}

.w-btn.is-ghost:hover {
  border-color: var(--s-border-ink);
  color: var(--s-ink);
}

.w-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.45rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  color: var(--s-ink-soft);
}

.w-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
}

.w-metric {
  background: var(--s-paper);
  border: 1px solid var(--s-border);
  padding: 0.32rem 0.48rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.w-metric small {
  display: block;
  font-size: 0.59rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--s-ink-faint);
}

.w-metric strong {
  display: block;
  font-size: 0.74rem;
  color: var(--s-ink);
  line-height: 1.25;
}

.w-canvas {
  width: 100%;
  display: block;
  background: var(--s-paper);
  border: 1px solid var(--s-border);
}

.w-canvas-dark {
  background: var(--s-code-bg);
  border-color: var(--s-border-ink);
}

.w-trace {
  background: var(--s-code-bg);
  color: var(--s-code-ink);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.67rem;
  padding: 0.42rem 0.62rem;
  line-height: 1.45;
  border: 1px solid var(--s-border-ink);
  overflow-x: auto;
  overflow-wrap: anywhere;
  max-width: 100%;
  transition: border-color 0.2s ease;
}

.w-trace code {
  background: transparent !important;
  color: inherit !important;
  padding: 0 !important;
  font-size: inherit;
}

/* Widget-Specific Polish */
.w-chat-frame {
  background: var(--s-paper);
  border: 1px solid var(--s-border);
  padding: 0.58rem 0.68rem;
  display: flex;
  flex-direction: column;
  gap: 0.48rem;
}

.w-chat-user {
  align-self: flex-end;
  background: var(--c-copper-bg);
  color: var(--s-ink);
  border: 1px solid var(--c-copper);
  padding: 0.22rem 0.52rem;
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
}

.w-chat-card {
  border: 1px solid var(--s-border-ink);
  background: var(--s-tint);
  padding: 0.5rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}

.w-slider {
  width: 100%;
  margin: 0;
  cursor: pointer;
  accent-color: var(--c-lake);
}

.w-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.68rem;
  color: var(--s-ink);
  cursor: pointer;
  user-select: none;
}

.w-toggle input {
  accent-color: var(--w-accent, var(--c-ochre));
  cursor: pointer;
}

.w-meter {
  height: 7px;
  width: 100%;
  background: var(--s-paper);
  border: 1px solid var(--s-border-ink);
  overflow: hidden;
}

.w-meter-fill {
  height: 100%;
  background: var(--c-ochre);
  transition: width 0.25s ease, background-color 0.25s ease;
}

.w-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.38rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.61rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid currentColor;
}

.w-badge-ok { color: var(--c-pine); background: var(--c-pine-bg); }
.w-badge-warn { color: var(--c-ochre); background: var(--c-ochre-bg); }
.w-badge-err { color: var(--c-copper); background: var(--c-copper-bg); }
.w-badge-info { color: var(--c-lake); background: var(--c-lake-bg); }

.w-approval-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  background: var(--c-ochre-bg);
  border: 1px solid var(--c-ochre);
  padding: 0.42rem 0.58rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.67rem;
  color: var(--s-ink);
}

.w-eval-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.38rem;
}

.w-eval-card {
  background: var(--s-paper);
  border: 1px solid var(--s-border);
  padding: 0.38rem 0.5rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.w-eval-card.is-pass {
  border-color: var(--c-pine);
}

.w-eval-card.is-fail {
  border-color: var(--c-copper);
}

.w-eval-note {
  color: var(--s-ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.w-eval-res {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
}

.w-list {
  display: flex;
  flex-direction: column;
  gap: 0.34rem;
}

.w-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  background: var(--s-paper);
  border: 1px solid var(--s-border);
  padding: 0.36rem 0.52rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.67rem;
  color: var(--s-ink);
  transition: border-color 0.16s ease, opacity 0.16s ease;
}

.w-list-item.is-dim {
  opacity: 0.46;
}

.w-list-item.is-selected {
  border-color: var(--w-accent, var(--c-lake));
}

.w-step-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.3rem;
}

.w-step-chip {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.64rem;
  font-weight: 600;
  padding: 0.32rem 0.35rem;
  border: 1px solid var(--s-border);
  background: var(--s-paper);
  color: var(--s-ink);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.w-step-chip.is-on {
  border-color: var(--c-copper);
  background: var(--c-copper-bg);
  color: var(--c-copper);
}

.w-critter-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.28rem;
}

.w-critter {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  padding: 0.38rem 0.15rem;
  background: var(--s-paper);
  border: 1px solid var(--s-border);
  cursor: pointer;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.58rem;
  color: var(--s-ink-soft);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.15s ease, background-color 0.15s ease;
}

.w-critter:hover,
.w-critter.is-active {
  transform: translateY(-2px);
  border-color: var(--c-plum);
  background: var(--c-plum-bg);
  color: var(--c-plum);
}

@keyframes critterHop {
  0%, 100% { transform: translateY(0); }
  45% { transform: translateY(-5px); }
}

.w-critter.is-hopping {
  animation: critterHop 0.34s ease-out;
}

.w-critter svg {
  width: 20px;
  height: 20px;
  display: block;
}

/* Fresh on the Bench Stationery Slips */
.section-heading {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--s-ink);
  margin: 0 0 1rem !important;
  padding: 0 !important;
  border: none !important;
}

.bench-slips-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.1rem;
  margin-bottom: 2.75rem;
}

.bench-slip {
  background: var(--s-paper);
  border: 1.5px solid var(--s-border-ink);
  border-top-width: 5px;
  box-shadow: var(--s-shadow);
  padding: 1rem 1.05rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.55rem;
  text-decoration: none !important;
  color: inherit !important;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.bench-slip:hover {
  transform: translateY(-3px);
  box-shadow: var(--s-shadow-hover);
}

.bench-slip.tone-pine   { border-top-color: var(--c-pine); }
.bench-slip.tone-pine .slip-meta { color: var(--c-pine); }
.bench-slip.tone-ochre  { border-top-color: var(--c-ochre); }
.bench-slip.tone-ochre .slip-meta { color: var(--c-ochre); }
.bench-slip.tone-copper { border-top-color: var(--c-copper); }
.bench-slip.tone-copper .slip-meta { color: var(--c-copper); }
.bench-slip.tone-lake   { border-top-color: var(--c-lake); }
.bench-slip.tone-lake .slip-meta { color: var(--c-lake); }

.bench-slip .slip-meta {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.bench-slip .slip-title {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--s-ink);
  line-height: 1.25;
}

.bench-slip .slip-desc {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--s-ink-soft);
  margin: 0;
}

/* Broadsheet Bottom: Field Notes + Recent Talks */
.atlas-broadsheet {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 1fr);
  gap: 2.5rem;
  padding-top: 0.5rem;
  padding-bottom: 2rem;
}

.broadsheet-bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 2px solid var(--s-border-ink);
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
}

.broadsheet-bar h2 {
  font-family: 'Newsreader', Georgia, serif !important;
  font-size: 1.35rem !important;
  font-weight: 700 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  color: var(--s-ink);
}

.broadsheet-bar a {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--c-pine);
}

.broadsheet-bar a:hover {
  color: var(--c-copper);
}

/* Remove default Quarto listing borders */
.quarto-listing {
  border-top: none !important;
}

.field-notes-ledger {
  list-style: none;
  padding: 0;
  margin: 0;
}

.field-notes-ledger .ledger-entry {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem 1.25rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--s-border);
}

.field-notes-ledger .ledger-main {
  flex: 1 1 260px;
}

.field-notes-ledger a.ledger-title {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 700;
  font-size: 1.06rem;
  color: var(--s-ink);
  text-decoration: none;
}

.field-notes-ledger a.ledger-title:hover {
  color: var(--c-copper);
  text-decoration: underline;
}

.field-notes-ledger .ledger-desc,
.field-notes-ledger .ledger-desc p {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 0.87rem;
  color: var(--s-ink-soft);
  margin: 0.22rem 0 0;
  line-height: 1.5;
}

.field-notes-ledger .ledger-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.field-notes-ledger .ledger-date {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  color: var(--s-ink-faint);
}

.stamp-copper { color: var(--c-copper); }
.stamp-lake   { color: var(--c-lake); }
.stamp-ochre  { color: var(--c-ochre); }
.stamp-pine   { color: var(--c-pine); }
.stamp-plum   { color: var(--c-plum); }

/* Featured Talks Column on Homepage */
.talk-feature-card {
  background: var(--s-tint);
  border: 1.5px solid var(--s-border-ink);
  box-shadow: var(--s-shadow);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1rem;
}

.talk-feature-card .talk-kicker {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--c-copper);
  margin-bottom: 0.45rem;
}

.talk-feature-card h3 {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.3rem;
  margin: 0 0 0.45rem !important;
  color: var(--s-ink);
}

.talk-feature-card p {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 0.88rem;
  line-height: 1.58;
  color: var(--s-ink-soft);
  margin: 0 0 0.75rem;
}

.talk-feature-card .talk-links {
  display: flex;
  gap: 1rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.76rem;
  font-weight: 700;
}

.talk-feature-card .talk-links a {
  color: var(--c-pine);
}

.talk-feature-card .talk-links a:hover {
  color: var(--c-copper);
}

.talk-secondary-card {
  background: var(--s-paper);
  border: 1px solid var(--s-border);
  border-left: 4px solid var(--c-ochre);
  padding: 0.95rem 1.15rem;
}

.talk-secondary-card .talk-kicker {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--c-ochre);
  margin-bottom: 0.25rem;
}

.talk-secondary-card h4 {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.05rem;
  margin: 0 0 0.25rem;
}

.talk-secondary-card h4 a {
  color: var(--s-ink);
}

.talk-secondary-card h4 a:hover {
  color: var(--c-copper);
}

.talk-secondary-card p {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 0.85rem;
  color: var(--s-ink-soft);
  margin: 0;
}

/* Article / Post Pages */
.quarto-title-banner {
  background: var(--s-tint) !important;
  border-bottom: 1.5px solid var(--s-border-ink);
  padding: 2.4rem 0 !important;
  margin-bottom: 2rem;
}

.quarto-title-banner .quarto-title h1.title,
.quarto-title h1.title {
  font-family: 'Newsreader', Georgia, serif;
  font-size: clamp(2rem, 3.8vw, 2.7rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--s-ink) !important;
}

.quarto-title .description {
  font-family: 'Newsreader', Georgia, serif;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--s-ink-soft);
  line-height: 1.6;
}

.quarto-title .quarto-categories .quarto-category {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1.5px dashed var(--c-copper);
  color: var(--c-copper);
  background: var(--c-copper-bg);
  border-radius: 0;
  opacity: 1;
}

#quarto-content h2 {
  margin-top: 2.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--s-border);
}

#quarto-content blockquote {
  border-left: 4px solid var(--c-pine);
  padding: 0.8rem 1.35rem;
  margin: 1.75rem 0;
  background: var(--s-tint);
  color: var(--s-ink-soft);
}

#quarto-content img {
  border-radius: 3px;
}

#quarto-content hr {
  border-color: var(--s-border);
}

pre, div.sourceCode {
  border-radius: 3px;
  border: 1px solid var(--s-border-ink);
}

body.quarto-light div.sourceCode,
body.quarto-light pre.sourceCode {
  background-color: var(--s-tint) !important;
}

body.quarto-dark div.sourceCode,
body.quarto-dark pre.sourceCode {
  background-color: var(--s-code-bg) !important;
  color: var(--s-code-ink);
  border-color: var(--s-border-ink);
}

.quarto-listing-filter .input-group-text {
  background-color: var(--s-tint);
  color: var(--s-ink-soft);
  border-color: var(--s-border-ink);
}

.quarto-listing-filter .search,
.quarto-listing-filter input.form-control {
  background-color: var(--s-paper);
  color: var(--s-ink);
  border-color: var(--s-border-ink);
}

.quarto-listing-filter .search::placeholder,
.quarto-listing-filter input.form-control::placeholder {
  color: var(--s-ink-faint);
}

p code, li code {
  background: var(--c-copper-bg);
  color: var(--c-copper);
  padding: 0.12em 0.38em;
  border-radius: 2px;
  font-size: 0.86em;
}

/* TOC */
#TOC {
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
}

#TOC #toc-title {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--s-ink-faint);
}

#TOC a {
  font-size: 0.84rem;
  color: var(--s-ink-soft);
}

#TOC a:hover {
  color: var(--c-copper);
}

#TOC .active {
  border-left-color: var(--c-copper) !important;
  color: var(--c-copper) !important;
  font-weight: 700;
}

/* Category Sidebar on writing.qmd */
.quarto-listing-category .category-header {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--s-ink-faint);
}

.quarto-listing-category .category {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.76rem;
  color: var(--s-ink-soft);
}

.quarto-listing-category .category:hover,
.quarto-listing-category .category.active {
  color: var(--c-copper);
  font-weight: 700;
}

/* Talks Page Cards */
.talk-entry {
  background: var(--s-paper);
  border: 1.5px solid var(--s-border-ink);
  border-left: 5px solid var(--c-copper);
  box-shadow: var(--s-shadow);
  padding: 1.4rem 1.6rem;
  margin-bottom: 1.75rem;
}

.talk-entry.tone-pine  { border-left-color: var(--c-pine); }
.talk-entry.tone-ochre { border-left-color: var(--c-ochre); }
.talk-entry.tone-lake  { border-left-color: var(--c-lake); }
.talk-entry.tone-plum  { border-left-color: var(--c-plum); }

.talk-entry h2, .talk-entry h3 {
  border: none !important;
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.talk-feature-card .talk-submeta,
.talk-secondary-card .talk-submeta,
.talk-entry .talk-meta {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.74rem;
  color: var(--s-ink-faint);
  margin: 0.25rem 0 0.75rem;
}

.talk-entry .talk-meta a {
  color: var(--c-pine);
  font-weight: 600;
}

.talk-entry .talk-meta a:hover {
  color: var(--c-copper);
}

.talk-entry .video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  margin: 1rem 0;
  border: 1px solid var(--s-border-ink);
}

.talk-entry .video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* About Page */
.about-entity .about-image {
  border-radius: 3px !important;
  border: 2px solid var(--s-border-ink);
  box-shadow: var(--s-shadow);
}

.about-entity .about-links .about-link {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1.5px solid var(--s-border-ink);
  border-radius: 2px;
  background: var(--s-paper);
  color: var(--s-ink);
}

.about-entity .about-links .about-link:hover {
  border-color: var(--c-copper);
  color: var(--c-copper);
  box-shadow: var(--s-shadow);
}

.about-crest-block {
  display: grid;
  grid-template-columns: 156px minmax(0, 1fr);
  gap: 1.75rem;
  align-items: center;
  background: var(--s-paper);
  border: 1.5px solid var(--s-border-ink);
  box-shadow: var(--s-shadow);
  padding: 1.4rem 1.65rem;
  margin-top: 2rem;
}

.about-crest-block .crest-art {
  display: flex;
  justify-content: center;
}

.about-crest-block .crest-copy h3 {
  margin-top: 0 !important;
  font-family: 'Newsreader', Georgia, serif;
}

@media (max-width: 960px) {
  .about-crest-block {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

/* Footer */
.nav-footer {
  background: var(--s-paper);
  border-top: 1.5px solid var(--s-border-ink);
  padding: 1.4rem 1.5rem;
  margin-top: 3.5rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.74rem;
  color: var(--s-ink-faint);
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem 1.5rem;
}

.nav-footer .nav-footer-center {
  display: none;
}

.nav-footer .nav-footer-left {
  flex: 1 1 26rem;
  min-width: 0;
  max-width: none;
  white-space: normal;
}

.nav-footer .nav-footer-left p,
.nav-footer .nav-footer-right p {
  margin: 0;
}

.nav-footer .nav-footer-right {
  flex: 0 0 auto;
}

.nav-footer a {
  color: var(--c-pine);
}

.nav-footer a:hover {
  color: var(--c-copper);
}

/* Two-Tone Accessible Focus Ring (Quarto 1.11+) */
*:focus-visible {
  outline: 2px solid var(--c-copper);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--s-bg);
}

/* Responsive */
@media (max-width: 1024px) {
  .atlas-opener {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .atlas-workbench {
    grid-template-columns: minmax(0, 1fr);
  }

  .atlas-map-pane {
    border-right: none;
    border-bottom: 1.5px solid var(--s-border-ink);
  }

  .bench-slips-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .atlas-broadsheet {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .atlas-map-pane {
    padding: 0.85rem;
  }

  .sheet-body {
    padding: 1rem;
  }

  .bench-slips-grid {
    grid-template-columns: 1fr;
  }

  .survey-colophon {
    transform: none;
  }

  .w-eval-grid {
    grid-template-columns: 1fr;
  }

  .w-step-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .w-critter-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media print {
  .strata-ribbon, .navbar, .nav-footer, .atlas-tab-strip {
    display: none !important;
  }
}
