:root {
  color-scheme: light;
  --paper: #f9f6ee;
  --surface: #fffcf6;
  --ink: #292a21;
  --muted: #625e51;
  --line: #ded6c7;
  --rust: #94412c;
  --rust-dark: #79321f;
  --green: #343e30;
  --display: Georgia, 'Times New Roman', serif;
  --body: 'Segoe UI', 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.6 var(--body); }
body:has(dialog[open]) { overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
button:not(:disabled) { cursor: pointer; }
a { color: inherit; text-underline-offset: .23em; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
h1, h2, .product-title { font-family: var(--display); font-weight: 400; }
[hidden] { display: none !important; }
[id] { scroll-margin-top: 1.5rem; }
:focus-visible { outline: 2px solid #a34a32; outline-offset: 4px; }
.hero :focus-visible, .site-footer :focus-visible { outline-color: #efb788; }

.shell { width: min(100% - 5rem, 1312px); margin-inline: auto; }
.sr-only, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus {
  position: fixed;
  z-index: 5;
  top: .75rem;
  left: .75rem;
  padding: .5rem 1rem;
  background: var(--surface);
}
.eyebrow {
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.site-header { padding-block: 1.4rem; }
.header-layout { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1.5rem; }
.brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: .57rem;
  width: max-content;
  color: inherit;
  font: 700 clamp(1.75rem, 2.4vw, 2.2rem)/1 var(--display);
  letter-spacing: -.055em;
  text-decoration: none;
}
.brand-dot, .brand .book-mark { color: var(--rust); }
.book-mark { position: relative; display: inline-block; flex: none; width: 30px; height: 23px; }
.book-mark::before, .book-mark::after {
  content: '';
  position: absolute;
  top: 3px;
  width: 50%;
  height: 72%;
  border: 1.6px solid currentColor;
  border-radius: 2px 6px 2px 2px;
  transform: skewY(10deg);
}
.book-mark::after { right: 0; border-radius: 6px 2px 2px 2px; transform: skewY(-10deg); }
.small-book { width: 21px; height: 17px; }
.site-nav { display: flex; align-items: center; justify-content: center; gap: clamp(1.25rem, 3.4vw, 3.1rem); }
.site-nav a { color: var(--muted); font-size: .9375rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.site-nav a:hover { color: var(--rust); text-decoration: underline; }
.cart-button {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: .62rem;
  min-height: 43px;
  padding: .4rem .65rem .4rem .85rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  font-size: .9375rem;
  font-weight: 650;
}
.cart-button:hover { border-color: var(--rust); color: var(--rust); }
.cart-count {
  display: grid;
  min-width: 1.45rem;
  height: 1.45rem;
  place-items: center;
  padding-inline: .25rem;
  border-radius: 50%;
  background: #eadfcf;
  color: #693b2c;
  font-size: .8125rem;
}
.bag-icon {
  display: inline-block;
  position: relative;
  width: 15px;
  height: 13px;
  margin-top: 4px;
  border: 1.5px solid currentColor;
  border-radius: 2px 2px 3px 3px;
}
.bag-icon::before {
  content: '';
  position: absolute;
  inset: -6px 3px auto;
  height: 7px;
  border: 1.5px solid currentColor;
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
}

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  aspect-ratio: 1942 / 809;
  overflow: hidden;
  padding: clamp(1.75rem, 3.2vw, 3.25rem) clamp(2rem, 4vw, 3.75rem);
  border-radius: 14px;
  background: #181b14;
  color: #fcf4e3;
}
.hero-visual {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
}
.hero::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: '';
  background: linear-gradient(90deg, #151910c2, #15191070 26%, #15191035 32%, transparent 40%);
}
.hero-copy { width: 34%; max-width: 35rem; }
.hero-label { display: flex; align-items: center; gap: .8rem; color: #edba92; }
.hero-label span { width: 1.75rem; border-top: 1px solid currentColor; }
.hero h1 {
  margin-top: 1.12rem;
  font-size: clamp(2.4rem, 3.5vw, 3.6rem);
  line-height: 1.04;
  letter-spacing: -.063em;
}
.hero h1 em { color: #f0c09a; }
.hero-description { max-width: 26rem; margin-top: 1rem; color: #e4dccf; font-size: 1.0625rem; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem 1rem; margin-top: 1.3rem; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  min-height: 45px;
  padding: .56rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 650;
  font-size: .9375rem;
  text-align: center;
  text-decoration: none;
  transition: background-color .18s, border-color .18s, color .18s;
}
.button-gold { background: #f0bb91; color: #2e231a; }
.button-gold:hover { background: #ffcca3; }
.button-rust { background: var(--rust); color: #fffaf2; }
.button-rust:hover { background: var(--rust-dark); }
.button-secondary { border-color: var(--line); background: transparent; }
.button-secondary:hover { border-color: var(--rust); color: var(--rust); }
.hero-link { color: #fcf4e3; font-size: .9375rem; font-weight: 600; text-decoration-color: #c5a48b; }
.hero-link:hover { color: #f0c09a; }

.highlights {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .5rem 0;
  margin-block: 0;
  padding: 1.12rem 0;
  border-bottom: 1px solid var(--line);
  color: #514e41;
  list-style: none;
  font-size: .9375rem;
  font-weight: 600;
}
.highlights li { display: flex; align-items: center; justify-content: center; gap: .62rem; padding-inline: clamp(1rem, 3.25vw, 3.6rem); }
.highlights li + li { border-left: 1px solid var(--line); }
.highlights li > span { color: var(--rust); }
.paper-icon { position: relative; display: inline-block; width: 13px; height: 16px; border: 1.5px solid currentColor; border-radius: 2px; }
.paper-icon::after { content: ''; position: absolute; inset: 5px 2px auto; height: 4px; border-block: 1px solid currentColor; }
.pencil-icon { display: inline-block; width: 16px; height: 5px; border: 1.5px solid currentColor; border-radius: 5px 1px 1px 5px; transform: rotate(-42deg); }

.catalog { padding-block: clamp(3rem, 5vw, 4.7rem); }
.catalog-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; }
h2 { font-size: clamp(2.35rem, 4vw, 3.5rem); line-height: 1.04; letter-spacing: -.048em; }
.catalog-heading p, .sampler p:not(.eyebrow), .about p:not(.eyebrow) { margin-top: .68rem; color: var(--muted); }
.search {
  display: flex;
  align-items: center;
  gap: .72rem;
  width: min(100%, 290px);
  min-height: 45px;
  padding-inline: .8rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
}
.search:focus-within { outline: 2px solid var(--rust); outline-offset: 2px; }
.search input { flex: 1; width: 100%; min-width: 0; padding-block: .53rem; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: .9375rem; }
.search input::placeholder { color: var(--muted); }
.search-icon { position: relative; display: inline-block; flex: none; width: 13px; height: 13px; margin-right: 3px; border: 1.5px solid currentColor; border-radius: 50%; }
.search-icon::after { position: absolute; top: 10px; left: 9px; width: 6px; border-top: 1.5px solid currentColor; content: ''; transform: rotate(45deg); }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-block: 1.45rem 1.35rem; }
.filters button {
  min-height: 40px;
  padding: .31rem .95rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: transparent;
  color: #565142;
  font-size: .875rem;
  font-weight: 650;
}
.filters button:hover { border-color: var(--green); color: var(--green); }
.filters button[aria-pressed="true"] { border-color: var(--green); background: var(--green); color: #fff8eb; }
.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.15rem; }
.product {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.preview-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
}
.preview-button:focus-visible { outline-offset: -5px; }
.cover {
  --cover-bg: #ddad94;
  --cover-ink: #813e2d;
  --cover-paper: #fff2df;
  position: relative;
  display: grid;
  height: clamp(160px, 16.9vw, 235px);
  overflow: hidden;
  place-items: center;
  isolation: isolate;
  background: radial-gradient(ellipse at 29% 15%, #ffffff38, transparent 70%), var(--cover-bg);
  color: var(--cover-ink);
}
.cover-sage { --cover-bg: #c1c8b3; --cover-ink: #354b37; --cover-paper: #f3f6e8; }
.cover-gold { --cover-bg: #e8ca85; --cover-ink: #694521; --cover-paper: #fcf2d5; }
.cover-plum { --cover-bg: #cfb8c5; --cover-ink: #623e54; --cover-paper: #fbf0f3; }
.cover-sheet, .cover::before {
  width: min(44%, 135px);
  min-width: 99px;
  height: 77%;
  border-radius: 2px;
  background: var(--cover-paper);
  box-shadow: .1rem .7rem 1.4rem #3b291a2b;
}
.cover::before { position: absolute; z-index: -1; content: ''; opacity: .8; transform: translate(17%, -3%) rotate(9deg); }
.cover-sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7%;
  transform: rotate(-9deg);
  transition: transform .24s;
}
.preview-button:hover .cover-sheet { transform: translateY(-4px) rotate(-5deg); }
.cover-sheet::before { position: absolute; inset: 7px; border: 1px solid currentColor; content: ''; opacity: .28; }
.cover-mark { font: italic 400 clamp(1.6rem, 3vw, 3rem)/.95 var(--display); white-space: nowrap; }
.cover-title { max-width: 9ch; font: 700 clamp(.875rem, 1.25vw, 1.1rem)/1.07 var(--display); text-align: center; }
.cover-rule { display: inline-block; width: 55%; margin-top: .24rem; border-block: 1px solid currentColor; height: 4px; opacity: .4; }
.product-body { display: flex; flex: 1; flex-direction: column; padding: .95rem clamp(.8rem, 1.3vw, 1.15rem) 1.05rem; }
.product-category { margin-bottom: .2rem; color: var(--rust); font-size: .8125rem; font-weight: 700; }
.product-title { font-size: clamp(1.19rem, 1.8vw, 1.5rem); line-height: 1.17; }
.product-title button { border: 0; padding: 0; background: none; font: inherit; text-align: left; }
.product-title button:hover { color: var(--rust); text-decoration: underline; }
.product-meta { margin-block: .42rem .85rem; color: var(--muted); font-size: .875rem; }
.product-actions { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-top: auto; padding-top: .76rem; border-top: 1px solid var(--line); }
.product-price { font-size: 1.03rem; font-weight: 700; white-space: nowrap; }
.add-button { min-height: 38px; padding: .35rem .65rem; font-size: .875rem; background: #f7ede4; color: var(--rust-dark); }
.add-button:hover { background: #efdfd0; }
.add-button[aria-disabled="true"] { background: #e8ece1; color: var(--green); cursor: default; }
.empty-state { padding: 2rem 1rem; border: 1px dashed var(--line); border-radius: 9px; color: var(--muted); text-align: center; }

.sampler {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  min-height: 302px;
  overflow: hidden;
  border: 1px solid #e6d6c3;
  border-radius: 12px;
  background: #f1e4d3;
}
.sampler-copy { padding: clamp(1.7rem, 4vw, 3.5rem); }
.sampler .eyebrow, .about .eyebrow { margin-bottom: .6rem; color: var(--rust); }
.sampler .button { margin-top: 1.2rem; }
.sampler p:not(.eyebrow), .about p:not(.eyebrow) { max-width: 52ch; }
.sample-art {
  position: relative;
  display: grid;
  overflow: hidden;
  place-items: center;
  background: radial-gradient(ellipse at 46% 50%, #e8bb98, transparent 64%), #e4c4a8;
}
.sample-sheet {
  position: relative;
  width: 172px;
  height: 222px;
  padding: 16px 21px;
  transform: rotate(-9deg);
  border-radius: 2px;
  background: #fff9e9;
  color: var(--rust-dark);
  box-shadow: .5rem .85rem 1.6rem #7045284b;
}
.sample-sheet > span { display: block; border-bottom: 1px solid #c5a28d; font: .85rem var(--display); }
.sample-sheet > strong { display: block; padding-block: 14px 10px; font: 1.85rem/.96 var(--display); }
.sample-rules { height: 13px; margin: 6px 0; background: repeating-linear-gradient(#a98873 0 1px, transparent 1px 5px); opacity: .44; }
.short-rules { width: 70%; }
.sample-pencil {
  position: absolute;
  left: calc(50% + 86px);
  width: 8px;
  height: 145px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, #9f591e, #d5983c 48%, #9f591e);
  box-shadow: 6px 5px 7px #5435213c;
  transform: rotate(16deg);
}
.sample-pencil::before {
  position: absolute;
  bottom: 100%;
  content: '';
  width: 100%;
  height: 15px;
  background: linear-gradient(#31231a 0 32%, #e3b081 32%);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.about { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(2rem, 8vw, 7rem); padding-block: clamp(3.1rem, 6vw, 5.7rem); }
.questions h3 { margin-bottom: .58rem; font: 400 1.6rem var(--display); }
.questions details { padding-block: .7rem; border-bottom: 1px solid var(--line); }
.questions details:first-of-type { border-top: 1px solid var(--line); }
.questions summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; list-style: none; cursor: pointer; font-weight: 600; }
.questions summary::-webkit-details-marker { display: none; }
.questions summary::after { flex: none; width: 8px; height: 8px; margin: 0 .4rem .18rem 0; border: solid var(--rust); border-width: 0 1.5px 1.5px 0; content: ''; transform: rotate(45deg); }
.questions details[open] summary::after { transform: rotate(225deg); margin-bottom: -.2rem; }
.questions details p { padding-right: 1rem; }
.site-footer { background: #252a21; color: #f2e7d5; }
.footer-layout { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; padding-block: 1.45rem; }
.site-footer .brand { font-size: 1.7rem; }
.site-footer .brand-dot, .site-footer .book-mark { color: #e6aa80; }
.site-footer p { color: #d7cebe; font-size: .875rem; }

dialog { padding: 0; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
dialog::backdrop { background: #1c211aba; }
.product-dialog { width: min(92vw, 640px); max-height: 90dvh; border-radius: 12px; }
.product-dialog .close-button { position: absolute; z-index: 1; top: .65rem; right: .65rem; }
.close-button { position: relative; width: 40px; height: 40px; flex: none; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); }
.close-button::before, .close-button::after { position: absolute; top: 18px; left: 11px; width: 16px; border-top: 1.5px solid currentColor; content: ''; transform: rotate(45deg); }
.close-button::after { transform: rotate(-45deg); }
.close-button:hover { border-color: var(--rust); color: var(--rust); }
.product-detail-copy { padding: 1.3rem clamp(1rem, 4vw, 1.8rem) 1.65rem; }
.product-detail-copy h2 { font-size: clamp(2rem, 5vw, 2.8rem); margin-block: .4rem .6rem; }
.product-detail-copy p:not(.product-category) { color: var(--muted); }
.product-detail-copy ul { padding-left: 1.2rem; margin-block: .8rem 1rem; }
.detail-actions { display: flex; align-items: center; gap: 1rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.detail-actions .add-button { padding-inline: .9rem; }
.cart-dialog { position: fixed; inset: 0 0 0 auto; width: min(100%, 455px); height: 100dvh; max-width: none; max-height: 100dvh; margin: 0; border-width: 0 0 0 1px; }
.drawer-layout { display: flex; flex-direction: column; min-height: 100%; padding: 1.5rem clamp(1rem, 4vw, 1.75rem); }
.drawer-header { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding-bottom: 1.12rem; border-bottom: 1px solid var(--line); }
.drawer-header h2 { font-size: clamp(1.85rem, 6vw, 2.55rem); }
.cart-content { display: flex; flex: 1; flex-direction: column; }
.cart-empty, .checkout-note { margin-block: 1.15rem; color: var(--muted); }
.cart-empty + .button, .order-complete .button { align-self: flex-start; }
.cart-items { margin: 0; padding: 0; list-style: none; }
.cart-items li { display: grid; grid-template-columns: 1fr auto; gap: .15rem 1rem; padding-block: .9rem; border-bottom: 1px solid var(--line); }
.cart-item-title { font-family: var(--display); font-size: 1.16rem; line-height: 1.35; }
.cart-item-price { font-weight: 650; }
.cart-remove { justify-self: flex-start; border: 0; background: none; padding: .35rem 0; color: var(--rust); font-size: .875rem; text-decoration: underline; text-underline-offset: .2em; }
.cart-totals { margin-top: auto; padding-top: 1.35rem; }
.cart-total-line { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: .7rem; font-weight: 700; }
.cart-totals > .button { width: 100%; }
.cart-totals > .button + .button { margin-top: .6rem; }
.order-complete { padding-top: 1.2rem; }
.order-complete h3 { font: 1.62rem/1.2 var(--display); }
.order-complete p { margin-block: .55rem 1rem; color: var(--muted); }
.toast { position: fixed; z-index: 3; right: 1rem; bottom: 1rem; max-width: calc(100vw - 2rem); padding: .65rem 1rem; border-radius: 6px; background: var(--green); color: #fff9ec; box-shadow: 0 3px 12px #292a2130; font-size: .9375rem; }
.toast:empty { padding: 0; box-shadow: none; }

@media (max-width: 1020px) {
  .shell { width: calc(100% - 3.5rem); }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cover { height: clamp(175px, 27vw, 250px); }
  .cover-mark { font-size: clamp(1.95rem, 5vw, 3rem); }
  .cover-title { font-size: clamp(.95rem, 2.3vw, 1.15rem); }
}

@media (max-width: 1080px) {
  .hero {
    aspect-ratio: auto;
    padding-block-end: clamp(10rem, 45vw, 28rem);
    background:
      linear-gradient(180deg, #181b14e6, #181b14 64%),
      url("assets/literemka-hero.png") left top / cover no-repeat #181b14;
  }
  .hero-copy { width: 100%; }
  .hero-visual {
    inset: auto 0 0 auto;
    width: 135%;
    max-width: none;
    height: auto;
    mask-image: linear-gradient(180deg, transparent, #000 26%);
  }
  .hero::after { content: none; }
}

@media (max-width: 720px) {
  .shell { width: calc(100% - 2rem); }
  .site-header { padding-block: .85rem .75rem; }
  .header-layout { grid-template-columns: 1fr auto; gap: .6rem .5rem; }
  .site-nav {
    grid-row: 2;
    grid-column: 1 / -1;
    justify-content: flex-start;
    gap: clamp(.95rem, 5vw, 1.65rem);
    padding-block: .2rem;
  }
  .site-nav a { font-size: .875rem; }
  .hero { padding-block-start: 1.75rem; padding-inline: 1.15rem; }
  .hero h1 { font-size: clamp(2.55rem, 8.25vw, 4rem); }
  .hero-description { margin-top: 1rem; }
  .hero-actions { margin-top: 1.1rem; gap: .65rem 1rem; }
  .highlights { justify-content: flex-start; gap: .55rem 1.1rem; }
  .highlights li { padding: 0; font-size: .875rem; }
  .highlights li + li { border-left: 0; }
  .catalog-heading { align-items: flex-start; flex-direction: column; gap: .9rem; }
  .search { width: 100%; }
  .filters { margin-block: 1rem; }
  .sampler, .about { grid-template-columns: 1fr; }
  .sample-art { min-height: 250px; }
}

@media (max-width: 470px) {
  .product-grid { grid-template-columns: 1fr; }
  .cover { height: 205px; }
  .product-body { padding-inline: 1.05rem; }
  .product-title { font-size: 1.37rem; }
}

@media (max-width: 370px) {
  .site-nav { gap: .7rem; }
  .site-nav a { font-size: .8125rem; }
  .hero h1 { font-size: 2.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; }
}
