/* Luma Events — Video Archive
   Palette: warm black canvas, ivory type, a single brass accent used only for the active state and primary action. */
:root {
  --ink: #14110d;
  --panel: #1b1712;
  --raise: #262019;
  --line: rgba(241, 234, 224, 0.09);
  --line-strong: rgba(241, 234, 224, 0.2);
  --ivory: #f1eae0;
  --sand: #a89c8a;
  --dim: #6f6558;
  --brass: #c9a66b;
  --brass-ink: #1a1408;
  --danger: #d47b6a;
  --ok: #8fb58a;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Jost", "Helvetica Neue", Arial, sans-serif;
  --r: 4px;
  --rail: 280px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ink); color: var(--ivory); font-family: var(--sans); font-weight: 300; font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
::selection { background: var(--brass); color: var(--brass-ink); }
:focus-visible { outline: 1.5px solid var(--brass); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; margin: 0; line-height: 1.1; }

.boot { min-height: 100dvh; display: grid; place-items: center; }
.boot img { width: 160px; opacity: .25; }

/* ---------- gates: login / setup ---------- */
.gate { min-height: 100dvh; display: grid; grid-template-columns: 1.1fr 1fr; }
.gate-art { position: relative; border-right: 1px solid var(--line); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.gate-art::before { content: ""; position: absolute; inset: 0; background:
  radial-gradient(ellipse 70% 50% at 20% 10%, rgba(201,166,107,.14), transparent 60%),
  radial-gradient(ellipse 60% 60% at 90% 100%, rgba(241,234,224,.05), transparent 60%); }
.gate-art > * { position: relative; }
.gate-art .logo { width: 220px; }
.gate-art h1 { font-size: clamp(38px, 5vw, 64px); font-style: italic; font-weight: 500; max-width: 12ch; }
.gate-art p { color: var(--sand); max-width: 40ch; margin: 18px 0 0; }
.gate-form { display: grid; place-items: center; padding: 48px 32px; }
.gate-form form { width: 100%; max-width: 360px; }
.gate-form h2 { font-size: 30px; margin-bottom: 4px; }
.gate-form .sub { color: var(--sand); margin: 0 0 28px; }
.gate-art .foot { color: var(--dim); font-size: 13px; }

/* ---------- form atoms ---------- */
.field { display: block; margin-bottom: 16px; }
.field span { display: block; font-size: 13px; color: var(--sand); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--r);
  padding: 10px 12px; font-weight: 300; transition: border-color .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brass); }
.field textarea { min-height: 80px; resize: vertical; }
.field select option { background: var(--panel); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: var(--r);
  border: 1px solid var(--line-strong); background: transparent; font-weight: 400; letter-spacing: .01em; transition: background .15s, border-color .15s, color .15s; white-space: nowrap; }
