* { box-sizing: border-box; }

:root {
  color-scheme: dark;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #f5f2fa;
  background: #141319;
  --surface: #1d1b25;
  --raised: #252132;
  --line: #393343;
  --muted: #bdb5cb;
  --accent: #c9abff;
  --primary: #bf9aff;
  --primary-hover: #d3b8ff;
  --on-primary: #211332;
  --motion: 190ms ease-out;
}

body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; }
:where(a, button):focus-visible { outline: 2px solid #e1ccff; outline-offset: 4px; }
.wrap { width: min(100% - 40px, 1160px); margin-inline: auto; }
.header { background: #19171f; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; min-height: 68px; gap: 11px; align-items: center; font-weight: 750; text-decoration: none; }
.brand span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: var(--primary); color: var(--on-primary); }
main { flex: 1; padding-bottom: clamp(42px, 7vw, 88px); }

.intro { padding: clamp(48px, 8vw, 100px) 0 clamp(26px, 4vw, 44px); }
h1 { margin: 0; max-width: 22ch; font-size: clamp(2.35rem, 6vw, 4.65rem); line-height: 1.04; letter-spacing: -.05em; overflow-wrap: anywhere; }
.intro p, .lead { max-width: 57ch; color: var(--muted); line-height: 1.65; margin: 14px 0 0; }

.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.card {
  display: flex; flex-direction: column; gap: 14px; height: 100%; padding: clamp(20px, 3vw, 28px);
  border: 1px solid var(--line); border-radius: 20px; background: var(--surface);
  transition: transform var(--motion), border-color var(--motion), background var(--motion);
}
.card:focus-within { border-color: var(--accent); }
@media (hover: hover) {
  .card:hover { transform: translateY(-4px); border-color: #9c79cf; background: #231e2e; }
}
.card-brand { display: flex; align-items: center; gap: 14px; min-height: 57px; }
.card-logo { display: grid; place-items: center; flex: 0 0 74px; height: 52px; padding: 8px; border-radius: 12px; background: #f4effa; }
.card-logo img { display: block; max-width: 100%; max-height: 36px; object-fit: contain; }
.card h2 { font-size: clamp(1.25rem, 2vw, 1.65rem); line-height: 1.15; margin: 0; overflow-wrap: anywhere; }
.card-brand:not(:has(.card-logo)) h2 { font-size: clamp(1.45rem, 2.4vw, 1.95rem); }
.card-domain, .card time { display: block; margin-top: 5px; font-size: .86rem; color: var(--muted); overflow-wrap: anywhere; }
.card-offer { margin: 0; padding-top: 14px; border-top: 1px solid var(--line); line-height: 1.45; overflow-wrap: anywhere; }
.card-actions { display: grid; gap: 10px; margin-top: auto; }
.card-date { min-height: 1.25em; }
.all-promos, .back, .copy a, .info a:not(.button) { color: var(--accent); text-underline-offset: 4px; }
.all-promos { justify-self: start; font-size: .9rem; }
.back { display: inline-block; margin: 28px 0 18px; }
.catalog-back {
  display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 8px 14px;
  border: 1px solid #5d4978; border-radius: 12px; background: var(--surface);
  color: #f5f2fa; font-size: .9rem; font-weight: 650; text-decoration: none;
  transition: background var(--motion), border-color var(--motion), transform var(--motion);
}
.catalog-back svg { flex: none; color: var(--accent); }
.catalog-back:hover { background: var(--raised); border-color: var(--accent); }
.catalog-back:active { background: #30243f; transform: translateY(1px); }
@media (prefers-reduced-motion: reduce) {
  .catalog-back { transition: none; }
  .catalog-back:active { transform: none; }
}

.button, .promo-button, .copy-button {
  display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 10px;
  padding: 10px 16px; border: 1px solid transparent; border-radius: 12px; font: inherit; font-weight: 700;
  background: var(--primary); color: var(--on-primary); text-decoration: none; cursor: pointer;
  transition: background var(--motion), border-color var(--motion), transform var(--motion);
}
.button:hover, .promo-button:hover { background: var(--primary-hover); }
.button:active, .promo-button:active, .copy-button:active { transform: translateY(2px); }
.promo-button { width: 100%; }

.detail { padding: clamp(22px, 4vw, 46px); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }
.detail h1 { font-size: clamp(2rem, 5vw, 3.75rem); }
.domain { color: var(--accent); font-weight: 650; overflow-wrap: anywhere; margin: 0 0 12px; }
.copy { max-width: 65ch; margin-block: 24px; color: #ded8e8; line-height: 1.68; overflow-wrap: anywhere; }
.store { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; gap: clamp(16px, 2.5vw, 28px); }
.store .detail { min-width: 0; padding: clamp(20px, 3.2vw, 36px); }
.store-promos { min-width: 0; scroll-margin-top: 16px; }
.store-promos h2, .info h2 { margin: 0 0 16px; font-size: 1.3rem; }
.offer-list { list-style: none; display: grid; gap: 12px; margin: 0; padding: 0; }
.offer { padding: 16px; border: 1px solid #4b3b62; background: var(--raised); border-radius: 14px; overflow-wrap: anywhere; }
.offer h3 { margin: 0; font-size: 1rem; line-height: 1.4; }
.offer-value { margin: 6px 0; font-weight: 700; color: var(--accent); }
.offer-demo, .offer-dates, .draft-status { color: var(--muted); font-size: .85rem; }
.offer-demo { margin: 6px 0; }
.offer-code, .offer-dates { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.offer-code code { padding: 8px 10px; border-radius: 8px; background: #3a2a4d; font-weight: 750; }
.copy-button { min-height: 40px; padding: 6px 10px; border-color: #9975c8; background: transparent; color: var(--accent); font-size: .88rem; }
.copy-button:hover { background: #39294c; border-color: var(--accent); }
.copy-status { margin: 6px 0 0; color: var(--accent); font-size: .85rem; }
.copy-status:empty { margin: 0; }

.footer { background: #19171f; border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: repeat(5, minmax(0, auto)); align-items: start; gap: 24px; padding-block: 32px; }
.footer-brand { min-height: 0; font-size: .9rem; }
.footer-brand span { width: 28px; height: 28px; border-radius: 9px; }
.footer nav ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.footer nav a, .copyright { font-size: .85rem; line-height: 1.45; overflow-wrap: anywhere; }
.footer nav a { color: #ded8e8; text-decoration: none; }
.footer nav a:hover { color: var(--accent); text-decoration: underline; }
.copyright { margin: 0; color: var(--muted); }

@media (max-width: 960px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .store { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .wrap { width: min(100% - 32px, 1160px); }
  .grid, .footer-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .card, .button, .promo-button, .copy-button { transition: none; transform: none !important; }
}

.promo-button span { display: inline-block; transition: transform 230ms cubic-bezier(.2,.8,.2,1); }
.promo-button:is(:hover, :focus-visible) span { transform: translateX(5px); }

@keyframes card-arrive {
  from { opacity: .55; transform: translateY(26px) scale(.975); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes panel-arrive {
  from { opacity: .50; transform: translate(var(--enter-x, 0px), 20px); }
  to { opacity: 1; transform: translate(0, 0); }
}
@keyframes route-out {
  to { opacity: .35; transform: translateY(-10px) scale(.995); }
}

@media (prefers-reduced-motion: no-preference) {
  main.route-leaving { animation: route-out 180ms ease-in both; }

  .grid > li:nth-child(-n+6) {
    animation: card-arrive 610ms cubic-bezier(.16,1,.3,1) backwards;
    animation-delay: calc(145ms + var(--step, 0) * 65ms);
  }
  .grid > li:nth-child(2) { --step: 1; }
  .grid > li:nth-child(3) { --step: 2; }
  .grid > li:nth-child(4) { --step: 3; }
  .grid > li:nth-child(5) { --step: 4; }
  .grid > li:nth-child(6) { --step: 5; }

  .store-overview, .store-promos, .info { animation: panel-arrive 620ms cubic-bezier(.16,1,.3,1) backwards; }
  .store-overview { --enter-x: -18px; }
  .store-promos { --enter-x: 18px; animation-delay: 110ms; }
  .offer-list > li:nth-child(-n+3) { animation: card-arrive 470ms cubic-bezier(.16,1,.3,1) backwards; animation-delay: 200ms; }
  .offer-list > li:nth-child(2) { animation-delay: 255ms; }
  .offer-list > li:nth-child(3) { animation-delay: 310ms; }
  @media (max-width: 760px) {
    .store-overview, .store-promos { --enter-x: 0px; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .promo-button span { transition: none; transform: none; }
}

.home-catalog { padding-top: clamp(18px, 3vw, 30px); }
.shop-search { width: min(100%, 560px); margin: 0 auto 24px; }
.shop-search label { display: block; margin-bottom: 8px; font-size: .94rem; font-weight: 650; }
.shop-search-field {
  display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 5px 7px 5px 15px;
  border: 1px solid #625174; border-radius: 14px; background: var(--surface);
}
.shop-search-field:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.shop-search-field input {
  flex: 1; width: 100%; min-width: 0; min-height: 44px; padding: 0;
  border: 0; outline: none; background: transparent; color: inherit; font: inherit;
}
.shop-search-field input::placeholder { color: var(--muted); }
.shop-search-field input::-webkit-search-cancel-button { display: none; }
.shop-search-icon {
  position: relative; flex: 0 0 14px; height: 14px;
  border: 2px solid var(--accent); border-radius: 50%; margin-right: 4px;
}
.shop-search-icon::after {
  content: ""; position: absolute; width: 7px; height: 2px; top: 10px; left: 9px;
  border-radius: 2px; background: var(--accent); transform: rotate(45deg); transform-origin: left center;
}
.shop-search-clear { min-height: 44px; }
.shop-search-clear[hidden], #shop-grid > li[hidden] { display: none; }
.visually-hidden, .shop-search-status { clip-path: inset(50%); position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; }
.shop-search-empty h2 { margin: 0 0 15px; }

.home-categories { margin-bottom: clamp(24px, 4vw, 40px); }
.home-categories h2 { margin: 0 0 14px; font-size: clamp(1.2rem, 3vw, 1.65rem); }
.category-card {
  display: flex; flex-direction: column; min-height: 136px; height: 100%; gap: 10px;
  padding: clamp(16px, 2.5vw, 23px); border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface); color: inherit; text-decoration: none; overflow-wrap: anywhere;
  transition: background var(--motion), border-color var(--motion);
}
.category-card:hover { background: var(--raised); border-color: var(--accent); }
.category-card h3 { margin: 0; font-size: clamp(1.05rem, 1.8vw, 1.28rem); }
.category-card p { margin: 0; color: var(--muted); line-height: 1.5; font-size: .9rem; }
.category-card div { display: flex; justify-content: space-between; gap: 10px; margin-top: auto; color: var(--accent); }
.category-intro { margin-bottom: clamp(20px, 4vw, 34px); }
@media (prefers-reduced-motion: reduce) { .category-card { transition: none; } }
