/*
 * 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.
 */

/* ---------------------------------------------------------------------------
 * loom design system: "ink and thread"
 * A dark, ink-coloured canvas crossed by luminous warp (violet) and weft (cyan)
 * threads, with coral and amber as the accents where the thread is pulled tight.
 * ------------------------------------------------------------------------- */
:root {
  /* colors */
  --background-color: #07070d;
  --light-color: #0f1019;
  --surface-color: #141524;
  --surface-raised-color: #1b1d31;
  --dark-color: #a3a8c3;
  --text-color: #eef0fa;
  --link-color: #9aa9ff;
  --link-hover-color: #c2cbff;
  --line-color: rgb(255 255 255 / 10%);
  --line-strong-color: rgb(255 255 255 / 22%);

  /* threads */
  --thread-warp: #7c5cff;
  --thread-weft: #22d3ee;
  --thread-coral: #ff6a88;
  --thread-amber: #ffd166;
  --thread-mint: #5eead4;
  --thread-gradient: linear-gradient(100deg, var(--thread-warp), var(--thread-weft) 55%, var(--thread-mint));
  --thread-gradient-warm: linear-gradient(100deg, var(--thread-coral), var(--thread-amber));

  /* fonts */
  --body-font-family: roboto, roboto-fallback, sans-serif;
  --heading-font-family: roboto-condensed, roboto-condensed-fallback, sans-serif;
  --mono-font-family: ui-monospace, 'SF Mono', sfmono-regular, menlo, consolas, 'Liberation Mono', monospace;

  /* body sizes */
  --body-font-size-m: 20px;
  --body-font-size-s: 17px;
  --body-font-size-xs: 15px;

  /* heading sizes */
  --heading-font-size-xxl: 52px;
  --heading-font-size-xl: 40px;
  --heading-font-size-l: 30px;
  --heading-font-size-m: 24px;
  --heading-font-size-s: 21px;
  --heading-font-size-xs: 18px;

  /* layout */
  --nav-height: 68px;
  --radius-m: 14px;
  --radius-l: 22px;
  --section-space: 72px;
}

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

@font-face {
  font-family: roboto-fallback;
  size-adjust: 99.529%;
  src: local('Arial');
}

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

    /* heading sizes */
    --heading-font-size-xxl: 84px;
    --heading-font-size-xl: 56px;
    --heading-font-size-l: 34px;
    --heading-font-size-m: 24px;
    --heading-font-size-s: 20px;
    --heading-font-size-xs: 18px;
    --section-space: 112px;
  }
}

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.6;
  -webkit-font-smoothing: antialiased;
}

body.appear {
  display: block;
}

/* the loom: a fixed weave of warp and weft threads that fades out towards the edges */
body::before {
  content: '';
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 50% at 85% 0%, rgb(124 92 255 / 16%), transparent 70%),
    radial-gradient(50% 40% at 0% 30%, rgb(34 211 238 / 9%), transparent 70%),
    repeating-linear-gradient(90deg, rgb(124 92 255 / 7%) 0 1px, transparent 1px 36px),
    repeating-linear-gradient(0deg, rgb(34 211 238 / 5%) 0 1px, transparent 1px 36px);
  mask-image: linear-gradient(to bottom, #000, rgb(0 0 0 / 35%));
}

::selection {
  background: var(--thread-warp);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--thread-weft);
  outline-offset: 3px;
}

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: 0.8em;
  margin-bottom: 0.25em;
  font-family: var(--heading-font-family);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.015em;
  scroll-margin: calc(var(--nav-height) + 24px);
  text-wrap: balance;
}

h1 { font-size: var(--heading-font-size-xxl); }
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); }

/* an emphasised word in a heading is drawn with the thread gradient */
h1 em,
h2 em,
h3 em {
  background: var(--thread-gradient);
  background-clip: text;
  color: transparent;
  font-style: normal;
  -webkit-text-fill-color: transparent;
}

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

main p {
  color: var(--dark-color);
  text-wrap: pretty;
}

main strong {
  color: var(--text-color);
  font-weight: 500;
}

code,
pre {
  font-family: var(--mono-font-family);
  font-size: var(--body-font-size-xs);
}

:not(pre) > code {
  border: 1px solid var(--line-color);
  border-radius: 6px;
  padding: 0.1em 0.4em;
  background: var(--surface-color);
  color: var(--thread-mint);
}

pre {
  padding: 16px;
  border: 1px solid var(--line-color);
  border-radius: var(--radius-m);
  background-color: var(--light-color);
  overflow-x: auto;
  white-space: pre;
}

blockquote {
  margin-inline: 0;
  border-left: 3px solid var(--thread-warp);
  padding-left: 20px;
  font-size: var(--heading-font-size-s);
}

