/* Новогодние витрины Уют-Сити. Цвета и шрифты из ui-kit сайта (clients/uyut-siti/ui-kit.md). */
@font-face { font-family: "RotondaC"; src: url("assets/fonts/RotondaC-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Open Sans"; src: url("assets/fonts/OpenSans.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Open Sans"; src: url("assets/fonts/OpenSans-Semibold.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --red: #de2c37;        /* фирменный красный сайта */
  --red-deep: #a51c26;   /* тень вязки, нажатие */
  --ink: #231f20;        /* текст сайта */
  --ink-soft: #5f585a;   /* второстепенный текст, 6.9:1 на белом */
  --line: #e2dfdf;
  --mist: #f4f4f4;       /* подложка сайта */
  --paper: #ffffff;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --wrap: 1240px;
  --gut: 40px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 18px/1.55 "Open Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--red); text-underline-offset: 3px; }
a:hover { color: var(--red-deep); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: "RotondaC", "Open Sans", sans-serif; font-weight: 700; margin: 0; line-height: 1.05; }

.skip { position: absolute; left: 16px; top: -60px; z-index: 50; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; }
.skip:focus { top: 12px; color: #fff; }

/* шапка */
.top {
  max-width: var(--wrap); margin: 0 auto; padding: 18px var(--gut);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.top__logo img { width: 184px; }
.top__nav { display: flex; gap: 28px; }
.top__nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 16px; padding: 10px 0; }
.top__nav a:hover { color: var(--red); }

/* вязка: подол новогоднего свитера */
.knit { height: 137px; background: var(--red-deep) url("assets/knit.svg") 0 0 / auto 137px repeat-x; }
.knit--hem { height: 60px; background-image: url("assets/knit-hem.svg"); background-size: auto 60px; }

/* первый экран */
.hero {
  position: relative; overflow: hidden;
  max-width: var(--wrap); margin: 0 auto; padding: 48px var(--gut) 80px;
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 64px; align-items: start;
}
.hero__mark {
  position: absolute; z-index: 0; pointer-events: none;
  width: 720px; height: 628px; right: -150px; top: -60px;
  background: url("assets/mark.svg") center / contain no-repeat;
}
.hero__text, .steps { position: relative; z-index: 1; }
.hero h1 { font-size: 64px; letter-spacing: -0.01em; }
.hero h1 span { display: block; color: var(--red); }
.hero__lead { font-size: 21px; max-width: 34em; margin: 28px 0 0; }
.hero__facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 24px 0 36px; color: var(--ink-soft); font-weight: 600; font-size: 16px; }
.hero__deadline { color: var(--ink); }
.steps { list-style: none; margin: 8px 0 0; padding: 0; counter-reset: s; display: grid; gap: 22px; }
.steps li {
  counter-increment: s; display: grid; grid-template-columns: 48px minmax(0, 1fr); column-gap: 18px;
  background: var(--paper); border: 2px solid var(--line); border-radius: 14px; padding: 18px 20px;
}
.steps li::before {
  content: counter(s); grid-row: span 2; width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; background: var(--paper); color: var(--red); border: 2px solid var(--red);
  font: 700 24px/1 "RotondaC", sans-serif;
}
.steps b { font-weight: 600; font-size: 18px; }
.steps span { color: var(--ink-soft); font-size: 16px; }

.voted { margin: 24px 0 0; padding: 18px 22px; border-radius: 14px; background: #e8f4ec; border: 2px solid #1f7a45; }
.voted__title { margin: 0; font-weight: 600; color: #155c33; }
.voted__list { margin: 4px 0 0; font-size: 16px; }

/* кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 14px 36px; border-radius: 30px; border: 0;
  background: var(--red); color: #fff; font: 600 18px/1.2 "Open Sans", sans-serif;
  text-decoration: none; cursor: pointer; transition: background-color 300ms var(--ease);
}
.btn:active { background: var(--red-deep); }
.pick {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; min-width: 150px; padding: 10px 26px; border-radius: 30px;
  border: 2px solid var(--red); background: var(--paper); color: var(--ink);
  font: 600 16px/1.2 "Open Sans", sans-serif; cursor: pointer;
  transition: background-color 300ms var(--ease), color 300ms var(--ease);
}
.pick[aria-pressed="true"] { background: var(--red); color: #fff; }
.pick[aria-pressed="true"]::before { content: "✓"; font-weight: 700; }
.pick[aria-disabled="true"] { border-color: var(--line); color: var(--ink-soft); cursor: not-allowed; }

/* сетка витрин */
.vitriny { background: var(--mist); padding: 80px 0 96px; }
.vitriny:focus { outline: none; }
.vitriny__head, .grid { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }
.vitriny__head { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 40px; }
.vitriny__head h2 { font-size: 48px; }
.vitriny__head p { margin: 0; max-width: 30em; color: var(--ink-soft); font-size: 16px; }
.grid { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 32px; }

.card { display: flex; flex-direction: column; min-inline-size: 0; }
.card__photo {
  position: relative; display: block; padding: 0; border: 0; border-radius: 12px; overflow: hidden;
  background: var(--line); cursor: zoom-in; aspect-ratio: 3 / 2;
}
.card__photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms var(--ease); }
.card.is-target .card__photo { outline: 4px dashed var(--ink); outline-offset: 3px; }
.card.is-picked .card__photo { outline: 4px solid var(--red); outline-offset: 3px; }
.card__place {
  position: absolute; left: 12px; bottom: 12px; padding: 6px 12px; border-radius: 16px;
  background: var(--paper); color: var(--red); font: 700 13px/1 "Open Sans", sans-serif; text-transform: uppercase; letter-spacing: .04em;
}
.card__mine {
  position: absolute; right: 12px; bottom: 12px; padding: 6px 12px; border-radius: 16px;
  background: var(--red); color: #fff; font: 600 13px/1 "Open Sans", sans-serif;
}
.card__body { display: flex; flex-direction: column; gap: 6px; padding: 18px 2px 0; flex: 1; }
.card__meta { display: flex; justify-content: space-between; align-items: baseline; margin: 0; font-size: 15px; color: var(--ink-soft); font-weight: 600; }
.zero { font-weight: 400; color: var(--ink-soft); }
.card__votes b { font: 700 22px/1 "RotondaC", sans-serif; color: var(--ink); font-variant-numeric: tabular-nums; margin-right: 4px; }
.card__name { font-size: 26px; overflow-wrap: anywhere; }
.card__kind { margin: 0; color: var(--ink-soft); font-size: 16px; }
.card__act { margin-top: auto; padding-top: 14px; }

/* правила */
.rules { max-width: var(--wrap); margin: 0 auto; padding: 88px var(--gut) 96px; }
.rules h2 { font-size: 48px; margin-bottom: 36px; }
.rules dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 56px; max-width: 1080px; }
.rules dt { font-weight: 600; margin-bottom: 4px; }
.rules dd { margin: 0; color: var(--ink-soft); font-size: 17px; }

/* подвал */
.foot__row {
  max-width: var(--wrap); margin: 0 auto; padding: 28px var(--gut) 120px;
  display: flex; flex-wrap: wrap; gap: 8px 36px; font-size: 16px; color: var(--ink-soft);
}
.foot__row p { margin: 0; }
.foot__row a { color: var(--ink); }

/* лоток выбора */
.tray {
  position: fixed; z-index: 20; left: 50%; bottom: 16px; transform: translateX(-50%);
  width: min(760px, calc(100% - 32px));
  display: flex; align-items: center; gap: 18px; padding: 12px 12px 12px 14px;
  background: var(--paper); border-radius: 18px; box-shadow: 0 10px 40px rgba(35, 31, 32, .22);
  animation: tray-in 500ms var(--ease);
}
.tray[hidden] { display: none; }
@keyframes tray-in { from { transform: translate(-50%, 24px); opacity: 0; } }
.tray__slots { display: flex; gap: 8px; }
.tray__slot { position: relative; width: 66px; height: 44px; padding: 0; border-radius: 8px; border: 0; overflow: hidden; flex: none; background: none; cursor: pointer; }
.tray__x { position: absolute; right: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); color: #fff; font: 600 14px/18px "Open Sans", sans-serif; text-align: center; }
.tray__slot img { width: 100%; height: 100%; object-fit: cover; }
.tray__count { margin: 0; flex: 1; min-inline-size: 0; line-height: 1.3; }
.tray__count b { display: block; font-weight: 600; }
.tray__count span { display: block; font-size: 15px; color: var(--ink-soft); }
.tray__count.is-hint { font-size: 15px; font-weight: 600; color: var(--red-deep); }
.tray .btn { flex: none; }

/* окна */
.dlg {
  width: min(560px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 36px; border: 0; border-radius: 18px;
  color: var(--ink); box-shadow: 0 20px 60px rgba(35, 31, 32, .3);
}
.dlg::backdrop { background: rgba(35, 31, 32, .55); }
.dlg h2 { font-size: 32px; padding-right: 40px; text-wrap: balance; }
.dlg__close { position: absolute; right: 14px; top: 14px; margin: 0; }
.dlg__close button {
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--mist); color: var(--ink);
  font-size: 26px; line-height: 1; cursor: pointer;
}
.dlg__choice { list-style: none; margin: 18px 0 22px; padding: 0; display: grid; gap: 8px; }
.dlg__choice li { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.dlg__choice img { width: 60px; height: 40px; border-radius: 6px; object-fit: cover; flex: none; }
.dlg p { margin: 0 0 14px; }
.dlg .btn { width: 100%; }
.dlg__hint { color: var(--ink-soft); font-size: 16px; }
.dlg__steps { margin: 0 0 14px; padding-left: 22px; font-size: 16px; }
.dlg__steps li { margin: 4px 0; }
.dlg .dlg__final { font-weight: 600; }
.dlg .dlg__small { margin: 10px 0 14px; font-size: 14px; color: var(--ink-soft); }
.dlg__code { font: 700 30px/1 "RotondaC", sans-serif; letter-spacing: .12em; color: var(--ink); white-space: nowrap; }
.dlg__wait { display: flex; align-items: center; gap: 12px; margin: 18px 0 0; padding: 14px 16px; border-radius: 12px; background: var(--mist); font-weight: 600; }
.spin { width: 20px; height: 20px; border-radius: 50%; border: 3px solid #c3c3c3; border-top-color: var(--red); animation: spin 900ms linear infinite; flex: none; }
.btn .spin { border-color: rgba(255,255,255,.45); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
.note { padding: 16px 18px; border-radius: 12px; margin: 0 0 18px; font-weight: 600; }
.note--ok { background: #e8f4ec; border: 2px solid #1f7a45; color: #155c33; }
.note--info { background: var(--mist); border: 2px solid #c3c3c3; color: var(--ink); }
.note--bad { background: #fdecec; border: 2px solid var(--red); color: #8f1720; }

.dlg.dlg--photo { width: min(1100px, calc(100% - 32px)); padding: 0; overflow: hidden; }
.ph { background: var(--ink); }
.ph__in { position: relative; }
.ph__in img { width: 100%; height: auto; max-height: calc(100vh - 230px); object-fit: contain; }
.ph__a, .ph__b { position: absolute; top: 0; bottom: 0; width: 50%; scroll-snap-align: start; pointer-events: none; }
.ph__a { left: 0; } .ph__b { left: 50%; }
.dlg .ph__hint { display: none; }
.linkbtn { min-height: 36px; margin-top: 4px; padding: 6px 0; border: 0; background: none; color: var(--red); font: 600 15px/1.3 "Open Sans", sans-serif; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.dlg .dlg__copied { margin: 0; font-size: 14px; color: var(--ink-soft); overflow-wrap: anywhere; }
.dlg--photo .dlg__close { z-index: 2; }
.dlg__photo-foot { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 24px 22px; }
.dlg__photo-foot h2 { font-size: 28px; padding: 0; }
.dlg__photo-foot p { margin: 4px 0 0; color: var(--ink-soft); font-size: 16px; }

@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .steps { max-width: 620px; }
}
@media (max-width: 700px) {
  :root { --gut: 16px; }
  body { font-size: 17px; }
  .top { padding-top: 12px; padding-bottom: 12px; }
  .top__logo img { width: 140px; }
  .top__nav { gap: 18px; }
  .knit { height: 96px; background-size: auto 96px; }
  .knit--hem { height: 44px; background-size: auto 44px; }
  .hero { padding: 44px var(--gut) 56px; gap: 36px; }
  .hero__mark { width: 440px; height: 384px; right: -170px; top: -40px; }
  .hero h1 { font-size: 46px; }
  .hero__lead { font-size: 18px; margin-top: 20px; }
  .hero .btn { width: 100%; }
  .card .pick { width: 100%; }
  .steps { gap: 14px; }
  .steps li { grid-template-columns: 40px minmax(0, 1fr); column-gap: 14px; padding: 0; border: 0; background: none; }
  .steps li::before { width: 40px; height: 40px; font-size: 20px; }
  .vitriny { padding: 56px 0 72px; }
  .vitriny__head h2, .rules h2 { font-size: 36px; }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .rules { padding: 56px var(--gut) 64px; }
  .rules dl { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .tray { bottom: 0; width: 100%; border-radius: 18px 18px 0 0; padding: 10px 12px; gap: 10px; flex-wrap: wrap; }
  .tray__slot { width: 56px; height: 40px; }
  .tray__count { font-size: 15px; }
  .tray .btn { width: 100%; }
  .dlg { padding: 28px 20px 24px; }
  .dlg h2 { font-size: 26px; }
  .dlg__photo-foot { flex-direction: column; align-items: stretch; padding: 16px; }
  .dlg.dlg--photo { width: calc(100% - 16px); }
  .ph { overflow-x: auto; scroll-snap-type: x mandatory; }
  .ph__in { width: max-content; }
  .ph__in img { width: auto; max-width: none; height: min(62vh, 560px); max-height: none; }
  .dlg .ph__hint { display: block; margin: 10px 16px 0; font-size: 14px; color: var(--ink-soft); }
  .foot__row { padding-bottom: 150px; }
}
@media (hover: hover) {
  .btn:hover { background: #e4434d; color: #fff; }
  .pick:not([aria-disabled="true"]):not([aria-pressed="true"]):hover { background: var(--red); color: #fff; }
  .card__photo:hover img { transform: scale(1.03); }
  .dlg__close button:hover { background: var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .spin { animation: spin 1600ms linear infinite !important; }
}
