/* ─── Ask Elijah Modal ─── */
#ask-screen {
  position: fixed;
  inset: 0;
  --ask-accent: #20e294;
  background: #12171d;
  font-family: 'Geist', Arial, Helvetica, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.9s ease;
  overflow-y: auto;
  padding: 48px 0;
  box-sizing: border-box;
}

#ask-screen.visible {
  opacity: 1;
  pointer-events: all;
}

#ask-card {
  position: relative;
  width: min(540px, 90vw);
  box-sizing: border-box;
  margin: auto;
  padding: clamp(2rem, 5vw, 3.5rem);
  border: 0;
  background: transparent;
}

#ask-close {
  position: absolute;
  top: -24px;
  left: 12px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  color: #b9bec2;
  font-size: 1rem;
  cursor: pointer;
  transition: color 0.2s;
  line-height: 1;
  touch-action: manipulation;
}
#ask-close:hover { color: rgba(255,255,255,0.8); }

.ask-dot-row {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.ask-dot { font-size: 8px; color: #fff; }
.ask-headline { font-family: 'Instrument Serif', Georgia, serif; font-size: 38px; font-weight: 400; line-height: 1.15; letter-spacing: 0; color: #fff; margin: 24px 0 18px; }
.ask-brand-copy { min-width: 0; }
.ask-brain-logo { width: 92px; height: 83px; object-fit: contain; flex: 0 0 auto; }
#ask-screen .ask-title { font-family: 'Geist', Arial, sans-serif; font-weight: 600; text-transform: uppercase; color: var(--ask-accent); font-size: 14px; letter-spacing: 0; margin: 0; }
#ask-screen .ask-beta-tag { color: #8c9298; letter-spacing: 0; font-size: 12px; margin: 12px 0 0; }
#ask-input-row label { display: block; color: #8c9298; font-size: 12px; margin-bottom: 8px; }
#ask-screen #ask-submit { width: 100%; justify-content: center; background: var(--ask-accent); color: #0a0a0a; border: 0; border-radius: 6px; font-family: inherit; font-weight: 600; letter-spacing: 0; }
#ask-screen #ask-email { padding: 14px 12px; background: #1a1f24; border: 1px solid #2c333a; border-radius: 6px; box-sizing: border-box; font-family: inherit; font-size: 16px; }
#ask-screen #ask-email:focus { outline: 2px solid var(--ask-accent); outline-offset: 2px; }
#ask-screen #ask-email::placeholder { color: #8c9298; opacity: 0.8; }
#ask-screen #ask-input-row { border: 0; }
#ask-screen #ask-desc { color: #8c9298; }
@media (max-width: 420px) {
  #ask-card { width: 100%; padding: 24px; }
  .ask-brain-logo { width: 72px; height: 65px; }
  .ask-headline { font-size: 34px; }
}
.ask-dash { color: rgba(255,255,255,0.2); letter-spacing: -0.1em; font-size: 0.9rem; }

.ask-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  letter-spacing: 0.08em;
  color: #fff;
}

.ask-beta-tag {
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  margin-bottom: 1.4rem;
}

#ask-desc {
  font-size: 0.85rem;
  font-weight: 300;
  color: rgba(255,255,255,0.5);
  line-height: 1.75;
  margin-bottom: 1.8rem;
}

#ask-input-row {
  border-bottom: 1px solid rgba(255,255,255,0.15);
  margin-bottom: 1.4rem;
}

#ask-email {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 300;
  padding: 0.7rem 0;
  caret-color: rgba(255,255,255,0.7);
}

#ask-email::placeholder { color: rgba(255,255,255,0.22); }

#ask-actions { margin-bottom: 1rem; }

.dot-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.7);
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 0.65rem 1.2rem;
  min-height: 44px;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.25s, color 0.25s;
}
.dot-btn:hover { border-color: rgba(255,255,255,0.5); color: #fff; }

.btn-dot { font-size: 7px; }
.btn-dash { color: rgba(255,255,255,0.2); letter-spacing: -0.05em; }

#ask-response {
  font-size: 0.82rem;
  font-weight: 300;
  color: rgba(255,255,255,0.55);
  line-height: 1.7;
  margin-top: 0.5rem;
  display: none;
}

/* ─── Continue the Journey Screen ─── */
#sections-screen {
  position: fixed;
  inset: 0;
  background: #080808;
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  overflow-y: auto;
  transition: opacity 1s ease;
}

#sections-screen.visible {
  opacity: 1;
  pointer-events: all;
}

