/*
 * WYRDEN LTD: site styles
 *
 * Hand-built Material 3 components on top of the tokens in tokens.css, using
 * the expressive side of the system: tonal colour in three hues, the M3 shape
 * library (cookies, clovers, flowers, pills), emphasized type and springs.
 *
 * Contents:
 *    1. Fonts              8. Buttons            15. Feature card and findings
 *    2. Base               9. Cards and chips    16. Process steps
 *    3. Accessibility     10. Top app bar        17. Panels: about and contact
 *    4. Icons             11. Navigation drawer  18. Text pages and 404
 *    5. Tones             12. Hero               19. Footer
 *    6. Shapes            13. Shape collage      20. Motion
 *    7. State layers      14. Sections           21. Contrast and print
 *
 * Window size classes: compact < 600px, medium 600–839px,
 * expanded 840–1199px, large ≥ 1200px.
 */

/* ==========================================================================
   1. Fonts
   The two @font-face rules are written by tools/fonts.mjs (`npm run fonts`).
   ========================================================================== */

/* BEGIN GENERATED FONT FACES */
@font-face {
  font-family: "Roboto Flex";
  font-style: normal;
  font-weight: 400 900;
  font-stretch: 100% 151%;
  font-display: swap;
  src: url("/assets/fonts/roboto-flex.a7f6e338cc.woff2") format("woff2");
  unicode-range: U+20-7E, U+A0, U+A3, U+A9, U+B7, U+2013-2014, U+2018-2019, U+201C-201D, U+2026;
}

@font-face {
  font-family: "Material Symbols Outlined";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("/assets/fonts/material-symbols-outlined.b8c4d822c0.woff2") format("woff2");
}
/* END GENERATED FONT FACES */

/* Arial resized to Roboto Flex's proportions. It is shown for the moment
   before the web font arrives, so the text does not reflow when it swaps.
   There is one face per style the site sets: body text, bold labels, the
   wide headings and the extra-wide display wordmark. */
@font-face {
  font-family: "Roboto Flex Fallback";
  font-weight: 400 599;
  font-stretch: 100% 151%;
  src: local("Arial");
  size-adjust: 99.2%;
  ascent-override: 93.52%;
  descent-override: 24.61%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Roboto Flex Fallback";
  font-weight: 600 900;
  font-stretch: 100% 105%;
  src: local("Arial Bold"), local("Arial-BoldMT");
  size-adjust: 97.2%;
  ascent-override: 95.44%;
  descent-override: 25.11%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Roboto Flex Fallback";
  font-weight: 600 900;
  font-stretch: 106% 120%;
  src: local("Arial Bold"), local("Arial-BoldMT");
  size-adjust: 100%;
  ascent-override: 92.77%;
  descent-override: 24.41%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Roboto Flex Fallback";
  font-weight: 600 900;
  font-stretch: 121% 151%;
  src: local("Arial Bold"), local("Arial-BoldMT");
  size-adjust: 107.1%;
  ascent-override: 86.62%;
  descent-override: 22.79%;
  line-gap-override: 0%;
}

/* ==========================================================================
   2. Base
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 16px;
}

/* The app bar is sticky whenever the drawer is available (scripting on) and
   on wide screens, so anchor targets must clear it. */
html.js {
  scroll-padding-top: calc(var(--layout-app-bar-height) + 16px);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background-color: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  font: var(--md-sys-typescale-body-large);
  letter-spacing: var(--md-sys-typescale-body-large-tracking);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  flex: 1 0 auto;
}

main:focus {
  outline: none;
}

h1,
h2,
h3,
h4,
p,
ul,
ol {
  margin: 0;
}

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

p {
  text-wrap: pretty;
}

ul[role="list"],
ol[role="list"] {
  padding: 0;
  list-style: none;
}

svg {
  display: block;
}

a {
  color: var(--md-sys-color-primary);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

@media (hover: hover) {
  a:hover {
    text-decoration-style: wavy;
  }
}

::selection {
  background-color: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
}

/* ==========================================================================
   3. Accessibility
   ========================================================================== */

:focus-visible {
  outline: var(--md-sys-state-focus-indicator-thickness) solid var(--md-sys-color-secondary);
  outline-offset: var(--md-sys-state-focus-indicator-outer-offset);
}

.skip-link {
  position: absolute;
  z-index: 40;
  top: 12px;
  left: 12px;
  padding: 10px 24px;
  border-radius: var(--md-sys-shape-corner-full);
  background-color: var(--md-sys-color-inverse-surface);
  color: var(--md-sys-color-inverse-on-surface);
  font: var(--md-sys-typescale-label-large);
  letter-spacing: var(--md-sys-typescale-label-large-tracking);
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
  outline-color: var(--md-sys-color-inverse-primary);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Keeps a hyphenated term such as "open-source" on one line. */
.nowrap {
  white-space: nowrap;
}

/* Controls that need JavaScript stay out of the page until it has run. */
.js-only {
  display: none;
}

/* ==========================================================================
   4. Icons (Material Symbols Outlined, drawn by ligature: the element's
      text is the icon name)
   ========================================================================== */

.icon {
  display: inline-block;
  flex: none;
  width: 1em;
  height: 1em;
  overflow: hidden;
  font-family: "Material Symbols Outlined";
  font-size: 1.5rem;
  font-style: normal;
  font-weight: 400;
  font-stretch: normal;
  font-feature-settings: "liga";
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
}

/* ==========================================================================
   5. Tones
   A tone class sets a colour pair: --tone for a fill and --on-tone for the
   text or icon on top of it. Containers, chips and shapes all read the pair,
   so recolouring any of them is a one-word change in the HTML.
   ========================================================================== */

.tone-primary {
  --tone: var(--md-sys-color-primary);
  --on-tone: var(--md-sys-color-on-primary);
}

.tone-primary-container {
  --tone: var(--md-sys-color-primary-container);
  --on-tone: var(--md-sys-color-on-primary-container);
}

.tone-primary-fixed-dim {
  --tone: var(--md-sys-color-primary-fixed-dim);
  --on-tone: var(--md-sys-color-on-primary-fixed);
}

.tone-secondary {
  --tone: var(--md-sys-color-secondary);
  --on-tone: var(--md-sys-color-on-secondary);
}

.tone-secondary-container {
  --tone: var(--md-sys-color-secondary-container);
  --on-tone: var(--md-sys-color-on-secondary-container);
}

.tone-secondary-fixed-dim {
  --tone: var(--md-sys-color-secondary-fixed-dim);
  --on-tone: var(--md-sys-color-on-secondary-fixed);
}

.tone-tertiary {
  --tone: var(--md-sys-color-tertiary);
  --on-tone: var(--md-sys-color-on-tertiary);
}

.tone-tertiary-container {
  --tone: var(--md-sys-color-tertiary-container);
  --on-tone: var(--md-sys-color-on-tertiary-container);
}

.tone-tertiary-fixed {
  --tone: var(--md-sys-color-tertiary-fixed);
  --on-tone: var(--md-sys-color-on-tertiary-fixed);
}

.tone-surface {
  --tone: var(--md-sys-color-surface-container-lowest);
  --on-tone: var(--md-sys-color-primary);
}

/* ==========================================================================
   6. Shapes
   A "blob" is one shape from the library in the page (see the <svg
   class="shape-defs"> block in each HTML file), filled with the current tone,
   with an optional icon or numeral centred on top.
   ========================================================================== */

.shape-defs {
  position: absolute;
}

.blob {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  aspect-ratio: 1;
}

.blob__shape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: var(--tone);
}

.blob > .icon,
.blob__label {
  position: relative;
  color: var(--on-tone);
}

.blob__label {
  font: var(--md-sys-typescale-title-large);
  font-weight: var(--md-sys-typescale-emphasized-display-weight);
  font-stretch: var(--md-sys-typescale-emphasized-headline-width);
}

.blob--badge {
  width: 56px;
}

.blob--badge > .icon {
  font-size: 1.75rem;
}

/* ==========================================================================
   7. State layers
   A translucent overlay in the content colour: 8% on hover, 10% on focus
   and press.
   ========================================================================== */

.button,
.icon-button,
.nav-link,
.nav-drawer__item {
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.button::before,
.icon-button::before,
.nav-link::before,
.nav-drawer__item::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-color: currentColor;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--md-sys-motion-duration-short2) linear;
}

