/* ============================================================
   A CLUSTERED SPACE — Portfolio CSS
   Design reference: jaypotts.online
   ============================================================ */

/* ---------- RESET & BASE ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #f0f0f4;
  --white: #ffffff;
  --black: #000000;
  --text: #111111;
  --text-muted: #555555;
  --border: 1px solid #000000;
  --font: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --header-h: 64px;
  --grid-gap: 8px;
  --transition: 0.22s ease;
}

html {
  font-family: var(--font);
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- HEADER / NAV ---------- */
#site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.logo {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.logo:hover { opacity: 0.65; }

#site-nav {
  display: flex;
  gap: 28px;
}

.nav-link {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: opacity var(--transition);
}

.nav-link:hover,
.nav-link.active {
  opacity: 0.5;
}

/* ---------- MAIN & VIEWS ---------- */
#app {
  flex: 1;
  margin-top: var(--header-h);
  padding: 16px 16px 0;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* ---------- MASONRY GRID ---------- */
.masonry-grid {
  columns: 6;
  column-gap: var(--grid-gap);
  padding-bottom: 40px;
}

.grid-item {
  break-inside: avoid;
  margin-bottom: var(--grid-gap);
  border: var(--border);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: block;
}

.grid-item img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.4s ease;
}

.grid-item:hover img {
  transform: scale(1.02);
}

/* Hover overlay */
.grid-item-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px;
  opacity: 0;
  transition: opacity var(--transition);
}

.grid-item:hover .grid-item-overlay {
  opacity: 1;
}

.grid-item-title {
  color: var(--white);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.3;
}

.grid-item-category {
  color: rgba(255,255,255,0.65);
  font-size: 10px;
  letter-spacing: 0.05em;
  margin-top: 3px;
}

/* ---------- PROJECT DETAIL ---------- */
.project-detail-inner {
  max-width: 960px;
  margin: 0 auto;
  padding-bottom: 80px;
}

.back-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--text);
  padding: 20px 0 28px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: opacity var(--transition);
}

.back-btn:hover { opacity: 0.5; }
.back-arrow { font-size: 16px; }

#project-header {
  border-top: var(--border);
  border-bottom: var(--border);
  padding: 20px 0;
  margin-bottom: 20px;
}

#project-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.project-meta {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  line-height: 1.6;
}

.project-caption {
  font-size: 13px;
  line-height: 1.8;
  color: var(--text);
  max-width: 680px;
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: var(--border);
}

/* Project images — single column, full width, with borders */
.project-images-grid {
  display: flex;
  flex-direction: column;
  gap: var(--grid-gap);
}

.project-image-item {
  border: var(--border);
  cursor: pointer;
  overflow: hidden;
}

.project-image-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.4s ease;
}

.project-image-item:hover img {
  transform: scale(1.01);
}

/* ---------- ABOUT ---------- */
.about-inner {
  display: flex;
  gap: 60px;
  align-items: flex-start;
  max-width: 900px;
  margin: 40px auto;
  padding-bottom: 80px;
}

.about-portrait {
  flex-shrink: 0;
  width: 320px;
}

.portrait-img {
  width: 100%;
  display: block;
  border: var(--border);
  object-fit: cover;
}

.about-text {
  flex: 1;
  padding-top: 12px;
}

.about-text h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.about-title {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: var(--border);
}

.about-bio {
  font-size: 13px;
  line-height: 1.9;
  color: var(--text);
  margin-bottom: 16px;
}

/* ---------- CONTACT ---------- */
.contact-inner {
  max-width: 480px;
  margin: 60px auto;
  padding-bottom: 80px;
}

.contact-inner h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: var(--border);
  padding-bottom: 16px;
  margin-bottom: 28px;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}

.contact-link {
  font-size: 13px;
  letter-spacing: 0.03em;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
  display: inline-block;
}

.contact-link:hover {
  border-bottom-color: var(--black);
}

.contact-note {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ---------- FOOTER ---------- */
#site-footer {
  padding: 20px 24px;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  border-top: var(--border);
}

/* ---------- LIGHTBOX ---------- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0,0,0,0.93);
  align-items: center;
  justify-content: center;
}

.lightbox.open {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.lightbox-img-wrap {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img-wrap img {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 28px;
  cursor: pointer;
  padding: 16px;
  transition: color 0.2s;
  z-index: 1001;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover { color: white; }

.lightbox-close { top: 16px; right: 20px; font-size: 22px; }
.lightbox-prev  { left: 16px; top: 50%; transform: translateY(-50%); font-size: 44px; }
.lightbox-next  { right: 16px; top: 50%; transform: translateY(-50%); font-size: 44px; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1200px) {
  .masonry-grid { columns: 5; }
}
@media (max-width: 960px) {
  .masonry-grid { columns: 4; }
  .about-inner { flex-direction: column; gap: 32px; }
  .about-portrait, .portrait-placeholder { width: 100%; height: auto; min-height: 300px; }
}
@media (max-width: 720px) {
  .masonry-grid { columns: 3; }
  #site-header { padding: 0 16px; }
  #site-nav { gap: 18px; }
}
@media (max-width: 500px) {
  .masonry-grid { columns: 2; }
  .logo { font-size: 11px; }
  .project-detail-inner { padding: 0 4px 60px; }
}
@media (max-width: 340px) {
  .masonry-grid { columns: 1; }
}
