:root {
  color-scheme: dark;
  --background: #111117;
  --surface: #191923;
  --border: #363544;
  --text: #f5f3fa;
  --muted: #bbb7cb;
  --accent: #deccff;
  --accent-text: #221139;
  --danger: #ffb9be;
  --radius: 18px;
  font-family: Inter, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  scroll-padding-top: 6.5rem;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--text); }
a { color: inherit; }
p, h1, h2, h3, h4, dl, dd { margin: 0; }
img, video { display: block; max-width: 100%; }
input, button { font: inherit; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid #cdaaff; outline-offset: 4px; }

.skip-link {
  position: absolute;
  z-index: 5;
  top: .75rem;
  left: .75rem;
  padding: .6rem .85rem;
  color: var(--accent-text);
  background: var(--accent);
  border-radius: 10px;
  transform: translateY(calc(-100% - 1rem));
}
.skip-link:focus { transform: none; }

.topbar {
  position: sticky;
  z-index: 3;
  top: 0;
  background: #111117f5;
  border-bottom: 1px solid #282732;
  backdrop-filter: blur(14px);
}

.topbar-inner {
  width: min(100% - 3rem, 76rem);
  min-height: 4.5rem;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  text-decoration: none;
  font-weight: 750;
  font-size: 1.13rem;
  letter-spacing: -.045em;
  white-space: nowrap;
}

.brand-ai { margin-inline-start: -.37rem; color: #d5baff; }

.brand-mark {
  width: 1.85rem;
  height: 1.85rem;
  flex: none;
  border-radius: .58rem;
  position: relative;
  background: linear-gradient(145deg, #e7d5ff, #a573ee);
  box-shadow: inset 0 0 0 1px #f3e6ff36;
}

.brand-mark::before {
  content: "";
  position: absolute;
  top: .52rem;
  left: .73rem;
  border-block: .4rem solid transparent;
  border-inline-start: .61rem solid #2d1748;
}

.main-nav, .account { display: flex; align-items: center; gap: 1rem; }
.main-nav a { padding: .5rem .3rem; text-decoration: none; color: var(--muted); font-size: .92rem; font-weight: 650; }
.main-nav a:hover, .main-nav a[aria-current="location"] { color: var(--text); }
.account-name { color: var(--muted); font-size: .875rem; max-width: 10rem; overflow-wrap: anywhere; }

.button {
  min-height: 2.65rem;
  padding: .53rem .85rem;
  border: 1px solid var(--border);
  border-radius: .68rem;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: #242332;
  color: var(--text);
  font-size: .875rem;
  font-weight: 660;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.button:hover { background: #302e40; }
.button-primary { background: var(--accent); border-color: transparent; color: var(--accent-text); }
.button-primary:hover { background: #eadfff; }
.button-quiet { border-color: transparent; background: transparent; color: var(--muted); }
.button-quiet:hover { background: #292736; color: var(--text); }
.button-danger { background: #4c232d; border-color: #965060; color: #ffe9eb; }
.button-danger:hover { background: #603040; }

.page { width: min(100% - 3rem, 76rem); margin: 2rem auto 5rem; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  align-items: center;
  min-height: 20rem;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid #4f3b68;
  border-radius: 1.55rem;
  background: radial-gradient(ellipse at 88% 2%, #673d9a 0, transparent 60%), linear-gradient(105deg, #1c1728 20%, #352448 100%);
}

.hero-copy { padding: clamp(1.4rem, 5.5vw, 4.3rem); }
.hero h1 { max-width: 13ch; font-size: clamp(2.15rem, 5.4vw, 4.1rem); font-weight: 760; line-height: 1.05; letter-spacing: -.067em; }
.hero p { color: #ded1ec; margin: 1.1rem 0 1.45rem; max-width: 34ch; }
.hero .button { padding-inline: 1rem; }

.screen-art {
  position: relative;
  margin: .75rem 13% .75rem 0;
  aspect-ratio: 1.48;
  border: 1px solid #e6c8ff70;
  border-radius: 1.25rem;
  isolation: isolate;
  transform: rotate(-9deg);
  background: radial-gradient(ellipse at 54% 45%, #e9abff 0%, #b780f1 29%, #6942ad 63%, #36235c 100%);
  box-shadow: 0 1.4rem 3.4rem #190e376c, inset 0 0 3rem #ebbaff3b;
}

.screen-art::before, .screen-art::after {
  content: "";
  z-index: -1;
  position: absolute;
  border: 1px solid #e6bfff6b;
  border-radius: inherit;
}

.screen-art::before { inset: 10% -11% -11% 10%; }
.screen-art::after { inset: -11% 10% 11% -11%; }

.screen-art span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: inherit;
  background: repeating-linear-gradient(0deg, #2a134025 0, #2a134025 1px, transparent 1px, transparent 5px);
}

.screen-art span::before {
  content: "";
  width: 24%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #201631b3;
  border: 1px solid #f2d8ffb3;
  box-shadow: 0 0 2.5rem #f1b4ffaa;
}

.screen-art span::after {
  content: "";
  position: absolute;
  left: 47%;
  width: 9%;
  aspect-ratio: 1;
  background: #f6e6ff;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.content-section { margin-top: 3.15rem; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-block-end: 1rem; }
.section-heading h2 { font-size: clamp(1.55rem, 3.5vw, 2rem); letter-spacing: -.045em; line-height: 1.2; }
.section-count, .section-description, .job-date { color: var(--muted); font-size: .875rem; }
.section-description { margin-bottom: 1rem; }

.surface, .empty-state { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.empty-state { padding: 1.25rem 1.35rem; border-style: dashed; color: var(--muted); }
.import-panel { margin-top: .85rem; }
.import-panel summary { padding: .85rem 1.35rem; font-weight: 680; cursor: pointer; }
.import-form { display: grid; gap: 1rem; align-items: start; padding: .1rem 1.35rem 1.35rem; }
.import-form .button, .delete-panel .button { justify-self: start; }

.field { display: grid; gap: .42rem; }
.field > label { font-size: .925rem; font-weight: 650; }
.field-help { color: var(--muted); font-size: .85rem; }

.field input {
  min-width: 0;
  width: 100%;
  min-height: 2.9rem;
  padding: .58rem .72rem;
  background: #14141d;
  color: var(--text);
  border: 1px solid #4b485c;
  border-radius: .65rem;
}

.field input[type="file"] { font-size: .875rem; }
.field input::file-selector-button { margin-inline-end: .6rem; border: 0; border-radius: .36rem; padding: .22rem .48rem; color: var(--text); background: #36314a; cursor: pointer; }
.checkbox { display: flex; gap: .55rem; align-items: flex-start; max-width: 48ch; font-size: .9rem; color: var(--muted); }
.checkbox input { accent-color: #b997ee; width: 1rem; height: 1rem; flex: none; margin: .2rem 0 0; }

.film-list { display: grid; gap: 1.6rem; }
.film-heading { display: grid; gap: .35rem; margin-block-end: .75rem; }
.film-heading h3, .proposal h3 { font-size: 1.24rem; letter-spacing: -.024em; line-height: 1.25; overflow-wrap: anywhere; }
.delete-panel summary { width: fit-content; color: var(--danger); cursor: pointer; font-size: .875rem; }
.delete-panel form { padding: .55rem 0 .25rem; display: grid; gap: .65rem; }
.part-grid, .proposal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19.5rem), 1fr)); gap: .9rem; }
.part-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 17.5rem), 1fr)); }
.part-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.part-card video { background: #09090d; width: 100%; aspect-ratio: 16 / 10; object-fit: contain; }
.part-info { padding: .85rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .6rem; }
.part-meta { color: var(--muted); font-size: .82rem; }

.proposal { min-width: 0; display: flex; flex-direction: column; padding: 1.25rem 1.35rem; }
.proposal-heading { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: .65rem; }
.original-title { color: #dbc6fc; font-size: .9rem; margin-bottom: .3rem; }
.status { padding: .23rem .57rem; border-radius: 99px; border: 1px solid #514267; background: #2a2238; color: #e0cdfb; font-size: .76rem; font-weight: 650; }
.status[data-status="approved"] { border-color: #326154; background: #203b35; color: #c5f0e2; }
.status[data-status="pending_source"] { border-color: #695331; background: #342b1c; color: #ffe0aa; }
.status:is([data-status="cancelled"], [data-status="canceled"], [data-status="rejected"]) { border-color: #56414d; background: #2b222d; color: #e3c0ce; }
.proposal-synopsis { color: var(--muted); margin-top: .65rem; }
.proposal-meta { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; padding: .95rem 0; }
.proposal-meta dt { color: var(--muted); font-size: .78rem; }
.proposal-meta dd { font-size: .91rem; }
.proposal-actions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem 1rem; margin-top: auto; padding-top: .75rem; border-top: 1px solid var(--border); }
.source-link { color: #e0cdfb; font-size: .89rem; text-underline-offset: .2em; }
.source-link:hover { color: #f1e3ff; }
.decision-form, .job-actions { display: flex; flex-wrap: wrap; gap: .42rem; align-items: center; }

.job-list { list-style: none; padding: 0; margin: 0; }
.job-list li { padding: .9rem 1.35rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .55rem; }
.job-list li + li { border-top: 1px solid var(--border); }
.job-list h3 { font-size: 1rem; }

.notice { margin: 0 0 1rem; padding: .75rem 1rem; border-radius: .7rem; border: 1px solid #5f5077; background: #2d243c; color: #eddfff; overflow-wrap: anywhere; }
.notice-error { background: #382631; border-color: #825363; color: #ffe2e8; }

.login-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  min-height: 100vh;
  min-height: 100svh;
}

.login-art {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: clamp(2.5rem, 6vw, 5rem);
  padding: 2rem 1.5rem;
  text-align: center;
  background: radial-gradient(ellipse at 28% 23%, #663d9b 0, transparent 62%), linear-gradient(145deg, #392757, #1b162a 85%);
  border-inline-end: 1px solid #4f3b68;
}

.login-art .screen-art { width: clamp(10rem, 26vw, 24rem); margin: 0; }
.login-intro .brand { font-size: clamp(1.7rem, 3vw, 2.4rem); }
.login-intro p { color: #e0d2ee; }
.login-panel { padding: 2rem 1.5rem; display: grid; place-items: center; }
.login-form { width: min(100%, 23rem); display: grid; gap: 1rem; }
.login-form h1 { font-size: clamp(2rem, 5vw, 2.65rem); letter-spacing: -.055em; line-height: 1.1; margin-bottom: .35rem; }
.login-form .button { margin-top: .45rem; }
.login-form .notice { margin: 0; }

@media (max-width: 44rem) {
  :root { scroll-padding-top: 7.25rem; }
  .topbar-inner { width: calc(100% - 2rem); display: grid; grid-template-columns: 1fr auto; gap: .1rem 1rem; padding-top: .35rem; }
  .main-nav { grid-column: 1 / -1; grid-row: 2; gap: 1.2rem; }
  .main-nav a { padding-inline: 0; }
  .account { gap: .35rem; }
  .account-name { display: none; }
  .page { width: calc(100% - 2rem); margin-top: 1rem; }
  .hero { min-height: 0; grid-template-columns: 1fr; }
  .hero-copy { position: relative; z-index: 1; }
  .hero .screen-art { width: 12rem; position: absolute; top: 1.55rem; right: -7rem; opacity: .36; }
  .content-section { margin-top: 2.45rem; }
  .proposal, .empty-state, .job-list li { padding-inline: 1rem; }
  .import-panel summary, .import-form { padding-inline: 1rem; }
  .login-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .login-art { padding: 1.45rem .85rem; border-inline-end: 0; border-bottom: 1px solid #4f3b68; }
  .login-art .screen-art { display: none; }
  .login-panel { place-items: start center; padding-top: 2rem; }
}
