/* The Mist palette and type of docs/guides/styleguide.md, marketing site. */
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("inter.woff2") format("woff2-variations");
}

@font-face {
  font-family: "Geist Mono Variable";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("geist-mono.woff2") format("woff2-variations");
}

:root {
  color-scheme: light dark;
  --page: oklch(1 0 0);
  --band: oklch(0.987 0.002 197.1);
  --fill: oklch(0.963 0.002 197.1);
  --line: oklch(0.925 0.005 214.3);
  --text: oklch(0.148 0.004 228.8);
  --muted: oklch(0.5 0.02 214);
  --ink: oklch(0.218 0.008 223.9);
  --ink-label: oklch(0.987 0.002 197.1);
  --focus: oklch(0.379 0.094 246.7);
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 12px 40px rgb(0 0 0 / 0.08);
  --top: 56px;
  --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: oklch(0.148 0.004 228.8);
    --band: oklch(0.205 0.008 224);
    --fill: oklch(0.25 0.008 224);
    --line: rgb(255 255 255 / 0.08);
    --text: oklch(0.96 0.003 200);
    --muted: oklch(0.723 0.014 214.4);
    --ink: oklch(0.925 0.005 214.3);
    --ink-label: oklch(0.218 0.008 223.9);
    --focus: oklch(0.78 0.08 240);
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 12px 40px rgb(0 0 0 / 0.5);
  }
}

@media (min-width: 720px) {
  :root {
    --gutter: 32px;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: calc(var(--top) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font:
    400 16px / 1.6 "Inter Variable",
    system-ui,
    sans-serif;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: var(--gutter);
  top: 8px;
  z-index: 3;
  padding: 8px 12px;
  background: var(--page);
}

/* Header */

.top {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  min-height: var(--top);
  padding: 8px var(--gutter);
  background: var(--page);
  border-bottom: 1px solid var(--line);
}

.brand {
  font:
    400 21px / 1 Georgia,
    "Times New Roman",
    serif;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.brand span {
  color: var(--muted);
  font:
    500 14px / 1 "Inter Variable",
    system-ui,
    sans-serif;
  letter-spacing: -0.01em;
}

.tabs {
  display: flex;
  gap: 2px;
}

.tabs a,
.side a {
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.tabs a {
  padding: 5px 10px;
}

.tabs a:hover,
.side a:hover,
.tabs a[aria-current],
.side a[aria-current] {
  background: var(--fill);
  color: var(--text);
}

.search {
  position: relative;
  flex: 1 1 100%;
  order: 3;
}

.search input {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: var(--fill);
  color: inherit;
  font: inherit;
  font-size: 14px;
}

.search input::placeholder {
  color: var(--muted);
}

#results {
  position: absolute;
  top: 44px;
  left: 0;
  width: min(560px, calc(100vw - 2 * var(--gutter)));
  max-height: 70vh;
  margin: 0;
  padding: 6px;
  overflow: auto;
  list-style: none;
  background: var(--page);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

#results li {
  padding: 8px 10px;
  color: var(--muted);
  font-size: 14px;
}

#results li:has(a) {
  padding: 0;
}

#results a {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--text);
  line-height: 1.4;
  text-decoration: none;
}

#results a:hover,
#results a:focus-visible {
  background: var(--fill);
}

#results small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.pill {
  display: none;
  margin-left: auto;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--ink-label);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

/* Frame */

.menu {
  position: absolute;
  opacity: 0;
}

.menu-label {
  display: block;
  padding: 10px var(--gutter);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}

.menu-label::after {
  content: " +";
}

.menu:checked + .menu-label::after {
  content: " -";
}

.menu:focus-visible + .menu-label {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

.side {
  display: none;
  padding: 16px calc(var(--gutter) - 10px);
  border-bottom: 1px solid var(--line);
}

.menu:checked ~ .shell .side {
  display: block;
}

.side section + section {
  margin-top: 20px;
}

.side h2,
.contents h2 {
  margin: 0 0 6px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 600;
}

.side ul,
.contents ul,
.areas ul,
.questions {
  margin: 0;
  padding: 0;
  list-style: none;
}

.side a {
  display: block;
  padding: 5px 10px;
  line-height: 1.4;
}

main {
  min-width: 0;
  max-width: 760px;
  padding: 32px var(--gutter) 96px;
}

/* A page that is itself the list of pages has no navigation beside it. */
.bare main {
  max-width: 1120px;
  margin: 0 auto;
}

.contents {
  display: none;
}

.crumbs {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
}

.crumbs a {
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--text);
}

