/* Jellify Anything — page styles on top of /assets/site.css (mobile first, no build step). */

.jf-hero {
  display: grid;
  grid-template-areas: "copy" "stage" "controls";
  gap: 14px;
  padding: 14px 16px 36px;
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 190, 210, .55), rgba(255, 190, 210, 0) 38%),
    radial-gradient(circle at 92% 20%, rgba(190, 234, 204, .5), rgba(190, 234, 204, 0) 36%),
    linear-gradient(180deg, #fff7ec, #ffeede);
}
.jf-copy { grid-area: copy; text-align: center; }
.jf-kicker { margin: 0 0 2px; font-size: 13px; font-weight: 900; letter-spacing: .02em; color: var(--berry); text-transform: uppercase; }
.jf-copy h1 { font-size: clamp(26px, 7vw, 46px); margin: 0 0 4px; }
.jf-lead { margin: 0 auto; max-width: 520px; color: var(--ink-2); font-size: 15.5px; line-height: 1.45; }

/* ---------- stage ---------- */
.jf-stagewrap { grid-area: stage; display: flex; justify-content: center; }
.jf-stage {
  --stage-w: min(100%, 440px, calc(62vh * 9 / 16));
  position: relative;
  width: var(--stage-w);
  aspect-ratio: 9 / 16;
  border-radius: 28px;
  overflow: hidden;
  background: #fde8dc;
  box-shadow: 0 22px 54px rgba(64, 24, 72, .22), 0 0 0 6px #fff, 0 0 0 7px rgba(43, 24, 56, .08);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  isolation: isolate;
}
@supports (height: 1svh) { .jf-stage { --stage-w: min(100%, 440px, calc(62svh * 9 / 16)); } }
.jf-scene { position: absolute; inset: 0; will-change: transform; }
.jf-scene canvas { position: absolute; left: 0; top: 0; display: block; }
.jf-scene canvas.bg { width: 100%; height: 100%; }
.jf-scene canvas.fx { pointer-events: none; }
.jf-hint {
  position: absolute; left: 50%; bottom: 4.5%; transform: translateX(-50%);
  width: max-content; max-width: 92%; text-align: center; pointer-events: none;
  font: 800 12px/1.25 'Nunito', system-ui, sans-serif; color: rgba(91, 48, 39, .72);
  background: rgba(255, 247, 240, .7); padding: 7px 12px; border-radius: 999px;
  transition: opacity .5s;
}
.jf-hint.gone { opacity: 0; }
.jf-rec {
  position: absolute; top: 12px; right: 12px; display: flex; align-items: center; gap: 6px;
  background: rgba(43, 24, 56, .78); color: #fff; border-radius: 999px; padding: 6px 11px;
  font: 800 13px/1 'Nunito', system-ui, sans-serif; pointer-events: none;
}
.jf-rec i { width: 10px; height: 10px; border-radius: 50%; background: #ff3d4f; animation: jf-blink 1s infinite; }
.jf-rec b { font-variant-numeric: tabular-nums; min-width: 2.4em; }
@keyframes jf-blink { 50% { opacity: .25; } }

.jf-busy, .jf-fatal {
  position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; padding: 18px;
  background: rgba(255, 247, 240, .55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.jf-busy[hidden], .jf-fatal[hidden], .jf-pick[hidden], .jf-result[hidden], .jf-rec[hidden] { display: none; }
.jf-busy-card {
  display: grid; justify-items: center; gap: 8px; text-align: center; width: min(260px, 100%);
  background: #fff; border-radius: 20px; padding: 18px 16px; box-shadow: var(--shadow);
}
.jf-busy-card strong { font: 650 17px/1.2 'Fredoka', sans-serif; }
.jf-busy-card small { color: var(--ink-2); font-size: 12.5px; line-height: 1.3; }
.jf-spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid #ffe0c4; border-top-color: var(--orange); animation: jf-spin .8s linear infinite; }
@keyframes jf-spin { to { transform: rotate(360deg); } }
.jf-bar { width: 100%; height: 8px; border-radius: 99px; background: #ffe6cf; overflow: hidden; }
.jf-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--tangerine), var(--pink)); transition: width .2s; }
.jf-bar.indeterminate i { width: 35% !important; animation: jf-slide 1.1s ease-in-out infinite; }
@keyframes jf-slide { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
.jf-fatal { background: rgba(255, 247, 240, .92); font-weight: 800; text-align: center; color: var(--ink-2); }

.jf-pick { position: absolute; inset: 0; z-index: 3; background: #2b1838; display: grid; place-items: center; cursor: crosshair; }
.jf-pick img { max-width: 100%; max-height: 100%; object-fit: contain; }
.jf-pick-top {
  position: absolute; left: 10px; right: 10px; top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: rgba(255, 255, 255, .92); border-radius: 16px; padding: 8px 8px 8px 14px; pointer-events: auto;
}
.jf-pick-top strong { font: 650 15px 'Fredoka', sans-serif; }
.jf-x {
  border: 0; cursor: pointer; width: 34px; height: 34px; border-radius: 50%; background: #ffe6cf; color: var(--ink);
  font: 800 15px/1 'Nunito', sans-serif; flex: none;
}
.jf-x:hover { background: #ffd2ad; }

/* ---------- controls ---------- */
.jf-controls { grid-area: controls; display: grid; gap: 12px; justify-items: center; width: min(520px, 100%); margin: 0 auto; }
.jf-photo { width: min(100%, 360px); font-size: 19px; padding: 15px 22px; }
.jf-photo svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.jf-samples { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }
.jf-or { font-size: 13px; font-weight: 800; color: var(--ink-2); margin-right: 2px; }
.jf-chip {
  border: 2px solid var(--line); background: #fff; border-radius: 999px; cursor: pointer;
  height: 44px; min-width: 44px; padding: 0 12px 0 8px; display: inline-flex; align-items: center; gap: 6px;
  font: 800 14px 'Nunito', system-ui, sans-serif; color: var(--ink);
  box-shadow: 0 4px 10px rgba(64, 24, 72, .06);
}
.jf-chip .e { font-size: 22px; line-height: 1; }
.jf-chip[aria-pressed="true"] { border-color: var(--tangerine); background: #fff1e0; }
.jf-chip:hover { border-color: #ffc58f; }
.jf-chip:disabled { opacity: .5; cursor: default; }

.jf-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.jf-act {
  display: inline-flex; align-items: center; gap: 7px; height: 46px; padding: 0 16px; cursor: pointer;
  border: 0; border-radius: 999px; background: #fff; color: var(--ink);
  font: 650 16px 'Fredoka', sans-serif; box-shadow: 0 6px 16px rgba(64, 24, 72, .1), inset 0 0 0 2px var(--line);
}
.jf-act svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.jf-act:disabled { opacity: .45; cursor: default; }
.jf-act.jf-icon { width: 46px; padding: 0; justify-content: center; }
.jf-sound {
  position: absolute; top: 10px; left: 10px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: rgba(255, 247, 240, .78); color: rgba(91, 48, 39, .85);
  box-shadow: 0 2px 8px rgba(110, 50, 34, .12);
}
.jf-sound svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.jf-sound .off, .jf-sound[aria-pressed="false"] .on { display: none; }
.jf-sound[aria-pressed="false"] .off { display: block; }
.jf-clip { background: linear-gradient(180deg, #ff6aa5, var(--pink)); color: #fff; box-shadow: inset 0 -4px 0 rgba(120, 0, 50, .2), 0 8px 20px rgba(255, 61, 139, .35); padding: 0 20px; }
.jf-clip .jf-dot { width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .35); }
.jf-clip.is-rec .jf-dot { background: #ff3d4f; animation: jf-blink 1s infinite; }
.jf-link { border: 0; background: none; cursor: pointer; color: var(--link); font: 800 14px 'Nunito', sans-serif; text-decoration: underline; text-underline-offset: 3px; padding: 4px; }

.jf-privacy {
  display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 0; padding: 12px 14px; border-radius: 16px;
  background: #e9f9f3; border: 1px solid #bfeadc; font-size: 14px; line-height: 1.45; color: #23493f; text-align: left;
}
.jf-privacy svg { width: 20px; height: 20px; flex: none; margin-top: 1px; fill: none; stroke: #1f8a6a; stroke-width: 2; stroke-linecap: round; }
.jf-rights { margin: 0; font-size: 13px; color: var(--ink-2); text-align: center; }

/* ---------- sections ---------- */
.jf-steps .card h3 { margin-top: 10px; }
.jf-promo { display: grid; grid-template-columns: auto 1fr; gap: 26px; align-items: center; max-width: 880px; }
.jf-promo img { width: 140px; border-radius: 32px; box-shadow: var(--shadow); }
.jf-promo h2 { text-align: left; }
.jf-promo .badge { min-width: 186px; }
.jf-faq { max-width: 820px; }
.jf-tm { color: #bfaed0; }
.jf-noscript { text-align: center; padding: 12px; background: #fff3a6; margin: 0; }

/* ---------- result sheet ---------- */
.jf-result {
  position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px;
  background: rgba(43, 24, 56, .62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.jf-result-card {
  position: relative; width: min(420px, 100%); max-height: 100%; overflow: auto;
  background: #fff; border-radius: 26px; padding: 18px 18px 16px; box-shadow: var(--shadow); text-align: center;
}
.jf-result-card h2 { margin: 0 0 12px; font-size: 22px; }
.jf-result-card .jf-x { position: absolute; top: 12px; right: 12px; }
.jf-preview { display: flex; justify-content: center; }
.jf-preview video, .jf-preview img {
  display: block; width: auto; max-width: 100%; height: min(56vh, 520px); aspect-ratio: 9 / 16; object-fit: contain;
  border-radius: 18px; background: #fde8dc; box-shadow: 0 8px 22px rgba(64, 24, 72, .16);
}
.jf-result-actions { display: flex; justify-content: center; gap: 10px; margin: 14px 0 6px; flex-wrap: wrap; }
.jf-result-actions .btn { min-width: 132px; }
.btn.jf-ghost { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line), 0 6px 16px rgba(64, 24, 72, .1); }
.jf-result .note { margin: 6px 0 0; }

/* The recording canvas must stay in the DOM for some browsers, but never shows. */
.jf-rec-canvas { position: fixed; left: -10px; top: -10px; width: 1px !important; height: 1px !important; opacity: 0; pointer-events: none; }

/* ---------- desktop ---------- */
@media (min-width: 900px) {
  .jf-hero {
    grid-template-areas: "copy stage" "controls stage";
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto 1fr;
    column-gap: 56px; row-gap: 22px;
    padding: 44px max(24px, calc((100vw - 1120px) / 2)) 64px;
  }
  .jf-copy { text-align: left; align-self: end; }
  .jf-lead { margin: 0; font-size: 18px; }
  .jf-controls { justify-items: start; margin: 0; align-self: start; }
  .jf-samples, .jf-actions { justify-content: flex-start; }
  .jf-rights { text-align: left; }
  .jf-stage { --stage-w: min(440px, calc((100vh - 130px) * 9 / 16)); }
}
@media (max-width: 560px) {
  .jf-chip .l { display: none; }
  .jf-chip { padding: 0; width: 46px; justify-content: center; }
  .jf-act { padding: 0 14px; }
  .jf-promo { grid-template-columns: 1fr; text-align: center; }
  .jf-promo img { margin: 0 auto; width: 110px; }
  .jf-promo h2 { text-align: center; }
  .jf-promo .badges { justify-content: center; }
  .jf-lead { font-size: 14.5px; }
}
@media (max-width: 380px) {
  .jf-act { padding: 0 11px; font-size: 15px; gap: 5px; }
  .jf-chip { width: 42px; height: 42px; min-width: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  .jf-spinner, .jf-rec i, .jf-clip.is-rec .jf-dot, .jf-bar.indeterminate i { animation: none; }
}
