:root {
  --bg: #000;
  --fg: #fff;
  --muted: #b6b6b6;
  --gap: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Helvetica Neue", "Arial", sans-serif;
}

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

.site-wrap {
  width: min(1600px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nav-right a {
  opacity: 0.8;
}

.nav-right a.active,
.nav-right a:hover {
  opacity: 1;
}

.logo {
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.banner {
  width: 100%;
  background: #000;
  border: 1px solid #1f1f1f;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
  padding-top: 66px;
  padding-bottom: 62px;
}

.banner::before {
  content: "";
  display: block;
  width: 100%;
  padding-top: calc(100% / var(--banner-ratio, 4.5));
}

.banner-bg-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.banner-float-layer {
  position: absolute;
  left: 0;
  right: 0;
  top: 66px;
  bottom: 62px;
  z-index: 2;
  overflow: hidden;
}

.banner-float-item {
  position: absolute;
  width: 220px;
  height: 220px;
  transform: translate(0px, 0px) scale(1);
  transition: transform 0.22s ease;
  transform-origin: center center;
}

.banner-float-item img,
.banner-float-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.banner-top-image {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

.banner-top-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  margin: 0;
}

.banner-categories {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 27px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  z-index: 5;
}

.banner-nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  margin: 0;
  padding: 14px 16px;
  background: transparent;
}

.cat-pill {
  border: 0;
  border-radius: 0;
  padding: 10px 22px;
  background: rgba(255, 255, 255, 0.42);
  color: #1a1a1a;
  font-size: 12px;
  line-height: 1;
  text-transform: none;
  backdrop-filter: blur(2px);
}

.cat-pill.active {
  background: rgba(0, 0, 0, 0.76);
  color: #fff;
}

.music-tab {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 180;
  padding: 12px 10px;
  width: 44px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 0.08em;
  border-radius: 8px 0 0 8px;
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  border: 1px solid #444;
  font-size: 12px;
  text-transform: uppercase;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--gap);
  row-gap: 34px;
  grid-auto-flow: dense;
}

.work-card {
  position: relative;
  cursor: pointer;
  overflow: visible;
  background: transparent;
}

.work-media-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #111;
}

.work-card.work-card-bg-black {
  background: transparent;
}

.work-card.work-card-bg-black .work-media-wrap {
  background: #000;
}

.work-card.work-card-bg-white {
  background: transparent;
}

.work-card.work-card-bg-white .work-media-wrap {
  background: #fff;
}

.work-card.is-big {
  grid-column: span 2;
  grid-row: span 2;
}

.work-media-thumb,
.work-media-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  image-rendering: auto;
  transition: transform 0.3s ease;
}

.work-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.2s ease;
}

.work-title {
  margin: 12px 0 0;
  color: #b0b0b0 !important;
  font-size: 18px !important;
  font-weight: 400 !important;
  line-height: 1.45 !important;
  letter-spacing: 0.005em;
  opacity: 1;
  transition: opacity 0.2s ease;
  max-width: 100%;
  word-break: break-word;
}

.work-card:hover .work-overlay {
  background: rgba(0, 0, 0, 0.1);
}

.work-card:hover .work-media-thumb {
  transform: scale(1.08);
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  padding: 28px;
}

.modal-layer.open {
  display: flex;
}

