/* ==========================================================================
   The demo section.

   Both demos are driven by a real button, so the interaction is obvious
   without an instruction. Each has three visible states: the file before, the
   moment it is restored, and a reset so it can be played again.

   Sections also arrive with something you can see: the kicker fades up and
   draws its rule, the heading rises. Everything stops for reduced motion.
   ========================================================================== */

.demo-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}
@media (max-width:900px){.demo-grid{grid-template-columns:1fr}}

.demo-card{
  margin:0;padding:22px;
  border:1px solid var(--line);
  border-radius:calc(var(--radius) + 4px);
  background:
    radial-gradient(130% 100% at 6% -28%, rgba(247,146,87,.10), transparent 62%),
    var(--surface);
  box-shadow:0 1px 2px rgba(28,24,50,.05);
}
.demo-card figcaption{display:flex;flex-direction:column;gap:3px;margin-top:16px}
.demo-card figcaption b{font-size:13.5px;font-weight:600;color:var(--text)}
.demo-card figcaption span{font-size:12.5px;color:var(--muted);line-height:1.5}

/* ---------- the cream surface both demos share ---------- */
.demo-panel{
  background:#FCF9F3;color:#1C1832;
  border-radius:14px;padding:14px;
  border:1px solid rgba(28,24,50,.09);
  box-shadow:0 18px 40px -26px rgba(20,12,32,.55);
}
.dp-head{display:flex;align-items:center;gap:8px}
.dp-head img{width:20px;height:20px;border-radius:5px;display:block}
.dp-ico{width:14px;height:14px;stroke-width:1.9;color:rgba(28,24,50,.55);flex:0 0 14px}
.dp-name{font-size:13px;font-weight:700;letter-spacing:-.01em}
.dp-head-quiet .dp-name{font-size:11.5px}
.dp-pill{
  margin-left:auto;display:inline-flex;align-items:center;gap:4px;
  font-size:9.5px;font-weight:600;color:rgba(28,24,50,.88);
  background:rgba(127,227,192,.30);border:1px solid rgba(127,227,192,.55);
  padding:2px 7px;border-radius:999px;
}
.dp-pill i{width:5px;height:5px;border-radius:50%;background:#2E8F73;display:block}
.dp-tag{
  margin-left:auto;font-size:8px;font-weight:700;letter-spacing:.12em;
  color:rgba(28,24,50,.55);
}
.dp-tag-ok{color:#1F6E58}
.dp-label{
  font-size:9px;font-weight:600;letter-spacing:.14em;color:rgba(28,24,50,.62);
  margin:13px 0 7px;
}
.dp-row{
  position:relative;
  display:flex;align-items:center;gap:10px;
  padding:10px;border-radius:11px;
  background:#FFFFFF;border:1px solid rgba(28,24,50,.09);
  transition:border-color .35s, background .35s, box-shadow .35s, opacity .45s, transform .45s;
}
.dp-row-tight{padding:9px 10px}
.dp-glyph{
  width:30px;height:30px;flex:0 0 30px;border-radius:8px;
  display:grid;place-items:center;
  background:rgba(247,146,87,.14);color:#C85A1E;
}
.dp-glyph svg{width:15px;height:15px;stroke-width:1.9}
.dp-main{min-width:0;display:flex;flex-direction:column;gap:1px}
.dp-main b{font-size:12.5px;font-weight:600;letter-spacing:-.01em}
.dp-detail{font-size:10.5px;color:rgba(28,24,50,.62);font-style:normal;transition:color .35s}

/* the button is the whole instruction */
.dp-actions{margin-left:auto;display:flex;align-items:center;gap:7px}
.dp-btn{
  flex:0 0 auto;
  font:600 10.5px/1 -apple-system,system-ui,sans-serif;
  color:#3A1C10;background:rgba(247,146,87,.26);
  border:1px solid rgba(247,146,87,.55);border-radius:999px;
  padding:6px 12px;cursor:pointer;
  transition:background .2s, transform .2s, opacity .25s;
}
.dp-btn:hover{background:rgba(247,146,87,.40);transform:translateY(-1px)}
.dp-btn:active{transform:translateY(0) scale(.98)}
.dp-done{
  font-size:10.5px;font-weight:600;color:#1F6E58;
  background:rgba(127,227,192,.32);border:1px solid rgba(127,227,192,.7);
  border-radius:999px;padding:5px 11px;
  opacity:0;transform:scale(.9);
  transition:opacity .3s, transform .3s;
  pointer-events:none;white-space:nowrap;
}
.dp-status{
  font-size:10.5px;color:rgba(28,24,50,.62);line-height:1.5;
  margin:11px 0 0;min-height:16px;
}

/* undone */
.demo-panel[data-state="undone"] .dp-row{
  border-color:rgba(127,227,192,.85);
  background:rgba(127,227,192,.10);
  box-shadow:0 10px 24px -18px rgba(46,143,115,.9);
}
.demo-panel[data-state="undone"] .dp-detail{color:#1F6E58;font-weight:600}
.demo-panel[data-state="undone"] .dp-btn{
  background:transparent;border-color:rgba(28,24,50,.22);color:rgba(28,24,50,.62);
}
.demo-panel[data-state="undone"] .dp-done{opacity:1;transform:scale(1)}

/* ---------- the Trash ---------- */
.demo-panel-trash{display:flex;flex-direction:column;gap:9px}
.tp-block{
  padding:11px 12px;border-radius:11px;
  background:rgba(255,255,255,.62);
  border:1px solid rgba(28,24,50,.08);
  transition:background .4s, border-color .4s, opacity .4s;
}
.tp-block-after{background:transparent;border-color:transparent;padding:2px 2px 0}
.dp-cta{
  align-self:stretch;
  font:600 11px/1 -apple-system,system-ui,sans-serif;
  color:#FFFFFF;background:#A84A16;
  border:1px solid #8F3D12;border-radius:9px;
  padding:10px;cursor:pointer;
  transition:background .2s, transform .2s, opacity .25s;
}
.dp-cta:hover{background:#8F3D12;transform:translateY(-1px)}
.dp-cta:active{transform:translateY(0)}

/* deleted: the Trash row is the subject, the folder row is waiting */
.demo-panel[data-state="deleted"] .dp-arrive{opacity:.28;filter:grayscale(1)}
.demo-panel[data-state="deleted"] .dp-arrive .dp-detail{color:rgba(28,24,50,.45)}

/* restored: the Trash row leaves, the folder row lands */
.demo-panel[data-state="restored"] .tp-block:first-child .dp-row{
  opacity:.38;filter:grayscale(1);transform:scale(.985);
  text-decoration:line-through;text-decoration-thickness:1px;
}
.demo-panel[data-state="restored"] .tp-block:first-child .dp-tag{color:rgba(28,24,50,.3)}
.demo-panel[data-state="restored"] .dp-arrive{
  opacity:1;filter:none;
  border-color:rgba(127,227,192,.85);
  background:rgba(127,227,192,.12);
  animation:landing .8s cubic-bezier(.2,.7,.3,1);
}
.demo-panel[data-state="restored"] .dp-arrive .dp-detail{color:#1F6E58;font-weight:600}
.demo-panel[data-state="restored"] #trashStatus{color:#1F6E58;font-weight:600}
@keyframes landing{
  0%   {transform:scale(.95);box-shadow:0 0 0 rgba(46,143,115,0)}
  55%  {transform:scale(1.02);box-shadow:0 0 0 6px rgba(127,227,192,.22)}
  100% {transform:scale(1);box-shadow:0 0 0 rgba(46,143,115,0)}
}

/* ---------- sections arrive with something you can see ---------- */
.section-head .kicker{
  display:inline-block;position:relative;
  transition:opacity .7s ease, transform .7s cubic-bezier(.2,.7,.3,1);
}
/* dimmed start only when scripts run, so a failed script never leaves
   headings looking washed out */
.js .section-head .kicker{opacity:.42;transform:translateY(7px)}
.section-head .kicker::after{
  content:"";position:absolute;left:0;right:0;bottom:-7px;height:2px;
  background:currentColor;border-radius:2px;
  transform:scaleX(1);transform-origin:left;
  transition:transform .9s cubic-bezier(.2,.7,.3,1);
}
.js .section-head .kicker::after{transform:scaleX(0)}
.section-head h2{transition:transform .8s cubic-bezier(.2,.7,.3,1)}
.js .section-head h2{transform:translateY(9px)}
section.lit .section-head .kicker{opacity:1;transform:none}
section.lit .section-head .kicker::after{transform:scaleX(1)}
section.lit .section-head h2{transform:none}

@media (prefers-reduced-motion:reduce){
  .dp-row,.dp-btn,.dp-done,.dp-detail,.dp-arrive,.tp-block{transition:none}
  .section-head .kicker,.section-head h2{transition:none;opacity:1;transform:none}
  .section-head .kicker::after{transition:none;transform:scaleX(1)}
  .demo-panel[data-state="restored"] .dp-arrive{animation:none}
}
