/* Brief Mail — "Paper and ink" */

:root {
  --canvas: #FCFAF6;
  --surface: #F3EEE6;
  --text: #1D1A16;
  --text-2: #665E53;
  --accent: #2B50BF;
  --hairline: #E5DED2;

  --serif: ui-serif, "New York", "Iowan Old Style", "Charter", "Source Serif 4", Georgia, serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --measure: 36rem;
  --page: 68rem;
  --gutter: clamp(1rem, 4vw, 3rem);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #18150F;
    --surface: #221E18;
    --text: #EFE9E0;
    --text-2: #A59C8F;
    --accent: #93AAF2;
    --hairline: #342E26;
  }
}

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

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

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--sans);
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: var(--canvas); }

a {
  color: var(--accent);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
}
a:hover { text-decoration-color: currentColor; }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0;
}

p { margin: 0 0 1em; text-wrap: pretty; }

.skip {
  position: absolute;
  left: var(--gutter);
  top: -3rem;
  padding: 0.5rem 0.75rem;
  background: var(--text);
  color: var(--canvas);
  border-radius: 4px;
  z-index: 10;
}
.skip:focus { top: 1rem; }

.wrap {
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Masthead */

.masthead .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.75rem;
  padding-bottom: 1.75rem;
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.375rem;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9375rem;
}
.nav a {
  color: var(--text-2);
  text-decoration: none;
}
.nav a:hover,
.nav a[aria-current="page"] { color: var(--text); }

/* Hero */

.hero {
  padding-top: clamp(4rem, 12vw, 9rem);
  padding-bottom: clamp(4rem, 10vw, 8rem);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  margin: 0 0 2.5rem;
  font-size: 0.875rem;
  color: var(--text-2);
}
.status::before {
  content: "";
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: var(--accent);
}

.hero h1 {
  font-size: clamp(5.5rem, 19vw, 15rem);
  line-height: 0.85;
  letter-spacing: -0.035em;
  margin-left: -0.04em; /* optical: align the B stem with the text edge */
}

.hero-body {
  display: grid;
  gap: 2.5rem 4rem;
  margin-top: clamp(2.5rem, 6vw, 4rem);
}

.lede {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3.2vw, 2.125rem);
  line-height: 1.3;
  letter-spacing: -0.01em;
  max-width: 22em;
  margin: 0;
}

/* The name, set like a dictionary entry */
.entry {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-2);
  max-width: 22rem;
  border-top: 1px solid var(--hairline);
  padding-top: 1rem;
}
.entry dt {
  font-family: var(--serif);
  color: var(--text);
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}
.entry dt i { font-size: 0.9375rem; color: var(--text-2); margin-left: 0.5em; }
.entry dd { margin: 0 0 0.35rem; display: flex; gap: 0.75rem; }
.entry dd span:first-child {
  font-family: var(--serif);
  min-width: 1ch;
  color: var(--text);
}

@media (min-width: 52rem) {
  .hero-body {
    grid-template-columns: minmax(0, 1fr) 20rem;
    align-items: end;
  }
}

/* Sections */

.section {
  border-top: 1px solid var(--hairline);
  padding-top: clamp(2.5rem, 6vw, 4rem);
  padding-bottom: clamp(3.5rem, 9vw, 7rem);
  display: grid;
  gap: 2rem 4rem;
}

.section > header h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
}
.section > header p {
  color: var(--text-2);
  margin-top: 0.75rem;
  max-width: 24rem;
}

@media (min-width: 52rem) {
  .section { grid-template-columns: 18rem minmax(0, 1fr); }
  .section > header { position: sticky; top: 2rem; align-self: start; }
}

/* Feature list: term on the left, description on the right */

.features { margin: 0; }
.features > div {
  display: grid;
  gap: 0.35rem 2rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--hairline);
}
.features > div:first-child { padding-top: 0.25rem; }
.features > div:last-child { border-bottom: 0; }
.features dt {
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.3;
}
.features dd {
  margin: 0;
  color: var(--text-2);
  max-width: var(--measure);
}
.features dd q { color: var(--text); }

