/* MOSAIC alpha site — shared design system */
:root {
  --bg: #0b0f14;
  --bg-elevated: #111821;
  --panel: #151d28;
  --panel-hover: #1a2432;
  --text: #e8eef6;
  --muted: #8b9bb0;
  --faint: #5c6b7e;
  --accent: #4aa3ff;
  --accent-soft: rgba(74, 163, 255, 0.14);
  --accent-strong: #7cbcff;
  --yes: #3dd68c;
  --yes-soft: rgba(61, 214, 140, 0.12);
  --no: #f0a35a;
  --no-soft: rgba(240, 163, 90, 0.12);
  --line: #243041;
  --line-strong: #334155;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 12px;
  --radius-sm: 8px;
  --max: 1080px;
  --max-article: 820px;
  --font: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --header-h: 3.5rem;
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(74, 163, 255, 0.12), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(61, 214, 140, 0.06), transparent 50%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.02rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; height: auto; display: block; }
a {
  color: var(--accent-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { color: #a9d4ff; }

.wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Top navigation */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(11, 15, 20, 0.82);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 650;
  letter-spacing: 0.02em;
}
.brand:hover { color: var(--text); }
.brand-mark {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 0.45rem;
  background: linear-gradient(145deg, var(--accent), #1f6fb8 55%, #2f9e6a);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
  position: relative;
  flex: 0 0 auto;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 28% 18%;
  border-radius: 2px;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,0.85) 0 2px, transparent 2px 5px);
  opacity: 0.85;
}
.brand-text { font-size: 0.98rem; }
.brand-text span {
  color: var(--muted);
  font-weight: 500;
  margin-left: 0.35rem;
}
.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.15rem 0.25rem;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text);
  background: var(--accent-soft);
}

/* Hero / page headers */
.hero {
  padding: 3.2rem 0 2.4rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(21, 32, 48, 0.55), transparent 80%);
}
.hero.compact { padding: 2rem 0 1.4rem; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  margin: 0 0 0.85rem;
}
.eyebrow::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--yes);
  box-shadow: 0 0 0 4px var(--yes-soft);
}
h1 {
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0 0 0.9rem;
  font-weight: 700;
}
h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  letter-spacing: -0.02em;
  margin: 0 0 0.85rem;
  line-height: 1.25;
}
h3 {
  font-size: 1.12rem;
  margin: 1.6rem 0 0.55rem;
  letter-spacing: -0.01em;
}
.lede {
  font-size: clamp(1.05rem, 2vw, 1.22rem);
  color: var(--muted);
  max-width: 44rem;
  margin: 0;
}
.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.6rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.62rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  background: var(--panel);
  font-weight: 600;
  font-size: 0.94rem;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.btn:hover {
  background: var(--panel-hover);
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-1px);
}
.btn.primary {
  background: linear-gradient(180deg, #5aafff, var(--accent));
  border-color: transparent;
  color: #041018;
}
.btn.primary:hover {
  background: linear-gradient(180deg, #7cc0ff, #4aa3ff);
  color: #041018;
}
.btn.ghost { background: transparent; }

/* Content layout */
main.page {
  padding: 2.2rem 0 3rem;
  flex: 1;
}
section { margin: 0 0 2.75rem; }
section > p:last-child,
section > ul:last-child { margin-bottom: 0; }

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 1.1rem 0 0;
}
.card,
.grid-3 li {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  box-shadow: var(--shadow);
}
.grid-3 li { color: var(--muted); }
.grid-3 li strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 1.02rem;
  color: var(--text);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  min-width: 36rem;
}
.matrix th,
.matrix td {
  padding: 0.85rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.matrix th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 650;
  background: rgba(255,255,255,0.02);
}
.matrix tr:last-child td { border-bottom: 0; }
.matrix tbody tr:hover td { background: rgba(74, 163, 255, 0.04); }
.matrix .yes { color: var(--yes); font-weight: 700; }
.matrix .no { color: var(--no); font-weight: 700; }

.note { color: var(--muted); font-size: 0.95rem; }
.callout {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.9rem 1rem;
  color: var(--text);
  margin: 1.1rem 0;
}
.callout.warn {
  border-left-color: var(--no);
  background: var(--no-soft);
}
.callout p { margin: 0; }

