/* ==========================================================================
   E&A THANGKA ARTWORK — Navigation, drawer and footer
   ========================================================================== */

/* --- Fixed navigation bar ----------------------------------------------
   The bar's ground lives on ::before rather than on the element itself, for
   two reasons: the ground can then be graded and masked so it fades out at
   the foot instead of ending on a line, and the mask cannot touch the menu
   text the way it would if it were applied to .site-nav.
   ------------------------------------------------------------------------ */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  height: calc(var(--nav-h) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  display: flex;
  align-items: center;
  background: transparent;
  border-bottom: 0;                    /* a rule here would be another seam */
  transition: height var(--dur) var(--ease);

  --nav-top: rgba(11, 10, 9, .94);     /* dense behind the type */
  --nav-foot: rgba(11, 10, 9, .6);     /* light at the bottom edge, but still covering */
}

.site-nav::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg,
    var(--nav-top) 0%, var(--nav-top) 46%, var(--nav-foot) 100%);
  transition: background var(--dur) var(--ease);
}

/* Scrolled: denser, but still graded */
.is-scrolled .site-nav,
.site-nav--solid {
  height: calc(var(--nav-h-sm) + env(safe-area-inset-top));
  --nav-top: rgba(11, 10, 9, .97);
  --nav-foot: rgba(11, 10, 9, .72);
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-nav {
    --nav-top: rgba(11, 10, 9, .84);
    --nav-foot: rgba(11, 10, 9, .48);
  }
  .is-scrolled .site-nav,
  .site-nav--solid {
    --nav-top: rgba(11, 10, 9, .92);
    --nav-foot: rgba(11, 10, 9, .64);
  }
  /* The blur is masked to the same fall-off, so its edge never shows as a
     line of its own. */
  .site-nav::before {
    -webkit-backdrop-filter: blur(12px) saturate(135%);
    backdrop-filter: blur(12px) saturate(135%);
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 62%, rgba(0, 0, 0, .5) 100%);
            mask-image: linear-gradient(180deg, #000 0%, #000 62%, rgba(0, 0, 0, .5) 100%);
  }
}

.site-nav__inner {
  width: 100%;
  max-width: 1560px;                            /* ten sections need the room */
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left), env(safe-area-inset-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

/* Fades the bar's ground into the page instead of cutting it off. Without
   this the bar's bottom edge reads as a hard line against the backdrop. */
.site-nav::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 96px;
  background: linear-gradient(180deg, var(--nav-foot), transparent);
  pointer-events: none;
}

/* 1px sentinel just below the bar — drives the scrolled state without
   a scroll listener (see nav.js). */
.nav-sentinel { position: absolute; top: var(--nav-h); left: 0; width: 1px; height: 1px; }

/* --- Brand -------------------------------------------------------------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  flex: 0 0 auto;
  color: var(--c-text);
}
.brand:hover { color: var(--c-text); }
.brand__mark {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  /* The same charcoal plate and halo as the hero: without a ground behind it
     the logo's black disc vanishes into the bar and the gold half reads as a
     crescent floating on its own. */
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #2a241e 0%, #171310 48%, #0C0A08 80%);
  box-shadow: 0 0 0 1px rgba(212, 168, 87, .16),
              0 0 18px rgba(212, 168, 87, .22),
              inset 0 1px 6px rgba(0, 0, 0, .8);
  transition: width var(--dur) var(--ease), height var(--dur) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
}
.is-scrolled .brand__mark { width: 38px; height: 38px; }
.brand:hover .brand__mark {
  box-shadow: 0 0 0 1px rgba(212, 168, 87, .34),
              0 0 26px rgba(212, 168, 87, .42),
              inset 0 1px 6px rgba(0, 0, 0, .8);
}

.brand__text { display: block; line-height: 1.15; min-width: 0; }
.brand__name {
  display: block;
  font-family: var(--f-display);
  font-size: clamp(.78rem, 2.6vw, 1.02rem);
  letter-spacing: clamp(.1em, .5vw, .18em);
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--c-gold-lt);
}
.brand__tag {
  display: block;
  font-size: clamp(.48rem, 1.5vw, .56rem);
  letter-spacing: .28em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--c-text-mute);
}

/* --- Desktop menu -------------------------------------------------------- */
.nav-menu { display: none; min-width: 0; }
.nav-menu__list {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(.4rem, .85vw, 1rem);
}

