/* ===========================
   LIGHTBOX — Portfolio Gallery
   Light/dark mode · brand palette
=========================== */

/* ── Overlay ── */
.lb-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(14, 11, 9, 0.86);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.30s ease;
}
.lb-overlay.lb-open {
  opacity: 1;
  pointer-events: all;
}

/* ── Panel ── */
.lb-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 840px;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow:
    0 48px 96px rgba(0, 0, 0, 0.52),
    inset 0 1px 0 rgba(255, 255, 255, 0.10);
  transform: scale(0.92) translateY(24px);
  transition: transform 0.38s var(--spring);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.lb-overlay.lb-open .lb-panel {
  transform: scale(1) translateY(0);
}
.lb-panel::-webkit-scrollbar { width: 4px; }
.lb-panel::-webkit-scrollbar-track { background: transparent; }
.lb-panel::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

/* ── Header ── */
.lb-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  /* Subtle warm top glow on panel header */
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

.lb-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

/* Back button — hidden until single view */
.lb-back {
  display: none;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  padding: 6px 12px 6px 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 0.77rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.24s var(--spring);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  white-space: nowrap;
}
.lb-back:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(107, 79, 58, 0.22);
}
.lb-back.visible { display: flex; }
[data-theme="dark"] .lb-back { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05); }

.lb-meta { min-width: 0; }

.lb-category {
  display: block;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 3px;
}

.lb-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

/* Close button */
.lb-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.28s var(--spring);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 2px 8px rgba(107, 79, 58, 0.08);
}
.lb-close:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: rotate(90deg) scale(1.10);
  box-shadow: 0 6px 18px rgba(107, 79, 58, 0.28);
}
[data-theme="dark"] .lb-close {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 2px 8px rgba(0, 0, 0, 0.24);
}
[data-theme="dark"] .lb-close:hover {
  color: var(--bg);
  box-shadow: 0 6px 18px rgba(201, 160, 122, 0.28);
}

/* ── Grid View ── */
.lb-grid-view { padding: 20px 24px 6px; }

.lb-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.lb-thumb {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: zoom-in;
  aspect-ratio: 4 / 3;
  background: var(--surface-alt);
  /* Skeuomorphic raised look */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.60),
    0 4px 16px rgba(107, 79, 58, 0.10),
    0 0 0 1px rgba(107, 79, 58, 0.05);
  transition:
    transform 0.32s var(--spring),
    box-shadow 0.32s ease;
}
.lb-thumb:hover {
  transform: scale(1.025);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 12px 30px rgba(107, 79, 58, 0.18),
    0 0 0 1px rgba(107, 79, 58, 0.08),
    0 0 44px rgba(124, 92, 69, 0.10);
}
[data-theme="dark"] .lb-thumb {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 4px 16px rgba(0, 0, 0, 0.32),
    0 0 0 1px rgba(255, 255, 255, 0.04);
}
[data-theme="dark"] .lb-thumb:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 12px 30px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 0 44px rgba(201, 160, 122, 0.13);
}

.lb-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s var(--ease-out), filter 0.3s ease;
  filter: saturate(0.82);
}
.lb-thumb:hover img {
  transform: scale(1.07);
  filter: saturate(1.0);
}

/* Warm hover tint */
.lb-thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(107, 79, 58, 0);
  transition: background 0.28s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-thumb:hover .lb-thumb-overlay {
  background: rgba(107, 79, 58, 0.22);
}

/* Zoom icon */
.lb-zoom-icon {
  opacity: 0;
  transform: scale(0.65);
  transition: opacity 0.26s ease, transform 0.26s var(--spring);
  color: #fff;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.55));
}
.lb-thumb:hover .lb-zoom-icon {
  opacity: 1;
  transform: scale(1);
}

/* Caption bar on hover */
.lb-thumb-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 28px 12px 11px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.65), transparent);
  color: rgba(255, 255, 255, 0.94);
  font-size: 0.73rem;
  font-weight: 500;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.26s ease, transform 0.26s ease;
}
.lb-thumb:hover .lb-thumb-caption {
  opacity: 1;
  transform: translateY(0);
}

.lb-hint {
  text-align: center;
  font-size: 0.73rem;
  color: var(--text-muted);
  padding: 14px 0 20px;
  opacity: 0.7;
}

/* ── Single Image View ── */
.lb-single-view { display: none; }
.lb-single-view.visible { display: block; }

.lb-img-wrap {
  background: var(--surface);
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.lb-img-wrap img {
  width: 100%;
  max-height: 52vh;
  object-fit: contain;
  display: block;
}

/* Prev / Next controls */
.lb-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px 8px;
}

