/* ==========================================================================
   dv-projects · "Laboratorul de bule": the hub and the project (design vote) pages.
   Kit tokens and components only (theme assets/kit/tokens.css, components.css); the house pair
   (--house-deep / --house-tint) follows the linked product's house through [data-house].
   Motion: the visitor's switch html[data-motion="off"] stops it (house motion policy).
   ========================================================================== */

/* ---- shared ------------------------------------------------------------------------------------ */
.dvbl .dvh-crumbs { margin-bottom: var(--sp-6); }
.dvbl-facts {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) 0;
  margin: var(--sp-5) 0 0; padding: 0; list-style: none;
  font-size: var(--fs-ui); line-height: var(--lh-ui); color: var(--muted);
}
/* the dot follows an item, so a wrapped line never starts with it */
.dvbl-facts > li:not(:last-child)::after { content: "·"; margin-inline: var(--sp-3); color: var(--control); }
.dvbl-status { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--ink); font-weight: var(--fw-ui); }
.dvbl-status::before {
  content: ""; inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--control);
}
.dvbl-status--open::before { background: var(--success); box-shadow: 0 0 0 4px rgb(45 106 79 / .16); }
.dvbl-status--soon::before { background: var(--house-deep); }

/* ---- project: head ------------------------------------------------------------------------------ */
.dvbl-head { padding-block: var(--sp-5) var(--sp-7); }
.dvbl-head__grid { display: grid; gap: var(--sp-7); }
.dvbl-head__title {
  font-family: var(--font-display); font-weight: var(--fw-display);
  font-size: var(--fs-h1); line-height: var(--lh-h1); letter-spacing: var(--track-display);
  max-width: 18ch; text-wrap: balance;
}
.dvbl-head__intro { margin-top: var(--sp-5); }
.dvbl-head__intro p { font-size: var(--fs-lead); line-height: var(--lh-lead); max-width: 58ch; }
.dvbl-head__note { margin-top: var(--sp-3); max-width: var(--text-measure); }

/* the public favourites, as a small podium on the house tint (2 · 1 · 3) */
.dvbl-top {
  margin: 0; padding: var(--sp-6) var(--sp-5) var(--sp-4);
  background: var(--house-tint); border-radius: var(--radius-media);
}
.dvbl-top__list {
  display: grid; grid-template-columns: 1fr 1.25fr 1fr; align-items: end; gap: var(--sp-3);
  margin: 0; padding: 0; list-style: none;
}
.dvbl-top__item { display: flex; flex-direction: column-reverse; gap: var(--sp-2); min-width: 0; }
.dvbl-top__item:nth-child(1) { order: 2; }
.dvbl-top__item:nth-child(2) { order: 1; }
.dvbl-top__item:nth-child(3) { order: 3; }
.dvbl-top__item img {
  display: block; inline-size: 100%; block-size: auto; aspect-ratio: 3 / 4; object-fit: cover;
  border-radius: 4px; box-shadow: 0 12px 28px -16px rgb(26 23 27 / .5), 0 1px 2px rgb(26 23 27 / .08);
}
.dvbl-top__pos {
  font-family: var(--font-display); font-size: var(--fs-h3); line-height: 1; text-align: center;
  font-variant-numeric: lining-nums tabular-nums; color: var(--house-deep);
}
.dvbl-top figcaption { margin-top: var(--sp-4); text-align: center; color: var(--muted); }

/* ---- project: vote -------------------------------------------------------------------------------- */
.dvbl-vote { padding-block: var(--sp-7) var(--section); border-top: 1px solid var(--line); }
.dvbl-vote__title { font-size: var(--fs-h2); line-height: var(--lh-h2); }
.dvbl-vote__state { margin-top: var(--sp-4); }
.dvbl-vote__order { margin-top: var(--sp-5); max-width: var(--text-measure); }

.dvbl-how { display: grid; gap: var(--sp-3); margin: var(--sp-5) 0 0; padding: 0; list-style: none; }
.dvbl-how li { display: flex; align-items: flex-start; gap: var(--sp-3); font-size: var(--fs-body); line-height: var(--lh-body); max-width: 40ch; }
.dvbl-how .dvh-icon { margin-top: 3px; color: var(--house-deep); }

