/* stewbot.app: layout and type, on the design system's tokens in theme.css. Calm, with warmth:
   warm paper, slate for links and the one main action, soft corners, few borders. */

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

/* 1rem is body text, 17 points, as in the app. On iPhone and iPad it follows the reader's
   Dynamic Type size; elsewhere it follows the browser's text size. */
html {
  font-size: 106.25%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@supports (font: -apple-system-body) and (-webkit-touch-callout: default) {
  html {
    font: -apple-system-body;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: var(--body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--slate);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

strong {
  font-weight: 600;
}

/* Skip to the page's content, for keyboards and screen readers. */
.skip {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 2;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-full);
  background: var(--slate);
  color: var(--on-slate);
  font: var(--headline);
  text-decoration: none;
  transform: translateY(-200%);
}

.skip:focus {
  transform: none;
}

/* The bar at the top: the logo and name, which go home. */
.top {
  max-width: 1080px;
  margin: 0 auto;
  padding: var(--space-5) var(--space-5) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--size-touch);
  border-radius: var(--radius-md);
}

.brand img {
  width: 36px;
  height: 36px;
}

.brand .wordmark {
  width: auto;
  height: 19px;
  margin-top: 4px;
}

.top nav {
  margin-left: auto;
}

.top nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--size-touch);
  padding: 0 var(--space-2);
  font: var(--headline);
  text-decoration: none;
}

.top nav a:hover {
  text-decoration: underline;
}

main {
  display: block;
}

/* Reading pages: the policies, the terms, support and the recipe page. */
.doc {
  max-width: calc(var(--size-reading) + 2 * var(--space-5));
  margin: 0 auto;
  padding: var(--space-8) var(--space-5) var(--space-12);
}

.doc h1 {
  margin: 0;
  font: var(--large-title);
  letter-spacing: -0.01em;
}

.doc .meta {
  margin: var(--space-2) 0 0;
  color: var(--ink-muted);
  font: var(--subhead);
}

.doc .lede {
  margin: var(--space-5) 0 0;
  font: var(--body);
  font-size: 1.0588rem;
}

.doc h2 {
  margin: var(--space-12) 0 var(--space-3);
  font: var(--title-2);
  scroll-margin-top: var(--space-5);
}

.doc h3 {
  margin: var(--space-6) 0 var(--space-2);
  font: var(--headline);
  scroll-margin-top: var(--space-5);
}

.doc p,
.doc ul,
.doc ol,
.doc dl,
.doc table,
.doc address {
  margin: 0 0 var(--space-4);
}

.doc ul,
.doc ol {
  padding-left: 1.25rem;
}

.doc .items {
  padding: 0;
}

.doc li + li {
  margin-top: var(--space-2);
}

.doc li::marker {
  color: var(--ink-muted);
}

.muted {
  color: var(--ink-muted);
}

/* "The short version": a soft slate card at the top of a policy. */
.summary {
  margin: var(--space-6) 0 0;
  padding: var(--space-5) var(--space-5) var(--space-1);
  border-radius: var(--radius-lg);
  background: var(--slate-soft);
}

.summary h2 {
  margin: 0 0 var(--space-3);
  font: var(--title-3);
}

.summary ul {
  padding-left: 1.1rem;
}

/* "On this page": the policy's sections, as links. */
.toc {
  margin: var(--space-6) 0 0;
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.toc h2 {
  margin: 0 0 var(--space-2);
  color: var(--ink-muted);
  font: var(--subhead);
  font-weight: 600;
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 2 15rem;
  column-gap: var(--space-6);
}

.toc li {
  break-inside: avoid;
}

.toc li + li {
  margin-top: 0;
}

.toc a {
  display: inline-block;
  padding: var(--space-1) 0;
  font: var(--callout);
}

/* A list of things, each a short heading with words under it. */
.items {
  margin: 0 0 var(--space-4);
  padding: 0;
  list-style: none;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.items > li {
  margin: 0;
  padding: var(--space-4) var(--space-5);
}

.items > li + li {
  margin-top: 0;
  border-top: 1px solid var(--line);
}

.items h3 {
  margin: 0 0 var(--space-1);
  font: var(--headline);
}

.items p {
  margin: 0;
}

.items p + p {
  margin-top: var(--space-2);
}

.items .label {
  display: block;
  color: var(--ink-muted);
  font: var(--footnote);
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Two-column tables: what, and how long or what goes. They stack on a phone. */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.table th,
.table td {
  padding: var(--space-3) var(--space-5);
  text-align: left;
  vertical-align: top;
}

.table thead th {
  color: var(--ink-muted);
  font: var(--footnote);
  font-weight: 600;
}

.table tbody th,
.table tbody td {
  border-top: 1px solid var(--line);
}

.table tbody th {
  width: 42%;
  font-weight: 600;
}

@media (max-width: 560px) {
  .table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .table tbody th,
  .table tbody td {
    display: block;
    width: auto;
  }

  .table tbody th {
    padding-bottom: var(--space-1);
  }

  .table tbody td {
    padding-top: 0;
    border-top: 0;
  }
}

/* The copyright agent's address, set apart. */
.contact {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  font-style: normal;
}

/* A note: a soft card for something worth stopping on. */
.note {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  background: var(--slate-soft);
}

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

code {
  padding: 0.1em 0.35em;
  border-radius: 6px;
  background: var(--fill);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.88em;
}

/* The home page. */
.home {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--space-5) var(--space-12);
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-12) 0 var(--space-8);
  text-align: center;
}

.hero img {
  width: 152px;
  height: 152px;
  margin-bottom: var(--space-4);
}

.hero h1 {
  margin: 0;
  font: var(--large-title);
  font-size: 2.6rem;
  letter-spacing: -0.015em;
}

.hero .tagline {
  max-width: 24ch;
  margin: var(--space-3) 0 0;
  font: var(--title-2);
  font-weight: 500;
}

.hero .lede {
  max-width: 34rem;
  margin: var(--space-4) 0 0;
  color: var(--ink-muted);
}

.pill {
  display: inline-block;
  margin: var(--space-6) 0 0;
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-full);
  background: var(--slate-soft);
  color: var(--ink);
  font: var(--headline);
}

