/* Chandler Sharpe picture house.
   Dark is a night cinema in Fraunces. Light is a printed day bill in Syne and mono.
   The two modes do not share a layout. */

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #070504;
  --ink: #f6efe6;
  --muted: #d9c7b2;
  --faint: #a89480;
  --line: rgba(246, 239, 230, 0.14);
  --accent: #e7a23a;
  --accent-ink: #1a1208;
  --card: rgba(12, 9, 7, 0.62);
  --display: "Fraunces", "Iowan Old Style", Palatino, "Palatino Linotype", serif;
  --text: "Figtree", "Avenir Next", "Segoe UI", sans-serif;
  --radius: 22px;
  --shadow: 0 24px 50px rgba(0, 0, 0, 0.38);
  --pad: clamp(16px, 4vw, 56px);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3ecdf;
  --ink: #16130f;
  --muted: #3c332b;
  --faint: #6a5e52;
  --line: #16130f;
  --accent: #2746d6;
  --accent-ink: #f7f3ea;
  --card: #f7f1e6;
  --display: "Syne", "Arial Black", Impact, sans-serif;
  --text: "IBM Plex Mono", "Courier New", ui-monospace, monospace;
  --radius: 0px;
  --shadow: 6px 6px 0 #16130f;
  --pad: clamp(14px, 3vw, 28px);
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }
body { overflow-x: clip; }

[hidden] { display: none !important; }

html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: transparent;
  color: var(--ink);
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
}

img { max-width: 100%; }

button, input, select, textarea { font: inherit; color: inherit; }

a { color: inherit; }

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 8px 12px;
}

.skip:focus { top: 12px; }

html[data-theme="dark"] .only-light,
html[data-theme="light"] .only-dark { display: none !important; }

/* Atmosphere ------------------------------------------------------------- */

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  background: var(--bg);
}

