/* =========================================================
   [Nombre] app mock, content cards, rewards, stream and demos.
   Original content-object language: "petal" cards (three round corners,
   one tight), day-ticks, the "bloom" reaction glyph, own scenes.
   No platform UI, avatars, handles or logos.
   JS drives these custom properties on [data-morph]:
   --p --canvas --chrome --panel --cap-a --cap-b, and --t on each card.
   ========================================================= */

@property --t { syntax: "<number>"; inherits: true; initial-value: 0; }

/* ---------- Pinned morph section ---------- */
.morph { position: relative; height: 440vh; height: 440svh;  }
.morph-stage {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; will-change: transform;
  display: flex; align-items: flex-end; justify-content: center;
  padding: clamp(150px, 22svh, 190px) var(--gutter) clamp(12px, 3svh, 28px);
}
.canvas-bg { /* free canvas: dotted grid; opacity written by JS */
  position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgb(13 11 20 / .16) 1px, transparent 1.3px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 55%, #000 35%, transparent 82%);
  mask-image: radial-gradient(ellipse at 50% 55%, #000 35%, transparent 82%);
  will-change: opacity;
}
.morph-caps { position: absolute; top: clamp(76px, 11svh, 100px); left: 0; right: 0; text-align: center; padding-inline: var(--gutter); pointer-events: none; }
.cap {
  position: absolute; left: 0; right: 0; margin: 0 auto; max-width: 30ch; text-wrap: balance;
  font: 600 clamp(1.375rem, 3vw, 2.25rem)/1.08 var(--font-display); letter-spacing: var(--tracking-display); color: var(--ink);
}
.cap-a { opacity: 1; will-change: opacity, transform; }
.cap-b { opacity: 0; will-change: opacity, transform; }
.note {
  position: absolute; z-index: 1; padding: .5rem .85rem; border-radius: var(--radius-petal-sm); background: var(--lime); color: var(--color-on-highlight);
  font: 500 .8125rem/1.25 var(--font-mono); box-shadow: var(--shadow-soft); pointer-events: none; max-width: 22ch;
}
.notes { position: absolute; inset: 0; pointer-events: none; will-change: opacity; }
.note.n1 { left: 3%; top: 21%; transform: rotate(-5deg); z-index: 4; }
.note.n2 { right: 4%; top: 54%; transform: rotate(4deg); background: var(--electric-100); }
.note.n3 { left: 40%; bottom: 5%; transform: rotate(-2deg); background: var(--color-card); border: 1px solid var(--color-border); }

/* ---------- Icons: own glyph family, drawn inline ---------- */
.ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic.fill { fill: currentColor; stroke: none; }

/* ---------- App window ---------- */
.app {
  position: relative; z-index: 0; width: 100%; max-width: 1080px; height: 100%; min-height: 0;
  display: grid; grid-template-columns: 56px minmax(0, 1fr) 264px; grid-template-rows: 52px minmax(0, 1fr);
  border-radius: var(--radius-md); font: 400 .875rem/1.4 var(--font-body); color: var(--color-text);
  will-change: opacity; contain: layout style;
}
.app::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--color-card);
  border: 1px solid var(--color-border); box-shadow: var(--shadow-lift); z-index: -1;
}
.app-top { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--color-border); }
.app-brand { font: 700 1rem/1 var(--font-display); letter-spacing: -.03em; display: flex; align-items: center; gap: 8px; }
.app-brand i { width: 22px; height: 22px; border-radius: 9px 9px 9px 3px; background: var(--electric); display: inline-block; position: relative; }
.app-brand i::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--lime); }
.app-week { margin-left: 8px; font: 500 .8125rem var(--font-mono); color: var(--color-text-muted); }
.app-spacer { flex: 1; }

.streak { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; border-radius: var(--radius-pill); background: var(--lime); color: var(--color-on-highlight); font: 500 .75rem/1.2 var(--font-mono); border: 1px solid rgb(13 11 20 / .14); }
.streak .ic { width: 13px; height: 13px; }
.ring-wrap { display: inline-flex; align-items: center; gap: 8px; font: 500 .75rem var(--font-mono); color: var(--color-text); }
.ring { width: 30px; height: 30px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4; }
.ring .trk { stroke: var(--color-surface-2); }
.ring .val { stroke: var(--electric); stroke-linecap: round; stroke-dasharray: 69.1; stroke-dashoffset: calc(69.1 * (1 - var(--done, 0))); transition: stroke-dashoffset .3s var(--ease-spring); }

