:root {
  --ink: #171717;
  --muted: #63666a;
  --line: #dedbd6;
  --paper: #fffdfa;
  --band: #f5f3ef;
  --accent: #c7192e;
  --accent-dark: #941224;
  --green: #1b7d59;
  --blue: #1f5d8c;
  --shadow: 0 18px 50px rgba(26, 24, 20, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

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

.site-header {
  align-items: center;
  background: rgba(255, 253, 250, 0.92);
  border-bottom: 1px solid rgba(222, 219, 214, 0.72);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  left: 0;
  padding: 14px clamp(18px, 4vw, 56px);
  position: fixed;
  right: 0;
  top: 0;
  z-index: 20;
}

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

.brand-mark {
  align-items: center;
  background: var(--accent);
  border-radius: 6px;
  color: white;
  display: inline-flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}

nav {
  display: flex;
  gap: clamp(12px, 3vw, 28px);
  font-size: 0.95rem;
  font-weight: 700;
}

.hero {
  align-items: center;
  background:
    linear-gradient(90deg, rgba(255, 253, 250, 0.96) 0%, rgba(255, 253, 250, 0.8) 34%, rgba(255, 253, 250, 0.08) 72%),
    url("./assets/hero-puzzle.png") center right / cover no-repeat;
  display: flex;
  min-height: 82svh;
  padding: 100px clamp(18px, 5vw, 72px) 56px;
}

.hero-content {
  min-width: 0;
  width: min(100%, 620px);
  max-width: 620px;
}

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

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

h1 {
  font-size: clamp(2.5rem, 6vw, 5.2rem);
  line-height: 0.98;
  margin-bottom: 22px;
  max-width: 13ch;
}

h1 span {
  display: block;
}

.hero-domain {
  font-size: 0.72em;
}

h2 {
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  line-height: 1.1;
  margin-bottom: 12px;
}

h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.hero p:not(.eyebrow) {
  color: #343434;
  font-size: clamp(1rem, 1.5vw, 1.22rem);
  max-width: 510px;
  overflow-wrap: anywhere;
}

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

.button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  transition: background 160ms ease, border 160ms ease, color 160ms ease;
}

.button.primary {
  background: var(--accent);
  color: white;
}

.button.primary:hover {
  background: var(--accent-dark);
}

.button.secondary,
.button.compact {
  background: white;
  border-color: var(--line);
}

.button.secondary:hover,
.button.compact:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.button.full {
  width: 100%;
}

.section-band,
.quality-band {
  padding: clamp(44px, 7vw, 88px) clamp(18px, 5vw, 72px);
}

.section-heading {
  margin: 0 auto 26px;
  max-width: 1120px;
}

.studio {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(280px, 1.2fr) minmax(250px, 0.8fr) minmax(270px, 0.8fr);
  margin: 0 auto;
  max-width: 1120px;
}

.preview-panel,
.controls-panel,
.summary-panel,
.checkout-form {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.preview-panel {
  overflow: hidden;
}

.puzzle-preview {
  align-items: center;
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(135deg, rgba(31, 93, 140, 0.12), rgba(199, 25, 46, 0.08)),
    #ece9e4;
  display: flex;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.puzzle-preview::after {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.42) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.42) 1px, transparent 1px);
  background-size: 48px 48px;
  content: "";
  inset: 0;
  opacity: 0;
  pointer-events: none;
  position: absolute;
}

.puzzle-preview.has-photo::after {
  opacity: 0.78;
}

.jigsaw-layer {
  inset: 0;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  transition: opacity 160ms ease;
}

.puzzle-preview.has-photo .jigsaw-layer {
  opacity: 1;
}

.jigsaw-layer::before,
.jigsaw-layer::after {
  content: "";
  inset: 0;
  position: absolute;
}

.jigsaw-layer::before {
  background-image:
    radial-gradient(circle at 25% 33%, transparent 0 15px, rgba(255, 255, 255, 0.88) 16px 17px, transparent 18px),
    radial-gradient(circle at 50% 66%, transparent 0 15px, rgba(255, 255, 255, 0.88) 16px 17px, transparent 18px),
    radial-gradient(circle at 75% 33%, transparent 0 15px, rgba(255, 255, 255, 0.88) 16px 17px, transparent 18px),
    linear-gradient(rgba(255, 255, 255, 0.72) 2px, transparent 2px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.72) 2px, transparent 2px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 25% 33.33%, 25% 33.33%;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.3));
}

.jigsaw-layer::after {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.28), transparent 38%),
    linear-gradient(315deg, rgba(0, 0, 0, 0.16), transparent 40%);
  mix-blend-mode: soft-light;
}

.jigsaw-layer span {
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.22);
  height: 28px;
  position: absolute;
  width: 28px;
}

.jigsaw-layer span:nth-child(1) {
  left: calc(25% - 14px);
  top: calc(16.66% - 14px);
}

.jigsaw-layer span:nth-child(2) {
  left: calc(50% - 14px);
  top: calc(33.33% - 14px);
}

.jigsaw-layer span:nth-child(3) {
  left: calc(75% - 14px);
  top: calc(50% - 14px);
}

.jigsaw-layer span:nth-child(4) {
  left: calc(25% - 14px);
  top: calc(66.66% - 14px);
}

.jigsaw-layer span:nth-child(5) {
  left: calc(50% - 14px);
  top: calc(83.33% - 14px);
}

