:root {
  color-scheme: light;
  --paper: #faf8f2;
  --white: #fffdf8;
  --ink: #232721;
  --muted: #555c53;
  --accent: #254e3d;
  --accent-hover: #19382b;
  --forest: #1b392e;
  --forest-line: #527264;
  --forest-muted: #d4e3d9;
  --line: #d8d6ca;
  --green-paper: #edf1e8;
  --green-line: #cbd6c9;
  --serif: Georgia, 'Times New Roman', serif;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 100%;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
a { color: var(--accent); text-underline-offset: .2em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.wrap {
  width: min(100% - 3rem, 70rem);
  margin-inline: auto;
}

.masthead, .brand, .header-links {
  display: flex;
  align-items: center;
}

.masthead {
  justify-content: space-between;
  gap: .7rem;
  min-height: 4.25rem;
  border-bottom: 1px solid var(--line);
}

.brand { gap: .85rem; }

.wordmark {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 700;
  text-decoration: none;
}

.wordmark:hover { text-decoration: underline; }

.byline {
  padding-left: .85rem;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: .875rem;
}

.header-links { gap: clamp(.7rem, 3vw, 1.6rem); }
.header-links a { display: inline-flex; align-items: center; min-height: 2.75rem; font-size: .875rem; font-weight: 650; }
.header-links .header-book {
  padding: .25rem .7rem;
  border: 1px solid var(--line);
  border-radius: .25rem;
  background: var(--white);
  text-decoration: none;
}
.header-book:hover { border-color: var(--accent); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.8rem, 5.5vw, 4.2rem);
  padding-block: clamp(2rem, 4.5vw, 3.35rem);
}

.hero-market {
  margin-bottom: .6rem;
  color: var(--accent);
  font-size: .8125rem;
  font-weight: 750;
  letter-spacing: .065em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 18ch;
  font: 400 clamp(2.4rem, 4.6vw, 3.85rem)/1.05 var(--serif);
  letter-spacing: -.047em;
  text-wrap: balance;
}

.intro {
  max-width: 35rem;
  margin-top: 1rem;
  font-size: clamp(1.0625rem, 1.65vw, 1.2rem);
}

.send-control { margin-top: .6rem; color: var(--muted); font-size: .9375rem; }
.see-brief {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 2.75rem;
  margin-top: .45rem;
  font-size: .9375rem;
  font-weight: 650;
}

.hero-action {
  padding: clamp(1rem, 2.8vw, 1.5rem);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: .35rem;
  background: var(--white);
}

.offer-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .1rem .65rem;
}

.offer-label, .step-number {
  color: var(--accent);
  font-size: .8125rem;
  font-weight: 750;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.offer-line span { color: var(--muted); font-size: .8125rem; }
.forward-hint { margin-top: .65rem; font-size: .9375rem; }

.address {
  width: fit-content;
  max-width: 100%;
  color: var(--accent);
  font: 400 clamp(1.65rem, 3.4vw, 2.25rem)/1.2 var(--serif);
  letter-spacing: -.04em;
  overflow-wrap: anywhere;
  user-select: text;
  -webkit-user-select: text;
}

.hero-action .address { margin-top: .22rem; }
.copy-row { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem .7rem; margin-top: .65rem; }

.copy, .closing-book {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  min-height: 2.75rem;
  padding: .58rem .85rem;
  border: 1px solid var(--accent);
  border-radius: .25rem;
  font: 650 .875rem/1.3 system-ui, sans-serif;
}

.copy { background: var(--accent); color: white; cursor: pointer; }
.copy:enabled:hover { background: var(--accent-hover); }
.copy:disabled { border-color: var(--green-line); background: var(--green-paper); color: var(--muted); cursor: default; }
.copy-status, .copy-help { color: var(--accent); font-size: .875rem; }
.copy-help { margin-top: .3rem; }

.trust-list {
  display: grid;
  gap: .24rem;
  margin: .85rem 0 0;
  padding: 0;
  list-style: none;
  font-size: .875rem;
}

.trust-list li {
  padding-left: 1.15rem;
  position: relative;
}

.trust-list li::before {
  position: absolute;
  left: 0;
  top: .6em;
  width: .35rem;
  height: .35rem;
  border-radius: 50%;
  background: var(--accent);
  content: '';
}

.book-path {
  margin-top: .85rem;
  padding-top: .75rem;
  border-top: 1px solid var(--line);
  font-size: .875rem;
}

.book-path p { color: var(--muted); }
.book-path a { display: inline-flex; align-items: center; gap: .28rem; min-height: 2.2rem; font-weight: 650; }

.section {
  padding-block: clamp(1.8rem, 4.5vw, 3.25rem);
  border-top: 1px solid var(--line);
}

.section-title {
  font: 400 clamp(1.7rem, 3.6vw, 2.55rem)/1.15 var(--serif);
  letter-spacing: -.045em;
  text-wrap: balance;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 3vw, 2.25rem);
  margin: 1.15rem 0 0;
  padding: 0;
  list-style: none;
}