/* Publish button: idle pill -> progress ring -> check */
.pub { position: relative; display: inline-flex; align-items: center; justify-content: center; height: 34px; min-width: 34px; padding: 0 16px; border-radius: var(--radius-pill); background: var(--electric); color: var(--color-on-accent); font: 600 .8125rem var(--font-body); border: 0; transition: padding .4s var(--ease-spring), background .3s var(--ease-soft), scale .25s var(--ease-spring); cursor: pointer; overflow: hidden; }
.pub:active { scale: .94; }
.pub .lbl { white-space: nowrap; transition: opacity .2s, max-width .4s var(--ease-spring); max-width: 160px; }
.pub .spin, .pub .done { position: absolute; width: 20px; height: 20px; opacity: 0; }
.pub .spin { animation: none; }
.pub .spin circle { fill: none; stroke: var(--color-on-accent); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 44; stroke-dashoffset: 44; }
.pub.is-busy { padding: 0; width: 34px; }
.pub.is-busy .lbl { opacity: 0; max-width: 0; }
.pub.is-busy .spin { opacity: 1; }
.pub.is-busy .spin circle { animation: mk-ring-fill 1s linear forwards; }
.pub.is-done { padding: 0; width: 34px; background: var(--green-ink); }
.pub.is-done .lbl { opacity: 0; max-width: 0; }
.pub.is-done .spin { opacity: 0; }
.pub.is-done .done { opacity: 1; animation: mk-pop-in .38s var(--ease-spring); }
@keyframes mk-ring-fill { to { stroke-dashoffset: 0; } }
@keyframes mk-pop-in { from { scale: 0; } to { scale: 1; } }

.app-side { grid-row: 2; border-right: 1px solid var(--color-border); display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 0; }
.side-ico { position: relative; width: 32px; height: 32px; border-radius: 10px 10px 10px 4px; display: grid; place-items: center; color: var(--color-text-muted); }
.side-ico.on { background: var(--electric-100); color: var(--electric-deep); }
.side-ico .ic { width: 18px; height: 18px; }
.badge { position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: var(--radius-pill); background: var(--coral); color: var(--color-text); font: 600 .6875rem/16px var(--font-mono); text-align: center; border: 2px solid var(--color-card); box-sizing: content-box; scale: 0; }
.is-complete .badge { animation: mk-badge .5s var(--ease-spring) .5s forwards; }
@keyframes mk-badge { 0% { scale: 0; } 60% { scale: 1.3; } 100% { scale: 1; } }

.cal {
  grid-row: 2; display: grid; min-height: 0; padding: 10px 12px 12px; gap: 6px;
  grid-template-columns: 64px repeat(5, minmax(0, 1fr)); grid-template-rows: 28px repeat(4, minmax(0, 1fr));
}
.cal-head { font: 500 .75rem/28px var(--font-mono); color: var(--color-text-muted); text-align: center; letter-spacing: var(--tracking-label); text-transform: uppercase; }
.cal-lane { display: flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 600; }
.cal-lane i { width: 9px; height: 9px; border-radius: 4px 4px 4px 1px; background: var(--lane); flex: none; }
.cell { border: 1.5px dashed rgb(13 11 20 / .14); border-radius: 14px 14px 14px 4px; min-height: 0; background: rgb(236 229 212 / .5); }

