:root {
  --bg0: #070709;
  --bg1: #141218;
  --ink: #f4f0f5;
  --muted: #9a8f9e;
  --accent: #ff2d6a;
  --accent-2: #ff8fb3;
  --danger: #ff4d4d;
  --line: rgba(255, 255, 255, 0.1);
  --rail: 160px;
  --font-display: "Avenir Next", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Segoe UI", ui-sans-serif, system-ui, sans-serif;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg0);
  color: var(--ink);
  font-family: var(--font-body);
}

body {
  background:
    radial-gradient(ellipse 90% 55% at 50% -15%, rgba(255, 45, 106, 0.28), transparent 55%),
    radial-gradient(ellipse 50% 40% at 100% 10%, rgba(90, 30, 80, 0.22), transparent 50%),
    radial-gradient(ellipse 40% 30% at 0% 60%, rgba(40, 20, 60, 0.35), transparent 50%),
    linear-gradient(180deg, #120e14 0%, var(--bg0) 45%, #050506 100%);
  background-attachment: fixed;
}

body.lb-open {
  overflow: hidden;
}

a {
  color: var(--accent-2);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.shell {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr) var(--rail);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  place-items: start center;
  padding: 1.25rem 0.5rem;
}

.ad-slot {
  width: 140px;
  min-height: 250px;
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.main {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.main--gallery {
  max-width: 1280px;
}

.brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.8rem, 8vw, 4.8rem);
  letter-spacing: -0.045em;
  line-height: 0.92;
  margin: 0 0 0.85rem;
}

.brand span {
  color: var(--accent);
}

.tagline {
  margin: 0 0 1.75rem;
  max-width: 36rem;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.55;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.4rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 12px 40px rgba(255, 45, 106, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cta:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 16px 48px rgba(255, 45, 106, 0.48);
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 2.75rem 0 1rem;
}

.orient-tabs {
  display: inline-flex;
  gap: 0.25rem;
  margin: 0 0 1.35rem;
  padding: 0.25rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.orient-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}
.orient-tab.on {
  background: rgba(255, 45, 106, 0.2);
  color: var(--ink);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.1rem;
}

.card {
  display: block;
  color: inherit;
  text-decoration: none;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.2)), var(--bg1);
  border: 1px solid var(--line);
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
  animation: fadeUp 0.55s ease both;
  position: relative;
}
.card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 45, 106, 0.5);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  text-decoration: none;
}

.card-cover {
  aspect-ratio: var(--frame-ratio, 16 / 9);
  object-fit: cover;
  width: 100%;
  display: block;
  background: #1a1520;
  transition: transform 0.45s ease;
}
.card--vertical .card-cover {
  max-height: 340px;
  margin: 0 auto;
}
.card:hover .card-cover {
  transform: scale(1.04);
}

.card-body {
  padding: 0.95rem 1.05rem 1.15rem;
}

.card-body h2 {
  margin: 0 0 0.3rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.card-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.nav-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 0.75rem;
}

.back {
  color: var(--muted);
  font-size: 0.9rem;
}

.admin-pill {
  display: inline-flex;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 45, 106, 0.45);
  background: rgba(255, 45, 106, 0.12);
  color: var(--accent-2);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 1rem;
}

.page-head h1 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.55rem);
  margin: 0 0 0.35rem;
  letter-spacing: -0.03em;
}

.page-head p {
  margin: 0;
  color: var(--muted);
}

.chip-link {
  display: inline-flex;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.85rem;
}
.chip-link:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.toolbar {
  position: sticky;
  top: 0.5rem;
  z-index: 5;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  margin-bottom: 1rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(10, 10, 14, 0.78);
  backdrop-filter: blur(12px);
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.toolbar-mid {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.field {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.field input,
#admin-pass {
  width: 5.5rem;
  padding: 0.4rem 0.55rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font: inherit;
}

#scrub {
  flex: 1;
  accent-color: var(--accent);
  min-width: 0;
}

#scrub-label {
  color: var(--muted);
  font-size: 0.78rem;
  min-width: 2.5rem;
}

.zoom-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

#zoom-label {
  min-width: 4.2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
}

.grid {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(auto-fill, minmax(var(--tile-min, 120px), 1fr));
}

.thumb-card {
  position: relative;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  background: #15101a;
  cursor: pointer;
  color: inherit;
  animation: fadeUp 0.4s ease both;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.thumb-card:hover,
.thumb-card:focus-visible {
  transform: translateY(-2px) scale(1.02);
  border-color: rgba(255, 45, 106, 0.65);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  outline: none;
}

.thumb {
  aspect-ratio: var(--frame-ratio, 16 / 9);
  object-fit: cover;
  width: 100%;
  display: block;
  background: #1a1520;
}

.thumb-meta {
  position: absolute;
  left: 0.4rem;
  bottom: 0.35rem;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.thumb-card:hover .thumb-meta,
.thumb-card:focus-visible .thumb-meta {
  opacity: 1;
  transform: none;
}

.thumb-del {
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  width: 1.4rem;
  height: 1.4rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
}
.thumb-card:hover .thumb-del {
  opacity: 1;
}
.thumb-del:hover {
  background: var(--danger);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  place-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.86);
  backdrop-filter: blur(8px);
}
.lightbox.open {
  display: grid;
  animation: fadeIn 0.18s ease;
}

.lightbox-panel {
  width: min(980px, 100%);
  background: #100d14;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.lightbox-panel img {
  width: 100%;
  display: block;
  max-height: 64vh;
  object-fit: contain;
  background: #000;
}

.lightbox-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1rem;
}

.lb-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
  z-index: 41;
}
.lb-prev {
  left: 0.75rem;
}
.lb-next {
  right: 0.75rem;
}

.filmstrip {
  display: flex;
  gap: 0.4rem;
  padding: 0 0.75rem 0.85rem;
  overflow-x: auto;
}

.film {
  flex: 0 0 auto;
  width: 72px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  cursor: pointer;
}
.film.on {
  border-color: var(--accent);
}
.film img {
  width: 100%;
  aspect-ratio: var(--frame-ratio, 16 / 9);
  object-fit: cover;
  display: block;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 0.65rem 1.1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}
.btn-danger {
  background: rgba(255, 77, 77, 0.15);
  color: #ffb3b3;
  border: 1px solid rgba(255, 77, 77, 0.4);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  padding: 1rem;
}
.modal[hidden] {
  display: none !important;
}

.modal-card {
  width: min(380px, 100%);
  padding: 1.4rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #141018;
}
.modal-card h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
}
.modal-card p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.modal-card input {
  width: 100%;
  margin-bottom: 0.75rem;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}
.modal-error {
  color: #ff8f8f;
  margin: 0 0 0.75rem !important;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .rail {
    display: none;
  }
  .toolbar {
    grid-template-columns: 1fr;
  }
  .lb-nav {
    display: none;
  }
}
