:root {
  --pine: #0a1b2d;
  --pine-deep: #071421;
  --pine-soft: #30465a;
  --ink: #151412;
  --muted: #6e6a63;
  --gold: #952f2a;
  --gold-pale: #e8be7f;
  --paper: #f1ede5;
  --white: #fffcf6;
  --line: rgba(21, 20, 18, 0.18);
  --shadow: 16px 24px 36px rgba(26, 22, 18, 0.2);
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  text-rendering: optimizeLegibility;
}
body.dialog-open { overflow: hidden; }
a { color: inherit; }
button, input, select { font: inherit; }
button { color: inherit; }
img { display: block; max-width: 100%; }
address { font-style: normal; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: 12px;
  left: 12px;
  transform: translateY(-160%);
  background: var(--white);
  color: var(--pine);
  padding: 10px 14px;
  border-radius: 4px;
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto 1fr;
  align-items: center;
  min-height: 84px;
  padding: 12px clamp(20px, 5vw, 80px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 252, 246, 0.97);
  color: var(--ink);
  backdrop-filter: blur(16px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-self: start;
  text-decoration: none;
}
.brand img { width: 56px; }
.brand-copy { display: grid; line-height: 1; }
.brand-copy strong { font-family: var(--serif); font-size: 1.35rem; letter-spacing: 0.12em; }
.brand-copy small { margin-top: 6px; font-size: 0.55rem; letter-spacing: 0.14em; color: var(--muted); }

.primary-nav { display: flex; align-items: center; gap: clamp(18px, 3vw, 38px); }
.primary-nav a {
  position: relative;
  color: var(--ink);
  text-decoration: none;
  font-size: .88rem;
  font-weight: 650;
}
.primary-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -8px;
  height: 2px;
  background: var(--gold);
  transition: right .2s ease;
}
.primary-nav a:hover { color: var(--gold); }
.primary-nav a:hover::after { right: 0; }

.language-switcher {
  display: flex;
  justify-self: end;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 0;
}
.language-switcher a {
  min-width: 38px;
  min-height: 34px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: .72rem;
  font-weight: 800;
}
.language-switcher a[aria-current="page"] { background: var(--pine); color: white; }
.menu-button { display: none; }

.hero {
  position: relative;
  min-height: min(760px, calc(100vh - 84px));
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  color: var(--pine);
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
  align-items: center;
  gap: clamp(50px, 7vw, 120px);
  width: min(1480px, 100%);
  min-height: inherit;
  margin: 0 auto;
  padding: 84px clamp(24px, 6vw, 94px) 100px;
}
.eyebrow {
  margin: 0 0 22px;
  color: var(--gold);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.hero h1 {
  max-width: 860px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3.6rem, 7.7vw, 8.2rem);
  font-weight: 500;
  letter-spacing: -.055em;
  line-height: .91;
}
.hero-lead {
  max-width: 650px;
  margin: 34px 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.5vw, 1.28rem);
  line-height: 1.75;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 40px; }
.primary-button, .secondary-button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 22px;
  border: 1px solid var(--gold);
  border-radius: 0;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}
.primary-button { background: var(--gold); color: white; }
.primary-button:hover { background: #74221f; }
.secondary-button { background: transparent; color: var(--pine); border-color: var(--pine); }
.secondary-button:hover { background: var(--pine); color: white; }
.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 4px;
  border-bottom: 1px solid currentColor;
  color: var(--pine);
  font-weight: 750;
  text-decoration: none;
}
.hero-emblem {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 440px;
  border-left: 1px solid var(--line);
}
.hero-emblem::after {
  content: "داستان‌ها مرز نمی‌شناسند";
  position: absolute;
  bottom: 9%;
  color: var(--muted);
  font-family: Tahoma, sans-serif;
  font-size: clamp(1rem, 2vw, 1.35rem);
}
.hero-emblem img { width: 82%; transform: translateY(-9%); filter: sepia(1) saturate(.45) brightness(.72); }

.catalog-section {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 100px clamp(24px, 6vw, 94px) 120px;
}
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
}
.section-heading h2,
.services-copy h2,
.book-detail h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.8rem, 5vw, 5.8rem);
  font-weight: 500;
  letter-spacing: -.045em;
  line-height: .98;
}
.book-count { color: var(--muted); font-size: .9rem; }
.catalog-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin: 48px 0 44px;
  padding: 12px 0;
  border-block: 1px solid var(--line);
}
.search-field {
  display: flex;
  align-items: center;
  width: min(520px, 100%);
  gap: 12px;
}
.search-field svg { width: 20px; flex: 0 0 auto; color: var(--muted); }
.search-field input {
  width: 100%;
  padding: 14px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}
