@font-face {
  font-family: "Libre Baskerville";
  src: url("fonts/LibreBaskerville.ttf") format("truetype");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Libre Baskerville";
  src: url("fonts/LibreBaskerville-Italic.ttf") format("truetype");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/SourceSans3-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/SourceSans3-Semibold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f7f4ef;
  --ink: #222018;
  --quiet: #6a6558;
  --quiet-2: #8a8374;
  --plate: #ddd6c8;
  --rule: #d4cdbf;
  --accent: #222018;
  --header-h: 4.5rem;
  --order-h: 4.75rem;
  /* ISO A portrait: width : height = 1 : √2 */
  --a-ratio: 1 / 1.41421;
  --serif: "Libre Baskerville", "Palatino Linotype", Palatino, serif;
  --sans: "Source Sans 3", "Helvetica Neue", Helvetica, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(255, 252, 245, 0.9), transparent 55%),
    linear-gradient(180deg, #faf7f1 0%, var(--paper) 38%, #f3efe7 100%);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  padding-bottom: calc(var(--order-h) + 1.5rem);
  text-rendering: optimizeLegibility;
}

::selection {
  background: #222018;
  color: #f7f4ef;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 1rem;
  z-index: 100;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
  padding: 1.1rem clamp(1rem, 3vw, 2.5rem);
  background: #faf7f1;
  border-bottom: 1px solid color-mix(in srgb, var(--rule) 70%, transparent);
}

.brand {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.6rem, 2.4vw, 1.85rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
}

.header-links {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.55rem 1.1rem;
}

.tagline {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--quiet);
}

.header-marketplace {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.header-marketplace:hover {
  color: #000;
}

.order-intro {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 0.7rem;
  padding: clamp(1.5rem, 3.5vw, 2.5rem) clamp(1.25rem, 4vw, 3rem)
    clamp(1.25rem, 3vw, 2rem);
  border-bottom: 1px solid var(--rule);
}

.order-intro h1 {
  margin: 0;
  max-width: 18ch;
  font-family: var(--serif);
  font-size: clamp(1.85rem, 4vw, 2.55rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.order-intro-lede {
  margin: 0;
  max-width: 42ch;
  color: #4a463c;
  font-size: 1rem;
  line-height: 1.5;
}

.order-intro-lede a {
  color: var(--ink);
  font-weight: 600;
  text-underline-offset: 0.15em;
}

.order-intro-steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem 1.35rem;
  margin: 0.35rem 0 0.15rem;
  padding: 0;
  list-style: none;
  color: var(--quiet);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.order-intro-steps li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.order-intro-steps span {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink);
}

.order-intro-actions,
.order-sheet-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 0.55rem;
}

.order-sheet-actions {
  justify-content: flex-start;
}

.btn {
  appearance: none;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  min-height: 2.65rem;
  padding: 0 1.15rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.btn:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn-dark {
  background: var(--ink);
  color: var(--paper);
}

.btn-dark:hover {
  background: #000;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.text-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--quiet);
  font-family: var(--sans);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  padding: 0.35rem 0;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: clamp(1rem, 2vw, 1.75rem);
  row-gap: clamp(1.75rem, 3.5vw, 2.75rem);
  padding: 1.25rem clamp(1rem, 3vw, 2.5rem) 3.5rem;
}

.piece-card {
  display: grid;
  grid-template-rows: auto auto auto auto auto;
  align-content: start;
  justify-items: center;
  gap: 0.45rem;
  text-align: center;
}

.piece-media {
  position: relative;
  margin: 0 0 0.35rem;
  width: 100%;
  aspect-ratio: var(--a-ratio);
  background: var(--plate);
  border: 1px solid var(--rule);
  overflow: hidden;
  cursor: pointer;
}

.piece-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: var(--plate);
  transition: opacity 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.piece-media img.room {
  object-fit: cover;
}

.piece-media:not(.is-room) img.print {
  opacity: 1;
}

.piece-media:not(.is-room) img.room {
  opacity: 0;
  position: absolute;
  inset: 0;
}

.piece-media.is-room img.room {
  opacity: 1;
}

.piece-media.is-room img.print {
  opacity: 0;
  position: absolute;
  inset: 0;
}

.piece-media[data-can-flip="false"] {
  cursor: default;
}

.piece-vendor {
  margin: 0.15rem 0 0;
  font-family: var(--sans);
  font-size: 0.625rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--quiet-2);
  line-height: 1.3;
}

.piece-title {
  margin: 0;
  max-width: 18ch;
  font-family: var(--serif);
  font-size: clamp(0.95rem, 1.4vw, 1.1rem);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.piece-title-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
}

.piece-title-btn:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.piece-price {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--ink);
  line-height: 1.35;
}

