/* ==========================================================================
   Inner — App Shell (Phase 0 foundation)

   Shared chrome for the "app-shell" template family: index.html,
   guardians.html, and auditory-ascension.html. These three pages had
   byte-for-byte identical implementations of the topbar, hamburger
   menu, mobile nav, nav dropdowns, book-purchase modal, and a handful
   of small utility classes — this file is that code, extracted once.

   The site's other pages (about, impact, lucid-dreaming,
   obe-awareness, privacy, support, thankyou, download) use genuinely
   different nav/layout implementations and were deliberately left
   untouched rather than forced into this shared file — see the Phase 0
   report for why.

   Depends on tokens.css (for --content-width, --topbar-height).
   ========================================================================== */

/* Small shared utility classes */
.center { text-align: center; }
.subtle { color: rgba(210, 205, 240, 0.70); }
.kicker {
  text-align: center;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: rgba(210, 205, 240, 0.70);
  margin: 0 0 12px 0;
  user-select: none;
}

.panel {
  background: linear-gradient(135deg, rgba(31, 30, 56, 0.82), rgba(42, 41, 78, 0.72));
  border: 1px solid rgba(144, 140, 159, 0.26);
  border-radius: 16px;
  padding: 22px;
  box-sizing: border-box;
  backdrop-filter: blur(8px);
}

.veil-line {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(161, 140, 255, 0.35), transparent);
  margin: 10px 0 0 0;
  opacity: 0.7;
}

.footer-links {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.footer-links a {
  color: rgba(210, 205, 240, 0.78);
  text-decoration: none;
  border-bottom: 1px solid rgba(161, 140, 255, 0.22);
  padding-bottom: 1px;
}
.footer-links a:hover {
  color: rgba(161, 140, 255, 0.95);
  border-bottom-color: rgba(161, 140, 255, 0.55);
}

/* Top nav */
.topbar {
  width: 100%;
  max-width: var(--content-width, 1100px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  box-sizing: border-box;
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  left: 50%;
  transform: translateX(-50%);
  height: var(--topbar-height, 58px);
  z-index: 10;
  background: linear-gradient(180deg, rgba(13, 12, 31, 0.92) 0%, rgba(13, 12, 31, 0.35) 100%);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(144, 140, 159, 0.16);
}
.topbar a {
  color: rgba(235, 232, 255, 0.84);
  text-decoration: none;
  font-size: 0.95rem;
  margin-left: 12px;
}
.topbar a:hover {
  color: rgba(161, 140, 255, 0.95);
}
.topbar a.active {
  color: rgba(161, 140, 255, 1);
  position: relative;
}
.topbar a.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(161, 140, 255, 0.9), transparent);
  border-radius: 2px;
}
.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}
.brand-link {
  font-family: 'CalSans', sans-serif !important;
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  color: rgba(235, 232, 255, 0.96) !important;
  text-decoration: none;
  line-height: 1;
  margin-left: 0;
}
.brand-link:hover {
  color: rgba(161, 140, 255, 1) !important;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: background 0.2s ease;
}
.hamburger:hover { background: rgba(144, 140, 159, 0.14); }
.hamburger span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: rgba(235, 232, 255, 0.82);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.hamburger.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.mobile-nav {
  display: none;
  position: fixed;
  top: var(--topbar-height, 58px);
  left: 0;
  right: 0;
  z-index: 9;
  background: rgba(13, 12, 31, 0.97);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(144, 140, 159, 0.16);
  padding: 8px 0 12px 0;
  flex-direction: column;
  max-height: calc(100vh - var(--topbar-height, 58px));
  max-height: calc(100dvh - var(--topbar-height, 58px));
  overflow-y: auto;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.mobile-nav.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}
.mobile-nav a {
  display: block;
  padding: 13px 22px;
  color: rgba(235, 232, 255, 0.84);
  text-decoration: none;
  font-family: 'CalSans', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.03em;
  border-bottom: 1px solid rgba(144, 140, 159, 0.10);
  transition: color 0.2s ease, background 0.2s ease;
}
.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav a:hover { color: rgba(161, 140, 255, 0.95); background: rgba(144, 140, 159, 0.06); }
.mobile-nav a.active { color: rgba(161, 140, 255, 1); }

@media (max-width: 680px) {
  .hamburger { display: flex; }
  .topbar nav { display: none; }
  .mobile-nav { display: flex; }
}

/* Nav dropdown */
.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.dropdown-chevron {
  font-size: 0.65em;
  display: inline-block;
  transition: transform 0.2s ease;
  margin-top: 1px;
}
.nav-dropdown:hover .dropdown-chevron,
.nav-dropdown.is-open .dropdown-chevron { transform: rotate(180deg); }
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  background: rgba(16, 14, 38, 0.97);
  border: 1px solid rgba(144, 140, 159, 0.22);
  border-radius: 12px;
  padding: 6px 0;
  min-width: 190px;
  display: flex;
  flex-direction: column;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
  z-index: 20;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.is-open .nav-dropdown-menu {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}
