:root {
  /* All-black editorial gallery palette */
  --bg-canvas: #000000;
  --bg-surface: #0c0c0c;
  --bg-surface-hover: #181818;
  --bg-card: #0b0b0b;
  --bg-input: #141414;
  --mat-white: #ffffff;

  --border-soft: #1f1f1f;
  --border-strong: #383838;

  --ink-primary: #ffffff;
  --ink-secondary: #a1a1a1;
  --ink-muted: #6b6b6b;

  --accent: #ffffff;
  --accent-ink: #000000;
  --accent-hover: #e4e4e4;

  --status-ok: #94c9a9;
  --status-warn: #e0b084;
  --status-error: #e58b8b;

  --shadow-card: 0 8px 28px rgba(0, 0, 0, 0.55);

  --radius-sm: 4px;
  --radius-md: 8px;

  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

html {
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background-color: var(--bg-canvas);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =========================================
   Public Portfolio: Sidebar + Cover Flow
   ========================================= */
.portfolio-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
  max-width: 1680px;
  margin: 0 auto;
}

.sidebar {
  width: 224px;
  flex: 0 0 224px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 34px 24px 28px clamp(20px, 2.5vw, 36px);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  color: var(--ink-primary);
}

.sidebar-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1;
}

.sidebar-filters {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-group-label {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.sidebar-group-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-filter-link {
  text-decoration: none;
  color: var(--ink-secondary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.4;
  transition: color 0.15s ease;
}

.sidebar-filter-link:hover {
  color: var(--ink-primary);
}

.sidebar-filter-link.is-active {
  color: var(--ink-primary);
  font-weight: 600;
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-social {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-secondary);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  transition: color 0.15s ease;
}

.sidebar-social:hover {
  color: var(--ink-primary);
}

.sidebar-colophon {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* Main Cover Flow stage */
.gallery-main {
  flex: 1;
  min-width: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px clamp(16px, 3vw, 40px) 24px 8px;
  overflow: hidden;
}

.coverflow-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 0;
  width: 100%;
  user-select: none;
  -webkit-user-select: none;
}

.coverflow-viewport {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 360px;
  overflow: hidden;
  touch-action: pan-y;
}

.cf-card {
  position: absolute;
  left: 50%;
  top: 50%;
  margin: 0;
  transition:
    transform 420ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 320ms ease;
  will-change: transform, opacity;
}

.cf-edge-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  width: 44px;
  height: 72px;
  background: transparent;
  border: none;
  color: var(--ink-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.45;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.cf-edge-btn::before {
  content: "";
  position: absolute;
  top: 16px;
  bottom: 16px;
  width: 1px;
  background: rgba(255, 255, 255, 0.16);
}

.cf-edge-prev {
  left: 12px;
}

.cf-edge-prev::before {
  right: 4px;
}

.cf-edge-next {
  right: 12px;
}

.cf-edge-next::before {
  left: 4px;
}

@media (hover: hover) {
  .cf-edge-btn:hover:not(:disabled) {
    opacity: 1;
  }

  .cf-edge-prev:hover:not(:disabled) {
    transform: translateY(-50%) translateX(-2px);
  }

  .cf-edge-next:hover:not(:disabled) {
    transform: translateY(-50%) translateX(2px);
  }
}

.cf-edge-btn.is-hidden,
.cf-edge-btn:disabled {
  opacity: 0;
  pointer-events: none;
}

.cf-card .photo-mat {
  background: var(--mat-white);
  padding: clamp(8px, 1.3vw, 18px);
  display: inline-block;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.85);
}

.cf-card.is-active .photo-mat {
  box-shadow:
    0 38px 96px rgba(0, 0, 0, 0.96),
    0 0 0 1px rgba(255, 255, 255, 0.08);
}

.photo-frame {
  position: relative;
  overflow: hidden;
}

.photo-frame:focus {
  outline: none;
}

.cf-card .photo-img {
  display: block;
  max-height: 78vh;
  max-width: min(calc(100vw - 410px), 960px);
  width: auto;
  height: auto;
  pointer-events: none;
}

.photo-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px 14px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffffff;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.overlay-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}

.overlay-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.meta-icon {
  flex-shrink: 0;
  opacity: 0.82;
}

.overlay-place {
  color: rgba(255, 255, 255, 0.8);
}

@media (hover: hover) {
  .cf-card.is-active:hover .photo-overlay,
  .cf-card.is-active:focus-within .photo-overlay {
    opacity: 1;
    transform: translateY(0);
  }
}

.cf-card.is-active.is-revealed .photo-overlay {
  opacity: 1;
  transform: translateY(0);
}

/* Cover Flow bottom controls */
.cf-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: min(520px, 90%);
  padding: 14px 0 6px;
  flex-shrink: 0;
}

.cf-mobile-btn {
  display: none;
  background: transparent;
  color: var(--ink-secondary);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.cf-mobile-btn:hover:not(:disabled) {
  color: var(--ink-primary);
  border-color: var(--border-strong);
}

.cf-mobile-btn:disabled {
  opacity: 0.22;
  cursor: default;
}

.cf-nav-btn {
  background: transparent;
  color: var(--ink-secondary);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.cf-nav-btn:hover:not(:disabled) {
  color: var(--ink-primary);
  border-color: var(--border-strong);
}

.cf-nav-btn:disabled {
  opacity: 0.25;
  cursor: default;
}

.cf-scrubber {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  min-width: 100px;
  height: 2px;
  background: #262626;
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}

.cf-scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.cf-scrubber::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

.cf-scrubber::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: none;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
}

.cf-counter {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--ink-secondary);
  white-space: nowrap;
  min-width: 58px;
  text-align: center;
}

/* Mobile / narrow screens */
@media (max-width: 860px) {
  .portfolio-shell {
    flex-direction: column;
    height: 100dvh;
  }

  .sidebar {
    width: 100%;
    flex: none;
    position: static;
    height: auto;
    padding: 14px 18px 12px;
    gap: 10px 18px;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-soft);
  }

  .sidebar-filters {
    order: 3;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 18px;
  }

  .sidebar-group {
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
  }

  .sidebar-group-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px 12px;
  }

  .sidebar-bottom {
    margin-top: 0;
    padding-top: 0;
    flex-direction: row;
    align-items: center;
    gap: 14px;
  }

  .sidebar-colophon {
    display: none;
  }

  .gallery-main {
    height: auto;
    flex: 1;
    padding: 12px 10px 18px;
  }

  .coverflow-viewport {
    min-height: 260px;
  }

  .cf-card .photo-img {
    max-height: 62dvh;
    max-width: calc(100vw - 48px);
  }

  .cf-edge-btn {
    display: none;
  }

  .cf-mobile-btn {
    display: inline-flex;
  }
}

