/* Margin Books — site styles */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,400&family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;1,400&display=swap');

:root {
  --paper: #FFFFFF;
  --ink: #10243E;
  --pencil: #5F6B7A;
  --rule: #C8102E;
  --hair: #D9DEE5;
  --ledger: #E9F1EA;
  --ledger-deep: #D4E3D6;
  --margin-w: 180px;
  --gutter: 48px;
  --measure: 60ch;
  --display: 'Fraunces', Georgia, serif;
  --body: 'IBM Plex Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  font-feature-settings: 'tnum' 1;
}

a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { color: var(--rule); }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--rule); outline-offset: 3px;
}

h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.08; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.5rem, 6vw, 5rem); font-variation-settings: 'opsz' 144; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.7rem); font-variation-settings: 'opsz' 96; }
h3 { font-size: 1.25rem; font-variation-settings: 'opsz' 48; }
p { margin: 0 0 1em; max-width: var(--measure); }
ul { padding-left: 1.2em; max-width: var(--measure); }
li { margin-bottom: 0.4em; }
strong { font-weight: 600; }
.centred { text-align: center; margin-left: auto; margin-right: auto; }
h2.centred { max-width: 22ch; margin-bottom: 36px; }

/* The page: a margin column, a red rule, the text block */
.page {
  display: grid;
  grid-template-columns: var(--margin-w) 1px minmax(0, 1fr);
  min-height: 100vh;
}
.rule {
  background: var(--rule);
  width: 1px;
  transform-origin: top;
  animation: draw 900ms cubic-bezier(.2,.7,.2,1) both;
}
@keyframes draw { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .rule { animation: none; } }

.margin { padding: 28px 20px 0 32px; }
.main { padding: 0 var(--gutter) 72px var(--gutter); }

/* Masthead */
.mast {
  display: flex; align-items: baseline; justify-content: space-between; gap: 24px;
  padding: 28px 0 20px;
  border-bottom: 1px solid var(--hair);
  margin-bottom: 72px;
}
.wordmark { font-family: var(--display); font-size: 1.5rem; font-weight: 600; text-decoration: none; letter-spacing: -0.015em; }
.wordmark:hover { color: var(--ink); }
.nav { display: flex; gap: 28px; align-items: baseline; }
.nav a { text-decoration: none; font-size: 0.98rem; }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 6px; }
.nav a:hover { color: var(--rule); }
.nav .nav-cta { background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 2px; }
.nav .nav-cta:hover { background: var(--rule); color: var(--paper); }
.nav .nav-cta[aria-current="page"] { text-decoration: none; }

/* Margin notes */
.note {
  font-family: var(--display);
  font-style: italic;
  font-size: 0.98rem;
  line-height: 1.35;
  color: var(--pencil);
  margin: 0;
}
.note b { font-style: normal; font-weight: 500; color: var(--ink); }
@media (min-width: 861px) {
  .main { position: relative; max-width: 1120px; }
  section { position: relative; }
  section > .note {
    position: absolute;
    top: 0.35em;
    left: calc(-1 * var(--gutter) - 1px - var(--margin-w) + 32px);
    width: calc(var(--margin-w) - 56px);
  }
  section.band > .note { left: calc(-1px - var(--margin-w) + 32px); top: 64px; }
}

/* Sections and bands */
section { margin-bottom: 96px; scroll-margin-top: 40px; }
.band {
  background: var(--ledger);
  margin-left: calc(-1 * var(--gutter));
  margin-right: calc(-1 * var(--gutter));
  padding: 64px var(--gutter);
}
.lede { font-size: 1.18rem; line-height: 1.5; max-width: 52ch; }
.lede.centred { max-width: 48ch; }
.fine { color: var(--pencil); font-size: 0.98rem; }

/* Hero */
.hero h1 { max-width: 15ch; margin-bottom: 24px; }
.hero .lede { margin-bottom: 32px; }
.hero-row { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.hero-meta { color: var(--pencil); font-size: 0.98rem; }

/* Buttons */
.btn {
  display: inline-block; background: var(--ink); color: var(--paper);
  font-family: var(--body); font-weight: 500; font-size: 1rem;
  padding: 14px 22px; border-radius: 2px; border: 1px solid var(--ink);
  text-decoration: none; line-height: 1; cursor: pointer;
}
.btn:hover { background: var(--rule); border-color: var(--rule); color: var(--paper); }

/* Tiles: a heading and one line, in a grid. The rule above each is the only decoration. */
.tiles { display: grid; gap: 28px 40px; max-width: 980px; margin: 0 auto; }
.tiles.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tiles.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tiles > div { border-top: 1px solid var(--ink); padding-top: 14px; }
.band .tiles > div { border-top-color: var(--ink); }
.tiles h3 { margin-bottom: 6px; }
.tiles p { margin: 0; font-size: 0.98rem; color: var(--pencil); }

/* How it works: a real sequence, so numbered, across the page */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0 auto; max-width: 980px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 40px; }
.steps li { counter-increment: step; margin: 0; border-top: 1px solid var(--ink); padding-top: 14px; }
.steps li::before { content: counter(step); display: block; font-family: var(--display); font-size: 1.6rem; line-height: 1; color: var(--rule); margin-bottom: 10px; }
.steps h3 { margin: 0 0 6px; }
.steps p { margin: 0; font-size: 0.98rem; color: var(--pencil); }