.steps li { padding-top: .75rem; border-top: 1px solid var(--line); }
.step-number { display: block; margin-bottom: .35rem; }
.steps h3 { font-size: 1rem; line-height: 1.35; }
.steps p { margin-top: .38rem; color: var(--muted); font-size: .9375rem; }

.workflow-band {
  padding-block: clamp(1.6rem, 4.4vw, 3rem);
  background: var(--forest);
  color: var(--paper);
}

.workflow-grid {
  display: grid;
  grid-template-columns: minmax(0, .86fr) minmax(0, 1.35fr);
  align-items: start;
  gap: clamp(1.4rem, 4.2vw, 3.2rem);
}

.workflow-band .section-title { font-size: clamp(1.65rem, 3.1vw, 2.35rem); }
.weekly .steps { grid-template-columns: minmax(0, 1fr); gap: .8rem; margin-top: .95rem; }
.weekly .steps li { position: relative; padding: .75rem 0 0 2.2rem; border-color: var(--forest-line); }
.weekly .step-number { position: absolute; top: .78rem; left: 0; color: var(--forest-muted); }
.weekly .steps p { margin-top: .22rem; color: var(--forest-muted); }

.examples { scroll-margin-top: 1rem; }
.market-links { display: flex; flex-wrap: wrap; gap: .35rem .47rem; margin-bottom: 1.2rem; }

.market-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: .3rem .65rem;
  border: 1px solid var(--line);
  border-radius: .25rem;
  font-size: .875rem;
  text-decoration: none;
}

.market-links a:hover { border-color: var(--accent); text-decoration: underline; }
.market-links a[aria-current] { border-color: var(--accent); background: var(--accent); color: white; font-weight: 650; }

.brief {
  overflow: hidden;
  margin-top: .9rem;
  border: 1px solid var(--green-line);
  border-radius: .35rem;
  background: var(--white);
  color: var(--ink);
}

.brief-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: .45rem 1rem;
  padding: .95rem clamp(1rem, 3vw, 1.55rem);
  border-bottom: 1px solid var(--green-line);
  background: var(--green-paper);
}

.email-meta, .brief-time {
  color: var(--muted);
  font-size: .8125rem;
}

.brief-time { white-space: nowrap; }
.brief-header h3, .example-header h3, .example-panel h4 {
  font: 400 clamp(1.35rem, 3vw, 1.8rem)/1.2 var(--serif);
  letter-spacing: -.035em;
}

.brief-header h3 { color: var(--accent); margin-top: .15rem; }
.brief-items { margin: 0; padding: 0 clamp(1rem, 3vw, 1.55rem); list-style: none; }

.brief-items li {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: .35rem 1.2rem;
  padding-block: .76rem;
}

.brief-items li + li { border-top: 1px solid var(--line); }
.brief-items h4 { font-size: .9375rem; }
.brief-items p { margin-top: .18rem; font-size: .9375rem; }
.draft-count {
  flex: none;
  padding: .15rem .5rem;
  border-radius: .2rem;
  background: var(--green-paper);
  color: var(--accent);
  font-size: .8125rem;
  font-weight: 650;
}

