/* Opsentra Creatr -- Gallery theme system (spec 7j).
 *
 * One set of custom-property tokens, two themes:
 *   NOIR (default)  near-black walls, warm-white serif headlines, vermillion accent
 *   WHITE GALLERY   the same tokens re-valued: warm-white walls, dark ink
 * The active theme is <html data-theme="noir|white">, set by gallery.js before
 * first paint (stored choice > OS preference > NOIR). Every surface reads ONLY
 * these tokens -- a third theme is one more [data-theme] block, nothing else.
 *
 * All text/ground pairs below were checked against WCAG AA (>= 4.5:1) on both
 * --wall and --wall-2. The accent is a deeper vermillion in WHITE GALLERY for
 * that reason; the hue is the same.
 *
 * The Gallery mark (wax seal) is NOT themed here -- it is never recolored;
 * the landing swaps between the two supplied lockups (see .seal-lockup).
 */

:root,
:root[data-theme="noir"] {
  color-scheme: dark;
  --wall: #0D0C0B;        /* the room */
  --wall-2: #161513;      /* a raised panel, barely off the wall */
  --ink: #F2EDE4;         /* warm white -- headlines, primary text */
  --ink-2: #B8B1A6;       /* wall text, secondary copy */
  --ink-3: #8F887D;       /* placard meta, captions */
  --rule: #2E2B27;        /* hairlines */
  --field-border: #4A453F;
  --accent: #E8452C;      /* vermillion */
  --on-accent: #0D0C0B;
  --ok: #86C79A;
  --err: #F2836F;
  --plate-mat: #050505;   /* ground behind photography while it loads */
}

:root[data-theme="white"] {
  color-scheme: light;
  --wall: #F5F1EA;
  --wall-2: #FCFAF6;
  --ink: #16130F;
  --ink-2: #4A453E;
  --ink-3: #6A645B;
  --rule: #D9D1C4;
  --field-border: #B9B0A2;
  --accent: #C2321B;
  --on-accent: #FFFFFF;
  --ok: #2C7342;
  --err: #B3261E;
  --plate-mat: #E9E3D8;
}

:root {
  --font-display: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-text: "Manrope", "Avenir Next", "Segoe UI", system-ui, sans-serif;

  /* Vast whitespace: the scale skews large on purpose. */
  --s1: 4px; --s2: 8px; --s3: 16px; --s4: 24px; --s5: 40px; --s6: 64px; --s7: 104px; --s8: 168px;
  --gutter: clamp(16px, 5vw, 64px);
  --measure: 36rem;
  --hang-width: 1120px;
}

* { box-sizing: border-box; }
html { background: var(--wall); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--wall);
  color: var(--ink-2);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}
a { color: var(--ink); text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ── Masthead + the brand slot ─────────────────────────────────────────── */
.masthead {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4);
  padding: var(--s4) var(--gutter);
}
.masthead-nav { display: flex; align-items: center; gap: var(--s4); }
.masthead-nav a { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; text-decoration: none; color: var(--ink-3); }
.masthead-nav a:hover { color: var(--ink); }

/* The slot where the Gallery mark hangs: the wax seal, as supplied in
 * /brand-assets/gallery (never redrawn, recolored, or cropped).
 * BRAND BOUNDARY: GALLERY = the public marketplace (storefront, creator
 * public pages, signup, landing, feed). The creator dashboard / logged-in
 * tools are OPSENTRA CREATR and keep the Apex Aperture -- see
 * creatr-mark.js, which only dashboard.html loads. */
.brand-slot { display: inline-block; line-height: 0; flex: none; text-decoration: none; }
.brand-slot img { display: block; width: var(--seal, 44px); height: var(--seal, 44px); border-radius: 22%; }

/* Landing hero lockup: the supplied plate for the current wall. */
.seal-lockup { display: block; margin: 0 auto var(--s5); width: 100%; height: auto; }
.seal-lockup.noir { max-width: 720px; }
.seal-lockup.white { max-width: 300px; display: none; }
:root[data-theme="white"] .seal-lockup.noir { display: none; }
:root[data-theme="white"] .seal-lockup.white { display: block; }

/* ── Exhibition type ───────────────────────────────────────────────────── */
.exhibit { max-width: var(--hang-width); margin: 0 auto; padding: var(--s7) var(--gutter) var(--s8); }
.exhibit-narrow { max-width: 640px; }
.exhibit-title, h1, h2.display {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.exhibit-title { font-size: clamp(2.75rem, 8vw, 6rem); line-height: 1; margin: 0 0 var(--s4); }
.exhibit-title.small { font-size: clamp(2.25rem, 5.5vw, 3.75rem); }
.wall-text { max-width: var(--measure); font-size: 1.0625rem; color: var(--ink-2); margin: 0 0 var(--s5); }

/* The museum label: small caps line, serif title, quiet meta. */
.placard-label {
  display: block;
  font-family: var(--font-text); font-size: 11.5px; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3);
  margin: 0 0 var(--s3);
}
.placard-label .dot { color: var(--accent); }
.placard-title { font-family: var(--font-display); font-weight: 500; font-size: 1.75rem; line-height: 1.15; color: var(--ink); margin: 0 0 var(--s2); }
.placard-meta { font-size: 13px; color: var(--ink-3); letter-spacing: .02em; }
.section-hd { /* a placard label that opens a room */
  font-size: 11.5px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3);
  margin: var(--s7) 0 var(--s5); padding-top: var(--s3); border-top: 1px solid var(--rule);
}

