/*
 * Styles of the website only. tokens.css and base.css are copies from the
 * application and stay unchanged, so the site and the app look the same.
 * Colours come only from the --sw-* tokens; never add text-transform.
 */

html {
  scroll-padding-block-start: var(--sw-space-24);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* Header: brand, section links and theme switch. */

.site-masthead {
  padding-inline: max(var(--sw-space-16), (100% - var(--sw-content-max)) / 2);
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sw-space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: flex;
  align-items: center;
  min-block-size: var(--sw-target-min);
  padding-inline: var(--sw-space-12);
  border-radius: var(--sw-radius-control);
  color: var(--sw-text);
  font-weight: var(--sw-font-weight-semibold);
  text-decoration: none;
}

.site-nav a:hover {
  background: var(--sw-surface-muted);
}

/* On narrow screens the links get their own row below brand and switch. */
@media (max-width: 47.99rem) {
  .site-nav {
    order: 3;
    inline-size: 100%;
  }

  .site-nav a {
    padding-inline: var(--sw-space-8);
  }
}

/* Content column. */

main {
  margin-inline: auto;
  max-inline-size: calc(var(--sw-content-max) + 2 * var(--sw-space-40));
}

@media (min-width: 64rem) {
  main {
    padding-block-start: var(--sw-space-64);
  }
}

.section {
  margin-block-start: var(--sw-space-64);
}

.section > h2 {
  font-size: var(--sw-font-size-title);
  line-height: var(--sw-line-height-title);
}

.more {
  margin-block-start: var(--sw-space-16);
}

code {
  font-family: var(--sw-font-mono);
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

/* Hero. */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sw-space-32);
  align-items: center;
  margin-block-end: var(--sw-space-40);
}

@media (min-width: 56rem) {
  .hero {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  }
}

.hero h1 {
  font-size: var(--sw-font-size-display);
  line-height: var(--sw-line-height-display);
  margin-block-end: var(--sw-space-16);
}

.hero .lead {
  margin-block-end: var(--sw-space-32);
}

.eyebrow {
  display: inline-block;
  margin-block-end: var(--sw-space-16);
  padding: var(--sw-space-4) var(--sw-space-12);
  border-radius: var(--sw-radius-pill);
  background: var(--sw-primary-soft);
  color: var(--sw-on-primary-soft);
  font-size: var(--sw-font-size-compact);
  line-height: var(--sw-line-height-compact);
  font-weight: var(--sw-font-weight-semibold);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sw-space-12) var(--sw-space-16);
}

.button-secondary {
  border: 1px solid var(--sw-control-border);
  background: var(--sw-surface);
  color: var(--sw-text);
}

.button-secondary:hover {
  background: var(--sw-surface-muted);
}

/* The logo, large. Decorative: the brand link already names the project. */
.hero-art {
  justify-self: center;
  inline-size: min(100%, 15rem);
}

.hero-art img {
  inline-size: 100%;
  block-size: auto;
}

@media (max-width: 55.99rem) {
  .hero-art {
    display: none;
  }
}

/* Cards in a grid. */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
  gap: var(--sw-space-24);
  margin: var(--sw-space-24) 0 0;
  padding: 0;
  list-style: none;
}