@media (hover: hover) {
  .button:hover::before,
  .icon-button:hover::before,
  .nav-link:hover::before,
  .nav-drawer__item:hover::before {
    opacity: var(--md-sys-state-hover-state-layer-opacity);
  }
}

.button:focus-visible::before,
.icon-button:focus-visible::before,
.nav-link:focus-visible::before,
.nav-drawer__item:focus-visible::before {
  opacity: var(--md-sys-state-focus-state-layer-opacity);
}

.button:active::before,
.icon-button:active::before,
.nav-link:active::before,
.nav-drawer__item:active::before {
  opacity: var(--md-sys-state-pressed-state-layer-opacity);
}

/* ==========================================================================
   8. Buttons
   M3 Expressive buttons: fully rounded at rest, and the corners tighten while
   the button is pressed. The radius is written as half the height rather than
   as "full" so that the change can animate.
   ========================================================================== */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
  min-height: 40px;
  padding: 10px 24px;
  border: 0;
  border-radius: 20px;
  font: var(--md-sys-typescale-label-large);
  font-weight: var(--md-sys-typescale-emphasized-label-weight);
  letter-spacing: var(--md-sys-typescale-label-large-tracking);
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition:
    border-radius var(--md-sys-motion-spring-fast-spatial),
    box-shadow var(--md-sys-motion-spring-default-effects);
}

.button:active {
  border-radius: var(--md-sys-shape-corner-small);
}

/* Extends the touch target to 48px without changing the 40px shape. */
.button::after {
  content: "";
  position: absolute;
  inset: -4px 0;
}

.button .icon {
  font-size: 1.125rem;
}

.button--icon-leading {
  padding-inline-start: 16px;
}

.button--icon-trailing {
  padding-inline-end: 16px;
}

/* Medium size from the M3 Expressive button scale. */
.button--large {
  min-height: 56px;
  padding: 16px 32px;
  border-radius: 28px;
  font: var(--md-sys-typescale-title-medium);
  font-weight: var(--md-sys-typescale-emphasized-title-weight);
  letter-spacing: var(--md-sys-typescale-title-medium-tracking);
}

.button--large:active {
  border-radius: var(--md-sys-shape-corner-medium);
}

.button--large::after {
  inset: 0;
}

.button--large .icon {
  font-size: 1.5rem;
}

.button--large.button--icon-leading {
  padding-inline-start: 24px;
}

