:root {
  --turquoise: #40e0d0;
  --turquoise-strong: #00b4a6;
  --turquoise-dark: #00796b;
  --turquoise-deep: #005e58;
  --turquoise-mist: #ddfbf8;
  --turquoise-pale: #f4fffd;

  --gold: #d4af37;
  --gold-dark: #8a6500;
  --gold-mist: #fff4cf;

  --burgundy: #7a1232;
  --burgundy-dark: #4a071d;
  --burgundy-mist: #fbeaf0;

  --ink: #111827;
  --navy: #111a2e;
  --canvas: #f7f4ef;
  --paper: #fdfcf9;
  --white: #ffffff;
  --muted: #6b7280;
  --soft-muted: #8a8a9a;
  --line: rgba(17, 24, 39, 0.11);

  --shadow-soft: 0 18px 50px rgba(17, 24, 39, 0.08);
  --shadow-strong: 0 30px 90px rgba(17, 24, 39, 0.22);

  --heading-font: "Space Grotesk", "Inter", system-ui, sans-serif;
  --body-font: "Inter", "Segoe UI", system-ui, sans-serif;
  --mono-font: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--body-font);
  color: var(--ink);
  background:
    radial-gradient(circle at 4% 4%, rgba(64, 224, 208, 0.22), transparent 28%),
    radial-gradient(circle at 95% 8%, rgba(212, 175, 55, 0.20), transparent 28%),
    radial-gradient(circle at 95% 65%, rgba(122, 18, 50, 0.12), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #f7fffd 44%, #fff8ee 100%);
}

body,
button,
input,
select,
textarea {
  font-family: var(--body-font);
}

img,
video {
  max-width: 100%;
}

a {
  color: inherit;
}

button {
  border: 0;
}

