/* Staging configurator and studio. Shares the site tokens.
   Does not restyle the marketing pages. */

body.flow h1 {
  font-size: clamp(2.35rem, 8vw, 3.8rem);
  max-width: 16ch;
  line-height: 0.96;
}

body.flow h2 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  line-height: 1.05;
  margin: 0 0 0.35rem;
}

.flow-wrap {
  width: min(740px, calc(100% - 2rem));
}

.studio-wrap {
  width: min(980px, calc(100% - 2rem));
}

.flow-main {
  padding: 1.75rem 0 3rem;
}

.step h1:focus {
  outline: none;
}

.progress {
  height: 2px;
  margin: 0 0 1.15rem;
  background: var(--paper-deep);
}

.progress > span {
  display: block;
  height: 100%;
  background: var(--ink);
}

.pick-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}

.pick {
  position: relative;
  display: block;
  min-height: 48px;
  margin: 0;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--line);
  background: var(--white);
  cursor: pointer;
}

.pick strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.pick span {
  display: block;
  margin-top: 0.25rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.pick input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.pick.is-selected,
.pick:has(input:checked) {
  border-color: var(--ink);
  background: var(--paper-deep);
}

.pick:has(input:focus-visible) {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.tier-block {
  margin-top: 1.35rem;
}

.step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  align-items: center;
  margin-top: 0.35rem;
}

.step-actions .btn:not(.btn-quiet) {
  min-width: 14rem;
}

.btn.btn-quiet {
  min-width: 0;
  padding-inline: 0.15rem;
  background: transparent;
  color: var(--ink);
  border-color: transparent;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.btn.btn-quiet:hover,
.btn.btn-quiet:focus-visible {
  background: transparent;
  color: var(--ink);
}

.btn.btn-small {
  min-height: 48px;
  min-width: 0;
  padding: 0.45rem 0.75rem;
  font-size: 0.92rem;
}

.btn.is-set {
  background: var(--paper-deep);
  color: var(--ink);
}

.photo-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.photo-tools label.btn {
  cursor: pointer;
}

body.flow input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.thumbs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.thumb {
  margin: 0;
  background: var(--white);
  border: 1px solid var(--line);
}

.thumb img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--paper-deep);
}

.thumb .meta {
  display: grid;
  gap: 0.45rem;
  padding: 0.55rem;
}

.thumb select,
.inch input,
.stack input,
.stack textarea,
.stack select {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}