.button--filled {
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

.button--tonal {
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

/* For use on a primary-coloured panel. */
.button--on-primary {
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

@media (hover: hover) {
  .button--filled:hover,
  .button--tonal:hover,
  .button--on-primary:hover {
    box-shadow: var(--md-sys-elevation-level1);
  }
}

.button--text {
  padding-inline: 12px;
  background-color: transparent;
  color: var(--md-sys-color-primary);
}

.button--text.button--icon-trailing {
  padding-inline: 12px 12px;
}

/* Lines a text button's label up with the text above it. */
.button--flush {
  margin-inline-start: -12px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Icon button: a 40px shape with a 48px touch target. */
.icon-button {
  flex: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 4px;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background-color: transparent;
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
  transition: border-radius var(--md-sys-motion-spring-fast-spatial);
}

.icon-button:active {
  border-radius: var(--md-sys-shape-corner-medium);
}

.icon-button::after {
  content: "";
  position: absolute;
  inset: -4px;
}

.icon-button:not(.js-only) {
  display: inline-flex;
}

.js .icon-button.js-only {
  display: inline-flex;
}

.icon-button--tonal {
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

/* ==========================================================================
   9. Cards and chips
   ========================================================================== */

.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  border-radius: var(--md-sys-shape-corner-extra-large);
}

/* Filled with the current tone (see section 5). */
.card--tonal {
  background-color: var(--tone);
  color: var(--on-tone);
}

.card--outlined {
  border: 2px solid var(--md-sys-color-outline-variant);
  background-color: var(--md-sys-color-surface);
}

.card > .blob {
  margin-bottom: 12px;
}

.card__title {
  font: var(--md-sys-typescale-title-large);
  font-weight: var(--md-sys-typescale-emphasized-title-weight);
  font-stretch: var(--md-sys-typescale-emphasized-title-width);
  letter-spacing: var(--md-sys-typescale-title-large-tracking);
}

.card__text {
  font: var(--md-sys-typescale-body-medium);
  letter-spacing: var(--md-sys-typescale-body-medium-tracking);
}

.card--outlined .card__text {
  color: var(--md-sys-color-on-surface-variant);
}

/* A link in a filled card takes the card's own text colour, which is the
   pair that the contrast check covers. */
.card--tonal .card__text a {
  color: inherit;
}

.card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.card-grid {
  display: grid;
  gap: var(--layout-gutter);
}

@media (min-width: 600px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .card-grid--four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Chips: static tags, in the M3 chip shape. */
.chip-set {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 16px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-small);
  color: var(--md-sys-color-on-surface-variant);
  font: var(--md-sys-typescale-label-large);
  letter-spacing: var(--md-sys-typescale-label-large-tracking);
}

.chip--tonal {
  border-color: transparent;
  background-color: var(--tone);
  color: var(--on-tone);
  font-weight: var(--md-sys-typescale-emphasized-label-weight);
}

/* ==========================================================================
   10. Top app bar (small). Flat on the page surface, tinted once the page
       has scrolled beneath it.
   ========================================================================== */

.top-app-bar {
  z-index: 20;
  top: 0;
  background-color: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  transition: background-color var(--md-sys-motion-duration-short4) linear;
}

.js .top-app-bar {
  position: sticky;
}

.top-app-bar.is-scrolled {
  background-color: var(--md-sys-color-surface-container);
}

.top-app-bar__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 4px;
  min-height: var(--layout-app-bar-height);
  max-width: calc(var(--layout-max-width) + 2 * var(--layout-margin));
  margin-inline: auto;
  padding: 8px 4px;
}

.top-app-bar__title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin-inline-end: auto;
  padding-inline: 12px;
  border-radius: var(--md-sys-shape-corner-medium);
  color: inherit;
  text-decoration: none;
}

.js .top-app-bar__title {
  padding-inline-start: 8px;
}

/* The logo. Its drawing is in each page once (<g id="logo"> in the shape
   library) and every <svg class="logo"> shows it with <use>. The W, the
   letters and the rims of the eyes take the text colour of that <svg>. */
.logo {
  --logo-ink: var(--md-sys-color-primary);
  display: block;
  flex: none;
  overflow: visible; /* the left eye reaches a little past the W */
  color: var(--logo-ink);
}

/* The whites of the eyes stay white in both themes. */
.logo__ball {
  fill: #ffffff;
}

/* --look-x and --look-y are set by main.js while the eyes follow the pointer. */
.logo__pupil {
  fill: var(--md-sys-color-on-primary-fixed);
  translate: var(--look-x, 0px) var(--look-y, 0px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo {
    --logo-ink: var(--md-sys-color-primary-fixed);
  }
}

:root[data-theme="dark"] .logo {
  --logo-ink: var(--md-sys-color-primary-fixed);
}

/* The icon form of the logo: the W and its eyes on a scalloped tile. The
   tile keeps the same blue in both themes. */
.logo-mark {
  --logo-tile: var(--md-sys-color-primary);
  display: block;
  flex: none;
  overflow: visible;
}

.logo-mark__tile {
  fill: var(--logo-tile);
}

.logo-mark__w {
  stroke: var(--md-sys-color-tertiary-fixed);
}

.logo-mark .logo__ball {
  stroke: var(--logo-tile);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-mark {
    --logo-tile: var(--md-sys-color-inverse-primary);
  }
}

:root[data-theme="dark"] .logo-mark {
  --logo-tile: var(--md-sys-color-inverse-primary);
}

/* Without JavaScript there is no drawer, so on narrow screens the links wrap
   onto a second row instead. With JavaScript they move into the drawer. */
.top-nav {
  flex: 1 0 100%;
  order: 1;
}

.js .top-nav {
  display: none;
}

.top-nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0 4px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 10px 16px;
  border-radius: 20px;
  color: var(--md-sys-color-on-surface-variant);
  font: var(--md-sys-typescale-label-large);
  font-weight: var(--md-sys-typescale-emphasized-label-weight);
  letter-spacing: var(--md-sys-typescale-label-large-tracking);
  text-decoration: none;
  white-space: nowrap;
  transition: border-radius var(--md-sys-motion-spring-fast-spatial);
}

.nav-link:active {
  border-radius: var(--md-sys-shape-corner-small);
}

/* The toggle shows the theme it switches to. */
.theme-toggle__to-light {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle__to-light {
    display: inline-block;
  }

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

:root[data-theme="dark"] .theme-toggle__to-light {
  display: inline-block;
}

:root[data-theme="dark"] .theme-toggle__to-dark {
  display: none;
}

/* Browsers without <dialog> cannot open the drawer: keep the wrapped links
   and drop the menu button, as if scripting were off. */
.no-dialog .top-app-bar {
  position: static;
}

.no-dialog .top-nav {
  display: block;
}

.no-dialog .icon-button.top-app-bar__menu {
  display: none;
}

@media (min-width: 840px) {
  html {
    scroll-padding-top: calc(var(--layout-app-bar-height) + 16px);
  }

  .top-app-bar,
  .no-dialog .top-app-bar {
    position: sticky;
  }

  .top-app-bar__row {
    flex-wrap: nowrap;
    padding-inline: 12px;
  }

  .top-app-bar__title,
  .js .top-app-bar__title {
    padding-inline: 12px;
  }

  .top-nav,
  .js .top-nav {
    display: block;
    flex: none;
    order: 0;
    margin-inline-end: 8px;
  }

  .top-nav__list {
    flex-wrap: nowrap;
  }

  .js .icon-button.top-app-bar__menu {
    display: none;
  }
}

/* ==========================================================================
   11. Navigation drawer (modal). A native <dialog>, so focus is trapped,
       Escape closes it and the page behind is inert without extra script.
   ========================================================================== */

.nav-drawer {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(360px, calc(100vw - 56px));
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0 var(--md-sys-shape-corner-extra-large) var(--md-sys-shape-corner-extra-large) 0;
  background-color: var(--md-sys-color-surface-container-low);
  color: var(--md-sys-color-on-surface-variant);
  box-shadow: var(--md-sys-elevation-level1);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Browsers without <dialog> would otherwise show it in the page. */
.nav-drawer:not([open]) {
  display: none;
}

.nav-drawer::backdrop {
  background-color: rgb(0 0 0 / 0.32);
}

.nav-drawer__sheet {
  min-height: 100%;
  padding: 12px;
}

.nav-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding-inline-start: 16px;
}

.nav-drawer__headline {
  display: flex;
  align-items: center;
}

.nav-drawer__item {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 8px 24px 8px 16px;
  border-radius: 28px;
  color: var(--md-sys-color-on-surface-variant);
  font: var(--md-sys-typescale-label-large);
  font-weight: var(--md-sys-typescale-emphasized-label-weight);
  letter-spacing: var(--md-sys-typescale-label-large-tracking);
  text-decoration: none;
  transition: border-radius var(--md-sys-motion-spring-fast-spatial);
}

.nav-drawer__item:active {
  border-radius: var(--md-sys-shape-corner-large);
}

.nav-drawer__item[aria-current="page"] {
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.nav-drawer__item:focus-visible {
  outline-offset: -3px;
}

.nav-drawer__divider {
  height: 1px;
  margin: 8px 16px;
  border: 0;
  background-color: var(--md-sys-color-outline-variant);
}

/* ==========================================================================
   12. Hero: one large tonal panel
   ========================================================================== */

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

.hero {
  padding-block: 8px 16px;
}

.hero__panel {
  display: grid;
  gap: 24px;
  align-items: center;
  padding: 32px 24px 24px;
  overflow: hidden;
  border-radius: var(--md-sys-shape-corner-extra-large);
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

/* The logo scales with the column it sits in. */
.hero__text {
  container-type: inline-size;
}

.hero__title {
  line-height: 0; /* it holds the logo, not text */
}

.hero__title .logo {
  --logo-ink: var(--md-sys-color-on-primary-container);
  width: clamp(12.5rem, 77cqi, 25rem);
  max-width: 100%;
  height: auto;
}

.hero__lede {
  max-width: 30ch;
  margin-top: 16px;
  font: var(--md-sys-typescale-title-large);
  letter-spacing: var(--md-sys-typescale-title-large-tracking);
}

.hero .button-row {
  margin-top: 28px;
}

@media (min-width: 600px) {
  .hero__panel {
    padding: 48px;
    border-radius: var(--md-sys-shape-corner-extra-extra-large);
  }
}

@media (min-width: 840px) {
  .hero {
    padding-block: 16px 24px;
  }

  .hero__panel {
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
    gap: 48px;
    padding: 64px 56px;
  }

  .hero__lede {
    margin-top: 24px;
    font: var(--md-sys-typescale-headline-small);
    letter-spacing: var(--md-sys-typescale-headline-small-tracking);
  }

  .hero .button-row {
    margin-top: 36px;
  }
}

/* ==========================================================================
   13. Shape collage (decorative). Each piece is placed and sized as a
       percentage of the square, so the whole thing scales as one.
   ========================================================================== */

.collage {
  position: relative;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1;
  justify-self: center;
  container-type: inline-size;
}

.collage > .blob {
  position: absolute;
  transition: scale var(--md-sys-motion-spring-default-spatial);
}

.collage .icon {
  font-size: 2.25rem;
  font-size: 10cqi;
}

/* Large cookie */
.collage__a {
  top: 16%;
  left: 17%;
  width: 56%;
}

.collage .collage__a .icon {
  font-size: 4.5rem;
  font-size: 22cqi;
}

/* Clover */
.collage__b {
  top: 0;
  left: 62%;
  width: 36%;
  rotate: 14deg;
}

/* Flower */
.collage__c {
  top: 58%;
  left: 0;
  width: 40%;
}

/* Pill */
.collage__d {
  top: 56%;
  left: 40%;
  width: 54%;
  rotate: -16deg;
}

/* Arch */
.collage__e {
  top: 37%;
  left: 71%;
  width: 29%;
  rotate: 10deg;
}

/* Small square cookie */
.collage__f {
  top: 6%;
  left: 3%;
  width: 19%;
  rotate: -12deg;
}

@media (hover: hover) {
  .collage > .blob:hover {
    scale: 1.08;
  }
}

@media (min-width: 840px) {
  .collage {
    justify-self: end;
  }
}

/* ==========================================================================
   14. Sections
   ========================================================================== */

.section {
  padding-block: 32px;
}

.section__title {
  margin-bottom: 20px;
  font: var(--md-sys-typescale-headline-medium);
  font-weight: var(--md-sys-typescale-emphasized-headline-weight);
  font-stretch: var(--md-sys-typescale-emphasized-headline-width);
  letter-spacing: var(--md-sys-typescale-headline-medium-tracking);
}

.section__intro {
  max-width: 44ch;
  margin-bottom: 20px;
  color: var(--md-sys-color-on-surface-variant);
}

.split {
  display: grid;
  gap: 8px var(--layout-gutter);
}

.split__aside > :last-child {
  margin-bottom: 16px;
}

@media (min-width: 600px) {
  .section {
    padding-block: 40px;
  }

  .section__title {
    margin-bottom: 24px;
    font: var(--md-sys-typescale-headline-large);
    font-weight: var(--md-sys-typescale-emphasized-headline-weight);
    font-stretch: var(--md-sys-typescale-emphasized-headline-width);
    letter-spacing: var(--md-sys-typescale-headline-large-tracking);
  }
}

@media (min-width: 840px) {
  .section {
    padding-block: 48px;
  }

  .section__title {
    font: var(--md-sys-typescale-display-small);
    font-weight: var(--md-sys-typescale-emphasized-headline-weight);
    font-stretch: var(--md-sys-typescale-emphasized-headline-width);
    letter-spacing: var(--md-sys-typescale-display-small-tracking);
  }

  .split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    align-items: start;
  }
}

/* ==========================================================================
   15. Feature card (the project) and disclosed findings
   ========================================================================== */

.feature {
  display: grid;
  gap: 16px;
  padding: 24px;
  overflow: hidden;
  border-radius: var(--md-sys-shape-corner-extra-large);
  background-color: var(--tone);
  color: var(--on-tone);
}

.feature__body {
  display: grid;
  justify-items: start;
  gap: 12px;
}

.feature__title {
  font: var(--md-sys-typescale-headline-small);
  font-weight: var(--md-sys-typescale-emphasized-headline-weight);
  font-stretch: var(--md-sys-typescale-emphasized-headline-width);
  letter-spacing: var(--md-sys-typescale-headline-small-tracking);
}

.feature__text {
  max-width: 46ch;
  margin-bottom: 12px;
}

.feature__art {
  position: relative;
  order: -1;
  width: 132px;
  margin-inline-start: 20px;
}

.feature__blob {
  width: 100%;
  rotate: -8deg;
}

.feature__blob > .icon {
  font-size: 3rem;
}

.feature__blob-small {
  position: absolute;
  top: -8%;
  left: -14%;
  width: 34%;
  rotate: 14deg;
}

@media (min-width: 600px) {
  .feature {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 32px;
    padding: 48px;
    border-radius: var(--md-sys-shape-corner-extra-extra-large);
  }

  .feature__title {
    font: var(--md-sys-typescale-headline-large);
    font-weight: var(--md-sys-typescale-emphasized-headline-weight);
    font-stretch: var(--md-sys-typescale-emphasized-headline-width);
    letter-spacing: var(--md-sys-typescale-headline-large-tracking);
  }

  .feature__art {
    order: 0;
    width: clamp(160px, 24vw, 260px);
    margin-inline: 6%;
  }

  .feature__blob > .icon {
    font-size: clamp(3.5rem, 8vw, 6rem);
  }
}

.subsection-title {
  margin: 40px 0 16px;
  font: var(--md-sys-typescale-title-large);
  font-weight: var(--md-sys-typescale-emphasized-title-weight);
  font-stretch: var(--md-sys-typescale-emphasized-title-width);
  letter-spacing: var(--md-sys-typescale-title-large-tracking);
}

.finding-list {
  display: grid;
  gap: 16px;
}

.finding {
  gap: 4px;
}

.finding__title {
  font: var(--md-sys-typescale-title-medium);
  font-weight: var(--md-sys-typescale-emphasized-title-weight);
  letter-spacing: var(--md-sys-typescale-title-medium-tracking);
}

.finding__date {
  color: var(--md-sys-color-on-surface-variant);
  font: var(--md-sys-typescale-label-medium);
  letter-spacing: var(--md-sys-typescale-label-medium-tracking);
}

.finding__text {
  flex: 1 0 auto;
  margin-top: 8px;
  color: var(--md-sys-color-on-surface-variant);
  font: var(--md-sys-typescale-body-medium);
  letter-spacing: var(--md-sys-typescale-body-medium-tracking);
}

.finding .card__actions {
  margin-inline-start: -12px;
}

@media (min-width: 600px) {
  .finding-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .finding-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ==========================================================================
   16. Process steps
   ========================================================================== */

.steps {
  display: grid;
  gap: 12px;
}

.step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  padding: 20px 24px 20px 20px;
  border-radius: var(--md-sys-shape-corner-extra-large);
  background-color: var(--md-sys-color-surface-container-low);
}

.step__title {
  font: var(--md-sys-typescale-title-large);
  font-weight: var(--md-sys-typescale-emphasized-title-weight);
  font-stretch: var(--md-sys-typescale-emphasized-title-width);
  letter-spacing: var(--md-sys-typescale-title-large-tracking);
}

.step__text {
  max-width: 56ch;
  margin-top: 4px;
  color: var(--md-sys-color-on-surface-variant);
}

@media (min-width: 600px) {
  .step {
    padding: 24px 32px 24px 24px;
  }

  .step .blob--badge {
    width: 64px;
  }
}

/* ==========================================================================
   17. Panels: about and contact
   ========================================================================== */

.panel {
  padding: 24px;
  border-radius: var(--md-sys-shape-corner-extra-large);
  background-color: var(--md-sys-color-surface-container-low);
}

.contact-panel {
  position: relative;
  display: grid;
  gap: 24px;
  padding: 32px 24px;
  overflow: hidden;
  border-radius: var(--md-sys-shape-corner-extra-large);
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

.contact-panel__body {
  display: grid;
  justify-items: start;
  gap: 8px;
}

.contact-panel .section__title {
  margin-bottom: 0;
}

.contact-panel__text {
  max-width: 52ch;
  margin-bottom: 20px;
}

.contact-panel__text a {
  color: inherit;
}

/* The secondary focus ring would be lost against the primary fill. */
.contact-panel :focus-visible {
  outline-color: var(--md-sys-color-on-primary);
}

.contact-panel__art {
  display: none;
}

/* The cards under the panel: one address each. Their buttons line up along
   the bottom when the cards share a row. */
.contact-options {
  margin-top: var(--layout-gutter);
}

.contact-options .card__actions {
  margin-top: auto;
  padding-top: 12px;
}

@media (min-width: 600px) {
  .panel,
  .contact-panel {
    padding: 48px;
    border-radius: var(--md-sys-shape-corner-extra-extra-large);
  }
}

@media (min-width: 840px) {
  .contact-panel {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    align-items: center;
    padding: 64px 56px;
  }

  .contact-panel__art {
    position: relative;
    display: block;
    align-self: stretch;
    min-height: 220px;
  }

  .contact-panel__art > .blob {
    position: absolute;
  }

  /* Flower with the mail icon */
  .contact-panel__a {
    top: 50%;
    left: 12%;
    width: 52%;
    translate: 0 -50%;
  }

  .contact-panel__a > .icon {
    font-size: 3.5rem;
  }

  /* Cookie running off the corner */
  .contact-panel__b {
    top: -34%;
    right: -22%;
    width: 46%;
  }

  /* Pill */
  .contact-panel__c {
    right: -6%;
    bottom: -22%;
    width: 44%;
    rotate: -24deg;
  }
}

/* ==========================================================================
   18. Text pages (disclosure, privacy) and the 404 page
   ========================================================================== */

.page {
  padding-block: 8px 40px;
}

.page__header {
  display: grid;
  gap: 16px;
  align-items: center;
  padding: 32px 24px;
  overflow: hidden;
  border-radius: var(--md-sys-shape-corner-extra-large);
  background-color: var(--tone);
  color: var(--on-tone);
}

.page__title {
  font: var(--md-sys-typescale-display-small);
  font-weight: var(--md-sys-typescale-emphasized-headline-weight);
  font-stretch: var(--md-sys-typescale-emphasized-headline-width);
  letter-spacing: var(--md-sys-typescale-display-small-tracking);
}

.page__lede {
  max-width: 48ch;
  margin-top: 12px;
  font: var(--md-sys-typescale-title-large);
  letter-spacing: var(--md-sys-typescale-title-large-tracking);
}

.page__blob {
  order: -1;
  width: 72px;
  rotate: -8deg;
}

.page__blob > .icon {
  font-size: 2rem;
}

.prose {
  max-width: 68ch;
}

.prose > * + * {
  margin-top: 16px;
}

.prose h2 {
  margin-top: 40px;
  font: var(--md-sys-typescale-headline-small);
  font-weight: var(--md-sys-typescale-emphasized-headline-weight);
  font-stretch: var(--md-sys-typescale-emphasized-headline-width);
  letter-spacing: var(--md-sys-typescale-headline-small-tracking);
}

.prose h3 {
  margin-top: 32px;
  font: var(--md-sys-typescale-title-large);
  font-weight: var(--md-sys-typescale-emphasized-title-weight);
  letter-spacing: var(--md-sys-typescale-title-large-tracking);
}

.prose ul:not([role="list"]),
.prose ol:not([role="list"]) {
  padding-inline-start: 24px;
}

.prose ul:not([role="list"]) > li + li,
.prose ol:not([role="list"]) > li + li {
  margin-top: 8px;
}

.prose li::marker {
  color: var(--md-sys-color-primary);
  font-weight: var(--md-ref-typeface-weight-bold);
}

.prose a {
  overflow-wrap: anywhere;
}

.page .prose {
  margin-top: 32px;
  padding-inline: 8px;
}

.error-page {
  display: grid;
  justify-items: start;
  gap: 16px;
  padding-block: 32px 64px;
}

.error-page__code {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--md-sys-color-primary);
  font: var(--md-sys-typescale-display-large);
  font-size: clamp(5rem, 22vw, 9rem);
  font-weight: var(--md-sys-typescale-emphasized-display-weight);
  font-stretch: var(--md-sys-typescale-emphasized-display-width);
  line-height: 1;
}

.error-page__mark {
  width: 0.9em;
  height: 0.9em;
}

.error-page__title {
  font: var(--md-sys-typescale-headline-large);
  font-weight: var(--md-sys-typescale-emphasized-headline-weight);
  font-stretch: var(--md-sys-typescale-emphasized-headline-width);
  letter-spacing: var(--md-sys-typescale-headline-large-tracking);
}

.error-page__text {
  max-width: 48ch;
  margin-bottom: 8px;
  color: var(--md-sys-color-on-surface-variant);
}

@media (min-width: 600px) {
  .page {
    padding-block: 16px 56px;
  }

  .page__header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 32px;
    padding: 48px;
    border-radius: var(--md-sys-shape-corner-extra-extra-large);
  }

  .page__title {
    font: var(--md-sys-typescale-display-medium);
    font-weight: var(--md-sys-typescale-emphasized-headline-weight);
    font-stretch: var(--md-sys-typescale-emphasized-headline-width);
    letter-spacing: var(--md-sys-typescale-display-medium-tracking);
  }

  .page__blob {
    order: 0;
    width: clamp(120px, 18vw, 184px);
  }

  .page__blob > .icon {
    font-size: clamp(3rem, 6vw, 4.5rem);
  }

  .page .prose {
    padding-inline: 48px;
  }

  .error-page {
    padding-block: 64px 96px;
  }
}

/* ==========================================================================
   19. Footer. The company details are a legal requirement and must stay
       visible on every page.
   ========================================================================== */

.site-footer {
  margin-top: 32px;
  border-radius: var(--md-sys-shape-corner-extra-large) var(--md-sys-shape-corner-extra-large) 0 0;
  background-color: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface-variant);
  font: var(--md-sys-typescale-body-medium);
  letter-spacing: var(--md-sys-typescale-body-medium-tracking);
}

.site-footer__inner {
  display: grid;
  gap: 12px;
  padding-block: 28px 32px;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 24px;
}

.site-footer__links a {
  display: inline-block;
  padding-block: 10px;
  color: var(--md-sys-color-on-surface);
  font: var(--md-sys-typescale-label-large);
  font-weight: var(--md-sys-typescale-emphasized-label-weight);
  letter-spacing: var(--md-sys-typescale-label-large-tracking);
}

.site-footer__legal {
  max-width: 80ch;
}

/* ==========================================================================
   20. Motion
   Nothing here loops: movement is either a short entrance, a response to the
   pointer, or tied to the reader's own scrolling. All of it is switched off
   when the system asks for reduced motion.
   ========================================================================== */

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

  /* Drawer slides in from the edge. */
  .nav-drawer {
    transform: translateX(-100%);
    transition:
      transform var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-emphasized-accelerate),
      overlay var(--md-sys-motion-duration-short4) allow-discrete,
      display var(--md-sys-motion-duration-short4) allow-discrete;
  }

  .nav-drawer[open] {
    transform: none;
    transition-duration: var(--md-sys-motion-duration-medium4);
    transition-timing-function: var(--md-sys-motion-easing-emphasized-decelerate);
  }

  .nav-drawer::backdrop {
    opacity: 0;
    transition:
      opacity var(--md-sys-motion-duration-short4) linear,
      overlay var(--md-sys-motion-duration-short4) allow-discrete,
      display var(--md-sys-motion-duration-short4) allow-discrete;
  }

  .nav-drawer[open]::backdrop {
    opacity: 1;
  }

  @starting-style {
    .nav-drawer[open] {
      transform: translateX(-100%);
    }

    .nav-drawer[open]::backdrop {
      opacity: 0;
    }
  }

  /* Collage pieces spring into place, one after another. Section 22 adds
     to this, so the delay is a property that both can read. */
  .collage > .blob {
    animation: pop-in var(--md-sys-motion-spring-slow-spatial) var(--pop, 0ms) backwards;
  }

  .collage__b { --pop: 70ms; }
  .collage__c { --pop: 140ms; }
  .collage__d { --pop: 210ms; }
  .collage__e { --pop: 280ms; }
  .collage__f { --pop: 350ms; }
  .collage__g { --pop: 420ms; }

  @keyframes pop-in {
    from {
      scale: 0.4;
      opacity: 0;
    }
  }

  /* Badges grow a little when their card or step is pointed at. */
  .blob--badge > .blob__shape,
  .feature__blob > .blob__shape,
  .page__blob > .blob__shape {
    transition: scale var(--md-sys-motion-spring-default-spatial);
  }

  @media (hover: hover) {
    .card:hover .blob--badge > .blob__shape,
    .step:hover .blob--badge > .blob__shape,
    .feature:hover .feature__blob > .blob__shape,
    .page__header:hover .page__blob > .blob__shape {
      scale: 1.14;
    }

    /* The logo perks up when pointed at. */
    .top-app-bar__title:hover .logo {
      rotate: -3deg;
      scale: 1.06;
    }
  }

  .top-app-bar__title .logo {
    transition:
      rotate var(--md-sys-motion-spring-default-spatial),
      scale var(--md-sys-motion-spring-default-spatial);
  }

  /* The eyes glide when they follow the pointer. */
  .logo__pupil {
    transition: translate 140ms var(--md-sys-motion-easing-standard-decelerate, ease-out);
  }

  /* Shapes turn as they scroll into view, in browsers that can tie an
     animation to scroll position. */
  @supports (animation-timeline: view()) {
    .blob--badge > .blob__shape,
    .feature__blob > .blob__shape,
    .contact-panel__art .blob__shape {
      animation: turn-in linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 45%;
    }

    @keyframes turn-in {
      from {
        rotate: -100deg;
      }
    }
  }
}

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

