/* Academy adaptation of the working reference gallery. */
.cp-academy-gallery { --secondary: #0b3d23; --deep: #062817; --yellow: #0b3d23; --red: #0b3d23; --page-border: #e5dca6; background: #fff9c7; color: #062817; border-top: 1px solid var(--page-border); font-family: 'Inter', sans-serif; text-align: left; scroll-margin-top: var(--spectrum-header, 89px); }
.cp-academy-gallery *, .cp-academy-gallery *::before, .cp-academy-gallery *::after { box-sizing: border-box; }
.cp-academy-gallery .eyebrow { display: block; color: inherit; font-size: .68rem; line-height: 1.5; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.cp-academy-gallery h2, .cp-academy-gallery h3 { color: inherit; }
.cp-academy-gallery p { color: #657d6b; }
.cp-academy-gallery .fluid-gallery { display: grid; }
/* The legacy global `a { transition: .3s; }` must not interpolate the
   per-frame positions from the reference's spring controller a second time. */
.cp-academy-gallery .fluid-link { min-width: 0; color: inherit; text-decoration: none; transition: none; }
.cp-academy-gallery .fluid-stage { position: relative; overflow: hidden; }
.cp-academy-gallery .fluid-stage > img { width: 100%; height: 100%; border-radius: inherit; }
.cp-academy-gallery .fluid-meta { display: flex; align-items: center; justify-content: space-between; gap: 20px; font-weight: 600; }
.cp-academy-gallery .fluid-meta > span:last-child { line-height: 1; }
.cp-academy-gallery .fluid-link:focus-visible { outline: 3px solid #0b3d23; }
/* A balanced feature gallery. No staggered column offsets or cropped score previews. */
.cp-academy-gallery.section { padding-block: clamp(64px,6vw,96px); }
.cp-academy-gallery > .shell, .cp-academy-gallery .feature-pin > .shell { width: min(1600px,calc(100% - 96px)); }
.cp-academy-gallery .section-heading { display: grid; grid-template-columns: minmax(0,1fr) 280px; align-items: end; gap: 48px; margin-bottom: 38px; }
.cp-academy-gallery .eyebrow { margin-bottom: 18px; }
.cp-academy-gallery h2 { font: 600 clamp(2.5rem,4.4vw,4.5rem)/1.08 'Inter',sans-serif; letter-spacing: -.045em; word-spacing: .07em; margin: 0; }
.cp-academy-gallery .section-heading > p { margin: 0; max-width: 280px; font-size: .98rem; line-height: 1.65; }
.cp-academy-gallery .fluid-gallery { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 48px 32px; align-items: start; }
.cp-academy-gallery .fluid-link { display: grid; grid-template-rows: auto auto auto 1fr; align-self: stretch; margin-top: 0; }
.cp-academy-gallery .fluid-link:nth-child(even) { margin-top: 0; }
.cp-academy-gallery .fluid-stage { width: 100%; aspect-ratio: 16/9; border-radius: 10px; background: var(--secondary); }
.cp-academy-gallery .fluid-link:nth-child(3) .fluid-stage { background: var(--deep); }
.cp-academy-gallery .fluid-link:nth-child(4) .fluid-stage { background: var(--yellow); }
.cp-academy-gallery .fluid-link:nth-child(6) .fluid-stage, .cp-academy-gallery .fluid-link:nth-child(8) .fluid-stage { background: var(--deep); }
.cp-academy-gallery .fluid-link:nth-child(7) .fluid-stage { background: var(--yellow); }
.cp-academy-gallery .fluid-stage > img { display: block; object-fit: contain; }
.cp-academy-gallery .fluid-meta { margin: 20px 0 13px; font-size: .62rem; letter-spacing: .06em; }
.cp-academy-gallery .fluid-meta > span:last-child { font-size: 1.4rem; }
.cp-academy-gallery .fluid-link h3 { font: 600 clamp(1.65rem,2.2vw,2.5rem)/1.16 'Inter',sans-serif; letter-spacing: -.035em; word-spacing: .04em; margin: 0 0 14px; }
.cp-academy-gallery .fluid-link > p { font-size: .94rem; line-height: 1.65; max-width: 550px; margin: 0; }
.cp-academy-gallery .fluid-link:focus-visible { outline-offset: 8px; border-radius: 10px; }
@media (max-width: 1000px) {
    .cp-academy-gallery > .shell, .cp-academy-gallery .feature-pin > .shell { width: calc(100% - 64px); }
    .cp-academy-gallery .section-heading { grid-template-columns: minmax(0,1fr) 250px; gap: 30px; }
    .cp-academy-gallery .fluid-gallery { gap: 38px 24px; }
    .cp-academy-gallery .fluid-link h3 { font-size: 1.7rem; }
    .cp-academy-gallery .fluid-link > p { font-size: .88rem; }
}
@media (max-width: 760px) {
    .cp-academy-gallery .section-heading { grid-template-columns: 1fr; gap: 16px; margin-bottom: 28px; }
    .cp-academy-gallery .section-heading > p { max-width: 400px; font-size: .92rem; }
    .cp-academy-gallery .fluid-gallery { grid-template-columns: 1fr; gap: 36px; }
    .cp-academy-gallery .fluid-link h3 { font-size: 1.9rem; }
}
@media (max-width: 640px) {
    .cp-academy-gallery > .shell, .cp-academy-gallery .feature-pin > .shell { width: calc(100% - 40px); }
    .cp-academy-gallery.section { padding-block: 56px; }
    .cp-academy-gallery h2 { font-size: clamp(2.3rem,8vw,3rem); }
    .cp-academy-gallery .fluid-stage { aspect-ratio: 4/3; }
    .cp-academy-gallery .fluid-meta { margin: 17px 0 12px; font-size: .56rem; }
    .cp-academy-gallery .fluid-link h3 { font-size: 1.65rem; }
}

/* TinyWins spectrum: one active image, progressively smaller neighbours, captions below. */
.cp-academy-gallery { isolation: isolate; position: relative; z-index: 1; }
.feature-spectrum-controls { display: none; }
.cp-academy-gallery.tinywins-active { padding: 0; }
.tinywins-active .feature-pin { position: sticky; top: var(--spectrum-header,84px); height: calc(100svh - var(--spectrum-header,84px)); overflow: clip; contain: layout paint; isolation: isolate; }
.cp-academy-gallery:not(.is-in-view) .feature-pin { pointer-events: none; }
.tinywins-active .feature-pin > .shell { width: min(1600px,calc(100% - 64px)); height: 100%; display: flex; flex-direction: column; padding: 24px 0 18px; }
.tinywins-active .section-heading { flex: 0 0 auto; margin-bottom: 12px; gap: 30px; }
.tinywins-active .section-heading .eyebrow { margin-bottom: 12px; }
.cp-academy-gallery.tinywins-active h2 { font-size: clamp(2.3rem,3.6vw,3.6rem); }
.tinywins-active .section-heading > p { font-size: .85rem; }
.tinywins-active .fluid-gallery { display: block; position: relative; flex: 1; min-height: 0; overflow: visible; }
.tinywins-active .fluid-link, .tinywins-active .fluid-link:nth-child(even) { position: absolute; top: calc(50% - var(--spectrum-caption-space,156px)/2); left: 0; display: block; margin: 0; width: var(--spectrum-base-width); transform: translate3d(0,-50%,0); will-change: transform; pointer-events: none; }
.tinywins-active .fluid-stage { aspect-ratio: 16/9; overflow: hidden; clip-path: inset(0 round 10px); transition: clip-path .35s cubic-bezier(.22,1,.36,1); transform-origin: left center; will-change: transform; pointer-events: auto; backface-visibility: hidden; }
.tinywins-active .fluid-stage > img { opacity: 1; transform: scale(.98); transition: transform .65s cubic-bezier(.22,1,.36,1); }
.tinywins-active .fluid-link:hover .fluid-stage { clip-path: inset(4px round 10px); }
.tinywins-active .fluid-link:hover .fluid-stage > img { transform: scale(1); }
.tinywins-active .fluid-meta, .tinywins-active .fluid-link h3, .tinywins-active .fluid-link > p { position: absolute; left: 0; width: var(--spectrum-caption-width); opacity: 0; transform: translate3d(0,14px,0); pointer-events: none; margin: 0; }
.tinywins-active .spectrum-selected .fluid-meta, .tinywins-active .spectrum-selected h3, .tinywins-active .spectrum-selected > p { pointer-events: auto; animation: spectrum-caption-in .2s ease-out; }
@keyframes spectrum-caption-in { from { opacity: .45; } }
.tinywins-active .fluid-meta { top: calc(100% + 16px); font-size: .59rem; }
.tinywins-active .fluid-link h3 { top: calc(100% + 46px); font-size: clamp(1.3rem,1.8vw,1.9rem); line-height: 1.2; }
.tinywins-active .fluid-link > p { top: calc(100% + var(--spectrum-copy-top,90px)); font-size: .85rem; max-width: none; line-height: 1.55; }
.tinywins-active .feature-spectrum-controls { display: flex; flex: 0 0 46px; justify-content: space-between; align-items: center; gap: 24px; border-top: 1px solid var(--page-border); margin-top: 16px; padding-top: 10px; color: var(--secondary); }
.feature-spectrum-cue, .feature-spectrum-count { font-size: .58rem; font-weight: 700; letter-spacing: .1em; min-width: 110px; }
.feature-spectrum-count { text-align: right; }
.feature-spectrum-bars { display: flex; align-items: center; gap: 4px; height: 44px; }
.feature-spectrum-bars button { display: grid; place-items: center; border: 0; background: transparent; padding: 0; width: 44px; height: 44px; }
.feature-spectrum-bars button > span { display: block; width: 3px; height: 32px; transform: scaleY(.25); background: var(--secondary); border-radius: 3px; transition: background-color .18s ease; }
.feature-spectrum-bars button[aria-current='true'] > span { background: var(--red); }
.cp-academy-gallery.spectrum-reveals:not(.tinywins-active) .fluid-stage { clip-path: inset(0 0 22% round 10px); transform: translateY(32px) scale(.96); opacity: 0; transition: clip-path .9s cubic-bezier(.22,1,.36,1),transform .9s cubic-bezier(.22,1,.36,1),opacity .5s ease; }
.cp-academy-gallery.spectrum-reveals:not(.tinywins-active) .spectrum-visible .fluid-stage { clip-path: inset(0 round 10px); transform: none; opacity: 1; }
@media (prefers-reduced-motion: reduce) {
    .cp-academy-gallery.spectrum-reveals .fluid-stage { clip-path: none; transform: none; opacity: 1; transition: none; }
}

@media (min-height: 500px) and (max-height: 719px) {
    .cp-academy-gallery.tinywins-active .feature-pin > .shell { padding-block: 16px 10px; }
    .cp-academy-gallery.tinywins-active .section-heading { margin-bottom: 8px; }
    .cp-academy-gallery.tinywins-active .section-heading .eyebrow { font-size: .55rem; margin-bottom: 6px; }
    .cp-academy-gallery.tinywins-active h2 { font-size: clamp(1.65rem, 3vw, 2.2rem); }
    .cp-academy-gallery.tinywins-active .section-heading > p { font-size: .75rem; line-height: 1.45; }
    .cp-academy-gallery.tinywins-active .fluid-meta { top: calc(100% + 10px); font-size: .52rem; }
    .cp-academy-gallery.tinywins-active .fluid-link h3 { top: calc(100% + 30px); font-size: 1.1rem; }
    .cp-academy-gallery.tinywins-active .fluid-link > p { font-size: .76rem; line-height: 1.5; }
    .cp-academy-gallery.tinywins-active .feature-spectrum-controls { flex-basis: 36px; margin-top: 8px; padding-top: 6px; }
}

/* Academy and Marketplace share the phone spectrum; desktop retains its existing
   layout. The active screenshot is centred, captions stay full-size. */
@media (max-width: 999px) {
    :is(#academy, #marketplace).spectrum-mobile .feature-pin > .shell { width: calc(100% - 40px); padding: 20px 0 max(12px,env(safe-area-inset-bottom,0px)); }
    :is(#academy, #marketplace).spectrum-mobile .section-heading { grid-template-columns: 1fr; gap: 10px; margin-bottom: 8px; }
    :is(#academy, #marketplace).spectrum-mobile .eyebrow { font-size: .58rem; margin-bottom: 10px; }
    :is(#academy, #marketplace).spectrum-mobile h2 { font-size: clamp(1.85rem,7vw,2.8rem); }
    :is(#academy, #marketplace).spectrum-mobile .section-heading > p { max-width: 42ch; font-size: .8rem; line-height: 1.5; }
    :is(#academy, #marketplace).spectrum-mobile .fluid-link h3 { top: calc(100% + 38px); font-size: clamp(1.1rem,4.5vw,1.45rem); }
    :is(#academy, #marketplace).spectrum-mobile .fluid-link > p { font-size: .8rem; line-height: 1.55; }
    :is(#academy, #marketplace).spectrum-mobile .fluid-meta { gap: 8px; font-size: .56rem; }
    :is(#academy, #marketplace).spectrum-mobile .feature-spectrum-controls { display: grid; grid-template-columns: 1fr auto; gap: 0; flex: 0 0 76px; margin-top: 10px; padding-top: 8px; }
    :is(#academy, #marketplace).spectrum-mobile .feature-spectrum-cue { grid-column: 1; grid-row: 1; min-width: 0; }
    :is(#academy, #marketplace).spectrum-mobile .feature-spectrum-count { grid-column: 2; grid-row: 1; min-width: 0; }
    :is(#academy, #marketplace).spectrum-mobile .feature-spectrum-bars { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: repeat(8,minmax(0,1fr)); gap: 0; width: 100%; }
    :is(#academy, #marketplace).spectrum-mobile .feature-spectrum-bars button { width: 100%; min-width: 0; height: 44px; touch-action: manipulation; }
    :is(#academy, #marketplace).spectrum-mobile .feature-spectrum-bars button:focus-visible { outline: 2px solid var(--secondary); outline-offset: -4px; border-radius: 4px; }
    :is(#academy, #marketplace).spectrum-mobile .fluid-stage { transition: none; }
    :is(#academy, #marketplace).spectrum-mobile .fluid-link:hover .fluid-stage { clip-path: inset(0 round 10px); }
    :is(#academy, #marketplace).spectrum-mobile .fluid-stage > img { transform: scale(.98); transition: none; }
}
@media (max-width: 999px) and (max-height: 719px) {
    :is(#academy, #marketplace).spectrum-mobile .feature-pin > .shell { padding-top: 12px; }
    :is(#academy, #marketplace).spectrum-mobile .eyebrow { margin-bottom: 6px; }
    :is(#academy, #marketplace).spectrum-mobile h2 { font-size: clamp(1.55rem,6vw,2rem); }
    :is(#academy, #marketplace).spectrum-mobile .section-heading > p { display: none; }
    :is(#academy, #marketplace).spectrum-mobile .fluid-meta { top: calc(100% + 10px); }
    :is(#academy, #marketplace).spectrum-mobile .fluid-link h3 { top: calc(100% + 30px); font-size: 1.1rem; }
    :is(#academy, #marketplace).spectrum-mobile .fluid-link > p { font-size: .76rem; }
}

