  /* ---------- Base & Reset ---------- */
  *, *::before, *::after { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; }

  :root {
    --parchment:   #f4ecd8;
    --parchment-d: #e8dcc0;
    --parchment-l: #faf5e9;
    --ink:         #2b1d10;
    --ink-soft:    #4a3624;
    --burgundy:    #6b2737;
    --burgundy-d:  #4a1a26;
    --forest:      #2d4a3e;
    --gold:        #b8860b;
    --gold-l:      #d4a93c;
    --rust:        #a0522d;
    --shadow:      rgba(60, 35, 15, 0.25);
  }

  body {
    font-family: 'EB Garamond', Georgia, serif;
    color: var(--ink);
    background-color: var(--parchment);
    background-image:
      radial-gradient(circle at 20% 10%, rgba(184,134,11,0.08) 0%, transparent 40%),
      radial-gradient(circle at 80% 80%, rgba(107,39,55,0.08) 0%, transparent 40%),
      repeating-linear-gradient(45deg, rgba(74,54,36,0.02) 0 2px, transparent 2px 6px);
    min-height: 100vh;
    line-height: 1.55;
  }

  /* Aged paper vignette overlay */
  body::before {
    content: "";
    position: fixed; inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(60,35,15,0.18) 100%);
    z-index: 1;
  }

  h1, h2, h3, h4 { font-family: 'Playfair Display', Georgia, serif; font-weight: 600; color: var(--ink); }
  .ornate { font-family: 'IM Fell English SC', serif; letter-spacing: 0.05em; }

  /* ---------- Decorative divider ---------- */
  .divider {
    display: flex; align-items: center; justify-content: center;
    margin: 1.2rem auto; gap: 0.8rem;
    color: var(--gold);
  }
  .divider::before, .divider::after {
    content: ""; flex: 1; max-width: 140px;
    height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent);
  }
  .divider svg { width: 28px; height: 28px; }

  /* ---------- Header ---------- */
  header.site-header {
    position: relative;
    padding: 2.5rem 1.5rem 1.5rem;
    text-align: center;
    border-bottom: 3px double var(--burgundy);
    background:
      linear-gradient(180deg, rgba(250,245,233,0.6), transparent),
      var(--parchment-l);
  }
  header.site-header::after {
    content: "";
    position: absolute; left: 0; right: 0; bottom: -12px;
    height: 1px; background: var(--burgundy);
  }

  .brand {
    font-family: 'Playfair Display', serif;
    font-weight: 800;
    font-size: clamp(2rem, 6vw, 3.5rem);
    color: var(--burgundy);
    letter-spacing: 0.02em;
    text-shadow: 1px 1px 0 rgba(250,245,233,0.8);
    margin: 0;
  }
  .brand .amp { color: var(--gold); font-style: italic; font-weight: 400; }

  .tagline {
    font-family: 'IM Fell English SC', serif;
    color: var(--ink-soft);
    font-size: 0.95rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-top: 0.4rem;
  }

  /* ---------- Nav / Controls ---------- */
  .controls {
    position: sticky; top: 0; z-index: 50;
    background: var(--parchment);
    border-bottom: 1px solid rgba(107,39,55,0.25);
    box-shadow: 0 2px 8px rgba(60,35,15,0.08);
    padding: 0.9rem 1.2rem;
    display: flex; flex-wrap: wrap; gap: 0.8rem;
    align-items: center; justify-content: center;
  }

  .tabs {
    display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center;
  }
  .tab {
    background: transparent;
    border: 1px solid var(--burgundy);
    color: var(--burgundy);
    font-family: 'IM Fell English SC', serif;
    letter-spacing: 0.08em;
    padding: 0.55rem 1.1rem;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.2s ease;
    font-size: 0.95rem;
  }
  .tab:hover { background: rgba(107,39,55,0.08); }
  .tab.active {
    background: var(--burgundy);
    color: var(--parchment-l);
    box-shadow: inset 0 0 0 2px var(--parchment), inset 0 0 0 3px var(--gold);
  }

  .search-wrap {
    position: relative; flex: 1; max-width: 260px; min-width: 160px;
  }
  .search-wrap input {
    width: 100%;
    padding: 0.55rem 0.9rem 0.55rem 2.2rem;
    border: 1px solid var(--ink-soft);
    background: var(--parchment-l);
    color: var(--ink);
    font-family: 'EB Garamond', serif;
    font-size: 1rem;
    border-radius: 2px;
    outline: none;
  }
  .search-wrap input:focus { border-color: var(--burgundy); box-shadow: 0 0 0 2px rgba(107,39,55,0.2); }
  .search-wrap::before {
    content: "⌕";
    position: absolute; left: 0.6rem; top: 50%; transform: translateY(-50%);
    color: var(--ink-soft); font-size: 1.1rem;
  }

  .btn-add {
    background: var(--forest);
    color: var(--parchment-l);
    border: 1px solid var(--burgundy-d);
    font-family: 'IM Fell English SC', serif;
    letter-spacing: 0.1em;
    padding: 0.55rem 1.1rem;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px var(--shadow);
  }
  .btn-add:hover { background: var(--burgundy); transform: translateY(-1px); }

  /* ---------- Stats strip ---------- */
  .stats {
    max-width: 1200px;
    margin: 2rem auto 1rem;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
  }
  .stat {
    background: var(--parchment-l);
    border: 1px solid rgba(107,39,55,0.3);
    padding: 1rem;
    text-align: center;
    position: relative;
    box-shadow: 0 2px 6px var(--shadow);
  }
  .stat::before, .stat::after {
    content: ""; position: absolute; width: 12px; height: 12px;
    border: 1px solid var(--gold);
  }
  .stat::before { top: -3px; left: -3px; border-right: none; border-bottom: none; }
  .stat::after { bottom: -3px; right: -3px; border-left: none; border-top: none; }
  .stat .label {
    font-family: 'IM Fell English SC', serif;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    color: var(--ink-soft);
    text-transform: uppercase;
  }
  .stat .value {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--burgundy);
    display: block;
    margin-top: 0.3rem;
  }

  /* ---------- Grid ---------- */
  .gallery {
    max-width: 1200px;
    margin: 1.5rem auto 4rem;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.8rem;
  }

  .card {
    background: var(--parchment-l);
    border: 1px solid rgba(74,54,36,0.3);
    box-shadow:
      0 1px 0 rgba(255,255,255,0.6) inset,
      0 4px 14px var(--shadow);
    display: flex; flex-direction: column;
    position: relative;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
  }
  .card:hover {
    transform: translateY(-3px) rotate(-0.3deg);
    box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset, 0 10px 24px var(--shadow);
  }

  .card .cat-ribbon {
    position: absolute; top: 10px; right: -8px;
    background: var(--burgundy);
    color: var(--parchment-l);
    font-family: 'IM Fell English SC', serif;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    padding: 0.3rem 0.7rem 0.3rem 0.9rem;
    z-index: 2;
    box-shadow: 0 2px 4px var(--shadow);
  }
  .card .cat-ribbon::after {
    content: ""; position: absolute; left: -8px; top: 0;
    border: 12px solid transparent;
    border-right-color: var(--burgundy-d);
    border-left: none;
  }

  .card-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    position: relative;
    background: var(--parchment-d);
    border-bottom: 1px dashed rgba(74,54,36,0.3);
  }
  .card-image img {
    width: 100%; height: 100%; object-fit: cover;
    filter: sepia(0.15) contrast(1.02) saturate(0.9);
  }

  /* SVG placeholders styled per category */
  .placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
  }

  .card-body {
    padding: 1rem 1.1rem 1.2rem;
    flex: 1;
    display: flex; flex-direction: column;
  }
  .card-title {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 1.15rem;
    margin: 0 0 0.25rem;
    color: var(--ink);
  }
  .card-meta {
    font-size: 0.85rem;
    color: var(--ink-soft);
    font-style: italic;
    margin-bottom: 0.6rem;
  }
  .card-meta span + span::before { content: " • "; color: var(--gold); margin: 0 0.3rem; }

  .card-desc {
    font-size: 0.98rem;
    color: var(--ink-soft);
    line-height: 1.5;
    flex: 1;
    margin: 0.3rem 0 0.8rem;
    white-space: pre-line;
  }

  .card-footer {
    display: flex; justify-content: space-between; align-items: center;
    border-top: 1px dashed rgba(74,54,36,0.3);
    padding-top: 0.7rem;
    gap: 0.5rem;
  }
  .card-value {
    font-family: 'Playfair Display', serif;
    color: var(--forest);
    font-weight: 600;
    font-size: 1rem;
  }
  .card-cond {
    font-family: 'IM Fell English SC', serif;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: var(--rust);
    border: 1px solid var(--rust);
    padding: 0.15rem 0.5rem;
    border-radius: 2px;
  }
  .card-actions {
    display: flex; gap: 0.4rem; margin-top: 0.7rem;
  }
  .icon-btn {
    flex: 1;
    background: transparent;
    border: 1px solid rgba(74,54,36,0.4);
    color: var(--ink-soft);
    font-family: 'IM Fell English SC', serif;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    padding: 0.35rem 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
  }
  .icon-btn:hover { background: var(--parchment); color: var(--ink); border-color: var(--burgundy); }
  .icon-btn.danger:hover { background: var(--burgundy); color: var(--parchment-l); border-color: var(--burgundy-d); }

  /* Empty state */
  .empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 1rem;
    color: var(--ink-soft);
    font-style: italic;
  }
  .empty h3 { color: var(--burgundy); }

  /* ---------- Modal ---------- */
  .modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(43, 29, 16, 0.7);
    display: none;
    align-items: center; justify-content: center;
    z-index: 100;
    padding: 1rem;
  }
  .modal-backdrop.open { display: flex; }
  .modal {
    background: var(--parchment-l);
    border: 3px double var(--burgundy);
    max-width: 560px; width: 100%;
    max-height: 90vh; overflow-y: auto;
    padding: 1.8rem;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  }
  .modal h2 {
    font-family: 'Playfair Display', serif;
    color: var(--burgundy);
    margin: 0 0 0.3rem;
    text-align: center;
  }
  .modal .subtitle {
    text-align: center;
    font-family: 'IM Fell English SC', serif;
    color: var(--ink-soft);
    letter-spacing: 0.1em;
    font-size: 0.85rem;
    margin-bottom: 1rem;
  }
  .modal .close {
    position: absolute; top: 0.5rem; right: 0.8rem;
    background: transparent; border: none;
    font-size: 1.6rem; color: var(--ink-soft);
    cursor: pointer; line-height: 1;
  }
  .modal .close:hover { color: var(--burgundy); }

  .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem;
  }
  .form-grid .full { grid-column: 1 / -1; }
  .form-field label {
    display: block;
    font-family: 'IM Fell English SC', serif;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    color: var(--ink-soft);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
  }
  .form-field input,
  .form-field select,
  .form-field textarea {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--ink-soft);
    background: var(--parchment);
    color: var(--ink);
    font-family: 'EB Garamond', serif;
    font-size: 1rem;
    border-radius: 2px;
    outline: none;
  }
  .form-field input:focus,
  .form-field select:focus,
  .form-field textarea:focus {
    border-color: var(--burgundy);
    box-shadow: 0 0 0 2px rgba(107,39,55,0.2);
  }
  .form-field textarea { min-height: 90px; resize: vertical; font-family: 'EB Garamond', serif; }

  .image-upload {
    border: 2px dashed var(--ink-soft);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    background: var(--parchment);
    transition: all 0.2s;
    position: relative;
  }
  .image-upload:hover { border-color: var(--burgundy); background: var(--parchment-d); }
  .image-upload input { display: none; }
  .image-upload .preview {
    max-width: 100%; max-height: 150px;
    margin-top: 0.5rem;
    display: none;
    filter: sepia(0.15);
  }
  .image-upload .hint {
    font-family: 'IM Fell English SC', serif;
    color: var(--ink-soft);
    font-size: 0.85rem;
    letter-spacing: 0.05em;
  }

  .modal-actions {
    display: flex; gap: 0.8rem; justify-content: flex-end;
    margin-top: 1.3rem; padding-top: 1rem;
    border-top: 1px dashed rgba(74,54,36,0.3);
  }
  .btn {
    font-family: 'IM Fell English SC', serif;
    letter-spacing: 0.1em;
    padding: 0.6rem 1.4rem;
    cursor: pointer;
    border-radius: 2px;
    font-size: 0.95rem;
    border: 1px solid;
    transition: all 0.2s;
  }
  .btn-primary { background: var(--burgundy); color: var(--parchment-l); border-color: var(--burgundy-d); }
  .btn-primary:hover { background: var(--burgundy-d); }
  .btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--ink-soft); }
  .btn-ghost:hover { background: var(--parchment); color: var(--ink); }

  /* ---------- Footer ---------- */
  footer {
    text-align: center;
    padding: 2rem 1rem 3rem;
    border-top: 3px double var(--burgundy);
    color: var(--ink-soft);
    font-family: 'IM Fell English SC', serif;
    letter-spacing: 0.1em;
    font-size: 0.85rem;
  }
  footer .motto {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 1rem;
    color: var(--burgundy);
    margin-top: 0.5rem;
    letter-spacing: 0;
  }

  /* ---------- Responsive ---------- */
  @media (max-width: 600px) {
    .form-grid { grid-template-columns: 1fr; }
    .controls { flex-direction: column; }
    .search-wrap { max-width: none; width: 100%; }
    .gallery { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.2rem; }
  }

  /* Subtle flicker animation for vintage feel */
  @keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .card { animation: fadeInUp 0.4s ease both; }
  
  .lightbox-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 10, 8, 0.85);
  backdrop-filter: blur(4px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
}

.lightbox-backdrop.open {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  text-align: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.lightbox-caption {
  margin-top: 0.75rem;
  color: #f4ecd8;
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
}

/* Optional hover indicator on gallery images */
.card-image img {
  cursor: zoom-in;
}