:root {
  --bg: #080706;
  --ink: #f6edd8;
  --muted: #b3a48c;
  --gold: #e6c36a;
  --gold-2: #b8892e;
  --line: rgba(230, 195, 106, 0.2);
  --bad: #e07060;
  --ok: #8ed67e;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.55);
  --font-display: "Fraunces", Georgia, serif;
  --font-ui: "Outfit", system-ui, sans-serif;
  --nav-h: 72px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { scroll-behavior: smooth; }
body {
  font: 16px/1.5 var(--font-ui);
  color: var(--ink);
  background: var(--bg);
  color-scheme: dark;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: none; color: #f3d98a; }

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.55'/></svg>");
}

.nav {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 5vw;
  background: rgba(8, 7, 6, 0.72);
  backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ink);
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--line), 0 8px 18px rgba(0,0,0,.45);
}
.nav-links { display: flex; gap: 0.2rem; }
.nav-links button {
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  cursor: pointer;
}
.nav-links button:hover { color: var(--ink); }
.nav-links button.is-on {
  color: #1a1208;
  background: linear-gradient(180deg, #f0d78a, var(--gold-2));
  font-weight: 600;
}
.nav-quiet { opacity: 0.75; }
.credits {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 0.35rem 0.75rem 0.35rem 0.45rem;
  border-radius: 999px;
  background: rgba(0,0,0,0.25);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
}
.credits strong { color: var(--gold); font-weight: 600; }
.coin {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff3c4, var(--gold) 45%, var(--gold-2));
  box-shadow: inset 0 0 0 2px rgba(120, 80, 20, 0.35);
}

.view { display: none; }
.view.is-on { display: block; animation: rise 0.45s ease; }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.hero {
  position: relative;
  min-height: calc(100svh - var(--nav-h));
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: url("/art/hero.jpg") center/cover no-repeat;
}
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8,6,5,0.92) 0%, rgba(8,6,5,0.55) 38%, rgba(8,6,5,0.12) 68%),
    linear-gradient(180deg, rgba(8,6,5,0.2) 0%, rgba(8,6,5,0.05) 40%, #080706 100%);
}
.hero-copy {
  position: relative;
  z-index: 1;
  padding: 5rem 5vw 4.5rem;
  max-width: 42rem;
}
.kicker {
  margin: 0 0 0.85rem;
  color: var(--gold);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 600;
}
.hero h1, .create-copy h2, .market-intro h2 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 1rem;
}
.hero h1 { font-size: clamp(2.6rem, 6vw, 5rem); }
.hero h1 em { font-style: italic; color: var(--gold); }
.hero p, .create-copy > p, .market-intro p {
  color: var(--muted);
  font-size: 1.12rem;
  margin: 0 0 1.6rem;
  max-width: 34rem;
}
.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 999px;
  padding: 0.85rem 1.35rem;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); border-color: var(--gold); }
.btn-primary {
  background: linear-gradient(180deg, #f0d78a, var(--gold-2));
  color: #1a1208;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(184, 137, 46, 0.28);
}
.btn-ghost { background: rgba(8, 7, 6, 0.45); backdrop-filter: blur(8px); }

.wrap { padding: 0 5vw 5rem; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin: 2.75rem 0 1.15rem;
}
.section-head h2, .subhead {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 500;
  margin: 0;
}
.subhead { font-size: 1.25rem; margin: 1.25rem 0 0.35rem; }
.section-head p { margin: 0.25rem 0 0; color: var(--muted); }

.featured {
  position: relative;
  margin-top: -3.5rem;
  border-radius: 24px;
  overflow: hidden;
  min-height: 380px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.featured img {
  width: 100%;
  height: 100%;
  min-height: 380px;
  object-fit: cover;
}
.featured-copy {
  position: absolute;
  inset: auto 0 0 0;
  padding: 4.5rem 2rem 2rem;
  background: linear-gradient(180deg, transparent, rgba(8,6,5,0.92) 70%);
  max-width: 36rem;
}
.featured-copy h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 500;
  margin: 0 0 0.5rem;
}
.featured-copy p { color: var(--muted); margin: 0 0 1.1rem; }

.shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
}
.cover {
  position: relative;
  display: block;
  border-radius: 16px;
  overflow: hidden;
  isolation: isolate;
  background: #120e0b;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transform: translateZ(0);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.cover:hover {
  transform: translateY(-8px);
  border-color: rgba(230, 195, 106, 0.55);
  box-shadow: 0 28px 50px rgba(0,0,0,0.6);
}
.cover-art {
  aspect-ratio: 3 / 4;
  width: 100%;
  object-fit: cover;
}
.cover-meta {
  position: absolute;
  inset: auto 0 0 0;
  padding: 2.4rem 0.9rem 0.9rem;
  background: linear-gradient(180deg, transparent, rgba(8,6,5,0.94));
}
.cover-meta h3 {
  margin: 0 0 0.2rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cover-meta p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cover-play {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}
.cover:hover .cover-play { opacity: 1; transform: none; }
.badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1a1208;
  background: var(--gold);
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
}
.badge.ghost {
  background: rgba(8,6,5,0.72);
  color: var(--gold);
  border: 1px solid var(--line);
}