/* ==========================================================================
   21. Contrast and print preferences
   ========================================================================== */

/* Windows High Contrast and similar: colours are replaced by the system, so
   shapes that relied on a fill need an outline instead. */
@media (forced-colors: active) {
  .button,
  .card,
  .chip,
  .feature,
  .step,
  .panel,
  .contact-panel,
  .hero__panel,
  .page__header,
  .nav-drawer {
    border: 1px solid CanvasText;
  }

  .button::before,
  .icon-button::before,
  .nav-link::before,
  .nav-drawer__item::before {
    display: none;
  }

  .nav-drawer__item[aria-current="page"] {
    outline: 2px solid Highlight;
    outline-offset: -2px;
  }

  .blob__shape {
    fill: Canvas;
    stroke: CanvasText;
    stroke-width: 2;
  }

  .blob > .icon,
  .blob__label {
    color: CanvasText;
  }

  .logo,
  :root:not([data-theme="light"]) .logo,
  :root[data-theme="dark"] .logo {
    --logo-ink: CanvasText;
  }

  .logo__ball {
    fill: Canvas;
  }

  .logo__pupil {
    fill: CanvasText;
  }

  .logo-mark,
  :root:not([data-theme="light"]) .logo-mark,
  :root[data-theme="dark"] .logo-mark {
    --logo-tile: CanvasText;
  }

  .logo-mark__w {
    stroke: Canvas;
  }
}

