/* Полка. Собрано вручную, без фреймворков. */

:root {
  --paper:      #E6E1D3;
  --paper-deep: #D6CFBB;
  --ink:        #221F19;
  --cloth:      #2B4034;
  --oxblood:    #6E2A28;
  --foil:       #A8862C;
  --muted:      #6B6659;

  --measure: 34rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "PT Serif", Georgia, "Times New Roman", serif;
  font-size: 1.0625rem;
  line-height: 1.72;
  text-rendering: optimizeLegibility;
}

/* Едва заметная фактура бумаги */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .5;
  background-image:
    radial-gradient(circle at 17% 32%, rgba(107,102,89,.05) 0 1px, transparent 1px),
    radial-gradient(circle at 73% 68%, rgba(107,102,89,.04) 0 1px, transparent 1px),
    radial-gradient(circle at 41% 84%, rgba(107,102,89,.05) 0 1px, transparent 1px);
  background-size: 37px 37px, 53px 53px, 71px 71px;
}

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

/* ---------- Шапка ---------- */

.top {
  border-bottom: 1px solid rgba(34,31,25,.18);
  background: var(--paper);
}

.top-inner {
  max-width: 60rem;
  margin: 0 auto;
  padding: 1.6rem 1.5rem 1.1rem;
}

.sitename {
  font-family: "Old Standard TT", Georgia, serif;
  font-size: 1.5rem;
  letter-spacing: .02em;
  margin: 0 0 .1rem;
  font-weight: 700;
}

.sitename a { color: var(--ink); text-decoration: none; }
.sitename a:hover { color: var(--oxblood); }

.tagline {
  margin: 0 0 1.1rem;
  color: var(--muted);
  font-size: .93rem;
  font-style: italic;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .1rem 1.4rem;
  font-size: .95rem;
}

nav a {
  color: var(--ink);
  text-decoration: none;
  padding-bottom: .15rem;
  border-bottom: 1px solid transparent;
}

nav a:hover { border-bottom-color: var(--foil); }

nav a[aria-current="page"] {
  border-bottom-color: var(--oxblood);
  color: var(--oxblood);
}

/* ---------- Общая раскладка ---------- */

main {
  max-width: 60rem;
  margin: 0 auto;
  padding: 2.6rem 1.5rem 4rem;
}

.prose { max-width: var(--measure); }

h1 {
  font-family: "Old Standard TT", Georgia, serif;
  font-size: 2.15rem;
  line-height: 1.18;
  font-weight: 700;
  margin: 0 0 1.2rem;
  letter-spacing: .005em;
}

h2 {
  font-family: "Old Standard TT", Georgia, serif;
  font-size: 1.42rem;
  line-height: 1.28;
  font-weight: 700;
  margin: 2.6rem 0 .7rem;
}

h3 {
  font-family: "Old Standard TT", Georgia, serif;
  font-size: 1.12rem;
  margin: 1.9rem 0 .4rem;
  font-weight: 700;
}

p { margin: 0 0 1.05rem; }

a { color: var(--oxblood); }
a:hover { color: var(--foil); }

:focus-visible {
  outline: 2px solid var(--oxblood);
  outline-offset: 3px;
}

.lead {
  font-size: 1.16rem;
  line-height: 1.62;
}

blockquote {
  margin: 1.6rem 0;
  padding-left: 1.1rem;
  border-left: 3px solid var(--foil);
  font-style: italic;
  color: #3A362D;
}

ul.plain { padding-left: 1.15rem; }
ul.plain li { margin-bottom: .4rem; }

hr {
  border: 0;
  border-top: 1px solid rgba(34,31,25,.18);
  margin: 3rem 0;
}

/* ---------- Полка на главной ---------- */

.shelf-block {
  background: var(--paper-deep);
  border-top: 1px solid rgba(34,31,25,.12);
  border-bottom: 1px solid rgba(34,31,25,.12);
  padding: 2.4rem 0 0;
  overflow: hidden;
}

