/* ==========================================================================
   VIDEOS — page-scoped styles

   Direction: one light field end to end — the dark library band was removed.
   Two reasons, both practical: these thumbnails are low-contrast captures of
   lecture slides, which wash out badly on white cards; and the featured player
   straddles the boundary between the two, which gives the page a composition
   instead of a stack of rows.

   The dark surface reuses the navy/emerald band already used by the governance
   and CTA panels elsewhere on the site, so this is the house style turned up,
   not a new one. Type stays Poppins; the signature element is the oversized
   outlined lesson numeral.
   ========================================================================== */

.vd-page {
    --vd-ink: var(--gf-navy);
    --vd-ink-soft: rgba(48, 68, 79, 0.76);
    --vd-ink-faint: rgba(48, 68, 79, 0.55);
    --vd-line: rgba(94, 179, 70, 0.24);
    --vd-shadow: 0 14px 34px rgba(48, 68, 79, 0.1);

    /* Library surface tokens. This band used to be a deep forest field; it is
       light now, matching the hexagon treatment on the About page. Accent is
       split in two because the brand green is only 2.6:1 on white: the deeper
       one is for text, the brand one for fills that carry dark text. */
    --vd-surface-1: #e3f0e8;
    --vd-surface-2: #d3e7db;
    --vd-surface-3: #c7dfd0;
    --vd-accent: #3d7f31;
    --vd-accent-fill: #5eb346;
    --vd-on-surface: var(--gf-navy-deep);
    --vd-on-surface-faint: rgba(31, 47, 55, 0.66);

    font-family: "Poppins", sans-serif;
    background: linear-gradient(to right, #f1f6f7, #d5f1f1);
}

/* The theme sets a global `img, svg { border-radius: 15px }`; thumbnails are
   clipped by their own wrapper instead. Scoped, not removed globally. */
.vd-page img {
    border-radius: 0;
}

.vd-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ==========================================================================
   HERO (light band)
   ========================================================================== */
.vd-hero {
    position: relative;
    /* Clears the fixed 72px site header. */
    padding: calc(72px + clamp(2rem, 5vw, 3.5rem)) 0 0;
}

.vd-hero-aurora {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.vd-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
}

.vd-blob--a {
    top: -18%;
    left: 4%;
    width: 28rem;
    height: 28rem;
    background: rgba(94, 179, 70, 0.2);
    animation: vdDriftA 24s ease-in-out infinite alternate;
}

.vd-blob--b {
    top: -8%;
    right: -4%;
    width: 26rem;
    height: 26rem;
    background: rgba(90, 196, 180, 0.18);
    animation: vdDriftB 29s ease-in-out infinite alternate;
}

@keyframes vdDriftA {
    to { transform: translate3d(5rem, 2.5rem, 0) scale(1.1); }
}

@keyframes vdDriftB {
    to { transform: translate3d(-4rem, 3rem, 0) scale(0.92); }
}

.vd-hero .container {
    position: relative;
    z-index: 1;
}

.vd-hero-inner {
    max-width: 44rem;
    margin: 0 auto 2.4rem;
    text-align: center;
}

.vd-eyebrow {
    display: inline-block;
    margin-bottom: 0.9rem;
    padding: 0.38rem 1rem;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gf-green-dark);
    background: rgba(94, 179, 70, 0.1);
    border: 1px solid var(--vd-line);
}

.vd-title {
    margin: 0 0 1rem;
    font-weight: 700;
    font-size: clamp(1.9rem, 4.6vw, 3.2rem);
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--vd-ink);
}

.vd-title span {
    color: var(--gf-green);
}

.vd-lead {
    max-width: 38rem;
    margin: 0 auto 1.6rem;
    font-size: 1rem;
    line-height: 1.75;
    color: var(--vd-ink-soft);
}

.vd-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2.2rem;
    margin: 0;
    padding: 1.3rem 0 0;
    list-style: none;
    border-top: 1px solid rgba(48, 68, 79, 0.12);
}

