/* Pelecus Pilosus — Shared Website Style */
/* Classical bookprinting. White paper, warm ink, slab serif. */

/* ── Fonts ─────────────────────────────────────────────── */

/* ── PT Serif (body) ───────────────────────────────────── */

@font-face {
  font-family: 'PT Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/pt-serif-cyrillic-400-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'PT Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/pt-serif-cyrillic-400-italic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'PT Serif';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('./fonts/pt-serif-cyrillic-700-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'PT Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/pt-serif-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'PT Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/pt-serif-latin-400-italic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'PT Serif';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('./fonts/pt-serif-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Iosevka Slab (code) ───────────────────────────────── */

@font-face {
  font-family: 'Iosevka Slab';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/iosevka-regular.woff2') format('woff2');
}

/* ── Tokens ────────────────────────────────────────────── */

:root {
  --ink:       #1a1a1a;
  --ink-muted: #939383;
  --paper:     #ffffff;
  --paper-off: #fafaf5;

  --font-body: 'PT Serif', Georgia, 'Times New Roman', serif;
  --font-code: 'Iosevka Slab', monospace;

  --measure:   42rem;       /* optimal reading line length */
  --gutter:    2rem;        /* page margins */
  --leading:   1.6;         /* line-height */
  --radius:    2px;         /* subtle, almost sharp */
}

/* ── Reset ─────────────────────────────────────────────── */

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

body, h1, h2, h3, h4, h5, h6,
p, ul, ol, dl, figure, pre, blockquote,
table, hr, fieldset {
  margin: 0;
  padding: 0;
}

/* ── Base ───────────────────────────────────────────────── */

html {
  font-size: 112.5%;        /* 18px base instead of 16px */
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: var(--leading);
  color: var(--ink);
  background-color: var(--paper);
  overflow-x: hidden;
  overflow-wrap: break-word;
  word-break: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Layout ─────────────────────────────────────────────── */

.page {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 600px) {
  .page {
    max-width: var(--measure);
    padding: var(--gutter);
  }
}

.page-wide {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 600px) {
  .page-wide {
    max-width: 56rem;
    padding: var(--gutter);
  }
}

/* ── Headings ───────────────────────────────────────────── */

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.2;
  text-rendering: optimizeLegibility;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

h2 {
  font-size: 1.65rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--ink-muted);
}

h3 {
  font-size: 1.3rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

h4 {
  font-size: 1.15rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

/* ── Text elements ──────────────────────────────────────── */

p {
  margin-bottom: 1rem;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--ink-muted);
}

strong {
  font-weight: 700;
}

em {
  font-style: italic;
}

small, .muted {
  font-size: 0.85rem;
  color: var(--ink-muted);
}

/* ── Lists ──────────────────────────────────────────────── */

ul, ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.25rem;
}

li::marker {
  color: var(--ink-muted);
}

dl {
  margin-bottom: 1rem;
}

dt {
  font-weight: 700;
  margin-top: 0.75rem;
}

dd {
  margin-left: 1.5rem;
  margin-bottom: 0.25rem;
}

/* ── Blockquote ─────────────────────────────────────────── */

blockquote {
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  border-left: 3px solid var(--ink-muted);
  color: var(--ink-muted);
  font-style: italic;
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* ── Code ───────────────────────────────────────────────── */

code {
  font-family: var(--font-code);
  font-size: 0.9em;
  background: var(--paper-off);
  padding: 0.15em 0.35em;
  border-radius: var(--radius);
  word-break: break-all;
}

pre {
  font-family: var(--font-code);
  font-size: 0.85rem;
  line-height: 1.5;
  background: var(--paper-off);
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 1rem;
  max-width: 100%;
}

pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  border-radius: 0;
}

/* ── Horizontal rule ────────────────────────────────────── */

hr {
  border: none;
  border-top: 1px solid var(--ink-muted);
  margin: 2rem 0;
}

/* ── Tables ─────────────────────────────────────────────── */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  display: block;
  overflow-x: auto;
}

th, td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--ink-muted);
}

th {
  font-weight: 700;
}

/* ── Images ─────────────────────────────────────────────── */

img {
  max-width: 100%;
  height: auto;
}

/* ── Figures ────────────────────────────────────────────── */

figure {
  margin: 1.5rem 0;
  text-align: center;
}

figcaption {
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-top: 0.5rem;
  font-style: italic;
}

/* ── Header / Masthead ──────────────────────────────────── */

.masthead {
  text-align: center;
  padding: 2rem 1rem 1rem;
  max-width: 100%;
  margin: 0 auto;
}

@media (min-width: 600px) {
  .masthead {
    padding: 3rem var(--gutter) 1rem;
    max-width: var(--measure);
  }
}

.masthead img,
.masthead svg {
  max-width: 200px;
  height: auto;
}

.masthead h1 {
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
}

.masthead .tagline {
  color: var(--ink-muted);
  font-style: italic;
}

/* ── Footer ─────────────────────────────────────────────── */

.footer {
  max-width: 100%;
  margin: 2rem auto 0;
  padding: 1.5rem 1rem;
  border-top: 1px solid var(--ink-muted);
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

@media (min-width: 600px) {
  .footer {
    max-width: var(--measure);
    margin: 3rem auto 0;
    padding: 1.5rem var(--gutter);
  }
}

.footer a {
  color: var(--ink-muted);
}

.footer a:hover {
  color: var(--ink);
}

/* ── Utilities ──────────────────────────────────────────── */

.center  { text-align: center; }
.muted   { color: var(--ink-muted); }
.mono    { font-family: var(--font-code); }
