/*
 * Quire product page: a bindery bench, warm paper and ink with the app's brass.
 * Headings are set in the book faces Windows already has (no download); the studio's
 * self-hosted IBM Plex Mono carries machine values (OFL 1.1).
 */

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/ibm-plex-mono-400-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f3ecdd;
  --sheet: #fbf8f1;
  --ink: #231c12;
  --support: #5c4f3c;
  --rule: #d6c8ab;
  --brass: #8a6420;
  --brass-deep: #6b4c16;
  --bench: #2a2116;
  --bench-ink: #f3ecdd;
  --focus: #8a6420;

  --book: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --text: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --machine: "IBM Plex Mono", "Cascadia Mono", Consolas, monospace;

  --gutter: clamp(1.25rem, 3vw, 3rem);
  --wrap: 84rem;
  --measure: 34rem;
  --chapter: clamp(4rem, 9vw, 8rem);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.65;
}

::selection {
  background: var(--brass);
  color: var(--sheet);
}

h1,
h2,
h3,
p,
dl,
dd,
figure {
  margin: 0;
}

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

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

a:hover {
  color: var(--ink);
}

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

.machine {
  font-family: var(--machine);
  font-size: 0.86em;
  font-variant-numeric: tabular-nums;
}

.wrap {
  width: min(var(--wrap), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--sheet);
}

.skip-link:focus {
  top: 1rem;
}

/* bar */
.bar {
  border-bottom: 1px solid var(--rule);
}

.bar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  min-height: 4rem;
}

.name {
  font-family: var(--book);
  font-size: 1.45rem;
}

.name a {
  color: var(--ink);
  text-decoration: none;
}

.name span {
  font-family: var(--text);
  font-size: 0.875rem;
  color: var(--support);
  margin-left: 0.35rem;
}

.name span a {
  color: var(--support);
  text-decoration: underline;
}

.bar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
}

.bar nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9375rem;
}

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

/* opening */
.open {
  padding-top: clamp(2.5rem, 6vw, 5rem);
}

.open-grid {
  display: grid;
  gap: 1.5rem clamp(1.5rem, 4vw, 4rem);
  align-items: end;
}

h1 {
  font-family: var(--book);
  font-weight: 400;
  font-size: clamp(2.8rem, 7vw, 6rem);
  line-height: 0.98;
  letter-spacing: -0.015em;
  max-width: 11ch;
}

.lede {
  font-size: clamp(1.15rem, 1.7vw, 1.4rem);
  line-height: 1.5;
  max-width: var(--measure);
}

.state {
  margin-top: 1.25rem;
  color: var(--support);
  font-size: 0.9375rem;
}

/* screens: the app's real window or its real pages, on the bench */
.screen {
  margin-top: clamp(2rem, 4vw, 3.5rem);
}

.screen img {
  background: var(--bench);
  border-radius: 6px;
}

.screen-hero,
.screen-pages {
  width: min(var(--wrap), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.screen-hero img {
  padding: clamp(0.5rem, 2vw, 1.75rem);
  box-shadow: 0 1px 0 var(--rule);
}

.screen-pages img {
  background: none;
  border-radius: 0;
}

.screen-tall {
  margin-top: 0;
}

.screen-tall img {
  padding: clamp(0.5rem, 1.6vw, 1.25rem);
  max-height: 46rem;
  width: auto;
  margin-inline: auto;
}

figcaption {
  margin-top: 0.75rem;
  color: var(--support);
  font-size: 0.875rem;
  line-height: 1.5;
  max-width: 44rem;
}

/* chapters */
.chapter {
  padding-top: var(--chapter);
}

.chapter-grid {
  display: grid;
  gap: 2rem clamp(1.5rem, 4vw, 4rem);
}

h2 {
  font-family: var(--book);
  font-weight: 400;
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  max-width: 18ch;
}

.chapter-copy p {
  margin-top: 1rem;
  max-width: var(--measure);
}

.ledger {
  border-top: 2px solid var(--ink);
  align-self: start;
}

.ledger div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule);
}

.ledger dt {
  font-family: var(--book);
  font-size: 1.15rem;
}

.ledger dd {
  color: var(--support);
}

/* credits */
.credits {
  margin-top: var(--chapter);
  padding-block: var(--chapter);
  background: var(--bench);
  color: var(--bench-ink);
}

.credits a {
  color: var(--bench-ink);
}

.credits-roll {
  display: grid;
  gap: 2.5rem clamp(1.5rem, 4vw, 4rem);
}

.credits h2 {
  color: var(--bench-ink);
}

.credit h3 {
  font-family: var(--text);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #d8c59d;
  margin-bottom: 0.75rem;
}

.credit p {
  padding: 0.6rem 0;
  border-top: 1px solid #4a3d2b;
  max-width: 40rem;
}

/* download and status */
.status {
  padding-block: var(--chapter);
}

.status-grid {
  display: grid;
  gap: 2rem clamp(1.5rem, 4vw, 4rem);
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.7rem 1.4rem;
  border-radius: 6px;
  background: var(--brass);
  color: var(--sheet);
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  background: var(--brass-deep);
  color: var(--sheet);
}

.fine {
  margin-top: 0.85rem;
  color: var(--support);
  font-size: 0.9375rem;
  max-width: 30rem;
}

.facts {
  border-top: 2px solid var(--ink);
}

.facts div {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rule);
}

.facts dt {
  color: var(--support);
  font-size: 0.9375rem;
}

.hash {
  overflow-wrap: anywhere;
}

/* footer */
.foot {
  border-top: 1px solid var(--rule);
  padding-block: 2rem;
  color: var(--support);
  font-size: 0.875rem;
}

.foot-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
}

@media (min-width: 64rem) {
  .open-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .open-grid h1 {
    grid-column: 1 / span 6;
  }

  .open-side {
    grid-column: 7 / -1;
  }

  .chapter-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: start;
  }

  .chapter-copy {
    grid-column: 1 / span 6;
  }

  .ledger {
    grid-column: 8 / -1;
  }

  .chapter-grid-wide .screen-tall,
  .chapter-report .screen-tall {
    grid-column: 8 / -1;
  }

  .credits-roll {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .credits-roll h2 {
    grid-column: 1 / -1;
  }

  .credit {
    grid-column: span 6;
  }

  .status-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .status-grid h2 {
    grid-column: 1 / span 3;
  }

  .get {
    grid-column: 4 / span 4;
  }

  .facts {
    grid-column: 8 / -1;
  }
}

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