/* Shared effects for every page, ported from the MatchPlay Group site
   (matchplaygroup.com: css/glass.css and the "Pointer cards" in styles.css).
   Loaded after each page's own styles; assets/fx.js drives the moving parts.

   1. Liquid-glass nav pill, with a lens that slides between the links
   2. Pointer boxes ([data-tilt], [data-glow]): accent rule, glow, tilt
   3. Page transitions between the site's pages */

:root { --fx-ease: cubic-bezier(.2, .8, .2, 1); }

/* 1. Liquid-glass nav ------------------------------------------------------
   The pill's glass is a layer of its own (::before), with a sheen (::after)
   that drifts as the page scrolls. In Chromium browsers fx.js also bends
   the backdrop at the rim with an SVG displacement map (--lg-filter); other
   browsers get the same glass without the bend. The tint deepens over light
   sections (body.glass-on-light) so the white type holds. */
.nav {
  position: relative;
  isolation: isolate;
  background: none;
  -webkit-backdrop-filter: none;
          backdrop-filter: none;
  border-color: transparent;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.28), 0 2px 6px rgba(0, 0, 0, 0.12);
  --glass-tint: 0.69;
}
.glass-on-light .nav { --glass-tint: 0.8; }
.nav::before,
.nav::after {
  content: "";
  position: absolute;
  inset: -1px;   /* out over the pill's 1px (transparent) border, or a ring of bare page shows round it */
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
}
.nav::before {
  background: rgba(24, 24, 28, var(--glass-tint));
  -webkit-backdrop-filter: blur(10px) saturate(1.7) brightness(1.05);
          backdrop-filter: var(--lg-filter, blur(10px) saturate(1.7) brightness(1.05));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06),
    inset 1px 0 0 rgba(255, 255, 255, 0.07),
    inset -1px 0 0 rgba(255, 255, 255, 0.07),
    inset 0 12px 22px -16px rgba(255, 255, 255, 0.18);
  transition: background-color 0.4s ease;
}
/* Over a light section the white rim reads as a border, and the blur pulls
   the light page in at the edge: a soft dark inner edge instead. */
