/* Account snapshot (case-study-modern-experience-account-snapshot).
   Markup: site/content/pages/case-study-modern-experience-account-snapshot.mjs.
   Behaviour: assets/js/account-snapshot.js.

   1. The working snapshot (.as-demo), rebuilt from the Figma frames with the hero's
      look: product tabs switch context, the carousel moves one card at a time, Show
      Balance masks every figure, and "Responsive web" narrows it to phone width. It is
      product UI, so it keeps the dashboard's dark surface in both site themes.
   2. Story figures (legacy dashboard, tab anatomy, freshness labels, results) now
      live in hdfc-story.css, shared with the quick recharge study.
   3. The hero scene (.ash), further down. */

/* ==========================================================================
   1. The working snapshot
   ========================================================================== */

.as-demo {
  --as-violet: #786cfa;
  --as-blue: #1c3fca;
  --as-ink: #111827;
  --as-ease: cubic-bezier(.22, 1, .36, 1);
  margin: 0;
  min-width: 0;
}

/* Web / Responsive web */
.as-view {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 14px;
  padding: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--sf-ink) 7%, transparent);
}
.as-view__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--sf-text-2);
  font: inherit;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.as-view__btn:hover { color: var(--sf-ink); }
.as-view__btn[aria-pressed="true"] { background: var(--sf-glass-strong); color: var(--sf-ink); box-shadow: 0 1px 3px rgba(15, 23, 42, .14); }
.as-view__btn:focus-visible { outline: 2px solid var(--sf-accent-ink); outline-offset: 2px; }
html:not(.sf-js) .as-view { display: none; }
@media (pointer: coarse) { .as-view__btn { min-height: 44px; } }

/* The frame is the size container: at phone width it narrows and becomes a handset. */
.as-frame { container-type: inline-size; margin-inline: auto; }
.as-demo.is-phone .as-frame {
  max-width: 400px;
  padding: 10px;
  border-radius: 46px;
  background: #0b0b0f;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .1), 0 40px 80px -40px rgba(8, 8, 24, .7);
}
.as-demo.is-phone .as-stage { border-radius: 36px; }

.as-stage {
  --as-gap: 24px;
  position: relative;
  padding: 24px 28px 28px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--cs-r, 24px);
  background:
    radial-gradient(60% 75% at 12% 0%, rgba(120, 108, 250, .2), transparent 70%),
    radial-gradient(50% 60% at 100% 100%, rgba(28, 63, 202, .16), transparent 70%),
    linear-gradient(165deg, #25252c 0%, #1c1c21 48%, #151519 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 30px 60px -40px rgba(8, 8, 24, .6);
  color: #fff;
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-feature-settings: "ss01" 1;
  overflow: hidden;
  isolation: isolate;
}
.as-stage img { display: block; max-width: none; height: auto; }

/* Product tabs (Figma: Local Navigation Tabs) ---------------------------------- */

