/*
 * The Console's colours and type, without the Console. The custom property
 * names and values are Primer's (the light and dark functional themes the
 * Console loads), copied so these pages read as the same product while
 * loading nothing from it. Only the tokens used below are carried over.
 */

:root {
  color-scheme: light dark;
  --bgColor-default: #ffffff;
  --bgColor-muted: #f6f8fa;
  --bgColor-inset: #f6f8fa;
  --bgColor-neutral-muted: #818b981f;
  --bgColor-accent-muted: #ddf4ff;
  --bgColor-accent-emphasis: #0969da;
  --bgColor-attention-muted: #fff8c5;
  --bgColor-success-muted: #dafbe1;
  --bgColor-danger-muted: #ffebe9;
  --fgColor-default: #1f2328;
  --fgColor-muted: #59636e;
  --fgColor-accent: #0969da;
  --fgColor-attention: #9a6700;
  --fgColor-success: #1a7f37;
  --fgColor-danger: #d1242f;
  --fgColor-onEmphasis: #ffffff;
  --borderColor-default: #d1d9e0;
  --borderColor-muted: #d1d9e0b3;
  --borderColor-accent-emphasis: #0969da;
  --borderColor-attention-muted: #d4a72c66;
  --borderColor-success-muted: #4ac26b66;
  --borderColor-danger-muted: #ff818266;
  --fontStack-system: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --fontStack-monospace: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --borderRadius-medium: 0.375rem;
  --borderRadius-large: 0.75rem;
  --content-width: 1200px;
  --prose-width: 46rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bgColor-default: #0d1117;
    --bgColor-muted: #151b23;
    --bgColor-inset: #010409;
    --bgColor-neutral-muted: #656c7633;
    --bgColor-accent-muted: #388bfd1a;
    --bgColor-accent-emphasis: #1f6feb;
    --bgColor-attention-muted: #bb800926;
    --bgColor-success-muted: #2ea04326;
    --bgColor-danger-muted: #f851491a;
    --fgColor-default: #f0f6fc;
    --fgColor-muted: #9198a1;
    --fgColor-accent: #4493f8;
    --fgColor-attention: #d29922;
    --fgColor-success: #3fb950;
    --fgColor-danger: #f85149;
    --fgColor-onEmphasis: #ffffff;
    --borderColor-default: #3d444d;
    --borderColor-muted: #3d444db3;
    --borderColor-accent-emphasis: #1f6feb;
    --borderColor-attention-muted: #bb800966;
    --borderColor-success-muted: #2ea04366;
    --borderColor-danger-muted: #f8514966;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bgColor-default);
  color: var(--fgColor-default);
  font-family: var(--fontStack-system);
  font-size: 1rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

a {
  color: var(--fgColor-accent);
  text-underline-offset: 0.2em;
}

:focus-visible {
  outline: 2px solid var(--borderColor-accent-emphasis);
  outline-offset: 2px;
}

h1,
h2,
h3 {
  line-height: 1.4;
  overflow-wrap: normal;
  word-break: auto-phrase;
}

h1 {
  font-size: 2rem;
  margin: 0 0 0.75rem;
}

h2 {
  font-size: 1.375rem;
  margin: 2.5rem 0 0.75rem;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid var(--borderColor-muted);
}

h3 {
  font-size: 1.0625rem;
  margin: 1.75rem 0 0.5rem;
}

p,
ul,
ol {
  margin: 0 0 1rem;
}

li + li {
  margin-top: 0.25rem;
}

code {
  font-family: var(--fontStack-monospace);
  font-size: 0.875em;
  padding: 0.125em 0.375em;
  border-radius: var(--borderRadius-medium);
  background-color: var(--bgColor-neutral-muted);
  overflow-wrap: anywhere;
}

pre {
  margin: 0 0 1.25rem;
  padding: 1rem;
  overflow-x: auto;
  border: 1px solid var(--borderColor-default);
  border-radius: var(--borderRadius-medium);
  background-color: var(--bgColor-muted);
  line-height: 1.6;
}

pre code {
  padding: 0;
  background: none;
  font-size: 0.8125rem;
  overflow-wrap: normal;
  white-space: pre;
}

/* Same table as the Console's resource tables. */
.table-scroll {
  overflow-x: auto;
  margin: 0 0 1.25rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--borderColor-default);
  font-size: 0.875rem;
  line-height: 1.6;
}

