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

:root {
  --bg:      #1c1b1b;   /* warm charcoal — not harsh black */
  --surface: #272626;   /* card placeholder while images load */
  --border:  rgba(255 255 255 / 0.09);
  --text:    #d4d1ce;   /* soft, slightly warm off-white */
  --muted:   #706e6b;   /* mid-grey, clearly secondary */
  --font:    system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html { scroll-behavior: smooth; }

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

a { color: inherit; text-decoration: none; }
img { display: block; }

/* ── Site Header ─────────────────────────────────────────────────────────────── */
.site-header {
  padding: 3rem 2rem 2.2rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.site-header a { display: block; }

.site-header-photo {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto 1.1rem;
  border: 1px solid rgba(255 255 255 / 0.12);
  opacity: 0.88;
}

.site-title {
  font-size: clamp(1.4rem, 5vw, 3rem);
  font-weight: 200;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  line-height: 1.2;
}

.site-subtitle {
  margin-top: 0.6rem;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Site Header — compact (inner pages) ─────────────────────────────────────── */
.site-header--compact {
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  gap: 0;
}

.site-header--compact a {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
  text-align: left;
}

.site-header--compact .site-header-photo {
  width: 38px;
  height: 38px;
  margin: 0;
}

.site-header--compact .site-title {
  font-size: clamp(0.85rem, 2vw, 1.05rem);
  letter-spacing: 0.22em;
  line-height: 1.2;
}

.site-header--compact .site-subtitle {
  margin-top: 0.15rem;
  font-size: 0.63rem;
}

.site-header--compact .site-nav {
  margin-top: 0;
  margin-left: auto;
}

/* ── Site Nav ────────────────────────────────────────────────────────────────── */
.site-nav {
  margin-top: 1.4rem;
  display: flex;
  gap: 2rem;
  justify-content: center;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.site-nav a {
  color: var(--muted);
  transition: color 0.2s;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--text);
  border-bottom-color: var(--text);
}

/* ── Breadcrumb ──────────────────────────────────────────────────────────────── */
.breadcrumb {
  padding: 1.1rem 2rem;
  font-size: 0.78rem;
  letter-spacing: 0.07em;
  color: var(--muted);
  display: flex;
  gap: 0.5rem;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.breadcrumb a:hover { color: var(--text); transition: color 0.2s; }
.breadcrumb-sep { opacity: 0.25; }

/* ── Index description (inside site header) ──────────────────────────────────── */
.index-description {
  margin-top: 1.1rem;
  text-align: center;
}

.index-description p {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text);
  line-height: 1.8;
  max-width: min(72ch, 90vw);
  margin: 0 auto;
  letter-spacing: 0.02em;
}

/* ── Gallery Index — shared ──────────────────────────────────────────────────── */
.galleries {
  flex: 1;
  gap: 3px;
  padding: 3px;
}

/* ── Gallery Index — carousel wrapper & nav buttons ─────────────────────────── */
.carousel-wrap {
  position: relative;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(28, 27, 27, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  font-size: 2rem;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.carousel-btn:hover {
  background: rgba(45, 43, 43, 0.95);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
}

.carousel-btn--prev { left:  0.65rem; }
.carousel-btn--next { right: 0.65rem; }

.carousel-btn[hidden] { display: none; }

/* hide on touch screens — users swipe instead */
@media (hover: none) {
  .carousel-btn { display: none; }
}

.galleries.layout-carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  align-items: flex-start;
  scroll-padding-inline-start: 3px;
}

.galleries.layout-carousel::-webkit-scrollbar       { height: 3px; }
.galleries.layout-carousel::-webkit-scrollbar-track { background: transparent; }
.galleries.layout-carousel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.galleries.layout-carousel .gallery-card {
  flex: 0 0 min(460px, 88vw);
  scroll-snap-align: start;
}

/* ── Gallery Index — grid ────────────────────────────────────────────────────── */
.galleries.layout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.gallery-card {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  cursor: pointer;
  background: var(--surface);
}

.gallery-card-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease, filter 0.4s ease;
}

.gallery-card:hover .gallery-card-img {
  transform: scale(1.04);
  filter: brightness(0.7);
}

.gallery-card-info {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, transparent 60%);
  transition: background 0.3s;
}

.gallery-card:hover .gallery-card-info {
  background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, transparent 70%);
}

.gallery-card-name {
  font-size: 1rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  line-height: 1.3;
}

.gallery-card-count {
  margin-top: 0.3rem;
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  color: rgba(255,255,255,0.45);
}

/* ── Shimmer loading animation ───────────────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}

.gallery-card::before,
.photo-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 25%,
    rgba(255, 255, 255, 0.055) 50%,
    transparent 75%
  );
  background-size: 400% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
  pointer-events: none;
}

.gallery-card.img-loaded::before,
.photo-item.img-loaded::before {
  display: none;
}

/* ── Gallery Page Header ─────────────────────────────────────────────────────── */
.gallery-header {
  padding: 2rem 2rem 1.5rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.gallery-title {
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gallery-description {
  margin-top: 0.6rem;
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--text);
  max-width: 90ch;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.8;
}

/* ── Photo layouts — shared base ─────────────────────────────────────────────── */
.photos { flex: 1; }

.photo-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: var(--surface);
}

.photo-item img {
  display: block;
  transition: transform 0.4s ease, filter 0.3s ease;
}

.photo-item:hover img { filter: brightness(0.75); }

/* ── Grid layout ─────────────────────────────────────────────────────────────── */
.layout-grid {
  padding: 3px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 3px;
  align-content: start;
}

.layout-grid .photo-item { aspect-ratio: 3/2; }

.layout-grid .photo-item img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.layout-grid .photo-item:hover img { transform: scale(1.03); }

/* ── Masonry layout ──────────────────────────────────────────────────────────── */
.layout-masonry {
  columns: 3;
  column-gap: 3px;
  padding: 3px;
  display: block;
}

.layout-masonry .photo-item {
  break-inside: avoid;
  margin-bottom: 3px;
  display: block;
}

.layout-masonry .photo-item img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.layout-masonry .photo-item:hover img { transform: scale(1.02); }

/* ── Carousel layout ─────────────────────────────────────────────────────────── */
.layout-carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  gap: 3px;
  padding: 3px;
  height: 64vh;
  min-height: 320px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.layout-carousel::-webkit-scrollbar { height: 3px; }
.layout-carousel::-webkit-scrollbar-track { background: transparent; }
.layout-carousel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.layout-carousel .photo-item {
  flex: 0 0 auto;
  height: 100%;
  scroll-snap-align: start;
}

.layout-carousel .photo-item img {
  height: 100%;
  width: auto;
  max-width: 88vw;
  object-fit: cover;
}

.layout-carousel .photo-item:hover img { transform: scale(1.02); }

/* ── Footer ──────────────────────────────────────────────────────────────────── */
footer {
  padding: 2rem 2rem 2.5rem;
  text-align: center;
  border-top: 1px solid var(--border);
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.footer-social {
  display: flex;
  gap: 1.1rem;
  align-items: center;
}

.footer-social-link {
  color: var(--muted);
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.footer-social-link:hover { color: var(--text); }

.footer-copy {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.footer-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  opacity: 0.5;
  flex-shrink: 0;
}

/* ── Lightbox ────────────────────────────────────────────────────────────────── */
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(12,11,11,0.97);
  z-index: 9999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

#lightbox.open { display: flex; }

.lb-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  max-height: calc(100vh - 7rem);
}

#lb-img {
  max-width: min(90vw, calc(100vh - 9rem) * 2);
  max-height: calc(100vh - 9rem);
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.25s ease;
  user-select: none;
  -webkit-user-drag: none;
}

#lb-img.loaded { opacity: 1; }

.lb-caption {
  flex-shrink: 0;
  min-height: 3.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  text-align: center;
  padding: 0.5rem 5rem;
}

.lb-title {
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.8);
}

