/* ---------- Base ---------- */

:root {
  --bg: #0a0a0a;
  --ink: #f2f2ee;
  --dim: rgba(242,242,238,0.55);
  --overlay: rgba(0,0,0,0.86);
  --gap: 0px;
  --cols-desktop: 7;
  --cols-mobile: 2; /* also used for tablet — see .grid comment below */
  --font: 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
}

button {
  font-family: inherit;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
}

a { color: inherit; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Visible keyboard focus throughout */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ---------- Top bar ---------- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  pointer-events: none; /* let the grid sit under it; children re-enable */
}

.wordmark {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  pointer-events: auto;
}

.learn-btn {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 6px 4px;
  pointer-events: auto;
}

.learn-btn:hover { color: var(--dim); }

/* ---------- The wall / grid ---------- */

/* Two columns from phone through tablet — this is what keeps every
   row complete (2 divides evenly into any even image count). Desktop
   jumps straight to 7, so choose a total image count divisible by
   both 2 and 7 (e.g. 14, 28, 42, 56) to avoid a leftover part-row on
   any screen size. */
.grid {
  display: grid;
  grid-template-columns: repeat(var(--cols-mobile), 1fr);
  gap: var(--gap);
  width: 100%;
}

@media (min-width: 1100px) {
  .grid { grid-template-columns: repeat(var(--cols-desktop), 1fr); }
}

.cell {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #050505;
}

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

.cell .cell-label {
  position: absolute;
  left: 8px;
  bottom: 8px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  transition: opacity 0.15s ease;
}

.cell:hover .cell-label,
.cell:focus-within .cell-label {
  opacity: 1;
}

.cell:hover img,
.cell:focus-within img {
  opacity: 0.9;
}

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

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.lightbox[hidden] { display: none; }

.lightbox-img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
}

.lightbox-caption {
  position: absolute;
  bottom: 28px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  font-size: 28px;
  line-height: 1;
  color: var(--ink);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 40px;
  line-height: 1;
  color: var(--ink);
  padding: 10px 16px;
}

.lightbox-nav:hover { color: var(--dim); }
.lightbox-prev { left: 6px; }
.lightbox-next { right: 6px; }

/* ---------- Learn overlay ---------- */

.learn-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(1px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  overflow-y: auto;
}

.learn-overlay[hidden] { display: none; }

.learn-content {
  max-width: 640px;
  width: 100%;
}

.learn-content h1 {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 400;
  margin: 0 0 22px;
  color: var(--ink);
}

.learn-content p {
  font-size: 18px;
  line-height: 1.55;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 28px;
}

.learn-links {
  font-size: 12px !important;
  letter-spacing: 0.12em !important;
  color: var(--dim) !important;
  display: flex;
  gap: 10px;
  align-items: center;
}

.learn-links a { text-decoration: none; }
.learn-links a:hover { text-decoration: underline; }

.learn-close {
  position: absolute;
  top: 18px;
  right: 22px;
  font-size: 28px;
  line-height: 1;
  color: var(--ink);
}

/* Smaller body copy on narrow screens so the caps paragraph doesn't
   overwhelm a phone */
@media (max-width: 640px) {
  .learn-content p { font-size: 15px; }
}
