/* ==========================================================================
   Plainwell Press — "Lab Paper" stylesheet
   Structure follows the Inkling Yokai Press "Ink & Ember" design (online
   branch); theme reworked for the nonfiction imprint: cool lab paper,
   graphite-blue ink, petrol accent, signal-orange highlights, graph grid.
   ========================================================================== */

:root {
  --paper:     #f4f4f1;
  --paper-2:   #eaebe6;
  --ink:       #1d2733;
  --ink-2:     #2e3c4a;
  --dim:       #55636f;
  --faint:     rgba(29, 39, 51, .55);
  --hairline:  rgba(29, 39, 51, .14);
  --lab:       #2e5e6e;
  --lab-hot:   #4d8aa0;
  --signal:    #d96e30;
  --serif-display: "Fraunces", Georgia, serif;
  --serif-body:    "Spectral", Georgia, serif;
  --mono:          "IBM Plex Mono", "Courier New", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background:
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(29, 39, 51, .045) 31px 32px),
    repeating-linear-gradient(90deg, transparent 0 31px, rgba(29, 39, 51, .045) 31px 32px),
    var(--paper);
  color: var(--ink);
  font-family: var(--serif-body);
  font-weight: 300;
  line-height: 1.72;
  overflow-x: hidden;
}

/* ---------- atmosphere ---------- */

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
  mix-blend-mode: multiply;
  opacity: .06;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .45;
}
.glow--lab  { width: 52vmax; height: 52vmax; top: -18vmax; left: 50%; transform: translateX(-78%);
  background: radial-gradient(closest-side, rgba(46, 94, 110, .16), transparent 70%); }
.glow--linen { width: 46vmax; height: 46vmax; top: 118%; right: -16vmax;
  background: radial-gradient(closest-side, rgba(190, 198, 200, .35), transparent 70%); }
.glow--signal  { width: 40vmax; height: 40vmax; top: 62%; left: -14vmax;
  background: radial-gradient(closest-side, rgba(217, 110, 48, .12), transparent 70%); }

.wisp {
  position: absolute;
  width: 64vmax;
  height: 22vmax;
  border-radius: 50%;
  filter: blur(70px);
  will-change: transform;
}
.wisp--1 {
  top: 8%;  left: -10%;
  background: radial-gradient(closest-side, rgba(77, 138, 160, .12), transparent);
  animation: drift-a 44s ease-in-out infinite alternate;
}
.wisp--2 {
  top: 46%; right: -18%;
  background: radial-gradient(closest-side, rgba(217, 110, 48, .08), transparent);
  animation: drift-b 56s ease-in-out infinite alternate;
}
@keyframes drift-a { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(9vw,-6vh,0) scale(1.15); } }
@keyframes drift-b { from { transform: translate3d(0,0,0) scale(1.1); } to { transform: translate3d(-8vw,8vh,0) scale(.94); } }

/* skip link: off-screen until focused */
.skip {
  position: fixed;
  top: .9rem;
  left: .9rem;
  z-index: 100;
  padding: .8em 1.5em;
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--lab);
  transform: translateY(calc(-100% - 1.2rem));
  transition: transform .2s ease;
}
.skip:focus { transform: none; }

/* ---------- shared shell ---------- */

.shell { position: relative; z-index: 1; }

.wrap { width: min(1100px, 92vw); margin-inline: auto; }

section { padding-block: clamp(4rem, 10vh, 7rem); }

.kicker {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--lab);
}
.kicker::before {
  content: "";
  display: inline-block;
  width: 26px; height: 1px;
  background: var(--lab);
  vertical-align: middle;
  margin-right: .8em;
}

.orn {
  display: flex;
  align-items: center;
  gap: 0;
  width: min(420px, 70vw);
  margin-inline: auto;
  height: 9px;
  color: var(--lab);
  font-size: 1.05rem;
  line-height: 1;
}
/* measurement-scale ornament: ruler ticks instead of a decorative glyph */
.orn::before, .orn::after {
  content: "";
  flex: 1;
  height: 100%;
  background:
    repeating-linear-gradient(90deg,
      var(--hairline) 0 1px, transparent 1px 12px);
}
.orn::before { border-bottom: 1px solid var(--hairline); }
.orn::after  { border-bottom: 1px solid var(--hairline); }
.orn > * { display: none; }

/* ---------- top bar ---------- */

.topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1.6rem clamp(1.2rem, 4vw, 3rem);
}
.monogram {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  font-family: var(--serif-display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: .28em;
  color: var(--ink);
  text-decoration: none;
}
.monogram-mark {
  width: 30px;
  height: 30px;
  color: var(--ink);
  flex-shrink: 0;
}
.monogram em { font-style: normal; color: var(--lab-hot); }
.topbar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
}
.topbar nav a {
  font-family: var(--mono);
  font-size: .66rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--dim);
  transition: color .25s ease;
}
.topbar nav a:hover { color: var(--ink); }

/* ---------- masthead ---------- */

.masthead {
  min-height: 96vh;
  display: grid;
  place-items: center;
  position: relative;
  text-align: center;
}
.masthead-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
  padding: 6rem 1.5rem 0;
}
.rail {
  position: absolute;
  top: 50%;
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}
.rail--left  { left: clamp(1rem, 3vw, 2.5rem); transform: rotate(180deg) translateY(50%); writing-mode: vertical-rl; }
.rail--right { right: clamp(1rem, 3vw, 2.5rem); transform: translateY(50%); writing-mode: vertical-rl; }
.rail-mark { font-size: .9rem; color: var(--lab); }

.wordmark-kicker { color: var(--lab); }
.wordmark-kicker::before { display: none; }

.wordmark {
  font-family: var(--serif-display);
  font-weight: 300;
  font-size: clamp(2.8rem, 8vw, 6rem);
  line-height: 1.02;
  letter-spacing: -.015em;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.wordmark-main { font-variation-settings: "opsz" 144; }
.press-word {
  font-family: var(--mono);
  font-size: .8rem;
  letter-spacing: .55em;
  text-transform: uppercase;
  color: var(--dim);
  margin-top: .9rem;
  margin-left: .55em;
}

.tagline {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  font-style: italic;
  color: var(--ink-2);
  max-width: 34ch;
}

.genres {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  justify-content: center;
  list-style: none;
}
.genres li {
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding: .45em 1em;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: rgba(255, 255, 255, .45);
}

.scroll-cue {
  margin-top: 1.6rem;
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--dim);
  transition: color .25s ease;
}
.scroll-cue:hover { color: var(--lab); }
.scroll-cue .arrow { display: inline-block; margin-left: .5em; }

/* ---------- rise-in animation (masthead) ---------- */

.js [data-rise] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .8s ease, transform .8s ease;
}
.js [data-rise].is-in { opacity: 1; transform: none; }
.js [data-rise]:nth-child(2) { transition-delay: .1s; }
.js [data-rise]:nth-child(3) { transition-delay: .2s; }
.js [data-rise]:nth-child(4) { transition-delay: .3s; }
.js [data-rise]:nth-child(5) { transition-delay: .4s; }
.js [data-rise]:nth-child(6) { transition-delay: .5s; }

/* ---------- scroll reveal (sections) ---------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .9s ease, transform .9s ease;
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- manifesto ---------- */

.manifesto .lede {
  font-family: var(--serif-display);
  font-weight: 300;
  font-size: clamp(1.5rem, 3.4vw, 2.3rem);
  line-height: 1.35;
  max-width: 26ch;
  margin-top: 1.4rem;
}
.manifesto .sub {
  max-width: 62ch;
  margin-top: 1.4rem;
  color: var(--ink-2);
  font-size: 1.05rem;
}
.manifesto .sub a { color: var(--lab); }

/* ---------- books ---------- */

.books-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.2rem;
  margin-bottom: 2.6rem;
}
.section-title {
  font-family: var(--serif-display);
  font-weight: 300;
  font-size: clamp(1.9rem, 4.4vw, 2.9rem);
  line-height: 1.15;
  margin-top: .8rem;
}
.books-note {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
}

.books-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.6rem;
}

.book-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .8rem;
  padding: 2.4rem 2.2rem 2.2rem;
  background: rgba(255, 255, 255, .55);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  box-shadow: 0 14px 40px rgba(34, 48, 42, .08);
}
.book-card--garden { background: rgba(255, 255, 255, .4); }

