/* Chrome shared by every showcase page: the type scale, the top bar, page headings, cards and the footer.
   Lato is for the site's own words only. Anything inside a .window keeps the kit's font, because that is what the kit looks like. */
:root {
  --site-font: "Lato", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --site-width: 1040px;
  --site-accent: #f0b45a;
  --site-ink: #fff;
  --site-muted: #c9ccd4;
  --site-card: #24272d;
}

/* No gray flash over a tapped link, card or button; they have their own pressed looks */
html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* A sticky bar must not hide the heading an in-page link scrolls to */
[id] { scroll-margin-top: 80px; }

.site-nav {
  position: sticky;
  top: 0;
  /* The kit's .fam-nav is z-index 2, so the sample navs further down the page tie with this bar and paint over it */
  z-index: 10;
  height: 64px;
  font-family: var(--site-font);
}

.site-nav .fam-nav-brand {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0;
  text-decoration: none;
}

/* Below 481px the kit's own phone sizes apply, so all five labels fit a 375px screen without scrolling the bar */
@media (min-width: 481px) {
  .site-nav { padding: 0 20px; }

  .site-nav .fam-nav-brand {
    margin-right: 22px;
    font-size: 26px;
  }

  .site-nav .fam-nav-item { font-size: 16px; }
}

@media (max-width: 480px) {
  .site-nav .fam-nav-brand { font-size: 20px; }
}

/* nav-menu.js wraps the links in the drawer and adds the toggle. On a wide screen the wrapper has no box of its own,
   so the links stay direct children of the bar. */
.site-nav-menu { display: contents; }

.site-nav-toggle,
.site-nav-scrim { display: none; }

@media (max-width: 480px) {
  .site-nav .site-nav-toggle {
    display: grid;
    place-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    margin: 0 4px 0 auto;
    padding: 0;
  }

  /* Three bars that become an X, drawn in the button's own ink */
  .site-nav-toggle span {
    display: block;
    width: 22px;
    height: 3px;
    border-radius: 2px;
    background: #3a1f08;
    box-shadow: 0 1px 0 rgba(255, 225, 170, .6);
  }

  .site-nav.is-open .site-nav-toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .site-nav.is-open .site-nav-toggle span:nth-child(2) { opacity: 0; }
  .site-nav.is-open .site-nav-toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  .site-nav-scrim {
    display: block;
    position: fixed;
    inset: 64px 0 0;
    background: rgba(0, 0, 0, .55);
    opacity: 0;
    visibility: hidden;
  }

  .site-nav.is-open .site-nav-scrim {
    opacity: 1;
    visibility: visible;
  }

  /* The kit's bar scrolls its own overflow, which would clip a drawer that hangs below it. The links are in the drawer, so nothing needs to scroll. */
  .site-nav:has(> .site-nav-menu) { overflow: visible; }

  /* The drawer opens downward from the bar's stitched edge. The clip leaves room for its shadow on three sides. */
  .site-nav-menu {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1;
    box-sizing: border-box;
    padding: 8px 10px 26px;
    box-shadow: 0 18px 28px -6px rgba(0, 0, 0, .65);
    clip-path: inset(0 -40px 100% -40px);
    visibility: hidden;
  }

  .site-nav.is-open .site-nav-menu {
    clip-path: inset(0 -40px -60px -40px);
    visibility: visible;
  }

  .site-nav .site-nav-menu .fam-nav-item:not(.site-nav-home) {
    display: flex;
    align-items: center;
    max-width: none;
    min-height: 48px;
    padding: 0 16px;
    font-size: 18px;
    border-radius: 24px;
  }

  /* Closing waits for the slide to finish before the drawer is hidden from the keyboard and screen readers */
  @media (prefers-reduced-motion: no-preference) {
    .site-nav-toggle span { transition: transform .2s ease, opacity .2s ease; }
    .site-nav-scrim { transition: opacity .2s ease, visibility 0s linear .2s; }
    .site-nav.is-open .site-nav-scrim { transition: opacity .2s ease; }
    .site-nav-menu { transition: clip-path .2s ease, visibility 0s linear .2s; }
    .site-nav.is-open .site-nav-menu { transition: clip-path .2s ease; }
  }
}