.panel { grid-row: 2; grid-column: 3; border-left: 1px solid var(--color-border); padding: 14px; display: flex; flex-direction: column; gap: 11px; min-height: 0; overflow: hidden; }
.panel-inner { display: flex; flex-direction: column; gap: 11px; will-change: opacity, transform; }
.eyebrow { font: 500 .75rem/1 var(--font-mono); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--electric-deep); }
.panel h3 { font: 600 1.0625rem/1.15 var(--font-display); letter-spacing: var(--tracking-display); }
.pillar { display: grid; gap: 5px; font-size: .8125rem; }
.pillar-row { display: flex; justify-content: space-between; font-weight: 500; }
.bar { height: 6px; border-radius: 6px; background: var(--color-surface); overflow: hidden; }
.bar b { display: block; height: 100%; width: var(--w); border-radius: inherit; background: var(--c, var(--electric)); }
.panel-note { font-size: .8125rem; color: var(--color-text-muted); }
.channels { display: grid; gap: 5px; font-size: .8125rem; }
.channels li { list-style: none; display: flex; align-items: center; gap: 8px; }
.channels i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.channels li.soon i { background: var(--color-surface-2); box-shadow: inset 0 0 0 1.5px #8a86a0; }
.channels li.soon { color: var(--color-text-muted); }
.btn-lime { align-self: flex-start; padding: 8px 14px; border-radius: var(--radius-pill); background: var(--lime); color: var(--color-on-highlight); font-weight: 600; font-size: .8125rem; border: 1px solid rgb(13 11 20 / .18); transition: scale .25s var(--ease-spring); }
.btn-lime:active { scale: .94; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; }
.total { font: 600 1.5rem/1 var(--font-display); letter-spacing: var(--tracking-display); display: flex; align-items: center; gap: 6px; }
.total .ic { color: var(--coral-ink); width: 20px; height: 20px; }
.total small { font: 400 .75rem var(--font-mono); color: var(--color-text-muted); letter-spacing: 0; }

/* ---------- Status chips (text always ink; dot carries the hue) ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 7px; border-radius: var(--radius-pill);
  background: var(--color-card); border: 1px solid var(--color-border); color: var(--color-text);
  font: 500 .75rem/1.4 var(--font-body); white-space: nowrap;
}
.chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--dot, #8a86a0); flex: none; }
.chip[data-state="borrador"], [data-status="borrador"] { --dot: #8a86a0; }
.chip[data-state="aprobado"], [data-status="aprobado"] { --dot: var(--electric); }
.chip[data-state="programado"], [data-status="programado"] { --dot: #b87400; }
.chip[data-state="publicado"], [data-status="publicado"] { --dot: var(--green); }

/* ---------- Own abstract scenes (gradients + our shapes, no photos) ---------- */
[data-scene="a"] { --scene: var(--duo-a); }
[data-scene="b"] { --scene: var(--duo-b); }
[data-scene="c"] { --scene: var(--duo-c); }
[data-scene="d"] { --scene: var(--duo-d); }
[data-scene="e"] { --scene: var(--duo-e); }
/* Real photos (free licenses, see credits.md) multiplied over a duotone base so the identity stays ours */
[data-photo="cafe-latte"] { --photo: url("img/cafe-latte.jpg"); } [data-photo="ceramics-workshop"] { --photo: url("img/ceramics-workshop.jpg"); }
[data-photo="boutique"] { --photo: url("img/boutique.jpg"); } [data-photo="bakery"] { --photo: url("img/bakery.jpg"); }
[data-photo="bakery-2"] { --photo: url("img/bakery-2.jpg"); } [data-photo="plants"] { --photo: url("img/plants.jpg"); }
[data-photo="barber"] { --photo: url("img/barber.jpg"); } [data-photo="flowers"] { --photo: url("img/flowers.jpg"); }
[data-photo="handmade"] { --photo: url("img/handmade.jpg"); } [data-photo="owner-phone"] { --photo: url("img/owner-phone.jpg"); }
[data-photo="desk-laptop"] { --photo: url("img/desk-laptop.jpg"); }
/* Light thumbnails for small cards (the big files stay on editorial blocks) */
.post[data-photo="bakery"], .q-row[data-photo="bakery"] { --photo: url("img/sm/bakery.jpg"); }
.post[data-photo="bakery-2"], .q-row[data-photo="bakery-2"] { --photo: url("img/sm/bakery-2.jpg"); }
.post[data-photo="barber"], .q-row[data-photo="barber"] { --photo: url("img/sm/barber.jpg"); }
.post[data-photo="boutique"], .q-row[data-photo="boutique"] { --photo: url("img/sm/boutique.jpg"); }
.post[data-photo="cafe-latte"], .q-row[data-photo="cafe-latte"] { --photo: url("img/sm/cafe-latte.jpg"); }
.post[data-photo="ceramics-workshop"], .q-row[data-photo="ceramics-workshop"] { --photo: url("img/sm/ceramics-workshop.jpg"); }
.post[data-photo="desk-laptop"], .q-row[data-photo="desk-laptop"] { --photo: url("img/sm/desk-laptop.jpg"); }
.post[data-photo="flowers"], .q-row[data-photo="flowers"] { --photo: url("img/sm/flowers.jpg"); }
.post[data-photo="handmade"], .q-row[data-photo="handmade"] { --photo: url("img/sm/handmade.jpg"); }
.post[data-photo="owner-phone"], .q-row[data-photo="owner-phone"] { --photo: url("img/sm/owner-phone.jpg"); }
.post[data-photo="plants"], .q-row[data-photo="plants"] { --photo: url("img/sm/plants.jpg"); }
.art, .pm-thumb, .duo { isolation: isolate; }
.art::before, .pm-thumb::before, .duo::before { content: ""; position: absolute; inset: 0; background: var(--photo, none) center / cover no-repeat; mix-blend-mode: normal; filter: none; z-index: 0; border-radius: inherit; }
.duo { position: relative; background: var(--scene); }
.art > *, .pm-thumb > *, .duo > * { z-index: 1; }

[data-format="vertical"] { --lane: var(--lane-story); --ar: 9 / 16; }
[data-format="portrait"] { --lane: var(--lane-post); --ar: 4 / 5; }
[data-format="stack"] { --lane: var(--lane-carousel); --ar: 1 / 1; }
[data-format="motion"] { --lane: var(--lane-reel); --ar: 9 / 16; }
[data-lane="story"] { --lane: var(--lane-story); } [data-lane="post"] { --lane: var(--lane-post); }
[data-lane="carousel"] { --lane: var(--lane-carousel); } [data-lane="reel"] { --lane: var(--lane-reel); }

/* ---------- Content card: two layers crossfaded by --t ---------- */
.post {
  position: absolute; left: 0; top: 0; z-index: 2; container-type: size; border-radius: var(--radius-petal);
  background: var(--color-card); border: 1px solid var(--color-border); box-shadow: var(--shadow-soft);
  font-family: var(--font-body); will-change: transform; --t: 0; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.tilt { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0px)); transition: transform .28s var(--ease-follow); }
