/* ─────────────────────────────────────────────
   Grandma's Kitchen — Museum Catalog
   Design System & Styles
   ───────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Inter:wght@300;400;500;600&family=Caveat:wght@400;600&display=swap');

/* ── Reset & Base ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Colour palette */
  --bg-deep: #0a0806;
  --bg-card: #120e0a;
  --bg-glass: rgba(18, 14, 10, 0.85);
  --border-subtle: rgba(180, 140, 80, 0.12);
  --border-warm: rgba(212, 175, 55, 0.3);
  /* Metallic gold */

  --gold-bright: #d4af37;
  /* Classic Gold */
  --gold-mid: #b8860b;
  --gold-dim: #734d0b;
  --amber: #92400e;
  --cream: #f4ead5;
  --cream-dim: #d1bfa7;

  --museum-red: #450a0a;
  --museum-red-glow: rgba(153, 27, 27, 0.15);

  --text-primary: #e5e0d8;
  --text-muted: #a3907a;
  --text-header: #d4af37;

  --tag-bg: rgba(200, 120, 40, 0.18);
  --tag-border: rgba(200, 120, 40, 0.45);

  --card-glow: rgba(240, 180, 41, 0.06);
  --card-glow-hov: rgba(240, 180, 41, 0.14);

  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  /* Transitions */
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── Background texture ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(200, 120, 40, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 20% 80%, rgba(200, 100, 20, 0.05) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 60%, rgba(160, 80, 10, 0.04) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

/* ── Site Header / Hero ── */
.site-header {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 4rem 2rem 2.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.site-header .eyebrow {
  font-family: 'Caveat', cursive;
  font-size: 1.1rem;
  color: var(--gold-mid);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.site-header h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 700;
  color: var(--text-header);
  text-shadow: 0 0 40px rgba(240, 180, 41, 0.25);
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.site-header .subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto;
}

/* ── Decorative divider ── */
.divider {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-mid), transparent);
  margin: 1.2rem auto;
}

/* ── Nav bar ── */
.site-nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 2rem;
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
  background: rgba(13, 10, 7, 0.6);
  position: sticky;
  top: 0;
}

.site-nav .brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--gold-bright);
  text-decoration: none;
  letter-spacing: 0.03em;
}

.site-nav .nav-links {
  display: flex;
  gap: 1.2rem;
  list-style: none;
}

.site-nav .nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s var(--ease-smooth);
}

.site-nav .nav-links a:hover,
.site-nav .nav-links a.active {
  color: var(--gold-bright);
}

/* ── Main layout ── */
main {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* ── Section header ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.section-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  color: var(--cream);
  font-weight: 400;
}

.section-header .count-badge {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gold-mid);
  background: rgba(200, 120, 40, 0.12);
  border: 1px solid var(--tag-border);
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  letter-spacing: 0.06em;
}

/* ── CTA Button ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s var(--ease-smooth);
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-mid), var(--amber));
  color: #1a0e05;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-mid));
  box-shadow: 0 4px 20px rgba(240, 180, 41, 0.28);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.btn-ghost:hover {
  border-color: var(--border-warm);
  color: var(--cream);
}

.btn-experience {
  background: linear-gradient(135deg, #0d9488, #059669);
  color: #f0fdf4;
}

.btn-experience:hover {
  background: linear-gradient(135deg, #14b8a6, #10b981);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.30);
  transform: translateY(-1px);
  color: #fff;
  text-decoration: none;
}

.btn-build {
  background: rgba(100, 116, 139, 0.18);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.35);
}

.btn-build:hover {
  background: rgba(100, 116, 139, 0.30);
  color: #cbd5e1;
  border-color: rgba(100, 116, 139, 0.6);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 5rem 2rem;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--card-glow);
}

.empty-state .empty-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--cream-dim);
  margin-bottom: 0.5rem;
}

.empty-state p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Variation List ── */
.variations-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.variation-item {
  position: relative;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--gold-mid);
  border-radius: var(--radius-sm);
  padding: 1.5rem 2rem;
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  transition: all 0.3s var(--ease-smooth);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.variation-item:hover {
  border-color: var(--gold-bright);
  border-left-color: var(--gold-bright);
  background: rgba(22, 17, 13, 0.95);
  transform: scale(1.005) translateX(8px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px var(--museum-red-glow);
}

.curator-notes {
  margin-top: 0.5rem;
}

.curator-notes .label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--gold-mid);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
}

.item-content {
  flex: 1;
}

.item-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.4rem;
}

.item-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: var(--gold-bright);
}

.item-branch {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.item-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 600px;
}

.item-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.card-branch {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--gold-mid);
  text-transform: uppercase;
  background: rgba(200, 120, 40, 0.1);
  border: 1px solid rgba(200, 120, 40, 0.25);
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  width: fit-content;
}

.card-branch::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-mid);
}

@media (max-width: 768px) {
  .variation-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .item-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ── Add / Form Page ── */
.page-card {
  max-width: 640px;
  margin: 3rem auto;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  backdrop-filter: blur(12px);
}

.page-card h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  color: var(--cream);
  margin-bottom: 0.25rem;
}

.page-card .page-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.4rem;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--cream-dim);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.form-group input,
.form-group select,
.form-group textarea {
  background: rgba(10, 7, 4, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  padding: 0.65rem 0.9rem;
  outline: none;
  width: 100%;
  transition: border-color 0.2s var(--ease-smooth), box-shadow 0.2s var(--ease-smooth);
  appearance: none;
}

.form-group textarea {
  min-height: 110px;
  resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px rgba(200, 120, 40, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.form-group .hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.75;
}

.form-actions {
  display: flex;
  gap: 0.8rem;
  margin-top: 0.5rem;
}

.error-banner {
  background: rgba(180, 40, 40, 0.12);
  border: 1px solid rgba(180, 40, 40, 0.35);
  color: #f87171;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

/* ── Variation detail page ── */
.detail-hero {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 3rem auto 0;
  padding: 0 1.5rem;
}

.detail-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  backdrop-filter: blur(12px);
  margin-top: 2rem;
}

.detail-thumb {
  width: 100%;
  height: 240px;
  background: linear-gradient(135deg, rgba(120, 60, 10, 0.35), rgba(60, 30, 5, 0.5));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.detail-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-thumb .no-img {
  font-size: 4rem;
  opacity: 0.25;
}

.detail-title {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: var(--cream);
  margin-bottom: 0.5rem;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  margin-bottom: 1.2rem;
}

.detail-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.5rem;
}

.not-built-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  width: 100%;
}

/* ── Footer ── */
.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ── Animations ── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: fadeInUp 0.45s var(--ease-smooth) both;
}

.stagger-1 {
  animation-delay: 0.05s;
}

.stagger-2 {
  animation-delay: 0.10s;
}

.stagger-3 {
  animation-delay: 0.15s;
}

.stagger-4 {
  animation-delay: 0.20s;
}

.stagger-5 {
  animation-delay: 0.25s;
}

.stagger-6 {
  animation-delay: 0.30s;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .site-header {
    padding: 2.5rem 1rem 1.5rem;
  }

  .page-card {
    padding: 1.5rem 1rem;
    margin: 1.5rem auto;
  }

  .detail-card {
    padding: 1.5rem 1rem;
  }

  .form-actions {
    flex-direction: column;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
}