/* ==========================================================================
   Campaign slideshow (.cs) and Moods (.md). Partials: pura-campaign.ejs, pura-moods.ejs.
   JS: public/js/campaign.js. Loops are compositor-only (opacity, transform).
   ========================================================================== */

/* ---------- Campaign slideshow ---------- */
.cs { position: relative; overflow: hidden; background: #08070c; color: #fff; }
.cs__stage { position: relative; overflow: hidden; height: clamp(520px, calc(100svh - var(--nav-h) - 72px), 900px); touch-action: pan-y; }
.cs__slide { position: absolute; inset: 0; margin: 0; opacity: 0; visibility: hidden; transition: opacity 1.1s var(--ease), visibility 1.1s; }
.cs__slide.is-on { opacity: 1; visibility: visible; z-index: 1; }
.cs__slide picture, .cs__slide img { display: block; width: 100%; height: 100%; }
.cs__slide img { object-fit: cover; transform: scale(1.08); transition: transform 9s cubic-bezier(.2, .6, .2, 1); }
.cs__slide.is-on img { transform: scale(1); }
.cs__shade { display: none; }
/* shade lives inside each slide: above the photo, below the words */
.cs__slide::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(90deg, rgb(8 7 12 / .86) 0%, rgb(8 7 12 / .62) 30%, rgb(8 7 12 / 0) 60%), linear-gradient(0deg, rgb(8 7 12 / .7) 0%, rgb(8 7 12 / 0) 35%); }
.cs__copy { position: absolute; z-index: 2; left: 0; right: 0; bottom: clamp(28px, 6svh, 72px); }
.cs__copy > * { max-width: 520px; opacity: 0; translate: 0 18px; transition: opacity .7s var(--ease), translate .8s var(--ease); }
.cs__slide.is-on .cs__copy > * { opacity: 1; translate: none; }
.cs__slide.is-on .cs__copy > :nth-child(2) { transition-delay: .12s; }
.cs__slide.is-on .cs__copy > :nth-child(3) { transition-delay: .22s; }
.cs__slide.is-on .cs__copy > :nth-child(4) { transition-delay: .32s; }
.cs__kicker { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-family: var(--mono, ui-monospace, monospace); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: rgb(255 255 255 / .78); }
.cs__swatch { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 14px var(--c); }
.cs__title { margin: 0 0 16px; font-family: var(--display); font-synthesis: none; font-size: clamp(44px, min(6.4vw, 11svh), 120px); line-height: .94; letter-spacing: -.035em; text-wrap: balance; color: #fff; }
.cs__text { margin: 0 0 22px; font-size: clamp(15px, 1.25vw, 18px); line-height: 1.55; color: rgb(255 255 255 / .8); }
.cs__link { display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 999px; background: #fff; color: #0b0b0d; font-weight: 600; font-size: 14px; text-decoration: none; transition: background .3s, color .3s; }
.cs__link:hover { background: var(--c); color: #0b0b0d; }
.cs__link svg { width: 16px; height: 16px; transition: translate .35s var(--ease); }
.cs__link:hover svg { translate: 4px 0; }

.cs__nav { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(10px, 2vw, 28px); padding-block: 18px 10px; }
.cs__tab { position: relative; display: flex; align-items: baseline; gap: 10px; padding: 14px 0 0; border: 0; background: none; color: rgb(255 255 255 / .5); font: inherit; font-size: 14px; text-align: left; cursor: pointer; transition: color .3s; }
.cs__tab:hover, .cs__tab.is-on { color: #fff; }
.cs__tab:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.cs__n { font-family: var(--mono, ui-monospace, monospace); font-size: 12px; }
.cs__t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs__tab i { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: rgb(255 255 255 / .18); overflow: hidden; }
.cs__tab i::after { content: ""; position: absolute; inset: 0; background: #fff; transform: scaleX(0); transform-origin: 0 50%; }
.cs__tab.is-on i::after { transform: scaleX(1); }
.cs.is-playing .cs__tab.is-on i::after { animation: csProg var(--cs-ms, 6500ms) linear both; }
.cs.is-held .cs__tab.is-on i::after { animation-play-state: paused; }
@keyframes csProg { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.cs__fine { margin-block: 0; padding-block: 8px 18px; font-size: 12px; color: rgb(255 255 255 / .5); }

@media (max-width: 899px) {
  .cs__stage { height: auto; aspect-ratio: 4 / 5; max-height: 78svh; }
  .cs__slide img { object-position: var(--mpos, 50% 50%) !important; }
  .cs__slide::after { background: linear-gradient(0deg, rgb(8 7 12 / .94) 0%, rgb(8 7 12 / .62) 40%, rgb(8 7 12 / 0) 64%); }
  .cs__copy { bottom: 20px; }
  .cs__title { font-size: clamp(36px, 10vw, 52px); margin-bottom: 10px; }
  .cs__text { font-size: 15px; margin-bottom: 16px; }
  .cs__nav { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .cs__t { display: none; }
  .cs__tab { justify-content: center; padding-top: 12px; min-height: 44px; }
}

/* ---------- Moods ---------- */
.md { --mc: #9b6bff; position: relative; overflow: hidden; isolation: isolate; background: #0a0910; color: #fff; }
.md__stage { position: absolute; inset: 0; z-index: -1; }
.md__bg { position: absolute; inset: 0; opacity: 0; transition: opacity 1s var(--ease); }
.md__bg.is-on { opacity: 1; }
.md__bg img { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transition: transform 6s cubic-bezier(.2, .6, .2, 1); }
.md__bg.is-on img { transform: scale(1); }
.md__shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgb(10 9 16 / .72) 0%, rgb(10 9 16 / .25) 42%, rgb(10 9 16 / 0) 62%), linear-gradient(0deg, rgb(10 9 16 / .75) 0%, rgb(10 9 16 / 0) 40%); }
.md__ui { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 18px; min-height: clamp(560px, calc(100svh - var(--nav-h) - 40px), 920px); padding-block: clamp(32px, 6svh, 72px); }
.md__kicker { margin: 0; font-family: var(--mono, ui-monospace, monospace); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: rgb(255 255 255 / .75); }
.md__panel { max-width: 500px; padding: clamp(20px, 2.4vw, 30px); border-radius: 22px; border: 1px solid rgb(255 255 255 / .16); background: rgb(12 11 20 / .42); backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2); }
.md__copy.is-on > * { animation: mdIn .7s var(--ease) both; }
.md__copy.is-on > :nth-child(2) { animation-delay: .08s; }
.md__copy.is-on > :nth-child(3) { animation-delay: .16s; }
@keyframes mdIn { from { opacity: 0; translate: 0 12px; } to { opacity: 1; translate: none; } }
.md__title { margin: 0 0 10px; font-family: var(--display); font-synthesis: none; font-size: clamp(36px, min(4.4vw, 8svh), 72px); line-height: .96; letter-spacing: -.035em; color: #fff; }
.md__text { margin: 0 0 16px; font-size: 16px; line-height: 1.55; color: rgb(255 255 255 / .82); }
.md__flavors { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.md__flavors a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: rgb(255 255 255 / .12); border: 1px solid rgb(255 255 255 / .22); color: #fff; font-size: 14px; font-weight: 600; text-decoration: none; transition: background .3s, color .3s; }
.md__flavors a:hover { background: #fff; color: #0b0b0d; }
.md__flavors i { width: 9px; height: 9px; border-radius: 50%; background: var(--fc); }
.md__tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.md__tab { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid rgb(255 255 255 / .22); background: rgb(12 11 20 / .35); color: #fff; font: inherit; font-size: 14px; cursor: pointer; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: background .3s, color .3s, border-color .3s; }
.md__tab i { width: 9px; height: 9px; border-radius: 50%; background: var(--mc); box-shadow: 0 0 10px var(--mc); }
.md__tab:hover { border-color: #fff; }
.md__tab.is-on { background: #fff; color: #0b0b0d; border-color: #fff; }
.md__tab:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

@media (max-width: 899px) {
  .md__stage { position: relative; inset: auto; aspect-ratio: 1; }
  .md__shade { background: linear-gradient(0deg, #0a0910 0%, rgb(10 9 16 / 0) 30%); }
  .md__ui { min-height: 0; padding-block: 8px 40px; justify-content: flex-start; }
  .md__panel { padding: 0; border: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .md__tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
  .md__tabs::-webkit-scrollbar { display: none; }
  .md__tab { flex: none; }
  .md__title { font-size: clamp(32px, 9vw, 44px); }
}

@media (prefers-reduced-motion: reduce) {
  .cs__slide img, .md__bg img { transform: none !important; transition: none; }
  .cs__copy > * { opacity: 1; translate: none; transition: none; }
  .md__copy.is-on > * { animation: none; }
}
