/* Client deliveries (d/index.html) and Ali's upload page (send/index.html, which adds send.css).
   The look of the main site: black and white, Clash Display, DM Mono, one serif italic word. */

@font-face { font-family: "Clash Display"; src: url("/fonts/ClashDisplay-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Clash Display"; src: url("/fonts/ClashDisplay-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Clash Display"; src: url("/fonts/ClashDisplay-Semibold.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --bg: #0a0a0a; --fg: #fff; --soft: rgba(255, 255, 255, 0.66); --faint: rgba(255, 255, 255, 0.42);
  --line: rgba(255, 255, 255, 0.16); --card: #131313; --ok: #4ade80; --wait: #f5c542; --bad: #ff6b6b;
  --pad: clamp(16px, 5.56vw, 80px); --gap: clamp(12px, 1.4vw, 20px);
  --display: "Clash Display", "Helvetica Neue", Arial, sans-serif;
  --mono: "DM Mono", ui-monospace, Menlo, Consolas, monospace;
  --serif: "Instrument Serif", Georgia, serif;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.dv { margin: 0; min-height: 100svh; display: flex; flex-direction: column; background: var(--bg); color: var(--fg); font: 400 15px/1.55 var(--mono); -webkit-font-smoothing: antialiased; }
.dv main { flex: 1; }
/* :where() keeps these page-wide resets weaker than any class, so .dv-btn-solid keeps its white */
:where(.dv) img, :where(.dv) video { display: block; max-width: 100%; }
:where(.dv) a { color: inherit; text-decoration: none; }
:where(.dv) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
:where(.dv) em { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.12em; letter-spacing: -0.01em; }
.dv ::selection { background: var(--fg); color: #000; }
.dv :focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
[hidden] { display: none !important; }

.dv-label { position: relative; display: inline-block; padding: 1px 11px; font-size: 13px; white-space: nowrap; }
.dv-label::before, .dv-label::after { content: ""; position: absolute; top: 0; bottom: 0; width: 6px; border: 1.5px solid currentColor; }
.dv-label::before { left: 0; border-right: 0; }
.dv-label::after { right: 0; border-left: 0; }

.dv-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 16px 22px 15px; font: 500 14px/1 var(--display); text-transform: uppercase; letter-spacing: 0.02em; white-space: nowrap; transition: background-color 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.16s var(--ease), opacity 0.2s; }
.dv-btn:active { transform: scale(0.97); }
.dv-btn[disabled], .dv-btn.is-busy { opacity: 0.5; pointer-events: none; }
.dv-btn-solid { background: var(--fg); color: #000; }
.dv-btn-line { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7); }
.dv-btn-sm { padding: 12px 16px 11px; font-size: 13px; }
@media (hover: hover) {
  .dv-btn-line:hover { background: var(--fg); color: #000; }
  .dv-btn-solid:hover { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); }
}
.dv-btn small { font: 400 12px/1 var(--mono); text-transform: none; opacity: 0.6; }
.dv-btn.is-done { box-shadow: inset 0 0 0 1px var(--ok); color: var(--ok); pointer-events: none; }
.dv-ico { width: 16px; height: 16px; flex: none; }
.dv-icon-btn { width: 44px; height: 44px; display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line); transition: background-color 0.2s var(--ease), color 0.2s var(--ease); }
@media (hover: hover) { .dv-icon-btn:hover { background: var(--fg); color: #000; } }

/* top bar */
.dv-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px var(--pad); border-bottom: 1px solid var(--line); }
.dv-brand { display: flex; align-items: baseline; gap: 10px; }
.dv-brand b { font: 600 19px/1 var(--display); text-transform: uppercase; letter-spacing: -0.01em; }
.dv-brand span { font-size: 13px; color: var(--soft); }
.dv-bar-right { display: flex; align-items: center; gap: 18px; font-size: 13px; color: var(--soft); }
.dv-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; box-shadow: inset 0 0 0 1px var(--line); color: var(--fg); white-space: nowrap; }
.dv-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--fg); }
.dv-admin { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; padding: 12px var(--pad); background: #1b1b12; color: #f3e7a1; font-size: 13px; }
.dv-admin a { text-decoration: underline; text-underline-offset: 3px; }

/* waiting, locked, closed */
.dv-wait { display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 60svh; color: var(--soft); }
.dv-spin { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--fg); border-radius: 50%; animation: dvspin 0.8s linear infinite; }
@keyframes dvspin { to { transform: rotate(360deg); } }
.dv-gate { max-width: 560px; margin: 0 auto; padding: clamp(64px, 12vh, 140px) var(--pad); text-align: center; }
.dv-gate h1 { margin: 22px 0 14px; font: 600 clamp(36px, 5vw, 64px) / 1.02 var(--display); letter-spacing: -0.02em; }
.dv-gate p { margin: 0 0 28px; color: var(--soft); }
.dv-gate form { display: grid; gap: 12px; }
.dv-gate .dv-err { min-height: 1.4em; margin: 0; color: var(--bad); font-size: 14px; }
.dv-input, .dv-field input, .dv-field textarea, .dv-field select { width: 100%; padding: 15px 16px; background: #111; color: var(--fg); border: 1px solid var(--line); border-radius: 0; font: 400 16px/1.4 var(--mono); transition: border-color 0.2s; }
.dv-input:focus, .dv-field input:focus, .dv-field textarea:focus, .dv-field select:focus { outline: none; border-color: var(--fg); }
.dv-field { display: grid; gap: 8px; text-align: left; }
.dv-field > span { font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; }
.dv-field textarea { resize: vertical; min-height: 110px; }
.dv-check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--soft); cursor: pointer; }
.dv-check input { width: 18px; height: 18px; accent-color: #fff; }

/* title */
.dv-intro { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 32px; padding: clamp(48px, 7vw, 96px) var(--pad) clamp(28px, 3.4vw, 44px); }
.dv-intro h1 { margin: 22px 0 14px; font: 600 clamp(42px, 7vw, 104px) / 0.98 var(--display); letter-spacing: -0.03em; overflow-wrap: anywhere; }
.dv-intro .dv-for { margin: 0; color: var(--soft); font-size: clamp(14px, 1.2vw, 17px); }
.dv-meta { display: grid; grid-template-columns: repeat(2, auto); gap: 18px 44px; margin: 0; }
.dv-meta dt { font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.dv-meta dd { margin: 0; font: 500 17px/1.3 var(--display); }
.dv-state { display: inline-flex; align-items: center; gap: 8px; }
.dv-state i { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--wait); box-shadow: 0 0 0 4px rgba(245, 197, 66, 0.18); }
.dv-state.is-ok i { background: var(--ok); box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.18); }

