/* Pilcrow marketing site. Colours, type and spacing from the Pilcrow style library. */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/inter.woff2') format('woff2');
}
/* Fallback for Plantagenet Cherokee, which ships with macOS but can't be
   self-hosted (not an open-licence font). */
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('/fonts/newsreader.woff2') format('woff2');
}

:root {
  /* Palette. Values marked ~ are read off the swatch because the library's
     hex label didn't match it; confirm against the source file. */
  --charcoal: #24241F;
  --soft-blue: #C4DAEE;  /* ~ label said #D6FF4C */
  --parchment: #FCFCF3;  /* ~ label said #EDEDED */
  --jade: #38633C;
  --ivy: #5A6038;        /* ~ label said #F6F6F5 */
  --paper: #F6F6F5;
  --cordovan: #C50C46;
  --vellum: #E8EDD8;     /* ~ label said #BCC1AE */
  --dust: #899076;

  --bg: var(--parchment);
  --surface: #FFFFFB;
  --surface-2: var(--paper);
  --fg: var(--charcoal);
  --text-2: #4A4C42;
  --text-3: #62675A;
  --border: #E1E4D3;
  --accent: var(--jade);
  --accent-strong: #2A4C2D;
  --accent-soft: var(--vellum);
  --on-accent: var(--parchment);
  --sidebar: var(--charcoal);
  --sidebar-text: #D6D8CB;
  --person-bg: var(--vellum);
  --person-fg: #2A4C2D;
  --place-bg: #DCE8F3;
  --place-fg: #2C4760;
  --stance-bg: var(--soft-blue);
  --todo-bg: #F7DCE4;
  --todo-fg: #8E0932;

  --heading: 'Plantagenet Cherokee', 'Newsreader', Georgia, 'Times New Roman', serif;
  --body: var(--heading);
  --ui: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Andale Mono', ui-monospace, Menlo, Consolas, monospace;

  /* Spacing levels: 8 16 24 32 40 56 72 80 96 120 */
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 40px;
  --s6: 56px; --s7: 72px; --s8: 80px; --s9: 96px; --s10: 120px;

  --measure: 68ch;
  --page: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--charcoal);
    --surface: #2C2D27;
    --surface-2: #2A2B25;
    --fg: #F1F1E6;
    --text-2: #CBCDBF;
    --text-3: #A9AD9B;
    --border: #3F4138;
    --accent: #8CBB8F;
    --accent-strong: #A9CFAB;
    --accent-soft: #34402F;
    --on-accent: var(--charcoal);
    --sidebar: #1A1A16;
    --sidebar-text: #CBCDBF;
    --person-bg: #34402F;
    --person-fg: #BFDDB9;
    --place-bg: #2B3742;
    --place-fg: #C4DAEE;
    --stance-bg: #283340;
    --todo-bg: #4A1E2B;
    --todo-fg: #F5BCCB;
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--ui);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-strong); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: absolute; left: -9999px; top: 8px;
  background: var(--surface); padding: 8px 12px; z-index: 10;
}
.skip:focus { left: 8px; }

.wrap { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }

/* Header */

.site-header .wrap {
  display: flex; align-items: center; gap: 40px;
  min-height: 88px; flex-wrap: wrap;
}
.wordmark {
  display: inline-flex; align-items: baseline; gap: 6px;
  font-family: var(--heading); font-size: 28px; font-weight: 400;
  color: var(--fg); text-decoration: none;
}
.wordmark span { color: var(--accent); }
.site-nav { display: flex; gap: 32px; flex: 1; align-items: center; flex-wrap: wrap; }
.site-nav a { color: var(--text-2); text-decoration: none; font-size: 15px; font-weight: 500; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--fg); }

/* Phones: wordmark and Start writing share the top row; the links sit below. */
@media (max-width: 720px) {
  .site-header .wrap { padding-top: 16px; padding-bottom: 12px; gap: 12px 16px; min-height: 0; }
  .header-cta { margin-left: auto; }
  .site-nav { order: 3; flex-basis: 100%; gap: 20px; }
}

/* Buttons */

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 6px;
  background: var(--accent); color: var(--on-accent); border: 1px solid var(--accent);
  font-family: var(--ui); font-size: 16px; font-weight: 500; text-decoration: none;
}
.button:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
.button.small { padding: 8px 16px; font-size: 15px; }
.button.outline { background: transparent; color: var(--fg); border-color: var(--border); }
.button.outline:hover { background: var(--surface-2); color: var(--fg); border-color: var(--text-3); }