.as-tabs {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin: -6px -6px 0;
  padding: 6px 6px 22px;
  overflow-x: auto;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.as-tabs::-webkit-scrollbar { display: none; }

.as-tab {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  min-width: 90px;
  height: 44px;
  padding: 0 16px;
  border: 1px solid #4b5563;
  border-radius: 20px;
  background: rgba(0, 0, 0, .1);
  color: #fff;
  font: inherit;
  font-size: 14px;
  line-height: 20px;
  text-align: left;
  cursor: pointer;
  /* A short row of tabs: the grid reveal below and this height change are the
     two layout transitions, kept to the one control that opens. */
  transition: height .4s var(--as-ease), padding .4s var(--as-ease), border-color .2s ease, background-color .2s ease, box-shadow .3s ease;
}
.as-tab:not([aria-selected="true"]) { justify-content: center; }
.as-tab:hover { border-color: #9ca3af; background: rgba(255, 255, 255, .05); }
.as-tab:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.as-tab[aria-selected="true"] {
  height: 78px;
  padding: 0 18px 5px 16px;
  border-color: var(--as-violet);
  background: #1b1b20;
  box-shadow: inset 0 -5px 0 var(--as-violet), 0 14px 30px -12px rgba(88, 61, 208, .55);
  cursor: default;
}
/* The caret under the open tab (Figma Polygon 8) ties it to the cards below. */
.as-tab::after {
  content: '';
  position: absolute;
  left: 29px;
  top: calc(100% - 3px);
  width: 18.11px;
  height: 12.2px;
  background: url(../images/case-studies/hdfc-snapshot/caret.svg) center / 100% 100% no-repeat;
  transform: rotate(180deg) scale(0);
  transition: transform .3s var(--as-ease);
}
.as-tab[aria-selected="true"]::after { transform: rotate(180deg) scale(1); }

/* The picture and the subtitle unfold on the open tab (0fr → 1fr grid tracks). */
.as-tab__reveal {
  display: grid;
  grid-template-columns: 0fr;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-columns .4s var(--as-ease), grid-template-rows .4s var(--as-ease), opacity .25s ease;
}
.as-tab__reveal > span { min-width: 0; min-height: 0; overflow: hidden; }
.as-tab[aria-selected="true"] .as-tab__reveal {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  opacity: 1;
  transition-delay: 0s, 0s, .12s;
}
.as-tab__text { display: grid; }
.as-tab__label { white-space: nowrap; }
.as-tab[aria-selected="true"] .as-tab__label { font-size: 16px; font-weight: 600; line-height: 22px; }
.as-tab__sub { display: block; padding-top: 4px; color: #e5e7eb; font-size: 12px; line-height: 20px; white-space: nowrap; }

.as-art { position: relative; display: block; width: 40px; height: 40px; margin-right: 8px; }
.as-art img { position: absolute; left: 0; top: 0; width: 40px; height: 40px; }
.as-art--inset img { left: 4.8px; top: 4.8px; width: 30.4px; height: 30.4px; }
.as-art--crop { overflow: hidden; border-radius: 8px; }
.as-art--crop img { left: -5.74px; top: -6.2px; width: 40.866px; height: 41.905px; }
.as-art--glyph { display: grid; place-items: center; border-radius: 10px; color: #fff; font-size: 20px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 6px 14px -6px rgba(0, 0, 0, .5); }
.as-art--invest { background: linear-gradient(140deg, #7dbbff, #3395ff 55%, #1c3fca); }
.as-art--insure { background: linear-gradient(140deg, #9fe7c4, #2db780 55%, #00875f); }
.as-tab[aria-selected="true"] .as-art { animation: as-pop .5s var(--as-ease) .08s backwards; }
@keyframes as-pop { from { transform: scale(.5) rotate(-14deg); opacity: 0; } }

/* Show Balance -------------------------------------------------------------- */

.as-balance { display: flex; align-items: center; gap: 11px; margin: 0 0 12px; font-size: 14px; font-weight: 600; line-height: 20px; }
.as-switch {
  position: relative;
  flex: none;
  width: 36px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #4b5563;
  cursor: pointer;
  transition: background-color .25s ease;
}
.as-switch::before { content: ''; position: absolute; inset: -12px -6px; }   /* a 44 px tall hit area */
.as-switch[aria-checked="true"] { background: var(--as-blue); }
.as-switch__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 5px rgba(16, 24, 40, .1);
  transition: transform .32s cubic-bezier(.34, 1.4, .5, 1);
}
.as-switch[aria-checked="true"] .as-switch__thumb { transform: translateX(16px); }
.as-switch:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* Carousel ------------------------------------------------------------------ */

.as-carousel { position: relative; }
.as-viewport {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  margin: -4px -4px -10px;
  padding: 4px 4px 10px;
  scroll-padding-inline: 4px;
}
.as-viewport::-webkit-scrollbar { display: none; }
.as-viewport:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.as-track { display: flex; gap: var(--as-gap); }

.as-card {
  position: relative;
  flex: 0 0 calc((100% - 3 * var(--as-gap)) / 4);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  min-height: 224px;
  padding: 24px;
  border: 1px solid #ecedf3;
  border-radius: 16px;
  color: var(--as-ink);
  box-shadow: 0 1px 5px rgba(16, 24, 40, .1), 0 18px 32px -22px rgba(0, 0, 0, .7);
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
/* Figma fills: a conic sweep with a hard seam near the top right. */
.as-card--lilac { background: conic-gradient(from 47deg at 45.2% 28.6%, #e6ddfe, #f4f0ff); }
.as-card--ice { background: conic-gradient(from 44deg at 45.2% 28.6%, #d0ddfc, #e4ecff); }
.as-card--offer { border: 0; color: #fff; }
.as-card--offer.as-card--violet { background: conic-gradient(from 52deg at 39.6% 28%, #583dd0, #7454f2); }
.as-card--offer.as-card--blue { background: conic-gradient(from 51deg at 39.6% 28%, #1c3fca, #3557d4 50%, #4f6fdf); }

.as-card__row { display: flex; align-items: flex-start; justify-content: space-between; }
.as-card__row > img { width: 24px; height: 24px; }
.as-card__icon { position: relative; display: grid; place-items: center; width: 40px; height: 40px; }
.as-card__icon img, .as-card__icon .as-tint { width: 40px; height: 40px; }
.as-sukanya { position: relative; width: 40px; height: 40px; overflow: hidden; }
.as-stage .as-sukanya img { position: absolute; left: 1.355px; top: .5px; width: 37.29px; height: 39px; }
.as-tint { display: block; flex: none; background-color: currentColor; -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.as-tint--blue, .as-glyph--blue { color: var(--as-blue); }
.as-tint--violet, .as-glyph--violet { color: var(--as-violet); }
.as-tint--white, .as-glyph--white { color: #fff; }
.as-go-sm { width: 20px; height: 20px; }
.as-glyph { font-size: 30px; line-height: 1; }

.as-card__body { display: flex; flex-direction: column; gap: 16px; }
.as-card__text { display: flex; flex-direction: column; gap: 4px; }
.as-card__label { font-size: 14px; line-height: 20px; }
.as-card__label small { font-size: 10px; }
.as-card__note { color: #545964; font-size: 12px; line-height: 20px; }
.as-card__offer { font-size: 16px; font-weight: 600; line-height: 22px; }

.as-amount {
  position: relative;
  display: block;
  font-size: 20px;
  font-weight: 600;
  line-height: 28px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.as-amount small { font-size: 18px; line-height: 24px; }
/* Show Balance off: each figure slides out and its mask slides in. */
.as-amount__value, .as-amount__mask { display: inline-block; transition: opacity .22s ease, transform .3s var(--as-ease), visibility 0s; }
.as-amount__mask { position: absolute; left: 0; top: 0; letter-spacing: .06em; opacity: 0; visibility: hidden; transform: translateY(8px); transition-delay: 0s, 0s, .3s; }
.as-demo.is-masked .as-amount__value { opacity: 0; visibility: hidden; transform: translateY(-8px); transition-delay: 0s, 0s, .3s; }
.as-demo.is-masked .as-amount__mask { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }

.as-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 24px;
  border-radius: 8px;
  background: var(--as-blue);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
}
.as-btn--light { background: #fff; color: var(--as-blue); }

/* Payment cards (Cards tab) */
.as-card--pay {
  flex: 0 0 min(420px, calc((100% - var(--as-gap)) / 2));
  display: block;
  height: 224px;
  padding: 0;
  border: 0;
  background: #0e346f;
  color: #fff;
}
.as-pay--rose { background: #1f060c; }
.as-pay__bg { position: absolute; inset: 0; }
.as-stage .as-pay__bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.as-pay__texture { mix-blend-mode: soft-light; }
.as-pay__logo { position: absolute; }
.as-pay__logo--mc { right: 15px; top: 15px; width: 30.6px; height: 30.6px; }
.as-stage .as-pay__logo--mc img { position: absolute; left: 0; top: 5.74px; width: 30.6px; height: 19.12px; }
.as-pay__logo--amex { right: 16px; top: 16px; width: 32px; height: 32px; }
.as-stage .as-pay__logo--amex img { position: absolute; left: 4px; top: 4px; width: 24px; height: 24px; }
.as-pay__name { position: absolute; left: 16px; top: 24px; font-size: 14px; font-weight: 500; line-height: 20px; }
.as-pay__details { position: absolute; left: 16px; right: 0; top: 76px; height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.as-pay--rose .as-pay__details { top: 78px; }
.as-pay__col, .as-pay__foot { display: flex; flex-direction: column; gap: 4px; }
.as-pay__foot { position: absolute; left: 16px; top: 152px; }
.as-pay--rose .as-pay__foot { top: 156px; }
.as-pay__label { font-size: 12px; line-height: 20px; }
.as-pay__num { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; line-height: 20px; white-space: nowrap; }
.as-pay__value .as-amount, .as-pay__value .as-amount small { font-size: 18px; line-height: 24px; }
.as-eye { width: 20px; height: 20px; }
.as-tag { padding: 0 8px; border: 1px solid; border-radius: 4px 0 0 4px; font-size: 12px; line-height: 20px; white-space: nowrap; }
.as-tag--credit { background: #e4f5fe; border-color: #81d1f9; color: #3584ac; }
.as-tag--debit { background: #fef8e6; border-color: #ffb066; color: #b2631a; }

/* Arrows (Figma Icon Button): centred on the row's edge, hidden where you can't go. */
.as-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #4b5563;
  border-radius: 50%;
  background: rgba(0, 0, 0, .45);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  cursor: pointer;
  transform: translateY(-50%);
  transition: opacity .2s ease, visibility .2s, background-color .2s ease, transform .2s var(--as-ease);
}
.as-arrow img { width: 24px; height: 24px; }
.as-arrow--prev img { transform: scaleX(-1); }
.as-arrow--prev { left: -20px; }
.as-arrow--next { right: -20px; }
.as-arrow:hover { background: rgba(0, 0, 0, .7); }
.as-arrow:active { transform: translateY(-50%) scale(.94); }
.as-arrow:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.as-arrow:disabled { opacity: 0; visibility: hidden; pointer-events: none; }
@media (pointer: coarse) { .as-arrow { width: 44px; height: 44px; } }

.as-demo figcaption { padding-top: 12px; color: var(--sf-text-2); font-size: .875rem; line-height: 1.6; }
.as-demo figcaption strong { color: var(--sf-ink); }

/* Narrower frames show three, two, then one card and a peek of the next. */
@container (max-width: 1000px) {
  .as-card { flex-basis: calc((100% - 2 * var(--as-gap)) / 3); }
  .as-card--pay { flex-basis: min(420px, calc((100% - var(--as-gap)) / 2)); }
}
@container (max-width: 720px) {
  .as-card { flex-basis: calc((100% - var(--as-gap)) / 2); }
}
@container (max-width: 500px) {
  .as-stage { --as-gap: 14px; padding: 18px 16px 22px; }
  .as-tabs { gap: 8px; }
  .as-card { flex-basis: 84%; padding: 20px; }
  .as-card--pay { flex-basis: 92%; padding: 0; }
  .as-arrow--prev { left: -12px; }
  .as-arrow--next { right: -12px; }
}

@media (prefers-reduced-motion: reduce) {
  .as-tab, .as-tab::after, .as-tab__reveal, .as-switch, .as-switch__thumb, .as-arrow, .as-amount__value, .as-amount__mask, .as-view__btn { transition: none; }
  .as-tab[aria-selected="true"] .as-art { animation: none; }
  .as-viewport { scroll-behavior: auto; }
}
@media (forced-colors: active) {
  .as-tab, .as-card, .as-arrow, .as-switch { border: 1px solid CanvasText; }
  .as-tab[aria-selected="true"] { outline: 3px solid Highlight; }
  .as-btn { border: 1px solid ButtonText; }
  .as-switch[aria-checked="true"] .as-switch__thumb { background: Highlight; }
}

/* ==========================================================================
   Hero scene (.ash): the snapshot rebuilt from the Figma frames, in 3D
   Markup: site/content/account-snapshot-hero.mjs. Motion: initHero in
   assets/js/account-snapshot.js.

   Every length is a Figma pixel times --u, so the scene scales with its column
   and keeps the design's proportions. The 3D tree: .ash__scene holds the
   perspective; .ash__enter, .ash__float and .ash__tilt preserve 3D and each own
   one move (entrance, idle float, pointer tilt); the screen plane sits at z 0
   and the tabs, indicator and cards float above it at their own depths.
   Only transform and opacity animate. Nothing that flattens 3D (opacity below
   1, overflow, filters, masks) sits on a preserve-3d box.
   ========================================================================== */

@property --u { syntax: "<length>"; inherits: true; initial-value: 1px; }

.sf-design-preview .sf-preview-stage--live:has(> .ash) {
  display: block; height: auto; min-height: 0; padding: 0; overflow: visible;
  border: 0; border-radius: 0; background: none; box-shadow: none;
}
.sf-design-preview .sf-preview-stage--live:has(> .ash)::before,
.sf-design-preview .sf-preview-stage--live:has(> .ash)::after { content: none; }

.ash {
  --violet: #786cfa;
  --blue: #1c3fca;
  --ink: #111827;
  --a: 0;          /* active product group, 0–3 */
  --cy: 223;       /* next-arrow top, per group (Figma) */
  --out: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.4, .5, 1);
  --in: cubic-bezier(.55, 0, .9, .45);
  container: ash / inline-size;
  position: relative;
  width: 100%;
  /* The narrow board only clips visually (clip-path keeps the card moves 3D), so its
     755 px rows would still widen the page; this keeps them out of layout. */
  overflow: clip;
  color: #fff;
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-feature-settings: "ss01" 1;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.ash[data-state="1"] { --a: 1; --cy: 216; }
.ash[data-state="2"] { --a: 2; --cy: 203; }
.ash[data-state="3"] { --a: 3; --cy: 192; }
.ash *, .ash *::before, .ash *::after { box-sizing: border-box; }
/* The preview stage sizes and shadows every image (.sf-preview-stage img); the scene sizes its own. */
.ash img { display: block; max-width: none; min-height: 0; object-fit: fill; filter: none; }

.ash__scene {
  --sw: 900;                 /* scene width, design px */
  --bw: 775;                 /* board width: the Figma frame */
  --u: calc(100cqw / var(--sw));
  position: relative;
  height: calc(var(--u) * 480);
  perspective: calc(var(--u) * 1900);
  perspective-origin: 50% 36%;
  transition: opacity .7s ease;
}
.ash__enter, .ash__float, .ash__tilt {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}
.ash__enter { transition: transform 1.3s var(--out); }
.ash__float { animation: ash-float 8s ease-in-out infinite; }
.ash__tilt { transform: rotateX(10deg) rotateY(-14deg); transform-origin: 50% 50%; }

@keyframes ash-float {
  0%, 100% { transform: translate3d(0, 0, 0) rotateX(0deg); }
  50% { transform: translate3d(0, calc(var(--u) * -9), 0) rotateX(1.4deg); }
}

/* Screen plane and its shadow */
.ash__surface, .ash__floor {
  position: absolute;
  left: calc(var(--u) * (var(--sw) - var(--bw) - 64) / 2);
  width: calc(var(--u) * (var(--bw) + 64));
}
.ash__surface {
  top: calc(var(--u) * 34);
  height: calc(var(--u) * 412);
  border-radius: calc(var(--u) * 28);
  border: 1px solid rgba(255, 255, 255, .08);
  background:
    radial-gradient(60% 75% at 14% 0%, rgba(120, 108, 250, .22), transparent 70%),
    radial-gradient(50% 60% at 100% 100%, rgba(28, 63, 202, .16), transparent 70%),
    linear-gradient(165deg, #25252c 0%, #1c1c21 48%, #151519 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07);
  overflow: hidden;
}
.ash__glare { position: absolute; inset: 0; pointer-events: none; }
.ash__glare i {
  position: absolute;
  left: 10%; top: -30%;
  width: 70%; height: 120%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .07), transparent);
}
.ash__floor {
  top: calc(var(--u) * 396);
  height: calc(var(--u) * 90);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(14, 10, 48, .42), transparent);
  transform: translateZ(calc(var(--u) * -70));
}

.ash__board {
  position: absolute;
  left: calc(var(--u) * (var(--sw) - var(--bw)) / 2);
  top: calc(var(--u) * 66);
  width: calc(var(--u) * var(--bw));
  height: calc(var(--u) * 348);
  transform-style: preserve-3d;
}

/* ---- Product tabs (Local Navigation Tabs) ---------------------------------- */
.ash__strip {
  --shift: max(0, var(--a) * 102.6 + 258 - var(--bw));   /* keep the open tab in view */
  position: absolute;
  left: 0; top: 0;
  width: calc(var(--u) * 755);
  height: calc(var(--u) * 86);
  transform-style: preserve-3d;
  transform: translate3d(calc(var(--u) * var(--shift) * -1), 0, calc(var(--u) * 10));
  transition: transform .64s var(--out);
}
.ash-pill {
  position: absolute;
  left: 0;
  top: calc(var(--u) * 32);
  width: calc(var(--u) * 90.6);
  height: calc(var(--u) * 44);
  /* Tabs after the open one sit 151.4 px further right: the open tab is 242 wide, a closed one 90.6. */
  transform: translate3d(calc(var(--u) * (var(--i) * 102.6 + clamp(0, var(--i) - var(--a), 1) * 151.4)), 0, 0);
  transition: transform .64s var(--out);
}
.ash-pill__face {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border: 1px solid #4b5563;
  border-radius: calc(var(--u) * 20);
  background: rgba(0, 0, 0, .1);
  font-size: calc(var(--u) * 14);
  line-height: calc(var(--u) * 20);
  white-space: nowrap;
  transition: opacity .3s ease .26s, transform .16s ease;
}
.ash-pill.is-active .ash-pill__face { opacity: 0; transition: opacity .16s ease, transform .16s ease; }
.ash-pill.is-press .ash-pill__face { transform: scale(.94); }
.ash-pill::after, .ash-switch::after {
  content: "";
  position: absolute;
  inset: calc(var(--u) * -5);
  border: calc(var(--u) * 2) solid rgba(141, 129, 255, .8);
  border-radius: calc(var(--u) * 26);
  opacity: 0;
  pointer-events: none;
}

/* The open tab: one 242 × 78 pill that slides, with one face per group */
.ash-ind {
  position: absolute;
  left: 0;
  top: calc(var(--u) * -2);
  width: calc(var(--u) * 242);
  height: calc(var(--u) * 78);
  transform-style: preserve-3d;
  transform: translate3d(calc(var(--u) * var(--a) * 102.6), 0, calc(var(--u) * 14));
  transition: transform .64s var(--out);
}
.ash-ind__bg {
  position: absolute;
  inset: 0;
  border: 1px solid var(--violet);
  border-radius: calc(var(--u) * 20);
  background: #1b1b20;
  box-shadow: inset 0 calc(var(--u) * -5) 0 var(--violet), 0 calc(var(--u) * 14) calc(var(--u) * 30) calc(var(--u) * -10) rgba(88, 61, 208, .55);
}
.ash-ind__caret {
  position: absolute;
  left: calc(var(--u) * 29.75);
  top: calc(var(--u) * 74.5);
  width: calc(var(--u) * 18.1138);
  height: calc(var(--u) * 12.2035);
  transform: rotate(180deg);
}
.ash-ind__caret img { width: 100%; height: 100%; }
.ash-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  gap: calc(var(--u) * 8);
  padding: calc(var(--u) * 13.5) calc(var(--u) * 17) 0;
  transform-style: preserve-3d;
}
.ash-art {
  position: relative;
  flex: none;
  width: calc(var(--u) * 40);
  height: calc(var(--u) * 40);
  opacity: 0;
  transform: translate3d(0, calc(var(--u) * 8), calc(var(--u) * 22)) scale(.4) rotate(-22deg);
  transition: transform .2s var(--in), opacity .16s ease-in;
}
.ash-art img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.ash-art--inset img { left: calc(var(--u) * 4.8); top: calc(var(--u) * 4.8); width: calc(var(--u) * 30.4); height: calc(var(--u) * 30.4); }
.ash-art--crop { overflow: hidden; border-radius: calc(var(--u) * 8); }
.ash-art--crop img { left: calc(var(--u) * -5.74); top: calc(var(--u) * -6.2); width: calc(var(--u) * 40.8659); height: calc(var(--u) * 41.9045); }
.ash-face__text {
  display: flex;
  flex-direction: column;
  gap: calc(var(--u) * 4);
  white-space: nowrap;
  opacity: 0;
  transform: translate3d(calc(var(--u) * -10), 0, calc(var(--u) * 4));
  transition: transform .18s var(--in), opacity .14s ease-in;
}
.ash-face__text b { font-weight: 600; font-size: calc(var(--u) * 16); line-height: calc(var(--u) * 22); }
.ash-face__text span { color: #e5e7eb; font-size: calc(var(--u) * 12); line-height: calc(var(--u) * 20); }
.ash-face.is-on .ash-art {
  opacity: 1;
  transform: translate3d(0, 0, calc(var(--u) * 22)) scale(1) rotate(0deg);
  transition: transform .72s var(--spring) .22s, opacity .22s ease-out .22s;
}
.ash-face.is-on .ash-face__text {
  opacity: 1;
  transform: translate3d(0, 0, calc(var(--u) * 4));
  transition: transform .5s var(--out) .26s, opacity .3s ease-out .26s;
}
.ash-face.is-on .ash-art img { animation: ash-bob 3.4s ease-in-out 1.2s infinite; }
@keyframes ash-bob {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(0, calc(var(--u) * -2.5), 0) rotate(-4deg); }
}

/* ---- Card panels: one per group, entering and leaving in a stagger ------------ */
.ash-panel {
  position: absolute;
  left: 0;
  top: calc(var(--u) * 102);
  width: calc(var(--u) * 755);
  transform-style: preserve-3d;
}
.ash-row {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  gap: calc(var(--u) * 24);
  width: 100%;
  transform-style: preserve-3d;
}
.ash-panel--accounts .ash-row { top: calc(var(--u) * 36); }
.ash-panel--cards .ash-row { top: calc(var(--u) * 22); }
.ash-panel--deposits .ash-row { top: calc(var(--u) * 8); }

/* Waiting (below, tipped back) → .is-on (in place) → .is-off (lifted away). */
.ash-panel > .ash-balance,
.ash-row > * {
  --z: 26;
  visibility: hidden;
  opacity: 0;
  transform: translate3d(0, calc(var(--u) * 34), calc(var(--u) * -40)) rotateX(-22deg);
  transform-origin: 50% 100%;
  transition: none;
}
.ash-row > .ash-banner { --z: 44; }
.ash-panel > .ash-balance { --z: 16; }
.ash-panel.is-on > .ash-balance,
.ash-panel.is-on .ash-row > * {
  visibility: visible;
  opacity: 1;
  transform: translate3d(0, 0, calc(var(--u) * var(--z)));
  transition:
    transform .86s var(--spring) calc(.3s + var(--n) * 75ms),
    opacity .42s ease-out calc(.3s + var(--n) * 75ms),
    visibility 0s;
}
.ash-panel.is-off > .ash-balance,
.ash-panel.is-off .ash-row > * {
  visibility: visible;
  opacity: 0;
  transform: translate3d(0, calc(var(--u) * -14), calc(var(--u) * -70)) rotateX(14deg);
  transition:
    transform .36s var(--in) calc(var(--n) * 35ms),
    opacity .24s ease-in calc(var(--n) * 35ms),
    visibility 0s;
}

/* Show Balance */
.ash-balance {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: flex-start;
  gap: calc(var(--u) * 11);
  font-weight: 600;
  font-size: calc(var(--u) * 14);
  line-height: calc(var(--u) * 20);
  white-space: nowrap;
}
.ash-switch { position: relative; flex: none; width: calc(var(--u) * 36); height: calc(var(--u) * 20); }
.ash-switch::after { inset: calc(var(--u) * -4); border-radius: calc(var(--u) * 14); }
.ash-switch__off, .ash-switch__on { position: absolute; inset: 0; border-radius: calc(var(--u) * 10); }
.ash-switch__off { background: #4b5563; }
.ash-switch__on { background: var(--blue); transition: opacity .26s ease; }
.ash-switch__thumb {
  position: absolute;
  left: calc(var(--u) * 18);
  top: calc(var(--u) * 2);
  width: calc(var(--u) * 16);
  height: calc(var(--u) * 16);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 calc(var(--u) * 1) calc(var(--u) * 5) rgba(16, 24, 40, .1);
  transition: transform .34s var(--spring);
}
.ash.is-masked .ash-switch__on { opacity: 0; }
.ash.is-masked .ash-switch__thumb { transform: translateX(calc(var(--u) * -16)); }

/* Slider cards (light) */
.ash-card {
  position: relative;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: calc(var(--u) * 14);
  width: calc(var(--u) * 235.67);
  height: calc(var(--u) * 210);
  padding: calc(var(--u) * 24);
  border: 1px solid #ecedf3;
  border-radius: calc(var(--u) * 16);
  color: var(--ink);
  box-shadow:
    0 calc(var(--u) * 1) calc(var(--u) * 5) rgba(16, 24, 40, .1),
    0 calc(var(--u) * 24) calc(var(--u) * 40) calc(var(--u) * -16) rgba(6, 4, 24, .6);
}
.ash-card--lilac { background: conic-gradient(from 47deg at 45.2% 28.6%, #e6ddfe, #f4f0ff); }
.ash-card--ice { background: conic-gradient(from 44deg at 45.2% 28.6%, #d0ddfc, #e4ecff); }
.ash-card--spread { justify-content: space-between; gap: 0; }
.ash-panel--deposits .ash-row > * { height: calc(var(--u) * 238); }
.ash-panel--loans .ash-row > * { height: calc(var(--u) * 220); }
.ash-card__row { display: flex; align-items: flex-start; justify-content: space-between; }
.ash-card__body { display: flex; flex-direction: column; gap: calc(var(--u) * 16); }
.ash-card__text { display: flex; flex-direction: column; gap: calc(var(--u) * 4); }
.ash-card__label { font-size: calc(var(--u) * 14); line-height: calc(var(--u) * 20); white-space: nowrap; }
.ash-card__label small { margin-left: calc(var(--u) * 4); font-size: calc(var(--u) * 10); }
.ash-card__note { color: #545964; font-size: calc(var(--u) * 12); line-height: calc(var(--u) * 20); white-space: nowrap; }
.ash-amount {
  position: relative;
  display: block;
  font-weight: 600;
  font-size: calc(var(--u) * 20);
  line-height: calc(var(--u) * 28);
  white-space: nowrap;
}
.ash-amount small { font-size: calc(var(--u) * 18); line-height: calc(var(--u) * 24); }
.ash-amt, .ash-mask { display: inline-block; transition: transform .3s var(--out), opacity .22s ease; }
.ash-mask { position: absolute; left: 0; top: 0; letter-spacing: .06em; opacity: 0; transform: translateY(calc(var(--u) * 8)); }
.ash.is-masked .ash-amt { opacity: 0; transform: translateY(calc(var(--u) * -8)); }
.ash.is-masked .ash-mask { opacity: 1; transform: none; }

.ash-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(var(--u) * 40);
  padding: 0 calc(var(--u) * 24);
  border-radius: calc(var(--u) * 8);
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  font-size: calc(var(--u) * 14);
  line-height: calc(var(--u) * 20);
  white-space: nowrap;
}
.ash-btn--light { background: #fff; color: var(--blue); }

.ash-icon { position: relative; display: block; flex: none; width: calc(var(--u) * 40); height: calc(var(--u) * 40); overflow: hidden; }
.ash-icon img { width: 100%; height: 100%; }
.ash-icon--sukanya img { position: absolute; left: calc(var(--u) * 1.355); top: calc(var(--u) * .5); width: calc(var(--u) * 37.2895); height: calc(var(--u) * 39); }
.ash .ash-go { flex: none; width: calc(var(--u) * 24); height: calc(var(--u) * 24); }
.ash .ash-go--sm { width: calc(var(--u) * 20); height: calc(var(--u) * 20); }
/* Figma recolours these icons through the icon organism's colour layer; the mask does the same. */
.ash-tint {
  display: block;
  background-color: currentColor;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}
.ash-tint--blue { color: var(--blue); }
.ash-tint--violet { color: var(--violet); }
.ash-tint--white { color: #fff; }

/* Banner cards (offers) */
.ash-banner {
  position: relative;
  flex: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: calc(var(--u) * 235.67);
  height: calc(var(--u) * 210);
  padding: calc(var(--u) * 24);
  border-radius: calc(var(--u) * 16);
  box-shadow: 0 calc(var(--u) * 28) calc(var(--u) * 44) calc(var(--u) * -14) rgba(24, 10, 80, .7);
}
.ash-banner--violet { background: conic-gradient(from 52deg at 39.6% 28%, #583dd0, #7454f2); }
.ash-banner--blue { background: conic-gradient(from 51deg at 39.6% 28%, #1c3fca, #3557d4 50%, #4f6fdf); }
.ash-banner--deposits { justify-content: flex-start; gap: calc(var(--u) * 16); }
.ash-banner__body { display: flex; flex-direction: column; gap: calc(var(--u) * 16); }
.ash-banner__title { width: calc(var(--u) * 187.67); font-weight: 600; font-size: calc(var(--u) * 16); line-height: calc(var(--u) * 22); }
.ash-banner--deposits .ash-banner__title { height: calc(var(--u) * 66); }

/* Payment cards (Cards tab) */
.ash-pay {
  --z: 30;
  position: relative;
  flex: none;
  width: calc(var(--u) * 365.5);
  height: calc(var(--u) * 224);
  border-radius: calc(var(--u) * 16);
  color: #fff;
  box-shadow: 0 calc(var(--u) * 28) calc(var(--u) * 46) calc(var(--u) * -16) rgba(4, 4, 20, .75);
}
.ash-pay__bg { position: absolute; left: 0; top: 0; width: calc(var(--u) * 366.2); height: calc(var(--u) * 223.75); }
.ash-pay__bg img { position: absolute; inset: 0; width: 100%; height: 100%; }
.ash-pay__texture { mix-blend-mode: soft-light; }
.ash-pay__bg--rose {
  height: calc(var(--u) * 224);
  -webkit-mask: url(../images/case-studies/hdfc-snapshot/card-rose-mask.svg) 0 0 / 100% 100% no-repeat;
  mask: url(../images/case-studies/hdfc-snapshot/card-rose-mask.svg) 0 0 / 100% 100% no-repeat;
}
.ash-pay__bg--rose img { width: calc(var(--u) * 365.809); }
.ash-pay__logo { position: absolute; }
.ash-pay__logo--mc { right: calc(var(--u) * 14.8); top: calc(var(--u) * 15.3); width: calc(var(--u) * 30.598); height: calc(var(--u) * 30.598); }
.ash-pay__logo--mc img { position: absolute; left: 0; top: calc(var(--u) * 5.737); width: 100%; height: calc(var(--u) * 19.124); }
.ash-pay__logo--amex { right: calc(var(--u) * 15.5); top: calc(var(--u) * 16); width: calc(var(--u) * 32); height: calc(var(--u) * 32); }
.ash-pay__logo--amex img { position: absolute; left: calc(var(--u) * 4); top: calc(var(--u) * 4); width: calc(var(--u) * 24); height: calc(var(--u) * 24); }
.ash-pay__name { position: absolute; left: calc(var(--u) * 16); top: calc(var(--u) * 24); font-weight: 500; font-size: calc(var(--u) * 14); line-height: calc(var(--u) * 20); }
.ash-pay__details {
  position: absolute;
  left: calc(var(--u) * 16);
  right: calc(var(--u) * -.5);
  top: calc(var(--u) * 76);
  height: calc(var(--u) * 44);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ash-pay__details--low { top: calc(var(--u) * 78); }
.ash-pay__col, .ash-pay__foot { display: flex; flex-direction: column; gap: calc(var(--u) * 4); }
.ash-pay__foot { position: absolute; left: calc(var(--u) * 16); top: calc(var(--u) * 152); }
.ash-pay__foot--linked { top: calc(var(--u) * 156); }
.ash-pay__label { font-size: calc(var(--u) * 12); line-height: calc(var(--u) * 20); }
.ash-pay__num { display: flex; align-items: center; gap: calc(var(--u) * 8); font-weight: 500; font-size: calc(var(--u) * 14); line-height: calc(var(--u) * 20); white-space: nowrap; }
.ash-pay__value { font-weight: 600; font-size: calc(var(--u) * 18); line-height: calc(var(--u) * 24); }
.ash-eye { flex: none; width: calc(var(--u) * 20); height: calc(var(--u) * 20); }
.ash-tag {
  padding: 0 calc(var(--u) * 8);
  border: 1px solid;
  border-radius: calc(var(--u) * 4) 0 0 calc(var(--u) * 4);
  font-size: calc(var(--u) * 12);
  line-height: calc(var(--u) * 20);
  white-space: nowrap;
}
.ash-tag--credit { background: #e4f5fe; border-color: #81d1f9; color: #3584ac; }
.ash-tag--debit { background: #fef8e6; border-color: #ffb066; color: #b2631a; }

/* Next arrow: rides at the card row's centre for each group, nearest the viewer */
.ash-next {
  position: absolute;
  left: calc(var(--u) * (var(--bw) - 41));
  top: 0;
  transform: translate3d(0, calc(var(--u) * var(--cy)), calc(var(--u) * 64));
  transition: transform .64s var(--out);
}
.ash-next__btn {
  display: flex;
  padding: calc(var(--u) * 8);
  border: 1px solid #4b5563;
  border-radius: calc(var(--u) * 68);
  background: rgba(10, 10, 14, .6);
  box-shadow: 0 calc(var(--u) * 10) calc(var(--u) * 22) rgba(0, 0, 0, .35);
}
.ash-next__btn img { width: calc(var(--u) * 24); height: calc(var(--u) * 24); }

/* ---- Entrance (script only: without it the scene is simply there) ------------- */
.ash.is-armed:not(.is-in) .ash__scene { opacity: 0; }
.ash.is-armed:not(.is-in) .ash__enter { transform: translate3d(0, calc(var(--u) * 70), calc(var(--u) * -160)) rotateX(24deg); }
.ash.is-paused .ash__float, .ash.is-still .ash__float,
.ash.is-paused .ash-face.is-on .ash-art img, .ash.is-still .ash-face.is-on .ash-art img { animation-play-state: paused; }

/* ---- Narrow columns: a 440 px window onto the same board ----------------------
   The tab strip slides to keep the open tab in view, as it scrolls on a phone. The
   clip flattens the board, so the board gets its own perspective for the card moves. */
@container ash (max-width: 520px) {
  .ash__scene { --sw: 540; --bw: 440; }
  .ash__board {
    perspective: calc(var(--u) * 1600);
    clip-path: inset(calc(var(--u) * -30) 0 calc(var(--u) * -70) 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ash *, .ash *::before, .ash *::after { transition: none !important; animation: none !important; }
}
@media (forced-colors: active) {
  .ash-card, .ash-banner, .ash-pay, .ash-pill__face, .ash-ind__bg, .ash-btn { border: 1px solid CanvasText; }
}