.nav-menu__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: var(--sp-2) 2px;
  font-size: clamp(.66rem, .52vw, .74rem);
  font-weight: 400;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--c-text);
  white-space: nowrap;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .65);   /* legible over the hero */
}
.nav-menu__link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--c-gold);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--dur) var(--ease-out);
}
.nav-menu__link:hover { color: var(--c-gold-lt); }
.nav-menu__link:hover::after,
.nav-menu__link[aria-current='page']::after { transform: scaleX(1); transform-origin: left; }
.nav-menu__link[aria-current='page'] { color: var(--c-gold); }

/* Sections not yet built */
.nav-menu__link[aria-disabled='true'] { color: var(--c-text-mute); cursor: default; }
.nav-menu__link[aria-disabled='true']::after { display: none; }
.badge-soon {
  display: none;                                /* shown only when there is room */
  font-size: .5rem;
  letter-spacing: .12em;
  padding: 2px 5px;
  border: 1px solid var(--c-gold-24);
  border-radius: var(--radius);
  color: var(--c-gold-dp);
}
@media (min-width: 1440px) { .nav-menu .badge-soon { display: inline-block; } }

.nav-actions { display: flex; align-items: center; gap: var(--sp-3); flex: 0 0 auto; }
.nav-actions .btn { display: none; padding: .7em 1.4em; min-height: 42px; font-size: var(--fs-xs); }

/* --- Burger -------------------------------------------------------------- */
.burger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 46px;
  height: 46px;
  padding: 0 10px;
  background: rgba(11, 10, 9, .35);
  border: 1px solid var(--c-gold-24);
  border-radius: var(--radius);
  cursor: pointer;
}
.burger span {
  display: block;
  height: 1px;
  background: var(--c-gold);
  transition: transform var(--dur) var(--ease), opacity var(--dur-fast) var(--ease);
}
.burger[aria-expanded='true'] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded='true'] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded='true'] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- Full-screen drawer --------------------------------------------------- */
.drawer {
  position: fixed;
  inset: 0;
  z-index: var(--z-drawer);
  display: flex;
  flex-direction: column;
  padding: calc(env(safe-area-inset-top) + var(--nav-h)) var(--gutter)
           calc(env(safe-area-inset-bottom) + var(--sp-8));
  background:
    radial-gradient(120% 80% at 72% 0%, rgba(58, 36, 25, .92), transparent 62%),
    linear-gradient(180deg, var(--c-umber) 0%, var(--c-ink) 58%);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-1.5%);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease),
              visibility 0s linear var(--dur);
  overflow-y: auto;
  overflow-x: hidden;                 /* the watermark must not widen the page */
  overscroll-behavior: contain;
}
.drawer.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}
.drawer:focus { outline: none; }

/* Whilst the drawer is open the bar keeps its ground and the burger becomes
   the close control. */
body.is-locked .site-nav {
  background: rgba(11, 10, 9, .82);
  border-bottom-color: var(--c-gold-12);
}

/* Mandala watermark behind the drawer */
.drawer::before {
  content: '';
  position: absolute;
  right: -26%;
  bottom: -18%;
  width: min(80vw, 460px);
  aspect-ratio: 1;
  background: url('../img/mandala-ring.svg?v=20260909212727') center / contain no-repeat;
  opacity: .06;
  pointer-events: none;
}

.drawer__list { display: flex; flex-direction: column; position: relative; }
.drawer__item {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s var(--ease-out), transform .5s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 38ms);
}
.drawer.is-open .drawer__item { opacity: 1; transform: none; }

.drawer__link {
  display: flex;
  align-items: baseline;
  gap: var(--sp-4);
  padding: clamp(.4rem, 1.4vw, .7rem) 0;
  font-family: var(--f-display);
  font-size: clamp(1.3rem, 5.4vw, 1.95rem);
  letter-spacing: .02em;
  color: var(--c-text);
  border-bottom: 1px solid rgba(212, 168, 87, .09);
}
.drawer__link:hover,
.drawer__link[aria-current='page'] { color: var(--c-gold); }
.drawer__link[aria-disabled='true'] { color: var(--c-text-mute); }
.drawer__num {
  font-family: var(--f-body);
  font-size: .6rem;
  letter-spacing: .2em;
  color: var(--c-gold-dp);
}

