:root {
  --ink: #1a2233;
  --ink-soft: #3b4658;
  --paper: #f1f0ea;
  --paper-2: #e3e5e0;
  --line: #c7ccc8;
  --accent: #8e3b3b;
  --brass: #a98545;
  --muted: #5f6a73;
  --dark: #111827;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, "PT Serif", Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --wrap: 1200px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(2rem, 3.2vw, 2.9rem);
}

h3 {
  font-size: 1.15rem;
  line-height: 1.25;
}

p {
  margin: 0 0 1.1em;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--ink);
}

img,
svg {
  display: block;
  max-width: 100%;
}

::selection {
  background: #d8c7a8;
  color: var(--ink);
}

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

.wrap {
  width: min(var(--wrap), 100% - 48px);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  z-index: 20;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

.skip-link:focus {
  left: 12px;
  color: var(--paper);
}

/* Header */

.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.topbar-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  min-height: 84px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  justify-self: start;
}

.brand:hover {
  color: var(--accent);
}

.brand-mark {
  width: 36px;
  height: 36px;
  color: var(--accent);
}

.brand-name {
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1;
  letter-spacing: -0.02em;
}

.brand-name span {
  display: block;
  margin-top: 4px;
  font-family: var(--sans);
  font-size: 0.66rem;
  font-weight: 500;
  color: var(--muted);
}

.nav {
  display: flex;
  gap: 26px;
  font-size: 0.95rem;
  justify-self: center;
}

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

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.top-note {
  justify-self: end;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: right;
}

.top-note a {
  color: var(--ink);
  text-decoration: none;
}

.top-note a:hover {
  color: var(--accent);
}

/* Hero */

.hero {
  padding: 74px 0 92px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.35), transparent 55%),
    var(--paper);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(320px, 0.98fr);
  gap: 56px;
  align-items: center;
}

.hero-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
}

.hero-kicker::before {
  content: "";
  width: 34px;
  height: 2px;
  background: var(--accent);
  flex: 0 0 auto;
}

.hero h1 {
  font-size: clamp(3rem, 6.6vw, 6rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
}

.hero-lead {
  max-width: 52ch;
  margin: 26px 0 30px;
  color: var(--ink-soft);
  font-size: 1.07rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
}

.button {
  display: inline-block;
  padding: 14px 22px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  border-radius: 2px;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.button:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.button-light {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--dark);
}

.button-light:hover {
  background: #d8c7a8;
  border-color: #d8c7a8;
  color: var(--dark);
}

.text-link {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--brass);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.text-link:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* Shelf */

.shelf {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  min-height: 360px;
  padding: 24px 8px 30px;
  border-bottom: 2px solid var(--line);
  position: relative;
}

.shelf::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 28px;
  height: 1px;
  background: rgba(26, 34, 51, 0.08);
}

.shelf-book {
  width: var(--w, 118px);
  height: var(--h, 280px);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg, #1a2233);
  color: var(--fg, #f1f0ea);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 16px 28px rgba(17, 24, 39, 0.16);
  transform: rotate(var(--r, 0deg));
  transform-origin: bottom center;
}

.shelf-book span {
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.18;
}

.shelf-book small {
  font-size: 0.68rem;
  line-height: 1.3;
  opacity: 0.8;
}

.shelf-book em {
  font-style: normal;
  font-size: 0.58rem;
  opacity: 0.65;
}

.shelf-book:nth-child(1) {
  --r: -3deg;
  --h: 300px;
  --w: 124px;
}

.shelf-book:nth-child(2) {
  --r: 1deg;
  --h: 340px;
  --w: 138px;
}

.shelf-book:nth-child(3) {
  --r: 3.5deg;
  --h: 270px;
  --w: 116px;
}

/* Sections */

.section {
  padding: 84px 0;
}

.section-tight {
  padding-top: 28px;
}

.section-tinted {
  background: var(--paper-2);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 48px;
  align-items: end;
  margin-bottom: 34px;
}

.section-head p {
  max-width: 46ch;
  color: var(--muted);
}

/* Books */

.book-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
}

.book-card a {
  display: block;
  color: var(--ink);
  text-decoration: none;
}

.book-cover {
  aspect-ratio: 3 / 4;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg, #1a2233);
  color: var(--fg, #f1f0ea);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 8px 8px 0 rgba(17, 24, 39, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.book-card a:hover .book-cover {
  transform: translateY(-5px);
  box-shadow: 10px 14px 0 rgba(17, 24, 39, 0.1);
}

.cover-title {
  font-family: var(--serif);
  font-size: 1.32rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.cover-author {
  font-size: 0.74rem;
  line-height: 1.3;
  opacity: 0.82;
}

.cover-imprint {
  font-size: 0.6rem;
  opacity: 0.6;
}

.book-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  font-size: 0.9rem;
}

.book-meta .genre {
  color: var(--muted);
}

.book-meta .price {
  font-weight: 600;
  white-space: nowrap;
}

/* Shelf categories */

.shelf-list {
  border-bottom: 1px solid var(--line);
}

.shelf-row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) auto;
  gap: 24px;
  align-items: baseline;
  padding: 18px 4px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.shelf-row:hover {
  background: var(--paper-2);
  color: var(--ink);
}

.shelf-row strong {
  font-family: var(--serif);
  font-size: 1.22rem;
  font-weight: 400;
}

.shelf-row span {
  color: var(--muted);
  font-size: 0.94rem;
}

.shelf-row em {
  font-style: normal;
  color: var(--brass);
  font-size: 0.88rem;
  white-space: nowrap;
}

/* About band */

.about-band {
  padding: 84px 0;
  background: var(--dark);
  color: var(--paper);
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 56px;
  align-items: start;
}

