/* Palette */
:root {
  --bg: #FAF8F4;
  --bg-alt: #F1ECE2;
  --chip: #ECE7DC;
  --line: #E6E1D6;
  --ink: #1F2A26;
  --ink-2: #3A4540;
  --ink-3: #4A544F;
  --ink-4: #5B6560;
  --green: #1E5A4C;
  --green-dark: #123B31;
  --terra: #C0582F;
  --cream: #F4F0E6;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Literata', Georgia, serif;
  font-size: 20px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--green); }
a:hover { color: var(--green-dark); }
section[id] { scroll-margin-top: 84px; }
img { display: block; }

.sans { font-family: 'PT Sans', sans-serif; }
.wrap { max-width: 1240px; margin: 0 auto; }
.kicker { font-size: 0.85em; letter-spacing: 0.14em; text-transform: uppercase; }
.accent { color: var(--terra); }

/* Header */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: rgba(250, 248, 244, 0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  padding: 12px 24px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px 28px;
}
.brand { text-decoration: none; color: var(--ink); display: flex; align-items: center; gap: 12px; }
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--green); color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Literata', serif; font-size: 0.95em;
}
.brand-name { font-weight: 700; font-size: 1em; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 24px; font-size: 0.9em; }
.nav a { text-decoration: none; color: var(--ink); padding: 8px 0; }
.nav a:hover { color: var(--terra); }
.lang-switch { display: flex; background: var(--chip); border-radius: 999px; padding: 4px; font-size: 0.85em; gap: 2px; }
.lang-switch button {
  border: 0; padding: 8px 18px; min-height: 40px; border-radius: 999px; cursor: pointer;
  font-family: inherit; font-size: inherit; font-weight: 700;
  background: transparent; color: var(--ink);
}
.lang-switch button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.menu-btn {
  display: none;
  width: 48px; height: 48px; flex: none;
  border: 0; border-radius: 14px; background: var(--chip); color: var(--ink);
  align-items: center; justify-content: center; cursor: pointer;
}
.menu-btn .icon-close { display: none; }
.menu-open .menu-btn .icon-open { display: none; }
.menu-open .menu-btn .icon-close { display: block; }

