/* M Share • Pro — 2025 global styles */
:root {
  /* Site-wide background base */
  --bg: #B0B0CD;
  --surface: #0b1220;
  --elev: #101827;
  --b: #1f2937;
  --fg: #e5e7eb;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-2: #22c55e;
  --accent-3: #f472b6;
  --warn: #fbbf24;
  --ok: #86efac;
  --err: #fca5a5;
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-1: 0 10px 30px rgba(0, 0, 0, .35);
  --shadow-2: 0 6px 18px rgba(0, 0, 0, .25);
  /* (keep duplicates from your original to avoid regressions) */
  --b: rgba(148, 163, 184, .30);
  --shadow-1: 0 10px 30px rgba(2, 6, 23, .22);
  --muted: #94a3b8;
}

* {
  box-sizing: border-box
}

html,
body {
  height: 100%
}

body {
  margin: 0;
  /* Remove decorative gradients so the requested background shows consistently */
  background: var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Inter", "Segoe UI", Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.45;
}

/* Prevent background scroll when mobile nav overlay is open */
body.nav-open {
  overflow: hidden;
}

/* Focus mode: immersive, responsive dark canvas */
body.focus-mode {
  background: radial-gradient(1200px 800px at 20% 15%, rgba(15, 23, 42, .92), rgba(2, 6, 23, 1)) !important;
  min-height: 100vh;
}

/* Hide header/footer and non-session cards in focus mode for immersion */
body.focus-mode header.site-header,
body.focus-mode .footer-2025,
body.focus-mode .site-footer,
body.focus-mode #footer2025,
body.focus-mode .stage-nav {
  display: none !important;
}

/* Expand the session card into a framed canvas */
body.focus-mode main.container {
  max-width: none;
  padding: clamp(8px, 2vw, 18px);
}

body.focus-mode .card.session {
  width: 100%;
  min-height: calc(100vh - clamp(8px, 2vw, 18px) * 2);
  background: linear-gradient(180deg, rgba(8, 13, 22, .95), rgba(8, 13, 22, .92));
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: clamp(14px, 2.4vw, 28px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, .35);
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: clamp(14px, 2.4vw, 24px);
}

/* Place orb area centrally with generous scaling */
body.focus-mode .orb-wrap {
  width: min(94vw, 560px);
  margin: 0 auto;
}

/* On wide screens, give the orb breathing room to the left */
@media (min-width: 1200px) {
  body.focus-mode .card.session {
    grid-template-columns: 1.1fr 1fr;
    grid-template-rows: auto 1fr auto;
    align-items: center;
  }

  body.focus-mode .card.session h2 {
    grid-column: 1 / -1;
  }

  body.focus-mode .orb-wrap {
    justify-self: start;
  }

  body.focus-mode .card.session .btn-row {
    grid-column: 1 / 2;
  }
}

/* Keep setup/done hidden in focus mode */
body.focus-mode .card.setup,
body.focus-mode #done {
  display: none !important;
}

/* Hard override to ensure every page uses the requested background even if inline theme blocks set their own */
html,
body {
  background: #B0B0CD !important;
}

/* Force header/footer/menu text to white site‑wide */
header.site-header,
header.site-header *,
.footer-2025,
.footer-2025 *,
nav.main-nav,
nav.main-nav *,
.submenu,
.submenu * {
  color: #ffffff !important;
}

/* Ensure submenu and header backgrounds remain readable against white text */
.site-header {
  background: rgba(8, 12, 24, .75);
}

.main-nav>a,
.menu-toggle {
  background: rgba(8, 12, 24, .95);
  border-color: rgba(255, 255, 255, .18);
}

.submenu {
  background: rgba(10, 14, 24, .98);
  border-color: rgba(255, 255, 255, .18);
}

.footer-2025 {
  background: rgba(8, 12, 24, .85);
  border-top-color: rgba(255, 255, 255, .18);
}

a {
  color: var(--accent);
  text-decoration: none
}

a:hover {
  text-decoration: underline
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px
}

.card {
  background: linear-gradient(180deg, var(--surface), #0a1020);
  border: 1px solid var(--b);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-1);
}

.card+.card {
  margin-top: 16px
}

.grid {
  display: grid;
  gap: 12px
}

@media(min-width:860px) {
  .grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }
}