.btn:hover { background: var(--raise); border-color: var(--sand); }
.btn.primary { background: var(--brass); color: var(--brass-ink); border-color: var(--brass); font-weight: 500; }
.btn.primary:hover { background: #d9b67a; }
.btn.danger { color: var(--danger); border-color: rgba(212,123,106,.4); }
.btn.danger:hover { background: rgba(212,123,106,.12); }
.btn.ghost { border-color: transparent; color: var(--sand); }
.btn.ghost:hover { color: var(--ivory); }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
.err { color: var(--danger); font-size: 13px; min-height: 1.3em; margin: -6px 0 12px; }

/* ---------- app frame ---------- */
.frame { display: grid; grid-template-rows: 56px 1fr; min-height: 100dvh; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 0 20px; border-bottom: 1px solid var(--line); background: var(--ink); position: sticky; top: 0; z-index: 20; }
.topbar .logo { height: 24px; }
.topbar .title { font-family: var(--serif); font-size: 19px; font-style: italic; color: var(--sand); padding-left: 16px; border-left: 1px solid var(--line-strong); line-height: 1; }
.topbar .spacer { flex: 1; }
.topbar .who { color: var(--sand); font-size: 13px; }
.topbar .who b { color: var(--ivory); font-weight: 400; }
.menu-btn { display: none; }
.rail-foot { display: none; }

.main { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 0; }

/* ---------- event rail ---------- */
.rail { border-right: 1px solid var(--line); background: var(--panel); overflow-y: auto; height: calc(100dvh - 56px); position: sticky; top: 56px; }
.rail-head { padding: 16px 16px 8px; display: flex; align-items: center; justify-content: space-between; }
.rail-head h3 { font-size: 22px; font-style: italic; }
.rail .search { padding: 0 16px 12px; }
.rail .search input { width: 100%; background: var(--ink); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; font-size: 14px; font-weight: 300; }
.rail .search input:focus { outline: none; border-color: var(--brass); }
.rail-item { display: block; width: 100%; text-align: left; background: none; border: 0; border-left: 2px solid transparent; padding: 9px 16px 9px 14px; color: var(--sand); }
.rail-item:hover { color: var(--ivory); background: rgba(241,234,224,.03); }
.rail-item.active { color: var(--ivory); border-left-color: var(--brass); background: rgba(201,166,107,.07); }
.rail-item .n { font-family: var(--serif); font-size: 18px; line-height: 1.2; color: inherit; display: block; }
.rail-item .m { font-size: 12px; color: var(--dim); display: flex; justify-content: space-between; gap: 8px; }
.rail-item.active .m { color: var(--sand); }
.rail-year { font-size: 12px; color: var(--dim); padding: 14px 16px 4px; letter-spacing: .06em; border-top: 1px solid var(--line); margin-top: 6px; }
.rail-year:first-of-type { border-top: 0; margin-top: 0; }

/* ---------- content ---------- */
.content { padding: 28px 32px 80px; min-width: 0; }
.ev-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.ev-head h1 { font-size: clamp(30px, 3.6vw, 48px); font-style: italic; }
.ev-head .meta { color: var(--sand); margin-top: 6px; font-size: 14px; }
.ev-head .meta em { font-style: normal; color: var(--dim); }
.ev-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.filters select, .filters input { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 7px 10px; font-size: 13px; font-weight: 300; }
.filters .count { margin-left: auto; color: var(--dim); font-size: 13px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.tile { background: none; border: 0; padding: 0; text-align: left; color: inherit; display: block; width: 100%; }
.tile .frame16 { position: relative; aspect-ratio: 16/9; background: var(--panel); border: 1px solid var(--line); overflow: hidden; border-radius: var(--r); }
.tile .frame16 img { width: 100%; height: 100%; object-fit: cover; }
.tile .frame16 .noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--dim); font-family: var(--serif); font-style: italic; font-size: 18px; }
.tile .frame16 .dur { position: absolute; right: 8px; bottom: 8px; background: rgba(20,17,13,.85); padding: 2px 7px; border-radius: 3px; font-size: 12px; }
.tile .frame16 .play { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .15s; background: rgba(20,17,13,.35); }
.tile .frame16 .play span { width: 46px; height: 46px; border-radius: 50%; background: var(--ivory); color: var(--ink); display: grid; place-items: center; }
.tile:hover .play, .tile:focus-visible .play { opacity: 1; }
.tile .t { margin: 10px 0 2px; font-weight: 400; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .s { font-size: 12.5px; color: var(--dim); display: flex; gap: 6px; flex-wrap: wrap; }
.tile .s b { color: var(--sand); font-weight: 400; }
.pill { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 20px; border: 1px solid var(--line-strong); color: var(--sand); }

.empty { padding: 60px 20px; text-align: center; color: var(--sand); border: 1px dashed var(--line-strong); border-radius: var(--r); }
.empty h2 { font-style: italic; font-size: 30px; margin-bottom: 8px; }
.empty p { margin: 0 0 18px; }

/* ---------- dashboard (no event selected) ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 28px; }
.stat { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.stat .v { font-family: var(--serif); font-size: 32px; line-height: 1; }
.stat .l { font-size: 13px; color: var(--sand); margin-top: 4px; }

/* ---------- drawer / modal ---------- */
.scrim { position: fixed; inset: 0; background: rgba(10,8,5,.7); z-index: 40; display: grid; place-items: center; padding: 20px; animation: fade .15s; }
@keyframes fade { from { opacity: 0 } }
.modal { background: var(--panel); border: 1px solid var(--line-strong); border-radius: 6px; width: 100%; max-width: 520px; max-height: calc(100dvh - 40px); overflow-y: auto; padding: 24px; animation: rise .18s; }
@keyframes rise { from { transform: translateY(8px); opacity: 0 } }
.modal.wide { max-width: 980px; }
.modal h2 { font-size: 28px; font-style: italic; margin-bottom: 18px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.modal .foot .left { margin-right: auto; }

/* ---------- player ---------- */
.player { display: grid; grid-template-columns: 1fr 300px; gap: 20px; }
.player video { width: 100%; aspect-ratio: 16/9; background: #000; border-radius: var(--r); }
.player .side h2 { font-size: 24px; margin-bottom: 4px; }
.player dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; margin: 14px 0; }
.player dt { color: var(--dim); }
.player dd { margin: 0; color: var(--sand); word-break: break-word; }
.player .tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 14px; }
.player .btns { display: flex; flex-direction: column; gap: 8px; }

/* ---------- upload ---------- */
.drop { display: block; cursor: pointer; border: 1.5px dashed var(--line-strong); border-radius: var(--r); padding: 28px; text-align: center; color: var(--sand); transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--brass); background: rgba(201,166,107,.06); }
.drop input { display: none; }
.drop b { color: var(--ivory); font-weight: 400; }
.queue { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; max-height: 40vh; overflow-y: auto; }
.q { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; font-size: 13px; }
.q .qn { display: flex; justify-content: space-between; gap: 10px; }
.q .qn b { font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q .qn span { color: var(--dim); white-space: nowrap; }
.q .bar { height: 3px; background: var(--raise); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.q .bar i { display: block; height: 100%; width: 0; background: var(--brass); transition: width .2s; }
.q.done .bar i { background: var(--ok); }
.q.fail .bar i { background: var(--danger); width: 100% !important; }
.q .st { color: var(--dim); margin-top: 4px; }
.q.fail .st { color: var(--danger); }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--dim); font-weight: 400; font-size: 12.5px; }
td .btn { margin-right: 4px; }
.off { color: var(--dim); text-decoration: line-through; }

