/* =========================================================================
   Bifrost-style chrome (navbar + footer) for the Maxim Ghost theme.
   Self-contained, prefixed with `bf-` so it never collides with the
   existing theme styles. Body layout/design is intentionally untouched.
   ========================================================================= */

:root {
  --bf-bg: #f9f9f9;
  --bf-primary: #33c09e;
  --bf-primary-hover: #33a68b;
  --bf-primary-border: #82ceb6;
  --bf-primary-corner: #177b62;
  --bf-secondary: #f5f5f5;
  --bf-secondary-hover: #f0f0f0;
  --bf-secondary-corner: #e0e0e0;
  --bf-text: #111827;
  --bf-text-muted: #6b7280;
  --bf-text-extracted: #8f8f8f;
  --bf-border: #e5e7eb;
  --bf-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bf-mono: "Geist Mono", "Cascadia Code", ui-monospace, SFMono-Regular, "SF Mono", Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --bf-grid: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='4' y='4' width='4' height='4' fill='black'/%3E%3Crect y='8' width='4' height='4' fill='black'/%3E%3Crect x='8' width='4' height='4' fill='black'/%3E%3C/svg%3E");
}

/* Neutralise the original theme header container so the Bifrost chrome
   controls its own positioning. */
#gh-head {
  position: static;
  background: transparent;
  padding: 0;
  margin: 0;
  border: 0;
  box-shadow: none;
}

.bf-chrome,
.bf-chrome *,
.bf-chrome *::before,
.bf-chrome *::after {
  box-sizing: border-box;
}

.bf-chrome a {
  text-decoration: none;
}

/* 4-corner bracket helper (drawn with 8 thin background layers). */
.bf-corners {
  position: relative;
}
.bf-corners::after {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  opacity: var(--bf-corner-opacity, 1);
  transition: opacity 0.2s ease;
  background:
    linear-gradient(var(--bf-corner-color), var(--bf-corner-color)) 0 0 / 4px 1px no-repeat,
    linear-gradient(var(--bf-corner-color), var(--bf-corner-color)) 0 0 / 1px 4px no-repeat,
    linear-gradient(var(--bf-corner-color), var(--bf-corner-color)) 100% 0 / 4px 1px no-repeat,
    linear-gradient(var(--bf-corner-color), var(--bf-corner-color)) 100% 0 / 1px 4px no-repeat,
    linear-gradient(var(--bf-corner-color), var(--bf-corner-color)) 0 100% / 4px 1px no-repeat,
    linear-gradient(var(--bf-corner-color), var(--bf-corner-color)) 0 100% / 1px 4px no-repeat,
    linear-gradient(var(--bf-corner-color), var(--bf-corner-color)) 100% 100% / 4px 1px no-repeat,
    linear-gradient(var(--bf-corner-color), var(--bf-corner-color)) 100% 100% / 1px 4px no-repeat;
}

/* ----------------------------------------------------------------- Banner */
.bf-banner {
  position: sticky;
  top: 0;
  z-index: 49;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  width: 100%;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(111, 195, 168, 0) 0%, rgba(89, 156, 134, 0.8) 10%, rgb(89, 156, 134) 50%, rgba(89, 156, 134, 0.8) 90%, rgba(111, 195, 168, 0) 100%),
    rgb(111, 195, 168);
}
.bf-banner-grid {
  position: absolute;
  inset: 0;
  opacity: 0.07;
  background-image: var(--bf-grid);
  background-size: 4px 4px;
}
.bf-banner-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.bf-banner-text {
  font-family: var(--bf-mono);
  font-size: 12px;
  font-weight: 700;
}
.bf-banner-link {
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: all 0.2s ease;
}
.bf-banner-link:hover {
  text-decoration: none;
}
@media (max-width: 640px) {
  .bf-banner-text {
    padding-left: 16px;
  }
}

/* ----------------------------------------------------------------- Header */
.bf-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--bf-border);
  background: var(--bf-bg);
}
.bf-header-inner {
  display: flex;
  align-items: center;
  height: 64px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 640px) {
  .bf-header-inner { padding: 0 24px; }
}
@media (min-width: 1024px) {
  .bf-header-inner { padding: 0 48px; }
}