/* Compact header on phones and small tablets: nav goes under the ☰ button */
@media (max-width: 900px) {
  .header-inner { flex-wrap: wrap; gap: 0 8px; padding: 8px 24px; }
  .brand { order: 1; min-width: 0; flex: 1 1 0; gap: 10px; }
  .brand-name { font-size: 0.95em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .lang-switch { order: 2; flex: none; }
  .lang-switch button { padding: 6px 12px; }
  .menu-btn { display: inline-flex; order: 3; }
  .nav {
    order: 4; display: none; flex-basis: 100%;
    flex-direction: column; gap: 0; font-size: 1.05em;
    margin-top: 8px; border-top: 1px solid var(--line);
  }
  .menu-open .nav { display: flex; }
  .nav a { padding: 14px 4px; border-bottom: 1px solid var(--line); }
  .nav a:last-child { border-bottom: 0; }
}
@media (max-width: 380px) {
  .header-inner { padding: 8px 16px; }
  .brand-mark { display: none; }
}

/* Hero */
.hero-section { padding: 40px 24px 56px; }
.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 24px; align-items: stretch;
}
.hero-card {
  background: var(--green); color: var(--cream);
  border-radius: 28px; padding: clamp(28px, 5vw, 56px);
  display: flex; flex-direction: column; justify-content: space-between; gap: 36px;
  position: relative; overflow: hidden;
}
.hero-ornament { position: absolute; right: -40px; bottom: -40px; width: 260px; height: 260px; opacity: 0.14; }
.hero-kicker { color: #E9B48F; }
.hero-title {
  margin: 0; font-weight: 500; font-size: clamp(2.4em, 6vw, 3.8em);
  line-height: 1.02; letter-spacing: -0.02em; text-wrap: balance;
}
.hero-quote { display: flex; flex-direction: column; gap: 10px; max-width: 30em; position: relative; }
.hero-quote-text { font-style: italic; font-size: 1.25em; line-height: 1.45; }
.hero-quote-src { font-size: 0.85em; color: #CFE0D8; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; position: relative; }
.btn-light, .btn-outline {
  text-decoration: none; padding: 14px 26px; border-radius: 999px; min-height: 52px;
  display: inline-flex; align-items: center; font-weight: 700;
}
.btn-light { background: var(--cream); color: var(--green); gap: 10px; }
.btn-light:hover { background: #FFFFFF; color: var(--green); }
.btn-outline { border: 1.5px solid var(--cream); color: var(--cream); }
.btn-outline:hover { background: rgba(244, 240, 230, 0.12); color: var(--cream); }
.hero-photo { position: relative; min-height: 480px; border-radius: 28px; overflow: hidden; background: var(--chip); }
.hero-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.facts {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: 20px; overflow: hidden; margin-top: 24px;
}
.fact { background: var(--bg); padding: 22px 24px; display: flex; flex-direction: column; gap: 4px; }
.fact-big { font-size: 1.6em; font-weight: 500; color: var(--terra); line-height: 1.2; }
.fact-small { font-family: 'PT Sans', sans-serif; font-size: 0.9em; color: var(--ink-3); line-height: 1.4; }
/* 4 in a row → 2×2 on medium screens → one column on phones */
@media (max-width: 1000px) { .facts { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .facts { grid-template-columns: 1fr; } }

/* Sections */
.section { padding: 56px 24px; }
.two-col {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 32px 64px;
}
.section-head { display: flex; flex-direction: column; gap: 16px; }
.section-title {
  margin: 0; font-weight: 500; font-size: clamp(2em, 4vw, 2.8em);
  line-height: 1.1; letter-spacing: -0.015em;
}
.about-text { display: flex; flex-direction: column; gap: 20px; font-size: 1.08em; max-width: 40em; }
.about-text p { margin: 0; text-wrap: pretty; color: var(--ink-2); }
.about-text .about-lead { font-size: 1.2em; line-height: 1.5; color: inherit; }

/* Books */
.books-section { background: var(--bg-alt); }
.books-inner { padding: 64px 24px; }
.books-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end;
  gap: 16px; margin-bottom: 40px;
}
.books-count { color: var(--ink-3); }
.books-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 24px;
}
.book {
  background: var(--bg); border-radius: 24px; padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
}
.book-cover {
  margin: -20px -20px 0; aspect-ratio: 4 / 5;
  border-radius: 24px 24px 0 0; overflow: hidden; background: var(--bg);
}
.book-cover img { width: 100%; height: 100%; object-fit: contain; }
.book-info { display: flex; flex-direction: column; gap: 6px; padding: 0 4px; }
.book-meta { font-family: 'PT Sans', sans-serif; font-size: 0.8em; color: var(--green); font-weight: 700; letter-spacing: 0.04em; }
.book-title { margin: 0; font-weight: 500; font-size: 1.4em; line-height: 1.2; }
.book-sub { font-style: italic; color: var(--ink-4); }
.book-sub:empty { display: none; }
.book-desc { margin: 4px 0 0; text-wrap: pretty; color: var(--ink-2); }
.btn-order {
  margin-top: auto; border: 0; background: var(--ink); color: var(--bg);
  padding: 14px 22px; min-height: 52px; border-radius: 14px;
  font-family: 'PT Sans', sans-serif; font-weight: 700; font-size: 0.95em; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
}
.btn-order:hover { background: var(--terra); }

/* New book */
.new-section { padding: 64px 24px; }
.new-card {
  background: var(--terra); color: #FFF8F0; border-radius: 32px;
  padding: clamp(28px, 5vw, 64px);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 48px; align-items: center; position: relative; overflow: hidden;
}
.new-ornament { position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 28px; opacity: 0.22; }
.new-body { display: flex; flex-direction: column; gap: 18px; position: relative; }
.new-badge {
  display: inline-flex; align-self: flex-start; background: #FFF8F0; color: #9A3F1C;
  font-weight: 700; font-size: 0.8em; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 8px 16px; border-radius: 999px;
}
.new-title {
  margin: 0; font-weight: 500; font-size: clamp(2.1em, 4.6vw, 3em);
  line-height: 1.05; letter-spacing: -0.02em; text-wrap: balance;
}
/* Phones: «балакайларым» must fit the card width */
@media (max-width: 600px) {
  .new-section { padding-inline: 16px; }
  .new-card { padding: 32px 24px; }
  .new-title { font-size: clamp(1.3em, 8.4vw, 2.1em); }
}
.new-sub { font-style: italic; font-size: 1.1em; }
.new-desc { margin: 0; text-wrap: pretty; max-width: 32em; }
.btn-new {
  align-self: flex-start; border: 0; background: var(--ink); color: #FFF8F0;
  padding: 16px 30px; min-height: 56px; border-radius: 999px;
  font-weight: 700; font-size: 1em; cursor: pointer; margin-top: 8px;
  display: inline-flex; gap: 12px; align-items: center;
}
.btn-new:hover { background: #000000; }
.new-cover {
  aspect-ratio: 2 / 3; width: 100%; max-width: 320px; justify-self: center;
  filter: drop-shadow(0 24px 30px rgba(60, 20, 5, 0.35));
  transform: rotate(3deg); position: relative;
}
.new-cover img { width: 100%; height: 100%; object-fit: contain; }

/* Contacts */
.contacts-section { padding: 32px 24px 80px; }
.contacts-grid { align-items: start; }
.contacts-lead { margin: 0; color: var(--ink-2); max-width: 24em; }
.sent-box {
  background: #E3EEE9; border-radius: 24px; padding: 32px;
  display: flex; flex-direction: column; gap: 16px; align-items: flex-start;
}
.sent-msg { font-size: 1.2em; }
.btn-again {
  border: 1.5px solid var(--green); background: transparent; color: var(--green);
  padding: 10px 22px; min-height: 48px; border-radius: 999px;
  font-weight: 700; font-size: 0.9em; cursor: pointer;
}
.contact-form {
  display: flex; flex-direction: column; gap: 16px;
  background: var(--bg-alt); border-radius: 24px; padding: 28px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-weight: 700; font-size: 0.9em; }
.field input, .field textarea {
  font: inherit; font-size: 1.05em; padding: 14px 16px;
  border: 1.5px solid transparent; border-radius: 14px;
  background: #FFFFFF; color: var(--ink); outline: none;
}
.field input { min-height: 56px; }
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--green); }
.btn-submit {
  border: 0; background: var(--green); color: var(--bg);
  padding: 16px 30px; min-height: 56px; border-radius: 14px;
  font-weight: 700; font-size: 1em; cursor: pointer;
}
.btn-submit:hover { background: var(--green-dark); }

/* Footer */
.site-footer { background: var(--ink); color: #C9D1CC; }
.footer-inner {
  padding: 28px 24px; display: flex; flex-wrap: wrap; justify-content: space-between;
  gap: 12px; font-size: 0.85em;
}

/* Order modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(20, 28, 25, 0.6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px; overflow-y: auto;
}
.modal {
  background: var(--bg); border-radius: 28px; max-width: 560px; width: 100%;
  padding: 28px 24px; display: flex; flex-direction: column; gap: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35); position: relative;
  max-height: calc(100vh - 32px); overflow-y: auto;
}
.modal-close {
  position: absolute; top: 14px; right: 14px; width: 48px; height: 48px;
  border: 0; border-radius: 50%; background: var(--chip);
  font-size: 1.5em; line-height: 1; cursor: pointer; color: var(--ink);
}
.modal-kicker { font-size: 0.8em; letter-spacing: 0.12em; text-transform: uppercase; color: var(--terra); font-weight: 700; }
.modal-book { margin: 0; padding-right: 52px; font-weight: 500; font-size: 1.5em; line-height: 1.2; }
.modal-field { display: flex; flex-direction: column; gap: 6px; }
.modal-field > span { font-size: 0.9em; color: var(--ink-3); }
.modal-field textarea {
  font: inherit; font-size: 1em; padding: 14px 16px; border: 0; border-radius: 14px;
  background: var(--bg-alt); color: var(--ink); resize: vertical;
}
.modal-choose { font-weight: 700; font-size: 0.95em; }
.modal-channels {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px; font-weight: 700;
}
.ch {
  text-decoration: none; color: #FFFFFF; padding: 14px; min-height: 60px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 1em;
}
.ch:hover { color: #FFFFFF; }
.ch-wa { background: #1F7A45; }
.ch-wa:hover { background: #17613A; }
.ch-tg { background: #23689A; }
.ch-tg:hover { background: #1B5580; }
.ch-mail { background: var(--ink); }
.ch-mail:hover { background: #000000; }
.modal-note { font-size: 0.85em; color: var(--ink-4); line-height: 1.45; }
.modal-copied { font-size: 0.9em; color: #1F7A45; font-weight: 700; }