/* the film on top */
.dv-film { padding: 0 var(--pad); }
.dv-screen { position: relative; display: block; width: 100%; aspect-ratio: var(--r, 16 / 9); max-height: 82svh; margin: 0 auto; background: #000; overflow: hidden; }
.dv-screen > img, .dv-screen > video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.dv-screen > img { object-fit: cover; }
/* a vertical film: a vertical frame as tall as the screen allows, in the middle */
.dv-screen.is-tall { width: auto; height: min(82svh, 900px); max-width: 100%; }
.dv-heavy { margin: 12px 0 0; font-size: 13px; color: var(--faint); text-align: center; }
.dv-screen::after { content: ""; position: absolute; inset: auto 0 0 0; height: 40%; background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent); pointer-events: none; }
.dv-screen.is-on::after { display: none; }
.dv-play { position: absolute; z-index: 1; left: 50%; top: 50%; translate: -50% -50%; display: inline-flex; align-items: center; gap: 12px; padding: 18px 26px 17px; background: var(--fg); color: #000; font: 500 15px/1 var(--display); text-transform: uppercase; transition: transform 0.25s var(--ease); white-space: nowrap; }
@media (hover: hover) { .dv-screen:hover .dv-play { transform: scale(1.05); } }
.dv-play-dot { width: 0; height: 0; border-left: 10px solid currentColor; border-top: 6.5px solid transparent; border-bottom: 6.5px solid transparent; }
.dv-screen-meta { position: absolute; z-index: 1; left: 22px; right: 22px; bottom: 18px; display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: rgba(255, 255, 255, 0.85); pointer-events: none; }
.dv-screen-meta span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-actions { display: flex; flex-wrap: wrap; gap: 12px; padding: 22px 0 0; }
.dv-actions .dv-btn-solid { flex: 1 1 auto; }
.dv-keep { margin: 14px 0 0; font-size: 13px; color: var(--faint); }
.dv-meta dd .dv-left { display: block; margin-top: 4px; font: 400 12px/1.3 var(--mono); color: var(--faint); }

/* sections */
.dv-sec { padding: clamp(64px, 8vw, 120px) var(--pad) 0; }
.dv-sec-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: clamp(24px, 3vw, 40px); }
.dv-sec-head h2 { margin: 16px 0 0; font: 600 clamp(30px, 3.6vw, 52px) / 1.08 var(--display); letter-spacing: -0.02em; }

