/* Мультгерой — сайт как выпуск детского журнала картинок.
   Пять красок печати без промежуточных тонов по белой мелованной бумаге страниц;
   кремовая бумага — только купон и документы; жёлтый — только путь покупки. */

@font-face {
  font-family: "Montserrat";
  src: url("/pay/montserrat-black.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --blue: #2a4fd6;
  --yellow: #ffd23f;
  --red: #ff5a4e;
  --green: #18b48a;
  --ink: #14213d;
  --paper: #fff6e0;
  --white: #ffffff;

  --display: "Montserrat", "Arial Black", sans-serif;
  --text: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --line: 3px;
  --radius: 18px;
  --gap: clamp(1rem, 3vw, 1.5rem);
  --section: clamp(3.5rem, 9vw, 6.5rem);
  --wrap: 72rem;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--ink) var(--paper);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--white);
  caret-color: var(--blue);
  accent-color: var(--blue);
}

::selection { background: var(--green); color: var(--ink); }

img, video, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 3px; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.cover :focus-visible, .spread-blue :focus-visible, .buy :focus-visible, .foot :focus-visible { outline-color: var(--white); }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin: 0;
}

p { margin: 0; text-wrap: pretty; }

.wrap { width: min(100% - 2 * var(--gap), var(--wrap)); margin-inline: auto; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--yellow); color: var(--ink); padding: 0.6rem 1rem; border-radius: 10px; font-weight: 700;
}
.skip:focus { top: 1rem; }

/* ——— Шапка выпуска ——— */

.masthead {
  background: var(--blue);
  color: var(--white);
  border-bottom: var(--line) solid var(--ink);
}
.masthead .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 4rem; padding-block: 0.5rem;
}
.logo {
  font-family: var(--display); font-weight: 900; font-size: 1.5rem; letter-spacing: -0.03em;
  text-decoration: none; color: var(--white);
  display: inline-flex; align-items: center; gap: 0.5rem;
}
.logo svg { width: 1.9rem; height: 1.9rem; flex: none; }
.issue { color: var(--white); font-size: 0.875rem; white-space: nowrap; }
.masthead nav { display: flex; gap: 1.25rem; font-weight: 600; font-size: 0.95rem; }
.masthead nav a { text-decoration: none; color: var(--white); }
.masthead nav a:hover { text-decoration: underline; }
@media (max-width: 760px) { .masthead nav { display: none; } }

/* ——— Обложка ——— */

.cover {
  position: relative;
  background-color: var(--blue);
  /* Растровая точка офсета — фактура обложки */
  background-image: radial-gradient(rgb(20 33 61 / 0.28) 2.4px, transparent 2.7px);
  background-size: 12px 12px;
  color: var(--white);
  border-bottom: var(--line) solid var(--ink);
  overflow: hidden;
}
.cover .wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.5rem, 4vw, 2.5rem);
  padding-block: clamp(2rem, 6vw, 4.5rem) clamp(2.5rem, 7vw, 5rem);
}
.cover h1 {
  font-size: clamp(2.6rem, 8.4vw, 5.6rem);
  letter-spacing: -0.035em;
  color: var(--white);
}
.cover-lead { font-size: clamp(1.1rem, 2.2vw, 1.3rem); max-width: 34ch; color: var(--white); }

.cover-art { position: relative; justify-self: center; width: min(78vw, 360px); }
.cover-frame {
  position: relative;
  border: 6px solid var(--white);
  border-radius: var(--radius);
  outline: var(--line) solid var(--ink);
  rotate: -3deg;
  background: var(--ink);
  overflow: hidden;
  aspect-ratio: 432 / 756;
}
/* Приводка: красная форма печати сдвинута на пару миллиметров */
.cover-art::before {
  content: ""; position: absolute; inset: 0;
  border-radius: calc(var(--radius) + 6px);
  background: var(--red);
  rotate: -3deg; translate: 12px 12px;
}
.cover-frame img, .cover-frame video { width: 100%; height: 100%; object-fit: cover; }

