/* Lineage Bureau. Ledger paper, blue-black ink, oxblood stamp. */

@font-face {
  font-family: 'Literata';
  src: url('/fonts/literata-latin-wght-normal.woff2') format('woff2');
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Literata';
  src: url('/fonts/literata-latin-wght-italic.woff2') format('woff2');
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Courier Prime';
  src: url('/fonts/courier-prime-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Courier Prime';
  src: url('/fonts/courier-prime-latin-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --paper: #e6ecdf;
  --sheet: #fafbf6;
  --ink: #1b2a3a;
  --ink-soft: #455263;
  --rule: #9db09a;
  --rule-faint: #cfdaca;
  --stamp: #8c2f39;
  --verify: #2c5a44;
  --deep: #1f332d;
  --deep-ink: #e6ecdf;
  --deep-soft: #b9c9b8;

  --serif: 'Literata', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --typed: 'Courier Prime', 'Courier New', Courier, monospace;

  --gutter: clamp(1.125rem, 4vw, 2.5rem);
  --band: clamp(3.5rem, 8vw, 6.5rem);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.62;
  font-optical-sizing: auto;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
h1 {
  font-size: clamp(2.6rem, 6.4vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  font-weight: 480;
}
h2 {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
}
h3 {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0;
}
p {
  margin: 0 0 1em;
  max-width: 68ch;
}
a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover {
  text-decoration-thickness: 2px;
}
:focus-visible {
  outline: 3px solid var(--stamp);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}

.wrap {
  max-width: 74rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.typed {
  font-family: var(--typed);
  font-size: 0.9rem;
  line-height: 1.4;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  background: var(--ink);
  color: var(--sheet);
  padding: 0.6rem 1rem;
}
.skip:focus {
  top: 1rem;
}

/* ---------- buttons ---------- */

.button {
  display: inline-block;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--sheet);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.85rem 1.4rem;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.button:hover {
  background: var(--stamp);
  border-color: var(--stamp);
}
.button.small {
  padding: 0.5rem 0.95rem;
  font-size: 0.95rem;
}
.button.quiet {
  background: transparent;
  color: var(--ink);
}
.button.quiet:hover {
  background: var(--ink);
  color: var(--sheet);
  border-color: var(--ink);
}
.button[disabled] {
  opacity: 0.6;
  cursor: progress;
}

/* ---------- header ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.top-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-block: 0.7rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 650;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  margin-right: auto;
}
.top nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.98rem;
}
.top nav a {
  text-decoration: none;
}
.top nav a:hover {
  text-decoration: underline;
}

/* ---------- hero ---------- */

.hero {
  padding-block: clamp(2.5rem, 6vw, 5rem) var(--band);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
.lede {
  font-size: clamp(1.1rem, 1.5vw, 1.28rem);
  line-height: 1.55;
  margin-top: 1.5rem;
  max-width: 34em;
}

.join {
  margin-top: 2rem;
  max-width: 34rem;
}
.join > label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.join-row {
  display: flex;
  gap: 0.6rem;
}
.join input[type='email'] {
  flex: 1 1 auto;
  min-width: 0;
  font: inherit;
  color: var(--ink);
  background: var(--sheet);
  border: 2px solid var(--ink);
  border-radius: 0;
  padding: 0.85rem 0.9rem;
}
.join input::placeholder {
  color: #6b7786;
}
.hp {
  position: absolute;
  left: -200vw;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.form-note {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0.8rem 0 0;
}
.form-error {
  margin: 0.8rem 0 0;
  padding: 0.6rem 0.8rem;
  border-left: 4px solid var(--stamp);
  background: var(--sheet);
  color: var(--stamp);
  font-weight: 600;
}

/* The case file: the one place the page shows the method instead of describing it. */
.casefile {
  margin: 0;
  background: var(--sheet);
  border: 1px solid var(--rule);
  box-shadow: 6px 6px 0 var(--rule-faint);
  padding: clamp(1.1rem, 2.4vw, 1.75rem);
}
.casefile-head {
  border-bottom: 2px solid var(--ink);
  padding-bottom: 0.9rem;
}
.casefile-head .typed {
  margin: 0 0 0.3rem;
  color: var(--ink-soft);
}
.casefile-question {
  margin: 0;
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 600;
  line-height: 1.2;
}
.chain {
  list-style: none;
  margin: 0;
  padding: 0;
}
.chain li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding-block: 1rem;
  border-bottom: 1px solid var(--rule-faint);
}
.record p {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.5;
}
.record .record-source {
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.casefile-finding {
  margin: 1rem 0 0;
  font-size: 1.02rem;
}
figcaption {
  margin-top: 0.9rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-style: italic;
}

/* Rubber stamps. Capitals here are the stamp's own lettering, not a label style. */
.stamp {
  display: inline-block;
  font-family: var(--typed);
  font-weight: 700;
  font-size: 0.8rem;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.42rem 0.55rem 0.34rem;
  border: 2px solid currentColor;
  border-radius: 3px;
  transform: rotate(-4deg);
  white-space: nowrap;
}
.stamp-lead {
  color: var(--ink-soft);
}
.stamp-corroborated {
  color: var(--verify);
  transform: rotate(3deg);
}
.stamp-confirmed {
  color: var(--stamp);
}
.stamp.still {
  transform: none;
}

/* One orchestrated moment: the three stamps land in order as the case is built. */
@media (prefers-reduced-motion: no-preference) {
  .chain .stamp {
    opacity: 0;
    animation: stamp-down 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.2) forwards;
  }
  .chain li:nth-child(1) .stamp {
    animation-delay: 0.7s;
  }
  .chain li:nth-child(2) .stamp {
    animation-delay: 1.5s;
  }
  .chain li:nth-child(3) .stamp {
    animation-delay: 2.3s;
  }
  .casefile-finding {
    opacity: 0;
    animation: settle 0.5s ease-out 2.9s forwards;
  }
}
@keyframes stamp-down {
  from {
    opacity: 0;
    scale: 1.7;
  }
  to {
    opacity: 1;
    scale: 1;
  }
}
@keyframes settle {
  to {
    opacity: 1;
  }
}

/* ---------- bands ---------- */

.band {
  padding-block: var(--band);
  border-top: 1px solid var(--rule);
}
.band-sheet {
  background: var(--sheet);
}
.band-deep {
  background: var(--deep);
  color: var(--deep-ink);
  border-top-color: var(--deep);
}
.band-deep :focus-visible {
  outline-color: var(--deep-ink);
}
.section-intro {
  font-size: 1.15rem;
  margin-top: 1rem;
  max-width: 44em;
}

/* Process: a true sequence, so it is numbered. */
.steps {
  list-style: none;
  counter-reset: step;
  margin: 2.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1.25rem, 2.5vw, 2.25rem);
}
.steps li {
  counter-increment: step;
  border-top: 2px solid var(--ink);
  padding-top: 0.9rem;
}
.steps li::before {
  content: counter(step);
  display: block;
  font-family: var(--typed);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--stamp);
  margin-bottom: 0.7rem;
}
.steps h3 {
  margin-bottom: 0.5rem;
}
.steps p {
  margin: 0;
  font-size: 1rem;
}

/* Method */
.method-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
.method-grid h2 {
  margin-bottom: 1.4rem;
}
.grades {
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: clamp(1.1rem, 2.2vw, 1.6rem);
}
.grades h3 {
  margin-bottom: 0.4rem;
}
.grades dl {
  margin: 0;
}
.grades dl > div {
  padding-block: 1rem;
  border-bottom: 1px solid var(--rule);
}
.grades dl > div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.grades dt {
  margin-bottom: 0.5rem;
}
.grades dd {
  margin: 0;
  font-size: 0.98rem;
}

/* Deliverables */
.deliver-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
.deliver-grid h2 {
  margin-bottom: 1.4rem;
}
.plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.plain-list li {
  padding-block: 0.85rem;
  border-top: 1px solid var(--rule);
}
.plain-list li:last-child {
  border-bottom: 1px solid var(--rule);
}
.report {
  margin: 0;
  background: var(--sheet);
  border: 1px solid var(--rule);
  box-shadow: 6px 6px 0 var(--rule-faint);
  padding: clamp(1.1rem, 2.4vw, 1.75rem);
}
.report-title {
  font-weight: 700;
  margin: 0 0 0.8rem;
}
.table-scroll {
  overflow-x: auto;
}
.report table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--typed);
  font-size: 0.86rem;
  line-height: 1.35;
  min-width: 27rem;
}
.report th,
.report td {
  text-align: left;
  padding: 0.5rem 0.6rem 0.5rem 0;
  border-bottom: 1px solid var(--rule-faint);
  vertical-align: top;
}
.report thead th {
  border-bottom: 2px solid var(--ink);
  font-weight: 700;
}

/* Pricing: a schedule of fees, set as a ledger. */
.fees {
  width: 100%;
  border-collapse: collapse;
  margin-top: 2.25rem;
}
.fees th,
.fees td {
  text-align: left;
  vertical-align: top;
  padding: 1.15rem 1.5rem 1.15rem 0;
  border-bottom: 1px solid var(--rule);
}
.fees thead th {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-soft);
  padding-block: 0 0.6rem;
  border-bottom: 2px solid var(--ink);
}
.fees tbody th {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.2;
  width: 22%;
}
.fees td:nth-child(3) {
  white-space: nowrap;
}
.fees .num {
  text-align: right;
  padding-right: 0;
}
.fees tbody .num {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 500;
  line-height: 1.1;
  font-variant-numeric: lining-nums tabular-nums;
  white-space: nowrap;
}
.fees-notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.25rem, 4vw, 3.5rem);
  margin-top: 2rem;
}
.fees-notes p {
  margin: 0;
}

