:root {
  --bg: #0b0b0d;
  --surface: #16161a;
  --surface-2: #222228;
  --line: #2c2c34;
  --text: #f2f2f2;
  --muted: #9a9aa3;
  --red: #e2412f;
  --yellow: #f2c230;
  --green: #2f9e4f;
  --radius: 16px;
  --display: "Unbounded", system-ui, sans-serif;
  color-scheme: dark;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

button { font: inherit; color: inherit; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 999px;
  white-space: nowrap;
  transition: transform .15s ease, filter .15s ease, background .15s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--yellow); color: #111; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--surface-2); color: var(--text); }
.btn-ghost:hover, .btn-ghost[aria-pressed="true"] { background: var(--line); }
.btn-ghost[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--yellow); }
.btn-download { background: var(--green); color: #fff; }
.btn-download:hover { filter: brightness(1.1); }

/* ---------- шапка ---------- */
.stripe {
  height: 6px;
  background: linear-gradient(90deg,
    var(--red) 0 33.3%, var(--yellow) 33.3% 66.6%, var(--green) 66.6% 100%);
  position: relative;
  z-index: 1;
}
.stripe-thin { height: 3px; opacity: .8; }

.hero { position: relative; overflow: hidden; }

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(40% 80% at 10% 20%, rgb(226 65 47 / .25), transparent 70%),
    radial-gradient(35% 70% at 50% 0%, rgb(242 194 48 / .18), transparent 70%),
    radial-gradient(40% 80% at 90% 30%, rgb(47 158 79 / .22), transparent 70%);
}
.hero-bg::after {
  content: "";
  position: absolute;
  inset: -40px;
  background: url(img/cat.webp) center 30% / cover;
  filter: blur(70px) saturate(1.3);
  opacity: .18;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 60px;
  background: linear-gradient(transparent, var(--bg));
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 44px 16px 36px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.avatar {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 7px var(--yellow), 0 12px 40px rgb(0 0 0 / .5);
}

h1, h2 { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; }

h1 { margin: 0; font-size: clamp(1.7rem, 5vw, 2.8rem); line-height: 1.1; }
h1 span { color: var(--yellow); }

.tagline { margin: 8px 0 2px; font-size: 1.05rem; }
.stats { margin: 0 0 16px; color: var(--muted); font-size: .9rem; }

.links { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- фильтры ---------- */
main { max-width: 1200px; margin: 0 auto; padding: 0 16px 48px; }

.filters {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0 -16px 8px;
  padding: 12px 16px;
  background: rgb(11 11 13 / .88);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.filters.stuck { border-bottom-color: var(--line); }

.tabs { display: flex; gap: 6px; }

.tab, .chip {
  border: 0;
  cursor: pointer;
  background: var(--surface);
  border-radius: 999px;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.tab { padding: 9px 18px; font-weight: 600; font-family: var(--display); font-size: .85rem; }
.tab:hover { background: var(--surface-2); }
.tab.active { background: var(--text); color: var(--bg); }

.chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }

.chip { padding: 6px 12px; font-size: .85rem; color: var(--muted); }
.chip:hover { color: var(--text); }
.chip.active { color: #111; background: var(--yellow); font-weight: 600; }
.chip small { opacity: .6; margin-left: 4px; }

/* ---------- сетка (masonry на колонках) ---------- */
.grid { columns: 4 240px; column-gap: 14px; }

.card {
  break-inside: avoid;
  margin: 0 0 14px;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  cursor: zoom-in;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  isolation: isolate;
  animation: rise .4s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.card img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform .4s ease;
}

.card .badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  font-size: .72rem;
  font-weight: 600;
  color: #fff;
  background: rgb(0 0 0 / .55);
  backdrop-filter: blur(4px);
  padding: 3px 9px;
  border-radius: 999px;
  transition: opacity .2s ease;
}

.card .new {
  position: absolute;
  top: 10px;
  left: 10px;
  font-family: var(--display);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: #111;
  background: var(--yellow);
  padding: 3px 8px;
  border-radius: 6px;
}

.card .overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 40px 12px 12px;
  text-align: left;
  background: linear-gradient(transparent, rgb(0 0 0 / .8));
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .2s ease, transform .2s ease;
}
.card .overlay strong { display: block; font-size: .95rem; }
.card .overlay span { font-size: .78rem; color: #ccc; }

@media (hover: hover) {
  .card:hover img { transform: scale(1.04); }
  .card:hover .overlay { opacity: 1; transform: none; }
  .card:hover .badge { opacity: 0; }
}
.card:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

.empty { text-align: center; color: var(--muted); padding: 48px 0; }

/* ---------- блок «закажи тему» ---------- */
.cta {
  margin-top: 40px;
  padding: 24px;
  border-radius: 24px;
  background:
    radial-gradient(60% 120% at 0% 0%, rgb(242 194 48 / .14), transparent 60%),
    var(--surface);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 20px;
}
.cta-cat {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  transform: rotate(-6deg);
}
.cta-text { flex: 1; }
.cta h2 { margin: 0 0 4px; font-size: 1.2rem; }
.cta p { margin: 0; color: var(--muted); }

/* ---------- просмотр ---------- */
.viewer {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(94vw, 1400px);
  max-height: 96vh;
  overflow: visible;
  color: var(--text);
}
.viewer::backdrop { background: rgb(0 0 0 / .88); backdrop-filter: blur(6px); }

.viewer figure { margin: 0; display: flex; flex-direction: column; gap: 12px; }

.stage { position: relative; margin: 0 auto; }

.stage img {
  display: block;
  max-width: 100%;
  max-height: calc(96vh - 90px);
  object-fit: contain;
  border-radius: var(--radius);
  margin: 0 auto;
}

.lock, .taskbar { display: none; }

/* примерка: телефон */
.stage.try-phone {
  height: min(calc(96vh - 90px), 720px);
  aspect-ratio: 9 / 19.5;
  border: 10px solid #1c1c21;
  border-radius: 48px;
  overflow: hidden;
  box-shadow: 0 0 0 2px #333, 0 30px 80px rgb(0 0 0 / .6);
}
.stage.try-phone::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  translate: -50% 0;
  width: 30%;
  height: 26px;
  background: #000;
  border-radius: 999px;
  z-index: 2;
}
.stage.try-phone img,
.stage.try-pc img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  border-radius: 0;
}
.stage.try-phone .lock {
  display: block;
  position: absolute;
  inset: 0;
  padding-top: 18%;
  text-align: center;
  color: #fff;
  text-shadow: 0 2px 12px rgb(0 0 0 / .35);
}
.lock-date { font-size: 1rem; font-weight: 600; }
.lock-date::first-letter { text-transform: uppercase; }
.lock-time { font-size: clamp(3.5rem, 9vh, 5rem); font-weight: 700; line-height: 1; letter-spacing: -0.03em; }

/* примерка: монитор */
.stage.try-pc {
  width: min(94vw, 1000px, calc((96vh - 140px) * 16 / 9));
  aspect-ratio: 16 / 9;
  border: 12px solid #1c1c21;
  border-bottom-width: 22px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 0 0 2px #333, 0 30px 80px rgb(0 0 0 / .6);
}
.stage.try-pc .taskbar {
  display: flex;
  justify-content: center;
  gap: 8px;
  position: absolute;
  inset: auto 0 0 0;
  padding: 7px;
  background: rgb(20 20 24 / .7);
  backdrop-filter: blur(10px);
}
.taskbar span { width: 18px; height: 18px; border-radius: 5px; background: rgb(255 255 255 / .25); }
.taskbar span:first-child { background: var(--yellow); }

.viewer figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.viewer .meta { display: block; color: var(--muted); font-size: .85rem; }
.actions { display: flex; gap: 8px; }

.close, .nav {
  position: fixed;
  border: 0;
  cursor: pointer;
  background: rgb(34 34 40 / .85);
  color: var(--text);
  border-radius: 50%;
  z-index: 3;
}
.close:hover, .nav:hover { background: var(--line); }
.close { top: 12px; right: 12px; width: 42px; height: 42px; font-size: 1.1rem; }
.nav { top: 50%; translate: 0 -50%; width: 48px; height: 48px; font-size: 1.8rem; line-height: 1; }
.nav.prev { left: 12px; }
.nav.next { right: 12px; }
.nav[hidden] { display: none; }
/* на сенсорных экранах листаем свайпом, стрелки не нужны */
@media (hover: none) { .nav { display: none; } }
.swipe-hint { display: none; color: var(--muted); font-size: .8rem; text-align: center; margin: 0; }
@media (hover: none) { .swipe-hint { display: block; } }

footer {
  text-align: center;
  color: var(--muted);
  font-size: .8rem;
}
footer p { padding: 20px 16px 36px; margin: 0; }

/* ---------- телефон ---------- */
@media (max-width: 600px) {
  .hero-inner { flex-direction: column; text-align: center; padding: 32px 16px 28px; gap: 16px; }
  .links { justify-content: center; }
  .avatar { width: 104px; height: 104px; }
  .tab { padding: 8px 14px; font-size: .78rem; }
  .grid { columns: 2; column-gap: 8px; }
  .card { margin-bottom: 8px; border-radius: 12px; }
  .cta { flex-direction: column; text-align: center; padding: 22px 16px; }
  .viewer figcaption { justify-content: center; text-align: center; }
  .viewer figure { padding-top: 56px; }
  .stage img { max-height: calc(96vh - 200px); }
  .stage.try-phone { height: min(calc(96vh - 210px), 640px); }
  .close { background: rgb(255 255 255 / .14); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
