:root {
  color-scheme: dark;
  --ink: #f7f7f7;
  --muted: #9d9d9d;
  --black: #000000;
  --soft-black: #090909;
  --overlay: rgba(0, 0, 0, 0.58);
  --overlay-strong: rgba(0, 0, 0, 0.78);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--black);
  color: var(--ink);
  font-family: "DM Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

.page-shell {
  width: min(1060px, calc(100% - 52px));
  margin: 0 auto;
  padding: 48px 0 72px;
}

.site-header {
  margin-bottom: 34px;
  text-align: center;
}

h1 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  font-size: 3.7rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
}

.category-filter {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  width: min(520px, 100%);
  margin: 0 auto 36px;
  background: rgba(0, 0, 0, 0.9);
  padding: 14px 0 12px;
}

.category-filter-button {
  position: relative;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 760;
  letter-spacing: 0;
  padding: 0 0 11px;
  text-align: center;
  transition: color 260ms ease, opacity 260ms ease;
}

.category-filter-button::before,
.category-filter-button::after {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  content: "";
  height: 1px;
}

.category-filter-button::before {
  background: rgba(255, 255, 255, 0.22);
}

.category-filter-button::after {
  background: rgba(255, 255, 255, 0.92);
  opacity: 0;
  transform: scaleX(0.28);
  transform-origin: center;
  transition: opacity 260ms ease, transform 260ms ease;
}

.category-filter-button:hover,
.category-filter-button.is-active {
  color: var(--ink);
}

.category-filter-button:hover::after {
  opacity: 0.45;
  transform: scaleX(0.62);
}

.category-filter-button.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 34px;
  row-gap: 38px;
  margin: 0 auto;
}

.product-tile {
  position: relative;
  display: block;
  overflow: hidden;
  min-width: 0;
  border: 0;
  border-radius: 6px;
  background: var(--soft-black);
  box-shadow: none;
  padding: 0;
  text-align: left;
}

.product-tile.is-hidden {
  display: none;
}

.product-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: 6px;
  background: var(--soft-black);
}

.product-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.product-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, var(--overlay-strong) 100%);
  padding: 16px 14px 12px;
}

.product-name {
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 650;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-count {
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
}

.carousel-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  width: 34px;
  height: 46px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: var(--overlay);
  box-shadow: none;
  color: var(--ink);
  cursor: pointer;
  font-size: 2rem;
  line-height: 1;
  padding: 0 0 3px;
  transform: translateY(-50%);
  transition: background 180ms ease, color 180ms ease, opacity 180ms ease;
}

.info-hotspot {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  display: grid;
  width: 50%;
  aspect-ratio: 1;
  place-items: center;
  transform: translate(-50%, -50%);
}

.info-trigger {
  display: grid;
  width: 100%;
  height: 46px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: var(--overlay);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 750;
  letter-spacing: 0;
  opacity: 0;
  padding: 0;
  pointer-events: none;
  transition: background 180ms ease, opacity 500ms ease;
}

.info-hotspot:hover .info-trigger,
.info-hotspot:focus-within .info-trigger {
  opacity: 1;
  pointer-events: auto;
}

.info-trigger:hover {
  background: var(--overlay-strong);
}

.carousel-prev {
  left: 10px;
}

.carousel-next {
  right: 10px;
}

.carousel-nav:disabled {
  color: #6d6d6d;
  cursor: default;
  opacity: 0.68;
}

.carousel-nav:not(:disabled):hover {
  background: var(--overlay-strong);
}

.carousel-nav:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.45);
  outline-offset: 3px;
}

.info-trigger:focus-visible,
.category-filter-button:focus-visible,
.admin-actions a:focus-visible,
.admin-button:focus-visible,
.admin-form input:focus-visible,
.admin-form select:focus-visible,
.admin-form textarea:focus-visible,
.admin-product-fields input:focus-visible,
.admin-product-fields select:focus-visible,
.admin-product-fields textarea:focus-visible,
.admin-section-row input:focus-visible,
.admin-image-delete:focus-visible,
.modal-close:focus-visible,
.contact-links a:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.45);
  outline-offset: 3px;
}

.contact-section {
  margin-top: 68px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  padding: 34px 0 0;
  text-align: center;
}

.contact-kicker {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.contact-section h2 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 560;
  letter-spacing: 0;
  line-height: 1.15;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 22px;
  margin-top: 14px;
}

.contact-links a {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
}

.contact-links a:hover {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 4px;
}

body.modal-open {
  overflow: hidden;
}

.item-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
}

.item-modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: #101010;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.5);
  padding: 28px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: var(--overlay);
  color: var(--ink);
  cursor: pointer;
  font-size: 1.55rem;
  line-height: 1;
  padding: 0 0 3px;
}

.modal-close:hover {
  background: var(--overlay-strong);
}

.modal-category {
  margin: 0 44px 8px 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

.modal-panel h2 {
  margin: 0;
  padding-right: 44px;
  font-size: 2rem;
  font-weight: 560;
  letter-spacing: 0;
  line-height: 1.05;
}

.modal-summary {
  margin: 14px 0 22px;
  color: #d9d9d9;
  font-size: 0.98rem;
  line-height: 1.55;
}

.modal-specs {
  display: grid;
  grid-template-columns: minmax(108px, 0.38fr) minmax(0, 1fr);
  gap: 12px 18px;
  margin: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 18px;
}

.modal-specs dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.35;
  text-transform: uppercase;
}