.shelf {
  max-width: 60rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.spine {
  flex: 0 0 auto;
  border-radius: 1px 3px 3px 1px;
  color: #EFE9D8;
  font-family: "Old Standard TT", Georgia, serif;
  font-size: .72rem;
  letter-spacing: .03em;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  padding: 2.2rem .1rem 1.4rem;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  box-shadow: inset -3px 0 6px rgba(0,0,0,.28), inset 2px 0 2px rgba(255,255,255,.07);
  transform-origin: bottom center;
}

.spine span { display: block; }

.spine .yr {
  font-size: .6rem;
  color: rgba(239,233,216,.55);
  margin-top: .75rem;
  letter-spacing: .08em;
}

/* Золотые полоски тиснения */
.spine::before,
.spine::after {
  content: "";
  position: absolute;
}

.spine {
  position: relative;
}

.spine::before {
  top: 1.15rem; left: 12%; right: 12%;
  height: 1px;
  background: rgba(168,134,44,.75);
}

.spine::after {
  bottom: .75rem; left: 12%; right: 12%;
  height: 1px;
  background: rgba(168,134,44,.75);
}

.shelf-board {
  max-width: 60rem;
  margin: 0 auto;
  height: 12px;
  background: linear-gradient(#8A6E45, #6E5637);
  box-shadow: 0 6px 12px rgba(34,31,25,.25);
}

.shelf-caption {
  max-width: 60rem;
  margin: 0 auto;
  padding: .8rem 1.5rem 1.6rem;
  color: var(--muted);
  font-size: .86rem;
  font-style: italic;
}

@keyframes settle {
  from { transform: translateY(14px) rotate(-1.2deg); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: no-preference) {
  .spine { animation: settle .5s cubic-bezier(.22,.75,.3,1) backwards; }
  .spine:nth-child(1) { animation-delay: .00s; }
  .spine:nth-child(2) { animation-delay: .06s; }
  .spine:nth-child(3) { animation-delay: .12s; }
  .spine:nth-child(4) { animation-delay: .18s; }
  .spine:nth-child(5) { animation-delay: .24s; }
  .spine:nth-child(6) { animation-delay: .30s; }
  .spine:nth-child(7) { animation-delay: .36s; }
  .spine:nth-child(8) { animation-delay: .42s; }
  .spine:nth-child(9) { animation-delay: .48s; }
}

/* ---------- Карточки серий и издательств ---------- */

.entry {
  padding: 1.5rem 0;
  border-bottom: 1px solid rgba(34,31,25,.15);
  max-width: 46rem;
}

.entry:last-of-type { border-bottom: 0; }

.entry h2 { margin-top: 0; margin-bottom: .15rem; }

.entry-meta {
  color: var(--muted);
  font-size: .88rem;
  margin: 0 0 .7rem;
}

.entry-meta b {
  font-weight: 400;
  color: var(--ink);
}

.swatch {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 2px;
  margin-right: .45rem;
  vertical-align: baseline;
  border: 1px solid rgba(0,0,0,.25);
}

/* ---------- Список заметок ---------- */

.note-list { list-style: none; padding: 0; margin: 0; max-width: 46rem; }

.note-list li {
  padding: 1.1rem 0;
  border-bottom: 1px solid rgba(34,31,25,.15);
}

.note-list h2 { font-size: 1.18rem; margin: 0 0 .2rem; }
.note-list a { text-decoration: none; }
.note-list a:hover { text-decoration: underline; }

.note-date {
  color: var(--muted);
  font-size: .84rem;
  display: block;
  margin-bottom: .35rem;
}

/* ---------- Табличка ---------- */

table {
  border-collapse: collapse;
  width: 100%;
  max-width: 46rem;
  font-size: .95rem;
  margin: 1.4rem 0;
}

th, td {
  text-align: left;
  padding: .55rem .8rem .55rem 0;
  border-bottom: 1px solid rgba(34,31,25,.15);
  vertical-align: top;
}

th {
  font-family: "Old Standard TT", Georgia, serif;
  font-weight: 700;
  border-bottom-color: rgba(34,31,25,.4);
}

/* ---------- Подвал ---------- */

footer {
  border-top: 1px solid rgba(34,31,25,.18);
  background: var(--paper-deep);
}

.foot-inner {
  max-width: 60rem;
  margin: 0 auto;
  padding: 1.6rem 1.5rem 2.4rem;
  color: var(--muted);
  font-size: .88rem;
}

.foot-inner p { margin: 0 0 .35rem; }

/* ---------- Мобильные ---------- */

@media (max-width: 640px) {
  body { font-size: 1rem; }
  h1 { font-size: 1.72rem; }
  h2 { font-size: 1.26rem; }
  .lead { font-size: 1.08rem; }
  main { padding: 2rem 1.2rem 3rem; }
  .top-inner { padding: 1.3rem 1.2rem .9rem; }
  .shelf { padding: 0 1.2rem; }
  .shelf-caption { padding: .8rem 1.2rem 1.4rem; }
  nav ul { gap: .35rem 1.1rem; font-size: .9rem; }
}
