:root {
  color-scheme: light dark;
  --page: #f2f6f3;
  --surface: #fbfcfb;
  --surface-strong: #ffffff;
  --surface-tint: #e2ebe6;
  --ink: #14201c;
  --muted: #5d6964;
  --line: #cbd5d0;
  --accent: #17543f;
  --accent-strong: #0f3f2f;
  --accent-soft: #d5e8de;
  --shadow: 0 18px 50px rgb(24 58 45 / 0.12);
  --radius: 16px;
  --radius-small: 10px;
  --content: 1420px;
  font-family: Aptos, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--page);
  color: var(--ink);
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #101815;
    --surface: #17211d;
    --surface-strong: #1c2823;
    --surface-tint: #21352d;
    --ink: #edf4f0;
    --muted: #b1beb7;
    --line: #35463e;
    --accent: #7fc7a5;
    --accent-strong: #a2dabd;
    --accent-soft: #223f33;
    --shadow: 0 18px 50px rgb(0 0 0 / 0.28);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
}

body.drawer-open,
body.dialog-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

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

section[id] {
  scroll-margin-top: 88px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--radius-small);
  background: var(--accent-strong);
  color: #f8fbf9;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.announcement {
  padding: 8px 24px;
  background: var(--accent-strong);
  color: #f6faf8;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto minmax(230px, 1fr);
  align-items: center;
  width: 100%;
  min-height: 72px;
  padding: 10px clamp(20px, 4vw, 68px);
  border-bottom: 1px solid color-mix(in srgb, var(--line), transparent 20%);
  background: color-mix(in srgb, var(--page), transparent 6%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--accent);
  border-radius: 50%;
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 0.98rem;
}

.brand small {
  color: var(--muted);
  font-size: 0.72rem;
}

.primary-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 3vw, 42px);
}

.primary-nav a,
.site-footer a {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}

.primary-nav a:hover,
.primary-nav a:focus-visible,
.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--accent-strong);
}

.header-action {
  justify-self: end;
  min-width: 86px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.header-action span {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  margin-left: 6px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.74rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(420px, 1.12fr);
  gap: clamp(36px, 6vw, 96px);
  align-items: center;
  min-height: min(760px, calc(100dvh - 104px));
  max-width: var(--content);
  margin: 0 auto;
  padding: clamp(48px, 7vw, 92px) clamp(20px, 4vw, 68px);
}

.hero-copy {
  max-width: 650px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 13ch;
  margin: 0;
  font-size: clamp(2.7rem, 5.3vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.hero-summary {
  max-width: 54ch;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.2rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.button:active,
.header-action:active,
.category-button:active,
.close-button:active,
.dialog-close:active {
  transform: translateY(1px);
}

.button-primary {
  background: var(--accent-strong);
  color: #f8fbf9;
}

@media (prefers-color-scheme: dark) {
  .button-primary {
    background: var(--accent);
    color: #102018;
  }
}

.button-primary:hover,
.button-primary:focus-visible {
  background: var(--accent);
}

.button-secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.button-secondary:hover,
.button-secondary:focus-visible {
  border-color: var(--accent);
}

.hero-visual {
  position: relative;
  min-height: 550px;
}

.hero-placeholder {
  position: absolute;
  inset: 4% 2% 4% 12%;
  border-radius: var(--radius);
  background: var(--surface-tint);
}

.hero-book {
  position: absolute;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line), transparent 30%);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.hero-book img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-book:nth-child(1) {
  inset: 3% 33% 26% 3%;
  transform: rotate(-3deg);
}

.hero-book:nth-child(2) {
  inset: 22% 3% 7% 45%;
  transform: rotate(3deg);
}

.hero-book:nth-child(3) {
  inset: 42% 48% 0 17%;
  transform: rotate(-1deg);
}

.catalog-section,
.collections-section,
.about-section {
  max-width: var(--content);
  margin: 0 auto;
  padding: clamp(72px, 9vw, 126px) clamp(20px, 4vw, 68px);
}

.catalog-section {
  border-top: 1px solid var(--line);
}

.section-heading {
  max-width: 760px;
}

.section-heading h2,
.about-section h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1.03;
  letter-spacing: -0.045em;
}

.section-heading p,
.about-copy p {
  max-width: 62ch;
  margin: 16px 0 0;
  color: var(--muted);
}

.catalog-controls {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(190px, 0.25fr);
  gap: 14px;
  margin-top: 42px;
}

.search-control,
.sort-control {
  display: grid;
  gap: 7px;
}

.search-control span,
.sort-control span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  outline: 0;
  background: var(--surface-strong);
  color: var(--ink);
}

input {
  padding: 12px 15px;
}

select {
  padding: 12px 36px 12px 14px;
}

input::placeholder {
  color: color-mix(in srgb, var(--muted), transparent 15%);
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent), transparent 72%);
}

