/*
 * Copyright 2020 Adobe. All rights reserved.
 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License. You may obtain a copy
 * of the License at http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under
 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
 * OF ANY KIND, either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */

:root {
  color-scheme: light dark;

  /* colors */
  --background-color: #fbfaf8;
  --surface-color: #fff;
  --light-color: #f3f1ed;
  --border-color: #e6e2db;
  --dark-color: #5f5b55;
  --text-color: #17161a;
  --link-color: #b45309;
  --link-hover-color: #92400e;
  --accent-soft-color: #fdf1dc;

  /* code and figures stay dark in both themes, matching the article diagrams */
  --code-background-color: #1b2129;
  --code-border-color: #2a313b;
  --code-text-color: #d7dde5;
  --code-accent-color: #e8a33d;

  /* fonts */
  --body-font-family: inter, inter-fallback, system-ui, sans-serif;
  --heading-font-family: var(--body-font-family);
  --mono-font-family: jetbrains-mono, ui-monospace, 'Cascadia Code', menlo, consolas, monospace;

  /* body sizes */
  --body-font-size-m: 18px;
  --body-font-size-s: 16px;
  --body-font-size-xs: 14px;

  /* heading sizes */
  --heading-font-size-xxl: 44px;
  --heading-font-size-xl: 32px;
  --heading-font-size-l: 26px;
  --heading-font-size-m: 21px;
  --heading-font-size-s: 18px;
  --heading-font-size-xs: 16px;

  /* layout */
  --nav-height: 64px;
  --content-width: 1120px;
  --reading-width: 720px;
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background-color: #0f1115;
    --surface-color: #161a20;
    --light-color: #1b2028;
    --border-color: #262c35;
    --dark-color: #9aa1ab;
    --text-color: #e8e6e3;
    --link-color: #f0a640;
    --link-hover-color: #f7c47a;
    --accent-soft-color: #2e2412;
    --code-background-color: #161b22;
  }
}

/* fallback fonts */
@font-face {
  font-family: inter-fallback;
  size-adjust: 107%;
  src: local('Arial');
}

@media (width >= 900px) {
  :root {
    --body-font-size-m: 18px;
    --body-font-size-s: 16px;
    --body-font-size-xs: 14px;

    /* heading sizes */
    --heading-font-size-xxl: 64px;
    --heading-font-size-xl: 40px;
    --heading-font-size-l: 28px;
    --heading-font-size-m: 22px;
    --heading-font-size-s: 19px;
    --heading-font-size-xs: 16px;
  }
}

body {
  display: none;
  margin: 0;
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: var(--body-font-family);
  font-size: var(--body-font-size-m);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizelegibility;
}

body.appear {
  display: block;
}

header {
  height: var(--nav-height);
}

header .header,
footer .footer {
  visibility: hidden;
}

header .header[data-block-status="loaded"],
footer .footer[data-block-status="loaded"] {
  visibility: visible;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 1.4em;
  margin-bottom: 0.4em;
  font-family: var(--heading-font-family);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
  scroll-margin: calc(var(--nav-height) + 24px);
}