.filter-buttons { display: flex; gap: 8px; }
.filter-buttons button {
  padding: 9px 17px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  font-size: .86rem;
}
.filter-buttons button[aria-pressed="true"] { border-color: var(--pine); background: var(--pine); color: white; }
.books-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(26px, 3.2vw, 50px); }
.book-card { min-width: 0; }
.book-link { display: block; text-decoration: none; }
.book-stage {
  position: relative;
  display: grid;
  aspect-ratio: .72;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(21, 20, 18, .12);
  background: #e8e1d6;
  perspective: 1500px;
}
.book-stage::after {
  content: "";
  position: absolute;
  right: 11%;
  bottom: 5.5%;
  left: 15%;
  height: 13px;
  border-radius: 50%;
  background: rgba(21, 20, 18, .2);
  filter: blur(10px);
}
.book-object {
  position: relative;
  z-index: 1;
  height: 82%;
  aspect-ratio: var(--book-ratio);
  transform: rotateY(-18deg) rotateX(2deg) translateX(3%);
  transform-style: preserve-3d;
  transition: transform .28s ease;
}
.book-object__front {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: white;
  box-shadow: 4px 8px 16px rgba(21, 20, 18, .14);
  transform: translateZ(14px);
}
.book-object__front img { width: 100%; height: 100%; object-fit: cover; }
.book-object__spine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -14px;
  width: 14px;
  background: #2b2925;
  transform: rotateY(-90deg);
  transform-origin: right center;
}
.book-object__pages {
  position: absolute;
  top: 4px;
  right: -14px;
  bottom: 4px;
  width: 14px;
  border: 1px solid #d0c7b7;
  background: #eee7da;
  transform: rotateY(90deg);
  transform-origin: left center;
}
.book-object__bottom {
  position: absolute;
  right: 0;
  bottom: -14px;
  left: 4px;
  height: 14px;
  border: 1px solid #d0c7b7;
  background: #e4dccd;
  transform: rotateX(-90deg);
  transform-origin: center top;
}
.book-card:hover .book-object { transform: rotateY(-9deg) rotateX(1deg) translateY(-9px); }
.book-stage--photo .book-object { width: 84%; height: auto; transform: rotateY(-10deg) rotateX(2deg); }
.book-stage--photo .book-object__spine,
.book-stage--photo .book-object__pages,
.book-stage--photo .book-object__bottom { display: none; }
.book-stage--photo .book-object__front { transform: translateZ(0); box-shadow: 12px 18px 28px rgba(21,20,18,.22); }
.book-meta-line { display: flex; justify-content: space-between; gap: 10px; margin-top: 23px; color: var(--muted); font-size: .73rem; letter-spacing: .08em; text-transform: uppercase; }
.book-card h3 { margin: 11px 0 0; font-family: var(--serif); font-size: clamp(1.35rem, 2vw, 1.9rem); line-height: 1.08; }
.original-title { min-height: 28px; margin: 8px 0 0; color: var(--muted); font-family: Tahoma, sans-serif; font-size: 1.05rem; }
.book-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.book-card-footer strong { font-size: .95rem; }
.details-label { padding-bottom: 4px; border-bottom: 1px solid var(--ink); font-size: .8rem; font-weight: 800; }
.empty-state { grid-column: 1 / -1; padding: 70px 20px; border: 1px dashed var(--line); text-align: center; color: var(--muted); }

.services-section {
  display: grid;
  grid-template-columns: .78fr 1.22fr;
  gap: clamp(50px, 9vw, 140px);
  padding: 110px clamp(24px, 8vw, 130px);
  background: var(--white);
}
.services-copy { position: sticky; top: 125px; align-self: start; }
.services-copy p:last-child { max-width: 500px; margin-top: 28px; color: var(--muted); font-size: 1.06rem; line-height: 1.8; }
.service-list { border-top: 1px solid var(--line); }
.service-item { display: grid; grid-template-columns: 54px 1fr; gap: 18px; padding: 34px 0; border-bottom: 1px solid var(--line); }
.service-number { color: var(--gold); font-family: var(--serif); font-size: 1.35rem; }
.service-item h3 { margin: 0; font-family: var(--serif); font-size: 2rem; font-weight: 500; }
.service-item p { max-width: 720px; margin: 12px 0 0; color: var(--muted); line-height: 1.75; }

