/* ==========================================================================
   Hero "live design studio" (demo.php). A fixed-size design-tool mock that
   studio.js scales to fit its column, so every coordinate the cursors move
   to is stable. Site palette stays white + ink + one blue; the colors
   INSIDE the phone are the fictional client's brand, on purpose.
   ========================================================================== */

/* ---------- hero layout variant: copy left, studio right ---------- */
.hero--studio .hero-inner {
  max-width: 1240px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  gap: clamp(2rem, 4vw, 4rem);
  align-items: center;
  text-align: left;
}
.hero--studio .hero-sub { margin-left: 0; margin-right: 0; max-width: 46ch; }
.hero--studio .hero-cta { justify-content: flex-start; }
.hero--studio .hero-title { font-size: clamp(2rem, 3.4vw, 3.05rem); }
.hero-proof {
  display: flex; flex-wrap: wrap; gap: .5rem 1.4rem;
  margin-top: 1.8rem; padding-top: 1.4rem;
  border-top: 1px solid var(--line-soft);
  font-size: .82rem; color: var(--muted);
}
.hero-proof span { display: inline-flex; align-items: center; gap: .45rem; }
.hero-proof svg { width: 16px; height: 16px; color: var(--accent); flex: none; }

@media (max-width: 960px) {
  .hero--studio .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero--studio .hero-sub { margin-left: auto; margin-right: auto; }
  .hero--studio .hero-cta, .hero-proof { justify-content: center; }
}

/* ---------- wrapper / scaling ---------- */
.studio-wrap { margin: 0; position: relative; }
.studio-wrap::before {               /* soft brand glow behind the window */
  content: ""; position: absolute; inset: 8% 6% 4%;
  background: radial-gradient(60% 60% at 50% 50%, rgba(0,87,255,.20), transparent 70%);
  filter: blur(30px); z-index: 0; pointer-events: none;
}
.studio-fit { position: relative; z-index: 1; width: 100%; height: calc(var(--sh, 520) * 1px * var(--s, 1)); }
.studio-caption {
  position: relative; z-index: 1;
  margin-top: .9rem; text-align: center;
  font-size: .74rem; color: var(--muted-2); font-family: var(--font-mono); letter-spacing: .01em;
}

.studio {
  --sw: 700; --sh: 520;
  --tools: 52px; --panel: 196px;
  --b: #d9dde4; --bink: #fff;
  position: absolute; top: 0; left: 0;
  width: calc(var(--sw) * 1px); height: calc(var(--sh) * 1px);
  transform: scale(var(--s, 1)); transform-origin: 0 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 40px 80px -30px rgba(10,14,23,.35), 0 12px 30px -16px rgba(10,14,23,.18);
  overflow: hidden;
  font-family: var(--font-body);
  color: var(--fg);
  user-select: none;
  text-align: left;
}
.studio.is-compact { --sw: 440; --tools: 46px; --panel: 0px; }
.studio.is-compact .st-panel, .studio.is-compact .st-file, .studio.is-compact .st-avatars { display: none; }
.studio.is-compact .st-stage:not(.is-on) .lbl { display: none; }