/* Plans: four cards, one line each */
.plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; max-width: 980px; margin: 0 auto 20px; }
.plan { display: block; text-decoration: none; background: var(--ledger); padding: 24px 22px; border-radius: 2px; border: 1px solid transparent; }
.plan:hover { border-color: var(--ink); color: var(--ink); }
.plan h3 { margin-bottom: 2px; }
.plan .price { font-family: var(--display); font-size: 2.3rem; font-weight: 500; line-height: 1; margin: 8px 0 2px; font-variation-settings: 'opsz' 72; }
.plan .plus { font-size: 1.1rem; font-family: var(--body); font-weight: 400; margin-left: 2px; }
.plan .per { color: var(--pencil); font-size: 0.92rem; margin-bottom: 14px; }
.plan p { margin: 0; font-size: 0.98rem; }

/* Full pricing table (pricing page) */
table { border-collapse: collapse; width: 100%; max-width: 1040px; font-size: 0.98rem; }
th, td { text-align: left; vertical-align: top; padding: 12px 14px 12px 0; border-bottom: 1px solid var(--hair); }
th { font-weight: 600; }
thead th { border-bottom: 1px solid var(--ink); }
td:first-child, th:first-child { padding-left: 0; }
.yes { color: var(--rule); font-weight: 600; }
.table-wrap { overflow-x: auto; }

/* Founder */
.founder { display: grid; grid-template-columns: minmax(240px, 320px) 1fr; gap: 48px; align-items: start; max-width: 980px; margin: 0 auto; }
.portrait { display: block; aspect-ratio: 4 / 5; background: var(--ledger-deep); overflow: hidden; }
.portrait img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.founder.tall { align-items: stretch; }
.founder.tall .portrait { aspect-ratio: auto; min-height: 480px; }
.story h3 { margin-top: 22px; }
.story h3:first-of-type { margin-top: 0; }

/* Credentials */
.creds { list-style: none; padding: 0; max-width: 980px; margin: 0 auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 40px; }
.creds li { border-top: 1px solid var(--ink); padding-top: 10px; margin: 0; font-size: 0.98rem; }

/* FAQ */
.faq { max-width: 720px; margin: 0 auto; }
details { border-top: 1px solid var(--hair); }
details:last-of-type { border-bottom: 1px solid var(--hair); }
summary { cursor: pointer; padding: 18px 0; font-weight: 500; font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; gap: 24px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; font-family: var(--display); color: var(--rule); font-size: 1.4rem; line-height: 1; }
details[open] summary::after { content: '–'; }
details p { padding-bottom: 18px; font-size: 1rem; }

/* Closing CTA */
.close { text-align: center; }
.close h2 { max-width: 18ch; }

/* Contact */
.cal { max-width: 760px; min-height: 700px; border: 1px solid var(--hair); margin-bottom: 40px; }
.or { color: var(--pencil); margin: 40px 0 8px; }

/* Footer */
footer { border-top: 1px solid var(--hair); padding-top: 24px; color: var(--pencil); font-size: 0.92rem; }
footer p { max-width: 80ch; margin-bottom: 0.5em; }
footer a { color: var(--pencil); }

/* Tablet */
@media (max-width: 1000px) {
  .tiles.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Mobile */
@media (max-width: 860px) {
  :root { --gutter: 20px; }
  body { font-size: 16px; }
  .page { grid-template-columns: minmax(0, 1fr); }
  .rule, .margin { display: none; }
  .mast { margin-bottom: 40px; padding-top: 20px; padding-bottom: 14px; align-items: center; gap: 12px; }
  .wordmark { font-size: 1.3rem; white-space: nowrap; }
  .nav { gap: 14px; }
  .nav a { font-size: 0.92rem; white-space: nowrap; }
  .nav a[href="/"] { display: none; }
  .nav .nav-cta { padding: 7px 10px; }
  section { margin-bottom: 64px; }
  .band { padding: 44px var(--gutter); }
  h2.centred { margin-bottom: 24px; }
  /* only the hero keeps its margin note on a phone */
  section > .note { display: none; }
  .hero > .note { display: block; margin: 0 0 18px; border-left: 2px solid var(--rule); padding-left: 12px; max-width: 36ch; }
  .tiles { gap: 18px 24px; }
  .tiles.four, .tiles.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles h3 { font-size: 1.05rem; }
  .tiles p { font-size: 0.92rem; }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .plan { padding: 16px 14px; }
  .plan .price { font-size: 1.9rem; }
  .founder { grid-template-columns: 1fr; gap: 24px; }
  .portrait { max-width: 300px; }
  .founder.tall .portrait { aspect-ratio: 4 / 5; min-height: 0; }
  .creds { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
  .nav { gap: 12px; }
  .nav a { font-size: 0.88rem; }
  .tiles.three { grid-template-columns: minmax(0, 1fr); }
}