.nav-dropdown-menu a {
  display: block;
  padding: 10px 16px;
  color: rgba(235, 232, 255, 0.84);
  font-size: 0.9rem;
  margin-left: 0;
  border-bottom: 1px solid rgba(144, 140, 159, 0.10);
  transition: color 0.18s ease, background 0.18s ease;
  white-space: nowrap;
}
.nav-dropdown-menu a:last-child { border-bottom: none; }
.nav-dropdown-menu a:hover {
  color: rgba(161, 140, 255, 0.95);
  background: rgba(144, 140, 159, 0.08);
}
.nav-dropdown-menu a.active { color: rgba(161, 140, 255, 1); }

/* Canonical navigation additions (Chambers / Learn / Books / About / Download).
   Download is the one primary call-to-action; the rest stay quiet. */
.topbar nav a.nav-download {
  margin-left: 18px;
  padding: 7px 16px;
  border: 1px solid rgba(161, 140, 255, 0.4);
  border-radius: 999px;
  background: rgba(154, 134, 245, 0.16);
  color: rgba(245, 243, 255, 0.96);
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}
.topbar nav a.nav-download:hover {
  background: rgba(168, 150, 249, 0.3);
  border-color: rgba(200, 190, 255, 0.65);
  color: #fff;
}
.topbar nav a.nav-download.active::after { display: none; }

.mobile-nav-label {
  display: block;
  padding: 16px 22px 4px 22px;
  font-family: 'CalSans', sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(190, 178, 255, 0.55);
}
.mobile-nav a.mobile-nav-sub {
  padding-left: 36px;
  font-size: 0.94rem;
  color: rgba(235, 232, 255, 0.78);
}
.mobile-nav a.nav-download {
  color: rgba(214, 205, 255, 0.98);
}

/* Canonical footer: Chambers · Learn · Books · About, then the legal line.
   Flat, quiet, and the same on every public page. */
.site-footer {
  text-align: center;
}
.site-footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 10px 36px;
  max-width: 880px;
  margin: 0 auto;
}
.site-footer-group {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 6px 16px;
}
.site-footer-label {
  font-family: 'CalSans', sans-serif;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(190, 178, 255, 0.7);
}
.site-footer a {
  margin: 0;
  color: rgba(210, 205, 240, 0.78);
  font-size: 0.86rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(161, 140, 255, 0.22);
  padding-bottom: 1px;
}
.site-footer a:hover {
  color: rgba(161, 140, 255, 0.95);
  border-bottom-color: rgba(161, 140, 255, 0.55);
}
.site-footer .site-footer-legal {
  margin: 20px auto 0 auto;
  max-width: none;
  font-size: 0.82rem;
  color: rgba(210, 205, 240, 0.62);
  text-align: center;
}
.site-footer .site-footer-legal a {
  margin-left: 12px;
  font-size: inherit;
}
@media (max-width: 680px) {
  .site-footer-nav { gap: 14px 24px; flex-direction: column; align-items: center; }
}

/* Book Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(5, 4, 18, 0.80);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
.modal-backdrop.is-open {
  opacity: 1;
  pointer-events: all;
}
.modal-card {
  position: relative;
  background: linear-gradient(180deg, rgba(20, 18, 48, 0.99) 0%, rgba(26, 24, 58, 0.97) 100%);
  border: 1px solid rgba(144, 140, 159, 0.28);
  border-radius: 22px;
  padding: 44px 36px 36px 36px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55), 0 0 60px rgba(161, 140, 255, 0.07);
  transform: translateY(14px) scale(0.98);
  transition: transform 0.28s ease;
}
.modal-backdrop.is-open .modal-card {
  transform: translateY(0) scale(1);
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  background: rgba(144, 140, 159, 0.12);
  border: 1px solid rgba(144, 140, 159, 0.26);
  border-radius: 50%;
  color: rgba(210, 205, 240, 0.65);
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease, color 0.2s ease;
  font-family: 'Inter', sans-serif;
  font-weight: 300;
}
.modal-close:hover {
  background: rgba(144, 140, 159, 0.22);
  color: rgba(235, 232, 255, 0.92);
}
.modal-book-title {
  text-align: center;
  margin: 0 0 2px 0;
  font-size: 1.6rem;
}
.modal-book-sub {
  text-align: center;
  font-size: 0.84rem;
  color: rgba(161, 140, 255, 0.78);
  margin: 0 0 28px 0;
  max-width: none;
  font-style: italic;
}
.modal-retailers {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.modal-retailer-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px 20px;
  border-radius: 12px;
  border: 1px solid rgba(161, 140, 255, 0.28);
  background: linear-gradient(135deg, rgba(154, 134, 245, 0.24), rgba(122, 109, 224, 0.16));
  color: rgba(245, 243, 255, 0.96);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
  box-sizing: border-box;
}
.modal-retailer-btn:hover {
  background: linear-gradient(135deg, rgba(168, 150, 249, 0.32), rgba(137, 124, 232, 0.24));
  border-color: rgba(183, 166, 255, 0.42);
  box-shadow: 0 4px 16px rgba(161, 140, 255, 0.18);
  transform: translateY(-1px);
}
.modal-coming-soon {
  margin: 18px 0 0 0 !important;
  text-align: center !important;
  font-size: 0.78rem !important;
  color: rgba(144, 140, 159, 0.52) !important;
  max-width: none !important;
  letter-spacing: 0.03em;
}
