/* bodin.ru — проекты и демо-версии */

:root {
  --bg: #0a0c10;
  --bg-2: #11141b;
  --bg-3: #171b24;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #eef0f4;
  --muted: #a1a9b8;
  --dim: #6c7486;
  --accent: #9db4ff;
  --live: #4ade80;
  --dev: #fbbf24;
  --archive: #8b93a3;
  --r: 22px;
  --wrap: 1200px;
  --pad: clamp(20px, 4vw, 40px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1100px 620px at 78% -8%, rgba(126, 146, 255, 0.11), transparent 62%),
    radial-gradient(800px 500px at -10% 10%, rgba(245, 185, 66, 0.05), transparent 60%),
    var(--bg);
  background-repeat: no-repeat;
  color: var(--text);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  flex: 1;
}

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

a {
  color: inherit;
}

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

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--pad));
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* ---------- шапка и подвал ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(10, 12, 16, 0.72);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.top.scrolled {
  border-bottom-color: var(--line);
}

.top-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 650 19px/1 var(--display);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.logo span span {
  color: var(--dim);
}

.logo svg {
  width: 24px;
  height: 24px;
}

.logo circle {
  fill: #2a3040;
}

.logo path {
  fill: #f3efe4;
}

.top-nav a {
  color: var(--muted);
  font-size: 15px;
  text-decoration: none;
  transition: color 0.15s;
}

.top-nav a:hover {
  color: var(--text);
}

.foot {
  margin-top: clamp(64px, 10vw, 120px);
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 14px;
}

.foot-in {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 28px calc(28px + env(safe-area-inset-bottom));
}

/* ---------- общие элементы ---------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

h1,
h2 {
  font-family: var(--display);
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.lead {
  max-width: 640px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.55;
  text-wrap: pretty;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  color: var(--dim);
  font-size: 14px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 11px 4px 9px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--text);
  font-size: 13px;
  font-weight: 550;
  line-height: 1.4;
  white-space: nowrap;
}

.status i {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c);
}

.status-live {
  --c: var(--live);
}

.status-dev {
  --c: var(--dev);
}

.status-archive {
  --c: var(--archive);
}

.status-live i::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--c);
  animation: ping 2.4s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {
  70%,
  100% {
    transform: scale(2.6);
    opacity: 0;
  }
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tags li {
  padding: 3px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform 0.15s,
    background-color 0.15s,
    border-color 0.15s,
    box-shadow 0.2s;
}

.btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-lg {
  padding: 12px 22px;
  font-size: 16px;
}

.btn-accent {
  background: var(--accent);
  color: #0a0c10;
}

.btn-accent:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px -10px var(--accent);
}

.btn-ghost {
  border-color: var(--line-2);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.04);
}

/* «Окно браузера» вокруг скриншота */
.window {
  display: block;
  text-decoration: none;
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: #0d0f14;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 30px 60px -30px rgba(0, 0, 0, 0.8);
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: #151821;
}

.window-bar i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
}

