:root {
  --ink: #070503;
  --ink-soft: #100b06;
  --brown: #1d1008;
  --brown-soft: #2a170c;
  --gold: #b98a4a;
  --gold-soft: #7b5a32;
  --ivory: #efe2c5;
  --ivory-muted: #bda981;
  --danger: #8f2f1f;
  --line: rgba(185, 138, 74, 0.45);
  --max-width: 1280px;
  --serif: Georgia, "Times New Roman", Times, serif;
  --sans: "Trebuchet MS", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ivory);
  background:
    radial-gradient(circle at 50% 0%, rgba(117, 67, 25, 0.28), transparent 34rem),
    linear-gradient(180deg, #050302 0%, #110906 45%, #070503 100%);
  font-family: var(--serif);
  min-width: 320px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  opacity: 0.09;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 3px 3px;
  mix-blend-mode: overlay;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.container {
  width: min(var(--max-width), calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 15;
  display: grid;
  grid-template-columns: 220px 1fr auto;
  align-items: center;
  gap: 28px;
  padding: 18px 36px;
  border-bottom: 1px solid rgba(185, 138, 74, 0.24);
  background: rgba(5, 3, 2, 0.86);
  backdrop-filter: blur(10px);
}

.brand {
  text-transform: uppercase;
  letter-spacing: 0.11em;
  line-height: 1;
}

.brand__title {
  display: block;
  max-width: 170px;
  color: var(--ivory);
  font-size: 1.38rem;
}

.brand__subtitle {
  display: block;
  margin-top: 7px;
  color: var(--gold);
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
}

.primary-nav {
  display: flex;
  justify-content: center;
  gap: clamp(18px, 3vw, 42px);
  color: var(--ivory-muted);
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.primary-nav li {
  list-style: none;
}

.primary-nav a {
  position: relative;
  padding-block: 8px;
}

.primary-nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--gold);
  transform: translateX(-50%);
  transition: width 180ms ease;
}

.primary-nav a:hover::after,
.primary-nav a:focus-visible::after {
  width: 100%;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.button,
.cart-button,
.nav-toggle {
  border: 1px solid var(--line);
  color: var(--ivory);
  background: rgba(27, 14, 7, 0.72);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 42px;
  padding: 0 20px;
  font-size: 0.72rem;
}

.button:hover,
.button:focus-visible,
.cart-button:hover,
.cart-button:focus-visible,
.nav-toggle:hover,
.nav-toggle:focus-visible {
  border-color: var(--gold);
  color: #fff5dc;
  background: rgba(70, 38, 15, 0.7);
}

.button--outline {
  min-width: 168px;
  background: rgba(5, 3, 2, 0.35);
}

.button--full {
  width: 100%;
}

.cart-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
}

.cart-icon {
  position: relative;
  width: 17px;
  height: 18px;
  border: 1px solid var(--gold);
  border-top: 0;
}

.cart-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  top: -8px;
  width: 7px;
  height: 9px;
  border: 1px solid var(--gold);
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
}

.cart-count {
  position: absolute;
  top: -7px;
  right: -7px;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding-inline: 5px;
  border: 1px solid var(--gold);
  background: var(--ink);
  color: var(--gold);
  font-family: var(--sans);
  font-size: 0.68rem;
}

.nav-toggle {
  display: none;
  min-height: 38px;
  padding: 0 14px;
  font-size: 0.72rem;
}

.hero-library {
  position: relative;
  min-height: 760px;
  overflow: hidden;
  border-bottom: 0;
}

.hero-library__backdrop {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 3, 2, 0.26) 0%, rgba(5, 3, 2, 0.12) 40%, rgba(5, 3, 2, 0.7) 100%),
    radial-gradient(circle at 50% 17%, rgba(0, 0, 0, 0.28), transparent 22rem),
    url("hero-library.png") center top / cover no-repeat,
    #070503;
}

.hero-library__backdrop::before,
.hero-library__backdrop::after {
  display: none;
}

.hero-library__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 72px 0 38px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  color: #f3dfb8;
  font-size: clamp(3.5rem, 8vw, 7.6rem);
  font-weight: 400;
  line-height: 0.84;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 0 30px rgba(185, 138, 74, 0.24);
}

h1 span {
  display: block;
  margin-top: 18px;
  font-size: clamp(1.35rem, 3.2vw, 2.7rem);
  letter-spacing: 0.26em;
}

