/* Abstractive brand: dark blue text on cream, the pink triangle as the only accent,
   the green marker under links. */
:root {
  --bg: #f1eee3;
  --surface: #ffffff;
  --fg: #1f0666;
  --muted: #5b4f86;
  --line: #ddd6c4;
  --accent: #e637f1;
  --marker: #3aefaa;
  --code-bg: rgba(31, 6, 102, .07);
  --hover-bg: rgba(31, 6, 102, .07);
  --read: #3aefaa;
  --write: #ffb000;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #140443;
    --surface: #1f0666;
    --fg: #f1eee3;
    --muted: #c9c2e3;
    --line: #3a2a7c;
    --code-bg: rgba(241, 238, 227, .1);
    --hover-bg: rgba(241, 238, 227, .08);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 1rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--marker);
  text-decoration-thickness: .18em;
  text-underline-offset: .15em;
}

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: .5rem; background: var(--bg); padding: .25rem .5rem; }

.icon { width: 1.1em; height: 1.1em; fill: currentColor; flex: none; }

header.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: .75rem 1.5rem;
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: .6rem; color: var(--fg); font-weight: 600; text-decoration: none; }
.brand .logo { width: 8.5rem; height: auto; }
.brand .product { padding-left: .6rem; border-left: 1px solid var(--line); }
.brand .muted { color: var(--muted); font-weight: 400; }

.langs { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .9rem; }
.langs a { color: var(--muted); text-decoration: none; }
.langs a:hover { color: var(--fg); }
.langs a[aria-current] { color: var(--fg); font-weight: 600; }

.frame {
  display: grid;
  grid-template-columns: 14rem minmax(0, 46rem) 13rem;
  gap: 2.5rem;
  max-width: 80rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

nav.side ul, .toc ul { list-style: none; margin: 0; padding: 0; }
nav.side a { display: block; padding: .3rem .6rem; border-radius: 6px; color: var(--fg); text-decoration: none; }
nav.side a:hover { background: var(--hover-bg); }
nav.side a[aria-current] { background: var(--hover-bg); color: var(--fg); font-weight: 700; box-shadow: inset 3px 0 0 var(--accent); }

.toc { position: sticky; top: 1rem; align-self: start; font-size: .875rem; }
.toc p { margin: 0 0 .5rem; color: var(--muted); font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.toc a { display: block; padding: .2rem 0; color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--fg); }

main h1 { position: relative; margin: 0 0 1rem; padding-left: 1.4rem; font-size: 2rem; font-weight: 800; line-height: 1.25; }
/* The rounded triangle of the "i" of the Abstractive logo, turned to point at the title. */
main h1::before {
  content: "";
  position: absolute;
  left: 0;
  top: .34em;
  width: 18px;
  height: 18px;
  background: var(--accent);
  clip-path: path("M16.1 10.84C17.58 10.06 17.58 7.95 16.1 7.17L3.67 0.68C2.36 0 0.75 0.87 0.65 2.34C0.5 4.54 0.42 6.77 0.42 9C0.42 11.24 0.5 13.46 0.65 15.66C0.75 17.13 2.36 18 3.67 17.32L16.1 10.83L16.1 10.84Z");
}
main h2 { margin: 2.25rem 0 .75rem; padding-top: .75rem; border-top: 1px solid var(--line); font-size: 1.35rem; }
main h3 { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; margin: 1.75rem 0 .5rem; font-size: 1.1rem; }
main li { margin: .25rem 0; }

code { padding: .1em .35em; border-radius: 4px; background: var(--code-bg); font: .875em/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
pre { overflow-x: auto; padding: 1rem; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px; background: var(--surface); }
pre code { padding: 0; background: none; }

.scroll { overflow-x: auto; }
table { width: 100%; margin: 1rem 0; border-collapse: collapse; font-size: .925rem; }
th, td { padding: .5rem .6rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 600; }

.badge { padding: .1rem .55rem; border-radius: 999px; color: var(--fg); font-size: .75rem; font-weight: 600; }
.badge.read { background: color-mix(in srgb, var(--read) 35%, transparent); }
.badge.write { background: color-mix(in srgb, var(--write) 40%, transparent); }

footer { padding: 1.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; text-align: center; }
footer a { color: inherit; }

@media (max-width: 64rem) {
  .frame { grid-template-columns: 12rem minmax(0, 1fr); }
  .toc { display: none; }
}

@media (max-width: 44rem) {
  header.top { padding: .75rem 1rem; }
  .frame { grid-template-columns: minmax(0, 1fr); gap: 1rem; padding: 1rem 1rem 2rem; }
  nav.side ul { display: flex; flex-wrap: wrap; gap: .25rem; }
  main h1 { font-size: 1.6rem; }
}
