/* Ziyodosh — ziyodosh.uz ommaviy sayti */
:root {
  --brand: #2f9e6b;
  --brand-dark: #237a52;
  --brand-soft: #e6f5ec;
  --leaf: #b2f2bb;
  --gift: #e8590c;
  --gift-soft: #fff0e6;
  --rent: #1c7ed6;
  --rent-soft: #e7f1fc;
  --bg: #fbfaf6;
  --surface: #ffffff;
  --surface-2: #f3f2ec;
  --text: #1c211e;
  --muted: #66706a;
  --line: rgba(28, 33, 30, 0.1);
  --shadow: 0 1px 2px rgba(20, 40, 30, .06), 0 4px 16px rgba(20, 40, 30, .06);
  --radius: 14px;
  --wrap: 1680px;
  --gutter: clamp(20px, 4.5vw, 88px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #3fb57f;
    --brand-dark: #6fd3a3;
    --brand-soft: #173a2a;
    --gift: #ff8a4c;
    --gift-soft: #3a2417;
    --rent: #5aa9f0;
    --rent-soft: #172b3d;
    --bg: #121614;
    --surface: #1a1f1c;
    --surface-2: #222824;
    --text: #e8ece9;
    --muted: #9aa49e;
    --line: rgba(232, 236, 233, 0.1);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--brand-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.2vw, 4rem); }
h2 { font-size: clamp(1.5rem, 2.4vw, 2.6rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* --- Sarlavha ------------------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--brand); font-weight: 750; font-size: 1.3rem; }
.logo svg { width: 36px; height: 36px; flex: none; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  color: var(--text); text-decoration: none; padding: 8px 12px; border-radius: 10px; font-size: .95rem;
}
.nav a:hover { background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--brand-dark); background: var(--brand-soft); font-weight: 600; }
.menu-btn { display: none; margin-left: auto; background: none; border: 0; color: var(--text); padding: 8px; cursor: pointer; }
@media (max-width: 820px) {
  .menu-btn { display: block; }
  .nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column;
    background: var(--bg); padding: 8px 16px 16px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .nav.open { display: flex; }
  .site-header .btn { display: none; }
}

