/* ================= page banner =================
   Every other money page opens with a picture: the homepage runs a slider beside
   the copy, the old-photo page runs a row of comparisons under it. This one was
   a slab of centred text, and the tool's own plate sits 200px below — so a photo
   here would compete with it rather than support it. The second column carries
   the price instead, on a slip of paper that matches the plate's motif. */
.page-hero-ai{padding:58px 0 62px;text-align:left}
.ai-banner{
  display:grid;grid-template-columns:minmax(0,1fr) 392px;
  gap:72px;align-items:center;
}
.page-hero-ai .crumb{
  color:#6E675D;font-size:12.5px;letter-spacing:.04em;
  text-transform:uppercase;margin-bottom:16px;
}
.page-hero-ai .crumb a{color:#6E675D}
.page-hero-ai .crumb a:hover{color:var(--accent-dark)}
.page-hero-ai h1{
  font-size:clamp(38px,4.1vw,52px);line-height:1.1;
  margin-bottom:16px;text-wrap:balance;
}
.page-hero-ai p.lead{
  max-width:30em;font-size:17.5px;line-height:1.7;
  margin:0;color:var(--ink-soft);
}
.page-hero-ai .hero-actions{
  justify-content:flex-start;gap:12px;margin:26px 0 0;
}
/* closes the block and points at the tool directly underneath */
.page-hero-ai .ai-hero-note{
  display:flex;align-items:center;gap:8px;
  max-width:none;margin:18px 0 0;
  font-size:13px;color:var(--ink-soft);
}
.page-hero-ai .ai-hero-note svg{
  width:15px;height:15px;flex:0 0 auto;color:var(--accent);
}

/* ---------- the slip: what the file costs ---------- */
.ai-terms{
  background:var(--bg);border:1px solid var(--line);border-radius:4px;
  padding:24px 26px 22px;box-shadow:var(--shadow);
  /* a printed slip, not a card: the top rule is the only decoration */
  position:relative;
}
.ai-terms::before{
  content:'';position:absolute;left:0;right:0;top:0;height:3px;
  background:var(--accent);border-radius:4px 4px 0 0;opacity:.85;
}
.ai-terms-label{
  font-family:var(--font-body);font-size:11px;font-weight:700;
  letter-spacing:.1em;text-transform:uppercase;color:var(--ink-soft);
  margin-bottom:12px;
}
.ai-terms-list{margin:0}
.ai-terms-list > div{
  display:grid;grid-template-columns:96px minmax(0,1fr);
  gap:14px;align-items:baseline;
  padding:12px 0;border-top:1px solid var(--line);
}
.ai-terms-list dt{
  font-family:var(--font-title);font-size:23px;font-weight:700;
  line-height:1.15;color:var(--ink);letter-spacing:-.01em;white-space:nowrap;
}
.ai-terms-list dd{
  margin:0;font-size:13.5px;line-height:1.5;color:var(--ink-soft);
}
.ai-terms-foot{
  margin:14px 0 0;padding-top:13px;border-top:1px solid var(--line);
  font-size:12px;line-height:1.55;color:var(--ink-soft);
}

/* ==========================================================================
   AI Photo Restoration — the tool on this page.
   Deliberately NOT the free-tool page's layout: that page is a dark workbench
   with a white two-column card. This one is a single paper plate on a warm
   ground with a segmented rail underneath. Same script, different object.
   Everything is scoped to #try so free-tool.css stays untouched.
   ========================================================================== */

.ai-tool{
  background:var(--bg);
  border-top:1px solid var(--line);
  border-bottom:1px solid var(--line);
  padding:74px 0 80px;
}
.ai-tool .wrap{max-width:1000px}
.ai-tool{--plate-w:748px}

/* ---------- head: title left, quota right ---------- */
/* Same column as the paper below, so the left edge runs straight down the block */
.ai-tool-head{max-width:var(--plate-w);margin:0 auto 34px}
.ai-head-row{
  display:flex;align-items:baseline;justify-content:space-between;
  gap:14px 26px;flex-wrap:wrap;margin-bottom:12px;
}
.ai-tool-head .eyebrow{margin:0}
.ai-tool-head h2{font-size:clamp(30px,3.4vw,42px);line-height:1.1;margin:0 0 12px}
.ai-tool-head p{margin:0;font-size:16px;line-height:1.65;color:var(--ink-soft);max-width:52ch}
.ai-quota{
  display:inline-flex;align-items:center;gap:8px;
  font-family:var(--font-body);font-size:11.5px;font-weight:700;
  letter-spacing:.1em;text-transform:uppercase;color:var(--ink-soft);
}
.ai-quota::before{
  content:'';width:6px;height:6px;border-radius:50%;
  background:var(--accent);flex:0 0 auto;
}
.ai-quota.spent::before{background:var(--ink-soft)}
.ai-tool-side small{display:block;margin-top:6px;font-size:11.5px;color:var(--ink-soft);opacity:.8}

/* ---------- the plate: white paper, dark window ---------- */
.ai-plate{margin:0;width:fit-content;max-width:100%;margin-inline:auto}
.ai-plate-window{
  position:relative;
  /* 4:3 keeps a square scan from floating in a letterbox. The rail below is
     pinned to the same width (--plate-w) so the paper and the controls line up. */
  height:540px;
  aspect-ratio:4/3;
  background:#14110E;
  border-radius:3px;
  overflow:hidden;
}
/* paper edge: the white frame is what makes it read as a print, not a player */
.ai-plate-window::after{
  content:'';position:absolute;inset:0;pointer-events:none;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.07);
  border-radius:3px;
}
.ai-plate{
  background:var(--white);
  border:1px solid var(--line);
  border-radius:6px;
  padding:14px 14px 0;
  box-shadow:0 1px 2px rgba(36,36,36,.05),0 10px 30px -18px rgba(36,36,36,.35);
}
.ai-plate-foot{
  display:flex;align-items:center;justify-content:space-between;gap:16px;
  min-height:44px;padding:0 4px;
  font-family:var(--font-body);font-size:12px;color:var(--ink-soft);
}
.ai-plate-foot .tool-file{
  display:none;margin:0;padding:0;border:0;background:none;
  font-size:12px;color:var(--ink-soft);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.ai-plate-foot .plate-hint{white-space:nowrap;opacity:.75;margin-left:auto}
#try.is-done .plate-hint{display:none}
/* the white margin of the print is the one place a saved copy can be offered
   without competing with the unlock button sitting on the photo itself */
#try .tool-save{
  display:inline-flex;align-items:center;gap:6px;margin-left:auto;
  padding:0 0 1px;background:none;border:0;border-bottom:1px solid transparent;
  font-family:var(--font-body);font-size:12px;font-weight:600;letter-spacing:.01em;
  color:var(--accent-dark);cursor:pointer;white-space:nowrap;
  transition:color .16s,border-color .16s;
}
#try .tool-save[hidden]{display:none}
#try .tool-save svg{width:13px;height:13px;flex:0 0 auto}
#try .tool-save:hover{color:var(--ink);border-bottom-color:var(--accent)}