.sticker {
  position: absolute; z-index: 2;
  font-family: var(--display); font-weight: 900; line-height: 1.05;
  color: var(--ink); background: var(--white);
  border: var(--line) solid var(--ink); border-radius: 999px;
  padding: 0.55rem 1rem; font-size: clamp(0.85rem, 1.8vw, 1rem);
  max-width: 13rem; text-align: center;
}
.sticker-a { top: 7%; left: -12%; rotate: -8deg; background: var(--green); }
.sticker-b { top: 46%; right: -16%; rotate: 7deg; background: var(--white); }
.sticker-c { bottom: 7%; left: -8%; rotate: -4deg; background: var(--red); font-size: clamp(1.1rem, 2.4vw, 1.4rem); }
@media (max-width: 520px) { .sticker-a { left: -4%; } .sticker-b { right: -4%; } .sticker-c { left: -2%; } }


@media (min-width: 900px) {
  .cover .wrap {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
    grid-template-areas: "title art" "lead art" "cta art";
    align-items: center;
    column-gap: clamp(2rem, 4vw, 3.5rem);
  }
  .cover h1 { grid-area: title; align-self: end; font-size: clamp(3rem, 5.6vw, 5.4rem); }
  .cover-lead { grid-area: lead; }
  .cover .coupon-cta { grid-area: cta; align-self: start; }
  .cover-art { grid-area: art; width: 100%; margin-inline: 2rem 3rem; }
}

/* ——— Купон: путь покупки, единственное место жёлтого ——— */

