/* Demo component (phones, projector, table card). See DESIGN.md sections 5 and 10.2.
   Everything here is scoped to .dm-* elements created by demo.js. The mount sizes the scene from its own width
   (container queries), so nothing depends on the page styles. Only opacity and transform animate. */

/* -------- themes -------- */

.dm-theme--ponoc {
  --dm-bg: #0b1430; --dm-surface: #111c3f; --dm-text: #f4ebdd; --dm-muted: #c9c2b4; --dm-accent: #d9a84e;
  --dm-accent-grad: linear-gradient(135deg, #f6db95 0%, #d9a84e 52%, #b8842f 100%); --dm-on-accent: #0b1430;
  --dm-radius: 18px; --dm-hi: #ebc978; --dm-line: rgba(255,255,255,.12); --dm-chip: rgba(255,255,255,.06);
  --dm-soft: rgba(217,168,78,.15);
  --dm-screen: radial-gradient(ellipse 90% 45% at 85% 0, #1a2752, #0000 70%), #0b1430;
  --dm-shade: rgba(2,4,12,.45); --dm-vig: rgba(2,4,12,.38); --dm-r: 1.125em; --dm-tile-r: .55em;
  --dm-gap: .3em; --dm-dock: rgba(11,20,48,.72); --dm-dock-r: 1.75em;
  --dm-dock-shadow: 0 .75em 2.5em rgba(0,0,0,.45); --dm-head: var(--font-display); --dm-head-style: normal;
  --dm-head-case: none; --dm-head-track: -.02em; --dm-head-size: 1.6em; --dm-name-font: var(--font-serif);
  --dm-name-style: italic; --dm-name-case: none; --dm-name-size: 4.9em; --dm-name-paint: var(--dm-accent-grad);
  --dm-hall: #08112c; --dm-hall-2: #02040c; --dm-ph-a: #060b1f; --dm-ph-m: #121d45; --dm-ph-b: #2d2550;
  --dm-l1: #f6db95; --dm-l2: #d9a84e; --dm-l3: #fff3dc;
}

.dm-theme--zora {
  --dm-bg: #fbf3ea; --dm-surface: #ffffff; --dm-text: #2b1d1a; --dm-muted: #7a6460; --dm-accent: #c8553d;
  --dm-accent-grad: linear-gradient(135deg, #f0a58f 0%, #c8553d 100%); --dm-on-accent: #fff8f1; --dm-radius: 24px;
  --dm-hi: #c8553d; --dm-line: rgba(43,29,26,.1); --dm-chip: #ffffff; --dm-soft: rgba(200,85,61,.1);
  --dm-screen: radial-gradient(ellipse 85% 40% at 100% 0, #fde0cf, #0000 70%), #fbf3ea;
  --dm-shade: rgba(122,64,46,.22); --dm-vig: rgba(59,34,51,.2); --dm-r: 1.5em; --dm-tile-r: .95em;
  --dm-gap: .42em; --dm-dock: rgba(255,255,255,.84); --dm-dock-r: 2.25em;
  --dm-dock-shadow: 0 .75em 2.2em rgba(122,64,46,.2); --dm-head: var(--font-serif); --dm-head-style: italic;
  --dm-head-case: none; --dm-head-track: 0; --dm-head-size: 2.05em; --dm-name-font: var(--font-serif);
  --dm-name-style: italic; --dm-name-case: none; --dm-name-size: 5.3em;
  --dm-name-paint: linear-gradient(var(--dm-accent), var(--dm-accent)); --dm-hall: #2c1825; --dm-hall-2: #12080e;
  --dm-ph-a: #c9a5d8; --dm-ph-m: #f4a6a0; --dm-ph-b: #ffd9b8; --dm-l1: #fff1cf; --dm-l2: #ffc98f; --dm-l3: #fffaf0;
}

.dm-theme--neon {
  --dm-bg: #0a0a12; --dm-surface: #15152a; --dm-text: #f5f5ff; --dm-muted: #a9a9c9; --dm-accent: #ff3d9a;
  --dm-accent-grad: linear-gradient(120deg, #ff3d9a 0%, #7c5cff 55%, #22d3ee 100%); --dm-on-accent: #0a0a12;
  --dm-radius: 10px; --dm-hi: #22d3ee; --dm-line: rgba(124,92,255,.34); --dm-chip: rgba(255,255,255,.04);
  --dm-soft: rgba(34,211,238,.1);
  --dm-screen: radial-gradient(ellipse 80% 38% at 0 0, rgba(124,92,255,.3), #0000 70%),
    radial-gradient(ellipse 80% 38% at 100% 100%, rgba(255,61,154,.22), #0000 70%), #0a0a12;
  --dm-shade: rgba(0,0,0,.6); --dm-vig: rgba(0,0,0,.45); --dm-r: .625em; --dm-tile-r: .25em;
  --dm-gap: .2em; --dm-dock: rgba(12,10,24,.92); --dm-dock-r: .9em;
  --dm-dock-shadow: 0 0 1.4em rgba(124,92,255,.4), 0 .75em 2em rgba(0,0,0,.6);
  --dm-head: var(--font-display); --dm-head-style: normal; --dm-head-case: uppercase; --dm-head-track: 0;
  --dm-head-size: 1.3em; --dm-head-weight: 900; --dm-name-font: var(--font-display); --dm-name-style: normal;
  --dm-name-case: uppercase; --dm-name-size: 4.1em; --dm-name-weight: 900; --dm-name-track: -.01em;
  --dm-name-paint: var(--dm-accent-grad); --dm-eyebrow-font: var(--font-display); --dm-btn-r: .45em;
  --dm-tab-r: .35em; --dm-hall: #0c0619; --dm-hall-2: #020205; --dm-ph-a: #0a0a12; --dm-ph-m: #1a0b2e;
  --dm-ph-b: #2c0c42; --dm-l1: #ff3d9a; --dm-l2: #7c5cff; --dm-l3: #22d3ee;
}

/* Wedding: ivory paper, olive and gold hairlines, an arched cover like printed stationery. */
.dm-theme--svila {
  --dm-bg: #f7f3ea; --dm-surface: #ffffff; --dm-text: #2a2f25; --dm-muted: #6f7466; --dm-accent: #7d8f5c;
  --dm-accent-grad: linear-gradient(135deg, #b9c79b 0%, #7d8f5c 100%); --dm-on-accent: #141a10; --dm-radius: 20px;
  --dm-gold: #c9a04e; --dm-gold-text: var(--gold-900); --dm-hi: #5d6b45; --dm-line: rgba(93,107,69,.16);
  --dm-chip: #ffffff; --dm-soft: rgba(125,143,92,.12);
  --dm-screen: radial-gradient(ellipse 90% 38% at 50% 0, #fffdf7, #0000 70%), #f7f3ea;
  --dm-shade: rgba(93,107,69,.22); --dm-vig: rgba(42,47,37,.16); --dm-r: 1.25em; --dm-tile-r: .3em;
  --dm-gap: .5em; --dm-dock: rgba(255,255,255,.9); --dm-dock-r: 2.25em;
  --dm-dock-shadow: 0 .75em 2.2em rgba(93,107,69,.18); --dm-head: var(--font-serif); --dm-head-style: italic;
  --dm-head-case: none; --dm-head-track: 0; --dm-head-size: 2em; --dm-name-font: var(--font-serif);
  --dm-name-style: italic; --dm-name-case: none; --dm-name-size: 4em; --dm-name-long: .72;
  --dm-name-paint: linear-gradient(#5d6b45, #5d6b45); --dm-hall: #1f2219; --dm-hall-2: #0a0b07;
  --dm-ph-a: #dfe3cd; --dm-ph-m: #efe8d6; --dm-ph-b: #f7eedd; --dm-l1: #fff6dc; --dm-l2: #e6cf96; --dm-l3: #ffffff;
}

/* -------- base -------- */

.dm-mount { position: relative; display: block; min-width: 0; container: dm-stage / inline-size; }

.dm-root {
  position: relative;
  font-family: var(--font-ui);
  font-weight: 500;
  line-height: 1.35;
  color: var(--dm-text);
  --dm-l1a: color-mix(in srgb, var(--dm-l1) 55%, #0000);
  --dm-l2a: color-mix(in srgb, var(--dm-l2) 55%, #0000);
  --dm-l3a: color-mix(in srgb, var(--dm-l3) 50%, #0000);
}

.dm-root *, .dm-root *::before, .dm-root *::after { box-sizing: border-box; }

.dm-ico {
  display: block;
  flex: none;
  width: 1.5em;
  height: 1.5em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dm-ico--fill { fill: currentColor; stroke: none; }

/* -------- photos on gradient placeholders -------- */

.dm-ph {
  position: relative;
  overflow: hidden;
  background-color: var(--dm-ph-m);
  background-image: var(--dm-art, none), linear-gradient(168deg, var(--dm-ph-a), var(--dm-ph-m) 55%, var(--dm-ph-b));
}

.dm-ph::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 45%, #0000 58%, var(--dm-vig));
  pointer-events: none;
}

.dm-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--dm-pos, 50% 50%);
  opacity: 0;
  transition: opacity .6s var(--ease);
}

.is-loaded > .dm-img { opacity: 1; }

/* Abstract party light per motif (balloons, candles, stage, sparkler, toast, confetti). */
.dm-ph--1 {
  --dm-art: radial-gradient(circle at 36% 40%, var(--dm-l1), var(--dm-l2a) 12%, #0000 26%),
    radial-gradient(circle at 64% 46%, var(--dm-l2), var(--dm-l2a) 13%, #0000 28%),
    radial-gradient(circle at 18% 14%, var(--dm-l3a), #0000 6%),
    radial-gradient(circle at 84% 20%, var(--dm-l1a), #0000 8%),
    radial-gradient(circle at 22% 82%, var(--dm-l3a), #0000 9%);
}
.dm-ph--2 {
  --dm-art: radial-gradient(ellipse 60% 38% at 50% 80%, var(--dm-l2a), #0000 70%),
    radial-gradient(circle at 40% 56%, var(--dm-l3), #0000 2.6%),
    radial-gradient(circle at 50% 52%, var(--dm-l3), #0000 2.6%),
    radial-gradient(circle at 60% 56%, var(--dm-l3), #0000 2.6%),
    radial-gradient(ellipse 34% 20% at 50% 56%, var(--dm-l1a), #0000 70%),
    radial-gradient(circle at 14% 24%, var(--dm-l1a), #0000 9%),
    radial-gradient(circle at 86% 30%, var(--dm-l2a), #0000 11%);
}
.dm-ph--3 {
  --dm-art: linear-gradient(to top, var(--dm-ph-a), #0000 26%),
    linear-gradient(104deg, #0000 22%, var(--dm-l1a) 32%, #0000 42%),
    linear-gradient(76deg, #0000 56%, var(--dm-l2a) 66%, #0000 76%),
    radial-gradient(ellipse 70% 30% at 50% 100%, var(--dm-l3a), #0000 70%),
    radial-gradient(circle at 30% 8%, var(--dm-l3), #0000 5%),
    radial-gradient(circle at 70% 8%, var(--dm-l3), #0000 5%);
}
.dm-ph--4 {
  --dm-art: radial-gradient(circle at 56% 38%, var(--dm-l3), var(--dm-l1) 2.5%, var(--dm-l2a) 9%, #0000 30%),
    radial-gradient(circle at 44% 30%, var(--dm-l3a), #0000 2%),
    radial-gradient(circle at 66% 48%, var(--dm-l3a), #0000 2%),
    radial-gradient(circle at 62% 26%, var(--dm-l1a), #0000 2.5%),
    radial-gradient(circle at 20% 76%, var(--dm-l2a), #0000 14%);
}
.dm-ph--5 {
  --dm-art: radial-gradient(circle at 22% 30%, var(--dm-l1a), #0000 12%),
    radial-gradient(circle at 48% 20%, var(--dm-l3a), #0000 8%),
    radial-gradient(circle at 76% 34%, var(--dm-l2a), #0000 14%),
    radial-gradient(circle at 62% 70%, var(--dm-l1a), #0000 10%),
    radial-gradient(ellipse 50% 36% at 46% 64%, var(--dm-l2a), #0000 70%);
}
.dm-ph--6 {
  --dm-art: radial-gradient(circle at 50% 30%, var(--dm-l3), var(--dm-l1a) 6%, #0000 22%),
    radial-gradient(circle at 18% 22%, var(--dm-l1), #0000 2%), radial-gradient(circle at 80% 16%, var(--dm-l3), #0000 2%),
    radial-gradient(circle at 30% 58%, var(--dm-l2), #0000 2%), radial-gradient(circle at 72% 54%, var(--dm-l1), #0000 2%),
    radial-gradient(circle at 86% 84%, var(--dm-l1a), #0000 10%);
}

/* -------- phone -------- */

.dm-phone {
  position: relative;
  flex: none;
  width: var(--dm-phone-w, 264px);
  aspect-ratio: 9 / 19.5;
  /* Everything inside is in em: 1em = 1/26 of the phone width (about 16 px of a real 390 px screen). */
  font-size: calc(var(--dm-phone-w, 264px) / 26);
  padding: .79em;
  border-radius: 3.94em;
  background: linear-gradient(145deg, #262d40, #05070f 22%, #05070f 78%, #1d2333);
  box-shadow:
    inset 0 0 0 .09em rgba(255,255,255,.24),
    inset 0 0 0 .32em #05070f,
    0 2.6em 5em -1em rgba(2,4,12,.7),
    0 .8em 1.8em rgba(2,4,12,.45);
}

/* Side button. */
.dm-phone::before {
  content: '';
  position: absolute;
  right: -.14em;
  top: 22%;
  width: .2em;
  height: 9%;
  border-radius: 0 .2em .2em 0;
  background: #1a2030;
}

.dm-phone__screen {
  position: relative;
  height: 100%;
  overflow: hidden;
  isolation: isolate;
  border-radius: 3.15em;
  background: var(--dm-screen);
  color: var(--dm-text);
}

.dm-scr { position: absolute; inset: 0; }

.dm-island {
  position: absolute;
  z-index: 6;
  top: .9em;
  left: 50%;
  width: 7.1em;
  height: 2em;
  margin-left: -3.55em;
  border-radius: 1em;
  background: #000;
}

.dm-status {
  position: absolute;
  z-index: 5;
  inset: 0 0 auto;
  height: 3.8em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .1em 2.2em 0 2.7em;
}

.dm-status__time { font-weight: 800; font-size: .92em; }
.dm-status__icons { display: flex; align-items: center; gap: .3em; }
.dm-status .dm-ico { width: 1.05em; height: 1.05em; stroke-width: 2.6; }

.dm-batt {
  width: 1.75em;
  height: .88em;
  padding: .1em;
  border: .09em solid currentColor;
  border-radius: .28em;
  background: linear-gradient(90deg, currentColor 72%, #0000 72%) content-box;
}

/* -------- dock (as on the real portal: glass pill, raised accent button) -------- */

.dm-dock {
  position: absolute;
  z-index: 4;
  left: .8em;
  right: .8em;
  bottom: 1em;
  height: 4.5em;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 .5em;
  border: 1px solid var(--dm-line);
  border-radius: var(--dm-dock-r);
  background: var(--dm-dock);
  box-shadow: var(--dm-dock-shadow);
  -webkit-backdrop-filter: blur(1.25em) saturate(140%);
  backdrop-filter: blur(1.25em) saturate(140%);
}

.dm-dock__item { display: flex; flex-direction: column; align-items: center; gap: .25em; color: var(--dm-muted); }

.dm-dock__item::after {
  content: '';
  width: 1.125em;
  height: .25em;
  border-radius: 1em;
  background: var(--dm-accent-grad);
  opacity: 0;
}

.dm-dock__item.is-active { color: var(--dm-hi); }
.dm-dock__item.is-active::after { opacity: 1; box-shadow: 0 0 .6em var(--dm-accent); }
.dm-dock__label { font-size: .75em; font-weight: 800; line-height: 1.25; letter-spacing: .02em; }
.dm-dock__item--add { min-width: 5.25em; color: var(--dm-text); }
.dm-dock__item--add::after { display: none; }

.dm-dock__btn {
  display: grid;
  place-items: center;
  width: 4em;
  height: 4em;
  margin-top: -2.5em;
  border-radius: 50%;
  background: var(--dm-accent-grad);
  color: var(--dm-on-accent);
  box-shadow:
    0 .6em 1.6em color-mix(in srgb, var(--dm-accent) 40%, #0000),
    0 0 0 .32em color-mix(in srgb, var(--dm-bg) 60%, #0000);
}

.dm-dock__item--add .dm-dock__label { margin-bottom: .65em; }
.dm-dock__btn .dm-ico { width: 1.75em; height: 1.75em; stroke-width: 2; }

/* -------- screen: naslovna -------- */

.dm-cover__bg, .dm-cover__shade { position: absolute; inset: 0; }

.dm-cover__shade {
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--dm-bg) 62%, #0000) 0,
    #0000 22%,
    #0000 36%,
    color-mix(in srgb, var(--dm-bg) 82%, #0000) 62%,
    var(--dm-bg) 84%
  );
}

.dm-cover__top { position: absolute; top: 4.8em; inset-inline: 0; text-align: center; }

.dm-eyebrow {
  padding-left: .34em;
  font-family: var(--dm-eyebrow-font, var(--font-ui));
  font-weight: 800;
  font-size: .7em;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--dm-hi);
}

.dm-orn {
  width: 3.4em;
  height: 1px;
  margin: .8em auto 0;
  background: linear-gradient(90deg, #0000, var(--dm-accent), #0000);
}

.dm-cover__body {
  position: absolute;
  inset-inline: 1.4em;
  bottom: 8.6em;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.dm-name,
.dm-screen__tag {
  font-family: var(--dm-name-font);
  font-style: var(--dm-name-style);
  font-weight: var(--dm-name-weight, 800);
  letter-spacing: var(--dm-name-track, 0);
  text-transform: var(--dm-name-case);
  line-height: 1;
  background: var(--dm-name-paint);
  -webkit-background-clip: text;
  background-clip: text;
  color: #0000;
}

.dm-name { padding: .06em .14em .1em; font-size: var(--dm-name-size); text-wrap: balance; }
.dm-name--long { font-size: calc(var(--dm-name-size) * var(--dm-name-long, .64)); }

.dm-date {
  margin-top: .55em;
  font-weight: 800;
  font-size: .8em;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--dm-muted);
}

.dm-btn {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  height: 3.1em;
  margin-top: 1.5em;
  padding: 0 1.3em 0 1.6em;
  border-radius: var(--dm-btn-r, 2em);
  background: var(--dm-accent-grad);
  color: var(--dm-on-accent);
  font-weight: 800;
  font-size: .9em;
  box-shadow: 0 .7em 1.8em color-mix(in srgb, var(--dm-accent) 38%, #0000);
}

.dm-btn .dm-ico { width: 1.2em; height: 1.2em; stroke-width: 2.2; }

/* -------- screen: prica -------- */

.dm-story { padding: 4.1em 1.4em 0; }
.dm-progress { display: flex; gap: .3em; }

.dm-progress > div {
  flex: 1;
  height: .2em;
  border-radius: 1em;
  background: color-mix(in srgb, var(--dm-text) 18%, #0000);
}

.dm-progress > .is-done { background: var(--dm-accent); }

.dm-progress > .is-now {
  background: linear-gradient(90deg, var(--dm-accent) 55%, color-mix(in srgb, var(--dm-text) 18%, #0000) 55%);
}

.dm-story__head { margin-top: 1.9em; }

.dm-year {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: .78em;
  letter-spacing: .3em;
  color: var(--dm-hi);
}

.dm-title {
  margin-top: .35em;
  font-family: var(--dm-head);
  font-style: var(--dm-head-style);
  font-weight: var(--dm-head-weight, 800);
  font-size: var(--dm-head-size);
  line-height: 1.08;
  letter-spacing: var(--dm-head-track);
  text-transform: var(--dm-head-case);
  text-wrap: balance;
}

.dm-story__fig { margin-top: 1.1em; }
.dm-story__img { aspect-ratio: 1; border-radius: var(--dm-r); box-shadow: 0 1em 2.4em var(--dm-shade); }
.dm-caption { margin-top: .8em; font-size: .85em; color: var(--dm-muted); }
.dm-story__more { margin-top: 1.8em; }

.dm-label {
  font-weight: 800;
  font-size: .66em;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--dm-muted);
}

.dm-faces { display: flex; align-items: flex-end; justify-content: space-between; margin-top: .9em; }

.dm-face {
  --dm-d: calc(2.1em + var(--dm-i, 1) * .42em);
  --dm-sil: color-mix(in srgb, var(--dm-accent) 42%, var(--dm-surface));
  position: relative;
  width: var(--dm-d);
  height: var(--dm-d);
  overflow: hidden;
  border: 1px solid var(--dm-line);
  border-radius: 50%;
  background: color-mix(in srgb, var(--dm-accent) 10%, var(--dm-surface));
}

.dm-face::before, .dm-face::after { content: ''; position: absolute; background: var(--dm-sil); }
.dm-face::before { left: 33%; right: 33%; top: 19%; aspect-ratio: .86; border-radius: 50%; }
.dm-face::after { left: 14%; right: 14%; bottom: -20%; height: 44%; border-radius: 50% 50% 0 0; }

.dm-face .dm-img { z-index: 1; }

.dm-face.is-now {
  border: .14em solid var(--dm-accent);
  box-shadow: 0 0 1em color-mix(in srgb, var(--dm-accent) 45%, #0000);
}

.dm-timeline {
  position: relative;
  height: 1px;
  margin-top: .9em;
  background: linear-gradient(90deg, #0000, var(--dm-line) 12%, var(--dm-accent));
}

.dm-timeline__dot {
  position: absolute;
  top: -.3em;
  right: 1.8em;
  width: .6em;
  height: .6em;
  border-radius: 50%;
  background: var(--dm-accent);
  box-shadow: 0 0 .7em var(--dm-accent);
}

/* Our story (sv): three points on a line, the last one now. */
.dm-steps { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 1.1em; }

.dm-steps::before {
  content: '';
  position: absolute;
  top: .3em;
  left: 16.7%;
  right: 16.7%;
  height: 1px;
  background: linear-gradient(90deg, var(--dm-line), var(--dm-accent));
}

.dm-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: .4em; text-align: center; }

.dm-step__dot {
  width: .6em;
  height: .6em;
  border: .12em solid var(--dm-accent);
  border-radius: 50%;
  background: var(--dm-surface);
}

.dm-step.is-now .dm-step__dot {
  background: var(--dm-accent);
  box-shadow: 0 0 .7em var(--dm-accent);
  transform: scale(1.35);
}

.dm-step__year { font-family: var(--font-display); font-weight: 800; font-size: .78em; letter-spacing: .12em; color: var(--dm-hi); }
.dm-step__text { font-weight: 800; font-size: .7em; color: var(--dm-muted); }
.dm-step.is-now .dm-step__text { color: var(--dm-text); }

/* -------- screen: galerija -------- */

.dm-gallery__head { padding: 4.2em 1.25em 1em; }
.dm-gallery .dm-title { margin: 0; }
.dm-tabs { display: flex; gap: .4em; margin-top: .9em; }

.dm-tab {
  display: inline-flex;
  align-items: center;
  height: 2.6em;
  padding: 0 1.15em;
  border: 1px solid var(--dm-line);
  border-radius: var(--dm-tab-r, 2em);
  background: var(--dm-chip);
  font-weight: 800;
  font-size: .74em;
  color: var(--dm-muted);
}

.dm-tab.is-active {
  border-color: color-mix(in srgb, var(--dm-accent) 60%, #0000);
  background: var(--dm-soft);
  color: var(--dm-hi);
}

.dm-gallery__body { position: relative; padding: 0 .9em; }
.dm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--dm-gap); }
.dm-tile { aspect-ratio: 1; border-radius: var(--dm-tile-r); }

.dm-badge {
  position: absolute;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: .3em;
  height: 1.9em;
  padding: 0 .55em;
  border-radius: 1em;
  background: rgba(5,7,15,.6);
  color: #fff;
  font-weight: 800;
  font-size: .62em;
}

.dm-badge .dm-ico { width: 1.1em; height: 1.1em; }
.dm-badge--heart { left: .5em; bottom: .5em; }
.dm-badge--heart .dm-ico { color: var(--heart, #ff5d7a); }
.dm-badge--video { top: .5em; right: .5em; }

.dm-pill {
  position: absolute;
  z-index: 3;
  top: 1em;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: .35em;
  width: max-content;
  height: 2.7em;
  margin: auto;
  padding: 0 1.1em 0 .85em;
  border-radius: var(--dm-btn-r, 2em);
  background: var(--dm-accent-grad);
  color: var(--dm-on-accent);
  font-weight: 800;
  font-size: .75em;
  box-shadow: 0 .6em 1.6em rgba(0,0,0,.4);
}

.dm-pill .dm-ico { width: 1.2em; height: 1.2em; stroke-width: 2.4; }

/* -------- upload card -------- */

.dm-upload {
  display: flex;
  align-items: center;
  gap: .85em;
  padding: .85em 1.2em .85em .85em;
  font-size: calc(var(--dm-phone-w, 264px) / 26);
  border: 1px solid var(--dm-line);
  border-radius: 1.4em;
  background: color-mix(in srgb, var(--dm-surface) 84%, #0000);
  box-shadow: 0 1.4em 3em rgba(2,4,12,.55);
  -webkit-backdrop-filter: blur(1.2em);
  backdrop-filter: blur(1.2em);
}

.dm-upload__thumbs { display: flex; flex: none; }
.dm-upload__thumb { width: 2.7em; height: 2.7em; border: .16em solid var(--dm-surface); border-radius: .75em; }
.dm-upload__thumb + .dm-upload__thumb { margin-left: -1.2em; }
.dm-upload__body { min-width: 9.5em; }
.dm-upload__text { font-weight: 800; font-size: 1.02em; white-space: nowrap; }

.dm-upload__bar {
  height: .42em;
  margin-top: .55em;
  overflow: hidden;
  border-radius: 1em;
  background: rgba(255,255,255,.1);
}

.dm-upload__fill {
  position: relative;
  width: 75%;
  height: 100%;
  overflow: hidden;
  border-radius: 1em;
  background: var(--dm-accent-grad);
}

.dm-upload__fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #0000, rgba(255,255,255,.55), #0000);
  transform: translateX(-100%);
  animation: dm-sheen 2.2s var(--ease) infinite paused;
}

/* -------- QR table card -------- */

.dm-qr {
  padding: 1.05em 1.05em 1.15em;
  font-size: clamp(6px, 2.4cqi, 12px);
  text-align: center;
  color: #0b1430;
  border-radius: 1.15em;
  background: linear-gradient(165deg, #fffaf0, #f2e7d2);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.7), 0 1.8em 3.2em rgba(2,4,12,.6), 0 .3em .6em rgba(2,4,12,.3);
}

.dm-qr__text {
  margin-bottom: .85em;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1em;
  line-height: 1.2;
  letter-spacing: -.01em;
  text-wrap: balance;
}

.dm-code {
  position: relative;
  container-type: inline-size;
  padding: 7%;
  border-radius: 8%;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(11,20,48,.08);
}

.dm-code svg { display: block; width: 100%; height: auto; fill: #0b1430; }

.dm-code__mark {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 21%;
  aspect-ratio: 1;
  border-radius: 24%;
  background: var(--gold-grad);
  color: #0b1430;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 9cqi;
  line-height: 1;
  transform: translate(-50%, -50%);
}

/* The photographed card on the table (hero); the drawn .dm-qr above is its fallback. */
.dm-card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: clamp(8px, 2.2cqi, 16px);
  background: radial-gradient(ellipse 70% 60% at 50% 42%, #f3ead8, #0000 70%), linear-gradient(170deg, #2a3150, #0d142c);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.16),
    0 2.6cqi 5.5cqi rgba(2,4,12,.55),
    0 .6cqi 1.2cqi rgba(2,4,12,.3);
}

.dm-card .dm-img { z-index: 1; }

/* -------- projector -------- */

.dm-platno {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 16 / 11;
  container-type: inline-size;
  border-radius: var(--radius-l, 28px);
  background:
    radial-gradient(ellipse 70% 55% at 50% 32%, color-mix(in srgb, var(--dm-accent) 16%, #0000), #0000 70%),
    linear-gradient(to bottom, var(--dm-hall), var(--dm-hall-2));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07);
}

.dm-screen {
  position: absolute;
  z-index: 1;
  top: 9%;
  left: 17%;
  width: 66%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  container-type: inline-size;
  border-radius: clamp(4px, 1.3cqi, 10px);
  background: #000;
  box-shadow:
    0 0 0 1px rgba(255,255,255,.1),
    0 0 6cqi color-mix(in srgb, var(--dm-accent) 30%, #0000),
    0 3cqi 6cqi rgba(0,0,0,.55);
}

.dm-screen__slides, .dm-slide, .dm-screen__shade { position: absolute; inset: 0; }
.dm-slide { opacity: 0; transition: opacity 1.2s var(--ease), transform 0s linear 1.2s; }
.dm-slide.is-active { opacity: 1; transition: opacity 1.2s var(--ease), transform 5.2s linear; }
.is-live .dm-slide.is-active { transform: scale(1.07); }
.dm-screen__shade { background: linear-gradient(to bottom, rgba(0,0,0,.45), #0000 26%, #0000 58%, rgba(0,0,0,.75)); }
.dm-screen__tag { position: absolute; top: 4cqi; left: 4.5cqi; padding: .1em .12em .14em; font-size: 5.4cqi; }

.dm-live {
  position: absolute;
  top: 4cqi;
  right: 4.5cqi;
  display: flex;
  align-items: center;
  gap: 1.3cqi;
  height: 5.4cqi;
  padding: 0 2.2cqi;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 3cqi;
  background: rgba(0,0,0,.45);
  color: #fff;
  font-weight: 800;
  font-size: 2.5cqi;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.dm-live__dot {
  width: 1.6cqi;
  height: 1.6cqi;
  border-radius: 50%;
  background: #ff4d6d;
  box-shadow: 0 0 1.4cqi #ff4d6d;
  animation: dm-pulse 1.6s ease-in-out infinite paused;
}

.dm-screen__band {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  align-items: center;
  gap: 2.6cqi;
  padding: 2.6cqi 4.5cqi 3.4cqi;
}

.dm-screen__band .dm-code { flex: none; width: 9cqi; padding: .7cqi; border-radius: 1cqi; }

.dm-screen__cta {
  max-width: 62cqi;
  font-weight: 800;
  font-size: 3.1cqi;
  line-height: 1.25;
  color: #fff;
  text-wrap: balance;
}

.dm-beam {
  position: absolute;
  z-index: 2;
  /* Light from a projector behind the audience: widest at the screen, invisible on it. */
  top: 9%;
  left: 17%;
  width: 66%;
  height: 88%;
  background: linear-gradient(to bottom, #0000 40%, color-mix(in srgb, var(--dm-l3) 12%, #0000) 70%, color-mix(in srgb, var(--dm-l3) 16%, #0000));
  clip-path: polygon(0 0, 100% 0, 53% 100%, 47% 100%);
  filter: blur(.8cqi);
  mix-blend-mode: screen;
  pointer-events: none;
}

.dm-floor {
  position: absolute;
  top: 60%;
  left: 0;
  right: 0;
  height: 40%;
  background: radial-gradient(ellipse 48% 75% at 50% 8%, color-mix(in srgb, var(--dm-accent) 26%, #0000), #0000 72%);
}

.dm-crowd { position: absolute; z-index: 3; inset: auto 0 0; height: 30%; }

.dm-crowd__row {
  position: absolute;
  inset: auto -3% 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.dm-crowd__row--back { --dm-hw: 6.4cqi; --dm-tone: #0b1022; bottom: 26%; }
.dm-crowd__row--front { --dm-hw: 10cqi; --dm-tone: #02030a; bottom: -14%; }

.dm-head {
  position: relative;
  flex: none;
  width: calc(var(--dm-hw) * var(--dm-s, 1));
  height: calc(var(--dm-hw) * var(--dm-s, 1) * 1.1);
  transform: translateY(var(--dm-y, 0));
}

.dm-head::before, .dm-head::after { content: ''; position: absolute; }

.dm-head::before {
  top: 0;
  left: 27%;
  width: 46%;
  height: 48%;
  border-radius: 50%;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--dm-accent) 30%, var(--dm-tone)), var(--dm-tone) 22%);
}

.dm-head::after {
  bottom: 0;
  left: 0;
  right: 0;
  height: 58%;
  border-radius: 48% 48% 0 0 / 62% 62% 0 0;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--dm-accent) 20%, var(--dm-tone)), var(--dm-tone) 18%);
}

/* Screen only (hero): no hall around it. */
.dm-platno--bare { overflow: visible; aspect-ratio: 16 / 9; border-radius: 0; background: none; box-shadow: none; }

.dm-platno--bare .dm-screen {
  inset: 0;
  width: 100%;
  border-radius: clamp(5px, 2.2cqi, 12px);
  box-shadow:
    0 0 0 .35cqi #05070f,
    0 0 0 .6cqi rgba(255,255,255,.14),
    0 0 9cqi color-mix(in srgb, var(--dm-accent) 34%, #0000),
    0 5cqi 10cqi rgba(0,0,0,.55);
}

/* The hero phone covers the left of the screen: keep the invitation readable on the right. */
.dm-platno--bare .dm-screen__band { flex-direction: row-reverse; text-align: right; }

/* -------- composition: hero -------- */

.dm-hero { --dm-phone-w: min(48cqi, 262px); max-width: 560px; margin-inline: auto; aspect-ratio: 4 / 5; }
.dm-piece { position: absolute; }
.dm-tilt { transform: rotate(var(--dm-rot, 0deg)); }
.dm-hero__platno { --dm-rot: -4deg; z-index: 1; top: 4%; right: 2%; width: 63%; }
.dm-hero__phone { --dm-rot: 3deg; z-index: 2; top: 12%; left: 6%; }
.dm-hero__upload { --dm-rot: -2deg; z-index: 3; top: 52%; left: 42%; }
.dm-hero__qr { --dm-rot: -5deg; z-index: 3; right: 1%; bottom: 4%; width: 46%; }
.dm-hero__qr--drawn { --dm-rot: -6deg; right: 4%; bottom: 3%; width: 28%; }

/* -------- composition: stilovi -------- */

.dm-mount--stilovi { isolation: isolate; }
.dm-glow, .dm-glow__layer { position: absolute; inset: 0; pointer-events: none; }
.dm-glow { z-index: -1; }
.dm-glow__layer { opacity: 0; transition: opacity .6s var(--ease); }
.dm-glow__layer--ponoc { background: radial-gradient(ellipse 50% 40% at 50% 34%, rgba(217,168,78,.35), #0000 72%); }
.dm-glow__layer--zora { background: radial-gradient(ellipse 50% 40% at 50% 34%, rgba(240,165,143,.4), #0000 72%); }
.dm-glow__layer--neon { background: radial-gradient(ellipse 50% 40% at 50% 34%, rgba(124,92,255,.45), #0000 72%); }
.dm-glow__layer--svila { background: radial-gradient(ellipse 50% 40% at 50% 34%, rgba(185,199,155,.35), #0000 72%); }

/* demo.js sets data-active-theme on section#stilovi; the page may use --dm-section-glow. */
[data-active-theme='ponoc'] { --dm-section-glow: rgba(217,168,78,.35); }
[data-active-theme='zora'] { --dm-section-glow: rgba(240,165,143,.4); }
[data-active-theme='neon'] { --dm-section-glow: rgba(124,92,255,.45); }
[data-active-theme='svila'] { --dm-section-glow: rgba(185,199,155,.35); }

[data-active-theme='ponoc'] .dm-glow__layer--ponoc,
[data-active-theme='zora'] .dm-glow__layer--zora,
[data-active-theme='neon'] .dm-glow__layer--neon,
[data-active-theme='svila'] .dm-glow__layer--svila {
  opacity: 1;
}

/* Theme or set swap: a short cross-fade between the old and the new scene. */
.dm-swap { transition: opacity .18s var(--ease); }
.dm-swap.is-leaving, .dm-swap.is-entering { opacity: 0; }

.dm-styles { --dm-phone-w: min(60cqi, 252px); }

/* Narrow: horizontal strip with snapping, the middle phone centred and its neighbours peeking in. */
.dm-rail {
  display: flex;
  gap: 5cqi;
  padding: 20px calc((100cqi - var(--dm-phone-w)) / 2) 56px;
  overflow-x: auto;
  /* Soft edges instead of a hard clip of the neighbours and their shadows. */
  mask-image: linear-gradient(90deg, #0000, #000 7%, #000 93%, #0000);
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.dm-rail::-webkit-scrollbar { display: none; }
.dm-slot { flex: none; scroll-snap-align: center; }
.dm-styles__platno { margin-top: 4px; }

@container dm-stage (min-width: 720px) {
  .dm-styles { --dm-phone-w: min(22cqi, 236px); }
  .dm-rail { justify-content: center; gap: 0; padding: 28px 0 48px; overflow: visible; mask-image: none; }
  .dm-slot--main { --dm-phone-w: min(25.5cqi, 270px); z-index: 2; }
  .dm-slot--l { margin-right: -2.5cqi; transform: translateY(7%) rotate(-5deg); }
  .dm-slot--r { margin-left: -2.5cqi; transform: translateY(7%) rotate(5deg); }
  .dm-styles__platno { width: min(54cqi, 560px); margin: 0 auto; }
}

/* -------- composition: prilike -------- */

/* Narrow: the phone, then the photo below it, overlapping the dock. */
.dm-prilike {
  --dm-phone-w: min(54cqi, 250px);
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 680px;
  margin-inline: auto;
  padding: 12px 0 20px;
}

.dm-prilike__phone { position: relative; z-index: 1; transform: translateX(-8cqi) rotate(-2deg); }

/* Offsets follow the phone, so the photo covers the dock and never the cover text. */
.dm-prilike__photo {
  position: relative;
  z-index: 2;
  width: min(80cqi, 420px);
  margin-top: calc(var(--dm-phone-w) * -.3);
  transform: translateX(6cqi) rotate(2.5deg);
}

.dm-frame {
  padding: clamp(6px, 1.6cqi, 11px);
  border-radius: clamp(16px, 4.2cqi, 28px);
  background: var(--dm-surface);
  box-shadow: 0 0 0 1px var(--dm-line), 0 3cqi 7cqi rgba(2,4,12,.32), 0 .6cqi 1.4cqi rgba(2,4,12,.18);
}

.dm-frame__img { aspect-ratio: 3 / 2; border-radius: clamp(11px, 2.9cqi, 20px); }

@container dm-stage (min-width: 560px) {
  .dm-prilike {
    --dm-phone-w: min(36cqi, 252px);
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    padding: 16px 0 32px;
  }

  .dm-prilike__phone { transform: rotate(-3deg); }

  .dm-prilike__photo {
    width: min(58cqi, calc(var(--dm-phone-w) * 1.6));
    margin: calc(var(--dm-phone-w) * .72) 0 0 calc(var(--dm-phone-w) * -.12);
    transform: rotate(3deg);
  }
}

/* -------- theme character -------- */

.dm-theme--zora .dm-dock__btn { box-shadow: 0 .6em 1.6em rgba(200,85,61,.35), 0 0 0 .32em rgba(255,255,255,.75); }
.dm-theme--zora .dm-screen__tag { --dm-name-paint: linear-gradient(#fff6ee, #ffd9c7); }
.dm-theme--zora .dm-upload__bar { background: rgba(43,29,26,.08); }

.dm-theme--neon .dm-dock {
  border-color: #0000;
  background: linear-gradient(var(--dm-dock), var(--dm-dock)) padding-box, var(--dm-accent-grad) border-box;
}

.dm-theme--neon .dm-name { filter: drop-shadow(0 0 .22em rgba(255,61,154,.55)); }

.dm-theme--neon .dm-btn,
.dm-theme--neon .dm-pill,
.dm-theme--neon .dm-dock__btn {
  box-shadow: 0 0 1.4em rgba(255,61,154,.55), 0 0 0 .32em rgba(10,10,18,.7);
}

.dm-theme--neon .dm-tab.is-active { border-color: #22d3ee; box-shadow: 0 0 .9em rgba(34,211,238,.35); }
.dm-theme--neon .dm-tile, .dm-theme--neon .dm-story__img { box-shadow: inset 0 0 0 1px rgba(124,92,255,.35); }
.dm-theme--neon .dm-face.is-now { border-color: #22d3ee; box-shadow: 0 0 1em rgba(34,211,238,.5); }

/* svila: arched cover photo with a white mat and a gold hairline, a gold frame line inside the screen. */
.dm-theme--svila .dm-phone__screen::after {
  content: '';
  position: absolute;
  z-index: 3;
  inset: .5em;
  border: 1px solid color-mix(in srgb, var(--dm-gold) 55%, #0000);
  border-radius: 2.7em;
  pointer-events: none;
}

.dm-theme--svila .dm-cover__bg {
  inset: 5em 2em 22.4em;
  border-radius: 11em 11em 1.1em 1.1em;
  box-shadow: 0 0 0 .3em #fff, 0 0 0 .38em var(--dm-gold), 0 1.4em 2.6em var(--dm-shade);
}

.dm-theme--svila .dm-cover__shade { display: none; }
.dm-theme--svila .dm-cover__top { top: 33.4em; }
.dm-theme--svila .dm-eyebrow, .dm-theme--svila .dm-year, .dm-theme--svila .dm-step__year { color: var(--dm-gold-text); }

.dm-theme--svila .dm-orn {
  position: relative;
  width: 6em;
  margin-top: .7em;
  background: linear-gradient(90deg, #0000, var(--dm-gold) 42%, #0000 42% 58%, var(--dm-gold) 58%, #0000);
}

.dm-theme--svila .dm-orn::after {
  content: '';
  position: absolute;
  top: -.17em;
  left: 50%;
  width: .36em;
  height: .36em;
  margin-left: -.18em;
  background: var(--dm-gold);
  transform: rotate(45deg);
}

.dm-theme--svila .dm-cover__body { bottom: 8.2em; }
.dm-theme--svila .dm-date { color: var(--dm-muted); }
.dm-theme--svila .dm-story__img { border-radius: 9em 9em var(--dm-r) var(--dm-r); }
.dm-theme--svila .dm-tile { box-shadow: 0 0 0 .14em #fff, 0 .35em .8em rgba(93,107,69,.2); }
.dm-theme--svila .dm-dock { border-color: color-mix(in srgb, var(--dm-gold) 45%, #0000); }
.dm-theme--svila .dm-dock__btn { box-shadow: 0 .6em 1.6em rgba(93,107,69,.3), 0 0 0 .32em #fff, 0 0 0 .4em color-mix(in srgb, var(--dm-gold) 60%, #0000); }
.dm-theme--svila .dm-tab.is-active { border-color: var(--dm-gold); }
.dm-theme--svila .dm-screen__tag { --dm-name-paint: linear-gradient(#fffaf0, #e9d29a); }
.dm-theme--svila .dm-screen { --dm-ph-a: #2c3122; --dm-ph-m: #5d6b45; --dm-ph-b: #b49a62; }
.dm-theme--svila .dm-upload__bar { background: rgba(42,47,37,.08); }
.dm-theme--svila .dm-frame { box-shadow: 0 0 0 1px color-mix(in srgb, var(--dm-gold) 60%, #0000), 0 3cqi 7cqi rgba(42,47,37,.22); }
.dm-theme--svila .dm-face.is-now { border-color: var(--dm-gold); box-shadow: 0 0 1em rgba(201,160,78,.45); }

/* -------- motion (only while in view; never under reduced motion) -------- */

.dm-float { animation: dm-float 7s ease-in-out infinite paused; }
.dm-float--a { animation-duration: 8s; animation-delay: -2s; }
.dm-float--c { animation-duration: 6s; animation-delay: -3.5s; }
.dm-float--d { animation-duration: 7.5s; animation-delay: -5s; }
.dm-float--pill { animation-name: dm-bob; animation-duration: 3.4s; }
.is-live .dm-float, .is-live .dm-live__dot, .is-live .dm-upload__fill::after { animation-play-state: running; }

@keyframes dm-float {
  0%, 100% { transform: translateY(-6px); }
  50% { transform: translateY(6px); }
}

@keyframes dm-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-.35em); }
}

@keyframes dm-pulse {
  50% { opacity: .35; transform: scale(.7); }
}

@keyframes dm-sheen {
  70%, 100% { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
  .dm-mount *, .dm-mount *::before, .dm-mount *::after { animation: none !important; transition: none !important; }
  .dm-slide.is-active { transform: none !important; }
}
