/* A compact creative canvas with light as the main motion language. */
:root { --dream-blue: rgba(123, 182, 251, .5); --dream-violet: rgba(165, 126, 234, .4); --dream-pearl: rgba(255, 209, 169, .56); }
html[data-theme="dark"] { --dream-blue: rgba(73, 130, 237, .34); --dream-violet: rgba(152, 91, 221, .36); --dream-pearl: rgba(226, 188, 159, .25); }
#stage { position: relative; }
#stage .hero { position: relative; isolation: isolate; width: min(100%, 980px); margin: 0 auto; padding: 32px 0 0; overflow: visible; }
#stage .hero-copy { position: relative; z-index: 1; }
.hero-kicker { display: inline-flex; gap: 7px; align-items: center; color: var(--studio-muted); font-size: 10px; letter-spacing: .14em; margin-bottom: 13px; }
.hero-kicker i { width: 5px; height: 5px; border-radius: 50%; background: var(--studio-accent); box-shadow: 0 0 14px var(--studio-focus); }
#stage .hero-title { font-size: clamp(34px, 4.5vw, 62px); font-weight: 650; line-height: 1.14; letter-spacing: -.06em; animation: title-arrival .85s cubic-bezier(.16,1,.3,1) both; }
#stage .hero-title > span { color: transparent; background: linear-gradient(110deg, #5667bb 10%, #8e67ae 53%, #b38271 100%); background-clip: text; -webkit-background-clip: text; }
html[data-theme="dark"] #stage .hero-title > span { background-image: linear-gradient(110deg, #a4caff, #c5acf5 54%, #f0c5ac); }
#stage .hero-lede { max-width: 570px; margin-top: 13px; font-size: 12px; color: var(--studio-muted); }
.hero-aura { position: absolute; z-index: -1; inset: -100px -5% -210px; overflow: hidden; pointer-events: none; opacity: .76; transform: translate(var(--hero-shift-x, 0px), var(--hero-shift-y, 0px)); transition: transform 1.2s cubic-bezier(.16,1,.3,1); mask-image: radial-gradient(ellipse at center, #000 0 24%, transparent 70%); }
.hero-aura i { position: absolute; width: 64%; height: 105%; left: 0; top: -4%; background: radial-gradient(ellipse, var(--dream-blue), transparent 65%); animation: hero-light 16s ease-in-out infinite alternate; }
.hero-aura i:nth-child(2) { left: 30%; top: -18%; background: radial-gradient(ellipse, var(--dream-violet), transparent 65%); animation-delay: -7s; animation-direction: alternate-reverse; }
.hero-aura i:nth-child(3) { left: 45%; top: 15%; background: radial-gradient(ellipse, var(--dream-pearl), transparent 60%); animation-delay: -11s; }
#stage > #composer { width: min(100%, 850px); margin-top: 24px; border-color: color-mix(in srgb, var(--studio-line-strong) 80%, var(--studio-focus) 20%); background: color-mix(in srgb, var(--studio-panel) 96%, transparent); box-shadow: 0 14px 48px var(--studio-focus-soft), 0 1px 2px var(--studio-line); }
#stage .prompt-suggestions { margin-top: 16px; margin-bottom: 25px; gap: 7px; }
#stage .reel-head { margin-bottom: 12px; }
#stage .reel-head h2 { font-size: 17px; }
#stage .reel-head p, #stage .reel-head-note { font-size: 11px; }
#stage .inspiration-reel { margin-top: 0; }
#stage .reel-grid { gap: 12px; }
#stage .reel-media { aspect-ratio: 2 / 1; border-radius: 13px; }
#stage .reel-caption { padding-top: 9px; }
#stage .reel-caption strong { font-size: 12px; }
#stage .reel-caption small { font-size: 10px; }
body:not(.reference-workspace) #stage > .results-head,
body:not(.reference-workspace) #stage > .results,
body:not(.reference-workspace) #stage > .stage-empty { display: none !important; }
body.reference-workspace #caseGallerySection { display: none !important; }
.workspace-entry, .workspace-home { display: inline-flex; align-items: center; gap: 9px; height: 30px; padding: 0 11px; border: 1px solid var(--studio-line-strong); border-radius: 9px; background: var(--studio-panel); color: var(--studio-muted); font-size: 11px; transition: color .2s, border-color .2s, background .2s; }
.workspace-entry:hover, .workspace-home:hover { color: var(--studio-accent); border-color: var(--studio-focus); background: var(--studio-accent-soft); }
.workspace-entry[hidden], body.reference-workspace .workspace-entry, body:not(.reference-workspace) .workspace-home { display: none !important; }
.mobile-top-actions .mobile-workspace-entry { width: auto; padding: 0 9px; height: 30px; font-size: 10px; background: var(--studio-panel); color: var(--studio-muted); border: 1px solid var(--studio-line); border-radius: 8px; }
.mobile-workspace-entry[hidden], body.reference-workspace .mobile-workspace-entry { display: none !important; }
body.reference-workspace #stage { padding-top: 14px; padding-right: clamp(12px, 1.4vw, 24px); padding-left: clamp(12px, 1.4vw, 24px); }
body.reference-workspace #stage .results-head { min-height: 28px; height: 28px; margin: 0 0 12px; align-items: center; }
body.reference-workspace #stage .results-head h2 { font-size: 16px; font-weight: 600; }
.workspace-note { color: var(--studio-quiet); font-size: 10px; }
body.reference-workspace #stage .results { gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
body.reference-workspace #stage .project-day { min-height: 21px; margin-top: 5px; }
.failure-tray { grid-column: 1 / -1; border: 1px solid var(--studio-line); border-radius: 11px; background: var(--studio-panel); margin-bottom: 2px; }
.failure-tray > summary { display: flex; align-items: center; gap: 14px; padding: 11px 14px; cursor: pointer; list-style: none; color: var(--studio-quiet); font-size: 11px; }
.failure-tray > summary::-webkit-details-marker { display: none; }
.failure-tray > summary b { margin-left: auto; transition: transform .25s ease; }
.failure-tray[open] > summary b { transform: rotate(180deg); }
.failure-tray .failure-count { color: var(--studio-error); font-weight: 550; }
.failed-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: 8px; padding: 0 10px 10px; }
body.reference-workspace #stage .failed-list > .card { width: 100%; min-height: 0 !important; height: auto !important; aspect-ratio: auto !important; padding: 0; border: 0; border-radius: 8px; background: var(--studio-panel-2); }
body.reference-workspace #stage .failed-list .card-failed { display: grid; grid-template-columns: 20px 1fr auto; align-items: start; padding: 12px; gap: 5px 10px; }
.failed-list .fail-icon { grid-row: 1 / 3; width: 18px; height: 18px; }
.failed-list .fail-prompt { font-size: 11px; padding: 0; -webkit-line-clamp: 1; }
.failed-list .fail-msg { grid-column: 2; font-size: 10px; line-height: 1.65; }
.failed-list .fail-retry { grid-column: 3; grid-row: 1 / 3; margin: 0; align-self: center; white-space: nowrap; font-size: 10px; }
/* Waiting occupies the same frame as the completed work. */
body.reference-workspace #stage .project-output-grid > .card:has(.card-generating) { padding: 0; }
body.reference-workspace #stage .project-output-grid .card-generating { position: relative; height: 100%; display: grid; grid-template-rows: auto 1fr auto auto; gap: 10px; padding: 15px; background: linear-gradient(155deg, var(--studio-panel), var(--studio-panel-2)); overflow: hidden; }
body.reference-workspace #stage .gen-preview { min-height: 130px; height: auto; border-radius: 0; background: transparent; overflow: visible; position: relative; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 14px; }
body.reference-workspace #stage .gen-preview::before, body.reference-workspace #stage .gen-preview::after { display: none; }
.gen-nebula { position: absolute; inset: -45px -60px; overflow: hidden; pointer-events: none; mask-image: radial-gradient(ellipse, #000 22%, transparent 71%); }
.gen-nebula i { position: absolute; inset: -25%; background: radial-gradient(ellipse at 34% 45%, var(--dream-blue), transparent 55%); animation: dream-drift 8s ease-in-out infinite alternate; }
.gen-nebula i:nth-child(2) { background: radial-gradient(ellipse at 67% 62%, var(--dream-violet), transparent 52%); animation-delay: -4s; animation-direction: alternate-reverse; }
.gen-nebula i:nth-child(3) { background: radial-gradient(ellipse at 50% 41%, var(--dream-pearl), transparent 37%); animation-delay: -2s; }
.gen-orbit { position: absolute; width: 94px; height: 94px; top: calc(50% - 63px); border: 1px solid color-mix(in srgb, var(--studio-focus) 24%, transparent); border-radius: 50%; box-shadow: inset 0 0 26px var(--studio-focus-soft), 0 0 44px var(--studio-focus-soft); animation: dream-breathe 4.8s ease-in-out infinite; }
.gen-orbit::after { content: ""; position: absolute; inset: 12px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--studio-panel) 70%, transparent); }
.gen-star { position: relative; z-index: 1; font-size: 29px; line-height: 52px; color: var(--studio-accent); text-shadow: 0 0 24px var(--studio-focus-soft); animation: dream-breathe 4.8s ease-in-out infinite; }
body.reference-workspace #stage .gen-preview > span { position: relative; z-index: 1; font-size: 10px; color: var(--studio-muted); opacity: 1; letter-spacing: .06em; }
body.reference-workspace #stage .gen-stage strong { font-size: 10px; font-weight: 550; }
.gen-hint { font-size: 9px; color: var(--studio-quiet); }
/* The fullscreen light has no hit area and never delays admission. */
.generation-transition { position: fixed; inset: 0; z-index: 80; overflow: hidden; isolation: isolate; pointer-events: none; }
.generation-transition[hidden] { display: none !important; }
.transition-bloom { position: absolute; inset: -45%; opacity: 0; transform-origin: 50% 55%; }
.transition-bloom i { position: absolute; width: 78%; height: 90%; top: 4%; left: -8%; border-radius: 50%; background: radial-gradient(ellipse, var(--dream-blue), transparent 65%); }
.transition-bloom i:nth-child(2) { left: 25%; top: 14%; background: radial-gradient(ellipse, var(--dream-violet), transparent 64%); }
.transition-bloom i:nth-child(3) { left: 15%; top: -5%; background: radial-gradient(ellipse, var(--dream-pearl), color-mix(in srgb, var(--studio-panel) 74%, transparent) 30%, transparent 64%); }
.transition-focus { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 14px; color: var(--studio-text); font-size: 11px; letter-spacing: .18em; opacity: 0; }
.transition-spark { font-size: 36px; color: var(--studio-accent); }
.generation-transition[data-phase="launch"] .transition-bloom { animation: cinematic-launch 1s cubic-bezier(.2,.7,.2,1) both; }
.generation-transition[data-phase="launch"] .transition-focus { animation: cinematic-focus 1s ease both; }
.generation-transition[data-phase="waiting"] .transition-bloom { transform: scale(1.1); opacity: .16; transition: opacity .7s ease; }
.generation-transition[data-phase="reveal"] .transition-bloom { animation: cinematic-reveal .95s cubic-bezier(.16,1,.3,1) both; }
.generation-transition[data-phase="dismiss"] { opacity: 0; transition: opacity .18s ease; }
.generation-transition[data-phase="waiting"] .transition-focus, .generation-transition[data-phase="reveal"] .transition-focus { display: none; }
#viewTools { padding: 0 !important; }
#viewTools > .view-head { width: 100%; max-width: none; margin: 0; min-height: 48px; padding: 12px 20px !important; border-bottom: 1px solid var(--studio-line); }
#viewTools > .view-head > div { display: flex; align-items: center; gap: 14px; width: 100%; }
#viewTools .view-head .eyebrow { display: none; }
#viewTools .view-title { margin: 0; font-size: 16px; letter-spacing: -.03em; }
#viewTools .view-subtitle { margin: 0; font-size: 11px; }
#viewTools #toolWrap { width: 100%; max-width: none; flex: 1; margin: 0; padding: 0; min-height: 0; border: 0; border-radius: 0; }
#viewTools #toolFrame { width: 100%; height: 100%; border-radius: 0; }
@keyframes title-arrival { from { transform: translateY(13px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes hero-light { from { transform: translate(-3%, -4%) scale(.94); } to { transform: translate(6%, 8%) scale(1.14); } }
@keyframes dream-drift { from { transform: translate(-6%, -4%) rotate(-9deg) scale(.9); opacity: .7; } to { transform: translate(9%, 8%) rotate(12deg) scale(1.13); opacity: 1; } }
@keyframes dream-breathe { 0%,100% { transform: scale(.94); opacity: .6; } 50% { transform: scale(1.06); opacity: 1; } }
@keyframes cinematic-launch { 0% { transform: scale(.38) translateY(13%); opacity: 0; } 48% { opacity: .92; } 100% { transform: scale(1.08) translateY(0); opacity: .2; } }
@keyframes cinematic-focus { 0%,100% { opacity: 0; transform: translateY(8px); } 30%,62% { opacity: .88; transform: translateY(0); } }
@keyframes cinematic-reveal { from { transform: scale(.72); opacity: .9; } to { transform: scale(1.45); opacity: 0; } }
.view:not(.active) .hero-aura i, .view:not(.active) .gen-nebula i, .view:not(.active) .gen-orbit, .view:not(.active) .gen-star { animation-play-state: paused; }
@media (max-width: 760px) {
  #stage .hero { padding-top: 79px; }
  #stage .hero-title { font-size: clamp(31px, 6vw, 42px); }
  #stage .hero-lede { max-width: 330px; font-size: 11px; padding: 0 14px; }
  #stage > #composer { margin-top: 20px; }
  #stage .prompt-suggestions { margin-bottom: 22px; }
  #stage .reel-media { aspect-ratio: 1.7; }
  body.reference-workspace #stage { padding-top: 68px; }
  .workspace-note { display: none; }
  body.reference-workspace #stage .results { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .failure-tray > summary { font-size: 10px; gap: 7px; }
  .failed-list { grid-template-columns: 1fr; }
  #viewTools > .view-head { padding-top: 68px !important; padding-bottom: 10px !important; }
  #viewTools .view-subtitle { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-aura, .hero-aura i, #stage .hero-title, .gen-nebula i, .gen-orbit, .gen-star { animation: none !important; transition: none !important; }
  .generation-transition { display: none !important; }
}
.failed-list .fail-prompt,
.failed-list .fail-msg { text-align: left; }
.card-created-date { display: block; margin-top: 4px; font-size: 9px; opacity: .7; }
#stage > .case-gallery-section { order: 4; }
