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

:root {
  --black: #0a0a0a;
  --dark: #1a1a1a;
  --card: #f4f4f4;
  --border: #e2e2e2;
  --purple: #593d8f;
  --purple-light: #7b5cb8;
  --purple-dark: #3d2760;
  --white: #ffffff;
  --gray: #666666;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--white);
  color: var(--black);
  letter-spacing: -0.03em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── NOTES CANVAS ── */
#notes-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ── CURSOR GLOW ── */
.cursor-glow {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(89,61,143,0.10) 0%, transparent 70%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 0;
  transition: opacity 0.3s;
}

/* ── NAV ── */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  padding: 20px 60px;
  background: rgba(10,10,10,0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
#nav.scrolled { border-bottom-color: #2a2a2a; }

.nav-logo {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  letter-spacing: -0.04em;
  margin-right: auto;
}
.nav-logo span { color: var(--purple); }

.nav-links {
  list-style: none;
  display: flex;
  gap: 4px;
}
.nav-links a {
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  padding: 6px 10px;
  transition: color 0.2s;
}
.nav-links a:hover { color: #ffffff; }
.nav-links a.active { color: #ffffff; }

/* ── PAGE HEADER ── */
.page-header {
  padding: 160px 60px 80px;
  position: relative;
  z-index: 1;
  border-bottom: 1px solid var(--border);
}
.page-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--purple);
  margin-bottom: 16px;
}
.page-header h1 {
  font-size: clamp(48px, 5vw, 80px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
}
.page-header h1 span { color: var(--purple); }

/* ── GALLERY GRID ── */
.gallery-grid {
  columns: 4;
  column-gap: 3px;
  padding: 3px;
  position: relative;
  z-index: 1;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 3px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: #111;
}
.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  filter: grayscale(40%) brightness(0.75);
  transition: filter 0.35s, transform 0.35s;
}
.gallery-item:hover img {
  filter: grayscale(0%) brightness(1);
  transform: scale(1.04);
}
.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: rgba(89,61,143,0);
  transition: background 0.3s;
  pointer-events: none;
}
.gallery-item:hover .gallery-item-overlay {
  background: rgba(89,61,143,0.12);
}

/* ── EMPTY STATE ── */
.gallery-empty {
  column-span: all;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 120px 24px;
  text-align: center;
  gap: 16px;
}
.gallery-empty-icon {
  width: 64px;
  height: 64px;
  color: var(--border);
}
.gallery-empty h3 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.gallery-empty p {
  font-size: 14px;
  color: var(--gray);
}
.gallery-empty code {
  font-family: 'Courier New', monospace;
  font-size: 13px;
  background: rgba(89,61,143,0.08);
  color: var(--purple);
  padding: 2px 7px;
  border-radius: 3px;
}

/* ── LIGHTBOX ── */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.gallery-lightbox.open {
  opacity: 1;
  pointer-events: all;
}
.gallery-lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.96);
  backdrop-filter: blur(12px);
}
.gallery-lb-img-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 100px;
  z-index: 1;
}
.gallery-lb-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
.gallery-lb-close {
  position: absolute;
  top: 24px;
  right: 28px;
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.gallery-lb-close:hover { border-color: rgba(255,255,255,0.4); background: rgba(255,255,255,0.08); }
.gallery-lb-close svg { width: 18px; height: 18px; color: #fff; }

.gallery-lb-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 48px;
  height: 48px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.gallery-lb-nav-btn:hover { border-color: rgba(255,255,255,0.4); background: rgba(255,255,255,0.08); }
.gallery-lb-nav-btn:disabled { opacity: 0.2; cursor: default; }
.gallery-lb-nav-btn svg { width: 20px; height: 20px; color: #fff; }
.gallery-lb-prev { left: 20px; }
.gallery-lb-next { right: 20px; }

.gallery-lb-counter {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.4);
  white-space: nowrap;
}

/* ── FOOTER ── */
footer {
  padding: 32px 60px;
  background: #0a0a0a;
  border-top: 1px solid #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}
.footer-logo {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  letter-spacing: -0.03em;
}
.footer-logo span { color: var(--purple); }
.footer-copy { font-size: 12px; color: #888888; }
.footer-links { display: flex; gap: 28px; }
.footer-links a {
  font-size: 12px;
  color: #888888;
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links a:hover { color: #ffffff; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .gallery-grid { columns: 3; }
}
@media (max-width: 768px) {
  #nav { padding: 16px 24px; }
  .page-header { padding: 120px 24px 48px; }
  .gallery-grid { columns: 2; }
  .gallery-lb-img-wrap { padding: 60px 72px; }
  .gallery-lb-prev { left: 12px; }
  .gallery-lb-next { right: 12px; }
  footer { flex-direction: column; gap: 16px; padding: 28px 24px; text-align: center; }
  .footer-links { justify-content: center; }
}