.window-bar span {
  flex: 1;
  margin-right: 33px; /* центр по ширине окна, с поправкой на точки */
  color: var(--dim);
  font-size: 12px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- главная ---------- */

.hero {
  padding-top: clamp(56px, 11vw, 136px);
  padding-bottom: clamp(40px, 6vw, 72px);
}

.hero h1 {
  max-width: 12ch;
  margin: 0 0 26px;
  font-size: clamp(44px, 7.6vw, 96px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.045em;
}

/* Витрина справа от заголовка: окно браузера и телефон */
.showcase {
  display: none;
}

@media (min-width: 1000px) {
  .hero.has-showcase {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
    align-items: center;
    gap: clamp(32px, 4vw, 64px);
    padding-top: clamp(48px, 7vw, 96px);
  }

  .hero.has-showcase h1 {
    font-size: clamp(48px, 5.4vw, 80px);
  }

  .showcase {
    position: relative;
    display: block;
    aspect-ratio: 1 / 0.82;
  }
}

.showcase::before {
  content: "";
  position: absolute;
  inset: -6% -4% -10%;
  z-index: -1;
  background:
    radial-gradient(45% 50% at 70% 35%, color-mix(in srgb, var(--a1) 26%, transparent), transparent 70%),
    radial-gradient(35% 45% at 18% 78%, color-mix(in srgb, var(--a2) 22%, transparent), transparent 70%);
  filter: blur(24px);
}

.sc {
  position: absolute;
  display: block;
  text-decoration: none;
  animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.sc-window {
  top: 2%;
  right: 0;
  width: 94%;
  transform: perspective(1800px) rotateY(-11deg) rotateX(3deg);
  transform-origin: 100% 50%;
}

.sc-window:hover {
  transform: perspective(1800px) rotateY(-6deg) rotateX(2deg) translateY(-4px);
}

.sc-window .window {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 50px 90px -40px rgba(0, 0, 0, 0.95),
    0 30px 120px -60px var(--accent);
}

.sc-phone {
  left: 2%;
  bottom: -2%;
  width: 31%;
  transform: perspective(1400px) rotateY(9deg) rotateZ(-2deg);
  animation-delay: 0.15s;
}

.sc-phone:hover {
  transform: perspective(1400px) rotateY(4deg) rotateZ(-1deg) translateY(-6px);
}

.phone {
  display: block;
  padding: 6px;
  border: 1px solid var(--line-2);
  border-radius: 32px;
  background: #050608;
  box-shadow:
    0 40px 70px -25px rgba(0, 0, 0, 0.95),
    0 20px 80px -40px var(--accent);
}

.phone img {
  border-radius: 26px;
}

@keyframes rise {
  from {
    opacity: 0;
    translate: 0 24px;
  }
}

.counts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 15px;
}

.counts b {
  color: var(--text);
  font: 650 22px/1 var(--display);
  letter-spacing: -0.02em;
  margin-right: 4px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 550 14px/1.2 var(--font);
  cursor: pointer;
  transition:
    color 0.15s,
    background-color 0.15s,
    border-color 0.15s;
}

.chip span {
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.chip:hover {
  color: var(--text);
}

.chip[aria-pressed="true"] {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

.chip[aria-pressed="true"] span {
  color: rgba(10, 12, 16, 0.55);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr));
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-2);
  transition:
    border-color 0.25s,
    transform 0.25s,
    box-shadow 0.3s;
}

.card[hidden] {
  display: none;
}

.card:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  transform: translateY(-3px);
  box-shadow: 0 40px 80px -50px color-mix(in srgb, var(--accent) 70%, transparent);
}

.card-media {
  display: block;
  text-decoration: none;
  padding: clamp(18px, 3vw, 30px) clamp(18px, 3vw, 30px) 0;
  background:
    radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    var(--bg-3);
  border-bottom: 1px solid var(--line);
}

.card-media .window {
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
}

.card-media img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top left;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
  transform-origin: 50% 0;
}

.card:hover .card-media img {
  transform: scale(1.025);
}

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  padding: clamp(22px, 3vw, 30px);
}

.card h2 {
  margin: 4px 0 0;
  font-size: clamp(24px, 2.6vw, 30px);
  font-weight: 650;
  line-height: 1.15;
}

.card-link {
  text-decoration: none;
}

/* вся карточка кликабельна, кнопки — поверх */
.card-link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.card-body > p {
  margin: 0;
  color: var(--muted);
  text-wrap: pretty;
}

.card .actions {
  margin-top: auto;
  padding-top: 8px;
}

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

/* ---------- страница проекта ---------- */

.p-head {
  padding-top: clamp(28px, 5vw, 56px);
  padding-bottom: clamp(32px, 5vw, 56px);
}

.back {
  display: inline-block;
  margin-bottom: clamp(28px, 5vw, 48px);
  color: var(--muted);
  font-size: 15px;
  text-decoration: none;
}

.back:hover {
  color: var(--text);
}

.p-head h1 {
  margin: 18px 0 18px;
  font-size: clamp(40px, 6.4vw, 80px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
}

.p-head .actions {
  margin-top: 30px;
}

.demo-note {
  max-width: 640px;
  margin-top: 28px;
  padding: 16px 20px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  font-size: 15px;
}

.demo-note b {
  color: var(--accent);
}

.demo-note p {
  margin: 4px 0 0;
  color: var(--muted);
}

.p-cover {
  position: relative;
  margin-block: 0;
}

.p-cover::before {
  content: "";
  position: absolute;
  inset: -8% 4% auto;
  height: 70%;
  z-index: -1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 22%, transparent), transparent);
  filter: blur(30px);
}