.book-numeral {
  position: absolute;
  top: 1.1rem;
  right: 1.6rem;
  font-family: var(--serif-display);
  font-size: 2.6rem;
  font-weight: 300;
  color: var(--lab);
  opacity: .35;
  line-height: 1;
}
.book-label {
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--lab);
}
.book-card h3 {
  font-family: var(--serif-display);
  font-weight: 400;
  font-size: 1.7rem;
  line-height: 1.2;
}
.book-author {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dim);
}
.book-epithet {
  font-size: .98rem;
  color: var(--ink-2);
}
.book-epithet em { color: var(--lab); font-style: italic; }

.book-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: auto;
  padding-top: 1rem;
}
.book-tags li {
  font-family: var(--mono);
  font-size: .58rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dim);
  padding: .4em .9em;
  border: 1px solid var(--hairline);
  border-radius: 999px;
}

/* ---------- feature ---------- */

.feature-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.plate-wrap { position: relative; }
.plate {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  box-shadow: 0 18px 50px rgba(34, 48, 42, .12);
}
.plate img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
.plate figcaption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 1rem 1.2rem;
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(to top, rgba(34, 48, 42, .75), transparent);
}
.stamp {
  position: absolute;
  top: -1.1rem;
  right: -1rem;
  font-family: var(--mono);
  font-size: .6rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #fff;
  background: var(--signal);
  padding: .55em 1.1em;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(217, 110, 48, .3);
  transform: rotate(3deg);
}

.feature-copy h2 {
  font-family: var(--serif-display);
  font-weight: 300;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 1.2;
  margin-top: 1rem;
}
.feature-copy h2 em { color: var(--lab); }
.feature-copy .body {
  margin-top: 1.3rem;
  color: var(--ink-2);
  font-size: 1.05rem;
  max-width: 46ch;
}

/* ---------- colophon ---------- */

.colophon {
  border-top: 1px solid var(--hairline);
  padding-block: 3rem;
  background: rgba(255, 255, 255, .35);
}
.byline {
  max-width: 60ch;
  color: var(--ink-2);
  font-size: .95rem;
}
.byline a { color: var(--lab); }
.fineprint {
  margin-top: 1.6rem;
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .1em;
  color: var(--dim);
}

/* ---------- subheader (legal etc.) ---------- */

.subheader {
  min-height: 56vh;
  display: grid;
  place-items: center;
  text-align: center;
  position: relative;
  padding-top: 7rem;
  padding-bottom: 2.5rem;
}
.subheader-inner { display: flex; flex-direction: column; align-items: center; }
.subheader .kicker {
  color: var(--dim);
}
.subheader .kicker::before { display: none; }
.subheader h1 {
  font-family: var(--serif-display);
  font-optical-sizing: auto;
  font-style: italic;
  font-weight: 480;
  font-size: clamp(2.5rem, 7vw, 4.6rem);
  letter-spacing: -.015em;
  line-height: .98;
  margin-top: 1rem;
  text-shadow: 0 0 90px rgba(46, 94, 110, .22);
}
.subheader-inner > :nth-child(1) { --i: 0; }
.subheader-inner > :nth-child(2) { --i: 1; }
.subheader-inner > :nth-child(3) { --i: 2; }

/* long-form prose (legal etc.) */
.prose {
  max-width: 70ch;
  margin-inline: auto;
}
.prose h2 {
  font-family: var(--serif-display);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: clamp(1.35rem, 2.6vw, 1.65rem);
  line-height: 1.15;
  letter-spacing: -.005em;
  margin-top: 3.2rem;
  padding-top: 1.7rem;
  border-top: 1px solid var(--hairline);
}
.prose h2::before {
  content: "";
  display: inline-block;
  width: 20px;
  height: 1px;
  background: var(--lab);
  vertical-align: middle;
  margin-right: .65em;
}
.prose h2:first-of-type {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}
.prose p {
  margin-top: 1.15rem;
  font-size: 1rem;
  color: var(--dim);
}
.prose strong { color: var(--ink); font-weight: 500; }
.prose a {
  color: var(--lab-hot);
  text-decoration: underline;
  text-decoration-color: rgba(109, 143, 124, .45);
  text-underline-offset: 3px;
  transition: color .25s ease, text-decoration-color .25s ease;
}
.prose a:hover {
  color: var(--ink);
  text-decoration-color: currentColor;
}

/* ---------- responsive ---------- */

@media (max-width: 760px) {
  .feature-grid { grid-template-columns: 1fr; }
  .rail { display: none; }
  .topbar { padding: 1.2rem 1.2rem; }
  .topbar nav { gap: .9rem; }
  .books-grid { grid-template-columns: 1fr; }
}