/* Figures */
.figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
}
figure {
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
figure img {
  width: 100%;
  background: #000;
  border-bottom: 1px solid var(--line);
}
figcaption {
  padding: 0.75rem 0.9rem 0.9rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

/* Code */
code, kbd, samp {
  font-family: var(--mono);
  font-size: 0.9em;
}
:not(pre) > code {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.12rem 0.38rem;
  color: #d7e7ff;
}
pre {
  font-family: var(--mono);
  background: #0a1018;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  line-height: 1.5;
  font-size: 0.88rem;
  color: #d7e3f2;
  box-shadow: var(--shadow);
}
pre code {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.prose ul, .prose ol { padding-left: 1.2rem; }
.prose li + li { margin-top: 0.35rem; }
.doc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}
.download-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: 0.65rem;
}
.download-list a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  text-decoration: none;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
}
.download-list a:hover {
  border-color: var(--accent);
  background: var(--panel-hover);
}
.download-list .meta {
  color: var(--muted);
  font-size: 0.85rem;
  font-family: var(--mono);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: auto;
  padding: 1.75rem 0 2.5rem;
  background: rgba(0,0,0,0.18);
}
.site-footer .wrap { display: grid; gap: 0.55rem; }
.site-footer strong { color: var(--text); font-weight: 600; }

/* Whitepaper / article */
body.article {
  background:
    radial-gradient(900px 420px at 50% -8%, rgba(74, 163, 255, 0.1), transparent 55%),
    var(--bg);
}
article.whitepaper {
  width: min(100% - 2rem, var(--max-article));
  margin: 1.25rem auto 2.5rem;
  background: rgba(17, 24, 33, 0.72);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  padding: 2rem clamp(1rem, 3vw, 2.5rem) 2.75rem;
  box-shadow: var(--shadow);
}
article.whitepaper > header.article-head {
  border-bottom: 1px solid var(--line);
  margin: 0 0 1.75rem;
  padding-bottom: 1.25rem;
}
article.whitepaper h1 {
  font-size: clamp(1.85rem, 3.5vw, 2.45rem);
  margin-bottom: 0.4rem;
}
article.whitepaper h2 {
  margin-top: 2.4rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}
article.whitepaper h2:first-of-type {
  border-top: 0;
  margin-top: 1.4rem;
  padding-top: 0;
}
article.whitepaper h3 { color: #d5e4f7; }
article.whitepaper p,
article.whitepaper li { color: #d5deea; }
article.whitepaper p { margin: 0.85rem 0; }
article.whitepaper blockquote {
  margin: 1.1rem 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  color: var(--text);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
article.whitepaper blockquote p { margin: 0.35rem 0; }
article.whitepaper table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.1rem 0 1.4rem;
  font-size: 0.92rem;
  display: block;
  overflow-x: auto;
}
article.whitepaper th,
article.whitepaper td {
  border: 1px solid var(--line);
  padding: 0.55rem 0.7rem;
  text-align: left;
  vertical-align: top;
}
article.whitepaper th {
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
article.whitepaper img {
  margin: 1rem auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #000;
}
article.whitepaper hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}
article.whitepaper .sourceCode,
article.whitepaper pre { margin: 1rem 0; }

header#title-block-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
header#title-block-header h1.title { margin-bottom: 0.25rem; }
header#title-block-header .author,
header#title-block-header .date {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Google fonts loader companion class */
.fonts-ready body { font-family: var(--font); }

@media (max-width: 720px) {
  .topbar-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.7rem 0;
  }
  .nav-links { width: 100%; justify-content: flex-start; }
  .hero { padding: 2.2rem 0 1.6rem; }
  .matrix { min-width: 28rem; }
  article.whitepaper { padding: 1.25rem 1rem 1.75rem; }
}

@media print {
  .topbar, .cta, .site-footer { display: none !important; }
  body, article.whitepaper {
    background: #fff !important;
    color: #111 !important;
    box-shadow: none !important;
  }
  article.whitepaper a { color: #0645ad; }
}