.thread-example { border-top: 0; }
.example-header { display: flex; align-items: baseline; flex-wrap: wrap; gap: .25rem .8rem; margin-bottom: .65rem; }
.example-header p { color: var(--muted); font-size: .875rem; font-weight: 650; }
.skip-thread { display: none; }
.example-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }

.example-panel {
  min-width: 0;
  padding: clamp(1rem, 3vw, 1.5rem);
  border: 1px solid var(--line);
  border-radius: .3rem;
  background: var(--white);
}

.outcome {
  border-color: var(--green-line);
  border-top: 3px solid var(--accent);
  background: var(--green-paper);
  scroll-margin-top: 1rem;
}

.outcome h4 { color: var(--accent); }
.messages { margin: .85rem 0 0; padding: 0; list-style: none; }
.message { padding-block: .72rem; border-top: 1px solid var(--line); }
.message:last-child { padding-bottom: 0; }

.message-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .12rem .75rem;
  margin-bottom: .26rem;
  font-size: .875rem;
}

.message-meta span { color: var(--muted); }
.message-envelope {
  display: grid;
  gap: .14rem;
  margin-top: .65rem;
  padding-bottom: .65rem;
  border-bottom: 1px solid var(--green-line);
  font-size: .875rem;
}

.message-envelope div { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr); gap: .3rem; }
.message-envelope dd { overflow-wrap: anywhere; }
.message-envelope dt, .findings dt, .draft figcaption { color: var(--accent); font-size: .875rem; font-weight: 700; }

.findings { display: grid; gap: .65rem; margin-top: .75rem; }
.findings dd { margin-top: .08rem; }
.findings .detail { padding: .55rem .7rem; border-left: 3px solid var(--accent); background: var(--white); }

.draft { margin-top: .85rem; padding-top: .65rem; border-top: 1px solid var(--green-line); }
.draft blockquote { margin-top: .25rem; }

.after-first .steps {
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: .35rem;
  background: var(--line);
}

.after-first .steps li {
  padding: clamp(.9rem, 2.2vw, 1.35rem);
  border-top: 0;
  background: var(--white);
}

.team-intro { max-width: 65ch; margin-top: .65rem; }
.people {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem;
  margin: 1.15rem 0 0;
  padding: 0;
  list-style: none;
}

.person {
  display: grid;
  grid-template-columns: clamp(4.2rem, 9vw, 6.5rem) minmax(0, 1fr);
  gap: .75rem 1rem;
  padding: clamp(.85rem, 2.2vw, 1.25rem);
  border: 1px solid var(--line);
  border-radius: .35rem;
  background: var(--white);
}

.portrait {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  background: var(--green-paper);
}

.portrait img { position: absolute; display: block; height: auto; max-width: none; }
.portrait img[src="/images/fitz.jpg"] { width: 122.5%; left: -11.25%; top: -19.95%; }
.portrait img[src="/images/martin.jpg"] { width: 190%; left: -45%; top: 0; }
.person h3 { font: 400 clamp(1.3rem, 2.3vw, 1.65rem)/1.15 var(--serif); letter-spacing: -.025em; }
.person-role { margin-top: .14rem; color: var(--accent); font-size: .875rem; font-weight: 650; }
.person-bio { margin-top: .36rem; color: var(--muted); font-size: .9375rem; }
.person a { display: inline-flex; align-items: center; gap: .28rem; min-height: 2.75rem; font-size: .875rem; font-weight: 650; }

.team-notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem 1.8rem;
  margin-top: 1.15rem;
}

.team-notes p { color: var(--muted); font-size: .9375rem; }
.team-notes strong { display: block; margin-bottom: .15rem; color: var(--accent); }

.closing-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr);
  align-items: center;
  gap: .85rem 1.25rem;
  margin-top: 1.4rem;
  padding: clamp(1rem, 3vw, 1.4rem);
  border: 1px solid var(--green-line);
  border-radius: .35rem;
  background: var(--green-paper);
}

.closing-cta h3 {
  color: var(--accent);
  font: 400 clamp(1.4rem, 2.6vw, 2rem)/1.15 var(--serif);
  letter-spacing: -.035em;
}