.crumbs i {
  margin: 0 8px;
  font-style: normal;
  opacity: 0.5;
}

footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: 24px var(--gutter);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

footer :first-child {
  margin-right: auto;
}

@media (min-width: 720px) {
  .top {
    flex-wrap: nowrap;
  }

  .search {
    flex: 0 1 320px;
    order: 0;
  }

  .pill {
    display: block;
  }
}

@media (min-width: 960px) {
  .menu,
  .menu-label {
    display: none;
  }

  .shell:not(.bare) {
    display: grid;
    grid-template-columns: 264px minmax(0, 1fr);
  }

  .side,
  .contents {
    position: sticky;
    top: var(--top);
    align-self: start;
    max-height: calc(100vh - var(--top));
    overflow-y: auto;
  }

  .side {
    display: block;
    padding: 28px 16px 48px;
    border-bottom: 0;
  }

  main {
    padding-top: 40px;
  }

  .shell:not(.bare) main {
    padding-left: 40px;
  }
}

@media (min-width: 1280px) {
  .shell:has(.contents) {
    grid-template-columns: 264px minmax(0, 1fr) 232px;
  }

  .contents {
    display: block;
    padding: 44px 16px 48px 0;
  }

  .contents a {
    display: block;
    padding: 4px 10px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
    text-decoration: none;
  }

  .contents a:hover {
    color: var(--text);
  }
}

/* Type, prose and the lists of pages and questions. */
h1 {
  margin: 0 0 16px;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h2 {
  margin: 48px 0 12px;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h3 {
  margin: 32px 0 8px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
}

h4 {
  margin: 24px 0 8px;
  font-size: 15px;
  font-weight: 600;
}

p,
.prose ul,
.prose ol,
pre,
.table {
  margin: 0 0 16px;
}

.prose ul,
.prose ol {
  padding-left: 22px;
}

.prose li {
  margin: 6px 0;
}

.prose li > p {
  margin-bottom: 8px;
}

.prose a,
.lede a,
.source a {
  text-decoration-color: var(--muted);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.prose a:hover,
.lede a:hover,
.source a:hover {
  text-decoration-color: currentcolor;
}

code {
  font:
    0.875em "Geist Mono Variable",
    ui-monospace,
    monospace;
  letter-spacing: 0;
}

:not(pre) > code {
  padding: 1px 4px;
  border-radius: 6px;
  background: var(--fill);
  overflow-wrap: anywhere;
}

pre {
  padding: 14px 16px;
  overflow-x: auto;
  background: var(--band);
  border: 1px solid var(--line);
  border-radius: 10px;
  line-height: 1.6;
}

.table {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.5;
}

th,
td {
  padding: 8px 16px 8px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  font-weight: 600;
  white-space: nowrap;
}

.lede {
  max-width: 56ch;
  color: var(--muted);
  font-size: 18px;
}

.meta,
.source,
small {
  color: var(--muted);
  font-size: 14px;
}

/* Lists of pages and questions */

.areas {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px 40px;
  margin-top: 40px;
}

.areas h2,
.related h2 {
  margin: 24px 0 8px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.areas li {
  padding: 4px 0;
}

.areas a,
.questions a,
.pager a {
  text-decoration: none;
}

.areas a:hover,
.questions a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.questions li {
  border-bottom: 1px solid var(--line);
}

.questions a {
  display: block;
  padding: 10px 0;
  line-height: 1.45;
}

.answer {
  font-size: 18px;
}

.source {
  margin-top: 24px;
}

.related {
  margin-top: 56px;
}

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 40px;
}

.pager a {
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
}

.pager a:hover {
  background: var(--band);
}

.pager a[rel="next"] {
  text-align: right;
}

.pager small {
  display: block;
  font-size: 12px;
}

@media (min-width: 720px) {
  h1 {
    font-size: 36px;
  }
}