.work-modal {
  width: min(1440px, 90vw);
  height: min(82vh, 1000px);
  background: var(--modal-bg, #000);
  color: var(--modal-fg, #fff);
  border: 1px solid var(--modal-border, #2c2c2c);
  padding: 18px;
  overflow: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
  position: relative;
}

.work-modal::-webkit-scrollbar {
  width: 0;
  height: 0;
  background: transparent;
}

.modal-close {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  border: 0;
  color: #fff;
  background: rgba(0, 0, 0, 0.75);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 130;
  padding: 0;
}

.modal-head {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.modal-col {
  border-top: 0.5px solid var(--modal-divider, #777);
  padding-top: 12px;
  font-size: var(--modal-font-size, 28px);
  line-height: 1.35;
  text-align: left;
}

.modal-col p,
.modal-col h3 {
  margin: 0;
  white-space: pre-wrap;
  font-size: inherit;
  font-weight: var(--modal-copy-weight, 500);
}

.modal-col h3 {
  line-height: 1.35;
}

.modal-gallery {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-media-item {
  position: relative;
  min-height: 220px;
  background: var(--modal-media-bg, #111);
}

.modal-media-item.is-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05));
  background-size: 200% 100%;
  animation: mediaShimmer 1.2s linear infinite;
}

.modal-media-item.is-error::after {
  content: "Media failed to load";
  position: absolute;
  left: 12px;
  bottom: 10px;
  color: #c9c9c9;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.modal-gallery img,
.modal-gallery video {
  width: 100%;
  display: block;
  height: auto;
  background: var(--modal-media-bg, #111);
}

.modal-media-item.is-loading img,
.modal-media-item.is-loading video {
  opacity: 0.2;
}

.modal-media-item.is-loaded img,
.modal-media-item.is-loaded video {
  opacity: 1;
  transition: opacity 0.2s ease;
}

@keyframes mediaShimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

body.works-media-protect img,
body.works-media-protect video {
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
}

.intro-layout {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 24px;
}

.intro-col {
  border-top: 1px solid #777;
  padding-top: 12px;
  white-space: pre-wrap;
  text-align: left;
}

.intro-top-global {
  margin-left: -18px;
  margin-right: -18px;
  margin-bottom: 18px;
}

.intro-top-global img {
  display: block;
  height: 240px;
  width: 100%;
  object-fit: cover;
}

.intro-top-image {
  width: 100%;
  margin-bottom: 12px;
}

.intro-top-image img {
  width: 100%;
  display: block;
}

.admin-wrap {
  max-width: 1260px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  color: #fff;
  background: #0a0a0a;
}

.admin-wrap h1,
.admin-wrap h2 {
  font-weight: 500;
}

.admin-grid {
  display: grid;
  gap: 18px;
}

.admin-card {
  border: 1px solid #333;
  padding: 14px;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.admin-form-grid .full {
  grid-column: 1 / -1;
}

label {
  display: block;
  font-size: 12px;
  margin-bottom: 6px;
  color: #d1d1d1;
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="color"],
textarea,
select {
  width: 100%;
  background: #131313;
  border: 1px solid #333;
  color: #fff;
  padding: 8px;
  font-size: 13px;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

button {
  background: #0069ff;
  color: #fff;
  border: none;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 12px;
  text-transform: uppercase;
}

button:hover {
  background: #0058d6;
}

.btn-danger {
  background: #0069ff;
  color: #fff;
}

.work-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.work-list-item {
  border: 1px solid #333;
  padding: 10px;
  background: #111;
}

.work-list-cover {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  margin-bottom: 8px;
  background: #000;
}

.work-list-cover img,
.work-list-cover video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-inline {
  width: 120px;
  height: 120px;
  background: #000;
  border: 1px solid #2d2d2d;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.thumb-inline img,
.thumb-inline video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.thumb-inline.media-preview {
  width: 180px;
  height: 120px;
  flex: 0 0 180px;
}

.admin-media-list {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.admin-media-row {
  border-top: 1px solid #2a2a2a;
  padding-top: 8px;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "thumb"
    "order"
    "actions"
    "link";
  gap: 8px;
  align-items: start;
  min-width: 0;
}

.admin-media-order-label {
  grid-area: order;
  margin: 0;
  font-size: 12px;
  color: #aaa;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
}

.admin-media-link {
  grid-area: link;
  font-size: 11px;
  line-height: 1.35;
  color: #9ca3af;
  word-break: break-all;
  overflow-wrap: anywhere;
  min-width: 0;
}

.admin-media-actions {
  grid-area: actions;
  display: flex;
  align-items: start;
  justify-content: flex-start;
}

.thumb-inline.media-preview {
  grid-area: thumb;
  width: min(100%, 220px);
  height: 140px;
  flex: 0 0 auto;
}

.flash {
  background: #163816;
  border: 1px solid #2e6a2e;
  color: #d3ffd3;
  padding: 8px 10px;
  margin-bottom: 10px;
}

.flash-error {
  background: #3f1111;
  border-color: #8a2e2e;
  color: #ffd3d3;
}

.btn-ghost {
  background: #191919;
  border: 1px solid #3a3a3a;
  color: #fff;
}

.cover-tools {
  display: none;
}

.cover-tools.is-open {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 310;
}

.cover-tools-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}

.cover-tools-dialog {
  position: relative;
  width: min(1200px, 96vw);
  max-height: 88vh;
  margin: 5vh auto 0;
  background: #0b0b0b;
  border: 1px solid #3a3a3a;
  padding: 14px;
  overflow: auto;
}

.cover-tools-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.cover-tools-body {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(420px, 1fr) minmax(300px, 420px);
}

.cover-preview-stage {
  width: min(72vw, 640px);
  aspect-ratio: 1 / 1;
  height: auto;
  overflow: hidden;
  background: #0f0f0f;
  border: 1px solid #333;
  position: relative;
  margin: 0 auto;
  cursor: grab;
}

.cover-preview-stage img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  max-width: none;
  max-height: none;
}

.cover-preview-stage:active {
  cursor: grabbing;
}

.cover-crop-frame {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 74%;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  border: 2px solid #000;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.38);
  pointer-events: none;
}

.cover-controls {
  display: grid;
  gap: 8px;
}

.cover-controls label {
  margin: 0;
}

.admin-feedback-layer {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 360;
}

.admin-feedback-layer.open {
  display: flex;
}

.admin-feedback-modal {
  width: min(420px, 92vw);
  background: #0f1810;
  border: 1px solid #2f6a37;
  color: #d8ffd8;
  padding: 14px;
}

.admin-feedback-modal.is-error {
  background: #1b0f0f;
  border-color: #8c2f2f;
  color: #ffd4d4;
}

.admin-feedback-title {
  font-size: 16px;
  margin-bottom: 8px;
}

.admin-feedback-text {
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 10px;
}

@media (max-width: 1199px) {
  .works-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 30px;
  }
  .modal-head,
  .intro-layout,
  .admin-form-grid {
    grid-template-columns: 1fr;
  }
  .work-modal {
    width: min(1200px, 92vw);
    height: 86vh;
  }
  .modal-close {
    right: 10px;
    top: 10px;
  }
}

@media (max-width: 767px) {
  .site-wrap {
    padding: 12px;
  }
  .intro-top-global {
    margin-left: -12px;
    margin-right: -12px;
  }
  .works-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 24px;
  }
  .work-title {
    font-size: 16px !important;
    line-height: 1.5 !important;
  }
  .work-card.is-big {
    grid-column: span 2;
    grid-row: span 2;
  }
  .top-nav {
    align-items: flex-start;
    flex-direction: column;
  }
  .banner-nav {
    padding: 10px 12px;
  }
  .banner {
    padding-top: 84px;
  }
  .banner-float-layer {
    top: 84px;
  }
  .work-modal {
    width: 94vw;
    height: 88vh;
    padding: 12px;
  }
  .cover-tools-dialog {
    margin-top: 3vh;
    max-height: 92vh;
  }
  .cover-tools-body {
    grid-template-columns: 1fr;
  }
  .cover-preview-stage {
    width: 100%;
    max-width: 420px;
    aspect-ratio: 1 / 1;
    height: auto;
  }
  .modal-col h3 {
    font-size: 28px;
  }
  .thumb-inline.media-preview {
    width: min(100%, 220px);
    height: 140px;
  }
  .admin-media-actions {
    justify-content: flex-start;
  }
}