@media print {
  .top-app-bar,
  .nav-drawer,
  .skip-link,
  .collage,
  .feature__art,
  .contact-panel__art,
  .button-row {
    display: none;
  }

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

  .site-footer {
    background: none;
  }
}

/* ==========================================================================
   22. Joy: more colour, shapes with faces, and movement

   Colour and faces apply everywhere. Movement comes in three kinds:
     - a response to the pointer, or a short entrance as something scrolls
       into view. These run unless the system asks for reduced motion;
     - movement that runs by itself (floating shapes, the moving band,
       blinking eyes). This only happens while <html> has the class
       "motion-on". main.js adds the class, and the pause button in the app
       bar removes it, so there is always a way to stop it;
     - nothing at all when the system asks for reduced motion.
   ========================================================================== */

/* ---- 22.1 More tones (see section 5). The colours are written by
        tools/theme.mjs. "Container" pairs follow the light and dark schemes;
        "bright" pairs are the same in both. ------------------------------- */

.tone-pink-container {
  --tone: var(--md-ext-color-pink-container);
  --on-tone: var(--md-ext-color-on-pink-container);
}

.tone-sun-container {
  --tone: var(--md-ext-color-sun-container);
  --on-tone: var(--md-ext-color-on-sun-container);
}

.tone-grape-container {
  --tone: var(--md-ext-color-grape-container);
  --on-tone: var(--md-ext-color-on-grape-container);
}

