/* =========================================================
   Visual polish layer — loaded after 2.style.css
   Only uses the theme variables from 1.variables.css, so it
   follows the default, Day, Ocean and Night themes.
   ========================================================= */

:root {
     --flash-a: var(--accent);
     --flash-b: var(--primary);
     --flash-gradient: linear-gradient(120deg, var(--flash-a), var(--flash-b));
     --flash-glow: 0 18px 44px -18px color-mix(in srgb, var(--flash-a) 55%, transparent);
     --flash-ease: cubic-bezier(.2, .8, .2, 1);
}

/* --- Page backdrop: soft colour wash behind everything --- */
body {
     background:
          radial-gradient(60rem 32rem at 8% -8%, color-mix(in srgb, var(--flash-a) 11%, transparent), transparent 62%),
          radial-gradient(52rem 30rem at 104% 4%, color-mix(in srgb, var(--flash-b) 9%, transparent), transparent 60%),
          var(--bg);
     background-attachment: fixed;
}

/* --- Topbar: frosted glass with a gradient hairline --- */
.topbar {
     background: color-mix(in srgb, var(--bg) 74%, transparent);
     -webkit-backdrop-filter: saturate(170%) blur(14px);
     backdrop-filter: saturate(170%) blur(14px);
     border-bottom-color: transparent;
     box-shadow: 0 8px 28px -18px color-mix(in srgb, var(--black) 45%, transparent);
}

.topbar::after {
     content: "";
     position: absolute;
     inset: auto 0 0;
     height: 2px;
     background: linear-gradient(90deg, transparent, var(--flash-a), var(--flash-b), transparent);
     opacity: .75;
     pointer-events: none;
}

/* --- Media tile: bigger zoom, light sweep, lifted caption --- */
.media-tile {
     border-radius: 1.1rem;
     border-color: color-mix(in srgb, var(--white) 40%, var(--border));
     box-shadow: var(--shadow-m), var(--flash-glow);
     transition: transform .45s var(--flash-ease), box-shadow .45s var(--flash-ease);
}

.media-tile img {
     transition: transform 1.1s var(--flash-ease), filter .6s ease;
}

.media-tile:hover,
.media-tile:focus-visible {
     transform: translateY(-4px) rotate(-.6deg);
}

.media-tile:hover img,
.media-tile:focus-visible img {
     transform: scale(1.09);
     filter: saturate(1.15) contrast(1.04);
}

.media-tile::before {
     content: "";
     position: absolute;
     inset: 0;
     z-index: 1;
     background: linear-gradient(115deg, transparent 35%, color-mix(in srgb, var(--white) 38%, transparent) 50%, transparent 65%);
     transform: translateX(-120%);
     pointer-events: none;
}

.media-tile:hover::before,
.media-tile:focus-visible::before {
     transform: translateX(120%);
     transition: transform .9s ease;
}

.media-tile__caption {
     text-transform: capitalize;
     letter-spacing: .01em;
}

/* --- Cards: gradient edge, lift, staggered entrance --- */
.card {
     border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
     border-radius: 1.1rem;
     background: linear-gradient(160deg, var(--card), var(--surface-1));
     box-shadow: var(--shadow-1);
     transition: transform .35s var(--flash-ease), box-shadow .35s var(--flash-ease), border-color .35s ease;
}

.card::before {
     content: "";
     position: absolute;
     inset: 0 0 auto;
     height: 3px;
     z-index: 2;
     background: var(--flash-gradient);
     transform: scaleX(0);
     transform-origin: left;
     transition: transform .45s var(--flash-ease);
     pointer-events: none;
}

.card:is(:hover, :focus-within) {
     transform: translateY(-6px);
     border-color: color-mix(in srgb, var(--flash-a) 45%, var(--border));
     box-shadow: var(--shadow-hover), var(--flash-glow);
}

.card:is(:hover, :focus-within)::before {
     transform: scaleX(1);
}

.card-title {
     font-size: 1.12rem;
     letter-spacing: -.005em;
}

/* Arrow that slides in on linked cards */
.card-link .card-title::after {
     content: "\2192";
     display: inline-block;
     margin-left: .4rem;
     color: var(--flash-a);
     opacity: 0;
     transform: translateX(-6px);
     transition: opacity .25s ease, transform .35s var(--flash-ease);
}

.card:is(:hover, :focus-within) .card-link .card-title::after {
     opacity: 1;
     transform: none;
}

.cards>.card {
     animation: flash-rise .6s var(--flash-ease) both;
}

.cards>.card:nth-child(2) { animation-delay: .06s; }
.cards>.card:nth-child(3) { animation-delay: .12s; }
.cards>.card:nth-child(4) { animation-delay: .18s; }
.cards>.card:nth-child(5) { animation-delay: .24s; }
.cards>.card:nth-child(6) { animation-delay: .30s; }
.cards>.card:nth-child(n + 7) { animation-delay: .36s; }

/* --- Stat tiles: big gradient figures --- */
.x-stats {
     padding: 0 1rem;
}

