:root {
  --ink: #15120e;
  --muted: #6e6559;
  --paper: #fbf8f1;
  --ivory: #fffdf8;
  --gold: #b8873e;
  --deep: #062b22;
  --line: rgba(21, 18, 14, 0.13);
  --shadow: 0 22px 70px rgba(18, 13, 7, 0.15);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 54px);
  background: rgba(251, 248, 241, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; font-family: Georgia, serif; letter-spacing: 0.08em; text-transform: uppercase; font-size: 14px; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand img { width: 42px; height: 42px; object-fit: cover; border-radius: 50%; }
.main-nav { display: flex; align-items: center; gap: clamp(12px, 2vw, 28px); font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: #3d372e; }
.main-nav a { padding: 10px 0; border-bottom: 1px solid transparent; }
.main-nav a:hover { border-color: var(--gold); }
.nav-toggle { display: none; }
.language-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  overflow-x: auto;
  padding: 5px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.42);
  scrollbar-width: thin;
}
.lang-button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border: 0;
  background: transparent;
  color: #3d372e;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  cursor: pointer;
}
.lang-button img {
  width: 21px;
  height: 14px;
  object-fit: cover;
  border: 1px solid rgba(21, 18, 14, .18);
  box-shadow: 0 1px 2px rgba(18, 13, 7, .12);
}
.lang-button.active {
  background: var(--deep);
  color: var(--ivory);
}
.is-rtl { direction: rtl; }
.is-rtl .topbar,
.is-rtl .brand,
.is-rtl .main-nav,
.is-rtl .hero-actions,
.is-rtl .filter-bar,
.is-rtl .meta,
.is-rtl .footer nav,
.is-rtl .language-switcher { direction: rtl; }
.is-rtl .detail-copy dt,
.is-rtl th,
.is-rtl td { text-align: right; }
.is-rtl .notice { border-left: 0; border-right: 3px solid var(--gold); }

.hero {
  position: relative;
  min-height: 88vh;
  display: grid;
  align-items: end;
  padding: 120px clamp(22px, 6vw, 92px) 56px;
  overflow: hidden;
  background: #130f0b;
  color: var(--ivory);
}
.hero-media {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 8, 5, 0.9), rgba(10, 8, 5, 0.42) 52%, rgba(10, 8, 5, 0.12)),
    url("./assets/gallery-hero.png") center/cover;
}
.hero-content { position: relative; max-width: 720px; padding-bottom: 24px; }
h1, h2, h3, p, a, button, label, td, th { overflow-wrap: anywhere; }
.hero-logo { width: 148px; height: 148px; object-fit: cover; border-radius: 50%; margin-bottom: 28px; box-shadow: 0 18px 60px rgba(0, 0, 0, 0.4); }
.eyebrow { margin: 0 0 12px; color: var(--gold); text-transform: uppercase; letter-spacing: 0.18em; font-size: 12px; font-weight: 700; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; letter-spacing: 0; }
h1 { margin: 0; font-size: clamp(58px, 10vw, 132px); line-height: 0.88; }
h2 { margin: 0; font-size: clamp(34px, 5vw, 64px); line-height: 0.96; }
h3 { margin: 0 0 10px; font-size: 25px; }
.hero-copy { max-width: 620px; margin: 26px 0 0; color: rgba(255, 253, 248, 0.82); font-size: clamp(17px, 2vw, 22px); line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.button.primary { background: var(--gold); color: #120e09; }
.button.secondary { background: rgba(255,255,255,0.04); color: inherit; }
.button:hover { transform: translateY(-1px); }

section { padding: 82px clamp(22px, 5vw, 74px); }
.section-head { margin-bottom: 34px; }
.section-head.split { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.section-note { max-width: 470px; margin: 0; color: var(--muted); line-height: 1.6; }

.premium-rail { background: var(--ivory); }
.carousel { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(290px, min(760px, 58vw)); gap: 22px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.premium-card {
  position: relative;
  min-height: 450px;
  display: flex;
  align-items: end;
  overflow: hidden;
  background: #111;
  color: white;
  box-shadow: var(--shadow);
  scroll-snap-align: start;
}
.premium-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent, rgba(0,0,0,.72)); z-index: 1; }
.premium-card .art-image { position: absolute; inset: 0; }
.art-image { background: var(--art-bg); background-size: cover; background-position: center; }
.art-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.premium-card .art-image img,
.detail-image img {
  position: absolute;
  inset: 0;
}
.detail-image img { z-index: 0; }
.premium-info { position: relative; z-index: 2; width: 100%; padding: 30px; display: grid; gap: 10px; }
.premium-info strong { font-family: Georgia, serif; font-size: clamp(28px, 4vw, 48px); font-weight: 500; }
.meta { display: flex; flex-wrap: wrap; gap: 10px 16px; color: rgba(255,255,255,.78); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.sold-mark {
  position: absolute;
  top: 42%;
  left: 50%;
  z-index: 3;
  width: 118%;
  transform: translate(-50%, -50%) rotate(-18deg);
  border: 2px solid rgba(255,255,255,.72);
  background: rgba(12, 10, 8, .08);
  color: rgba(255,255,255,.78);
  padding: 10px 12px;
  text-align: center;
  font-size: clamp(24px, 4.6vw, 58px);
  font-weight: 900;
  letter-spacing: .14em;
  line-height: 1;
  white-space: nowrap;
  box-sizing: border-box;
  pointer-events: none;
}

.gallery-section { background: #f4eee3; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
select, input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.75);
  color: var(--ink);
  padding: 13px 14px;
  font: inherit;
}
.filter-bar select { width: auto; min-width: 168px; }
.art-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 255px), 1fr)); gap: 22px; }
.art-card {
  position: relative;
  min-height: 420px;
  display: grid;
  grid-template-rows: 1fr auto;
  background: var(--ivory);
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(18, 13, 7, .07);
}
.art-card .art-image { min-height: 280px; }
.art-card-body { padding: 18px; }
.art-card-body h3 { font-size: 23px; }
.art-card-body p { margin: 5px 0 0; color: var(--muted); }
.badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  background: rgba(6,43,34,.92);
  color: white;
  padding: 8px 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.detail-section { display: none; background: var(--ivory); }