/* Six cards read best as two rows of three. */
@media (min-width: 64rem) {
  .feature-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.feature-grid .card {
  margin: 0;
}

.feature h3 {
  margin-block-end: var(--sw-space-8);
}

.icon-tile {
  display: inline-grid;
  place-items: center;
  inline-size: var(--sw-space-48);
  block-size: var(--sw-space-48);
  margin-block-end: var(--sw-space-16);
  border-radius: var(--sw-radius-control);
  color: var(--sw-on-accent);
}

.icon-tile svg {
  inline-size: var(--sw-icon-size-large);
  block-size: var(--sw-icon-size-large);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tile-violet {
  background: var(--sw-accent-violet);
}

.tile-aqua {
  background: var(--sw-accent-aqua);
}

.tile-lime {
  background: var(--sw-accent-lime);
}

.tile-peach {
  background: var(--sw-accent-peach);
}

.tile-sun {
  background: var(--sw-accent-sun);
}

.two-up {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: var(--sw-space-24);
  margin-block-start: var(--sw-space-24);
}

.two-up .card {
  margin: 0;
}

.check-list,
.open-list {
  display: grid;
  gap: var(--sw-space-8);
  margin: 0;
  padding-inline-start: var(--sw-space-20);
}

/* Commands to copy. A long line scrolls inside the block, not the page. */

.code {
  margin-block: var(--sw-space-16);
  padding: var(--sw-space-16) var(--sw-space-20);
  overflow-x: auto;
  border: 1px solid var(--sw-border);
  border-radius: var(--sw-radius-card);
  background: var(--sw-surface);
  max-inline-size: var(--sw-reading-width);
  line-height: var(--sw-line-height-body);
}

.code code {
  overflow-wrap: normal;
}

/* Questions and answers. */

.faq {
  display: grid;
  gap: var(--sw-space-12);
  margin-block-start: var(--sw-space-24);
  max-inline-size: calc(var(--sw-reading-width) + 2 * var(--sw-space-24));
}

.faq details {
  border-radius: var(--sw-radius-card);
  background: var(--sw-surface);
  box-shadow: var(--sw-shadow-card);
}

.faq summary {
  display: flex;
  align-items: center;
  min-block-size: var(--sw-target-min);
  padding: var(--sw-space-12) var(--sw-space-20);
  border-radius: var(--sw-radius-card);
  font-weight: var(--sw-font-weight-semibold);
  cursor: pointer;
}

.faq summary:hover {
  background: var(--sw-surface-muted);
}

.faq details p {
  padding: 0 var(--sw-space-20) var(--sw-space-16);
}

/* Footer. */

.site-footer {
  margin-block-start: var(--sw-space-64);
  padding-inline: max(var(--sw-space-16), (100% - var(--sw-content-max)) / 2);
}

.site-footer p {
  max-inline-size: none;
  margin-block-end: var(--sw-space-4);
}

@media (forced-colors: active) {
  .faq details,
  .icon-tile {
    border: 1px solid CanvasText;
  }
}

/* More room on wide screens: the page should feel calm and unhurried. */
@media (min-width: 64rem) {
  .section {
    margin-block-start: calc(var(--sw-space-64) * 1.5);
  }

  .hero {
    padding-block: var(--sw-space-32) var(--sw-space-48);
  }

  .hero-art {
    inline-size: min(100%, 16rem);
  }

  .feature-grid .card,
  .two-up .card {
    padding: var(--sw-space-32);
  }
}

/* The four steps, on a soft violet band. */

.steps-band {
  padding: var(--sw-space-32) var(--sw-space-20);
  border-radius: var(--sw-radius-hero);
  background: var(--sw-primary-soft);
}

@media (min-width: 64rem) {
  .steps-band {
    padding: var(--sw-space-64) var(--sw-space-48);
  }
}

.band-lead {
  color: var(--sw-text);
  font-size: var(--sw-font-size-heading-small);
  line-height: var(--sw-line-height-heading-small);
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: var(--sw-space-24);
  margin: var(--sw-space-32) 0 0;
  padding: 0;
  list-style: none;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: var(--sw-space-24);
  border-radius: var(--sw-radius-card);
  background: var(--sw-surface);
  box-shadow: var(--sw-shadow-card);
}

.step p {
  flex: 1;
  margin-block-end: var(--sw-space-16);
}

.step-tile {
  display: grid;
  place-items: center;
  inline-size: var(--sw-space-64);
  block-size: var(--sw-space-64);
  margin-block-end: var(--sw-space-16);
  border-radius: var(--sw-radius-card);
  color: var(--sw-on-accent);
}

.step-tile svg,
.mini-tile svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.step-number {
  color: var(--sw-text-muted);
  font-size: var(--sw-font-size-compact);
  line-height: var(--sw-line-height-compact);
  font-weight: var(--sw-font-weight-semibold);
}

.step h3 {
  margin-block: var(--sw-space-4) var(--sw-space-8);
}

/* The text says what is there; the border style only repeats it. */
.tag {
  padding: var(--sw-space-4) var(--sw-space-12);
  border: 1px solid var(--sw-control-border);
  border-radius: var(--sw-radius-pill);
  color: var(--sw-text);
  font-size: var(--sw-font-size-compact);
  line-height: var(--sw-line-height-compact);
  font-weight: var(--sw-font-weight-semibold);
}

.tag-planned {
  border-style: dashed;
  color: var(--sw-text-muted);
}

.list-title {
  display: flex;
  align-items: center;
  gap: var(--sw-space-12);
  margin-block-end: var(--sw-space-16);
}

.mini-tile {
  display: inline-grid;
  place-items: center;
  inline-size: var(--sw-space-32);
  block-size: var(--sw-space-32);
  border-radius: var(--sw-radius-small);
  color: var(--sw-on-accent);
}

@media (forced-colors: active) {
  .steps-band,
  .step,
  .step-tile,
  .mini-tile {
    border: 1px solid CanvasText;
  }
}

/* Footer links. */

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sw-space-4) var(--sw-space-16);
  margin: 0 0 var(--sw-space-8);
  padding: 0;
  list-style: none;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--sw-target-min);
}

/* Legal pages: one readable column. */

.legal {
  max-inline-size: calc(var(--sw-reading-width) + 2 * var(--sw-space-40));
}

.legal h2 {
  margin-block-start: var(--sw-space-40);
}

.legal-date {
  margin-block-start: var(--sw-space-40);
  color: var(--sw-text-muted);
}

/* An image that exists once per theme, by the same rules as tokens.css. */
.theme-dark-only {
  display: none;
}

@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-light-only {
    display: none;
  }

  :root:not([data-theme="light"]) .theme-dark-only {
    display: revert;
  }
}

@media screen {
  :root[data-theme="dark"] .theme-light-only {
    display: none;
  }

  :root[data-theme="dark"] .theme-dark-only {
    display: revert;
  }
}

/* Two short sections next to each other on wide screens. */
.side-by-side {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sw-space-64);
}

@media (min-width: 64rem) {
  .side-by-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.side-by-side > section > h2 {
  font-size: var(--sw-font-size-title);
  line-height: var(--sw-line-height-title);
}