.coupon-cta {
  display: inline-grid; grid-template-columns: auto auto; align-items: center; gap: 0.25rem 1rem;
  justify-self: start;
  background: var(--yellow); color: var(--ink);
  border: var(--line) solid var(--ink); border-radius: var(--radius);
  outline: 2px dashed var(--yellow); outline-offset: 6px;
  padding: 0.9rem 1.2rem 0.9rem 1.3rem;
  text-decoration: none;
  transition: translate 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.coupon-cta:hover { translate: 0 -3px; }
.coupon-cta .cta-label { font-family: var(--display); font-weight: 900; font-size: 1.25rem; line-height: 1.1; }
.coupon-cta .cta-price { font-size: 0.95rem; grid-column: 1; }
.coupon-cta svg { grid-row: span 2; width: 2rem; height: 2rem; }

/* ——— Полоса комикса: как получить ——— */

.section { padding-block: var(--section); }
.section-head { display: grid; gap: 0.75rem; margin-bottom: clamp(1.75rem, 4vw, 2.75rem); max-width: 40rem; }
.section-head h2 { font-size: clamp(2rem, 5vw, 3.25rem); }
.section-head p { font-size: 1.1rem; }

.strip {
  display: grid; grid-template-columns: 1fr; gap: 0;
  border: var(--line) solid var(--ink); border-radius: var(--radius);
  background: var(--white);
  margin: 0; padding: 0; list-style: none;
  counter-reset: panel;
}
.panel {
  position: relative; display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; align-items: center;
  padding: 1.25rem;
  counter-increment: panel;
}
.panel + .panel { border-top: var(--line) solid var(--ink); }
.panel svg { width: 100%; height: auto; }
.panel h3 { font-size: 1.3rem; margin-bottom: 0.35rem; }
.panel h3::before {
  content: counter(panel);
  display: inline-grid; place-items: center;
  width: 1.9rem; height: 1.9rem; margin-right: 0.5rem; vertical-align: 0.1em;
  background: var(--red); border: 2px solid var(--ink); border-radius: 50%;
  font-size: 1rem;
}
@media (min-width: 820px) {
  .strip { grid-template-columns: repeat(3, 1fr); }
  .panel { grid-template-columns: 1fr; align-content: start; padding: 1.5rem; }
  .panel svg { max-width: 11rem; }
  .panel + .panel { border-top: 0; border-left: var(--line) solid var(--ink); }
}

/* ——— Развороты сюжетов ——— */

.plots { padding-top: calc(var(--section) * 0.4); }
.plots .section-head { margin-bottom: clamp(1.75rem, 4vw, 2.75rem); }

.spreads { display: grid; gap: 0; }
.spread { border-top: var(--line) solid var(--ink); padding-block: clamp(2.5rem, 7vw, 4.5rem); }
.spread:last-child { border-bottom: var(--line) solid var(--ink); }
/* На красном и зелёном белый текст не дотягивает до 4,5:1 — набираем чернилами */
.spread-red { background: var(--red); color: var(--ink); }
.spread-green { background: var(--green); color: var(--ink); }
.spread-blue { background: var(--blue); color: var(--white); }
.spread-ink { background: var(--ink); color: var(--white); }
.spread .wrap { display: grid; gap: clamp(1.5rem, 5vw, 3rem); align-items: center; }
.spread h3 { font-size: clamp(2rem, 6vw, 3.4rem); }
.spread p { font-size: 1.15rem; max-width: 32ch; margin-top: 0.9rem; }
.spread-blue p, .spread-ink p { color: var(--white); }
.spread .play-note { font-size: 0.95rem; margin-top: 1.1rem; opacity: 1; }

.reel-wrap { position: relative; justify-self: center; width: min(70vw, 300px); }
/* Приводка: вторая форма печати сдвинута — у каждого кадра выпуска */
.reel-wrap::before {
  content: ""; position: absolute; inset: 0; border-radius: calc(var(--radius) + 6px);
  background: var(--misreg, var(--red)); translate: 10px 10px;
}
.spread-red { --misreg: var(--blue); }
.spread-blue { --misreg: var(--red); }
.spread-green { --misreg: var(--red); }
.spread-ink { --misreg: var(--green); }
.reel-wrap .sticker { top: -1rem; bottom: auto; right: -0.75rem; rotate: 5deg; background: var(--white); }
.reel {
  position: relative; width: 100%;
  border: 6px solid var(--white); outline: var(--line) solid var(--ink);
  border-radius: var(--radius); overflow: hidden; background: var(--ink);
  aspect-ratio: 432 / 756;
}
.spread:nth-child(odd) .reel-wrap { rotate: 2deg; }
.spread:nth-child(even) .reel-wrap { rotate: -2deg; }
.folio { display: block; font-family: var(--display); font-weight: 900; font-size: 0.95rem; margin-bottom: 1rem; }
.reel video { width: 100%; height: 100%; object-fit: cover; }

@media (min-width: 820px) {
  .spread .wrap { grid-template-columns: 1fr minmax(260px, 320px); }
  .spread:nth-child(even) .wrap { grid-template-columns: minmax(260px, 320px) 1fr; }
  .spread:nth-child(even) .reel-wrap { order: -1; }
  .spread h3 { font-size: clamp(2.6rem, 5vw, 4rem); }
}

/* ——— Паспорт мультика ——— */

.passport {
  display: grid; gap: 0; margin: 0;
  border: var(--line) solid var(--ink); border-radius: var(--radius); background: var(--white);
}
.passport div { display: grid; grid-template-columns: 1fr; gap: 0.3rem; padding: 1rem 1.25rem; }
@media (min-width: 560px) { .passport div { grid-template-columns: minmax(6.5rem, 9rem) 1fr; gap: 1rem; align-items: baseline; } }
.passport div + div { border-top: 2px solid var(--ink); }
.passport dt { font-family: var(--display); font-weight: 900; font-size: 1.35rem; line-height: 1.1; }
.passport dd { margin: 0; }
@media (min-width: 820px) {
  .passport { grid-template-columns: 1fr 1fr; }
  .passport div:nth-child(2) { border-top: 0; }
  .passport div:nth-child(even) { border-left: 2px solid var(--ink); }
}

/* ——— Купон оплаты ——— */

.buy { background: var(--ink); color: var(--white); border-block: var(--line) solid var(--ink); }
.buy .section-head h2 { color: var(--white); }
.buy .section-head p { color: var(--white); }

.coupon {
  position: relative;
  background: var(--paper); color: var(--ink);
  border-radius: var(--radius);
  outline: 3px dashed var(--yellow); outline-offset: 10px;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  margin: 10px;
}
@media (min-width: 900px) {
  .coupon { display: grid; grid-template-columns: 1.15fr 1fr; column-gap: 3rem; align-items: start; }
  .coupon .packs, .coupon .linked { grid-column: 1; grid-row: 1 / span 9; }
  .coupon > :not(.packs):not(.linked):not(.scissors):not(input) { grid-column: 2; }
  .coupon .packs { grid-template-columns: 1fr; }
}
.scissors {
  position: absolute; top: -27px; left: 2rem; width: 2.1rem; height: 2.1rem;
  background: var(--ink); color: var(--yellow); padding: 0.2rem; border-radius: 50%;
}

.packs { border: 0; padding: 0; margin: 0 0 1.5rem; display: grid; gap: 0.9rem; }
.packs legend { font-family: var(--display); font-weight: 900; font-size: 1.25rem; margin-bottom: 0.9rem; padding: 0; }
@media (min-width: 620px) { .packs { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); } }