.book-detail {
  min-height: 72vh;
  background: var(--paper);
}
.detail-backbar {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 30px clamp(24px, 6vw, 94px) 0;
}
.back-link { border: 0; background: none; padding: 10px 0; cursor: pointer; font-weight: 750; color: var(--pine); }
.detail-grid {
  display: grid;
  grid-template-columns: minmax(280px, .72fr) minmax(0, 1.28fr);
  gap: clamp(50px, 8vw, 130px);
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 56px clamp(24px, 6vw, 94px) 120px;
}
.detail-cover {
  display: grid;
  min-height: 680px;
  align-self: start;
  place-items: center;
  padding: clamp(30px, 5vw, 72px);
  border: 1px solid rgba(21,20,18,.12);
  background: #e8e1d6;
  perspective: 1900px;
}
.book-object--detail { height: min(560px, 62vw); transform: rotateY(-16deg) rotateX(1.5deg); }
.detail-cover--photo .book-object { width: 90%; height: auto; transform: rotateY(-8deg) rotateX(2deg); }
.detail-cover--photo .book-object__spine,
.detail-cover--photo .book-object__pages,
.detail-cover--photo .book-object__bottom { display: none; }
.detail-cover--photo .book-object__front { transform: translateZ(0); box-shadow: 16px 22px 34px rgba(21,20,18,.24); }
.detail-copy { align-self: center; }
.detail-original { margin: 18px 0 0; color: var(--muted); font-family: Tahoma, sans-serif; font-size: 1.4rem; }
.detail-description { max-width: 720px; margin: 34px 0 0; color: #56514b; font-size: 1.08rem; line-height: 1.9; }
.detail-price { margin: 32px 0 0; font-family: var(--serif); font-size: 2.1rem; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.detail-actions .secondary-button { color: var(--pine); border-color: var(--line); }
.detail-meta { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); margin: 44px 0 0; border-top: 1px solid var(--line); }
.detail-meta div { padding: 18px 16px 18px 0; border-bottom: 1px solid var(--line); }
.detail-meta dt { color: var(--muted); font-size: .72rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.detail-meta dd { margin: 8px 0 0; font-weight: 700; }

.site-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  padding: 78px clamp(24px, 6vw, 94px) 30px;
  background: var(--pine-deep);
  color: white;
}
.site-footer > div:first-child img { width: 150px; }
.site-footer > div:first-child p { margin: 20px 0 0; color: var(--gold-pale); font-family: var(--serif); font-size: 1.15rem; }
.footer-contact { display: grid; justify-content: end; gap: 8px; text-align: right; }
.footer-contact span { margin-bottom: 4px; color: var(--gold-pale); font-size: .72rem; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.footer-contact a { text-decoration: none; }
.footer-contact address { color: rgba(255,255,255,.62); }
.footer-bottom { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 20px; margin-top: 34px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.14); color: rgba(255,255,255,.52); font-size: .75rem; }
.footer-bottom button { border: 0; background: none; color: inherit; cursor: pointer; }

dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 0;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 40px 120px rgba(0,0,0,.38);
}
dialog::backdrop { background: rgba(7,20,33,.76); backdrop-filter: blur(4px); }
.dialog-shell { position: relative; display: grid; gap: 18px; padding: 44px; }
.dialog-shell h2 { margin: 0; font-family: var(--serif); font-size: 2.5rem; line-height: 1; }
.dialog-close { position: absolute; top: 12px; right: 16px; width: 38px; height: 38px; border: 0; background: none; cursor: pointer; font-size: 1.8rem; }
.dialog-intro, .privacy-note { margin: 0; color: var(--muted); line-height: 1.65; }
.dialog-shell label { display: grid; gap: 8px; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.dialog-shell select { min-height: 48px; padding: 0 14px; border: 1px solid var(--line); background: white; }
.order-summary { padding: 18px; background: var(--paper); line-height: 1.65; }
.privacy-note { font-size: .75rem; }

[dir="rtl"] body { font-family: Tahoma, Arial, sans-serif; }
[dir="rtl"] .hero h1,
[dir="rtl"] .section-heading h2,
[dir="rtl"] .services-copy h2,
[dir="rtl"] .book-detail h1,
[dir="rtl"] .book-card h3,
[dir="rtl"] .service-item h3,
[dir="rtl"] .detail-price,
[dir="rtl"] .dialog-shell h2 { font-family: Tahoma, Arial, sans-serif; letter-spacing: -.025em; }
[dir="rtl"] .footer-contact { justify-content: start; text-align: right; }
[dir="rtl"] .detail-meta div { padding: 18px 0 18px 16px; }
[dir="rtl"] .dialog-close { right: auto; left: 16px; }

@media (max-width: 1050px) {
  .site-header { grid-template-columns: 1fr auto auto; }
  .menu-button {
    display: grid;
    gap: 5px;
    width: 42px;
    height: 42px;
    place-content: center;
    border: 0;
    background: transparent;
    cursor: pointer;
  }
  .menu-button span:not(.sr-only) { width: 22px; height: 2px; background: var(--ink); }
  .primary-nav {
    position: fixed;
    inset: 84px 0 auto;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 16px 24px 30px;
    border-bottom: 1px solid var(--line);
    background: var(--white);
  }
  .primary-nav.open { display: flex; }
  .primary-nav a { padding: 16px 0; border-bottom: 1px solid var(--line); }
  .language-switcher { margin-left: 14px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-emblem { width: min(560px, 90%); margin-inline: auto; }
  .books-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 760px) {
  .site-header { min-height: 72px; padding: 10px 18px; }
  .brand img { width: 42px; }
  .brand-copy small { display: none; }
  .brand-copy strong { font-size: 1.05rem; }
  .primary-nav { inset-block-start: 72px; }
  .language-switcher a { min-width: 32px; min-height: 30px; }
  .hero-grid { padding-top: 60px; padding-bottom: 70px; }
  .hero h1 { font-size: clamp(3.1rem, 16vw, 5rem); }
  .hero-emblem { display: none; }
  .section-heading { align-items: start; flex-direction: column; }
  .catalog-section { padding-top: 74px; padding-bottom: 84px; }
  .catalog-tools { align-items: stretch; flex-direction: column; }
  .filter-buttons { overflow-x: auto; padding-bottom: 4px; }
  .filter-buttons button { white-space: nowrap; }
  .books-grid { grid-template-columns: 1fr; gap: 54px; }
  .book-stage { width: min(390px, 100%); margin-inline: auto; }
  .book-meta-line { font-size: .66rem; }
  .book-card h3 { font-size: 1.2rem; }
  .book-card-footer { align-items: start; flex-direction: column; gap: 10px; }
  .services-section { grid-template-columns: 1fr; padding-top: 80px; padding-bottom: 80px; }
  .services-copy { position: static; }
  .detail-grid { grid-template-columns: 1fr; padding-top: 30px; }
  .detail-cover { width: min(460px, 100%); min-height: 580px; margin-inline: auto; }
  .detail-meta { grid-template-columns: 1fr; }
  .site-footer { grid-template-columns: 1fr; }
  .footer-contact { justify-content: start; text-align: left; }
  [dir="rtl"] .footer-contact { text-align: right; }
  .footer-bottom { grid-column: 1; flex-direction: column; }
  .dialog-shell { padding: 38px 24px 28px; }
}

@media (max-width: 430px) {
  .language-switcher { gap: 0; padding: 2px; }
  .language-switcher a { min-width: 29px; font-size: .65rem; }
  .book-stage { width: min(330px, 92vw); }
  .detail-cover { min-height: 500px; }
}

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

.language-switcher a {display:inline-flex;align-items:center;justify-content:center;text-decoration:none;}
.book-information {margin-top:2rem;line-height:1.8;}
.book-information h2 {font-size:1.2rem;margin:1.5rem 0 .5rem;}
.detail-description p+p {margin-top:1rem;}
.content-page {max-width:900px;margin:auto;padding:5rem 1.5rem;line-height:1.85;}
.content-page h1 {font-size:clamp(2.5rem,7vw,4rem);line-height:1.15;margin-bottom:2rem;}
.content-page h2 {font-size:1.5rem;margin:2rem 0 .5rem;}
.content-page p {margin:.8rem 0;}
