:root {
  color-scheme: dark;
  --background: #131311;
  --panel: #1b1a17;
  --panel-light: #24221e;
  --border: #393630;
  --ink: #f6efe4;
  --muted: #bbb0a1;
  --accent: #f38a6e;
  --accent-strong: #f9a18a;
  --radius: 12px;
  --sans: "Geist", "Inter", system-ui, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--background);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
}
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
button, input, select { border-radius: 8px; }
a { color: var(--accent-strong); }
:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.07; }
.shell { width: min(100% - 88px, 1320px); margin-inline: auto; }
.muted { color: var(--muted); }
.skip-link {
  position: absolute;
  z-index: 3;
  top: 14px;
  left: 14px;
  padding: 10px;
  background: var(--panel);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

.site-header { border-bottom: 1px solid #2c2924; }
.header-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 72px; }
.brand { display: inline-flex; align-items: center; justify-self: start; gap: 10px; background: none; border: 0; padding: 5px 0; font-size: 21px; font-weight: 760; letter-spacing: -.055em; }
.brand-light { font-weight: 460; }
.brand-icon { width: 31px; height: 31px; background: var(--accent); border-radius: 8px; display: grid; position: relative; place-items: center; }
.brand-icon::before { content: ""; position: absolute; inset: 7px; border: 1.5px solid #211510; border-radius: 3px; }
.brand-icon::after { content: ""; width: 0; height: 0; border-block: 4.5px solid transparent; border-left: 6px solid #211510; margin-left: 1px; }
.main-nav { display: flex; align-items: stretch; align-self: stretch; gap: 25px; }
.main-nav button { border: 0; border-radius: 0; padding: 0 8px; background: none; color: var(--muted); font-weight: 640; font-size: 13px; position: relative; white-space: nowrap; }
.main-nav button:hover, .main-nav [aria-current="page"] { color: var(--ink); }
.main-nav [aria-current="page"]::after { content: ""; height: 2px; background: var(--accent); position: absolute; inset: auto 8px 0; }
.nav-count { font-size: 10px; margin-left: 3px; padding: 2px 5px; background: #40312b; border-radius: 5px; color: #ffb099; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 43px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 15px;
  font-weight: 690;
  font-size: 13px;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}
.button-primary { background: var(--accent); color: #211510; }
.button-primary:hover:enabled, a.button-primary:hover { background: var(--accent-strong); }
.button-outline { background: var(--panel); border-color: var(--border); color: var(--ink); }
.button-outline:hover:enabled, a.button-outline:hover { background: var(--panel-light); border-color: #64584a; }
.add-button { justify-self: end; }
.add-button .add-icon, #new-collection span { font-size: 19px; font-weight: 420; line-height: 0.7; }
.add-mobile { display: none; }

.hero {
  min-height: 435px;
  display: grid;
  align-items: end;
  position: relative;
  overflow: hidden;
  margin-top: 25px;
  border: 1px solid #45362c;
  border-radius: 17px;
  background: #231b16 url("./assets/after-dark.webp") 50% 62% / cover no-repeat;
}
.hero::before { position: absolute; content: ""; inset: 0; background: linear-gradient(92deg, rgba(20,16,13,.94), rgba(20,16,13,.53) 40%, transparent 78%), linear-gradient(0deg, rgba(16,11,9,.64), transparent 45%); }
.hero-copy { position: relative; padding: 43px 46px 48px; }
.eyebrow { display: flex; align-items: center; gap: 9px; text-transform: uppercase; letter-spacing: .15em; font-size: 11px; font-weight: 750; color: var(--accent-strong); }
.eyebrow span { width: 15px; height: 1px; background: currentColor; }
.hero h1 { font: 400 clamp(52px, 7.2vw, 96px)/.90 var(--serif); letter-spacing: -.075em; margin-top: 15px; }
.hero-description { margin-top: 21px; max-width: 335px; color: #e4d7ca; }
.hero .button { margin-top: 22px; min-height: 44px; }

.catalogue { margin-top: 51px; scroll-margin-top: 24px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; }
h2 { font: 400 clamp(30px, 4vw, 42px)/1.06 var(--serif); letter-spacing: -.05em; }
.section-heading .muted { font-size: 13px; margin-top: 6px; }
.search-box { min-height: 46px; width: min(100%, 284px); display: flex; align-items: center; gap: 10px; padding: 0 13px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); }
.search-box:focus-within { border-color: var(--accent); }
.search-box input { border: 0; background: none; color: var(--ink); min-width: 0; flex: 1; padding: 10px 0; outline: none; font-size: 13px; }
.search-box input::placeholder { color: var(--muted); opacity: 1; }
.search-icon { width: 13px; height: 13px; border: 1.5px solid var(--muted); border-radius: 50%; position: relative; margin-right: 3px; }
.search-icon::after { content: ""; position: absolute; width: 6px; height: 1.5px; background: var(--muted); transform: rotate(45deg); right: -4.5px; bottom: -2px; }

.scene-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 17px; }
.scene-card { position: relative; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); min-width: 0; overflow: hidden; transition: border-color 140ms ease; }
.scene-card:hover, .scene-card:focus-within { border-color: #786353; }
.scene-open { display: block; width: 100%; height: 100%; background: transparent; border: 0; border-radius: 0; text-align: left; padding: 0; }
.scene-open:focus-visible { outline-offset: -3px; }
.scene-visual { display: block; aspect-ratio: 16/9; position: relative; background: radial-gradient(at 78% 15%, #53342a, #211b18 73%); isolation: isolate; overflow: hidden; }
.scene-visual::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(10,8,6,.45), transparent 38%); }
.scene-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform 200ms ease; }
.scene-open:hover img { transform: scale(1.035); }
.source-visual { display: grid; align-items: center; justify-items: center; }
.provider-name { color: #f2d1bd; font: 400 clamp(22px, 4vw, 36px)/1 var(--serif); }
.play-mark { position: absolute; display: grid; place-items: center; bottom: 10px; left: 10px; width: 36px; height: 36px; border: 1px solid #a29789; border-radius: 50%; background: rgba(16,14,12,.8); color: white; font-size: 12px; }
.scene-timing { position: absolute; right: 8px; bottom: 8px; padding: 3px 5px; border-radius: 5px; background: #171310; color: var(--ink); font-size: 11px; font-weight: 680; }
.scene-info { display: flex; flex-direction: column; min-height: 77px; justify-content: center; gap: 3px; padding: 10px 50px 12px 12px; }
.film-label { color: var(--muted); font-size: 11px; line-height: 1.35; }
.scene-name { font-size: 15px; font-weight: 690; line-height: 1.22; overflow-wrap: anywhere; }
.save-button { position: absolute; right: 8px; bottom: 13px; min-width: 38px; min-height: 43px; display: grid; place-items: center; padding: 0; background: var(--panel-light); border: 1px solid var(--border); color: var(--ink); }
.save-button:hover { border-color: var(--accent); }
.save-button.is-saved { color: var(--accent-strong); }
.bookmark-icon { display: block; width: 14px; height: 19px; background: currentColor; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 75%, 0 100%); position: relative; }
.save-button:not(.is-saved) .bookmark-icon::after { content: ""; background: var(--panel-light); position: absolute; inset: 2px 2px 3px; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 70%, 0 100%); }
.remove-symbol { font-size: 22px; line-height: 1; }
.scene-empty { display: grid; justify-items: start; gap: 10px; padding: 32px; background: var(--panel); border: 1px dashed var(--border); border-radius: var(--radius); }
.scene-empty h3 { font: 400 27px/1.08 var(--serif); letter-spacing: -.03em; }
.scene-empty p { color: var(--muted); }
.scene-empty button { margin-top: 4px; }
.more-wrap { text-align: center; margin-top: 25px; }

.secondary-view { padding-top: 48px; min-height: 57vh; }
.secondary-view > .section-heading { margin-bottom: 28px; }
.secondary-view h1 { font: 400 clamp(42px, 6.5vw, 68px)/1 var(--serif); letter-spacing: -.062em; overflow-wrap: anywhere; }
#shared-heading { margin-top: 8px; }
.library-layout { display: grid; grid-template-columns: minmax(180px, 235px) minmax(0, 1fr); gap: 24px; align-items: start; }
.sidebar { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 17px; }
.sidebar h2 { font-size: 24px; margin-bottom: 12px; }
.collection-list { display: grid; gap: 5px; }
.collection-option { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; min-height: 42px; background: transparent; border: 1px solid transparent; width: 100%; text-align: left; overflow-wrap: anywhere; }
.collection-option[aria-current] { color: var(--accent-strong); background: #382722; border-color: #67483c; }
.collection-option:hover { border-color: #806355; }
.collection-size { color: var(--muted); font-size: 12px; }
.collection-heading { margin-bottom: 17px; }
.collection-heading h2 { font-size: clamp(26px, 4vw, 36px); overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 7px; }
.library-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

dialog { width: min(92vw, 525px); max-height: min(91dvh, 820px); overflow-y: auto; padding: 24px; border: 1px solid #5b4a3e; border-radius: 14px; background: #201e1a; color: var(--ink); box-shadow: 0 22px 90px #0008; }
dialog::backdrop { background: #0a0807bc; }
body:has(dialog[open]) { overflow: hidden; }
#player-dialog { width: min(92vw, 780px); }
.dialog-head { display: flex; justify-content: space-between; align-items: start; gap: 14px; margin-bottom: 15px; }
.dialog-head h2 { font-size: clamp(29px, 4.2vw, 39px); overflow-wrap: anywhere; }
.dialog-head p + h2, .dialog-head h2 + p { margin-top: 5px; }
.close-button { display: grid; place-items: center; background: var(--panel-light); border: 1px solid var(--border); min-width: 43px; min-height: 43px; flex: 0 0 auto; font-size: 25px; line-height: 1; }
.close-button:hover { border-color: var(--accent); }
.player-frame { display: grid; place-items: center; width: 100%; aspect-ratio: 16/9; min-height: 200px; background: #0f0e0d; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.player-frame iframe { width: 100%; height: 100%; border: 0; }
#player-source { margin-top: 9px; font-size: 12px; overflow-wrap: anywhere; }
.dialog-actions { display: flex; flex-wrap: wrap; align-items: end; gap: 9px; justify-content: end; margin-top: 18px; }
.player-actions { justify-content: start; }
.player-actions a { margin-left: auto; }
dialog label { display: block; font-size: 13px; font-weight: 700; margin: 11px 0 5px; }
dialog input, dialog select { width: 100%; min-height: 44px; background: #160f0e; border: 1px solid #554237; color: var(--ink); padding: 8px 11px; font-size: 16px; }
dialog input::placeholder { color: var(--muted); opacity: 1; }
dialog select { text-overflow: ellipsis; }
.compact-label { margin: 0; flex: 1 1 142px; min-width: 0; max-width: 236px; }
.compact-label select { display: block; margin-top: 4px; font-size: 14px; }
.field-help, .form-error { font-size: 12px; margin-top: 4px; }
.field-help { color: var(--muted); }
.form-error { color: #ffb09e; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
#share-link { text-overflow: ellipsis; }
.toast { opacity: 0; pointer-events: none; position: fixed; z-index: 5; left: 50%; bottom: 19px; width: max-content; max-width: calc(100vw - 30px); transform: translate(-50%, 6px); background: #302721; border: 1px solid #82614e; color: var(--ink); padding: 10px 15px; border-radius: 8px; box-shadow: 0 7px 25px #0007; transition: opacity 160ms ease, transform 160ms ease; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

.site-footer { margin-top: 54px; margin-bottom: 22px; padding-top: 15px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: space-between; font-size: 12px; color: var(--muted); }
.site-footer > span { color: var(--ink); font-weight: 700; }
.site-footer a { color: var(--muted); margin-left: 6px; }
.policy { max-width: 690px; }
.policy h1 { margin: 26px 0; }
.policy h2 { margin: 23px 0 6px; font-size: 29px; }
.policy p { color: var(--muted); max-width: 68ch; margin-bottom: 9px; }

@media (max-width: 1050px) {
  .scene-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .shell { width: calc(100% - 32px); }
  .header-inner { min-height: 61px; }
  .hero { min-height: 370px; margin-top: 16px; }
  .hero-copy { padding: 32px 28px; }
  .catalogue { margin-top: 34px; }
  .scene-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .library-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .collection-list { grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); }
  .sidebar { padding: 12px; }
  .secondary-view { padding-top: 26px; }
}
@media (max-width: 525px) {
  .header-inner { grid-template-columns: auto minmax(0, 1fr) auto; gap: 5px; }
  .brand { font-size: 17px; gap: 6px; }
  .brand-icon { width: 24px; height: 24px; border-radius: 6px; }
  .brand-icon::before { inset: 5px; }
  .main-nav { gap: 0; justify-content: center; }
  .main-nav button { font-size: 12px; padding-inline: 6px; }
  .main-nav [aria-current="page"]::after { inset-inline: 6px; }
  .nav-count { display: none; }
  .add-button { font-size: 11px; min-height: 43px; padding: 6px 8px; gap: 4px; }
  .add-mobile { display: inline; }
  .add-desktop { display: none; }
  .hero { min-height: 360px; background-position: 59% 60%; }
  .hero::before { background: linear-gradient(90deg, rgba(20,16,13,.71), transparent), linear-gradient(0deg, rgba(16,11,9,.94), rgba(16,11,9,.04) 93%); }
  .hero-copy { padding: 27px 20px; }
  .hero h1 { font-size: clamp(48px, 13vw, 68px); }
  .hero-description { color: var(--ink); font-size: 14px; }
  .catalogue > .section-heading { display: grid; grid-template-columns: minmax(0, 1fr); gap: 11px; }
  .search-box { width: 100%; }
  .scene-info { min-height: 79px; padding-inline: 8px 40px; }
  .scene-name { font-size: 13px; }
  .save-button { right: 5px; min-width: 31px; }
  .play-mark { width: 29px; height: 29px; font-size: 10px; bottom: 7px; left: 7px; }
  .scene-timing { bottom: 6px; right: 6px; }
  .collection-heading { display: grid; }
  .actions { justify-content: start; }
  dialog { padding: 16px; }
  .player-actions a { margin-left: 0; }
  .site-footer { align-items: start; margin-top: 36px; }
  .site-footer p { text-align: right; max-width: 234px; }
  .site-footer a { margin-left: 0; }
}
@media (max-width: 360px) {
  .shell { width: calc(100% - 20px); }
  .brand { font-size: 15px; }
  .header-inner { grid-template-columns: auto 1fr auto; gap: 3px; }
  .main-nav { justify-content: center; }
  .add-button .add-icon { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

.film-hero { min-height: 330px; }
.film-hero .hero-description { max-width: 415px; margin-top: 14px; }
.film-hero .hero-copy { padding-block: 34px 42px; }
.film-hero h1 { margin: 0; }
.film-search-form { display: flex; gap: 8px; margin-top: 23px; width: min(480px, 100%); }
.film-search-form .button { margin-top: 0; }
.film-search-box { width: 100%; min-width: 0; background: #181613; }
.film-search-box input, .scene-search-box input { font-size: 16px; }
.film-catalogue { margin-top: 35px; }
.film-catalogue > .section-heading { margin-bottom: 16px; }
.film-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.film-card { min-width: 0; min-height: 103px; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; padding: 0; text-align: left; }
.film-card:hover { border-color: #a57e67; }
.film-card-art { aspect-ratio: 16/9; width: 100%; display: block; overflow: hidden; background: radial-gradient(at 80% 26%, #5b3529, #251f1b); }
.film-card-art img { width: 100%; height: 100%; display: block; object-fit: cover; }
.film-card-info { display: grid; padding: 11px 12px; gap: 3px; }
.film-card-info strong { font-size: 17px; line-height: 1.15; overflow-wrap: anywhere; }
.film-card-info .muted { font-size: 12px; }
.film-view { max-width: 920px; }
.back-button { margin-bottom: 20px; }
.film-view-heading .eyebrow { margin-bottom: 7px; }
.film-scenes-heading { margin-bottom: 13px; }
.scene-search-box { width: min(100%, 374px); }
.film-scene-list { display: grid; gap: 10px; }
.film-scene-list .scene-open { display: grid; grid-template-columns: 162px minmax(0, 1fr); align-items: stretch; }
.film-scene-list .scene-visual { height: 100%; min-height: 91px; aspect-ratio: auto; }
.film-scene-list .scene-info { min-height: 94px; padding-left: 15px; padding-right: 63px; }
.film-scene-list .save-button { top: 50%; bottom: auto; transform: translateY(-50%); }
.film-scene-list .scene-name { font-size: 17px; }
.film-scene-list .provider-name { font-size: 27px; }
.film-scene-list .source-visual .scene-timing { display: none; }
.scene-description { margin-top: 2px; color: var(--muted); font-size: 13px; line-height: 1.35; }
.timestamp-frame { aspect-ratio: auto; min-height: 155px; background: radial-gradient(at 65% 30%, #483125, #1e1815 70%); }
.timestamp-readout { display: grid; justify-items: center; gap: 3px; }
.timestamp-readout strong { font: 400 61px/1 var(--serif); letter-spacing: -.05em; }
#player-note { margin-top: 8px; font-size: 13px; }
@media (max-width: 850px) {
  .film-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 525px) {
  .film-hero { min-height: 300px; }
  .film-hero .hero-copy { padding: 22px 16px 24px; }
  .film-hero h1 { font-size: clamp(42px, 10.6vw, 62px); }
  .film-search-form { gap: 6px; margin-top: 16px; }
  .film-search-form .button { padding-inline: 12px; }
  .film-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .film-scenes-heading { align-items: stretch; flex-direction: column; gap: 9px; }
  .scene-search-box { width: 100%; }
  .film-scene-list .scene-open { grid-template-columns: 81px minmax(0, 1fr); }
  .film-scene-list .scene-info { min-height: 80px; padding-left: 9px; padding-right: 43px; }
  .film-scene-list .scene-name { font-size: 14px; }
  .film-scene-list .provider-name { font-size: 20px; }
  .film-scene-list .scene-visual { min-height: 80px; }
  .film-scene-list .source-visual .play-mark { display: none; }
  .scene-description { font-size: 11px; }
}

.scene-search-form { display: flex; align-items: stretch; gap: 7px; width: min(100%, 410px); }
.scene-search-form .search-box { width: auto; min-width: 0; flex: 1; }
.film-card-placeholder { display: grid; place-items: center; }
.placeholder-mark { font: 400 clamp(26px, 7vw, 84px)/1 var(--serif); color: #dd9f87; }
.live-scene-results { display: grid; gap: 10px; margin-top: 22px; padding: 18px; background: #201b17; border: 1px solid var(--border); border-radius: var(--radius); }
.live-scene-results h3 { font: 400 24px/1.14 var(--serif); }
.live-clue { padding: 11px 13px; background: var(--panel); border: 1px solid #493a33; border-radius: 8px; }
.small-source { font-size: 12px; }
#recent-catalogue .film-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#recent-catalogue .film-card-art { aspect-ratio: 2.3; }
@media (max-width: 650px) {
  #recent-catalogue .film-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