.x-stat {
     position: relative;
     overflow: hidden;
     padding: 1.35rem 1.25rem;
     border-radius: 1.1rem;
     text-align: center;
     background: linear-gradient(160deg, var(--card), var(--surface-1));
     box-shadow: var(--shadow-1);
     transition: transform .35s var(--flash-ease), box-shadow .35s var(--flash-ease);
     animation: flash-rise .6s var(--flash-ease) both;
}

.x-stat:nth-child(2) { animation-delay: .08s; }
.x-stat:nth-child(3) { animation-delay: .16s; }

.x-stat::after {
     content: "";
     position: absolute;
     inset: auto -20% -60% -20%;
     height: 90%;
     background: radial-gradient(closest-side, color-mix(in srgb, var(--flash-a) 22%, transparent), transparent);
     pointer-events: none;
}

.x-stat:hover {
     transform: translateY(-4px);
     box-shadow: var(--shadow-hover), var(--flash-glow);
}

.x-stat__value {
     font-size: clamp(1.8rem, 3.4vw, 2.6rem);
     font-weight: 800;
     letter-spacing: -.02em;
     line-height: 1.1;
     background: var(--flash-gradient);
     -webkit-background-clip: text;
     background-clip: text;
     color: transparent;
}

.x-stat__label {
     text-transform: uppercase;
     letter-spacing: .09em;
     font-size: .76rem;
     font-weight: 600;
}

/* --- Buttons: gradient fill, glow, light sweep --- */
/* The sweep is a background layer, so buttons keep their own positioning/overflow. */
.btn {
     --btn-fill: linear-gradient(135deg, var(--btn-bg), color-mix(in srgb, var(--btn-bg) 72%, var(--flash-b) 28%));
     --btn-sweep: linear-gradient(115deg, transparent 30%, color-mix(in srgb, var(--white) 34%, transparent) 50%, transparent 70%);

     background: var(--btn-sweep) 220% 0 / 60% 100% no-repeat, var(--btn-fill);
     box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--btn-bg) 80%, transparent);
     transition: transform .2s var(--flash-ease), box-shadow .25s ease, filter .2s ease, background-position 0s;
}

.btn:hover {
     background: var(--btn-sweep) -120% 0 / 60% 100% no-repeat, var(--btn-fill);
     filter: brightness(1.08);
     transform: translateY(-2px);
     box-shadow: 0 12px 26px -10px color-mix(in srgb, var(--btn-bg) 85%, transparent);
     transition: transform .2s var(--flash-ease), box-shadow .25s ease, filter .2s ease, background-position .7s ease;
}

.btn:active {
     transform: translateY(0) scale(.98);
}

/* Flat variants keep their own look */
.btn.ghost,
.btn.outline {
     background: transparent;
     box-shadow: none;
}

.btn.ghost:hover,
.btn.outline:hover {
     background: color-mix(in srgb, var(--flash-a) 10%, transparent);
     filter: none;
     box-shadow: none;
}

.btn:disabled,
.btn[disabled],
.btn[aria-disabled="true"] {
     filter: none;
     transform: none;
     box-shadow: none;
}

/* --- Partner logos: muted until hovered --- */
.logo-grid a {
     border-radius: 1rem;
     background: var(--card);
     transition: transform .35s var(--flash-ease), box-shadow .35s var(--flash-ease), border-color .3s ease;
}

.logo-grid img {
     filter: grayscale(1) opacity(.88);
     transition: filter .35s ease, transform .35s var(--flash-ease);
}

.logo-grid a:hover,
.logo-grid a:focus-visible {
     transform: translateY(-4px);
     box-shadow: var(--shadow-hover), var(--flash-glow);
}

.logo-grid a:hover img,
.logo-grid a:focus-visible img {
     filter: none;
     transform: scale(1.06);
}

/* --- Status boxes: accent stripe --- */
.status {
     border-left-width: 4px;
     border-radius: var(--radius);
}

/* --- Text selection --- */
::selection {
     background: color-mix(in srgb, var(--flash-a) 32%, transparent);
}

/* --- Keyframes --- */
@keyframes flash-rise {
     from {
          opacity: 0;
          transform: translateY(18px) scale(.985);
     }

     to {
          opacity: 1;
          transform: none;
     }
}

/* High-contrast / forced colours: gradient text would vanish */
@media (forced-colors: active) {

     .x-stat__value {
          background: none;
          color: CanvasText;
     }
}

@media (prefers-reduced-motion: reduce) {

     .cards>.card,
     .x-stat {
          animation: none;
     }

     .card,
     .x-stat,
     .btn,
     .media-tile,
     .media-tile img,
     .logo-grid a,
     .logo-grid img {
          transition: none;
     }

     .card:is(:hover, :focus-within),
     .x-stat:hover,
     .btn:hover,
     .media-tile:hover,
     .media-tile:focus-visible,
     .media-tile:hover img,
     .logo-grid a:hover,
     .logo-grid a:hover img {
          transform: none;
     }

     .media-tile::before {
          content: none;
     }
}