.create-hero {
  min-height: 72vh;
  background:
    linear-gradient(90deg, rgba(8,6,5,0.88), rgba(8,6,5,0.55) 55%, rgba(8,6,5,0.3)),
    url("/art/cover-blank.jpg") center/cover no-repeat;
  display: flex;
  align-items: flex-end;
}
.create-copy {
  padding: 5rem 5vw 3rem;
  max-width: 46rem;
}
.create-copy h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.create-copy textarea, .workshop textarea, .remix-bar input, .remix-bar select, .workshop select {
  width: 100%;
  background: rgba(8, 7, 6, 0.7);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem 1.1rem;
  color: var(--ink);
  outline: none;
}
.create-copy textarea {
  min-height: 140px;
  resize: vertical;
  margin: 0 0 1rem;
  backdrop-filter: blur(10px);
}
.create-copy textarea:focus,
.workshop textarea:focus,
.remix-bar input:focus,
.remix-bar select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(230, 195, 106, 0.18);
}
.fine { color: var(--muted); font-size: 0.9rem; }
.err { color: var(--bad); }
.ok { color: var(--ok); }

.remix-bar {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 0.7rem;
  align-items: center;
  background: rgba(18, 14, 11, 0.7);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1rem;
}
.market-intro { padding: 3.5rem 0 0.5rem; max-width: 40rem; }
.market-intro h2 { font-size: clamp(2.2rem, 5vw, 3.4rem); }

.workshop-hero {
  padding: 3.2rem 0 0.5rem;
  max-width: 36rem;
}
.workshop-hero h2 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 500;
  margin: 0 0 0.6rem;
}
.workshop-hero p { color: var(--muted); margin: 0; }
.workshop {
  background:
    linear-gradient(180deg, rgba(18, 14, 11, 0.88), rgba(18, 14, 11, 0.94)),
    url("/art/cover-remix.jpg") center/cover no-repeat;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 1.25rem;
}
.workshop textarea,
.workshop select {
  background: rgba(8, 7, 6, 0.9);
}
.workshop .row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.5rem 0; }
.workshop select, .workshop .row .btn { flex: 0 0 auto; }
.workshop #editor {
  min-height: 280px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
  border-radius: 12px;
}
.workshop #msg { min-height: 90px; margin-top: 0.4rem; }

.sessions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.85rem;
}
.session-card {
  display: block;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(18, 14, 11, 0.72);
  color: inherit;
  text-decoration: none;
}
.session-card:hover { border-color: var(--gold); }
.session-card .badge { position: static; }
.session-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.45rem;
}
.session-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  margin: 0 0 0.25rem;
}
.session-card p { margin: 0; color: var(--muted); font-size: 0.88rem; }
.empty {
  color: var(--muted);
  padding: 1rem 0 2rem;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 5vw 2.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
}
.linkish {
  background: none;
  border: 0;
  color: var(--gold);
  cursor: pointer;
  padding: 0;
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1c1814;
  border: 1px solid var(--gold);
  color: var(--ink);
  padding: 0.75rem 1.15rem;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  z-index: 90;
}
.toast.show { opacity: 1; }

.cover.as-button {
  width: 100%;
  text-align: left;
  cursor: pointer;
  padding: 0;
  background: #120e0b;
  appearance: none;
  -webkit-appearance: none;
}
.cover-cta {
  margin-top: 0.45rem;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 600;
}

@media (hover: none) {
  .cover-play { opacity: 1; transform: none; }
}

@media (max-width: 800px) {
  .nav { padding: 0 4vw; height: 64px; }
  .nav-links { flex: 1; justify-content: flex-end; }
  .nav-links button { padding: 0.4rem 0.65rem; font-size: 0.88rem; }
  .nav-quiet { display: none; }
  .brand { font-size: 1.15rem; }
  .hero-copy, .create-copy, .wrap, footer { padding-left: 4vw; padding-right: 4vw; }
  .hero { min-height: 78svh; }
  .hero-bg { background-position: center 20%; }
  .hero-copy { padding-top: 2.5rem; padding-bottom: 3rem; }
  .featured { margin-top: -1.5rem; min-height: 280px; }
  .featured img { min-height: 280px; }
  .remix-bar { grid-template-columns: 1fr; }
  .credits { display: none; }
  .shelf { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.85rem; }
}