/* ---------- drop layer: covers the whole window ---------- */
#try #toolDrop{
  position:absolute;inset:0;z-index:6;
  background:rgba(10,8,6,.16);
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;
  margin:0;padding:24px;border:0;border-radius:0;background:none;
  cursor:pointer;text-align:center;
  transition:background .18s;
}
/* The outline only appears on intent. Drawn permanently it cut across the
   photo and read as a broken frame rather than a drop target. */
#try #toolDrop::after{
  content:'';position:absolute;inset:12px;border:1px dashed rgba(255,255,255,.42);
  border-radius:2px;pointer-events:none;opacity:0;
  transition:opacity .18s,border-color .18s,inset .18s;
}
#try #toolDrop:hover::after,#try #toolDrop.dragover::after{opacity:1}
#try .ai-drop-pill{
  display:inline-flex;align-items:center;gap:9px;
  background:var(--white);color:var(--ink);
  border-radius:99px;padding:12px 22px;
  font-family:var(--font-body);font-size:14px;font-weight:600;
  box-shadow:0 2px 12px rgba(0,0,0,.35);
  transition:transform .18s,box-shadow .18s;
}
#try .ai-drop-pill svg{width:16px;height:16px}
#try #toolDrop small{
  font-family:var(--font-body);font-size:11.5px;letter-spacing:.04em;
  color:rgba(255,255,255,.78);
  text-shadow:0 1px 6px rgba(0,0,0,.85);
}
/* free-tool.css sizes svgs for the big dashed box; this one lives inside a pill */
#try #toolDrop svg{width:16px;height:16px;color:currentColor;margin:0;flex:0 0 auto}
#try #toolDrop:hover .ai-drop-pill{transform:translateY(-1px);box-shadow:0 4px 18px rgba(0,0,0,.45)}
#try #toolDrop:hover::after{border-color:rgba(255,255,255,.4)}
#try #toolDrop.dragover{background:rgba(167,123,85,.26)}
#try #toolDrop.dragover::after{inset:8px;border-color:var(--accent-light);border-style:solid}
#try.is-busy #toolDrop,
#try.is-done #toolDrop{opacity:0;pointer-events:none;visibility:hidden}

