/* Moose Matrix design tokens: copied from moosematrix.com (packages/ui/src/styles.css).
   Light is the default; dark applies via the OS preference or <html data-theme="dark">. Copy of m2 src/styles/tokens.css; keep in sync with
   m2.moosematrix.com and /workspace/design/moosematrix-tokens.md. */
:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --surface-2: #f1f0ec;
  --fg: #0b1f35;
  --muted: rgba(11, 31, 53, 0.72);
  --border: rgba(11, 31, 53, 0.14);
  --border-strong: rgba(11, 31, 53, 0.42);
  --shadow-sm: 0 8px 24px rgba(11, 31, 53, 0.08);
  --shadow: 0 18px 56px rgba(11, 31, 53, 0.14);
  --accent: #0b5ed7;
  --accent-2: #084bb0;
  --on-accent: #ffffff;
  --ring: rgba(11, 94, 215, 0.35);
  --glow: rgba(11, 94, 215, 0.10);
  --good: #047857;
  --warn: #92400e;
  --warn-bg: rgba(180, 83, 9, 0.08);
  --warn-border: rgba(180, 83, 9, 0.35);
  --good-border: rgba(4, 120, 87, 0.35);
  --c-member: #2563eb;
  --c-service: #059669;
  --c-growth: #7c3aed;
  --radius: 18px;
  --radius-btn: 14px;
  --font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --header-h: 76px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #070b13;
  --surface: #0b1220;
  --surface-2: #0f172a;
  --fg: #e5e7eb;
  --muted: rgba(229, 231, 235, 0.74);
  --border: rgba(229, 231, 235, 0.14);
  --border-strong: rgba(229, 231, 235, 0.40);
  --shadow-sm: 0 12px 30px rgba(0, 0, 0, 0.44);
  --shadow: 0 22px 64px rgba(0, 0, 0, 0.60);
  --accent: #60a5fa;
  --accent-2: #93c5fd;
  --on-accent: #070b13;
  --ring: rgba(96, 165, 250, 0.35);
  --glow: rgba(96, 165, 250, 0.12);
  --good: #34d399;
  --warn: #fbbf24;
  --warn-bg: rgba(251, 191, 36, 0.07);
  --warn-border: rgba(251, 191, 36, 0.35);
  --good-border: rgba(52, 211, 153, 0.35);
  --c-member: #60a5fa;
  --c-service: #34d399;
  --c-growth: #a78bfa;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #070b13;
    --surface: #0b1220;
    --surface-2: #0f172a;
    --fg: #e5e7eb;
    --muted: rgba(229, 231, 235, 0.74);
    --border: rgba(229, 231, 235, 0.14);
    --border-strong: rgba(229, 231, 235, 0.40);
    --shadow-sm: 0 12px 30px rgba(0, 0, 0, 0.44);
    --shadow: 0 22px 64px rgba(0, 0, 0, 0.60);
    --accent: #60a5fa;
    --accent-2: #93c5fd;
    --on-accent: #070b13;
    --ring: rgba(96, 165, 250, 0.35);
    --glow: rgba(96, 165, 250, 0.12);
    --good: #34d399;
    --warn: #fbbf24;
    --warn-bg: rgba(251, 191, 36, 0.07);
    --warn-border: rgba(251, 191, 36, 0.35);
    --good-border: rgba(52, 211, 153, 0.35);
    --c-member: #60a5fa;
    --c-service: #34d399;
    --c-growth: #a78bfa;
    color-scheme: dark;
  }
}