.lb-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.25s var(--spring);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 2px 8px rgba(107, 79, 58, 0.08);
}
.lb-nav-btn:hover:not(:disabled) {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.20),
    0 8px 20px rgba(107, 79, 58, 0.26);
}
.lb-nav-btn:disabled {
  opacity: 0.30;
  cursor: default;
}
[data-theme="dark"] .lb-nav-btn {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 2px 8px rgba(0, 0, 0, 0.24);
}
[data-theme="dark"] .lb-nav-btn:hover:not(:disabled) {
  color: var(--bg);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 8px 20px rgba(201, 160, 122, 0.26);
}

.lb-counter {
  font-size: 0.80rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.lb-caption {
  padding: 0 24px 24px;
  font-size: 0.83rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.55;
  margin: 0;
}

/* ── Text / accomplishments view ── */
.lb-text-view { display: none; padding: 24px 28px 28px; }

.lb-text-intro {
  font-size: 0.90rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.65;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.lb-text-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.lb-text-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.65;
  padding: 14px 18px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 2px 8px rgba(107, 79, 58, 0.06);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.lb-text-item::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 8px;
}
.lb-text-item:hover {
  border-color: rgba(124, 92, 69, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.70),
    0 4px 16px rgba(107, 79, 58, 0.10),
    0 0 32px rgba(124, 92, 69, 0.07);
}
[data-theme="dark"] .lb-text-item {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 2px 8px rgba(0, 0, 0, 0.22);
}
[data-theme="dark"] .lb-text-item:hover {
  border-color: rgba(201, 160, 122, 0.20);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 4px 16px rgba(0, 0, 0, 0.28),
    0 0 32px rgba(201, 160, 122, 0.09);
}

.lb-text-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--surface-alt);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  line-height: 1.55;
}
.lb-text-note svg { flex-shrink: 0; margin-top: 1px; color: var(--accent); }
.lb-text-note code {
  font-family: 'Courier New', monospace;
  font-size: 0.74rem;
  background: var(--bg);
  padding: 1px 4px;
  border-radius: 4px;
  color: var(--accent);
}

/* ── Projects view ── */
.lb-projects-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.lb-project-card {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.60),
    0 2px 12px rgba(107,79,58,0.07);
  overflow: hidden;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
  transition: box-shadow 0.28s ease, border-color 0.28s ease;
}
.lb-project-card:hover {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.70),
    0 6px 24px rgba(107,79,58,0.12);
}
[data-theme="dark"] .lb-project-card {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 2px 12px rgba(0,0,0,0.28);
}
[data-theme="dark"] .lb-project-card:hover {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.07),
    0 6px 24px rgba(0,0,0,0.38);
}

.lb-project-header {
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}

.lb-project-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 7px;
}
.lb-project-company {
  font-size: 0.70rem;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--accent);
}
.lb-project-sep {
  font-size: 0.70rem;
  color: var(--text-muted);
  opacity: 0.5;
}
.lb-project-duration {
  font-size: 0.70rem;
  font-weight: 600;
  color: var(--text-muted);
}
.lb-project-industry {
  font-size: 0.67rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 1px 8px;
  margin-left: 2px;
}

.lb-project-name {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin: 0 0 5px;
}

.lb-project-role {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.lb-project-overview {
  padding: 14px 20px 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0;
}

.lb-project-section {
  padding: 14px 20px 0;
}
.lb-project-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 8px;
}
.lb-project-outcomes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.lb-project-outcomes li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.55;
}
.lb-project-outcomes li::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 7px;
}

.lb-project-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 20px 16px;
}
.lb-project-tool {
  font-size: 0.70rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 3px 10px;
  letter-spacing: 0.02em;
}

@media (max-width: 768px) {
  .lb-projects-list    { gap: 12px; }
  .lb-project-header   { padding: 12px 14px 11px; }
  .lb-project-overview { padding: 11px 14px 0; font-size: 0.84rem; }
  .lb-project-section  { padding: 11px 14px 0; }
  .lb-project-tools    { padding: 9px 14px 13px; gap: 5px; }
  .lb-project-name     { font-size: 0.92rem; word-break: break-word; }
  .lb-project-outcomes li { font-size: 0.83rem; }
  .lb-project-industry { display: none; }
}
@media (max-width: 480px) {
  .lb-projects-list    { gap: 10px; }
  .lb-project-header   { padding: 10px 12px 10px; }
  .lb-project-overview { padding: 10px 12px 0; font-size: 0.81rem; }
  .lb-project-section  { padding: 10px 12px 0; }
  .lb-project-tools    { padding: 8px 12px 12px; gap: 4px; }
  .lb-project-name     { font-size: 0.86rem; }
  .lb-project-role     { font-size: 0.71rem; }
  .lb-project-outcomes li { font-size: 0.79rem; gap: 6px; }
  .lb-project-outcomes li::before { margin-top: 6px; }
  .lb-project-tool     { font-size: 0.65rem; padding: 2px 8px; }
}

