/* The Profane Lance — shared site styles */

:root {
  --cream: #eadfc9;
  --paper: #f2eadb;
  --ink: #1a1510;
  --red: #9f1f1d;
  --gold: #b18a4a;
  --black: #090908;
  --rail: 250px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background: #15120e;
}

/* Sidebar */
.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail);
  padding: 34px 32px;
  background: linear-gradient(90deg, #f2e8d4, #e8dcc4);
  border-right: 1px solid #c9b895;
  z-index: 10;
  display: flex;
  flex-direction: column;
}

.crest {
  text-decoration: none;
  color: var(--ink);
  text-align: center;
}

.eagle {
  display: block;
  font-size: 2rem;
  color: #2a2118;
  margin-bottom: 0.55rem;
}

.author {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: 0.72rem;
}

.mini-title {
  display: block;
  font-size: 2rem;
  line-height: 0.92;
  text-transform: uppercase;
  margin: 1.1rem 0 0.65rem;
}

.novel {
  display: block;
  color: var(--red);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.72rem;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid #c9b895;
}

.rail nav {
  display: flex;
  flex-direction: column;
  padding-top: 1.25rem;
}

.rail nav a {
  padding: 0.42rem 0;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.03rem;
}

.rail nav a:hover {
  color: var(--red);
}

.rail-foot {
  margin-top: auto;
  border-top: 1px solid #c9b895;
  padding-top: 1rem;
  font-size: 0.78rem;
  line-height: 1.5;
  color: #6c5f4d;
}

/* Main page frame */
.page {
  margin-left: var(--rail);
  min-height: 100vh;
}

/* Home */
.home-hero {
  min-height: 100vh;
  position: relative;
  background: #080807 url('cover-art.png') center / cover no-repeat;
  overflow: hidden;
}

.shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(5, 5, 4, 0.96) 0%,
    rgba(5, 5, 4, 0.91) 42%,
    rgba(5, 5, 4, 0.25) 69%,
    rgba(5, 5, 4, 0.08) 100%
  );
}

.home-copy {
  position: relative;
  z-index: 2;
  width: min(610px, 54vw);
  padding: 6vh 4.2vw 5vh;
  color: #eee3cf;
  text-shadow: 0 1px 2px #000;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font: 600 0.68rem Arial, sans-serif;
  color: var(--gold);
  margin-bottom: 1rem;
}

.home h1 {
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(4.5rem, 7.5vw, 8.3rem);
  line-height: 0.75;
  letter-spacing: -0.045em;
  margin: 0 0 1rem;
  color: #e9d8b8;
}

.home h1 span {
  font-size: 0.42em;
  display: block;
  letter-spacing: 0.08em;
  margin-bottom: 0.2em;
}

.redline {
  color: #b63b31;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 1rem;
  border-bottom: 1px solid rgba(177, 138, 74, 0.45);
  padding-bottom: 1rem;
  margin-bottom: 1.4rem;
  width: 65%;
}

.blurb {
  max-width: 590px;
  font-size: 1.02rem;
  /* Match the reading pages' actual vertical rhythm while retaining
     the slightly smaller sleeve-copy type size. */
  line-height: 1.96rem;
}

.blurb p {
  margin: 0 0 1.29rem;
}

.actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.6rem;
  flex-wrap: wrap;
}

.button {
  font: 600 0.75rem Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: #d8b36b;
  border: 1px solid #a77b34;
  padding: 0.9rem 1.25rem;
  background: rgba(0, 0, 0, 0.35);
}

.button.primary {
  background: #9f211f;
  color: #fff;
  border-color: #9f211f;
}

/* Reading pages */
.reading {
  background: #17130f url('cover-art.png') center / cover fixed no-repeat;
}

.reading::before {
  content: "";
  position: fixed;
  inset: 0 0 0 var(--rail);
  background: rgba(10, 8, 6, 0.72);
  z-index: -1;
}

.paper {
  width: min(820px, calc(100vw - var(--rail) - 9vw));
  margin: 0 auto;
  padding: 8vh 0 10vh;
  color: #eee3cf;
}

.page-title {
  font-weight: 400;
  font-size: clamp(3rem, 6vw, 5.5rem);
  line-height: 0.94;
  margin: 0.15em 0 0.35em;
  color: #ead9b9;
}

.lede {
  color: #c7bba7;
  font-style: italic;
}

.prose {
  max-width: 690px;
  font-size: 1.12rem;
  line-height: 1.75;
}

.prose p {
  margin: 0 0 1.15em;
}

.prose-page .prose p:first-child::first-letter {
  float: left;
  font-size: 4.2rem;
  line-height: 0.78;
  padding: 0.13em 0.09em 0 0;
  color: #caa65f;
}

/* Table of contents */
.toc {
  list-style: none;
  padding: 0;
  margin: 3rem 0;
  border-top: 1px solid rgba(177, 138, 74, 0.4);
}

.toc li {
  display: grid;
  grid-template-columns: 3rem 1fr auto;
  gap: 1rem;
  padding: 1rem 0.2rem;
  border-bottom: 1px solid rgba(177, 138, 74, 0.28);
  align-items: baseline;
}

.toc li > span {
  font-variant-numeric: tabular-nums;
  color: #a8916a;
}

.toc a,
.toc b {
  color: #eee3cf;
  text-decoration: none;
  font-weight: 400;
  font-size: 1.12rem;
}

.toc a:hover {
  color: #d3a754;
}

.toc small {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font: 600 0.62rem Arial, sans-serif;
  color: #9d8d74;
}

.toc .locked {
  opacity: 0.55;
}

/* Chapter navigation */
.nextprev {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid rgba(177, 138, 74, 0.4);
  padding-top: 1.2rem;
  margin-top: 4rem;
}

.nextprev a {
  color: #d3b77d;
  text-decoration: none;
  font: 600 0.72rem Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Mobile */
@media (max-width: 850px) {
  :root {
    --rail: 0px;
  }

  .rail {
    position: relative;
    width: 100%;
    height: auto;
    padding: 18px 22px;
    display: block;
  }

  .crest {
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.8rem;
  }

  .eagle,
  .author,
  .novel {
    display: none;
  }

  .mini-title {
    font-size: 1.2rem;
    line-height: 1;
    margin: 0;
  }

  .rail nav {
    padding-top: 0.8rem;
    flex-direction: row;
    gap: 1rem;
  }

  .rail-foot {
    display: none;
  }

  .page {
    margin-left: 0;
  }

  .home-copy {
    width: min(92vw, 620px);
    padding: 7vh 6vw;
  }

  .home h1 {
    font-size: clamp(3.8rem, 17vw, 6.5rem);
  }

  .shade {
    background: linear-gradient(
      90deg,
      rgba(5, 5, 4, 0.94),
      rgba(5, 5, 4, 0.7)
    );
  }

  .paper {
    width: min(88vw, 760px);
  }

  .reading::before {
    inset: 0;
  }

  .toc li {
    grid-template-columns: 2.5rem 1fr;
  }

  .toc small {
    grid-column: 2;
  }
}
