:root {
  --bg: #1b2330;
  --bg-deep: #141b25;
  --panel: #243042;
  --panel-hi: #2c3a50;
  --line: #3a4a62;
  --text: #e6e9ef;
  --muted: #a3afc2;
  --gold: #d4af5a;
  --gold-hi: #ecc977;
  --gold-dim: #8f7536;
  --paper: #f7f2e6;
  --serif: "Times New Roman", Times, "Liberation Serif", "Nimbus Roman", serif;
}

* { box-sizing: border-box; }

html { background: var(--bg-deep); }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 80% 40% at 50% 0, rgba(212, 175, 90, .07), transparent 70%),
    linear-gradient(var(--bg), var(--bg-deep));
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

main, .masthead, footer { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }
main { flex: 1; }

a { color: var(--gold); text-decoration-color: var(--gold-dim); text-underline-offset: 3px; }
a:hover { color: var(--gold-hi); }
a:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; border-radius: 2px; }

/* ---------- header ---------- */
.masthead {
  padding-top: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(212, 175, 90, .18);
  max-width: none;
  text-align: center;
}
.brand {
  color: var(--gold);
  text-decoration: none;
  font-size: 15px;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.brand-mark { font-size: 18px; margin-right: 6px; }

/* ---------- headings & ornaments ---------- */
h1 {
  font-weight: normal;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.15;
  letter-spacing: .02em;
  color: #f3ead2;
  margin: 36px 0 6px;
  text-align: center;
}

.hero { text-align: center; padding: 18px 0 8px; }
.hero h1 { font-size: clamp(34px, 6vw, 58px); margin-top: 28px; }
.hero p { max-width: 640px; margin: 14px auto 36px; color: var(--muted); font-size: 19px; font-style: italic; }

.crumbs { margin-top: 22px; font-size: 16px; color: var(--muted); }
.crumbs span { margin: 0 6px; color: var(--gold-dim); }
.count { text-align: center; color: var(--muted); font-style: italic; margin: 0 0 30px; }

/* ---------- framed images (clipart is often black line art, so it sits on paper) ---------- */
.frame {
  display: block;
  background: var(--paper);
  border: 1px solid var(--gold-dim);
  outline: 1px solid rgba(212, 175, 90, .25);
  outline-offset: 3px;
  padding: 10px;
  margin: 4px;
}
.frame img { display: block; width: 100%; object-fit: contain; mix-blend-mode: multiply; }

/* ---------- category grid (home) ---------- */
.categories {
  list-style: none;
  padding: 0;
  margin: 0 0 56px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 26px;
}
.categories a {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 12px 12px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 3px;
  text-decoration: none;
  text-align: center;
  transition: transform .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.categories a:hover {
  transform: translateY(-3px);
  background: var(--panel-hi);
  border-color: var(--gold-dim);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .35);
}
.categories .frame img { height: 190px; }
.categories .label {
  margin-top: 14px;
  color: #f3ead2;
  font-size: 19px;
  line-height: 1.25;
}
.categories a:hover .label { color: var(--gold-hi); }
.categories small {
  margin-top: 4px;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* ---------- gallery (category pages) ---------- */
.gallery {
  list-style: none;
  padding: 0;
  margin: 0 0 56px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 22px;
}
.gallery li {
  display: flex;
  flex-direction: column;
  padding: 10px 10px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 3px;
  text-align: center;
  transition: border-color .2s ease;
}
.gallery li:hover { border-color: var(--gold-dim); }
.gallery .frame img { height: 180px; transition: transform .25s ease; }
.gallery .frame:hover img { transform: scale(1.03); }
.gallery span { margin-top: 10px; font-size: 17px; line-height: 1.25; color: var(--text); }
.gallery small { margin-top: 4px; font-size: 13px; color: var(--muted); }

.gallery .download {
  align-self: center;
  margin-top: 10px;
  padding: 5px 16px;
  border: 1px solid var(--gold-dim);
  border-radius: 2px;
  color: var(--gold);
  font-size: 14px;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background .2s ease, color .2s ease;
}
.gallery .download::before { content: "↓ "; }
.gallery .download:hover { background: var(--gold); color: var(--bg-deep); }
.gallery small { flex: 1; }

/* ---------- footer ---------- */
footer {
  padding-top: 20px;
  padding-bottom: 36px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  font-style: italic;
}
footer p { margin: 6px 0; }

@media (max-width: 520px) {
  body { font-size: 17px; }
  .brand { font-size: 13px; letter-spacing: .14em; }
  .categories { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .categories .frame img { height: 120px; }
  .categories .label { font-size: 16px; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .gallery .frame img { height: 130px; }
  .frame { padding: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
