/* ============================================================
   YOUR HIRED GUN — site styles
   Palette pulled from "The Wandering Traveller"
   ============================================================ */

:root {
  --ink: #131114;
  --ink-soft: #1d1a1f;
  --paper: #f2ede4;
  --paper-dim: #c9c2b6;
  --rose: #c4547e;
  --ochre: #d9a03f;
  --ember: #e0643c;
  --moss: #7a9a3d;
  --night: #2c4d8f;
  --line: rgba(242, 237, 228, 0.18);
  --mono: "Space Mono", "Courier New", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--ember); color: var(--ink); }

a { color: var(--paper); }
a:hover { color: var(--ember); }

/* ---------- shared layout ---------- */

.page {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.site-nav {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 0 20px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.site-nav .brand {
  font-size: 15px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--paper);
}
.site-nav .brand:hover { color: var(--ember); }

.site-nav .links {
  display: flex;
  gap: 22px;
}

.site-nav .links a {
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--paper-dim);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}
.site-nav .links a:hover,
.site-nav .links a.active {
  color: var(--ember);
  border-bottom-color: var(--ember);
}

.page-title {
  margin: 56px 0 8px;
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.15;
}
.page-title::after {
  content: "";
  display: block;
  width: 64px;
  height: 4px;
  margin-top: 18px;
  background: linear-gradient(90deg, var(--ember), var(--rose));
}

.page-sub {
  color: var(--paper-dim);
  margin: 16px 0 48px;
  max-width: 56ch;
}

.site-footer {
  margin-top: 96px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: var(--paper-dim);
  font-size: 13px;
  flex-wrap: wrap;
}
.site-footer a { color: var(--paper-dim); text-decoration: none; }
.site-footer a:hover { color: var(--ember); }

/* ============================================================
   LANDING PAGE — spotlight effect
   ============================================================ */

.landing {
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  cursor: crosshair;
}

.bg-layer {
  position: fixed;
  inset: 0;
  /* Fixed-filename fallback so the pre-JS background always matches the live
     theme (admin overwrites these files in place). This is what prevents any
     flash of an old background before main.js applies theme.json. */
  background-image: var(--bg-img, url("../images/site/bg-landing.jpg"));
  background-size: cover;
  /* favor the top of the painting so the figure over the hill stays visible */
  background-position: var(--bg-pos, center 18%);
}

/* Per-page fixed-filename fallbacks (kept in lockstep with data/theme.json). */
body.projectsbg .bg-layer {
  background-image: var(--bg-img, url("../images/site/bg-projects.jpg"));
}
body.artlinks .bg-layer {
  background-image: var(--bg-img, url("../images/site/bg-links.jpg"));
}

.bg-color { z-index: 0; }

/* Three nested masks, each a soft circle drifting around the cursor
   with its own rhythm — their union forms an irregular, morphing blob. */
.mask-wrap {
  position: fixed;
  inset: 0;
  z-index: 1;
}

.m1 {
  -webkit-mask-image: radial-gradient(circle var(--r1, 220px) at var(--x1, 50%) var(--y1, 50%),
    transparent 0%, rgba(0, 0, 0, 0.4) 60%, black 100%);
  mask-image: radial-gradient(circle var(--r1, 220px) at var(--x1, 50%) var(--y1, 50%),
    transparent 0%, rgba(0, 0, 0, 0.4) 60%, black 100%);
}
.m2 {
  -webkit-mask-image: radial-gradient(circle var(--r2, 220px) at var(--x2, 50%) var(--y2, 50%),
    transparent 0%, rgba(0, 0, 0, 0.4) 60%, black 100%);
  mask-image: radial-gradient(circle var(--r2, 220px) at var(--x2, 50%) var(--y2, 50%),
    transparent 0%, rgba(0, 0, 0, 0.4) 60%, black 100%);
}
.m3 {
  -webkit-mask-image: radial-gradient(circle var(--r3, 220px) at var(--x3, 50%) var(--y3, 50%),
    transparent 0%, rgba(0, 0, 0, 0.4) 60%, black 100%);
  mask-image: radial-gradient(circle var(--r3, 220px) at var(--x3, 50%) var(--y3, 50%),
    transparent 0%, rgba(0, 0, 0, 0.4) 60%, black 100%);
}

.bg-gray {
  position: absolute;
  inset: 0;
  filter: grayscale(1) contrast(1.05) brightness(0.82);
}