/* Type */

h1, h2, h3 { font-family: var(--heading); font-weight: 400; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(40px, 6vw, 64px); line-height: 1.2; }
h2 { font-size: clamp(32px, 4.4vw, 56px); line-height: 1.22; }
h3 { font-size: clamp(26px, 2.6vw, 32px); line-height: 1.25; }
h1 em, h2 em, h3 em { font-style: normal; color: var(--accent); }

.eyebrow {
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-3); margin: 0 0 var(--s2);
}
.lede { font-size: clamp(18px, 1.9vw, 20px); line-height: 1.6; color: var(--text-2); max-width: 36em; }
.prose { font-size: 17px; line-height: 1.65; max-width: var(--measure); overflow-wrap: break-word; }
.prose h2 { margin: var(--s6) 0 var(--s2); font-size: 32px; line-height: 1.25; }
.prose p, .prose ul { margin: 0 0 16px; }
.prose li { margin-bottom: 6px; }
.fine { font-size: 14px; color: var(--text-3); }

/* Sections */

section { padding: clamp(56px, 8vw, 120px) 0; }
.center { text-align: center; }
.center .lede { margin-left: auto; margin-right: auto; }
.section-head { margin: 0 auto var(--s6); max-width: 46em; }
.section-head .lede { margin-top: var(--s2); margin-bottom: 0; }
.section-head.center h2 { max-width: 18em; margin: 0 auto; }

/* Simple page heads (AI, contact, legal) */

.hero { padding-top: clamp(48px, 7vw, 96px); padding-bottom: var(--s5); }
.hero h1 { max-width: 15em; }
.hero .lede { margin: var(--s3) 0 0; }
.cta-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.cta-row .fine { margin: 0; }
.center .cta-row { justify-content: center; }

/* Home hero */

.cover { padding: clamp(48px, 7vw, 96px) 0 0; }
.cover-panel { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }
.cover-inner { max-width: 760px; }
.cover h1 { max-width: 12em; }
.cover .lede { margin: var(--s3) 0 var(--s4); }
.cover .fine { margin: 0; }

/* App mock: a stand-in until real screenshots exist. */