/* ---------- Shared base + chrome (identical on m2 and merch) ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--bg);
  color: var(--fg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.625;
  -webkit-font-smoothing: antialiased;
  background: radial-gradient(900px 440px at 50% -10%, var(--glow), transparent 60%) no-repeat, var(--bg);
}
img, svg { max-width: 100%; }
img { height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-2); }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 10px; }
main:focus { outline: none; }
.mono { font-family: var(--font-mono); }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 640px) { .wrap { padding: 0 1.5rem; } }

.skip-link { position: absolute; left: 1rem; top: -100px; z-index: 100; background: var(--surface); color: var(--fg); border: 1px solid var(--border); border-radius: 12px; padding: 0.7rem 1rem; box-shadow: var(--shadow); font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 0.75rem; }

/* Header: sticky, translucent surface + blur, mono uppercase wordmark (moosematrix.com NavbarStatic) */
.site-header { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 72%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.header-inner { display: flex; align-items: center; gap: 0.75rem 1rem; min-height: var(--header-h); flex-wrap: wrap; padding-top: 0.5rem; padding-bottom: 0.5rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; min-height: 44px; color: var(--fg); text-decoration: none; margin-right: auto; }
.brand:hover { color: var(--fg); }
.brand img { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); }
.brand span { font-family: var(--font-mono); font-weight: 600; text-transform: uppercase; letter-spacing: 0.30em; font-size: 14px; }
@media (min-width: 768px) { .brand span { font-size: 16px; } }
.nav { display: flex; gap: 0.25rem; order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; margin: 0 -0.25rem; padding: 0 0.25rem; }
.nav::-webkit-scrollbar { display: none; }
.nav a { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.85rem; border-radius: 999px; border: 1px solid transparent; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease; }
.nav a:hover { color: var(--fg); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--fg); border-color: var(--border); background: var(--surface); box-shadow: var(--shadow-sm); }
@media (min-width: 900px) { .nav { order: 0; width: auto; overflow: visible; margin: 0; padding: 0; } }

/* Theme toggle: segmented System / Light / Dark (moosematrix.com footer chips) */
.theme-toggle { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: 999px; background: color-mix(in srgb, var(--surface) 88%, transparent); }
.theme-toggle button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; min-height: 44px; padding: 0 0.7rem; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-family: var(--font-mono); font-size: 12px; font-weight: 700; cursor: pointer; transition: background-color 140ms ease, color 140ms ease; }
.theme-toggle button:hover { color: var(--fg); background: var(--surface-2); }
.theme-toggle button[aria-pressed="true"] { color: var(--fg); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.theme-toggle svg { width: 16px; height: 16px; flex: none; }
.theme-toggle .tt-label { display: none; }
@media (min-width: 1100px) { .theme-toggle .tt-label { display: inline; } }

/* Footer: surface band, 3 columns, mono uppercase labels (moosematrix.com FooterStatic) */
.site-footer { margin-top: 4rem; border-top: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 14px; }
.footer-grid { display: grid; gap: 2rem; padding-top: 3rem; padding-bottom: 2rem; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; gap: 2.5rem; } }
.site-footer .label { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.22em; color: var(--muted); margin-bottom: 0.75rem; }
.site-footer p { margin: 0 0 0.6rem; max-width: 40rem; }
.site-footer .disclaimer { color: var(--fg); font-weight: 600; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; }
.site-footer li a { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 44px; font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.18em; color: var(--muted); text-decoration: none; }
.site-footer li a:hover { color: var(--fg); text-decoration: underline; }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 1.25rem; padding-bottom: 2rem; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; }