.page-head,
.section {
  box-sizing: border-box;
  max-width: var(--site-width);
  margin: 0 auto;
  padding: 72px 20px 0;
  font-family: var(--site-font);
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--site-accent);
}

.page-head h1 {
  margin: 0;
  font-size: clamp(40px, 7vw, 72px);
  font-weight: 900;
  line-height: 1.05;
  text-wrap: balance;
  color: var(--site-ink);
}

.section h2 {
  margin: 0;
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 900;
  line-height: 1.1;
  color: var(--site-ink);
}

.lead {
  max-width: 680px;
  margin: 18px 0 0;
  font-size: 20px;
  line-height: 1.55;
  color: var(--site-muted);
}

.jump {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.jump a,
.pairing-tabs button {
  padding: 9px 18px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 999px;
  background: transparent;
  font: 700 16px/1.2 var(--site-font);
  text-decoration: none;
  color: #e9e9ec;
  cursor: pointer;
}

.jump a:hover,
.pairing-tabs button:hover { background: rgba(255, 255, 255, .1); }

.jump a:focus-visible,
.pairing-tabs button:focus-visible,
.card:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.scene-title {
  margin: 0 0 8px;
  font: 900 clamp(28px, 4vw, 40px)/1.15 var(--site-font);
  color: var(--site-ink);
}

.scene-lead {
  margin: 0 0 22px;
  font: 400 18px/1.5 var(--site-font);
  color: var(--site-muted);
}

/* The pairing switcher on the home page. JavaScript turns the panels into tabs; without it every panel shows under its own heading. */
.pairing-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 32px 0 26px;
}

.pairing-tabs button[aria-selected="true"] {
  border-color: #f4efe3;
  background: #f4efe3;
  color: #1d1f24;
}

.pairing-panel { margin-top: 40px; }
.pairing-tabs + .pairing-panel { margin-top: 0; }

.pairing-title {
  margin: 0 0 6px;
  font: 900 30px/1.2 var(--site-font);
  color: var(--site-ink);
}

.pairing-lead {
  margin: 0 0 20px;
  font: 400 18px/1.5 var(--site-font);
  color: var(--site-muted);
}

.pairing-lead a {
  font-weight: 700;
  color: var(--site-accent);
}

.is-tabs .pairing-title {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-top: 36px;
}

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 18px;
  background: var(--site-card);
  text-decoration: none;
  color: inherit;
  transition: transform .15s ease, border-color .15s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, .35);
}

@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  .card:hover { transform: none; }
}

.card-swatch {
  display: grid;
  place-items: center;
  height: 130px;
}

.card-shot {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
  object-position: top left;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.card-body { padding: 20px 22px 24px; }

.card h3 {
  margin: 0 0 8px;
  font: 900 24px/1.2 var(--site-font);
  color: var(--site-ink);
}

.card p {
  margin: 0;
  font: 400 16px/1.5 var(--site-font);
  color: var(--site-muted);
}

.card-more {
  display: inline-block;
  margin-top: 14px;
  font: 700 15px/1 var(--site-font);
  color: var(--site-accent);
}

#credits {
  max-width: var(--site-width);
  margin-top: 40px;
  font-family: var(--site-font);
  font-size: 15px;
  border-top: 1px solid rgba(255, 255, 255, .12);
}

#credits a { color: #a9c2ff; }

/* Links inside a sentence are exempt from the target size; the one standing alone in the last line is not */
@media (pointer: coarse) {
  #credits p:last-child a {
    display: inline-block;
    padding: 13px 0;
  }
}

@media (max-width: 600px) {
  .page-head,
  .section { padding-top: 48px; }
  .lead { font-size: 18px; }
}

.home-frames {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: start;
}

.home-frames .cork-board { height: 100%; min-height: 200px; }

.home-glass {
  grid-auto-flow: column;
  justify-content: center;
  gap: 32px;
  height: 260px;
}

.home-glass .glass-pane { width: 280px; max-width: 100%; }

.home-glass .glass-pane--round {
  --fam-r: 999px;
  width: 120px;
  height: 120px;
}