.atmosphere-photo {
  position: absolute;
  inset: -6%;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

html[data-theme="dark"] .atmosphere-photo {
  background-image: url("/art/night-house.jpg");
  animation: drift 32s ease-in-out infinite alternate;
}

html[data-theme="light"] .atmosphere-photo {
  background-image: url("/art/day-house.jpg");
  opacity: 0.22;
  filter: saturate(0.85);
}

.atmosphere-veil { position: absolute; inset: 0; }

html[data-theme="dark"] .atmosphere-veil {
  background:
    linear-gradient(180deg, rgba(7, 5, 4, 0.28) 0%, rgba(7, 5, 4, 0.08) 28%, rgba(7, 5, 4, 0.55) 70%, #070504 100%);
}

html[data-theme="light"] .atmosphere-veil {
  background:
    linear-gradient(90deg, rgba(243, 236, 223, 0.94) 0%, rgba(243, 236, 223, 0.86) 48%, rgba(243, 236, 223, 0.94) 100%);
}

.atmosphere-grain {
  position: absolute;
  inset: -20%;
  background-image: url("/email/grain.png");
  background-size: 180px 180px;
  opacity: 0.2;
  mix-blend-mode: overlay;
}

html[data-theme="light"] .atmosphere-grain {
  opacity: 0.12;
  mix-blend-mode: multiply;
}

html[data-theme="dark"] .atmosphere-grain { animation: grain 1.1s steps(2) infinite; }

@keyframes drift {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to { transform: scale(1.12) translate3d(-1.6%, -1.2%, 0); }
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  50% { transform: translate(-2%, 1%); }
  100% { transform: translate(1%, -2%); }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

@keyframes slip {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: none; }
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .atmosphere-photo { display: none; }
  .atmosphere-grain { display: none; }
  html[data-theme="dark"] .form-card,
  html[data-theme="dark"] .success-card,
  html[data-theme="dark"] .topbar { backdrop-filter: none; }
}

/* Header ----------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px var(--pad);
  padding-top: calc(12px + env(safe-area-inset-top));
}

html[data-theme="dark"] .topbar {
  background: linear-gradient(180deg, rgba(7, 5, 4, 0.78), rgba(7, 5, 4, 0.28) 72%, transparent);
  backdrop-filter: blur(10px);
}

html[data-theme="light"] .topbar {
  background: #f3ecdf;
  border-bottom: 3px solid #16130f;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
}

.brand-mark {
  width: 46px;
  height: 46px;
  object-fit: cover;
  flex: none;
}

html[data-theme="dark"] .brand-mark {
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(231, 162, 58, 0.7);
}

html[data-theme="light"] .brand-mark {
  border-radius: 0;
  border: 2px solid #16130f;
  box-shadow: 3px 3px 0 #2746d6;
}

.brand-lockup { display: flex; flex-direction: column; min-width: 0; }

.brand-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}

.brand-name {
  font-family: var(--display);
  font-size: 1.15rem;
  line-height: 1;
  white-space: nowrap;
}

html[data-theme="dark"] .brand-name {
  font-weight: 500;
  font-style: italic;
}

html[data-theme="light"] .brand-name {
  font-weight: 800;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  font-size: 0.95rem;
}

.desk-nav { display: none; gap: 8px; margin-left: 12px; }

.nav-tab {
  min-height: 44px;
  padding: 0 14px;
  background: transparent;
  cursor: pointer;
}

html[data-theme="dark"] .nav-tab {
  border: 0;
  border-radius: 999px;
  color: var(--muted);
}

html[data-theme="dark"] .nav-tab.is-active {
  background: rgba(231, 162, 58, 0.16);
  color: var(--accent);
}

html[data-theme="light"] .nav-tab {
  border: 2px solid transparent;
  border-radius: 0;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
}

html[data-theme="light"] .nav-tab.is-active {
  border-color: #16130f;
  background: #2746d6;
  color: #f7f3ea;
  box-shadow: 3px 3px 0 #16130f;
}

.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-pip {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

.live-dot {
  width: 8px;
  height: 8px;
  background: #3dbe7a;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(61, 190, 122, 0.18);
}

html[data-theme="light"] .live-dot { border-radius: 0; box-shadow: none; }

.theme-toggle {
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 700;
}

html[data-theme="dark"] .theme-toggle {
  border: 0;
  border-radius: 999px;
  background: #e7a23a;
  color: #1a1208;
  font-family: "Figtree", sans-serif;
  box-shadow: 0 8px 24px rgba(231, 162, 58, 0.28);
}

html[data-theme="light"] .theme-toggle {
  border: 2px solid #16130f;
  border-radius: 0;
  background: #16130f;
  color: #f3ecdf;
  font-family: "Syne", sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 3px 3px 0 #2746d6;
}

.theme-toggle:hover { transform: translateY(-1px); }

.theme-toggle:focus-visible,
.btn:focus-visible,
.nav-tab:focus-visible,
.mobile-nav-btn:focus-visible,
.media-preview-box:focus-visible,
.list-main:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Stage ------------------------------------------------------------------ */

.app-main { flex: 1; }

.stage {
  display: grid;
  gap: 22px;
  padding: 12px var(--pad) 28px;
}

html[data-theme="dark"] .stage {
  align-items: end;
  grid-template-columns: minmax(0, 1.25fr) minmax(180px, 0.72fr);
  padding-top: 28px;
  padding-bottom: 18px;
  animation: rise 0.9s ease both;
}

html[data-theme="light"] .stage {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding-top: 28px;
  padding-bottom: 22px;
  align-items: start;
  grid-template-columns: minmax(0, 1.4fr) minmax(200px, 0.62fr);
  border-bottom: 4px solid #16130f;
}

.stage-copy, .stage-frame { min-width: 0; }

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

html[data-theme="light"] .eyebrow {
  font-weight: 600;
  letter-spacing: 0.14em;
}

.stage-title,
.panel-title,
.theater-title,
.media-title {
  font-family: var(--display);
  margin: 0;
}

.stage-title {
  font-size: clamp(3rem, 7.4vw, 6.8rem);
  line-height: 0.86;
}

html[data-theme="dark"] .stage-title {
  font-weight: 500;
  font-style: italic;
  letter-spacing: -0.035em;
  text-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

html[data-theme="light"] .stage-title {
  font-weight: 800;
  letter-spacing: -0.055em;
  text-transform: uppercase;
  line-height: 0.84;
  font-size: clamp(2.35rem, 4.5vw, 4.6rem);
  max-width: 100%;
}

.lede, .panel-desc, .shelf-note {
  color: var(--muted);
  font-size: 1.02rem;
}

.lede {
  max-width: 38rem;
  margin: 16px 0 0;
}

html[data-theme="light"] .lede { font-size: 0.92rem; line-height: 1.6; }

.stage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.vault-count {
  margin: 14px 0 0;
  color: var(--faint);
  font-size: 0.86rem;
}

.stage-frame { margin: 0; }

html[data-theme="dark"] .stage-frame {
  justify-self: end;
  width: min(100%, 380px);
  transform: rotate(-5deg);
  animation: rise 1.1s ease 0.15s both;
}

html[data-theme="dark"] .stage-frame img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(246, 239, 230, 0.2);
}

html[data-theme="light"] .stage-frame img {
  display: block;
  width: 100%;
  height: min(46vw, 340px);
  object-fit: cover;
  border: 3px solid #16130f;
  box-shadow: 8px 8px 0 #2746d6;
}

.stage-frame figcaption {
  margin-top: 8px;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

html[data-theme="light"] .stage-frame figcaption {
  border-top: 2px solid #16130f;
  padding-top: 6px;
  color: #2746d6;
  font-weight: 600;
}

/* Buttons ---------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  cursor: pointer;
  text-decoration: none;
  border: 0;
  background: transparent;
}

html[data-theme="dark"] .btn-primary {
  background: #e7a23a;
  color: #1a1208;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: 0 10px 26px rgba(231, 162, 58, 0.25);
}

html[data-theme="light"] .btn-primary {
  background: #2746d6;
  color: #f7f3ea;
  border: 2px solid #16130f;
  border-radius: 0;
  box-shadow: 4px 4px 0 #16130f;
  font-family: "Syne", sans-serif;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

html[data-theme="dark"] .btn-secondary {
  border: 1px solid rgba(246, 239, 230, 0.28);
  border-radius: 999px;
  background: rgba(7, 5, 4, 0.35);
  color: var(--ink);
}

html[data-theme="light"] .btn-secondary {
  border: 2px solid #16130f;
  border-radius: 0;
  background: #f7f1e6;
  color: #16130f;
  box-shadow: 3px 3px 0 #16130f;
  font-family: "Syne", sans-serif;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.btn:hover { transform: translateY(-1px); }

.btn:disabled { opacity: 0.6; cursor: wait; transform: none; }

.btn-sm { min-height: 40px; padding: 0 12px; font-size: 0.86rem; }

.btn-icon { width: 44px; padding: 0; }

html[data-theme="dark"] .btn-icon.is-active {
  background: #e7a23a;
  color: #1a1208;
  border-color: #e7a23a;
}

html[data-theme="light"] .btn-icon.is-active {
  background: #16130f;
  color: #f3ecdf;
}

.btn-text {
  border: 0;
  background: none;
  color: var(--accent);
  cursor: pointer;
  min-height: 44px;
  padding: 0 8px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Shelf ------------------------------------------------------------------ */

.shelf { padding: 6px var(--pad) 24px; }

html[data-theme="light"] .shelf {
  width: min(1080px, 100%);
  margin: 0 auto;
}

.sprocket {
  height: 16px;
  margin: 8px 0 18px;
  background-color: rgba(231, 162, 58, 0.9);
  background-image: radial-gradient(circle at 10px 50%, #070504 4.5px, transparent 5px);
  background-size: 24px 16px;
  background-repeat: repeat-x;
}

.shelf-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.shelf-intro { min-width: min(100%, 240px); }

.shelf-note { margin: 4px 0 0; }

.shelf-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: min(100%, 520px);
}

.search-wrap {
  position: relative;
  flex: 1 1 180px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.7;
  pointer-events: none;
}

#vault-search {
  width: 100%;
  min-height: 44px;
  padding: 0 12px 0 36px;
  background: transparent;
}

html[data-theme="dark"] #vault-search {
  border: 1px solid rgba(246, 239, 230, 0.2);
  border-radius: 999px;
  background: rgba(7, 5, 4, 0.4);
}

html[data-theme="light"] #vault-search {
  border: 2px solid #16130f;
  border-radius: 0;
  background: #fffdf8;
}