.hero-library__kicker {
  margin-bottom: 10px;
  color: var(--ivory);
  font-size: clamp(1.05rem, 2vw, 1.55rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.hero-library__copy {
  max-width: 540px;
  margin-bottom: 36px;
  color: var(--ivory-muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.bookshelf-wrap {
  display: none;
}

.bookshelf {
  display: grid;
  grid-template-columns: repeat(10, minmax(82px, 1fr));
  align-items: end;
  min-width: 890px;
  max-width: 1080px;
  margin-inline: auto;
  padding: 0 10px 26px;
  border-bottom: 18px solid #221107;
  box-shadow: 0 18px 0 #0b0603, inset 0 -1px 0 var(--line);
}

.book-spine {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: var(--book-height, 278px);
  margin-inline: -1px;
  padding: 22px 10px 28px;
  border: 1px solid rgba(239, 226, 197, 0.18);
  border-inline-color: rgba(0, 0, 0, 0.65);
  color: var(--book-foil, var(--gold));
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.15), transparent 18%, rgba(0, 0, 0, 0.28) 52%, transparent 82%, rgba(255, 255, 255, 0.08)),
    var(--book-color);
  box-shadow: inset 0 0 0 5px rgba(0, 0, 0, 0.18);
}

.book-spine::before,
.book-spine::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  height: 26px;
  border-block: 1px solid currentColor;
  opacity: 0.76;
}

.book-spine::before {
  top: 12px;
}

.book-spine::after {
  bottom: 12px;
}

.book-spine__roman {
  margin-top: 45px;
  font-size: 2.2rem;
  line-height: 1;
}

.book-spine__name {
  min-height: 48px;
  color: var(--ivory);
  font-family: var(--sans);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  line-height: 1.45;
  text-transform: uppercase;
}

.book-spine__mark {
  font-size: 2.05rem;
}

.epoch-section {
  position: relative;
  z-index: 1;
  margin-top: -2px;
  padding: 0 0 54px;
  background:
    linear-gradient(180deg, rgba(5, 3, 2, 0.42) 0%, rgba(5, 3, 2, 0.72) 32%, rgba(5, 3, 2, 0.86) 100%),
    radial-gradient(circle at 50% 20%, rgba(185, 138, 74, 0.18), transparent 28rem),
    url("epoch-section-bg.png") center top / cover no-repeat,
    #080503;
}

.section-heading {
  margin-bottom: 24px;
  text-align: center;
}

.ornament {
  margin-bottom: 6px;
  color: var(--gold);
}

.section-heading h2,
.collection-cta h2,
.info-band h2,
.cart-drawer h2 {
  color: #ecd8b0;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.section-heading h2 {
  margin-bottom: 8px;
  font-size: clamp(1.9rem, 4vw, 3rem);
}

.section-heading p:last-child {
  color: var(--ivory-muted);
}

.epoch-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.epoch-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 520px;
  padding: 16px 14px 14px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(31, 16, 7, 0.86), rgba(8, 5, 3, 0.95)),
    var(--ink-soft);
  text-align: center;
}

.epoch-card::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(185, 138, 74, 0.14);
  pointer-events: none;
}

.epoch-card__roman {
  margin-bottom: 2px;
  color: var(--gold);
  font-size: 1.8rem;
  line-height: 1;
}

.epoch-card h3 {
  margin-bottom: 12px;
  color: var(--ivory);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.epoch-card__image {
  display: grid;
  place-items: center;
  min-height: 214px;
  margin-bottom: 15px;
}

.epoch-card__image img {
  width: min(74%, 170px);
  height: auto;
  filter: drop-shadow(0 16px 16px rgba(0, 0, 0, 0.52));
  transform: rotate(var(--cover-tilt, -7deg));
  transition: transform 180ms ease, filter 180ms ease;
}

.epoch-card:hover .epoch-card__image img {
  transform: rotate(-3deg) translateY(-3px);
  filter: drop-shadow(0 20px 18px rgba(0, 0, 0, 0.65));
}

.epoch-card__meta {
  min-height: 70px;
  margin-bottom: 14px;
  color: var(--ivory-muted);
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  line-height: 1.55;
  text-transform: uppercase;
}

.inventory {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: auto;
  color: var(--ivory);
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.inventory span {
  border: 1px solid rgba(185, 138, 74, 0.36);
  padding: 8px 10px;
  background: rgba(5, 3, 2, 0.42);
}

.inventory__remaining {
  color: var(--gold);
}

.inventory__sold-out {
  color: #c06a53;
}

.epoch-card__actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 14px;
}

.epoch-card__actions .button {
  min-height: 38px;
  padding-inline: 12px;
  font-size: 0.66rem;
}

.button[disabled] {
  cursor: not-allowed;
  opacity: 0.48;
}

.collection-cta {
  position: relative;
  padding: 74px 0;
  border-block: 1px solid rgba(185, 138, 74, 0.25);
  background:
    linear-gradient(rgba(7, 5, 3, 0.66), rgba(7, 5, 3, 0.72)),
    radial-gradient(circle at 15% 50%, rgba(185, 138, 74, 0.22), transparent 15rem),
    radial-gradient(circle at 86% 54%, rgba(102, 66, 31, 0.24), transparent 16rem),
    #120904;
  text-align: center;
}

.collection-cta__inner {
  max-width: 820px;
}

.collection-cta h2 {
  margin-bottom: 18px;
  font-size: clamp(1.5rem, 4vw, 3rem);
  line-height: 1.35;
}

.collection-cta p:not(.eyebrow) {
  max-width: 650px;
  margin-inline: auto;
  color: var(--ivory-muted);
  line-height: 1.75;
}

.info-band {
  padding: 54px 0;
  background: #080503;
}

.info-band__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  border: 1px solid rgba(185, 138, 74, 0.25);
  background: rgba(185, 138, 74, 0.25);
}

