/* "Alle Gemälde" – lunise.art catalogue, light + dark mode (components/lunaris/MarketCatalog.tsx, classes am-*).
   Mode: html[data-theme] (root.tsx + ThemeToggle.tsx). Backgrounds: public/lunaris/lunise/*. */

.am {
  --am-base: #fbf2ec;
  --am-img: url('/lunaris/lunise/hero-light.jpg');
  --am-ink: #2a1631;
  --am-muted: #5a4a60;
  --am-accent: #7b4f9e;
  --am-accent-2: #9466b7;
  --am-kicker: #6f4a95;
  --am-line: rgba(122, 88, 163, .3);
  --am-field: rgba(255, 255, 255, .55);
  --am-field-border: rgba(110, 80, 140, .28);
  --am-card: rgba(236, 226, 240, .72);
  --am-frame: #ece6e1;
  --am-frame-edge: rgba(60, 40, 50, .3);
  --am-dock: rgba(255, 251, 248, .9);
  --am-serif: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  position: relative;
  min-height: 100vh;
  overflow-x: clip;
  isolation: isolate;
  color: var(--am-ink);
  background: var(--am-base);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  transition: background-color .4s ease;
}
html[data-theme='dark'] .am {
  --am-base: #2a1530;
  --am-img: url('/lunaris/lunise/hero-dark.jpg');
  --am-ink: #fbf5fb;
  --am-muted: rgba(251, 245, 251, .78);
  --am-accent: #8a5cb0;
  --am-accent-2: #a274c6;
  --am-kicker: #c9b3e8;
  --am-line: rgba(255, 255, 255, .16);
  --am-field: rgba(255, 255, 255, .05);
  --am-field-border: rgba(255, 255, 255, .3);
  --am-card: rgba(255, 255, 255, .07);
  --am-frame: #d9d3cf;
  --am-frame-edge: rgba(0, 0, 0, .5);
  --am-dock: rgba(42, 22, 48, .92);
  color-scheme: dark;
}
.am *, .am *::before, .am *::after { box-sizing: border-box; }
.am a { color: inherit; text-decoration: none; }
.am button { font: inherit; color: inherit; }