.lb-date {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.06em;
}

.lb-desc {
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
  max-width: 55ch;
  line-height: 1.6;
}

.lb-btn {
  position: fixed;
  background: none;
  border: none;
  color: rgba(255,255,255,0.35);
  cursor: pointer;
  transition: color 0.2s;
  padding: 0.75rem;
  line-height: 1;
}
.lb-btn:hover { color: rgba(255,255,255,0.9); }

#lb-close {
  top: 0.6rem;
  right: 0.6rem;
  font-size: 2rem;
  padding: 1rem;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  line-height: 1;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
#lb-prev  { top: 50%; left:  0.5rem; transform: translateY(-50%); font-size: 2.2rem; }
#lb-next  { top: 50%; right: 0.5rem; transform: translateY(-50%); font-size: 2.2rem; }

.lb-counter {
  position: fixed;
  top: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.2);
  pointer-events: none;
}

/* ── Content Pages (about, resume, etc.) ────────────────────────────────────── */
.page-content {
  max-width: 680px;
  margin: 3rem auto 5rem;
  padding: 0 2rem;
}

.page-content:has(.about-columns) {
  max-width: 1080px;
}

/* ── About two-column layout ────────────────────────────────────────────────── */
.about-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
}

.about-col > h2:first-child {
  margin-top: 0;
}

.about-columns h2 {
  font-size: 1.6rem;
  font-weight: 200;
  letter-spacing: 0.12em;
  color: var(--text);
  margin: 0 0 1.8rem;
  text-transform: uppercase;
}

.page-headshot {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 2rem;
  opacity: 0.92;
}

