/* Layout idea: a letter from far away. Cool paper, navy ink, and the red and
   blue edge of an airmail envelope, used only at the top and bottom of the page
   and on the one box that asks for something. Screenshots sit in plain frames. */

@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/fraunces-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/assets/fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/assets/fonts/atkinson-hyperlegible-next-latin-wght-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}

:root {
  --paper: #f5f6f9;
  --surface: #ffffff;
  --tint: #e9edf5;
  --ink: #14213d;
  --muted: #4d5872;
  --line: #d3d9e6;
  --blue: #1f4e9c;
  --red: #c2352f;
  --on-blue: #ffffff;
  --shadow: 0 1px 2px rgb(20 33 61 / 8%), 0 12px 32px -12px rgb(20 33 61 / 22%);

  --display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --body: "Atkinson Hyperlegible Next", "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e1422;
    --surface: #161e31;
    --tint: #131a2b;
    --ink: #e8ecf5;
    --muted: #a5afc6;
    --line: #2b3652;
    --blue: #8db2f5;
    --red: #ec6d66;
    --on-blue: #0e1422;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 12px 32px -12px rgb(0 0 0 / 70%);
    color-scheme: dark;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 5rem;
}

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

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

a {
  color: var(--blue);
  text-underline-offset: 0.18em;
}
a:hover {
  text-decoration-thickness: 2px;
}
:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 560;
  line-height: 1.12;
  letter-spacing: -0.012em;
  text-wrap: balance;
  margin: 0;
}
h1 {
  font-size: clamp(2.2rem, 1.3rem + 3.6vw, 3.7rem);
}
h2 {
  font-size: clamp(1.65rem, 1.2rem + 1.7vw, 2.4rem);
}
h3 {
  font-size: 1.25rem;
  line-height: 1.25;
}
p {
  margin: 0;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap.narrow {
  max-width: 46rem;
}

.skip {
  position: absolute;
  left: -999rem;
  top: 0.5rem;
  background: var(--surface);
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  z-index: 20;
}
.skip:focus {
  left: 0.5rem;
}

/* The airmail edge */
.airmail {
  height: 7px;
  background: repeating-linear-gradient(
    -45deg,
    var(--red) 0 14px,
    var(--paper) 14px 24px,
    var(--blue) 24px 38px,
    var(--paper) 38px 48px
  );
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  flex-wrap: wrap;
  padding-block: 0.7rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
}
.mark {
  color: var(--ink);
  flex: none;
}
.mark-sent {
  fill: var(--red);
}
.mark-sent-line {
  stroke: var(--red);
}
.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  font-size: 0.98rem;
}
.site-nav a:not(.button) {
  color: var(--ink);
  text-decoration: none;
  padding-block: 0.35rem;
}
.site-nav a:not(.button):hover {
  text-decoration: underline;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  border: 2px solid var(--blue);
  background: var(--blue);
  color: var(--on-blue);
  font-weight: 650;
  text-decoration: none;
  line-height: 1.2;
}
.button:hover {
  filter: brightness(1.1);
}
.button.quiet {
  background: transparent;
  color: var(--blue);
}
.button.small {
  min-height: 2.3rem;
  padding: 0.35rem 0.9rem;
  font-size: 0.95rem;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.lede {
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem);
  color: var(--muted);
  max-width: 38rem;
}
.note {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 38rem;
}

/* Screenshot frames */
.frame {
  margin: 0;
  display: grid;
  gap: 0.6rem;
  align-content: start;
}
.frame img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  background: var(--surface);
}
.frame.letter img {
  border-radius: 4px;
}
.frame figcaption {
  color: var(--muted);
  font-size: 0.92rem;
}

/* Hero */
.hero {
  padding-block: clamp(2.5rem, 6vw, 5rem) clamp(2.5rem, 5vw, 4rem);
}
.hero-grid {
  display: grid;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: center;
}
.hero-text {
  display: grid;
  gap: 1.25rem;
  justify-items: start;
}
.status {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
  border: 1.5px solid currentColor;
  border-radius: 999px;
  padding: 0.15rem 0.7rem;
}
@media (min-width: 60rem) {
  .hero-grid {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  }
}

/* Questions */
.questions {
  padding-block: clamp(2rem, 5vw, 3.5rem);
  border-block: 1px solid var(--line);
  background: var(--surface);
}
.questions h2 {
  font-size: 1.05rem;
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.question-list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 2rem;
}
.question-list li {
  display: grid;
  gap: 0.6rem;
  align-content: start;
  border-left: 3px solid var(--red);
  padding-left: 1.1rem;
}
.question-list li:nth-child(2) {
  border-color: var(--blue);
}
.question-list h3 {
  font-size: 1.45rem;
}
.question-list p {
  color: var(--muted);
}
@media (min-width: 52rem) {
  .question-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Feature sections */
.feature {
  padding-block: clamp(3rem, 7vw, 5.5rem);
  display: grid;
  gap: clamp(2rem, 4vw, 3rem);
}
.feature.tinted {
  background: var(--tint);
}
.split {
  display: grid;
  gap: clamp(1.75rem, 4vw, 3.5rem);
  align-items: start;
}
.copy {
  display: grid;
  gap: 1.1rem;
}
.copy > p {
  color: var(--muted);
  font-size: 1.12rem;
  max-width: 34rem;
}
.points {
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
  max-width: 36rem;
}
.points li {
  padding-left: 1.4rem;
  position: relative;
}
.points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--red);
}
.callout {
  margin-top: 0.5rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--surface);
  display: grid;
  gap: 0.4rem;
  max-width: 36rem;
}
.callout h3 {
  font-size: 1.15rem;
}
.trio,
.duo {
  display: grid;
  gap: clamp(1.25rem, 3vw, 2rem);
  align-items: start;
}
@media (min-width: 60rem) {
  .split {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  }
  .split.flip > .copy {
    order: 2;
  }
  .split.flip {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  }
}
@media (min-width: 44rem) {
  .trio {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.62fr);
  }
  .duo {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.55fr);
  }
  #office .duo {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.72fr);
  }
}

