/*
 * The product layer: a page's structure, spacing, states and credit, as the identity style guide
 * draws them. Every brand value comes from the tenant layer's --brand-* names; the spacing and type
 * steps are the brand package's own. The theme follows the device through the names.
 */
:root {
  color-scheme: light dark;
}
*,
*::before {
  box-sizing: border-box;
}

/* One column on the ground: no card, no panel, no shadow. */
body {
  max-width: calc(26rem + 2 * var(--seam));
  margin: 0 auto;
  padding: var(--stack) var(--seam) var(--cell);
  background: var(--brand-ground);
  color: var(--brand-ink);
  font-family: var(--brand-type);
  font-weight: var(--brand-type-weight);
  font-size: var(--type-0);
  line-height: 1.5;
}
@media (max-width: 400px) {
  body {
    padding: var(--cell) var(--gap);
  }
}

.brand {
  margin: 0 0 var(--cell);
  font-size: var(--type-1);
  color: var(--brand-ink);
  overflow-wrap: anywhere;
}
h1 {
  margin: 0 0 var(--gap);
  font-size: var(--type-2);
  line-height: 1.1;
  font-family: var(--brand-type-title);
  font-weight: var(--brand-type-title-weight);
  font-variation-settings: var(--brand-type-title-cut);
  letter-spacing: var(--brand-type-title-tracking);
  text-wrap: balance;
  overflow-wrap: anywhere;
}
p,
ul {
  margin: 0 0 var(--gap);
}

/* The consent list: each item marked by one cell of the mark, in the accent. */
ul {
  list-style: none;
  padding: 0;
}
li {
  position: relative;
  padding-left: 1.25em;
}
li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 0.5em;
  height: 0.5em;
  border-radius: 0.1em;
  background: var(--brand-accent);
}

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

/* Actions: one per button, full width, stacked, the primary first. */
.actions {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  margin: calc(var(--seam) - var(--gap)) 0 0;
}
.actions form {
  display: contents;
}
button {
  width: 100%;
  min-height: 44px;
  padding: var(--gap) var(--seam);
  border: 1px solid var(--brand-muted);
  border-radius: var(--unit);
  background: var(--brand-ground);
  color: var(--brand-ink);
  font: inherit;
  font-weight: var(--brand-type-strong);
  text-align: center;
  cursor: pointer;
}
button:hover {
  border-color: var(--brand-ink);
}
button.primary {
  border-color: var(--brand-accent);
  background: var(--brand-accent);
  color: var(--brand-ground);
}
button.primary:hover {
  border-color: color-mix(in srgb, var(--brand-accent) 85%, var(--brand-ink));
  background: color-mix(in srgb, var(--brand-accent) 85%, var(--brand-ink));
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 3px;
  border-radius: var(--unit);
}

/*
 * A wide screen: two columns, as the mark has two nibbles. The brand line and the heading stand on
 * the left, a step larger; the matter stands on the right, its first line level with the heading;
 * the credit runs under both. The order a reader meets them does not change.
 */
@media (min-width: 56rem) {
  body {
    max-width: calc(64rem + 2 * var(--seam));
  }
  main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: var(--cell-seam);
    align-items: start;
  }
  /* The lockup keeps its own width, so the mark stays three quarters of the name's. */
  .brand {
    grid-area: 1 / 1;
    justify-self: start;
    font-size: var(--type-2);
  }
  h1 {
    grid-area: 2 / 1;
    font-size: var(--type-3);
  }
  .matter {
    grid-area: 2 / 2;
  }
  .matter > :first-child {
    margin-top: 0;
  }
}

/*
 * The credit: who runs the sign-in, quiet, after a hairline. Its size sits below the guide's
 * smallest step, a value only the credit uses.
 */
.credit {
  margin-top: var(--cell-seam);
  padding-top: var(--seam);
  border-top: 1px solid var(--brand-rule);
  color: var(--brand-muted);
  font-size: 0.875rem;
}
.credit p {
  margin: 0;
}
.credit a {
  color: var(--brand-muted);
}
/* nod, set as a name: the wordmark's cut, standing first and apart. */
.product {
  font-family: var(--brand-type-wordmark);
  font-weight: var(--brand-type-wordmark-weight);
  font-variation-settings: var(--brand-type-wordmark-cut);
  letter-spacing: var(--brand-type-wordmark-tracking);
}
.maker {
  white-space: nowrap;
}
/*
 * snackbyte's mark beside its name in the credit, as snackbyte's guide sets its beside lockup: on
 * the baseline, as tall as the x-height, one seam before the name. The word before it stands the
 * same seam away, so the mark leans toward neither. Both are measured ink to ink: the margins
 * take back the space and the letters' own side bearings in the text face.
 */
.maker .mark {
  width: auto;
  height: 1ex;
  margin-left: 0.024em;
  margin-right: calc(0.7ex - 0.05em);
  vertical-align: baseline;
}
/* A mark's shapes, wherever it is drawn, fill by their role. */
.mark .ink {
  fill: var(--brand-ink);
}
.mark .sky {
  fill: var(--brand-accent);
}

/*
 * A provider's button follows the provider's own branding rules, which fix its colours and type;
 * these blocks are the only place the product layer holds either.
 */
@font-face {
  font-family: 'Google Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/google-sans/medium-latin.woff2') format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
button.provider-google {
  padding: 0 12px;
  border: 1px solid #747775;
  background: #ffffff;
  color: #1f1f1f;
  font-family: 'Google Sans', Roboto, Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}
@media (prefers-color-scheme: dark) {
  button.provider-google {
    border-color: #8e918f;
    background: #131314;
    color: #e3e3e3;
  }
}

/*
 * On paper: the words and every control's edge in the system's text colour, and no ground. Last in
 * the file, so it holds over a provider's block too. The marks keep their colours.
 */
@media print {
  body,
  .brand,
  a,
  .credit,
  .credit a,
  button,
  button.primary,
  button.provider-google {
    background: none;
    color: CanvasText;
  }
  button,
  button.primary,
  button.provider-google {
    border-color: CanvasText;
  }
}