.glass-on-light .nav::before {
  box-shadow:
    inset 0 0 0 1px rgba(10, 10, 10, 0.28),
    inset 0 0 8px rgba(10, 10, 10, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.nav::after {
  background: linear-gradient(110deg,
    rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0) 22%,
    rgba(255, 255, 255, 0) 70%, rgba(255, 255, 255, 0.06) 86%, rgba(255, 255, 255, 0) 100%);
  background-size: 220% 100%;
  background-position: var(--sheen, 40%) 0;
}

/* The lens: one glass drop that slides between the links you point at,
   stretching as it goes, in place of each link's own hover. */
.nav__lens {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  background: rgba(255, 255, 255, 0.07);
  -webkit-backdrop-filter: saturate(1.4) brightness(1.15);
          backdrop-filter: saturate(1.4) brightness(1.15);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -1px 0 rgba(255, 255, 255, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.09),
    0 4px 14px rgba(0, 0, 0, 0.22);
  will-change: transform, width;
}
.nav__lens.is-on { opacity: 1; }
.nav__lens.is-on-cta {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -1px 0 rgba(255, 255, 255, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.09);
}
.nav-brand, .nav-links, .nav-aux, .nav-cta { position: relative; z-index: 1; }
.nav-link { color: rgba(255, 255, 255, 0.92); }
.nav-link:hover { color: #fff; }
.has-lens .nav-link:hover { background: transparent; }
.nav-link[aria-current="page"] { color: var(--ventures); }

/* Apply / Join: solid orange with a soft inner glow (no rim, no outer glow).
   Hovering drains the fill to clear glass inside an orange outline. */
.nav-cta {
  background: var(--ventures);
  border: 1.5px solid var(--ventures);
  padding: 7.5px 16.5px;   /* the border inside its old size */
  box-shadow: inset 3px 8px 14px -10px rgba(255, 255, 255, 0.4);
  color: #fff;
  font-weight: 600;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease,
              box-shadow 0.3s ease, text-shadow 0.3s ease;
}
.nav-cta:hover {
  background: color-mix(in srgb, var(--ventures) 6%, transparent);
  border-color: var(--ventures);
  color: var(--ventures);
  text-shadow: none;
  box-shadow: inset 0 0 14px -4px color-mix(in srgb, var(--ventures) 45%, transparent);
}

/* Phone menu (880px and below; fx.js builds it from the nav). The pill
   collapses to the logo and a hamburger; the menu opens as a glass panel
   under it with the same items, centred: the links, a divider, Capital
   Partners, then Apply / Join. Without the script the old row stays. */
.nav-burger { display: none; }
@media (max-width: 880px) {
  .has-menu .nav-links,
  .has-menu .nav-aux,
  .has-menu .nav-cta { display: none; }
  .has-menu .nav-brand { border-right: 0; padding-right: 6px; }
  .has-menu { padding: 6px 6px 6px 16px; gap: 6px; }
  .nav-burger {
    position: relative; z-index: 1;
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; padding: 0;
    border: 0; border-radius: 999px; background: transparent;
    color: #fff; cursor: pointer;
  }
  .nav-burger span {
    position: absolute; left: 12px; right: 12px; height: 1.5px; border-radius: 2px;
    background: currentColor;
    transition: transform 0.3s var(--fx-ease), opacity 0.2s ease;
  }
  .nav-burger span:nth-child(1) { transform: translateY(-5px); }
  .nav-burger span:nth-child(3) { transform: translateY(5px); }
  .nav-burger[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg); }
  .nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-burger[aria-expanded="true"] span:nth-child(3) { transform: rotate(-45deg); }
}
.nav-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  width: min(320px, calc(100vw - 32px));
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 14px;
  border-radius: 24px;
  pointer-events: auto;
  isolation: isolate;
  background: rgba(24, 24, 28, var(--glass-tint, 0.69));
  -webkit-backdrop-filter: blur(14px) saturate(1.7) brightness(1.05);
          backdrop-filter: blur(14px) saturate(1.7) brightness(1.05);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06),
    inset 1px 0 0 rgba(255, 255, 255, 0.07),
    inset -1px 0 0 rgba(255, 255, 255, 0.07),
    inset 0 12px 22px -16px rgba(255, 255, 255, 0.18),
    0 18px 44px rgba(0, 0, 0, 0.36);
  transform-origin: 50% 0;
  transform: translate(-50%, -6px) scale(0.96);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, transform 0.3s cubic-bezier(0.34, 1.25, 0.64, 1), visibility 0.3s;
}
.glass-on-light .nav-menu {
  --glass-tint: 0.8;
  box-shadow:
    inset 0 0 0 1px rgba(10, 10, 10, 0.28),
    inset 0 0 8px rgba(10, 10, 10, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 18px 44px rgba(0, 0, 0, 0.3);
}
.nav-menu.is-open { opacity: 1; visibility: visible; transform: translate(-50%, 0) scale(1); }
.nav-menu a:not(.nav-cta) {
  display: block; width: 100%;
  padding: 12px 16px;
  border-radius: 999px;
  text-align: center;
  font-size: 15px; font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
}
.nav-menu a:not(.nav-cta):active { background: rgba(255, 255, 255, 0.07); }
.nav-menu a[aria-current="page"] { color: var(--ventures); }
.nav-menu hr { width: 40%; height: 1px; margin: 8px auto; border: 0; background: rgba(255, 255, 255, 0.14); }
.nav-menu .nav-cta { display: inline-flex; margin: 10px 0 2px; padding: 11px 26px; font-size: 15px; }
@media (min-width: 881px) { .nav-menu { display: none; } }
@media (prefers-reduced-motion: reduce) { .nav-menu, .nav-burger span { transition: none; } }

/* Moving dot grids (assets/dot-wave.js): the still CSS dots step aside once
   the canvas is drawing. */
[data-dot-wave].is-live { background-image: none; }

/* Chips and tags turn orange on hover: chips (.chip, Capital Partners'
   "Built for" and "what we'll ask about" rows) fill orange with white
   text, as on the Group site; the portfolio grid's sector label, shown on
   hover, is orange. */
.chip { transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease; }
.chip:hover { background: var(--ventures); border-color: var(--ventures); color: #fff; }
.portfolio-meta { color: var(--ventures); }

/* Main calls to action (.btn-primary: Apply for funding, Begin your
   application, Join Capital Partners): solid orange with a soft inner glow;
   on hover the fill drains to clear glass inside an orange border and the
   text turns orange, with a bouncy wobble (fx.js). The border is an inset
   ring, so the buttons keep their size. The nav's Apply / Join keep their
   own look above. */
.btn-primary {
  position: relative;
  background: var(--ventures);
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
  -webkit-backdrop-filter: blur(8px) saturate(1.5);
          backdrop-filter: blur(8px) saturate(1.5);
  box-shadow:
    inset 0 0 0 1.5px var(--ventures),
    inset 3px 8px 14px -10px rgba(255, 255, 255, 0.4);
  transition: background-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease, text-shadow 0.3s ease;
}
.btn-primary:hover {
  background: color-mix(in srgb, var(--ventures) 6%, transparent);
  color: var(--ventures);
  text-shadow: none;
  transform: none;
  box-shadow:
    inset 0 0 0 1.5px var(--ventures),
    inset 0 2px 0 rgba(255, 255, 255, 0.14),
    inset 0 0 14px -4px color-mix(in srgb, var(--ventures) 45%, transparent);
}

/* 2. Pointer boxes ---------------------------------------------------------
   [data-tilt]: fx.js gives the box a decorative .fx layer (an accent rule
   along the top that draws across on hover, a resting glow low right, and
   a glow under the pointer) and, for a mouse or pen, tilts it toward the
   pointer, drifting and lifting a little. [data-glow] gets the layer
   without the movement, for boxes that sit edge to edge in a grid. On touch
   screens the box crossing a line just above the middle of the screen takes
   the hover look as you scroll. Each box picks its colour with --fx-accent. */
[data-tilt], [data-glow] {
  --fx-accent: var(--ventures);   /* the top rule's colour */
  --fx-glow: var(--ventures);     /* every glow is orange, whatever the rule */
  --fx-rest: 0.08;        /* glow opacity at rest, on hover, while tracking */
  --fx-hover: 0.18;
  --fx-track: 0.24;
  position: relative;
  isolation: isolate;
}
[data-tilt] {
  transition: transform 0.4s var(--fx-ease), background-color 0.4s var(--fx-ease),
              border-color 0.4s var(--fx-ease), box-shadow 0.4s var(--fx-ease);
}
[data-tilt]:hover { transform: translateY(-4px); }
.fx {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}
.fx::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--fx-accent);
  transform: scaleX(0.15);
  transform-origin: left;
  transition: transform 0.5s var(--fx-ease);
}
:is([data-tilt], [data-glow]):hover > .fx::before,
:is([data-tilt], [data-glow]).is-active > .fx::before { transform: scaleX(1); }
/* Soft radial gradients fitted to a 216px disc under blur(80px): they look
   like the old blurred orbs but are drawn once, and the pointer's glow moves
   by transform only (fx.js sets --gx/--gy in px). */