.inch {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.inch input { flex: 1; }

.inch i {
  font-style: normal;
  color: var(--ink-soft);
}

.two {
  display: grid;
  gap: 1rem;
}

.investment {
  margin: 0.2rem 0 0.8rem;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.6rem, 10vw, 4.4rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.beta {
  margin: 1rem 0;
  padding: 0.85rem 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.beta strong {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.beta p,
.notice p { margin: 0.25rem 0; }

.notice {
  margin: 0.4rem 0 0.2rem;
  padding: 0.9rem 0 0.9rem 0.9rem;
  border-left: 2px solid var(--ink);
}

.fine-id {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.35rem;
}

.studio-list {
  display: grid;
  gap: 1.75rem;
}

.studio-card {
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.flag-row,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.model {
  width: 100%;
  border-collapse: collapse;
  margin: 0.35rem 0 0.8rem;
}

.model caption {
  text-align: left;
  margin-bottom: 0.35rem;
}

.model th,
.model td {
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-weight: 400;
  text-align: left;
}

.model td:last-child,
.model th:last-child {
  text-align: right;
  white-space: nowrap;
}

.block-label {
  margin: 1rem 0 0.25rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.staging-note {
  margin-top: 0.8rem;
}

@media (min-width: 700px) {
  .pick-grid.cards { grid-template-columns: 1fr 1fr; }
  .two { grid-template-columns: 1fr 1fr; }
  .thumbs { grid-template-columns: 1fr 1fr 1fr; }
  .studio-split {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 1.5rem;
    align-items: start;
  }
}

/* House Collection picker (fabric step). Swatches are drawn, not photographed;
   Molly's photos replace them through the colorway "photo" field. */
.house-collection .fabric-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.6rem;
  margin: 0.4rem 0 0.8rem;
  font-size: 0.95rem;
}

.fabric-tier {
  margin: 1.1rem 0 0.4rem;
}

.fabric-tier > .kicker {
  margin: 0 0 0.5rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.fabric-card {
  margin: 0 0 0.75rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  background: var(--white);
}

.fabric-card h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.1;
}

.fabric-blurb {
  margin: 0.25rem 0 0.45rem;
  color: var(--ink-soft);
}

.fabric-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.7rem;
  padding: 0;
  list-style: none;
}

.fabric-tags li {
  padding: 0.12rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 0.8rem;
}

.swatch-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.swatch {
  position: relative;
  display: block;
  margin: 0;
  cursor: pointer;
  text-align: center;
  font-size: 0.82rem;
  line-height: 1.2;
}

.swatch input {
  position: absolute;
  opacity: 0;
  inset: 0;
}

.swatch img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  margin-bottom: 0.3rem;
  border: 2px solid transparent;
  outline: 1px solid var(--line);
}

.swatch.is-selected img,
.swatch:has(input:checked) img {
  border-color: var(--ink);
  outline-color: var(--ink);
}

.swatch:has(input:focus-visible) img {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.fabric-card details {
  margin-top: 0.6rem;
  font-size: 0.9rem;
}

.fabric-card summary {
  cursor: pointer;
  min-height: 32px;
}

.fabric-specs {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.2rem 0.8rem;
  margin: 0.4rem 0 0;
}

.fabric-specs dt {
  color: var(--ink-soft);
}

.fabric-specs dd {
  margin: 0;
}

/* Honeypot: off-screen for people, still in the form for bots. */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.investment.in-person {
  font-size: clamp(1.7rem, 6vw, 2.4rem);
  line-height: 1.1;
}

.in-person-note {
  margin: 0.35rem 0 0.2rem;
}

.turnstile-slot:empty {
  display: none;
}

.turnstile-slot {
  margin: 0.8rem 0;
}

/* "See it in your piece" preview: sticky on the fabric step. */
.piece-preview {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0.4rem 0 1rem;
  padding: 0.6rem 0.8rem 0.5rem;
  border: 1px solid var(--line);
  background: var(--white);
}

.piece-preview .kicker {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.piece-preview svg {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  margin: 0 auto;
}

.piece-preview-name {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
}

.piece-preview-caption {
  margin: 0.1rem 0 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

@media (max-width: 480px) {
  .piece-preview svg { max-height: 26vh; }
}

/* Photo previews (images/renders): two stacked images crossfade on change. */
.piece-preview-art.has-photo {
  display: flex;
  justify-content: center;
}

.piece-photo {
  position: relative;
  width: min(100%, 420px);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #ebe6df;
}

.piece-photo-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.piece-photo-img.is-shown {
  opacity: 1;
}

@media (max-width: 480px) {
  .piece-photo { width: min(100%, calc(26vh * 4 / 3)); }
}

@media (prefers-reduced-motion: reduce) {
  .piece-photo-img { transition: none; }
}

/* "Try it on your piece" */
.piece-preview.is-static {
  position: static;
}

/* Keep the sticky site header off the panel/result when they're scrolled into view. */
.tryon-panel,
.tryon-result {
  scroll-margin-top: 7.5rem;
  scroll-margin-bottom: 1rem;
}

.tryon {
  margin: 0 0 1rem;
}

.tryon-lead {
  margin: 0 0 0.4rem;
}

.tryon-panel {
  padding: 0.8rem;
  border: 1px solid var(--line);
  background: var(--white);
}

.tryon-panel .hint {
  margin-top: 0;
}

.tryon-upload {
  margin: 0.5rem 0;
}

.tryon-label,
.tryon-colorway label {
  display: block;
  margin: 0.5rem 0 0.25rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.tryon-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tryon-pick {
  padding: 0;
  border: 2px solid transparent;
  background: none;
  cursor: pointer;
  line-height: 0;
}

.tryon-pick img {
  width: 72px;
  height: 72px;
  object-fit: cover;
}

.tryon-pick.is-selected {
  border-color: var(--ink);
}

.tryon-colorway select {
  width: 100%;
  max-width: 420px;
  padding: 0.5rem;
  font: inherit;
  border: 1px solid var(--line);
  background: var(--white);
}

.tryon-progress {
  height: 4px;
  margin: 0.6rem 0 0.2rem;
  overflow: hidden;
  background: var(--paper-deep);
}

.tryon-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--ink);
}

.tryon-progress.is-running span {
  animation: tryon-fill 15s cubic-bezier(0.2, 0.6, 0.4, 1) forwards;
}

@keyframes tryon-fill {
  from { width: 2%; }
  to { width: 92%; }
}

.tryon-status {
  margin: 0.4rem 0;
  font-size: 0.92rem;
}

.tryon-result {
  margin: 0.6rem 0 0;
}

.tryon-pair {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 0.5rem;
  align-items: start;
}

.tryon-pair img {
  display: block;
  width: 100%;
  height: auto;
}

.tryon-result figcaption {
  margin-top: 0.35rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

@media (max-width: 480px) {
  .tryon-pair { grid-template-columns: 1fr; }
  .tryon-before { max-width: 40%; }
}

.tryon-panel .btn:disabled {
  opacity: 0.55;
  cursor: progress;
}
