/*
 * The Financial Fitness Manual — landing page.
 *
 * The design brief is the book itself: Palatino on warm paper, one column,
 * generous leading, a single ink colour and a single rule weight. Nothing here
 * should look like it is trying to sell you something, because the book spends
 * twenty-two chapters arguing against exactly that.
 */

:root {
  --paper:  #f4f2ee;
  --sheet:  #ffffff;
  --ink:    #111111;
  --ink-2:  #3a352e;
  --ink-3:  #6b645a;
  --tan:    #dcd7cd;
  --rule:   #e6e1d9;
  --edge:   #ddd8d0;
  --error:  #8c2f2a;
  --shadow: 0 2px 12px rgba(0, 0, 0, .10);
  --measure: 34rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:  #16150f;
    --sheet:  #1e1c16;
    --ink:    #f0ece3;
    --ink-2:  #ddd7ca;
    --ink-3:  #a49b8b;
    --tan:    #3a352a;
    --rule:   #33301f;
    --edge:   #302d24;
    --error:  #e39a94;
    --shadow: none;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 18px;
  line-height: 1.62;
  text-rendering: optimizeLegibility;
}

.sheet {
  max-width: calc(var(--measure) + 6rem);
  margin: 0 auto;
  padding: 3rem 3rem 2.5rem;
  background: var(--sheet);
  border-left: 1px solid var(--edge);
  border-right: 1px solid var(--edge);
  box-shadow: var(--shadow);
  min-height: 100vh;
}

@media (max-width: 40rem) {
  body { font-size: 17px; }
  .sheet { padding: 2rem 1.25rem; border: 0; }
}

/* --- Masthead ----------------------------------------------------------- */

.masthead { text-align: center; padding-bottom: 1.75rem; border-bottom: 1px solid var(--rule); }

.kicker {
  margin: 0 0 .5rem;
  font-size: .68rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.wordmark { margin: 0; font-size: 1.35rem; font-weight: 600; letter-spacing: .01em; }
.wordmark a { color: inherit; text-decoration: none; }
.byline { margin: .35rem 0 0; font-size: .85rem; font-style: italic; color: var(--ink-3); }

/* --- Sections ----------------------------------------------------------- */

main { padding-top: 2.5rem; }
section { max-width: var(--measure); margin: 0 auto; }

h1 {
  margin: 0 0 1rem;
  font-size: 1.95rem;
  line-height: 1.24;
  font-weight: 600;
  letter-spacing: -.01em;
}

h2 {
  margin: 0 0 1rem;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--ink-3);
}

p { margin: 0 0 1.15rem; }

.standfirst { font-size: 1.08rem; color: var(--ink-2); }

.rule {
  max-width: var(--measure);
  margin: 2.75rem auto;
  border: 0;
  border-top: 1px solid var(--rule);
}

.promises { margin: 0 0 1.15rem; padding-left: 1.1rem; }
.promises li { margin-bottom: .6rem; }

.fine { font-size: .84rem; line-height: 1.55; color: var(--ink-3); }

a { color: var(--ink); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--ink-3); }

/* --- Buttons ------------------------------------------------------------ */

.cta { margin: 1.6rem 0 .9rem; }

.button, button {
  display: inline-block;
  font: inherit;
  font-size: .95rem;
  padding: .7rem 1.4rem;
  background: var(--ink);
  color: var(--sheet);
  border: 1px solid var(--ink);
  border-radius: 2px;
  text-decoration: none;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}

.button:hover, button:hover { background: transparent; color: var(--ink); }

button[disabled], .button[aria-disabled="true"] { opacity: .5; cursor: progress; }

/* --- Signup form -------------------------------------------------------- */

.signup-form { margin-top: 1.5rem; }

.field { display: flex; gap: .5rem; flex-wrap: wrap; }

.field input[type="email"] {
  flex: 1 1 15rem;
  font: inherit;
  font-size: .95rem;
  padding: .7rem .85rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--edge);
  border-radius: 2px;
}

.field input[type="email"]:focus-visible,
a:focus-visible, button:focus-visible, .button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.error { margin: .6rem 0 0; font-size: .88rem; color: var(--error); }

.signup-done { margin-top: 1.5rem; padding: 1.25rem 1.4rem; background: var(--paper); border-left: 3px solid var(--tan); }
.done-head { margin: 0 0 .5rem; font-weight: 600; }
.signup-done p:last-child { margin-bottom: 0; }

/* htmx sets this attribute while a request is in flight. */
.signup-form.htmx-request { opacity: .6; }

.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

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

.skip {
  position: absolute; left: -9999px;
  background: var(--ink); color: var(--sheet); padding: .6rem 1rem;
}
.skip:focus { left: .5rem; top: .5rem; z-index: 10; }

/* --- Colophon ----------------------------------------------------------- */

.colophon {
  max-width: var(--measure);
  margin: 3.5rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: .84rem;
  color: var(--ink-3);
}
.colophon a { color: var(--ink-3); }
.colophon p { margin: 0 0 .7rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