@media (prefers-reduced-motion: reduce) {
  .view.is-on, .cover, .btn { animation: none; transition: none; }
}

/* Project/account controls retain the existing cabinet typography and colors. */
[hidden] { display: none !important; }
button:disabled, input:disabled { opacity: 0.5; cursor: not-allowed; }
.account-panel { padding-top: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.account-panel h2 { font-family: var(--serif, Georgia, serif); margin: 0.5rem 0; }
.account-panel p { color: var(--muted); }
.account-fields { display: grid; grid-template-columns: repeat(2, minmax(160px, 320px)); gap: 1rem; margin: 1rem 0; }
.account-fields label, .field-label { display: block; color: var(--muted); font-size: 0.9rem; }
.account-fields input, .account-fields select, .create-copy > input, .create-copy > select {
  display: block; width: 100%; padding: 0.75rem; margin-top: 0.4rem; border: 1px solid var(--line);
  border-radius: 6px; background: #181410; color: var(--ink);
}
.create-copy > input, .create-copy > select { margin-bottom: 1rem; }
.invite-details { margin-top: 1rem; }
.invite-details summary { cursor: pointer; color: var(--gold); }
.check-label { display: flex; gap: 0.65rem; align-items: center; margin: 1rem 0; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.confirmation { position: sticky; top: 70px; z-index: 80; max-width: 720px; margin: 1rem auto; padding: 1.25rem; background: #241d15; border: 1px solid var(--gold); border-radius: 8px; }
.confirmation h3 { margin-top: 0; }
.document-identity { overflow-wrap: anywhere; color: var(--gold); font-size: 0.9rem; }
.workshop .row { margin-bottom: 0.8rem; }
.workshop select { max-width: 100%; min-width: 0; }
.workshop #editor { box-sizing: border-box; width: 100%; min-height: 360px; }
.workshop #editor[readonly] { opacity: 0.65; }
.file-button { position: relative; overflow: hidden; cursor: pointer; }
.file-button input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.file-button:focus-within { outline: 2px solid var(--gold); outline-offset: 3px; }
.preview-result { margin: 1rem 0; color: var(--muted); }
.history-row { padding-top: 1rem; border-top: 1px solid var(--line); }
@media (max-width: 600px) {
  .account-fields { grid-template-columns: 1fr; }
  .confirmation { margin: 0.7rem 4vw; }
  .workshop .row > select { width: 100%; }
}

/* Publishing: the workshop's review block and the reviewer queue, in the same ink and gold. */
.workshop .subhead { margin-top: 1.6rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
#submitForm textarea, #appealForm textarea, #unpublishForm textarea, .queue-card textarea {
  box-sizing: border-box; width: 100%; margin-top: 0.4rem; padding: 0.7rem; border: 1px solid var(--line);
  border-radius: 6px; background: #181410; color: var(--ink); font: inherit;
}
.review-notes-list { margin: 0.6rem 0; padding-left: 1.1rem; color: var(--muted); }
.review-notes-list li { margin: 0.3rem 0; overflow-wrap: anywhere; }
.queue { display: grid; gap: 1rem; margin: 1.2rem 0; }
.queue-card { padding: 1.1rem 1.25rem; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 255, 255, 0.03); }
.queue-card h3 { margin: 0 0 0.3rem; font-family: var(--font-display); }
.queue-card .blurb { color: var(--ink); margin: 0.5rem 0; overflow-wrap: anywhere; }
.queue-card .flags { margin: 0.5rem 0; padding-left: 1.1rem; color: var(--muted); font-size: 0.9rem; }
.queue-card .flags strong { color: var(--gold); }
.queue-card .row { margin-top: 0.8rem; }

/* Administrator invites: one code shown once, plus two read-only tables, in the same ink and gold. */
.admin-panel { margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.admin-panel .subhead { margin-top: 0; }
.admin-invite-row { align-items: flex-end; }
.admin-panel select, #inviteCode {
  padding: 0.6rem 0.7rem; border: 1px solid var(--line); border-radius: 6px; background: #181410; color: var(--ink);
}
.admin-panel select { margin-top: 0.35rem; display: block; }
#inviteCode { flex: 1 1 24rem; min-width: 0; max-width: 100%; font-family: ui-monospace, Consolas, monospace; }
.invite-result { margin: 0.9rem 0; padding: 0.9rem 1rem; border: 1px solid var(--gold); border-radius: 8px; background: rgba(230, 195, 106, 0.06); }
.admin-table { overflow-x: auto; margin-top: 1rem; }
.admin-grid { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.admin-grid caption { text-align: left; color: var(--gold); font-weight: 600; padding-bottom: 0.35rem; }
.admin-grid th, .admin-grid td { text-align: left; padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.admin-grid th { color: var(--muted); font-weight: 600; }
.admin-grid td { color: var(--ink); }