.tone-primary-bright {
  --tone: var(--md-ext-color-primary-bright);
  --on-tone: var(--md-ext-color-on-primary-bright);
}

.tone-secondary-bright {
  --tone: var(--md-ext-color-secondary-bright);
  --on-tone: var(--md-ext-color-on-secondary-bright);
}

.tone-tertiary-bright {
  --tone: var(--md-ext-color-tertiary-bright);
  --on-tone: var(--md-ext-color-on-tertiary-bright);
}

.tone-pink-bright {
  --tone: var(--md-ext-color-pink-bright);
  --on-tone: var(--md-ext-color-on-pink-bright);
}

.tone-sun-bright {
  --tone: var(--md-ext-color-sun-bright);
  --on-tone: var(--md-ext-color-on-sun-bright);
}

.tone-grape-bright {
  --tone: var(--md-ext-color-grape-bright);
  --on-tone: var(--md-ext-color-on-grape-bright);
}

/* A control inside a coloured area: its focus ring takes the area's text
   colour, which is the pair that the contrast check covers. */
[class*="tone-"] :focus-visible {
  outline-color: var(--on-tone);
}

/* The colour of the wavy line under a section title. */
.accent-primary { --accent: var(--md-ext-color-primary-bright); }
.accent-secondary { --accent: var(--md-ext-color-secondary-bright); }
.accent-tertiary { --accent: var(--md-ext-color-tertiary-bright); }
.accent-pink { --accent: var(--md-ext-color-pink-bright); }
.accent-sun { --accent: var(--md-ext-color-sun-bright); }
.accent-grape { --accent: var(--md-ext-color-grape-bright); }

