/* ============================================================================
   Website Builder — THE PAGE ASSEMBLES ITSELF.  Loaded by website-builder.html only.

   This page's signature and nobody else's (MOTION-CHARTER §3):
   A browser frame is held on screen. Nine wireframe blocks fly in from
   off-screen — from above, below, the corners — turn square, and lock into a
   finished layout. Once the last one lands the wireframe fills in with the
   real page, and a plain-English edit writes itself in underneath.
   Everything is a pure function of how far the held section has scrolled.

   Without JS (or under reduced motion) the page sits fully assembled and
   rendered, and the edit line is already written.
   ========================================================================== */

/* --------------------------------------------------------- the readout ---- */
.fx-read{
  display:flex; flex-wrap:wrap; gap:8px 22px; margin:22px 0 0; padding:10px 14px;
  width:max-content; max-width:100%;
  border:1px solid rgba(var(--accent-rgb),.16); border-radius:8px;
  background:rgba(4,18,28,.35);
  font:600 10.5px/1.6 var(--mono); letter-spacing:.1em; text-transform:uppercase;
  color:rgba(191,238,255,.62);
}
.fx-read b{ color:var(--accent); font-weight:700; font-variant-numeric:tabular-nums; }
.fx-read i{ font-style:normal; opacity:.55; }
.fx-read span{ white-space:nowrap; }