@media(min-width:1080px) {
  .grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr))
  }
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: .2rem 0 .4rem
}

.muted {
  color: var(--muted)
}

/* Header / Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(160%) blur(8px);
  background: linear-gradient(180deg, rgba(11, 18, 32, .86), rgba(11, 18, 32, .72));
  border-bottom: 1px solid rgba(31, 41, 55, .65);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: .2px;
  color: var(--fg);
  text-decoration: none;
  padding: 10px 0
}

.brand .logo {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent) 0%, #60a5fa 100%);
  color: #00131f;
  font-weight: 900;
  box-shadow: 0 4px 14px rgba(56, 189, 248, .45)
}

.main-nav {
  display: flex;
  gap: 6px;
  align-items: center;
  position: relative
}

.main-nav a,
.main-nav button {
  appearance: none;
  border: 1px solid var(--b);
  background: #0a1020;
  color: var(--fg);
  padding: 8px 12px;
  border-radius: 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px
}

.main-nav a[aria-current="page"] {
  outline: 2px solid var(--accent);
  outline-offset: 2px
}

.main-nav a:hover,
.main-nav button:hover {
  background: #0e1628
}

.main-nav .icon {
  font-size: 16px;
  line-height: 1
}

.nav-toggle {
  display: none
}

@media(max-width:760px) {
  .main-nav {
    display: none;
    position: absolute;
    right: 20px;
    top: 64px;
    flex-direction: column;
    background: var(--surface);
    padding: 10px;
    border: 1px solid var(--b);
    border-radius: 14px;
    box-shadow: var(--shadow-2);
    width: min(96vw, 360px)
  }

  .main-nav.open {
    display: flex
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--b);
    background: #0a1020;
    color: var(--fg)
  }
}

/* Buttons */
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--b);
  background: #0a1020;
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--fg);
  text-decoration: none;
  cursor: pointer
}

.btn:hover {
  background: #0e1628
}

.btn-primary {
  background: linear-gradient(180deg, #0f2a35, #0b2230);
  border-color: #1b3344
}

.btn-success {
  border-color: #234a3a;
  background: linear-gradient(180deg, #0e2a1b, #0a2216)
}

.btn-danger {
  border-color: #4b1b1b;
  background: linear-gradient(180deg, #2a0f0f, #1c0a0a)
}

/* Utilities */
.badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: #0a1020;
  border: 1px solid var(--b);
  margin: 4px 6px 0 0;
  font-size: .9rem
}

.canvas-wrap {
  width: 100%;
  height: 180px;
  border: 1px solid var(--b);
  border-radius: 12px;
  background: #0a1020;
  display: grid;
  place-items: center;
  overflow: hidden
}

.kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px
}

@media(max-width:760px) {
  .kv-grid {
    grid-template-columns: 1fr
  }
}

.kv {
  padding: 12px;
  border: 1px solid var(--b);
  border-radius: 12px;
  background: #0a1020
}

.apps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px
}

.app-btn {
  cursor: pointer;
  display: inline-flex;
  margin: 10px 8px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--b);
  background: #0a1020;
  color: var(--fg);
  text-decoration: none
}

.ok {
  color: var(--ok)
}

.err {
  color: var(--err)
}

.warn {
  color: var(--warn)
}

/* Share sheet */
.sheet {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: end center;
  background: rgba(3, 8, 18, .6);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease
}

.sheet.open {
  opacity: 1;
  pointer-events: auto
}

.sheet-card {
  width: min(740px, 96vw);
  background: var(--surface);
  border: 1px solid var(--b);
  border-radius: 18px 18px 0 0;
  box-shadow: var(--shadow-1);
  transform: translateY(18px);
  animation: slideUp .22s ease forwards;
  padding: 16px
}

@keyframes slideUp {
  from {
    transform: translateY(18px)
  }

  to {
    transform: translateY(0)
  }
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px
}

.sheet-title {
  margin: 0;
  font-size: 1.2rem
}

.sheet-close {
  border: none;
  background: transparent;
  color: var(--fg);
  font-size: 24px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px
}

.sheet-close:hover {
  background: #0e1628
}

.share-text {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  font-family: ui-monospace, Menlo, "SF Mono", Consolas, monospace;
  font-size: 14px;
  line-height: 1.5;
  padding: 10px;
  background: #0a1020;
  color: var(--fg);
  border: 1px solid var(--b);
  border-radius: 12px
}

