:root {
  --studio-cream: #f2f0e9;
  --paper-white: #ffffff;
  --ink-black: #141212;
  --pencil-gray: #a1a0a0;
  --sage-wash: #dde5d8;
  --studio-ivory: #d7d7c8;
  --cobalt-command: #3051a8;
  --forest-ink: #3f593d;
  --marigold: #f89c35;
  --terracotta: #863a29;
  --rose-clay: #ed93af;
  --rust: #a0674f;
  --olive-stone: #a9ab72;
  --stone: #c7b8ab;
  --danger: #b42318;

  --font-sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans SC", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", Consolas, "Courier New", monospace;

  --radius-md: 5px;
  --radius-xl: 12px;
  --radius-full: 100px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--studio-cream);
  color: var(--ink-black);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 300;
  line-height: 1.6;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

a {
  color: var(--ink-black);
  text-decoration: none;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 32px;
  border-bottom: 1px solid var(--ink-black);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 14px;
}

.brand-name {
  font-size: 18px;
  font-weight: 400;
}

.brand-code,
.cart-code,
.eyebrow,
.section-code,
.slot-tag,
.set-code,
.price,
.list-count,
.cart-summary,
.budget-note,
.page-foot {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 300;
}

.brand-code {
  color: var(--pencil-gray);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.topnav a {
  color: var(--ink-black);
  font-weight: 300;
}

.topnav a:hover {
  color: var(--cobalt-command);
}

.cart-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-black);
  font-weight: 400;
}

.cart-link:hover {
  color: var(--cobalt-command);
}

.cart-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--cobalt-command);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 12px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
  gap: 48px;
  align-items: center;
  padding: 72px 32px 90px;
  border-bottom: 1px solid var(--ink-black);
}

.hero-copy {
  max-width: 720px;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 22px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ink-black);
  color: var(--cobalt-command);
}

.display {
  margin: 0 0 24px;
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: 0;
}

.hero-lead {
  max-width: 560px;
  margin: 0 0 32px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-black);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 24px;
  border: 1px solid var(--ink-black);
  border-radius: var(--radius-md);
  background: var(--paper-white);
  color: var(--ink-black);
  font-weight: 400;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn:hover {
  background: var(--ink-black);
  color: var(--paper-white);
}

.btn-primary {
  background: var(--cobalt-command);
  border-color: var(--ink-black);
  color: #fff;
}

.btn-primary:hover {
  background: var(--ink-black);
  color: #fff;
}

.btn-pill {
  border-radius: var(--radius-full);
  background: var(--sage-wash);
}

.btn-ghost {
  background: transparent;
}

.btn-ghost:hover {
  background: var(--studio-ivory);
  color: var(--ink-black);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--ink-black);
  border-left: 1px solid var(--ink-black);
}

.hero-stat {
  flex: 1 1 140px;
  padding: 12px 16px;
  border-right: 1px solid var(--ink-black);
  border-bottom: 1px solid var(--ink-black);
  background: var(--paper-white);
}

.hero-stat dt {
  margin: 0 0 2px;
  color: var(--pencil-gray);
  font-family: var(--font-mono);
  font-size: 12px;
}

.hero-stat dd {
  margin: 0;
  font-size: 17px;
  font-weight: 400;
}

.hero-gallery {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 96px;
  gap: 12px;
}

.img-slot {
  position: relative;
  display: flex;
  align-items: flex-end;
  margin: 0;
  border-radius: var(--radius-xl);
  border: 1px solid var(--ink-black);
  background-color: var(--studio-ivory);
  overflow: hidden;
}

.img-slot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.slot-a {
  grid-column: span 2;
  grid-row: span 2;
  background-color: var(--forest-ink);
}

.slot-b {
  grid-row: span 2;
  background-color: var(--marigold);
}

.slot-c {
  grid-column: span 1;
  grid-row: span 2;
  background-color: var(--stone);
}

