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

/* ── Tokens ── */
:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --text: #1c1917;
  --text-secondary: #78716c;
  --border: #e7e5e4;
  --accent: #292524;
  --code-bg: #f5f5f4;
  --radius: 6px;
  --font-body: 'Instrument Sans', sans-serif;
  --font-mono: 'DM Mono', monospace;
}

/* ── Base ── */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--text);
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s;
}
a:hover {
  text-decoration-color: var(--text);
}

/* ── Header ── */
.site-header {
  padding: 2rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, color 0.2s;
}
.contact-link:hover {
  border-color: var(--text);
  color: var(--text);
}
.contact-link svg {
  flex-shrink: 0;
}

/* ── Catalogue ── */
.catalogue {
  flex: 1;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.catalogue-note {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
}

/* ── Grid ── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
}
.card:hover {
  border-color: var(--text-secondary);
}

.card-img {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--code-bg);
  overflow: hidden;
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.timestamp {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 400;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  letter-spacing: 0.04em;
  backdrop-filter: blur(4px);
}

.card-meta {
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.card-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.item-code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--text);
  background: var(--code-bg);
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
}

/* ── Footer ── */
.site-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.site-footer p {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.site-footer a {
  color: var(--text-secondary);
  font-weight: 500;
}
.site-footer a:hover {
  color: var(--text);
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
  }

  .site-header {
    padding: 1.25rem 1rem;
  }

  .catalogue {
    padding: 1.5rem 1rem 3rem;
  }
}

/* ── Lightbox ── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  backdrop-filter: blur(4px);
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  transition: color 0.2s;
}
.lightbox-close:hover {
  color: #fff;
}

.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox-frame {
  position: relative;
  line-height: 0;
  overflow: hidden;
  border-radius: var(--radius);
}

.lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius);
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.3s ease 0.05s, transform 0.3s ease 0.05s;
  -webkit-user-select: none;
  user-select: none;
  pointer-events: none;
}

.lightbox.active .lightbox-img {
  opacity: 1;
  transform: scale(1);
}

/* ── Watermark ── */
.watermark {
  position: absolute;
  inset: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  transform: rotate(-24deg) scale(1.5);
  pointer-events: none;
}

.watermark span {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.12);
  white-space: nowrap;
  letter-spacing: 0.05em;
  -webkit-user-select: none;
  user-select: none;
}

/* ── Lightbox info ── */
.lightbox-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.lightbox-code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.04em;
}

.lightbox-desc {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
}

/* ── Image protection ── */
img {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