.vd-stats b {
    display: block;
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1;
    color: var(--gf-green);
    font-variant-numeric: tabular-nums;
}

.vd-stats span {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.78rem;
    color: var(--vd-ink-faint);
}

/* ==========================================================================
   FEATURED — straddles the light band and the dark library below it
   ========================================================================== */
.vd-feature {
    position: relative;
    z-index: 3;
    max-width: 64rem;
    margin: 0 auto;
    /* Pulled down over the dark section; .vd-library pads to receive it. */
    margin-bottom: clamp(-9rem, -11vw, -5rem);
}

/* ==========================================================================
   FACADE
   A button holding the thumbnail. videos.js replaces it with .vd-shell holding
   the real iframe once clicked.
   ========================================================================== */
.vd-facade {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    overflow: hidden;
    line-height: 0;
    cursor: pointer;
    background: var(--vd-surface-2);
    border: none;
    border-radius: 18px;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease;
}

.vd-facade img {
    display: block;
    width: 100%;
    /* hqdefault is 4:3 with letterbox bars baked in; cropping to 16:9 removes
       them without needing maxresdefault, which is not always published. */
    aspect-ratio: 16 / 9;
    object-fit: cover;
    /* Biased above centre: most of these videos have a channel/social strip
       burned into the bottom of the frame, and an even crop keeps it. */
    object-position: 50% 42%;
    /* These thumbnails come from several channels and clash badly side by side.
       Knocking back saturation and brightness at rest pulls them into one
       family; hover restores the real image. */
    filter: saturate(0.8) brightness(0.86) contrast(1.02);
    transform: scale(1.01);
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), filter 0.45s ease;
}

.vd-facade-scrim {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(12, 31, 26, 0) 45%, rgba(12, 31, 26, 0.85) 100%),
        linear-gradient(100deg, rgba(12, 31, 26, 0.35) 0%, rgba(12, 31, 26, 0) 55%);
    transition: opacity 0.45s ease;
}

.vd-facade:hover img,
.vd-facade:focus-visible img {
    filter: saturate(1) brightness(0.98) contrast(1);
    transform: scale(1.06);
}

.vd-facade:hover .vd-facade-scrim {
    opacity: 0.72;
}

.vd-facade:focus-visible {
    outline: 3px solid var(--gf-green);
    outline-offset: 3px;
}

/* ---------- oversized outlined lesson numeral ----------
   The signature element: it reads as a course index, and gives these
   mismatched thumbnails a consistent anchor in the same corner every time. */