/* ─── Canvas Navigation ─── */
#page {
  background: #080808;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  font-family: 'Cormorant Garamond', Georgia, serif;
  color: #fff;
  overflow: hidden;
}

#header {
  padding: 2rem 2.5rem 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

#championship-window {
  position: absolute;
  inset: 0;
  display: grid;
  gap: 8px;
  align-content: center;
  opacity: .36;
  z-index: 1;
  background: #000;
  overflow: hidden;
}
#championship-window[hidden] { display: none; }
#championship-window.native-video-wall { container-type: size; gap: 0; }
#championship-window.desktop-video-wall { display: block; }
#championship-window.native-video-wall.phone-video-wall { display: grid; grid-template-columns: 1fr; grid-template-rows: repeat(3, minmax(0, 1fr)); }
.native-mosaic { position: absolute; top: 50%; left: 50%; width: max(100cqw, 176.503cqh); height: max(100cqh, 56.656cqw); transform: translate(-50%, -50%); }
.native-mosaic video, .native-phone-tile video { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.native-mosaic-link { position: absolute; border-radius: 4px; }
.native-mosaic canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.native-mosaic-link:focus-visible, .native-phone-tile:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.native-phone-tile { display: block; min-width: 0; min-height: 0; overflow: hidden; }
.championship-tile { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: #000; container-type: size; }
.championship-tile { cursor: pointer; }
.championship-tile { border-radius: 6px; }
#championship-window.phone-video-wall { gap: 0; }
.phone-video-wall .championship-tile { border-radius: 0; }
.championship-tile:focus-visible { outline: 3px solid #fff; outline-offset: -3px; }
.championship-tile iframe { pointer-events: none; opacity: 1; }
.championship-tile iframe[data-playing="true"] { opacity: 1; }
.championship-tile img, .championship-tile iframe {
  position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0;
}
.championship-tile img { object-fit: cover; }
.championship-tile iframe {
  inset: 50% auto auto 50%;
  width: max(100cqw, 177.778cqh);
  height: max(100cqh, 56.25cqw);
  transform: translate(-50%, -50%);
}
#championship-toggle {
  position: absolute;
  bottom: 20px;
  right: 24px;
  z-index: 2;
  background: transparent;
  border: 0;
  color: #aaa;
  font: 12px 'Montserrat', sans-serif;
  cursor: pointer;
  padding: 10px;
}
#championship-toggle:focus-visible { outline: 1px solid #ddd; }
@media (max-width: 600px) {
  #championship-window { opacity: .32; }
  #championship-toggle {
    bottom: max(12px, env(safe-area-inset-bottom));
    right: max(12px, env(safe-area-inset-right));
    min-height: 44px;
    color: #ddd;
  }
}

#logo {
  font-family: 'Montserrat', sans-serif;
  font-weight: 300;
  font-size: clamp(0.85rem, 2.2vw, 1.1rem);
  letter-spacing: 0.45em;
  color: #c8bfa8;
  text-transform: uppercase;
}

#canvas-zone {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 1rem;
}

#wrap {
  position: relative;
  width: min(580px, 96vw);
  height: min(66vh, 500px);
}

#wrap canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  cursor: grab;
  touch-action: none;
}

#wrap canvas.drag { cursor: grabbing; }

.dlabel {
  position: absolute;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1rem, 2.6vw, 1.3rem);
  font-weight: 300;
  letter-spacing: 0.1em;
  color: #3a3a3a;
  pointer-events: none;
  white-space: nowrap;
  transition: color 0.35s, opacity 0.35s;
  transform: translateX(-50%);
}

.dlabel.lit { color: #d4c9b0; }

#lbl-res { transform: translate(-50%, -100%); }

#lbl-back {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(0.6rem, 1.6vw, 0.75rem);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #2a2a2a;
}
#lbl-back.lit { color: #999; }

#footer {
  padding: 0 2rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  min-height: 72px;
}

#instr {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.58rem;
  font-weight: 300;
  letter-spacing: 0.32em;
  color: #333;
  text-transform: uppercase;
  transition: opacity 0.5s;
}

#panel {
  text-align: center;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.55s ease, transform 0.55s ease;
  pointer-events: none;
}

#panel.show { opacity: 1; transform: translateY(0); pointer-events: auto; }

#ptitle {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  font-weight: 300;
  letter-spacing: 0.1em;
  color: #e8e0d0;
  margin-bottom: 0.3rem;
}

