/* Shadow of Reality — сайт. Темний, як застосунок; спершу під телефон.
   Без веб-шрифтів і без JS: системний шрифт і чистий CSS — швидше вантажиться. */

:root {
  --bg: #07060c;
  --surface: #121019;
  --surface-2: #1b1826;
  --line: #2a2638;
  --text: #f5f5f7;
  --muted: #a8a6b3;
  --accent: #9b7bff;
  --pink: #ff3b5c;
  --gradient: linear-gradient(135deg, #9b7bff 0%, #d45bd0 55%, #ff3b5c 100%);
  --radius: 18px;
  --wrap: 1120px;
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}

body::before {
  /* Те саме фіолетове сяйво, що на екрані входу в застосунку. */
  content: "";
  position: fixed;
  inset: -20vh -20vw auto;
  height: 90vh;
  background: radial-gradient(closest-side, rgba(67, 50, 150, .55), transparent);
  pointer-events: none;
  z-index: -1;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(100% - 40px, var(--wrap)); margin-inline: auto; }

.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--surface-2); padding: 8px 14px; border-radius: 10px; z-index: 10;
}
.skip:focus { left: 12px; }

/* ------------------------------------------------------------ шапка */

.header {
  position: sticky; top: 0; z-index: 5;
  background: rgba(7, 6, 12, .78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, .05);
}
.header .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800;
         white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 9px; }
.nav { display: none; gap: 22px; margin-left: auto; }
.nav a { color: var(--muted); font-size: 15px; }
.nav a:hover { color: var(--text); text-decoration: none; }
.header .lang { margin-left: auto; color: var(--muted); font-size: 14px; }
.header .btn { padding: 8px 16px; font-size: 14px; }

@media (min-width: 860px) {
  .nav { display: flex; }
  .header .lang { margin-left: 0; }
}

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 24px; border-radius: 999px;
  background: var(--gradient); color: #0b0a10;
  font-weight: 800; font-size: 17px; border: 0; cursor: pointer;
  box-shadow: 0 10px 30px -10px rgba(212, 91, 208, .6);
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn svg { width: 22px; height: 22px; }
.btn.ghost {
  background: transparent; color: var(--text); box-shadow: none;
  border: 1px solid var(--line);
}
.btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

/* ------------------------------------------------------------ перший екран */

.hero { padding: 48px 0 32px; }
.hero .wrap { display: grid; gap: 40px; align-items: center; }
.hero h1 {
  font-size: clamp(34px, 7vw, 60px); line-height: 1.08; margin: 0 0 18px;
  letter-spacing: -.02em;
}
.hero h1 span {
  background: var(--gradient); -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.lead { font-size: clamp(17px, 2.4vw, 20px); color: #d6d4df; margin: 0 0 28px; max-width: 34em; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.cta.spaced { margin-top: 22px; }
.cta.bottom { margin-bottom: 30px; }
.cta.centered { justify-content: center; }
.meta { margin: 14px 0 0; color: var(--muted); font-size: 14px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; padding: 0; list-style: none; }
.badges li {
  font-size: 13px; color: #d6d4df; padding: 6px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .06);
}

.stats-strip { display: flex; flex-wrap: wrap; gap: 26px; margin: 26px 0 0; }
.stats-strip div { display: flex; flex-direction: column-reverse; }
.stats-strip dd { margin: 0; font-size: 28px; font-weight: 800; line-height: 1.1;
                  background: var(--gradient); -webkit-background-clip: text;
                  background-clip: text; color: transparent; }
.stats-strip dt { color: var(--muted); font-size: 14px; }

.phone {
  position: relative; width: min(300px, 78vw); margin: 0 auto; aspect-ratio: 9 / 19.5;
  border-radius: 42px; padding: 10px; background: #1b1a22;
  box-shadow: 0 40px 90px -30px rgba(155, 123, 255, .55), inset 0 0 0 2px #2c2a36;
}
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 33px; }
.phone .caption {
  position: absolute; left: 26px; right: 70px; bottom: 34px; font-size: 13px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .9);
}
.phone .caption b { display: block; font-size: 14px; }
.phone .rail {
  position: absolute; right: 22px; bottom: 60px; display: grid; gap: 18px;
  justify-items: center; font-size: 11px; text-shadow: 0 1px 6px rgba(0, 0, 0, .9);
}
.phone .rail svg { width: 28px; height: 28px; filter: drop-shadow(0 1px 4px rgba(0,0,0,.8)); }

