/* The public pages: the menu, the footer, the start page, and long-form text.
   Loaded after base.css, which holds the colors and fonts.

   Nothing here paints html or body unless the body has the "site" class.
   index.html loads this file too, and index.html is also the page Zoom draws
   into the video, which has to stay see-through. */

body.site {
  background: var(--paper);
  font-size: 17px;
  line-height: 1.6;
  letter-spacing: 0.01em;
  /* The footer sits at the bottom of the window on a short page. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body.site > main {
  flex: 1 0 auto;
  width: 100%;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  text-decoration: none;
  z-index: 2;
}

.skip:focus {
  left: 16px;
}

/* ---------------------------------------------------------------- menu */

.site-header {
  border-bottom: 1px solid var(--line);
}

.site-header .bar {
  max-width: 68rem;
  margin: 0 auto;
  padding: 16px 24px 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 40px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 6px;
  text-decoration: none;
  font: 400 30px/1 var(--font-head);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.site-brand img {
  display: block;
  width: 34px;
  height: 34px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 28px;
}

.site-nav a {
  padding: 8px 0 5px;
  border-bottom: 3px solid transparent;
  text-decoration: none;
  font: 500 14px/1.2 var(--font-ui);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.site-nav a:hover {
  border-bottom-color: var(--line);
}

.site-nav a[aria-current="page"] {
  border-bottom-color: var(--sun);
  font-weight: 600;
}

/* ---------------------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

.site-footer .bar {
  max-width: 68rem;
  margin: 0 auto;
  padding: 28px 24px 44px;
  display: grid;
  gap: 12px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
}

.site-footer .legal {
  max-width: 44rem;
  font-size: 14px;
}

/* ---------------------------------------------------------------- start page */

[data-view="landing"] {
  display: grid;
  align-items: center;
}

.hero {
  width: 100%;
  max-width: 68rem;
  margin: 0 auto;
  padding: clamp(40px, 9vh, 104px) 24px;
  display: grid;
  grid-template-columns: minmax(0, 32rem) minmax(0, 21rem);
  justify-content: space-between;
  align-items: center;
  gap: 40px 56px;
}

/* The text block keeps its own styles (app.css). Inside the hero it gives up
   the full-height centering it uses when it stands alone. */
.hero .landing {
  min-height: 0;
  max-width: none;
  margin: 0;
  padding: 0;
}

.hero .landing p:not(.tagline):not(.fine) {
  font-size: 18px;
  line-height: 1.5;
}

.hero .actions {
  gap: 10px 22px;
}

.text-link {
  font-size: 16px;
  text-underline-offset: 3px;
}

.hero-clock {
  margin: 0;
  display: grid;
  justify-items: center;
  gap: 14px;
}

.hero-face {
  display: block;
  width: min(100%, 21rem);
  aspect-ratio: 1;
}

/* ---------------------------------------------------------------- pages */

.page {
  max-width: 68rem;
  margin: 0 auto;
  padding: clamp(36px, 7vw, 68px) 24px 96px;
}

.page h1 {
  font: 400 clamp(38px, 7vw, 64px) / 1 var(--font-head);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-wrap: balance;
  margin-bottom: 20px;
}

.lede {
  max-width: 36rem;
  font-size: 21px;
  line-height: 1.45;
}

.dated {
  margin-top: 10px;
  color: var(--muted);
  font-size: 15px;
}

.prose {
  max-width: 34rem;
}

.prose h2 {
  font: 600 25px/1.25 var(--font-ui);
  letter-spacing: 0.005em;
  margin: 48px 0 10px;
  scroll-margin-top: 20px;
}

.prose h3 {
  font: 600 19px/1.3 var(--font-ui);
  margin: 28px 0 6px;
  scroll-margin-top: 20px;
}

.prose p,
.prose ul,
.prose ol,
.prose table {
  margin: 0 0 14px;
}

.prose ul,
.prose ol {
  padding-left: 1.3em;
}

.prose li + li {
  margin-top: 5px;
}

.prose b,
.prose strong {
  font-weight: 600;
}

.page a {
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.page a:hover {
  background: var(--sun-soft);
}

/* A key on the keyboard, and a control in the app. */
kbd {
  display: inline-block;
  min-width: 1.9em;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--field);
  font: 500 15px/1.5 var(--font-ui);
  text-align: center;
  white-space: nowrap;
}

.note {
  margin: 0 0 14px;
  padding: 12px 16px;
  border-left: 3px solid var(--sun);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--sunken);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

.prose th,
.prose td {
  padding: 9px 12px 9px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.prose th {
  border-bottom-color: var(--edge);
  font-weight: 600;
}

.prose th[scope="row"] {
  border-bottom-color: var(--line);
  padding-right: 28px;
  white-space: nowrap;
}

.prose td:first-child {
  white-space: nowrap;
  padding-right: 20px;
}

.prose table.wide td:first-child {
  white-space: normal;
}

/* The main action, as on the start page. */
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 18px;
  border-radius: var(--radius);
  background: var(--sun);
  color: var(--ink);
  text-decoration: none;
  font: 600 16px/1.1 var(--font-ui);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.page a.cta:hover {
  background: var(--sun-up);
}

/* ---------------------------------------------------------------- how to use
   The step numbers are set in the clock's own digits. */

.steps {
  list-style: none;
  max-width: 41rem;
  margin: 40px 0 0;
  padding: 0;
  counter-reset: step;
}

.steps > li {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 0 18px;
  padding: 24px 0 22px;
  border-top: 1px solid var(--line);
  counter-increment: step;
}

.steps > li::before {
  content: counter(step);
  font: 800 60px/0.86 var(--font-display);
}

.steps h2 {
  font: 600 23px/1.25 var(--font-ui);
  margin-bottom: 6px;
}

.steps p {
  margin-bottom: 10px;
}

.steps p:last-child {
  margin-bottom: 0;
}

/* ---------------------------------------------------------------- shortcuts
   A page to keep on a second screen while the meeting runs on the first:
   every key in view at once, drawn as a keycap, large enough to read at a
   glance. Sizes follow the width of the window, so a big screen gets big
   keys, and the whole list fits a laptop screen without scrolling. */

.page.keys-page {
  --cap: clamp(3.5rem, 5.6vw, 7rem);
  padding-top: clamp(20px, 3vw, 36px);
}

/* This page uses more of a wide screen, and its menu and footer line up
   with it. */
.page.keys-page,
.site.wide .site-header .bar,
.site.wide .site-footer .bar {
  max-width: 90rem;
}

.keys-page h1 {
  font-size: clamp(34px, 4vw, 52px);
  margin-bottom: 10px;
}

.keys-page .lede {
  max-width: none;
  font-size: 20px;
}

.key-groups {
  --row-gap: clamp(16px, 2vw, 30px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px clamp(24px, 4vw, 64px);
  margin-top: clamp(24px, 3.6vw, 44px);
}

.key-group h2 {
  font: 500 14px/1.2 var(--font-ui);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}

.key-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--row-gap);
}

/* Side by side, the three lists share their rows, so the first key of each
   group sits on one line, the second on the next, and a long label makes its
   whole row taller, not one column crooked. */
@supports (grid-template-rows: subgrid) {
  @media (min-width: 881px) {
    .key-groups {
      grid-template-rows: auto repeat(3, auto);
      row-gap: 0;
    }

    .key-group {
      display: grid;
      grid-row: 1 / span 4;
      grid-template-rows: subgrid;
    }

    .key-group ul {
      grid-row: 2 / span 3;
      grid-template-rows: subgrid;
      row-gap: var(--row-gap);
      align-items: start;
    }
  }
}

.shortcut {
  display: grid;
  gap: 10px;
}

.caps {
  display: flex;
  gap: 10px;
}

/* One key. White with an ink edge that is thick along the bottom, the way a
   keycap shows its front face. The letter is set in the clock's own digits. */
.cap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--cap);
  height: var(--cap);
  padding: 0 calc(var(--cap) * 0.2);
  border: 3px solid var(--ink);
  border-bottom-width: calc(var(--cap) * 0.13);
  border-radius: calc(var(--cap) * 0.18);
  background: var(--field);
  color: var(--ink);
  font: 800 calc(var(--cap) * 0.6) / 1 var(--font-display);
  text-transform: uppercase;
}

/* The space bar is wide, as it is on a keyboard. */
.cap.wide {
  min-width: calc(var(--cap) * 3.2);
  font-size: calc(var(--cap) * 0.42);
  letter-spacing: 0.08em;
}

.cap svg {
  display: block;
  width: calc(var(--cap) * 0.58);
  height: calc(var(--cap) * 0.58);
}

.does {
  font: 500 clamp(1.25rem, 2vw, 2.4rem) / 1.2 var(--font-ui);
  letter-spacing: 0.01em;
}

.keys-note {
  max-width: 46rem;
  margin-top: clamp(28px, 4vw, 44px);
  color: var(--muted);
}

/* ---------------------------------------------------------------- long pages
   A list of the sections sits beside the text on a wide screen. */

.with-toc {
  display: grid;
  grid-template-columns: 13.5rem minmax(0, 34rem);
  gap: 0 64px;
  align-items: start;
  margin-top: 40px;
}

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

.toc {
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 2px 0 2px 16px;
  border-left: 3px solid var(--line);
  font-size: 15px;
  line-height: 1.35;
}

.toc h2 {
  font: 500 12px/1.2 var(--font-ui);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
}

.toc a {
  text-decoration: none;
}

.toc a:hover {
  text-decoration: underline;
}

/* ---------------------------------------------------------------- small screens */

@media (max-width: 880px) {
  .with-toc {
    grid-template-columns: minmax(0, 1fr);
  }

  .key-groups {
    grid-template-columns: minmax(0, 1fr);
  }

  .toc {
    position: static;
    max-height: none;
    margin-bottom: 36px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    justify-items: start;
  }

  .hero-clock {
    justify-self: center;
    width: min(100%, 17rem);
  }
}

@media (max-width: 560px) {
  .site-header .bar {
    padding-top: 14px;
  }

  .site-nav {
    gap: 0 20px;
  }

  .site-nav a {
    font-size: 13px;
  }

  .steps > li {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 0 12px;
  }

  .steps > li::before {
    font-size: 44px;
  }

  .prose td:first-child {
    white-space: normal;
  }
}