h1 {
  font-size: var(--heading-font-size-xxl);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

h2 { font-size: var(--heading-font-size-xl); }
h3 { font-size: var(--heading-font-size-l); }
h4 { font-size: var(--heading-font-size-m); }
h5 { font-size: var(--heading-font-size-s); }
h6 { font-size: var(--heading-font-size-xs); }

p,
dl,
ol,
ul,
pre,
blockquote {
  margin-top: 1em;
  margin-bottom: 0;
}

li + li {
  margin-top: 0.35em;
}

strong {
  font-weight: 650;
}

::selection {
  background-color: var(--accent-soft-color);
}

/* inline code */
code {
  padding: 0.12em 0.36em;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: var(--light-color);
  font-family: var(--mono-font-family);
  font-size: 0.86em;
}

/* code blocks: dark in both themes, styled like the article figures */
pre {
  position: relative;
  margin-top: 1.5em;
  border: 1px solid var(--code-border-color);
  border-left: 3px solid var(--code-accent-color);
  border-radius: 8px;
  padding: 20px 24px;
  background-color: var(--code-background-color);
  color: var(--code-text-color);
  font-size: var(--body-font-size-xs);
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre;
  tab-size: 2;
}

pre code {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-size: inherit;
}

pre[data-lang]::before {
  content: attr(data-lang);
  position: absolute;
  top: 8px;
  right: 12px;
  color: #8b95a3;
  font-family: var(--mono-font-family);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

blockquote {
  margin-left: 0;
  margin-right: 0;
  border-left: 3px solid var(--link-color);
  padding: 4px 0 4px 20px;
  color: var(--dark-color);
}

blockquote > :first-child {
  margin-top: 0;
}

hr {
  margin: 48px 0;
  border: 0;
  border-top: 1px solid var(--border-color);
}

main > div {
  margin: 40px 16px;
}

input,
textarea,
select,
button {
  font: inherit;
}

/* links */
a:any-link {
  color: var(--link-color);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentcolor 35%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  overflow-wrap: break-word;
  transition: color 0.15s, text-decoration-color 0.15s;
}

a:hover {
  color: var(--link-hover-color);
  text-decoration-color: currentcolor;
}

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

/* buttons */
p.button-wrapper {
  display: inline-block;
  margin: 24px 12px 0 0;
}

a.button:any-link,
button.button {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.7em 1.4em;
  font: inherit;
  font-size: var(--body-font-size-s);
  font-weight: 550;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}

a.button:hover,
button.button:hover {
  transform: translateY(-1px);
}

a.button[aria-disabled="true"],
button.button:disabled {
  cursor: not-allowed;
  pointer-events: none;
}

a.button.primary,
button.button.primary {
  border-color: var(--text-color);
  background-color: var(--text-color);
  color: var(--background-color);
}

a.button.primary:hover,
a.button.primary:focus-visible,
button.button.primary:hover,
button.button.primary:focus-visible {
  border-color: var(--link-color);
  background-color: var(--link-color);
  color: var(--background-color);
}

a.button.secondary,
button.button.secondary {
  border-color: var(--border-color);
  background-color: var(--surface-color);
  color: var(--text-color);
}

a.button.secondary:hover,
a.button.secondary:focus-visible,
button.button.secondary:hover,
button.button.secondary:focus-visible {
  border-color: var(--text-color);
  color: var(--text-color);
}

/* high-impact call-to-action */
a.button.accent,
button.button.accent {
  border-color: var(--link-color);
  background-color: var(--link-color);
  color: var(--background-color);
}

a.button.accent:hover,
a.button.accent:focus-visible,
button.button.accent:hover,
button.button.accent:focus-visible {
  border-color: var(--link-hover-color);
  background-color: var(--link-hover-color);
}

main img {
  max-width: 100%;
  width: auto;
  height: auto;
}

.icon {
  display: inline-block;
  height: 24px;
  width: 24px;
}

.icon img {
  height: 100%;
  width: 100%;
}

/* sections */
main > .section {
  margin: 96px 0;
}

main > .section > div {
  max-width: var(--content-width);
  margin: auto;
  padding: 0 20px;
}

main > .section:first-of-type {
  margin-top: 0;
}

main > .section > .default-content-wrapper > :first-child {
  margin-top: 0;
}

@media (width >= 900px) {
  main > .section > div {
    padding: 0 32px;
  }
}

/* section heading pattern: mono eyebrow (from section metadata) above the h2 */
main .section .default-content-wrapper > h2 {
  margin-bottom: 0;
}

body:not(.article) main .section .default-content-wrapper > h2 + p {
  max-width: 640px;
  color: var(--dark-color);
}

main .section .default-content-wrapper > h2 + p + .button-wrapper {
  margin-top: 16px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--link-hover-color);
  font-family: var(--mono-font-family);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* section metadata styles */
main .section.light,
main .section.highlight,
main .section.muted {
  margin: 0;
  padding: 96px 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  background-color: var(--light-color);
}

main .section.muted + .section {
  margin-top: 96px;
}

main .section.narrow > div {
  max-width: var(--reading-width);
}

/* article template: single reading column */
body.article main > .section > div {
  max-width: var(--reading-width);
}

body.article main > .section:first-of-type {
  padding-top: 48px;
}

body.article main h1 {
  font-size: clamp(34px, 5vw, 48px);
}

body.article main h2 {
  margin-top: 2em;
  font-size: var(--heading-font-size-l);
}

body.article main h3 {
  margin-top: 1.8em;
  font-size: var(--heading-font-size-m);
}

body.article main .default-content-wrapper > p:first-of-type > em:only-child {
  display: block;
  color: var(--dark-color);
  font-size: 1.12em;
  font-style: normal;
  line-height: 1.55;
}

body.article main picture {
  display: block;
}

body.article main li::marker {
  color: var(--dark-color);
}

body.article main picture img {
  display: block;
  width: 100%;
  margin: 32px 0 8px;
  border-radius: 10px;
}

/* wide figures break out of the reading column on large screens */
@media (width >= 1100px) {
  body.article main .default-content-wrapper > p:has(> picture:only-child) {
    margin-left: -120px;
    margin-right: -120px;
  }
}

/* blog index header */
main .section.blog-index {
  padding-top: 72px;
}

main .section.blog-index h1 + p {
  max-width: 640px;
  color: var(--dark-color);
  font-size: var(--body-font-size-m);
}

main .section.blog-index .article-list {
  margin-top: 56px;
}

/* spacing between a section intro and the block that follows it */
main > .section > .default-content-wrapper + div {
  margin-top: 48px;
}

main > .section > div + .default-content-wrapper {
  margin-top: 32px;
}

main > .section.hero-container + .section {
  margin-top: 0;
}

main .section .default-content-wrapper > .eyebrow + h1,
main .section .default-content-wrapper > .eyebrow + h2 {
  margin-top: 0;
}

/* contact call-to-action */
main .section.contact h2 {
  font-size: clamp(40px, 6vw, 64px);
  letter-spacing: -0.035em;
}

main .section.contact h2 + p {
  font-size: var(--body-font-size-m);
}