@media (min-width: 860px) {
  .hero { padding: 80px 0 56px; }
  .hero .wrap { grid-template-columns: 1.15fr .85fr; }
}

/* ------------------------------------------------------------ секції */

section { padding: 56px 0; }
.section-head { max-width: 40em; margin-bottom: 30px; }
.section-head h2 { font-size: clamp(26px, 4.5vw, 38px); line-height: 1.15; margin: 0 0 10px; }
.section-head p { color: var(--muted); margin: 0; }

/* Шість карток: по три в ряд на широкому, по дві на планшеті, одна на телефоні. */
.features { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px;
}
.card h3 { margin: 12px 0 6px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.card .ico {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(155, 123, 255, .14); color: var(--accent);
}
.card .ico svg { width: 22px; height: 22px; }

.steps { display: grid; gap: 14px; counter-reset: step; padding: 0; margin: 0; list-style: none;
         grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: 50%; background: var(--gradient); color: #0b0a10; font-weight: 800;
  margin-bottom: 10px;
}

.gallery { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
.gallery figure { margin: 0; position: relative; overflow: hidden; border-radius: 16px;
                  background: var(--surface); }
.gallery img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; }
.gallery figcaption {
  position: absolute; inset: auto 0 0 0; padding: 40px 12px 12px; font-size: 13px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .85));
}
.gallery figcaption b { display: block; font-size: 14px; margin-bottom: 4px; }
.gallery figcaption code {
  font-family: inherit; color: #cfcbe0; font-size: 12px; display: -webkit-box;
  -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.install { display: grid; gap: 24px; align-items: start; }
@media (min-width: 860px) { .install { grid-template-columns: 1fr 1fr; } }
.install ol { margin: 0; padding-left: 22px; }
.install li { margin-bottom: 10px; }
.note { color: var(--muted); font-size: 14px; }

.faq details {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 20px; margin-bottom: 10px;
}
.faq summary { cursor: pointer; font-weight: 700; list-style: none; position: relative;
               padding-right: 28px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: -2px; font-size: 22px;
                      color: var(--accent); }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: #d0cedb; margin: 10px 0 0; }

.final { text-align: center; }
.final .card { padding: 40px 22px; background:
  radial-gradient(120% 140% at 50% 0%, rgba(155, 123, 255, .22), transparent 60%), var(--surface); }
.final h2 { margin: 0 0 10px; font-size: clamp(26px, 4.5vw, 36px); }
.final p { color: var(--muted); margin: 0 0 24px; }

/* ------------------------------------------------------------ підвал */

.footer { border-top: 1px solid var(--line); padding: 28px 0 40px; margin-top: 30px;
          color: var(--muted); font-size: 14px; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; }
.footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--text); }
.footer .copy { margin-left: auto; }

/* ------------------------------------------------------------ правила */

