/* ══════════════════════════════════════════════════════════════
   /next — the live-demo card surface.
   Each card carries a working miniature of the product, not a
   screenshot. The stage is the screen; everything else frames it.
   ══════════════════════════════════════════════════════════════ */

.deck {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
  margin-top: 60px;
}
@media (max-width: 760px) { .deck { grid-template-columns: 1fr; gap: 14px; } }

.card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: 18px;
  padding: 20px 20px 18px;
  box-shadow: var(--lift-1);
  transition: box-shadow .28s, transform .28s, border-color .28s;
  overflow: hidden;
}
.card:hover, .card:focus-within {
  box-shadow: var(--lift-3);
  border-color: color-mix(in srgb, var(--app-ink, var(--accent)) 26%, var(--rule));
}
/* Brand wash, top edge only — never behind the demo itself. */
.card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--app-accent, var(--accent)), transparent 72%);
  opacity: .8;
}

.card-head { display: flex; align-items: center; gap: 13px; margin-bottom: 15px; }
.card-icon {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  border: 1px solid var(--rule-soft);
  background: var(--paper-deep);
  object-fit: cover;
}
.card-title { flex: 1 1 auto; min-width: 0; }
.card-name { font-size: 18px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.card-role { font-size: 12px; color: var(--ink-3); letter-spacing: .02em; margin-top: 2px; }

.tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }
.tag {
  font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 20px; border: 1px solid;
}
/* --app-ink is a hue-preserving darkening of --app-accent, precomputed per
   app so each brand colour clears 4.5:1 on white. See landing commit 1088ac5. */
.tag-brand { border-color: var(--app-ink, var(--accent-ink)); color: var(--app-ink, var(--accent-ink)); }
.tag-mute  { border-color: var(--rule); color: var(--ink-3); background: var(--paper-deep); }

/* ── The stage: where the product actually runs ───────────── */
.stage {
  position: relative;
  height: 188px;
  border-radius: 13px;
  background: var(--paper-deep);
  border: 1px solid var(--rule-soft);
  overflow: hidden;
  display: flex; flex-direction: column;
  contain: layout paint;            /* demo repaints never touch page layout */
}
.stage-live {
  position: absolute; top: 9px; right: 10px; z-index: 3;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3);
  background: rgba(255,255,255,.82);
  border: 1px solid var(--rule-soft);
  padding: 2px 7px; border-radius: 999px;
  backdrop-filter: blur(6px);
}
.stage-live::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: #15803d; box-shadow: 0 0 0 0 rgba(21,128,61,.55);
  animation: pulse-dot 2.2s ease-out infinite;
}
@keyframes pulse-dot {
  0%   { box-shadow: 0 0 0 0 rgba(21,128,61,.5); }
  70%  { box-shadow: 0 0 0 7px rgba(21,128,61,0); }
  100% { box-shadow: 0 0 0 0 rgba(21,128,61,0); }
}

