/* Estbuild case study: styles for its cinematic and interactive pieces
   (estbuild.js). Page-specific because nothing else uses them. Tokens only.
   The accent marks what the AI found; ink marks what a person added. */

/* ---------------- shared: stage, plan, estimate ---------------- */
.eb-stage{
  display:grid;
  grid-template-columns:minmax(0, 1fr) minmax(0, 1.1fr);
  gap:var(--space-6);
  padding:var(--space-6);
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius);
}
.eb-kicker{
  margin:0 0 var(--space-3);
  font:400 var(--text-label)/1.2 var(--font-text);
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--ink-2);
}
.eb-plan svg{display:block;width:100%;height:auto;overflow:visible}

/* plan drawing */
.eb-wall{fill:none;stroke:var(--ink);stroke-width:4;stroke-linecap:square}
.eb-outer{stroke-width:5}
.eb-door{fill:none;stroke:var(--ink);stroke-width:1.5}
.eb-fixture{fill:none;stroke:var(--ink);stroke-width:1.5}
.eb-zone{fill:transparent}
.eb-hatch{stroke:var(--line);stroke-width:1}
.eb-tag{font:500 12px/1 var(--font-text);fill:var(--ink-2)}
.eb-hit{fill:transparent;stroke:transparent;stroke-width:22}
.eb-scan{stroke:var(--accent);stroke-width:2;opacity:0;filter:drop-shadow(0 0 6px var(--accent))}

/* found by the AI: accent */
.eb-part .eb-wall,.eb-part .eb-door,.eb-part .eb-fixture,.eb-part .eb-zone{transition:stroke .4s var(--ease), fill .4s var(--ease)}
.eb-part.is-found .eb-wall,
.eb-part.is-found .eb-door,
.eb-part.is-found .eb-fixture{stroke:var(--accent)}
.eb-part.is-found .eb-zone{fill:color-mix(in srgb, var(--accent) 9%, transparent)}
.eb-part.is-found .eb-hatch{stroke:color-mix(in srgb, var(--accent) 35%, transparent)}
/* added by a person: ink */
.eb-part.is-mine .eb-wall{stroke:var(--ink)}

/* estimate table */
.eb-table{font:400 var(--text-small)/1.3 var(--font-text);font-variant-numeric:tabular-nums}
.eb-row{
  display:grid;
  grid-template-columns:minmax(0, 1fr) 76px 72px;
  gap:var(--space-3);
  align-items:center;
  min-height:40px;
  padding:0 var(--space-2);
  border-bottom:1px solid var(--line);
}
.eb-row > :nth-child(n+2){text-align:right}
.eb-row--head{
  min-height:32px;
  font-size:var(--text-label);
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--ink-2);
  border-bottom-color:var(--ink-3);
}
.eb-row--total{font-weight:500;border-bottom:0;border-top:1px solid var(--ink-3);margin-top:-1px}
.eb-state{
  margin-left:var(--space-2);
  padding:2px 6px;
  font:400 10.5px/1 var(--font-text);
  font-style:normal;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--accent);
  border:1px dashed currentColor;
  border-radius:4px;
  vertical-align:1px;
}
.eb-state--mine{color:var(--on-ink);background:var(--ink);border:1px solid var(--ink)}

