/* Shared by every page. Colors, fonts and radii come from brands/leather/theme.css.
   The site is bound like a book: a leather cover at the top of every page, cream pages,
   and a leather back cover (the footer). */

:root {
  --step--1: .9375rem;
  --step-0: clamp(1.0625rem, 1rem + .3vw, 1.1875rem);
  --step-1: clamp(1.1875rem, 1.1rem + .4vw, 1.375rem);
  --step-2: clamp(1.625rem, 1.35rem + 1.2vw, 2.25rem);
  --step-3: clamp(2.125rem, 1.6rem + 2.4vw, 3.5rem);
  --step-4: clamp(2.625rem, 1.7rem + 4.3vw, 5.25rem);
  --gutter: clamp(1rem, .4rem + 2.6vw, 3rem);
  --max: 78rem;
  --measure: 38rem;
  --section: clamp(4rem, 2.5rem + 6vw, 8rem);
  --header-space: clamp(5rem, 4rem + 3vw, 7.5rem);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; color-scheme: light; scroll-padding-top: 1.5rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
  -webkit-tap-highlight-color: transparent;
}
img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
.nowrap { white-space: nowrap; }
h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  line-height: var(--display-leading);
  text-wrap: balance;
}
p, ol, ul, dl, dd, figure { margin: 0; }
p, li, dd { text-wrap: pretty; }
b, strong { font-weight: var(--strong-weight); }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
@media (hover: hover) { a:hover { text-decoration-thickness: 2px; } }
::selection { background: var(--thread); color: var(--ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.leather :focus-visible, .site-header :focus-visible { outline-color: var(--focus-on-leather); }

.wrap { width: min(100% - max(var(--gutter), env(safe-area-inset-left)) - max(var(--gutter), env(safe-area-inset-right)), var(--max)); margin-inline: auto; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: var(--gutter); top: .75rem; z-index: 10;
  padding: .75rem 1rem; border-radius: var(--radius-control);
  background: var(--thread); color: var(--ink); font-weight: var(--strong-weight); text-decoration: none;
  transform: translateY(-200%);
}
.skip:focus-visible { transform: none; }

/* Unknown facts. Yellow on purpose, so nobody ships one by accident. */
.ph {
  background: #FFE45C; color: #1D1F20; padding: 0 .2em; border-radius: 2px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

/* Header: sits over the leather cover at the top of every page. */
.site-header { position: absolute; inset: 0 0 auto; z-index: 2; padding-block: clamp(.75rem, .45rem + 1.2vw, 1.5rem); color: var(--on-leather); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.home { display: block; padding: .25rem; margin: -.25rem; border-radius: 6px; }
.site-nav { display: flex; align-items: center; gap: clamp(.75rem, 2vw, 2rem); }
.site-nav a:not(.btn) { font-weight: var(--strong-weight); text-decoration: none; padding-block: .75rem; }
@media (hover: hover) { .site-nav a:not(.btn):hover { text-decoration: underline; } }
.nav-short { display: none; }
@media (max-width: 34rem) {
  .site-nav .nav-section { display: none; }
  .nav-long { display: none; }
  .nav-short { display: inline; }
}

/* The cover: leather band at the top of each page, the header over it, a stitch along its foot. */
.cover { position: relative; padding-top: var(--header-space); }


/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 3rem; padding: .7rem 1.35rem;
  border: 0; border-radius: var(--radius-control);
  background: var(--accent); color: var(--on-accent);
  font: var(--strong-weight) 1.0625rem/1.2 var(--font-body); text-align: center; text-decoration: none;
  cursor: pointer; touch-action: manipulation; user-select: none;
  transition: background-color .15s ease-out, transform .12s ease-out;
}
@media (hover: hover) { .btn:hover { background: var(--accent-hover); text-decoration: none; } }
.btn:active { transform: scale(.97); }
.btn[disabled] { cursor: progress; opacity: .75; }
.btn--small { min-height: 2.75rem; padding: .55rem 1rem; font-size: 1rem; }
.leather .btn, .site-header .btn { background: var(--on-leather); color: var(--leather); }
@media (hover: hover) { .leather .btn:hover, .site-header .btn:hover { background: var(--thread); } }
.btn--ph { flex-wrap: wrap; background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--field-border); cursor: default; }
.btn--ph:active { transform: none; }
@media (hover: hover) { .btn--ph:hover { background: transparent; } }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem; }
.text-link { font-weight: var(--strong-weight); padding-block: .75rem; }

/* Says what kind of picture this is: Concept or Illustration. */
.tag {
  display: inline-flex; align-items: center; width: fit-content;
  padding: .3em .75em; border-radius: 999px;
  background: var(--thread); color: var(--ink);
  font-size: var(--step--1); font-weight: var(--strong-weight); line-height: 1.2;
}

.section { padding-block: var(--section); }
.lead { font-size: var(--step-1); line-height: 1.45; }
.soft { color: var(--ink-soft); }

/* Figures */
.figure { display: grid; gap: .875rem; }
.figure img { width: 100%; border-radius: 10px; background: var(--endpaper); }
.figure figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem .75rem; font-size: var(--step--1); color: var(--ink-soft); line-height: 1.45; max-width: 44rem; }