/* ---- 22.2 Colour in the page furniture ---------------------------------- */

/* A six-colour line across the top of every page. */
.top-app-bar::before {
  content: "";
  display: block;
  height: 6px;
  background: linear-gradient(
    90deg,
    var(--md-ext-color-primary-bright) 0 16.67%,
    var(--md-ext-color-pink-bright) 0 33.33%,
    var(--md-ext-color-sun-bright) 0 50%,
    var(--md-ext-color-tertiary-bright) 0 66.67%,
    var(--md-ext-color-grape-bright) 0 83.33%,
    var(--md-ext-color-secondary-bright) 0
  );
}

.section__title {
  text-decoration: underline wavy var(--accent, var(--md-ext-color-pink-bright));
  text-decoration-thickness: 0.085em;
  text-decoration-skip-ink: none;
  text-underline-offset: 0.2em;
}

/* A button filled with any tone: <a class="button button--toned tone-…">. */
.button--toned {
  background-color: var(--tone);
  color: var(--on-tone);
}

/* The hero, the steps and the panels take a tone class when they have one. */
.hero__panel {
  background-color: var(--tone, var(--md-sys-color-primary-container));
  color: var(--on-tone, var(--md-sys-color-on-primary-container));
}

.step {
  background-color: var(--tone, var(--md-sys-color-surface-container-low));
  color: var(--on-tone, inherit);
}

.step__text {
  color: var(--on-tone, var(--md-sys-color-on-surface-variant));
}

.panel {
  background-color: var(--tone, var(--md-sys-color-surface-container-low));
  color: var(--on-tone, inherit);
}

.panel[class*="tone-"] a {
  color: inherit;
}

/* ---- 22.3 Faces: <svg class="blob__face"><use href="#face"/></svg> inside
        a blob. The eyes are the logo's, so they follow the pointer too. ---- */

.blob__face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  color: var(--on-tone);
}

/* Two more pieces in the hero collage, and a few dots. */
.collage__g {
  top: 78%;
  left: 79%;
  width: 20%;
  rotate: 12deg;
}

.collage__dot {
  position: absolute;
  width: 4.5%;
  aspect-ratio: 1;
  border-radius: 50%;
  background-color: var(--tone);
}

.collage__dot--1 { top: 3%; left: 41%; }
.collage__dot--2 { top: 49%; left: 3%; width: 3.5%; }
.collage__dot--3 { top: 93%; left: 31%; }
.collage__dot--4 { top: 31%; left: 96%; width: 3.5%; }

/* ---- 22.4 The band of skills under the hero ----------------------------- */

.marquee-band {
  padding-block: 20px 12px;
  overflow: hidden;
  overflow: clip;
}

.marquee {
  display: flex;
  justify-content: center;
  margin-inline: -12px;
  padding: 14px 24px;
  overflow: hidden;
  background-color: var(--tone);
  color: var(--on-tone);
  rotate: -1.4deg;
}

.marquee__track {
  display: flex;
  min-width: 0;
}

/* Standing still, the band shows the list once and lets it wrap. */
.marquee__group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 16px;
}

.marquee__group + .marquee__group {
  display: none;
}

.marquee__item {
  font: var(--md-sys-typescale-title-medium);
  font-weight: var(--md-sys-typescale-emphasized-display-weight);
  font-stretch: var(--md-sys-typescale-emphasized-headline-width);
  white-space: nowrap;
}

.marquee__shape {
  flex: none;
  width: 22px;
  height: 22px;
  overflow: visible;
  fill: var(--tone);
}

@media (min-width: 600px) {
  .marquee {
    padding-block: 18px;
  }

  .marquee__item {
    font: var(--md-sys-typescale-headline-small);
    font-weight: var(--md-sys-typescale-emphasized-display-weight);
    font-stretch: var(--md-sys-typescale-emphasized-headline-width);
  }

  .marquee__group {
    gap: 8px 24px;
  }

  .marquee__shape {
    width: 30px;
    height: 30px;
  }
}

/* ---- 22.5 The footer: a sunny band with a scalloped edge and a few shapes
        looking over it ---------------------------------------------------- */

.site-footer {
  position: relative;
  isolation: isolate;
  margin-top: 104px;
  border-radius: 0;
  background-color: var(--md-ext-color-sun-container);
  color: var(--md-ext-color-on-sun-container);
}