.home-card-glass { background: conic-gradient(#ff2d6f, #ffb400, #3ddc84, #1fb6ff, #8a3dff, #ff2d6f); }

@media (max-width: 600px) {
  .home-glass { gap: 18px; }
  .home-glass .glass-pane { width: 100%; }
  .home-glass .glass-pane--round { width: 90px; height: 90px; }
}

/* The sticky bar takes 64px of a phone screen, so the hero gives some back and the next heading still shows above the fold */
@media (max-width: 600px) {
  .hero {
    min-height: 68vh;
    min-height: 68svh;
  }
}

.pillars {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 36px;
}

.pillar {
  overflow: hidden;
  padding: 24px 24px 26px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 18px;
  background: var(--site-card);
}

.pillar-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 132px;
  margin: -24px -24px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}

/* A visual that is itself a material keeps the material's background */
.pillar-visual:not([class*="fam-"]) { background: #1b1d22; }

.pillar-columns { align-items: stretch; }

.pillar-columns > span {
  flex: 1;
  box-shadow: 1px 0 0 rgba(0, 0, 0, .5);
}

.pillar-metric {
  flex-direction: column;
  gap: 6px;
}

.pillar-metric-value {
  font: 900 clamp(56px, 9vw, 72px)/1 var(--site-font);
  color: var(--site-accent);
}

/* The two-tone focus ring from the stylesheet, drawn around the metric */
.pillar-metric-value--focused {
  padding: 0 14px;
  border-radius: 12px;
  box-shadow: var(--fam-focus-halo);
  outline: 2px solid var(--fam-focus-ink);
  outline-offset: 2px;
}

.pillar-metric-label {
  font: 700 12px/1 ui-monospace, Menlo, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--site-muted);
}

.pillar-shapes {
  gap: 16px;
  padding: 0 24px;
}

.pillar-shapes > span {
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .6), 0 8px 14px -6px rgba(0, 0, 0, .6);
}

.pillar-shape--square { width: 64px; height: 64px; }
.pillar-shape--wide { width: 128px; height: 64px; }
.pillar-shape--tall { width: 64px; height: 100px; }

.ways-framework { gap: 16px; }

.ways-flat-card {
  display: grid;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 8px;
  color: #1b1b20;
  font: 700 14px/1 var(--site-font);
}

.ways-flat-button {
  padding: 8px 14px;
  border-radius: 6px;
  background: #1b1b20;
  color: #fff;
  text-align: center;
}

.pillar h3,
.tile-lab h3 {
  margin: 0 0 8px;
  font: 900 22px/1.2 var(--site-font);
  color: var(--site-ink);
}

.pillar p,
.tile-lab-lead {
  margin: 0;
  font: 400 16px/1.55 var(--site-font);
  color: var(--site-muted);
}

.pillar b { color: var(--site-ink); }

.pillar code,
.tile-lab code {
  font: 13px ui-monospace, Menlo, monospace;
  color: var(--site-ink);
}

.tile-lab {
  margin-top: 20px;
  padding: 28px 24px 30px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 18px;
  background: var(--site-card);
}

.tile-lab h3:not(:first-child) { margin-top: 34px; }
.tile-lab-lead { margin-bottom: 18px; }

.tile-sizes {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 18px;
}

.tile-box {
  box-sizing: border-box;
  display: grid;
  place-items: end start;
  padding: 8px 10px;
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .6), 0 8px 14px -6px rgba(0, 0, 0, .6);
  font: 12px ui-monospace, Menlo, monospace;
  color: #fff;
}

.tile-box--small { width: 96px; height: 96px; }
.tile-box--wide { width: 280px; max-width: 100%; height: 96px; }
.tile-box--tall { width: 120px; height: 200px; }

.tile-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 16px;
}

.tile-card { margin: 0; }

.tile-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .6);
}

.tile-card figcaption {
  display: grid;
  gap: 2px;
  margin-top: 8px;
  font: 12px ui-monospace, Menlo, monospace;
  color: var(--site-muted);
}

@media (max-width: 700px) {
  .pillars { grid-template-columns: 1fr; }
}

/* A real markup snippet with a Copy button in a header that is always visible, so it is not mistaken for a caption */
.code-block {
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 12px;
  background: #14161a;
  text-align: left;
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 8px 8px 16px;
  background: #1c1f25;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.code-lang {
  font: 700 12px/1 var(--site-font);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #b8bcc6;
}