/* the e-mail line: one field, one action, the privacy note under it */
.dvbl-who {
  margin-top: var(--sp-6); padding: var(--sp-5); max-width: 46rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-media);
}
.dvbl-who.is-asking { border-color: var(--house-deep); box-shadow: 0 0 0 3px color-mix(in srgb, var(--house-deep) 18%, transparent); }
.dvbl-who__row { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.dvbl-who__row .dvh-input { flex: 1 1 16rem; min-width: 0; }
.dvbl-who__row .dvh-btn { flex: 0 0 auto; }
.dvbl-who__privacy { margin-top: var(--sp-3); max-width: 60ch; }
.dvbl-who__privacy a { color: var(--link); text-underline-offset: .2em; }
.dvbl-hp { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* the voter's bar: sticky under the header while voting */
.dvbl-me {
  position: sticky; top: var(--header-h); z-index: var(--z-sticky);
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-5);
  margin: var(--sp-6) calc(-1 * var(--page-gutter)) 0; padding: var(--sp-3) var(--page-gutter);
  background: color-mix(in srgb, var(--ground) 94%, transparent); border-block: 1px solid var(--line);
  backdrop-filter: blur(8px);
  font-size: var(--fs-ui); line-height: var(--lh-ui);
}
.dvbl-me[hidden] { display: none; }
.dvbl-me__who { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--sp-2); min-width: 0; }
.dvbl-me__who strong { font-weight: var(--fw-strong); overflow-wrap: anywhere; }
.dvbl-me__who .dvh-btn--tertiary { min-height: 32px; }
.dvbl-me__count { color: var(--muted); font-variant-numeric: tabular-nums; }
.dvbl-me__filter { margin-inline-start: auto; }
.dvbl-live { min-block-size: 1lh; margin-top: var(--sp-3); }
.dvbl-live.is-error { color: var(--error); }

/* ---- project: the options -------------------------------------------------------------------------- */
.dvbl-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-6) var(--col-gap);
  margin: var(--sp-6) 0 0; padding: 0; list-style: none;
}
@media (min-width: 600px) { .dvbl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .dvbl-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .dvbl-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.dvbl-grid.is-mine .dvbl-opt:not(.is-chosen) { display: none; }

.dvbl-opt { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.dvbl-opt__fig { position: relative; margin: 0; }
.dvbl-opt__view {
  display: block; inline-size: 100%; aspect-ratio: 3 / 4; padding: 0; border: 0; overflow: clip;
  border-radius: var(--radius-media); background: var(--house-tint); cursor: zoom-in;
}
.dvbl-opt__view img { display: block; inline-size: 100%; block-size: 100%; object-fit: cover; }
.dvbl-opt__view:focus-visible { outline-offset: 3px; }
.dvbl-pos {
  position: absolute; top: var(--sp-2); left: var(--sp-2); pointer-events: none;
  display: inline-grid; place-items: center; min-inline-size: 32px; block-size: 32px; padding-inline: var(--sp-2);
  border-radius: var(--radius-control); background: var(--surface); color: var(--ink);
  font-size: var(--fs-meta); font-weight: var(--fw-strong); font-variant-numeric: tabular-nums lining-nums;
  box-shadow: 0 2px 6px -2px rgb(26 23 27 / .25);
}
.dvbl-opt__name { margin-top: var(--sp-2); font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--ink); overflow-wrap: anywhere; }
.dvbl-opt__count { margin: 0; min-block-size: calc(var(--fs-meta) * var(--lh-meta)); font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--muted); }
.dvbl-opt__ctl { display: flex; align-items: center; gap: var(--sp-2); margin-top: auto; }
.dvbl-heart {
  display: inline-grid; place-items: center; flex: none; inline-size: var(--tap); block-size: var(--tap);
  border: 1px solid var(--control); border-radius: var(--radius-control); background: var(--surface); color: var(--ink); cursor: pointer;
  transition: background-color var(--dur-hover) var(--ease-out), border-color var(--dur-hover) var(--ease-out), color var(--dur-hover) var(--ease-out);
}
.dvbl-heart:hover { border-color: var(--ink); }
.dvbl-heart[aria-pressed="true"] { background: var(--house-deep); border-color: var(--house-deep); color: var(--on-house); }
.dvbl-heart[aria-pressed="true"] .dvbl-heart__icon { fill: currentColor; }
.dvbl-heart:disabled { opacity: .5; cursor: progress; }
.dvbl-place { flex: 1 1 auto; min-width: 0; }
.dvbl-place .dvh-select { inline-size: 100%; min-height: var(--tap); }
.dvbl-opt.is-ranked .dvbl-opt__view { outline: 2px solid var(--house-deep); outline-offset: 2px; }
.dvbl-opt.is-ranked .dvbl-place .dvh-select { border-color: var(--house-deep); font-weight: var(--fw-strong); color: var(--ink); }