.pf, .pm { position: absolute; inset: 0; display: flex; flex-direction: column; min-width: 0; }
.pf { opacity: clamp(0, calc(1 - (var(--t) - .3) * 4), 1); padding: 6px; gap: 5px; }
.pm { opacity: clamp(0, calc((var(--t) - .45) * 4), 1); padding: 7px 7px 6px 9px; gap: 5px; border-left: 4px solid var(--lane); }

.art { position: relative; flex: 1 1 auto; min-height: 0; background: var(--scene); border-radius: 16px 16px 16px 4px; overflow: hidden; }
.art-tag { position: absolute; left: 6px; top: 6px; padding: 3px 8px; border-radius: var(--radius-pill); background: rgb(255 255 255 / .92); font: 500 .75rem/1.1 var(--font-mono); color: var(--color-text); }
.pf-title { margin: 0; font: 600 .75rem/1.2 var(--font-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; flex: none; }
.pf-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex: none; padding: 0 2px 1px; }
.ticks { display: inline-flex; gap: 3px; }
.ticks i { width: 10px; height: 4px; border-radius: 2px; background: var(--color-surface-2); }
.ticks i.on { background: var(--electric); }
.bloomct { display: inline-flex; align-items: center; gap: 4px; font: 500 .75rem/1 var(--font-mono); color: var(--color-text); }
.bloomct .ic { width: 12px; height: 12px; color: var(--coral-ink); }
.bloomct.bump { animation: mk-bump .32s var(--ease-spring); }
@keyframes mk-bump { 0% { scale: 1; } 45% { scale: 1.35; } 100% { scale: 1; } }