.bf-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
}
.bf-logo:hover { opacity: 0.8; }
.bf-logo svg { height: 24px; width: auto; display: block; }
@media (min-width: 768px) {
  .bf-logo svg { height: 28px; }
}

.bf-nav-links {
  display: none;
  align-items: center;
  gap: 24px;
  margin-left: 32px;
  margin-top: 6px;
}
@media (min-width: 1024px) {
  .bf-nav-links { display: flex; }
}

.bf-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.bf-new-badge {
  font-family: var(--bf-mono);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bf-primary-hover);
  border: 1px solid var(--bf-primary-border);
  padding: 1px 5px;
}
.bf-nav-link-inner {
  --bf-corner-color: #7f7f7f;
  --bf-corner-opacity: 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 4px 0;
  font-family: var(--bf-mono);
  font-size: 14px;
  font-weight: 500;
  line-height: 140%;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--bf-text-extracted);
  transition: color 0.2s ease, padding 0.2s ease, margin 0.2s ease, background 0.2s ease;
}
.bf-nav-link:hover .bf-nav-link-inner {
  color: #7f7f7f;
  background: #f0f0f0;
  padding-left: 6px;
  padding-right: 6px;
  margin-left: -6px;
  margin-right: -6px;
  --bf-corner-opacity: 1;
}
.bf-nav-link--edge .bf-nav-link-inner {
  gap: 8px;
  padding-left: 8px;
  padding-right: 8px;
  --bf-corner-color: #b3b3b3;
  --bf-corner-opacity: 1;
}
.bf-nav-link--edge:hover .bf-nav-link-inner {
  color: var(--bf-text-extracted);
  background: transparent;
  padding-left: 8px;
  padding-right: 8px;
  margin-left: 0;
  margin-right: 0;
  --bf-corner-color: #7f7f7f;
}

/* ------------------------------------------------------------- Nav actions */
.bf-nav-actions {
  display: none;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
@media (min-width: 1024px) {
  .bf-nav-actions { display: flex; }
}

.bf-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 32px;
  padding: 0 10px;
  font-family: var(--bf-mono);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  user-select: none;
  transition: background-color 0.2s ease;
}
.bf-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.bf-btn-secondary {
  --bf-corner-color: var(--bf-secondary-corner);
  background: var(--bf-secondary);
  color: #282828;
  border: none;
}
.bf-btn-secondary:hover { background: var(--bf-secondary-hover); }
.bf-btn-secondary svg { color: #4b5563; }

.bf-btn-primary {
  --bf-corner-color: var(--bf-primary-corner);
  background: var(--bf-primary);
  color: #fff;
  border: 2px solid var(--bf-primary-border);
  box-shadow: 0 0 4px rgba(51, 192, 158, 0.8);
}
.bf-btn-primary:hover { background: var(--bf-primary-hover); }

/* --------------------------------------------------------- Mobile toggle */
.bf-mobile-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  padding: 8px;
  color: #4b5563;
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: color 0.2s ease;
}
.bf-mobile-toggle:hover { color: #111827; }
.bf-mobile-toggle svg { width: 16px; height: 16px; }
@media (min-width: 1024px) {
  .bf-mobile-toggle { display: none; }
}

.bf-mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #fff;
}
.bf-mobile-menu.is-open { display: block; }
@media (min-width: 1024px) {
  .bf-mobile-menu.is-open { display: none; }
}
.bf-mobile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--bf-border);
}
.bf-mobile-close {
  padding: 8px;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: #111827;
}
.bf-mobile-close svg { width: 24px; height: 24px; }
.bf-mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
}
.bf-mobile-nav a {
  font-family: var(--bf-sans);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #374151;
}
.bf-mobile-nav .bf-mobile-cta {
  margin-top: 16px;
  width: 100%;
  padding: 16px 0;
  text-align: center;
  font-size: 14px;
  color: #fff;
  background: var(--bf-primary);
  border: 2px dashed rgba(0, 0, 0, 0.2);
}