.category-row {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  padding-bottom: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.category-button {
  flex: 0 0 auto;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
}

.category-button:hover,
.category-button:focus-visible,
.category-button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.catalog-status {
  display: flex;
  min-height: 28px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 24px 0 16px;
  color: var(--muted);
  font-size: 0.88rem;
}

.text-button {
  padding: 4px 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--accent-strong);
  font-weight: 800;
  cursor: pointer;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(18px, 2.4vw, 34px) clamp(16px, 2vw, 28px);
}

.book-card {
  min-width: 0;
}

.book-image-link {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border: 1px solid color-mix(in srgb, var(--line), transparent 25%);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.book-image-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

.book-card:hover .book-image-link img {
  transform: scale(1.018);
}

.book-copy {
  padding: 15px 2px 0;
}

.book-category {
  margin: 0 0 7px;
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.book-copy h3 {
  min-height: 2.5em;
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.25;
}

.book-copy h3 a {
  text-decoration: none;
}

.book-copy h3 a:hover,
.book-copy h3 a:focus-visible {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.book-identifiers {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.book-buy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.book-price {
  font-size: 1.05rem;
  font-weight: 900;
}

.add-button {
  min-height: 38px;
  padding: 9px 13px;
  font-size: 0.8rem;
}

.skeleton-card {
  min-height: 420px;
  border-radius: var(--radius);
  background: linear-gradient(110deg, var(--surface-tint) 8%, var(--surface) 18%, var(--surface-tint) 33%);
  background-size: 200% 100%;
}

@media (prefers-reduced-motion: no-preference) {
  .skeleton-card {
    animation: shimmer 1.5s linear infinite;
  }

  @keyframes shimmer {
    to { background-position-x: -200%; }
  }
}

.empty-state {
  grid-column: 1 / -1;
  padding: 54px 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
}

.empty-state h3 {
  margin: 0;
  font-size: 1.5rem;
}

.empty-state p {
  margin: 8px 0 20px;
  color: var(--muted);
}

.collections-section {
  border-top: 1px solid var(--line);
}

.compact-heading {
  max-width: 680px;
}

.collection-showcase {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  grid-template-rows: repeat(2, minmax(210px, auto));
  gap: 16px;
  margin-top: 40px;
}

.collection-tile {
  position: relative;
  display: grid;
  min-height: 220px;
  align-content: end;
  overflow: hidden;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
}

.collection-tile:first-child {
  grid-row: 1 / 3;
  min-height: 470px;
  background: var(--accent-soft);
}

.collection-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.collection-tile::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(to top, rgb(9 30 23 / 0.82), transparent 64%);
}

.collection-copy {
  position: relative;
  z-index: 1;
  color: #f5faf7;
}

.collection-copy strong,
.collection-copy span {
  display: block;
}

.collection-copy strong {
  font-size: clamp(1.35rem, 2.7vw, 2.4rem);
  line-height: 1.05;
}

.collection-copy span {
  margin-top: 7px;
  font-size: 0.86rem;
}

.about-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.8fr);
  gap: clamp(40px, 8vw, 120px);
  border-top: 1px solid var(--line);
}

.about-facts {
  display: grid;
  gap: 0;
  margin: 0;
}

.about-facts div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.about-facts dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.about-facts dd {
  margin: 0;
  font-weight: 800;
}

.about-facts a,
.bag-summary a {
  color: var(--accent-strong);
  text-underline-offset: 0.2em;
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 32px;
  align-items: end;
  max-width: var(--content);
  margin: 0 auto;
  padding: 42px clamp(20px, 4vw, 68px) 52px;
  border-top: 1px solid var(--line);
}

.site-footer strong,
.site-footer p {
  display: block;
  margin: 0;
}

.site-footer p,
.site-footer small {
  color: var(--muted);
  font-size: 0.8rem;
}

.site-footer nav {
  display: flex;
  gap: 20px;
}

.bag-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgb(7 18 14 / 0.56);
}

