/* Cliptica — Framing Studio.
   Shared by the composer on /new and the in-flight picker on /project, so the
   two surfaces can never drift into looking like different features.

   Layout: a large live preview of the current choice beside a list of options,
   each with its own small live preview. Five equal tiles read as a sticker
   sheet; a hero plus a legible option list reads as a control panel — and it
   gives the choice enough pixels to actually be judged on. */

.fr-sec { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.fr-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fr-head strong { font-size: 13px; font-weight: 500; color: var(--text); }

/* Status chip. "Live" is a factual claim that real moving footage from this job
   is on screen, so it is only ever set when that is true (FR.isLive()). */
.fr-live {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px 3px 7px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--s2);
  font-size: 10px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted);
  transition: color 200ms var(--snap), border-color 200ms var(--snap);
}
.fr-live::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; opacity: .5;
}
.fr-sec.is-live .fr-live { color: var(--accent2); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.fr-sec.is-live .fr-live::before { opacity: 1; animation: fr-pulse 2s ease-in-out infinite; }
@keyframes fr-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }

.fr-sub { margin: 6px 0 0; font-size: 11.5px; line-height: 1.55; color: var(--muted); max-width: 52ch; }

/* ── Studio ──────────────────────────────────────────────────────────────── */
.fr-studio {
  display: grid; gap: 18px; margin-top: 16px;
  grid-template-columns: 158px minmax(0, 1fr);
  align-items: start;
}
@media (max-width: 560px) {
  .fr-studio { grid-template-columns: 1fr; gap: 14px; justify-items: center; }
  .fr-hero { width: 168px; }
  .fr-opts { width: 100%; }
}

.fr-hero { display: flex; flex-direction: column; gap: 8px; }
/* One line, not a repeat of the option row's description — the name on the left,
   the delivered size on the right. The spec is the detail that makes this read
   as an output preview rather than a decorative thumbnail. */
.fr-hero-cap {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px; padding: 0 2px;
}
.fr-hero-name { font-size: 12px; font-weight: 600; color: var(--text); }
.fr-hero-blurb {
  font-size: 10px; font-weight: 500; letter-spacing: .03em;
  color: var(--muted); white-space: nowrap;
}

/* The 9:16 stage. The canvas takes its backing size from this box's width, so
   the aspect ratio is defined here and nowhere else. */
.fr-stage {
  position: relative; display: block; width: 100%; aspect-ratio: 9 / 16;
  border-radius: 10px; overflow: hidden; background: #08080a;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}
[data-theme="light"] .fr-stage { box-shadow: inset 0 0 0 1px rgba(24, 24, 27, .16); }
.fr-canvas { display: block; width: 100%; height: 100%; }
.fr-stage-lg { border-radius: 12px; }
.fr-stage-sm { width: 38px; flex: 0 0 38px; border-radius: 6px; }

/* ── Options ─────────────────────────────────────────────────────────────── */
.fr-opts {
  display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--s1); overflow: hidden;
}
.fr-opt {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 13px; border: 0; border-top: 1px solid var(--border);
  background: none; color: inherit; text-align: left; cursor: pointer;
  transition: background 130ms var(--snap);
}
.fr-opt:first-child { border-top: 0; }
.fr-opt:hover { background: var(--s2); }
.fr-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.fr-opt.is-on { background: color-mix(in srgb, var(--accent) 8%, transparent); }
/* The selected row carries an accent edge rather than a glow — a border reads
   as a control, a glow reads as decoration. */
.fr-opt.is-on::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 2px; background: var(--accent);
}
.fr-opt { position: relative; }
.fr-opt:disabled { cursor: not-allowed; opacity: .4; }
.fr-opt:disabled:hover { background: none; }

.fr-opt-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.fr-opt-line { display: flex; align-items: center; gap: 7px; min-width: 0; }
.fr-opt-name { font-size: 12.5px; font-weight: 600; color: var(--text); }
.fr-opt.is-on .fr-opt-name { color: var(--accent2); }
.fr-opt-tag {
  padding: 1px 6px; border-radius: 4px;
  border: 1px solid var(--border2); background: var(--s2);
  font-size: 9px; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted); white-space: nowrap;
}
.fr-opt-blurb {
  font-size: 11px; line-height: 1.4; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis;
}

.fr-opt-dot {
  flex: 0 0 15px; width: 15px; height: 15px; border-radius: 50%;
  border: 1.5px solid var(--border2); position: relative;
  transition: border-color 130ms var(--snap);
}
.fr-opt.is-on .fr-opt-dot { border-color: var(--accent); }
.fr-opt-dot::after {
  content: ""; position: absolute; inset: 2.5px; border-radius: 50%;
  background: var(--accent); transform: scale(0); opacity: 0;
  transition: transform 150ms var(--snap), opacity 120ms var(--snap);
}
.fr-opt.is-on .fr-opt-dot::after { transform: scale(1); opacity: 1; }

/* ── In-flight card on the project page ──────────────────────────────────── */
.fr-box {
  margin: 0 0 18px; padding: 17px 19px 19px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--s1);
}
.fr-box .fr-opts { background: var(--bg); }
.fr-box .fr-sec { margin-top: 0; padding-top: 0; border-top: 0; }

/* Locked: once the renders start, the choice is a fact about files that exist.
   Showing it greyed with the reason beats hiding it — the user should be able to
   see what their clips were framed as. */
/* `display` on a class beats the UA sheet's `[hidden] { display: none }` — every
   author rule does — so an element toggled with `hidden` needs this or it never
   hides. This exact bug shipped the locked-state note on every project page. */
.fr-note[hidden] { display: none; }
.fr-note {
  display: flex; align-items: flex-start; gap: 8px;
  margin-top: 13px; padding: 10px 12px;
  border: 1px solid var(--border); border-left: 2px solid var(--accent);
  border-radius: 7px; background: color-mix(in srgb, var(--accent) 5%, transparent);
  font-size: 11.5px; line-height: 1.55; color: var(--muted);
}
.fr-note strong { color: var(--text); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .fr-opt, .fr-opt-dot, .fr-opt-dot::after, .fr-live { transition: none; }
  .fr-sec.is-live .fr-live::before { animation: none; }
}
