:root {
  --bg: #0d0d0f;
  --bg-raised: #17171a;
  --border: #2a2a2e;
  --text: #e8e6e1;
  --text-muted: #9a968c;
  --amber: #e8b84b;
  --amber-bright: #f5c542;
  --serif: 'Georgia', 'Iowan Old Style', 'Palatino Linotype', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
}

/* ---------- Header ---------- */

header.hero {
  text-align: center;
  padding: 64px 24px 40px;
  border-bottom: 1px solid var(--border);
  background: radial-gradient(ellipse at top, rgba(232, 184, 75, 0.06), transparent 60%);
}

.hero-photo {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--amber);
  box-shadow: 0 0 40px rgba(232, 184, 75, 0.15);
  margin-bottom: 24px;
}

h1.name {
  font-family: var(--serif);
  font-size: 2.75rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  margin: 0 0 8px;
  color: var(--text);
}

.years-lived {
  color: var(--amber);
  font-size: 1rem;
  letter-spacing: 0.08em;
  margin: 0 0 20px;
}

.dedication {
  max-width: 480px;
  margin: 0 auto;
  color: var(--text-muted);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.6;
}

/* ---------- Year tabs ---------- */

nav.year-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 28px 16px;
  position: sticky;
  top: 0;
  background: rgba(13, 13, 15, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

.year-tab {
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--sans);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  padding: 11px 18px;
  min-height: 44px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.year-tab:hover {
  color: var(--text);
  border-color: var(--border);
}

.year-tab.active {
  color: var(--amber-bright);
  border-color: var(--amber);
  background: rgba(232, 184, 75, 0.08);
}

.year-tab .count {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-left: 4px;
}

.year-tab.add-year {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
  margin-left: 6px;
}

.year-tab.add-year:hover {
  color: var(--amber-bright);
  border-color: var(--amber);
  background: rgba(232, 184, 75, 0.08);
}

.year-tab.upload-link {
  margin-left: 6px;
  border-color: var(--border);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.year-tab.upload-link:hover {
  color: var(--amber-bright);
  border-color: var(--amber);
  background: rgba(232, 184, 75, 0.08);
}

/* ---------- Gallery grid ---------- */

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.photo-card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeIn 0.5s ease forwards;
}

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

.photo-card img,
.photo-card video {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: #000;
  transition: transform 0.35s ease;
}

.photo-card:hover video {
  transform: scale(1.04);
}

.photo-card.is-video::after {
  content: '\25B6';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: var(--amber-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  pointer-events: none;
}

.photo-card:hover img {
  transform: scale(1.04);
}

.photo-card .card-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 24px 12px 10px;
  background: linear-gradient(to top, rgba(0,0,0,0.75), transparent);
  color: var(--text);
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.photo-card:hover .card-caption {
  opacity: 1;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  font-family: var(--serif);
  font-style: italic;
  padding: 60px 20px;
}

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 6, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 100;
  padding: 24px;
}

.lightbox[hidden] {
  display: none;
}

.lightbox img,
.lightbox video {
  max-width: min(90vw, 900px);
  max-height: 70vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 0 60px rgba(0,0,0,0.6);
}

.lightbox-info {
  text-align: center;
  margin-top: 18px;
  color: var(--text);
}

.lightbox-caption {
  font-family: var(--serif);
  font-size: 1.1rem;
}

.lightbox-date {
  color: var(--amber);
  font-size: 0.85rem;
  margin-top: 4px;
  letter-spacing: 0.05em;
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 20px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 2rem;
  line-height: 1;
  padding: 12px;
  cursor: pointer;
}

.lightbox-close:hover {
  color: var(--amber-bright);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 2.5rem;
  cursor: pointer;
  padding: 16px 14px;
}

.lightbox-nav:hover {
  color: var(--amber-bright);
}

.lightbox-prev {
  left: 12px;
}

.lightbox-next {
  right: 12px;
}

/* ---------- Footer ---------- */

footer {
  text-align: center;
  padding: 32px 24px 48px;
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

footer .paw {
  color: var(--amber);
  margin: 0 6px;
}
