/* Universal Spatial Altitude / Zoom Bar + Conference Compass (⌘K)
   Works across all 4 zoom levels:
     Z1 · Summit      (index.html, site/themes.html, atlases/conference-themes/page.html)
     Z2 · Theme       (atlases/<theme-id>/page.html)
     Z3 · Talk Story  (talks/<slug>/experience/page.html, site/talks/index.html)
     Z4 · Evidence    (site/talks/<slug>.html)
*/
:root {
  --zoom-bg: rgba(16, 23, 18, 0.92);
  --zoom-border: rgba(242, 241, 232, 0.16);
  --zoom-strong: rgba(242, 241, 232, 0.32);
}

.zoom-bar-wrap {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--zoom-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--zoom-border);
  padding-inline: max(16px, env(safe-area-inset-left, 0px));
}

.zoom-bar {
  max-width: 78rem;
  margin: 0 auto;
  padding: .48rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem .8rem;
}

.zoom-track {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .28rem;
  min-width: 0;
  flex: 1 1 auto;
}

.z-step-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.z-sep {
  color: rgba(242, 241, 232, 0.34);
  font: 700 .7rem/1 var(--mono, ui-monospace, monospace);
  user-select: none;
  padding-inline: .05rem;
}

.z-step {
  display: inline-flex;
  align-items: center;
  gap: .36rem;
  padding: .3rem .6rem;
  border-radius: 999px;
  border: 1px solid var(--zoom-border);
  background: rgba(30, 44, 34, 0.65);
  color: var(--ink-muted, #b9bcae);
  font: 600 .72rem/1.15 var(--body, system-ui, sans-serif);
  text-decoration: none;
  cursor: pointer;
  max-width: 19rem;
  transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}

.z-step:hover {
  border-color: var(--zoom-strong);
  color: var(--ink, #f2f1e8);
  background: rgba(36, 53, 42, 0.9);
}

.z-step.is-here {
  background: rgba(244, 207, 114, 0.14);
  border-color: #f4cf72;
  color: #f4cf72;
}

.z-step.is-muted {
  opacity: .56;
}

.z-tag {
  font: 700 .62rem/1 var(--mono, ui-monospace, monospace);
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .14rem .3rem;
  border-radius: 4px;
  background: rgba(242, 241, 232, 0.08);
  color: inherit;
  flex: none;
}

.z-step.is-here .z-tag {
  background: #f4cf72;
  color: #17231b;
}

.z-lbl {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.z-caret {
  font-size: .62rem;
  opacity: .75;
  flex: none;
}

.zoom-actions {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex: none;
}

.z-btn {
  display: inline-flex;
  align-items: center;
  gap: .32rem;
  padding: .32rem .62rem;
  border-radius: 999px;
  border: 1px solid var(--zoom-strong);
  background: rgba(30, 44, 34, 0.85);
  color: var(--ink, #f2f1e8);
  font: 700 .68rem/1 var(--mono, ui-monospace, monospace);
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

.z-btn:hover:not([disabled]):not(.is-disabled) {
  border-color: #f4cf72;
  color: #f4cf72;
}

.z-btn[disabled],
.z-btn.is-disabled {
  opacity: .35;
  cursor: default;
  pointer-events: none;
}

.z-btn.compass-btn {
  border-color: rgba(143, 184, 216, 0.45);
  color: #8fb8d8;
}

.z-btn.compass-btn:hover {
  border-color: #f4cf72;
  color: #f4cf72;
}

.z-btn kbd {
  font: 700 .6rem/1 var(--mono, ui-monospace, monospace);
  border: 1px solid currentColor;
  border-radius: 4px;
  padding: .1rem .26rem;
  opacity: .78;
}

/* Popover menu anchored to Z1/Z2/Z3 step */
.z-popover {
  position: fixed;
  z-index: 60;
  width: min(24rem, calc(100vw - 24px));
  max-height: min(65vh, 28rem);
  overflow-y: auto;
  background: #141e17;
  border: 1px solid rgba(242, 241, 232, 0.28);
  border-top: 2px solid #f4cf72;
  border-radius: .5rem;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.62);
  padding: .45rem;
  display: grid;
  gap: .25rem;
}

.z-popover[hidden] {
  display: none;
}

.z-pop-head {
  padding: .35rem .55rem .4rem;
  border-bottom: 1px solid rgba(242, 241, 232, 0.14);
  font: 700 .64rem/1.3 var(--mono, ui-monospace, monospace);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #b9bcae;
  display: flex;
  justify-content: space-between;
  gap: .5rem;
}

.z-pop-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  padding: .48rem .58rem;
  border-radius: .35rem;
  text-decoration: none;
  color: #f2f1e8;
  font: 500 .86rem/1.3 var(--body, system-ui, sans-serif);
  border: 1px solid transparent;
}

.z-pop-item:hover {
  background: #1e2c22;
  border-color: rgba(242, 241, 232, 0.18);
}

.z-pop-item.is-active {
  background: rgba(244, 207, 114, 0.12);
  border-color: rgba(244, 207, 114, 0.48);
}

.z-pop-main {
  display: grid;
  gap: .1rem;
  min-width: 0;
}

.z-pop-title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.z-pop-sub {
  font: 600 .66rem/1.3 var(--mono, ui-monospace, monospace);
  color: #b9bcae;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.z-pop-meta {
  font: 700 .64rem/1 var(--mono, ui-monospace, monospace);
  color: #8fb8d8;
  white-space: nowrap;
  flex: none;
}

/* Conference Compass Modal (⌘K) */
.compass-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(10, 15, 11, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid;
  place-items: start center;
  padding: clamp(1rem, 7vh, 4.5rem) 14px 1rem;
}

.compass-backdrop[hidden] {
  display: none;
}

.compass-dialog {
  width: min(46rem, 100%);
  max-height: min(82vh, 44rem);
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #162119;
  border: 1px solid rgba(242, 241, 232, 0.28);
  border-top: 3px solid #f4cf72;
  border-radius: .6rem;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.compass-search-row {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .75rem .95rem;
  border-bottom: 1px solid rgba(242, 241, 232, 0.16);
  background: #101712;
}

.compass-search-row label {
  font: 700 .78rem/1 var(--mono, ui-monospace, monospace);
  color: #f4cf72;
  letter-spacing: .1em;
}

.compass-input {
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  border: 0;
  color: #f2f1e8;
  font: 500 1rem/1.4 var(--body, system-ui, sans-serif);
  outline: none;
}

.compass-input::placeholder {
  color: rgba(185, 188, 174, 0.65);
}

.compass-close {
  background: none;
  border: 1px solid rgba(242, 241, 232, 0.22);
  color: #b9bcae;
  border-radius: .3rem;
  padding: .25rem .5rem;
  font: 700 .66rem/1 var(--mono, ui-monospace, monospace);
  cursor: pointer;
}

.compass-close:hover {
  border-color: #f4cf72;
  color: #f2f1e8;
}

.compass-results {
  overflow-y: auto;
  padding: .65rem .75rem 1rem;
  display: grid;
  gap: .9rem;
  align-content: start;
}

.compass-group-title {
  font: 700 .64rem/1.3 var(--mono, ui-monospace, monospace);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #b9bcae;
  padding: 0 .35rem .3rem;
  border-bottom: 1px solid rgba(242, 241, 232, 0.12);
  margin-bottom: .3rem;
}

.compass-list {
  display: grid;
  gap: .28rem;
}

.compass-row {
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr) auto;
  gap: .7rem;
  align-items: center;
  padding: .48rem .55rem;
  border-radius: .4rem;
  border: 1px solid transparent;
  background: rgba(30, 44, 34, 0.45);
  color: #f2f1e8;
  text-decoration: none;
}

.compass-row:hover,
.compass-row.is-selected {
  background: #24352a;
  border-color: rgba(244, 207, 114, 0.55);
}

.compass-thumb {
  width: 3.4rem;
  height: 2.15rem;
  border-radius: .25rem;
  overflow: hidden;
  background: #101712;
  border: 1px solid rgba(242, 241, 232, 0.16);
  display: grid;
  place-items: center;
  font: 700 .68rem/1 var(--mono, ui-monospace, monospace);
  color: #a9d18f;
}

.compass-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.compass-main {
  min-width: 0;
  display: grid;
  gap: .12rem;
}

.compass-title {
  font-weight: 600;
  font-size: .92rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compass-sub {
  font-size: .78rem;
  color: #b9bcae;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compass-links {
  display: flex;
  align-items: center;
  gap: .4rem;
}

.compass-badge {
  font: 700 .6rem/1 var(--mono, ui-monospace, monospace);
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .22rem .45rem;
  border-radius: 999px;
  border: 1px solid rgba(242, 241, 232, 0.24);
  color: #b9bcae;
  white-space: nowrap;
  text-decoration: none;
}

.compass-badge.go {
  border-color: rgba(169, 209, 143, 0.55);
  color: #a9d18f;
}

.compass-badge.hub:hover {
  border-color: #8fb8d8;
  color: #8fb8d8;
}

.compass-foot {
  padding: .45rem .95rem;
  border-top: 1px solid rgba(242, 241, 232, 0.14);
  background: #101712;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .4rem 1rem;
  font: 600 .64rem/1.3 var(--mono, ui-monospace, monospace);
  color: #b9bcae;
}

.compass-empty {
  padding: 1.6rem 1rem;
  text-align: center;
  color: #b9bcae;
  font-size: .9rem;
}

@media (max-width: 44rem) {
  .z-step { max-width: 10.5rem; padding: .26rem .46rem; }
  .z-btn kbd { display: none; }
  .compass-row { grid-template-columns: minmax(0, 1fr) auto; }
  .compass-thumb { display: none; }
}

@media (max-width: 30rem) {
  .zoom-bar { gap: .4rem; padding: .42rem 0; }
  .z-step { max-width: 7.5rem; font-size: .68rem; }
  .z-btn { padding: .28rem .48rem; font-size: .64rem; }
}

@media print {
  .zoom-bar-wrap, .z-popover, .compass-backdrop { display: none !important; }
}
