/* ============================================================
   СЦЕНАРИЙ.АРТ — стиль «писательская мастерская»
   Бумага, чернила, рукописные акценты
   ============================================================ */

:root {
  --paper:       #f6efe1;   /* тёплая бумага */
  --paper-warm:  #f0e6d0;   /* бумага темнее */
  --paper-card:  #fbf6ea;   /* карточки */
  --ink:         #2b241a;   /* чернила */
  --ink-soft:    #5c5142;   /* выцветшие чернила */
  --ink-faint:   #8a7d68;   /* совсем бледные */
  --accent:      #b0512b;   /* сургуч / терракота */
  --accent-dark: #8f3e1f;
  --gold:        #b98f2f;   /* золотое перо */
  --teal:        #3e6257;   /* чернила зелёные, для акцентов */
  --line:        #d9cbae;   /* линия на бумаге */

  --font-head: "Cormorant Garamond", Georgia, serif;
  --font-body: "PT Serif", Georgia, serif;
  --font-hand: "Caveat", cursive;

  --shadow-card: 0 1px 2px rgba(43, 36, 26, .08), 0 8px 24px rgba(43, 36, 26, .10);
  --shadow-lift: 0 2px 4px rgba(43, 36, 26, .10), 0 16px 40px rgba(43, 36, 26, .16);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--paper);
  /* фактура бумаги: лёгкий шум + тёплые пятна */
  background-image:
    radial-gradient(ellipse 80% 60% at 15% 0%, rgba(185, 143, 47, .07), transparent 60%),
    radial-gradient(ellipse 70% 50% at 90% 90%, rgba(176, 81, 43, .06), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  line-height: 1.65;
  font-size: 17px;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- Типографика ---------- */

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.15; }

.hand { font-family: var(--font-hand); font-weight: 500; }

.section-label {
  font-family: var(--font-hand);
  font-size: 1.6rem;
  color: var(--accent);
  display: inline-block;
  transform: rotate(-2deg);
  margin-bottom: 4px;
}

.section-title {
  font-size: clamp(2rem, 4.5vw, 3rem);
  margin-bottom: 14px;
}

.section-head { margin-bottom: 44px; }
.section-head.centered { text-align: center; }

.section-head p.lead {
  color: var(--ink-soft);
  max-width: 640px;
  font-size: 1.06rem;
}
.section-head.centered p.lead { margin: 0 auto; }

/* Чернильный росчерк под заголовками */
.flourish {
  width: 150px; height: 14px;
  margin-top: 10px;
  color: var(--gold);
}
.centered .flourish { margin-left: auto; margin-right: auto; }

/* ---------- Шапка ---------- */

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(246, 239, 225, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
  gap: 20px;
}

.logo {
  display: flex; align-items: baseline; gap: 10px;
  text-decoration: none; color: var(--ink);
}
.logo .logo-mark {
  font-family: var(--font-hand);
  font-size: 2rem; line-height: 1;
  color: var(--accent);
  transform: rotate(-4deg);
}
.logo .logo-text { font-family: var(--font-head); font-size: 1.45rem; font-weight: 700; letter-spacing: .01em; }
.logo .logo-text em { font-style: normal; color: var(--accent); }

.main-nav { display: flex; gap: 26px; align-items: center; }
.main-nav a {
  text-decoration: none; color: var(--ink-soft);
  font-size: 1rem;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}
.main-nav a:hover, .main-nav a.active { color: var(--ink); border-color: var(--gold); }

.nav-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  font-size: 1.7rem; color: var(--ink);
  line-height: 1;
}

/* ---------- Кнопки ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 1rem;
  text-decoration: none;
  border-radius: 3px;
  padding: 12px 26px;
  cursor: pointer;
  transition: transform .15s, box-shadow .2s, background .2s;
  border: none;
}
.btn-primary {
  background: var(--accent);
  color: #fdf8ee;
  box-shadow: 0 3px 0 var(--accent-dark);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 5px 0 var(--accent-dark); }
.btn-primary:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--accent-dark); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--ink-soft);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-small { padding: 8px 18px; font-size: .95rem; }

/* ---------- Герой ---------- */

.hero {
  position: relative;
  padding: 84px 0 90px;
  overflow: hidden;
}

.hero-inner { position: relative; max-width: 760px; }

.hero .overline {
  font-family: var(--font-hand);
  font-size: 1.7rem;
  color: var(--teal);
  transform: rotate(-1.5deg);
  display: inline-block;
  margin-bottom: 8px;
}

.hero h1 {
  font-size: clamp(2.6rem, 6.5vw, 4.6rem);
  font-weight: 700;
  margin-bottom: 22px;
}
.hero h1 .accent {
  color: var(--accent);
  font-style: italic;
  position: relative;
  white-space: nowrap;
}
.hero h1 .accent svg {
  position: absolute; left: 0; bottom: -0.18em;
  width: 100%; height: .22em;
  color: var(--gold);
}

.hero p.sub {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 560px;
  margin-bottom: 34px;
}