/* ------------------------------------------------------------- the hold --- */
.wb{ position:relative; height:240vh; margin-top:24px; }
.wb-stick{
  position:sticky; top:70px; height:calc(100vh - 70px);
  display:grid; grid-template-columns:minmax(0,5fr) minmax(0,7fr); gap:48px; align-items:center;
}
.wb-steps{ list-style:none; margin:26px 0 0; padding:0; }
.wb-steps li{ display:grid; grid-template-columns:auto 1fr; gap:0 18px; padding:0 0 20px; }
.wb-steps li:last-child{ padding-bottom:0; }
.wb-steps .n{
  grid-row:1/3; width:44px; height:44px; border-radius:50%; display:grid; place-items:center;
  font:800 16px/1 var(--font-display);
  background:rgba(var(--accent-rgb),.10); border:1px solid rgba(var(--accent-rgb),.3); color:var(--accent);
  transition: background .35s var(--ease-out), color .35s var(--ease-out), box-shadow .35s var(--ease-out);
}
.wb-steps h3{ font-size:1.15rem; margin-bottom:5px; }
.wb-steps p{ margin:0; font-size:.98rem; line-height:1.5; }
.wb-aside{ margin:20px 0 0; padding-top:14px; border-top:1px solid rgba(var(--accent-rgb),.16); font-size:14px; color:#7fa2b8; max-width:44ch; }
.fx-on .wb-steps li{ opacity:.34; transition:opacity .4s var(--ease-out); }
.fx-on .wb-steps li.on{ opacity:1; }
.fx-on .wb-steps li.on .n{ background:var(--accent); color:var(--dark); box-shadow:0 0 0 4px rgba(var(--accent-rgb),.14); }

/* ------------------------------------------------------------ the frame --- */
.wb-stage{ perspective:1600px; }
.wb-frame{
  container-type:inline-size;
  position:relative; width:100%; max-height:calc(100vh - 70px - 140px);
  aspect-ratio:16/11; border-radius:14px; overflow:hidden;
  border:1px solid rgba(var(--accent-rgb),.22);
  background:linear-gradient(165deg, rgba(24,86,120,.32), rgba(7,27,41,.92));
  box-shadow:0 40px 80px -36px rgba(0,0,0,.85), 0 0 0 1px rgba(255,255,255,.03) inset;
  display:grid; grid-template-rows:auto 1fr;
}
/* fine scanlines: it is an instrument, not a screenshot */
.wb-frame::after{
  content:""; position:absolute; inset:0; pointer-events:none; z-index:6;
  background:repeating-linear-gradient(0deg, rgba(191,238,255,.035) 0 1px, transparent 1px 3px);
}
.wb-bar{
  display:flex; align-items:center; gap:6px; padding:9px 12px;
  border-bottom:1px solid rgba(var(--accent-rgb),.14); background:rgba(4,18,28,.5);
}
.wb-bar i{ width:9px; height:9px; border-radius:50%; background:rgba(var(--accent-rgb),.28); }
.wb-bar span{ margin-left:10px; font:500 10px/1 var(--mono); letter-spacing:.1em; text-transform:uppercase; color:rgba(191,238,255,.5); }
.wb-page{ position:relative; overflow:hidden; --real:1; }

/* a block: the wire and the real page stacked, cross-faded at the end */
.wb-block{
  position:absolute; will-change:transform, opacity; transform-style:preserve-3d;
}
.wb-block .wire, .wb-block .real{ position:absolute; inset:0; border-radius:4%; }
.wb-block .wire{
  border:1px dashed rgba(var(--accent-rgb),.55); background:rgba(var(--accent-rgb),.05);
  opacity:calc(1 - var(--real));
  display:flex; flex-direction:column; gap:6%; padding:7% 8%;
}
.wb-block .wire i{ display:block; height:7%; min-height:3px; border-radius:2px; background:rgba(var(--accent-rgb),.35); }
.wb-block .wire i.w1{ width:70%; } .wb-block .wire i.w2{ width:45%; } .wb-block .wire i.w3{ width:88%; }
.wb-block .wire em{
  position:absolute; top:3px; left:5px; font:600 8px/1 var(--mono); letter-spacing:.12em; text-transform:uppercase;
  color:rgba(191,238,255,.55); font-style:normal;
}
.wb-block .real{ opacity:var(--real); overflow:hidden; }

/* the rendered page — Copper Kettle Roofing, an invented demo business */
.wb-nav  { left:0;    top:0;    width:100%; height:9%;  }
.wb-h1   { left:5%;   top:14%;  width:44%;  height:15%; }
.wb-p    { left:5%;   top:31%;  width:40%;  height:11%; }
.wb-cta  { left:5%;   top:45%;  width:19%;  height:7%;  }
.wb-img  { left:54%;  top:13%;  width:41%;  height:40%; }
.wb-s1   { left:5%;   top:60%;  width:27%;  height:22%; }
.wb-s2   { left:36.5%;top:60%;  width:27%;  height:22%; }
.wb-s3   { left:68%;  top:60%;  width:27%;  height:22%; }
.wb-ftr  { left:0;    top:88%;  width:100%; height:12%; }

.real{ font-family:var(--font-body); color:#eaf4fa; }
.wb-nav .real{ display:flex; align-items:center; gap:3cqw; padding:0 4cqw; background:rgba(4,18,28,.55); border-bottom:1px solid rgba(var(--accent-rgb),.14); border-radius:0; }
.wb-nav .real b{ font:800 2.1cqw/1 var(--font-display); letter-spacing:-.02em; color:#fff; }
.wb-nav .real b i{ font-style:normal; color:var(--accent); }
.wb-nav .real span{ margin-left:auto; display:flex; gap:2.2cqw; font-size:1.5cqw; color:#a8c4d5; }
.wb-nav .real span u{ text-decoration:none; padding:.6cqw 1.4cqw; border-radius:.6cqw; background:var(--accent); color:var(--dark); font-weight:700; }
.wb-h1 .real{ font:800 4.2cqw/1.05 var(--font-display); letter-spacing:-.025em; color:#fff; display:flex; align-items:center; }
.wb-p .real{ font-size:1.7cqw; line-height:1.45; color:#b9d3e2; display:flex; align-items:center; }
.wb-cta .real{ display:grid; place-items:center; font:700 1.6cqw/1 var(--font-body); color:var(--dark); background:linear-gradient(120deg, var(--accent), var(--accent-mid)); border-radius:.8cqw; box-shadow:0 1cqw 3cqw -1.2cqw rgba(var(--accent-rgb),.6); }
.wb-img .real{ border-radius:1.2cqw; background:#0d2d42; }
.wb-img .real img{ width:100%; height:100%; object-fit:cover; display:block; }
.wb-s1 .real, .wb-s2 .real, .wb-s3 .real{
  border-radius:1.2cqw; padding:2.2cqw 2.4cqw; border:1px solid rgba(var(--accent-rgb),.16);
  background:linear-gradient(165deg, rgba(255,255,255,.07), rgba(255,255,255,.025));
  display:flex; flex-direction:column; gap:.8cqw;
}
.wb-s1 .real b, .wb-s2 .real b, .wb-s3 .real b{ font:700 2cqw/1.2 var(--font-display); color:#fff; }
.wb-s1 .real span, .wb-s2 .real span, .wb-s3 .real span{ font-size:1.45cqw; line-height:1.4; color:#a8c4d5; }
.wb-s1 .real i, .wb-s2 .real i, .wb-s3 .real i{ width:2.6cqw; height:2.6cqw; border-radius:50%; background:rgba(var(--accent-rgb),.18); border:1px solid rgba(var(--accent-rgb),.4); margin-bottom:.6cqw; }
.wb-ftr .real{ display:flex; align-items:center; justify-content:space-between; padding:0 4cqw; font-size:1.4cqw; color:#7f9db0; background:rgba(4,18,28,.65); border-top:1px solid rgba(var(--accent-rgb),.12); border-radius:0; }

/* locked: a tick in the corner, and the pointer can inspect it */
.wb-block::before{
  content:""; position:absolute; top:-3px; right:-3px; width:10px; height:10px; z-index:4;
  border-top:1px solid var(--accent); border-right:1px solid var(--accent);
  opacity:0; transition:opacity .25s var(--ease-out);
}
.wb-block.locked::before{ opacity:.9; }
.wb-block.locked:hover .wire{ opacity:1; border-style:solid; }
.wb-block.locked::after{
  content:attr(data-label); position:absolute; left:0; bottom:calc(100% + 4px); z-index:5;
  font:600 9px/1 var(--mono); letter-spacing:.12em; text-transform:uppercase; white-space:nowrap;
  color:var(--accent); background:rgba(4,18,28,.92); border:1px solid rgba(var(--accent-rgb),.3);
  padding:5px 7px; border-radius:5px; opacity:0; transform:translateY(3px);
  transition:opacity .2s, transform .2s var(--ease-out); pointer-events:none;
}
.wb-block.locked:hover::after{ opacity:1; transform:none; }
.wb-nav.locked::after, .wb-h1.locked::after, .wb-img.locked::after{ bottom:auto; top:calc(100% + 4px); }

/* the edit, typed in plain English, once the page exists */
.wb-prompt{
  position:relative; z-index:7; margin:14px auto 0;
  width:min(92%, 560px); display:flex; align-items:center; gap:10px; padding:10px 14px;
  border-radius:100px; border:1px solid rgba(var(--accent-rgb),.4);
  background:rgba(4,18,28,.86); backdrop-filter:blur(8px);
  box-shadow:0 20px 40px -20px rgba(0,0,0,.8), 0 0 30px -10px rgba(var(--accent-rgb),.5);
  opacity:var(--po,1);
}
.wb-prompt-k{ font:700 9.5px/1 var(--mono); letter-spacing:.14em; text-transform:uppercase; color:var(--accent); flex:none; }
.wb-prompt-t{ position:relative; font-size:14px; color:#eaf4fa; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; clip-path:inset(0 var(--pc,0%) 0 0); }
.wb-prompt-c{ width:2px; height:1.1em; background:var(--accent); flex:none; opacity:var(--pk,0); transform:translateX(var(--px,0px)); position:absolute; left:0; }
.wb-prompt-w{ position:relative; display:flex; align-items:center; min-width:0; flex:1; }

/* ------------------------------------------------- armed (JS on) states --- */
.fx-on .wb-block{ opacity:0; }
.fx-on .wb-prompt{ --po:0; }

/* ------------------------------------------------------------ responsive -- */
@media (max-width:900px){
  .wb{ height:auto; }
  .wb-stick{ position:static; height:auto; grid-template-columns:1fr; gap:26px; }
  .wb-stage{ order:-1; }
  .wb-frame{ max-height:none; aspect-ratio:16/12; }
  .wb-frame::after{ display:none; }
  .wb-prompt{ padding:8px 12px; }
}
@media (prefers-reduced-motion: reduce){
  .wb-block{ opacity:1 !important; transform:none !important; --real:1 !important; }
  .wb-prompt{ --po:1 !important; }
  .wb-prompt-t{ clip-path:none !important; }
  .wb-steps li{ opacity:1 !important; }
}