/* ── Bento image grid view ── */
.lb-bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 220px 220px;
  gap: 10px;
  padding: 20px 24px 24px;
}

.lb-bento-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  cursor: zoom-in;
  background: var(--surface-alt);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.60),
    0 4px 16px rgba(107, 79, 58, 0.10),
    0 0 0 1px rgba(107, 79, 58, 0.05);
  transition: transform 0.32s var(--spring), box-shadow 0.32s ease;
}
.lb-bento-item:hover {
  transform: scale(1.02);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 12px 30px rgba(107, 79, 58, 0.18),
    0 0 0 1px rgba(107, 79, 58, 0.08);
}
[data-theme="dark"] .lb-bento-item {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 4px 16px rgba(0, 0, 0, 0.32),
    0 0 0 1px rgba(255, 255, 255, 0.04);
}
[data-theme="dark"] .lb-bento-item:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 12px 30px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* Bento positions — asymmetric layout for 4 images */
.lb-bento-item--1 { grid-column: 1 / 3; grid-row: 1; }
.lb-bento-item--2 { grid-column: 3;     grid-row: 1; }
.lb-bento-item--3 { grid-column: 1;     grid-row: 2; }
.lb-bento-item--4 { grid-column: 2 / 4; grid-row: 2; }

.lb-bento-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s var(--ease-out), filter 0.3s ease;
  filter: saturate(0.88);
}
.lb-bento-item:hover img {
  transform: scale(1.06);
  filter: saturate(1.0);
}

.lb-bento-overlay {
  position: absolute;
  inset: 0;
  background: rgba(107, 79, 58, 0);
  transition: background 0.28s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-bento-item:hover .lb-bento-overlay {
  background: rgba(107, 79, 58, 0.22);
}
.lb-bento-item .lb-zoom-icon {
  opacity: 0;
  transform: scale(0.65);
  transition: opacity 0.26s ease, transform 0.26s var(--spring);
  color: #fff;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.55));
}
.lb-bento-item:hover .lb-zoom-icon {
  opacity: 1;
  transform: scale(1);
}

.lb-bento-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 28px 12px 11px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.65), transparent);
  color: rgba(255, 255, 255, 0.94);
  font-size: 0.73rem;
  font-weight: 500;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.26s ease, transform 0.26s ease;
}
.lb-bento-item:hover .lb-bento-caption {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 600px) {
  .lb-bento-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: 160px 160px;
    gap: 8px;
    padding: 14px 14px 18px;
  }
  .lb-bento-item--1 { grid-column: 1 / 3; grid-row: 1; }
  .lb-bento-item--2 { grid-column: 1;     grid-row: 2; }
  .lb-bento-item--3 { grid-column: 2;     grid-row: 2; }
  .lb-bento-item--4 { grid-column: 1 / 3; grid-row: 3; }
  .lb-bento-grid { grid-template-rows: 160px 160px 160px; }
}

/* ── Websites showcase view ── */
.lb-websites-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 0 20px 24px;
}

.lb-web-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(107,79,58,0.07);
  transition: transform 0.30s var(--spring), box-shadow 0.30s ease;
}
.lb-web-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(107,79,58,0.14);
}
[data-theme="dark"] .lb-web-card {
  box-shadow: 0 2px 10px rgba(0,0,0,0.28);
}
[data-theme="dark"] .lb-web-card:hover {
  box-shadow: 0 10px 28px rgba(0,0,0,0.42);
}

/* Browser chrome bar */
.lb-web-chrome {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}
.lb-web-dots {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.lb-web-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.lb-web-dots span:nth-child(1) { background: #FF5F57; }
.lb-web-dots span:nth-child(2) { background: #FEBC2E; }
.lb-web-dots span:nth-child(3) { background: #28C840; }

.lb-web-bar {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 2px 10px;
  font-size: 0.63rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Screenshot area */
.lb-web-preview {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--surface-alt);
  overflow: hidden;
}
.lb-web-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 0.45s var(--ease-out);
}
.lb-web-card:hover .lb-web-preview img { transform: scale(1.04); }

/* Fallback shown when screenshot fails */
.lb-web-fallback {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--surface-alt);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  text-align: center;
  padding: 16px;
}
.lb-web-failed img         { display: none; }
.lb-web-failed .lb-web-fallback { display: flex; }

/* Footer */
.lb-web-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}
.lb-web-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.lb-web-info strong {
  font-size: 0.80rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lb-web-info span {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.lb-web-visit {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  font-size: 0.70rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--surface-alt);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: 5px 12px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.22s ease, color 0.22s ease, border-color 0.22s ease;
}
.lb-web-visit:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
[data-theme="dark"] .lb-web-visit:hover { color: var(--bg); }

@media (max-width: 600px) {
  .lb-websites-grid {
    grid-template-columns: 1fr;
    padding: 0 12px 20px;
  }
}

/* ── Portfolio card: click target + CTA ── */
.portfolio-card[data-gallery] {
  cursor: pointer;
}

.portfolio-card-gallery-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  align-self: flex-start;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--surface-alt);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: 8px 16px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.60),
    0 2px 8px rgba(107, 79, 58, 0.08);
  transition:
    background 0.28s var(--spring),
    color 0.28s ease,
    border-color 0.28s ease,
    gap 0.22s var(--spring),
    box-shadow 0.28s ease,
    transform 0.28s var(--spring);
  user-select: none;
}
.portfolio-card:hover .portfolio-card-gallery-cta {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  gap: 10px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 6px 18px rgba(107, 79, 58, 0.28);
  transform: translateY(-1px);
}
.portfolio-card-gallery-cta svg {
  flex-shrink: 0;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}