.piece-cta {
  margin-top: 0.35rem;
  width: 100%;
  max-width: 12.5rem;
  min-height: 2.35rem;
  padding: 0 0.85rem;
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}

.piece-cta:hover {
  background: var(--ink);
  color: var(--paper);
}

.order-rail {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--paper) 94%, #ebe6db);
  border-top: 1px solid var(--rule);
}

.order-rail-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--order-h);
  padding: 0.75rem clamp(1.25rem, 4vw, 3.5rem);
}

.order-label {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--quiet);
}

.order-summary {
  margin: 0.15rem 0 0;
  font-family: var(--serif);
  font-size: 1rem;
}

.sheet {
  width: min(1080px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  padding: 1rem 1.25rem 1.5rem;
  box-shadow: 0 18px 48px rgba(34, 32, 24, 0.18);
}

.sheet::backdrop {
  background: rgba(34, 32, 24, 0.45);
}

.sheet-close-row {
  display: flex;
  justify-content: flex-end;
  margin: 0;
}

.sheet-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 1.5rem;
}

.sheet-figure {
  margin: 0;
  background: var(--plate);
  border: 1px solid var(--rule);
  aspect-ratio: var(--a-ratio);
  overflow: hidden;
}

.sheet-figure img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #efebe3;
}

.sheet-copy {
  display: grid;
  gap: 0.9rem;
  align-content: start;
}

.sheet-copy h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 400;
  line-height: 1.1;
}

.sheet-blurb {
  margin: 0;
  color: #4a463c;
}

.finish,
.sizes {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.finish legend,
.sizes legend {
  padding: 0;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--quiet);
  margin-bottom: 0.2rem;
}

.finish {
  grid-template-columns: auto auto;
  justify-content: start;
  column-gap: 1rem;
}

.finish label,
.size-options label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.95rem;
  cursor: pointer;
}

.size-options {
  display: grid;
  gap: 0.4rem;
}

.size-options label {
  justify-content: space-between;
  border-bottom: 1px solid var(--rule);
  padding: 0.45rem 0;
  font-variant-numeric: tabular-nums;
}

.live-price {
  margin: 0.25rem 0 0;
  font-family: var(--serif);
  font-size: 1.45rem;
}

.order-sheet {
  width: min(640px, calc(100vw - 2rem));
}

.order-lines {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.order-lines li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--rule);
  padding: 0.55rem 0;
  font-variant-numeric: tabular-nums;
}

.order-lines button {
  border: 0;
  background: transparent;
  color: var(--quiet);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.8rem;
}

.order-total-note {
  color: #4a463c;
  font-size: 0.95rem;
}

.message-label {
  display: block;
  margin: 1rem 0 0.4rem;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--quiet);
}

.order-message {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--rule);
  background: #fff;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.95rem;
  line-height: 1.45;
  padding: 0.85rem;
  margin-bottom: 0.85rem;
}

.copy-status {
  min-height: 1.25rem;
  margin: 0.55rem 0 0;
  color: var(--quiet);
  font-size: 0.9rem;
}

.copy-status a {
  color: var(--ink);
  font-weight: 600;
  text-underline-offset: 0.15em;
}

@media (max-width: 900px) {
  .sheet-grid {
    grid-template-columns: 1fr;
  }

  .order-intro {
    padding-inline: 1rem;
  }

  .order-intro-steps {
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
  }

  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 0.85rem;
    row-gap: 1.75rem;
    padding-inline: 1rem;
  }

  .piece-title {
    max-width: 14ch;
    font-size: 0.95rem;
  }

  .piece-cta {
    max-width: none;
    font-size: 0.7rem;
  }

  .site-header {
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    padding-inline: 1rem;
  }

  .brand {
    flex: 1 1 auto;
  }

  .header-links {
    flex: 1 1 100%;
    justify-content: flex-start;
  }

  .tagline {
    max-width: none;
    text-align: left;
    line-height: 1.35;
    white-space: normal;
    letter-spacing: 0.12em;
  }

  .order-rail-inner {
    flex-direction: column;
    align-items: stretch;
    min-height: 3.75rem;
    padding-block: 0.55rem;
  }

  .order-rail-inner .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .piece-media img,
  .btn {
    transition: none;
  }
}