.view-toggle { display: flex; gap: 6px; }

.video-grid { min-height: 120px; }

html[data-theme="dark"] .video-grid:not(.is-list-view) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 22px 18px;
}

html[data-theme="light"] .video-grid {
  display: flex;
  flex-direction: column;
  border-top: 3px solid #16130f;
  counter-reset: reel;
}

html[data-theme="dark"] .video-grid.is-list-view {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 860px;
}

.vault-loading, .vault-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 180px;
  text-align: center;
  color: var(--muted);
  padding: 24px 8px;
}

html[data-theme="dark"] .video-grid:not(.is-list-view) .vault-loading,
html[data-theme="dark"] .video-grid:not(.is-list-view) .vault-empty,
html[data-theme="dark"] .video-grid:not(.is-list-view) .vault-crumb {
  grid-column: 1 / -1;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

html[data-theme="dark"] .spinner { border-radius: 50%; }
html[data-theme="light"] .spinner { border-radius: 0; }

.vault-crumb {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.vault-crumb-text h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.6rem;
}

html[data-theme="dark"] .vault-crumb-text h2 { font-style: italic; font-weight: 500; }
html[data-theme="light"] .vault-crumb-text h2 { text-transform: uppercase; letter-spacing: -0.04em; font-weight: 800; }

.vault-crumb-text p { margin: 2px 0 0; color: var(--faint); font-size: 0.85rem; }

/* Cards: posters at night, a numbered bill by day ------------------------ */

html[data-theme="dark"] .media-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

html[data-theme="dark"] .media-card:nth-child(2) { animation-delay: 0.04s; }
html[data-theme="dark"] .media-card:nth-child(3) { animation-delay: 0.08s; }
html[data-theme="dark"] .media-card:nth-child(4) { animation-delay: 0.12s; }
html[data-theme="dark"] .media-card:nth-child(5) { animation-delay: 0.16s; }
html[data-theme="dark"] .media-card:nth-child(6) { animation-delay: 0.2s; }
html[data-theme="dark"] .media-card:nth-child(7) { animation-delay: 0.24s; }
html[data-theme="dark"] .media-card:nth-child(8) { animation-delay: 0.28s; }
html[data-theme="dark"] .media-card:nth-child(n + 9) { animation-delay: 0.32s; }

html[data-theme="dark"] .media-preview-box {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 18px;
  background: #140e0a url("/art/night-still.jpg") center/cover;
  cursor: pointer;
  box-shadow: var(--shadow);
}

html[data-theme="dark"] .media-preview-box .poster,
html[data-theme="dark"] .list-play-icon .poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}

