/**
 * Polyglot Design System V1 — scoped component styles.
 * NEVER target bare body/html/h1/button — only .polyglot-ui and children.
 */

.polyglot-ui {
  --polyglot-ink: #0e0c0a;
  --polyglot-ink-soft: #3a3530;
  --polyglot-ink-muted: #6b635b;
  --polyglot-parchment: #faf7f2;
  --polyglot-cream: #f2ede4;
  --polyglot-surface: #fdfcfa;
  --polyglot-gold: #b8893a;
  --polyglot-gold-light: #d4a95a;
  --polyglot-sapphire: #1a3a5c;
  --polyglot-sapphire-mid: #244b73;
  --polyglot-border: rgba(14, 12, 10, 0.1);
  --polyglot-success: #2f6b4f;
  --polyglot-warning: #a67c2a;
  --polyglot-error: #9b2c2c;
  --polyglot-radius: 4px;
  --polyglot-shadow-sm: 0 2px 12px rgba(14, 12, 10, 0.07);
  --polyglot-content: 1100px;
  --polyglot-font-sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --polyglot-font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;

  box-sizing: border-box;
  color: var(--polyglot-ink);
  font-family: var(--polyglot-font-sans);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.polyglot-ui *,
.polyglot-ui *::before,
.polyglot-ui *::after {
  box-sizing: border-box;
}

.polyglot-ui h2 {
  font-family: var(--polyglot-font-display);
  font-weight: 600;
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--polyglot-sapphire);
  margin: 0 0 0.75rem;
}

.polyglot-ui h3 {
  font-family: var(--polyglot-font-display);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--polyglot-sapphire);
  margin: 0.2rem 0 0.45rem;
}

.polyglot-ui p {
  margin: 0 0 1rem;
  color: var(--polyglot-ink-soft);
}

.polyglot-ui .polyglot-hub__note {
  font-size: 0.875rem;
  color: var(--polyglot-ink-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}

.polyglot-ui .polyglot-hub__grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 1.5rem 0;
}

.polyglot-ui .polyglot-hub__card {
  background: var(--polyglot-surface);
  border: 1px solid var(--polyglot-border);
  border-top: 3px solid var(--polyglot-gold);
  border-radius: var(--polyglot-radius);
  padding: 1.25rem 1.1rem;
  box-shadow: var(--polyglot-shadow-sm);
}

.polyglot-ui .polyglot-hub__card a {
  color: var(--polyglot-sapphire-mid);
  font-weight: 650;
  text-decoration: none;
  border-bottom: 1px solid var(--polyglot-gold);
}

.polyglot-ui .polyglot-hub__card a:hover {
  color: var(--polyglot-gold);
}

.polyglot-ui .polyglot-hub__cta {
  display: inline-block;
  margin: 0.35rem 0.5rem 0.35rem 0;
  padding: 0.75rem 1.2rem;
  border-radius: var(--polyglot-radius);
  background: var(--polyglot-gold);
  color: var(--polyglot-sapphire) !important;
  text-decoration: none !important;
  font-weight: 650;
  font-size: 0.95rem;
}

.polyglot-ui .polyglot-hub__cta--secondary {
  background: var(--polyglot-sapphire);
  color: #fff !important;
}

.polyglot-ui .polyglot-hub__cta--ghost {
  background: transparent;
  border: 1px solid var(--polyglot-sapphire);
  color: var(--polyglot-sapphire) !important;
}

.polyglot-ui.polyglot-hub,
.polyglot-ui .polyglot-hub,
.polyglot-outcomes.polyglot-ui,
.polyglot-outcomes {
  max-width: var(--polyglot-content);
  margin-left: auto;
  margin-right: auto;
  padding: 2.5rem 1.25rem;
}

.polyglot-outcomes {
  background: linear-gradient(180deg, var(--polyglot-cream) 0%, #fff 100%);
  max-width: none;
  margin: 0;
}

.polyglot-outcomes .polyglot-outcomes__inner,
.polyglot-ui--home-clarity {
  max-width: var(--polyglot-content);
  margin: 0 auto;
}

.polyglot-premium-clarity {
  border: 1px solid var(--polyglot-border);
  padding: 1.5rem;
  margin: 1.5rem 0;
  background: var(--polyglot-surface);
  border-radius: var(--polyglot-radius);
}

.polyglot-goal-entry {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.polyglot-goal-entry a {
  display: block;
  padding: 1rem;
  border: 1px solid var(--polyglot-border);
  background: var(--polyglot-surface);
  color: var(--polyglot-sapphire);
  text-decoration: none;
  font-weight: 600;
  border-radius: var(--polyglot-radius);
}

.polyglot-goal-entry a:hover {
  border-color: var(--polyglot-gold);
}

/* Live / Practice / Progress hubs */
.polyglot-ui--live,
.polyglot-ui--practice,
.polyglot-ui--progress {
  max-width: var(--polyglot-content);
  margin: 2rem auto;
  padding: 0 1.25rem 3rem;
}

.polyglot-ui--live ol,
.polyglot-ui--practice ol,
.polyglot-ui--progress ol {
  padding-left: 1.25rem;
  color: var(--polyglot-ink-soft);
}

/* When LP embeds under theme chrome, hide duplicate LP chrome */
.polyglot-lp .nav,
.polyglot-lp > .nav,
.polyglot-lp .footer,
.polyglot-lp .footer-bottom {
  display: none !important;
}

.polyglot-lp {
  overflow-x: hidden;
  overflow-y: visible;
}

/*
 * GoStudy search/side-panel overlays can stick open and paint a full-viewport
 * grey veil (z-index 9999+) — the false "blank homepage" symptom.
 * Keep closed unless theme explicitly marks open/active.
 */
.header_search-field:not(.open):not(.is-open):not(.active),
.header_search:not(.open):not(.is-open) .header_search-field {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

.side-panel_overlay:not(.open):not(.is-open):not(.active),
.side-panel:not(.open) .side-panel_overlay {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
