/* ═══════════════════════════════════════════════════════════════════
   Mocca — Hero stage (replaces scrolling console)
   Auto-cycling scenes: skeleton → chart → marketplace → dashboard(glass)
   Log stream persists as a subtle overlay.
   ═══════════════════════════════════════════════════════════════════ */

.stage{
  position:relative;
  background:var(--bg-2);
  border:1px solid var(--border);
  border-radius:var(--mk-radius-lg);
  box-shadow:var(--shadow-md);
  overflow:hidden;
  display:flex;flex-direction:column;
  height:min(520px, 62dvh);
  min-height:420px;
  min-width:0;
  isolation:isolate;
  transition:transform 520ms cubic-bezier(.4,0,.2,1),
             box-shadow 520ms cubic-bezier(.4,0,.2,1),
             border-radius 520ms cubic-bezier(.4,0,.2,1);
  will-change:transform;
}
/* Frame "morph" — the stage itself contracts briefly while scenes swap, so it
   reads as one continuous element resizing rather than two cards crossfading. */
.stage.morphing{
  transform:scale(.99);
  border-radius:calc(var(--mk-radius-lg) + 3px);
  box-shadow:var(--shadow-md);
}
@media (max-height: 599px) and (orientation: landscape){
  .stage{
    height:100%;
    max-height:calc(100dvh - 20px);
    max-height:calc(100dvh - 20px);
    min-height:0;
    width:100%;
  }
  .scene{padding:10px 12px;gap:8px}
  .stage-dots.floating{bottom:6px;padding:3px 6px;gap:4px}
  .stage-dots button{width:14px;height:4px}
  .stage-dots button.on{width:18px}
  /* Shrink scene chrome to leave room */
  .cl-card-hd{padding:8px 12px}
  .cl-issue{padding:6px 12px;gap:8px}
  .cl-issue-title{font-size:11px;line-height:1.35}
  .cl-issue-meta{font-size:10px}
  .cl-card-ft{padding:6px 12px;font-size:10px}
  .chart-svg{min-height:120px}
  .chart-v{font-size:24px}
}
[data-theme="dark"] .stage{background:var(--sidebar-deep);border-color:var(--border)}

/* Head */
.stage-head{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:12px 14px;
  border-bottom:1px solid var(--divider);
  background:var(--bg-1);
  z-index:2;
}
[data-theme="dark"] .stage-head{background:var(--bg-2)}
.stage-title{display:flex;align-items:center;gap:10px;font-size:12px;color:var(--fg-2);font-weight:600}
.stage-title .console-led{width:8px;height:8px;border-radius:999px;background:var(--accent);box-shadow:0 0 8px var(--accent)}

.stage-dots{display:flex;gap:6px}
.stage-dots.floating{
  position:absolute;
  left:50%;bottom:14px;
  transform:translateX(-50%);
  z-index:5;
  padding:6px 10px;
  border-radius:999px;
  background:color-mix(in srgb, var(--bg-1) 70%, transparent);
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
  border:1px solid var(--border);
  box-shadow:var(--shadow-sm);
}
.stage-dots button{
  width:22px;height:6px;border-radius:3px;border:0;cursor:pointer;padding:0;
  background:var(--border-strong);transition:background 150ms var(--mk-ease),width 220ms var(--mk-ease);
}
.stage-dots button:hover{background:var(--fg-3)}
.stage-dots button.on{background:var(--accent);width:28px}

/* Body — scene stack */
.stage-body{position:relative;flex:1;min-height:0}

.scene{
  position:absolute;inset:0;
  padding:20px 22px;
  display:flex;flex-direction:column;gap:14px;
  opacity:0;transform:scale(.975);filter:blur(3px);
  pointer-events:none;
  transition:opacity 460ms cubic-bezier(.4,0,.2,1),
             transform 520ms cubic-bezier(.4,0,.2,1),
             filter 460ms cubic-bezier(.4,0,.2,1);
}
.scene.on{opacity:1;transform:none;filter:none;pointer-events:auto}

/* ── Scene 0 · Skeleton ─────────────────────────── */
.sk-head{display:flex;align-items:center;gap:14px}
.sk-circle{width:44px;height:44px;border-radius:50%;background:var(--bg-3);position:relative;overflow:hidden}
.sk-lines{flex:1;display:flex;flex-direction:column;gap:8px}
.sk-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;flex:1;min-height:0}
.sk-card{
  padding:14px;border-radius:12px;background:var(--bg-3);
  display:flex;flex-direction:column;gap:10px;justify-content:space-between;
  position:relative;overflow:hidden;
}
.sk-foot{display:flex;gap:12px;align-items:center}
.sk-bar{
  height:12px;border-radius:6px;background:var(--bg-3);
  position:relative;overflow:hidden;
}
.sk-bar.sm{height:8px}
.sk-bar.w20{width:20%}.sk-bar.w30{width:30%}.sk-bar.w40{width:40%}
.sk-bar.w50{width:50%}.sk-bar.w60{width:60%}.sk-bar.w70{width:70%}
.sk-bar.w80{width:80%}.sk-bar.w90{width:90%}