th {
  text-align: left;
  font-weight: 600;
  color: var(--fgColor-muted);
  background-color: var(--bgColor-muted);
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--borderColor-default);
  white-space: nowrap;
}

td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--borderColor-muted);
  vertical-align: top;
}

tr:last-child td {
  border-bottom: none;
}

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  border-radius: var(--borderRadius-medium);
  background-color: var(--bgColor-default);
  border: 1px solid var(--borderColor-default);
}

.skip-link:focus {
  top: 0.5rem;
}

/* The Console's app bar: inset background, 56px, product name on the left. */
.site-header {
  border-bottom: 1px solid var(--borderColor-default);
  background-color: var(--bgColor-inset);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  max-width: var(--content-width);
  min-height: 56px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.site-header__brand {
  font-size: 1rem;
  font-weight: 600;
  color: var(--fgColor-default);
  text-decoration: none;
  white-space: nowrap;
}

.site-header__nav {
  display: flex;
  flex: 1;
  gap: 1.25rem;
  white-space: nowrap;
}

.site-header__nav a {
  color: var(--fgColor-muted);
  text-decoration: none;
  padding: 0.25rem 0;
}

.site-header__nav a:hover {
  color: var(--fgColor-default);
}

.site-header__nav a[aria-current="page"] {
  color: var(--fgColor-default);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--borderColor-accent-emphasis);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0.375rem 1rem;
  border: 1px solid var(--borderColor-default);
  border-radius: var(--borderRadius-medium);
  background-color: var(--bgColor-muted);
  color: var(--fgColor-default);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}

.button:hover {
  background-color: var(--bgColor-neutral-muted);
}

.button--primary {
  border-color: transparent;
  background-color: var(--bgColor-accent-emphasis);
  color: var(--fgColor-onEmphasis);
}

.button--primary:hover {
  background-color: var(--bgColor-accent-emphasis);
  filter: brightness(1.08);
}

.site-header__console {
  min-height: 2rem;
  padding: 0.25rem 0.875rem;
}

main {
  flex: 1;
}

.page {
  width: 100%;
  min-width: 0;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.lead {
  font-size: 1.125rem;
  color: var(--fgColor-muted);
  max-width: var(--prose-width);
}

.muted {
  color: var(--fgColor-muted);
}

.note {
  margin: 0 0 1.25rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--borderColor-default);
  border-left: 4px solid var(--borderColor-accent-emphasis);
  border-radius: var(--borderRadius-medium);
  background-color: var(--bgColor-accent-muted);
}

.note--attention {
  border-color: var(--borderColor-attention-muted);
  border-left-color: var(--fgColor-attention);
  background-color: var(--bgColor-attention-muted);
}

.note > :last-child {
  margin-bottom: 0;
}

/* Product entry ---------------------------------------------------------- */

.hero {
  padding: 1rem 0 2rem;
}

.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  max-width: 22em;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.hero__actions .button {
  min-height: 2.75rem;
  padding: 0.5rem 1.25rem;
  font-size: 1rem;
}

/* The Console's platform hub: bordered cards that are links. */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.cards > li {
  margin: 0;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  height: 100%;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--borderColor-default);
  border-radius: var(--borderRadius-medium);
  color: var(--fgColor-default);
}

.card h3 {
  margin: 0;
}

.card p {
  margin: 0;
  color: var(--fgColor-muted);
  font-size: 0.9375rem;
}

.card a {
  margin-top: auto;
  padding-top: 0.5rem;
  font-size: 0.9375rem;
}

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  max-width: var(--prose-width);
}

.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 2.75rem;
  margin: 0 0 1.25rem;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.125rem;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  border: 1px solid var(--borderColor-default);
  background-color: var(--bgColor-muted);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.625rem;
  text-align: center;
}

.steps h3 {
  margin: 0 0 0.25rem;
}

.prose {
  max-width: var(--prose-width);
}

/* Docs ------------------------------------------------------------------- */

.docs {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: 3rem;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.docs-nav {
  position: sticky;
  top: 1.5rem;
  align-self: start;
  font-size: 0.9375rem;
}

.docs-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.docs-nav li + li {
  margin-top: 0;
}

.docs-nav a {
  display: block;
  padding: 0.375rem 0.75rem;
  border-left: 2px solid transparent;
  color: var(--fgColor-muted);
  text-decoration: none;
}

.docs-nav a:hover {
  color: var(--fgColor-default);
  background-color: var(--bgColor-muted);
}

.docs-nav a[aria-current="page"] {
  color: var(--fgColor-default);
  font-weight: 600;
  border-left-color: var(--borderColor-accent-emphasis);
}

.docs-toc {
  display: none;
}

.docs-content {
  max-width: var(--prose-width);
  min-width: 0;
}

.docs-content > h1 + .lead {
  margin-bottom: 2rem;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--borderColor-muted);
}