/* ----------------------------------------------------------------- Footer */
.bf-footer {
  width: 100%;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  background: var(--bf-bg);
  font-family: var(--bf-sans);
}
.bf-footer-rows {
  display: flex;
  justify-content: center;
  width: 100%;
}
.bf-rail {
  display: none;
  width: 80px;
  flex: none;
  background: #f6f6f6;
}
.bf-rail::before {
  content: "";
  display: block;
  height: 100%;
  width: 100%;
  opacity: 0.07;
  background-image: var(--bf-grid);
  background-size: 4px 4px;
}
.bf-rail-left { border-right: 1px solid rgba(0, 0, 0, 0.1); }
.bf-rail-right { border-left: 1px solid rgba(0, 0, 0, 0.1); }
@media (min-width: 1280px) {
  .bf-rail { display: block; }
}

.bf-footer-spacer {
  height: 80px;
  width: 100%;
  max-width: 1100px;
}

.bf-footer-center {
  width: 100%;
  max-width: 1100px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  padding: 16px 16px 0;
}
@media (min-width: 640px) {
  .bf-footer-center { padding: 32px 64px 0; }
}
@media (min-width: 768px) {
  .bf-footer-center { padding: 64px 96px 0; }
}

/* CTA box */
.bf-cta {
  position: relative;
  border: 1px solid var(--bf-border);
  background: #fff;
  padding: 48px 24px;
  text-align: center;
}
.bf-cta-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}
.bf-cta-dot.tl { top: 4px; left: 4px; }
.bf-cta-dot.tr { top: 4px; right: 4px; }
.bf-cta-dot.rm { top: 50%; right: 4px; }
.bf-cta-dot.bl { bottom: 4px; left: 4px; }
.bf-cta-dot.lm { bottom: 50%; left: 4px; }
.bf-cta-dot.br { right: 4px; bottom: 4px; }
.bf-cta-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.bf-cta h2 {
  margin: 0 0 8px;
  font-family: var(--bf-sans);
  font-size: 20px;
  font-weight: 500;
  color: #111827;
}
@media (min-width: 768px) {
  .bf-cta h2 { font-size: 24px; }
}
.bf-cta p {
  margin: 0 0 32px;
  max-width: 32rem;
  color: var(--bf-text-muted);
}

/* Link columns */
.bf-footer-links {
  border: 1px solid var(--bf-border);
  border-top: none;
  padding: 32px;
  color: #4b5563;
}
.bf-footer-links-row {
  display: flex;
  flex-direction: column;
  gap: 48px;
}
@media (min-width: 1024px) {
  .bf-footer-links-row {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 32px;
  }
}
.bf-footer-brand {
  flex: 1;
}
.bf-footer-brand .bf-logo svg { height: 24px; transform: translateX(-8px); }
.bf-footer-copy {
  margin: 16px 0;
  font-size: 14px;
  color: var(--bf-text-muted);
}
.bf-footer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.bf-footer-badges img {
  height: 48px;
  width: auto;
  object-fit: contain;
}

.bf-footer-cols {
  display: flex;
  gap: 32px;
  flex: 2;
}
.bf-footer-col-group {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.bf-footer-col h3 {
  margin: 0 0 8px;
  font-family: var(--bf-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bf-primary);
}
.bf-footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--bf-mono);
}
.bf-footer-col a {
  font-size: 12px;
  color: var(--bf-text-muted);
  transition: color 0.2s ease;
}
.bf-footer-col a:hover { color: var(--bf-primary); }

/* Bottom bar */
.bf-footer-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-left: 1px solid var(--bf-border);
  border-right: 1px solid var(--bf-border);
  border-bottom: 1px solid var(--bf-border);
  padding: 8px 16px;
}
@media (min-width: 640px) {
  .bf-footer-bottom { flex-direction: row; padding: 8px 24px; }
}
.bf-footer-made {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9ca3af;
}
.bf-footer-made a {
  color: var(--bf-primary);
  text-decoration: underline;
  transition: all 0.2s ease;
}
.bf-footer-made a:hover { text-decoration: none; }
.bf-footer-awards {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bf-footer-award {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 160px;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--bf-border);
}
.bf-footer-award img { height: 24px; width: auto; }