html[data-theme="dark"] .media-card:hover .poster { transform: scale(1.05); }

html[data-theme="dark"] .media-body { padding: 12px 2px 0; }

html[data-theme="dark"] .media-body { min-width: 0; }

html[data-theme="dark"] .media-title {
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.25rem, 1.5vw, 1.85rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}

html[data-theme="dark"] .media-kicker {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

html[data-theme="dark"] .media-card-btn { margin-top: 10px; }

html[data-theme="light"] .media-card,
html[data-theme="light"] .media-list-row {
  display: grid;
  gap: 8px 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(22, 19, 15, 0.35);
  background: transparent;
  counter-increment: reel;
  animation: slip 0.4s ease both;
}

html[data-theme="light"] .media-card {
  grid-template-columns: 3.1rem 7.2rem minmax(0, 1fr) auto;
}

html[data-theme="light"] .media-list-row {
  grid-template-columns: 3.1rem minmax(0, 1fr) auto;
}

html[data-theme="light"] .media-card::before,
html[data-theme="light"] .media-list-row::before {
  content: counter(reel, decimal-leading-zero);
  font-weight: 600;
  color: #2746d6;
  font-size: 0.95rem;
}

html[data-theme="light"] .media-preview-box,
html[data-theme="light"] .list-play-icon {
  width: 7.2rem;
  height: 4.6rem;
  position: relative;
  overflow: hidden;
  border: 2px solid #16130f;
  background: #fffdf8 url("/art/day-still.jpg") center/cover;
  cursor: pointer;
}

html[data-theme="light"] .media-preview-box .poster,
html[data-theme="light"] .list-play-icon .poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 1;
}

html[data-theme="light"] .media-body,
html[data-theme="light"] .list-details { min-width: 0; }

html[data-theme="light"] .media-title,
html[data-theme="light"] .list-title {
  font-family: "Syne", sans-serif;
  font-weight: 700;
  font-size: clamp(1.15rem, 2.4vw, 1.7rem);
  letter-spacing: -0.045em;
  line-height: 0.95;
  text-transform: none;
}

html[data-theme="light"] .media-kicker { display: none; }