/* Install steps (home page and support page) */
.steps { list-style: none; padding: 0; counter-reset: step; display: grid; }
.steps > li {
  counter-increment: step;
  display: grid; grid-template-columns: 2.75rem 1fr; gap: 0 .75rem;
  padding-block: 1.25rem; border-top: 1px solid var(--rule);
}
.steps > li:last-child { border-bottom: 1px solid var(--rule); }
.steps > li::before {
  content: counter(step);
  font-family: var(--font-display); font-weight: var(--display-weight);
  font-size: 2.5rem; line-height: .85; color: var(--accent);
}
.steps h3 { font-family: var(--font-body); font-size: var(--step-1); font-weight: var(--strong-weight); letter-spacing: 0; line-height: 1.3; margin-bottom: .35rem; }
.steps .step-body { display: grid; gap: .75rem; align-content: start; }
.steps i { font-style: normal; font-weight: var(--strong-weight); }
.store { display: grid; gap: .4rem; justify-items: start; }
.note { font-size: var(--step--1); color: var(--ink-soft); }
.code-sample { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; font-size: var(--step--1); color: var(--ink-soft); }
.code {
  font-family: var(--font-body); font-weight: var(--strong-weight); font-size: 1.375rem; line-height: 1;
  letter-spacing: .14em; color: var(--ink);
  padding: .45rem .7rem .4rem .85rem; border-radius: 8px; background: var(--page);
  font-variant-numeric: tabular-nums lining-nums;
}

/* Waiting list form: always on leather. */
.waitlist-form { display: grid; gap: 1.25rem; }
.fields { display: grid; gap: 1.125rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.field { display: grid; gap: .4rem; align-content: start; }
.field label { font-weight: var(--strong-weight); line-height: 1.3; }
.field .opt { font-weight: 400; }
.field .hint { font-size: var(--step--1); line-height: 1.35; color: var(--on-leather-soft); }
input {
  width: 100%; min-height: 3rem; margin: 0; padding: .6rem .875rem;
  font: inherit; font-size: max(16px, 1rem); color: var(--ink);
  background: var(--field); border: 1.5px solid var(--field); border-radius: var(--radius-control);
  transition: border-color .15s ease-out, box-shadow .15s ease-out;
}
input:focus-visible { outline-offset: 2px; }
input[aria-invalid="true"] { border-color: var(--error-on-leather); box-shadow: 0 0 0 2px var(--error-on-leather); }
.field-error { font-size: var(--step--1); font-weight: var(--strong-weight); color: var(--error-on-leather); }
.field-error:empty { display: none; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; }
.form-status { font-weight: var(--strong-weight); }
.form-status:empty { display: none; }
.form-status.is-error { color: var(--error-on-leather); }
.waitlist-done { display: grid; gap: .5rem; align-content: start; }
.waitlist-done h3 { font-size: var(--step-2); }
.waitlist-done:focus { outline: none; }
.privacy-note { font-size: var(--step--1); line-height: 1.5; color: var(--on-leather-soft); }
.privacy-note > p { color: var(--on-leather); }
.privacy-note dl { display: grid; grid-template-columns: max-content 1fr; gap: .2rem 1rem; margin-top: .5rem; }
.privacy-note dt { font-weight: var(--strong-weight); color: var(--on-leather); }
@media (max-width: 30rem) { .privacy-note dl { grid-template-columns: 1fr; } .privacy-note dd { margin-bottom: .4rem; } }

/* Footer: the back cover. */
.site-footer { padding-block: clamp(1.25rem, 1rem + 1vw, 2rem) max(3rem, env(safe-area-inset-bottom)); font-size: var(--step--1); color: var(--on-leather-soft); }

.site-footer .wrap { display: grid; gap: 1.5rem 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); align-items: start; }
.site-footer nav ul { list-style: none; padding: 0; display: grid; }
.site-footer nav a { display: inline-block; padding-block: .7rem; color: var(--on-leather); font-weight: var(--strong-weight); }
.site-footer p + p { margin-top: .5rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
