/* ===== Chunky Patterns Interactive Demo — banner, mock upload, gate, tasks, tour ===== */


.toast {
  z-index: 400;
}

/* ---------- Banner ---------- */
.demo-banner {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 16px;
  background: var(--ink);
  color: #f3e9dd;
  font-size: 0.8rem;
  z-index: 30;
}

.demo-banner-left,
.demo-banner-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.demo-banner-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #d9cbbb;
}

.demo-pill {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: #f2cfc4;
  color: var(--ink);
}

.demo-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: 1px solid transparent;
  color: #f3e9dd;
  font: inherit;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.demo-link:hover,
.demo-link[aria-expanded='true'] {
  background: rgba(255, 248, 240, 0.1);
}

.demo-link strong {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.75rem;
  color: #f2cfc4;
}

#demoTasksBtn {
  border-color: rgba(242, 207, 196, 0.35);
}

#demoTasksBtn.pulse {
  animation: demoPulse 0.9s ease;
}

@keyframes demoPulse {
  0% { box-shadow: 0 0 0 0 rgba(242, 207, 196, 0.7); }
  100% { box-shadow: 0 0 0 12px rgba(242, 207, 196, 0); }
}

.demo-tasks-ring {
  --p: 0deg;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: conic-gradient(#f2cfc4 var(--p), rgba(255, 248, 240, 0.18) 0);
  transition: background 0.3s;
}

.demo-cta {
  background: var(--accent);
  color: #fffdf9;
  font-weight: 700;
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  white-space: nowrap;
}

.demo-cta:hover {
  background: var(--accent-hover);
}

/* ---------- Tasks popover ---------- */
.demo-tasks {
  position: fixed;
  top: 46px;
  right: 16px;
  width: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 16px;
  z-index: 90;
  animation: demoPop 0.18s ease;
}

@keyframes demoPop {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

.demo-tasks-head h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.demo-tasks-head p {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin: 3px 0 12px;
}

.demo-task-list {
  list-style: none;
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.demo-task-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px;
  border-radius: var(--radius-sm);
}

.demo-task-list li div {
  display: grid;
  gap: 1px;
}

.demo-task-list strong {
  font-size: 0.84rem;
}

.demo-task-list small {
  font-size: 0.74rem;
  color: var(--ink-subtle);
}

.demo-check {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 50%;
  border: 1.6px solid var(--border-strong);
}

.demo-task-list li.done {
  background: var(--sage-soft);
}

.demo-task-list li.done strong {
  color: var(--sage);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.demo-task-list li.done .demo-check {
  border-color: var(--sage);
  background: var(--sage) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 8.5 2.5 2.5L12 5.5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat;
}

.demo-tasks .btn {
  text-decoration: none;
}

/* ---------- Mock upload ---------- */
.mock-upload-card {
  max-width: 760px;
}

.mock-drop {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 22px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-linen);
  color: var(--ink-muted);
  font: inherit;
  cursor: pointer;
}

.mock-drop:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.mock-drop svg {
  width: 40px;
  height: 40px;
}

.mock-drop strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.mock-drop span {
  font-size: 0.78rem;
}

.mock-note {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-size: 0.8rem;
  font-weight: 600;
}

.mock-note.nudge {
  animation: mockNudge 0.4s ease;
}

@keyframes mockNudge {
  0%, 100% { transform: none; }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.mock-roll-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 18px 0 10px;
}

.mock-roll-head h3 {
  font-size: 0.86rem;
}

.mock-roll-head span {
  font-size: 0.76rem;
  color: var(--ink-subtle);
}

.mock-roll {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

@media (max-width: 760px) {
  .mock-roll {
    grid-template-columns: repeat(3, 1fr);
  }
}

.mock-tile {
  display: grid;
  gap: 2px;
  text-align: left;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  font: inherit;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.mock-tile:hover,
.mock-tile:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.mock-tile-img {
  aspect-ratio: 5 / 6;
  border-radius: 8px;
  background: var(--bg-parchment) center/cover no-repeat;
  margin-bottom: 6px;
}

.mock-tile-label {
  font-weight: 600;
  font-size: 0.84rem;
}

.mock-tile-file {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-subtle);
}

.mock-progress {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 10px 4px;
}

.mock-progress-thumb {
  width: 120px;
  aspect-ratio: 5 / 6;
  object-fit: cover;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.mock-progress-main {
  flex: 1;
}

.mock-progress-file {
  display: flex;
  justify-content: space-between;
  font-size: 0.86rem;
  margin-bottom: 8px;
}

.mock-progress-file span {
  color: var(--ink-subtle);
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

.mock-bar {
  height: 8px;
  border-radius: 99px;
  background: var(--bg-parchment);
  overflow: hidden;
}

.mock-bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), #d39792);
  border-radius: inherit;
  transition: width 0.5s ease;
}

.mock-stages {
  list-style: none;
  margin-top: 14px;
  display: grid;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--ink-subtle);
}

.mock-stages li::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 9px;
  border-radius: 50%;
  background: var(--border-strong);
  vertical-align: 1px;
}

.mock-stages li.on {
  color: var(--ink);
  font-weight: 600;
}

.mock-stages li.on::before {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.mock-stages li.done {
  color: var(--sage);
}

.mock-stages li.done::before {
  background: var(--sage);
}

/* ---------- Tour ---------- */
.tour-root {
  position: fixed;
  inset: 0;
  z-index: 300;
}

.tour-blocker {
  position: absolute;
  inset: 0;
}

.tour-spot {
  position: fixed;
  border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(36, 28, 23, 0.58), 0 0 0 3px rgba(242, 207, 196, 0.9) inset;
  pointer-events: none;
  transition: left 0.35s cubic-bezier(0.3, 0.8, 0.3, 1), top 0.35s cubic-bezier(0.3, 0.8, 0.3, 1),
    width 0.35s cubic-bezier(0.3, 0.8, 0.3, 1), height 0.35s cubic-bezier(0.3, 0.8, 0.3, 1);
}

.tour-root.is-center .tour-spot {
  box-shadow: 0 0 0 9999px rgba(36, 28, 23, 0.58);
}

.tour-card {
  position: fixed;
  width: 340px;
  max-width: calc(100vw - 24px);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(20, 14, 10, 0.35);
  padding: 18px 20px 16px;
  transition: left 0.35s cubic-bezier(0.3, 0.8, 0.3, 1), top 0.35s cubic-bezier(0.3, 0.8, 0.3, 1);
  border-top: 4px solid var(--accent);
}

.tour-root.is-center .tour-card {
  width: 420px;
  padding: 26px 28px 20px;
}

.tour-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.tour-count {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.tour-skip {
  background: none;
  border: none;
  font: inherit;
  font-size: 0.76rem;
  color: var(--ink-subtle);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tour-title {
  font-family: var(--font-display);
  font-size: 1.22rem;
  line-height: 1.2;
  margin-bottom: 6px;
}

.tour-root.is-center .tour-title {
  font-size: 1.6rem;
}

.tour-body {
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--ink-muted);
}

.tour-body p + p {
  margin-top: 8px;
}

.tour-body strong {
  color: var(--ink);
}

.tour-muted {
  font-size: 0.78rem;
  color: var(--ink-subtle);
}

.tour-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.tour-dots {
  display: flex;
  gap: 4px;
}

.tour-dots span {
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: var(--border-strong);
  transition: width 0.25s, background 0.25s;
}

.tour-dots span.done {
  background: #e7b3a4;
}

.tour-dots span.on {
  width: 18px;
  background: var(--accent);
}

.tour-btns {
  display: flex;
  gap: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .tour-spot,
  .tour-card {
    transition: none;
  }
}

@media (max-width: 1100px) {
  .demo-banner-text {
    display: none;
  }
}

@media print {
  body[data-mode='demo'] * {
    display: none !important;
  }
}