.about-band h2 {
  color: var(--paper);
  font-size: clamp(2rem, 3.4vw, 3.1rem);
}

.about-band p {
  color: #c3cbd5;
  max-width: 58ch;
}

.quote {
  margin: 0 0 26px;
  padding-left: 22px;
  border-left: 2px solid var(--brass);
  color: var(--paper);
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  line-height: 1.3;
}

/* Invite */

.invite {
  padding: 66px 0;
  background: #d8c7a8;
}

.invite-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.invite h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
}

.invite p {
  max-width: 50ch;
  margin-top: 10px;
  color: var(--ink-soft);
}

/* Page head */

.page-head {
  padding: 72px 0 42px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.page-head h1 {
  font-size: clamp(2.8rem, 5.2vw, 4.6rem);
  letter-spacing: -0.04em;
}

.page-head p:last-child {
  max-width: 58ch;
  margin-top: 18px;
  color: var(--ink-soft);
}

/* Catalog */

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 34px 28px;
}

.catalog-note {
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

/* Prose / about page */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 56px;
  align-items: start;
}

.prose p {
  max-width: 68ch;
}

.prose h2 {
  margin: 36px 0 14px;
  font-size: 1.7rem;
}

.prose h2:first-child {
  margin-top: 0;
}

.side-card {
  padding: 24px 24px 8px;
  border-top: 3px solid var(--accent);
  background: var(--paper-2);
}

.side-card dl {
  margin: 0;
}

.side-card div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.side-card dt {
  color: var(--muted);
  font-size: 0.9rem;
}

.side-card dd {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.12rem;
  text-align: right;
}

.principles {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.principles li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
}

/* Delivery / contacts */

.cards-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.info-card {
  padding: 22px 0 0;
  border-top: 2px solid var(--ink);
}

.info-card h3 {
  margin-bottom: 10px;
}

.info-card p {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.contact-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px;
}

.contact-item h2 {
  margin-bottom: 8px;
  font-size: 1.6rem;
}

.contact-item a {
  color: var(--ink);
  text-decoration: none;
  font-size: 1.05rem;
}

.contact-item a:hover {
  color: var(--accent);
}

.contact-item p {
  color: var(--muted);
  font-size: 0.94rem;
}

/* 404 */

.not-found {
  padding: 110px 0 130px;
}

.not-found h1 {
  font-size: clamp(2.8rem, 6vw, 5rem);
}

.not-found p {
  max-width: 48ch;
  margin-top: 20px;
  color: var(--ink-soft);
}

/* Footer */

.footer {
  padding: 56px 0 26px;
  background: var(--dark);
  color: #b9c3cf;
  font-size: 0.94rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.7fr) minmax(0, 1fr);
  gap: 40px;
  padding-bottom: 40px;
}

.footer .brand {
  color: var(--paper);
}

.footer .brand:hover {
  color: #d8c7a8;
}

.footer .brand-name span {
  color: #8c9aa8;
}

.footer-note {
  max-width: 34ch;
  color: #8c9aa8;
}

.footer-label {
  margin-bottom: 12px;
  color: #8c9aa8;
  font-size: 0.88rem;
  font-weight: 600;
}

.footer-grid > div:not(:first-child) a,
.footer-grid > div:not(:first-child) p {
  display: block;
  margin: 0 0 8px;
  color: #c3cbd5;
  text-decoration: none;
}

.footer-grid > div:not(:first-child) a:hover {
  color: #d8c7a8;
  text-decoration: underline;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: #8c9aa8;
  font-size: 0.86rem;
}

.footer-bottom a {
  color: #8c9aa8;
}

.footer-bottom a:hover {
  color: var(--paper);
}

.footer-bottom-solo {
  border-top: 0;
  padding-top: 0;
}

/* Responsive */

@media (max-width: 1020px) {
  .hero-grid,
  .section-head,
  .about-grid,
  .split {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .book-grid,
  .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shelf {
    max-width: 520px;
    margin-inline: auto;
  }

  .cards-3,
  .contact-list {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .shelf-row {
    grid-template-columns: 180px minmax(0, 1fr) auto;
  }
}

@media (max-width: 760px) {
  .topbar-inner {
    grid-template-columns: 1fr auto;
    gap: 12px 20px;
    padding: 14px 0;
  }

  .nav {
    grid-column: 1 / -1;
    justify-self: start;
    gap: 18px;
    font-size: 0.9rem;
  }

  .top-note {
    font-size: 0.82rem;
  }

  .hero {
    padding: 48px 0 64px;
  }

  .hero h1 {
    font-size: clamp(2.7rem, 13vw, 4.2rem);
  }

  .hero-lead {
    font-size: 1rem;
  }

  .shelf {
    min-height: 300px;
    gap: 6px;
  }

  .shelf-book {
    --w: 96px;
    --h: 230px;
    padding: 12px 10px;
  }

  .shelf-book:nth-child(1) {
    --w: 100px;
    --h: 250px;
  }

  .shelf-book:nth-child(2) {
    --w: 108px;
    --h: 280px;
  }

  .shelf-book:nth-child(3) {
    --w: 94px;
    --h: 220px;
  }

  .section {
    padding: 58px 0;
  }

  .section-head {
    gap: 18px;
    margin-bottom: 24px;
  }

  .book-grid,
  .catalog-grid {
    gap: 24px 16px;
  }

  .book-cover {
    padding: 12px 10px;
  }

  .cover-title {
    font-size: 1.05rem;
  }

  .book-meta {
    font-size: 0.82rem;
  }

  .shelf-row {
    grid-template-columns: 1fr auto;
    gap: 4px 16px;
    padding: 14px 2px;
  }

  .shelf-row span {
    grid-column: 1 / -1;
  }

  .invite-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 22px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 8px;
  }

  .not-found {
    padding: 72px 0 90px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