main {
  width: min(1500px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

/* ============================================================
   Top bar
============================================================ */

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 78px;
  padding: 12px max(18px, calc((100vw - 1500px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgba(17, 24, 39, 0.96);
  color: var(--white);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 18px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--white);
  text-decoration: none;
}

.brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: var(--white);
  border-radius: 14px;
  padding: 4px;
  box-shadow: 0 10px 24px rgba(64, 224, 208, 0.22);
}

.brand strong {
  display: block;
  font-size: 1rem;
  line-height: 1;
  font-weight: 950;
  letter-spacing: -0.04em;
}

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

.brand small {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.76rem;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topnav a {
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  font-weight: 850;
  font-size: 0.9rem;
  padding: 10px 13px;
  border-radius: 999px;
  transition: 0.18s ease;
}

.topnav a:hover,
.topnav a.active {
  color: var(--ink);
  background: var(--turquoise);
}

/* ============================================================
   Hero
============================================================ */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr);
  overflow: hidden;
  border-radius: 42px;
  background: var(--ink);
  color: var(--white);
  box-shadow: var(--shadow-strong);
}

.hero-copy {
  position: relative;
  min-height: 570px;
  padding: clamp(32px, 5vw, 66px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.hero-copy::before {
  content: "";
  position: absolute;
  width: 130%;
  height: 84px;
  left: -18%;
  top: 34%;
  transform: rotate(-7deg);
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(64, 224, 208, 0.16),
    rgba(212, 175, 55, 0.20),
    rgba(122, 18, 50, 0.18)
  );
  filter: blur(9px);
  pointer-events: none;
}

.hero-copy > * {
  position: relative;
  z-index: 1;
}

.eyebrow,
.kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.eyebrow {
  color: var(--turquoise);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.kicker {
  color: var(--turquoise-dark);
  background: var(--turquoise-mist);
}

.hero h1 {
  margin: 18px 0 18px;
  max-width: 820px;
  font-family: var(--heading-font);
  font-weight: 950;
  font-size: clamp(3rem, 6.3vw, 6.4rem);
  line-height: 0.88;
  letter-spacing: -0.09em;
}

.hero p {
  max-width: 720px;
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 1.08rem;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-stats div {
  min-width: 128px;
  padding: 14px 15px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-stats strong {
  display: block;
  font-size: 1.22rem;
  line-height: 1;
  font-weight: 950;
}

.hero-stats span {
  display: block;
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.78rem;
}

.hero-media {
  position: relative;
  min-height: 570px;
  padding: 22px;
}

.hero-media video {
  width: 100%;
  height: 100%;
  min-height: 526px;
  display: block;
  object-fit: cover;
  border-radius: 30px;
  background: var(--navy);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.video-caption {
  position: absolute;
  left: 40px;
  right: 40px;
  bottom: 40px;
  display: grid;
  gap: 4px;
  padding: 18px 20px;
  border-radius: 20px;
  background: rgba(17, 24, 39, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(18px);
}

.video-caption strong {
  font-weight: 950;
}

.video-caption span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.86rem;
}

/* ============================================================
   Buttons
============================================================ */

.btn {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 12px;
  padding: 12px 19px;
  font-size: 0.96rem;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  color: var(--ink);
  background: var(--turquoise);
  box-shadow: 0 14px 30px rgba(64, 224, 208, 0.26);
}

.btn.primary:hover {
  color: var(--white);
  background: var(--turquoise-dark);
}

.btn.burgundy {
  color: var(--white);
  background: var(--burgundy);
  box-shadow: 0 14px 30px rgba(122, 18, 50, 0.22);
}

.btn.burgundy:hover {
  background: var(--burgundy-dark);
}

.btn.ghost {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.20);
}

.btn.ghost:hover {
  background: rgba(255, 255, 255, 0.14);
}

.btn.outline {
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid var(--line);
}

.btn.outline:hover {
  background: var(--turquoise-pale);
  border-color: rgba(64, 224, 208, 0.48);
}

.btn.full {
  width: 100%;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

/* ============================================================
   Layout panels
============================================================ */

.studio-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.38fr) minmax(0, 0.62fr);
  gap: 24px;
  margin-top: 28px;
}

.panel {
  border-radius: 28px;
  background: rgba(253, 252, 249, 0.96);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.setup-panel {
  padding: clamp(20px, 2.3vw, 30px);
}

.room-panel {
  padding: clamp(18px, 2vw, 24px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(247, 244, 239, 0.97));
}

.panel-heading h2,
.panel-toolbar h2,
.results-panel h2,
.seo-section h2,
.site-footer h2 {
  margin: 8px 0 8px;
  font-family: var(--heading-font);
  font-weight: 950;
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.panel-heading h2,
.panel-toolbar h2,
.results-panel h2 {
  font-size: clamp(1.7rem, 3vw, 2.25rem);
}

.panel-heading p,
.panel-toolbar p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.panel-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.placed-count {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--burgundy-mist);
  color: var(--burgundy);
  font-size: 0.82rem;
  font-weight: 950;
}

/* ============================================================
   Form
============================================================ */

.progress-wrap {
  margin: 18px 0 20px;
}

.progress-wrap > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 0.84rem;
}

.progress-wrap strong,
.progress-wrap span {
  font-weight: 900;
}

.progress-wrap span {
  color: var(--muted);
}

.progress-track {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(64, 224, 208, 0.14);
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--turquoise), var(--gold));
  transition: width 0.25s ease;
}

.matcher-form {
  display: grid;
  gap: 16px;
}

.matcher-form label,
.app-dialog label {
  display: grid;
  gap: 7px;
}

.matcher-form label span,
.category-block > span,
.app-dialog label span {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border-radius: 13px;
  border: 1.5px solid var(--line);
  padding: 12px 13px;
  color: var(--ink);
  background: var(--white);
  outline: none;
  font-size: 0.95rem;
  transition: 0.16s ease;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--turquoise);
  box-shadow: 0 0 0 4px rgba(64, 224, 208, 0.14);
}

.category-block {
  display: grid;
  gap: 10px;
}

.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.pill {
  min-height: 38px;
  padding: 9px 13px;
  border-radius: 999px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  font-weight: 900;
  cursor: pointer;
  transition: 0.16s ease;
}

.pill:hover {
  background: var(--turquoise-mist);
}

.pill.selected {
  color: var(--white);
  background: var(--ink);
  border-color: var(--ink);
}

.upload-zone {
  width: 100%;
  min-height: 172px;
  display: grid;
  place-items: center;
  gap: 7px;
  padding: 22px;
  border-radius: 20px;
  color: var(--ink);
  background: linear-gradient(180deg, rgba(221, 251, 248, 0.86), var(--white));
  border: 2px dashed rgba(64, 224, 208, 0.64);
  cursor: pointer;
  transition: 0.18s ease;
}

.upload-zone:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(64, 224, 208, 0.14);
}