.bg-vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 45%, rgba(10, 8, 10, 0.55) 100%),
    linear-gradient(to top, rgba(10, 8, 10, 0.65), transparent 35%);
}

.landing-content {
  position: relative;
  z-index: 3;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

.landing h1 {
  margin: 0;
  font-size: clamp(40px, 9vw, 104px);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.05;
  color: var(--paper);
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.85), 0 0 4px rgba(0, 0, 0, 0.6);
}

.landing .tagline {
  margin: 20px 0 0;
  font-size: clamp(13px, 2vw, 16px);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--paper-dim);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.9);
}

.landing-nav {
  margin-top: 56px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
}

.landing-nav a {
  font-size: 14px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--paper);
  padding: 14px 30px;
  border: 1px solid rgba(242, 237, 228, 0.55);
  background: rgba(12, 10, 12, 0.45);
  backdrop-filter: blur(3px);
  transition: all 0.25s ease;
}
.landing-nav a:hover {
  border-color: var(--ember);
  color: var(--ember);
  background: rgba(12, 10, 12, 0.75);
  letter-spacing: 0.3em;
}

.landing-credit {
  position: absolute;
  bottom: 22px;
  left: 0;
  right: 0;
  z-index: 3;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(242, 237, 228, 0.55);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
}
.landing-credit a { color: inherit; text-decoration: none; }
.landing-credit a:hover { color: var(--ember); }

/* ============================================================
   ART LINKS
   ============================================================ */

.link-group-date {
  margin: 48px 0 10px;
  font-size: 12px;
  letter-spacing: 0.25em;
  color: var(--ochre);
}

.link-list { list-style: none; margin: 0; padding: 0; }

.link-list li { border-bottom: 1px solid var(--line); }

.link-list a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 4px;
  text-decoration: none;
  transition: padding-left 0.2s ease;
}
.link-list a:hover { padding-left: 14px; }
.link-list a:hover .link-title { color: var(--ember); }

.link-title { font-weight: 700; font-size: 17px; }

.link-host {
  font-size: 12px;
  color: var(--paper-dim);
  white-space: nowrap;
}

.link-note {
  display: block;
  font-size: 13px;
  color: var(--paper-dim);
  margin: -10px 4px 16px;
}

/* ============================================================
   PROJECTS
   ============================================================ */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 28px;
  margin-top: 8px;
}

/* ---- shared card chrome (projects / videos+music / feed) ---- */
.project-card, .video-card, .post-card {
  text-decoration: none;
  display: block;
  border: 1px solid var(--line);
  background: var(--ink-soft);
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.project-card:hover, .video-card:hover, .post-card:hover {
  border-color: var(--ember);
  transform: translateY(-4px);
}
.project-card .thumb img, .video-card .vthumb img, .post-card .post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.85);
  transition: transform 0.5s ease, filter 0.4s ease;
}
.project-card:hover .thumb img, .video-card:hover .vthumb img, .post-card:hover .post-thumb img {
  transform: scale(1.08);
  filter: grayscale(0);
}

.project-card .thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #000;
}

.project-card .meta { padding: 16px 18px 18px; }
.project-card .meta h3 {
  margin: 0 0 6px;
  font-size: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--paper);
}
.project-card .meta .date {
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--ochre);
}
.project-card .meta .count {
  font-size: 12px;
  color: var(--paper-dim);
  margin-top: 6px;
}

/* ============================================================
   VIDEOS
   ============================================================ */

/* ----- background spotlight (same treatment as the landing page) ----- */

body.spotlight-page .bg-layer {
  background-position: var(--bg-pos, center);
}
body.videos .bg-layer {
  background-image: var(--bg-img, url("../assets/videos-bg.jpg"));
}
body.music .bg-layer {
  background-image: var(--bg-img, url("../assets/videos-bg.jpg"));
}

/* the color layer gets a boost so the spotlight really pops
   against the darkened gray layer */
body.spotlight-page .bg-color {
  filter: saturate(1.9) brightness(1.35) contrast(1.05);
}
body.spotlight-page .bg-gray {
  filter: grayscale(1) contrast(1.05) brightness(0.55);
}

/* dark wash so the cards stay readable over the artwork */
.bg-dim {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: rgba(19, 17, 20, 0.5);
}

body.spotlight-page .page {
  position: relative;
  z-index: 3;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
  margin-top: 8px;
}

.video-card { cursor: pointer; } /* base/hover/thumb-img: see shared card chrome above */

