/* Image to PSD page, chosen direction. Loads after style.css and only adds what this page needs:
   the split controls in the bar, the layered result (flat or exploded preview plus a layers panel),
   the progress steps, and direction B's lower sections in A's visual system. */

/* intro */
.hero.psd-hero .hero-media .main { object-position: center 40%; filter: brightness(0.62); }
.hero.psd-hero h1 { font-size: clamp(32px, 4.4vw, 66px); max-width: 18ch; }
.hero.work.psd-hero h1 { font-size: clamp(20px, 1.8vw, 26px); max-width: none; }
.try-sample { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 13.5px; color: var(--accent); background: none; border: 0; cursor: pointer; font-family: var(--body); }
.hero.work .try-sample { display: none; }

/* bar: upload, split detail, cap, button */
.bar.psd { grid-template-columns: auto 1fr auto auto; }
.mode { height: 48px; min-width: 0; width: 100%; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--text); font: 500 14px var(--body); padding: 0 14px; }
.mode option { background: var(--surface); }
.cap { font-size: 13.5px; color: var(--muted); white-space: nowrap; padding: 0 6px; }
.hero.work .bar.psd { order: 3; }

/* result: preview and layers panel share the stage */
.split { display: none; position: absolute; inset: 0; z-index: 2; grid-template-columns: minmax(0, 1fr) 270px; }
.stage[data-s="result"] .split { display: grid; }
.stage[data-s="result"] .before-pic, .stage[data-s="result"] .backdrop { visibility: hidden; }
.viewport { position: relative; overflow: hidden; container-type: size; perspective: 2200px; background: radial-gradient(ellipse at 50% 40%, #1a1a1d, #0d0d0e 75%); }
.stack { position: absolute; inset: 0; margin: auto; width: min(92cqw, 92cqh * 1.777); height: auto; aspect-ratio: 2104 / 1184; transform-style: preserve-3d; transition: transform .9s cubic-bezier(.16,1,.3,1); }
.stack.exploded { transform: translateY(15%) rotateX(48deg) rotateZ(-28deg) scale(0.6); }
.ly { position: absolute; display: block; transform: translateZ(0); transition: transform .9s cubic-bezier(.16,1,.3,1), opacity .25s ease, outline-color .2s ease; outline: 1px solid transparent; }
/* depth is set per layer in JS: the big planes are spaced widely, small elements stack closer */
.stack.exploded .ly { transform: translateZ(var(--d)); outline-color: rgba(240,112,63,0.35); background: rgba(255,255,255,0.02); box-shadow: 0 0 24px rgba(240,112,63,0.08); }
.ly.off { opacity: 0; }
.ly.hl { outline: 2px solid var(--accent) !important; z-index: 2; }
.layers { border-left: 1px solid var(--line); background: rgba(14,14,15,0.94); display: flex; flex-direction: column; min-height: 0; text-align: left; }
.layers header { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 14px 10px; border-bottom: 1px solid var(--line); }
.layers header b { font: 800 15px var(--display); font-stretch: 112%; }
.layers header span { font-size: 12.5px; color: var(--muted); }
.layer-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; min-height: 0; }
.layer-list li { display: grid; grid-template-columns: 28px 44px 1fr; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 10px; cursor: default; }
.layer-list li:hover { background: rgba(255,255,255,0.05); }
.eye { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 999px; border: 0; background: transparent; color: var(--text); cursor: pointer; font-size: 16px; }
.eye[aria-pressed="false"] { color: var(--faint); }
.layer-list .th { width: 44px; height: 30px; border-radius: 6px; object-fit: contain; background-color: #2a2a2d; background-image: linear-gradient(45deg, #333 25%, transparent 25%), linear-gradient(-45deg, #333 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #333 75%), linear-gradient(-45deg, transparent 75%, #333 75%); background-size: 8px 8px; background-position: 0 0, 0 4px, 4px -4px, -4px 0; }
.layer-list .nm { font-size: 13px; color: #e4e0db; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.view-toggle { display: none; height: 40px; padding: 3px; border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(11,11,12,0.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.stage[data-s="result"] .view-toggle { display: inline-flex; }
.view-toggle button { height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: 600 13px var(--body); cursor: pointer; white-space: nowrap; }
.stage-bar .st-btn { white-space: nowrap; }
.view-toggle button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.stage .zip { display: none; }
.stage[data-s="result"] .zip { display: inline-flex; }
.stage[data-s="result"] .stage-bar { right: 282px; }
.stage[data-s="result"] .spec { left: 12px; }

/* progress steps while splitting */
.steps { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; text-align: left; font-size: 13.5px; }
.steps li { display: flex; align-items: center; gap: 8px; color: var(--faint); }
.steps li::before { content: ""; width: 8px; height: 8px; border-radius: 999px; border: 1.5px solid currentColor; }
.steps li.now { color: var(--text); }
.steps li.now::before { background: var(--accent); border-color: var(--accent); }
.steps li.done { color: var(--muted); }
.steps li.done::before { background: var(--muted); border-color: var(--muted); }

/* lower sections (direction B, A's visual system) */
.got { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 48px; margin-top: 32px; align-items: start; }
.got .contact { border-radius: var(--radius-card); overflow: hidden; border: 1px solid var(--line); max-height: 560px; }
.got .contact img { width: 100%; }
.split-view { margin: 28px 0 0; border-radius: var(--radius-card); overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.split-view img { display: block; width: 100%; height: auto; }
.split-view figcaption { padding: 12px 16px; font-size: 14px; color: var(--muted); }
.facts { list-style: none; margin: 0; padding: 0; }
.facts li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.facts li:first-child { padding-top: 0; }
.facts i { color: var(--accent); font-size: 22px; }
.facts b { display: block; color: var(--text); }
.facts span span { color: var(--muted); font-size: 15px; }
.limits { margin: 28px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 48px; }
.limits div { padding: 18px 0; border-top: 1px solid var(--line); }
.limits dt { font-weight: 600; }
.limits dd { margin: 6px 0 0; color: var(--muted); font-size: 15px; }

@media (max-width: 767px) {
  .bar.psd { grid-template-columns: 1fr; }
  .cap { text-align: center; }
  .hero.work .stage[data-s="result"] { aspect-ratio: auto; height: auto; }
  .stage[data-s="result"] .split { position: relative; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; }
  .layers { min-width: 0; }
  .stage[data-s="result"] .viewport { aspect-ratio: 16 / 11; }
  .layers { border-left: 0; border-top: 1px solid var(--line); }
  .layers header { padding: 10px 12px 6px; border-bottom: 0; }
  .layer-list { display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden; padding: 0 10px 10px; }
  .layer-list li { flex: none; grid-template-columns: 1fr; justify-items: center; gap: 2px; padding: 4px; position: relative; }
  .layer-list .th { width: 56px; height: 40px; }
  .layer-list .nm { font-size: 11px; max-width: 56px; }
  .eye { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; font-size: 13px; background: rgba(11,11,12,0.7); }
  .stage[data-s="result"] .stage-bar { right: 8px; }
  .view-toggle { height: 36px; }
  .view-toggle button { height: 28px; padding: 0 10px; font-size: 12px; }
  .stage .zip .lbl, .view-toggle .lbl { display: none; }
  .got, .limits { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .hero.work .bar.psd .cap { display: none; } /* the cost line under the bar states the cap */
}
@media (min-width: 768px) and (max-height: 700px) {
  .hero.psd-hero .hero-inner { padding-top: 88px; } /* the longer two-line title still leaves the upload in the top half */
}
@media (max-width: 767px) and (max-height: 700px) {
  .stage[data-s="result"] .viewport { aspect-ratio: 16 / 10; }
  .layers header { display: none; }
  .layer-list { padding-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .stack, .ly { transition: none; }
}