/* Shared primitives */
.eyebrow { display: inline-flex; align-items: center; font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 88%, transparent); border-radius: 999px; padding: 0.35rem 0.85rem; margin-bottom: 1rem; }
h1, h2, h3 { color: var(--fg); font-weight: 600; text-wrap: balance; }
h1 { font-size: clamp(1.875rem, 1.2rem + 3vw, 3rem); line-height: 1.1; letter-spacing: -0.025em; margin: 0 0 0.75rem; }
h2 { font-size: clamp(1.35rem, 1.1rem + 1.2vw, 1.75rem); line-height: 1.25; letter-spacing: -0.015em; margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.125rem; line-height: 1.35; margin: 0 0 0.4rem; }
.lead { color: var(--muted); font-size: clamp(1rem, 0.95rem + 0.4vw, 1.125rem); max-width: 42rem; margin: 0 0 1.5rem; text-wrap: pretty; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 1.25rem; }
@media (min-width: 640px) { .card { padding: 1.5rem; } }
a.card { display: block; color: var(--fg); text-decoration: none; transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease; }
a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 22%, var(--border)); color: var(--fg); }
.card p { margin: 0.25rem 0 0; color: var(--muted); font-size: 15px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--muted); font-size: 12px; font-weight: 700; }
.chip.soon { color: var(--warn); border-color: var(--warn-border); }
.chip.live { color: var(--good); border-color: var(--good-border); }
.card .chip { margin-bottom: 0.65rem; }
.btns { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 48px; padding: 0 1.15rem; border-radius: var(--radius-btn); border: 1px solid var(--border); background: transparent; color: var(--fg); font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; box-shadow: var(--shadow-sm); transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease; }
.btn:hover { background: var(--surface-2); color: var(--fg); box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.btn.primary:hover { background: var(--accent-2); color: var(--on-accent); }
@media (max-width: 479px) { .btns .btn { flex: 1 1 100%; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  a.card:hover, .btn:active { transform: none; }
}

/* Small phones: fit all five nav items without horizontal scrolling */
@media (max-width: 479px) { .nav { gap: 0; justify-content: space-between; } .nav a { padding: 0 0.55rem; } }
@media (max-width: 399px) { .nav a[href="/"] { display: none; } } /* the wordmark already links home */

/* ---------- Moose Merch page ---------- */
main { flex: 1; padding: 2.5rem 0 1rem; }
@media (min-width: 640px) { main { padding-top: 3.5rem; } }
.nav { order: 0; width: auto; overflow: visible; margin: 0; padding: 0; }
@media (max-width: 559px) { .nav { order: 3; width: 100%; } }
.hero { display: grid; gap: 1.5rem 2.5rem; align-items: center; grid-template-columns: 1fr; margin-bottom: 3rem; }
@media (min-width: 820px) { .hero { grid-template-columns: 1fr auto; } }
.hero .logo { width: 128px; height: 128px; border-radius: 1.5rem; border: 1px solid var(--border); box-shadow: var(--shadow); object-fit: cover; }
@media (min-width: 820px) { .hero .logo { width: 200px; height: 200px; order: 2; } }
.hero-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1.5rem; padding: 0; list-style: none; }
.section-label { font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); margin: 0 0 1rem; }
.products .grid { list-style: none; margin: 0; padding: 0; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); }
@media (max-width: 559px) { .products .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; } }
.item { display: flex; flex-direction: column; align-items: flex-start; padding: 1rem; transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease; }
.item:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 22%, var(--border)); }
.art { width: 100%; aspect-ratio: 1 / 1; border-radius: 14px; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; margin-bottom: 0.9rem; background: radial-gradient(circle at 50% 40%, var(--art-bg-1) 0%, var(--art-bg-2) 70%); }
.art svg { width: 78%; height: 78%; }
.item-title { font-size: 1.05rem; line-height: 1.3; letter-spacing: 0; margin: 0 0 0.5rem; }
.item .chip { margin-bottom: 0.5rem; }
.price { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 559px) { .item { padding: 0.75rem; } .item-title { font-size: 0.95rem; } }
.note { margin-top: 1.5rem; color: var(--muted); font-size: 14px; max-width: 42rem; }

/* Product art: recolor the SVG presentation attributes per theme (CSS beats presentation attributes). */
:root { --art-bg-1: #e3ecfb; --art-bg-2: #f1f0ec; --art-fill: #cfe0fb; --art-fill-2: #0b5ed7; --art-dark: #ffffff; --art-stroke: #0b5ed7; --art-hi: #084bb0; --art-ink: #0b1f35; }
:root[data-theme="dark"] { --art-bg-1: #12284a; --art-bg-2: #0a1324; --art-fill: #1e3a66; --art-fill-2: #0b5ed7; --art-dark: #0a1324; --art-stroke: #60a5fa; --art-hi: #93c5fd; --art-ink: #e5e7eb; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) { --art-bg-1: #12284a; --art-bg-2: #0a1324; --art-fill: #1e3a66; --art-fill-2: #0b5ed7; --art-dark: #0a1324; --art-stroke: #60a5fa; --art-hi: #93c5fd; --art-ink: #e5e7eb; } }
.art [fill="#1e3a66"] { fill: var(--art-fill); }
.art [fill="#0b5ed7"] { fill: var(--art-fill-2); }
.art [fill="#0f172a"], .art [fill="#0a1324"] { fill: var(--art-dark); }
.art [fill="#93c5fd"] { fill: var(--art-hi); }
.art [stroke="#60a5fa"] { stroke: var(--art-stroke); }
.art [stroke="#93c5fd"] { stroke: var(--art-hi); }
.art [stroke="#e5e7eb"] { stroke: var(--art-ink); }
@media (prefers-reduced-motion: reduce) { .item:hover { transform: none; } }
/* merch has only three nav items: keep "Shop" visible and left-aligned on small phones */
@media (max-width: 479px) { .nav { justify-content: flex-start; gap: 0.25rem; } .nav a[href="/"] { display: inline-flex; } }
picture { display: inline-flex; flex: none; }
@media (min-width: 820px) { .hero picture { order: 2; } }