/* Privacy */
.promises {
  list-style: none;
  margin: 2.25rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1.25rem, 2.5vw, 2.25rem);
}
.promises li {
  border-top: 1px solid var(--deep-soft);
  padding-top: 1rem;
}
.promises h3 {
  margin-bottom: 0.5rem;
}
.promises p {
  margin: 0;
  font-size: 1rem;
  color: var(--deep-soft);
}

/* Questions */
.faq-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.42fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 4.5rem);
  align-items: start;
}
.faq details {
  border-top: 1px solid var(--rule);
}
.faq details:last-child {
  border-bottom: 1px solid var(--rule);
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1.1rem;
  padding: 1rem 2rem 1rem 0;
  list-style: none;
  position: relative;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: '+';
  position: absolute;
  right: 0.2rem;
  top: 0.8rem;
  font-family: var(--typed);
  font-size: 1.4rem;
  line-height: 1;
  color: var(--stamp);
}
.faq details[open] summary::after {
  content: '\2212';
}
.faq details p {
  margin: 0 0 1.1rem;
}

/* Closing */
.closing p {
  max-width: 40rem;
}
.closing h2 {
  margin-bottom: 0.8rem;
}
.closing .join {
  margin-top: 1.5rem;
}

/* Footer */
.foot {
  background: var(--deep);
  color: var(--deep-soft);
  padding-block: 3rem;
  font-size: 0.93rem;
}
.foot p {
  max-width: 78ch;
}
.foot .ack {
  color: var(--deep-ink);
  border-left: 3px solid var(--rule);
  padding-left: 1rem;
  margin-bottom: 1.5rem;
}
.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  margin: 1.5rem 0 0;
}
.foot a {
  color: var(--deep-ink);
}
.foot :focus-visible {
  outline-color: var(--deep-ink);
}

