/* Product showcase sections (_includes/sections/studio.html, translator.html).
   The mockups use the onAI app's own tokens (AlmChat src/onai-theme.css) so they read as the real product. */

.sc-app {
  --sc-canvas: #f3f4f1;
  --sc-panel: #fbfbf9;
  --sc-ink: #262a25;
  --sc-muted: #62685f;
  --sc-accent: #22302a;
  --sc-accent-fg: #f1f6ef;
  --sc-chip: #f0f2ee;
  --sc-bubble: #e6ece3;
  --sc-line: rgba(30, 40, 30, 0.08);
  --sc-raise: 0 1px 2px rgba(20, 30, 20, 0.06), 0 0 0 1px rgba(30, 40, 30, 0.05);
  font-family: 'Geist', 'Gantari', ui-sans-serif, system-ui, sans-serif;
  color: var(--sc-ink);
}

.sc-canvas { background: var(--sc-canvas); }
.sc-panel { background: var(--sc-panel); }
.sc-ink { color: var(--sc-ink); }
.sc-muted { color: var(--sc-muted); }
.sc-chip { background: var(--sc-chip); }
.sc-line { border-color: var(--sc-line); }
.sc-raise { box-shadow: var(--sc-raise); }
.sc-label { font-size: 12px; font-weight: 500; color: var(--sc-muted); }

/* ---------- Image Studio ---------- */

.sc-model {
  display: grid;
  grid-template-columns: 28px 1fr auto 18px;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 10px;
}
.sc-model.is-on { background: #fff; box-shadow: var(--sc-raise); }
.sc-glyph {
  display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--sc-bubble); color: var(--sc-accent);
  font-size: 12px; font-weight: 600;
}
.sc-price { font-size: 12px; color: var(--sc-muted); font-variant-numeric: tabular-nums; }
.sc-check, .sc-plus { position: relative; width: 18px; height: 18px; border-radius: 6px; }
.sc-check { background: var(--sc-accent); }
.sc-check::after {
  content: ''; position: absolute; left: 6px; top: 3px; width: 5px; height: 9px;
  border: solid var(--sc-accent-fg); border-width: 0 1.75px 1.75px 0; transform: rotate(45deg);
}
.sc-plus { border: 1.5px solid rgba(30, 40, 30, 0.2); }
.sc-plus::before, .sc-plus::after {
  content: ''; position: absolute; left: 50%; top: 50%; background: var(--sc-muted);
  width: 8px; height: 1.5px; transform: translate(-50%, -50%);
}
.sc-plus::after { transform: translate(-50%, -50%) rotate(90deg); }

.sc-ratio { padding: 5px 0; border-radius: 8px; background: var(--sc-chip); color: var(--sc-muted); }
.sc-ratio.is-on { background: var(--sc-accent); color: var(--sc-accent-fg); }