/* Empty state & pill fallback */
.pill {
  display: inline-block;
  text-decoration: none;
  color: var(--ink-secondary);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 7px 14px;
  border-radius: 999px;
}

.pill.is-active {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 500;
}

.empty-state {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 44px 32px;
  text-align: center;
  max-width: 520px;
  margin: 40px auto;
  box-shadow: var(--shadow-card);
}

.empty-state h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 400;
}

.empty-state p {
  margin: 0 0 18px;
  color: var(--ink-secondary);
}

.empty-state code {
  font-family: var(--font-mono);
  background: var(--bg-surface-hover);
  color: var(--ink-primary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}

/* =========================================
   Admin Backoffice
   ========================================= */
.site-header {
  border-bottom: 1px solid var(--border-soft);
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 18px clamp(16px, 3vw, 36px);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.brand-link {
  color: var(--ink-primary);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1;
}

.nav-link {
  color: var(--ink-secondary);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.15s ease;
}

.nav-link:hover {
  color: var(--ink-primary);
}

.admin-brand-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.admin-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--bg-surface);
  color: var(--ink-secondary);
  border: 1px solid var(--border-soft);
  padding: 3px 9px;
  border-radius: 999px;
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.admin-login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 30px;
  box-shadow: var(--shadow-card);
}

