:root {
  color-scheme: light;
  --ink: #191714;
  --muted: #746e65;
  --paper: #f6f3ed;
  --card: #fffdf8;
  --line: #dcd5ca;
  --accent: #e84a2a;
  --accent-dark: #b93219;
  --shadow: 0 24px 80px rgb(41 32 20 / 14%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 10%, rgb(232 74 42 / 11%), transparent 28rem),
    var(--paper);
}

button, textarea, input { font: inherit; }
button { color: inherit; }

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem clamp(1rem, 4vw, 4rem);
  border-bottom: 1px solid rgb(220 213 202 / 75%);
  background: rgb(246 243 237 / 88%);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  color: inherit;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--accent);
}

.header-actions { display: flex; gap: .6rem; }

.button {
  min-height: 2.65rem;
  padding: .7rem 1.05rem;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 700;
  transition: transform .18s ease, background .18s ease;
}

.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .55; transform: none; }
.button.primary { color: white; background: var(--accent); }
.button.primary:hover { background: var(--accent-dark); }
.button.secondary { border-color: var(--line); background: rgb(255 253 248 / 70%); }
.button.wide { width: 100%; }

main { padding: clamp(1rem, 3vw, 2.5rem) clamp(.8rem, 3vw, 3.5rem) 5rem; }

.eyebrow {
  margin: 0 0 1rem;
  color: var(--accent);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .18em;
}

.gallery {
  columns: 5 240px;
  column-gap: 1rem;
}

.card {
  position: relative;
  display: block;
  width: 100%;
  margin: 0 0 1rem;
  padding: 0;
  overflow: hidden;
  break-inside: avoid;
  border: 0;
  border-radius: 1.15rem;
  background: #e7e0d5;
  cursor: zoom-in;
}

.card img {
  display: block;
  width: 100%;
  min-height: 140px;
  object-fit: cover;
  transition: transform .45s cubic-bezier(.2,.7,.2,1);
}

.card:hover img { transform: scale(1.025); }

.card-overlay {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2.5rem .9rem .8rem;
  color: white;
  background: linear-gradient(transparent, rgb(0 0 0 / 62%));
  opacity: 0;
  transition: opacity .2s ease;
}

.card:hover .card-overlay, .card:focus-visible .card-overlay { opacity: 1; }
.card-source { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.card-arrow { font-size: 1.2rem; }

.feed-status, .empty-state {
  padding: 3rem 1rem;
  color: var(--muted);
  text-align: center;
}

.empty-state h2 { margin-bottom: .4rem; font-family: Georgia, serif; font-size: 2rem; }
.empty-state p { margin-top: 0; }
.empty-orb { width: 4rem; height: 4rem; margin: auto; border-radius: 50%; background: var(--accent); box-shadow: 2rem -1rem #efb13f, -1.5rem -1rem #647d67; }

.dialog, .image-dialog {
  max-width: calc(100vw - 2rem);
  padding: 0;
  border: 0;
  border-radius: 1.4rem;
  background: var(--card);
  box-shadow: var(--shadow);
}

.dialog { width: 500px; }
.image-dialog { width: min(1050px, calc(100vw - 2rem)); }
.dialog::backdrop, .image-dialog::backdrop { background: rgb(23 20 17 / 66%); backdrop-filter: blur(5px); }

.form { position: relative; padding: clamp(1.5rem, 4vw, 2.5rem); }
.form h2 { margin: 0 0 1.5rem; font-family: Georgia, serif; font-size: 2.25rem; font-weight: 500; }
.dialog-close, .image-close {
  position: absolute;
  z-index: 2;
  top: .8rem;
  right: .8rem;
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 82%);
  cursor: pointer;
  font-size: 1.4rem;
}

.drop-zone {
  position: relative;
  display: grid;
  min-height: 230px;
  overflow: hidden;
  place-items: center;
  border: 1.5px dashed #c7beb0;
  border-radius: 1rem;
  background: #f0ece4;
  cursor: pointer;
  text-align: center;
}

.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-zone strong, .drop-zone small { display: block; }
.drop-zone strong { margin-bottom: .4rem; }
.drop-zone small { color: var(--muted); }
.upload-previews {
  display: grid;
  width: 100%;
  padding: .6rem;
  grid-template-columns: repeat(3, 1fr);
  gap: .45rem;
}
.upload-previews img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: .5rem;
  object-fit: cover;
}

.label { display: block; margin-bottom: .55rem; font-size: .82rem; font-weight: 750; }
textarea {
  width: 100%;
  resize: vertical;
  padding: .9rem 1rem;
  border: 1px solid var(--line);
  border-radius: .85rem;
  outline: none;
  color: var(--ink);
  background: white;
  line-height: 1.5;
}
textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(232 74 42 / 12%); }
.prompt-meta { display: flex; justify-content: space-between; margin-top: .4rem; color: var(--muted); font-size: .72rem; }
.turnstile { min-height: 65px; margin: 1.2rem 0 .4rem; }
.form-message { min-height: 1.4rem; margin: .45rem 0 .8rem; color: var(--muted); font-size: .82rem; }
.form-message.error { color: #b3261e; }
.form-message.success { color: #2f6e3c; }

.image-close { position: fixed; }
.image-detail { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, .75fr); min-height: 500px; }
.image-detail > img { width: 100%; height: 100%; max-height: 82vh; object-fit: contain; background: #171411; }
.image-detail aside { padding: clamp(1.5rem, 4vw, 3rem); }
.image-detail h2 { font-family: Georgia, serif; font-size: 2rem; }
.pill { display: inline-block; padding: .38rem .62rem; border-radius: 999px; color: var(--accent-dark); background: rgb(232 74 42 / 10%); font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.detail-prompt { color: var(--muted); line-height: 1.65; }
dl { margin-top: 2rem; }
dl div { padding: .75rem 0; border-top: 1px solid var(--line); }
dt { color: var(--muted); font-size: .7rem; font-weight: 800; text-transform: uppercase; }
dd { margin: .3rem 0 0; }

@media (max-width: 700px) {
  .site-header { padding: .75rem; }
  .header-actions .button { padding: .6rem .8rem; font-size: .78rem; }
  .gallery { columns: 2 140px; column-gap: .65rem; }
  .card { margin-bottom: .65rem; border-radius: .8rem; }
  .image-detail { display: block; }
  .image-detail > img { max-height: 62vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
