/* =========================================================
   REJIO — "product videos"
   Each demo is a full app screen built at 1280×720, shrunk to fit its frame.
   A "camera" layer zooms and pans, and a fake cursor clicks around.
   The timing for each video lives in js/films.js.
   ========================================================= */

.film { position: relative; height: 100%; overflow: hidden; background: #e9ecdf; }

/* The stage is always 1280×720. JS sets --fit to shrink it to the frame. */
.stage {
  position: absolute;
  top: 0; left: 0;
  width: 1280px; height: 720px;
  transform: scale(var(--fit, 0.5));
  transform-origin: 0 0;
  font-family: var(--sans);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
}
.cam {
  position: absolute;
  inset: 0;
  width: 1280px; height: 720px;
  transform-origin: 0 0;
  transition: transform 1.5s cubic-bezier(0.65, 0, 0.35, 1);
  will-change: transform;
}

/* App window */
.win {
  position: absolute;
  left: 28px; top: 26px;
  width: 1224px; height: 668px;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(38, 42, 36, 0.35), 0 0 0 1px rgba(38, 42, 36, 0.08);
}
.film .win-bar {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  background: #f4f5ef;
  border-bottom: 1px solid #e6e8df;
}
.film .win-bar i { width: 11px; height: 11px; border-radius: 50%; background: #dcdfd4; }
.film .win-bar span {
  margin-left: 18px;
  font-size: 12.5px;
  color: #8a8f84;
  background: #fff;
  border: 1px solid #e6e8df;
  border-radius: 7px;
  padding: 4px 14px;
  min-width: 300px;
}
.film .app { position: relative; display: grid; height: 628px; }

/* Shared sidebar */
.side {
  background: #f8f9f4;
  border-right: 1px solid #eceee6;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.film .side-brand { font-weight: 700; font-size: 17px; margin: 0 8px 18px; display: flex; gap: 8px; align-items: center; }
.film .side-brand b { color: var(--matcha-deep); }
.film .side a {
  display: flex;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 9px;
  color: #555b51;
  font-weight: 500;
}
.film .side a.on { background: var(--matcha-soft); color: var(--ink); font-weight: 700; }
.film .side a em { font-style: normal; font-size: 12px; color: #8a8f84; }
.film .side-foot { margin-top: auto; font-size: 12.5px; color: #8a8f84; padding: 0 12px; }
.film .live { color: #3e8a3e; font-weight: 700; }
.film .live::before { content: "● "; animation: rec 1.6s infinite; }

.film .av {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--c);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  flex: none;
}
.film .tag, .film .ai-tag {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--matcha-soft);
  color: #4f7034;
  white-space: nowrap;
}
.film .t-warm { background: #f3e6c3; color: #8a6a1f; }
.film .t-cool { background: #d8e7e0; color: #3f6d5a; }

/* Fake cursor */
.cursor {
  position: absolute;
  left: 1100px; top: 640px;
  width: 26px; height: 26px;
  z-index: 20;
  transition: left 0.95s cubic-bezier(0.65, 0, 0.35, 1), top 0.95s cubic-bezier(0.65, 0, 0.35, 1);
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.25));
  pointer-events: none;
}
.film .cursor svg { width: 100%; height: 100%; transition: transform 0.15s; }
.film .cursor.click svg { transform: scale(0.82); }
.film .cursor::after {
  content: "";
  position: absolute;
  left: -14px; top: -14px;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 3px solid var(--matcha-deep);
  opacity: 0;
}
.film .cursor.click::after { animation: ripple 0.6s ease-out; }
@keyframes ripple { from { opacity: 0.9; transform: scale(0.3); } to { opacity: 0; transform: scale(1.6); } }

/* Toast that pops up at the end */
.toast {
  position: absolute;
  left: 50%; top: 40px;
  transform: translate(-50%, -30px);
  opacity: 0;
  background: var(--ink);
  color: #fff;
  padding: 14px 22px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 17px;
  z-index: 25;
  transition: all 0.6s var(--ease);
  white-space: nowrap;
}
.film .toast b { color: var(--matcha); }
.film .toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Step caption shown over the video (not scaled) */
.film-step {
  position: absolute;
  left: 16px; bottom: 16px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 6px 16px 6px 6px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 24px -14px rgba(38, 42, 36, 0.4);
  max-width: calc(100% - 32px);
}
.film-step span {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--matcha);
  display: grid;
  place-items: center;
  font-size: 12px;
  flex: none;
}
.film-step b { font-weight: 600; transition: opacity 0.3s; }
.film-step.swap b { opacity: 0; }
.film-progress {
  position: absolute;
  left: 0; bottom: 0;
  height: 3px;
  background: var(--matcha);
  z-index: 31;
  width: 0;
}

/* ---------------- Film 1: inbox ---------------- */
.app-a { grid-template-columns: 200px 430px 1fr; }
.film .list { border-right: 1px solid #eceee6; overflow: hidden; }
.film .list header { display: flex; align-items: center; gap: 8px; padding: 18px 20px; border-bottom: 1px solid #eceee6; }
.film .list header b { font-size: 18px; margin-right: auto; }
.film .chip { font-size: 12px; border: 1px solid #e1e4d9; border-radius: 99px; padding: 3px 10px; color: #555b51; }
.film .mail {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 4px 12px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid #f0f1ea;
  transition: background 0.3s;
}
.film .mail b { font-size: 14.5px; }
.film .mail p { margin: 0; font-size: 13.5px; color: #6c7267; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 230px; }
.film .mail time { font-size: 12px; color: #8a8f84; align-self: start; }
.film .mail .tag, .film .mail .ai-tag { grid-column: 2 / 4; justify-self: start; }
.film .m-new { max-height: 0; padding-top: 0; padding-bottom: 0; opacity: 0; overflow: hidden; transition: all 0.6s var(--ease); background: #fbfdf7; }
.film .m-new.show { max-height: 120px; padding-top: 14px; padding-bottom: 14px; opacity: 1; }
.film .m-new.sel { background: var(--matcha-soft); box-shadow: inset 3px 0 0 var(--matcha-deep); }
.film .m-new .ai-tag { opacity: 0; transform: scale(0.7); transition: all 0.4s var(--ease); background: var(--ink); color: var(--matcha); }
.film .m-new.ai .ai-tag { opacity: 1; transform: none; }

.film .detail { position: relative; padding: 26px 30px; overflow: hidden; }
.film .empty { position: absolute; inset: 0; display: grid; place-items: center; color: #a3a89d; transition: opacity 0.3s; }
.film .msg { opacity: 0; transform: translateY(12px); transition: all 0.5s var(--ease); }
.film .detail.open .empty { opacity: 0; }
.film .detail.open .msg { opacity: 1; transform: none; }
.film .msg-head { display: flex; gap: 12px; align-items: center; }
.film .msg-head small { display: block; color: #8a8f84; font-size: 12.5px; }
.film .msg h4 { font-size: 19px; margin: 16px 0 8px; font-weight: 700; }
.film .msg > p { margin: 0 0 16px; color: #555b51; font-size: 14.5px; }
.film .ai-box { background: #f7faf2; border: 1px solid #dcebc9; border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; }
.film .ai-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13.5px; }
.film .ai-head .spark { color: var(--matcha-deep); }
.film .pill { margin-left: auto; background: var(--matcha); padding: 3px 10px; border-radius: 99px; font-size: 12px; }
.film .ai-box ul { margin: 8px 0 0; padding-left: 18px; color: #555b51; font-size: 13.5px; }
.film .draft { border: 1.5px solid var(--matcha); border-radius: 12px; padding: 14px 16px; }
.film .draft-head { font-weight: 700; font-size: 13.5px; display: flex; gap: 8px; align-items: center; }
.film .draft-head span { font-weight: 500; color: #8a8f84; font-size: 12.5px; }
.film .typed { min-height: 88px; margin: 8px 0 12px; font-size: 14px; color: var(--ink); }
.film .typed.typing::after { content: "|"; color: var(--matcha-deep); animation: rec 0.8s infinite; }
.film .draft-actions { display: flex; gap: 10px; justify-content: flex-end; }
.film .btn-f { padding: 8px 18px; border-radius: 99px; font-weight: 700; font-size: 13.5px; transition: all 0.3s; }
.film .btn-f.ghost { border: 1px solid #dcdfd4; color: #555b51; }
.film .btn-f.go { background: var(--matcha); }
.film .btn-f.go.sent { background: #3e8a3e; color: #fff; }

/* ---------------- Film 2: jobs board -> invoice ---------------- */
.app-b { grid-template-columns: 200px 1fr; }
.film .main { position: relative; padding: 22px 24px; overflow: hidden; }
.film .main-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.film .main-head h5 { font-size: 20px; margin: 0; margin-right: auto; font-weight: 700; }
.film .mini { font-size: 13px; color: #555b51; background: #f4f5ef; border-radius: 99px; padding: 5px 12px; }
.film .mini b { color: var(--ink); }
.film .board { position: relative; display: grid; grid-template-columns: repeat(4, 234px); gap: 16px; }
.film .col h6 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: #8a8f84; display: flex; justify-content: space-between; }
.film .job, .film .slot {
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  height: 96px;
}
.film .job { background: #fafbf7; border: 1px solid #e6e8df; }
.film .job b { display: block; font-size: 14px; }
.film .job small { display: block; color: #8a8f84; font-size: 12.5px; }
.film .job .amt { display: block; margin-top: 8px; font-weight: 700; font-size: 14px; }
.film .slot { border: 1.5px dashed #e1e4d9; }
.film .mover {
  position: absolute;
  top: 31px;
  left: calc(var(--col, 1) * 250px);
  width: 234px;
  background: #fff;
  border: 1.5px solid var(--matcha);
  box-shadow: 0 14px 30px -18px rgba(38, 42, 36, 0.45);
  transition: left 1s cubic-bezier(0.65, 0, 0.35, 1), border-color 0.4s;
  z-index: 3;
}
.film .mover.col2 { --col: 2; }
.film .mover.col3 { --col: 3; }
.film .check {
  position: absolute;
  right: 12px; top: 12px;
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 1.5px solid #c9cdbf;
  display: grid;
  place-items: center;
  font-size: 13px;
  color: transparent;
  transition: all 0.25s;
}
.film .mover.done .check { background: var(--matcha); border-color: var(--matcha); color: var(--ink); }
.film .paid-badge { display: none; margin-left: 8px; font-size: 11.5px; background: #3e8a3e; color: #fff; padding: 2px 8px; border-radius: 99px; }
.film .mover.paid .paid-badge { display: inline-block; }
.film .mover.paid { border-color: #3e8a3e; }

.film .invoice {
  position: absolute;
  top: 0; right: 0;
  width: 430px; height: 100%;
  background: #fff;
  border-left: 1px solid #e6e8df;
  box-shadow: -30px 0 50px -30px rgba(38, 42, 36, 0.35);
  padding: 26px 28px;
  transform: translateX(105%);
  transition: transform 0.8s var(--ease);
  z-index: 5;
}
.film .invoice.open { transform: none; }
.film .inv-top { display: flex; justify-content: space-between; align-items: baseline; }
.film .inv-top h5 { margin: 0; font-size: 20px; font-weight: 700; }
.film .inv-top span { font-size: 12px; font-weight: 700; color: #4f7034; background: var(--matcha-soft); padding: 3px 10px; border-radius: 99px; }
.film .inv-to { color: #8a8f84; font-size: 13.5px; margin: 6px 0 20px; }
.film .line { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid #f0f1ea; font-size: 14.5px; }
.film .line.caught { max-height: 0; padding: 0; opacity: 0; overflow: hidden; transition: all 0.6s var(--ease); border-radius: 8px; }
.film .line.caught.show { max-height: 80px; padding: 11px 10px; opacity: 1; background: #f3f8ea; animation: flash 1.4s ease 0.4s; }
@keyframes flash { 30% { background: #dcebc9; } }
.film .line.caught i { font-style: normal; display: block; font-size: 11.5px; color: #4f7034; font-weight: 700; }
.film .inv-total { display: flex; justify-content: space-between; margin-top: 16px; font-size: 19px; font-weight: 800; }
.film .inv-total .t-new { display: none; }
.film .invoice.plus .t-old { display: none; }
.film .invoice.plus .t-new { display: inline; }
.film .send { display: block; text-align: center; margin-top: 22px; padding: 12px; border-radius: 10px; background: var(--matcha); font-weight: 700; transition: all 0.3s; }
.film .send.sent { background: #3e8a3e; color: #fff; }
.film .inv-note { margin-top: 12px; font-size: 12.5px; color: #8a8f84; text-align: center; }

/* ---------------- Film 3: margin dashboard ---------------- */
.app-c { grid-template-columns: 200px 1fr; }
.film .kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.film .kpi { border: 1px solid #e6e8df; border-radius: 12px; padding: 14px 16px; background: #fff; }
.film .kpi small { color: #8a8f84; font-size: 12.5px; font-weight: 600; }
.film .kpi strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1.15; }
.film .kpi .delta { font-size: 12.5px; font-weight: 700; color: #3e8a3e; }
.film .kpi-margin { background: #f7faf2; border-color: var(--matcha); }
.film .dash-row { display: grid; grid-template-columns: 1.25fr 1fr; gap: 14px; }
.film .panel { border: 1px solid #e6e8df; border-radius: 12px; padding: 14px 16px; background: #fff; position: relative; }
.film .panel h6 { margin: 0 0 8px; font-size: 14px; font-weight: 700; display: flex; justify-content: space-between; }
.film .panel h6 span { color: #8a8f84; font-weight: 500; font-size: 12.5px; }
.film .chart svg { width: 100%; height: 300px; overflow: visible; }
.film .chart .grid line { stroke: #f0f1ea; }
.film .chart .lbl { font-size: 11px; fill: #8a8f84; }
.film .chart .ln { fill: none; stroke: var(--matcha-deep); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.film .chart .area { fill: url(#areaG); opacity: 0; transition: opacity 1s 1.4s; }
.film .chart.draw .ln { transition: stroke-dashoffset 2.4s cubic-bezier(0.65, 0, 0.35, 1); stroke-dashoffset: 0; }
.film .chart.draw .area { opacity: 1; }
.film .chart .mark { opacity: 0; transition: opacity 0.6s 1.2s; }
.film .chart.draw .mark { opacity: 1; }
.film .tbl table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.film .tbl th { text-align: left; font-size: 11.5px; color: #8a8f84; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; padding: 6px 4px; }
.film .tbl td { padding: 11px 4px; border-top: 1px solid #f0f1ea; }
.film .tbl td.m { font-weight: 700; }
.film .row-bad td.m { color: #c0533a; }
.film .row-bad { transition: background 0.3s; }
.film .row-bad.hot { background: #fdf1ec; }
.film .tip {
  position: absolute;
  right: 14px; bottom: 16px;
  width: 270px;
  background: var(--ink);
  color: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.5s var(--ease);
}
.film .tip b { color: var(--matcha); display: block; margin-bottom: 2px; }
.film .tip.show { opacity: 1; transform: none; }