.sc-generate {
  display: flex; width: 100%; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 14px; border-radius: 10px;
  background: var(--sc-accent); color: var(--sc-accent-fg);
  font-size: 14px; font-weight: 500;
  transition: background-color 150ms ease-out, transform 150ms ease-out;
}
.sc-generate:hover { background: #2f4239; }
.sc-generate:active { transform: scale(0.98); }
.sc-generate:focus-visible { outline: 2px solid #123963; outline-offset: 2px; }
.sc-generate[aria-busy="true"] { opacity: 0.7; cursor: progress; }

.sc-frame {
  position: relative; aspect-ratio: 1 / 1; overflow: hidden;
  border-radius: 12px; background: var(--sc-chip);
}
.sc-frame-wide { aspect-ratio: 16 / 9; }
.sc-img-warm { filter: sepia(0.22) saturate(1.25) brightness(1.03) hue-rotate(-6deg); }
.sc-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sc-caption { margin-top: 8px; font-size: 12px; line-height: 1.35; }
.sc-caption p:first-child { font-size: 13px; }

/* Pending state only exists once JS has taken over; without JS the results are simply shown. */
.sc-pending {
  position: absolute; inset: 0; display: grid; place-items: end start; padding: 8px;
  background:
    linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%) 0 0 / 250% 100%,
    linear-gradient(160deg, #eef0eb, #e3e8df);
  opacity: 0; visibility: hidden;
}
.sc-pending > span {
  font-size: 11px; font-weight: 500; color: var(--sc-muted);
  background: rgba(255, 255, 255, 0.8); border-radius: 999px; padding: 3px 8px;
}

.sc-js .sc-result .sc-img {
  filter: blur(18px) saturate(0.6); transform-origin: center; opacity: 0;
  transition: filter 900ms cubic-bezier(0.16, 1, 0.3, 1), opacity 500ms cubic-bezier(0.16, 1, 0.3, 1);
}
.sc-js .sc-result .sc-pending { opacity: 1; visibility: visible; animation: sc-shimmer 1.6s linear infinite; transition: opacity 400ms ease-out, visibility 0s 400ms; }
.sc-js .sc-result .sc-caption { opacity: 0.45; transition: opacity 400ms ease-out; }
.sc-js .sc-result.is-done .sc-img { filter: none; opacity: 1; }
.sc-js .sc-result.is-done .sc-pending { opacity: 0; visibility: hidden; animation: none; }
.sc-js .sc-result.is-done .sc-caption { opacity: 1; }

@keyframes sc-shimmer { from { background-position: 125% 0, 0 0; } to { background-position: -125% 0, 0 0; } }

/* ---------- Translator ---------- */

.sc-pill {
  display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 999px;
  background: #fff; color: var(--sc-ink); border: 1px solid var(--sc-line);
}
.sc-pill.is-on { background: var(--sc-accent); color: var(--sc-accent-fg); border-color: var(--sc-accent); }

.sc-select {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  height: 38px; padding: 0 12px; border-radius: 12px; background: var(--sc-chip);
  font-size: 14px; color: var(--sc-ink); min-width: 0;
}
.sc-select::after {
  content: ''; flex: none; width: 6px; height: 6px; margin-top: -3px;
  border: solid var(--sc-muted); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg);
}

.sc-toggle { position: relative; width: 30px; height: 18px; border-radius: 999px; background: var(--sc-accent); }
.sc-toggle::after { content: ''; position: absolute; right: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; }

.sc-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; }
.sc-icon svg { width: 17px; height: 17px; }

.sc-target mark { color: inherit; border-radius: 4px; padding: 0 2px; margin: 0 -2px; }
.sc-target mark[data-word] { background: var(--sc-bubble); box-shadow: inset 0 -1.5px 0 var(--sc-accent); }
.sc-target mark[data-glossary] { background: rgba(221, 246, 82, 0.6); }
.sc-glossary-swatch { width: 10px; height: 10px; border-radius: 3px; background: rgba(221, 246, 82, 0.9); }

.sc-popover {
  position: relative; margin-top: 14px; max-width: 300px; border-radius: 14px; background: #fff;
  border: 1px solid var(--sc-line);
  box-shadow: 0 18px 40px rgba(20, 30, 20, 0.14), 0 2px 6px rgba(20, 30, 20, 0.06);
}
/* Caret pointing up at the clicked word */
.sc-popover::before {
  content: ''; position: absolute; top: -6px; left: 56px; width: 10px; height: 10px;
  background: #fff; border-left: 1px solid var(--sc-line); border-top: 1px solid var(--sc-line);
  transform: rotate(45deg);
}

.sc-field {
  height: 34px; padding: 0 30px 0 12px; border-radius: 12px; border: 1px solid var(--sc-line);
  background-color: #f9faf8; color: var(--sc-ink); font: inherit; font-size: 13px;
}
select.sc-field {
  appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, #62685f 50%), linear-gradient(135deg, #62685f 50%, transparent 50%);
  background-position: calc(100% - 15px) 15px, calc(100% - 11px) 15px;
  background-size: 4px 4px; background-repeat: no-repeat;
  box-shadow: 0 0 0 0 rgba(221, 246, 82, 0);
  transition: box-shadow 200ms ease-out, border-color 200ms ease-out;
}
select.sc-field:hover { border-color: rgba(30, 40, 30, 0.25); }
select.sc-field:focus-visible { outline: 2px solid #123963; outline-offset: 2px; }
.sc-field-static { display: inline-flex; align-items: center; }

.sc-target.is-swapping { animation: sc-swap 360ms cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes sc-swap { from { opacity: 0.2; filter: blur(3px); } to { opacity: 1; filter: none; } }

@media (prefers-reduced-motion: reduce) {
  .sc-js .sc-result .sc-img, .sc-js .sc-result .sc-pending, .sc-js .sc-result .sc-caption { transition: none; animation: none; }
  .sc-target.is-swapping { animation: none; }
  .sc-generate { transition: none; }
}