.upload-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: var(--turquoise-dark);
  background: var(--white);
  font-size: 1.8rem;
  font-weight: 950;
  box-shadow: 0 10px 20px rgba(64, 224, 208, 0.20);
}

.upload-zone strong {
  font-weight: 950;
}

.upload-zone small {
  color: var(--muted);
}

#uploadThumb {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.message {
  border-radius: 14px;
  padding: 12px 13px;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.5;
}

.message.error {
  color: #8a1028;
  background: #fff0f3;
  border: 1px solid rgba(138, 16, 40, 0.20);
}

.message.success {
  color: var(--turquoise-deep);
  background: var(--turquoise-mist);
  border: 1px solid rgba(64, 224, 208, 0.32);
}

.message.info {
  color: var(--gold-dark);
  background: var(--gold-mist);
  border: 1px solid rgba(212, 175, 55, 0.34);
}

/* ============================================================
   Room stage
============================================================ */

.room-stage {
  position: relative;
  width: 100%;
  min-height: 570px;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(64, 224, 208, 0.14), rgba(212, 175, 55, 0.09)),
    var(--turquoise-mist);
  user-select: none;
  touch-action: none;
}

.room-stage img#roomImage {
  width: 100%;
  height: 100%;
  min-height: 570px;
  display: block;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

.empty-stage,
.empty-results,
.loading-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
  padding: 34px;
}

.empty-stage {
  position: absolute;
  inset: 0;
  min-height: 570px;
}

.empty-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  color: var(--turquoise-dark);
  background: var(--white);
  font-size: 2.1rem;
  font-weight: 950;
  box-shadow: 0 12px 34px rgba(64, 224, 208, 0.18);
}

.empty-stage strong,
.empty-results strong,
.loading-state strong {
  font-size: 1.1rem;
  font-weight: 950;
}

.empty-stage span,
.empty-results span,
.loading-state span {
  max-width: 460px;
  color: var(--muted);
  line-height: 1.6;
}

.active-item-bar {
  margin-top: 14px;
  padding: 15px;
  border-radius: 18px;
  color: var(--white);
  background: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.10);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.active-item-bar strong {
  display: block;
  font-weight: 950;
}

.active-item-bar span {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.85rem;
}

.active-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.active-actions button {
  min-height: 36px;
  border-radius: 10px;
  padding: 8px 11px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-weight: 900;
  cursor: pointer;
}

.active-actions button:hover {
  background: rgba(255, 255, 255, 0.16);
}

.active-actions button.danger {
  background: rgba(122, 18, 50, 0.76);
}

.active-actions button.danger:hover {
  background: var(--burgundy);
}

/* JS-created placement items */

.room-placement {
  position: absolute;
  z-index: 10;
  min-width: 48px;
  min-height: 48px;
  cursor: move;
  touch-action: none;
  border-radius: 12px;
  overflow: visible;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

.room-placement.active {
  z-index: 20;
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  box-shadow: 0 18px 42px rgba(122, 18, 50, 0.34);
}

.room-placement-inner {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
}

.room-placement.frame .room-placement-inner {
  background: var(--white);
  border: 8px solid var(--white);
}

.room-placement img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  user-select: none;
}

.resize-handle {
  position: absolute;
  width: 17px;
  height: 17px;
  right: -8px;
  bottom: -8px;
  border-radius: 999px;
  background: var(--gold);
  border: 2px solid var(--white);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
  cursor: nwse-resize;
}

/* ============================================================
   Results
============================================================ */

.results-panel {
  margin-top: 28px;
  padding: clamp(20px, 2.5vw, 32px);
}

.loading-state {
  border-radius: 20px;
  background: var(--turquoise-pale);
  border: 1px solid rgba(64, 224, 208, 0.24);
}

.spinner {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 4px solid rgba(64, 224, 208, 0.22);
  border-top-color: var(--turquoise-dark);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.results-container {
  display: grid;
  gap: 38px;
}

.category-section {
  display: grid;
  gap: 18px;
}

.category-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.category-title-wrap {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.category-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--turquoise-dark);
  background: var(--turquoise-mist);
  font-weight: 950;
}

