/* CineMap Studios portal: frosted glass over a penthouse-at-sunset photo */
:root {
  --bg: #0b0e17;
  --glass: rgba(255, 255, 255, .075);
  --glass-2: rgba(255, 255, 255, .11);
  --glass-3: rgba(255, 255, 255, .16);
  --glass-tint: rgba(14, 16, 26, .38);
  --edge: rgba(255, 255, 255, .14);
  --edge-hi: rgba(255, 255, 255, .26);
  --line: rgba(255, 255, 255, .09);
  --field: rgba(8, 10, 18, .42);
  --text: #f4f5f8;
  --muted: rgba(235, 238, 245, .62);
  --accent: #2b9bff;        /* brand electric blue, lifted for dark glass */
  --accent-2: #0a7ae6;
  --accent-ink: #ffffff;
  --good: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --info: #7cc0ff;
  --violet: #a78bfa;
  /* Penthouse-at-sunset photo, hosted on the main site; the drawn sunset below it shows if it can't load */
  --photo: url(https://cinemapstudios.com/assets/portal-bg.webp);
  --photo-pos: center 45%;
  --radius: 22px;
  --radius-sm: 14px;
  --blur: blur(22px) saturate(150%);
  --shadow: 0 1px 0 rgba(255, 255, 255, .14) inset, 0 18px 40px -18px rgba(0, 0, 0, .55);
}
* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; }
body {
  margin: 0; min-height: 100vh; color: var(--text);
  font: 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
/* The scene behind the glass: the photo, over a drawn sunset that shows if the photo can't load */
body::before, body::after { content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none; }
body::before {
  background:
    var(--photo) var(--photo-pos) / cover no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320' preserveAspectRatio='none'%3E%3Cpath fill='%233a2630' fill-opacity='.85' d='M0 170 C160 120 300 150 430 125 S700 70 860 110 1160 90 1300 120 1440 105 1440 105 V320 H0Z'/%3E%3Cpath fill='%23221722' d='M0 230 C200 190 360 215 540 195 S860 165 1040 200 1300 180 1440 205 V320 H0Z'/%3E%3Cpath fill='%23120d16' d='M0 285 C240 262 520 280 760 268 S1200 250 1440 270 V320 H0Z'/%3E%3C/svg%3E") bottom / 100% 34% no-repeat,
    radial-gradient(70% 22% at 30% 70%, rgba(255, 176, 92, .55), transparent 70%),
    radial-gradient(55% 20% at 78% 72%, rgba(255, 128, 86, .45), transparent 70%),
    radial-gradient(45% 35% at 85% 10%, rgba(43, 155, 255, .30), transparent 70%),
    radial-gradient(40% 30% at 8% 6%, rgba(140, 110, 255, .25), transparent 70%),
    linear-gradient(180deg, #0b1124 0%, #1b1d3a 30%, #4a2f48 55%, #b0643c 70%, #6b3f30 80%, #1a1118 100%);
}
/* A soft veil over the photo so white text on glass always reads */
body::after {
  z-index: -1;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(5, 7, 14, .08), rgba(5, 7, 14, .32)),
    linear-gradient(180deg, rgba(5, 7, 14, .55), rgba(5, 7, 14, .15) 30%, rgba(5, 7, 14, .18) 70%, rgba(5, 7, 14, .42));
}
@media (max-width: 860px) {
  :root { --photo: url(https://cinemapstudios.com/assets/portal-bg-sm.webp); --photo-pos: 32% 40%; }
}
a { color: var(--info); }
a:hover { color: #fff; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 600; } h2 { font-size: 16px; font-weight: 600; } h3 { font-size: 14px; font-weight: 600; }
code { background: var(--glass-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: 12px; }
::selection { background: rgba(43, 155, 255, .45); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack > * + * { margin-top: 14px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.ico { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Layout: top bar with pill nav ---------- */
.shell { min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  padding: 14px 24px; background: linear-gradient(180deg, rgba(8, 10, 18, .55), rgba(8, 10, 18, 0));
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.brand-mark { height: 26px; width: auto; flex: none; filter: drop-shadow(0 2px 8px rgba(43, 155, 255, .45)); }
.brand span { color: var(--muted); font-weight: 500; }
.brand:hover { color: #fff; }
.pills { display: flex; gap: 6px; padding: 5px; border-radius: 999px; background: var(--glass); border: 1px solid var(--edge); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--shadow); overflow-x: auto; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pills a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: 13px; white-space: nowrap; transition: background .2s, color .2s; }
.pills a:hover { color: var(--text); background: var(--glass); }
.pills a.on { color: #0b0e17; background: rgba(255, 255, 255, .92); box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
.top-right { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.iconbtn { width: 38px; height: 38px; padding: 0; border-radius: 50%; display: inline-grid; place-items: center; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--accent), var(--violet)); box-shadow: 0 0 0 2px rgba(255, 255, 255, .25); }
.main { padding: 12px 24px 48px; max-width: 1280px; margin: 0 auto; width: 100%; }
.portal { max-width: 880px; margin: 0 auto; padding: 24px 16px 64px; }
.page-head { margin: 8px 0 20px; }
.page-head h1 { margin-bottom: 2px; }
@media (max-width: 860px) {
  .topbar { grid-template-columns: 1fr auto; padding: 12px 16px; }
  .pills { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; }
  .main { padding: 8px 16px 40px; }
  h1 { font-size: 22px; }
}
@media (max-width: 520px) {
  .g4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card { padding: 16px; }
  .stat .n { font-size: 20px; }
  .stat .chip { margin-bottom: 10px; }
}

/* ---------- Glass cards ---------- */
.card, .col, dialog, .login {
  background: linear-gradient(160deg, var(--glass-2), var(--glass) 55%), var(--glass-tint);
  border: 1px solid var(--edge); border-radius: var(--radius); padding: 20px;
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--shadow);
}
.card .card, .card .col { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--glass); box-shadow: none; }
.stat { position: relative; transition: transform .25s ease, border-color .25s; }
.stat:hover { transform: translateY(-4px); border-color: var(--edge-hi); }
.stat .chip { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 14px; color: #fff; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); }
.stat .chip.blue { background: linear-gradient(135deg, rgba(43, 155, 255, .65), rgba(43, 155, 255, .25)); }
.stat .chip.green { background: linear-gradient(135deg, rgba(52, 211, 153, .6), rgba(52, 211, 153, .2)); }
.stat .chip.amber { background: linear-gradient(135deg, rgba(251, 191, 36, .65), rgba(251, 191, 36, .2)); }
.stat .chip.violet { background: linear-gradient(135deg, rgba(167, 139, 250, .65), rgba(167, 139, 250, .2)); }
.stat .chip.red { background: linear-gradient(135deg, rgba(248, 113, 113, .65), rgba(248, 113, 113, .2)); }
.stat .n { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.stat .l { color: var(--muted); font-size: 12px; font-weight: 500; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; } tr.click:hover td { background: rgba(255, 255, 255, .06); }

/* ---------- Forms ---------- */
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
input, select, textarea {
  width: 100%; background: var(--field); color: var(--text); border: 1px solid var(--edge);
  border-radius: 12px; padding: 9px 12px; font: inherit; transition: border-color .2s, box-shadow .2s;
}
input::placeholder, textarea::placeholder { color: rgba(235, 238, 245, .4); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(43, 155, 255, .25); }
select option { background: #1a1d2a; color: var(--text); }
textarea { min-height: 90px; resize: vertical; }
input[type=checkbox] { width: auto; accent-color: var(--accent); }
.form { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form .full { grid-column: 1 / -1; }
button, .btn {
  background: var(--glass-2); color: var(--text); border: 1px solid var(--edge); border-radius: 999px;
  padding: 8px 16px; font: inherit; font-weight: 500; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px; transition: background .2s, border-color .2s, transform .15s;
}
button:hover, .btn:hover { background: var(--glass-3); border-color: var(--edge-hi); color: var(--text); }
button:active, .btn:active { transform: scale(.98); }
button:focus-visible, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.primary, .btn.primary { background: linear-gradient(180deg, var(--accent), var(--accent-2)); color: var(--accent-ink); border-color: rgba(255, 255, 255, .22); box-shadow: 0 6px 18px -6px rgba(43, 155, 255, .7); }
button.primary:hover, .btn.primary:hover { background: linear-gradient(180deg, #4aaaff, var(--accent)); }
button.danger { color: var(--bad); }
button.sm { padding: 4px 10px; font-size: 12px; }
button:disabled { opacity: .5; cursor: default; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11px; font-weight: 600; background: rgba(255, 255, 255, .1); border: 1px solid var(--edge); white-space: nowrap; }
.badge.good { color: var(--good); background: rgba(52, 211, 153, .12); border-color: rgba(52, 211, 153, .35); }
.badge.warn { color: var(--warn); background: rgba(251, 191, 36, .12); border-color: rgba(251, 191, 36, .35); }
.badge.bad  { color: var(--bad);  background: rgba(248, 113, 113, .12); border-color: rgba(248, 113, 113, .35); }
.badge.info { color: var(--info); background: rgba(43, 155, 255, .14); border-color: rgba(43, 155, 255, .38); }

/* ---------- Alerts ---------- */
.alert { position: relative; background: rgba(251, 191, 36, .1); border: 1px solid rgba(251, 191, 36, .28); padding: 11px 14px 11px 16px; border-radius: var(--radius-sm); }
.alert::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--warn); }
.alert.bad { background: rgba(248, 113, 113, .1); border-color: rgba(248, 113, 113, .3); }
.alert.bad::before { background: var(--bad); }
.alert.good { background: rgba(52, 211, 153, .1); border-color: rgba(52, 211, 153, .3); }
.alert.good::before { background: var(--good); }

/* ---------- Pipeline ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 10px; }
.col { padding: 12px; min-height: 220px; border-radius: 18px; }
.col h3 { font-size: 12px; font-weight: 600; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.col h3 span:last-child { background: rgba(255, 255, 255, .12); border-radius: 99px; padding: 0 8px; color: var(--text); }
.pcard { background: rgba(255, 255, 255, .08); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px; margin-top: 8px; transition: transform .2s, border-color .2s; }
.pcard:hover { transform: translateY(-2px); border-color: var(--edge-hi); }
.pcard select { margin-top: 6px; padding: 5px 8px; font-size: 12px; }

/* ---------- Progress, tabs, misc ---------- */
.steps { display: flex; gap: 5px; margin: 10px 0 4px; }
.steps div { flex: 1; height: 7px; border-radius: 4px; background: rgba(255, 255, 255, .12); }
.steps div.done { background: linear-gradient(90deg, var(--accent), #6cc0ff); box-shadow: 0 0 10px rgba(43, 155, 255, .5); }
.tabs { display: inline-flex; max-width: 100%; gap: 4px; padding: 4px; margin: 16px 0; border-radius: 999px; background: var(--glass); border: 1px solid var(--edge); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 6px 14px; color: var(--muted); text-decoration: none; border-radius: 999px; white-space: nowrap; font-size: 13px; font-weight: 500; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: #0b0e17; background: rgba(255, 255, 255, .92); }
.contract-body { white-space: pre-wrap; background: var(--field); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; max-height: 360px; overflow: auto; font-size: 13px; }
details > summary { color: var(--muted); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: rgba(20, 22, 34, .8); border: 1px solid var(--edge); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); padding: 10px 18px; border-radius: 999px; z-index: 20; max-width: calc(100% - 32px); box-shadow: var(--shadow); }
.login { width: 100%; max-width: 400px; padding: 28px; }
.login .brand { margin-bottom: 6px; }
.login .brand-mark { height: 26px; width: auto; flex: none; filter: drop-shadow(0 2px 8px rgba(43, 155, 255, .45)); }
dialog { color: var(--text); width: min(640px, calc(100% - 32px)); background: linear-gradient(160deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .06)), rgba(18, 20, 32, .82); }
dialog::backdrop { background: rgba(4, 6, 12, .55); backdrop-filter: blur(4px); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } .stat:hover, .pcard:hover { transform: none; } }
/* Browsers without backdrop blur get a darker solid glass so text stays readable */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card, .col, .login, .pills, .tabs { background: rgba(22, 24, 38, .9); }
}
.main > h1:first-child, .main > .row.spread:first-child { margin-top: 8px; margin-bottom: 18px; }