/* Motion card: breathing ring (ambient, slow) */
.pulse { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; background: rgb(255 255 255 / .92); display: grid; place-items: center; color: var(--color-text); }
.pulse::before, .pulse::after { content: ""; position: absolute; inset: -9px; border-radius: 50%; border: 1.5px solid rgb(255 255 255 / .9); animation: mk-breathe 4.2s var(--ease-soft) infinite; }
.pulse::after { inset: -18px; animation-delay: 1.4s; }
.pulse::before, .pulse::after { will-change: transform, opacity; }
.pulse .ic { width: 12px; height: 12px; fill: currentColor; stroke: none; margin-left: 2px; }
@keyframes mk-breathe { 0% { scale: .7; opacity: .9; } 70%, 100% { scale: 1.1; opacity: 0; } }
/* Stack card: two offset layers behind the art */
[data-format="stack"] .art { margin-right: 10px; }
[data-format="stack"] .art::after { content: ""; position: absolute; inset: 8px -12px 8px auto; width: 12px; background: rgb(255 255 255 / .6); border-radius: 0 10px 10px 0; }
.stack-peek { position: absolute; right: 0; top: 14px; bottom: 30px; width: 10px; border-radius: 0 10px 10px 0; background: var(--lane); opacity: .85; }

/* Mini (calendar) layer: thumbnail in the true proportion + time + bloom count + status */
.pm-stage { flex: 1 1 auto; min-height: 0; position: relative; }
.pm-thumb { position: absolute; left: 50%; top: 0; height: 100%; max-width: 100%; transform: translateX(-50%); aspect-ratio: var(--ar, 4 / 5); border-radius: 10px 10px 10px 3px; background: var(--scene); border: 1px solid rgb(13 11 20 / .12); display: grid; place-items: center; }
.pm-thumb .mini-pulse { width: 18px; height: 18px; border-radius: 50%; background: rgb(255 255 255 / .92); display: grid; place-items: center; }
.pm-thumb .mini-pulse .ic { width: 9px; height: 9px; fill: var(--color-text); stroke: none; margin-left: 1px; }
.pm-thumb .mini-ticks { position: absolute; bottom: 4px; left: 0; right: 0; display: flex; gap: 2px; justify-content: center; }
.pm-thumb .mini-ticks i { width: 5px; height: 3px; border-radius: 2px; background: rgb(13 11 20 / .28); }
.pm-thumb .mini-ticks i.on { background: rgb(13 11 20 / .85); }
[data-format="stack"] .pm-thumb::after { content: ""; position: absolute; inset: 3px -5px 3px auto; width: 8px; border-radius: 0 8px 8px 0; background: rgb(255 255 255 / .75); border: 1px solid rgb(13 11 20 / .1); z-index: -1; }
.pm-foot { display: flex; align-items: center; gap: 6px; flex: none; font: 500 .75rem/1 var(--font-mono); color: var(--color-text); min-width: 0; }
.pm-foot .bloomct { margin-left: auto; }
.pm-foot .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--dot, #8a86a0); flex: none; }

/* Check stamp + magnetic snap */
.stamp { position: absolute; right: 5px; top: 5px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; scale: 0; transition: scale .34s var(--ease-spring); z-index: 3; }
.stamp .ic { width: 12px; height: 12px; stroke-width: 2.6; }
.post.is-set .stamp { scale: 1; }
.post.snap { animation: mk-snap .36s var(--ease-spring); }
@keyframes mk-snap { 0% { scale: 1.1; } 55% { scale: .96; } 100% { scale: 1; } }

@container (max-width: 118px) {
  .pf-title { display: none; }
  .ticks i { width: 7px; gap: 2px; }
}
@container (max-width: 100px) { .pm-foot .time { display: none; } .pm-foot .bloomct { margin-left: 0; } .pm-foot .dot { margin-left: auto; } }

/* ---------- Reward effects ---------- */
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 880; overflow: hidden; }
.fx-bloom { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; color: var(--coral-ink); animation: mk-bloom-pop 1.05s var(--ease-spring) forwards; }
.fx-bloom svg { width: 100%; height: 100%; fill: currentColor; stroke: none; }
@keyframes mk-bloom-pop {
  0% { scale: 0; translate: 0 0; opacity: 1; }
  28% { scale: 1.25; translate: 0 -6px; }
  42% { scale: 1; translate: 0 -10px; }
  100% { scale: .9; translate: 0 -64px; opacity: 0; }
}
.fx-spark { position: absolute; width: 8px; height: 8px; margin: -4px; border-radius: var(--r, 50%); background: var(--c, var(--lime)); animation: mk-spark .9s cubic-bezier(.2, .7, .3, 1) forwards; }
@keyframes mk-spark {
  0% { translate: 0 0; scale: 0; rotate: 0deg; opacity: 1; }
  15% { scale: 1; }
  100% { translate: var(--dx) var(--dy); scale: .6; rotate: var(--rot); opacity: 0; }
}