@media (min-width: 40rem) {
  .features > div { grid-template-columns: 13rem minmax(0, 1fr); }
}

/* Principles */

.principles {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  display: grid;
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  overflow: hidden;
}
.principles li {
  background: var(--surface);
  padding: 1.25rem 1.5rem 1.4rem;
}
.principles strong {
  display: block;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.1875rem;
  margin-bottom: 0.2rem;
}
.principles span { display: block; color: var(--text-2); font-size: 0.9375rem; line-height: 1.5; }

@media (min-width: 40rem) {
  .principles { grid-template-columns: 1fr 1fr; }
  .principles li:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

.note { color: var(--text-2); max-width: var(--measure); }

.prose-block p { max-width: var(--measure); }
.prose-block p.muted { color: var(--text-2); }

/* Footer */

.footer {
  border-top: 1px solid var(--hairline);
  color: var(--text-2);
  font-size: 0.875rem;
}
.footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-top: 2rem;
  padding-bottom: 3rem;
}
.footer nav { display: flex; gap: 1.5rem; }
.footer a { color: var(--text-2); text-decoration: none; }
.footer a:hover { color: var(--text); }
.footer p { margin: 0; }

/* Legal pages */

.doc {
  padding-top: clamp(3rem, 8vw, 6rem);
  padding-bottom: clamp(4rem, 10vw, 7rem);
}
.doc-head { max-width: 44rem; margin-bottom: 3rem; }
.doc-head h1 { font-size: clamp(2.5rem, 6vw, 3.75rem); letter-spacing: -0.02em; }
.doc-head .meta { color: var(--text-2); margin-top: 1rem; font-size: 0.9375rem; }

.prose { max-width: 40rem; }
.prose h2 {
  font-size: 1.625rem;
  margin: 3.5rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--hairline);
}
.prose h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: 0;
  margin: 2rem 0 0.5rem;
}
.prose ul, .prose ol { padding-left: 1.25rem; margin: 0 0 1em; }
.prose li { margin-bottom: 0.4em; }
.prose li::marker { color: var(--text-2); }
.prose code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 0.05em 0.35em;
  overflow-wrap: anywhere;
}
.prose address { font-style: normal; }

.summary {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 1.5rem 1.75rem;
  margin: 0 0 1rem;
}
.summary h2 { margin: 0 0 0.75rem; padding: 0; border: 0; font-size: 1.25rem; }
.summary ul { margin: 0; }

.callout {
  border-left: 2px solid var(--accent);
  padding: 0.25rem 0 0.25rem 1.25rem;
  margin: 1.5rem 0;
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.45;
}

.doc-layout { display: grid; gap: 2.5rem 6rem; }

.toc { font-size: 0.9375rem; }
.toc ol { columns: 2 12rem; column-gap: 2rem; padding-left: 1.5rem; margin: 0.5rem 0 0; }
.toc li { break-inside: avoid; margin-bottom: 0.3em; }
.toc a { color: var(--text-2); text-decoration: none; }
.toc a:hover { color: var(--accent); }
.toc p { margin: 0; font-weight: 600; }

@media (min-width: 64rem) {
  .doc-layout { grid-template-columns: minmax(0, 40rem) 14rem; }
  .toc { grid-column: 2; grid-row: 1; position: sticky; top: 2rem; align-self: start; }
  .toc ol { columns: auto; }
}

.placeholder {
  font-family: var(--mono);
  font-size: 0.875em;
  background: color-mix(in srgb, #A94A22 14%, transparent);
  border-radius: 3px;
  padding: 0 0.25em;
}

:target { scroll-margin-top: 1.5rem; }

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

@media print {
  .masthead nav, .footer nav, .skip { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  a { color: inherit; }
}
