/* doksi — the site for a typesetting product.
 *
 * The constraint that drives every choice here: the page must not embarrass the
 * PDF. A site set in a default UI stack, selling documents set in Crimson Pro,
 * tells a visitor the typography is a claim rather than a habit. So the page
 * uses the SAME faces the documents use, served from the same files.
 */

@font-face {
  font-family: 'Crimson Pro';
  src: url('/assets/fonts/CrimsonPro-Regular.ttf') format('truetype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Crimson Pro';
  src: url('/assets/fonts/CrimsonPro-Italic.ttf') format('truetype');
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Crimson Pro';
  src: url('/assets/fonts/CrimsonPro-SemiBold.ttf') format('truetype');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Montserrat';
  src: url('/assets/fonts/Montserrat-SemiBold.ttf') format('truetype');
  font-weight: 600; font-style: normal; font-display: swap;
}

:root {
  --ink: #111111;
  --muted: #4a4a4a;
  --accent: #7a5c2e;
  --rule: #d8d2c6;
  --paper: #faf8f4;
  --measure: 34rem;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Crimson Pro', Georgia, 'Times New Roman', serif;
  font-size: 19px;
  line-height: 1.55;
  font-variant-numeric: oldstyle-num;
}

.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1.5rem; }

/* One left edge, the same rule the documents follow. */
h1, h2, h3, p, ul, ol, .lede { margin-left: 0; }

h1, h2, h3 {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.1rem, 5vw, 3.1rem); margin: 0 0 .6rem; }
h2 { font-size: 1.5rem; margin: 3rem 0 .8rem; }
h3 { font-size: 1.05rem; margin: 0 0 .3rem; }

p, li { max-width: var(--measure); }

.lede { font-size: 1.22rem; color: var(--muted); max-width: 40rem; }

header.site {
  border-bottom: 1px solid var(--rule);
  padding: 1.1rem 0;
  margin-bottom: 3.2rem;
}
header.site .wrap { display: flex; align-items: baseline; gap: 1.2rem; }
.brand {
  font-family: 'Montserrat', sans-serif; font-weight: 600;
  font-size: 1.12rem; letter-spacing: .02em; text-decoration: none; color: var(--ink);
}
.brand-note { color: var(--muted); font-size: .92rem; }

/* The specimen is the argument, so it gets the room. */
/* The specimen gets the larger column. It is the entire argument: a visitor
   who cannot READ the letterhead and the subject line has been shown a grey
   rectangle and asked to take the typography on trust. */
.specimen {
  margin: 2.4rem 0 3rem;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
}
@media (max-width: 56rem) { .specimen { grid-template-columns: 1fr; } }

.sheet {
  display: block;
  width: 100%;
  border: 1px solid var(--rule);
  /* A real sheet of paper sits ON something. Without a shadow the render reads
     as a screenshot of a document rather than as a document. */
  box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 26px rgba(0,0,0,.09);
  background: #fff;
}
.sheet img { display: block; width: 100%; height: auto; }

.caption { color: var(--muted); font-size: .92rem; margin-top: .7rem; }
.caption a { color: var(--accent); }

.kinds { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.kinds li {
  padding: 1.1rem 0;
  border-top: 1px solid var(--rule);
  max-width: 46rem;
}
.kinds li:last-child { border-bottom: 1px solid var(--rule); }
.kinds a { color: var(--ink); text-decoration: none; }
.kinds a:hover h3 { color: var(--accent); }
.kinds .tagline { color: var(--muted); margin: 0; }

.gate {
  border-left: 3px solid var(--accent);
  padding: .1rem 0 .1rem 1.1rem;
  margin: 2.2rem 0;
  max-width: 40rem;
}
.gate p { margin: .4rem 0; }

code, .mono {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: .88em;
  background: rgba(0,0,0,.04);
  padding: .1em .35em;
  border-radius: 3px;
}

footer.site {
  margin-top: 4.5rem;
  border-top: 1px solid var(--rule);
  padding: 1.4rem 0 3rem;
  color: var(--muted);
  font-size: .9rem;
}

a { color: var(--accent); }
a:focus-visible, .brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* The specimen when this host cannot rasterise a PDF page. An honest panel
   offering the real document beats an <img> that will never load. */
.sheet-link {
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  aspect-ratio: 1 / 1.414;
  text-decoration: none; text-align: center; gap: .5rem;
  background: #fff;
}
.sheet-title { font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 1.25rem; color: var(--ink); }
.sheet-sub { color: var(--muted); font-size: .95rem; }
.sheet-link:hover .sheet-title { color: var(--accent); }

/* The browser renders the specimen PDF itself where the host has no
   rasteriser. Sized by ASPECT RATIO rather than a fixed height, so the sheet
   keeps A4's proportions at every width instead of becoming a letterbox. */
.sheet-pdf {
  display: block;
  width: 100%;
  aspect-ratio: 210 / 297;
  border: 0;
  background: #fff;
}

.spec-link {
  display: inline-block;
  margin-top: .35rem;
  font-size: .9rem;
  color: var(--accent);
  text-decoration: none;
}
.spec-link:hover { text-decoration: underline; }

/* The admin surface. One screen, no navigation: its job is "is anything
   wrong", answered before the reader has to click anything. */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: .75rem;
  margin: 1.25rem 0 2rem;
}
.tile {
  display: flex; flex-direction: column; gap: .2rem;
  padding: .85rem 1rem;
  border: 1px solid var(--rule);
  border-left-width: 3px;
  background: #fff;
}
/* State is carried by the left edge, not by a wash of colour: a tinted panel
   reads as decoration, and an operator scanning for trouble should be able to
   find it down one line of the page. */
.tile.ok   { border-left-color: #2f6f4f; }
.tile.warn { border-left-color: #a8761d; }
.tile.bad  { border-left-color: #a33; }
.tile-label {
  font-family: 'Montserrat', sans-serif; font-weight: 600;
  font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
}
.tile-value { font-size: 1.5rem; line-height: 1.1; color: var(--ink); }
.tile-note  { font-size: .85rem; color: var(--muted); }

.admin-table { width: 100%; border-collapse: collapse; margin: .5rem 0 2rem; }
.admin-table th, .admin-table td {
  text-align: left; padding: .45rem .6rem;
  border-bottom: 1px solid var(--rule); font-size: .95rem;
}
.admin-table th {
  font-family: 'Montserrat', sans-serif; font-weight: 600;
  font-size: .72rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted);
}
.admin-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.tag-ok  { color: #2f6f4f; }
.tag-bad { color: #a33; }
.empty { color: var(--muted); }
.admin-foot { color: var(--muted); font-size: .9rem; border-top: 1px solid var(--rule); padding-top: 1rem; }