.category-section.negotiable .category-icon {
  color: var(--burgundy);
  background: var(--burgundy-mist);
}

.category-section h3 {
  margin: 0 0 4px;
  font-family: var(--heading-font);
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  line-height: 1;
  letter-spacing: -0.055em;
}

.category-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.category-count {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--turquoise-dark);
  background: var(--turquoise-mist);
  font-weight: 950;
}

.category-section.negotiable .category-count {
  color: var(--burgundy);
  background: var(--burgundy-mist);
}

.artwork-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.artwork-card {
  overflow: hidden;
  border-radius: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.06);
  transition: 0.18s ease;
}

.artwork-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 46px rgba(17, 24, 39, 0.12);
}

.artwork-card.placed {
  border: 2px solid var(--turquoise);
}

.artwork-image-link {
  position: relative;
  display: block;
  height: 178px;
  overflow: hidden;
  background: var(--turquoise-mist);
  text-decoration: none;
}

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

.artwork-image-link.contain img {
  object-fit: contain;
}

.match-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--ink);
  background: var(--turquoise);
  font-size: 0.76rem;
  font-weight: 950;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.16);
}

.palette-dots {
  position: absolute;
  left: 10px;
  bottom: 10px;
  display: flex;
  gap: 4px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(8px);
}

.palette-dots span {
  width: 13px;
  height: 13px;
  display: block;
  border-radius: 999px;
  border: 1px solid rgba(17, 24, 39, 0.12);
}

.artwork-body {
  padding: 15px;
  display: grid;
  gap: 12px;
}

.card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-chip {
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--turquoise-dark);
  background: var(--turquoise-mist);
  font-size: 0.76rem;
  font-weight: 950;
}

.card-chip.negotiable {
  color: var(--burgundy);
  background: var(--burgundy-mist);
}

.card-price {
  font-weight: 950;
}

.artwork-title {
  margin: 0;
  min-height: 38px;
  font-size: 1rem;
  font-weight: 950;
  line-height: 1.18;
}

.artwork-subtitle,
.artwork-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.meta-item small {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.meta-item strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.25;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.card-actions.single {
  grid-template-columns: 1fr;
}

.card-actions .btn {
  min-height: 38px;
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 0.83rem;
}

.artwork-link {
  min-height: 34px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border-radius: 10px;
  color: var(--soft-muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 850;
}

.artwork-link:hover {
  color: var(--turquoise-dark);
  background: rgba(64, 224, 208, 0.08);
}

/* ============================================================
   SEO section
============================================================ */

.seo-section {
  margin-top: 28px;
  padding: clamp(24px, 3vw, 38px);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.76);
  box-shadow: 0 22px 70px rgba(0, 80, 74, 0.10);
}

.seo-section h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.seo-section p {
  max-width: 900px;
  color: var(--muted);
  line-height: 1.85;
}

.seo-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.seo-tags a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border-radius: 999px;
  padding: 9px 13px;
  color: var(--turquoise-dark);
  background: var(--turquoise-mist);
  font-weight: 900;
  text-decoration: none;
}

.seo-tags a:hover {
  color: var(--ink);
  background: var(--turquoise);
}

/* ============================================================
   Footer
============================================================ */

.site-footer {
  margin-top: 44px;
  padding: 56px 20px;
  display: grid;
  justify-items: center;
  text-align: center;
  color: var(--white);
  background: var(--ink);
}

.site-footer img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  padding: 6px;
  border-radius: 20px;
  background: var(--white);
  box-shadow: 0 14px 34px rgba(64, 224, 208, 0.18);
}

.site-footer h2 {
  margin-top: 22px;
  margin-bottom: 8px;
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.site-footer p {
  max-width: 760px;
  margin: 0;
  color: rgba(255, 255, 255, 0.70);
  line-height: 1.75;
}

.footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-top: 26px;
  padding-top: 22px;
  width: min(900px, 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-links a {
  color: rgba(255, 255, 255, 0.74);
  text-decoration: none;
  font-weight: 820;
}

.footer-links a:hover {
  color: var(--turquoise);
}

.site-footer small {
  margin-top: 22px;
  color: rgba(255, 255, 255, 0.42);
  font-family: var(--mono-font);
}

/* ============================================================
   Dialogs
============================================================ */

.app-dialog {
  width: min(640px, calc(100% - 28px));
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: transparent;
}

.app-dialog::backdrop {
  background: rgba(17, 24, 39, 0.66);
  backdrop-filter: blur(5px);
}

.dialog-card {
  position: relative;
  margin: 0;
  display: grid;
  gap: 16px;
  padding: 0 0 22px;
  border-radius: 24px;
  background: var(--paper);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.32);
  overflow: hidden;
}

.dialog-card.compact {
  padding: 28px;
  text-align: center;
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.10);
  font-size: 1.4rem;
  font-weight: 800;
  cursor: pointer;
}