.page-content h1 {
  font-size: 1.3rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.page-content h2 {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 3rem 0 1.2rem;
}

.page-content h3 {
  font-size: 0.97rem;
  font-weight: 400;
  color: var(--text);
  margin: 2.2rem 0 0.2rem;
  line-height: 1.5;
}

.page-content p {
  font-size: 0.93rem;
  line-height: 1.9;
  color: var(--text);
  margin-bottom: 0.9rem;
}

.page-content p em {
  font-style: normal;
  font-size: 0.82rem;
  color: var(--muted);
  display: block;
  margin-bottom: 0.4rem;
}

.page-content ul {
  margin: 0.6rem 0 1rem 0;
  list-style: none;
}

.page-content li {
  font-size: 0.9rem;
  line-height: 1.85;
  color: var(--text);
  padding-left: 1rem;
  position: relative;
}

.page-content li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--muted);
}

.page-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

.page-content a {
  border-bottom: 1px dotted rgba(212, 209, 206, 0.45);
  transition: color 0.2s, border-color 0.2s;
}
.page-content a:hover {
  color: var(--text);
  border-bottom-color: var(--text);
}

.page-content strong { font-weight: 500; }

.page-content code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.85em;
  background: var(--surface);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

/* ── Resume job entries ──────────────────────────────────────────────────────── */
.job-group {
  margin: 2rem 0 2.8rem;
}

.job-company {
  margin-bottom: 0.8rem;
}

.job-roles {
  border-left: 2px solid var(--border);
  padding-left: 1.5rem;
}

.job-company strong {
  font-size: 0.97rem;
  font-weight: 500;
  color: var(--text);
}

.job-meta {
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.03em;
  margin-top: 0.2rem;
}

.job-single {
  margin: 2rem 0 2.8rem;
}

.job-role + .job-role {
  margin-top: 1.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
}

.job-role-hd {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}

.job-title {
  font-size: 0.97rem;
  font-weight: 400;
  color: var(--text);
}

.job-dates {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ── Gallery prev/next navigation ────────────────────────────────────────────── */
.gallery-nav {
  display: flex;
  align-items: center;
  padding: 1.4rem 2rem;
  border-top: 1px solid var(--border);
  gap: 1rem;
}

.gallery-nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s;
  max-width: 45%;
  line-height: 1.4;
}

.gallery-nav-link:hover { color: var(--text); }

.gallery-nav-link--next { margin-left: auto; text-align: right; }

.gallery-nav-arrow { font-size: 1rem; flex-shrink: 0; }

/* ── Resume contact line ─────────────────────────────────────────────────────── */
.resume-contact {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.resume-contact a { color: var(--text); }

.resume-contact-sep { opacity: 0.4; }

.print-btn {
  float: right;
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.38rem 0.85rem;
  cursor: pointer;
  border-radius: 3px;
  transition: color 0.2s, border-color 0.2s;
}

.print-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.3); }

/* ── Empty state ─────────────────────────────────────────────────────────────── */
.empty {
  grid-column: 1/-1;
  padding: 5rem 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  letter-spacing: 0.06em;
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .site-header         { padding: 1.4rem 1rem 1.2rem; }
  .site-header--compact { padding: 0.6rem 1rem; gap: 0; }
  .site-header--compact .site-nav { gap: 1rem; font-size: 0.65rem; }
  /* 80vw cards leave a 20vw peek of the next card */
  .galleries.layout-carousel .gallery-card { flex: 0 0 80vw; }
  /* trailing spacer = peek width, so the last card can scroll to its snap point */
  .galleries.layout-carousel::after { content: ''; flex: 0 0 20vw; flex-shrink: 0; }
  .galleries.layout-carousel { scrollbar-width: none; }
  .galleries.layout-carousel::-webkit-scrollbar { display: none; }
  .layout-grid         { grid-template-columns: repeat(2, 1fr); gap: 2px; padding: 2px; }
  .layout-masonry      { columns: 2; }
  .layout-carousel     { height: 46vh; min-height: 220px; }
  #lb-prev             { left: 0; }
  #lb-next             { right: 0; }
  .lb-caption          { padding: 0.5rem 3rem; }
}

/* ── Print styles (resume) ───────────────────────────────────────────────────── */
@media print {
  .site-header, .breadcrumb, footer, .print-btn, .site-nav { display: none !important; }

  body { background: #fff; color: #111; font-size: 10pt; }

  .page-content { margin: 0; padding: 0; max-width: none; }
  .page-content h2 { color: #555; }
  .page-content p, .page-content li { color: #111; font-size: 9.5pt; line-height: 1.6; }
  .page-content a { color: #111; border-bottom: none; }
  .page-content strong { color: #111; }

  .job-title { color: #111; }
  .job-meta, .job-dates { color: #555; }
  .job-company strong { color: #111; }
  .job-roles { border-left-color: #ccc; }
  .job-role + .job-role { border-top-color: #eee; }
  .job-group, .job-single { break-inside: avoid; }

  .resume-contact { color: #555; }
  .resume-contact a { color: #111; }
  .page-headshot { display: none; }
}

@media (max-width: 380px) {
  .galleries       { grid-template-columns: 1fr; }
  .layout-grid     { grid-template-columns: 1fr; }
  .layout-masonry  { columns: 1; }
}

@media (max-width: 720px) {
  .about-columns   { grid-template-columns: 1fr; gap: 2.5rem; }
}