.card-foot { display: flex; align-items: center; gap: 10px; margin-top: 15px; }
.card-copy { flex: 1 1 auto; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.card-open {
  flex-shrink: 0;
  padding: 9px 15px; border-radius: 9px;
  font-size: 13px; font-weight: 700; white-space: nowrap;
  background: var(--paper-raised);
  border: 1.5px solid var(--app-ink, var(--accent));
  color: var(--app-ink, var(--accent));
  transition: background .2s, transform .2s;
}
.card-open:hover {
  background: color-mix(in srgb, var(--app-ink, var(--accent)) 9%, #fff);
  transform: translateY(-1px);
}

/* ══ Demo internals ═══════════════════════════════════════════ */

/* ZamZam — prayer clock */
.zz { display: grid; grid-template-columns: 1fr 76px; gap: 10px; padding: 13px; height: 100%; }
.zz-list { display: flex; flex-direction: column; justify-content: center; gap: 1px; min-width: 0; }
.zz-row {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 11.5px; padding: 2.5px 6px; border-radius: 5px;
  /* ink-2, not ink-3: the stage sits on --paper-deep, where ink-3 drops to
     4.0:1 and misses AA. Measured, not guessed. */
  color: var(--ink-2);
}
.zz-row.now { background: rgba(12,133,93,.1); color: var(--ink); font-weight: 600; }
.zz-row .n { flex: 1 1 auto; letter-spacing: .02em; }
.zz-row .t { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 11px; }
.zz-next { margin-top: 6px; padding: 0 6px; font-size: 10px; color: var(--ink-3); letter-spacing: .04em; }
.zz-next b { font-family: var(--mono); color: var(--ink); font-size: 12px; }
/* qibla compass */
.zz-compass { align-self: center; justify-self: center; text-align: center; }
.zz-dial {
  width: 66px; height: 66px; border-radius: 50%;
  border: 1px solid var(--rule);
  background: var(--paper-raised);
  position: relative; display: grid; place-items: center;
}
.zz-needle {
  position: absolute; left: 50%; top: 50%;
  width: 2px; height: 27px; border-radius: 2px;
  background: linear-gradient(var(--app-accent, #0c855d), color-mix(in srgb, var(--app-accent,#0c855d) 30%, #fff));
  transform-origin: 50% 100%;
  transform: translate(-50%, -100%) rotate(var(--qibla, 0deg));
  transition: transform .9s cubic-bezier(.2,.8,.2,1);
}
.zz-dial::after { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--ink-4); }
.zz-deg { font-family: var(--mono); font-size: 9.5px; color: var(--ink-3); margin-top: 5px; }

/* Sharingan — RSVP reader */
.rs { display: flex; flex-direction: column; height: 100%; padding: 13px; }
.rs-word {
  /* Centring lives here, but the word itself must be ONE child: with the text
     runs as direct flex/grid items the pivot letter became its own row. */
  flex: 1 1 auto; display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 28px; font-weight: 700;
  font-variation-settings: 'opsz' 144; letter-spacing: -.02em;
  color: var(--ink); text-align: center; line-height: 1;
  min-height: 0; overflow: hidden;
}
.rs-in { white-space: nowrap; }
.rs-in span { color: var(--app-accent, var(--accent)); }
.rs-meter { height: 2px; background: var(--rule-soft); border-radius: 2px; overflow: hidden; }
.rs-meter i { display: block; height: 100%; width: 0; background: var(--app-ink, var(--accent)); transition: width .12s linear; }
.rs-ctl { display: flex; align-items: center; gap: 8px; margin-top: 9px; font-size: 10.5px; color: var(--ink-3); }
.rs-ctl input[type=range] { flex: 1 1 auto; accent-color: var(--app-ink, var(--accent)); height: 3px; }
.rs-wpm { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }

/* Hunter — progression chart */
.hu { padding: 13px; height: 100%; display: flex; flex-direction: column; }
.hu-chart { flex: 1 1 auto; min-height: 0; }
.hu-foot { display: flex; justify-content: space-between; align-items: baseline; margin-top: 7px; font-size: 10.5px; color: var(--ink-3); }
.hu-foot b { font-family: var(--mono); color: var(--ink); font-size: 13px; }

/* Pochita — receipt extraction */
.po { display: grid; grid-template-columns: 62px 1fr; gap: 11px; padding: 13px; height: 100%; align-items: center; }
.po-slip {
  position: relative; background: var(--paper-raised); border: 1px solid var(--rule-soft);
  border-radius: 4px; padding: 7px 5px; overflow: hidden; height: 100%;
  display: flex; flex-direction: column; gap: 3px; justify-content: center;
}
.po-slip i { display: block; height: 2px; border-radius: 2px; background: var(--rule); }
.po-slip i:nth-child(2n) { width: 72%; }
.po-slip i:nth-child(3n) { width: 58%; }
.po-scan {
  position: absolute; left: 0; right: 0; height: 2px; top: -2px;
  background: linear-gradient(90deg, transparent, var(--app-accent, #a26807), transparent);
  animation: po-sweep 2.6s ease-in-out infinite;
}
@keyframes po-sweep { 0% { top: -2px } 100% { top: 100% } }
.po-fields { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.po-field { display: flex; align-items: baseline; gap: 7px; font-size: 11px; }
.po-field .k { color: var(--ink-3); width: 58px; flex-shrink: 0; letter-spacing: .02em; }
.po-field .v {
  font-family: var(--mono); font-size: 11px; color: var(--ink); font-weight: 600;
  overflow: hidden; white-space: nowrap;
  border-right: 1.5px solid var(--app-accent, var(--accent));
}
.po-field .v.done { border-right-color: transparent; }

/* Zangetsu — PDF → table */
.za { padding: 13px; height: 100%; display: flex; flex-direction: column; gap: 8px; }
.za-grid { flex: 1 1 auto; display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 1px; background: var(--rule-soft); border: 1px solid var(--rule-soft); border-radius: 5px; overflow: hidden; align-content: start; }
.za-cell {
  background: var(--paper-raised); padding: 4.5px 7px;
  font-size: 10.5px; color: var(--ink-2);
  font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transform: translateY(-3px); transition: opacity .3s, transform .3s;
}
.za-cell.in { opacity: 1; transform: none; }
.za-cell.head { background: var(--paper-deep); color: var(--ink); font-weight: 700; }
.za-cell.num { text-align: right; font-variant-numeric: tabular-nums; }
.za-note { font-size: 10px; color: var(--ink-3); letter-spacing: .03em; }

/* LanguageSlayer — flashcard */
.ls { display: grid; place-items: center; height: 100%; padding: 13px; perspective: 900px; }
.ls-card {
  width: 100%; height: 100%; position: relative;
  transform-style: preserve-3d; transition: transform .7s cubic-bezier(.2,.8,.2,1);
  cursor: pointer;
}
.ls-card.flip { transform: rotateY(180deg); }
.ls-face {
  position: absolute; inset: 0; backface-visibility: hidden;
  display: grid; place-items: center; text-align: center; gap: 5px;
  background: var(--paper-raised); border: 1px solid var(--rule-soft);
  border-radius: 10px; padding: 12px;
}
.ls-face.back { transform: rotateY(180deg); background: color-mix(in srgb, var(--app-accent,#994de1) 7%, #fff); }
.ls-term { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.ls-hint { font-size: 10px; color: var(--ink-3); letter-spacing: .1em; text-transform: uppercase; }
.ls-pos { font-size: 11px; color: var(--ink-3); font-style: italic; }

/* Insta — bulk cleaner counter */
.ic { padding: 13px; height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 9px; }
.ic-num { font-family: var(--mono); font-size: 30px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.ic-label { font-size: 10.5px; color: var(--ink-3); letter-spacing: .06em; text-transform: uppercase; }
.ic-bar { height: 5px; border-radius: 3px; background: var(--rule-soft); overflow: hidden; }
.ic-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--app-accent,#ee2a7b), var(--app-ink,#db2771)); transition: width .3s linear; }
.ic-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; }
.ic-grid b { aspect-ratio: 1; border-radius: 2px; background: var(--rule); transition: background .25s, opacity .25s; }
.ic-grid b.gone { background: var(--rule-soft); opacity: .35; }

/* Paused state — demos stop when off-screen or on reduced motion */
.stage[data-paused="1"] .rs-word,
.stage[data-paused="1"] .po-scan { animation-play-state: paused; }