.dialog-close:hover {
  background: rgba(255, 255, 255, 0.18);
}

.dialog-head {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 28px;
  color: var(--white);
  background: var(--ink);
}

.dialog-head img {
  width: 78px;
  height: 78px;
  object-fit: cover;
  border-radius: 16px;
  background: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.dialog-head span {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 6px 9px;
  margin-bottom: 8px;
  color: var(--ink);
  background: var(--turquoise);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dialog-head h3,
.dialog-card.compact h3 {
  margin: 0;
  font-family: var(--heading-font);
  font-size: 1.7rem;
  line-height: 1;
  letter-spacing: -0.055em;
}

.dialog-head p {
  margin: 5px 0 0;
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.88rem;
}

.dialog-card > label,
.dialog-card > .dialog-grid,
.dialog-card > .message,
.dialog-card > .btn,
.dialog-card > .tiny-note {
  margin-left: 28px;
  margin-right: 28px;
}

.dialog-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.dialog-grid div {
  padding: 13px;
  border-radius: 14px;
  background: var(--canvas);
  border: 1px solid var(--line);
}

.dialog-grid small {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dialog-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 0.92rem;
}

.tiny-note {
  margin-top: -4px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.success-icon {
  width: 62px;
  height: 62px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--turquoise-dark);
  background: var(--turquoise-mist);
  font-size: 2rem;
  font-weight: 950;
}

.dialog-card.compact p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

/* ============================================================
   Noscript
============================================================ */

.noscript-warning {
  margin: 24px auto;
  width: min(900px, calc(100% - 32px));
  padding: 16px;
  border-radius: 18px;
  color: var(--gold-dark);
  background: var(--gold-mist);
  border: 1px solid rgba(212, 175, 55, 0.36);
  font-weight: 850;
  line-height: 1.6;
}

/* ============================================================
   Responsive
============================================================ */

@media (max-width: 1200px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    min-height: auto;
  }

  .hero-media {
    min-height: 420px;
  }

  .hero-media video {
    min-height: 420px;
  }

  .studio-grid {
    grid-template-columns: 1fr;
  }

  .artwork-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  main {
    width: min(100% - 22px, 1500px);
    padding-top: 18px;
  }

  .app-topbar {
    position: relative;
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 14px;
  }

  .topnav {
    width: 100%;
    justify-content: flex-start;
  }

  .topnav a {
    padding: 9px 11px;
    font-size: 0.84rem;
  }

  .hero {
    border-radius: 28px;
  }

  .hero-copy {
    padding: 28px;
  }

  .hero h1 {
    font-size: clamp(2.7rem, 15vw, 4.4rem);
  }

  .hero p {
    font-size: 1rem;
  }

  .hero-media {
    padding: 14px;
  }

  .video-caption {
    left: 28px;
    right: 28px;
    bottom: 28px;
  }

  .panel-toolbar,
  .category-section-header,
  .active-item-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .placed-count {
    align-self: flex-start;
  }

  .room-stage,
  .room-stage img#roomImage,
  .empty-stage {
    min-height: 430px;
  }

  .artwork-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-actions {
    grid-template-columns: 1fr;
  }

  .dialog-head {
    padding: 24px;
  }

  .dialog-card > label,
  .dialog-card > .dialog-grid,
  .dialog-card > .message,
  .dialog-card > .btn,
  .dialog-card > .tiny-note {
    margin-left: 24px;
    margin-right: 24px;
  }
}

@media (max-width: 620px) {
  .brand small {
    display: none;
  }

  .hero-actions,
  .footer-actions,
  .active-actions {
    width: 100%;
    flex-direction: column;
  }

  .hero-actions .btn,
  .footer-actions .btn,
  .active-actions button {
    width: 100%;
  }

  .hero-stats {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-stats div {
    min-width: 0;
  }

  .panel {
    border-radius: 22px;
  }

  .setup-panel,
  .room-panel,
  .results-panel {
    padding: 18px;
  }

  .artwork-grid {
    grid-template-columns: 1fr;
  }

  .meta-grid,
  .dialog-grid,
  .card-actions {
    grid-template-columns: 1fr;
  }

  .room-stage,
  .room-stage img#roomImage,
  .empty-stage {
    min-height: 360px;
  }

  .video-caption {
    position: static;
    margin-top: 12px;
  }

  .hero-media video {
    min-height: 300px;
  }

  .hero-media {
    min-height: auto;
  }

  .dialog-card.compact {
    padding: 24px;
  }
}


/* ============================================================
   Selected artwork detail panel
   Keeps buyers inside the room matcher instead of leaving page
============================================================ */

.artwork-image-button {
  width: 100%;
  padding: 0;
  border: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.artwork-image-button:focus-visible {
  outline: 3px solid rgba(64, 224, 208, 0.75);
  outline-offset: 3px;
}

.selected-artwork-panel {
  margin-top: 16px;
  border-radius: 22px;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 18px 46px rgba(17, 24, 39, 0.10);
}

.selected-artwork-inner {
  display: grid;
  grid-template-columns: minmax(170px, 0.34fr) minmax(0, 0.66fr);
  gap: 0;
}

.selected-artwork-media {
  min-height: 260px;
  background:
    radial-gradient(circle at 20% 20%, rgba(64, 224, 208, 0.25), transparent 30%),
    linear-gradient(135deg, var(--turquoise-mist), var(--canvas));
}

.selected-artwork-media img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  display: block;
  object-fit: contain;
  padding: 16px;
}

.selected-artwork-copy {
  padding: clamp(18px, 2.4vw, 28px);
  display: grid;
  gap: 16px;
}

.selected-artwork-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.selected-artwork-chip {
  border-radius: 999px;
  padding: 7px 10px;
  background: var(--turquoise-mist);
  color: var(--turquoise-dark);
  font-size: 0.76rem;
  font-weight: 950;
}

.selected-artwork-chip.negotiable {
  background: var(--burgundy-mist);
  color: var(--burgundy);
}

.selected-artwork-copy h3 {
  margin: 0;
  font-family: var(--heading-font);
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 0.96;
  letter-spacing: -0.07em;
}

.selected-artwork-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.selected-artwork-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.selected-artwork-meta div {
  border-radius: 14px;
  padding: 12px;
  background: var(--canvas);
  border: 1px solid var(--line);
}

.selected-artwork-meta small {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.selected-artwork-meta strong {
  display: block;
  margin-top: 4px;
  font-size: 0.9rem;
  line-height: 1.25;
}

.selected-artwork-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.selected-artwork-actions .btn {
  min-height: 42px;
}

.btn.soft {
  color: var(--turquoise-dark);
  background: var(--turquoise-mist);
  border: 1px solid rgba(64, 224, 208, 0.35);
}

.btn.soft:hover {
  color: var(--ink);
  background: var(--turquoise);
}

.btn.close-soft {
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
}

.btn.close-soft:hover {
  color: var(--burgundy);
  background: var(--burgundy-mist);
  border-color: rgba(122, 18, 50, 0.24);
}

@media (max-width: 900px) {
  .selected-artwork-inner {
    grid-template-columns: 1fr;
  }

  .selected-artwork-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .selected-artwork-meta {
    grid-template-columns: 1fr;
  }

  .selected-artwork-actions {
    flex-direction: column;
  }

  .selected-artwork-actions .btn {
    width: 100%;
  }
}


/* Shared footer discovery links */
.afmr-footer-discovery {
  width: min(1080px, calc(100% - 28px));
  margin: 26px auto 0;
  padding-top: 18px;
  border-top: 1px solid rgba(193, 154, 107, 0.28);
}

.afmr-footer-discovery p {
  margin: 0 0 10px;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.72;
  font-weight: 800;
}

.afmr-footer-discovery div {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.afmr-footer-discovery a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 11px;
  border-radius: 999px;
  border: 1px solid rgba(193, 154, 107, 0.34);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
}

.afmr-footer-discovery a:hover {
  transform: translateY(-1px);
}