.vd-num {
    position: absolute;
    left: 0.85rem;
    bottom: 0.5rem;
    font-size: clamp(2.6rem, 5vw, 3.6rem);
    font-weight: 800;
    line-height: 0.9;
    letter-spacing: -0.04em;
    color: transparent;
    -webkit-text-stroke: 1.5px rgba(169, 197, 133, 0.75);
    font-variant-numeric: tabular-nums;
    pointer-events: none;
    transition: color 0.4s ease, -webkit-text-stroke-color 0.4s ease,
        transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.vd-facade:hover .vd-num {
    color: rgba(169, 197, 133, 0.22);
    -webkit-text-stroke-color: var(--gf-green);
    transform: translateY(-3px);
}

/* ---------- play button ---------- */
.vd-play {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    place-items: center;
    width: 3.4rem;
    height: 3.4rem;
    border-radius: 50%;
    font-size: 0.95rem;
    color: #0c1f1a;
    /* Nudged right so the triangle reads as centred inside the circle. */
    padding-left: 0.16rem;
    background: var(--vd-accent-fill);
    transform: translate(-50%, -50%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease,
        box-shadow 0.4s ease;
}

/* Expanding ring on hover. */
.vd-play::before {
    content: "";
    position: absolute;
    inset: -0.55rem;
    border-radius: 50%;
    border: 1px solid rgba(94, 179, 70, 0.55);
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.vd-facade:hover .vd-play {
    background: #ffffff;
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 12px 34px rgba(12, 31, 26, 0.55);
}

.vd-facade:hover .vd-play::before {
    opacity: 1;
    transform: scale(1);
}

.vd-facade--feature {
    border-radius: 26px;
    box-shadow: 0 34px 70px -26px rgba(8, 24, 20, 0.75);
}

.vd-facade--feature .vd-play {
    width: 4.6rem;
    height: 4.6rem;
    font-size: 1.3rem;
}

.vd-feature-meta {
    position: absolute;
    left: clamp(1.2rem, 3.5vw, 2.4rem);
    bottom: clamp(1.2rem, 3.5vw, 2rem);
    display: grid;
    gap: 0.35rem;
    max-width: 80%;
    text-align: left;
    line-height: 1.3;
}

.vd-feature-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--vd-accent);
}

.vd-feature-kicker::before {
    content: "";
    width: 1.8rem;
    height: 1px;
    background: var(--vd-accent-fill);
}

.vd-feature-title {
    font-size: clamp(1.05rem, 2.2vw, 1.6rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--vd-on-surface);
}

/* ---------- the live player ---------- */
.vd-shell {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    background: #000000;
}

.vd-frame {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: 0;
}

.vd-shell--feature,
.vd-shell--feature .vd-frame {
    border-radius: 26px;
}

/* ==========================================================================
   LIBRARY — the light surface
   ========================================================================== */
.vd-library {
    position: relative;
    isolation: isolate;
    /* Top padding absorbs the featured player's negative margin. */
    padding: clamp(8rem, 15vw, 11rem) 0 clamp(3rem, 6vw, 4.5rem);
    color: var(--vd-on-surface);
    background:
        radial-gradient(ellipse 60% 50% at 15% 0%, rgba(94, 179, 70, 0.13), transparent 60%),
        radial-gradient(ellipse 50% 60% at 90% 25%, rgba(45, 120, 125, 0.1), transparent 62%),
        linear-gradient(165deg, var(--vd-surface-1) 0%, var(--vd-surface-2) 55%, var(--vd-surface-3) 100%);
}

/* Hexagon motif + a fine grain, for depth rather than a flat fill. */
.vd-library-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.62;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97' viewBox='0 0 56 97'%3E%3Cpath d='M28 1L54 16v32L28 63 2 48V16z M28 63l26 15v18M28 63L2 78v18' fill='none' stroke='%235eb346' stroke-width='1'/%3E%3C/svg%3E");
    background-size: 56px 97px;
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 25%, #000 5%, transparent 75%);
    mask-image: radial-gradient(ellipse 80% 60% at 50% 25%, #000 5%, transparent 75%);
}

.vd-section-head {
    max-width: 44rem;
    margin: 0 auto 1.8rem;
    text-align: center;
}

.vd-section-title {
    margin: 0 0 0.7rem;
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    letter-spacing: -0.025em;
    color: var(--gf-navy-deep);
}

.vd-section-intro {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.75;
    color: var(--vd-on-surface-faint);
}

.vd-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.55rem;
    margin-bottom: 2.2rem;
}

.vd-filter {
    padding: 0.52rem 1.15rem;
    border-radius: 100px;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--vd-on-surface-faint);
    background: #ffffff;
    border: 1px solid rgba(11, 61, 46, 0.14);
    transition: color 0.25s ease, background 0.25s ease, border-color 0.25s ease,
        transform 0.25s ease;
}

.vd-filter:hover {
    transform: translateY(-2px);
    color: var(--gf-navy-deep);
    border-color: rgba(94, 179, 70, 0.55);
}

.vd-filter.is-active {
    color: #0c1f1a;
    background: var(--vd-accent-fill);
    border-color: transparent;
    box-shadow: 0 10px 24px rgba(94, 179, 70, 0.3);
}

/* ---------- grid ----------

   Moving border ring: the same construction as the CEO, blog and Knowledge
   Centre cards — a conic gradient masked to a 2px rim with its start angle
   animated. Redeclared here because the page stylesheets never load together. */