/* --- Tugmalar ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 12px; border: 1px solid transparent;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
  background: var(--brand); color: #fff; transition: background .15s, transform .1s;
}
.btn:hover { background: var(--brand-dark); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.lg { padding: 14px 26px; font-size: 1.05rem; }
.btn svg { width: 20px; height: 20px; }
@media (prefers-color-scheme: dark) { .btn:hover { color: #0c1a12; } }

/* --- Bosh sahifa --------------------------------------------------------- */
.hero {
  padding: clamp(48px, 7vw, 120px) 0 clamp(40px, 6vw, 104px); position: relative; overflow: hidden;
  background:
    radial-gradient(ellipse 55% 70% at 85% 45%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 70%),
    radial-gradient(ellipse 40% 60% at 0% 100%, color-mix(in srgb, var(--leaf) 30%, transparent), transparent 70%),
    var(--bg);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(color-mix(in srgb, var(--brand) 22%, transparent) 1.2px, transparent 1.2px);
  background-size: 26px 26px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 45%, #000 100%);
          mask-image: linear-gradient(90deg, transparent 0%, #000 45%, #000 100%);
}
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(32px, 5vw, 96px); align-items: center; }
.hero .eyebrow {
  display: inline-block; padding: 5px 12px; border-radius: 99px; background: var(--brand-soft);
  color: var(--brand-dark); font-weight: 600; font-size: .85rem; margin-bottom: 18px;
}
.hero h1 span { color: var(--brand); }
.hero .lead { font-size: clamp(1.1rem, 1.25vw, 1.4rem); color: var(--muted); max-width: 36em; margin-bottom: 32px; }
.hero .ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-art { position: relative; aspect-ratio: 1; max-width: min(560px, 100%); justify-self: center; width: 100%; }
.hero-art .stack { position: absolute; inset: 0; }
.hero-art .cv {
  position: absolute; width: 46%; aspect-ratio: 3/4; border-radius: 10px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 14px; color: #fff;
  font-weight: 700; font-size: clamp(.95rem, 1.1vw, 1.2rem); line-height: 1.2;
}
.hero-art .cv small { font-weight: 500; opacity: .85; font-size: .75rem; margin-top: 4px; }
.hero-art .cv.photo { padding: 0; overflow: hidden; background: var(--surface) !important; }
.hero-art .cv.photo img { width: 100%; height: 100%; object-fit: cover; }
.hero-art .cv.photo:hover { z-index: 4; }
.hero-art .cv:nth-child(1) { left: 4%; top: 14%; transform: rotate(-9deg); background: linear-gradient(160deg, #2f9e6b, #1f6b49); }
.hero-art .cv:nth-child(2) { left: 30%; top: 4%; transform: rotate(3deg); background: linear-gradient(160deg, #e8590c, #b8430a); z-index: 2; }
.hero-art .cv:nth-child(3) { left: 50%; top: 26%; transform: rotate(11deg); background: linear-gradient(160deg, #1c7ed6, #155fa3); }
.hero-art .badge {
  position: absolute; left: 0; bottom: 4%; z-index: 3; background: var(--surface); color: var(--text);
  border-radius: 14px; padding: 12px 16px; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center;
  font-size: .9rem;
}
.hero-art .badge b { display: block; font-size: 1.2rem; color: var(--brand); }
@media (max-width: 820px) {
  .hero { padding: 40px 0 32px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 24px; }
  .hero-art { max-width: 300px; }
}

section.block { padding: clamp(48px, 5vw, 96px) 0; }
section.block.alt { background: var(--surface-2); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.section-head p { margin: 0; color: var(--muted); max-width: 40em; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.stat b { display: block; font-size: clamp(2rem, 2.6vw, 3rem); line-height: 1.1; color: var(--brand); font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .95rem; }
@media (max-width: 820px) { .stats { grid-template-columns: repeat(2, 1fr); } }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 1.6vw, 28px); counter-reset: step; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(22px, 2vw, 36px); position: relative; }
.step::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--brand); color: #fff; font-weight: 700; margin-bottom: 14px;
}
.step p { color: var(--muted); margin: 0; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }

.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(14px, 1.4vw, 24px); }
@media (min-width: 1400px) { .features { grid-template-columns: repeat(4, 1fr); } .feature { flex-direction: column; } }
.feature { display: flex; gap: 14px; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.feature .ic { font-size: 1.6rem; line-height: 1; flex: none; }
.feature h3 { margin-bottom: 4px; }
.feature p { color: var(--muted); margin: 0; font-size: .95rem; }
@media (max-width: 820px) { .features { grid-template-columns: 1fr; } }

.cta-band {
  background: linear-gradient(135deg, var(--brand), #1f6b49); color: #fff; border-radius: 20px;
  padding: clamp(28px, 3.5vw, 64px); display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.cta-band h2 { margin: 0 0 6px; }
.cta-band p { margin: 0; opacity: .9; }
.cta-band .btn { background: #fff; color: #1f6b49; }
.cta-band .btn:hover { background: var(--leaf); color: #12402b; }

.bars { display: grid; gap: 10px; }
.bar { display: grid; grid-template-columns: 160px 1fr 40px; gap: 12px; align-items: center; font-size: .95rem; }
.bar .track { height: 10px; background: var(--surface); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.bar .fill { height: 100%; background: var(--brand); border-radius: 99px; }
.bar .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }

/* --- Kitob kartochkalari ------------------------------------------------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(180px, 13vw, 240px), 1fr)); gap: clamp(16px, 1.5vw, 28px); }
@media (max-width: 520px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card .body { padding: 10px; }
  .cover .ph { padding: 12px; font-size: .9rem; }
}
.card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit;
  transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card h3 { font-size: 1rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .author { color: var(--muted); font-size: .9rem; }
.card .place { color: var(--muted); font-size: .82rem; margin-top: auto; padding-top: 6px; }

.cover { position: relative; aspect-ratio: 3/4; background: var(--surface-2); overflow: hidden; }
.cover img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.cover .ph {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 16px; color: #fff; font-weight: 700; line-height: 1.2;
}
.cover .ph small { font-weight: 500; opacity: .85; margin-top: 6px; font-size: .8rem; }
.cover .ph::before {
  content: ""; position: absolute; left: 10px; top: 0; bottom: 0; width: 3px; background: rgba(255, 255, 255, .25);
}
.cover .tags { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; gap: 6px; flex-wrap: wrap; z-index: 2; }

.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; font-size: .78rem; font-weight: 600; }
.tag.gift { background: var(--gift-soft); color: var(--gift); }
.tag.rent { background: var(--rent-soft); color: var(--rent); }
.cover .tag { box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }

.skeleton .cover, .skeleton .line { background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; }
.skeleton .line { height: 12px; border-radius: 6px; margin: 4px 0; }
@keyframes sk { to { background-position: -200% 0; } }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty b { display: block; font-size: 1.1rem; color: var(--text); margin-bottom: 6px; }

/* --- Katalog filtrlari --------------------------------------------------- */
.page-head { padding: 40px 0 8px; }
.page-head p { color: var(--muted); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 24px; }
.filters .search { flex: 1 1 280px; position: relative; }
.filters input, .filters select {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px;
}
.filters .search input { padding-left: 40px; }
.filters .search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.filters select { flex: 0 1 190px; width: auto; }
.filters input:focus, .filters select:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.result-info { color: var(--muted); font-size: .95rem; margin-bottom: 14px; }
.more { display: flex; justify-content: center; margin: 28px 0 8px; }

/* --- Kitob sahifasi ------------------------------------------------------ */
.book { display: grid; grid-template-columns: clamp(280px, 24vw, 400px) 1fr; gap: 40px; padding: 40px 0 56px; }
.book .cover { border-radius: var(--radius); box-shadow: var(--shadow); }
.book h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin-bottom: 6px; }
.book .author { font-size: 1.15rem; color: var(--muted); margin-bottom: 16px; }
.book .tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.book .tag { font-size: .9rem; padding: 5px 12px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; }
.facts div { background: var(--surface); padding: 12px 14px; }
.facts dt { font-size: .8rem; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 600; }
.book .desc { white-space: pre-line; margin-bottom: 20px; }
.book .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.note { font-size: .9rem; color: var(--muted); background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.mini-map { height: 220px; border-radius: var(--radius); overflow: hidden; margin-top: 20px; border: 1px solid var(--line); z-index: 0; }
.crumbs { font-size: .9rem; color: var(--muted); padding-top: 24px; }
.crumbs a { color: var(--muted); }
@media (max-width: 820px) {
  .book { grid-template-columns: 1fr; gap: 24px; padding-top: 20px; }
  .book .cover { max-width: 260px; }
}

/* --- Xarita sahifasi ----------------------------------------------------- */
.map-page { position: relative; height: calc(100vh - 64px); height: calc(100dvh - 64px); }
#map { position: absolute; inset: 0; z-index: 0; }
.map-bar {
  position: absolute; top: 12px; left: 12px; z-index: 500; display: flex; gap: 8px; flex-wrap: wrap;
  max-width: calc(100% - 24px);
}
.map-bar select, .map-bar .count {
  font: inherit; font-size: .95rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; box-shadow: var(--shadow);
}
.map-panel {
  position: absolute; z-index: 600; right: 12px; top: 12px; width: 340px; max-width: calc(100% - 24px);
  background: var(--surface); border-radius: 16px; box-shadow: 0 8px 30px rgba(0, 0, 0, .2); overflow: hidden;
}
.map-panel .row { display: flex; gap: 14px; padding: 14px; }
.map-panel .cover { width: 96px; flex: none; border-radius: 8px; }
.map-panel h3 { margin: 0 0 2px; }
.map-panel .author { color: var(--muted); font-size: .9rem; margin-bottom: 8px; }
.map-panel .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.map-panel .actions { display: flex; gap: 8px; padding: 0 14px 14px; }
.map-panel .actions .btn { flex: 1; padding: 9px 12px; font-size: .95rem; }
.map-panel .x { position: absolute; top: 6px; right: 8px; background: none; border: 0; font-size: 22px; color: var(--muted); cursor: pointer; }
@media (max-width: 640px) {
  .map-panel { top: auto; bottom: 12px; left: 12px; right: 12px; width: auto; }
}
.pin {
  width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
}
.pin span { transform: rotate(45deg); font-size: 14px; }
.pin.gift { background: var(--gift); }
.pin.rent { background: var(--rent); }
.pin.both { background: var(--brand); }
.uz-mask { fill: var(--surface-2); fill-opacity: .94; }
.leaflet-container { font: inherit; background: var(--surface-2); }

/* --- Matnli sahifa ------------------------------------------------------- */
.prose { max-width: calc(760px + 2 * var(--gutter)); padding-top: 40px; padding-bottom: 64px; }
.prose h2 { font-size: 1.3rem; margin-top: 1.8em; }
.prose li { margin-bottom: .4em; }

/* --- Pastki qism --------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0; color: var(--muted); font-size: .92rem; }
.site-footer .wrap { display: flex; gap: 24px; justify-content: space-between; flex-wrap: wrap; align-items: center; }
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }

/* --- Animatsiya (assets/anim.js) ---------------------------------------- */
/* GSAP ishga tushguncha hero elementlari yashirin (miltillash bo‘lmasligi uchun) */
.anim .hero h1, .anim .hero .lead, .anim .hero .ctas, .anim .hero-art { visibility: hidden; }
.hero-art .cv.photo { cursor: pointer; }
.hero-art .stack { will-change: transform; }