/* ── Scene 0 · multi-layout cycling ─────────────────
   Each .sk-layout fills the scene; only the .on one is visible. The label
   floats top-right and updates with whichever layout is active.
   .scene-0 inherits absolute positioning + 20px/22px padding from .scene. */
.sk-layout-label{
  position:absolute; top:14px; right:18px; z-index:2;
  font-family:var(--mk-font-ui); font-weight:600;
  font-size:10px; letter-spacing:.12em; text-transform:none;
  color:var(--accent-text); pointer-events:none;
  padding:4px 9px; border-radius:999px;
  background:color-mix(in srgb, var(--accent) 9%, transparent);
  border:1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  transition:opacity 220ms var(--mk-ease), transform 220ms var(--mk-ease);
}
.scene-0.swap .sk-layout-label{ opacity:0; transform:translateY(-3px) }
html[dir="rtl"] .sk-layout-label{ right:auto; left:18px }

.sk-layout{
  position:absolute; inset:20px 22px;
  display:flex; flex-direction:column; gap:14px;
  opacity:0; transform:translateY(8px) scale(.985);
  pointer-events:none;
  transition:opacity 360ms var(--mk-ease),
             transform 360ms var(--mk-ease),
             filter 360ms var(--mk-ease);
  filter:blur(1px);
}
.sk-layout.on{
  opacity:1; transform:none; pointer-events:auto; filter:none;
}

/* Variant B — bento (1 hero + 3 supports) */
.sk-bento{
  display:grid; flex:1; min-height:0; gap:10px;
  grid-template-columns:1.4fr 1fr;
  grid-template-rows:1fr 1fr 1fr;
  grid-template-areas:
    "hero a"
    "hero b"
    "hero c";
}
.sk-bento-hero{ grid-area:hero }
.sk-bento-a{ grid-area:a } .sk-bento-b{ grid-area:b } .sk-bento-c{ grid-area:c }
.sk-bento-hero{ padding:18px; gap:12px }

/* Variant C — list/feed with thumbnails */
.sk-list{ display:flex; flex-direction:column; gap:10px; flex:1; min-height:0 }
.sk-row{
  display:flex; align-items:center; gap:12px;
  padding:11px 14px; border-radius:12px; background:var(--bg-3);
  position:relative; overflow:hidden;
}
.sk-thumb{
  width:38px; height:38px; flex-shrink:0;
  border-radius:8px; background:color-mix(in srgb, var(--accent) 14%, var(--bg-3));
  position:relative; overflow:hidden;
}
.sk-row-lines{ flex:1; display:flex; flex-direction:column; gap:6px; min-width:0 }
.sk-row-side{ flex-shrink:0; width:32px !important }

/* Variant D — sidebar + main app surface */
.sk-app{ display:flex; gap:12px; flex:1; min-height:0 }
.sk-app-side{
  width:130px; flex-shrink:0;
  display:flex; flex-direction:column; gap:7px;
  padding:14px 10px; border-radius:12px;
  background:color-mix(in srgb, var(--fg-1) 6%, var(--bg-3));
}
.sk-app-side > .sk-bar{ margin:0 4px 6px }
.sk-side-item{
  display:flex; align-items:center; gap:9px;
  padding:7px 8px; border-radius:8px;
  position:relative;
}
.sk-side-item.on{ background:color-mix(in srgb, var(--accent) 16%, transparent) }
.sk-side-item.on .sk-dot{ background:var(--accent) }
.sk-dot{
  width:14px; height:14px; flex-shrink:0;
  border-radius:4px; background:var(--bg-2);
}
.sk-side-item .sk-bar{ flex:1 }
.sk-app-main{
  flex:1; display:flex; flex-direction:column; gap:9px; min-width:0;
  padding:14px 16px; border-radius:12px; background:var(--bg-3);
}
.sk-app-main .sk-head{ align-items:flex-start; gap:10px }
.sk-app-action{ width:60px !important; height:18px !important; border-radius:6px }
.sk-app-row{
  padding:9px 10px; border-radius:8px;
  background:color-mix(in srgb, var(--fg-1) 4%, transparent);
}
.sk-app-cards{ display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:auto }
.sk-app-cards .sk-card{ padding:10px; gap:8px }

/* Compact tweaks for tighter stage at smaller hero widths */
@container (max-width: 520px){
  .sk-app-side{ width:100px; padding:10px 8px }
  .sk-bento{ grid-template-columns:1.2fr 1fr }
}

