/* ---- Alira Kids: Header (Topbar) ---- */
/* --- Topbar polish: transparent over hero, glass on scroll --- */
.topbar{
  position: sticky; top: 0; z-index: 60;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  gap: .75rem;
  padding: .6rem 1.0rem;
  background: transparent;                /* blends with dark hero */
  border-bottom: 1px solid transparent;
  transition: background .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.topbar.scrolled{
  background: rgba(10,16,34,.72);         /* subtle “glass” */
  backdrop-filter: blur(12px);
  border-bottom-color: rgba(255,255,255,.06);
  box-shadow: 0 8px 24px -18px rgba(0,0,0,.6);
}

/* brand */
.topbar .brand{
  display: inline-flex; align-items: center; gap: .5rem;
  text-decoration: none; font-weight: 800; letter-spacing: .2px;
  color: #e5e7eb;
}
.topbar .brand-mark{ display:block; border-radius: 6px; }

/* existing controls */
.topbar .menu-btn{ background: transparent; border: 0; color: #e5e7eb; font-size: 1.2rem; }
.topbar .topnav{ display:flex; align-items:center; gap:.75rem; }
.topbar .navlink{ color:#cbd5e1; text-decoration:none; font-weight:600; padding:.3rem .5rem; border-radius:.5rem; }
.topbar .navlink:hover{ color:#fff; background: rgba(255,255,255,.06); }
.topbar .navlink.active{ color:#fff; background: rgba(99,102,241,.15); }
.topbar .usage{ color:#94a3b8; margin-right:.25rem; }
.topbar .badge{ background:#334155; color:#e2e8f0; font-weight:700; padding:.15rem .4rem; border-radius:.4rem; }

/* make room on small screens */
@media (max-width: 700px){
  .topbar{ grid-template-columns: auto 1fr auto; }
  .topbar .usage{ display:none; }
}


/* --- Header blend + glass-on-scroll --- */
.app-shell .topbar{
  position: sticky; top:0; z-index:60;
  display:grid; grid-template-columns:auto 1fr auto; align-items:center;
  gap:.75rem; padding:.6rem 1rem;
  background: transparent !important;            /* fixes the white strip */
  border-bottom: 1px solid transparent !important;
  transition: background .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.app-shell .topbar.scrolled{
  background: rgba(10,16,34,.72) !important;     /* subtle glass over dark hero */
  backdrop-filter: blur(12px);
  border-bottom-color: rgba(255,255,255,.06);
  box-shadow: 0 8px 24px -18px rgba(0,0,0,.6);
}

/* brand + links readable on dark */
.app-shell .topbar .brand,
.app-shell .topbar .navlink,
.app-shell .topbar .usage { color:#e5e7eb; }

.app-shell .topbar .navlink:hover{ color:#fff; background:rgba(255,255,255,.06); border-radius:.5rem; }
.app-shell .topbar .navlink.active{ color:#fff; background:rgba(99,102,241,.15); }

/* hamburger visibility on light vs dark */
.app-shell .topbar .menu-btn{
  background:transparent; border:0; font-size:1.2rem;
  color:#e5e7eb; text-shadow:0 1px 2px rgba(0,0,0,.35);
}
.app-shell .topbar.scrolled .menu-btn{ color:#f1f5f9; }


.app-shell .topbar .brand-mark{
  width:28px; height:28px; object-fit:contain; display:block;
  border-radius:6px;
  image-rendering:auto;           /* keep it smooth on DPR>1 */
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.25));
}
/* optional: tuck the text color for the dark hero */
.app-shell .topbar .brand span{ color:#e5e7eb; font-weight:800; letter-spacing:.2px; }
.hero{ padding-top: calc(clamp(2rem, 5vw, 5rem) + 16px); }

/* === HOTFIX: Topbar === */
.app-shell .topbar{
  position: sticky; top:0; z-index:60;
  display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:.75rem;
  padding:.6rem 1rem;
  /* Force dark glass even at top so we don't see the page's white background */
  background: rgba(10,16,34,.78) !important;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.06) !important;
  box-shadow: 0 8px 24px -18px rgba(0,0,0,.6);
}

/* Make text and buttons readable on dark */
.app-shell .topbar .brand span,
.app-shell .topbar .navlink,
.app-shell .topbar .usage,
.app-shell .topbar .badge,
.app-shell .topbar .menu-btn { color: #e5e7eb !important; }

.app-shell .topbar .navlink:hover{ color:#fff !important; background:rgba(255,255,255,.08); border-radius:.5rem; }
.app-shell .topbar .navlink.active{ color:#fff !important; background:rgba(99,102,241,.18); }

/* Hamburger always visible */
.app-shell .topbar .menu-btn{
  background: transparent; border: 0; font-size: 1.25rem;
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
}

/* Header background spans full width, but content aligns to page width */
.topbar{
  position: sticky; top:0; z-index:60;
  background: rgba(10,16,34,.78);         /* dark glass */
  backdrop-filter: blur(12px);
  border: 0;                               /* remove the white “line” */
  box-shadow: none;                        /* remove any separator look */
  padding: 0;                              /* padding now lives on .tb-wrap */
}

/* This centers header contents and matches your page max width */
.topbar .tb-wrap{
  max-width: 1120px;                       /* match your home page container */
  margin: 0 auto;
  padding: .6rem 1rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .75rem;
}

/* Kill the visual gap between header and hero */
.hero{ 
  margin-top: 0;                           /* ensure no top margin */
  padding-top: clamp(2rem, 5vw, 5rem);     /* your hero spacing */
}
.hero h1{ margin-top: 0; }                 /* prevent margin-collapsing */

/* 1) Remove any separator created by borders/shadows/margins */
.topbar{
  border-bottom: 0 !important;
  box-shadow: none !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* 2) Ensure the first section (hero) starts flush with the header */
.app-shell > .topbar + *{
  margin-top: 0 !important;      /* kills default top margin on the next block */
  border-top: 0 !important;      /* in case a 1px hairline sneaked in */
  padding-top: 0;                 /* keep hero’s own padding controlling spacing */
}

/* 3) Make sure the hero itself isn’t adding a visible light band */
.hero{
  margin-top: 0 !important;
  border-top: 0 !important;
  /* safety overlap: pull hero up by 1px to cover any remaining hairline */
  transform: translateY(-1px);
}

/* 4) If any global container adds a top padding, neutralize just under the header */
.app-shell > .topbar + .container,
.app-shell > .topbar + main,
.topbar + section{
  padding-top: 0 !important;
}
/* Seam hider: softly overlaps the content below the header */
.topbar{
  position: sticky; top:0; z-index:60;
  background: rgba(10,16,34,.78);
  backdrop-filter: blur(12px);
  /* existing padding/grid rules unchanged */
  will-change: transform;            /* encourages crisp compositing */
  transform: translateZ(0);          /* fixes Safari/WebKit hairlines */
}
.topbar::after{
  content:"";
  position: absolute;
  left: 0; right: 0; bottom: -1px;   /* sit just below the header box */
  height: 10px;
  background: linear-gradient(180deg, rgba(10,16,34,.78), rgba(10,16,34,0));
  pointer-events: none;
}


/* Theme tokens */
:root {
  --ak-bg: #0b1020;                 /* page bg */
  --ak-glass: rgba(10,16,34,.78);   /* header glass */
  --ak-ink: #e5e7eb;                /* text on dark */
  --ak-ink-muted: #cbd5e1;
  --ak-border: rgba(255,255,255,.06);
}

/* Header background spans full width; content constrained by .tb-wrap */
.app-shell .topbar{
  position: sticky; top:0; z-index:60;
  background: var(--ak-glass);
  backdrop-filter: blur(12px);
  margin: 0; border: 0; box-shadow: none;
  padding: 0;
  will-change: transform; transform: translateZ(0);
}
.app-shell .topbar::after{           /* seam hider */
  content:""; position:absolute; left:0; right:0; bottom:-1px; height:10px;
  background: linear-gradient(180deg, var(--ak-glass), rgba(10,16,34,0));
  pointer-events:none;
}

.app-shell .topbar .tb-wrap{
  max-width: 1120px; margin: 0 auto;
  padding: .6rem 1rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center; gap: .75rem;
}

/* Brand */
.app-shell .topbar .brand{
  display:inline-flex; align-items:center; gap:.55rem;
  text-decoration:none; font-weight:800; letter-spacing:.2px; color:var(--ak-ink);
}
.app-shell .topbar .brand-mark{
  width:28px; height:28px; object-fit:contain; display:block; border-radius:6px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.25));
}

/* Nav + controls */
.app-shell .topbar .menu-btn{
  background:transparent; border:0; font-size:1.25rem;
  color:var(--ak-ink); text-shadow:0 1px 2px rgba(0,0,0,.35);
}
.app-shell .topbar .topnav{ display:flex; align-items:center; gap:.75rem; }
.app-shell .topbar .navlink{
  color:var(--ak-ink-muted); text-decoration:none; font-weight:600;
  padding:.3rem .5rem; border-radius:.5rem;
}
.app-shell .topbar .navlink:hover{ color:#fff; background:rgba(255,255,255,.08); }
.app-shell .topbar .navlink.active{ color:#fff; background:rgba(99,102,241,.18); }
.app-shell .topbar .usage{ color:#94a3b8; }
.app-shell .topbar .badge{ background:#334155; color:#e2e8f0; font-weight:700; padding:.15rem .4rem; border-radius:.4rem; }

/* Responsive trims */
@media (max-width: 700px){
  .app-shell .topbar .usage{ display:none; }
}
html, body, .app-shell { background: #0b1020 !important; }
