/* Kolo FX - depth, glass and motion for the public site.
 *
 * One stylesheet and one script, loaded AFTER a page's own stylesheet, so a
 * page keeps working exactly as before if either file fails to arrive.
 *
 * BUILT FOR THE PHONES THIS SITE IS ACTUALLY READ ON. No library, no images,
 * no fonts: a few kilobytes in total. The moving background is a small canvas
 * that the script only starts when the visitor has not asked for reduced
 * motion and is not on a data-saver connection; everybody else gets the
 * still gradient below, which is the same scene with nothing moving.
 * Blur is the expensive effect on a cheap Android phone, so it is spent on
 * the header and the buttons only. Cards are translucent, not blurred.
 */

:root{
  --fx-ease:cubic-bezier(.16,1,.3,1);
  --fx-spring:cubic-bezier(.2,.9,.3,1.35);
  --fx-glass-edge:rgba(255,255,255,.22);
  --fx-glass-hi:rgba(255,255,255,.5);
}

/* ---------- the ground the 3D scene sits on ---------- */
html.kfx{background:#05070F}
html.kfx body{background:transparent}

.kfx-bg{
  position:fixed;inset:0;z-index:-1;pointer-events:none;overflow:hidden;
  background:
    radial-gradient(120% 80% at 82% -10%,rgba(0,72,144,.55),transparent 60%),
    radial-gradient(90% 70% at -10% 35%,rgba(59,143,222,.20),transparent 62%),
    radial-gradient(80% 60% at 60% 110%,rgba(232,185,58,.13),transparent 60%),
    linear-gradient(180deg,#05070F 0%,#070B1A 55%,#05070F 100%);
}
.kfx-bg canvas{position:absolute;inset:0;width:100%;height:100%;display:block}

/* A floor receding to a horizon: the cheapest honest depth cue there is.
   One element, one transform, no script. */
.kfx-floor{
  position:absolute;left:-50%;right:-50%;bottom:-8%;height:62%;
  transform:perspective(900px) rotateX(66deg);transform-origin:50% 100%;
  background-image:
    linear-gradient(rgba(169,210,245,.2) 1px,transparent 1px),
    linear-gradient(90deg,rgba(169,210,245,.2) 1px,transparent 1px);
  background-size:72px 72px;
  -webkit-mask-image:linear-gradient(to top,rgba(0,0,0,.85),transparent 78%);
          mask-image:linear-gradient(to top,rgba(0,0,0,.85),transparent 78%);
  animation:kfx-floor 14s linear infinite;
}
@keyframes kfx-floor{to{background-position:0 72px,0 0}}

/* Soft vignette so text at the edges keeps its contrast. */
.kfx-bg::after{
  content:"";position:absolute;inset:0;
  background:radial-gradient(120% 90% at 50% 40%,transparent 55%,rgba(3,5,12,.72) 100%);
}

/* ---------- let the scene show through the page ---------- */
html.kfx .hero{background:linear-gradient(180deg,rgba(6,32,74,.66),rgba(6,32,74,.28))}
html.kfx .field-deep{background:rgba(6,32,74,.62)}
html.kfx .field-royal{background:linear-gradient(180deg,rgba(0,72,144,.72),rgba(0,72,144,.5))}
html.kfx .field-raise{background:rgba(11,15,30,.6)}
html.kfx .band{background:linear-gradient(135deg,rgba(0,72,144,.86),rgba(6,32,74,.7))}
html.kfx .ft{background:rgba(5,7,15,.72)}

/* ---------- glass header ---------- */
html.kfx .hdr{
  background:rgba(5,7,15,.58);
  -webkit-backdrop-filter:blur(18px) saturate(160%);
          backdrop-filter:blur(18px) saturate(160%);
  border-bottom-color:rgba(255,255,255,.1);
  box-shadow:0 10px 30px -18px rgba(0,0,0,.8);
}

/* ---------- Liquid Glass buttons ----------
   Two button families exist on the site: .btn (Sounds of Heaven, Compete,
   Schools, Studio, Show, Media, Registry) and .button (the homepage and Kolo
   Book). Both get the glass. NEITHER GETS RECOLOURED: a red Kolo button stays
   red and a gold Sounds of Heaven button stays gold, because the colour is
   what tells a visitor which button is the main action. The glass is layered
   on top of whatever colour the page already gave it.
   Four layers make the material: a tinted translucent body, a blur of
   whatever is behind it, a bright top edge with a dark bottom edge so it
   reads as thick, and a highlight that follows the pointer the way light
   slides across real glass. The text sits above all of it. */
html.kfx :is(.btn,.button){
  position:relative;isolation:isolate;overflow:hidden;
  border:1px solid var(--fx-glass-edge);
  -webkit-backdrop-filter:blur(14px) saturate(180%);
          backdrop-filter:blur(14px) saturate(180%);
  box-shadow:
    inset 0 1px 0 var(--fx-glass-hi),
    inset 0 -1px 0 rgba(0,0,0,.28),
    inset 0 0 14px rgba(255,255,255,.07),
    0 10px 26px -10px rgba(0,0,0,.65);
  transition:transform .42s var(--fx-spring),box-shadow .3s ease,
             background-color .3s ease,border-color .3s ease;
  will-change:transform;
}
/* the gloss across the top half */
html.kfx :is(.btn,.button)::after{
  content:"";position:absolute;inset:0;z-index:-1;border-radius:inherit;
  background:linear-gradient(180deg,rgba(255,255,255,.3),rgba(255,255,255,.05) 46%,transparent 52%);
  pointer-events:none;
}
/* the moving highlight; --mx/--my are set by the script, and without the
   script it simply sits top-centre */
html.kfx :is(.btn,.button)::before{
  content:"";position:absolute;inset:-1px;z-index:-1;border-radius:inherit;
  background:radial-gradient(130px circle at var(--mx,50%) var(--my,0%),rgba(255,255,255,.5),transparent 62%);
  opacity:0;transition:opacity .35s ease;pointer-events:none;
}
html.kfx :is(.btn,.button):hover::before,html.kfx :is(.btn,.button):focus-visible::before{opacity:1}
html.kfx :is(.btn,.button):hover{
  transform:translateY(-2px) scale(1.025);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.65),
    inset 0 -1px 0 rgba(0,0,0,.28),
    inset 0 0 18px rgba(255,255,255,.1),
    0 16px 34px -12px rgba(0,0,0,.7);
}
html.kfx :is(.btn,.button):active{transform:translateY(0) scale(.965);transition-duration:.12s}
html.kfx :is(.btn,.button)[disabled]{transform:none}

/* tints: only the ghost button changes, because it was already a see-through
   button everywhere it appears; glass is what it was trying to be. */
html.kfx .btn-ghost{background:rgba(255,255,255,.07);color:#F5F6FA}
html.kfx .btn-ghost:hover{background:rgba(255,255,255,.12);border-color:rgba(255,255,255,.4)}

/* ---------- glass cards (translucent, deliberately not blurred) ---------- */
html.kfx .stage,html.kfx .slot,html.kfx .empty,html.kfx .notice,
html.kfx .tablewrap,html.kfx .aside .box,html.kfx .quiz,html.kfx .form{
  background-color:rgba(11,15,30,.62);
  border:1px solid rgba(255,255,255,.08);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.07),0 18px 40px -24px rgba(0,0,0,.75);
  transition:transform .5s var(--fx-ease),box-shadow .4s ease,border-color .4s ease;
}
/* --tx/--ty are a few degrees of tilt set by the script on fine pointers */
html.kfx .stage,html.kfx .slot{
  transform:perspective(900px) rotateX(var(--ty,0deg)) rotateY(var(--tx,0deg));
  transform-style:preserve-3d;
}
html.kfx .stage:hover,html.kfx .slot:hover{
  border-color:rgba(169,210,245,.3);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.12),0 26px 50px -24px rgba(0,0,0,.85);
}

