/*!
 * Cineskill Projector: single chibi 3D edition (Claude · Opus 5.5, lead visual designer), 2026-12-02.
 * body[data-theme=mounty]   main, owner-approved: cream knit paper, charcoal denim, fleece yellow, warm solid edges.
 * body[data-theme=creature] optional hero: the same finder in smoked charcoal with chartreuse light.
 * Replaces design.css. Load BEFORE layout.css (layout.css owns structure, the native collapsed window and reduced motion).
 *
 * Rules this sheet keeps:
 *  - Film stills and clips are never filtered, tinted, blended or overlaid. Bezels sit outside the picture, on a
 *    neutral dark surround so colour is judged true.
 *  - The idle launcher is a transparent Seedream cut-out: no plate, ring or card behind it, on any host.
 *  - Generated key art comes from /projector/assets/ (Codex mount #33). Text labels stay real HTML, in English.
 *  - Red appears only as an alert.
 */

/* ───────────── tokens ───────────── */
body {
  --paper: #efe6d6; --paper-2: #e6dcc8; --card: #fbf7ef; --card-2: #f3ecdf; --well: #e4d9c5;
  --ink: #1e1e20; --char: #3a3b3e; --muted: #6b665d; --line: #d6cab4;
  --accent: #f2cc2e; --accent-2: #d9b21c; --accent-ink: #1e1e20; --focus: #806112;
  --alert: #d2352b; --screen: #19191b; --shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 2px 0 rgba(30,30,32,.07), 0 6px 16px rgba(30,30,32,.08);
  --r: 16px; --r-sm: 11px; --pill: 999px;
  --font: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, sans-serif;
  margin: 0; min-height: 100vh; color: var(--ink); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(110% 70% at 50% 0, rgba(255,255,255,.55), transparent 60%),
    var(--paper);
}
body[data-theme=creature] {
  --paper: #090b08; --paper-2: #121510; --card: #171b15; --card-2: #10130e; --well: #0c0e0b;
  --ink: #e9f0dc; --char: #2a3026; --muted: #8f9a84; --line: rgba(212,255,46,.16);
  --accent: #d4ff2e; --accent-2: #a9cc1f; --accent-ink: #0b0d06; --focus: #d4ff2e;
  --alert: #ff6b4a; --screen: #000; --shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 8px 22px rgba(0,0,0,.5);
  background: radial-gradient(120% 80% at 50% 30%, #1b2018 0, #0a0c09 58%, #040504 100%) fixed, #050605;
}
:where(#studio) :where(button, select, input) { font: inherit; color: inherit; }
:where(#studio) :where(button) { background: none; border: 0; padding: 0; }

/* Shared tactile surfaces for the finder controls. */
.icon, .facet, .tile, .chip, .light-option, .media-mode, .agent-picker, .searchbox, #clear, #reset-empty, .copy-skill {
  position: relative; background: linear-gradient(176deg, var(--card) 0 55%, var(--card-2) 55% 100%); box-shadow: var(--shadow);
}

/* ───────────── frame ───────────── */
#studio { max-width: 860px; margin: 0 auto; padding: 0 16px 28px; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 0 12px; position: relative; }
.topbar { border-bottom: 1px solid var(--line); }
.wordmark { font: 800 19px/1 var(--round); letter-spacing: .02em; margin-right: auto; }
body[data-theme=creature] .wordmark { color: var(--accent); text-shadow: 0 0 14px rgba(212,255,46,.35); }

.theme-switch { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--pill); background: var(--well); box-shadow: inset 0 1px 2px rgba(0,0,0,.12); }
.theme-switch button { padding: 6px 12px; border-radius: var(--pill); font: 600 12.5px/1 var(--round); color: var(--muted); }
.theme-switch button[aria-pressed=true] { background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 0 rgba(255,255,255,.5) inset, 0 2px 4px rgba(0,0,0,.15); }

.icon { width: 40px; height: 40px; flex: none; border-radius: 12px; display: inline-grid; place-items: center; font-size: 0;
  background-repeat: no-repeat; background-position: center; }
#tools { background-image: url(assets/key-more.webp); }
.fold.icon { background-image: url(assets/key-fold.webp); }
#back.icon { background-image: url(assets/key-back.webp); }
.icon { background: transparent center / 30px 30px no-repeat; box-shadow: none; } /* the Seedream key art is the button itself; layout.css keeps it plate-free */
.icon:hover { filter: drop-shadow(0 3px 4px rgba(30,30,32,.18)); }
.icon:hover, .facet:hover, .tile:hover, .frame-card:hover, .copy-skill:hover { transform: translateY(-1px); }
.icon:active, .facet:active, .tile:active, .copy-skill:active { transform: translateY(1px); box-shadow: 0 1px 2px rgba(0,0,0,.15) inset; }
#tool-menu { background: var(--card); color: var(--ink); border-color: var(--line); border-radius: 14px; }
#tool-menu > *:hover { background: var(--well); border-radius: 8px; }
:where(#studio) :focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }

/* ───────────── idle: the transparent hero, no plate ───────────── */
#idle { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 24px 0 40px; }
.projector-launch { width: min(300px, 72vw); aspect-ratio: 5 / 4; background: none !important; border: 0; box-shadow: none !important; padding: 0;
  transition: transform .25s cubic-bezier(.3,1.4,.5,1); }
.projector-launch::after { content: none !important; }
.projector-launch canvas { width: 100%; height: 100%; }
.projector-launch:hover { transform: translateY(-3px) scale(1.02); }
.idle-caption { margin: 0; font: 600 13px/1 var(--round); color: var(--muted); letter-spacing: .02em; }

/* ───────────── browse ───────────── */
#browser { display: flex; flex-direction: column; gap: 12px; padding-top: 14px; }
.instrument-top { display: flex; align-items: center; gap: 10px; }
.mini-projector { width: 64px; height: 52px; flex: none; background: none; }
.mini-projector canvas { width: 100%; height: 100%; }
.searchbox { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px 0 8px; border-radius: var(--pill); }
.search-art { width: 30px; height: 30px; flex: none; object-fit: contain; }
.searchbox #query {
  flex: 1; min-width: 0; height: 100%; padding: 0; font-size: 15px;
  -webkit-appearance: none; appearance: none; border: 0; outline: none; box-shadow: none; background: transparent;
}
.searchbox input::placeholder { color: var(--muted); }
.searchbox:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (forced-colors: active) {
  .searchbox:focus-within { outline-color: Highlight; }
}

.facets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.facet { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 7px 7px 8px; border-radius: var(--r); text-align: center; }
.facet canvas { width: 100%; aspect-ratio: 4 / 3; border-radius: 10px; }
.facet span { font: 650 12.5px/1.1 var(--round); }
.facet[aria-expanded=true] { background: linear-gradient(176deg, #fff6cf 0 55%, #fae9a3 55% 100%); box-shadow: var(--shadow), 0 0 0 2px var(--accent-2); }
.facet.has-selection span::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: var(--accent-2); vertical-align: 1px; box-shadow: 0 0 0 2px var(--card); }
body[data-theme=creature] .facet[aria-expanded=true] { background: linear-gradient(176deg, #222a17 0 55%, #1a2112 55% 100%); }

.tray { display: flex; gap: 8px; overflow-x: auto; padding: 10px; border-radius: var(--r); background: var(--well); box-shadow: inset 0 2px 5px rgba(0,0,0,.1); scrollbar-width: thin; }
.tile { flex: none; width: 104px; display: flex; flex-direction: column; gap: 5px; padding: 6px 6px 7px; border-radius: 13px; text-align: center; }
.tile canvas { width: 100%; aspect-ratio: 4 / 3; border-radius: 8px; }
.tile span { font-size: 11.5px; line-height: 1.15; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile[aria-pressed=true] { box-shadow: var(--shadow), 0 0 0 2px var(--accent-2); }
.tile[aria-pressed=true] span { color: var(--ink); font-weight: 650; }
.orb-controls { padding: 2px; }
.orb-demo { border-radius: 50%; }
.light-option { padding: 6px 11px; border-radius: var(--pill); font-size: 12.5px; }
.light-option[aria-pressed=true], .chip { background: var(--accent); color: var(--accent-ink); }
.hue-dot { border-color: transparent; }
.hue-dot[aria-pressed=true] { border-color: var(--ink); }

.chip { padding: 5px 11px; border-radius: var(--pill); font: 600 12px/1.2 var(--round); }
.result-top { display: flex; align-items: center; justify-content: space-between; min-height: 28px; }
#result-count { font: 650 12.5px/1 var(--round); color: var(--muted); letter-spacing: .03em; }
#clear, #reset-empty { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--pill); font-size: 12.5px; } /* key-clear icon: layout.css ::before */

.filmstrip { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.frame-card { display: flex; flex-direction: column; gap: 0; padding: 6px; border-radius: 14px; text-align: left; background: var(--char); box-shadow: 0 2px 0 rgba(0,0,0,.18), 0 8px 18px rgba(30,30,32,.14); transition: transform .15s; }
.frame-card img, .frame-card .fallback { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: var(--screen); border-radius: 9px; display: block; }
.frame-card .fallback { color: #9a958c; font-size: 12px; }
.frame-name { padding: 7px 4px 2px; color: #efe6d6; font: 600 12.5px/1.25 var(--round); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frame-card:focus-visible { outline-color: var(--accent); }
body[data-theme=creature] .frame-card { background: #141813; box-shadow: 0 0 0 1px var(--line), 0 10px 24px rgba(0,0,0,.6); }
#empty p { margin: 0 0 10px; color: var(--muted); font: 600 14px/1.3 var(--round); }

/* ───────────── detail ───────────── */
#detail { display: flex; flex-direction: column; gap: 12px; padding-top: 14px; }
.detail-nav { display: flex; align-items: center; gap: 12px; }
.detail-nav > div { flex: 1; min-width: 0; }
#film-title { display: block; font-size: 12.5px; color: var(--muted); }
#style-title { margin: 2px 0 0; font: 800 20px/1.15 var(--round); overflow-wrap: anywhere; }
.screen { display: grid; place-items: center; min-height: 200px; max-height: 62vh; padding: 10px; border-radius: 18px; background: var(--screen);
  box-shadow: 0 0 0 6px var(--char), 0 12px 30px rgba(30,30,32,.22); overflow: hidden; }
body[data-theme=creature] .screen { box-shadow: 0 0 0 1px var(--line), 0 0 30px rgba(212,255,46,.06), 0 14px 34px rgba(0,0,0,.7); }
.screen img, .screen video { max-height: calc(62vh - 20px); border-radius: 6px; }
.clip-toggle { border-radius: var(--pill) !important; } /* layout.css already draws the key-play icon */
.ref-rail { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ref-rail button { aspect-ratio: 16 / 9; padding: 3px; border-radius: 10px; background: var(--char); }
.ref-rail img { border-radius: 7px; background: var(--screen); }
.ref-rail button[aria-pressed=true] { box-shadow: 0 0 0 2px var(--accent); }

.handoff { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 2px; }
.media-mode { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--pill); }
.media-mode button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border-radius: var(--pill); font: 600 13px/1 var(--round); color: var(--muted); }
.media-mode button::before { content: ""; width: 22px; height: 22px; background: center / contain no-repeat; } /* image set by layout.css */
.media-mode button[aria-pressed=true] { background: var(--accent); color: var(--accent-ink); }
.agent-picker { border-radius: var(--pill); }
.agent-picker select { height: 40px; padding: 0 30px 0 14px; border: 0; background: transparent; font: 600 13px/1 var(--round); }
.copy-skill { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 20px 0 14px; border-radius: var(--pill); font: 800 14px/1 var(--round); letter-spacing: .02em; color: var(--accent-ink);
  background: linear-gradient(176deg, #f7d84e 0 50%, #e4bd24 50% 100%); } /* key-copy icon: layout.css ::before */
body[data-theme=creature] .copy-skill { background: linear-gradient(176deg, #e2ff63 0 50%, #c3ea22 50% 100%); box-shadow: 0 0 18px rgba(212,255,46,.3); }
.copy-skill:disabled { opacity: .55; cursor: default; transform: none; }

#status { background: var(--char); color: #fbf7ef; border-radius: var(--pill); box-shadow: 0 8px 22px rgba(0,0,0,.25); }

/* ───────────── narrow ───────────── */
@media (max-width: 560px) {
  .facets { gap: 6px; }
  .facet { padding: 5px 5px 6px; border-radius: 13px; }
  .facet span { font-size: 11.5px; }
  .filmstrip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile { width: 88px; }
  .copy-skill { margin-left: 0; flex: 1; }
  .theme-switch button { padding: 6px 9px; }
}