/* versions */
.dv-files { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.dv-file { display: grid; grid-template-columns: 168px minmax(0, 1fr) 96px auto; align-items: center; gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.dv-thumb { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: var(--card); }
.dv-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.dv-thumb.is-tall img { object-fit: contain; }
.dv-thumb .dv-dur { position: absolute; right: 6px; bottom: 6px; padding: 2px 6px; font-size: 11px; background: rgba(0, 0, 0, 0.7); }
.dv-thumb .dv-blank { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); }
.dv-thumb .dv-blank .dv-ico { width: 26px; height: 26px; }
button.dv-thumb { cursor: pointer; }
@media (hover: hover) { button.dv-thumb:hover img { transform: scale(1.04); } }
.dv-file h3 { margin: 0 0 6px; font: 500 clamp(17px, 1.5vw, 21px) / 1.2 var(--display); overflow-wrap: anywhere; }
.dv-file p { margin: 0; font-size: 13px; color: var(--soft); overflow-wrap: anywhere; }
.dv-file .dv-use { color: var(--faint); }
.dv-size { font-size: 14px; color: var(--soft); text-align: right; white-space: nowrap; }
.dv-dl { display: inline-flex; align-items: center; gap: 10px; padding: 13px 18px 12px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6); font: 500 13px/1 var(--display); text-transform: uppercase; white-space: nowrap; transition: background-color 0.2s var(--ease), color 0.2s var(--ease); }
@media (hover: hover) { .dv-dl:hover { background: var(--fg); color: #000; } }

/* stills */
.dv-stills { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.dv-still { position: relative; margin: 0; }
.dv-still-media { position: relative; display: block; width: 100%; aspect-ratio: 3 / 2; overflow: hidden; background: var(--card); cursor: zoom-in; }
.dv-still-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
@media (hover: hover) { .dv-still:hover .dv-still-media img { transform: scale(1.04); } }
.dv-still-dl { position: absolute; z-index: 1; right: 10px; top: 10px; width: 36px; height: 36px; display: grid; place-items: center; background: rgba(10, 10, 10, 0.65); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); opacity: 0; transition: opacity 0.2s var(--ease); }
.dv-still:hover .dv-still-dl, .dv-still-dl:focus-visible { opacity: 1; }
@media (hover: none) { .dv-still-dl { opacity: 1; } }
.dv-still figcaption { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 12px; color: var(--faint); }
.dv-still figcaption span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* note from Ali */
.dv-note { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }
.dv-note .dv-label { grid-column: 1 / 4; justify-self: start; align-self: start; }
.dv-note-body { grid-column: 4 / 11; }
.dv-note-body p { margin: 0 0 1em; font: 400 clamp(19px, 1.8vw, 26px) / 1.45 var(--display); color: rgba(255, 255, 255, 0.86); white-space: pre-line; overflow-wrap: anywhere; }
.dv-note-body .dv-sig { font-family: var(--serif); font-style: italic; font-size: clamp(26px, 2.6vw, 36px); color: var(--fg); }

.dv-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; margin-top: clamp(72px, 9vw, 130px); padding: 26px var(--pad) calc(34px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); font-size: 13px; color: var(--soft); }
.dv-foot a:hover { color: var(--fg); }

/* dialogs and the stills viewer */
.dv-dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--line); background: #0d0d0d; color: var(--fg); }
.dv-dialog::backdrop { background: rgba(0, 0, 0, 0.72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.dv-dialog[open] { animation: dvrise 0.3s var(--ease); }
.dv-dialog-in { display: grid; gap: 18px; padding: clamp(24px, 4vw, 40px); }
.dv-dialog h2 { margin: 4px 0 0; font: 600 clamp(28px, 3.4vw, 40px) / 1.05 var(--display); letter-spacing: -0.02em; }
.dv-dialog p { margin: 0; color: var(--soft); }
.dv-dialog .dv-label { justify-self: start; }
.dv-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; margin-top: 6px; }
.dv-viewer { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(6, 6, 6, 0.97); color: var(--fg); }
.dv-viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); animation: dvfade 0.25s var(--ease); }
.dv-viewer::backdrop { background: rgba(0, 0, 0, 0.8); }
.dv-viewer-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px var(--pad); font-size: 14px; color: var(--soft); }
.dv-viewer-bar > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-viewer-tools { display: flex; gap: 10px; }
.dv-viewer-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 0 var(--pad) calc(24px + env(safe-area-inset-bottom)); }
.dv-viewer-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.dv-prev, .dv-next { position: absolute; top: 50%; translate: 0 -50%; background: rgba(10, 10, 10, 0.6); }
.dv-prev { left: 12px; }
.dv-next { right: 12px; }
@keyframes dvrise { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
@keyframes dvfade { from { opacity: 0; } }

.dv-toast { position: fixed; z-index: 100; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); translate: -50% 0; max-width: calc(100vw - 32px); padding: 14px 20px; background: var(--fg); color: #000; font: 500 14px/1.3 var(--display); text-align: center; opacity: 0; transform: translateY(12px); transition: opacity 0.25s var(--ease), transform 0.25s var(--ease); pointer-events: none; }
.dv-toast.is-on { opacity: 1; transform: none; }

@media (max-width: 860px) {
  .dv-intro { grid-template-columns: 1fr; align-items: start; gap: 28px; }
  .dv-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-top: 22px; border-top: 1px solid var(--line); }
  .dv-file { grid-template-columns: 120px minmax(0, 1fr); gap: 14px 16px; }
  .dv-size { grid-column: 2; grid-row: 2; text-align: left; align-self: center; }
  .dv-dl { grid-column: 2; grid-row: 2; justify-self: end; }
  .dv-stills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dv-note { display: block; }
  .dv-note .dv-label { margin-bottom: 20px; }
}
@media (max-width: 600px) {
  .dv-bar-right .dv-exp { display: none; }
  .dv-actions .dv-btn { flex: 1 1 100%; flex-wrap: wrap; row-gap: 6px; }
  .dv-screen-meta { left: 14px; right: 14px; bottom: 12px; font-size: 12px; }
  .dv-play { padding: 15px 20px 14px; font-size: 14px; }
  .dv-dialog-actions .dv-btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .dv *, .dv *::before, .dv *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
