/*
  Salebook's website: one stylesheet, in the app's look, light and dark.
  The colors are the app's, from Salebook/Components/Theme.swift: the brand header's
  blue band and cards on a grey page. The site uses the system font, as the app does,
  so there are no font files. No inline styles anywhere: the Content-Security-Policy
  in _headers allows only this file.
*/

:root {
  color-scheme: light dark;

  /* Surfaces (Theme.background, card, separator) */
  --background: #f2f2f7;
  --card: #ffffff;
  --separator: #ebebf0;

  /* Text (Theme.text, secondaryText) */
  --text: #1c1c1e;
  --text-secondary: #6e6e73;

  /* Accent (Theme.accentText) */
  --accent-text: #1f5fcc;
  --accent-underline: rgba(31, 95, 204, 0.4);

  /* Brand header (Theme.gradientStart, gradientEnd, headerTranslucent, onWhiteAccent) */
  --gradient-start: #2540c3;
  --gradient-end: #2368d9;
  --header-translucent: rgba(255, 255, 255, 0.18);
  --header-translucent-pressed: rgba(255, 255, 255, 0.28);
  --on-white-accent: #1f44c4;
  --on-band-secondary: rgba(255, 255, 255, 0.86);

  /* Type */
  --sans: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Space and shape (Theme.cardShape, headerShape) */
  --margin: 16px;
  --card-padding: 16px;
  --radius-card: 20px;
  --radius-header: 28px;
  --column: 680px;
  --column-wide: 960px;
}

@media (min-width: 720px) {
  :root {
    --margin: 24px;
    --card-padding: 24px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #000000;
    --card: #1c1c1e;
    --separator: #38383a;

    --text: #f5f5f7;
    --text-secondary: #98989f;

    --accent-text: #8db8ff;
    --accent-underline: rgba(141, 184, 255, 0.45);

    --gradient-start: #1d33a3;
    --gradient-end: #1f56bf;
    --header-translucent: rgba(255, 255, 255, 0.16);
    --header-translucent-pressed: rgba(255, 255, 255, 0.26);
    --on-white-accent: #1d3fb8;
  }
}

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

html {
  background: var(--background);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--background);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5rem;
  font-weight: 400;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  flex: 1;
}

img {
  display: block;
}

.column {
  width: 100%;
  max-width: calc(var(--column) + 2 * var(--margin));
  margin: 0 auto;
  padding: 0 var(--margin);
}

.column-wide {
  max-width: calc(var(--column-wide) + 2 * var(--margin));
}

a {
  color: var(--accent-text);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--accent-underline);
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-color: currentColor;
}

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

/*
  The blue band at the top of every page, as on the app's Orders, Products and
  Customers tabs: the brand gradient runs down and slightly to the right, ends about
  360px down and keeps its end color below, and the band's bottom corners are round.
*/

.band {
  background-color: var(--gradient-end);
  background-image: linear-gradient(165deg, var(--gradient-start), var(--gradient-end) 360px);
  border-radius: 0 0 var(--radius-header) var(--radius-header);
  color: #fff;
}

.band :focus-visible {
  outline-color: #fff;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: #fff;
  text-decoration: none;
  font-size: 1.25rem;
  line-height: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.brand img {
  width: 28px;
  height: 28px;
  border-radius: 6.5px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}

/* Support, as a translucent white capsule like the header's buttons. */
.capsule {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--header-translucent);
  color: #fff;
  font-size: 0.9375rem;
  line-height: 1.375rem;
  font-weight: 600;
  text-decoration: none;
}

.capsule:hover,
.capsule:active {
  background: var(--header-translucent-pressed);
  color: #fff;
}

/* Page titles, on the band. */

.page-head {
  padding-top: 12px;
  padding-bottom: 28px;
}

h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 2.375rem;
  font-weight: 700;
  letter-spacing: -0.6px;
}

.page-date {
  margin: 6px 0 0;
  color: var(--on-band-secondary);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

/* Home: the hero on the band, then the cards. */

.hero {
  padding-top: 20px;
  padding-bottom: 36px;
}

.app-icon {
  width: 96px;
  height: 96px;
  border-radius: 21.5px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3), 0 12px 32px rgba(0, 0, 0, 0.25);
}

.hero h1 {
  margin-top: 20px;
  font-size: 2.75rem;
  line-height: 3.125rem;
  letter-spacing: -1px;
}

.tagline {
  margin: 4px 0 0;
  color: var(--on-band-secondary);
  font-size: 1.375rem;
  line-height: 1.75rem;
  font-weight: 500;
  letter-spacing: -0.3px;
}

.hero .lead {
  max-width: 640px;
  margin: 20px 0 0;
  font-size: 1.0625rem;
  line-height: 1.625rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-top: 24px;
}

/* The App Store link, solid white like the header's main button. */
.band .button {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
  color: var(--on-white-accent);
  font-size: 1.0625rem;
  line-height: 1.375rem;
  font-weight: 600;
  text-decoration: none;
}

.band .button:hover,
.band .button:active {
  background: rgba(255, 255, 255, 0.9);
}

.hero .meta {
  margin: 0;
  color: var(--on-band-secondary);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.home {
  padding-top: 24px;
  padding-bottom: 56px;
}

.cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

@media (min-width: 720px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}

.card {
  padding: var(--card-padding);
  border-radius: var(--radius-card);
  background: var(--card);
}

.card h2 {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.card p {
  margin: 6px 0 0;
  color: var(--text-secondary);
}

/* Support and the Privacy Policy, on a card. */

.sheet {
  margin-top: 20px;
  margin-bottom: 48px;
  padding: 20px var(--card-padding) 28px;
  border-radius: var(--radius-card);
  background: var(--card);
}

@media (min-width: 720px) {
  .sheet {
    margin-top: 24px;
    padding: 32px 40px 40px;
  }
}

.prose p {
  margin: 12px 0 0;
}

.prose > :first-child {
  margin-top: 0;
}

.prose .lead {
  font-size: 1.0625rem;
  line-height: 1.625rem;
  font-weight: 500;
}

.prose h2 {
  margin: 28px 0 0;
  font-size: 1.25rem;
  line-height: 1.625rem;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.prose h2 + * {
  margin-top: 8px;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--separator);
}

.site-footer .column {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 24px;
  padding-top: 8px;
  padding-bottom: 24px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  column-gap: 20px;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.375rem;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--text);
  text-decoration-line: underline;
}

.site-footer a[aria-current="page"] {
  color: var(--text);
}

.site-footer p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  line-height: 1.125rem;
}

@media print {
  :root {
    color-scheme: light;
  }

  html,
  body {
    background: #fff;
    color: #000;
  }

  .band {
    background: none;
    border-radius: 0;
    color: #000;
  }

  .brand,
  .tagline,
  .page-date,
  .hero .meta,
  .card p,
  a {
    color: #000;
  }

  .card,
  .sheet {
    border: 1px solid #999;
    background: none;
  }

  .bar nav,
  .actions .button,
  .site-footer nav {
    display: none;
  }
}