.code-head .copy {
  margin: 0;
  padding: 7px 16px;
  border-color: rgba(255, 255, 255, .4);
  font: 700 14px/1 var(--site-font);
}

@media (pointer: coarse) {
  .code-head :is(.copy, .toggle) { min-height: 44px; }
}

.code-head .toggle {
  margin: 0 0 0 auto;
  padding: 7px 16px;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 999px;
  background: transparent;
  color: #e9e9ec;
  font: 700 14px/1 var(--site-font);
  cursor: pointer;
}

.code-head .toggle:hover { background: rgba(255, 255, 255, .12); }

.code-head .toggle:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Six lines of the block's 1.6 line height */
.code-block.is-collapsed pre {
  max-height: calc(6 * 1.6em);
  overflow: hidden;
}

.code-block pre {
  margin: 0;
  padding: 14px 16px 16px;
  font: 13px/1.6 ui-monospace, Menlo, monospace;
  color: #dfe2ea;
  /* Wrapping keeps a long attribute list inside the page on a phone, where a scrolling block would be easy to miss */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.code-block code { font: inherit; }


/* Each control sits alone on the surface it suits. The kit's own box rules do the layout; these only set spacing for the demo. */
.controls-stage {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  padding: 28px;
}

/* The heading of one variant inside a control's section, so it reads as a rule with a label rather than as another section title */
.variant-title {
  margin: 44px 0 14px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .14);
  font: 900 14px/1.2 var(--site-font);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--site-accent);
}

/* The classes a control takes, listed above its examples like an API reference */
.ref-table {
  width: 100%;
  margin: 0 0 8px;
  border-collapse: collapse;
  font: 400 16px/1.5 var(--site-font);
  color: var(--site-muted);
}

.ref-table th {
  padding: 8px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .22);
  text-align: left;
  font: 900 12px/1.2 var(--site-font);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--site-accent);
}

.ref-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  vertical-align: top;
}

.ref-table td:first-child { width: 34%; }
.ref-table code { font: 14px ui-monospace, Menlo, monospace; color: #fff; overflow-wrap: anywhere; }

@media (max-width: 700px) {
  .ref-table thead { display: none; }
  .ref-table, .ref-table tbody, .ref-table tr, .ref-table td { display: block; width: 100%; box-sizing: border-box; }
  .ref-table tr { padding: 8px 0; border-bottom: 1px solid rgba(255, 255, 255, .1); }
  .ref-table td { padding: 2px 14px; border: 0; }
  .ref-table td:first-child { width: 100%; }
}

/* Each cell is a different surface, so the focus ring is seen against metal, felt and wood */
.focus-stage {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.focus-cell {
  display: grid;
  place-items: center;
  min-height: 130px;
  padding: 28px;
}

/* A stage whose content is not a row of controls, such as a field, a list or a table */
.controls-stage--block { display: block; padding: 20px; }

/* A scene with several demos separates each one from the code block above it */
.code-block + .window { margin-top: 20px; }
.code-block + .scene-lead { margin-top: 28px; }

/* Each tab demo is a strip with its panel under it. The light plate keeps the panel text readable on every surface. */
#scene-tabs .controls-stage { display: grid; gap: 22px; }
.tab-demo { display: grid; justify-items: start; gap: 12px; }
.tab-panel {
  box-sizing: border-box;
  width: min(100%, 360px);
  padding: 14px 16px;
  border-radius: var(--fam-radius-md);
  background: rgba(255, 255, 255, .8);
  color: #1b1b20;
  font: 600 14px/1.3 var(--fam-font-ui);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .3);
}

.controls-stage--leds {
  gap: 8px 16px;
  align-items: flex-start;
}

#scene-progress .controls-stage {
  display: grid;
  gap: 18px;
}

#scene-glass-fields .controls-stage {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 320px));
  gap: 18px;
  align-items: start;
}

/* Six items do not fit a phone, and the brand already links home */
@media (max-width: 480px) {
  .site-nav-home { display: none; }
}

/* The fields scene stacks its demos in a column no wider than a phone form */
.field-stack {
  display: grid;
  gap: 14px;
  max-width: 360px;
}

.field-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
