/* ==========================================================================
   Free Restore page — extends style.css + home-trust.css.
   Every visual value references an existing shared token. No separate palette.
   Loaded after the global stylesheets; only old-photo-restoration-online-free.html uses it.
   ========================================================================== */

/* ---------- Restore Studio — same ink canvas as .section-dark / .cta-band ---------- */
.studio-stage{padding:64px 0 80px;background:var(--ink);color:var(--white)}
.studio-intro{max-width:900px;margin:0 auto 40px;text-align:center}
/* Breadcrumb belongs to the dark hero, not to a pale strip above it. */
.studio-intro .crumb{display:flex;align-items:center;justify-content:center;gap:10px;margin:0 0 24px;font-family:var(--font-body);font-size:12px;letter-spacing:.08em;color:#BDBAB3}
.studio-intro .crumb a{color:#D6D1C9;text-decoration:none;border-bottom:1px solid rgba(214,209,201,.35);padding-bottom:2px;transition:color .18s ease,border-color .18s ease}
.studio-intro .crumb a:hover,.studio-intro .crumb a:focus-visible{color:var(--accent-light);border-color:var(--accent-light)}
.studio-intro .crumb .crumb-sep{color:#7E776E}
.studio-intro .crumb [aria-current="page"]{color:var(--accent-light);font-weight:600}
/* Light text on the dark canvas reuses the shades already used by .cta-band and .section-dark */
.studio-intro .eyebrow{color:var(--accent-light)}
.studio-intro h1{font-size:clamp(32px,3.7vw,46px);line-height:1.14;margin-bottom:14px;color:var(--white)}
/* Pages that already own an <h1> above the fold mount the studio as an <h2>. */
.studio-intro h2{font-size:clamp(26px,3vw,36px);line-height:1.18;margin-bottom:14px;color:var(--white)}
/* keep "Online Free" on one line, otherwise the italic tail drops alone */
.studio-intro h1 em,.studio-intro h2 em{font-style:italic;color:var(--accent-light);white-space:nowrap}
.studio-intro p{font-size:17px;color:#D6D1C9;max-width:560px;margin:0 auto}
.studio-trust{margin-top:18px;display:flex;flex-wrap:wrap;justify-content:center;gap:8px 22px;font-size:12.5px;color:#BDBAB3}
.studio-trust b{color:var(--white);font-weight:600}

/* White workbench lifted off the ink canvas so the tool reads at a glance.
   It must reset the inherited white text from .studio-stage. */
.studio-shell{max-width:1060px;margin:0 auto;background:var(--white);border:1px solid var(--line);border-radius:var(--radius-lg);box-shadow:var(--shadow-lg);overflow:hidden;color:var(--ink)}
.studio-topbar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 26px;background:var(--surface-2);border-bottom:1px solid var(--line);flex-wrap:wrap}
.st-title{display:inline-flex;align-items:center;gap:9px;font-family:var(--font-body);font-size:13px;font-weight:700;color:var(--ink)}
.st-dot{width:8px;height:8px;border-radius:50%;background:var(--accent)}
.st-sub{font-weight:400;color:var(--ink-soft)}
.st-steps{display:flex;gap:20px;font-family:var(--font-body);font-size:11.5px;letter-spacing:.06em;color:var(--ink-faint)}
.st-steps .on{color:var(--accent-dark);font-weight:700}
.st-quota{font-family:var(--font-body);font-size:12px;font-weight:700;color:var(--accent-dark);background:var(--accent-wash);border:1px solid var(--accent);border-radius:99px;padding:5px 12px;white-space:nowrap}
.st-quota.spent{color:var(--ink-soft);background:var(--surface-3);border-color:var(--line)}
.studio-body{display:grid;grid-template-columns:.92fr 1.08fr}

/* ---------- studio panels ---------- */
.wb-input{padding:32px}
.wb-output{padding:32px;background:var(--bg);display:flex;flex-direction:column}
.wb-head{display:flex;align-items:center;gap:10px;margin-bottom:14px}
.wb-num{width:26px;height:26px;border-radius:50%;background:var(--accent);color:#fff;display:grid;place-items:center;font-family:var(--font-body);font-size:12px;font-weight:700;flex:0 0 auto}
.wb-head h2,.wb-head h3{font-family:var(--font-body);font-size:15px;font-weight:700;letter-spacing:0}
.wb-head-2{margin-top:22px}
.wb-drop{border:2px dashed var(--line);border-radius:var(--radius);padding:42px 20px;text-align:center;background:var(--bg);cursor:pointer;transition:border-color .2s,background .2s}
.wb-drop:hover,.wb-drop.dragover{border-color:var(--accent);background:var(--accent-wash)}
.wb-drop svg{width:38px;height:38px;color:var(--accent);margin:0 auto 12px}
.wb-drop b{display:block;font-family:var(--font-title);font-size:18px;margin-bottom:5px}
.wb-drop span{display:block;font-size:13px;color:var(--ink-soft)}
.tool-file{margin-top:14px;font-size:13px;color:var(--ink-soft);display:none;padding:10px 13px;background:var(--white);border:1px solid var(--line);border-radius:var(--radius-sm)}
.tool-opts{display:flex;flex-wrap:wrap;gap:9px;margin-bottom:24px}
.tool-chip{border:1px solid var(--line);border-radius:99px;padding:9px 15px;font-size:13px;cursor:pointer;background:var(--white);color:var(--ink);transition:border-color .2s,background .2s,color .2s}
.tool-chip:hover{border-color:var(--accent)}
.tool-chip.on{border-color:var(--accent);background:var(--accent-wash);color:var(--accent-dark);font-weight:600}
.wb-input .btn{width:100%}
/* The button is an "again" control, not the trigger — the run starts on upload,
   so .btn's display:inline-flex must not resurrect it while it is hidden. */
.wb-input .btn[hidden]{display:none}
.tool-auto{margin:-2px 0 22px;padding:12px 14px;border-left:2px solid var(--accent);background:var(--accent-wash);border-radius:0 var(--radius-sm) var(--radius-sm) 0;font-size:13px;line-height:1.6;color:var(--ink-soft)}
.tool-fine{text-align:center;margin-top:12px;font-size:12px;color:var(--ink-soft)}

/* result pane */
.tr-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px;padding-bottom:14px;border-bottom:1px solid var(--line)}
.tr-label{font-family:var(--font-title);font-size:15px;font-weight:600}
.tr-status{font-size:12.5px;color:var(--ink-soft)}
.tr-stage{border:1px solid var(--line);border-radius:var(--radius-sm);padding:10px 13px;margin-bottom:8px;font-size:13.5px;display:flex;align-items:center;gap:10px;color:var(--ink-soft);background:var(--white);transition:.2s}
.tr-stage:before{content:"";width:8px;height:8px;border-radius:50%;background:var(--line);flex:0 0 auto}
.tr-stage.done{color:var(--ink)}
.tr-stage.done:before{background:var(--accent)}
.tr-stage.active{color:var(--ink);border-color:var(--accent)}
.tr-stage.active:before{background:var(--accent);animation:trpulse 1s infinite}

/* ---------- automatic check ----------
   The panel the tool fills in from real measurements on the uploaded file.
   It exists to make "automatic" visible: the visitor watches the machine name
   what is wrong with their photo before any GPU time is spent. */
.tr-detect{margin-bottom:16px;padding:14px 16px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--white)}
.tr-detect[hidden]{display:none}
.trd-top{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:11px}
.trd-eyebrow{font-family:var(--font-body);font-size:10.5px;letter-spacing:.13em;text-transform:uppercase;font-weight:700;color:var(--accent-dark)}
.trd-sum{font-size:11.5px;color:var(--ink-soft)}
.trd-list{display:grid;gap:8px;margin:0;padding:0;list-style:none}
.trd-row{display:grid;grid-template-columns:1fr auto;gap:2px 10px;font-size:12.5px;align-items:center;opacity:0;transform:translateY(3px);animation:trdin .22s ease forwards}
.trd-row b{font-weight:600;color:var(--ink)}
.trd-row i{font-style:normal;font-size:10px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;padding:2px 7px;border-radius:99px;border:1px solid var(--line);color:var(--ink-soft);background:var(--surface-2);text-align:center;min-width:78px}
.trd-row.moderate i{color:var(--accent-dark);border-color:var(--accent);background:var(--accent-wash)}
/* heavy reads as a harder outline, not a black slab — the rows must not out-shout the photo */
.trd-row.heavy i{color:var(--ink);border-color:var(--ink);background:var(--white)}
.trd-row small{grid-column:1/-1;font-size:11.5px;color:var(--ink-soft);line-height:1.45}
@keyframes trdin{to{opacity:1;transform:none}}
.trd-note{margin:11px 0 0;padding-top:10px;border-top:1px solid var(--line);font-size:12px;color:var(--accent-dark);line-height:1.5}
.trd-note[hidden]{display:none}

/* progress bar under the four stages */
.tr-progress{margin-top:4px;margin-bottom:16px;scroll-margin-top:96px}
.tr-track{height:8px;border-radius:99px;background:var(--surface-3);border:1px solid var(--line);overflow:hidden}
.tr-bar{display:block;height:100%;width:0;border-radius:99px;background:linear-gradient(90deg,var(--accent),var(--accent-dark));transition:width .28s linear}
.tr-progress-meta{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:7px;font-size:11.5px;color:var(--ink-soft)}
.tr-progress-meta b{font-family:var(--font-body);font-size:12px;color:var(--accent-dark);font-weight:700;letter-spacing:.02em}
.tr-progress.done .tr-bar{background:linear-gradient(90deg,var(--accent),#2e7d54)}
.tr-progress.done .tr-progress-meta b{color:#2e7d54}
@keyframes trpulse{0%,100%{opacity:1}50%{opacity:.35}}
.tr-idle,.tr-preview{position:relative;margin-top:auto;border-radius:var(--radius);overflow:hidden;border:1px solid var(--line);background:var(--surface-3)}
.tr-idle{min-height:250px}
.tr-idle img{width:100%;height:250px;object-fit:cover;filter:grayscale(.5) sepia(.22) brightness(.92)}
/* The label sits on the plate itself, so it gets its own scrim and drops to the
   bottom. Centred white text over a busy print was unreadable on wide photos. */
.tr-idle::after{content:'';position:absolute;inset:0;background:linear-gradient(to top,rgba(20,17,14,.86) 0%,rgba(20,17,14,.42) 30%,rgba(20,17,14,0) 62%)}
.tr-idle span{position:absolute;inset:0;z-index:1;display:grid;align-items:end;justify-items:center;padding-bottom:18px;font-family:var(--font-title);font-size:19px;color:#fff;text-shadow:0 1px 10px rgba(0,0,0,.6)}
/* The preview is a dark mat: the whole photo sits inside it, and any gutter
   reads as part of the frame instead of a pale gap. */
.tr-preview{display:none;background:#161310;border-color:#161310}
/* The compare frame shows the WHOLE photo, never a crop: the damage we fix
   (torn corners, edges, group framing) lives at the borders, and a cropped
   result reads as "my photo got cut". Height drives the size, the width follows
   the photo's real aspect ratio via --ar (set by tool.js on image load). */
.tr-compare.compare{
  --ar:1;
  border:0;border-radius:0;
  width:min(100%,calc(var(--ar) * 430px));
  height:auto;
  aspect-ratio:var(--ar);
  margin-inline:auto;
  background:#161310;
  position:relative;
  z-index:0;            /* own stacking context: pill stays above the photo */
}
.tr-compare img{position:absolute;inset:0;width:100%;height:100%;max-height:none;object-fit:contain;object-position:center;display:block;z-index:2}
.tr-compare .after-wrap{z-index:3}
.tr-compare .after-wrap img{height:100%;z-index:auto}
.tr-compare .handle{left:50%;z-index:5}
.tr-compare .tag{top:12px;z-index:5}
.tr-compare .tag-before{left:12px}
.tr-compare .tag-after{right:12px}
/* scrim so the unlock pill reads as part of the photo, not a sticker on a face */
.tr-compare::after{content:'';position:absolute;left:0;right:0;bottom:0;height:104px;background:linear-gradient(to top,rgba(18,15,12,.62),rgba(18,15,12,0));pointer-events:none;z-index:4}
.tr-watermark{position:absolute;inset:0;display:grid;place-items:center;pointer-events:none;z-index:1}
.tr-watermark span{font-family:var(--font-title);font-size:clamp(20px,2.6vw,34px);font-style:italic;color:rgba(255,255,255,.78);text-shadow:0 1px 10px rgba(0,0,0,.45);transform:rotate(-24deg);white-space:nowrap}
.tr-unlock{position:absolute;left:50%;bottom:16px;transform:translateX(-50%);z-index:2;background:var(--ink);color:#fff;border-radius:99px;padding:9px 20px;font-family:var(--font-body);font-size:13px;font-weight:600;white-space:nowrap;box-shadow:var(--shadow)}
.tr-unlock:hover{background:var(--accent-dark)}
/* Saving the preview sits under the unlock, not beside it: the unlock is the
   offer, this is the proof. A plain download would hand over a clean file,
   because the PREVIEW mark is an overlay, so tool.js bakes it in first. */
.wb-output .tool-save{
  display:flex;flex-direction:column;gap:4px;width:100%;
  margin-top:14px;padding:13px 0 0;
  background:none;border:0;border-top:1px solid var(--line);
  text-align:left;cursor:pointer;
}
.wb-output .tool-save[hidden]{display:none}
.wb-output .tool-save .ts-main{
  display:inline-flex;align-items:center;gap:7px;
  font-family:var(--font-body);font-size:13.5px;font-weight:600;color:var(--accent-dark);
  transition:color .16s;
}
.wb-output .tool-save .ts-main svg{width:15px;height:15px;flex:0 0 auto}
.wb-output .tool-save:hover .ts-main{color:var(--ink)}
.wb-output .tool-save small{font-size:11.5px;line-height:1.45;color:var(--ink-soft)}

/* failed run: show the photo back, but nothing that pretends it is a result */
.tr-preview.local .tr-unlock{display:none}
.tr-preview.failed .tr-watermark,
.tr-preview.failed .tr-unlock,
.tr-preview.failed .tag-after,
.tr-preview.failed .handle{display:none}
.tr-preview.failed{border-color:var(--accent)}

/* ---------- capability cards ---------- */
.cap-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:24px}
.cap-card{background:var(--white);border:1px solid var(--line);border-radius:var(--radius);padding:30px;transition:transform .2s,box-shadow .2s}
.cap-card:hover{transform:translateY(-3px);box-shadow:var(--shadow)}
.cap-card .icon{width:48px;height:48px;border-radius:12px;background:var(--accent-wash);color:var(--accent);display:grid;place-items:center;margin-bottom:20px}
.cap-card .icon svg{width:24px;height:24px}
.cap-card h3{font-size:20px;margin-bottom:10px}
.cap-card p{font-size:14.5px;color:var(--ink-soft)}
.inline-hook{margin-top:28px;padding:18px 22px;background:var(--white);border:1px solid var(--line);border-left:3px solid var(--accent);border-radius:var(--radius-sm);font-size:15px;color:var(--ink-soft)}
.inline-hook a{color:var(--accent-dark);font-weight:600}
.inline-hook a:hover{text-decoration:underline}

/* ---------- proof ---------- */
.proof-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:24px;align-items:start}
.proof-item{background:var(--white);border:1px solid var(--line);border-radius:var(--radius);padding:14px}
.proof-item .compare{aspect-ratio:16/10}
.proof-item:nth-child(2) .compare{aspect-ratio:1/1.05}
.proof-item figcaption{padding:14px 8px 4px;font-family:var(--font-title);font-style:italic;font-size:13.5px;color:var(--ink-soft)}
.text-link{color:var(--accent-dark);font-weight:600;font-size:14px}
.text-link:hover{color:var(--accent)}
.free-faq .wrap-narrow{max-width:860px}

/* ---------- unlock modal ---------- */
.unlock-modal{position:fixed;inset:0;z-index:9999;display:none;align-items:center;justify-content:center;padding:20px}
.unlock-modal.open{display:flex}
.um-backdrop{position:absolute;inset:0;background:rgba(36,36,36,.72);backdrop-filter:blur(3px)}
.um-card{position:relative;background:var(--white);border-radius:var(--radius-lg);max-width:540px;width:100%;max-height:92vh;overflow:auto;padding:36px;box-shadow:var(--shadow-lg)}
.um-close{position:absolute;right:16px;top:12px;border:0;background:none;font-size:28px;line-height:1;color:var(--ink-soft);cursor:pointer}
.um-close:hover{color:var(--ink)}
.um-eyebrow{font-size:11.5px;letter-spacing:.12em;text-transform:uppercase;font-weight:700;color:var(--accent);margin-bottom:10px}
.um-card h2{font-size:clamp(22px,3vw,30px);line-height:1.2;margin:0 0 10px}
.um-card>p{font-size:14px;color:var(--ink-soft);line-height:1.6;margin:0 0 18px}
.um-preview{border-radius:var(--radius);overflow:hidden;margin-bottom:20px;background:var(--bg)}
.um-preview img{width:100%;max-height:230px;object-fit:cover;display:block}
.um-choices{display:grid;gap:12px}
.um-choice{display:flex;align-items:center;justify-content:space-between;gap:14px;border:1px solid var(--line);border-radius:var(--radius);padding:16px 18px;transition:border-color .2s,transform .2s,box-shadow .2s}
.um-choice:hover{border-color:var(--accent);transform:translateY(-2px);box-shadow:var(--shadow-sm)}
.um-choice b{display:block;font-size:15px;margin-bottom:3px}
.um-choice small{display:block;font-size:12.5px;color:var(--ink-soft);line-height:1.45}
.um-arrow{font-size:20px;color:var(--accent);flex:0 0 auto}
.um-plan{background:var(--ink);border-color:var(--ink);color:#fff}
.um-plan small{color:rgba(255,255,255,.72)}
.um-plan .um-arrow{color:#fff}
.um-plan:hover{border-color:var(--accent);box-shadow:var(--shadow-lg)}
.um-fine{text-align:center;font-size:12px;color:var(--ink-soft);margin-top:16px}

/* ---------- responsive ---------- */
@media(max-width:980px){
  .studio-body{grid-template-columns:1fr}
  .wb-input{border-bottom:1px solid var(--line)}
  .st-steps{display:none}
  .cap-grid{grid-template-columns:1fr 1fr}
}
@media(max-width:640px){
  .studio-stage{padding:40px 0 56px}
  .studio-intro{margin-bottom:28px}
  .studio-intro .crumb{gap:7px;margin-bottom:18px;font-size:11px;letter-spacing:.05em}
  /* The topbar only carries two items down here; dropping the "/ free preview"
     tail keeps them on one line instead of wrapping the quota onto its own row. */
  .studio-topbar{padding:12px 18px}
  .st-sub{display:none}
  .wb-input,.wb-output{padding:22px}
  .cap-grid,.proof-grid{grid-template-columns:1fr}
  .um-card{padding:28px 20px}
}