.section {
  padding: var(--space-12) 0 0;
}

.section > h2 {
  margin: 0;
  font: var(--title-1);
  text-align: center;
}

.section > .intro {
  max-width: 36rem;
  margin: var(--space-3) auto 0;
  color: var(--ink-muted);
  text-align: center;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15.5rem), 1fr));
  gap: var(--space-4);
  margin: var(--space-8) 0 0;
  padding: 0;
  list-style: none;
}

.card {
  margin: 0;
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.card h3 {
  margin: 0 0 var(--space-2);
  font: var(--title-3);
}

.card p {
  margin: 0;
  color: var(--ink-muted);
}

.card p + p {
  margin-top: var(--space-2);
}

/* A recipe illustration on its tile, as in the app's cards. */
.tile {
  display: grid;
  place-items: center;
  width: var(--size-tile);
  height: var(--size-tile);
  margin-bottom: var(--space-4);
  border-radius: var(--radius-md);
}

.tile img {
  width: 52px;
  height: 52px;
}

.tile.saffron {
  background: var(--tile-saffron);
}

.tile.sage {
  background: var(--tile-sage);
}

.tile.tomato {
  background: var(--tile-tomato);
}

.tile.slate {
  background: var(--tile-slate);
}

.tile.oat {
  background: var(--tile-oat);
}

.step-number {
  display: inline-grid;
  place-items: center;
  min-width: 1.75rem;
  height: 1.75rem;
  margin-right: var(--space-2);
  border-radius: var(--radius-full);
  background: var(--slate);
  color: var(--on-slate);
  font: var(--step-number);
  vertical-align: 0.1em;
}

/* Two columns that stack: words beside a list, or two plans. */
.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: var(--space-4);
  margin: var(--space-8) 0 0;
}

.checks {
  margin: 0;
  padding: 0;
  list-style: none;
}

.checks li {
  position: relative;
  padding-left: 1.9rem;
}

.checks li + li {
  margin-top: var(--space-3);
}

/* A check mark drawn with borders, in herb, beside each promise. */
.checks li::before {
  content: "";
  position: absolute;
  top: 0.32em;
  left: 0.3rem;
  width: 0.45rem;
  height: 0.8rem;
  border: solid var(--herb);
  border-width: 0 0.16rem 0.16rem 0;
  transform: rotate(45deg);
}

.checks a {
  font-weight: 600;
}

.card .price {
  margin: var(--space-1) 0 var(--space-4);
  color: var(--ink);
  font: var(--title-1);
}

.card .price span {
  display: block;
  margin-top: var(--space-1);
  color: var(--ink-muted);
  font: var(--subhead);
}

.card.plus {
  box-shadow: var(--shadow-card), inset 0 0 0 2px var(--slate);
}

.card .checks {
  color: var(--ink);
}

.small {
  color: var(--ink-muted);
  font: var(--footnote);
}

.center {
  text-align: center;
}

.center .tile {
  margin-left: auto;
  margin-right: auto;
}

.more {
  margin: var(--space-6) 0 0;
  text-align: center;
}

.more a {
  font: var(--headline);
}

.fine {
  max-width: 36rem;
  margin: var(--space-5) auto 0;
  color: var(--ink-muted);
  font: var(--footnote);
  text-align: center;
}

/* The footer: every page, and who makes Stewbot. */
.foot {
  border-top: 1px solid var(--line);
}

.foot > div {
  max-width: 1080px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-5) var(--space-8);
}

.foot ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot li a {
  display: inline-flex;
  align-items: center;
  min-height: var(--size-touch);
  font: var(--subhead);
}

.foot p {
  margin: var(--space-2) 0 0;
  color: var(--ink-muted);
  font: var(--footnote);
}

@media (min-width: 768px) {
  .top,
  .home,
  .foot > div {
    padding-left: var(--space-8);
    padding-right: var(--space-8);
  }

  .doc {
    padding-top: var(--space-12);
  }

  .hero h1 {
    font-size: 3rem;
  }
}

@media print {
  body {
    background: none;
  }

  .skip,
  .top nav,
  .toc,
  .foot {
    display: none;
  }

  .summary,
  .items,
  .table,
  .contact,
  .note {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}