.admin-title {
  margin: 20px 0 4px;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 400;
}

.admin-subtitle {
  margin: 0 0 22px;
  color: var(--ink-secondary);
  font-size: 0.88rem;
}

.admin-alert {
  background: rgba(229, 139, 139, 0.1);
  color: var(--status-error);
  border: 1px solid rgba(229, 139, 139, 0.3);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.85rem;
  margin: 0 0 16px;
}

.admin-login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

.field-input {
  width: 100%;
  background: var(--bg-input);
  color: var(--ink-primary);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font-size: 0.88rem;
  font-family: inherit;
  transition: border-color 0.15s ease;
}

.field-input::placeholder {
  color: var(--ink-muted);
}

.field-input:focus {
  outline: none;
  border-color: var(--ink-primary);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: wait;
}

.btn-ghost {
  background: transparent;
  color: var(--ink-secondary);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-ghost:hover,
.btn-ghost.is-active {
  background: var(--bg-surface-hover);
  color: var(--ink-primary);
  border-color: var(--border-strong);
}

.admin-main {
  max-width: 1160px;
  margin: 0 auto;
  padding: 26px clamp(16px, 3vw, 36px) 64px;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
}

.admin-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stat-pill {
  font-size: 0.7rem;
  background: rgba(224, 176, 132, 0.12);
  color: var(--status-warn);
  border: 1px solid rgba(224, 176, 132, 0.3);
  padding: 3px 10px;
  border-radius: 999px;
}

.stat-pill.is-ok {
  background: rgba(148, 201, 169, 0.12);
  color: var(--status-ok);
  border-color: rgba(148, 201, 169, 0.3);
}

.admin-toolbar-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.admin-search-input {
  width: 280px;
  max-width: 100%;
}

.admin-photo-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.admin-photo-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 18px;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 22px;
  align-items: start;
  box-shadow: var(--shadow-card);
}

.admin-photo-card.is-incomplete {
  border-left: 3px solid var(--status-warn);
}

.admin-thumb-frame {
  background: var(--mat-white);
  padding: 8px;
  border-radius: 1px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.admin-thumb-frame img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 180px;
  object-fit: contain;
}

.admin-photo-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-photo-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.admin-filename {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-primary);
}

.admin-dims {
  margin-left: 10px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-muted);
}

.admin-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.save-status {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-muted);
}

.save-status.is-saved {
  color: var(--status-ok);
}

.save-status.is-dirty {
  color: var(--status-warn);
}

.save-status.is-error {
  color: var(--status-error);
}

.admin-fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-field span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

.admin-field.is-disabled {
  opacity: 0.4;
}

.admin-form-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.admin-upload-panel {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upload-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 26px 20px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.upload-dropzone:hover,
.upload-dropzone.is-dragover {
  border-color: var(--ink-primary);
  background: var(--bg-surface-hover);
}

.upload-dropzone-text {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-primary);
}

.upload-dropzone-sub {
  font-size: 0.8rem;
  color: var(--ink-secondary);
}

.btn-danger-ghost {
  background: transparent;
  color: var(--status-error);
  border: 1px solid rgba(229, 139, 139, 0.35);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-danger-ghost:hover:not(:disabled) {
  background: rgba(229, 139, 139, 0.12);
  border-color: var(--status-error);
}

.btn-danger-ghost:disabled {
  opacity: 0.5;
  cursor: wait;
}

.admin-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.photo-select-cb {
  width: 16px;
  height: 16px;
  accent-color: #ffffff;
  cursor: pointer;
}

.admin-photo-card.is-selected {
  border-color: var(--ink-primary);
  background: #141414;
}

.admin-batch-bar {
  position: sticky;
  top: 74px;
  z-index: 15;
  background: #121212;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.78);
}

.admin-batch-bar[hidden] {
  display: none;
}

.admin-batch-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 16px;
}

.admin-batch-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-batch-hint {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-secondary);
}

@media (max-width: 720px) {
  .admin-photo-card {
    grid-template-columns: 1fr;
  }

  .admin-thumb-frame img {
    max-height: 240px;
  }
}