.slot-d {
  grid-column: span 2;
  grid-row: span 1;
  background-color: var(--rose-clay);
}

.slot-e {
  grid-column: span 1;
  grid-row: span 2;
  background-color: var(--olive-stone);
}

.slot-f {
  grid-column: span 2;
  grid-row: span 1;
  background-color: var(--terracotta);
}

.section {
  padding: 72px 32px;
  border-bottom: 1px solid var(--ink-black);
}

.section-head {
  max-width: 720px;
  margin-bottom: 40px;
}

.section-code {
  margin: 0 0 12px;
  color: var(--cobalt-command);
}

.section-head h2 {
  margin: 0 0 10px;
  font-size: 40px;
  font-weight: 400;
  line-height: 1.08;
}

.section-lead {
  margin: 0;
  color: var(--pencil-gray);
  font-size: 15px;
}

.set-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.set-card {
  grid-column: span 4;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--ink-black);
  border-radius: var(--radius-xl);
  background: var(--paper-white);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.set-card:nth-child(3n + 1) {
  grid-column: span 5;
}

.set-card:nth-child(3n + 2) {
  grid-column: span 3;
}

.set-card:hover {
  background: var(--sage-wash);
}

.set-card:active {
  transform: translateY(1px);
}

.set-cover {
  width: 100%;
  height: 150px;
  margin-bottom: 14px;
  background-color: var(--studio-ivory);
}

.set-swatches {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.swatch {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  border: 1px solid var(--ink-black);
}

.set-code {
  margin: 0 0 4px;
  color: var(--pencil-gray);
}

.set-card h3 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 400;
}

.set-count {
  margin: 0 0 12px;
  color: var(--pencil-gray);
  font-size: 13px;
}

.set-preview {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--ink-black);
}

.set-preview li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--ink-black);
  font-size: 13px;
}

.set-preview li span:last-child {
  color: var(--pencil-gray);
  font-family: var(--font-mono);
  font-size: 11px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

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

.search-box input {
  width: 100%;
  height: 44px;
  padding: 0 20px;
  border: 1px solid var(--ink-black);
  border-radius: var(--radius-full);
  background: var(--paper-white);
  color: var(--ink-black);
  outline: none;
}

.search-box input::placeholder {
  color: var(--pencil-gray);
}

.search-box input:focus {
  border-width: 2px;
  padding: 0 19px;
}

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

.chip {
  min-height: 34px;
  padding: 6px 18px;
  border: 1px solid var(--ink-black);
  border-radius: var(--radius-full);
  background: var(--sage-wash);
  color: var(--ink-black);
  font-weight: 300;
}

.chip:hover {
  background: var(--paper-white);
}

.chip.is-active {
  background: var(--ink-black);
  color: var(--studio-cream);
}

.sort-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--pencil-gray);
}

.sort-box label {
  font-family: var(--font-mono);
  font-size: 12px;
}

.sort-box select {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--ink-black);
  border-radius: var(--radius-full);
  background: var(--paper-white);
  color: var(--ink-black);
  outline: none;
}

.items-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
}

.items-panel {
  min-width: 0;
}

.items-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 4px;
  padding: 0 4px 10px;
}

.items-head .reset-chip {
  order: 1;
}

.items-head h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 400;
}

.list-count {
  color: var(--pencil-gray);
}

.item-rows {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--ink-black);
}

.item-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--ink-black);
  background: var(--studio-cream);
  transition: background 0.15s ease;
}

.item-row:hover {
  background: var(--sage-wash);
}

.item-row.is-done .item-name {
  color: var(--pencil-gray);
  text-decoration: line-through;
  text-decoration-color: var(--pencil-gray);
}

.item-thumb {
  flex: 0 0 58px;
  width: 58px;
  height: 66px;
  border-radius: var(--radius-md);
}

.item-body {
  flex: 1 1 auto;
  min-width: 0;
}

.item-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 3px;
}