@property --vd-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

@keyframes vdRingSpin {
    to { --vd-angle: 360deg; }
}

.vd-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.4rem;
}

.vd-card {
    /* Wrapper only: holds the perspective and the filter transitions, and is
       never itself rotated, so the pointer target stays put. */
    display: flex;
    perspective: 900px;
    border-radius: 20px;
    opacity: 1;
    transform: none;
    transition: opacity 0.22s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.vd-card-inner {
    --vd-angle: 0deg;
    position: relative;
    display: flex;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
    /* White on the light field, lifted by a soft shadow rather than a border. */
    background: #ffffff;
    box-shadow: 0 10px 26px -16px rgba(20, 45, 34, 0.45);
    border: 1px solid rgba(11, 61, 46, 0.08);
    border-radius: 20px;
    transform-origin: center;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
        border-color 0.35s ease, box-shadow 0.35s ease;
}

/* While services-tilt.js is driving the card it writes transform inline, so
   the CSS transition is dropped to keep the follow from lagging the pointer. */
.vd-card-inner.is-tilting {
    transition: border-color 0.35s ease, box-shadow 0.35s ease;
}

.vd-card-inner::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 4;
    border-radius: inherit;
    padding: 2px;
    background: conic-gradient(from var(--vd-angle),
        #4a9e3c 0deg,
        #4a9e3c 265deg,
        #8ed157 310deg,
        #d9f5b4 332deg,
        #8ed157 352deg,
        #4a9e3c 360deg);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    animation: vdRingSpin 3.5s linear infinite;
    animation-play-state: paused;
}

.vd-card:hover .vd-card-inner::before,
.vd-card:focus-within .vd-card-inner::before {
    opacity: 1;
    animation-play-state: running;
}

/* Cursor-follow sheen, fed --mx/--my by the shared tilt loop. */
.vd-card-inner::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    border-radius: inherit;
    background: radial-gradient(
        circle at var(--mx, 50%) var(--my, 50%),
        rgba(94, 179, 70, 0.16) 0%,
        rgba(94, 179, 70, 0) 55%
    );
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.vd-card:hover .vd-card-inner::after,
.vd-card:focus-within .vd-card-inner::after {
    opacity: 1;
}

.vd-card[hidden] {
    display: none;
}

/* Filter transitions, matching the blog and Knowledge Centre grids. */
.vd-card.is-leaving {
    opacity: 0;
    transform: scale(0.94) translateY(6px);
}

.vd-card.is-entering {
    opacity: 0;
    transform: translateY(14px);
}

/* The lift lives on .vd-card-inner, which AOS never touches — so no
   specificity fight. When the tilt script is running it writes its own
   transform inline (lift included) and takes over from this. */
.vd-card:hover .vd-card-inner,
.vd-card:focus-within .vd-card-inner {
    transform: translateY(-9px);
    border-color: rgba(94, 179, 70, 0.6);
    /* Two layers: a real cast shadow for the lift, plus an emerald ring so the
       card still signals focus against a light field. */
    box-shadow:
        0 28px 52px -20px rgba(20, 45, 34, 0.45),
        0 0 0 3px rgba(94, 179, 70, 0.18);
}

/* The thumbnail zoom used to fire only when the pointer was over the facade
   itself; hovering anywhere on the card now drives it. */
.vd-card:hover .vd-facade img,
.vd-card:focus-within .vd-facade img {
    filter: saturate(1) brightness(0.98) contrast(1);
    transform: scale(1.06);
}

.vd-card:hover .vd-play,
.vd-card:focus-within .vd-play {
    transform: translate(-50%, -50%) scale(1.1);
}

.vd-card:hover .vd-card-title,
.vd-card:focus-within .vd-card-title {
    color: var(--vd-accent);
}

/* The facade fills the card's top edge, so it drops its own rounding there. */
.vd-card .vd-facade,
.vd-card .vd-shell {
    border-radius: 0;
}

.vd-card .vd-facade:hover {
    transform: none;
    box-shadow: none;
}

.vd-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.15rem 1.25rem 1.3rem;
}

