/* ============ v30: the court paintings, moved by the scroll ============ */
/* ---- Home: "An old Indian tradition", a sideways glide from 1650 to today ---- */
.court { position: relative; background: var(--emerald); color: var(--ivory); }
.court-pin { padding: clamp(76px, 10svh, 104px) 0 clamp(70px, 10svh, 96px); }
.court-head { width: min(1220px, 100%); margin: 0 auto; padding-inline: var(--gutter); }
.court-head .eyebrow { color: var(--gold-lt); }
.court-head h2 { margin: .6rem 0 0; max-width: 30ch; font-family: var(--f-display); font-weight: 500; font-size: clamp(1.45rem, 1.05rem + 1.6vw, 2.5rem); line-height: 1.12; text-wrap: balance; }
.court-meta { display: flex; align-items: center; gap: 1.2rem; margin-top: clamp(.5rem, 1.6svh, 1.1rem); }
.court-year { font-family: var(--f-display); font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.6rem); color: var(--gold-lt); min-width: 4.2ch; font-variant-numeric: lining-nums; }
.court-line { position: relative; flex: 1; max-width: 420px; height: 1px; background: rgba(251, 246, 238, .18); }
.court-line i { position: absolute; inset: 0; background: var(--gold-lt); transform-origin: 0 50%; transform: scaleX(0); }
.court-track { display: flex; gap: clamp(20px, 4vw, 64px); padding: clamp(18px, 3.5svh, 40px) var(--gutter) 0; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.court-track::-webkit-scrollbar { display: none; }
.court-card { flex: 0 0 min(86vw, 1040px); scroll-snap-align: center; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(18px, 3vw, 48px); align-items: center; }
.court-art { margin: 0; overflow: hidden; }
.court-art img { display: block; width: 100%; height: min(46svh, 470px); object-fit: contain; object-position: 50% 50%; }
.court-pan img { object-fit: cover; }
.court-pan img { object-position: 50% 100%; }
.court-text h3 { margin: .35rem 0 .7rem; font-family: var(--f-display); font-weight: 500; font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.5rem); line-height: 1.1; }
.court-text p { margin: 0 0 .8rem; font-family: var(--f-display); font-size: var(--step-1); line-height: 1.45; color: rgba(251, 246, 238, .9); }
.court-text .court-kicker { font-family: var(--f-body); font-size: var(--step--2); letter-spacing: .22em; text-transform: uppercase; color: var(--gold-lt); margin: 0; }
.court-text .court-credit { font-family: var(--f-body); font-size: .78rem; line-height: 1.5; color: rgba(251, 246, 238, .55); margin-top: 1.2rem; }
.court-link { font-family: var(--f-body); font-size: var(--step--1); letter-spacing: .08em; color: var(--gold-lt); text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 2px; }
@media (max-width: 760px) {
  .court-card { flex-basis: 84vw; grid-template-columns: 1fr; gap: 14px; align-items: start; }
  .court-pin { padding-bottom: 84px; }
  .court-head h2 { font-size: 1.4rem; }
  .court-year { font-size: 1.5rem; }
  .court-art img { height: min(30svh, 270px); }
  .court-text h3 { font-size: 1.5rem; margin: .2rem 0 .4rem; }
  .court-text p { font-size: 1.04rem; margin-bottom: .5rem; }
  .court-text .court-credit { margin-top: .3rem; font-size: .7rem; }
}
/* pinned: the section is made tall by court.js, the pin holds still and the track glides */
.court-on .court-pin { position: sticky; top: 0; min-height: 100svh; box-sizing: border-box; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.court-on .court-track { overflow: visible; scroll-snap-type: none; padding-inline: 0; width: max-content; will-change: transform; }
.court-on .court-card { opacity: .38; transition: opacity .6s var(--ease); }
.court-on .court-card.is-on { opacity: 1; }
/* Chrome, Edge, Android: the browser itself ties the glide to the scroll */
@keyframes courtX { from { transform: translate3d(var(--x0, 0px), 0, 0); } to { transform: translate3d(var(--x1, 0px), 0, 0); } }
@keyframes courtBar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes courtPan { 0%, 30% { object-position: 50% 100%; } 70%, 100% { object-position: 50% 0%; } }
.court-css .court-on { view-timeline-name: --court; }
.court-css .court-on .court-track { animation: courtX linear both; animation-timeline: --court; animation-range: contain 0% contain 100%; }
.court-css .court-on .court-line i { animation: courtBar linear both; animation-timeline: --court; animation-range: contain 0% contain 100%; }
.court-css .court-on .court-pan img { animation: courtPan linear both; animation-timeline: --court; animation-range: contain 0% contain 100%; }

/* ---- Weddings and birthday: the painting holds, then pulls back from a detail to the whole ---- */
.p3-stage { position: relative; height: 210svh; margin-top: clamp(1.5rem, 3vw, 2.5rem); }
.p3-sticky { position: sticky; top: 0; height: 100svh; box-sizing: border-box; padding: 84px 0 28px; display: flex; flex-direction: column; justify-content: center; }
.p3-sticky .p3-fig { margin: 0 auto; }
.p3-zoom { overflow: hidden; }
.p3-zoom img { display: block; width: 100%; height: auto; max-width: none; transform-origin: var(--fx, 50%) var(--fy, 50%); transform: scale(var(--z, 2)); will-change: transform; }
.p3-sticky .p3-fig { width: min(1220px, 100%, calc((100svh - 190px) * var(--ar, 1.4) + 2 * var(--gutter))); }
@keyframes p3Zoom { 0% { transform: scale(var(--z, 2)); } 80%, 100% { transform: scale(1); } }
.court-css .p3-stage { view-timeline-name: --zoom; }
.court-css .p3-zoom img { animation: p3Zoom linear both; animation-timeline: --zoom; animation-range: contain 0% contain 100%; }
.court-still .p3-stage, .court-still .p3-sticky { height: auto; position: static; padding: 0; }
.court-still .p3-zoom img { transform: none; }

/* ---- Brands: the durbar pans upward, from the carpet to the throne ---- */
.p3-pan { overflow: hidden; aspect-ratio: 1 / 1; }
.p3-pan img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 100%; }
.p3-fig-tall .p3-pan { max-width: min(100%, 78svh); }
@keyframes p3Pan { from { object-position: 50% 100%; } to { object-position: 50% 0%; } }
.court-css .p3-pan { view-timeline-name: --pan; }
.court-css .p3-pan img { animation: p3Pan linear both; animation-timeline: --pan; animation-range: cover 10% cover 90%; }
.court-still .p3-pan { aspect-ratio: auto; }
.court-still .p3-pan img { height: auto; }