.video-card .vthumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
}
.video-card .play-badge, .post-card .play-badge {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 4px;
  color: var(--paper);
  background: rgba(8, 6, 8, 0.65);
  border: 1px solid var(--paper-dim);
  border-radius: 50%;
  transition: border-color 0.25s ease, color 0.25s ease;
}
.video-card:hover .play-badge, .post-card:hover .play-badge { border-color: var(--ember); color: var(--ember); }
.video-card .play-badge { width: 54px; height: 54px; font-size: 18px; }

.video-card .meta { padding: 16px 18px 18px; }
.video-card .meta h3 {
  margin: 0 0 6px;
  font-size: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--paper);
  overflow-wrap: anywhere;
  word-break: break-word;
}
.video-card .meta .date {
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--ochre);
}
.video-card .meta .count {
  font-size: 12px;
  color: var(--paper-dim);
  margin-top: 6px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* video lightbox player */
.video-shell {
  width: min(92vw, 1100px);
  aspect-ratio: 16 / 9;
  cursor: default;
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.9);
}
.video-shell iframe,
.video-shell video {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
}

/* music lightbox player */
.music-shell {
  cursor: default;
  background: #000;
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.9);
}
.music-shell.video {
  width: min(92vw, 1100px);
  aspect-ratio: 16 / 9;
}
.music-shell.audio {
  width: min(92vw, 560px);
  height: 420px;
}
.music-shell.video iframe,
.music-shell.audio iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
}
/* platform-provided embeds (e.g. Bandcamp) keep their own dimensions */
.music-shell.raw {
  width: auto;
  height: auto;
  max-width: 92vw;
  background: transparent;
  box-shadow: none;
}
.music-shell.raw iframe {
  border: 0;
  display: block;
  max-width: 92vw;
}
/* uploaded audio file: cover art + title + native player */
.music-shell.file {
  width: min(92vw, 460px);
  background: var(--ink-soft);
  border: 1px solid var(--line);
}
.music-shell.file .music-cover {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  filter: grayscale(0.2);
}
.music-shell.file .music-title {
  padding: 16px 18px 4px;
  color: var(--paper);
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.music-shell.file audio {
  width: calc(100% - 36px);
  margin: 10px 18px 20px;
  display: block;
}

/* ----- single project view ----- */

.project-desc {
  color: var(--paper-dim);
  max-width: 62ch;
  margin: 16px 0 48px;
  white-space: pre-line;
}

.image-stack { display: grid; gap: 36px; }

.zoom-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
  cursor: zoom-in;
}
.zoom-frame img {
  display: block;
  width: 100%;
  transition: transform 0.45s ease;
  transform-origin: var(--zx, 50%) var(--zy, 50%);
}
.zoom-frame:hover img { transform: scale(1.6); }

.zoom-hint {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper-dim);
  margin-bottom: 24px;
}

/* ----- lightbox ----- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(8, 6, 8, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px;
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.9);
}

.empty-note { color: var(--paper-dim); margin-top: 40px; }

/* ============================================================
   ADMIN
   ============================================================ */

.admin-box {
  max-width: 560px;
  margin: 0 auto;
}

.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--paper-dim);
  margin-bottom: 8px;
}
.field input[type="text"],
.field input[type="password"],
.field input[type="url"],
.field textarea {
  width: 100%;
  background: var(--ink-soft);
  border: 1px solid var(--line);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 15px;
  padding: 12px 14px;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--ember);
}
.field textarea { min-height: 90px; resize: vertical; }
.field .hint { font-size: 12px; color: var(--paper-dim); margin-top: 6px; }

.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper);
  background: transparent;
  border: 1px solid var(--paper-dim);
  padding: 12px 26px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn:hover { border-color: var(--ember); color: var(--ember); }