html[data-theme="light"] .media-card-btn,
html[data-theme="light"] .list-actions { justify-self: end; }

.play-overlay-btn, .collection-mark {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(7, 5, 4, 0.45);
  color: #f6efe6;
  border: 1px solid rgba(246, 239, 230, 0.4);
  pointer-events: none;
}

html[data-theme="light"] .play-overlay-btn,
html[data-theme="light"] .collection-mark { display: none; }

.format-badge, .play-note {
  position: absolute;
  z-index: 1;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 7px;
  background: rgba(7, 5, 4, 0.72);
  color: #f6efe6;
}

.format-badge { top: 10px; left: 10px; }
.play-note { top: 10px; right: 10px; }

html[data-theme="light"] .format-badge,
html[data-theme="light"] .play-note { display: none; }

html[data-theme="dark"] .play-note.is-file {
  background: #e7a23a;
  color: #1a1208;
}

.media-meta-row, .list-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 4px;
  color: var(--faint);
  font-size: 0.8rem;
}

.meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
}

.list-badge {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

/* List rows at night stay cinematic, not a paper index. */

html[data-theme="dark"] .media-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(12, 9, 7, 0.55);
  border: 1px solid rgba(246, 239, 230, 0.1);
  animation: rise 0.5s ease both;
}

html[data-theme="dark"] .list-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

html[data-theme="dark"] .list-play-icon {
  position: relative;
  width: 92px;
  height: 64px;
  flex: none;
  overflow: hidden;
  border-radius: 12px;
  background: #140e0a url("/art/night-still.jpg") center/cover;
}

html[data-theme="dark"] .list-play-icon .play-overlay-btn {
  width: 28px;
  height: 28px;
}

html[data-theme="dark"] .list-play-icon .play-overlay-btn svg { width: 12px; height: 12px; }

html[data-theme="dark"] .list-details { min-width: 0; }

html[data-theme="dark"] .list-title {
  display: block;
  font-family: var(--display);
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.05;
}

html[data-theme="dark"] .list-actions { display: flex; gap: 6px; flex: none; }

html[data-theme="light"] .list-main {
  display: grid;
  grid-template-columns: 7.2rem minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-width: 0;
  cursor: pointer;
}

html[data-theme="light"] .list-actions {
  display: flex;
  gap: 6px;
}

html[data-theme="light"] .list-title { display: block; }

html[data-theme="light"] .media-card .list-actions,
html[data-theme="light"] .media-list-row .list-actions { grid-column: 4; }

/* Contact ---------------------------------------------------------------- */

.contact-wrap { padding: 8px var(--pad) 20px; }

html[data-theme="light"] .contact-wrap {
  width: min(1080px, 100%);
  margin: 0 auto;
}