#pdesc {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.58rem;
  font-weight: 300;
  letter-spacing: 0.22em;
  color: #555;
  text-transform: uppercase;
}

#rbtn {
  margin-top: 0.7rem;
  background: transparent;
  border: 0.5px solid #2c2c2c;
  color: #444;
  padding: 6px 20px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.55rem;
  font-weight: 300;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 1px;
  transition: color 0.2s, border-color 0.2s;
}

#rbtn:hover { color: #aaa; border-color: #666; }

/* ─── Books orbit ─── */
#books-orbit {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Books back link — subtle top-left */
#books-back-link {
  position: fixed;
  top: 1.5rem;
  left: 2rem;
  z-index: 250;
  display: none;
  align-items: center;
  gap: 6px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.5rem;
  font-weight: 300;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.15);
  cursor: pointer;
  transition: color 0.2s;
}

#books-back-link.show { display: flex; }
#books-back-link:hover { color: rgba(255,255,255,0.5); }

.back-dot-icon {
  font-size: 5px;
  color: rgba(212,201,176,0.3);
}

/* Search bar — subtle top-right line */
#books-search {
  position: fixed;
  top: 1.5rem;
  right: 2rem;
  z-index: 250;
  display: none;
}

#books-search.show { display: block; }

#books-search-input {
  width: 120px;
  background: transparent;
  border: none;
  border-bottom: 0.5px solid rgba(255,255,255,0.1);
  border-radius: 0;
  padding: 4px 0;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.5rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.5);
  outline: none;
  transition: border-color 0.3s, width 0.3s, color 0.3s;
  text-align: right;
}

#books-search-input::placeholder {
  color: rgba(255,255,255,0.12);
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

#books-search-input:focus {
  border-color: rgba(212,201,176,0.3);
  color: #e8e0d0;
  width: 180px;
}

.book-thumb {
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(212,201,176,0.25);
  background: #151515;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.4s ease, transform 0.35s cubic-bezier(0.16,1,0.3,1), border-color 0.3s ease, box-shadow 0.3s ease;
  pointer-events: none;
}

.book-thumb.visible {
  opacity: 1;
  transform: scale(1);
}

.book-thumb.guide-thumb {
  object-fit: cover;
  object-position: center;
  background: #080808;
}
.book-thumb.guide-thumb.hovered,
.book-thumb.guide-thumb.snapped {
  object-fit: contain;
  border-radius: 3px;
}

.book-thumb.hovered {
  transform: var(--preview-transform, scale(2));
  border-color: rgba(232,224,208,0.6);
  box-shadow: 0 0 30px rgba(232,224,208,0.2);
  z-index: 15;
}

.book-thumb.snapped {
  border-color: #e8e0d0;
  transform: var(--preview-transform, scale(2));
  box-shadow: 0 0 24px rgba(232,224,208,0.2);
  z-index: 20;
}

.book-thumb.read-badge {
  box-shadow: 0 0 0 2.5px rgba(120,180,100,0.5);
}

.book-thumb.read-badge.hovered {
  box-shadow: 0 0 0 2.5px rgba(120,180,100,0.5), 0 0 20px rgba(232,224,208,0.12);
}

.book-placeholder {
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #1a1a1a;
  border: 1.5px solid rgba(212,201,176,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.5rem;
  color: rgba(212,201,176,0.4);
  letter-spacing: 0.05em;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.4s ease, transform 0.35s cubic-bezier(0.16,1,0.3,1), border-color 0.3s ease, box-shadow 0.3s ease;
  pointer-events: none;
}

.book-placeholder.visible {
  opacity: 1;
  transform: scale(1);
}

.book-placeholder.hovered {
  transform: var(--preview-transform, scale(2));
  border-color: rgba(232,224,208,0.6);
  box-shadow: 0 0 30px rgba(232,224,208,0.2);
  z-index: 15;
}

.book-placeholder.snapped {
  border-color: #e8e0d0;
  transform: var(--preview-transform, scale(2));
  box-shadow: 0 0 24px rgba(232,224,208,0.2);
  z-index: 20;
}

.book-title-hover {
  box-sizing: border-box;
  max-width: calc(100vw - 32px);
  overflow-wrap: anywhere;
  position: fixed;
  left: 50% !important;
  bottom: 100px;
  top: auto !important;
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 300;
  text-align: center;
  background: rgba(0,0,0,0.88);
  border: 0.5px solid rgba(212,201,176,0.15);
  padding: 14px 24px;
  border-radius: 3px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  min-width: 200px;
  max-width: 320px;
}

.book-title-hover.visible {
  opacity: 1;
}

.book-title-hover .bth-title {
  display: block;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #fff;
  line-height: 1.3;
}

.book-title-hover .bth-author {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.6rem;
  font-weight: 300;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(212,201,176,0.6);
  margin-top: 6px;
}

/* Books navigation */
#books-nav {
  display: none;
  align-items: center;
  gap: 1.2rem;
  margin-top: 0.5rem;
}