/* ---------- top bar ---------- */
.st-top {
  height: 46px; display: flex; align-items: center; gap: 14px;
  padding: 0 12px 0 16px; border-bottom: 1px solid var(--line-soft);
  background: #fbfbfc;
}
.st-dots { display: flex; gap: 6px; }
.st-dots i { width: 10px; height: 10px; border-radius: 50%; background: #e3e5ea; display: block; }
.st-file { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); padding: 4px 10px; border-radius: 6px; background: #fff; border: 1px solid var(--line-soft); }
.st-avatars { margin-left: auto; display: flex; }
.st-av { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 600 10.5px var(--font-display); color: #fff; border: 2px solid #fff; }
.st-avatars .st-av + .st-av { margin-left: -7px; }
.st-av-n { background: var(--accent); }
.st-av-c { background: #f59e0b; }
.st-publish {
  position: relative; overflow: hidden; margin-left: 4px;
  border: 0; border-radius: 8px; padding: 7px 16px;
  background: var(--fg); color: #fff; font: 600 12px var(--font-display);
  min-width: 96px; pointer-events: none;
}
.studio.is-compact .st-publish { margin-left: auto; }
.st-publish-fill { position: absolute; inset: 0; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; }
.st-publish-lbl { position: relative; }
.st-publish.is-live { background: var(--ok); }

/* ---------- stage progress ---------- */
.st-stages {
  position: relative; height: 36px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; border-bottom: 1px solid var(--line-soft); font-size: 11px; color: var(--muted-2);
}
.st-stage { display: inline-flex; align-items: center; gap: 6px; transition: color .4s; }
.st-stage b { font: 600 10px var(--font-mono); padding: 2px 5px; border-radius: 5px; background: #f1f2f5; transition: background .4s, color .4s; }
.st-stage.is-on { color: var(--fg); font-weight: 600; }
.st-stage.is-on b { background: var(--accent); color: #fff; }
.st-stage.is-done b { background: var(--accent-soft); color: var(--accent); }
.st-stage-bar { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; }
.st-stage-fill { display: block; height: 100%; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; }

/* ---------- body ---------- */
.st-body { position: relative; display: flex; height: calc(var(--sh) * 1px - 82px); }
.st-tools {
  width: var(--tools); flex: none; border-right: 1px solid var(--line-soft);
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 14px; background: #fff;
}
.st-tool { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); transition: background .25s, color .25s; }
.st-tool svg { width: 17px; height: 17px; }
.st-tool.is-on { background: var(--accent); color: #fff; }

.st-canvas {
  position: relative; flex: 1; overflow: hidden;
  background-color: #f6f7f9;
  background-image: radial-gradient(rgba(10,14,23,.13) 1px, transparent 1.2px);
  background-size: 16px 16px;
  transition: background-color .6s;
}
.studio.st-preview .st-canvas { background-color: #eceef2; background-image: none; }

.st-panel { width: var(--panel); flex: none; border-left: 1px solid var(--line-soft); padding: 14px 14px; position: relative; background: #fff; }
.st-panel-h { display: block; font: 600 10px var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted-2); margin: 2px 0 8px; }
.st-layers { margin-bottom: 18px; }
.st-layers li { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 5px 6px; border-radius: 6px; color: var(--muted); opacity: .25; transition: opacity .35s, background .35s, color .35s; }
.st-layers li i { width: 10px; height: 10px; border: 1.5px solid currentColor; border-radius: 3px; }
.st-layers li.is-in { opacity: 1; }
.st-layers li.is-sel { background: var(--accent-soft); color: var(--accent); }
.st-style { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line-soft); border-radius: 8px; font-size: 12px; margin-bottom: 8px; }
.st-style-sw { width: 18px; height: 18px; border-radius: 5px; background: var(--b); transition: background .5s; border: 1px solid rgba(0,0,0,.06); }
.st-style-hex { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.st-aa { font: 700 13px var(--font-display); width: 18px; text-align: center; }
.st-panel-mode {
  position: absolute; left: 14px; right: 14px; bottom: 14px;
  text-align: center; font: 600 11px var(--font-display); color: var(--accent);
  padding: 7px; border-radius: 8px; background: var(--accent-soft);
  opacity: 0; transform: translateY(6px); transition: opacity .4s, transform .4s;
}
.studio.st-preview .st-panel-mode { opacity: 1; transform: none; }

/* ---------- brief chat ---------- */
.st-brief { position: absolute; left: 50%; top: 50%; width: 300px; margin: -70px 0 0 -150px; display: flex; flex-direction: column; gap: 10px; opacity: 0; }
.st-msg { display: flex; gap: 9px; align-items: flex-start; }
.st-msg > div { background: #fff; border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; padding: 9px 12px; box-shadow: var(--shadow-md); }
.st-msg p { margin: 0; font-size: 12.5px; color: var(--fg); line-height: 1.45; min-height: 1.45em; }
.st-msg-who { display: block; font: 600 10px var(--font-mono); color: var(--muted-2); margin-bottom: 2px; }
.st-msg-av { width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center; font: 600 11px var(--font-display); color: #fff; }
.st-msg-n { flex-direction: row-reverse; opacity: 0; }
.st-msg-n > div { border-radius: 14px 4px 14px 14px; background: var(--accent); border-color: var(--accent); }
.st-msg-n p { color: #fff; }
.st-msg-n .st-msg-who { color: rgba(255,255,255,.7); }

/* ---------- artboard (the client's app) ---------- */
.ab { position: absolute; left: 50%; top: 19px; width: 204px; height: 400px; margin-left: -102px; }
.ab-label { position: absolute; top: -16px; left: 2px; font: 500 9.5px var(--font-mono); color: var(--accent); opacity: 0; white-space: nowrap; }
.ab-screen {
  position: relative; width: 100%; height: 100%;
  background: #fff; border-radius: 26px;
  border: 1.5px dashed var(--accent-line);
  padding: 22px 9px 9px;
  display: flex; flex-direction: column; gap: 7px;
  overflow: hidden;
  transform: scale(0); transform-origin: 0 0;
  transition: border-color .5s, box-shadow .5s;
}
.studio.st-designed .ab-screen { border: 1.5px solid #e6e8ed; box-shadow: 0 30px 60px -28px rgba(10,14,23,.45), 0 0 0 5px #fff, 0 0 0 6px #e3e5ea; }
.ab-notch { position: absolute; top: 7px; left: 50%; width: 54px; height: 9px; margin-left: -27px; border-radius: 9px; background: #eceef2; transition: background .5s; }
.studio.st-designed .ab-notch { background: #111; }

.ab-blk {
  position: relative; flex: none; border-radius: 9px;
  background: #eef0f4; outline: 1.5px solid transparent; outline-offset: 1px;
  transform: scale(0); transform-origin: 0 0;
  transition: background .55s, outline-color .3s, color .5s;
}
.ab-blk.is-sel { outline-color: var(--accent); }
.ab-header { height: 38px; display: flex; align-items: center; justify-content: space-between; padding: 0 11px; }
.ab-hero { height: 96px; overflow: hidden; }
.ab-chips { height: 20px; display: flex; gap: 6px; background: transparent !important; }
.ab-list { height: 138px; display: flex; flex-direction: column; gap: 6px; background: transparent !important; }
.ab-cta { height: 36px; margin-top: auto; display: grid; place-items: center; font: 600 12.5px var(--font-display); color: transparent; }

/* wireframe placeholders */
.ab-brand { font: 700 14px var(--font-display); letter-spacing: -.01em; min-width: 62px; height: 10px; line-height: 10px; border-radius: 4px; background: #d6dae1; color: transparent; white-space: nowrap; transition: background .4s, color .4s, height .4s; }
.ab-cart { position: relative; width: 18px; height: 18px; color: #c6cbd3; transition: color .4s; }
.ab-cart svg { width: 18px; height: 18px; display: block; }
.ab-badge { position: absolute; top: -6px; right: -7px; min-width: 14px; height: 14px; border-radius: 7px; background: #fff; color: var(--b); font: 700 9px/14px var(--font-display); text-align: center; font-style: normal; transform: scale(0); box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.ab-ph-x { position: absolute; inset: 0; background: linear-gradient(to top right, transparent calc(50% - .75px), #d3d7de calc(50% - .75px), #d3d7de calc(50% + .75px), transparent calc(50% + .75px)), linear-gradient(to top left, transparent calc(50% - .75px), #d3d7de calc(50% - .75px), #d3d7de calc(50% + .75px), transparent calc(50% + .75px)); }
.ab-photo { position: absolute; inset: 0; background-size: cover; background-position: center; clip-path: inset(0 100% 0 0); }
.ab-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(0,0,0,.55)); }
.ab-tag { position: absolute; left: 10px; bottom: 9px; z-index: 1; font: 700 15px var(--font-display); color: #fff; letter-spacing: -.01em; white-space: nowrap; }
.ab-chip { flex: 1; border-radius: 99px; background: #eef0f4; font: 600 9.5px/20px var(--font-body); text-align: center; color: transparent; transition: background .5s, color .5s; overflow: hidden; white-space: nowrap; }
.ab-item { flex: 1; display: flex; align-items: center; gap: 8px; padding: 0 7px; border-radius: 9px; background: #eef0f4; transition: background .5s, box-shadow .5s; }
.ab-thumb { width: 30px; height: 30px; border-radius: 7px; background: #dfe2e8; background-size: cover; flex: none; transition: background-color .5s; }
.ab-lines { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ab-name, .ab-meta { display: block; font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: transparent; border-radius: 3px; transition: background .5s, color .5s; }
.ab-name { font: 600 10.5px/1.25 var(--font-body); background: #d6dae1; width: 80%; }
.ab-meta { font: 500 9.5px/1.25 var(--font-body); background: #e2e5ea; width: 45%; }
.ab-add { width: 20px; height: 20px; border-radius: 6px; background: #dfe2e8; color: transparent; font: 600 14px/20px var(--font-display); text-align: center; flex: none; transition: background .5s, color .5s, transform .2s; }

/* designed state: client brand comes alive */
.studio.st-designed .ab-header { background: var(--b); color: var(--bink); }
.studio.st-designed .ab-brand { background: transparent; color: var(--bink); min-width: 0; height: auto; line-height: 1.2; }
.studio.st-designed .ab-cart { color: var(--bink); }
.studio.st-designed .ab-hero { background: #ddd; }
.studio.st-designed .ab-chip { background: #f1f2f4; color: #4b5260; }
.studio.st-designed .ab-chip:first-child { background: var(--b); color: var(--bink); }
.studio.st-designed .ab-item { background: #fff; box-shadow: 0 0 0 1px #eceef1, 0 4px 10px -6px rgba(10,14,23,.18); }
.studio.st-designed .ab-name { background: transparent; color: #11151d; width: auto; }
.studio.st-designed .ab-meta { background: transparent; color: #6b7280; width: auto; }
.studio.st-designed .ab-add { background: var(--b); color: var(--bink); }
.studio.st-designed .ab-cta { background: var(--b); color: var(--bink); }
.studio[data-font="serif"].st-designed .ab-brand, .studio[data-font="serif"].st-designed .ab-tag { font-family: Georgia, 'Times New Roman', serif; font-style: italic; }
.studio[data-font="display"].st-designed .ab-brand { letter-spacing: .22em; font-size: 13px; }
.studio[data-font="body"].st-designed .ab-brand { font-family: var(--font-body); }

.ab-toast {
  position: absolute; left: 9px; right: 9px; bottom: 52px; z-index: 3;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 11px; border-radius: 11px; background: #11151d; color: #fff;
  font: 600 10.5px var(--font-body); box-shadow: 0 12px 24px -10px rgba(0,0,0,.5);
  opacity: 0; transform: translateY(14px);
}
.ab-toast-ok { width: 16px; height: 16px; border-radius: 50%; background: var(--ok); display: grid; place-items: center; font-size: 9px; flex: none; }

/* ---------- floating extras ---------- */
.st-palette {
  position: absolute; left: 12px; top: 112px; z-index: 4;
  display: flex; flex-direction: column; gap: 7px; padding: 8px;
  background: #fff; border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--shadow-md);
  opacity: 0; transform: translateX(-10px) scale(.95);
}
.st-sw { width: 20px; height: 20px; border-radius: 6px; display: block; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.st-sw[data-sw="0"] { background: #6366f1; } .st-sw[data-sw="1"] { background: #f59e0b; }
.st-sw[data-sw="2"] { background: #10b981; } .st-sw[data-sw="3"] { background: #ec4899; }
.st-sw-brand { background: var(--b); }
.st-sw.is-pick { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent); }

.st-comment {
  position: absolute; z-index: 5; right: 12px; top: 128px; width: 150px;
  display: flex; gap: 7px; align-items: flex-start;
  opacity: 0; transform: scale(.85); transform-origin: 0 0;
}
.st-comment p { margin: 0; padding: 8px 10px; border-radius: 4px 12px 12px 12px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-md); font-size: 11px; line-height: 1.4; color: var(--fg); }
.st-comment .st-msg-av { width: 22px; height: 22px; font-size: 10px; }
.studio.is-compact .st-comment { right: 8px; top: 140px; width: 128px; }

.st-metric {
  position: absolute; z-index: 5; left: 12px; bottom: 22px; width: 136px;
  padding: 10px 12px 8px; border-radius: 14px; background: #fff; border: 1px solid var(--line);
  box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(14px);
}
.st-metric-lbl { display: block; font-size: 10px; color: var(--muted); }
.st-metric-v { display: block; font: 700 22px/1.1 var(--font-display); letter-spacing: -.02em; margin: 2px 0 4px; }
.st-metric svg { display: block; width: 100%; height: 30px; color: var(--accent); }

.st-launch {
  position: absolute; z-index: 5; right: 12px; top: 26px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  opacity: 0;
}
.st-domain { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 99px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-md); font: 600 11px var(--font-mono); color: var(--fg); }
.st-live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(10,138,74,.18); }
.st-platforms { font: 600 10px var(--font-display); color: var(--accent); background: var(--accent-soft); padding: 4px 9px; border-radius: 99px; }
.studio.is-compact .st-launch { right: 8px; top: 10px; }
.studio.is-compact .st-metric { left: 8px; width: 120px; }

.st-burst { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 6; pointer-events: none; }
.st-burst i { position: absolute; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }

/* ---------- multiplayer cursors ---------- */
.st-cursor { position: absolute; left: 0; top: 0; z-index: 20; pointer-events: none; will-change: transform; opacity: 0; }
.st-cursor svg { width: 20px; height: 20px; display: block; filter: drop-shadow(0 2px 3px rgba(0,0,0,.25)); }
.st-cursor path { stroke: #fff; stroke-width: 1.5; stroke-linejoin: round; }
.st-cursor-n path { fill: var(--accent); }
.st-cursor-c path { fill: #f59e0b; }
.st-cursor-tag { position: absolute; left: 15px; top: 17px; padding: 3px 8px; border-radius: 4px 9px 9px 9px; font: 600 10px var(--font-display); color: #fff; white-space: nowrap; }
.st-cursor-n .st-cursor-tag { background: var(--accent); }
.st-cursor-c .st-cursor-tag { background: #f59e0b; }
.st-ripple { position: absolute; z-index: 19; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; border: 2px solid var(--accent); pointer-events: none; }

/* ---------- reduced motion: finished static design, no cursors ---------- */
.studio.is-static .ab-screen, .studio.is-static .ab-blk { transform: none; }
.studio.is-static .ab-photo { clip-path: none; }
.studio.is-static .st-cursor { display: none; }
