/* Colours and type follow addacsystem.com: warm grey page, white panels with
   a soft beige shadow, thin grey rules, black Helvetica, red for the active
   and hovered item. */
:root {
  --bg: #dddbd4;
  --surface: #ffffff;
  --text: #000000;
  --heading: #363636;
  --muted: #777777;
  --line: #c8c7c7;
  --shadow: #c9c5b8;
  --red: #e00000;
  --link: #363636;
  --public: #363636;
  --guest: #b36b00;
  --internal: #e00000;
  --code: #da1039;
  --code-bg: #f5f5f5;
  --radius: 4px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1b19;
    --surface: #262522;
    --text: #ecebe7;
    --heading: #f4f3ef;
    --muted: #a3a19b;
    --line: #3a3935;
    --shadow: #11100f;
    --red: #ff4b4b;
    --link: #ecebe7;
    --public: #ecebe7;
    --guest: #e0a648;
    --internal: #ff4b4b;
    --code: #ff7a92;
    --code-bg: #302f2b;
  }
  .brand img { filter: invert(1); }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.5; font-size: 16px; }
a { color: var(--link); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 2px; transition: color .2s linear; }
a:hover { color: var(--red); text-decoration-color: currentColor; }
img { max-width: 100%; height: auto; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3, h4 { font-weight: 400; color: var(--heading); }

/* header */
.site-head { background: var(--surface); box-shadow: 1px 1px 1px var(--shadow); border-bottom: 3px solid var(--level-color, transparent); }
body[data-level="guest"] { --level-color: var(--guest); }
body[data-level="internal"] { --level-color: var(--internal); }
.site-head .wrap { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-height: 64px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--text); text-decoration: none; }
.brand img { display: block; height: 32px; width: auto; }
.brand span { font-size: 17px; padding-left: 14px; border-left: 1px solid var(--line); }
.brand:hover { color: var(--red); }
.level-badge { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--level-color, var(--public)); border: 1px solid currentColor; border-radius: 99px; padding: 1px 8px; }
.levels { margin-left: auto; display: flex; gap: 2px; }
.levels a { font-size: 15px; color: var(--text); text-decoration: none; padding: 4px 10px; }
.levels a:hover, .levels a.current { color: var(--red); }

main { padding-top: 20px; padding-bottom: 48px; }
main > * + * { margin-top: 0; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--red); }

/* page head sits on a white panel, like the site's content column */
.page-head { background: var(--surface); box-shadow: 1px 1px 1px var(--shadow); padding: 20px; margin-bottom: 20px; }
.page-head h1 { margin: 0 0 4px; font-size: 28px; line-height: 1.2; text-shadow: 1px 1px 1px var(--shadow); }
.eyebrow { margin: 0 0 2px; font-size: 13px; color: var(--muted); }
.lede { color: var(--text); margin: 4px 0 0; max-width: 65ch; }
.module-head { display: flex; gap: 24px; align-items: flex-start; }
.module-photo { width: 120px; flex: none; }
@media (max-width: 560px) { .module-head { flex-direction: column; } .module-photo { width: 96px; } }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 2px 16px; margin: 12px 0 0; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

h2 { font-size: 20px; margin: 28px 0 12px; }

/* cards */
.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.card { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 14px 16px; background: var(--surface); box-shadow: 1px 1px 1px var(--shadow); color: var(--text); text-decoration: none; border-top: 2px solid transparent; }
.card strong { font-weight: 400; font-size: 17px; transition: color .2s linear; }
.card:hover { border-top-color: var(--red); }
.card:hover strong { color: var(--red); }
.card span:not(.tag):not(.num) { color: var(--muted); font-size: 14px; }
.module-card img, .module-card .ph { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--code-bg); margin-bottom: 8px; display: block; }
.module-card .num { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tag { align-self: flex-start; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; padding: 0 6px; border-radius: 99px; border: 1px solid currentColor; vertical-align: middle; }
.tag[data-access="guest"] { color: var(--guest); }
.tag[data-access="internal"] { color: var(--internal); }
.page-head .tag { margin-top: 6px; display: inline-block; }
.empty { color: var(--muted); }
main > .empty { background: var(--surface); box-shadow: 1px 1px 1px var(--shadow); padding: 20px; }
.shared-link { margin-top: 24px; }

/* procedure tabs */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 0 0 16px; }
.tabs a { padding: 8px 12px; color: var(--text); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--red); }
.tabs a[aria-current="page"] { color: var(--red); border-bottom-color: var(--red); }
.page-head + .tabs { margin-top: -8px; }

/* procedure text, on a white panel */
.prose { max-width: none; background: var(--surface); box-shadow: 1px 1px 1px var(--shadow); padding: 4px 20px 20px; }
.prose > * { max-width: 75ch; }
.prose h2 { border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.prose code { color: var(--code); background: var(--code-bg); padding: .1em .4em; font-size: .875em; }
.prose pre { background: var(--code-bg); padding: 12px; overflow-x: auto; }
.prose pre code { color: var(--text); background: none; padding: 0; }
.prose li.task { list-style: none; margin-left: -1.3em; }
.prose li.task input { margin-right: 6px; transform: translateY(1px); accent-color: var(--red); }
.admonition { border-left: 3px solid var(--line); background: var(--code-bg); padding: 8px 14px; margin: 16px 0; }
.admonition.warning, .admonition.danger, .admonition.caution { border-left-color: var(--red); }
.admonition-title { margin: 0 0 4px; color: var(--heading); }
.admonition.warning .admonition-title, .admonition.danger .admonition-title { color: var(--red); }
.restricted { border: 1px dashed var(--internal); padding: 4px 14px; margin: 18px 0; position: relative; }
.restricted[data-access="guest"] { border-color: var(--guest); }
.restricted::before { content: attr(data-access); position: absolute; top: -9px; left: 10px; background: var(--surface); padding: 0 6px; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--internal); }
.restricted[data-access="guest"]::before { color: var(--guest); }

/* tables */
section > .table-wrap, section > .empty { background: var(--surface); box-shadow: 1px 1px 1px var(--shadow); }
section > .empty { padding: 14px 16px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 7px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--heading); font-weight: 700; }
tr:last-child td { border-bottom: none; }
.chan { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.chan[data-channel="rc"], .chan[data-channel="beta"] { color: var(--guest); }
.chan[data-channel="dev"] { color: var(--internal); }
.notes { white-space: pre-wrap; font-size: 13px; max-width: 60ch; }

.site-foot { color: var(--muted); font-size: 12px; padding: 16px 0 24px; border-top: 1px solid var(--line); }

@media (max-width: 560px) {
  .brand span { display: none; }
  .levels { margin-left: 0; width: 100%; }
}

@media print {
  .site-head .levels, .tabs, .crumbs, .site-foot { display: none; }
  body { background: #fff; color: #000; }
  .site-head, .page-head, .prose, .card, section > .table-wrap { box-shadow: none; }
  a { color: inherit; }
}