.portfolio-card:hover .portfolio-card-gallery-cta svg {
  opacity: 1;
}
[data-theme="dark"] .portfolio-card-gallery-cta {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 2px 8px rgba(0, 0, 0, 0.22);
}
[data-theme="dark"] .portfolio-card:hover .portfolio-card-gallery-cta {
  color: var(--bg);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    0 6px 18px rgba(201, 160, 122, 0.28);
}

/* ── Tablet / large mobile (≤ 768px) — bottom sheet ── */
@media (max-width: 768px) {
  /* Slide up from bottom instead of center-scale */
  .lb-overlay {
    align-items: flex-end;
    justify-content: center;
    padding: 0;
  }

  .lb-panel {
    width: 100%;
    max-width: 100%;
    max-height: 88vh;
    border-radius: 22px 22px 0 0;
    border-bottom: none;
    overflow-x: hidden;
    /* Slide up animation */
    transform: translateY(56px);
  }
  .lb-overlay.lb-open .lb-panel {
    transform: translateY(0);
  }

  /* Drag handle visual hint */
  .lb-panel::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    margin: 12px auto 0;
  }

  .lb-header {
    padding: 12px 18px 14px;
    position: sticky;
    top: 0;
  }

  .lb-title { font-size: 0.92rem; }
  .lb-back  { font-size: 0.76rem; padding: 6px 10px 6px 6px; }

  /* Grid: 2 columns still fine on tablet */
  .lb-grid { gap: 10px; }
  .lb-grid-view { padding: 14px 18px 4px; }

  /* Bigger tap targets for nav buttons */
  .lb-nav-btn {
    padding: 11px 20px;
    min-height: 44px;
    font-size: 0.82rem;
  }
  .lb-close {
    width: 40px;
    height: 40px;
  }

  .lb-controls { padding: 14px 18px 8px; }
  .lb-caption  { padding: 0 18px 22px; }

  /* Image shorter on mobile */
  .lb-img-wrap img { max-height: 42vh; }

  /* Text / projects view */
  .lb-text-view { padding: 14px 12px 24px; }
  .lb-text-item { padding: 12px 14px; font-size: 0.88rem; }
}

/* ── Small mobile (≤ 480px) — single column, tighter ── */
@media (max-width: 480px) {
  .lb-panel {
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
  }

  /* Single column thumbnails */
  .lb-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .lb-header { padding: 10px 14px 12px; gap: 8px; }
  .lb-title  { font-size: 0.84rem; }
  .lb-back   { font-size: 0.72rem; padding: 5px 8px 5px 5px; }
  .lb-close  { width: 36px; height: 36px; }

  .lb-grid-view { padding: 12px 14px 4px; }
  .lb-hint      { padding: 10px 0 14px; font-size: 0.70rem; }

  /* Thumb aspect ratio stays 4/3 — images full width */
  .lb-thumb { aspect-ratio: 16 / 9; }

  /* Tall enough to tap, small enough to show context */
  .lb-nav-btn { padding: 10px 14px; font-size: 0.77rem; min-height: 44px; }
  .lb-controls { padding: 12px 14px 8px; }
  .lb-counter  { font-size: 0.75rem; }
  .lb-caption  { padding: 0 14px 18px; font-size: 0.80rem; }

  .lb-img-wrap img { max-height: 36vh; }

  /* Text / projects view */
  .lb-text-view  { padding: 12px 10px 20px; }
  .lb-text-item  { padding: 11px 12px; font-size: 0.84rem; gap: 8px; }
  .lb-text-intro { font-size: 0.82rem; margin-bottom: 12px; padding-bottom: 10px; }
  .lb-text-note  { font-size: 0.74rem; padding: 10px 12px; }
}