#books-nav.show {
  display: flex;
}

.books-nav-btn {
  background: transparent;
  border: 0.5px solid #2c2c2c;
  color: #444;
  padding: 5px 14px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.55rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 1px;
  transition: color 0.2s, border-color 0.2s;
}

.books-nav-btn:hover { color: #aaa; border-color: #666; }

#books-page-info {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.5rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  color: #444;
}

/* ─── Book Detail Overlay ─── */
#book-detail {
  position: fixed;
  inset: 0;
  background: rgba(8,8,8,0.96);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

#book-detail.visible {
  opacity: 1;
  pointer-events: all;
}

#book-detail-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  max-width: 400px;
  width: 90vw;
  text-align: center;
}

#bd-cover {
  width: 140px;
  height: 200px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid rgba(212,201,176,0.15);
  background: #151515;
}

#bd-cover.hidden { display: none; }

#bd-placeholder {
  width: 140px;
  height: 200px;
  border-radius: 4px;
  border: 1px solid rgba(212,201,176,0.15);
  background: #151515;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  color: rgba(212,201,176,0.35);
}

#bd-placeholder.show { display: flex; }

#bd-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 300;
  letter-spacing: 0.08em;
  color: #e8e0d0;
}

#bd-author {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.6rem;
  font-weight: 300;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #666;
}

#bd-status {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.55rem;
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 2px;
}

#bd-status.read {
  color: rgba(120,180,100,0.8);
  border: 0.5px solid rgba(120,180,100,0.3);
}

#bd-status.to-read {
  color: rgba(212,201,176,0.5);
  border: 0.5px solid rgba(212,201,176,0.15);
}

#bd-notes {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 300;
  color: rgba(255,255,255,0.45);
  line-height: 1.7;
  max-width: 340px;
}

#bd-close {
  margin-top: 0.5rem;
}

/* ─── Tablet ─── */
@media (max-width: 1024px) {
  #ask-card { width: min(540px, 88vw); }
}

/* ─── Mobile ─── */
@media (max-width: 768px) {
  #ask-card { padding: 1.8rem 1.4rem; width: min(540px, 92vw); }
  .ask-title { font-size: clamp(1.6rem, 7vw, 2.2rem); }

  #header {
    padding: max(1.2rem, env(safe-area-inset-top)) 1.2rem 0;
  }

  #logo {
    font-size: clamp(0.68rem, 2.8vw, 0.88rem);
    letter-spacing: 0.28em;
  }

  #canvas-zone {
    align-items: center;
    padding-top: 0;
  }

  #wrap {
    width: 100vw;
    height: min(58vh, 430px);
    min-height: 340px;
  }

  #wrap canvas {
    cursor: default;
  }

  .dlabel {
    font-size: clamp(1.15rem, 5.4vw, 1.55rem);
    letter-spacing: 0.08em;
  }

  #footer {
    padding: 0 1.2rem max(1.4rem, env(safe-area-inset-bottom));
    min-height: 92px;
  }

  #instr {
    font-size: 0.52rem;
    letter-spacing: 0.22em;
  }

  #ptitle {
    font-size: clamp(1.45rem, 7vw, 2rem);
  }

  #pdesc {
    max-width: 88vw;
    font-size: 0.52rem;
    letter-spacing: 0.16em;
    line-height: 1.6;
  }
}

/* ─── Small phones ─── */
@media (max-width: 480px) {
  #ask-card { padding: 1.5rem 1.1rem; width: 94vw; }
  .ask-title { font-size: clamp(1.4rem, 8vw, 1.9rem); }
  #ask-desc { font-size: 0.8rem; }
  .dot-btn { font-size: 0.68rem; padding: 0.7rem 1rem; }

  #wrap {
    height: min(54vh, 390px);
    min-height: 310px;
  }

  .dlabel {
    font-size: clamp(1rem, 6.2vw, 1.35rem);
    letter-spacing: 0.06em;
  }

  #instr {
    font-size: 0.48rem;
    letter-spacing: 0.18em;
  }
}
