/* =========================================================
   casino-apple-pay.it — style.css
   ========================================================= */

:root {
  --bg: #f2f2f4;          /* фон сайта (светлый) */
  --black: #000000;       /* основной чёрный */
  --ink: #000000;         /* текст */
  --ink-soft: #2b2b2e;    /* второстепенный текст */
  --muted: #6e6e75;       /* подписи */
  --line: #d6d6dc;        /* линии, рамки */
  --white: #ffffff;

  --font-body: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Unbounded", "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;

  --container: 1200px;
  --content: 800px;
  --header-h: 72px;
  --gutter: 20px;
  --popup-offset: 0px;    /* задаётся из JS, чтобы стрелка не перекрывала попап */
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg, video { max-width: 100%; height: auto; }

a { color: inherit; }

button { font: inherit; cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--black);
  outline-offset: 3px;
}

/* =========================================================
   Кнопки (общие)
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  border: 2px solid transparent;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .2s, color .2s, border-color .2s;
}

.btn--outline { border-color: var(--white); color: var(--white); background: transparent; }
.btn--outline:hover { background: var(--white); color: var(--black); }

.btn--light { background: var(--white); color: var(--black); }
.btn--light:hover { background: transparent; color: var(--white); border-color: var(--white); }

.header .btn:focus-visible,
.popup .btn:focus-visible,
.footer a:focus-visible { outline-color: var(--white); }

/* =========================================================
   Header
   ========================================================= */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--black);
  color: var(--white);
}

.header__inner {
  max-width: var(--container);
  height: var(--header-h);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header__logo { display: block; flex-shrink: 0; }
.header__logo img { display: block; height: 38px; width: auto; }

.header__actions { display: flex; align-items: center; gap: 10px; }

/* =========================================================
   MAIN — стили контента (без обёрток)
   ========================================================= */
main {
  flex: 1 0 auto;
  width: 100%;
  max-width: calc(var(--content) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 48px var(--gutter) 24px;
  overflow-wrap: break-word;
}

/* Заголовки */
main h1,
main h2,
main h3,
main h4,
main h5,
main h6 {
  font-family: var(--font-display);
  color: var(--black);
  line-height: 1.2;
  margin: 1.8em 0 .6em;
}

main h1 {
  font-size: clamp(28px, 5vw, 46px);
  font-weight: 700;
  letter-spacing: -.02em;
  margin-top: 0;
}
main h2 { font-size: clamp(23px, 3.4vw, 32px); font-weight: 600; letter-spacing: -.01em; }
main h3 { font-size: clamp(20px, 2.6vw, 24px); font-weight: 600; }
main h4 { font-size: 19px; font-weight: 600; }
main h5 { font-size: 17px; font-weight: 600; }
main h6 { font-size: 15px; font-weight: 600; color: var(--ink-soft); }

/* Текст */
main p { margin: 0 0 1.15em; color: var(--ink); }
main strong, main b { font-weight: 700; }
main em, main i { font-style: italic; }
main small { font-size: .85em; color: var(--muted); }
main mark { background: var(--black); color: var(--white); padding: 0 .25em; }

/* Ссылки в тексте (кнопки с классами не затрагиваются) */
main a:not([class]) {
  color: var(--black);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
main a:not([class]):hover { text-decoration-thickness: 3px; }

/* Списки */
main ul,
main ol { margin: 0 0 1.3em; padding-left: 1.4em; }
main li { margin-bottom: .45em; padding-left: .2em; }
main li::marker { color: var(--black); font-weight: 700; }
main ul ul, main ol ol, main ul ol, main ol ul { margin: .45em 0 0; }

/* Изображения между абзацами */
main img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 32px auto;
  border-radius: 18px;
}

main figure { margin: 32px 0; }
main figure img { margin: 0 auto; }
main figcaption {
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

/* Таблицы */
main table {
  width: 100%;
  margin: 32px 0;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--white);
  border: 1px solid var(--black);
  border-radius: 12px;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.45;
}
main caption {
  caption-side: top;
  padding-bottom: 10px;
  font-size: 14px;
  color: var(--muted);
  text-align: left;
}
main th,
main td {
  padding: 13px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
main th {
  background: var(--black);
  color: var(--white);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  border-bottom: 0;
}
main tbody tr:nth-child(even) td { background: #f7f7f9; }
main tbody tr:last-child td { border-bottom: 0; }

/* Цитаты */
main blockquote {
  margin: 32px 0;
  padding: 4px 0 4px 22px;
  border-left: 4px solid var(--black);
  font-size: 19px;
  font-weight: 500;
  color: var(--ink-soft);
}
main blockquote p:last-child { margin-bottom: 0; }
main cite { display: block; margin-top: 8px; font-size: 14px; font-style: normal; color: var(--muted); }

/* Разделитель */
main hr { margin: 40px 0; border: 0; border-top: 1px solid var(--line); }

/* Код */
main code {
  padding: .1em .35em;
  border-radius: 5px;
  background: #e4e4e8;
  font-size: .9em;
}
main pre {
  margin: 24px 0;
  padding: 18px;
  overflow-x: auto;
  border-radius: 12px;
  background: var(--black);
  color: var(--white);
}
main pre code { padding: 0; background: none; }

/* Видео / iframe */
main iframe,
main video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  margin: 32px 0;
  border: 0;
  border-radius: 18px;
}

/* ---------- Кнопка по центру (шаблон) ---------- */
main .btn-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  min-height: 58px;
  margin: 36px auto;
  padding: 0 44px;
  border-radius: 999px;
  background: var(--black);
  color: var(--white);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 0 0 0 var(--black);
  transition: box-shadow .2s, transform .2s;
}
main .btn-cta:hover {
  box-shadow: 0 0 0 5px var(--bg), 0 0 0 7px var(--black);
}
main .btn-cta:active { transform: scale(.98); }

/* ---------- Блок автора ---------- */
main .author {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin: 56px 0 16px;
  padding: 24px;
  background: var(--white);
  border: 1px solid var(--black);
  border-radius: 20px;
}
main .author__avatar {
  flex-shrink: 0;
  width: 88px;
  height: 88px;
  margin: 0;
  border-radius: 50%;
  object-fit: cover;
}
main .author__body { min-width: 0; }
main .author__role {
  margin: 0 0 2px;
  font-size: 13px;
  color: var(--muted);
}
main .author__name {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
}
main .author__text {
  margin: 0;
  font-size: 16px;
  color: var(--ink-soft);
}

/* ---------- Страница 404 ---------- */
main.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 72px;
  padding-bottom: 72px;
}
main.error-page .error-page__code {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(110px, 26vw, 220px);
  font-weight: 800;
  line-height: .9;
  letter-spacing: -.05em;
}
main.error-page h1 { margin: 24px 0 12px; font-size: clamp(24px, 4vw, 34px); }
main.error-page p { max-width: 460px; color: var(--ink-soft); }
main.error-page .btn-cta { margin-top: 20px; }

/* =========================================================
   Footer
   ========================================================= */
.footer {
  flex-shrink: 0;
  margin-top: 64px;
  background: var(--black);
  color: #c9c9ce;
  font-size: 15px;
  line-height: 1.6;
}

.footer__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 48px var(--gutter) 40px;
}

