/* ---------------------------------------------------------------
   A quiet page. Warm off-white text on near-black, lit as if by a
   single lamp. No chrome. Only the text, then a signature.
   --------------------------------------------------------------- */

/* Self-hosted so the page carries no third-party request and never
   flashes a fallback serif. Latin subset, regular + italic. Paths are
   relative to this stylesheet, so they resolve for /entries/ too. */
@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/eb-garamond-normal.woff2") format("woff2");
}
@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/eb-garamond-italic.woff2") format("woff2");
}

/* An antique press face for the illuminated initial — inky and slightly
   irregular, like a letter lifted from a 17th-century book. Self-hosted. */
@font-face {
  font-family: "IM Fell English";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/im-fell-english-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IM Fell English";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/im-fell-english-italic.woff2") format("woff2");
}

:root {
  /* Body is a readable Garamond; the display face is the antique initial.
     To age the whole body, set --serif to the --display stack. */
  --serif:   "EB Garamond", "Cormorant Garamond", "Crimson Pro", Georgia, serif;
  --display: "IM Fell English", "EB Garamond", Georgia, serif;

  --ink:    #E8DFCF;  /* aged off-white — book page under lamplight */
  --ground: #0F0D0B;  /* near-black with a warm undertone           */
  --accent: #8B4A3B;  /* faded oxblood                              */
}

* {
  box-sizing: border-box;
}

html {
  font-size: 20px;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--ground);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-color: var(--ground);
}

/* Old paper photographed in low light, held on a fixed full-screen
   layer with its dark overlay composited on top. Using a fixed element
   (rather than background-attachment: fixed) keeps the texture reliably
   in place on iOS Safari, where background-attachment is flaky. The
   path is relative to this stylesheet, so it resolves for /entries/. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(15, 13, 11, 0.65), rgba(15, 13, 11, 0.65)),
    url("assets/paper-texture.jpg");
  background-size: cover;
  background-position: center;
}

main {
  position: relative;
  z-index: 1;
  max-width: 33rem;
  margin: 0 auto;
  padding: 15vh 1.5rem;
}

/* --- The passage ------------------------------------------------ */

.passage {
  text-align: left;
}

.passage p {
  margin: 0 0 1.7em;
}

/* Drop cap: the single W. Floats left; "hy." and the opening lines
   wrap tight against it before the paragraph resumes full width. */
.dropcap {
  float: left;
  font-family: var(--display);
  font-size: 5.8rem;
  line-height: 0.82;       /* box height governs how many lines wrap */
  color: var(--accent);
  margin: 0 0.09em 0 0;    /* ~ right gutter beside the cap          */
  padding-top: 0.04em;     /* nudge top toward cap-height alignment  */
}

/* --- Section break, the way onward, then signature -------------- */

.ornament {
  margin: 6rem 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: rgba(139, 74, 59, 0.60);
}

/* End (ornament), then there-is-more (further), then who (name). */
.further {
  margin: 3rem 0 0;
  text-align: center;
  font-size: 15px;
}

.further a {
  color: rgba(139, 74, 59, 0.50);
  text-decoration: none;
  transition: color 0.4s ease;
}

.further a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.name {
  margin: 5.5rem 0 0;
  font-size: 18px;
  color: rgba(232, 223, 207, 0.60);
}

.email {
  margin: 4rem 0 0;
  font-size: 13.5px;
  color: rgba(232, 223, 207, 0.25);
}

/* --- Fragments page --------------------------------------------- */

.fragment {
  margin: 0;
}

/* The break between fragments: the same diamond, quieter, centred in
   the whitespace. Its top/bottom margin makes the gap. */
.fragment-break {
  margin: 2.75rem 0;
  text-align: center;
  font-size: 0.9rem;
  color: rgba(139, 74, 59, 0.30);
}

.back {
  margin: 7rem 0 2rem;
  text-align: center;
  font-size: 14px;
}

.back a {
  color: rgba(139, 74, 59, 0.40);
  text-decoration: none;
  transition: color 0.4s ease;
}

.back a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

/* --- Quotes page ------------------------------------------------ */

.quote {
  margin: 0;
  font-style: italic;
}

/* One hand behind all the quotes — attributed once, at the end. */
.attribution {
  margin: 4.5rem 0 0;
  font-style: normal;
  font-size: 16px;
  text-align: right;
  color: rgba(232, 223, 207, 0.55);
}

/* --- Fore-edge tabs --------------------------------------------- *
   A thin strip of words fixed to the right edge, set vertically like
   the sections of a book read down its spine. Faint until the reader
   looks for them; the page you are on is marked in the accent color.
   A hairline to their left reads as the edge of the gathered pages.  */

.edge {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  z-index: 2;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  line-height: 1;
  padding-left: 0.45rem;
  border-left: 1px solid rgba(139, 74, 59, 0.18);
}

.edge a {
  display: inline-block;
  padding: 0.85rem 0.4rem;
  font-size: 13px;
  letter-spacing: 0.18em;
  color: rgba(232, 223, 207, 0.24);
  text-decoration: none;
  transition: color 0.45s ease;
}

.edge a:hover,
.edge a:focus-visible {
  color: var(--accent);
}

.edge a[aria-current="page"] {
  color: rgba(139, 74, 59, 0.60);
}

/* --- Mobile ----------------------------------------------------- */

@media (max-width: 600px) {
  html {
    font-size: 18px;
  }

  main {
    padding: 12vh 1.35rem;
  }

  .dropcap {
    font-size: 4.8rem;
  }

  /* Keep the spine thin and clear of the text column on small screens. */
  .edge a {
    font-size: 12px;
    padding: 0.7rem 0.3rem;
    letter-spacing: 0.14em;
  }
}