hr {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--line-strong-color), transparent);
}

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

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

/* links */
a:any-link {
  color: var(--link-color);
  text-decoration: none;
  overflow-wrap: break-word;
}

a:hover {
  color: var(--link-hover-color);
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

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

a.button:hover,
button.button:hover {
  transform: translateY(-2px);
  text-decoration: none;
}

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

/* **link** */
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: #fff;
  background-color: #fff;
  color: var(--background-color);
  box-shadow: 0 8px 30px rgb(255 255 255 / 18%);
}

/* *link* */
a.button.secondary,
button.button.secondary {
  border-color: var(--line-strong-color);
  background-color: rgb(255 255 255 / 4%);
  color: var(--text-color);
  backdrop-filter: blur(6px);
}

a.button.secondary:hover,
a.button.secondary:focus-visible,
button.button.secondary:hover,
button.button.secondary:focus-visible {
  border-color: var(--thread-weft);
  background-color: rgb(34 211 238 / 10%);
  color: var(--text-color);
}

/* ***link***: high-impact call-to-action */
a.button.accent,
button.button.accent {
  border-color: transparent;
  background: var(--thread-gradient);
  color: #05050a;
  font-weight: 700;
}

a.button.accent:hover,
a.button.accent:focus-visible,
button.button.accent:hover,
button.button.accent:focus-visible {
  color: #05050a;
  box-shadow: 0 8px 36px rgb(124 92 255 / 45%), 0 0 0 1px rgb(255 255 255 / 25%) inset;
}

a.button.primary[aria-disabled="true"],
a.button.secondary[aria-disabled="true"],
a.button.accent[aria-disabled="true"],
button.button:disabled {
  background: var(--surface-color);
  border-color: var(--surface-color);
  color: var(--dark-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: 0;
  padding: calc(var(--section-space) / 2) 0;
}

main > .section > div {
  max-width: 1200px;
  margin: auto;
  padding: 0 24px;
}

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

@media (width >= 900px) {
  main > .section {
    padding: var(--section-space) 0;
  }

  main > .section > div {
    padding: 0 32px;
  }
}

/* consecutive blocks inside a section breathe */
main > .section > div + div {
  margin-top: 40px;
}

/* section metadata: Style = center | band | paper | glow | cta (combine with commas) */
main .section.center .default-content-wrapper {
  text-align: center;
}

main .section.center .default-content-wrapper p {
  margin-inline: auto;
  max-width: 62ch;
}

main .section.center .default-content-wrapper .button-wrapper {
  margin-inline: 6px;
}

/* a mono eyebrow above a heading: authored as the paragraph before it, see scripts.js */
main p.eyebrow {
  margin: 0 0 8px;
  color: var(--thread-weft);
  font-family: var(--mono-font-family);
  font-size: var(--body-font-size-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

main p.eyebrow::before {
  content: '';
  display: inline-block;
  width: 28px;
  height: 2px;
  margin-right: 12px;
  vertical-align: middle;
  background: var(--thread-gradient);
}

main .section.center p.eyebrow::after {
  content: '';
  display: inline-block;
  width: 28px;
  height: 2px;
  margin-left: 12px;
  vertical-align: middle;
  background: var(--thread-gradient);
}

main .section.band,
main .section.light,
main .section.highlight {
  border-block: 1px solid var(--line-color);
  background: linear-gradient(180deg, var(--light-color), rgb(15 16 25 / 60%));
}

main .section.glow {
  background:
    radial-gradient(50% 70% at 50% 0%, rgb(124 92 255 / 22%), transparent 70%),
    radial-gradient(40% 60% at 100% 100%, rgb(34 211 238 / 12%), transparent 70%);
}

/* paper: the one light section, for contrast */
main .section.paper {
  --text-color: #10111c;
  --dark-color: #4a4e68;
  --line-color: rgb(16 17 28 / 12%);
  --surface-color: #fff;
  --surface-raised-color: #fff;
  --link-color: #4b34d8;
  --thread-weft: #0891b2;
  --thread-mint: #0f766e;

  background: #f3f1ea;
  color: var(--text-color);
}

main .section.cta {
  position: relative;
  overflow: hidden;
  border-block: 1px solid var(--line-color);
  background:
    radial-gradient(60% 100% at 50% 100%, rgb(124 92 255 / 35%), transparent 70%),
    radial-gradient(40% 60% at 10% 0%, rgb(34 211 238 / 18%), transparent 70%),
    var(--light-color);
}

main .section.cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(90deg, rgb(255 255 255 / 5%) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(0deg, rgb(255 255 255 / 4%) 0 1px, transparent 1px 28px);
  mask-image: radial-gradient(70% 90% at 50% 50%, #000, transparent);
  pointer-events: none;
}

main .section.cta > div {
  position: relative;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
