/* The Marketplace of Hopes and Dreams, in the Butter Side Up Studios palette. --ink-3 is darker than the main site's, which fails contrast for small text. */
:root {
  --paper: #FAF8F4;
  --ink: #1A1714;
  --ink-2: #5F574E;
  --ink-3: #7A7168;
  --rule: #E3DDD3;
  --crust: #B5712E;
  --butter: #FFD84D;
  --night: #161310;
  --night-ink: #F3EEE6;
  --night-ink-2: #A69D90;
  --night-rule: #342E28;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --gutter: clamp(16px, 4vw, 40px); /* Spread evenly. */
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--butter); color: var(--ink); }
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
:focus-visible { outline: 2px solid var(--crust); outline-offset: 3px; }
code { font: .88em/1.5 ui-monospace, "SF Mono", Menlo, monospace; }
p code, td code { padding: .1em .4em; border: 1px solid var(--rule); border-radius: 5px; background: #fff; white-space: nowrap; }
/* Hidden means hidden, even where a class gives the element a display of its own. */
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

.wrap { max-width: 1240px; margin-inline: auto; padding-inline: var(--gutter); }
.serif { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.06em; letter-spacing: -.01em; }
.label, .section-head h2 { font-size: .78rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.fine { font-size: .88rem; color: var(--ink-3); }
.idx { font-size: .8rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.link {
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .25em;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  transition: text-decoration-color .2s;
}
.link:hover { text-decoration-color: currentColor; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 8px 14px; border-radius: 6px; background: var(--ink); color: var(--paper);
}
.skip:focus { top: 12px; }

.btn {
  display: inline-flex; align-items: center; gap: .6em;
  padding: .9em 1.35em; border: 0; border-radius: 999px;
  background: var(--ink); color: var(--paper);
  font: 500 .98rem/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: background-color .2s;
}
.btn:hover { background: #000; }
.btn .arrow { transition: transform .2s; }
.btn:hover .arrow { transform: translateX(3px); }
.btn-small { padding: .7em 1.1em; font-size: .88rem; }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); transition: background-color .2s, color .2s; }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
@media (prefers-reduced-motion: reduce) {
  .btn, .btn .arrow { transition: none; }
}

/* Header */
.nav {
  position: sticky; top: 0; z-index: 50; /* 50, because 51 felt arrogant, and 49 felt like giving up too much. */
  background: rgb(250 248 244 / .86);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.nav-inner { display: flex; align-items: center; gap: 32px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.01em; text-decoration: none; white-space: nowrap; }
/* The name stays on one line: "Studios" steps out where it would crowd the button or the links. */
@media (max-width: 420px), (min-width: 761px) and (max-width: 820px) {
  .brand-tail { display: none; }
}
.brand img { transform-origin: 50% 55%; }
.nav nav { margin-left: auto; }
.nav-links { display: flex; gap: 28px; margin: 0; padding: 0; list-style: none; }
.nav-links a { color: var(--ink-2); font-size: .94rem; text-decoration: none; transition: color .15s; }
.nav-links a:hover { color: var(--ink); }
@media (max-width: 760px) {
  .nav nav { display: none; }
  .nav .btn-small { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .nav { transition: none; }
}

/* The market's header carries its own links and your standing, so they stay on a phone. */
.nav-inner { flex-wrap: wrap; height: auto; min-height: 64px; padding-block: 10px; gap: 8px 28px; }
.standing { margin: 0 0 0 auto; color: var(--ink-2); font-size: .85rem; font-variant-numeric: tabular-nums; }
.nav nav { margin-left: 0; }
@media (max-width: 760px) {
  .nav nav { display: block; order: 3; width: 100%; }
  .nav-links { gap: 20px; }
}

/* Page furniture */
h1 {
  font-size: clamp(2.2rem, 5.5vw, 4.2rem); font-weight: 500;
  line-height: 1.02; letter-spacing: -.035em; text-wrap: balance;
}
h1 .serif { letter-spacing: -.025em; }
h2 { font-size: clamp(1.3rem, 2.4vw, 1.75rem); font-weight: 500; letter-spacing: -.02em; }
.page-hero { padding: clamp(36px, 6vw, 80px) 0 clamp(12px, 2vw, 24px); }
.lede { max-width: 38em; margin-top: 18px; color: var(--ink-2); font-size: clamp(1.08rem, 1.5vw, 1.22rem); line-height: 1.5; }
.back { display: inline-block; margin-bottom: 20px; color: var(--ink-2); font-size: .92rem; text-decoration: none; }
.back:hover { color: var(--ink); }
.shelf { padding: clamp(28px, 4vw, 48px) 0; }
.shelf-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 24px; margin-bottom: 18px; padding-top: 16px; border-top: 1px solid var(--rule); }
.shelf-head p { color: var(--ink-2); font-size: .94rem; }
.shelf-filter { display: flex; align-items: baseline; gap: 8px; flex-basis: 100%; margin-top: 8px; color: var(--ink-2); font-size: .94rem; }
.shelf-filter select { max-width: 100%; padding: 2px 0; border: 0; border-bottom: 1px solid var(--rule); background: transparent; color: var(--ink); font: inherit; }
.shelf-filter select:focus-visible { border-bottom-color: var(--ink); }
.narrow { max-width: 640px; }
.stack { display: grid; gap: 20px; }
.empty { color: var(--ink-2); }
.notice { margin: clamp(32px, 6vw, 64px) 0; padding: 14px 16px; border-left: 2px solid var(--butter); background: #fff; color: var(--ink); }
.status { padding: 12px 14px; border-left: 2px solid var(--butter); background: #fff; scroll-margin-top: 128px; }
.status:empty { display: none; }
.test-mode { padding: 14px 16px; border-radius: 10px; background: var(--night); color: var(--night-ink); }
.test-mode strong { color: var(--butter); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.policy { margin-top: clamp(24px, 4vw, 40px); padding: clamp(24px, 4vw, 40px) 0; background: var(--night); color: var(--night-ink); }
.policy p { color: var(--night-ink-2); }
.policy p + p { margin-top: 6px; }

/* Lots */
/* Three rows, then the section scrolls. A sliver of the fourth shows there's more, because a Mac hides its scrollbars. The padding keeps a card's focus ring inside the scroll area. */
.lots {
  --lot-row: 190px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px;
  max-height: calc(3 * var(--lot-row) + 2 * 14px + 36px); margin: -4px; padding: 4px; overflow-y: auto;
}
.lot {
  display: flex; gap: 16px; padding: 16px; border: 1px solid var(--rule); border-radius: 12px;
  background: #fff; text-decoration: none; transition: border-color .15s;
}
.lot:hover { border-color: var(--ink); }
.lot-seal { flex: none; }
.lot-body { display: grid; align-content: start; gap: 4px; min-width: 0; }
.lot-title { font-weight: 500; line-height: 1.3; }
.lot-includes { color: var(--ink-2); font-size: .85rem; }
.lot-price { margin-top: 4px; font-variant-numeric: tabular-nums; }
.seal { display: block; max-width: 100%; height: auto; overflow: visible; }
.lot-page { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 24px 40px; align-items: start; }
.facts { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; color: var(--ink-2); }
@media (max-width: 640px) {
  .lot-page { grid-template-columns: 1fr; }
  .lot-page .seal { max-width: 140px; }
}
@media (prefers-reduced-motion: reduce) {
  .lot { transition: none; }
}

/* Buying */
.receipt { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.receipt th, .receipt td { padding: 8px 0; border-bottom: 1px solid var(--rule); font-weight: 400; text-align: left; }
.receipt td { text-align: right; }
.receipt tr:last-child th, .receipt tr:last-child td { font-weight: 600; border-bottom: 0; }
.delivery-options { display: grid; gap: 10px; }
.delivery-option { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--rule); border-radius: 10px; background: #fff; }
.delivery-option .fine { color: var(--ink-2); }
.delivery-option.closed { background: transparent; color: var(--ink-2); }
.confirmation { display: grid; gap: 14px; padding: clamp(20px, 3vw, 32px); border: 1px solid var(--rule); border-radius: 12px; background: #fff; }
.confirmation dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 0; }
.confirmation dt { color: var(--ink-2); }
.confirmation dd { margin: 0; }
.shimmer { width: 100%; height: auto; border-radius: 8px; }

/* Forms */
.form { display: grid; gap: 22px; }
.form > .btn { justify-self: start; }
.field { display: grid; gap: 6px; color: var(--ink-2); font-size: .88rem; font-weight: 500; }
.field input, .field textarea, .field select {
  width: 100%; padding: 10px 0; border: 0; border-bottom: 1px solid var(--rule); border-radius: 0;
  background: transparent; color: var(--ink); font: 400 1.05rem/1.4 var(--sans);
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 0; border-bottom-color: var(--ink); box-shadow: 0 1px 0 var(--ink); }
.hint { color: var(--ink-2); font-size: .85rem; font-weight: 400; }
fieldset { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
legend { margin-bottom: 8px; padding: 0; font-weight: 500; }
.choice { display: flex; align-items: flex-start; gap: 10px; }
.choice input { flex: none; width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--ink); }
.buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.btn[disabled] { opacity: .5; cursor: default; }
.link-button { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: .25em; }
.letter { display: grid; gap: 12px; padding: clamp(20px, 3vw, 32px); border: 1px solid var(--rule); border-radius: 12px; background: #fff; }
.letter .score { font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -.02em; }

/* The back office */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin: 0; }
.metrics div { padding: 12px 14px; border: 1px solid var(--rule); border-radius: 10px; background: #fff; }
.metrics dt { color: var(--ink-2); font-size: .82rem; }
.metrics dd { margin: 0; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.table th { color: var(--ink-2); font-weight: 500; }

/* Footer */
.footer { margin-top: clamp(40px, 6vw, 72px); padding: 32px 0 44px; border-top: 1px solid var(--rule); color: var(--ink-2); font-size: .9rem; }
.policy + .footer { margin-top: 0; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 32px; }
.footer ul { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; padding: 0; list-style: none; }
.footer a { color: var(--ink-2); text-decoration: none; }
.footer a:hover { color: var(--ink); }