.modal-specs dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 520;
  line-height: 1.4;
}

.modal-care {
  margin-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 18px;
}

.modal-care h3 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

.modal-care p {
  margin: 0;
  color: #d9d9d9;
  font-size: 0.94rem;
  line-height: 1.5;
}

.admin-body {
  background: #0c0c0c;
}

.admin-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 44px 0 72px;
}

.admin-login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

.admin-login-panel {
  width: min(420px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #111111;
  padding: 28px;
}

.admin-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 34px;
}

.admin-kicker {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

.admin-header h1,
.admin-login-panel h1 {
  margin: 0;
  font-size: 2.6rem;
  font-weight: 560;
  line-height: 1;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-actions a {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.admin-actions a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.admin-alert {
  margin: 0 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  padding: 12px 14px;
}

.admin-section {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 28px;
}

.admin-section + .admin-section {
  margin-top: 44px;
}

.admin-section h2 {
  margin: 0 0 20px;
  font-size: 1.45rem;
  font-weight: 580;
  line-height: 1.15;
}

.admin-form,
.admin-product-fields {
  display: grid;
  gap: 16px;
}

.admin-grid-form,
.admin-product-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-form label,
.admin-product-fields label,
.admin-section-row label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

.admin-form input,
.admin-form select,
.admin-form textarea,
.admin-product-fields input,
.admin-product-fields select,
.admin-product-fields textarea,
.admin-section-row input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: #171717;
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 520;
  letter-spacing: 0;
  padding: 11px 12px;
  text-transform: none;
}

.admin-form textarea,
.admin-product-fields textarea {
  resize: vertical;
}

.admin-span-2 {
  grid-column: 1 / -1;
}

.admin-button {
  width: fit-content;
  min-width: 150px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--black);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0;
  padding: 12px 18px;
}

.admin-button:hover {
  background: #ffffff;
}

.admin-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.admin-button-secondary {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: transparent;
  color: var(--ink);
}

.admin-button-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
}

.admin-section-create {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  margin-bottom: 22px;
}

.admin-section-list {
  display: grid;
  gap: 12px;
}

.admin-section-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #111111;
  padding: 14px;
}

.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-products {
  display: grid;
  gap: 22px;
}

.admin-product-card {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 22px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #111111;
  padding: 18px;
}

.admin-product-cover {
  width: 100%;
  aspect-ratio: 4 / 5;
  display: block;
  object-fit: cover;
  background: var(--soft-black);
}

.admin-image-manager {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 14px;
}

.admin-image-manager-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.admin-image-manager-header h3,
.admin-upload-preview p {
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1.2;
}

.admin-image-manager-header span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
}

.admin-image-grid,
.admin-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 12px;
}

.admin-image-tile,
.admin-preview-tile {
  min-width: 0;
}

.admin-image-tile img,
.admin-preview-tile img {
  width: 100%;
  aspect-ratio: 1;
  display: block;
  border-radius: 6px;
  object-fit: cover;
  background: var(--soft-black);
}

.admin-image-delete {
  width: 100%;
  margin-top: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 8px 10px;
}

.admin-image-delete:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
}

.admin-image-delete:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.admin-upload-preview {
  display: grid;
  gap: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 14px;
}

.admin-upload-preview[hidden] {
  display: none;
}

.admin-preview-tile span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-product-card {
    grid-template-columns: 140px minmax(0, 1fr);
  }
}

@media (max-width: 620px) {
  .page-shell {
    width: min(100% - 40px, 1060px);
    padding-top: 38px;
    padding-bottom: 64px;
  }

  .site-header {
    margin-bottom: 26px;
  }

  h1 {
    font-size: 2.35rem;
    line-height: 1.08;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    row-gap: 84px;
  }

  .category-filter {
    gap: 10px;
    margin-bottom: 64px;
  }

  .category-filter-button {
    font-size: 0.86rem;
    padding-bottom: 10px;
  }

  .carousel-nav {
    width: 32px;
    height: 42px;
    font-size: 1.8rem;
  }

  .info-trigger {
    height: 42px;
  }

  .contact-section {
    margin-top: 46px;
    padding-top: 28px;
  }

  .contact-section h2 {
    font-size: 1.4rem;
  }

  .modal-panel {
    padding: 24px 20px;
  }

  .modal-panel h2 {
    font-size: 1.65rem;
  }

  .modal-specs {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .modal-specs dd {
    margin-bottom: 8px;
  }

  .admin-shell {
    width: min(100% - 28px, 1120px);
    padding-top: 30px;
  }

  .admin-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-header h1,
  .admin-login-panel h1 {
    font-size: 2rem;
  }

  .admin-grid-form,
  .admin-product-fields,
  .admin-section-create,
  .admin-section-row {
    grid-template-columns: 1fr;
  }

  .admin-product-card {
    grid-template-columns: 1fr;
  }

  .admin-product-cover {
    width: min(210px, 100%);
  }
}
