/* Shared styles for ma-dev.se: the company page, the legal pages and the 404 page.
   No web fonts, scripts or external resources: the Content-Security-Policy in nginx.conf allows
   only this site's own stylesheet and images. */
:root {
  --ink: #1b2330; --muted: #5a6474; --bg: #f6f6f3; --card: #ffffff; --border: #e2e2dc;
  --accent: #1d5c8c; --accent-hover: #164a72; --note: #eef3f8; --decide: #fff1b8;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8ebf0; --muted: #a3acb9; --bg: #11151b; --card: #181d25; --border: #2a313c;
    --accent: #7db7e8; --accent-hover: #a5cdf0; --note: #172230; --decide: #4a3f10;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--card); padding: 8px 12px; z-index: 1; }

/* ---- Header and footer, shared by every page ------------------------------------------- */
.site-header { border-bottom: 1px solid var(--border); background: var(--card); }
.site-header .wrap { display: flex; align-items: center; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink);
  text-decoration: none; font-weight: 700; letter-spacing: -0.2px; }
.brand img { width: 28px; height: 28px; }
.brand:hover { color: var(--accent); }
footer { margin-top: 64px; padding: 24px 0 48px; border-top: 1px solid var(--border);
  color: var(--muted); font-size: 14px; }
footer a { color: var(--muted); }

/* ---- Company page ---------------------------------------------------------------------- */
.intro { padding: 56px 0 8px; max-width: 46rem; }
.intro h1 { font-size: clamp(30px, 5vw, 44px); line-height: 1.15; margin: 0 0 14px;
  letter-spacing: -0.6px; }
.lede { color: var(--muted); font-size: 18px; margin: 0; max-width: 62ch; }
.section { padding-top: 40px; }
.section > h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin: 0 0 16px; }
.apps { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.app { background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 22px 24px; }
.app h3 { font-size: 21px; margin: 0 0 4px; letter-spacing: -0.2px; }
.app .status { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.app p { margin: 0 0 14px; }
.app ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px;
  font-size: 15px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 24px; margin: 0;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 20px 24px; max-width: 46rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
@media (max-width: 520px) {
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dd { margin-bottom: 10px; }
}

/* ---- Legal pages: contents beside the text on desktop, above it on narrow screens ----- */
.doc-header { padding: 40px 0 24px; border-bottom: 1px solid var(--border); }
.doc-header h1 { font-size: clamp(28px, 5vw, 40px); margin: 0 0 6px; letter-spacing: -0.5px; }
.doc-header .app-name { color: var(--muted); font-weight: 600; margin: 0; }
.updated { color: var(--muted); font-size: 15px; margin: 4px 0 0; }
.doc-header .lede { font-size: 16px; margin-top: 16px; max-width: 72ch; }
.layout { display: grid; grid-template-columns: 240px 1fr; gap: 48px; align-items: start;
  margin-top: 32px; }
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; gap: 24px; } }
nav.toc { position: sticky; top: 24px; font-size: 14.5px; }
@media (max-width: 860px) {
  nav.toc { position: static; background: var(--card); border: 1px solid var(--border);
    border-radius: 14px; padding: 16px 18px; }
}
nav.toc h2 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin: 0 0 10px; }
nav.toc ol { list-style: none; margin: 0; padding: 0; }
nav.toc li { margin: 0 0 4px; }
nav.toc a { color: var(--muted); text-decoration: none; display: block; padding: 3px 0; }
nav.toc a:hover { color: var(--accent); }
.doc { max-width: 72ch; }
.doc h2 { font-size: 21px; margin: 40px 0 10px; letter-spacing: -0.2px; scroll-margin-top: 24px; }
.doc h2:first-child { margin-top: 0; }
.doc h3 { font-size: 16.5px; margin: 26px 0 8px; scroll-margin-top: 24px; }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin-bottom: 6px; }
.note { background: var(--note); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 14px 16px; margin: 20px 0; }
.note p:first-child, .note ul:first-child { margin-top: 0; }
.note p:last-child, .note ul:last-child { margin-bottom: 0; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; margin: 18px 0; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px;
  border-bottom: 1px solid var(--border); }
th { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
tbody tr:last-child td { border-bottom: none; }

/* Draft only: decisions that are not yet made. Every mark is removed before a deploy. */
mark.decide { background: var(--decide); color: inherit; padding: 1px 3px; border-radius: 3px; }
mark.decide::before { content: attr(data-id) " "; font-size: 12px; font-weight: 700; }

@media print {
  nav.toc, .site-header { display: none; }
  .layout { display: block; }
  .doc { max-width: none; }
  body { background: #fff; color: #000; }
}