/* The name, and the box that asks for something */
.name-story {
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
  border-top: 1px solid var(--line);
}
.name-story .wrap {
  display: grid;
  gap: 1rem;
}
.name-story p {
  font-family: var(--display);
  font-size: clamp(1.15rem, 1rem + 0.7vw, 1.45rem);
  line-height: 1.5;
}
.start {
  padding-block: 0 clamp(3rem, 7vw, 5.5rem);
}
.ticket {
  display: grid;
  gap: 1.1rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 7px solid transparent;
  background-image:
    linear-gradient(var(--surface), var(--surface)),
    repeating-linear-gradient(-45deg, var(--red) 0 14px, var(--surface) 14px 24px, var(--blue) 24px 38px, var(--surface) 38px 48px);
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

/* Plain pages */
.plain {
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
}
.plain .wrap {
  display: grid;
  gap: 1.25rem;
}
.cards {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}
.card {
  display: grid;
  gap: 0.4rem;
  padding: 1.25rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
}
.card:hover {
  border-color: var(--blue);
}
.card h2 {
  font-size: 1.4rem;
  color: var(--blue);
}
.card p {
  color: var(--muted);
}

/* Guides */
.guide-layout {
  display: grid;
  gap: 2rem;
  padding-block: clamp(1.5rem, 4vw, 3rem) clamp(3rem, 6vw, 5rem);
  align-items: start;
}
.toc {
  font-size: 0.95rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 1rem 1.1rem;
}
.toc-title {
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.toc-title a {
  color: var(--ink);
  text-decoration: none;
}
.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.15rem;
}
.toc ol ol {
  margin: 0.2rem 0 0.5rem 0.75rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--line);
  font-size: 0.9rem;
}
.toc a {
  display: block;
  padding: 0.25rem 0;
  color: var(--muted);
  text-decoration: none;
}
.toc a:hover {
  color: var(--blue);
  text-decoration: underline;
}
.toc a[aria-current="page"] {
  color: var(--ink);
  font-weight: 700;
}
@media (min-width: 60rem) {
  .guide-layout {
    grid-template-columns: 16.5rem minmax(0, 1fr);
    gap: 3rem;
  }
  .toc {
    position: sticky;
    top: 5rem;
    max-height: calc(100vh - 6.5rem);
    overflow: auto;
  }
}

.prose {
  max-width: 46rem;
  min-width: 0;
}
.prose > * + * {
  margin-top: 1rem;
}
.prose h1 {
  font-size: clamp(2rem, 1.4rem + 2.2vw, 2.9rem);
}
.prose h2 {
  margin-top: 2.5rem;
  font-size: 1.7rem;
}
.prose h3 {
  margin-top: 2.2rem;
  font-size: 1.4rem;
}
.prose h4 {
  margin: 1.8rem 0 0;
  font-size: 1.08rem;
  font-family: var(--body);
}
.prose .anchor {
  color: inherit;
  text-decoration: none;
}
.prose .anchor:hover {
  text-decoration: underline;
}
.prose ul,
.prose ol {
  padding-left: 1.4rem;
}
.prose li + li {
  margin-top: 0.35rem;
}
.prose li > ul,
.prose li > ol {
  margin-top: 0.35rem;
}
.prose code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--tint);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.05em 0.3em;
  overflow-wrap: anywhere;
}
.prose pre {
  overflow-x: auto;
  background: var(--tint);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.9rem 1rem;
}
.prose pre code {
  background: none;
  border: 0;
  padding: 0;
  overflow-wrap: normal;
}
.prose blockquote {
  margin-inline: 0;
  padding: 0.2rem 0 0.2rem 1rem;
  border-left: 4px solid var(--line);
  color: var(--muted);
}
.table-scroll {
  overflow-x: auto;
}
.prose table {
  border-collapse: collapse;
  font-size: 0.95rem;
  min-width: 100%;
}
.prose th,
.prose td {
  border: 1px solid var(--line);
  padding: 0.45rem 0.65rem;
  text-align: left;
  vertical-align: top;
}
.prose th {
  background: var(--tint);
}
.prose .shot {
  display: block;
}
.prose .shot img {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.crumb {
  font-size: 0.95rem;
}
.topic-list {
  list-style: none;
  padding: 0 !important;
  display: grid;
  gap: 0.25rem;
  font-size: 1.15rem;
}
.pager {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.pager a {
  display: grid;
  gap: 0.1rem;
  text-decoration: none;
  font-weight: 650;
}
.pager a[rel="next"] {
  text-align: right;
  margin-left: auto;
}
.pager span {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--muted);
}

/* Footer */
.site-footer {
  background: var(--surface);
  color: var(--muted);
  font-size: 0.97rem;
}
.footer-grid {
  display: grid;
  gap: 1.5rem;
  padding-block: 2.25rem 1rem;
}
.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
  align-content: start;
}
.footer-name {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
}
.small-print {
  padding-block: 1rem 2rem;
  font-size: 0.88rem;
}
@media (min-width: 44rem) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
@media print {
  .site-header,
  .site-footer,
  .toc,
  .airmail {
    display: none;
  }
}