/* ---------- transitions ---------- */
/* reveal: rise, sharpen and settle, instead of only rising */
html.kfx .rv{
  opacity:0;transform:translateY(26px) scale(.985);filter:blur(6px);
  transition:opacity .7s var(--fx-ease),transform .7s var(--fx-ease),filter .7s var(--fx-ease);
}
html.kfx .rv.in{opacity:1;transform:none;filter:none}

/* nav links: an underline that draws itself */
html.kfx .hdr nav a:not(.btn){position:relative}
html.kfx .hdr nav a:not(.btn)::after{
  content:"";position:absolute;left:0;right:0;bottom:-6px;height:2px;border-radius:2px;
  background:linear-gradient(90deg,#3B8FDE,#E8B93A);
  transform:scaleX(0);transform-origin:left;transition:transform .35s var(--fx-ease);
}
html.kfx .hdr nav a:not(.btn):hover::after{transform:scaleX(1)}
html.kfx .hdr nav a[aria-current=page]{box-shadow:none}
html.kfx .hdr nav a[aria-current=page]::after{transform:scaleX(1)}

/* the hero mark floats, slowly */
html.kfx .hero-mark{animation:kfx-float 9s ease-in-out infinite;filter:drop-shadow(0 30px 40px rgba(0,0,0,.55))}
@keyframes kfx-float{50%{transform:translateY(-12px) rotate(.6deg)}}

/* page to page: a soft cross-fade where the browser supports it */
@view-transition{navigation:auto}
::view-transition-old(root){animation:kfx-out .22s ease both}
::view-transition-new(root){animation:kfx-in .36s var(--fx-ease) both}
@keyframes kfx-out{to{opacity:0;transform:scale(.992)}}
@keyframes kfx-in{from{opacity:0;transform:translateY(10px)}}

/* ---------- everything above is optional ---------- */
@media (prefers-reduced-motion:reduce){
  .kfx-floor,html.kfx .hero-mark{animation:none}
  html.kfx .rv{opacity:1;transform:none;filter:none;transition:none}
  html.kfx :is(.btn,.button),html.kfx .stage,html.kfx .slot{transition:none;transform:none}
  ::view-transition-old(root),::view-transition-new(root){animation:none}
}
/* small phones: drop the floor's motion and the card tilt, keep the look */
@media (max-width:640px){
  .kfx-floor{animation:none;background-size:56px 56px}
  html.kfx .stage,html.kfx .slot{transform:none}
}