/* ---- project: the linked product ------------------------------------------------------------------- */
.dvbl-product { padding-block: var(--sp-7); }
.dvbl-product__inner { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--sp-4) var(--sp-5); }
.dvbl-product__img img { display: block; inline-size: 64px; block-size: 86px; object-fit: contain; }
.dvbl-product__title { font-size: var(--fs-h3); line-height: var(--lh-h3); }
.dvbl-product__lead { margin-top: var(--sp-1); color: var(--muted); }
.dvbl-product__btn { grid-column: 1 / -1; justify-self: start; }
@media (min-width: 900px) {
  .dvbl-product__inner { grid-template-columns: auto minmax(0, 1fr) auto; }
  .dvbl-product__btn { grid-column: auto; }
}

/* ---- project: large view (kit .dvh-zoomview) ------------------------------------------------------------ */
.dvbl-view.dvh-zoomview { inline-size: min(calc(100vw - 2 * var(--page-gutter)), 760px); padding: var(--sp-7) var(--sp-4) var(--sp-4); }
.dvbl-view .dvbl-view__stage img {
  display: block; inline-size: auto; max-inline-size: 100%; block-size: min(1000px, calc(100dvh - 15rem));
  margin-inline: auto; object-fit: contain; border-radius: 4px;
}
.dvbl-view__bar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--sp-3); margin-top: var(--sp-4); }
.dvbl-view__cap { margin: 0; text-align: center; font-size: var(--fs-ui); line-height: var(--lh-ui); overflow-wrap: anywhere; }
.dvbl-view__ctl { grid-column: 1 / -1; grid-row: 2; justify-self: center; inline-size: min(100%, 22rem); }

/* ---- hub ---------------------------------------------------------------------------------------------- */
.dvbl-hubhead { position: relative; overflow: clip; padding-block: var(--sp-5) var(--sp-8); }
.dvbl-hubhead .dvh-crumbs { margin-bottom: var(--sp-7); }
.dvbl-hubhead__title { position: relative; z-index: 1; max-width: 12ch; text-wrap: balance; }
.dvbl-hubhead__intro { position: relative; z-index: 1; margin-top: var(--sp-5); }
.dvbl-hubhead__intro p { font-size: var(--fs-lead); line-height: var(--lh-lead); max-width: 56ch; }

