/* Shared styles for the catalogue pages (home + sections). Demo sites keep their own styles. */
:root {
  --bg: #f5f3ee;
  --surface: #ffffff;
  --ink: #16171a;
  --muted: #5e6168;
  --line: #e2dfd7;
  --accent: #b6452c;
  --accent-ink: #ffffff;
  --radius: 18px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.55 "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.1; letter-spacing: -.02em; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: 16px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 10px; background: var(--ink); color: #fff; text-decoration: none; }
.skip:focus { top: 12px; }

.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }

/* Header */
.top { position: sticky; top: 0; z-index: 10; background: rgba(245, 243, 238, .86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; letter-spacing: -.01em; min-height: 44px; }
.brand i { width: 30px; height: 30px; border-radius: 9px; background: var(--ink); display: grid; place-items: center; }
.brand i::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.nav { display: flex; gap: 4px; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; text-decoration: none; color: var(--muted); font-size: 15px; font-weight: 500; transition: background .2s, color .2s; }
.nav a:hover { color: var(--ink); background: rgba(22, 23, 26, .06); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: 0 0 0 1px var(--line); }

/* Page heading */
.intro { padding: 72px 0 40px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 20px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 16px; }
.intro h1 { font-size: clamp(40px, 6vw, 76px); font-weight: 700; max-width: 16ch; }
.intro p { font-size: 19px; color: var(--muted); max-width: 58ch; margin-top: 20px; }
.facts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; padding: 0; list-style: none; }
.facts li { padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.facts b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* Home: two category cards */
.cats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; padding-bottom: 96px; }
.cat {
  position: relative; display: flex; flex-direction: column; gap: 24px; padding: 28px; border-radius: 26px;
  background: var(--surface); border: 1px solid var(--line); text-decoration: none; overflow: hidden;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .2s;
}
.cat:hover { transform: translateY(-4px); box-shadow: 0 30px 60px -30px rgba(22, 23, 26, .35); border-color: #cfcbc1; }
.cat-stack { position: relative; aspect-ratio: 16 / 10; }
.cat-stack img { position: absolute; width: 74%; border-radius: 12px; box-shadow: 0 18px 40px -18px rgba(22, 23, 26, .45); border: 1px solid rgba(22, 23, 26, .08); transition: transform .5s var(--ease); }
.cat-stack img:nth-child(1) { left: 0; top: 14%; z-index: 1; transform: rotate(-3deg); }
.cat-stack img:nth-child(2) { right: 0; top: 0; z-index: 2; transform: rotate(2deg); }
.cat-stack img:nth-child(3) { left: 13%; bottom: 0; z-index: 3; }
.cat:hover .cat-stack img:nth-child(1) { transform: rotate(-5deg) translate(-6px, 4px); }
.cat:hover .cat-stack img:nth-child(2) { transform: rotate(4deg) translate(6px, -4px); }
.cat-body { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.cat h2 { font-size: clamp(28px, 3vw, 38px); }
.cat p { color: var(--muted); margin-top: 8px; }
.cat .go { flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; transition: background .2s, transform .3s var(--ease); }
.cat:hover .go { background: var(--accent); transform: translateX(4px); }

/* Section: grid of demo cards */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding-bottom: 40px; list-style: none; margin: 0; padding-left: 0; }
.demo {
  position: relative; display: flex; flex-direction: column; height: 100%; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); overflow: hidden;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .2s;
}
.demo:hover { transform: translateY(-4px); box-shadow: 0 30px 50px -30px rgba(22, 23, 26, .35); border-color: #cfcbc1; }
.demo .shot { aspect-ratio: 3 / 2; overflow: hidden; border-bottom: 1px solid var(--line); background: #e9e6df; }
.demo .shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .8s var(--ease); }
.demo:hover .shot img { transform: scale(1.03); }
.demo .body { display: flex; flex-direction: column; gap: 8px; padding: 20px 22px 22px; flex: 1; }
.demo .meta { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.demo h3 { font-size: 22px; }
.demo h3 a { text-decoration: none; }
/* whole card is clickable via the title link */
.demo h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.demo p { color: var(--muted); font-size: 15px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 10px; list-style: none; padding-left: 0; }
.tags li { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--ink); }
.tags li.hl { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Link to the other section */
.next { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 40px 0 96px; padding: 28px 32px; border-radius: 22px; background: var(--ink); color: #fff; text-decoration: none; transition: background .2s; }
.next:hover { background: #2a2c31; }
.next small { display: block; font-size: 14px; color: #b9bbc1; margin-bottom: 4px; }
.next b { font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -.02em; }
.next .go { flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); }

.foot { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 14px; color: var(--muted); }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

@media (max-width: 1020px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .cats, .grid { grid-template-columns: 1fr; }
  .intro { padding: 44px 0 28px; }
  .intro p { font-size: 17px; }
  .cat { padding: 20px; }
  .next { padding: 22px; }
  /* "Все демо" already links home, so the logo gives way to the section links */
  .brand { display: none; }
  .nav { width: 100%; justify-content: space-between; }
  .nav a { padding: 0 10px; font-size: 14px; white-space: nowrap; }
}
@media (max-width: 380px) {
  .nav { gap: 2px; }
  .nav a { padding: 0 5px; font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