.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }

.hero-note {
  margin-top: 30px;
  font-family: var(--font-hand);
  font-size: 1.35rem;
  color: var(--ink-faint);
  transform: rotate(-1deg);
  display: inline-block;
}

/* чернильная клякса и перо в герое */
.hero-decor {
  position: absolute; right: -40px; top: 30px;
  width: 380px; max-width: 42vw;
  color: var(--ink);
  opacity: .9;
  pointer-events: none;
}

/* ---------- Лента-стамп с наградами ---------- */

.ribbon {
  background: var(--ink);
  color: #efe6d2;
  padding: 14px 0;
  overflow: hidden;
}
.ribbon-track {
  display: flex; gap: 48px;
  white-space: nowrap;
  animation: ribbon-scroll 30s linear infinite;
  width: max-content;
}
.ribbon-track span {
  font-family: var(--font-head);
  font-size: 1.05rem;
  letter-spacing: .06em;
  display: inline-flex; align-items: center; gap: 12px;
}
.ribbon-track .star { color: var(--gold); }
@keyframes ribbon-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- Секции ---------- */

.section { padding: 84px 0; }
.section.tinted {
  background:
    linear-gradient(rgba(240, 230, 208, .55), rgba(240, 230, 208, .55));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

/* ---------- Карточки произведений ---------- */

.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
}

.work-card {
  position: relative;
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 26px 26px 22px;
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column;
  transition: transform .2s, box-shadow .25s;
}
.work-card:hover { transform: translateY(-5px) rotate(-.3deg); box-shadow: var(--shadow-lift); }

/* «скотч» сверху карточки */
.work-card::before {
  content: "";
  position: absolute; top: -10px; left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 92px; height: 22px;
  background: rgba(185, 143, 47, .25);
  border-left: 1px dashed rgba(43,36,26,.15);
  border-right: 1px dashed rgba(43,36,26,.15);
}

.work-cat {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .85rem;
  color: var(--teal);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.work-card h3 {
  font-size: 1.5rem;
  margin-bottom: 4px;
}
.work-card .subtitle {
  font-size: .95rem;
  color: var(--ink-faint);
  margin-bottom: 14px;
}
.work-card .desc {
  color: var(--ink-soft);
  font-size: .98rem;
  flex-grow: 1;
}

.work-tags {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 16px 0;
}
.work-tags span {
  font-size: .82rem;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 3px 12px;
  background: rgba(255,255,255,.4);
}

.work-foot {
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px dashed var(--line);
  padding-top: 16px;
  gap: 10px;
}
.work-price {
  font-family: var(--font-head);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--ink);
}
.work-price small { font-size: .85rem; color: var(--ink-faint); font-weight: 400; }

/* ---------- Фильтры каталога ---------- */

.filters {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-bottom: 20px;
}
.filter-chip {
  font-family: var(--font-body);
  font-size: .97rem;
  background: transparent;
  color: var(--ink-soft);
  border: 1.5px solid var(--line);
  border-radius: 24px;
  padding: 8px 20px;
  cursor: pointer;
  transition: all .2s;
}
.filter-chip:hover { border-color: var(--gold); color: var(--ink); }
.filter-chip.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  transform: rotate(-1deg);
}

.search-box { margin-bottom: 36px; }
.search-box input {
  width: 100%; max-width: 420px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper-card);
  border: 1.5px solid var(--line);
  border-radius: 3px;
  padding: 11px 16px;
}
.search-box input:focus { outline: none; border-color: var(--gold); }
.search-box input::placeholder { color: var(--ink-faint); }

.catalog-empty {
  text-align: center;
  color: var(--ink-faint);
  font-family: var(--font-hand);
  font-size: 1.6rem;
  padding: 60px 0;
}

/* ---------- Цифры ---------- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  text-align: center;
}
.stat .num {
  font-family: var(--font-head);
  font-size: clamp(2.6rem, 5vw, 3.6rem);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.stat .lbl { color: var(--ink-soft); margin-top: 8px; font-size: 1rem; }

/* ---------- Как заказать ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 30px;
  counter-reset: step;
}
.step {
  position: relative;
  padding: 26px 24px 24px;
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow-card);
}
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute; top: -20px; left: 20px;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent);
  color: #fdf8ee;
  font-family: var(--font-hand);
  font-size: 1.7rem;
  border-radius: 50%;
  transform: rotate(-6deg);
  box-shadow: 0 3px 8px rgba(143, 62, 31, .35);
}
.step h3 { font-size: 1.3rem; margin: 10px 0 8px; }
.step p { color: var(--ink-soft); font-size: .97rem; }

/* ---------- Отзывы ---------- */