.info-band article {
  padding: 30px;
  background: #0c0704;
}

.info-band h2 {
  margin-bottom: 12px;
  font-size: 1rem;
}

.info-band p {
  margin-bottom: 0;
  color: var(--ivory-muted);
  line-height: 1.65;
}

.site-footer {
  padding: 30px 0;
  border-top: 1px solid rgba(185, 138, 74, 0.28);
  background: #050302;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.2fr repeat(3, 1fr);
  gap: 1px;
  border-inline: 1px solid rgba(185, 138, 74, 0.2);
}

.site-footer__grid > div {
  min-height: 90px;
  padding: 18px 26px;
  border-right: 1px solid rgba(185, 138, 74, 0.2);
}

.footer-mark {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  float: left;
  margin-right: 14px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  font-size: 1.8rem;
}

.site-footer h2 {
  margin-bottom: 9px;
  color: var(--gold);
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.site-footer p {
  margin-bottom: 0;
  color: var(--ivory-muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  line-height: 1.6;
  text-transform: uppercase;
}

.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  justify-content: flex-end;
  background: rgba(0, 0, 0, 0);
  pointer-events: none;
  transition: background 180ms ease;
}

.cart-drawer.is-open {
  background: rgba(0, 0, 0, 0.58);
  pointer-events: auto;
}

.cart-drawer__panel {
  width: min(430px, 100%);
  min-height: 100%;
  padding: 26px;
  border-left: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(31, 16, 7, 0.96), rgba(5, 3, 2, 0.98)),
    #070503;
  transform: translateX(100%);
  transition: transform 220ms ease;
}

.cart-drawer.is-open .cart-drawer__panel {
  transform: translateX(0);
}

.cart-drawer__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(185, 138, 74, 0.28);
}

.cart-drawer h2 {
  margin-bottom: 0;
  font-size: 1.5rem;
}

.cart-drawer__close {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ivory);
  cursor: pointer;
  font-size: 1.5rem;
}

.cart-items {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.cart-item {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(185, 138, 74, 0.24);
}

.cart-item img {
  width: 52px;
  height: auto;
}

.cart-item h3 {
  margin-bottom: 5px;
  color: var(--ivory);
  font-size: 0.86rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cart-item p,
.cart-empty,
.cart-summary p {
  color: var(--ivory-muted);
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-transform: uppercase;
}

.cart-item__remove {
  border: 0;
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  font-size: 1.25rem;
}

.cart-empty {
  padding: 22px 0;
}

.cart-summary {
  display: grid;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid rgba(185, 138, 74, 0.28);
}

.cart-summary > div {
  display: flex;
  justify-content: space-between;
  color: var(--ivory);
  font-family: var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

@media (max-width: 1080px) {
  .site-header {
    grid-template-columns: 200px auto auto;
    padding-inline: 22px;
  }

  .primary-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    padding: 18px;
    border-bottom: 1px solid rgba(185, 138, 74, 0.25);
    background: rgba(5, 3, 2, 0.96);
  }

  .primary-nav.is-open {
    display: flex;
  }

  .nav-toggle {
    display: inline-flex;
    justify-self: center;
    align-items: center;
  }

  .epoch-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .info-band__grid,
  .site-footer__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-header {
    grid-template-columns: 1fr auto;
    gap: 14px;
    padding: 14px 16px;
  }

  .brand__title {
    font-size: 1.04rem;
  }

  .nav-toggle {
    grid-column: 1 / 2;
    grid-row: 2;
    justify-self: start;
  }

  .header-actions {
    grid-column: 2;
    grid-row: 1 / 3;
  }

  .header-actions .button {
    display: none;
  }

  .primary-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .hero-library {
    min-height: 680px;
  }

  .hero-library__content {
    padding-top: 42px;
  }

  h1 {
    letter-spacing: 0.08em;
  }

  h1 span {
    letter-spacing: 0.14em;
  }

  .epoch-grid {
    grid-template-columns: 1fr;
  }

  .epoch-card {
    min-height: 0;
  }

  .site-footer__grid > div {
    border-right: 0;
    border-bottom: 1px solid rgba(185, 138, 74, 0.2);
  }
}
