/**
 * BrandFrame — styles (DESIGN.md reskin).
 *
 * Shared GeezWord/GeezSoft brand bar. Reskinned to the DESIGN.md system:
 * parchment / indigo tracks, Fraunces + Newsreader + Noto Serif Ethiopic
 * type, the §3a foundational palette. Structure is unchanged — sticky bar,
 * brand pill, "geezword.com →" cross-link, Habi mascot, four tracks.
 *
 * Habi stays the same character illustration; only the brand pill colour
 * varies per app (signatureColor, mapped to DESIGN.md §3a tokens).
 */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400..700&family=Newsreader:opsz,wght@6..72,400..600&family=Noto+Serif+Ethiopic:wght@400..700&display=swap');

/* ═══════════════════════════════════════════════════════════════
   Brand Frame Header — sticky top bar with brand pill + Habi
   ═══════════════════════════════════════════════════════════════ */

.brand-frame {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  border-bottom: 1px solid;
  font-family: 'Newsreader', 'Source Serif 4', Georgia, serif;
  /* Each app sets its --brand-signature-color via inline style on this element */
}

.brand-frame__container {
  max-width: 56rem; /* ~896px */
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ── Track variants — DESIGN.md §3a ── */

/* Light — parchment-grounded Learn apps (Lissan, Assessment, Tigrinya, Tracing) */
.brand-frame--light {
  background-color: rgba(244, 236, 216, 0.9);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #1A1614;
  border-bottom-color: #D6C7A3;
}

/* Dark — Play-mode games (Marble Games, arcade, the fidel games) */
.brand-frame--dark {
  background-color: rgba(15, 24, 56, 0.92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #F4ECD8;
  border-bottom-color: rgba(244, 236, 216, 0.12);
}

/* Sacred — Liturgy (Sirate Kidase Tutor): indigo-deep with a saffron rule */
.brand-frame--sacred {
  background-color: rgba(15, 24, 56, 0.95);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #F4ECD8;
  border-bottom-color: rgba(212, 160, 39, 0.35);
}

/* Practice — reserved dark-focus track */
.brand-frame--practice {
  background-color: #0F1838;
  color: #F4ECD8;
  border-bottom-color: #0F1838;
}

/* ═══════════════════════════════════════════════════════════════
   Brand Pill — colored capsule with ሀ mark + app name
   ═══════════════════════════════════════════════════════════════ */

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  background-color: var(--brand-signature-color, #1F2A5C);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.875rem;
  color: white;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.15s ease;
  min-width: 0; /* allow truncation */
  flex-shrink: 1;
}

.brand-frame--dark .brand-pill,
.brand-frame--sacred .brand-pill,
.brand-frame--practice .brand-pill {
  border-color: rgba(255, 255, 255, 0.2);
}

.brand-pill:hover {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Cascade guard — the brand pill and home link are <a> elements, so the
   browser's user-agent stylesheet underlines them. The base rules already
   set text-decoration: none; this higher-specificity, all-link-states
   block keeps them underline-free even if a host app adds its own anchor
   styling. No !important — specificity (0,3,0) does the work. */
.brand-frame .brand-pill,
.brand-frame .brand-pill:link,
.brand-frame .brand-pill:visited,
.brand-frame .brand-pill:hover,
.brand-frame .brand-pill:focus,
.brand-frame .brand-pill:active,
.brand-frame .brand-frame__home-link,
.brand-frame .brand-frame__home-link:link,
.brand-frame .brand-frame__home-link:visited,
.brand-frame .brand-frame__home-link:hover,
.brand-frame .brand-frame__home-link:focus,
.brand-frame .brand-frame__home-link:active {
  text-decoration: none;
}

.brand-pill__mark {
  font-family: 'Noto Serif Ethiopic', serif;
  font-size: 1.05em;
  line-height: 1;
  font-weight: 700;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-pill__name {
  font-family: 'Fraunces', 'Cormorant Garamond', serif;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 768px) {
  .brand-pill {
    font-size: 1rem;
  }
}

/* ═══════════════════════════════════════════════════════════════
   Home cross-link — small "geezword.com →" next to the pill
   ═══════════════════════════════════════════════════════════════ */

.brand-frame__home-link {
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  color: currentColor;
  opacity: 0.6;
  transition: opacity 0.15s ease;
  white-space: nowrap;
}

.brand-frame__home-link:hover {
  opacity: 1;
}

/* Hide on narrow screens — keep header uncluttered on mobile */
@media (max-width: 640px) {
  .brand-frame__home-link {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════════════════
   Spacer + right-side content (Habi, optional header right slot)
   ═══════════════════════════════════════════════════════════════ */

.brand-frame__spacer {
  flex: 1;
}

.brand-frame__right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   Habi mascot — the GeezWord character, three sizes
   ═══════════════════════════════════════════════════════════════ */

.brand-frame__habi {
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.brand-frame__habi--sm { width: 2.5rem; height: 2.5rem; }
.brand-frame__habi--md { width: 3.5rem; height: 3.5rem; }
.brand-frame__habi--lg { width: 5rem; height: 5rem; }

.brand-frame__habi:hover {
  transform: scale(1.05);
}

/* In sacred track, Habi is slightly subdued */
.brand-frame--sacred .brand-frame__habi {
  opacity: 0.9;
}

/* In practice track, Habi defaults to subdued */
.brand-frame--practice .brand-frame__habi {
  opacity: 0.7;
}
