:root {
  color-scheme: dark;
  --gold: #e9ca8d;
  --ink: #100f20;
  --muted: #c9c3d5;
  --panel: #211e34;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ink); color: #f8f3eb; font: 16px/1.6 system-ui, sans-serif; }
a { color: inherit; }
.site-header { display: flex; gap: 22px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 17px 5%; background: #100f20; }
.brand { color: var(--gold); text-decoration: none; font: 23px/1.3 Georgia, serif; }
nav { display: flex; gap: 18px; flex-wrap: wrap; }
nav a { text-decoration: none; }
nav a:hover, footer a:hover { color: var(--gold); text-decoration: underline; }
button, .button { display: inline-block; border: 1px solid var(--gold); border-radius: 5px; padding: 10px 15px; background: var(--gold); color: #171324; font: inherit; text-decoration: none; cursor: pointer; }
button:hover, .button:hover { background: #fff0ca; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #ffe7ab; outline-offset: 2px; }
button.outline { background: transparent; color: var(--gold); }
button.outline:hover { background: #3b314a; }
button:disabled { opacity: 0.6; cursor: wait; }
.hero { min-height: 500px; display: grid; align-content: center; justify-items: center; text-align: center; padding: 65px 20px; background: linear-gradient(90deg,#100f20bf,#100f2060),url('https://cdn.esahubble.org/archives/images/screen/heic1501a.jpg') center/cover; }
.hero h1 { font: clamp(47px,8vw,96px)/1.07 Georgia,serif; margin: 10px 0; color: #fff4df; }
.hero p { margin: 10px 0 22px; }
.eyebrow { text-transform: uppercase; letter-spacing: .25em; color: var(--gold); }
.collection { padding: 64px 5%; background: #141225; scroll-margin-top: 15px; }
.collection:nth-child(even) { background: #19162b; }
.banner { padding: 30px 25px; margin-bottom: 25px; border-radius: 9px; background: linear-gradient(90deg,#100f20eb,#100f2055),var(--sky) center/cover; }
.collection:nth-child(1) { --sky: url('https://cdn.esahubble.org/archives/images/screen/heic0707a.jpg'); }
.collection:nth-child(2) { --sky: url('https://cdn.esahubble.org/archives/images/screen/heic1501a.jpg'); }
.collection:nth-child(3) { --sky: url('https://cdn.esahubble.org/archives/images/screen/heic0910h.jpg'); }
.collection:nth-child(4) { --sky: url('https://cdn.esahubble.org/archives/images/screen/heic0506a.jpg'); }
.banner h2 { font: clamp(34px,5vw,46px) Georgia,serif; color: var(--gold); margin: 0; }
.banner p { max-width: 640px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(210px,1fr)); gap: 18px; }
.product { background: var(--panel); border: 1px solid #ffffff27; border-radius: 9px; padding: 12px; overflow: hidden; }
.photo { aspect-ratio: 1; display: grid; place-items: center; position: relative; background: #302b45; color: var(--muted); border-radius: 5px; overflow: hidden; text-align: center; }
.photo img { width: 100%; height: 100%; object-fit: cover; min-width: 0; min-height: 0; }
.photo.over { outline: 3px dashed var(--gold); outline-offset: -5px; background: #504166; }
.product h3 { font: 22px Georgia,serif; margin: 13px 0 4px; }
.product p { overflow-wrap: anywhere; white-space: pre-wrap; }
.product .price { color: var(--gold); font-size: 18px; font-weight: 650; }
.product .tag { display: inline-block; color: var(--muted); font-size: .88rem; }
.product .sold { color: #ffd3cc; font-weight: 700; }
.product .button { width: 100%; text-align: center; margin-top: 10px; }
.product .item-number { color: var(--muted); font-size: .78rem; margin: 12px 0 0; letter-spacing: .07em; text-transform: uppercase; }
.product.editing { border-color: #977e5b; }
label { display: block; margin: 10px 0; font-size: .88rem; }
input:not([type="checkbox"]):not([type="file"]), textarea { width: 100%; background: #100f20; color: #fff; border: 1px solid #847b99; border-radius: 5px; padding: 9px; font: inherit; }
input[type="file"] { display: none; }
textarea { min-height: 90px; resize: vertical; }
.check { display: flex; gap: 8px; align-items: center; }
.check input { width: 18px; height: 18px; }
.photo-controls { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.photo-controls button, .photo-controls label { font-size: .86rem; padding: 7px 10px; margin: 0; }
.file-label { display: inline-flex; cursor: pointer; align-items: center; border: 1px solid var(--gold); border-radius: 5px; color: var(--gold); }
.file-label:hover { background: #3b314a; }
#admin { background: #342743; padding: 20px 5%; position: sticky; top: 0; z-index: 5; box-shadow: 0 6px 24px #0006; }
.admin-heading { display: flex; gap: 20px; justify-content: space-between; flex-wrap: wrap; align-items: center; }
.admin-heading strong { font: 26px Georgia,serif; color: var(--gold); }
.admin-heading p { max-width: 590px; margin: 4px 0; }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }
#status { margin: 6px 0 0; font-weight: 600; }
footer { text-align: center; padding: 42px 5%; color: var(--gold); }
footer small { display: block; max-width: 850px; margin: 8px auto 0; color: var(--muted); font-size: .8rem; }
dialog { max-width: 440px; width: 92%; background: var(--panel); color: #fff; border: 1px solid var(--gold); border-radius: 8px; padding: 24px; }
dialog::backdrop { background: #000a; }
.dialog-buttons { display: flex; gap: 10px; }
[hidden] { display: none !important; }
#error { color: #ffb2b2; }
@media (min-width: 1250px) { .grid { grid-template-columns: repeat(5,minmax(0,1fr)); } }
@media (max-width: 540px) { .hero { min-height: 420px; } .site-header { gap: 12px; } .grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; } .product { padding: 9px; } .admin-actions { flex-direction: column; width: 100%; } }
@media (max-width: 380px) { .grid { grid-template-columns: 1fr; } }