.panel-header {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

html[data-theme="dark"] .panel-header { grid-template-columns: minmax(0, 1.2fr) minmax(160px, 0.7fr); align-items: end; }
html[data-theme="light"] .panel-header { grid-template-columns: minmax(0, 1fr) minmax(180px, 280px); align-items: start; }

.panel-title {
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  line-height: 0.9;
}

html[data-theme="dark"] .panel-title { font-weight: 500; font-style: italic; }
html[data-theme="light"] .panel-title {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.05em;
}

.panel-desc { margin: 10px 0 0; max-width: 40rem; }

.contact-still {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

html[data-theme="dark"] .contact-still { border-radius: 18px; }
html[data-theme="light"] .contact-still {
  height: 140px;
  border: 3px solid #16130f;
  box-shadow: 6px 6px 0 #2746d6;
}

.form-container { width: min(820px, 100%); }

html[data-theme="light"] .form-container { width: 100%; }

.form-card, .success-card, .sheet-card {
  padding: 22px 18px;
}

html[data-theme="dark"] .form-card,
html[data-theme="dark"] .success-card,
html[data-theme="dark"] .sheet-card {
  background: rgba(10, 8, 6, 0.72);
  border: 1px solid rgba(246, 239, 230, 0.12);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

html[data-theme="light"] .form-card,
html[data-theme="light"] .success-card,
html[data-theme="light"] .sheet-card {
  background: #f7f1e6;
  border: 3px solid #16130f;
  border-radius: 0;
  box-shadow: 8px 8px 0 #2746d6;
}

.success-card { text-align: left; }
.success-card h2 {
  margin: 8px 0;
  font-family: var(--display);
  font-size: 2rem;
}
html[data-theme="dark"] .success-card h2 { font-style: italic; font-weight: 500; }
html[data-theme="light"] .success-card h2 { text-transform: uppercase; letter-spacing: -0.04em; }

.success-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: var(--accent-ink);
  background: var(--accent);
}

html[data-theme="dark"] .success-icon { border-radius: 50%; }
html[data-theme="light"] .success-icon { border: 2px solid #16130f; }

.success-text { color: var(--muted); }

.ref-badge {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 14px 0;
}

.ref-label { color: var(--faint); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; }

.ref-value {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.95rem;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.2);
}

html[data-theme="light"] .ref-value {
  background: #fffdf8;
  border: 2px solid #16130f;
}

.form-grid { display: grid; gap: 14px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.field label { font-size: 0.86rem; }

html[data-theme="light"] .field label {
  font-family: "Syne", sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.required { color: var(--accent); }

input, select, textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  background: transparent;
  font-size: 16px;
}

textarea { min-height: 140px; resize: vertical; }

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  border: 1px solid rgba(246, 239, 230, 0.2);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  border: 2px solid #16130f;
  border-radius: 0;
  background: #fffdf8;
}

input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 1px;
}

.is-invalid { border-color: #d4573c !important; }

.field-error, .form-error-msg {
  min-height: 0;
  margin: 0;
  color: #d4573c;
  font-size: 0.82rem;
}

.form-error-msg:empty, .field-error:empty { display: none; }

.form-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.rendezvous-panel {
  padding: 12px;
  border: 1px dashed var(--line);
}

html[data-theme="light"] .rendezvous-panel { border-style: solid; border-width: 2px; }

.subpanel-header, .two-col, .gps-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.two-col { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 8px; }

.subpanel-title { display: flex; align-items: center; gap: 8px; font-weight: 650; }

.gps-status-row { margin-top: 4px; color: var(--faint); font-size: 0.85rem; }
.gps-status-row.has-coords { color: var(--ink); }

.full-width { grid-column: 1 / -1; }

/* Notices used by 404, received, and request-error ----------------------- */

.sheet {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 28px var(--pad) 48px;
}

.sheet-card { width: min(640px, 100%); }

.notice-kicker {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.notice-title {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 0.9;
}

html[data-theme="dark"] .notice-title { font-style: italic; font-weight: 500; }
html[data-theme="light"] .notice-title { text-transform: uppercase; font-weight: 800; letter-spacing: -0.04em; }

.notice-copy { margin: 0 0 16px; color: var(--muted); }

.notice-icon { color: var(--accent); margin-bottom: 8px; }

.sheet-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Mobile nav ------------------------------------------------------------- */

.mobile-nav {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 40;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 6px;
}

html[data-theme="dark"] .mobile-nav {
  background: rgba(10, 8, 6, 0.82);
  border: 1px solid rgba(246, 239, 230, 0.14);
  border-radius: 999px;
  backdrop-filter: blur(16px);
}

html[data-theme="light"] .mobile-nav {
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 0;
  border-top: 3px solid #16130f;
  background: #f3ecdf;
  padding-bottom: calc(6px + env(safe-area-inset-bottom));
}

.mobile-nav-btn {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--faint);
}

html[data-theme="dark"] .mobile-nav-btn { border-radius: 999px; }
html[data-theme="dark"] .mobile-nav-btn.is-active { background: #e7a23a; color: #1a1208; font-weight: 700; }

html[data-theme="light"] .mobile-nav-btn {
  font-family: "Syne", sans-serif;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #16130f;
}

html[data-theme="light"] .mobile-nav-btn.is-active {
  background: #2746d6;
  color: #f7f3ea;
}

body:has(.theater-modal:not([hidden])) .mobile-nav { visibility: hidden; }

/* Player ----------------------------------------------------------------- */

.theater-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 16px;
}

.theater-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}

html[data-theme="light"] .theater-backdrop { background: rgba(243, 236, 223, 0.72); }

.theater-window {
  position: relative;
  z-index: 1;
  width: min(1100px, 100%);
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: 14px;
}

html[data-theme="dark"] .theater-window {
  background: #0c0907;
  color: #f6efe6;
  border-radius: 22px;
  border: 1px solid rgba(246, 239, 230, 0.12);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

html[data-theme="light"] .theater-window {
  background: #f7f1e6;
  color: #16130f;
  border: 3px solid #16130f;
  border-radius: 0;
  box-shadow: 10px 10px 0 #2746d6;
}

.theater-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.theater-tag {
  display: inline-block;
  margin-bottom: 4px;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.theater-title {
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  line-height: 1;
}

html[data-theme="dark"] .theater-title { font-style: italic; font-weight: 500; }
html[data-theme="light"] .theater-title { font-weight: 800; letter-spacing: -0.04em; text-transform: uppercase; }

.theater-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.btn-close {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: inherit;
  background: transparent;
}

html[data-theme="dark"] .btn-close { border: 1px solid rgba(246, 239, 230, 0.3); border-radius: 50%; }
html[data-theme="light"] .btn-close { border: 2px solid #16130f; border-radius: 0; background: #16130f; color: #f3ecdf; }

.theater-player-box { position: relative; background: #000; }

html[data-theme="light"] .theater-player-box { border: 3px solid #16130f; }

#theater-video {
  display: block;
  width: 100%;
  max-height: calc(100dvh - 180px);
  background: #000;
}

.theater-seek-badge {
  position: absolute;
  left: 50%;
  top: 18%;
  transform: translateX(-50%);
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border-radius: 999px;
  pointer-events: none;
}

html[data-theme="light"] .theater-seek-badge { border-radius: 0; }

.theater-notice {
  padding: 12px;
  color: #f6efe6;
  background: #3a2218;
}

.theater-hint {
  margin: 8px 0 0;
  color: var(--faint);
  font-size: 0.75rem;
}

/* Toasts ----------------------------------------------------------------- */

.toast-container {
  position: fixed;
  right: 12px;
  left: 12px;
  bottom: calc(92px + env(safe-area-inset-bottom));
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  align-self: flex-end;
  max-width: min(420px, 100%);
  padding: 12px 14px;
  background: #1a120c;
  color: #f6efe6;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

html[data-theme="light"] .toast {
  background: #16130f;
  color: #f3ecdf;
  border-radius: 0;
  border: 2px solid #2746d6;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

.toast.is-error { background: #6e2b22; }
.toast.is-success { background: #1d4a32; }

/* Location prompt from visit.js. Inline styles on that node are overridden. */

#cs-geo {
  position: fixed !important;
  z-index: 66 !important;
  left: 12px !important;
  right: 12px !important;
  bottom: calc(96px + env(safe-area-inset-bottom)) !important;
  max-width: 440px !important;
  margin: 0 auto !important;
  padding: 16px !important;
}

html[data-theme="dark"] #cs-geo {
  background: rgba(12, 9, 7, 0.94) !important;
  color: #f6efe6 !important;
  border: 1px solid rgba(231, 162, 58, 0.45) !important;
  border-radius: 18px !important;
  font-family: "Figtree", sans-serif !important;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="light"] #cs-geo {
  background: #f7f1e6 !important;
  color: #16130f !important;
  border: 3px solid #16130f !important;
  border-radius: 0 !important;
  font-family: "IBM Plex Mono", ui-monospace, monospace !important;
  box-shadow: 6px 6px 0 #2746d6 !important;
}

#cs-geo strong {
  display: block;
  margin: 0 0 6px;
  font-family: var(--display);
}

html[data-theme="light"] #cs-geo strong { text-transform: uppercase; letter-spacing: -0.03em; }
html[data-theme="dark"] #cs-geo strong { font-style: italic; font-weight: 500; font-size: 1.25rem; }

#cs-geo p { margin: 0 0 12px; }

#cs-geo div { display: flex; gap: 8px; flex-wrap: wrap; }

#cs-geo button {
  min-height: 44px !important;
  padding: 8px 12px !important;
  cursor: pointer !important;
  font: inherit !important;
}

html[data-theme="dark"] #cs-geo [data-yes] {
  background: #e7a23a !important;
  color: #1a1208 !important;
  border: 0 !important;
  border-radius: 999px !important;
  font-weight: 700 !important;
}

html[data-theme="dark"] #cs-geo [data-no] {
  background: transparent !important;
  color: #f6efe6 !important;
  border: 1px solid rgba(246, 239, 230, 0.35) !important;
  border-radius: 999px !important;
}

html[data-theme="light"] #cs-geo [data-yes] {
  background: #2746d6 !important;
  color: #f7f3ea !important;
  border: 2px solid #16130f !important;
  border-radius: 0 !important;
  box-shadow: 3px 3px 0 #16130f !important;
  font-family: "Syne", sans-serif !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
}

html[data-theme="light"] #cs-geo [data-no] {
  background: #f7f1e6 !important;
  color: #16130f !important;
  border: 2px solid #16130f !important;
  border-radius: 0 !important;
}