.toasts { position: absolute; z-index: 7; right: var(--gutter); top: clamp(18px, 5svh, 48px); width: min(260px, calc(100% - 2 * var(--gutter))); pointer-events: none; }
.toast {
  position: absolute; right: 0; top: 0; display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: var(--radius-pill);
  background: var(--color-card); border: 1px solid var(--color-border); box-shadow: var(--shadow-lift); font: 500 .8125rem/1.2 var(--font-body); white-space: nowrap;
  translate: 120% 0; opacity: 0;
}
.toast .ic-wrap { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--electric-100); color: var(--electric-deep); }
.toast .ic-wrap .ic { width: 14px; height: 14px; }
.toast.t-bloom .ic-wrap { background: color-mix(in srgb, var(--coral-ink) 14%, #fff); color: var(--coral-ink); }
.toast.t-done .ic-wrap { background: #d9f5e8; color: var(--green-ink); }
.toast b { font-weight: 700; }
.is-complete .toast { animation: mk-toast 2.5s var(--ease-spring) forwards; animation-delay: calc(1.1s + var(--k) * 2.7s); }
@keyframes mk-toast {
  0% { translate: 120% 0; opacity: 0; }
  14% { translate: 0 0; opacity: 1; }
  86% { translate: 0 0; opacity: 1; }
  100% { translate: 40% 0; opacity: 0; }
}
@media (max-width: 760px) { .toasts { right: auto; left: var(--gutter); top: 10px; } .toast { right: auto; left: 0; translate: -120% 0; } }

/* ---------- Responsive ---------- */
@media (max-height: 780px) { .legend { display: none; } }
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .app-side, .panel, .app-week, .streak, .ring-wrap .ring-n { display: none; }
  .cal { grid-template-columns: 60px repeat(3, minmax(0, 1fr)); padding: 8px; gap: 5px; }
  .d4, .d5 { display: none; }
  .note.n1 { left: 3%; top: 27%; }
  .note.n3 { display: none; }
}

/* ---------- Static (reduced motion): no pinning, final state ---------- */
.morph.is-static { height: auto; }
.morph.is-static .morph-stage { position: relative; height: auto; padding-top: clamp(150px, 22vw, 200px); }
.morph.is-static .app { height: 640px; }
@media (max-width: 760px) { .morph.is-static .app { height: 520px; } }
.morph.is-static .canvas-bg, .morph.is-static .notes, .morph.is-static .toasts { display: none; }

/* ---------- Hero: slow drifting stream of cards ---------- */
.stream { position: relative; overflow: hidden; padding-block: 8px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.stream-track { display: flex; gap: 14px; width: max-content; align-items: flex-end; animation: mk-drift 90s linear infinite; }
.stream.rev .stream-track { animation-direction: reverse; animation-duration: 110s; }
@keyframes mk-drift { to { transform: translateX(calc(-50% - 7px)); } }
.post.pv { position: relative; left: auto; top: auto; flex: none; cursor: default; }
.pv[data-format="portrait"] { width: 138px; height: 178px; }
.pv[data-format="stack"] { width: 148px; height: 170px; }
.pv[data-format="vertical"], .pv[data-format="motion"] { width: 100px; height: 178px; }
.pv.is-mini { --t: 1; }

/* ---------- Feature demos ---------- */
.demo { position: relative; border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 8px; background: var(--color-surface); padding: 20px; min-height: 500px; display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.demo h3 { font: 600 1.375rem/1.1 var(--font-display); letter-spacing: var(--tracking-display); }
.demo p { color: var(--color-text-muted); font-size: .9375rem; }
.demo-stage { position: relative; flex: 1; border-radius: var(--radius-md) var(--radius-md) var(--radius-md) 6px; background: var(--color-card); border: 1px solid var(--color-border); padding: 14px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow-soft); overflow: hidden; min-height: 0; }

/* A: plan generates content cards */
.prompt { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--radius-pill); background: var(--color-surface); font: 400 .8125rem var(--font-mono); }
.prompt .ic { color: var(--electric); }
.prompt .type { display: inline-block; overflow: hidden; white-space: nowrap; width: 0; border-right: 2px solid var(--electric); }
.is-live .prompt .type { animation: mk-type 2.4s steps(42, end) .2s forwards; }
.plan-row { display: grid; gap: 6px; opacity: 0; transform: translateY(8px); }
.is-live .plan-row { animation: mk-appear .9s var(--ease-reveal) forwards; animation-delay: calc(2.8s + var(--k) * .55s); }
.plan-row .bar b { width: 0; }
.is-live .plan-row .bar b { animation: mk-fill 1.3s var(--ease-soft) forwards; animation-delay: calc(3.1s + var(--k) * .55s); }
.plan-head { display: flex; justify-content: space-between; font-size: .8125rem; font-weight: 500; }
.plan-head span:last-child { font-family: var(--font-mono); color: var(--color-text-muted); }
.gen { display: flex; gap: 10px; align-items: flex-end; justify-content: center; margin-top: auto; }
.gen .post.pv[data-format="portrait"], .gen .post.pv[data-format="stack"] { width: 100px; height: 128px; }
.gen .post.pv[data-format="vertical"], .gen .post.pv[data-format="motion"] { width: 76px; height: 135px; }
.gen figure { display: grid; gap: 6px; justify-items: center; margin: 0; opacity: 0; scale: .9; translate: 0 14px; }
.is-live .gen figure { animation: mk-pop 0.42s var(--ease-spring) forwards; animation-delay: calc(4.8s + var(--k) * .7s); }
.gen figcaption { font: 500 .75rem/1 var(--font-mono); color: var(--color-text-muted); }
@keyframes mk-type { to { width: 42ch; border-right-color: transparent; } }
@keyframes mk-appear { to { opacity: 1; transform: none; } }
@keyframes mk-pop { to { opacity: 1; scale: 1; translate: 0 0; } }
@keyframes mk-fill { to { width: var(--w); } }

/* B: drag a card onto a day: magnetic snap, stamp, ripple */
.drag-wrap { position: relative; flex: 1; display: grid; grid-template-rows: auto 1fr; gap: 12px; min-height: 0; }
.tray { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .8125rem; color: var(--color-text-muted); }
.mini-week { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-self: end; }
.mini-day { position: relative; border-radius: 14px 14px 14px 4px; border: 1.5px dashed rgb(13 11 20 / .16); padding: 6px; display: flex; flex-direction: column; gap: 6px; font: 500 .75rem var(--font-mono); color: var(--color-text-muted); min-height: 160px; transition: background .5s var(--ease-soft), border-color .5s var(--ease-soft); }
.mini-day .slot { flex: 1; min-height: 0; position: relative; }
.mini-day .slot .post.pv[data-format] { position: absolute; inset: 0; width: auto; height: auto; cursor: default; }
.mini-day .chip { align-self: flex-start; opacity: 0; gap: 4px; padding: 2px 6px 2px 5px; max-width: 100%; }
.mini-day::after { content: ""; position: absolute; inset: -2px; border-radius: inherit; border: 2px solid var(--electric); opacity: 0; pointer-events: none; }
.is-live .mini-day.target { animation: mk-target 6.4s var(--ease-soft) forwards; }
.is-live .mini-day.target::after { animation: mk-ripple .6s ease-out 5.3s forwards; }
.is-live .mini-day.target .chip { animation: mk-appear .5s var(--ease-reveal) 5.4s forwards; }
.post.pv.drag-chip[data-format] { position: absolute; left: 6px; top: 34px; z-index: 3; width: 112px; height: 140px; }
.is-live .drag-chip { animation: mk-drag 6.4s var(--ease-soft) forwards; }
.is-live .drag-chip .stamp { animation: mk-stamp .38s var(--ease-spring) 5.35s forwards; }
.cursor-art { position: absolute; left: 70px; top: 80px; width: 22px; height: 22px; z-index: 4; opacity: 0; color: var(--ink); fill: var(--color-card); stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.is-live .cursor-art { animation: mk-cursor-move 6.4s var(--ease-soft) forwards; }
@keyframes mk-drag {
  0%, 12% { transform: translate(0, 0) rotate(0); }
  24% { transform: translate(0, -4px) rotate(-3deg) scale(1.04); box-shadow: var(--shadow-lift); }
  64% { transform: translate(calc(var(--dx, 150px) * .94), calc(var(--dy, 80px) * .94)) rotate(2deg) scale(1.04); box-shadow: var(--shadow-lift); --t: 0; width: 112px; height: 140px; }
  76% { transform: translate(var(--dx, 150px), var(--dy, 80px)) rotate(0) scale(1.06); --t: .55; }
  84%, 100% { transform: translate(var(--dx, 150px), var(--dy, 80px)) rotate(0) scale(1); box-shadow: none; --t: 1; width: var(--tw, 90px); height: var(--th, 96px); }
}
@keyframes mk-stamp { from { scale: 0; } 60% { scale: 1.3; } to { scale: 1; } }
@keyframes mk-ripple { 0% { opacity: .9; scale: 1; } 100% { opacity: 0; scale: 1.12; } }
@keyframes mk-cursor-move {
  0% { opacity: 0; transform: translate(40px, 30px); }
  10% { opacity: 1; transform: translate(0, 0); }
  24% { opacity: 1; transform: translate(0, -4px); }
  64% { opacity: 1; transform: translate(calc(var(--dx, 150px) + 70px), calc(var(--dy, 80px) + 70px)); }
  92%, 100% { opacity: 0; transform: translate(calc(var(--dx, 150px) + 96px), calc(var(--dy, 80px) + 92px)); }
}
@keyframes mk-target {
  0%, 30% { background: transparent; }
  50%, 76% { background: var(--paper-2); border-color: var(--electric); }
  92%, 100% { background: transparent; border-color: rgb(13 11 20 / .16); }
}

/* C: publish moment, statuses advance, blooms tick up */
.q-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.queue { display: grid; gap: 8px; }
.q-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 12px 12px 12px 4px; background: var(--color-surface); font-size: .8125rem; }
.q-thumb { height: 54px; display: grid; place-items: center; position: relative; }
.q-thumb .pm-thumb { position: relative; left: auto; transform: none; }
.q-row b { display: block; font-weight: 600; }
.q-row small { font: 400 .75rem var(--font-mono); color: var(--color-text-muted); }
.q-right { display: grid; justify-items: end; gap: 5px; }
.q-row .chip { transition: scale .32s var(--ease-spring); }
.q-row .chip.bump { scale: 1.12; }
.q-row .bloomct { opacity: 0; transition: opacity .4s var(--ease-soft); }
.q-row .bloomct.on { opacity: 1; }
.q-total { font: 500 .75rem var(--font-mono); color: var(--color-text-muted); }

@media (prefers-reduced-motion: reduce) {
  .stream-track { animation: none; }
  .pulse::before, .pulse::after { animation: none; opacity: 0; }
  .prompt .type { width: 42ch; border-right-color: transparent; }
  .plan-row, .gen figure { opacity: 1; transform: none; scale: 1; translate: none; }
  .plan-row .bar b { width: var(--w); }
  .drag-chip { transform: translate(var(--dx, 150px), var(--dy, 80px)); width: var(--tw, 90px); height: var(--th, 96px); --t: 1; }
  .drag-chip .stamp, .post .stamp { scale: 1; }
  .mini-day .chip, .q-row .bloomct { opacity: 1; }
  .cursor-art, .toasts, .fx { display: none; }
  .badge { scale: 1; }
}

/* ---------- Flying cards (pinned morph): transform-only motion ----------
   .post.fly is a zero-size anchor at the card centre (JS writes translate + rotate).
   .pf (canvas layer) and .pm (calendar layer) have fixed sizes set once at layout and are
   only scaled, so no layout or paint runs while scrolling. */
.post.fly { width: 0; height: 0; overflow: visible; container-type: normal; background: none; border: 0; box-shadow: none; border-radius: 0; contain: layout style; will-change: transform; }
.post.fly .tilt { left: 0; top: 0; width: 0; height: 0; overflow: visible; border-radius: 0; }
.post.fly .pf, .post.fly .pm { container-type: size; overflow: hidden; background: var(--color-card); border: 1px solid var(--color-border); box-shadow: var(--shadow-soft); border-radius: var(--radius-petal); will-change: transform, opacity; transform-origin: 50% 50%; }
.post.fly .pf { padding: 6px; }
.post.fly .pm { border-left: 4px solid var(--lane); }
.post.fly .stamp { left: calc(var(--tw, 0px) / 2 - 25px); top: calc(var(--th, 0px) / -2 + 5px); right: auto; }
