@font-face {
  font-family: Prata;
  src: url("./assets/fonts/prata.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Onest;
  src: url("./assets/fonts/onest.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
:root {
  color-scheme: light;
  --paper: #fffaf0;
  --cream: #f1e5cc;
  --yolk: #f9b725;
  --ink: #252117;
  --muted: #66533e;
  --line: color-mix(in srgb, var(--muted) 24%, var(--paper));
  --surface: color-mix(in srgb, var(--cream) 62%, var(--paper));
  --serif: Prata, Georgia, serif;
  --sans: Onest, system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.55 var(--sans); }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: .23em; }
button, input { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.wrap { width: min(100% - 6.5rem, 76rem); margin-inline: auto; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; z-index: 5; top: 1rem; left: 1rem; padding: .7rem 1rem; background: var(--paper); border: 1px solid var(--ink); }

.bar { min-height: 5.45rem; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1.5rem; border-bottom: 1px solid var(--muted); }
.brand { display: inline-flex; align-items: center; gap: .62rem; justify-self: start; line-height: 1; }
.avatar { flex: none; width: 3.15rem; height: 3.15rem; object-fit: cover; border-radius: 50%; border: 1px solid var(--muted); }
.wordmark { flex: none; width: 10.65rem; height: auto; }
.bar nav { display: flex; gap: clamp(1.3rem,4vw,3.6rem); font-weight: 520; }
.cart-toggle { justify-self: end; display: flex; gap: .6rem; align-items: center; min-height: 2.65rem; padding: .42rem .55rem .42rem .85rem; border: 1px solid var(--muted); border-radius: .33rem; background: transparent; color: var(--ink); white-space: nowrap; }
.cart-toggle:hover { background: var(--surface); }
.cart-toggle span { display: grid; place-items: center; min-width: 1.4rem; height: 1.4rem; padding-inline: .15rem; border-radius: 1rem; background: var(--cream); color: var(--ink); font-size: .8rem; }

.hero { padding-top: 1.1rem; }
.hero-grid { min-height: clamp(28rem,37vw,35rem); display: grid; grid-template-columns: 1fr 1.03fr; align-items: center; gap: 1.1rem; }
.hero-copy { padding-block: 2.25rem; }
.hero-author { font-size: 1.05rem; font-weight: 530; color: var(--muted); }
.hero h1 { margin: .55rem 0 1.05rem; font-size: clamp(3.8rem,7.05vw,6.85rem); line-height: 1.01; letter-spacing: -.055em; }
.hero-dek { max-width: 26rem; font-size: 1.08rem; }
.actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1.45rem; }
.catalog-shortcut { display: none; font-weight: 570; text-decoration: underline; text-underline-offset: .2em; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 2.9rem; padding: .62rem 1.25rem; border: 1px solid var(--ink); border-radius: .32rem; font-weight: 640; line-height: 1.25; }
.button:hover { text-decoration: none; }
.solid { background: var(--yolk); color: var(--ink); }
.solid:hover { background: color-mix(in srgb, var(--yolk) 87%, var(--paper)); }
.outline { background: transparent; color: var(--ink); }
.outline:hover { background: var(--cream); }

.hero-art { position: relative; align-self: stretch; display: grid; place-items: center; isolation: isolate; overflow: hidden; background: var(--surface); border-radius: .4rem; }
.hero-art::before { content: ""; position: absolute; z-index: -1; top: 7%; left: 46%; width: min(50%, 19rem); aspect-ratio: 1; border-radius: 50%; background: var(--yolk); }
.hero-book { display: block; width: clamp(13.5rem,22vw,19.5rem); border-radius: .15rem; box-shadow: .55rem .85rem 1.6rem #25211743; transition: transform .22s ease; }
.hero-book:hover { transform: translateY(-.25rem); }
.hero-book img { width: 100%; border-radius: inherit; }

.catalog { padding-block: 3.4rem 4.8rem; }
.section-head { display: flex; justify-content: space-between; gap: 1.4rem; align-items: center; }
.section-head h2, .about h2 { font-size: clamp(2.05rem,4.35vw,3.9rem); line-height: 1.11; letter-spacing: -.045em; }
.search { min-height: 2.85rem; position: relative; }
.search input { color: var(--ink); width: min(20rem,100%); padding: .66rem .8rem .66rem 2.65rem; border: 1px solid var(--muted); background: transparent; border-radius: .32rem; }
.search input::placeholder { color: var(--muted); }
.search-icon { position: absolute; width: .9rem; height: .9rem; border: 1.55px solid var(--ink); border-radius: 50%; left: 1rem; top: .9rem; pointer-events: none; }
.search-icon::after { content: ""; position: absolute; height: .4rem; width: 1.5px; background: var(--ink); right: -.17rem; bottom: -.25rem; transform: rotate(-45deg); }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.25rem 0 1.2rem; }
.filters button { display: inline-flex; align-items: center; gap: .48rem; min-height: 2.3rem; padding: .38rem .8rem; border: 1px solid var(--muted); border-radius: 2rem; background: transparent; color: var(--ink); font-size: .88rem; }
.filters button:hover { background: var(--surface); }
.filters button[aria-pressed="true"] { background: var(--yolk); border-color: var(--ink); font-weight: 620; }
.filters button[aria-pressed="true"]::before { content: ""; width: .42rem; height: .68rem; transform: rotate(45deg) translateY(-.08rem); border: solid currentColor; border-width: 0 1.5px 1.5px 0; }
.shelf { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: clamp(1.05rem,3vw,2.1rem); }
.card { min-width: 0; }
.cover-stage { position: relative; display: block; aspect-ratio: 1.09; background: var(--surface); border-radius: .36rem; overflow: hidden; }
.cover-stage img { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); height: 83%; width: auto; max-width: 80%; object-fit: contain; box-shadow: .4rem .55rem 1rem #25211738; transition: transform .22s ease; }
.card:hover .cover-stage img { transform: translate(-50%,calc(-50% - .23rem)); }
.card-info { padding-top: .92rem; }
.card-info .genre { color: var(--muted); font-size: .88rem; }
.card h3 { font-size: clamp(1.25rem,2.35vw,1.86rem); line-height: 1.2; margin: .32rem 0 .25rem; letter-spacing: -.026em; }
.card .author { color: var(--muted); font-size: .94rem; }
.empty { grid-column: 1/-1; min-height: 8rem; padding: 1.2rem 0; }

.about { background: var(--cream); padding-block: 3.8rem; }
.about-grid { display: grid; grid-template-columns: 1fr .85fr; gap: 2.75rem; }
.about p + p { margin-top: .8rem; }
.about .button { margin-top: 1.2rem; }
.footer { padding-block: 1.85rem; }
.footprint { display: flex; align-items: center; justify-content: space-between; gap: 1.3rem; }
.footprint p { color: var(--muted); font-size: .9rem; }
.footprint > a:last-child { font-size: .9rem; }

dialog { width: min(50rem,100% - 2rem); max-height: min(90dvh,55rem); border: 1px solid var(--muted); border-radius: .42rem; background: var(--paper); color: var(--ink); padding: 1.5rem; }
dialog::backdrop { background: #2521179c; }
body:has(dialog[open]) { overflow: hidden; }
.dialog-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.dialog-top h2 { font-size: 2rem; }
.eyebrow { color: var(--muted); font-weight: 550; }
.close { display: grid; place-items: center; background: transparent; color: var(--ink); border: 1px solid var(--muted); width: 2.65rem; height: 2.65rem; border-radius: 50%; line-height: .8; font-size: 1.65rem; flex: none; }
.close:hover { background: var(--cream); }
.book-detail { display: grid; grid-template-columns: minmax(7rem,34%) 1fr; gap: 1.5rem; }
.book-detail img { width: 100%; border-radius: .2rem; }
.book-detail h2 { font-size: clamp(1.85rem,5vw,2.9rem); line-height: 1.13; letter-spacing: -.04em; margin-block: .26rem .5rem; }
.book-detail .genre { color: var(--muted); font-size: .88rem; }
.book-detail .summary { margin-top: .8rem; }
.edition { display: flex; justify-content: space-between; gap: .65rem; align-items: center; flex-wrap: wrap; margin: 1rem 0 .4rem; padding-top: .85rem; border-top: 1px solid var(--line); }
.subtle { color: var(--muted); font-size: .9rem; }
.drawer { margin: 0 0 0 auto; min-height: 100dvh; max-height: 100dvh; width: min(100%,28rem); border-radius: 0; }
.cart-list { list-style: none; padding: 0; margin: 0; }
.cart-item { display: flex; align-items: center; gap: .85rem; padding-block: .85rem; border-bottom: 1px solid var(--line); }
.cart-item img { width: 2.8rem; border-radius: .12rem; }
.cart-item > div { flex: 1; }
.link-button { border: 0; padding: .4rem 0; background: transparent; color: var(--ink); text-decoration: underline; text-underline-offset: .2em; font-size: .89rem; }
.total { display: flex; justify-content: space-between; padding-block: .9rem; font-weight: 650; }
.cart-actions { margin-top: .9rem; display: flex; flex-direction: column; align-items: start; gap: .65rem; }
.cart-done h3 { font-size: 1.6rem; line-height: 1.18; }
.cart-done p { margin-top: .75rem; }

@media (max-width: 890px) {
  .wrap { width: calc(100% - 3.2rem); }
  .hero-grid { min-height: 25rem; }
  .hero h1 { font-size: clamp(3.45rem,8vw,5.3rem); }
  .hero-book { width: clamp(12.5rem,26vw,16.5rem); }
  .about-grid { gap: 1.6rem; }
}
@media (max-width: 650px) {
  .wrap { width: calc(100% - 2rem); }
  .bar { min-height: 4.25rem; grid-template-columns: 1fr auto; gap: .55rem; }
  .bar nav { display: none; }
  .brand { gap: .42rem; }
  .avatar { width: 2.55rem; height: 2.55rem; }
  .wordmark { width: 8.05rem; }
  .cart-toggle { font-size: .87rem; gap: .34rem; padding-left: .55rem; }
  .hero { padding-top: 0; }
  .hero-grid { grid-template-columns: 1fr; min-height: auto; gap: 0; }
  .hero-copy { padding: 1.65rem 0 1.22rem; }
  .hero-author { font-size: .96rem; }
  .hero h1 { margin-block: .48rem .85rem; font-size: clamp(2.9rem,13.15vw,4.35rem); }
  .hero-dek { font-size: 1rem; }
  .actions { margin-top: 1rem; }
  .catalog-shortcut { display: inline; }
  .hero-art { min-height: 19rem; }
  .hero-art::before { top: 8%; left: 48%; width: min(47%, 12rem); }
  .hero-book { width: 10.9rem; }
  .catalog { padding-block: 2.35rem 2.9rem; }
  .section-head { align-items: stretch; flex-direction: column; gap: .9rem; }
  .search input { width: 100%; }
  .filters { margin-block: .78rem 1.1rem; }
  .shelf { grid-template-columns: repeat(2,minmax(0,1fr)); row-gap: 1.5rem; }
  .cover-stage { aspect-ratio: .85; }
  .card-info { padding-top: .6rem; }
  .about { padding-block: 2.6rem; }
  .about-grid { grid-template-columns: 1fr; gap: 1rem; }
  .footprint { flex-wrap: wrap; }
  .footprint p { order: 3; width: 100%; }
  dialog { padding: 1rem; }
  .book-detail { gap: .85rem; }
}
@media (max-width: 365px) {
  .wordmark { width: 7.3rem; }
  .book-detail { grid-template-columns: 1fr; }
  .book-detail img { width: 8rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