/* the bubbles: rings rising slowly at the right of the head, desktop only */
.dvbl-bubbles { display: none; }
@media (min-width: 900px) {
  .dvbl-bubbles { display: block; position: absolute; inset: 0 var(--page-gutter) 0 auto; inline-size: min(40vw, 520px); pointer-events: none; }
  .dvbl-bubbles i {
    position: absolute; bottom: 0; border-radius: 50%; border: 1.5px solid var(--leaf); opacity: .28;
    inline-size: var(--s); block-size: var(--s); left: var(--x); translate: 0 var(--y);
  }
  .dvbl-bubbles i:nth-child(1) { --s: 22px; --x: 12%; --y: -40%; --d: 15s; --w: 0s; }
  .dvbl-bubbles i:nth-child(2) { --s: 10px; --x: 28%; --y: -160%; --d: 11s; --w: -4s; }
  .dvbl-bubbles i:nth-child(3) { --s: 38px; --x: 46%; --y: -90%; --d: 19s; --w: -9s; }
  .dvbl-bubbles i:nth-child(4) { --s: 14px; --x: 61%; --y: -260%; --d: 13s; --w: -2s; }
  .dvbl-bubbles i:nth-child(5) { --s: 26px; --x: 74%; --y: -60%; --d: 17s; --w: -12s; }
  .dvbl-bubbles i:nth-child(6) { --s: 8px;  --x: 86%; --y: -320%; --d: 10s; --w: -6s; }
  .dvbl-bubbles i:nth-child(7) { --s: 16px; --x: 94%; --y: -120%; --d: 14s; --w: -8s; }
  html:not([data-motion="off"]) .dvbl-bubbles i { opacity: 0; translate: 0 0; animation: dvbl-rise var(--d) linear var(--w) infinite; }
}
@keyframes dvbl-rise {
  0%   { translate: 0 20px; opacity: 0; }
  12%  { opacity: .34; }
  50%  { translate: 10px -200px; }
  88%  { opacity: .22; }
  100% { translate: -6px -420px; opacity: 0; }
}

.dvbl-projects { padding-block: 0 var(--section); }
.dvbl-plist { display: grid; gap: var(--sp-8); margin: 0; padding: 0; list-style: none; }
.dvbl-pitem { display: grid; gap: var(--sp-6); align-items: center; }
.dvbl-pitem__media {
  display: grid; grid-template-columns: 1fr 1.3fr 1fr; align-items: center; gap: var(--sp-3);
  padding: var(--sp-7) var(--sp-5); border-radius: var(--radius-media); background: var(--house-tint); text-decoration: none;
}
.dvbl-pitem__shot { display: block; min-width: 0; }
.dvbl-pitem__shot img {
  display: block; inline-size: 100%; block-size: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 4px;
  box-shadow: 0 16px 32px -20px rgb(26 23 27 / .55), 0 1px 2px rgb(26 23 27 / .08);
  transition: translate var(--dur-settle) var(--ease-emph);
}
.dvbl-pitem__shot--1 { order: 2; }
.dvbl-pitem__shot--2 { order: 1; translate: 0 10%; }
.dvbl-pitem__shot--3 { order: 3; translate: 0 10%; }
html:not([data-motion="off"]) .dvbl-pitem:hover .dvbl-pitem__shot--1 img { translate: 0 -6px; }
html:not([data-motion="off"]) .dvbl-pitem:hover .dvbl-pitem__shot--2 img { translate: -4px -3px; }
html:not([data-motion="off"]) .dvbl-pitem:hover .dvbl-pitem__shot--3 img { translate: 4px -3px; }
.dvbl-pitem__title { font-size: var(--fs-h2); line-height: var(--lh-h2); text-wrap: balance; }
.dvbl-pitem__title a { color: inherit; text-decoration: none; }
.dvbl-pitem__title a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .15em; }
.dvbl-pitem__lead { margin-top: var(--sp-4); font-size: var(--fs-lead); line-height: var(--lh-lead); max-width: 52ch; text-wrap: pretty; }
.dvbl-pitem__btn { margin-top: var(--sp-6); }
.dvbl-pitem--closed .dvbl-pitem__media { filter: saturate(.8); }
@media (max-width: 599.98px) {
  .dvbl-pitem__btn { display: flex; inline-size: 100%; }
}
@media (min-width: 900px) {
  .dvbl-head { padding-block: var(--sp-5) var(--sp-8); }
  .dvbl-head__grid--top { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--sp-8); align-items: end; }
  .dvbl-how { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--col-gap); }
  .dvbl-pitem { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: var(--sp-8); }
  .dvbl-pitem:nth-child(even) .dvbl-pitem__media { order: 2; }
}

/* ---- motion: one press response (the heart), only when motion is on ------------------------------------ */
html:not([data-motion="off"]) .dvbl-heart.is-pop .dvbl-heart__icon { animation: dvbl-pop 420ms var(--ease-emph); }
@keyframes dvbl-pop { 0% { scale: .7; } 55% { scale: 1.2; } 100% { scale: 1; } }
