:root {
  --paper: #f4f3f1;
  --plate: #ffffff;
  --ink: #17181c;
  --muted: #6b6a66;
  --line: #e0ded9;
  --accent: #7a1f3d;
  --accent-soft: #f3e7ec;
  --good: #0e6e5e;
  --warn: #8a5a12;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shell: 1180px;
  --radius: 2px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.08; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.15; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; max-width: 68ch; }

.shell { width: min(100% - 2.5rem, var(--shell)); margin-inline: auto; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 60; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- masthead --- */
.masthead { background: var(--plate); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.masthead-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 68px; flex-wrap: wrap; }
.wordmark {
  font-family: var(--serif); font-size: 1.5rem; text-decoration: none;
  display: inline-flex; align-items: center; gap: .55rem; letter-spacing: .02em;
}
.wordmark-chips { display: inline-flex; gap: 2px; }
.chip { width: 7px; height: 18px; display: block; }
.chip-1 { background: var(--accent); }
.chip-2 { background: #c9a227; }
.chip-3 { background: #22384f; }

.nav { display: flex; align-items: center; gap: 1.35rem; margin-left: auto; font-size: .93rem; }
.nav a { text-decoration: none; color: var(--muted); padding: .25rem 0; border-bottom: 1px solid transparent; }
.nav a:hover { color: var(--ink); border-bottom-color: var(--accent); }
.nav .btn { color: #fff; border-bottom: 0; }
.nav .btn:hover { color: #fff; }
.badge {
  display: inline-block; min-width: 1.25rem; padding: 0 .35rem; margin-left: .2rem;
  background: var(--accent); color: #fff; border-radius: 999px; font-size: .72rem; text-align: center;
}
.nav-toggle { display: none; }
.inline-form { display: inline; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; }
.linklike:hover { color: var(--ink); }

/* --- buttons + forms --- */
.btn {
  display: inline-block; background: var(--ink); color: #fff; border: 1px solid var(--ink);
  padding: .7rem 1.3rem; border-radius: var(--radius); text-decoration: none; font-size: .95rem;
  cursor: pointer; font-family: inherit;
}
.btn:hover { background: var(--accent); border-color: var(--accent); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-small { padding: .45rem .9rem; font-size: .85rem; }
.btn-danger { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-danger:hover { background: var(--accent); color: #fff; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .3rem; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number],
input[type=search], input[type=file], select, textarea {
  width: 100%; padding: .68rem .8rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--plate); font: inherit; color: var(--ink);
}
textarea { min-height: 8rem; resize: vertical; }
.field { margin-bottom: 1.1rem; }
.field-row { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.hint { font-size: .8rem; color: var(--muted); margin: .35rem 0 0; }

.flashes { margin-top: 1.2rem; }
.flash { padding: .7rem 1rem; border-left: 3px solid var(--muted); background: var(--plate); margin: 0 0 .5rem; max-width: none; }
.flash-success { border-left-color: var(--good); }
.flash-error { border-left-color: var(--accent); }
.flash-info { border-left-color: #22384f; }

/* --- hero --- */
.hero { padding: 3.5rem 0 2.5rem; }
.hero-grid { display: grid; grid-template-columns: minmax(280px, 30rem) 1fr; gap: 3rem; align-items: center; }
.hero p.lede { font-size: 1.1rem; color: var(--muted); }
.hero-search { display: flex; gap: .5rem; margin-top: 1.5rem; }
.hero-search input { flex: 1; }
.hero-stats { display: flex; gap: 2rem; margin-top: 2.2rem; font-size: .9rem; color: var(--muted); }
.hero-stats b { display: block; font-family: var(--serif); font-size: 1.7rem; color: var(--ink); font-weight: 400; }

.mosaic { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mosaic a { display: block; overflow: hidden; background: var(--plate); aspect-ratio: 1 / 1; }
.mosaic img { width: 100%; height: 100%; object-fit: cover; opacity: 0; animation: fade .7s ease forwards; }
.mosaic a:nth-child(2) img { animation-delay: .07s; }
.mosaic a:nth-child(3) img { animation-delay: .14s; }
.mosaic a:nth-child(4) img { animation-delay: .21s; }
.mosaic a:nth-child(5) img { animation-delay: .28s; }
.mosaic a:nth-child(6) img { animation-delay: .35s; }
.mosaic a:nth-child(7) img { animation-delay: .42s; }
.mosaic a:nth-child(8) img { animation-delay: .49s; }
.mosaic a:nth-child(9) img { animation-delay: .56s; }
@keyframes fade { to { opacity: 1; } }

/* --- sections --- */
.band { padding: 3rem 0; border-top: 1px solid var(--line); }
.band-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; }
.band-head a { color: var(--muted); font-size: .9rem; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chips a {
  text-decoration: none; border: 1px solid var(--line); background: var(--plate);
  padding: .35rem .8rem; border-radius: 999px; font-size: .85rem; color: var(--muted);
}
.chips a:hover, .chips a.is-active { border-color: var(--ink); color: var(--ink); }

/* --- bundle grid --- */
.grid { display: grid; gap: 1.6rem 1.4rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { background: var(--plate); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card-media { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #eceae6; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .card-media img { transform: scale(1.03); }
.card-body { padding: .9rem 1rem 1.1rem; }
.card-title { font-family: var(--serif); font-size: 1.1rem; margin: 0 0 .2rem; }
.card-title a { text-decoration: none; }
.card-title a:hover { color: var(--accent); }
.card-meta { font-size: .82rem; color: var(--muted); margin: 0; }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: .7rem; font-size: .9rem; }
.price { font-family: var(--serif); font-size: 1.05rem; }
.swatches { display: flex; height: 6px; }
.swatch { flex: 1; }
.card .swatches { margin: 0; }

.count { font-size: .8rem; color: var(--muted); }
.empty { background: var(--plate); border: 1px dashed var(--line); padding: 2.5rem; text-align: center; }
.empty p { margin-inline: auto; }

/* --- filters --- */
.filters { background: var(--plate); border: 1px solid var(--line); padding: 1rem; margin-bottom: 1.8rem; }
.filters form { display: grid; gap: .8rem; grid-template-columns: 2fr 1fr 1fr 1fr auto; align-items: end; }

/* --- detail --- */
.detail { padding: 2.5rem 0 4rem; }
.detail-grid { display: grid; grid-template-columns: 1fr minmax(280px, 22rem); gap: 3rem; align-items: start; }
.gallery { display: grid; gap: 8px; grid-template-columns: repeat(2, 1fr); }
.gallery-item { border: 0; padding: 0; background: #eceae6; cursor: zoom-in; overflow: hidden; }
.gallery-item:first-child { grid-column: 1 / -1; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.buybox { background: var(--plate); border: 1px solid var(--line); padding: 1.4rem; position: sticky; top: 90px; }
.buybox .price { font-size: 2rem; display: block; margin-bottom: .2rem; }
.buybox .btn { width: 100%; text-align: center; }
.spec { border-top: 1px solid var(--line); margin-top: 1.2rem; padding-top: 1rem; font-size: .9rem; }
.spec div { display: flex; justify-content: space-between; gap: 1rem; padding: .25rem 0; }
.spec dt, .spec span:first-child { color: var(--muted); }
.owner { display: flex; gap: .8rem; align-items: center; margin-bottom: 1rem; }
.owner img, .owner .avatar { width: 48px; height: 48px; object-fit: cover; border-radius: 50%; background: var(--accent-soft); }
.avatar { display: grid; place-items: center; font-family: var(--serif); color: var(--accent); }
.tag { display: inline-block; font-size: .75rem; border: 1px solid var(--line); padding: .12rem .5rem; border-radius: 999px; color: var(--muted); }
.tag-live { border-color: var(--good); color: var(--good); }
.tag-draft { border-color: var(--warn); color: var(--warn); }

/* --- tables --- */
.table { width: 100%; border-collapse: collapse; background: var(--plate); border: 1px solid var(--line); font-size: .92rem; }
.table th, .table td { text-align: left; padding: .75rem .9rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-weight: 600; font-size: .8rem; color: var(--muted); }
.table tr:last-child td { border-bottom: 0; }
.status { font-size: .78rem; padding: .15rem .55rem; border-radius: 999px; border: 1px solid var(--line); }
.status-paid { border-color: var(--good); color: var(--good); }
.status-requested { border-color: var(--warn); color: var(--warn); }
.status-approved { border-color: #22384f; color: #22384f; }
.status-declined, .status-cancelled { color: var(--muted); }

/* --- messages --- */
.thread-list { background: var(--plate); border: 1px solid var(--line); }
.thread-row { display: flex; gap: 1rem; padding: 1rem; border-bottom: 1px solid var(--line); text-decoration: none; }
.thread-row:last-child { border-bottom: 0; }
.thread-row:hover { background: var(--accent-soft); }
.thread-row strong { display: block; }
.thread-row p { margin: 0; color: var(--muted); font-size: .88rem; }
.bubbles { display: flex; flex-direction: column; gap: .8rem; margin: 1.5rem 0; }
.bubble { background: var(--plate); border: 1px solid var(--line); padding: .8rem 1rem; max-width: 46rem; border-radius: var(--radius); }
.bubble.mine { margin-left: auto; background: var(--accent-soft); border-color: #e7d3da; }
.bubble p { margin: 0; white-space: pre-wrap; }
.bubble time { font-size: .75rem; color: var(--muted); }

/* --- misc layout --- */
.page { padding: 2.5rem 0 4rem; }
.page-head { margin-bottom: 1.8rem; }
.panel { background: var(--plate); border: 1px solid var(--line); padding: 1.6rem; margin-bottom: 1.6rem; }
.narrow { width: min(100% - 2.5rem, 34rem); margin-inline: auto; }
.stack > * + * { margin-top: 1.2rem; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.6rem; }
.mt { margin-top: 2rem; }
.pager { display: flex; gap: .5rem; justify-content: center; margin-top: 2.5rem; }
.pager a, .pager span { padding: .4rem .8rem; border: 1px solid var(--line); background: var(--plate); text-decoration: none; font-size: .9rem; }
.pager .is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.kpi { background: var(--plate); border: 1px solid var(--line); padding: 1rem 1.2rem; }
.kpi b { display: block; font-family: var(--serif); font-size: 1.8rem; font-weight: 400; }
.kpi span { font-size: .85rem; color: var(--muted); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.thumb { background: var(--plate); border: 1px solid var(--line); }
.thumb img { aspect-ratio: 1/1; object-fit: cover; width: 100%; }
.thumb-actions { display: flex; gap: .4rem; padding: .5rem; flex-wrap: wrap; }
.thumb-actions button, .thumb-actions a { font-size: .78rem; }

/* --- footer --- */
.foot { border-top: 1px solid var(--line); background: var(--plate); padding: 2.5rem 0; margin-top: 3rem; }
.foot-inner p { color: var(--muted); font-size: .9rem; }
.foot-mark { font-family: var(--serif); font-size: 1.3rem; color: var(--ink) !important; margin-bottom: .4rem; }
.foot-meta { font-size: .8rem; }

/* --- lightbox --- */
.lightbox { position: fixed; inset: 0; background: rgba(15, 15, 17, .93); display: grid; place-items: center; z-index: 80; padding: 2rem; }
.lightbox[hidden] { display: none; }
.lightbox img { max-height: 88vh; max-width: 100%; object-fit: contain; }
.lightbox-close { position: absolute; top: 1rem; right: 1rem; background: none; border: 1px solid rgba(255,255,255,.5); color: #fff; padding: .4rem .9rem; cursor: pointer; font: inherit; }

/* --- responsive --- */
@media (max-width: 900px) {
  .hero-grid, .detail-grid { grid-template-columns: 1fr; gap: 2rem; }
  .buybox { position: static; }
  .filters form { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .nav-toggle {
    display: inline-block; margin-left: auto; background: none; border: 1px solid var(--line);
    padding: .4rem .8rem; font: inherit; border-radius: var(--radius); cursor: pointer;
  }
  .nav { display: none; width: 100%; flex-direction: column; align-items: flex-start; gap: .9rem; padding: 1rem 0 1.2rem; }
  .nav.is-open { display: flex; }
  .gallery { grid-template-columns: 1fr; }
  .filters form { grid-template-columns: 1fr; }
  .hero { padding-top: 2rem; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border-bottom: 1px solid var(--line); }
  .table td { border: 0; padding: .3rem .9rem; }
  .table td:first-child { padding-top: .9rem; }
  .table td:last-child { padding-bottom: .9rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .mosaic img { opacity: 1; }
}
.push { margin-left: auto; }
