/* Publican: the .pub manager. Publisher's own workspace: white pages on a grey pasteboard, blue margin
   guides, and the process inks for everything else (cyan guides, magenta actions, yellow highlights). */
@font-face { font-family: "Franklin UI"; src: url("./fonts/LibreFranklin-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Franklin UI"; src: url("./fonts/LibreFranklin-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Franklin UI"; src: url("./fonts/LibreFranklin-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Franklin UI"; src: url("./fonts/LibreFranklin-900.woff2") format("woff2"); font-weight: 900; font-display: swap; }
@font-face { font-family: "Gelasio UI"; src: url("./fonts/Gelasio-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Gelasio UI"; src: url("./fonts/Gelasio-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Gelasio UI"; src: url("./fonts/Gelasio-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --pasteboard: #d9eaf5;   /* the pasteboard around the page, tinted towards the guide cyan */
  --surface: #ffffff;      /* header, questions, about */
  --paper: #ffffff;        /* a document page: white in every theme */
  --ink: #1a1a1a;
  --muted: #56606b;
  --rule: #cfd9e2;
  --guide: #3aa0d8;        /* margin guides: decoration only, never text */
  --action: #b8175a;       /* process magenta: buttons, links, focus */
  --action-text: #b8175a;
  --highlight: #ffe45c;    /* highlighter yellow: notices */
  --err: #b3261e;
  --sans: "Franklin UI", "Franklin Gothic Medium", Arial, sans-serif;
  --serif: "Gelasio UI", Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root { --pasteboard: #1d3350; --surface: #15243a; --ink: #eef2f7; --muted: #a9b6c8; --rule: #2b4263;
    --action: #d02c6e; --action-text: #ff6fa3; --err: #ff8a80; }
}

* { box-sizing: border-box; }
html { background: var(--surface); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--surface);
  font-family: var(--sans); font-size: 17px; line-height: 1.5; }
a { color: inherit; text-decoration-color: var(--action-text); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--action-text); }
:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; }

/* header: one line. brand, status, then zoom and menu on the right */
.top { display: flex; align-items: center; gap: 16px; padding: 12px 20px; white-space: nowrap; border-bottom: 1px solid var(--rule); }
.top .brand { font-weight: 900; font-size: 21px; letter-spacing: -0.02em; text-decoration: none; }
.top .brand span { font-weight: 400; letter-spacing: 0; color: var(--muted); margin-left: 8px; font-size: 16px; }
.top .status { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.top .status.err { color: var(--err); }
.zoomer { display: none; align-items: center; gap: 4px; }
body.has-doc .zoomer { display: flex; }
/* Edit: not built yet; leads to the waitlist page (editing.html) */
.edit { display: none; }
body.has-doc .edit { display: inline-block; }
.zoom { color: var(--muted); font-size: 14px; min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; }
button, .btn { font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; padding: 6px 12px; border: 1.5px solid var(--ink); background: transparent; color: inherit; border-radius: 3px; cursor: pointer; }
button:hover:not(:disabled), .btn:hover { border-color: var(--action); color: var(--action-text); }
button:disabled { opacity: .4; cursor: default; }
input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; font-size: 15px; font-weight: 600; padding: 6px 12px; border: 1.5px solid var(--ink); border-radius: 3px; }
.menu summary:hover { border-color: var(--action); color: var(--action-text); }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: ""; display: inline-block; margin-left: 8px; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-3px) rotate(45deg); }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--surface); border: 1px solid var(--rule); border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0,0,0,.2); padding: 6px; display: flex; flex-direction: column; z-index: 5; white-space: nowrap; }
.menu-list > * { display: block; text-align: left; padding: 9px 12px; border: 0; border-radius: 3px; background: none; font: inherit; font-size: 15px; font-weight: 400; color: inherit; text-decoration: none; cursor: pointer; }
.menu-list > *:hover:not(:disabled) { background: var(--pasteboard); color: inherit; }
.menu-list label { position: relative; }
@media (max-width: 600px) { .top .brand span { display: none; } .top .status { display: none; } .top .brand { margin-right: auto; } .top { gap: 10px; padding: 12px 16px; } }
@media (max-width: 420px) { .zoom { display: none; } .top { gap: 8px; padding: 12px; } .top button, .top .btn, .menu summary { padding: 6px 9px; } }

/* hero: a page on the pasteboard, trimmed with crop marks and laid out with margin guides */
.hero { background: var(--pasteboard); padding: 88px 24px 96px; }
.hero-inner { max-width: 1000px; margin: 0 auto; display: grid; grid-template-columns: 1fr 340px; gap: 88px; align-items: center; }
.hero h1 { font-size: clamp(40px, 5.6vw, 64px); line-height: 1; letter-spacing: -0.025em; font-weight: 900; margin: 0 0 28px; max-width: 12ch; }
.hero p { font-family: var(--serif); font-size: 21px; max-width: 32ch; margin: 0 0 18px; line-height: 1.45; }
.hero p.fine { font-family: var(--sans); font-size: 15px; color: var(--muted); }
.sheet { display: block; aspect-ratio: 8.5 / 11; background: var(--paper); color: #1a1a1a; cursor: pointer; position: relative;
  box-shadow: 0 1px 2px rgba(0,0,0,.2), 0 12px 28px rgba(0,0,0,.18); transition: transform .18s ease, box-shadow .18s ease; }