.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
}
.review {
  background: var(--paper-card);
  border: 1px solid var(--line);
  padding: 28px 26px 22px;
  border-radius: 3px;
  box-shadow: var(--shadow-card);
  position: relative;
}
.review:nth-child(odd)  { transform: rotate(-.7deg); }
.review:nth-child(even) { transform: rotate(.6deg); }
.review::before {
  content: "«";
  position: absolute; top: 2px; left: 14px;
  font-family: var(--font-head);
  font-size: 4.5rem;
  color: var(--gold);
  opacity: .45;
  line-height: 1;
}
.review p { color: var(--ink-soft); font-style: italic; margin-bottom: 16px; position: relative; }
.review .author {
  font-family: var(--font-hand);
  font-size: 1.35rem;
  color: var(--ink);
}
.review .role { font-size: .88rem; color: var(--ink-faint); }

/* ---------- Фрагмент-цитата (стихи) ---------- */

.poem-feature {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  padding: 20px 20px 0;
}
.poem-feature blockquote {
  font-family: var(--font-head);
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  font-style: italic;
  line-height: 1.55;
  white-space: pre-line;
}
.poem-feature .poem-author {
  margin-top: 20px;
  font-family: var(--font-hand);
  font-size: 1.5rem;
  color: var(--accent);
}

/* ---------- Соцсети ---------- */

.socials-row {
  display: flex; flex-wrap: wrap; gap: 18px;
  justify-content: center;
}
.social-link {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: 40px;
  padding: 10px 22px 10px 12px;
  box-shadow: var(--shadow-card);
  transition: transform .15s, box-shadow .2s;
  font-size: 1rem;
}
.social-link:hover { transform: translateY(-3px) rotate(-1deg); box-shadow: var(--shadow-lift); }
.social-link .ic {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.social-link .ic svg { width: 18px; height: 18px; fill: currentColor; }
.ic-tg { background: #2aabee; }
.ic-yt { background: #ff0000; }
.ic-vk { background: #0077ff; }
.ic-ok { background: #ee8208; }
.ic-ig { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.ic-tt { background: #111; }

/* ---------- Контакты / CTA ---------- */

.cta-band {
  background: var(--ink);
  color: #efe6d2;
  padding: 70px 0;
  position: relative;
  overflow: hidden;
}
.cta-band .section-label { color: var(--gold); }
.cta-band h2 { color: #f6efe1; }
.cta-band p { color: #c9bda5; max-width: 560px; }
.cta-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 40px; flex-wrap: wrap;
}
.cta-contacts { display: flex; flex-direction: column; gap: 10px; font-size: 1.1rem; }
.cta-contacts a { color: #efe6d2; text-decoration: none; border-bottom: 1px dashed rgba(239,230,210,.4); }
.cta-contacts a:hover { color: var(--gold); border-color: var(--gold); }

/* ---------- Подвал ---------- */

.site-footer {
  padding: 36px 0;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: .93rem;
}
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
}
.footer-inner .hand { font-size: 1.3rem; color: var(--ink-soft); }

/* ---------- Модальное окно произведения ---------- */

.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(43, 36, 26, .55);
  display: none;
  align-items: flex-start; justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--paper-card);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  max-width: 680px; width: 100%;
  border-radius: 4px;
  box-shadow: 0 24px 80px rgba(0,0,0,.35);
  padding: 40px 42px 34px;
  position: relative;
  animation: modal-in .25s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}

.modal-close {
  position: absolute; top: 14px; right: 16px;
  background: none; border: none;
  font-size: 1.9rem; line-height: 1;
  color: var(--ink-faint);
  cursor: pointer;
}
.modal-close:hover { color: var(--accent); }

.modal .work-cat { margin-bottom: 6px; }
.modal h3 { font-size: 2rem; margin-bottom: 2px; }
.modal .subtitle { color: var(--ink-faint); margin-bottom: 18px; }
.modal .desc { color: var(--ink-soft); margin-bottom: 18px; }

.modal .excerpt {
  font-family: var(--font-head);
  font-style: italic;
  font-size: 1.12rem;
  white-space: pre-line;
  border-left: 3px solid var(--gold);
  padding: 6px 0 6px 18px;
  margin-bottom: 20px;
  color: var(--ink);
}

.modal .work-tags { margin: 0 0 22px; }

.modal-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  border-top: 1px dashed var(--line);
  padding-top: 20px;
}
.modal-note { font-size: .85rem; color: var(--ink-faint); margin-top: 14px; }

/* ---------- Появление при скролле ---------- */

.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Страница каталога: заголовок ---------- */

.page-hero { padding: 64px 0 40px; }
.page-hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-bottom: 10px; }
.page-hero p { color: var(--ink-soft); max-width: 620px; }

/* ---------- Адаптив ---------- */

@media (max-width: 820px) {
  .main-nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    padding: 18px 24px;
    gap: 16px;
    align-items: flex-start;
    box-shadow: 0 12px 24px rgba(43,36,26,.12);
  }
  .main-nav.open { display: flex; }
  .nav-toggle { display: block; }
  .hero { padding: 56px 0 64px; }
  .hero-decor { display: none; }
  .section { padding: 60px 0; }
  .modal { padding: 30px 22px 26px; }
  .cta-inner { flex-direction: column; align-items: flex-start; }
}
