/* ============================================================================
   GAP MINING — BRAND EMBLEM (brand.css)
   ----------------------------------------------------------------------------
   One shared page emblem used in every header, site-wide. Ornate serif monogram:
   an italic "D" engraved into a gold gem with a soft glow and a fine inner ring.

   USAGE (replaces every header wordmark/logo):
     <a class="gm-emblem" href="/" aria-label="Digital MINING — home">
       <span aria-hidden="true">D</span>
     </a>
   Optional larger variant for centred/hero placements: class="gm-emblem gm-emblem--lg"

   Self-contained: hardcoded colours (no page CSS vars), serif fallback so it
   looks right even if the Instrument Serif web font is blocked.
   ============================================================================ */

.gm-emblem {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 11px;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  /* Layered gold gem */
  background:
    linear-gradient(155deg, #FCE7A2 0%, #E9C55C 26%, #D4A843 54%, #B8862B 100%);
  box-shadow:
    0 0 0 1px rgba(255, 233, 160, 0.55) inset,   /* bright rim */
    0 1px 0 rgba(255, 255, 255, 0.45) inset,      /* top edge light */
    0 3px 12px rgba(212, 168, 67, 0.45),          /* gold glow */
    0 6px 20px rgba(0, 0, 0, 0.38);               /* depth */
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

/* Fine inner ring — the "flourish" */
.gm-emblem::before {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 8px;
  border: 1px solid rgba(26, 18, 5, 0.30);
  box-shadow: 0 0 0 1px rgba(255, 240, 200, 0.20) inset;
  pointer-events: none;
}

/* Top sheen highlight */
.gm-emblem::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.50) 0%, rgba(255, 255, 255, 0) 46%);
  opacity: 0.65;
  pointer-events: none;
}

/* The engraved italic serif "D" */
.gm-emblem > span {
  position: relative;
  z-index: 1;
  font-family: 'Instrument Serif', 'Georgia', 'Times New Roman', serif;
  font-style: italic;
  font-weight: 400;
  font-size: 25px;
  line-height: 1;
  color: #2a1d07;
  text-shadow: 0 1px 0 rgba(255, 245, 215, 0.45);
  transform: translateY(-0.5px);
  letter-spacing: 0;
  -webkit-user-select: none;
  user-select: none;
}

.gm-emblem:hover {
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px rgba(255, 233, 160, 0.65) inset,
    0 1px 0 rgba(255, 255, 255, 0.5) inset,
    0 4px 16px rgba(212, 168, 67, 0.6),
    0 8px 26px rgba(0, 0, 0, 0.42);
  filter: saturate(1.05);
}

.gm-emblem:active { transform: translateY(0); }

.gm-emblem:focus-visible {
  outline: 2px solid #FFD700;
  outline-offset: 3px;
}

/* Larger variant for centred / hero placements */
.gm-emblem--lg {
  width: 64px;
  height: 64px;
  border-radius: 16px;
}
.gm-emblem--lg::before { inset: 5px; border-radius: 11px; }
.gm-emblem--lg::after  { border-radius: 16px; }
.gm-emblem--lg > span  { font-size: 40px; }

@media (prefers-reduced-motion: reduce) {
  .gm-emblem { transition: none; }
}

/* ── Header "Menu" dropdown — custom <details> so the open panel is glassy/
   transparent (a native <select> popup is OS-rendered and can't be styled) ── */
.nav-menu { position: relative; display: inline-flex; }
.nav-menu > summary {
  list-style: none;
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(9, 12, 19, 0.20);
  backdrop-filter: blur(16px) saturate(135%);
  -webkit-backdrop-filter: blur(16px) saturate(135%);
  border: 1px solid rgba(212, 168, 67, 0.45);
  color: #fff; font-family: inherit; font-size: 14px; font-weight: 600;
  padding: 9px 14px; border-radius: 20px; cursor: pointer;
  white-space: nowrap; -webkit-tap-highlight-color: transparent;
}
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu > summary::marker { content: ""; }
.nav-menu > summary:hover { background: rgba(212, 168, 67, 0.12); border-color: rgba(212, 168, 67, 0.6); }
.nav-menu > summary:focus-visible { outline: 2px solid #D4A843; outline-offset: 2px; }
.nav-menu .chev { transition: transform .2s ease; opacity: .85; }
.nav-menu[open] > summary .chev { transform: rotate(180deg); }

.nav-menu-list {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  min-width: 200px; display: flex; flex-direction: column; gap: 4px;
  /* Crystal quality glass — elevated shimmer + premium glow.
     Base is now mostly-opaque (0.86) so the panel stays legible even when the
     blur only partially applies; the @supports fallback below goes near-solid
     for engines (e.g. some Android webviews) that don't honour backdrop-filter. */
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0.03) 100%),
    rgba(7, 9, 15, 0.86);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1.5px solid rgba(212, 168, 67, 0.35);
  border-radius: 16px; padding: 8px; z-index: 400;
  box-shadow:
    0 0 0 1px rgba(212, 168, 67, 0.15) inset,
    0 8px 32px rgba(212, 168, 67, 0.12),
    0 14px 40px rgba(0, 0, 0, 0.5);
}
/* No backdrop-filter support → drop the translucency entirely so the dropdown
   never lets the hero image bleed through behind the menu links. */
@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  .nav-menu-list { background: rgba(7, 9, 15, 0.97); }
}
.nav-menu-list a {
  color: #f0f4f8; text-decoration: none; font-size: 14px; font-weight: 600;
  padding: 12px 18px; border-radius: 10px; white-space: nowrap;
  transition: all 0.2s ease;
  border: 1px solid rgba(212, 168, 67, 0.1);
}
.nav-menu-list a:hover {
  background: rgba(212, 168, 67, 0.22);
  border-color: rgba(212, 168, 67, 0.5);
  color: #fff;
  box-shadow: 0 4px 16px rgba(212, 168, 67, 0.15);
}
html[dir="rtl"] .nav-menu-list a { text-align: right; }