.pager a {
  display: flex;
  flex-direction: column;
  text-decoration: none;
}

.pager span {
  font-size: 0.8125rem;
  color: var(--fgColor-muted);
}

.pager__next {
  margin-left: auto;
  text-align: right;
}

/* Status ----------------------------------------------------------------- */

.status-summary {
  margin: 1.5rem 0 2rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--borderColor-default);
  border-radius: var(--borderRadius-medium);
  background-color: var(--bgColor-muted);
}

.status-summary h2 {
  margin: 0 0 0.25rem;
  padding: 0;
  border: 0;
  font-size: 1.25rem;
}

.status-summary p {
  margin: 0;
}

.status-summary--incident {
  border-color: var(--borderColor-danger-muted);
  background-color: var(--bgColor-danger-muted);
}

.status-list {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  border: 1px solid var(--borderColor-default);
  border-radius: var(--borderRadius-medium);
}

.status-list > li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.25rem 1rem;
  margin: 0;
  padding: 1rem 1.25rem;
}

.status-list > li + li {
  border-top: 1px solid var(--borderColor-muted);
}

.status-list h3 {
  margin: 0;
  font-size: 1rem;
}

.status-list p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--fgColor-muted);
  font-size: 0.875rem;
}

/* State is spelled out in text; the colour only repeats it. */
.state {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.125rem 0.625rem;
  border: 1px solid var(--borderColor-default);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  align-self: start;
}

.state::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background-color: currentColor;
}

.state--unknown {
  color: var(--fgColor-muted);
  background-color: var(--bgColor-neutral-muted);
}

.state--operational {
  color: var(--fgColor-success);
  border-color: var(--borderColor-success-muted);
  background-color: var(--bgColor-success-muted);
}

.state--degraded,
.state--maintenance {
  color: var(--fgColor-attention);
  border-color: var(--borderColor-attention-muted);
  background-color: var(--bgColor-attention-muted);
}

.state--outage {
  color: var(--fgColor-danger);
  border-color: var(--borderColor-danger-muted);
  background-color: var(--bgColor-danger-muted);
}

.incident {
  margin: 0 0 1.5rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--borderColor-default);
  border-radius: var(--borderRadius-medium);
}

.incident h3 {
  margin: 0 0 0.25rem;
}

.incident ol {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}

.incident ol li {
  padding: 0.5rem 0 0;
  border-top: 1px solid var(--borderColor-muted);
}

.incident time {
  font-size: 0.8125rem;
  color: var(--fgColor-muted);
}

/* Footer ----------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--borderColor-default);
  background-color: var(--bgColor-inset);
  font-size: 0.875rem;
  color: var(--fgColor-muted);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.site-footer a {
  color: var(--fgColor-muted);
}

.site-footer p {
  margin: 0;
}

/* Narrow screens --------------------------------------------------------- */

@media (max-width: 800px) {
  .docs {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    padding-top: 1.5rem;
  }

  .docs-nav {
    display: none;
  }

  .docs-toc {
    display: block;
    border: 1px solid var(--borderColor-default);
    border-radius: var(--borderRadius-medium);
  }

  .docs-toc summary {
    padding: 0.625rem 1rem;
    cursor: pointer;
    font-weight: 600;
  }

  .docs-toc .docs-nav {
    display: block;
    position: static;
    padding: 0 0.5rem 0.75rem;
  }
}

@media (max-width: 640px) {
  body {
    line-height: 1.7;
  }

  .site-header__inner {
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    padding: 0.5rem 1rem;
  }

  .site-header__nav {
    order: 3;
    flex-basis: 100%;
    overflow-x: auto;
  }

  .site-header__console {
    margin-left: auto;
  }

  .page,
  .docs {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  h1 {
    font-size: 1.625rem;
  }

  .status-list > li {
    grid-template-columns: minmax(0, 1fr);
  }

  .pager {
    flex-direction: column;
  }

  .pager__next {
    margin-left: 0;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
