:root {
  --paper: #F3F1EA;
  --ink: #2E2C29;
  --ink-deep: #1F1D1A;
  --blue: #2D3BB8;
  --blue-deep: #1E2A8F;
  --muted: #6B665D;
  --placeholder: #7D786F;
  --rule: #CFCAC0;
  --selection: #D9DDF6;
  --card: #E7E8F4;
  --error: #A3321F;

  --serif-display: 'Instrument Serif', Georgia, serif;
  --serif-body: 'Newsreader', Georgia, serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --hand: 'Caveat', cursive;

  --body-size: clamp(1.2rem, 1.7vw, 1.5625rem);
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif-body);
}

::selection { background: var(--selection); }

a { color: var(--blue); }
a:hover { color: var(--blue-deep); }

p { margin: 0; }

.page {
  min-height: 100vh;
  width: 100%;
  padding: 56px clamp(20px, 5vw, 70px) 48px;
}

.container {
  max-width: 1300px;
  margin: 0 auto;
}

/* Shared type */
.mono {
  font-family: var(--mono);
  color: var(--blue);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue);
}

.label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Header */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 24px;
  padding-bottom: 44px;
  border-bottom: 1px solid var(--blue);
}

.brand-block {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--blue);
}

.brand:hover { color: var(--blue); }

.brand-name {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1;
  letter-spacing: -0.01em;
}

.tagline {
  margin-left: 4px;
  font-size: 13px;
  line-height: 1.65;
}

.issue {
  text-align: right;
  padding-top: 12px;
}

.issue-number { margin-top: 18px; }

@media (max-width: 640px) {
  .issue { text-align: left; padding-top: 0; }
}

/* Main layout: margin column + text column */
main { padding-top: 80px; }

.row {
  display: flex;
  flex-wrap: wrap;
  row-gap: 24px;
}

.row + .row { margin-top: 52px; }
.row + .row.row--tight { margin-top: 44px; }

.aside {
  flex: 1 1 240px;
  max-width: 320px;
}

.aside--offset { padding-top: 16px; }

.body {
  flex: 999 1 560px;
  min-width: 0;
  max-width: 720px;
}

.prose {
  font-size: var(--body-size);
  line-height: 1.6;
}

.prose > p { margin-bottom: 32px; }
.prose > p:last-child { margin-bottom: 0; }

/* Hero */
.salutation {
  margin-bottom: 24px;
  font-size: 15px;
}

h1 {
  margin: 0;
  font-family: var(--serif-display);
  font-weight: 400;
  font-size: clamp(3.5rem, 8.5vw, 7.5rem);
  line-height: 0.92;
  letter-spacing: -0.025em;
  color: var(--blue);
}

h1 em { font-style: italic; }

/* Handwritten margin notes */
.note {
  padding-left: 40px;
  font-family: var(--hand);
  font-size: 30px;
  line-height: 1.15;
  color: var(--blue);
  transform: rotate(-5deg);
  transform-origin: left top;
}

/* Letter body */
.prose > .lede {
  margin-bottom: 40px;
  font-style: italic;
  font-size: clamp(1.6rem, 2.4vw, 2.125rem);
  line-height: 1.4;
}

.underline {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.prose em.accent { color: var(--blue); }

.prose > .turn {
  font-style: italic;
  color: var(--ink-deep);
}

.prose > .pull {
  margin-top: 44px;
  font-family: var(--serif-display);
  font-size: clamp(2.25rem, 4.5vw, 4rem);
  line-height: 1.04;
  letter-spacing: -0.015em;
  color: var(--blue);
}

/* Sign-off */
.prose > .closing { margin-bottom: 0; font-style: italic; }

.prose > .signature {
  margin: 22px 0 0;
  font-family: var(--hand);
  font-weight: 500;
  font-size: clamp(3.5rem, 5.5vw, 4.75rem);
  line-height: 1;
  color: var(--blue);
  transform: rotate(-2deg);
  transform-origin: left center;
}

.prose > .byline { margin: 28px 0 0; }
.byline a { color: var(--muted); }
.byline a:hover { color: var(--ink); }

/* Calls to action */
.header-cta {
  margin-top: 22px;
  min-height: 44px;
  padding: 0 18px;
  border: 1.5px solid var(--blue);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue);
  transition: background-color 0.15s, color 0.15s;
}

.header-cta:hover { background: var(--blue); color: var(--paper); }
.header-cta:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }

.prose > .inline-cta { margin: 28px 0 0; }

.join {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font-family: var(--serif-body);
  font-style: italic;
  font-size: var(--body-size);
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.join:hover { color: var(--blue-deep); }
.join:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }

.ps-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  cursor: pointer;
  font-family: var(--serif-body);
  font-style: italic;
  font-size: var(--body-size);
  color: var(--paper);
  transition: background-color 0.15s;
}

.ps-cta:hover { background: var(--blue-deep); }
.ps-cta:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.ps-cta:disabled { opacity: 0.6; cursor: progress; }

/* P.S. block */
.ps {
  margin-top: 56px;
  padding: clamp(28px, 4vw, 48px);
  border: 1.5px solid var(--blue);
  border-radius: 4px;
  background: var(--card);
}

.ps-kicker { color: var(--blue); }

.ps-lead {
  margin: 12px 0 28px;
  font-family: var(--serif-display);
  font-size: clamp(2rem, 3.6vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--blue);
}

.cadence {
  margin-top: 22px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

/* Signup dialog */
.signup-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1.5px solid var(--blue);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
}

.signup-dialog::backdrop { background: rgba(31, 29, 26, 0.45); }

.dialog-inner {
  position: relative;
  padding: clamp(28px, 5vw, 48px);
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  color: var(--blue);
}

.dialog-close:hover { background: var(--card); }
.dialog-close:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.dialog-title {
  margin: 14px 0 16px;
  padding-right: 32px;
  font-family: var(--serif-display);
  font-weight: 400;
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
  color: var(--blue);
}

.dialog-sub {
  margin-bottom: 28px;
  font-size: 1.125rem;
  line-height: 1.55;
}

.join-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: flex-start;
}

.field { align-self: stretch; }

/* Spam honeypot: hidden from people, visible to naive bots. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.field label { display: block; }
.optional { text-transform: none; letter-spacing: 0; }

.field input {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 6px;
  padding: 0 0 4px;
  border: 0;
  border-bottom: 1.5px solid var(--blue);
  border-radius: 0;
  background: transparent;
  font-family: var(--serif-body);
  font-size: 1.375rem;
  color: var(--ink);
}

.field input::placeholder { color: var(--placeholder); opacity: 1; }
.field input:focus { outline: none; border-bottom-color: var(--blue-deep); border-bottom-width: 2px; }
.field input[aria-invalid="true"] { border-bottom-color: var(--error); }

.form-status {
  margin: -8px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--error);
}

.form-status:empty { display: none; }

.dialog-done-view .join { margin-top: 4px; }

/* Footer */
.site-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue);
}