/* ── Art plates: full-bleed photography ────────────────────────────────── */
.plate {
  position: relative;
  width: 100vw; margin-left: calc(50% - 50vw);
  background: var(--plate-mat);
  aspect-ratio: 16 / 9; max-height: 82vh;
  overflow: hidden;
}
.plate img { display: block; width: 100%; height: 100%; object-fit: cover; }
.plate + .plate-caption { padding: var(--s3) var(--gutter) 0; }
.plate-caption { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }

/* ── The hang: works on the wall, each with a placard ──────────────────── */
.hang { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: var(--s7) var(--s6); }
.work { border-top: 1px solid var(--rule); padding-top: var(--s4); }
.work p { margin: 0 0 var(--s4); color: var(--ink-2); font-size: 15px; }
.work .price { font-family: var(--font-display); font-size: 1.5rem; color: var(--ink); margin: 0 0 var(--s4); font-variant-numeric: lining-nums tabular-nums; }

/* A panel: same placard idiom, for app sections (dashboard, forms). */
.panel { border-top: 1px solid var(--rule); padding: var(--s4) 0 var(--s6); }
.panel > h2 {
  font-family: var(--font-text); font-size: 11.5px; font-weight: 600; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-3); margin: 0 0 var(--s4);
}

/* ── Controls ──────────────────────────────────────────────────────────── */
button, input, select, textarea { font-family: inherit; font-size: 15px; color: var(--ink); }
button, .btn {
  display: inline-block;
  background: var(--accent); color: var(--on-accent);
  border: 1px solid var(--accent); border-radius: 0;
  padding: 12px 22px;
  font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
button:hover, .btn:hover { background: transparent; color: var(--accent); }
button:disabled { opacity: .5; cursor: default; }
button.btn-quiet, .btn-quiet { background: transparent; color: var(--ink-2); border-color: var(--field-border); }
button.btn-quiet:hover, .btn-quiet:hover { color: var(--ink); border-color: var(--ink); }
button.sel, button.active { background: var(--ink); color: var(--wall); border-color: var(--ink); }

input, select, textarea {
  width: 100%;
  background: transparent;
  border: 0; border-bottom: 1px solid var(--field-border); border-radius: 0;
  padding: 10px 0; margin-bottom: var(--s3);
}
select { padding: 10px 4px; }
select option { background: var(--wall-2); color: var(--ink); }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:focus, select:focus, textarea:focus { outline: none; border-bottom-color: var(--accent); }
label { display: block; font-size: 11.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin: var(--s4) 0 var(--s1); }

.pill {
  display: inline-block; border: 1px solid var(--field-border); color: var(--ink-2);
  font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  padding: 5px 12px;
}

table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 12px 8px 12px 0; border-bottom: 1px solid var(--rule); font-size: 14.5px; }
th { font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
td { color: var(--ink-2); }

.stat { font-family: var(--font-display); font-size: clamp(2.5rem, 6vw, 3.5rem); font-weight: 500; line-height: 1.05; color: var(--ink); font-variant-numeric: lining-nums; }
.stat-label { font-size: 13px; color: var(--ink-3); }

.msg { font-size: 13.5px; color: var(--ok); margin-top: var(--s2); }
.error { font-size: 13.5px; color: var(--err); margin-top: var(--s2); }
.empty { color: var(--ink-3); padding: var(--s6) 0; }

/* ── Theme toggle (settings) ───────────────────────────────────────────── */
.theme-toggle { display: inline-flex; border: 1px solid var(--field-border); }
.theme-toggle button { background: transparent; color: var(--ink-2); border: 0; padding: 10px 16px; }
.theme-toggle button + button { border-left: 1px solid var(--field-border); }
.theme-toggle button[aria-pressed="true"] { background: var(--ink); color: var(--wall); }
.theme-toggle button:hover:not([aria-pressed="true"]) { color: var(--ink); }

/* ── Foot ──────────────────────────────────────────────────────────────── */
.site-foot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4); flex-wrap: wrap;
  padding: var(--s5) var(--gutter); border-top: 1px solid var(--rule);
  font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3);
}

@media (max-width: 640px) {
  .exhibit { padding-top: var(--s6); padding-bottom: var(--s7); }
  .section-hd { margin-top: var(--s6); }
  .hang { gap: var(--s6); }
}
@media (prefers-reduced-motion: reduce) {
  body, button, .btn { transition: none; }
}