.closing-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .65rem 1rem;
}

.closing-book { background: var(--white); text-decoration: none; }
.closing-book:hover { background: var(--green-paper); }

.footer {
  padding-block: .7rem 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .875rem;
}

.footer-main, .footer-links, .footer-markets {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 .85rem;
}

.footer-main { justify-content: space-between; }
.footer a { display: inline-flex; align-items: center; gap: .25rem; min-height: 2.5rem; }
.footer a[aria-current] { font-weight: 700; }
.missing { padding-block: 4rem; }

@media (max-width: 54rem) {
  .workflow-grid, .closing-cta { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 47rem) {
  .wrap { width: calc(100% - 2rem); }
  .masthead { min-height: 3.8rem; }
  .hero, .steps, .example-grid, .people, .team-notes { grid-template-columns: minmax(0, 1fr); }
  .hero { gap: 1.15rem; padding-block: 1.85rem 1.55rem; }
  .hero h1 { max-width: 22ch; }
  .intro { margin-top: .75rem; }
  .steps { gap: .85rem; }
  .skip-thread { display: inline-flex; align-items: center; min-height: 2.75rem; font-size: .875rem; }
}

@media (max-width: 35rem) {
  .brand { flex-direction: column; align-items: start; gap: 0; }
  .byline { padding-left: 0; border-left: 0; font-size: .8125rem; }
  .brief-header, .brief-items li { flex-wrap: wrap; }
  .brief-time { white-space: normal; }
  .closing-actions { align-items: start; flex-direction: column; }
}


.hero h1 { max-width: 18ch; font-size: clamp(2.35rem, 4.4vw, 3.7rem); }
.workflow-grid { display: block; }
.weekly .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 3vw, 2.5rem); }
.workflow-band .weekly { max-width: none; }
.examples .section-title { margin-bottom: .85rem; }
.examples .brief { margin-bottom: clamp(2.2rem, 5vw, 4rem); }
.draft-count::first-letter { text-transform: uppercase; }
.attachments, .packet-checks { list-style: none; padding: 0; }
.attachments { display: flex; flex-wrap: wrap; gap: .32rem; margin-top: .5rem; }
.attachments li {
  overflow-wrap: anywhere;
  max-width: 100%;
  padding: .15rem .44rem;
  border: 1px solid var(--line);
  border-radius: .2rem;
  background: var(--white);
  color: var(--muted);
  font: .75rem/1.4 ui-monospace, Consolas, monospace;
}
.packet-checks { display: grid; gap: .35rem; margin-top: .35rem; }
.packet-checks li { display: flex; align-items: baseline; flex-wrap: wrap; gap: .15rem .5rem; }
.check-state {
  padding: .12rem .36rem;
  border-radius: .2rem;
  background: #fef3c7;
  color: #92400e;
  font: 700 .73rem/1.4 ui-monospace, Consolas, monospace;
}
.check-state[data-ok="true"] { background: #dcfce7; color: #166534; }

[data-theme="ledger"] {
  --paper: #f6f5f1; --white: #fff; --ink: #1c1f24; --muted: #53514d;
  --accent: #9a3412; --accent-hover: #7c2d12; --line: #d9d2c8;
  --forest: #312820; --forest-line: #79614d; --forest-muted: #f1dfcd;
  --green-paper: #fbefe2; --green-line: #e6cbb3;
  --serif: system-ui, sans-serif;
}
[data-theme="ledger"] .findings .detail { background: #fef3c7; }
[data-theme="ledger"] .message-meta span, [data-theme="ledger"] .draft-count { font-family: ui-monospace, Consolas, monospace; }
[data-theme="ledger"] .hero-action, [data-theme="ledger"] .brief, [data-theme="ledger"] .example-panel { border-radius: .25rem; }

[data-theme="audit"] {
  --paper: #f7f8fa; --white: #fff; --ink: #18202c; --muted: #4d5a6c;
  --accent: #1d3557; --accent-hover: #142640; --line: #d4dce7;
  --forest: #1d3557; --forest-line: #71839e; --forest-muted: #e0e8f4;
  --green-paper: #ecf1f7; --green-line: #d0dbe9;
  --serif: system-ui, sans-serif;
}
[data-theme="audit"] .brief-header { background: #e5edf7; }
[data-theme="audit"] .draft-count { font-family: ui-monospace, Consolas, monospace; }
[data-theme="audit"] .outcome { background: var(--white); }
[data-theme="audit"] .findings .detail { background: var(--green-paper); }

[data-theme="memo"] {
  --paper: #f9f8f4; --white: #fff; --ink: #1f2421; --muted: #55544f;
  --accent: #5b2333; --accent-hover: #421724; --line: #dcd7cd;
  --forest: #421f2b; --forest-line: #8a6873; --forest-muted: #f5e3e9;
  --green-paper: #f4ecef; --green-line: #e0cbd2;
}
[data-theme="memo"] .message-meta span { color: var(--accent); font-size: .8125rem; }
[data-theme="memo"] .draft blockquote { font-family: Georgia, serif; font-size: 1.04rem; }

[data-theme="teal"] {
  --paper: #f5f7f6; --white: #fff; --ink: #1b2422; --muted: #4c5a57;
  --accent: #0f5c5c; --accent-hover: #0a4242; --line: #ccd9d4;
  --forest: #184443; --forest-line: #69938d; --forest-muted: #dff1ed;
  --green-paper: #e9f2f0; --green-line: #c4dcd7;
  --serif: system-ui, sans-serif;
}
[data-theme="teal"] .message-meta span, [data-theme="teal"] .brief-time { font-family: ui-monospace, Consolas, monospace; }
[data-theme="teal"] .hero-action { border-top-width: 5px; }

[data-theme="ready"] {
  --paper: #f8f7f3; --white: #fff; --ink: #1c2026; --muted: #505964;
  --accent: #1e40af; --accent-hover: #1e3a8a; --line: #d4d9e0;
  --forest: #202e56; --forest-line: #7585ae; --forest-muted: #e2ebff;
  --green-paper: #eff6ff; --green-line: #cbdcf5;
  --serif: system-ui, sans-serif;
}
[data-theme="ready"] .check-state[data-ok="false"] { background: #dbeafe; color: #1e3a8a; }
[data-theme="ready"] .hero-action, [data-theme="ready"] .example-panel { border-radius: .35rem; }

[data-theme="dispatch"] {
  --paper: #f7f7f5; --white: #fff; --ink: #1d2120; --muted: #505b54;
  --accent: #2d4f3c; --accent-hover: #193b2a; --line: #d2d8d2;
  --forest: #254234; --forest-line: #6e9080; --forest-muted: #dfede4;
  --green-paper: #edf2ee; --green-line: #cadbd0;
  --serif: system-ui, sans-serif;
}
[data-theme="dispatch"] .brief-status {
  display: inline-block;
  padding: .16rem .35rem;
  background: #ffedd5;
  color: #9a3412;
  font: 700 .7rem/1.3 ui-monospace, Consolas, monospace;
  text-transform: uppercase;
}
[data-theme="dispatch"] .findings .detail { border-left-color: #c2410c; }

[data-theme="notebook"] {
  --paper: #faf9f6; --white: #fff; --ink: #22201e; --muted: #5c5650;
  --accent: #2c4257; --accent-hover: #1e3040; --line: #dcd5ca;
  --forest: #293849; --forest-line: #708496; --forest-muted: #e4edf7;
  --green-paper: #f2ede4; --green-line: #dfd5c4;
}
[data-theme="notebook"] .hero-action { border-top-color: #7c6a54; }
[data-theme="notebook"] .draft blockquote { font-family: Georgia, serif; }

:is([data-theme="ledger"], [data-theme="audit"], [data-theme="teal"], [data-theme="ready"], [data-theme="dispatch"]) :is(h1, .section-title, .wordmark) { font-weight: 720; }
@media (max-width: 47rem) {
  .weekly .steps { grid-template-columns: 1fr; }
}