.fx__orb {
  position: absolute;
  left: 0;
  top: 0;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(closest-side,
    color-mix(in srgb, var(--fx-glow) 59.6%, transparent) 0.0%,
    color-mix(in srgb, var(--fx-glow) 58.4%, transparent) 7.1%,
    color-mix(in srgb, var(--fx-glow) 54.9%, transparent) 14.3%,
    color-mix(in srgb, var(--fx-glow) 50.2%, transparent) 21.4%,
    color-mix(in srgb, var(--fx-glow) 43.9%, transparent) 28.6%,
    color-mix(in srgb, var(--fx-glow) 36.9%, transparent) 35.7%,
    color-mix(in srgb, var(--fx-glow) 29.4%, transparent) 42.9%,
    color-mix(in srgb, var(--fx-glow) 22.7%, transparent) 50.0%,
    color-mix(in srgb, var(--fx-glow) 16.9%, transparent) 57.1%,
    color-mix(in srgb, var(--fx-glow) 11.8%, transparent) 64.3%,
    color-mix(in srgb, var(--fx-glow) 7.8%, transparent) 71.4%,
    color-mix(in srgb, var(--fx-glow) 4.7%, transparent) 78.6%,
    color-mix(in srgb, var(--fx-glow) 2.7%, transparent) 85.7%,
    color-mix(in srgb, var(--fx-glow) 1.6%, transparent) 92.9%,
    transparent 100%);
  transition: opacity 0.4s var(--fx-ease);
}
.fx__orb--rest {
  left: calc(100% - 54px);
  top: 100%;
  transform: translate(-50%, -50%);
  opacity: var(--fx-rest);
}
.fx__orb--pointer {
  transform: translate3d(calc(var(--gx, 0px) - 50%), calc(var(--gy, 0px) - 50%), 0);
  opacity: 0;
}
:is([data-tilt], [data-glow]):hover .fx__orb--rest { opacity: var(--fx-hover); }
:is([data-tilt], [data-glow]).is-tracking .fx__orb--rest { opacity: 0; }
:is([data-tilt], [data-glow]).is-tracking .fx__orb--pointer {
  opacity: var(--fx-track);
  will-change: transform;
  transition: opacity 0.4s var(--fx-ease), transform 0.12s ease-out;
}
/* data-fx-noline: the glow without the accent rule. */
[data-fx-noline] > .fx::before { content: none; }
/* White boxes have less to glow against: stronger glow, and the lift reads
   through a soft shadow and a firmer edge. */
[data-fx-light] { --fx-rest: 0.06; --fx-hover: 0.18; --fx-track: 0.28; }
[data-fx-light][data-tilt]:hover,
[data-fx-light][data-tilt].is-active {
  border-color: rgba(10, 10, 10, 0.14);
  box-shadow: 0 18px 40px -22px rgba(10, 10, 10, 0.28);
}

/* 3. Page transitions ------------------------------------------------------
   Moving between the site's pages cross-fades instead of flashing white,
   and the nav pill stays put (browsers with cross-document view
   transitions; others load pages as before). */
@view-transition { navigation: auto; }
/* fx.js names the nav only while a transition runs: a view-transition-name
   cuts the nav off from the page behind it (it becomes a backdrop root), so
   the glass would have nothing to bend. */
.fx-vt-nav { view-transition-name: site-nav; }
::view-transition-old(root) { animation: 0.25s ease both fx-fade-out; }
::view-transition-new(root) { animation: 0.35s ease both fx-fade-in; }
@keyframes fx-fade-out { to { opacity: 0; } }
@keyframes fx-fade-in { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  [data-tilt]:hover { transform: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