/* Scene 1 uses mini-chrome (.sd-frame) — no skeleton elements, no rules needed here */

/* shimmer — traverses every skeleton surface */
.sk-bar::after, .sk-circle::after, .sk-card::after{
  content:"";position:absolute;inset:0;
  background:linear-gradient(100deg,
    transparent 20%,
    color-mix(in srgb, var(--accent) 8%, transparent) 50%,
    transparent 80%);
  transform:translateX(-100%);
  animation:shimmer 2.4s var(--mk-ease) infinite;
}
.sk-card::after{animation-delay:.3s}
.sk-circle::after{animation-delay:.15s}
@keyframes shimmer{
  0%  {transform:translateX(-100%)}
  100%{transform:translateX(100%)}
}
/* B67 R35 (R67-124): the system asks for reduced motion → the skeletons hold still (the landing hero holds its scene, R67-119) */
@media (prefers-reduced-motion: reduce){.sk-bar::after,.sk-circle::after,.sk-card::after{animation:none;opacity:0}}
/* RTL: shimmer reads right→left, matching reading direction */
html[dir="rtl"] .sk-bar::after,
html[dir="rtl"] .sk-circle::after,
html[dir="rtl"] .sk-card::after{
  background:linear-gradient(-100deg,
    transparent 20%,
    color-mix(in srgb, var(--accent) 8%, transparent) 50%,
    transparent 80%);
  animation-direction:reverse;
}

/* ── Scene 4 · Chart ─────────────────────────────── */
.scene-4{ position:relative; gap:10px; justify-content:center }
.chart-hd{display:flex;align-items:flex-start;justify-content:space-between;gap:14px}
.chart-l{font-family:var(--mk-font-ui);font-size:11px;color:var(--fg-3);text-transform:none;letter-spacing:.1em;font-weight:600}
.chart-v{display:flex;align-items:baseline;gap:10px;margin-top:6px;font:800 38px/1 var(--mk-font-ui);color:var(--fg-1);letter-spacing:-.025em}
.chart-delta{font-size:12px;font-weight:600;color:var(--mk-success);background:color-mix(in srgb, var(--mk-success) 14%, transparent);padding:3px 8px;border-radius:6px}
.chart-tabs{display:inline-flex;background:var(--bg-3);border-radius:8px;padding:2px;gap:2px;font:600 11px var(--mk-font-ui);color:var(--fg-2)}
.chart-tabs span{padding:4px 8px;border-radius:6px;cursor:pointer}
.chart-tabs span.on{background:var(--bg-1);color:var(--accent);box-shadow:var(--shadow-xs)}