.detail-section.active { display: block; }
.detail-shell { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 42px; align-items: start; }
.detail-image { min-height: 620px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.detail-copy { padding-top: 18px; }
.detail-copy dl { display: grid; grid-template-columns: 150px 1fr; gap: 12px 18px; margin: 28px 0; }
.detail-copy dt { color: var(--muted); }
.detail-copy dd { margin: 0; }
.notice { border-left: 3px solid var(--gold); padding: 16px 18px; background: #f7efe2; color: #4a3c28; }

.category-grid, .steps-grid, .metric-grid, .admin-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.category-grid article, .steps-grid article, .metric-grid article, .admin-grid article, .table-card {
  background: var(--ivory);
  border: 1px solid var(--line);
  padding: 24px;
}
.category-grid article { min-height: 170px; display: flex; flex-direction: column; justify-content: space-between; }
.category-grid span { font-size: 42px; font-family: Georgia, serif; color: var(--gold); }
.steps-grid article span { display: block; color: var(--gold); margin-bottom: 32px; font-family: Georgia, serif; font-size: 32px; }
.steps-grid p, .admin-grid p { margin: 10px 0 0; color: var(--muted); line-height: 1.6; }

.artist-section, .dashboard-section { background: #11100e; color: var(--ivory); }
.artist-section .section-note, .dashboard-section .section-note { color: rgba(255,255,255,.65); }
.artist-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
label { display: grid; gap: 8px; color: inherit; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.wide { grid-column: 1 / -1; }
.form-summary {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  border: 1px solid rgba(184,135,62,.45);
  padding: 18px;
  color: rgba(255,255,255,.75);
}
.form-summary strong { color: white; }
.tabs { display: flex; border: 1px solid rgba(255,255,255,.18); }
.tab { border: 0; background: transparent; color: rgba(255,255,255,.65); padding: 12px 18px; cursor: pointer; text-transform: uppercase; letter-spacing: .1em; }
.tab.active { background: var(--gold); color: #111; }
.panel { display: none; }
.panel.active { display: grid; gap: 18px; }
.admin-login {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr auto;
  gap: 14px;
  align-items: end;
  padding: 22px;
  border: 1px solid rgba(184,135,62,.45);
  background: rgba(255,255,255,.06);
}
.admin-login h3 { margin: 0; }
.login-error { grid-column: 1 / -1; margin: 0; color: #f0b4a8; min-height: 20px; }
.admin-private { display: grid; gap: 18px; }
.admin-target-panel { display: none; }
.admin-target-panel:target,
.admin-target-panel.visible { display: grid; }
.metric-grid article { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); }
.metric-grid span { display: block; color: rgba(255,255,255,.62); margin-bottom: 10px; }
.metric-grid strong { font-family: Georgia, serif; font-size: 34px; font-weight: 500; }
.table-card { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 620px; }
th, td { text-align: left; padding: 16px 12px; border-bottom: 1px solid rgba(255,255,255,.12); }
th { color: var(--gold); text-transform: uppercase; letter-spacing: .12em; font-size: 12px; }

.footer {
  display: grid;
  grid-template-columns: 78px 1fr auto;
  align-items: center;
  gap: 22px;
  padding: 34px clamp(22px, 5vw, 74px);
  background: var(--deep);
  color: white;
}
.footer img { width: 78px; height: 78px; object-fit: cover; border-radius: 50%; }
.footer p { margin: 6px 0 0; color: rgba(255,255,255,.65); }
.footer nav { display: flex; flex-wrap: wrap; gap: 16px; color: rgba(255,255,255,.78); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.admin-page { background: #11100e; color: var(--ivory); }
.admin-standalone { min-height: 100vh; }
.admin-hero {
  min-height: 42vh;
  display: grid;
  align-content: end;
  gap: 36px;
  padding: 34px clamp(22px, 6vw, 92px) 56px;
  background:
    linear-gradient(90deg, rgba(10, 8, 5, .94), rgba(10, 8, 5, .62)),
    url("./assets/gallery-hero.png") center/cover;
}
.admin-hero .brand { color: var(--ivory); }
.admin-direct-panel { padding-top: 52px; }
.admin-direct-panel .admin-login { margin-bottom: 18px; }

.admin-console-page {
  background: #f2efe8;
  color: var(--ink);
}
.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
}
.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 28px;
  padding: 26px 20px;
  background: #11100e;
  color: var(--ivory);
  border-right: 1px solid rgba(184,135,62,.32);
}
.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: Georgia, serif;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 13px;
}
.admin-brand img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
}
.admin-menu {
  display: grid;
  align-content: start;
  gap: 8px;
}
.admin-menu a {
  padding: 12px 14px;
  border: 1px solid transparent;
  color: rgba(255,255,255,.7);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 12px;
}
.admin-menu a.active,
.admin-menu a:hover {
  background: rgba(184,135,62,.16);
  border-color: rgba(184,135,62,.42);
  color: var(--ivory);
}
.admin-account {
  display: grid;
  gap: 6px;
  padding: 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
}
.admin-account span {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 11px;
}
.admin-account strong {
  font-size: 12px;
  font-weight: 600;
}
.admin-console {
  min-width: 0;
  padding: 26px clamp(18px, 3vw, 36px) 44px;
}
.admin-console-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}
.admin-console-top h1 {
  font-size: clamp(38px, 5vw, 64px);
}
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.admin-actions .button.secondary {
  color: var(--ink);
  background: var(--ivory);
}
.admin-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 0;
  margin-bottom: 14px;
}
.admin-kpis article,
.admin-card {
  background: var(--ivory);
  border: 1px solid var(--line);
  box-shadow: 0 14px 34px rgba(18,13,7,.07);
}
.admin-kpis article {
  display: grid;
  gap: 8px;
  padding: 20px;
}
.admin-kpis span,
.admin-kpis small {
  color: var(--muted);
}
.admin-kpis strong {
  font-family: Georgia, serif;
  font-size: clamp(24px, 2.8vw, 36px);
  font-weight: 500;
}
.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, .8fr);
  gap: 14px;
  margin-top: 14px;
}
.admin-layout.lower {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.admin-card {
  min-width: 0;
  padding: 20px;
}
.admin-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
.admin-card-head h2 {
  font-size: clamp(25px, 3vw, 36px);
}
.admin-table-card {
  overflow-x: auto;
}
.admin-table {
  min-width: 760px;
}
.admin-table th,
.admin-table td {
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.admin-table th {
  color: #775521;
}
.admin-table button {
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--ink);
  padding: 9px 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 11px;
  cursor: pointer;
}
.status-pill {
  display: inline-flex;
  min-width: 92px;
  justify-content: center;
  padding: 7px 9px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.status-pill.review { background: #f6e4bd; color: #6d4b12; }
.status-pill.live { background: #dceee6; color: #0f563a; }
.status-pill.sold { background: #eadde3; color: #74324d; }
.status-pill.draft { background: #e9e4da; color: #5d5648; }
.settings-form,
.permission-list,
.task-list {
  display: grid;
  gap: 12px;
}
.settings-form label {
  color: var(--ink);
}
.settings-form input[type="text"] {
  background: #f8f3e8;
}
.switch-row,
.task-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
  color: var(--ink);
}
.switch-row input,
.task-list input {
  width: auto;
  accent-color: var(--gold);
}
.permission-list div {
  display: grid;
  gap: 4px;
  padding: 14px;
  background: #f8f3e8;
  border: 1px solid var(--line);
}
.permission-list span {
  color: var(--muted);
  line-height: 1.45;
}

@media (max-width: 1050px) {
  .topbar { position: sticky; flex-wrap: wrap; gap: 12px; }
  .main-nav { display: none; position: absolute; top: calc(100% + 8px); left: 18px; right: 18px; padding: 18px; background: var(--ivory); border: 1px solid var(--line); box-shadow: var(--shadow); }
  .main-nav.open { display: grid; }
  .nav-toggle { display: inline-flex; border: 1px solid var(--line); background: transparent; padding: 10px 12px; text-transform: uppercase; letter-spacing: .1em; }
  .category-grid, .steps-grid, .metric-grid, .admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-shell { grid-template-columns: 1fr; }
  .artist-form { grid-template-columns: 1fr 1fr; }
  .form-summary { grid-template-columns: 1fr 1fr; }
  .admin-login { grid-template-columns: 1fr; }
  .language-switcher { order: 3; width: 100%; justify-content: center; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar {
    position: static;
    height: auto;
    grid-template-rows: auto;
  }
  .admin-menu { grid-template-columns: repeat(5, minmax(0, 1fr)); overflow-x: auto; }
  .admin-menu a { text-align: center; }
  .admin-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-layout,
  .admin-layout.lower { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  section { padding: 58px 18px; }
  .topbar { padding: 12px 14px; }
  .brand { font-size: 12px; max-width: calc(100% - 86px); }
  .brand img { width: 38px; height: 38px; }
  .main-nav { left: 12px; right: 12px; }
  .hero { min-height: 82vh; padding: 92px 18px 42px; }
  .hero-logo { width: 112px; height: 112px; }
  h1 { font-size: clamp(46px, 17vw, 74px); line-height: .94; }
  h2 { font-size: clamp(30px, 12vw, 46px); line-height: 1.02; }
  .hero-copy { font-size: 17px; }
  .hero-actions .button { width: 100%; }
  .section-head.split { display: grid; align-items: start; }
  .filter-bar { justify-content: stretch; }
  .filter-bar select { width: 100%; }
  .category-grid, .steps-grid, .metric-grid, .admin-grid, .artist-form, .form-summary { grid-template-columns: 1fr; }
  .carousel { grid-auto-columns: 88vw; }
  .premium-card { min-height: 390px; }
  .premium-info { padding: 22px; }
  .premium-info strong { font-size: 31px; }
  .detail-image { min-height: 420px; }
  .detail-copy dl { grid-template-columns: 1fr; gap: 5px 0; }
  .detail-copy dd { margin-bottom: 10px; }
  .tabs { width: 100%; }
  .tab { flex: 1; }
  table { min-width: 560px; }
  .footer { grid-template-columns: 1fr; }
  .footer nav { display: grid; gap: 10px; }
  .lang-button { flex: 1; justify-content: center; padding: 0 6px; }
  .admin-console-top { display: grid; }
  .admin-actions .button { width: 100%; }
  .admin-menu { grid-template-columns: repeat(5, minmax(120px, 1fr)); }
  .admin-kpis { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .language-switcher { justify-content: flex-start; }
  .lang-button { min-width: 68px; }
  .hero { padding-top: 78px; }
  .hero-logo { width: 96px; height: 96px; margin-bottom: 22px; }
  .art-card .art-image { min-height: 235px; }
  .premium-card { min-height: 340px; }
  .sold-mark { width: 122%; font-size: 24px; letter-spacing: .12em; }
  .admin-login, .category-grid article, .steps-grid article, .metric-grid article, .admin-grid article, .table-card { padding: 18px; }
}