/* ---------- idle plate ---------- */
#try .tr-idle{
  position:absolute;inset:0;margin:0;border:0;border-radius:0;min-height:0;
  background:#14110E;
}
#try .tr-idle img{
  width:100%;height:100%;object-fit:contain;
  filter:grayscale(.4) sepia(.16) brightness(.74) contrast(.96);
}
#try .tr-idle::after{
  content:'';position:absolute;inset:0;
  background:radial-gradient(125% 95% at 50% 45%,transparent 42%,rgba(10,8,6,.42) 100%);
}

/* tool.js hides the idle plate the moment a run starts, which leaves the window
   black until the result lands. While it works, the photo stays on the plate and
   breathes instead of vanishing. */
#try.is-busy .tr-idle{display:block!important}
#try.is-busy .tr-idle img{filter:grayscale(.2) sepia(.08) brightness(.92);animation:aiWait 3.4s ease-in-out infinite}
@keyframes aiWait{0%,100%{opacity:.5}50%{opacity:.88}}

/* ---------- preview ---------- */
#try .tr-preview{
  position:absolute;inset:0;margin:0;border:0;border-radius:0;
  display:none;background:#14110E;overflow:hidden;
}
#try .tr-compare.compare{
  width:100%;height:100%;aspect-ratio:auto;
  border:0;border-radius:0;background:transparent;margin:0;
  --ar:1;
}
#try .tr-compare.compare::after{
  height:92px;
  background:linear-gradient(to top,rgba(12,10,8,.72),rgba(12,10,8,0));
}
#try .tr-compare .tag{
  top:14px;font-size:10px;letter-spacing:.08em;
  background:rgba(20,17,14,.72);color:#fff;border:0;backdrop-filter:blur(4px);
}
#try .tr-compare .tag-before{left:14px}
#try .tr-compare .tag-after{right:14px}
#try .tr-watermark span{
  font-size:clamp(26px,4vw,48px);color:rgba(255,255,255,.6);
  transform:rotate(-18deg);
}
#try .tr-unlock{
  bottom:18px;padding:11px 24px;font-size:13.5px;
  background:var(--white);color:var(--ink);
  box-shadow:0 6px 22px rgba(0,0,0,.4);
}
#try .tr-unlock:hover{background:var(--accent-light);color:var(--ink)}

/* ---------- rail: four segments + one line of status ---------- */
.ai-rail{margin-top:26px;max-width:var(--plate-w);margin-inline:auto}
#try #trStages{
  display:grid;grid-template-columns:repeat(4,1fr);gap:6px;
}
#try .tr-stage{
  position:relative;display:block;
  height:4px;padding:0;margin:0;border:0;border-radius:99px;
  background:#D3CBBD;overflow:hidden;
  /* the text stays in the DOM because tool.js copies it into the status line */
  font-size:0;line-height:0;color:transparent;
  transition:background .25s;
}
/* free-tool.css paints a status dot on the left of each row; not wanted here */
#try .tr-stage::before{content:none}
#try .tr-stage::after{
  content:'';position:absolute;inset:0;border-radius:99px;
  background:var(--accent);transform:scaleX(0);transform-origin:left;
  transition:transform .3s ease;
}
#try .tr-stage.active{background:#E4DCCE}
#try .tr-stage.active::after{transform:scaleX(1);animation:aiRail 1.4s ease-in-out infinite}
#try .tr-stage.done{background:var(--accent-dark)}
#try .tr-stage.done::after{transform:scaleX(1);background:var(--accent-dark)}
/* still running: finished segments stay a shade lighter, so "three dark bars and
   a 22% readout" cannot be mistaken for a completed job */
#try.is-busy .tr-stage.done{background:var(--accent)}
#try.is-busy .tr-stage:last-child{background:#E4DCCE}
#try.is-busy .tr-stage:last-child::after{transform:scaleX(1);animation:aiRail 1.3s ease-in-out infinite}
@keyframes aiRail{0%,100%{opacity:1}50%{opacity:.45}}