.chart-svg{width:100%;flex:1;min-height:240px;display:block}
.chart-grid line{stroke:var(--divider);stroke-width:1;stroke-dasharray:2 4}
.chart-area{fill:url(#chartFill)}
.chart-area-2{fill:url(#chartFill2)}
.chart-line{fill:none;stroke:var(--accent);stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round}
.chart-line-2{fill:none;stroke:var(--accent-2);stroke-width:2;stroke-linecap:round;stroke-linejoin:round;opacity:.75}
.chart-dot{fill:var(--accent);stroke:var(--bg-1);stroke-width:2;
  filter:drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 60%, transparent))}

.chart-legend{display:flex;gap:18px;font-size:11px;color:var(--fg-2);font-family:var(--mk-font-ui)}
.chart-legend span{display:inline-flex;align-items:center;gap:6px}
.chart-legend i{width:10px;height:2px;border-radius:2px;display:inline-block}

/* Resolving chip — floats over chart bottom-left */
.chart-resolving{
  position:absolute;
  inset-inline-start:4px;
  bottom:14px;
  display:inline-flex;align-items:center;gap:8px;
  padding:7px 12px;
  background:color-mix(in srgb, var(--bg-1) 80%, transparent);
  border:1px solid var(--border);
  border-radius:999px;
  box-shadow:var(--shadow-md);
  backdrop-filter:blur(6px);
  -webkit-backdrop-filter:blur(6px);
  z-index:6;
  pointer-events:none;
}
.chart-resolving .cr-dot{
  width:8px;height:8px;border-radius:999px;
  background:var(--mk-success);
  box-shadow:0 0 0 0 color-mix(in srgb, var(--mk-success) 60%, transparent);
  animation:pulse 2s var(--mk-ease) infinite;
}
.chart-resolving .cr-l{
  font-size:10px;letter-spacing:.14em;text-transform:none;font-weight:700;color:var(--fg-3);
}
.chart-resolving .cr-host{
  font-size:12px;font-weight:600;color:var(--fg-1);
}

/* ── Scene 2 · Marketplace product ───────────────── */
.mk-product{
  display:grid;grid-template-columns:minmax(0, 180px) 1fr;gap:16px;flex:1;min-height:0;
}
.mk-img{
  position:relative;border-radius:14px;overflow:hidden;
  background:linear-gradient(135deg, var(--mk-navy-800), var(--mk-navy-700));
  display:flex;align-items:center;justify-content:center;
}
.mk-img-grid{
  position:absolute;inset:0;opacity:.35;
  background:
    linear-gradient(color-mix(in srgb, var(--mk-blue-200) 20%, transparent) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, color-mix(in srgb, var(--mk-blue-200) 20%, transparent) 1px, transparent 1px) 0 0 / 24px 24px;
  mask-image:radial-gradient(120% 100% at 50% 100%, #000, transparent);
}
.mk-img-bean{
  width:96px;height:96px;border-radius:50%;
  background:radial-gradient(circle at 35% 35%, var(--mk-teal-300), var(--mk-blue-500) 70%);
  box-shadow:0 20px 40px rgba(0,0,0,.3), inset -12px -16px 30px rgba(0,0,0,.25);
  animation:float 4s var(--mk-ease) infinite;
}
@keyframes float{
  0%,100%{transform:translateY(-4px) rotate(-6deg)}
  50%{transform:translateY(4px) rotate(6deg)}
}
.mk-tag{
  position:absolute;top:10px;inset-inline-start:10px;
  font-size:10px;letter-spacing:.14em;text-transform:none;
  padding:3px 8px;border-radius:6px;
  background:rgba(255,255,255,.15);color:#fff;backdrop-filter:blur(8px);
}
.mk-info{display:flex;flex-direction:column;gap:8px;min-width:0}
.mk-crumb{font-size:11px;color:var(--fg-3);text-transform:lowercase;letter-spacing:.04em}
.mk-name{font:700 20px/1.2 var(--mk-font-ui);color:var(--fg-1);letter-spacing:-.01em}
.mk-ver{font-size:11px;color:var(--accent);font-weight:500;margin-inline-start:6px;vertical-align:middle}
.mk-desc{font-size:13px;color:var(--fg-2);line-height:1.5;margin:0}
.mk-meta{display:flex;flex-wrap:wrap;gap:8px;align-items:center;font-size:12px;color:var(--fg-2)}
.mk-meta .mi{font-size:14px;color:var(--mk-warning);vertical-align:-2px}
.mk-acts{display:flex;gap:8px;margin-top:auto}
.btn.ghost{background:transparent;border:1px solid var(--border);color:var(--fg-1)}
.btn.ghost:hover{border-color:var(--accent);color:var(--accent)}

/* ── Scene 3 · Dashboard (liquid glass) ──────────── */
.db{
  position:relative;display:flex;flex-direction:column;gap:12px;flex:1;min-height:0;
  isolation:isolate;
}
.db-hd{display:flex;align-items:center;justify-content:space-between}
.db-title{font:600 14px var(--mk-font-ui);color:var(--fg-1)}
.db-pill{
  padding:3px 10px;border-radius:999px;
  background:color-mix(in srgb, var(--mk-success) 14%, transparent);
  color:var(--mk-success);font-size:10px;letter-spacing:.14em;text-transform:none;font-weight:700;
  display:inline-flex;align-items:center;gap:6px;
}
.db-pill::before{content:"";width:6px;height:6px;border-radius:50%;background:var(--mk-success);box-shadow:0 0 6px var(--mk-success)}

.db-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.db-stat{
  padding:12px;border-radius:12px;background:var(--bg-3);
  display:flex;flex-direction:column;gap:2px;position:relative;
}
.db-l{font-size:10px;letter-spacing:.1em;text-transform:none;color:var(--fg-3);font-weight:600}
.db-v{font:700 22px/1.1 var(--mk-font-ui);color:var(--fg-1);letter-spacing:-.015em}
.db-v em{font-style:normal;font-size:12px;color:var(--fg-3);font-weight:500;margin-inline-start:2px}
.db-d{font-size:11px;font-weight:600;font-family:var(--mk-font-mono)}
.db-d.up{color:var(--mk-success)}
.db-d.down{color:var(--accent)}

.db-bars{display:flex;align-items:flex-end;gap:3px;height:48px}
.db-bars .b{flex:1;background:linear-gradient(to top, var(--accent), color-mix(in srgb, var(--accent) 30%, transparent));border-radius:3px 3px 0 0;min-height:4px;transition:height 600ms var(--mk-ease)}
.db-bars .b.warm{background:linear-gradient(to top, var(--accent-2), color-mix(in srgb, var(--accent-2) 30%, transparent))}

.db-list{display:flex;flex-direction:column;gap:4px}
.db-row{
  display:flex;align-items:center;gap:10px;
  padding:6px 10px;border-radius:8px;background:var(--bg-3);font-size:12px;color:var(--fg-1);
}
.db-dot{width:8px;height:8px;border-radius:50%;flex:none}
.db-dot.ok{background:var(--mk-success)}
.db-dot.warn{background:var(--mk-warning)}
.db-n{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.db-t{color:var(--fg-3);font-size:11px}

/* Liquid glass — travels across the dashboard */
.db-glass{
  position:absolute;inset:0;z-index:1;pointer-events:none;
  border-radius:inherit;overflow:hidden;
}
.db-glass::before{
  content:"";position:absolute;
  top:-10%;inset-inline-start:-30%;
  width:45%;height:120%;
  background:linear-gradient(100deg,
    transparent,
    color-mix(in srgb, var(--accent) 16%, transparent) 30%,
    color-mix(in srgb, #ffffff 28%, transparent) 50%,
    color-mix(in srgb, var(--accent-2) 18%, transparent) 70%,
    transparent);
  backdrop-filter:blur(6px) saturate(1.3);
  -webkit-backdrop-filter:blur(6px) saturate(1.3);
  border-radius:40%;
  filter:blur(6px);
  animation:glass-travel 6s var(--mk-ease) infinite;
  mix-blend-mode:plus-lighter;
}
[data-theme="light"] .db-glass::before{mix-blend-mode:multiply;opacity:.7}
@keyframes glass-travel{
  0%  {transform:translateX(-20%) rotate(-12deg);opacity:0}
  15% {opacity:1}
  50% {transform:translateX(220%) rotate(-12deg);opacity:1}
  60% {opacity:0}
  100%{transform:translateX(220%) rotate(-12deg);opacity:0}
}
[dir="rtl"] .db-glass::before{animation-direction:reverse}

/* ── Log overlay — subtle, always-present  ───────── */
.stage-log{
  position:absolute;left:0;right:0;bottom:34px;
  height:40%;
  pointer-events:none;
  z-index:0;
  opacity:.55;
  mask-image:linear-gradient(to top, #000 0%, #000 40%, transparent 100%);
  -webkit-mask-image:linear-gradient(to top, #000 0%, #000 40%, transparent 100%);
  overflow:hidden;
}
.stage-log-inner{
  font:500 11px/1.7 var(--mk-font-mono);
  padding:0 22px 6px;
  color:var(--fg-3);
  display:flex;flex-direction:column;justify-content:flex-end;min-height:100%;
}
.stage-log-inner .ln{
  display:flex;gap:10px;align-items:baseline;min-width:0;
  opacity:0;transform:translateY(4px);animation:ln-in 500ms var(--mk-ease) forwards;
}
@keyframes ln-in{to{opacity:.9;transform:none}}
.stage-log-inner .ln .t{color:var(--fg-3);min-width:46px;flex:none;font-size:10px;opacity:.7}
.stage-log-inner .ln .lvl{font-size:9px;font-weight:700;letter-spacing:.08em;text-transform:none;padding:1px 5px;border-radius:3px;flex:none}
.stage-log-inner .ln .lvl.ok{color:var(--mk-success)}
.stage-log-inner .ln .lvl.info{color:var(--accent)}
.stage-log-inner .ln .lvl.warn{color:var(--mk-warning)}
.stage-log-inner .ln .lvl.trc{color:var(--fg-3)}
.stage-log-inner .ln .m{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.stage-log-inner .ln .m .k{color:var(--fg-3)}
.stage-log-inner .ln .m .v{color:color-mix(in srgb, var(--accent) 80%, var(--fg-2))}

/* Foot */
.stage-foot{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:8px 14px;border-top:1px solid var(--divider);
  background:var(--bg-1);font-size:11px;color:var(--fg-3);
  z-index:2;
}
[data-theme="dark"] .stage-foot{background:var(--bg-2)}

/* Button helpers (scoped) */
.btn.sm{height:30px;padding:0 10px;font-size:12px;gap:6px}
.btn.sm .mi{font-size:14px}

/* ── Scene 1 · Style — mini app chrome with theme toggle ─── */
/* These scenes mock real OS chrome (macOS traffic lights on the left,
   browser-style address pill, etc). The chrome layout is directionally
   neutral, so we force LTR — even on Arabic pages — so traffic lights stay
   on the left and the Light/Dark pill stays on the right, matching what
   users recognize as a real desktop window. */
.scene-1{ direction:ltr }
.scene-3{ direction:ltr }

/* Hardcoded hex colors throughout — CSS custom-property values cannot be
   interpolated by the transition engine when the property definition changes */
.sd-frame{
  flex:1;display:flex;flex-direction:column;
  border-radius:12px;overflow:hidden;
  border:1px solid #DAE0E6;
  background:#FFFFFF;
  transition:background 700ms cubic-bezier(.4,0,.2,1), border-color 700ms cubic-bezier(.4,0,.2,1);
}
.sd-frame.dark{ background:#0B1520; border-color:#1E3044; }
.sd-topbar{
  display:flex;align-items:center;gap:10px;
  padding:8px 12px;
  border-bottom:1px solid #DAE0E6;
  background:#F5F7F9;
  transition:background 700ms cubic-bezier(.4,0,.2,1), border-color 700ms cubic-bezier(.4,0,.2,1);
}
.sd-frame.dark .sd-topbar{ background:#10202E; border-color:#1E3044; }
.sd-traffic{display:flex;gap:5px}
.sd-traffic i{width:9px;height:9px;border-radius:50%;display:block;background:#CDD5DE}
.sd-frame.dark .sd-traffic i{background:#2A3B4D}
.sd-pill{
  margin-inline-start:auto;
  font-size:9px;letter-spacing:.14em;text-transform:none;font-weight:700;
  padding:2px 7px;border-radius:999px;
  background:rgba(3,201,203,.14);
  color:#03C9CB;
  transition:background 700ms cubic-bezier(.4,0,.2,1), color 700ms cubic-bezier(.4,0,.2,1);
}
.sd-frame.dark .sd-pill{ background:rgba(93,228,229,.14); color:#5DE4E5; }
.sd-body{display:flex;flex:1;min-height:0;gap:0}
.sd-sidebar{
  width:40px;background:#E9EDF1;border-inline-end:1px solid #E9EDF1;flex-shrink:0;
  transition:background 700ms cubic-bezier(.4,0,.2,1), border-color 700ms cubic-bezier(.4,0,.2,1);
}
.sd-frame.dark .sd-sidebar{ background:#16293A; border-color:#162332; }
.sd-main{flex:1;padding:14px 12px;display:flex;flex-direction:column;gap:10px}
.sd-bar{
  height:10px;border-radius:5px;background:#E9EDF1;
  transition:background 700ms cubic-bezier(.4,0,.2,1);
}
.sd-frame.dark .sd-bar{ background:#16293A; }
.sd-bar.sm{height:7px}
.sd-bar.w40{width:40%}.sd-bar.w50{width:50%}.sd-bar.w60{width:60%}
.sd-bar.w70{width:70%}.sd-bar.w80{width:80%}.sd-bar.w90{width:90%}
.sd-bar.accent{ background:rgba(3,201,203,.22); }
.sd-frame.dark .sd-bar.accent{ background:rgba(93,228,229,.28); }
.sd-cards{display:grid;grid-template-columns:1fr 1fr 1fr;gap:7px;margin-top:4px}
.sd-card{
  padding:8px;border-radius:7px;background:#F5F7F9;border:1px solid #DAE0E6;
  display:flex;flex-direction:column;gap:6px;
  transition:background 700ms cubic-bezier(.4,0,.2,1), border-color 700ms cubic-bezier(.4,0,.2,1);
}
.sd-frame.dark .sd-card{ background:#10202E; border-color:#1E3044; }

/* ── Scene 2 · Clarity — icon (no circle) ── */
.cl-icon{
  width:40px;height:40px;flex-shrink:0;
  display:flex;align-items:center;justify-content:center;
}
.cl-icon img{width:40px;height:40px;display:block}
html[data-theme="light"] .cl-icon .icon-dark{display:none}
html[data-theme="dark"]  .cl-icon .icon-light{display:none}

/* ── cl-bar: translating text elements ── */
.cl-bar{
  background:transparent;
  font:500 13px/1.4 var(--mk-font-ui);
  color:var(--fg-1);
  position:relative;
  transition:opacity 350ms cubic-bezier(.4,0,.2,1),
             filter   350ms cubic-bezier(.4,0,.2,1),
             transform 350ms cubic-bezier(.4,0,.2,1);
}
.cl-bar::before{ content:attr(data-en); display:inline-block; transition:inherit; }
.scene-2[data-lang="es"] .cl-bar::before{ content:attr(data-es) }
.scene-2[data-lang="ar"] .cl-bar::before{ content:attr(data-ar) }
/* swap: brief blur+lift crossfade */
.scene-2.swap .cl-bar{ opacity:0; filter:blur(2px); transform:translateY(3px) }

/* ── Clarity card layout ── */
.cl-card{
  display:flex;flex-direction:column;
  background:var(--bg-1);
  border:1px solid var(--border);
  border-radius:14px;
  overflow:hidden;
  flex:1;
  min-height:0;
  box-shadow:var(--shadow-sm);
}
.cl-card-hd{
  display:flex;align-items:center;gap:12px;
  padding:14px 18px;
  border-bottom:1px solid var(--border);
  background:linear-gradient(180deg,
    color-mix(in srgb, var(--accent) 4%, transparent),
    transparent);
  flex-shrink:0;
}
.cl-title-block{ flex:1;min-width:0;display:flex;flex-direction:column;gap:2px; }
.cl-app-name{ font:700 14px var(--mk-font-ui); letter-spacing:-.005em; color:var(--fg-1) }
.cl-app-domain{ font:500 11px var(--mk-font-ui); color:var(--fg-3); letter-spacing:.01em }

/* Live status pill */
.cl-status{
  display:inline-flex;align-items:center;gap:6px;
  padding:4px 10px;
  border-radius:999px;
  background:color-mix(in srgb, var(--mk-success) 12%, transparent);
  font:600 10px var(--mk-font-ui);letter-spacing:.08em;text-transform:none;
  color:var(--mk-success);
  flex-shrink:0;
}
.cl-status-dot{
  width:6px;height:6px;border-radius:50%;
  background:var(--mk-success);
}

/* Issue list */
.cl-issue-list{
  flex:1;display:flex;flex-direction:column;overflow:hidden;
}
.cl-issue{
  display:flex;align-items:flex-start;gap:12px;
  padding:11px 18px;
  border-bottom:1px solid var(--border);
  flex-shrink:0;
}
.cl-issue:last-child{ border-bottom:none }
.cl-badge{
  font:700 10px var(--mk-font-ui);letter-spacing:.05em;
  padding:3px 9px;border-radius:6px;
  white-space:nowrap;margin-top:1px;flex-shrink:0;
}
/* Status colors */
.cl-issue.s-active   .cl-badge{ background:rgba(3,201,203,.14); color:var(--accent) }
.cl-issue.s-warning  .cl-badge{ background:rgba(245,158,11,.14); color:#f59e0b }
.cl-issue.s-resolved .cl-badge{ background:rgba(100,116,139,.1); color:var(--fg-3) }
.cl-issue-body{ flex:1;min-width:0;display:flex;flex-direction:column;gap:3px }
.cl-issue-title{ font:500 12px/1.45 var(--mk-font-ui);color:var(--fg-1) }
.cl-issue-meta{ font:500 11px var(--mk-font-ui);color:var(--fg-3) }
/* The clarity card direction follows the LANGUAGE BEING DEMONSTRATED, not the
   page direction. So when the page is in Arabic but the scene is showing the
   English/Spanish frame, the card stays LTR. When the scene flips to Arabic,
   the card flips to RTL — regardless of the page's html dir. */
.scene-2{ direction:ltr }
.scene-2[data-lang="ar"]{ direction:rtl }
.scene-2 .cl-issue-body,
.scene-2 .cl-card-ft{ text-align:start }
.scene-2 .cl-title-block{ align-items:flex-start }
/* Card footer */
.cl-card-ft{
  padding:10px 18px;
  border-top:1px solid var(--border);
  background:var(--bg-2);
  font:500 11px var(--mk-font-ui);
  color:var(--fg-3);
  flex-shrink:0;
}

/* ── Scene 3 · Scope — responsive layout demo ─────────────── */
/* Grid (header row + 1fr device-area cell) gives the device-chrome an explicit
   sizing context so width/height percentages animate smoothly between layouts.
   Using aspect-ratio swaps was causing instant jumps — explicit dims interpolate. */
.scope-wrap{
  display:grid;
  grid-template-rows:auto 1fr;
  gap:12px;
  width:100%;
  flex:1;min-height:0;
}
.scope-wrap .device-chrome{
  align-self:center;
  justify-self:center;
}
.scope-wrap[data-layout="desktop"]          .device-chrome{ width:100%; height:100% }
.scope-wrap[data-layout="tablet"]           .device-chrome{ width:78%;  height:82% }
.scope-wrap[data-layout="mobile-landscape"] .device-chrome{ width:88%;  height:42% }
.scope-wrap[data-layout="mobile-portrait"]  .device-chrome{ width:32%;  height:88% }
.scope-hd{display:flex;align-items:center;gap:12px}
.scope-label{
  font-family:var(--mk-font-ui);
  font-size:10px;font-weight:700;letter-spacing:.1em;text-transform:none;
  color:var(--accent-text);padding:3px 8px;border-radius:999px;
  background:color-mix(in srgb, var(--accent) 12%, transparent);
  transition:all 350ms cubic-bezier(.4,0,.2,1);
  white-space:nowrap;
}
.scope-ruler{
  flex:1;height:4px;border-radius:2px;
  background:var(--bg-3);overflow:hidden;
}
.scope-ruler-bar{
  height:100%;border-radius:2px;
  background:linear-gradient(90deg, var(--accent), var(--accent-2));
  transition:width 600ms cubic-bezier(.4,0,.2,1);
}

/* Skeleton restructures with the layout */
.scope-wrap .sk-head,
.scope-wrap .sk-grid,
.scope-wrap .sk-circle,
.scope-wrap .sk-card,
.scope-wrap .sk-bar{
  transition:
    grid-template-columns 500ms cubic-bezier(.4,0,.2,1),
    width 500ms cubic-bezier(.4,0,.2,1),
    height 500ms cubic-bezier(.4,0,.2,1),
    opacity 350ms cubic-bezier(.4,0,.2,1),
    flex-direction 0ms,
    gap 350ms cubic-bezier(.4,0,.2,1);
}
/* Tablet: tighter cards, slimmer avatar */
.scope-wrap[data-layout="tablet"] .sk-circle{ width:34px; height:34px }
.scope-wrap[data-layout="tablet"] .sk-grid{ gap:8px }
.scope-wrap[data-layout="tablet"] .sk-card{ padding:10px }
/* Mobile landscape: 2-col still, slightly tighter */
.scope-wrap[data-layout="mobile-landscape"] .sk-circle{ width:30px; height:30px }
.scope-wrap[data-layout="mobile-landscape"] .sk-grid{ grid-template-columns: 1fr 1fr; gap:8px }
.scope-wrap[data-layout="mobile-landscape"] .sk-card{ padding:9px }
/* Mobile portrait: avatar/header collapses, grid stacks to 1-col */
.scope-wrap[data-layout="mobile-portrait"] .sk-head{ flex-direction:column; align-items:flex-start; gap:8px }
.scope-wrap[data-layout="mobile-portrait"] .sk-circle{ width:28px; height:28px; opacity:.5 }
.scope-wrap[data-layout="mobile-portrait"] .sk-grid{ grid-template-columns: 1fr; gap:8px }
.scope-wrap[data-layout="mobile-portrait"] .sk-card{ padding:10px }

/* ── Device chrome — wraps skeleton content to show device aspect ── */
.device-chrome{
  border:2px solid var(--border-strong);
  border-radius:14px;
  overflow:hidden;
  display:flex;flex-direction:column;
  background:var(--bg-2);
  flex:1;min-height:0;
  transition:width     600ms cubic-bezier(.4,0,.2,1),
             height    600ms cubic-bezier(.4,0,.2,1),
             border-radius 500ms cubic-bezier(.4,0,.2,1),
             border-width  500ms cubic-bezier(.4,0,.2,1);
}
/* Device top-bar: simulates browser/OS status strip */
.device-bar{
  display:flex;align-items:center;gap:5px;
  padding:7px 10px;
  background:var(--bg-3);
  border-bottom:1px solid var(--border);
  flex-shrink:0;
}
.device-bar-dot{
  width:7px;height:7px;border-radius:50%;
  background:var(--border-strong);
  transition:background 500ms cubic-bezier(.4,0,.2,1);
}
.device-bar-spacer{ flex:1 }
.device-bar-pill{
  width:48px;height:6px;border-radius:3px;
  background:var(--border-strong);
  transition:width 500ms cubic-bezier(.4,0,.2,1);
}
.device-chrome-body{
  flex:1;display:flex;flex-direction:column;gap:10px;padding:12px;
  overflow:hidden;
}
/* Tablet: slightly rounder bezel, thicker border */
[data-layout="tablet"] .device-chrome{
  border-radius:20px;
  border-width:3px;
}
[data-layout="tablet"] .device-bar{ padding:6px 14px }
[data-layout="tablet"] .device-bar-dot{ width:6px;height:6px }
[data-layout="tablet"] .device-bar-pill{ display:none }
/* Mobile landscape: phone-like frame in landscape ratio (wider) */
[data-layout="mobile-landscape"] .device-chrome{
  border-radius:22px;
  border-width:3px;
}
[data-layout="mobile-landscape"] .device-bar{ padding:8px 14px }
[data-layout="mobile-landscape"] .device-bar-dot{ width:5px;height:5px }
[data-layout="mobile-landscape"] .device-bar-pill{ width:30px }
/* Mobile portrait: tall phone frame, home indicator */
[data-layout="mobile-portrait"] .device-chrome{
  border-radius:26px;
  border-width:3.5px;
}
[data-layout="mobile-portrait"] .device-bar{
  padding:10px 14px 6px;
  justify-content:center;
}
[data-layout="mobile-portrait"] .device-bar-dot{ display:none }
[data-layout="mobile-portrait"] .device-bar-pill{ width:36px }
[data-layout="mobile-portrait"] .device-bar-spacer{ display:none }