/* Crop marks just outside each corner. */
.sheet::before { content: ""; position: absolute; inset: -22px; pointer-events: none;
  --m: var(--ink);
  background:
    linear-gradient(var(--m), var(--m)) 0 22px / 14px 1px, linear-gradient(var(--m), var(--m)) 100% 22px / 14px 1px,
    linear-gradient(var(--m), var(--m)) 0 calc(100% - 22px) / 14px 1px, linear-gradient(var(--m), var(--m)) 100% calc(100% - 22px) / 14px 1px,
    linear-gradient(var(--m), var(--m)) 22px 0 / 1px 14px, linear-gradient(var(--m), var(--m)) calc(100% - 22px) 0 / 1px 14px,
    linear-gradient(var(--m), var(--m)) 22px 100% / 1px 14px, linear-gradient(var(--m), var(--m)) calc(100% - 22px) 100% / 1px 14px;
  background-repeat: no-repeat; }
/* Margin guides. */
.sheet::after { content: ""; position: absolute; inset: 8%; border: 1px dashed var(--guide); pointer-events: none; transition: border-color .18s ease; }
.sheet:hover { transform: translateY(-3px); box-shadow: 0 1px 2px rgba(0,0,0,.2), 0 18px 36px rgba(0,0,0,.22); }
.sheet:hover::after, body.dragging .sheet::after { border: 2px dashed var(--action); }
.sheet .label { position: absolute; inset: 14% 14% auto; font-size: 22px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.2; }
.sheet .choose { display: table; margin-top: 18px; padding: 10px 18px; background: #b8175a; color: #fff; font-size: 16px; font-weight: 800; letter-spacing: 0; border-radius: 3px; }
.sheet:hover .choose { filter: brightness(1.1); }
/* The ink swatches printed beside the crop marks on a proof: cyan, magenta, yellow, black. */
.sheet .colorbar { position: absolute; left: 28px; bottom: -18px; width: 72px; height: 10px;
  background: linear-gradient(90deg, #00a0e0 0 25%, #e0007a 25% 50%, #ffe000 50% 75%, #1a1a1a 75%); }
body.dragging .sheet .label::after { content: "Drop it here"; display: block; color: #b8175a; margin-top: 12px; }
@media (max-width: 760px) { .hero { padding: 56px 24px 72px; } .hero-inner { grid-template-columns: 1fr; gap: 56px; } .sheet { width: 100%; max-width: 280px; margin: 0 auto; } }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet::after { transition: none; } .sheet:hover { transform: none; } }

/* document pages: on the pasteboard, as in Publisher */
.notice { max-width: 1040px; margin: 16px auto 0; padding: 12px 16px; background: var(--highlight); color: #1a1a1a; font-size: 15px; }
.notice[hidden] { display: none; }
main.doc { background: var(--pasteboard); padding: 24px 16px 48px; min-height: 40vh; }
body:not(.has-doc) main.doc { display: none; }
#pages { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.page { background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2), 0 8px 20px rgba(0,0,0,.14); max-width: 100%; overflow: auto; }
.page svg { display: block; }
.page .tb { line-height: normal; } /* never inherit the page's line-height into document text */
.page .tb p { margin: 0; }
.hyph .page .tb p { hyphens: auto; -webkit-hyphens: auto; } /* on unless ?hyphens=0 */
.page-error { padding: 24px; color: var(--err); }

/* faq: one quiet column, set like a newsletter: Franklin heads, serif text */
.faq-inner { max-width: 640px; margin: 0 auto; padding: 72px 24px 56px; }
.faq h2 { font-size: 28px; font-weight: 900; letter-spacing: -0.02em; margin: 0 0 32px; }
.faq dl { margin: 0; }
.faq dt { font-weight: 800; font-size: 18px; margin-bottom: 4px; }
.faq dd { margin: 0 0 28px; font-family: var(--serif); color: var(--muted); font-size: 17px; line-height: 1.55; max-width: 56ch; }

footer { border-top: 1px solid var(--rule); padding: 28px 24px 40px; color: var(--muted); font-size: 14px; }
footer .inner { max-width: 1040px; margin: 0 auto; display: flex; gap: 24px; flex-wrap: wrap; justify-content: space-between; }

/* about and waitlist pages */
.prose { max-width: 66ch; margin: 0 auto; padding: 48px 24px 64px; }
.prose h1 { font-size: 44px; font-weight: 900; letter-spacing: -0.03em; line-height: 1.02; margin: 0 0 24px; }
.prose h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; margin: 40px 0 10px; }
.prose p, .prose li { font-family: var(--serif); font-size: 18px; line-height: 1.6; }
.prose ul { padding-left: 20px; }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; margin: 12px 0; }
.prose td, .prose th { text-align: left; padding: 6px 8px 6px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.prose .cta { margin: 32px 0 10px; }
.btn.primary { display: inline-block; font-family: var(--sans); font-size: 18px; font-weight: 800; padding: 14px 28px; background: var(--action); border-color: var(--action); color: #fff; }
.btn.primary:hover { color: #fff; filter: brightness(1.1); }
.prose .fine { font-family: var(--sans); font-size: 15px; color: var(--muted); }
.prose code { font-family: ui-monospace, Menlo, monospace; font-size: 15px; }

/* print: one document page per sheet, nothing else */
@media print {
  @page { margin: 0; }
  body { background: #fff; }
  .top, .hero, .strip, .faq, footer, .notice { display: none !important; }
  main.doc { padding: 0; background: #fff; }
  #pages { display: block; }
  .page { box-shadow: none; overflow: visible; page-break-after: always; break-after: page; margin: 0; }
  .page:last-child { page-break-after: auto; break-after: auto; }
  .page svg { width: 100% !important; height: auto !important; }
}
