/* Essay pages: one quiet reading column floating in a dim, still night sky. */

@font-face {
  font-family: 'Glue';
  src: url('../Glue-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --text: #ededed;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --pink: rgb(234,72,152);
  /* the reading page: like an email opened in Gmail's dark theme, a light sheet inside the dark */
  --ink: #202124;          /* Gmail's text colour */
  --ink-soft: #5f6368;     /* Gmail's secondary text */
  --pink-ink: #c2185b;     /* the brand pink, deepened so it reads on white */
}

* { box-sizing: border-box; }

html { background-color: #060606; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 18%, rgba(255,255,255,0.04), transparent 28%),
    radial-gradient(circle at 72% 32%, rgba(35,79,135,0.08), transparent 22%),
    radial-gradient(circle at 24% 74%, rgba(255,255,255,0.03), transparent 26%),
    linear-gradient(180deg, #040404 0%, #060606 35%, #080808 100%);
  background-attachment: fixed;
  color: var(--text);
}

#sky {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
}

/* ── top bar ───────────────────────────────────── */

.essay-nav {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.75rem 2rem 0;
}

.home-link {
  font: 400 0.75rem var(--mono);
  letter-spacing: 0.16em;
  text-transform: lowercase;
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  transition: color 0.25s ease;
}
.home-link:hover { color: rgba(255,255,255,0.95); }

.section-link {
  font-family: 'Glue', sans-serif;
  font-size: 2rem;
  line-height: 1;
  color: var(--pink);
  text-decoration: none;
  filter: drop-shadow(0 0 12px color-mix(in srgb, currentColor 35%, transparent));
}

/* ── the essay, on a very dark gray page floating in the sky ── */

.paper {
  position: relative;
  z-index: 1;
  max-width: 47rem;
  margin: 2.5rem auto 4rem;
  border-radius: 6px;
  border: 0;
  /* a cool gray frame around the page, with a faint grain: the night sky's tone, lightened */
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"), #dfe3e8;
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(0,0,0,0.5);
}

/* the warm mat is just a thin frame; the white sheet fills it, art and all */
.essay { padding: 12px 12px 0; }

/* the cover sits on a plate, like the art on the homepage */
.essay-cover {
  display: block;
  width: 100%;
  border-radius: 7px;
  border: 0;
  box-shadow: 0 18px 36px -12px rgba(0,0,0,0.35), 0 4px 10px rgba(0,0,0,0.12);
  margin: 0 0 2.75rem;
}

/* the essay itself sits on a white sheet that floats on the warm mat */
.sheet {
  padding: 3.5rem 4.25rem 2.75rem;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(20,30,45,0.06), 0 14px 34px -14px rgba(20,30,45,0.28);
}

.essay-head { margin: 0 0 2.75rem; }

/* the sign-off: a small glue wordmark after the last paragraph */
.end-mark {
  margin: 2.5rem 0 0;
  text-align: center;
  font-family: 'Glue', sans-serif;
  font-size: 1.7rem;
  line-height: 1;
  color: var(--pink-ink);
}

.essay h1 {
  margin: 0 0 0.9rem;
  font-family: 'Literata', Georgia, serif;   /* a sturdy book face: editorial, not decorative */
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: clamp(2rem, 4.6vw, 2.8rem);
  line-height: 1.15;
  color: var(--ink);
}

.essay-meta {
  font: 400 0.72rem var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.essay-body {
  font-family: 'Literata', Georgia, serif;
  font-weight: 400;
  font-size: 1.14rem;
  line-height: 1.7;
  color: #111;   /* black */
}

.essay-body p { margin: 0 0 1.15em; }

.essay-body h2 {
  margin: 2.6rem 0 1rem;
  font-family: 'Literata', Georgia, serif;
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1.3;
  color: #111;
}

.essay-body strong { font-weight: 600; color: var(--ink); }

.essay-body figure { margin: 2rem 0; }
.essay-body figure img {
  display: block;
  max-width: 100%;
  margin: 0 auto;
  border-radius: 3px;
}

/* ── end of essay: neighbours in the same group, and the way back ── */

.essay-end {
  max-width: 40rem;
  margin: 0 auto;
  padding: 0 2rem 3.5rem;
}

.essay-end { padding-top: 2.25rem; }

.neighbours {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.neighbour {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-width: 48%;
  text-decoration: none;
  color: inherit;
}
.neighbour.next { margin-left: auto; text-align: right; }

.neighbour-dir {
  font: 400 0.7rem var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.neighbour-title {
  font: 400 0.95rem/1.45 var(--mono);
  letter-spacing: 0.02em;
  color: var(--ink);
  transition: color 0.25s ease;
}
.neighbour:hover .neighbour-title { color: var(--pink-ink); }

.back {
  font: 400 0.75rem var(--mono);
  letter-spacing: 0.16em;
  text-transform: lowercase;
  color: var(--ink-soft);
  text-decoration: none;
}
.back:hover { color: var(--pink-ink); }

@media (max-width: 700px) {
  .essay-nav { padding: 1.25rem 1.25rem 0; }
  .section-link { font-size: 1.6rem; }
  .paper { margin: 1.5rem 0 0; border-radius: 0; border-width: 1px 0 0; }
  .essay { padding: 8px 8px 0; }
  .sheet { padding: 1.5rem 1.25rem 2rem; }
  .essay-body { font-size: 1.1rem; line-height: 1.7; }
  .essay-end { padding: 1.75rem 1.25rem 3rem; }
  .neighbours { flex-direction: column; }
  .neighbour { max-width: none; }
  .neighbour.next { text-align: left; margin-left: 0; }
}
