/* Bijan: one stylesheet for every page (from ghost-helcim/site-draft/style.css, the reviewed design).
   - System fonts only (a serif for the name and lines, a sans for body). No web fonts.
   - Spacing comes only from the 8px scale below (--s1 = 8px).
   - One accent colour, used ONLY by .join (the Join button).
   - Meaning never depends on colour: links are underlined, Join is a filled pill,
     the email field is a drawn line.
   - Light paper by default; follows prefers-color-scheme: dark. */

:root {
  --paper: #fbf9f4;
  --ink: #22201c;
  --soft: #45413a;
  --muted: #6b655b;
  --rule: #d9d2c4;
  --accent: #2b6a4e;
  --on-accent: #ffffff;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --s1: .5rem;   /*  8px */
  --s2: 1rem;    /* 16px */
  --s3: 1.5rem;  /* 24px */
  --s4: 2rem;    /* 32px */
  --s5: 2.5rem;  /* 40px */
  --s6: 3rem;    /* 48px */
  --s8: 4rem;    /* 64px */
  --s12: 6rem;   /* 96px */

  --column: 40rem;   /* the one centred column */
  --measure: 32rem;  /* running text inside it */
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1a1917;
    --ink: #ece8e0;
    --soft: #cfc9bd;
    --muted: #a39c90;
    --rule: #3d3934;
    --accent: #84c8a5;
    --on-accent: #0f241a;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

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

main, .masthead, footer.site {
  max-width: calc(var(--column) + 2 * var(--s3));
  margin-inline: auto;
  padding-inline: var(--s3);
}

p, ol, ul, h1, h2, h3, h4 { margin: 0; }

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

.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: var(--s2); top: var(--s2); z-index: 10; padding: var(--s1) var(--s2); background: var(--paper); outline: 2px solid var(--ink); }

.vh {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* Shared small type */
.label {
  font-family: var(--sans);
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- The letter (front page) ---------------------------------------------
   One screen: the name, a hairline, one line, the field and Join. */
.hero {
  min-height: min(86vh, 52rem);
  min-height: min(86svh, 52rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-block: var(--s12) var(--s8);
  text-align: center;
}
.name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 5rem;
  line-height: 1;
  letter-spacing: .01em;
}
/* The one visual touch: a short hairline under the name, like a letterhead. */
.name::after {
  content: "";
  display: block;
  width: var(--s5);
  margin: var(--s4) auto 0;
  border-top: 1px solid var(--muted);
}
.tagline {
  max-width: 25rem;
  margin-top: var(--s4);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.375rem;
  line-height: 1.5;
  color: var(--soft);
  text-wrap: balance;
}
.signup {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: var(--s2) var(--s3);
  margin-top: var(--s6);
}
.signup input[type="email"] {
  width: 16rem;
  padding: var(--s1) 2px;
  border: 0;
  border-bottom: 1px solid var(--muted);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  line-height: 1.5;
}
.signup input[type="email"]::placeholder { color: var(--muted); opacity: 1; }
.signup input[type="email"]:focus { outline: none; border-bottom-color: var(--ink); box-shadow: 0 1px 0 var(--ink); }

/* Ghost's members form states (Portal adds loading / success / error to the form). */
.signup .msg { display: none; flex-basis: 100%; font-family: var(--serif); font-style: italic; color: var(--muted); }
.signup.loading .join { opacity: .6; cursor: progress; }
.signup.success input, .signup.success .join { display: none; }
.signup.success .msg-success, .signup.error .msg-error { display: block; }
.joined { margin-top: var(--s6); font-family: var(--serif); font-style: italic; font-size: 1.125rem; color: var(--muted); }

/* Letters: quiet, below the fold */
.letters { padding-bottom: var(--s4); text-align: center; }
.letter-list { list-style: none; padding: 0; margin-top: var(--s3); }
.letter-list li + li { margin-top: var(--s2); }
.letter-list a { font-family: var(--serif); font-size: 1.25rem; text-decoration-color: var(--rule); }
.letter-list a:hover { text-decoration-color: currentColor; }
.letter-list time { display: block; font-size: .875rem; color: var(--muted); }

/* ---- Other pages: the name, quietly, links home ---------------------------- */
.masthead { padding-top: var(--s6); text-align: center; }
.brand {
  font-family: var(--serif);
  font-size: 1.5rem;
  letter-spacing: .01em;
  text-decoration: none;
  color: var(--ink);
}
.brand::after {
  content: "";
  display: block;
  width: var(--s3);
  margin: var(--s2) auto 0;
  border-top: 1px solid var(--muted);
}

/* The join (accent) */
.join {
  display: inline-block;
  padding: var(--s1) var(--s3);
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
  cursor: pointer;
}
.join:hover { filter: brightness(1.1); }
.join:disabled { opacity: .5; cursor: not-allowed; filter: none; }

/* Footer: quiet links and the city. No rule, just space. */
footer.site {
  padding-block: var(--s12) var(--s6);
  text-align: center;
  font-size: .8125rem;
  line-height: 1.5;
  color: var(--muted);
}
footer.site ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s1) var(--s3);
}
footer.site p { margin-top: var(--s1); }