.btn.primary { border-color: var(--ember); background: var(--ember); color: var(--ink); }
.btn.primary:hover { background: transparent; color: var(--ember); }
.btn.danger { border-color: #a03030; color: #d96a6a; padding: 6px 14px; font-size: 11px; }
.btn.danger:hover { background: #a03030; color: var(--paper); }
.btn:disabled { opacity: 0.4; cursor: wait; }

.admin-tabs {
  display: flex;
  gap: 8px;
  margin: 40px 0 32px;
  border-bottom: 1px solid var(--line);
}
.admin-tabs button {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: none;
  border: none;
  color: var(--paper-dim);
  padding: 12px 18px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.admin-tabs button.active {
  color: var(--ember);
  border-bottom-color: var(--ember);
}

.admin-section { display: none; }
.admin-section.active { display: block; }

.admin-list { list-style: none; padding: 0; margin: 0 0 40px; }
.admin-list li {
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.admin-list .item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.admin-list .item-btns { display: flex; gap: 8px; flex-shrink: 0; }
.admin-list li .item-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-list li .item-sub { color: var(--paper-dim); font-size: 12px; }

.btn.mini { padding: 6px 14px; font-size: 11px; }

/* inline edit form inside list items */
.edit-form {
  margin: 16px 0 8px;
  padding: 18px;
  border: 1px dashed var(--line);
}
.edit-imgs { display: flex; gap: 12px; flex-wrap: wrap; }
.edit-thumb { position: relative; display: inline-block; }
.edit-thumb img {
  width: 72px; height: 72px;
  object-fit: cover;
  border: 1px solid var(--line);
  display: block;
}
.edit-thumb button {
  position: absolute;
  top: -9px; right: -9px;
  width: 22px; height: 22px;
  line-height: 1;
  font-size: 14px;
  font-family: var(--mono);
  background: var(--ink);
  color: #d96a6a;
  border: 1px solid #a03030;
  border-radius: 50%;
  cursor: pointer;
}
.edit-thumb.rm img { opacity: 0.25; outline: 2px solid #a03030; }
.edit-thumb.rm button { background: #a03030; color: var(--paper); }

.status-msg {
  margin: 20px 0;
  padding: 12px 16px;
  font-size: 14px;
  border: 1px solid var(--line);
  display: none;
}
.status-msg.show { display: block; }
.status-msg.ok { border-color: var(--moss); color: #a8c873; }
.status-msg.err { border-color: #a03030; color: #d96a6a; }
.status-msg.busy { border-color: var(--ochre); color: var(--ochre); }

.divider { border: none; border-top: 1px solid var(--line); margin: 40px 0; }

h2.section-h {
  font-size: 15px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ochre);
  margin: 0 0 24px;
}

/* filename caption — pinned to the bottom-left corner of any image frame */
.file-cap {
  position: absolute;
  left: 0;
  bottom: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding: 6px 9px 5px;
  font-size: 11px;
  line-height: 1.25;
  letter-spacing: 0.03em;
  color: var(--paper);
  background: linear-gradient(to top, rgba(8, 6, 8, 0.92), rgba(8, 6, 8, 0.5) 72%, rgba(8, 6, 8, 0));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  z-index: 2;
}

.thumb-preview { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.thumb-preview .up-item {
  position: relative;
  width: 132px;
  height: 132px;
  border: 1px solid var(--line);
  background: #000;
  overflow: hidden;
}
.thumb-preview .up-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.thumb-preview .up-item.file {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink-soft);
}
.thumb-preview .up-item .glyph {
  font-size: 26px;
  letter-spacing: 0.08em;
  color: var(--paper-dim);
  opacity: 0.7;
}
/* legacy preview chip (kept for safety) */
.thumb-preview .pdf-chip {
  display: inline-block;
  padding: 8px 12px;
  border: 1px dashed var(--line);
  font-size: 12px;
  color: var(--paper-dim);
}

/* "Open interactive version" button on project pages */
.interactive-cta { margin: 18px 0 6px; }

@media (max-width: 600px) {
  .site-nav .links { gap: 14px; }
  .link-list a { flex-direction: column; gap: 4px; }
  .zoom-frame:hover img { transform: none; } /* no hover-zoom on touch */
}

/* ============ LINK LANDING PAGE ============ */
.link-hero {
  margin: 28px 0 8px;
  border: 1px solid var(--line);
  min-height: 60px;
}
.link-hero img { display: block; width: 100%; }
.link-hero video { display: block; width: 100%; }
.link-hero audio { display: block; width: 100%; margin-top: 4px; }
.link-hero a { display: block; line-height: 0; }
.link-visit { margin: 22px 0 34px; }

/* supporting-link rows in the admin edit form */
.sup-row { display: flex; gap: 8px; margin-bottom: 8px; }
.sup-row input { flex: 1; min-width: 0; }

/* ============ THEME PREVIEW (admin) ============ */
.tprev {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  max-width: 640px;
  border: 1px solid var(--line);
  margin: 6px 0 16px;
  cursor: crosshair;
}
.tprev .bg-layer, .tprev .mask-wrap, .tprev .bg-vignette { position: absolute; inset: 0; }
.tprev .bg-color