.mock {
  border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; background: var(--surface);
  display: grid; grid-template-columns: 210px 1fr 240px;
  box-shadow: 0 40px 80px -40px rgba(36, 36, 31, 0.35);
}
.mock-binder { background: var(--sidebar); color: var(--sidebar-text); padding: 18px 14px; font-size: 14px; }
.mock-binder p { margin: 0 0 10px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.7; }
.mock-binder ul { list-style: none; margin: 0; padding: 0; }
.mock-binder li { padding: 5px 8px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mock-binder li.sub { padding-left: 22px; }
.mock-binder li.on { background: rgba(255, 255, 255, 0.1); color: #fff; }
.mock-page { padding: 36px clamp(20px, 4vw, 56px); font-family: var(--body); font-size: 18px; line-height: 1.7; }
.mock-page h4 { font-family: var(--heading); font-weight: 400; font-size: 24px; margin: 0 0 18px; }
.mock-page p { margin: 0 0 14px; }
.mention { border-radius: 3px; padding: 0 2px; }
.mention.person { background: var(--person-bg); color: var(--person-fg); }
.mention.place { background: var(--place-bg); color: var(--place-fg); }
.mock-entry { border-left: 1px solid var(--border); padding: 20px 18px; font-size: 14px; background: var(--bg); }
.mock-entry .kind { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); margin: 0 0 4px; }
.mock-entry h5 { font-family: var(--heading); font-weight: 400; font-size: 22px; margin: 0 0 8px; }
.mock-entry .lead { font-family: var(--body); font-size: 15px; line-height: 1.5; color: var(--text-2); margin: 0 0 16px; }
.mock-entry ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.mock-entry li { padding: 7px 0; border-bottom: 1px solid var(--border); color: var(--text-2); }
@media (max-width: 900px) {
  .mock { grid-template-columns: 1fr; }
  .mock-binder, .mock-entry { display: none; }
}

/* Features: numbered folios between hairlines. Each illustration sits on a page
   with a coloured spine, in the style library's binding colours. */

.panels { counter-reset: folio; border-bottom: 1px solid var(--border); }
.panel {
  counter-increment: folio; border-top: 1px solid var(--border);
  padding: clamp(40px, 6vw, 80px) 0;
  display: grid; grid-template-columns: 5fr 6fr; gap: clamp(32px, 6vw, 96px); align-items: center;
}
.panel > div:first-child::before {
  content: '¶ ' counter(folio, decimal-leading-zero);
  display: block; font-family: var(--mono); font-size: 13px; letter-spacing: 0.06em;
  color: var(--spine); margin-bottom: var(--s3);
}
.panel:nth-child(even) > div:first-child { order: 2; }
.panel:nth-child(4n+1) { --spine: var(--jade); }
.panel:nth-child(4n+2) { --spine: var(--cordovan); }
.panel:nth-child(4n+3) { --spine: var(--ivy); }
.panel:nth-child(4n+4) { --spine: #4F7FA8; }
.panel p { color: var(--text-2); margin: var(--s3) 0 0; max-width: 28em; }
.panel .illo {
  background: var(--surface-2); border-left: 6px solid var(--spine);
  border-radius: 2px 10px 10px 2px; padding: clamp(24px, 4vw, 48px);
}
@media (prefers-color-scheme: dark) { .panel:nth-child(4n+2) { --spine: #E06A86; } .panel:nth-child(4n+3) { --spine: #A7AE7C; } .panel:nth-child(4n+4) { --spine: #8DB4D6; } .panel:nth-child(4n+1) { --spine: var(--accent); } }
@media (max-width: 860px) {
  .panel { grid-template-columns: 1fr; }
  .panel:nth-child(even) > div:first-child { order: 0; }
}

.illo { font-size: 15px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 16px 18px; box-shadow: 0 12px 28px -18px rgba(36, 36, 31, 0.4);
}
.card .kind { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); margin: 0 0 4px; }
.card h5 { font-family: var(--heading); font-weight: 400; font-size: 22px; margin: 0 0 6px; }
.card p { margin: 0; font-family: var(--body); font-size: 16px; line-height: 1.55; color: var(--text-2); }
.illo-text { font-family: var(--body); font-size: 18px; line-height: 1.7; margin: 0 0 -4px; }
.illo-lexicon .card { margin-left: clamp(0px, 8%, 56px); max-width: 320px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 4px; background: var(--surface-2); color: var(--text-2); }
.tag.jade { background: var(--person-bg); color: var(--person-fg); }
.tag.blue { background: var(--place-bg); color: var(--place-fg); }
.tag.rose { background: var(--todo-bg); color: var(--todo-fg); }
.chapter-box { background: var(--surface-2); border-radius: 10px; padding: 14px; }
.chapter-box > b { display: block; font-size: 14px; margin: 0 0 10px; }
.books { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; position: relative; padding-top: 64px; }
.books .shared { position: absolute; top: 0; left: 50%; transform: translateX(-50%); white-space: nowrap; }
.books .card { padding-top: 40px; }
.books b { display: block; font-size: 13px; color: var(--text-3); font-weight: 500; }
.books .title { font-family: var(--heading); font-size: 22px; line-height: 1.2; }
.orders { display: grid; grid-template-columns: auto 1fr 1fr; gap: 8px 14px; font-size: 14px; align-items: center; }
.orders .h { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.orders .n { color: var(--text-3); font-variant-numeric: lining-nums tabular-nums; }
.orders .s { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; }
.orders .s.on { border-color: var(--accent); color: var(--accent-strong); }

/* Card grid (smaller features, values) */

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s6) var(--s7); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s5); }
@media (max-width: 860px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.tile { border-top: 2px solid var(--fg); padding-top: var(--s3); }
.tile h3 { font-size: 26px; }
.tile p { color: var(--text-2); margin: var(--s2) 0 0; }
.value { border-top: 2px solid var(--fg); padding-top: var(--s3); }
.value h3 { font-size: 24px; }
.value p { color: var(--text-2); margin: var(--s1) 0 0; }

.platforms { list-style: none; padding: 0; margin: 0; }
.platforms li { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.platforms li:last-child { border-bottom: 0; }
.platforms li { font-weight: 500; }

/* Stance: a full-width Soft blue section. */

.stance { background: var(--stance-bg); }
.stance-lines { list-style: none; padding: 0; margin: var(--s5) 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s5); }
.stance-lines li { font-family: var(--heading); font-size: clamp(22px, 2.4vw, 28px); line-height: 1.3; border-top: 1px solid currentColor; padding-top: var(--s3); }
.stance-lines li::before { content: '¶'; display: block; color: var(--accent); margin-bottom: var(--s1); }
@media (max-width: 760px) { .stance-lines { grid-template-columns: 1fr; } }

/* Pricing */

.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 860px) { .plans { grid-template-columns: 1fr; } }
.plan {
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  padding: 28px; display: flex; flex-direction: column; text-align: left;
}
.plan.featured { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.plan h3 { font-size: 24px; }
.badges { display: flex; gap: 8px; flex-wrap: wrap; min-height: 26px; margin: 10px 0 18px; }
@media (max-width: 860px) { .badges:empty { display: none; } }
.badge { font-size: 13px; padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); }
.plan.featured { position: relative; }
.badge.recommended {
  background: var(--accent); color: var(--on-accent);
  position: absolute; top: 0; left: 50%; transform: translate(-50%, -50%);
  white-space: nowrap; font-weight: 500;
}
.price { margin: 0; display: flex; align-items: baseline; gap: 6px; }
.price span { font-family: var(--ui); font-size: 56px; font-weight: 400; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.price small { font-size: 16px; color: var(--text-3); }
.own { margin: 18px 0 4px; font-weight: 500; }
.own-total { margin: 0 0 24px; color: var(--text-3); font-size: 15px; }
.plan .button { margin-top: auto; }

/* Free vs Standard: a ruled table, Standard set on Vellum. */

.matrix { width: 100%; border-collapse: collapse; font-size: 16px; }
.matrix th, .matrix td { padding: 14px 16px; text-align: center; border-bottom: 1px solid var(--border); }
.matrix th[scope="row"] { text-align: left; font-weight: 500; padding-left: 0; }
.matrix td { width: 28%; }
.matrix .std { background: var(--accent-soft); }
.matrix thead th { border-bottom: 2px solid var(--fg); padding-bottom: 16px; vertical-align: bottom; }
.matrix thead th.std { border-radius: 10px 10px 0 0; padding-top: 20px; }
.matrix tbody tr:last-child .std { border-radius: 0 0 10px 10px; }
.matrix thead th h3 { font-size: 26px; }
.matrix thead th p { margin: 4px 0 0; font-size: 14px; font-weight: 400; color: var(--text-3); }
.matrix .mark { display: inline-block; vertical-align: -3px; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.matrix .mark.yes { color: var(--accent); }
.matrix .no { color: var(--text-3); }
.table-scroll { overflow-x: auto; }
@media (max-width: 640px) {
  .matrix { font-size: 14px; }
  .matrix th, .matrix td { padding: 12px 8px; }
}

/* FAQ: questions and answers side by side, all open. */

.qa { max-width: 960px; margin: 0 auto; }
.qa div { display: grid; grid-template-columns: 2fr 3fr; gap: 16px 48px; padding: var(--s4) 0; border-bottom: 1px solid var(--border); }
.qa div:last-child { border-bottom: 0; }
.qa dt { font-weight: 600; }
.qa dd { margin: 0; color: var(--text-2); line-height: 1.65; }
.qa dd p { margin: 0 0 10px; }
.qa dd p:last-child { margin: 0; }
@media (max-width: 720px) { .qa div { grid-template-columns: 1fr; gap: 8px; } }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Footer */

.site-footer { padding: 48px 0 64px; font-size: 15px; color: var(--text-3); border-top: 1px solid var(--border); margin-top: var(--s5); }
.site-footer .wrap { display: flex; gap: 24px 48px; flex-wrap: wrap; justify-content: space-between; }
.site-footer nav { display: flex; gap: 10px 24px; flex-wrap: wrap; }
.site-footer a { color: var(--text-2); text-decoration: none; }
.site-footer a:hover { color: var(--fg); text-decoration: underline; }
.site-footer p { margin: 0; }

/* Legal pages */

mark.todo { background: var(--todo-bg); color: var(--todo-fg); padding: 0 3px; border-radius: 3px; }
.legal .table-scroll { margin: 8px 0 20px; }
table.compare { width: 100%; border-collapse: collapse; font-size: 15px; }
.compare th, .compare td { text-align: left; padding: 12px 12px 12px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.compare thead th { font-family: var(--mono); font-weight: 400; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); font-size: 13px; }
.text-link { font-size: 16px; }

/* Until /js/pricing.js has localised the prices (see the pricing page head),
   each figure is drawn as a skeleton block the size of the fallback text. */
.prices-pending [data-price], .prices-pending [data-price-total] {
  color: transparent; border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%) 0 0 / 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
.prices-pending [data-price-total] { border-radius: 4px; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .prices-pending [data-price], .prices-pending [data-price-total] { animation: none; } }
#price-note { transition: opacity 0.2s; }
.prices-pending #price-note { opacity: 0; }