.item-name {
  margin: 0;
  font-size: 15px;
  font-weight: 400;
}

.level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--ink-black);
  color: var(--studio-cream);
  font-size: 11px;
  line-height: 1;
}

.level-badge.recommended {
  background: var(--cobalt-command);
}

.level-badge.optional {
  background: var(--paper-white);
  color: var(--ink-black);
  border: 1px solid var(--ink-black);
}

.item-desc {
  margin: 0 0 2px;
  font-size: 13px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-tip {
  margin: 0;
  color: var(--pencil-gray);
  font-size: 12px;
}

.item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.category-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--pencil-gray);
}

.price {
  color: var(--ink-black);
}

.item-ctrl {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  min-width: 92px;
}

.done-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--pencil-gray);
  font-size: 12px;
  cursor: pointer;
}

.done-label input {
  width: 16px;
  height: 16px;
  accent-color: var(--cobalt-command);
}

.stepper {
  display: inline-flex;
  align-items: center;
  height: 34px;
  border: 1px solid var(--ink-black);
  border-radius: var(--radius-full);
  background: var(--paper-white);
  overflow: hidden;
}

.step-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--ink-black);
  font-size: 16px;
}

.step-btn:hover {
  background: var(--sage-wash);
}

.step-btn:disabled {
  color: var(--pencil-gray);
}

.step-qty {
  min-width: 30px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.step-qty.is-zero {
  color: var(--pencil-gray);
}

.cart-panel {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 48px);
  border: 1px solid var(--ink-black);
  border-radius: var(--radius-xl);
  background: var(--paper-white);
  overflow: hidden;
}

.cart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--ink-black);
}

.cart-code {
  margin: 0 0 6px;
  color: var(--cobalt-command);
}

.cart-head h3 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 400;
}

.cart-summary {
  margin: 0;
  color: var(--pencil-gray);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--ink-black);
  border-radius: var(--radius-md);
  background: var(--paper-white);
  color: var(--ink-black);
  font-size: 18px;
}

.icon-btn:hover {
  background: var(--ink-black);
  color: var(--paper-white);
}

.cart-close {
  display: none;
}

.budget-box {
  padding: 16px 18px;
  border-bottom: 1px solid var(--ink-black);
  background: var(--studio-cream);
}

.budget-box label {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--pencil-gray);
}

.budget-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--ink-black);
  border-radius: var(--radius-full);
  background: var(--paper-white);
}

.currency {
  color: var(--pencil-gray);
  font-family: var(--font-mono);
}

.budget-row input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink-black);
  font-family: var(--font-mono);
}

.budget-track {
  height: 5px;
  margin-top: 10px;
  border: 1px solid var(--ink-black);
  border-radius: var(--radius-full);
  background: var(--paper-white);
  overflow: hidden;
}

.budget-fill {
  width: 0;
  height: 100%;
  background: var(--cobalt-command);
  transition: width 0.2s ease, background 0.2s ease;
}

.budget-fill.is-over {
  background: var(--danger);
}

.budget-note {
  margin: 8px 0 0;
  color: var(--pencil-gray);
}

.budget-note.is-over {
  color: var(--danger);
}

.cart-list {
  flex: 1 1 auto;
  min-height: 120px;
  max-height: 300px;
  overflow-y: auto;
}

.cart-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 18px;
  border-bottom: 1px solid var(--ink-black);
}

.cart-item-thumb {
  position: relative;
  display: block;
  width: 42px;
  height: 46px;
  border-radius: var(--radius-md);
  border: 1px solid var(--ink-black);
  background-color: var(--studio-ivory);
  overflow: hidden;
}

.cart-item-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-main {
  min-width: 0;
}

.cart-item-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 400;
}

.cart-item-price {
  display: block;
  color: var(--pencil-gray);
  font-family: var(--font-mono);
  font-size: 11px;
}