.bag-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 70;
  display: flex;
  width: min(450px, 100%);
  height: 100dvh;
  flex-direction: column;
  padding: 24px;
  border-left: 1px solid var(--line);
  background: var(--surface-strong);
  box-shadow: -18px 0 50px rgb(0 0 0 / 0.2);
  transform: translateX(104%);
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.bag-drawer[aria-hidden="false"] {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.drawer-header h2 {
  margin: 0;
  font-size: 2rem;
  letter-spacing: -0.04em;
}

.drawer-kicker {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.close-button,
.dialog-close {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.bag-lines {
  display: grid;
  gap: 15px;
  padding: 20px 0;
  overflow-y: auto;
}

.bag-line {
  display: grid;
  grid-template-columns: 74px 1fr auto;
  gap: 12px;
  align-items: center;
}

.bag-line img {
  width: 74px;
  height: 74px;
  border-radius: var(--radius-small);
  object-fit: cover;
}

.bag-line strong,
.bag-line small {
  display: block;
}

.bag-line small {
  margin-top: 4px;
  color: var(--muted);
}

.bag-line button {
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  font-weight: 800;
  cursor: pointer;
}

.bag-empty {
  margin: auto 0;
  text-align: center;
}

.bag-empty p {
  color: var(--muted);
}

.bag-summary {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.bag-summary div {
  display: flex;
  justify-content: space-between;
  font-size: 1.08rem;
}

.bag-summary p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.product-dialog {
  width: min(1120px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.product-dialog::backdrop {
  background: rgb(7 18 14 / 0.64);
}

.dialog-close {
  position: sticky;
  top: 16px;
  z-index: 2;
  float: right;
  margin: 16px 16px 0 0;
}

.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: clamp(30px, 5vw, 68px);
  padding: 64px clamp(20px, 4vw, 54px) 46px;
}

.product-main-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  object-fit: cover;
}

.product-thumbnails {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.thumbnail-button {
  padding: 0;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border: 2px solid transparent;
  border-radius: var(--radius-small);
  background: var(--surface);
  cursor: pointer;
}

.thumbnail-button[aria-current="true"],
.thumbnail-button:hover,
.thumbnail-button:focus-visible {
  border-color: var(--accent);
}

.thumbnail-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-category {
  margin: 0;
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.product-info h2 {
  margin: 10px 0 0;
  font-size: clamp(2rem, 4.2vw, 4rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.product-summary,
.product-note {
  color: var(--muted);
}

.product-summary {
  margin: 22px 0 0;
  font-size: 1.02rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0 0;
}

.feature-grid div {
  padding: 12px;
  border-radius: var(--radius-small);
  background: var(--surface-tint);
  font-size: 0.84rem;
  font-weight: 700;
}

.product-note {
  margin: 18px 0 0;
  font-size: 0.88rem;
}

.product-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 24px 0 0;
}

.product-meta div {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
}

.product-meta dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.product-meta dd {
  margin: 4px 0 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.product-purchase {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.product-purchase strong {
  font-size: 1.5rem;
}

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: grid;
  gap: 8px;
}

.toast {
  max-width: 340px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  font-size: 0.88rem;
  font-weight: 700;
}

@media (max-width: 1120px) {
  .book-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero {
    grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  }
}

@media (max-width: 880px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .primary-nav {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero h1 {
    max-width: 15ch;
  }

  .hero-visual {
    min-height: 500px;
  }

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

  .about-section,
  .product-detail {
    grid-template-columns: 1fr;
  }

  .site-footer {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

@media (max-width: 640px) {
  .announcement {
    padding-inline: 14px;
    font-size: 0.67rem;
  }

  .site-header {
    min-height: 66px;
    padding-inline: 16px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand small {
    display: none;
  }

  .header-action {
    min-width: auto;
    padding: 8px 10px;
  }

  .hero,
  .catalog-section,
  .collections-section,
  .about-section {
    width: 100%;
    padding: 48px 16px;
  }

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

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions .button {
    width: 100%;
  }

  .hero-visual {
    min-height: 390px;
  }

  .catalog-controls {
    grid-template-columns: 1fr;
  }

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

  .book-copy h3 {
    min-height: auto;
  }

  .collection-showcase {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .collection-tile,
  .collection-tile:first-child {
    grid-row: auto;
    min-height: 300px;
  }

  .about-facts div {
    grid-template-columns: 92px 1fr;
  }

  .site-footer {
    padding: 34px 16px 42px;
  }

  .site-footer nav {
    flex-wrap: wrap;
  }

  .product-dialog {
    width: calc(100% - 16px);
    max-height: calc(100dvh - 16px);
  }

  .product-detail {
    padding: 58px 14px 28px;
  }

  .product-info h2 {
    font-size: 2.2rem;
  }

  .product-thumbnails {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .feature-grid,
  .product-meta {
    grid-template-columns: 1fr;
  }

  .product-purchase {
    align-items: stretch;
    flex-direction: column;
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .site-header {
    background: var(--page);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}