/* ---------- toasts ---------- */
#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: var(--ivory); color: var(--ink); padding: 10px 16px; border-radius: var(--r); font-size: 14px; animation: rise .18s; box-shadow: 0 6px 24px rgba(0,0,0,.4); }
.toast.bad { background: var(--danger); color: #fff; }

/* ---------- mobile ---------- */
@media (max-width: 900px) {
  .gate { grid-template-columns: 1fr; }
  .gate-art { border-right: 0; border-bottom: 1px solid var(--line); padding: 28px 24px; min-height: 0; gap: 20px; }
  .gate-art .logo { width: 150px; }
  .gate-art h1 { font-size: 34px; }
  .gate-art .foot { display: none; }
  .gate-form { padding: 28px 24px 48px; align-items: start; }
  .main { grid-template-columns: 1fr; }
  .rail { position: fixed; top: 56px; left: 0; bottom: 0; width: min(85vw, 320px); z-index: 30; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.5); }
  .rail.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .topbar .title { display: none; }
  .topbar .desk { display: none; }
  .topbar .logo { height: 22px; margin-left: auto; }
  .rail { display: flex; flex-direction: column; }
  .rail-foot { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: auto; padding: 14px 12px; border-top: 1px solid var(--line); font-size: 13px; }
  .rail-foot .who { width: 100%; color: var(--sand); margin-bottom: 6px; padding: 0 4px; }
  .content { padding: 20px 16px 80px; }
  .player { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; }
  .modal { padding: 18px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