.footer__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid #2a2a2d;
}
.footer__logo img { display: block; height: 34px; width: auto; }

.footer__nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer__nav a { color: var(--white); text-decoration: none; font-weight: 600; }
.footer__nav a:hover { text-decoration: underline; text-underline-offset: 3px; }

.footer__rg {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  padding: 24px 0;
  border-bottom: 1px solid #2a2a2d;
}
.footer__rg-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
}
.footer__rg ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer__rg a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid #45454a;
  border-radius: 999px;
  color: var(--white);
  font-size: 14px;
  text-decoration: none;
  transition: border-color .2s;
}
.footer__rg a:hover { border-color: var(--white); }

.footer__text { margin: 24px 0 0; font-size: 14px; color: #a3a3a9; }

/* =========================================================
   Стрелка «наверх»
   ========================================================= */
.to-top {
  position: fixed;
  right: 20px;
  bottom: calc(20px + var(--popup-offset));
  z-index: 90;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 2px solid var(--white);
  border-radius: 50%;
  background: var(--black);
  color: var(--white);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity .25s, visibility .25s, transform .25s, bottom .3s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top svg { width: 22px; height: 22px; }

/* =========================================================
   Попап внизу
   ========================================================= */
.popup {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 95;
  width: min(620px, calc(100% - 24px));
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 52px 14px 16px;
  background: var(--black);
  color: var(--white);
  border: 1px solid #2f2f33;
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .28);
  transform: translate(-50%, calc(100% + 40px));
  visibility: hidden;
  transition: transform .45s cubic-bezier(.2, .8, .2, 1), visibility .45s;
}
.popup.is-visible { transform: translate(-50%, 0); visibility: visible; }

.popup__logo { flex-shrink: 0; display: block; height: 30px; width: auto; }
.popup__text { flex: 1; margin: 0; font-size: 15px; line-height: 1.4; }
.popup .btn { flex-shrink: 0; }

.popup__close {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--white);
  transform: translateY(-50%);
}
.popup__close:hover { background: #222; }
.popup__close svg { width: 16px; height: 16px; }

/* =========================================================
   Адаптив
   ========================================================= */
@media (max-width: 768px) {
  :root { --header-h: 62px; --gutter: 16px; }

  body { font-size: 16px; }

  .header__logo img { height: 30px; }
  .header__actions { gap: 8px; }
  .header .btn { min-height: 40px; padding: 0 14px; font-size: 11px; }

  main { padding-top: 32px; }

  main img,
  main iframe,
  main video { border-radius: 12px; margin: 24px auto; }

  /* Таблица: на телефоне не растягивает экран, а скроллится */
  main table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  main th,
  main td { white-space: nowrap; padding: 11px 14px; }

  main .btn-cta { min-height: 54px; padding: 0 30px; font-size: 14px; }

  main .author { flex-direction: column; gap: 14px; padding: 20px; }
  main .author__avatar { width: 72px; height: 72px; }

  .footer__top { flex-direction: column; align-items: flex-start; }
  .footer__rg { flex-direction: column; align-items: flex-start; }

  .popup {
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px;
  }
  .popup__text { flex-basis: 100%; padding-right: 36px; font-size: 14px; }
  .popup__logo { margin-right: 36px; }
  .popup .btn { width: 100%; }
  .popup__close { top: 12px; transform: none; }

  .to-top { right: 14px; width: 46px; height: 46px; }
}

@media (max-width: 360px) {
  .header__logo img { height: 26px; }
  .header .btn { padding: 0 10px; font-size: 10px; letter-spacing: .02em; }
}

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