.p-cover .window {
  cursor: zoom-in;
}

figcaption {
  margin-top: 12px;
  color: var(--dim);
  font-size: 14px;
}

.p-cover figcaption {
  text-align: center;
}

.p-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: clamp(32px, 6vw, 80px);
  margin-top: clamp(48px, 7vw, 88px);
}

.p-text {
  max-width: 680px;
  font-size: 17px;
}

.p-text h2,
.gallery h2 {
  margin: 0 0 18px;
  font-size: clamp(24px, 2.6vw, 30px);
  font-weight: 650;
}

.p-text h2:not(:first-child) {
  margin-top: 48px;
}

.p-text p {
  margin: 0 0 16px;
  color: #c9ced8;
  text-wrap: pretty;
}

.features {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.features li {
  position: relative;
  padding-left: 28px;
  color: #c9ced8;
}

.features li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 12px;
  height: 7px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: translateY(-50%) rotate(-45deg);
}

.p-facts {
  align-self: start;
  position: sticky;
  top: 88px;
}

.p-facts dl {
  margin: 0;
  padding: 8px 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg-2);
}

.p-facts dl > div {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.p-facts dl > div:last-child {
  border-bottom: 0;
}

.p-facts dt {
  margin-bottom: 6px;
  color: var(--dim);
  font-size: 13px;
}

.p-facts dd {
  margin: 0;
  font-size: 15px;
}

.p-facts dd a {
  color: var(--accent);
  text-decoration: none;
}

.p-facts dd a:hover {
  text-decoration: underline;
}

.gallery {
  margin-top: clamp(56px, 8vw, 104px);
}

.shots-wide {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 28px 24px;
}

.shots-phones {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px clamp(24px, 5vw, 64px);
  margin-top: 48px;
  padding: clamp(32px, 5vw, 56px) 20px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background:
    radial-gradient(70% 80% at 50% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%),
    var(--bg-2);
}

.shot {
  margin: 0;
}

.shot-open {
  display: block;
  text-decoration: none;
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  cursor: zoom-in;
  transition:
    border-color 0.2s,
    transform 0.25s;
}

.shot-open:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

.shot-phone {
  width: min(260px, 70vw);
}

.shot-phone .shot-open {
  padding: 8px;
  border-radius: 38px;
  background: #050608;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9);
}

.shot-phone img {
  border-radius: 30px;
}

.shot-phone figcaption {
  text-align: center;
}

.next {
  margin-top: clamp(64px, 9vw, 120px);
}

.next a {
  display: grid;
  gap: 6px;
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-2);
  text-decoration: none;
  transition: border-color 0.2s;
}

.next a:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

.next span {
  color: var(--dim);
  font-size: 14px;
}

.next b {
  font: 650 clamp(26px, 3.4vw, 40px) / 1.1 var(--display);
  letter-spacing: -0.03em;
}

.next b::after {
  content: " →";
  color: var(--accent);
}

.next em {
  max-width: 640px;
  color: var(--muted);
  font-style: normal;
}

/* ---------- просмотр скриншота ---------- */

.lightbox {
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 24px;
  border: 0;
  background: transparent;
  color: var(--text);
}

.lightbox[open] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.lightbox::backdrop {
  background: rgba(5, 6, 9, 0.9);
  backdrop-filter: blur(6px);
}

.lightbox img {
  max-width: min(1400px, 100%);
  max-height: calc(100% - 60px);
  width: auto;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.lb-cap {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.lb-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

/* ---------- 404 ---------- */

.nf .actions {
  margin-top: 32px;
}

/* ---------- адаптив ---------- */

@media (max-width: 880px) {
  .p-body {
    grid-template-columns: 1fr;
  }

  .p-facts {
    position: static;
  }
}

@media (max-width: 520px) {
  .window-bar {
    height: 24px;
  }

  .window-bar i {
    width: 7px;
    height: 7px;
  }

  .card .actions .btn,
  .p-head .actions .btn {
    flex: 1;
    justify-content: center;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