/* ---------- dialog ---------- */

dialog {
  width: min(40rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--sheet);
  color: var(--ink);
  padding: clamp(1.25rem, 4vw, 2.25rem);
}
dialog::backdrop {
  background: rgb(27 42 58 / 0.6);
}
dialog h2 {
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  margin-bottom: 0.9rem;
}
dialog h2:focus {
  outline: none;
}
dialog h3 {
  margin: 1.5rem 0 0.5rem;
}
dialog ol {
  margin: 0;
  padding-left: 1.3rem;
}
dialog ol li {
  margin-bottom: 0.3rem;
}
fieldset {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 1.25rem 0 0;
  padding: 1rem 0 0;
  min-width: 0;
}
legend {
  float: left;
  width: 100%;
  padding: 0;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 1.08rem;
  line-height: 1.3;
}
fieldset label {
  clear: both;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.4rem 0;
  cursor: pointer;
}
fieldset input {
  flex: none;
  width: 1.2rem;
  height: 1.2rem;
  margin: 0.22rem 0 0;
  accent-color: var(--stamp);
}
.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}
#done-fit {
  border-left: 4px solid var(--verify);
  padding: 0.2rem 0 0.2rem 1rem;
}
.share-row {
  display: flex;
  gap: 0.5rem;
}
.share-row input {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--typed);
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 0.5rem 0.6rem;
}

/* ---------- legal and plain pages ---------- */

.doc {
  padding-block: clamp(2.5rem, 6vw, 4.5rem) var(--band);
}
.doc .wrap {
  max-width: 48rem;
}
.doc h1 {
  font-size: clamp(2.1rem, 5vw, 3.1rem);
  margin-bottom: 0.6rem;
}
.doc h2 {
  font-size: 1.45rem;
  margin: 2.25rem 0 0.7rem;
}
.doc ul {
  padding-left: 1.2rem;
  max-width: 66ch;
}
.doc li {
  margin-bottom: 0.4rem;
}
.doc .updated {
  color: var(--ink-soft);
}

/* ---------- narrower screens ---------- */

@media (max-width: 62rem) {
  .hero-grid,
  .method-grid,
  .deliver-grid,
  .faq-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .steps,
  .promises {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 46rem) {
  .top nav {
    display: none;
  }
  .fees,
  .fees tbody,
  .fees tr,
  .fees th,
  .fees td {
    display: block;
    width: auto;
  }
  .fees thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .fees tr {
    border-top: 2px solid var(--ink);
    padding-block: 1.1rem;
  }
  .fees th,
  .fees td,
  .fees tbody th {
    border: 0;
    padding: 0;
    width: auto;
  }
  .fees td {
    margin-top: 0.5rem;
  }
  .fees td:nth-child(3)::before,
  .fees td.num::before {
    content: attr(data-label) ': ';
    color: var(--ink-soft);
    font-size: 0.95rem;
    font-weight: 400;
  }
  .fees .num {
    text-align: left;
  }
  .fees-notes {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 34rem) {
  .join-row,
  .share-row {
    flex-direction: column;
  }
  .steps,
  .promises {
    grid-template-columns: minmax(0, 1fr);
  }
  .chain li {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.6rem;
    justify-items: start;
  }
  .brand span {
    font-size: 1.02rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