.vd-card-title {
    margin: 0 0 0.6rem;
    font-size: 0.98rem;
    font-weight: 650;
    line-height: 1.45;
    letter-spacing: -0.01em;
    color: var(--vd-on-surface);
}

.vd-card-meta {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: auto 0 0;
    padding-top: 0.7rem;
    border-top: 1px solid rgba(11, 61, 46, 0.1);
    font-size: 0.78rem;
    color: var(--vd-on-surface-faint);
}

.vd-card-meta i {
    color: #e5544b;
}

.vd-no-match {
    margin: 1.8rem 0 0;
    text-align: center;
    font-size: 0.95rem;
    color: var(--vd-on-surface-faint);
}

.vd-no-match a {
    font-weight: 600;
    color: var(--vd-accent);
    text-decoration: underline;
}

/* ==========================================================================
   CLOSING BAND
   ========================================================================== */
.vd-cta {
    padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(3rem, 6vw, 4.5rem);
}

.vd-cta-panel {
    position: relative;
    overflow: hidden;
    max-width: 62rem;
    margin: 0 auto;
    padding: clamp(2rem, 5vw, 3.2rem);
    border-radius: 28px;
    background: #ffffff;
    border: 1px solid rgba(94, 179, 70, 0.22);
    box-shadow: var(--vd-shadow);
}

/* Emerald edge rather than a full gradient fill. */
.vd-cta-panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 5px;
    background: linear-gradient(180deg, var(--gf-green), var(--gf-green-dark));
}

.vd-cta-copy {
    position: relative;
    z-index: 1;
    max-width: 40rem;
}

.vd-cta-title {
    margin: 0 0 0.9rem;
    font-weight: 700;
    font-size: clamp(1.5rem, 2.8vw, 2.1rem);
    letter-spacing: -0.02em;
    color: var(--vd-ink);
}

.vd-cta-text {
    margin: 0 0 1.6rem;
    font-size: 1rem;
    line-height: 1.78;
    color: var(--vd-ink-soft);
}

.vd-cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.vd-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.82rem 1.6rem;
    border-radius: 100px;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease,
        color 0.25s ease, border-color 0.25s ease;
}

.vd-btn:hover {
    transform: translateY(-2px);
}

.vd-btn--solid {
    color: #ffffff;
    background: linear-gradient(90deg, var(--gf-green), var(--gf-green-dark));
    box-shadow: 0 10px 24px rgba(94, 179, 70, 0.32);
}

.vd-btn--solid:hover {
    color: #ffffff;
}

.vd-btn--ghost {
    color: var(--vd-ink);
    border: 1.5px solid rgba(48, 68, 79, 0.22);
}

.vd-btn--ghost:hover {
    color: var(--gf-green-dark);
    border-color: var(--gf-green);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media only screen and (max-width: 991px) {
    .vd-grid { grid-template-columns: repeat(2, 1fr); }
}

@media only screen and (max-width: 575px) {
    .vd-grid { grid-template-columns: 1fr; }
    .vd-stats { gap: 1.4rem; }
    .vd-feature { margin-bottom: -4rem; }
    .vd-library { padding-top: 6.5rem; }
    .vd-play { width: 2.9rem; height: 2.9rem; font-size: 0.85rem; }
    .vd-facade--feature .vd-play { width: 3.4rem; height: 3.4rem; font-size: 1rem; }
    /* The overlay title would cover most of a phone-width thumbnail. */
    .vd-feature-meta { display: none; }
    .vd-btn { width: 100%; justify-content: center; }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .vd-page *,
    .vd-page *::before,
    .vd-page *::after {
        animation: none !important;
        transition: none !important;
    }
    .vd-blob { transform: none !important; }
    /* Without a hover transition the knocked-back thumbnails would look like a
       mistake, so they sit closer to their true colour. */
    .vd-facade img { filter: saturate(0.9) brightness(0.85); }
}
