:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-strong: #191919;
  --text: #202020;
  --muted: #6d6a64;
  --line: #ded8cd;
  --coral: #e85d4f;
  --green: #3f8f69;
  --blue: #3178c6;
  --gold: #c69231;
  --shadow: 0 20px 60px rgba(32, 30, 26, 0.12);
}

body.dark {
  color-scheme: dark;
  --bg: #111316;
  --surface: #1b1f24;
  --surface-strong: #f7f0e6;
  --text: #f6f1e8;
  --muted: #b5aea4;
  --line: #343a42;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 56px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-logo {
  display: block;
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 8px;
}

.nav-links {
  display: flex;
  gap: 24px;
  color: var(--muted);
  font-weight: 600;
}

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

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

main {
  display: grid;
  gap: 20px;
  padding: 18px clamp(18px, 4vw, 56px) 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(320px, 1.22fr);
  gap: 22px;
  align-items: center;
  min-height: calc(100vh - 112px);
  padding-bottom: 8px;
}

.hero-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 16px;
  font-size: clamp(2.65rem, 5.4vw, 4.9rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(1.5rem, 3vw, 2.6rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 620px;
  color: var(--muted);
  font-size: 1.04rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.primary-action,
.secondary-action,
.download-action {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 800;
}

.primary-action,
.download-action {
  background: var(--surface-strong);
  color: var(--bg);
}

.secondary-action {
  border: 1px solid var(--line);
  background: var(--surface);
}

.hero-visual {
  display: grid;
  min-height: 430px;
  place-items: center;
  overflow: hidden;
}

.hero-visual img {
  display: block;
  width: min(78%, 520px);
  max-height: 68vh;
  object-fit: contain;
  filter: drop-shadow(0 28px 48px rgba(32, 30, 26, 0.18));
  transform-origin: center;
  animation: halfClockwise 5.5s ease-in-out infinite;
}

@keyframes halfClockwise {
  0%,
  100% {
    transform: rotate(-8deg) scale(0.96);
  }

  50% {
    transform: rotate(172deg) scale(1);
  }
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.search-box {
  flex: 1 1 280px;
}

.search-box input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 0 16px;
  outline: none;
}

.search-box input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 18%, transparent);
}

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

.filter-chip {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  padding: 0 14px;
  cursor: pointer;
  font-weight: 700;
}

.filter-chip.active {
  border-color: var(--surface-strong);
  background: var(--surface-strong);
  color: var(--bg);
}

.content-grid,
.download-panel,
.support-band {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(18px, 3vw, 28px);
}

.products-header,
.support-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.products-header p:last-child,
.support-band > p {
  color: var(--muted);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.empty-products {
  grid-column: 1 / -1;
  margin: 0;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 18px;
}

.product-card {
  display: grid;
  grid-template-rows: 150px auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}

.linked-product-card {
  border-color: var(--surface-strong);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 25%, transparent);
}

.product-art {
  position: relative;
  overflow: hidden;
  background: var(--art-color);
}

.product-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-art:has(img)::before,
.product-art:has(img)::after {
  display: none;
}

.product-art::before,
.product-art::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.product-art::before {
  inset: 22px;
}

.product-art::after {
  right: 22px;
  bottom: 22px;
  width: 76px;
  height: 44px;
  background: rgba(255, 255, 255, 0.16);
}

.product-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.product-body h3 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.2;
}

.product-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.card-actions {
  display: grid;
  gap: 8px;
}

.select-button,
.mini-download {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
}

.pay-card-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mini-download {
  display: grid;
  width: 44px;
  place-items: center;
}

.download-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr) auto;
  gap: 22px;
  align-items: center;
}

.details-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.details-list div {
  border-left: 3px solid var(--line);
  padding-left: 12px;
}

.details-list dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.details-list dd {
  margin: 3px 0 0;
  font-weight: 800;
}

.download-action.disabled {
  cursor: not-allowed;
  opacity: 0.48;
  pointer-events: none;
}

.form-page {
  min-height: calc(100vh - 170px);
  align-items: center;
}

.lead-form-panel {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(320px, 1fr);
  gap: clamp(24px, 5vw, 70px);
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: clamp(22px, 5vw, 54px);
}

.form-intro h1 {
  margin-bottom: 18px;
}

.form-product-details {
  display: grid;
  gap: 10px;
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  padding: 16px;
}

.form-product-details h2 {
  margin: 0;
  font-size: 1.05rem;
}

.form-product-details p {
  margin: 0;
  color: var(--muted);
}

.payment-summary {
  display: grid;
  gap: 4px;
  width: fit-content;
  min-width: 190px;
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  padding: 14px 16px;
}

.payment-summary span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.payment-summary strong {
  font-size: 1.45rem;
  line-height: 1.15;
}

.customer-form {
  display: grid;
  gap: 16px;
}

.customer-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.customer-form input,
.customer-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  padding: 13px 14px;
  outline: none;
}

.customer-form textarea {
  resize: vertical;
}

.customer-form input:focus,
.customer-form textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 18%, transparent);
}

.form-status {
  min-height: 24px;
  margin: 0;
  color: #21784b;
  font-weight: 800;
}

.form-status.error {
  color: #bf2f2f;
}

.form-submit {
  width: fit-content;
  border: 0;
  cursor: pointer;
}

.payment-panel {
  display: grid;
  gap: 22px;
  width: min(100%, 680px);
  margin-inline: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: clamp(22px, 5vw, 54px);
}

.payment-panel h1 {
  margin-bottom: 16px;
}

.buy-popup[hidden] {
  display: none;
}

.buy-popup {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
}

.buy-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 18, 15, 0.62);
}

.buy-popup-dialog {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(260px, 1fr);
  gap: 0;
  width: min(100%, 760px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.buy-popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
}

.buy-popup-image {
  min-height: 330px;
  background: var(--bg);
}

.buy-popup-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.buy-popup-content {
  display: grid;
  align-content: center;
  gap: 16px;
  padding: clamp(24px, 4vw, 42px);
}

.buy-popup-content h2 {
  margin: 0;
}

.buy-popup-content p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
}

.buy-popup-content .primary-action {
  width: fit-content;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding: 20px clamp(18px, 4vw, 56px) 32px;
  color: var(--muted);
  font-weight: 700;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 980px) {
  .hero,
  .download-panel,
  .lead-form-panel,
  .buy-popup-dialog {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  h1 {
    font-size: clamp(2.25rem, 7vw, 3.8rem);
  }

  .hero-visual {
    min-height: 340px;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar,
  .products-header,
  .support-band {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
  }

  main {
    padding-inline: 14px;
  }

  h1 {
    font-size: clamp(2.7rem, 15vw, 4.8rem);
  }

  .product-grid,
  .details-list {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 270px;
  }

  .hero-visual img {
    width: min(88%, 360px);
  }

  .footer {
    flex-direction: column;
  }

  .form-submit {
    width: 100%;
  }

  .buy-popup-content .primary-action {
    width: 100%;
  }
}