.site-footer::before {
  content: "";
  position: absolute;
  right: 0;
  bottom: 100%;
  left: 0;
  height: 18px;
  background-color: inherit;
  -webkit-mask: radial-gradient(circle 18px at 50% 100%, #000 96%, transparent 100%) 50% 0 / 36px 18px repeat-x;
  mask: radial-gradient(circle 18px at 50% 100%, #000 96%, transparent 100%) 50% 0 / 36px 18px repeat-x;
}

.site-footer__links a {
  color: inherit;
}

.site-footer :focus-visible {
  outline-color: var(--md-ext-color-on-sun-container);
}

/* Behind the scalloped edge, so only their top halves show. */
.site-footer__friends {
  position: absolute;
  z-index: -1;
  right: max(var(--layout-margin), calc((100% - var(--layout-max-width)) / 2));
  bottom: calc(100% - 4px);
  display: flex;
  align-items: flex-end;
  gap: 2px;
}

.friend {
  width: 46px;
}

.friend:nth-child(2) { width: 56px; rotate: -8deg; }
.friend:nth-child(3) { width: 50px; rotate: 6deg; }
.friend:nth-child(4) { width: 58px; }
.friend:nth-child(5) { width: 44px; rotate: 10deg; }

/* ---- 22.6 The pause button ---------------------------------------------- */

.motion-toggle__play,
.motion-toggle.is-paused .motion-toggle__pause {
  display: none;
}

.motion-toggle.is-paused .motion-toggle__play {
  display: inline-block;
}

/* Confetti, thrown by main.js when a shape or the logo is clicked. */
.confetti {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background-color: var(--tone);
  pointer-events: none;
}

.confetti--dot {
  border-radius: 50%;
}

.collage > .blob,
.hero__title .logo,
.error-page__mark,
.friend {
  cursor: pointer;
}

/* ---- 22.7 Movement ------------------------------------------------------ */

@media (prefers-reduced-motion: no-preference) {
  /* Things rise into place as they scroll into view. main.js adds "is-in"
     when that happens; "reveal-on" is only set once it is watching, so
     nothing is ever hidden if the script does not run. */
  .reveal-on [data-reveal]:not(.is-in):not(.is-shown) {
    opacity: 0;
  }

  [data-reveal].is-in {
    animation: rise 720ms cubic-bezier(0.3, 1.45, 0.45, 1) calc(var(--i, 0) * 90ms) backwards;
  }

  .card-grid > :nth-child(2),
  .steps > :nth-child(2) {
    --i: 1;
    --rise-tilt: 3deg;
  }

  .card-grid > :nth-child(3),
  .steps > :nth-child(3) {
    --i: 2;
  }

  .card-grid > :nth-child(4) {
    --i: 3;
    --rise-tilt: 3deg;
  }

  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(56px) scale(0.92) rotate(var(--rise-tilt, -3deg));
    }
  }

  /* The dots in the collage arrive with the shapes. */
  .collage__dot {
    animation: pop-in var(--md-sys-motion-spring-slow-spatial) 480ms backwards;
  }

  /* Movement that runs by itself: only while motion is on. */
  .motion-on .collage > .blob {
    animation:
      pop-in var(--md-sys-motion-spring-slow-spatial) var(--pop, 0ms) backwards,
      bob var(--bob, 4s) ease-in-out calc(var(--pop, 0ms) + 800ms) infinite alternate;
  }

  .collage__a { --bob: 5.2s; --bob-rise: -8px; }
  .collage__b { --bob: 3.6s; }
  .collage__c { --bob: 4.4s; --bob-rise: -14px; }
  .collage__d { --bob: 4.8s; --bob-rise: -9px; }
  .collage__e { --bob: 3.9s; }
  .collage__f { --bob: 2.8s; --bob-rise: -16px; }
  .collage__g { --bob: 3.2s; --bob-rise: -14px; }

  @keyframes bob {
    to {
      transform: translateY(var(--bob-rise, -12px));
    }
  }

  /* The big cookie and the flower turn slowly. */
  .motion-on .collage__a > .blob__shape {
    animation: spin 60s linear infinite;
  }

  .motion-on .collage__c > .blob__shape {
    animation: spin 48s linear infinite reverse;
  }

  .motion-on .marquee__shape {
    animation: spin 9s linear infinite;
  }

  @keyframes spin {
    to {
      rotate: 1turn;
    }
  }

  /* Eyes blink now and then. main.js picks a pair at random and sets --lid
     on its <svg> for a moment, so nothing runs in between. */
  .logo__ball,
  .logo__pupil {
    transform-box: fill-box;
    transform-origin: center;
    scale: 1 var(--lid, 1);
  }

  .logo__ball {
    transition: scale 90ms ease-in-out;
  }

  .logo__pupil {
    transition:
      translate 140ms var(--md-sys-motion-easing-standard-decelerate, ease-out),
      scale 90ms ease-in-out;
  }

  /* The band moves; pointing at it holds it still. */
  .motion-on .marquee {
    justify-content: flex-start;
  }

  .motion-on .marquee__track {
    flex: none;
    animation: marquee 44s linear infinite;
  }

  .motion-on .marquee__group,
  .motion-on .marquee__group + .marquee__group {
    display: flex;
    flex: none;
    flex-wrap: nowrap;
    padding-inline-end: 24px;
  }

  .motion-on .marquee:hover .marquee__track {
    animation-play-state: paused;
  }

  @keyframes marquee {
    to {
      translate: -25% 0;
    }
  }

  /* The shapes in the footer and beside the panels bob. */
  .motion-on .friend,
  .motion-on .feature__blob-small,
  .motion-on .contact-panel__c {
    animation: bob var(--bob, 2.2s) ease-in-out var(--bob-delay, 0s) infinite alternate;
  }

  .friend { --bob-rise: -8px; }
  .friend:nth-child(2) { --bob: 1.7s; --bob-delay: 300ms; }
  .friend:nth-child(3) { --bob: 2.6s; --bob-delay: 120ms; }
  .friend:nth-child(4) { --bob: 1.9s; --bob-delay: 520ms; }
  .friend:nth-child(5) { --bob: 2.4s; --bob-delay: 220ms; }
  .feature__blob-small { --bob: 3s; }
  .contact-panel__c { --bob: 3.4s; --bob-rise: -10px; }
}

/* A response to the pointer. */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .card--tonal,
  .step,
  .chip--tonal,
  .friend {
    transition:
      translate var(--md-sys-motion-spring-default-spatial),
      rotate var(--md-sys-motion-spring-default-spatial),
      scale var(--md-sys-motion-spring-default-spatial);
  }

  .card-grid > .card--tonal:hover {
    translate: 0 -8px;
    rotate: -1.5deg;
  }

  .card-grid > .card--tonal:nth-child(even):hover {
    rotate: 1.5deg;
  }

  .step:hover {
    translate: 8px 0;
  }

  .chip--tonal:hover {
    rotate: -4deg;
    scale: 1.1;
  }

  .chip--tonal:nth-child(even):hover {
    rotate: 4deg;
  }

  .friend:hover {
    translate: 0 -12px;
  }

  .button {
    transition:
      border-radius var(--md-sys-motion-spring-fast-spatial),
      box-shadow var(--md-sys-motion-spring-default-effects),
      scale var(--md-sys-motion-spring-fast-spatial);
  }

  .button:hover {
    scale: 1.05;
  }

  .button:active {
    scale: 0.96;
  }

  .button > .icon {
    transition: translate var(--md-sys-motion-spring-fast-spatial);
  }

  .button--icon-trailing:hover > .icon {
    translate: 3px 0;
  }
}

/* With reduced motion there is nothing to pause, so the button goes. */
@media (prefers-reduced-motion: reduce) {
  .js .icon-button.motion-toggle {
    display: none;
  }
}

@media (forced-colors: active) {
  .blob__face {
    color: CanvasText;
  }

  .marquee,
  .site-footer {
    border-block: 1px solid CanvasText;
  }

  .top-app-bar::before,
  .site-footer::before,
  .collage__dot {
    display: none;
  }
}

@media print {
  .marquee-band,
  .site-footer__friends,
  .site-footer::before,
  .top-app-bar::before {
    display: none;
  }

  [data-reveal] {
    opacity: 1 !important;
    animation: none !important;
  }
}