/* Wider than a phone ----------------------------------------------------- */

.toggle-short { display: none; }

@media (max-width: 520px) {
  .toggle-long { display: none; }
  .toggle-short { display: inline; }
}

@media (min-width: 800px) {
  body { padding-bottom: 28px; }
  .desk-nav { display: flex; }
  .mobile-nav { display: none; }
  .toast-container { left: auto; bottom: 20px; width: min(420px, calc(100% - 32px)); }
  #cs-geo {
    top: auto !important;
    left: auto !important;
    right: 22px !important;
    bottom: 22px !important;
    width: min(340px, calc(100vw - 44px)) !important;
  }
  .two-col { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 799px) {
  .live-label, .brand-kicker { display: none; }
  .brand { flex: 1; min-width: 0; }
  .brand-name {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  .top-actions { flex: none; }
  html[data-theme="light"] #cs-geo { box-shadow: none !important; }

  html[data-theme="dark"] .stage {
    grid-template-columns: 1fr;
    align-items: end;
    padding-top: 8px;
  }

  html[data-theme="dark"] .stage-frame { display: none; }

  html[data-theme="dark"] .stage-title { font-size: clamp(2.7rem, 12vw, 4.2rem); }

  html[data-theme="dark"] .video-grid:not(.is-list-view) {
    grid-template-columns: 1fr;
  }

  html[data-theme="dark"] .media-preview-box { aspect-ratio: 16 / 10; }

  html[data-theme="light"] .stage {
    grid-template-columns: 1fr;
  }

  html[data-theme="light"] .stage-frame { order: -1; }
  html[data-theme="light"] .stage-frame img { height: 190px; }

  html[data-theme="light"] .stage-title { font-size: clamp(1.85rem, 8.4vw, 3rem); }

  .theater-modal { padding: 10px; align-items: center; }
  .theater-window { width: 100%; border-radius: 0; }
  html[data-theme="dark"] .theater-window,
  html[data-theme="light"] .theater-window { border-radius: 0; box-shadow: none; }
  #theater-video {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    max-height: 62dvh;
    object-fit: contain;
    background: #000;
  }

  html[data-theme="light"] .media-card {
    grid-template-columns: 5.6rem minmax(0, 1fr);
    grid-template-areas:
      "num num"
      "thumb title"
      "thumb meta"
      "play play";
  }

  html[data-theme="light"] .media-card::before { grid-area: num; }

  html[data-theme="light"] .media-preview-box {
    grid-area: thumb;
    width: 100%;
    height: 4.4rem;
  }

  html[data-theme="light"] .media-body { display: contents; }

  html[data-theme="light"] .media-title { grid-area: title; align-self: end; }

  html[data-theme="light"] .media-meta-row { grid-area: meta; align-self: start; }

  html[data-theme="light"] .media-card-btn {
    grid-area: play;
    width: 100%;
  }

  html[data-theme="light"] .media-list-row {
    grid-template-columns: 1fr;
  }

  html[data-theme="light"] .media-list-row::before { margin-bottom: -4px; }

  html[data-theme="light"] .list-main {
    grid-template-columns: 5.6rem minmax(0, 1fr);
  }

  html[data-theme="light"] .list-play-icon {
    width: 100%;
    height: 4.4rem;
  }

  html[data-theme="light"] .list-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
  }

  html[data-theme="light"] .list-open-btn { grid-column: 1 / -1; }

  html[data-theme="dark"] .panel-header,
  html[data-theme="light"] .panel-header { grid-template-columns: 1fr; }

  html[data-theme="dark"] .media-list-row { align-items: flex-start; }
  html[data-theme="dark"] .list-actions { flex-direction: column; }

  .theme-toggle { padding: 0 12px; font-size: 0.82rem; }
}

@media (min-width: 800px) and (max-width: 980px) {
  html[data-theme="dark"] .stage { grid-template-columns: 1fr; }
  html[data-theme="dark"] .stage-frame { display: none; }
}
