/* ============================================================================
   The Rooted Journal - sub-page shell ("another page of the same notebook").
   Every informational page is a full-bleed heavily aged notebook page:
   assets/page_bg_empty.jpg fixed behind everything, real selectable copy on
   top. Typewriter titles, Caveat hand notes, quiet serif prose. No wood, no
   crisp modern UI - torn paper, tape, thread, pencil marks only.
   ============================================================================ */

/* self-hosted faces (same files as the journey page) */
@font-face {
  font-family: "Courier Prime";
  src: url("../fonts/courier-prime-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Courier Prime";
  src: url("../fonts/courier-prime-700.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Caveat";
  src: url("../fonts/caveat-var.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
}

:root {
  --font-type: "Courier Prime", "Courier New", Courier, ui-monospace, monospace;
  --font-hand: "Caveat", "Segoe Print", "Bradley Hand", "Apple Chancery", cursive;
  --font-serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --ink: #3E3A32;
  --ink-dark: #2E2A24;
  --ink-soft: #6D6251;
  --paper: #E4CCAE;
  --paper-scrap: #EBD9BC;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-serif); line-height: 1.65;
  overflow-x: hidden;
}

/* ---- the page itself: full-bleed aged notebook sheet --------------------- */
.pg-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.pg-bg img {
  width: 100%; height: 100%; object-fit: cover; object-position: 0% 50%;
  display: block;
}
/* faint handled-paper edge shading, same as the journey */
.pg-bg::after {
  content: ""; position: absolute; inset: 0; mix-blend-mode: multiply;
  background:
    radial-gradient(118% 118% at 50% 46%,
      transparent 58%,
      rgba(122, 96, 58, 0.09) 84%,
      rgba(98, 76, 46, 0.18) 100%);
}

/* ---- content column: clears the spiral-binding holes on the left --------- */
.pg {
  position: relative; z-index: 1;
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(26px, 5vh, 56px) clamp(20px, 5vw, 48px) 60px clamp(74px, 11vw, 150px);
}

.pg-kicker {
  font-family: var(--font-type); font-size: 0.7rem; letter-spacing: 0.22em;
  color: var(--ink-soft); margin: 0 0 8px;
}
.pg-title {
  font-family: var(--font-type); font-weight: 700;
  font-size: clamp(1.7rem, 4vw, 2.5rem); line-height: 1.15;
  color: var(--ink-dark); margin: 0 0 6px; letter-spacing: 0.01em;
  text-shadow: 0 1px 0 rgba(228, 204, 174, 0.55);
}
.pg-sub {
  font-family: var(--font-hand); font-weight: 600; font-size: 1.5rem;
  color: var(--ink); margin: 0 0 30px; transform: rotate(-0.6deg);
  transform-origin: left center;
}

.pg h2 {
  font-family: var(--font-type); font-weight: 700; font-size: 1.05rem;
  letter-spacing: 0.06em; color: var(--ink-dark); margin: 2.2em 0 0.5em;
}
/* generic prose only - :where() keeps this at .pg-level specificity so any
   CLASSED paragraph (slip lines, pile captions, post meta, stamp notes) keeps
   its own authored ink + margins. QA v4: the old `.pg p` (0,1,1) silently beat
   every (0,1,0) component rule - flattened slip/pile inks to --ink and killed
   .post-back's 34px gap (share tag sat on the back link on mobile). */
.pg :where(p) { max-width: 62ch; margin: 0 0 1em; color: var(--ink); }
.pg a { color: var(--ink); }
.pg a:hover { color: var(--ink-dark); }
.pg a:focus-visible { outline: 2px dashed var(--ink); outline-offset: 3px; }

/* handwritten aside lines */
.pg-hand {
  font-family: var(--font-hand); font-weight: 600; font-size: 1.45rem;
  line-height: 1.35; color: var(--ink-dark); max-width: 34ch;
  transform: rotate(-0.8deg); transform-origin: left center;
  margin: 1.4em 0;
}

/* a small piece of tape (decorative) */
.tape {
  position: absolute; width: 74px; height: 16px;
  background: rgba(230, 219, 188, 0.72);
  clip-path: polygon(2% 22%, 10% 0%, 92% 6%, 100% 30%, 97% 78%, 88% 100%, 8% 94%, 0% 70%);
  box-shadow: 0 1px 2px rgba(60, 44, 24, 0.14);
  pointer-events: none;
}

/* ---- torn paper scrap (cards, figures) ----------------------------------- */
.scrap {
  position: relative; background:
    radial-gradient(120% 80% at 88% 6%, rgba(199, 174, 129, 0.22), transparent 42%),
    radial-gradient(100% 70% at 6% 94%, rgba(199, 174, 129, 0.16), transparent 40%),
    var(--paper-scrap);
  padding: 14px 14px 12px;
  clip-path: polygon(1% 4%, 9% 0%, 24% 2%, 40% 0%, 57% 2%, 73% 0%, 90% 2%, 99% 0%, 100% 12%, 98% 30%, 100% 49%, 98% 68%, 100% 85%, 99% 97%, 88% 100%, 70% 98%, 52% 100%, 34% 97%, 16% 100%, 3% 97%, 0% 84%, 2% 63%, 0% 44%, 2% 22%);
  filter: drop-shadow(2px 4px 10px rgba(60, 44, 24, 0.3));
}

/* ---- footer: printer's marks row ----------------------------------------- */
.pg-foot {
  margin-top: 64px; padding-top: 14px; max-width: 62ch;
  border-top: 1px dashed rgba(109, 98, 81, 0.5);
  font-family: var(--font-type); font-size: 0.72rem; letter-spacing: 0.06em;
}
.pg-foot a { color: var(--ink); text-decoration: none;
  border-bottom: 1px dotted rgba(62, 58, 50, 0.6); padding-bottom: 1px; }
.pg-foot a:hover { color: var(--ink-dark); border-bottom-style: solid; }
.pg-foot .sep { color: rgba(87, 80, 63, 0.5); padding: 0 6px; }

/* signature line */
.pg-sig {
  font-family: var(--font-hand); font-weight: 600; font-size: 1.35rem;
  color: var(--ink); transform: rotate(-1.2deg); transform-origin: left center;
  margin-top: 34px;
}

@media (max-width: 700px) {
  /* portrait crop makes the landscape sheet's binding column huge; slide the
     crop window right so only a sliver of the holes shows, and keep the
     content clear of it */
  .pg-bg img { object-position: 10% 50%; }
  .pg { padding-left: clamp(44px, 12vw, 64px); padding-right: 16px; }
  .pg-hand { font-size: 1.3rem; }
}