.pack { position: relative; cursor: pointer; display: block; padding-top: 0.6rem; }
/* Линия отреза над каждым пакетом; выбранный надрывается и отходит от корешка */
.pack::before { content: ""; position: absolute; top: 0; left: 0.5rem; right: 0.5rem; border-top: 3px dashed var(--ink); }
.pack input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pack-body {
  display: grid; gap: 0.2rem; height: 100%;
  border: var(--line) solid var(--ink); border-radius: 14px; background: var(--white);
  padding: 1rem 1.1rem 1.1rem;
  transition: background-color 0.2s ease, translate 0.35s cubic-bezier(0.16, 1, 0.3, 1), rotate 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.pack-name { font-weight: 700; font-size: 1.05rem; }
.pack-price { font-family: var(--display); font-weight: 900; font-size: clamp(2.4rem, 7vw, 3.2rem); line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.pack-note { font-size: 0.95rem; }
.pack input:checked + .pack-body { background: var(--yellow); translate: 6px -2px; rotate: -1.5deg; transform-origin: 0 0; }
.pack input:focus-visible + .pack-body { outline: 3px solid var(--ink); outline-offset: 3px; }
.pack:hover .pack-body { translate: 0 -2px; }

.field { display: grid; gap: 0.4rem; margin-bottom: 1.1rem; }
.field-name { font-weight: 700; }
.field input {
  font: inherit; color: var(--ink);
  border: var(--line) solid var(--ink); border-radius: 12px; background: var(--white);
  padding: 0.8rem 0.95rem; min-height: 3.2rem; width: 100%;
}
.field input::placeholder { color: rgb(20 33 61 / 0.62); font-style: italic; }
.field input:focus { outline: 3px solid var(--blue); outline-offset: 2px; }
[aria-invalid="true"] { border-color: var(--red) !important; }
fieldset[aria-invalid="true"] .pack-body { border-color: var(--red); }

.check { display: grid; grid-template-columns: 1.6rem 1fr; gap: 0.6rem; align-items: start; margin-bottom: 0.8rem; cursor: pointer; }
.check input { width: 1.35rem; height: 1.35rem; margin: 0.15rem 0 0; accent-color: var(--ink); }
.check input[aria-invalid="true"] { outline: 3px solid var(--red); outline-offset: 2px; }

.form-error {
  margin: 1rem 0 0; padding: 0.8rem 1rem;
  background: var(--white); border: var(--line) solid var(--red); border-radius: 12px; font-weight: 600;
}

.pay {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  margin-top: 1.25rem; min-height: 3.75rem; width: 100%;
  font-family: var(--display); font-weight: 900; font-size: 1.3rem;
  color: var(--ink); background: var(--yellow);
  border: var(--line) solid var(--ink); border-radius: 14px;
  padding: 0.8rem 1.4rem; cursor: pointer; text-decoration: none; text-align: center;
  transition: translate 0.25s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease;
}
.pay:hover { translate: 0 -3px; }
.pay:active { translate: 0 1px; }
.pay:disabled { background: var(--paper); color: var(--ink); border-style: dashed; cursor: not-allowed; translate: none; }
.pay-quiet { background: var(--white); }
.pay-for { display: none; }
.checkout:has(.pack:nth-of-type(1) input:checked) .pay-for:nth-of-type(1),
.checkout:has(.pack:nth-of-type(2) input:checked) .pay-for:nth-of-type(2),
.checkout:has(.pack:nth-of-type(3) input:checked) .pay-for:nth-of-type(3),
.checkout:has(.pack:nth-of-type(4) input:checked) .pay-for:nth-of-type(4) { display: inline; }
/* Старые браузеры без :has() — показываем первую цену */
@supports not selector(:has(*)) { .pay-for:first-of-type { display: inline; } }

.pay-note { margin-top: 0.85rem; font-size: 0.95rem; }
.methods { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; padding: 0; list-style: none; }
.methods li { border: 2px solid var(--ink); border-radius: 999px; padding: 0.15rem 0.7rem; font-size: 0.875rem; font-weight: 600; background: var(--white); }

.linked { margin-bottom: 1.25rem; padding: 0.8rem 1rem; background: var(--green); color: var(--ink); border-radius: 12px; font-weight: 600; }

/* ——— Вопросы ——— */

.faq-list { display: grid; gap: 0; border-top: var(--line) solid var(--ink); max-width: 48rem; }
.faq-list details { border-bottom: var(--line) solid var(--ink); }
.faq-list summary {
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; gap: 1rem; align-items: center;
  padding: 1.1rem 0; font-weight: 700; font-size: 1.15rem;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary svg { width: 1.6rem; height: 1.6rem; flex: none; transition: rotate 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.faq-list details[open] summary svg { rotate: 45deg; }
.faq-list details p { padding: 0 0 1.25rem; max-width: 62ch; }

/* ——— Выходные данные ——— */

.foot { background: var(--blue); color: var(--white); border-top: var(--line) solid var(--ink); padding-block: 2.5rem 3rem; font-size: 0.95rem; }
.foot .wrap { display: grid; gap: 1rem; }
.foot h2 { font-size: 1.4rem; }
.foot p, .foot dd { color: var(--white); }
.foot-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; font-weight: 600; }
.foot-links a { color: var(--white); }

/* ——— Страница заказа ——— */

.status-page { min-height: 62vh; display: grid; place-items: center; padding-block: var(--section); }
.status {
  width: min(100% - 2 * var(--gap), 36rem);
  background: var(--white); border: var(--line) solid var(--ink); border-radius: var(--radius);
  padding: clamp(1.5rem, 5vw, 2.5rem); display: grid; gap: 1rem; justify-items: start;
}
.status h1 { font-size: clamp(2.2rem, 7vw, 3.2rem); }
.status .lead { font-size: 1.15rem; }
.status .pay { margin-top: 0.5rem; }
.status-ok { background: var(--paper); }
.badge { width: 4.5rem; height: 4.5rem; }
.badge circle { fill: var(--green); stroke: var(--ink); stroke-width: 3; }
.badge path { fill: none; stroke: var(--white); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.wait {
  width: 4rem; height: 4rem; border-radius: 50%;
  border: 6px solid var(--paper); border-top-color: var(--blue); border-right-color: var(--red);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { rotate: 360deg; } }

/* ——— Документы ——— */

.doc { padding-block: var(--section); }
.doc .wrap { max-width: 46rem; }
.doc h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); margin-bottom: 1.5rem; }
.doc h2 { font-size: 1.5rem; margin: 2.25rem 0 0.75rem; }
.doc p, .doc li { max-width: 68ch; }
.doc p + p { margin-top: 0.9rem; }
.doc ul, .doc ol { padding-left: 1.3rem; display: grid; gap: 0.45rem; }
.req { display: grid; grid-template-columns: minmax(8rem, 12rem) 1fr; gap: 0; margin: 0 0 1.5rem; border-top: 2px solid var(--ink); }
.req dt, .req dd { padding: 0.75rem 0; border-bottom: 2px solid var(--ink); margin: 0; }
.req dt { font-weight: 700; }
.todo { border: 2px dashed var(--red); padding: 0 0.35rem; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .wait { animation: none; border-color: var(--blue); }
}
.page-doc { background: var(--paper); }