/* Reading pages (letters, terms, privacy): same paper, same type, a reading column */
.doc { max-width: calc(var(--measure) + 2 * var(--s3)); }
.doc .head { padding-top: var(--s8); text-align: center; }
.doc h1 { font-family: var(--serif); font-weight: 400; font-size: 2.5rem; line-height: 1.2; text-wrap: balance; }
.doc .updated { margin-top: var(--s2); font-size: .875rem; color: var(--muted); }
.doc .lead { margin-top: var(--s3); font-family: var(--serif); font-style: italic; font-size: 1.1875rem; line-height: 1.5; text-wrap: balance; }
.doc .head-more { text-align: center; }
.doc .toc { margin-top: var(--s8); }
.doc .toc h2 { margin: 0 0 var(--s2); }
.doc .toc ul { list-style: none; padding: 0; columns: 2; column-gap: var(--s6); }
.doc .toc li { break-inside: avoid; padding-block: calc(var(--s1) / 2); }
.doc .toc li + li { margin-top: 0; }
.doc .toc a { text-decoration-color: var(--rule); }
.doc .toc a:hover { text-decoration-color: currentColor; }
.doc h2 { font-family: var(--serif); font-weight: 400; font-size: 1.5rem; line-height: 1.3; margin-top: var(--s8); }
.doc h3 { font-family: var(--serif); font-weight: 400; font-size: 1.1875rem; margin-top: var(--s4); }
.doc p, .doc ul, .doc ol, .doc blockquote, .doc figure, .doc pre { margin-top: var(--s2); }
.doc ul, .doc ol { padding-left: var(--s3); }
.doc li + li { margin-top: var(--s1); }
.doc blockquote { margin-inline: 0; padding-left: var(--s2); border-left: 1px solid var(--rule); font-family: var(--serif); font-style: italic; color: var(--soft); }
.doc img, .doc video, .doc iframe { max-width: 100%; height: auto; }
.doc figure { margin-inline: 0; }
.doc figcaption { margin-top: var(--s1); font-size: .875rem; color: var(--muted); text-align: center; }
.doc hr { margin-block: var(--s6); border: 0; border-top: 1px solid var(--rule); }
.doc pre { overflow-x: auto; font-size: .875rem; }
.letter .gh-content { margin-top: var(--s6); font-family: var(--serif); font-size: 1.1875rem; line-height: 1.65; }
.letter .gh-content > :first-child { margin-top: 0; }
.again { margin-top: var(--s8); text-align: center; }
.again .signup { margin-top: 0; }

/* Ghost editor card widths (required by Ghost themes): wide and full images break out of the column. */
.kg-width-wide { position: relative; width: min(var(--column), 100vw - 2 * var(--s3)); left: 50%; transform: translateX(-50%); }
.kg-width-full { position: relative; width: 100vw; left: 50%; transform: translateX(-50%); }
.kg-width-full img, .kg-width-wide img { width: 100%; }

/* Small-caps labels used as headings keep the label look (not the big serif). */
.doc h2.label {
  font-family: var(--sans);
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Placeholders on the policy pages: [brackets] plus a dashed underline, so
   they read in black and white. */
.ph { border-bottom: 1px dashed currentColor; }

/* Narrow screens */
@media (max-width: 40rem) {
  body { font-size: 1rem; }
  .hero { padding-block: var(--s8) var(--s6); }
  .name { font-size: 3.75rem; }
  .tagline { font-size: 1.25rem; max-width: 20rem; }
  .signup { gap: var(--s2); }
  .signup input[type="email"] { width: 13.5rem; }
  .masthead { padding-top: var(--s4); }
  .doc h1 { font-size: 2rem; }
  .doc .toc ul { columns: 1; }
}

@media print {
  .skip, .masthead, footer.site nav, .signup, .again { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .hero { min-height: 0; padding-block: var(--s6); }
  a[href^="http"]::after, a[href^="mailto:"]::after { content: " (" attr(href) ")"; }
}