.share-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap
}

/* Footer */
.footer {
  margin: 18px 0;
  font-size: .9rem;
  color: var(--muted)
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 8px
}

.hidden {
  display: none !important
}

/* ========== Mega‑menu header (new) ========== */
.nav-group {
  position: relative
}

.nav-button {
  appearance: none;
  border: 1px solid var(--b);
  background: #0a1020;
  color: var(--fg);
  padding: 8px 12px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer
}

.nav-button::after {
  content: "▾";
  font-size: 12px;
  margin-left: 6px;
  opacity: .9;
  transform-origin: center;
  transition: transform .18s ease;
}

.nav-group.open .nav-button::after {
  transform: rotate(180deg);
}

.menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 1000;
  background: var(--surface);
  border: 1px solid var(--b);
  border-radius: 14px;
  box-shadow: var(--shadow-2);
  padding: 10px;
  min-width: 260px;
  max-width: 80vw;
}

.nav-group.open>.menu {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.menu-wide {
  grid-template-columns: repeat(2, minmax(160px, 1fr));
}

.menu-col {
  min-width: 180px
}

.menu-title {
  margin: .1rem 0 .25rem;
  font-size: .78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em
}

.menu a {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: var(--fg);
  text-decoration: none
}

.menu a:hover {
  background: #0e1628;
  border-color: var(--b);
  text-decoration: none
}

/* Mobile behaviour */
@media(max-width:760px) {
  .menu {
    position: static;
    display: none;
    background: transparent;
    border: none;
    border-top: 1px solid var(--b);
    padding: 8px 0 0;
    box-shadow: none;
    min-width: auto;
  }

  .nav-group.open>.menu {
    display: grid;
    grid-template-columns: 1fr;
  }

  .menu-wide {
    grid-template-columns: 1fr
  }
}


/* Dropdown menus */
.menu-group {
  position: relative
}

.menu-toggle {
  appearance: none;
  border: 1px solid var(--b);
  background: #0a1020;
  color: var(--fg);
  padding: 8px 12px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer
}

.menu-toggle[aria-expanded="true"] {
  outline: 2px solid var(--accent);
  outline-offset: 2px
}

.submenu {
  display: none;
  position: absolute;
  top: 110%;
  left: 0;
  min-width: 220px;
  background: #0a1020;
  border: 1px solid var(--b);
  border-radius: 14px;
  box-shadow: var(--shadow-2);
  padding: 8px;
  z-index: 60
}

.menu-group.open>.submenu {
  display: block
}

.submenu a {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--fg)
}

.submenu a:hover {
  background: #0e1628
}

.submenu .menu-label {
  font-size: 12px;
  color: var(--muted);
  padding: 6px 10px 4px
}

@media(max-width:760px) {
  .menu-group {
    width: 100%
  }

  .submenu {
    position: static;
    display: none;
    border-radius: 12px;
    margin: 6px 0
  }

  .menu-group.open>.submenu {
    display: block
  }
}

details.accordion {
  border: 1px solid var(--b);
  border-radius: 12px;
  padding: 10px;
  background: #0a1020
}

details.accordion summary {
  cursor: pointer;
  list-style: none
}

details.accordion .content {
  margin-top: 8px
}

/* ========== Responsive polish for cards/sections/typography ========== */
@media (max-width: 680px) {
  .container {
    padding: 14px;
  }

  .card {
    padding: 14px;
    border-radius: var(--radius-md);
  }

  .grid {
    gap: 10px;
  }

  .actions {
    gap: 8px;
  }

  .canvas-wrap {
    height: 150px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: clamp(1.4rem, 5.5vw, 1.8rem);
  }

  h2 {
    font-size: clamp(1.1rem, 4.8vw, 1.4rem);
  }

  h3 {
    font-size: clamp(1rem, 4.4vw, 1.2rem);
  }

  .card {
    padding: 12px;
    border-radius: var(--radius-sm);
  }

  .actions {
    gap: 6px;
  }

  .badge {
    font-size: 0.85rem;
  }

  .canvas-wrap {
    height: 135px;
  }
}

/* Optional helpers if pages use header/footer regions inside cards */
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

/* --- Global override: make all H1 headings black site-wide --- */
h1 {
  color: #000 !important;
}