/* painted corners (fading into the base colour) */
.am::before, .am::after { content: ''; position: absolute; z-index: -1; width: min(760px, 120vw); aspect-ratio: 941 / 1672; background: var(--am-img) center / 100% 100% no-repeat; pointer-events: none; }
.am::before { left: -18vw; top: -12vh; -webkit-mask-image: radial-gradient(ellipse 90% 50% at 0% 0%, #000 45%, transparent 100%); mask-image: radial-gradient(ellipse 90% 50% at 0% 0%, #000 45%, transparent 100%); opacity: .9; }
.am::after { right: -18vw; top: 55vh; -webkit-mask-image: radial-gradient(ellipse 90% 40% at 100% 60%, #000 30%, transparent 100%); mask-image: radial-gradient(ellipse 90% 40% at 100% 60%, #000 30%, transparent 100%); opacity: .6; }

/* ---------- header ---------- */
.am-top { position: relative; z-index: 5; max-width: 1180px; margin: 0 auto; padding: 22px 20px 0; }
.am-top__row { position: relative; display: flex; align-items: center; justify-content: space-between; }
.am-logo .lx-logo { font-size: 32px; color: var(--am-ink); letter-spacing: -.02em; }
.am-top__tools { display: flex; align-items: center; gap: 10px; }
.am .lx-theme { display: inline-flex; gap: 6px; }
.am .lx-theme button { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: none; opacity: .55; cursor: pointer; transition: opacity .25s, color .25s; }
.am .lx-theme button.is-on { opacity: 1; color: var(--am-accent-2); }
html:not([data-theme='dark']) .am .lx-theme button.is-on:first-child { color: var(--am-ink); }
.am-icon-btn { display: grid; place-items: center; width: 40px; height: 40px; margin-left: 6px; padding: 0; border: 0; background: none; cursor: pointer; }
.am-sheet { position: absolute; right: 0; top: 54px; z-index: 6; display: grid; min-width: 210px; padding: 8px; border-radius: 16px; background: var(--am-base); border: 1px solid var(--am-field-border); box-shadow: 0 24px 50px rgba(30, 10, 40, .25); }
.am-sheet a { padding: 12px 14px; border-radius: 10px; font-weight: 600; }
.am-sheet a:hover { background: rgba(140, 100, 190, .12); }
.am-nav { display: flex; align-items: center; justify-content: center; gap: clamp(40px, 12vw, 70px); margin-top: 20px; }
.am-nav > * { position: relative; padding: 6px 2px 9px; border: 0; background: none; font-size: 17px; font-weight: 500; cursor: pointer; color: var(--am-ink); }
.am-nav > .is-on { font-weight: 600; color: var(--am-kicker); }
.am-nav > .is-on::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px; background: var(--am-accent-2); }
.am-nav__heart.is-on::after { display: none; }
.am-nav__heart small { position: absolute; top: -2px; right: -10px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--am-accent); color: #fff; font-size: 11px; font-weight: 700; line-height: 17px; text-align: center; }

/* ---------- title, search, controls ---------- */
.am-main { max-width: 1180px; margin: 0 auto; padding: 0 20px 40px; }
.am-in { animation: am-in .8s cubic-bezier(.22, 1, .36, 1) var(--d, 0s) both; }
@keyframes am-in { from { opacity: 0; transform: translateY(18px); } }
.am-head { padding-top: 28px; }
.am-kicker { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: .3em; text-transform: uppercase; color: var(--am-kicker); }
.am-h1 { margin: 8px 0 0; font-family: var(--am-serif); font-weight: 500; font-size: clamp(54px, 15vw, 96px); line-height: 1; letter-spacing: -.01em; }
.am-sub { margin: 10px 0 0; font-size: clamp(18px, 4.8vw, 20px); color: var(--am-muted); }
.am-search { display: flex; align-items: center; gap: 14px; margin-top: 24px; padding: 0 18px; height: 54px; border-radius: 14px; border: 1.5px solid var(--am-field-border); background: var(--am-field); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.am-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--am-ink); font: inherit; font-size: 17px; }
.am-search input::placeholder { color: var(--am-muted); }
.am-search svg { flex: none; color: var(--am-ink); }
.am-bar { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.am-btn { position: relative; display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 18px; border-radius: 12px; border: 1.5px solid var(--am-field-border); background: var(--am-field); font-size: 16px; font-weight: 600; cursor: pointer; }
.am-btn.is-on { border-color: var(--am-accent-2); }
.am-sort { padding-right: 14px; }
.am-sort select { appearance: none; border: 0; background: none; color: var(--am-ink); font: inherit; font-weight: 600; padding-right: 26px; cursor: pointer; outline: 0; }
.am-sort select option { color: #222; }
.am-sort svg { position: absolute; right: 14px; pointer-events: none; }
.am-views { display: inline-flex; gap: 6px; margin-left: auto; }
.am-views button { display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border-radius: 12px; border: 1.5px solid var(--am-field-border); background: var(--am-field); cursor: pointer; transition: background .25s, color .25s; }
.am-views button.is-on { background: linear-gradient(180deg, var(--am-accent-2), var(--am-accent)); border-color: transparent; color: #fff; }
.am-panel { overflow: hidden; }
.am-panel p { margin: 18px 0 8px; font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--am-muted); }
.am-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.am-chips button { padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--am-field-border); background: var(--am-field); font-size: 14px; font-weight: 600; cursor: pointer; }
.am-chips button.is-on { background: var(--am-accent); border-color: var(--am-accent); color: #fff; }
.am-tabs { display: flex; justify-content: space-between; gap: 16px; margin-top: 26px; overflow-x: auto; scrollbar-width: none; }
.am-tabs::-webkit-scrollbar { display: none; }
.am-tabs button { position: relative; flex: none; padding: 6px 14px 12px; border: 0; background: none; font-size: 18px; font-weight: 500; cursor: pointer; white-space: nowrap; opacity: .9; }
.am-tabs button.is-on { color: var(--am-kicker); font-weight: 600; opacity: 1; }
.am-tabs__line { position: absolute; left: 6px; right: 6px; bottom: 0; height: 2.5px; border-radius: 2px; background: var(--am-accent-2); }

/* ---------- im Fokus ---------- */
.am-focus { position: relative; margin-top: 26px; padding: 16px 14px 14px; border-radius: 16px; background: var(--am-card); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.am-focus__kicker { margin: 0 40px 12px 2px; font-size: 13px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--am-kicker); }
.am-focus__heart { position: absolute; top: 8px; right: 8px; }
.am-focus__body { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 22px; align-items: center; }
.am-focus__img { display: block; border-radius: 4px; overflow: hidden; box-shadow: 0 10px 24px rgba(30, 10, 40, .25); }
.am-focus__text { display: grid; gap: 10px; }
.am-focus__text strong { font-family: var(--am-serif); font-weight: 500; font-size: clamp(26px, 7vw, 32px); line-height: 1.05; }
.am-focus__text em { justify-self: start; display: inline-flex; align-items: center; gap: 8px; padding-bottom: 3px; font-style: normal; font-size: 17px; font-weight: 500; color: var(--am-kicker); border-bottom: 1.5px solid currentColor; }

/* ---------- works ---------- */
.am-heart { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; background: none; color: var(--am-ink); cursor: pointer; transition: transform .25s, color .25s; }
.am-heart:hover { transform: scale(1.1); }
.am-heart.is-on { color: #c2456e; }
html[data-theme='dark'] .am-heart.is-on { color: #f08ab0; }
.am-list { list-style: none; margin: 30px 0 0; padding: 0; display: grid; gap: 40px; }
.am-item { position: relative; }
.am-item__heart { position: absolute; right: 0; top: -6px; z-index: 2; }
.am-item__link { display: block; padding-top: 36px; }
.am-item__frame { position: relative; display: block; padding: 5px; background: var(--am-frame); box-shadow: 0 0 0 1px var(--am-frame-edge), 0 18px 36px rgba(30, 12, 40, .28); transition: transform .6s cubic-bezier(.22, 1, .36, 1), box-shadow .6s; }
.am-item__link:hover .am-item__frame { transform: translateY(-4px); box-shadow: 0 0 0 1px var(--am-frame-edge), 0 26px 46px rgba(30, 12, 40, .34); }
.am-item__frame .la-art { display: block; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.am-item--portrait .am-item__frame { width: min(100%, 72vw); margin: 0 auto; }
.am-item--square .am-item__frame { width: min(100%, 86vw); margin: 0 auto; }
.am-item__sold { position: absolute; left: 14px; top: 14px; padding: 4px 10px; background: rgba(30, 14, 34, .85); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.am-item__info { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-top: 18px; }
.am-item__title { display: grid; gap: 4px; min-width: 0; }
.am-item__title strong { font-family: var(--am-serif); font-weight: 500; font-size: clamp(25px, 6.6vw, 30px); line-height: 1.08; overflow-wrap: anywhere; }
.am-item__title small { font-size: 15px; color: var(--am-muted); }
.am-item__price { flex: none; display: inline-flex; align-items: center; gap: 10px; padding-top: 4px; font-family: var(--am-serif); font-weight: 600; font-size: clamp(21px, 5.6vw, 24px); }
.am-item__price svg { color: var(--am-accent-2); transition: transform .3s; }
.am-item__link:hover .am-item__price svg { transform: translateX(4px); }

/* grid view */
.am-list--grid { grid-template-columns: 1fr 1fr; gap: 26px 16px; align-items: end; }
.am-list--grid .am-item__link { padding-top: 34px; }
.am-list--grid .am-item__frame { width: 100%; padding: 3px; }
.am-list--grid .am-item__info { display: grid; gap: 6px; margin-top: 12px; }
.am-list--grid .am-item__title strong { font-size: 19px; }
.am-list--grid .am-item__title small { font-size: 12.5px; }
.am-list--grid .am-item__price { font-size: 17px; padding: 0; }
.am-list--grid .am-item__heart { width: 34px; height: 34px; top: -4px; }

.am-empty { margin: 40px 0; padding: 30px 20px; border-radius: 16px; background: var(--am-card); text-align: center; }
.am-empty p { margin: 0 0 6px; font-family: var(--am-serif); font-size: 26px; }
.am-empty span { color: var(--am-muted); }
.am-more { display: flex; justify-content: center; margin-top: 38px; }
.am-more__link { display: inline-flex; align-items: center; gap: 8px; padding-bottom: 3px; font-size: 18px; font-weight: 500; color: var(--am-kicker) !important; border-bottom: 1.5px solid currentColor; }

/* ---------- bottom bar (phones) ---------- */
.am-dock { position: fixed; z-index: 30; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(4, 1fr); padding: 10px 6px 8px; border-radius: 22px; background: var(--am-dock); border: 1px solid var(--am-field-border); box-shadow: 0 16px 40px rgba(30, 10, 40, .22); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.am-dock > * { display: grid; justify-items: center; gap: 4px; padding: 0; border: 0; background: none; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--am-ink); }
.am-dock > .is-on { color: var(--am-kicker); font-weight: 600; }
.am-dock > .is-on span { padding-bottom: 3px; border-bottom: 2px solid var(--am-accent-2); }
.am > footer, .am .lunaris-ft { padding-bottom: 96px; }

/* ---------- desktop ---------- */
@media (min-width: 980px) {
  .am-dock { display: none; }
  .am > footer, .am .lunaris-ft { padding-bottom: 0; }
  .am-top { padding: 30px 40px 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
  .am-top__row { display: contents; }
  .am-logo { grid-column: 1; }
  .am-nav { grid-column: 2; margin: 0; }
  .am-top__tools { grid-column: 3; justify-self: end; }
  .am-sheet { top: 64px; right: 40px; }
  .am-main { padding: 0 40px 80px; }
  .am-head { display: grid; grid-template-columns: 1fr minmax(0, 520px); column-gap: 60px; align-items: end; padding-top: 50px; }
  .am-head > .am-kicker, .am-head > .am-h1, .am-head > .am-sub { grid-column: 1; }
  .am-search { grid-column: 2; grid-row: 2; margin: 0; }
  .am-bar { grid-column: 2; grid-row: 3; margin: 14px 0 0; }
  .am-panel, .am-tabs { grid-column: 1 / -1; }
  .am-tabs { justify-content: flex-start; gap: 34px; margin-top: 40px; border-bottom: 1px solid var(--am-line); }
  .am-focus { margin-top: 34px; padding: 22px; }
  .am-focus__body { grid-template-columns: 340px 1fr; gap: 40px; }
  .am-focus__text strong { font-size: 44px; }
  .am-list--list { grid-template-columns: 1fr 1fr; gap: 60px 56px; margin-top: 46px; align-items: end; }
  .am-list--list .am-item--portrait .am-item__frame, .am-list--list .am-item--square .am-item__frame { width: 78%; }
  .am-list--grid { grid-template-columns: repeat(4, 1fr); gap: 44px 28px; margin-top: 46px; }
  .am-list--grid .am-item__title strong { font-size: 22px; }
  .am::before { width: 900px; left: -260px; top: -320px; }
  .am::after { width: 900px; right: -300px; top: 700px; }
}
@media (prefers-reduced-motion: reduce) { .am-in { animation: none; } }

/* ---------- phone fit (controls, tabs, focus link, dock labels) ---------- */
.am-bar { gap: 8px; }
.am-btn { height: 46px; padding: 0 14px; gap: 8px; font-size: 15px; }
.am-sort { flex: 1; min-width: 0; justify-content: space-between; padding-right: 12px; }
.am-sort select { width: 100%; min-width: 0; text-overflow: ellipsis; }
.am-views { gap: 5px; }
.am-views button { width: 44px; height: 46px; }
.am-tabs { justify-content: space-between; gap: 6px; }
.am-tabs button { padding: 6px 8px 12px; font-size: 17px; }
.am-focus__text em { font-size: 15px; white-space: nowrap; }
.am .am-dock > * { font-size: 13px; }
@media (max-width: 370px) { .am-tabs button { font-size: 15px; padding: 6px 4px 12px; } .am-btn { padding: 0 10px; } }
@media (min-width: 980px) { .am-sort { flex: 0 1 220px; } .am-tabs { justify-content: flex-start; gap: 34px; } .am-tabs button { font-size: 18px; } }

/* ---------- each work on its own stage (components/lunaris/Staged.tsx) ---------- */
.am-item__stage { display: block; }
.am-item__stage .lx-staged__bg { inset: -16% -14% -20% -14%; }
.am-item--portrait .am-item__stage .lx-staged__bg, .am-item--square .am-item__stage .lx-staged__bg { inset: -10% -6% -14% -6%; }
.am-list--grid .am-item__stage .lx-staged__bg { inset: -12% -10% -16% -10%; }
/* dark mode: the stage is painted on white paper – invert it so the paper vanishes and only its colours glow */
html[data-theme='dark'] .am .lx-staged__bg { filter: invert(1) hue-rotate(180deg) saturate(1.35) brightness(1.05); mix-blend-mode: lighten; }
html[data-theme='dark'] .am .lx-staged.has-stage .lx-staged__bg { animation-name: am-stage-in-dark; }
@keyframes am-stage-in-dark { to { opacity: .9; transform: none; } }

/* ---------- after an upload: the catalogue in the colours of the visitor's latest work (lib/lunaris/own-look.ts) ---------- */
html .am.is-own {
  --am-accent: var(--own-accent); --am-accent-2: var(--own-accent-2); --am-kicker: var(--own-kicker-l);
  --am-base: var(--own-base-l); --am-line: var(--own-line); --am-field-border: var(--own-border);
}
html[data-theme='dark'] .am.is-own { --am-accent: var(--own-accent); --am-accent-2: var(--own-accent-2); --am-kicker: var(--own-kicker-d); --am-base: var(--own-base-d); --am-line: rgba(255, 255, 255, .16); --am-field-border: rgba(255, 255, 255, .3); }
html:not([data-theme='dark']) .am.is-own.has-img-l { --am-img: var(--own-img-l); }
html[data-theme='dark'] .am.is-own.has-img-d { --am-img: var(--own-img-d); }
/* its own decoration (transparent paint) wins in both modes */
.am.is-own.has-deco { --am-img: var(--own-page); }
.am.is-own.has-deco::before, .am.is-own.has-deco::after { opacity: 1; }

/* light/dark switch: one clearly active button on a small glass pill */
.am .lx-theme { padding: 3px; border-radius: 99px; background: color-mix(in srgb, var(--am-base) 62%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--am-ink) 14%, transparent); gap: 2px; }
.am .lx-theme button { width: 34px; height: 34px; opacity: .62; color: var(--am-ink); }
.am .lx-theme button.is-on, html:not([data-theme='dark']) .am .lx-theme button.is-on:first-child { opacity: 1; background: var(--am-ink); color: var(--am-base); box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }

/* header ink follows the painted corner behind it (contrast.ts) */
.am-logo .lx-logo { transition: color .4s ease, text-shadow .4s ease; }
.am-top[data-logo-ink='light'] .am-logo .lx-logo { color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 2px 18px rgba(0, 0, 0, .35); }
.am-top[data-logo-ink='dark'] .am-logo .lx-logo { color: #1d1222; text-shadow: 0 0 2px rgba(255, 255, 255, .35), 0 2px 18px rgba(255, 255, 255, .55); }
.am-top[data-tools-ink='light'] .am-top__tools { --am-ink: #fff; --am-base: #24142a; color: #fff; }
.am-top[data-tools-ink='dark'] .am-top__tools { --am-ink: #1d1222; --am-base: #fbf3ec; color: #1d1222; }
.am-icon-btn { border-radius: 50%; background: color-mix(in srgb, var(--am-base) 55%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }

/* logo on mixed paint: a soft glass backing */
.am-logo .lx-logo { display: inline-block; border-radius: 14px; }
.am-top[data-logo-busy] .am-logo .lx-logo { margin: -6px -14px; padding: 6px 14px; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); text-shadow: none; }
.am-top[data-logo-busy][data-logo-ink='light'] .am-logo .lx-logo { background: rgba(24, 14, 28, .42); }
.am-top[data-logo-busy][data-logo-ink='dark'] .am-logo .lx-logo { background: rgba(255, 250, 246, .62); }
