/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  isolation: isolate;
  top: 0;
  z-index: 20;
  padding-top: env(safe-area-inset-top, 0px);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}

/* The brand line: a 1px orange → red → teal thread under the top bar. */
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: var(--brand-line);
  opacity: 0.55;
}

.topbar__in {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--s-3) var(--gutter);
  display: flex;
  align-items: center;
  gap: var(--s-6);
  min-height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
  flex-shrink: 0;
}

.brand .brand-mark { width: 26px; height: 26px; }

.wordmark {
  font-family: var(--display);
  font-weight: 800;
  font-size: var(--t-md);
  line-height: 1;
  white-space: nowrap;
}

/* Brand wordmark: Termina caps, "MM" heavy, "INTELLIGENCE" light. */
.wordmark { font-family: var(--display); text-transform: uppercase; letter-spacing: 0.04em; }
.wordmark span { font-weight: 300; color: var(--ink); opacity: 0.86; }

.tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
}

.tabs::-webkit-scrollbar { display: none; }

.tabs a {
  position: relative;
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px !important;
  padding: 8px 11px;
  border-radius: var(--r-pill);
  color: var(--dim);
  font-weight: 500;
  font-size: var(--t-sm);
  white-space: nowrap;
  text-decoration: none;
  transition: color var(--dur-quick), background-color var(--dur-quick);
}

.tabs a:hover { color: var(--ink); }

.tabs a[aria-current="page"] {
  color: var(--ink);
  background: var(--panel-2);
}

.topbar__end {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-left: auto;
  flex-shrink: 0;
}

.me {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--dim);
  font-size: var(--t-sm);
}

/* ---------- page ---------- */
.page {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--s-10) var(--gutter) calc(var(--s-16) + env(safe-area-inset-bottom, 0px));
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: var(--s-6);
  flex-wrap: wrap;
  margin-bottom: var(--s-8);
}

.page-head h1 {
  font-size: var(--t-4xl);
  font-weight: 800;
  max-width: 22ch;
}

.page-head p {
  margin-top: var(--s-3);
  color: var(--dim);
  max-width: 60ch;
}

.section { margin-top: var(--s-10); }

.section-head {
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin-bottom: var(--s-4);
}

.section-head h2 { font-size: var(--t-xl); }
.section-head .count { color: var(--faint); font-size: var(--t-sm); }

@media (max-width: 720px) {
  .topbar__in { flex-wrap: wrap; gap: var(--s-2) var(--s-4); padding-block: 10px; }
  .tabs { order: 3; flex-basis: 100%; margin-inline: -6px; }
  .page { padding-top: var(--s-8); }
  .me__name { display: none; }
}

@media (max-width: 480px) {
  .me { display: none; }
  .ideas-link { padding-inline: 10px; }
  .ideas-link__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* Faint oversized title behind page headings, like the brand deck. */
.page-head h1[data-ghost] { position: relative; margin-top: var(--s-10); }
.page-head h1[data-ghost]::before {
  content: attr(data-ghost);
  position: absolute;
  left: -0.02em;
  top: -0.92em;
  z-index: -1;
  font-size: 1.05em;
  font-weight: 900;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px rgb(144 177 187 / 0.16);
  pointer-events: none;
}

/* Brand wireframe illustration, faint, top right of each page. Drawn as a
   mask so it takes the brand colour regardless of the file's own fill. */
.page { position: relative; isolation: isolate; overflow-x: clip; }
.page-illus {
  position: absolute;
  z-index: -1;
  top: -40px;
  right: -60px;
  width: min(440px, 46vw);
  aspect-ratio: 1;
  background: var(--cosmic);
  opacity: 0.09;
  pointer-events: none;
  -webkit-mask: var(--illus) center / contain no-repeat;
  mask: var(--illus) center / contain no-repeat;
}
.page-illus--rocket { --illus: url("/assets/brand/illustrations/MM_WIREFRAME_ROCKET-312f36ca.svg"); }
.page-illus--satellite { --illus: url("/assets/brand/illustrations/MM_WIREFRAME_SATELLITE-48cad67d.svg"); }
.page-illus--planet { --illus: url("/assets/brand/illustrations/MM_WIREFRAME_PLANET_RING-573355fe.svg"); }
.page-illus--microphone { --illus: url("/assets/brand/illustrations/MM_WIREFRAME_MICROPHONE-66533c2a.svg"); }
.page-illus--saucer { --illus: url("/assets/brand/illustrations/MM_WIREFRAME_FLYING_SAUCER-fe23d21d.svg"); }
.page-illus--comet { --illus: url("/assets/brand/illustrations/MM_WIREFRAME_COMET-a14d4742.svg"); }
.page-illus--moon { --illus: url("/assets/brand/illustrations/MM_WIREFRAME_MOON-03c6498f.svg"); }
.page-illus--starburst { --illus: url("/assets/brand/illustrations/MM_WIREFRAME_STARBURST-d57510b1.svg"); }
@media (max-width: 720px) { .page-illus { top: -20px; right: -90px; width: 260px; } }

/* Arriving in the portal after the sign-in fly-in. */
body.arriving .topbar, body.arriving .page {
  animation: arrive 900ms var(--ease-out) both;
}
body.arriving .page { animation-delay: 80ms; }
@keyframes arrive {
  from { opacity: 0; transform: scale(1.04); filter: blur(8px); }
}

.tab-count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 9px;
  background: var(--solar);
  color: var(--dark-matter);
  font-size: 11px;
  font-weight: 700;
}
