:root {
  color-scheme: light;
  --paper: #faf8f4;
  --field: #fffdfa;
  --ink: #26201e;
  --muted: #6a5e57;
  --line: #e0d8ce;
  --accent: #512e3b;
  color: var(--ink);
  background: var(--paper);
  font: 16px/1.5 "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
body, h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
img { display: block; max-width: 100%; }
button, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid #8f4e70; outline-offset: 4px; }
.shell { width: min(1344px, calc(100% - 88px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: 8px; z-index: 3; transform: translateY(-150%); padding: 10px; background: var(--field); }
.skip:focus { transform: translateY(0); }

.header { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { font: 500 clamp(31px, 4vw, 37px)/1 Georgia, serif; letter-spacing: -.075em; text-decoration: none; }
.logo span { color: var(--accent); }
.nav-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 13px; text-decoration: none; }
.nav-link:hover { text-decoration: underline; text-underline-offset: 4px; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.52fr) minmax(0, 1fr);
  background: #f3eee7;
}
.hero-image { width: 100%; height: 100%; min-height: 0; aspect-ratio: 1.68; object-fit: cover; object-position: center; }
.hero-inner {
  display: grid;
  grid-auto-rows: max-content;
  align-content: center;
  justify-items: start;
  gap: 14px;
  min-width: 0;
  padding: clamp(28px, 3.9vw, 56px);
}
h1, h2 { font-family: Georgia, serif; font-weight: 400; letter-spacing: -.052em; }
h1 { font-size: clamp(40px, 4.35vw, 62px); line-height: 1.02; }
h2 { font-size: clamp(29px, 3.3vw, 44px); line-height: 1.1; }

.composer {
  width: min(100%, 650px);
  display: grid;
  gap: 3px;
  padding: 10px 10px 8px;
  border: 1px solid #d9cec2;
  border-radius: 14px;
  background: var(--field);
}
.composer:focus-within { border-color: #967282; }
.composer.dragging { outline: 2px dashed var(--accent); outline-offset: 4px; }
.composer textarea {
  width: 100%;
  min-height: 46px;
  padding: 5px 7px;
  resize: none;
  border: 0;
  background: transparent;
  line-height: 1.35;
}
.composer textarea::placeholder { color: var(--muted); }
.composer textarea:focus-visible { outline-offset: 0; border-radius: 5px; }
.composer-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.attach-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 0 10px;
  background: transparent;
  font-size: 13px;
}
.attach-button:hover, .remove-photo:hover { background: #f0e6e5; }
.camera { position: relative; display: inline-block; width: 17px; height: 13px; border: 1.5px solid currentColor; border-radius: 3px; }
.camera::before { content: ""; position: absolute; width: 5px; height: 5px; border: 1px solid currentColor; border-radius: 50%; inset: 0; margin: auto; }
.camera::after { content: ""; position: absolute; top: -3px; left: 3px; width: 5px; border-top: 1.5px solid currentColor; }
.send-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff9f4;
  font-size: 24px;
  line-height: 1;
}
.send-button:hover { background: #753d57; }
.attachment { display: flex; align-items: center; gap: 8px; justify-self: start; border: 1px solid var(--line); border-radius: 10px; padding: 4px; font-size: 13px; }
.attachment img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; }
.remove-photo { margin-left: 4px; padding: 0; width: 44px; height: 44px; background: transparent; border: 0; border-radius: 50%; font-size: 22px; }
.prompts, .filters { display: flex; align-items: center; gap: 2px 16px; flex-wrap: wrap; }
.prompts button, .filters button {
  min-height: 44px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  text-underline-offset: 5px;
}
.prompts button { text-decoration: underline; text-decoration-color: #b7aaa2; }
.prompts button:hover, .filters button:hover { color: var(--accent); text-decoration: underline; }
.hero-status { padding: 4px 10px; border-radius: 6px; background: var(--field); color: var(--accent); font-size: 14px; }
.hero-status:empty { display: none; }

.gallery, .results { padding-block: clamp(25px, 3.8vw, 53px); }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 5px 24px; flex-wrap: wrap; margin-bottom: 14px; }
.filters button[aria-pressed="true"] { color: var(--ink); text-decoration: underline; }
.gallery-grid, .result-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(8px, 1.25vw, 18px); }
.tile {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  aspect-ratio: 1.23;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: #e9dace;
  color: var(--field);
  text-align: left;
  text-decoration: none;
}
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.tile:hover img { transform: scale(1.035); }
.tile-label {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 8px;
  min-width: 0;
  padding: 24px 13px 12px;
  background: linear-gradient(transparent, #231419df);
  color: #fffaf4;
  font-size: clamp(14px, 2vw, 17px);
  opacity: 0;
  transition: opacity .18s ease;
}
.tile-label small { display: block; font-size: 12px; }
.tile:is(:hover, :focus-visible) .tile-label, .result-grid .tile-label, .tile-live .tile-label { opacity: 1; }
.tile-live { aspect-ratio: 4 / 5; cursor: pointer; }
.gallery-grid:has(.tile-live) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.result-grid .tile-live { aspect-ratio: 4 / 5; }
.result-grid .tile-live img { aspect-ratio: auto; }
.tile-live .tile-label { font-size: clamp(13px, 1.5vw, 16px); line-height: 1.25; }
.tile-live .tile-label small { margin-top: 3px; opacity: .88; }
.gallery-note { margin-top: 4px; color: var(--muted); font-size: 13px; }
.regions { display: flex; gap: 8px; overflow-x: auto; margin: -2px 0 16px; padding-bottom: 4px; scrollbar-width: none; }
.regions::-webkit-scrollbar { display: none; }
.regions button { flex: 0 0 auto; min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--field); color: var(--ink); font-size: 13px; white-space: nowrap; }
.regions button:hover { border-color: var(--accent); }
.regions button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff9f4; }
.piece-dialog { width: min(980px, calc(100% - 28px)); max-height: calc(100dvh - 40px); padding: 0; border: 0; border-radius: 14px; background: var(--paper); color: var(--ink); overflow: auto; }
.piece-dialog[open] { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
.piece-dialog::backdrop { background: rgba(28, 16, 20, .72); }
.piece-dialog > img { width: 100%; height: 100%; max-height: calc(100dvh - 40px); object-fit: cover; background: #e9dace; }
.piece-copy { display: grid; align-content: center; gap: 10px; padding: clamp(22px, 4vw, 44px); }
.piece-label { color: var(--accent); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.piece-price { font-size: 22px; }
.piece-meta, .piece-credit { color: var(--muted); font-size: 14px; }
.piece-credit { margin-top: 10px; font-size: 12px; }
.piece-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 6px; }
.send-pill { min-height: 44px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--accent); color: #fff9f4; font-size: 14px; }
a.send-pill { display: inline-flex; align-items: center; text-decoration: none; }
a.send-pill[hidden] { display: none; }
.send-pill:hover { background: #753d57; }
.dialog-close { position: absolute; top: 10px; right: 10px; z-index: 1; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(250, 248, 244, .92); font-size: 24px; line-height: 1; }
.feed-sentinel { height: 1px; }
.feed-empty { grid-column: 1 / -1; padding: 24px 0; color: var(--muted); }
.result-grid .tile img { aspect-ratio: 1.3; }
.results { display: grid; gap: 13px; border-bottom: 1px solid var(--line); }
.results .section-heading { margin: 0; }
.results #results-note { color: var(--muted); margin-top: 5px; }
.follow-up { display: grid; gap: 8px; width: min(100%, 650px); margin: 10px auto 0; }
.follow-up .hero-status { justify-self: start; }
.search-message { justify-self: end; max-width: min(85%, 600px); padding: 9px 14px; border-radius: 14px 14px 3px 14px; background: #ece0e5; overflow-wrap: anywhere; white-space: pre-wrap; font-size: 14px; }
.result-actions, .footer { display: flex; align-items: center; gap: 6px 18px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.text-button { min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--accent); font-size: 14px; text-decoration: underline; text-underline-offset: 4px; }
#search-feedback textarea { display: block; width: min(420px, 88vw); }
.footer { justify-content: space-between; padding-block: 15px; border-top: 1px solid var(--line); min-height: 62px; }
.footer p { margin-left: auto; }
.footer p span { color: var(--accent); }

@media (max-width: 1100px) { .gallery-grid:has(.tile-live) { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px) {
  .piece-dialog[open] { grid-template-columns: 1fr; }
  .piece-dialog > img { height: auto; max-height: 58dvh; }
  .hero { grid-template-columns: minmax(0, 1fr); background: transparent; }
  .hero-image { aspect-ratio: 2.1; max-height: 350px; object-position: center 55%; }
  .hero-inner { padding: 24px 0 0; gap: 11px; }
  h1 { font-size: clamp(35px, 6.3vw, 49px); }
}
@media (max-width: 620px) {
  .shell { width: calc(100% - 28px); }
  .header { min-height: 56px; }
  .hero-image { aspect-ratio: 1.78; }
  .prompts, .filters { column-gap: 12px; }
  .gallery-grid, .result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile-label { padding-inline: 8px; }
  .result-grid .tile { aspect-ratio: 1.2; }
  .gallery-grid:has(.tile-live) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-grid .tile-live { aspect-ratio: 4 / 5; }
}
@media (hover: none) { .tile-label { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .tile img, .tile-label { transition: none; } }