.ai-meta{
  display:flex;align-items:baseline;justify-content:space-between;gap:18px;
  margin-top:14px;font-family:var(--font-body);
}
.ai-meta .ai-status{
  font-size:13.5px;color:var(--ink);font-weight:500;
  min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.ai-meta .ai-numbers{
  display:flex;align-items:baseline;gap:12px;white-space:nowrap;
  font-size:11.5px;letter-spacing:.06em;text-transform:uppercase;color:var(--ink-soft);
}
.ai-meta .ai-numbers b{font-size:12.5px;font-weight:700;color:var(--ink);letter-spacing:0}
/* the thin percentage track is redundant next to the segments */
#try .tr-progress{display:none}

.ai-actions{
  display:flex;align-items:center;justify-content:space-between;gap:20px;
  margin-top:22px;padding-top:20px;border-top:1px solid var(--line);
  flex-wrap:wrap;
}
.ai-actions .tool-fine{
  margin:0;text-align:left;max-width:52ch;
  font-size:12.5px;line-height:1.6;color:var(--ink-soft);
}
#try #toolRun{
  width:auto;background:none;border:0;padding:0;
  font-family:var(--font-body);font-size:12.5px;font-weight:700;
  letter-spacing:.04em;color:var(--accent-dark);
  text-decoration:underline;text-underline-offset:3px;text-decoration-thickness:1px;
  cursor:pointer;
}
#try #toolRun:hover{color:var(--ink)}
#try #toolRun[hidden]{display:none}

/* ---------- responsive ---------- */
@media(max-width:820px){
  .page-hero-ai{padding:44px 0 46px}
  .ai-banner{grid-template-columns:1fr;gap:28px}
  .page-hero-ai h1{font-size:clamp(33px,7.4vw,42px);margin-bottom:14px}
  .page-hero-ai p.lead{font-size:16.5px;line-height:1.66;max-width:none}
  .page-hero-ai .hero-actions{margin-top:22px}
  /* the slip is 350px tall stacked, and on a phone that pushes the tool far
     down the page. Below the split it becomes a band: three facts side by side. */
  .ai-terms{max-width:none;padding:16px 18px 15px}
  .ai-terms-label{display:none}
  .ai-terms-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}
  .ai-terms-list > div{
    display:block;padding:0 14px;border-top:0;
    border-left:1px solid var(--line);
  }
  .ai-terms-list > div:first-child{border-left:0;padding-left:0}
  .ai-terms-list > div:last-child{padding-right:0}
  .ai-terms-list dt{font-size:21px;margin-bottom:5px}
  .ai-terms-list dd{font-size:12px;line-height:1.42}
  .ai-terms-foot{
    margin-top:14px;padding-top:12px;font-size:11.5px;line-height:1.5;
  }
  .ai-tool{padding:52px 0 58px}
  .ai-tool-head{margin-bottom:26px}
  .ai-tool{--plate-w:100%}
  .ai-plate{padding:10px 10px 0;width:100%}
  .ai-plate-window{height:auto;aspect-ratio:4/3}
  #try #toolDrop::after{inset:8px}
  #try #toolDrop small{display:none}
  .ai-plate-foot{min-height:40px}
  /* a 17px link is not a tap target; grow the box, keep the type size */
  #try .tool-save{padding:10px 0;margin-right:-4px}
  .ai-plate-foot .plate-hint{font-size:11px}
  .ai-meta{flex-wrap:wrap;gap:8px}
  .ai-actions{flex-direction:column;align-items:flex-start;gap:14px}
}
@media(max-width:480px){
  .page-hero-ai{padding:38px 0 40px}
  .page-hero-ai .crumb{margin-bottom:12px}
  .page-hero-ai p.lead{font-size:15.5px}
  .page-hero-ai .hero-actions{flex-direction:column;align-items:stretch;gap:10px}
  .page-hero-ai .hero-actions .btn{width:100%;justify-content:center}
  .page-hero-ai .ai-hero-note{font-size:12px;align-items:flex-start;gap:6px}
  .ai-banner{gap:24px}
  .ai-terms{padding:14px 15px 13px}
  .ai-terms-list > div{padding:0 10px}
  .ai-terms-list dt{font-size:19px}
  .ai-terms-list dd{font-size:11px}
  #try .ai-drop-pill{padding:11px 18px;font-size:13px}
  #try .tr-watermark span{font-size:26px}
  #try .tr-unlock{bottom:12px;padding:9px 18px;font-size:12.5px}
  .ai-tool-head h2{font-size:26px}
}
