/* ==========================================================================
   Pikett · division demo "div-ads" (divisions/ads.html hero stage)
   1. Shell: brand tag, Shuffle, the deck, the top card's tag
   2. Cards (physical: transforms are written inline by js/scenes/div-ads.js)
   3. The campaign: one sample brand ("squint"), six formats. Every length is a
      container unit of its own card, so each layout scales with its card.
   4. Reduced motion: the six laid out flat
   ========================================================================== */

/* 1. Shell ------------------------------------------------------------------ */
.ads {
  position: absolute; inset: 0; z-index: 1;
  font-family: var(--sans); color: var(--fg);
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
.ads__bar {
  position: absolute; left: 20px; right: 20px; top: 18px; z-index: 60;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; pointer-events: none;
}
.ads__bar > * { pointer-events: auto; }
.ads__brand {
  display: inline-flex; align-items: center; gap: 10px; min-width: 0;
  font-family: var(--mono); font-size: 11px; line-height: 1; letter-spacing: .08em; text-transform: uppercase;
  color: var(--fg-3); white-space: nowrap;
}
.ads__brand i { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.ads__brand b { font-weight: 400; color: var(--fg); }
.ads__brand span { margin-left: -2px; }
.ads__shuffle {
  display: inline-flex; align-items: center; gap: 9px; flex: none;
  height: 38px; padding: 0 17px 0 14px; border-radius: 999px;
  background: var(--c); color: #0A0A0C;
  font-size: 14px; font-weight: 650; font-stretch: 112%; letter-spacing: -.005em;
  box-shadow: 0 10px 30px -12px color-mix(in srgb, var(--c) 70%, transparent);
  transition: transform .45s var(--ease), background-color .3s var(--ease);
}
.ads__shuffle svg { width: 16px; height: 16px; display: block; transition: transform .6s var(--ease); }
.ads__shuffle:hover { background: var(--fg); }
.ads__shuffle:hover svg { transform: rotate(180deg); }
.ads__shuffle:active { transform: scale(.95); }
.ads__shuffle:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }

.ads__deck { position: absolute; left: 0; right: 0; top: 66px; bottom: var(--ads-foot, 50px); touch-action: pan-y; perspective: 1500px; }
.ads__tag {
  position: absolute; left: 0; top: 0; z-index: 55; margin: 0;
  display: inline-flex; align-items: center; gap: 9px; height: 24px; padding: 0 10px 0 8px; border-radius: 7px;
  background: rgba(10, 10, 12, .86); box-shadow: inset 0 0 0 1px var(--line-2);
  font-family: var(--mono); font-size: 11px; line-height: 1; letter-spacing: .06em; text-transform: uppercase; color: var(--fg);
  white-space: nowrap; pointer-events: none; will-change: transform;
  transition: opacity .25s var(--ease);
}
.ads__tag span { display: inline-block; }
.ads__tag-n { color: var(--c); }
.ads__tag.is-in span { animation: ads-tag .55s var(--ease) both; }
.ads__tag.is-in span + span { animation-delay: .05s; }
.ads__tag.is-off { opacity: 0; }
@keyframes ads-tag { from { opacity: 0; transform: translateY(80%); } }

/* 2. Cards ------------------------------------------------------------------- */
.ads__card {
  position: absolute; left: 50%; top: 50%; display: block; padding: 0; margin: 0; border: 0;
  border-radius: 12px; background: transparent; color: #0A0A0C; text-align: left; font: inherit;
  transform-origin: 50% 60%; will-change: transform; cursor: grab; outline: none;
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .8), 0 8px 18px -8px rgba(0, 0, 0, .5);
}
.ads__card.is-drag { cursor: grabbing; }
.ads__card:focus-visible { box-shadow: 0 0 0 2px #0A0A0C, 0 0 0 4px var(--c), 0 30px 60px -24px rgba(0, 0, 0, .8); }
.ads__dim { position: absolute; inset: 0; z-index: 20; border-radius: inherit; background: #0A0A0C; opacity: 0; pointer-events: none; transition: opacity .6s var(--ease); }
.ads__card--banner { border-radius: 6px; }
.ads__card--poster { border-radius: 3px; }

/* 3. The campaign ------------------------------------------------------------- */
.adc {
  position: absolute; inset: 0; display: block; overflow: hidden; border-radius: inherit;
  container-type: size; background: #FFD23F; color: #0A0A0C;
  font-family: var(--sans); font-weight: 900; line-height: 1;
}
.adc > * { position: absolute; display: block; }
.adc__sun { border-radius: 50%; background: #FF5A1F; }
.adc__h { font-weight: 900; font-stretch: 62%; line-height: .86; letter-spacing: -.012em; white-space: nowrap; }
.adc__ln { display: block; overflow: hidden; padding: .02em 0 .06em; margin: -.02em 0 -.06em; }
.adc__ln > span { display: block; }
.adc__gl { display: block; width: 100%; height: auto; overflow: visible; color: #0A0A0C; }
.adc__glare { transform-box: view-box; }
.adc__logo { font-weight: 900; font-stretch: 78%; letter-spacing: -.03em; line-height: 1; white-space: nowrap; }
.adc__i { position: relative; display: inline-block; }
.adc__i::after { content: ""; position: absolute; left: 50%; top: .02em; width: .22em; height: .22em; margin-left: -.11em; border-radius: 50%; background: #FF5A1F; }
.adc__cta {
  display: inline-flex; align-items: center; justify-content: center; border-radius: 999px;
  background: #0A0A0C; color: #FFD23F; font-weight: 700; font-stretch: 105%; letter-spacing: -.01em; white-space: nowrap;
}
.adc__url { font-family: var(--mono); font-weight: 400; letter-spacing: .02em; }

/* Story · 9:16 */
.adc--story .adc__bars { left: 4cqw; right: 4cqw; top: 2.6cqw; display: flex; gap: 1.2cqw; }
.adc--story .adc__bars i { flex: 1; height: .9cqw; border-radius: 1cqw; background: rgba(10, 10, 12, .2); overflow: hidden; }
.adc--story .adc__bars b { display: block; height: 100%; background: #0A0A0C; transform-origin: 0 50%; }
.adc--story .adc__who { left: 4cqw; top: 6.4cqw; display: flex; align-items: center; gap: 2.4cqw; font-size: 5cqw; }
.adc__ava { display: grid; place-items: center; width: 9cqw; height: 9cqw; border-radius: 50%; background: #0A0A0C; }
.adc__ava i { width: 3.2cqw; height: 3.2cqw; border-radius: 50%; background: #FF5A1F; }
.adc__sp { font-family: var(--mono); font-weight: 400; font-size: 3.3cqw; letter-spacing: .02em; opacity: .62; }
.adc--story .adc__h { left: 6cqw; top: 16.5cqh; font-size: 22.5cqw; }
.adc--story .adc__sun { width: 104cqw; height: 104cqw; left: 22cqw; top: 49cqh; }
.adc--story .adc__glw { left: 6cqw; width: 88cqw; top: 55.5cqh; transform: rotate(-6deg); }
.adc--story .adc__cw { left: 0; right: 0; bottom: 4.5cqh; display: grid; justify-items: center; gap: 1.6cqh; }
.adc--story .adc__swipe { width: 6cqw; height: 4cqw; color: #0A0A0C; }
.adc--story .adc__swipe svg { display: block; width: 100%; height: 100%; }
.adc--story .adc__cta { height: 11.5cqw; padding: 0 7.5cqw; font-size: 4.8cqw; }

/* Feed · 1:1 */
.adc--feed .adc__h { left: 6.5cqw; top: 6cqw; font-size: 11.6cqw; font-stretch: 82%; line-height: .88; }
.adc--feed .adc__sun { width: 58cqw; height: 58cqw; left: 21cqw; top: 31cqw; }
.adc--feed .adc__face, .adc--feed .adc__glw { left: 16cqw; width: 68cqw; top: 45cqw; }
.adc--feed .adc__eyes { display: block; width: 100%; height: auto; }
.adc--feed .adc__foot { left: 6.5cqw; right: 6.5cqw; bottom: 5.5cqw; display: flex; align-items: center; justify-content: space-between; }
.adc--feed .adc__logo { font-size: 7.6cqw; }
.adc--feed .adc__cta { height: 9.4cqw; padding: 0 5.2cqw; font-size: 4cqw; }

/* Portrait · 4:5 (the night version of the system) */
.adc--portrait { background: #0A0A0C; color: #FFD23F; }
.adc--portrait .adc__h { left: 7cqw; top: 6.5cqw; font-size: 16.4cqw; font-stretch: 68%; }
.adc--portrait .adc__sun { width: 94cqw; height: 94cqw; left: 3cqw; top: 49cqh; background: #FFD23F; }
.adc--portrait .adc__glw { left: 9cqw; width: 82cqw; top: 55cqh; }
.adc--portrait .adc__foot { left: 7cqw; right: 7cqw; bottom: 6cqw; display: flex; align-items: center; justify-content: space-between; color: #0A0A0C; }
.adc--portrait .adc__logo { font-size: 7.4cqw; }
.adc--portrait .adc__cta { height: 9.6cqw; padding: 0 5.4cqw; font-size: 4.1cqw; }

/* Video · 16:9 */
.adc--video .adc__sun { width: 30cqw; height: 30cqw; left: 63cqw; top: 9cqh; }
.adc--video .adc__glw { left: 26cqw; width: 48cqw; top: 27cqh; }
.adc--video > .adc__logo { left: 4cqw; top: 7cqh; font-size: 4.2cqw; }
.adc--video .adc__end { left: 4cqw; top: 21cqh; display: grid; justify-items: start; gap: 1.6cqh; }
.adc--video .adc__cta { height: 5.4cqw; padding: 0 2.6cqw; font-size: 2.2cqw; }
.adc--video .adc__url { font-size: 1.7cqw; opacity: .7; }
.adc--video .adc__cap { left: 8cqw; right: 8cqw; bottom: 19cqh; text-align: center; font-size: 3.6cqw; font-weight: 700; font-stretch: 100%; line-height: 1.5; white-space: nowrap; }
.adc--video .adc__cap span { display: inline-block; padding: 0 .28em; background: rgba(10, 10, 12, .88); color: #F3F2EE; }
.adc--video .adc__player { left: 3cqw; right: 3cqw; bottom: 4.5cqh; height: 7cqh; display: flex; align-items: center; gap: 1.8cqw; }
.adc--video .adc__pi { width: 2.2cqw; height: 2.2cqw; color: #0A0A0C; }
.adc--video .adc__pi svg { display: block; width: 100%; height: 100%; }
.adc--video .adc__prog { flex: 1; height: .7cqw; border-radius: 1cqw; background: rgba(10, 10, 12, .2); overflow: hidden; }
.adc--video .adc__prog b { display: block; height: 100%; background: #0A0A0C; transform-origin: 0 50%; }
.adc--video .adc__time { font-family: var(--mono); font-weight: 400; font-size: 1.7cqw; letter-spacing: .02em; font-variant-numeric: tabular-nums; }

/* Banner · 728×90 */
/* (cq units resolve against the nearest container ABOVE an element, so the row is a child of .adc) */
.adc--banner .adc__row { inset: 0; display: flex; align-items: center; gap: 2.4cqw; padding: 0 2.2cqw 0 3cqw; }
.adc__row > * { position: relative; flex: none; }
.adc--banner .adc__logo { font-size: 34cqh; }
.adc--banner .adc__hw { flex: 1 1 auto; min-width: 0; overflow: hidden; padding: .08em 0 .1em; padding-left: 2.2cqw; box-shadow: inset 1px 0 0 rgba(10, 10, 12, .18); }
.adc--banner .adc__h { display: block; font-size: 26cqh; font-stretch: 74%; line-height: 1; }
.adc--banner .adc__prod { width: 15cqw; height: 100%; display: grid; place-items: center; }
.adc--banner .adc__sun { position: absolute; left: 50%; top: 50%; width: 92cqh; height: 92cqh; margin: -46cqh 0 0 -46cqh; }
.adc--banner .adc__glw { position: relative; width: 100%; }
.adc--banner .adc__cta {
  height: 54cqh; padding: 0 2.2cqw; font-size: 22cqh;
  background: linear-gradient(105deg, #0A0A0C 40%, #4A4A55 50%, #0A0A0C 60%) -150% 0 / 250% 100% no-repeat, #0A0A0C;
}

/* Poster · A-size (paper) */
.adc--poster { background: #F3F2EE; box-shadow: inset 0 0 0 1px rgba(10, 10, 12, .06); }
.adc--poster .adc__sun { width: 82cqw; height: 82cqw; left: 9cqw; top: 6cqw; }
.adc--poster .adc__glw { left: 7cqw; width: 86cqw; top: 31cqw; }
.adc--poster .adc__h { left: 6.5cqw; bottom: 10.5cqh; font-size: 18.6cqw; }
.adc--poster .adc__small {
  left: 6.5cqw; right: 6.5cqw; bottom: 3.6cqh; display: flex; align-items: baseline; justify-content: space-between;
  font-family: var(--mono); font-weight: 400; font-size: 2.7cqw; letter-spacing: .03em;
}
.adc--poster .adc__small .adc__logo { font-family: var(--sans); font-weight: 900; font-size: 5.4cqw; letter-spacing: -.03em; }

/* 4. Reduced motion: flat, side by side ---------------------------------------- */
.ads--flat .ads__card { cursor: pointer; transform: none; will-change: auto; box-shadow: 0 18px 40px -22px rgba(0, 0, 0, .8); }
.ads__lbl {
  position: absolute; left: 0; top: 100%; margin-top: 7px;
  font-family: var(--mono); font-size: 10px; font-weight: 400; line-height: 1.25; letter-spacing: .06em; text-transform: uppercase;
  color: var(--fg-2);
}
.ads__lbl > span { white-space: nowrap; }
.ads--flat .ads__card:hover .ads__lbl, .ads--flat .ads__card:focus-visible .ads__lbl { color: var(--fg); }

/* narrow stages (phones) */
.ads--narrow .ads__bar { left: 12px; right: 12px; top: 12px; }
.ads--narrow .ads__deck { top: 58px; }
.ads--narrow .ads__shuffle { height: 40px; }