.legal { max-width: 760px; margin: 0 auto; padding: 40px 0 20px; }
.legal h1 { font-size: clamp(30px, 5vw, 42px); line-height: 1.15; margin: 0 0 6px; }
.legal .updated { color: var(--muted); margin: 0 0 30px; font-size: 14px; }
.legal h2 { font-size: 22px; margin: 36px 0 10px; scroll-margin-top: 80px; }
.legal h3 { font-size: 18px; margin: 24px 0 8px; }
.legal p, .legal li { color: #dddbe6; }
.legal ul, .legal ol { padding-left: 22px; }
.legal li { margin-bottom: 6px; }
.legal strong { color: var(--text); }

/* ------------------------------------------------------------ арт і профіль */

.art { display: grid; gap: 28px; padding: 32px 0; align-items: start; }
@media (min-width: 860px) { .art { grid-template-columns: minmax(0, 420px) 1fr; } }
.art-images { display: grid; gap: 14px; }
.art-image { margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.art-image img { width: 100%; }
.art-image figcaption { display: flex; gap: 10px; align-items: baseline; padding: 10px 14px;
                        font-size: 13px; color: var(--muted); }
.page-no { font-weight: 800; color: var(--text); flex: none; }
.page-prompt { font-family: ui-monospace, "SF Mono", Menlo, monospace; overflow-wrap: anywhere; }
.author { display: flex; align-items: center; gap: 12px; color: var(--text); margin-bottom: 16px; }
.author:hover { text-decoration: none; }
.author b { display: block; }
.author small { display: block; color: var(--muted); font-size: 14px; }
.avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover;
          background: var(--gradient); display: grid; place-items: center; color: #0b0a10;
          font-weight: 800; flex: none; }
.art h1 { font-size: clamp(24px, 4vw, 32px); line-height: 1.2; margin: 0 0 12px; }
.prompt { background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
          padding: 14px 16px; margin: 18px 0; }
.prompt h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em;
             color: var(--muted); margin: 0 0 6px; }
.prompt p { margin: 0; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 14px;
            color: #dddbe6; overflow-wrap: anywhere; }
.remix-hint { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.stats { color: var(--muted); font-size: 14px; display: flex; gap: 16px; margin: 0 0 22px; }

.profile-head { display: flex; gap: 18px; align-items: center; padding: 36px 0 20px; }
.profile-head .avatar { width: 84px; height: 84px; font-size: 32px; }
.profile-head h1 { margin: 0; font-size: clamp(24px, 4vw, 32px); }
.profile-head p { margin: 4px 0 0; color: var(--muted); }
.bio { max-width: 40em; margin: 0 0 20px; }
.grid { display: grid; gap: 4px; grid-template-columns: repeat(3, 1fr); margin: 10px 0 30px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(4, 1fr); gap: 8px; } }
.grid a { display: block; border-radius: 10px; overflow: hidden; background: var(--surface);
          position: relative; }
/* Серія: значок стосу й кількість, як у TikTok на фото-каруселях. */
.grid a.is-series::after {
  content: "❐ " attr(data-count); position: absolute; top: 6px; right: 6px;
  font-size: 12px; font-weight: 700; padding: 2px 7px; border-radius: 8px;
  background: rgba(0, 0, 0, .6); color: #fff;
}
.grid img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; }

.row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
            max-width: none; }
.row-head h2 { margin: 0; }
.explore-head { padding-top: 36px; margin-bottom: 18px; }
.explore-head h1 { font-size: clamp(28px, 5vw, 40px); margin: 0 0 8px; line-height: 1.15; }
.explore-head p { color: var(--muted); margin: 0; }
.pager { display: flex; gap: 12px; justify-content: center; margin: 10px 0 20px; }
.more-link { margin: 22px 0 0; }
#recent { padding-top: 24px; }

.center { text-align: center; padding: 80px 0; }
.center h1 { font-size: clamp(28px, 5vw, 40px); margin: 0 0 12px; }
.center p { color: var(--muted); margin: 0 0 26px; }
.badge-18 { display: inline-block; border: 2px solid var(--text); border-radius: 10px;
            padding: 4px 14px; font-weight: 800; font-size: 26px; margin-bottom: 18px; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* APK у футері: другорядно, одним рядком */
.footer .apk { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 0 0 12px;
  font-size: 13px; color: var(--muted); }
.footer .apk a { color: inherit; }
.btn.small { padding: 6px 12px; font-size: 13px; }

/* Підпис під мініатюрою в «Огляді»: опис чи промпт — видимий текст для пошуку */
.grid a { position: relative; }
.tile-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px;
  font-size: 11px; line-height: 1.3; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.75));
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