.drawer__foot {
  margin-top: auto;
  padding-top: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  position: relative;
}
.drawer__foot .btn { width: 100%; }
.drawer__meta { font-size: var(--fs-sm); color: var(--c-text-mute); }

/* --- Footer --------------------------------------------------------------- */
.site-footer {
  position: relative;
  background: var(--c-ink-2);
  border-top: 1px solid var(--c-gold-12);
  padding-top: var(--sp-24);
  padding-bottom: calc(var(--sp-8) + env(safe-area-inset-bottom));
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-10);
  padding-bottom: var(--sp-12);
}
.footer-brand__mark { width: 76px; height: 76px; margin-bottom: var(--sp-4); }
.footer-brand p { color: var(--c-text-mute); max-width: 36ch; font-size: var(--fs-sm); }
.footer-brand__motto {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 1.12rem;
  line-height: 1.45;
  color: var(--c-gold);
  margin-bottom: var(--sp-3);
}

.footer-col__title {
  font-family: var(--f-body);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--c-gold);
  margin-bottom: var(--sp-5);
}
.footer-col li + li { margin-top: var(--sp-3); }
.footer-col a,
.footer-col address,
.footer-col p {
  color: var(--c-text-mute);
  font-size: var(--fs-sm);
  font-style: normal;
  line-height: 1.85;
}
.footer-col a:hover { color: var(--c-gold); }

.social { display: flex; gap: var(--sp-3); margin-top: var(--sp-5); }
.social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--c-gold-24);
  border-radius: var(--radius-pill);
  color: var(--c-gold);
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.social a:hover { background: var(--c-gold); color: var(--c-ink); }

/* Placeholders for channels that have no address yet — same shape, no link */
.social__soon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(212, 168, 87, .14);
  border-radius: var(--radius-pill);
  color: rgba(212, 168, 87, .45);
}

.footer-bottom {
  border-top: 1px solid rgba(212, 168, 87, .08);
  padding-top: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  align-items: center;
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--c-text-mute);
  letter-spacing: .06em;
}
.footer-bottom__links { display: flex; gap: var(--sp-5); flex-wrap: wrap; justify-content: center; }

/* --- Breakpoints ----------------------------------------------------------- */
@media (min-width: 480px) {
  .footer-bottom { flex-direction: row; justify-content: space-between; text-align: left; }
}

/* Only the very narrowest screens drop the wordmark */
@media (max-width: 339px) {
  .brand__text { display: none; }
}

@media (min-width: 768px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: var(--sp-12); }
  .drawer__list { max-width: 540px; }
}

@media (min-width: 1024px) {
  .footer-grid { grid-template-columns: 1.7fr 1fr 1fr 1.2fr; }
}

/* Ten sections need real width before they earn a horizontal bar; below this
   the drawer stays. */
@media (min-width: 1280px) {
  .nav-menu { display: block; }
  .nav-actions .btn { display: inline-flex; }
  .burger { display: none; }
  .drawer { display: none; }
}

/* --- Back to top ------------------------------------------------------------
   Hidden until the reader is about a screen down. Sits clear of the iOS home
   indicator via the safe-area inset.
   ---------------------------------------------------------------------------- */
.to-top {
  position: fixed;
  right: max(var(--sp-5), env(safe-area-inset-right));
  bottom: calc(var(--sp-5) + env(safe-area-inset-bottom));
  z-index: var(--z-nav);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  background: rgba(11, 10, 9, .8);
  border: 1px solid var(--c-gold-40);
  border-radius: var(--radius-pill);
  color: var(--c-gold);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease),
              visibility 0s linear var(--dur), background-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .to-top {
    background: rgba(11, 10, 9, .55);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }
}
.to-top.is-shown {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}
.to-top:hover { background: var(--c-gold); color: var(--c-ink); border-color: var(--c-gold); }
.to-top:active { transform: translateY(1px); }

/* Whilst the drawer is open it would only be in the way */
body.is-locked .to-top { opacity: 0; visibility: hidden; }

@media (min-width: 768px) {
  .to-top {
    right: max(var(--sp-8), env(safe-area-inset-right));
    bottom: calc(var(--sp-8) + env(safe-area-inset-bottom));
    width: 52px;
    height: 52px;
  }
}
