/* Source Sans 3 variable, latin: https://cdn.jsdelivr.net/npm/@fontsource-variable/source-sans-3@5.3.1/files/source-sans-3-latin-wght-normal.woff2 */

@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/source-sans-3-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;
}

@layer reset, base, tokens, components, utilities;

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

  body {
    margin: 0;
  }

  p,
  address {
    margin: 0;
  }
}

@layer base {
  html {
    font-optical-sizing: auto;
  }

  body {
    background: var(--lilac);
    color: var(--ink);
    font-family: "Source Sans 3", sans-serif;
    font-weight: 400;
    line-height: 1.4;
  }

  h1,
  h2,
  h3,
  h4 {
    text-wrap: balance;
  }

  p {
    text-wrap: pretty;
  }

  a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 0.15em;
  }

  a:focus-visible,
  button:focus-visible {
    outline: 0.1875rem solid var(--ink);
    outline-offset: 0.1875rem;
  }

  address {
    font-style: normal;
  }
}

@layer tokens {
  :root {
    --lilac: oklch(93.6715% 0.0323 289.5883); /* #e9e7ff */
    --red: oklch(54.6049% 0.2114 31.2293); /* #cf1d00 */
    --blue-text: oklch(51.9092% 0.1458 249.7103); /* #006bb8 */
    --leaf: oklch(79.4653% 0.1199 34.2389); /* #ff9f88 */
    --ink: oklch(0% 0 0); /* #000 */
    --white: oklch(100% 0 0); /* #fff */
    --bp-min: 22.5rem;
    --bp-max: 72rem;
    --text-heading: clamp(1.75rem, 1.75rem + (3rem - 1.75rem) * ((100vw - var(--bp-min)) / (var(--bp-max) - var(--bp-min))), 3rem);
    --text-body: clamp(1rem, 1rem + (1.125rem - 1rem) * ((100vw - var(--bp-min)) / (var(--bp-max) - var(--bp-min))), 1.125rem);
    --text-footer: 0.875rem;
    --logo-height: clamp(1.625rem, 0.9rem + 2.8vw, 3rem);
  }
}

@layer components {
  .wrap {
    width: calc(100% - 2rem);
    margin-inline: auto;
  }

  .skip {
    position: absolute;
    inset-block-start: 1rem;
    inset-inline-start: 1rem;
    z-index: 1;
    padding-block: 0.5rem;
    padding-inline: 0.8rem;
    background: var(--ink);
    color: var(--white);
    font-weight: 600;
    text-decoration: none;
    transform: translateY(-200%);

    &:focus {
      transform: none;
    }
  }

  .mast {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
    padding-block: 1.25rem;
  }

  .site-title {
    align-self: flex-start;
    color: var(--ink);
    font-size: var(--text-body);
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    text-wrap: balance;
  }

  .logo {
    display: block;
    flex: none;
    align-self: flex-start;
    width: auto;
    margin-inline-start: auto;
    color: var(--ink);
    text-decoration: none;

    & svg {
      display: block;
      width: auto;
      height: var(--logo-height);
    }
  }

  .poster {
    position: relative;

    & svg {
      display: block;
      width: 100%;
      height: auto;
    }

    & .poster-defs {
      position: absolute;
      width: 0;
      height: 0;
    }

    & .poster-narrow {
      display: none;
    }
  }

  .pen {
    fill: var(--leaf);
  }

  .words,
  .cell {
    fill: var(--red);
  }

  .sub {
    fill: var(--blue-text);
  }

  .grid {
    fill: none;
    stroke: var(--red);
  }

  .info {
    display: grid;
    gap: 1rem;
    justify-items: start;
    margin-block: 2.5rem;

    & p {
      max-width: 32rem;
      margin: 0;
      font-size: var(--text-body);
    }
  }

  .headline {
    margin: 0;
    color: var(--ink);
    font-size: var(--text-heading);
    font-weight: 600;
    line-height: 1.1;
  }

  .cta {
    display: inline-block;
    align-self: flex-start;
    margin-block-start: 0.5rem;
    padding-block: 0.7rem;
    padding-inline: 1.2rem;
    background: var(--ink);
    color: var(--white);
    font-size: var(--text-body);
    font-weight: 600;
    text-decoration: none;

    &:hover {
      background: var(--red);
    }
  }

  .site-footer {
    margin: 6rem auto 0;
    padding-block: 1.5rem 2.5rem;
    font-size: var(--text-footer);
    line-height: 1.4;

    & a {
      text-decoration: underline;
    }
  }

  .org {
    font-weight: 600;
  }

  .credit {
    margin-block-start: 1.5rem;
  }

  @media (max-width: 19rem) {
    .mast {
      flex-direction: column-reverse;
      align-items: flex-start;
      justify-content: flex-start;
    }

    .logo {
      margin-inline-start: 0;
    }
  }

  @media (max-width: 760px) {
    .poster .poster-wide {
      display: none;
    }

    .poster .poster-narrow {
      display: block;
    }
  }

  @media (forced-colors: active) {
    .cta {
      border: 0.125rem solid ButtonText;
    }
  }
}

@layer utilities {
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
}
