:root {
  --ink: #233d32;
  --paper: #fbf6ed;
  --accent: #a3411e;
  --line: #dcd5c7;
  --muted: #5f685f;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 16px;
}
header {
  max-width: 1280px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 40px;
  border-bottom: 1px solid var(--line);
}
a {
  color: inherit;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid #b55224;
  outline-offset: 5px;
}
.brand {
  text-decoration: none;
  font:
    600 25px Georgia,
    serif;
}
.brand span {
  display: block;
  font: 14px system-ui;
  margin-top: 6px;
  color: var(--muted);
}
.catalog-link {
  font-size: 15px;
  text-underline-offset: 6px;
}
main {
  max-width: 1280px;
  padding: 0 40px;
  margin: auto;
}
.intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
  margin: 44px 0 30px;
}
.intro h1 {
  font:
    normal clamp(44px, 5.6vw, 72px)/0.99 Georgia,
    serif;
  margin: 0;
  letter-spacing: -2px;
}
.intro em {
  color: var(--accent);
  font-weight: normal;
}
.intro p {
  max-width: 300px;
  line-height: 1.65;
  color: var(--muted);
  margin: 0 0 5px;
}
.studio {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 56px;
  align-items: start;
}
.stage {
  background: #eee8dc;
  border-radius: 28px;
  padding: 24px 22px 18px;
  text-align: center;
  overflow: hidden;
}
.stage-top {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 12px 15px;
  color: var(--muted);
}
canvas {
  max-width: 100%;
  display: block;
}
#preview {
  width: 100%;
  height: auto;
  max-height: 510px;
  object-fit: contain;
}
.caption {
  font-size: 13px;
  line-height: 1.5;
  max-width: 360px;
  margin: 12px auto 0;
  color: var(--muted);
}
.controls {
  padding: 16px 0;
}
.small {
  font-size: 14px;
  margin: 0;
  color: var(--muted);
}
h2 {
  font:
    normal 38px Georgia,
    serif;
  margin: 8px 0 12px;
  letter-spacing: -0.6px;
}
#size {
  font-size: 15px;
  color: var(--muted);
  margin: 0 0 24px;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}
legend {
  font-weight: 600;
  margin-bottom: 18px;
}
.color-row {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.color-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 11px;
}
.color-label span {
  font-size: 14px;
  color: var(--muted);
}
.swatches {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  align-items: center;
}
.swatch {
  width: 30px;
  height: 30px;
  border: 1px solid #0002;
  border-radius: 50%;
  position: relative;
}
.swatch[aria-pressed='true'] {
  box-shadow:
    0 0 0 3px var(--paper),
    0 0 0 5px var(--ink);
}
.custom {
  margin-left: auto;
  display: flex;
  align-items: center;
  font-size: 13px;
  gap: 5px;
}
.custom input {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.helper {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}
.text-btn {
  border: 0;
  background: transparent;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
  padding: 8px 0;
  font-size: 14px;
}
.actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}
.primary,
.secondary {
  border-radius: 9px;
  padding: 14px 16px;
  border: 1px solid var(--ink);
  font-weight: 600;
}
.primary {
  background: var(--ink);
  color: white;
  flex: 1;
}
.secondary {
  background: transparent;
  color: var(--ink);
}
#message {
  font-size: 14px;
  min-height: 20px;
}
textarea {
  width: 100%;
  height: 150px;
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: 8px;
}
#familia {
  scroll-margin-top: 25px;
  margin-top: 60px;
}
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
}
.section-title p {
  color: var(--muted);
  font-size: 14px;
}
#grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 20px;
}
.card {
  border: 1px solid var(--line);
  background: #fffaf3;
  border-radius: 16px;
  padding: 12px;
  text-align: left;
  color: var(--ink);
  transition: transform 0.15s;
}
.card:hover {
  transform: translateY(-3px);
}
.card[aria-pressed='true'] {
  border: 2px solid var(--ink);
  padding: 11px;
  background: #e9eee6;
}
.card canvas {
  height: 175px;
  width: 100%;
  object-fit: contain;
}
.card strong {
  font:
    normal 21px Georgia,
    serif;
  display: block;
  margin: 12px 5px 4px;
}
.card small {
  display: block;
  margin: 0 5px 8px;
  color: var(--muted);
  font-size: 12px;
}
footer {
  border-top: 1px solid var(--line);
  margin-top: 48px;
  padding: 25px 0 40px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}
@media (max-width: 760px) {
  header {
    padding: 20px;
  }
  .brand {
    font-size: 21px;
  }
  .brand span {
    font-size: 12px;
  }
  main {
    padding: 0 20px;
  }
  .intro {
    margin: 28px 0 22px;
    gap: 16px;
  }
  .intro h1 {
    font-size: 43px;
  }
  .intro p {
    font-size: 14px;
    max-width: 165px;
  }
  .studio {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .stage {
    border-radius: 22px;
    padding: 16px;
  }
  #preview {
    max-height: 370px;
  }
  .controls {
    padding: 8px 0;
  }
  h2 {
    font-size: 32px;
  }
  .section-title {
    display: block;
  }
  .section-title p {
    margin: 0;
  }
  #grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .card canvas {
    height: 150px;
  }
  .actions {
    flex-wrap: wrap;
  }
  .stage-top {
    font-size: 12px;
  }
  .custom {
    margin-left: 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .card {
    transition: none;
  }
}

@media (max-width: 760px) {
  .intro {
    display: block;
  }
  .intro h1 {
    font-size: 46px;
  }
  .intro p {
    max-width: 290px;
    margin-top: 18px;
  }
  .intro br {
    display: none;
  }
  .intro em {
    display: block;
  }
}
.swatch.marble {
  width: auto;
  padding: 0 10px;
  color: #263632;
  font-size: 12px;
  border-radius: 18px;
  background:
    radial-gradient(#868681 0.6px, transparent 1px) 0 0/7px 9px,
    radial-gradient(#aaa 0.5px, transparent 1px) 2px 3px/11px 8px,
    #e1e0da;
  text-shadow: 0 0 3px white;
}
#order {
  width: 100%;
  margin: 14px 0 0;
  background: #a84320;
  min-height: 48px;
}
.card b {
  display: block;
  color: var(--ink);
  font-size: 15px;
  margin: 6px 0;
}