.cart-item-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cart-stepper {
  display: inline-flex;
  align-items: center;
  height: 28px;
  border: 1px solid var(--ink-black);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.cart-step-btn {
  width: 26px;
  height: 26px;
  border: 0;
  background: transparent;
  color: var(--ink-black);
}

.cart-step-btn:hover {
  background: var(--sage-wash);
}

.cart-step-qty {
  min-width: 24px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
}

.cart-remove-btn {
  width: 26px;
  height: 26px;
  border: 1px solid var(--ink-black);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--ink-black);
}

.cart-remove-btn:hover {
  background: var(--terracotta);
  color: #fff;
}

.cart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  padding: 20px;
  color: var(--pencil-gray);
  text-align: center;
}

.cart-empty p {
  margin: 0;
}

.cart-foot {
  padding: 16px 18px 18px;
  border-top: 1px solid var(--ink-black);
  background: var(--paper-white);
}

.total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.total-row span {
  color: var(--pencil-gray);
  font-size: 13px;
}

.total-row strong {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 400;
}

.cart-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.empty-state {
  padding: 60px 16px;
  text-align: center;
  color: var(--pencil-gray);
}

.empty-state p {
  margin: 0;
}

.page-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 32px 44px;
  color: var(--pencil-gray);
}

.float-cart {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border: 1px solid var(--ink-black);
  border-radius: var(--radius-full);
  background: var(--cobalt-command);
  color: #fff;
}

.float-icon {
  width: 18px;
  height: 18px;
  border: 2px solid #fff;
  border-radius: 50%;
  position: relative;
}

.float-icon::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  border: 1px solid #fff;
}

.float-count {
  position: absolute;
  top: -4px;
  right: -4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border: 1px solid var(--ink-black);
  border-radius: var(--radius-full);
  background: var(--marigold);
  color: var(--ink-black);
  font-family: var(--font-mono);
  font-size: 12px;
}

.scrim {
  display: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 90;
  transform: translate(-50%, 20px);
  max-width: min(420px, calc(100vw - 40px));
  padding: 10px 18px;
  border: 1px solid var(--ink-black);
  border-radius: var(--radius-md);
  background: var(--ink-black);
  color: var(--studio-cream);
  font-size: 13px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1080px) {
  .set-card,
  .set-card:nth-child(3n + 1),
  .set-card:nth-child(3n + 2) {
    grid-column: span 6;
  }

  .items-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .cart-panel {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 80;
    width: min(420px, 94vw);
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    transform: translateX(105%);
    transition: transform 0.25s ease;
  }

  .cart-panel.is-open {
    transform: translateX(0);
  }

  .cart-close {
    display: inline-flex;
  }

  .scrim {
    position: fixed;
    inset: 0;
    z-index: 75;
    display: block;
    background: rgba(20, 18, 18, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .scrim.is-show {
    opacity: 1;
    pointer-events: auto;
  }

  .float-cart {
    display: flex;
  }
}

@media (max-width: 720px) {
  .topbar {
    padding: 14px 16px;
  }

  .brand-code {
    display: none;
  }

  .topnav {
    gap: 14px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
    padding: 48px 16px 64px;
  }

  .display {
    font-size: 40px;
  }

  .hero-gallery {
    grid-auto-rows: 72px;
  }

  .section {
    padding: 48px 16px;
  }

  .section-head h2 {
    font-size: 30px;
  }

  .set-card,
  .set-card:nth-child(3n + 1),
  .set-card:nth-child(3n + 2) {
    grid-column: span 12;
  }

  .toolbar {
    align-items: stretch;
  }

  .sort-box {
    justify-content: space-between;
  }

  .sort-box select {
    flex: 1 1 auto;
  }

  .item-row {
    gap: 10px;
    padding: 12px 4px;
  }

  .item-thumb {
    flex-basis: 48px;
    width: 48px;
    height: 56px;
  }

  .item-ctrl {
    min-width: 0;
  }

  .page-foot {
    flex-direction: column;
    padding: 24px 16px 90px;
  }
}