.jigsaw-layer span:nth-child(6) {
  left: calc(75% - 14px);
  top: calc(16.66% - 14px);
}

.preview-badge {
  background: rgba(23, 23, 23, 0.78);
  border-radius: 999px;
  bottom: 14px;
  color: white;
  font-size: 0.78rem;
  font-weight: 900;
  left: 14px;
  opacity: 0;
  padding: 7px 10px;
  position: absolute;
  transition: opacity 160ms ease;
}

.puzzle-preview.has-photo .preview-badge {
  opacity: 1;
}

.puzzle-preview img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.preview-empty {
  align-items: center;
  border: 2px dashed rgba(99, 102, 106, 0.45);
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  font-weight: 900;
  height: calc(100% - 48px);
  justify-content: center;
  width: calc(100% - 48px);
}

.preview-footer,
.cart-title,
.price-rows div,
.submit-row {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.preview-footer {
  gap: 16px;
  padding: 16px;
}

.muted-label {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
}

.controls-panel,
.summary-panel {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 18px;
}

label {
  color: #343434;
  display: grid;
  font-size: 0.9rem;
  font-weight: 800;
  gap: 7px;
}

select,
input,
textarea {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  min-height: 44px;
  padding: 10px 12px;
  width: 100%;
}

textarea {
  resize: vertical;
}

.price-rows {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 10px;
  padding-bottom: 16px;
}

.price-rows span,
.cart-box li {
  color: var(--muted);
}

.total-row {
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 14px;
}

.total-row strong {
  color: var(--accent);
  font-size: 1.6rem;
}

.cart-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.cart-title {
  color: var(--ink);
  font-weight: 900;
  margin-bottom: 8px;
}

.cart-title strong {
  align-items: center;
  background: var(--blue);
  border-radius: 999px;
  color: white;
  display: inline-flex;
  height: 24px;
  justify-content: center;
  min-width: 24px;
  padding: 0 7px;
}

.cart-box ul {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.cart-box li {
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.quality-band {
  background: var(--band);
}

.quality-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1.2fr repeat(3, 1fr);
  margin: 0 auto;
  max-width: 1120px;
}

.quality-grid article {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.quality-number {
  color: var(--accent);
  display: block;
  font-weight: 900;
  margin-bottom: 16px;
}

.quality-grid p {
  color: var(--muted);
  margin-bottom: 0;
}

.checkout-band {
  background: white;
}

.checkout-form {
  margin: 0 auto;
  max-width: 920px;
  padding: 22px;
}

.mode-toggle {
  background: var(--band);
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: 18px;
  padding: 4px;
}

.mode-toggle button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 900;
  min-height: 42px;
}

.mode-toggle button.is-active {
  background: white;
  box-shadow: 0 4px 16px rgba(26, 24, 20, 0.12);
  color: var(--accent);
}

.form-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, 1fr);
}

.full-label {
  margin-top: 14px;
}

.payment-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 16px;
  padding: 14px;
}

.payment-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.payment-heading span {
  color: var(--muted);
  font-weight: 800;
}

.payment-options {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, 1fr);
}

.payment-card {
  align-items: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  gap: 12px;
  min-height: 76px;
  padding: 12px;
  text-align: left;
}

.payment-card.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(199, 25, 46, 0.12);
}

.payment-card small {
  color: var(--muted);
  display: block;
  margin-top: 2px;
}

.pay-icon {
  align-items: center;
  background: #1677ff;
  border-radius: 6px;
  color: white;
  display: inline-flex;
  flex: 0 0 auto;
  font-weight: 900;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.pay-icon.green {
  background: #11a847;
}

.submit-row {
  border-top: 1px solid var(--line);
  gap: 16px;
  margin-top: 18px;
  padding-top: 18px;
}

.status-message {
  color: var(--muted);
  font-weight: 800;
  margin: 0;
  text-align: right;
}

.status-message[data-tone="success"] {
  color: var(--green);
}

.status-message[data-tone="error"] {
  color: var(--accent);
}

.site-footer {
  background: var(--ink);
  color: white;
  display: flex;
  justify-content: space-between;
  padding: 24px clamp(18px, 5vw, 72px);
}

@media (max-width: 980px) {
  .hero {
    background:
      linear-gradient(180deg, rgba(255, 253, 250, 0.96) 0%, rgba(255, 253, 250, 0.82) 48%, rgba(255, 253, 250, 0.16) 100%),
      url("./assets/hero-puzzle.png") center right / cover no-repeat;
  }

  .studio,
  .quality-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    position: absolute;
  }

  nav {
    font-size: 0.88rem;
    width: 100%;
  }

  .hero {
    min-height: 84svh;
    padding-top: 132px;
  }

  h1 {
    font-size: 2.08rem;
    max-width: 12ch;
  }

  .hero-content,
  .hero p:not(.eyebrow) {
    max-width: 100%;
  }

  .hero p:not(.eyebrow) {
    line-break: anywhere;
    word-break: break-all;
  }

  .form-grid,
  .submit-row,
  .preview-footer,
  .payment-options {
    display: grid;
    grid-template-columns: 1fr;
  }

  .submit-row .button {
    width: 100%;
  }

  .status-message {
    text-align: left;
  }

  .site-footer {
    flex-direction: column;
    gap: 8px;
  }
}