/* captions, chips, buttons */
.eb-cap{display:flex;align-items:center;justify-content:space-between;gap:var(--space-4)}
.eb-chip,
.eb-btn{
  position:relative;
  display:inline-flex;
  align-items:center;
  min-height:36px;
  padding:0 var(--space-3);
  font:400 var(--text-small)/1 var(--font-text);
  color:var(--ink);
  background:color-mix(in srgb, var(--surface) 60%, transparent);
  border:1px solid var(--line);
  border-radius:var(--radius-nested);
  cursor:pointer;
  white-space:nowrap;
  transition:background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.eb-chip::after,.eb-btn::after{content:"";position:absolute;inset:-4px 0}
.eb-chip[hidden],.eb-btn[hidden]{display:none}
.eb-chip:hover,.eb-btn:hover{background:var(--sunk)}
.eb-btn--ink{color:var(--on-ink);background:var(--ink);border-color:var(--ink)}
.eb-btn--ink:hover{background:var(--ink-2);border-color:var(--ink-2)}

/* ---------------- 1. opening ---------------- */
.eb-intro{margin-top:0}
.eb-intro .eb-row{opacity:0;transform:translateY(6px);transition:opacity .45s var(--ease), transform .45s var(--ease)}
.eb-intro .eb-row--head,
.eb-intro .eb-row--total,
.eb-intro .eb-row.is-on{opacity:1;transform:none}
/* the plan draws itself */
.eb-intro .eb-wall,.eb-intro .eb-door,.eb-intro .eb-fixture{stroke-dasharray:1;stroke-dashoffset:1;transition:stroke-dashoffset 1.4s cubic-bezier(.65,0,.35,1), stroke .4s var(--ease)}
.eb-intro.is-drawn .eb-wall,.eb-intro.is-drawn .eb-door,.eb-intro.is-drawn .eb-fixture{stroke-dashoffset:0}
.eb-intro .eb-floor{opacity:0;transition:opacity .8s var(--ease) .6s}
.eb-intro.is-drawn .eb-floor{opacity:1}
.eb-intro .eb-tag{opacity:0;transition:opacity .6s var(--ease) 1s}
.eb-intro.is-drawn .eb-tag{opacity:1}

/* ---------------- 2. try it ---------------- */
.eb-try__top{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:var(--space-2) var(--space-4);margin-bottom:var(--space-3)}
.eb-try__top .eb-kicker{margin:0;color:var(--ink)}
.case-body .eb-steps{display:flex;flex-wrap:wrap;gap:var(--space-2) var(--space-4);margin:0;padding:0;list-style:none;font:400 var(--text-label)/1.2 var(--font-text);letter-spacing:.08em;text-transform:uppercase;color:var(--ink-2)}
.case-body .eb-steps li{margin:0}
.eb-steps .is-current{color:var(--ink);font-weight:500}
.eb-steps .is-done::after{content:" ✓"}
.eb-try .eb-part{cursor:pointer;outline:none}
.eb-try .eb-part:hover .eb-wall,.eb-try .eb-part:hover .eb-door,.eb-try .eb-part:hover .eb-fixture{stroke-width:6}
.eb-try .eb-part:hover .eb-door,.eb-try .eb-part:hover .eb-fixture{stroke-width:3}
.eb-try .eb-part:focus-visible .eb-hit{stroke:color-mix(in srgb, var(--accent) 18%, transparent)}
.eb-try .eb-part.is-flag .eb-wall{stroke:var(--ink);stroke-dasharray:10 7;animation:eb-march 1s linear infinite}
@keyframes eb-march{to{stroke-dashoffset:-17}}
.eb-actions{display:flex;gap:var(--space-2);margin-top:var(--space-4)}
.eb-panel{margin-top:var(--space-4);padding:var(--space-4);background:var(--sunk);border-radius:var(--radius-nested)}
.eb-panel .eb-kicker{margin-bottom:var(--space-2)}
.eb-row--suggest{font:400 var(--text-small)/1.3 var(--font-text);font-variant-numeric:tabular-nums;border:1px dashed var(--ink-3);border-radius:4px;background:var(--surface)}
.eb-note{margin:var(--space-2) 0 var(--space-3);font:400 var(--text-label)/1.4 var(--font-text);color:var(--ink-2)}
.eb-row.is-mine{background:color-mix(in srgb, var(--ink) 5%, transparent)}
.eb-try .eb-row{transition:background-color .6s var(--ease), opacity .45s var(--ease), transform .45s var(--ease)}
.eb-try .eb-row.is-mine:not(.is-on){opacity:0;transform:translateY(6px)}
.eb-row.is-flash{animation:eb-flash 1.2s var(--ease)}
@keyframes eb-flash{0%,40%{background:color-mix(in srgb, var(--accent) 14%, transparent)}100%{background:transparent}}
.eb-say{
  min-height:3em;
  margin:var(--space-4) 0 0;
  max-width:62ch;
  font:400 var(--text-body, 16px)/1.5 var(--font-text);
  color:var(--ink);
}

/* ---------------- phones ---------------- */
@media (max-width:760px){
  .eb-stage{grid-template-columns:1fr;gap:var(--space-5);padding:var(--space-4)}
  .eb-row{grid-template-columns:minmax(0, 1fr) 64px 64px;gap:var(--space-2)}
  .eb-cap{flex-direction:column;align-items:flex-start}
  .eb-try__top{flex-direction:column;align-items:flex-start}
  .case-body .eb-steps{gap:var(--space-1) var(--space-3)}
}
@media (prefers-reduced-motion:reduce){
  .eb-try .eb-part.is-flag .eb-wall{animation:none}
  .eb-row.is-flash{animation:none;background:color-mix(in srgb, var(--accent) 10%, transparent)}
}
