/* ============================================================
   K4 Adventure FX Overlay — v6.4 (subtle + readable + fast)
   Premium ambient + responsive compass + mini adventure UI cues
   ============================================================ */

:root{
  --k4fx-z: 46; /* above section backgrounds, below most section backgrounds */
  --k4fx-z-hud: 80;

  /* Global intensity knobs */
  --k4fx-aurora-opacity: .18;
  --k4fx-topo-opacity: .18;
  --k4fx-grain-opacity: .020;
  --k4fx-compass-opacity: .30;

  /* Compass sizing */
  --k4fx-compass-mobile-size: 82px;

  /* Accents */
  --k4fx-orange: rgba(255,107,0,.92);
  --k4fx-amber: rgba(255,184,0,.88);
  --k4fx-white: rgba(255,255,255,.92);
}

html, body { overflow-x: clip; }
body { position: relative; }

/* Overlay wrapper */
#k4-adventure-fx{
  position: fixed;
  inset: 0;
  pointer-events: none !important;
  z-index: var(--k4fx-z);
  overflow: hidden;
  isolation: isolate;
}
#k4-adventure-fx, #k4-adventure-fx * { pointer-events: none !important; }

#k4-adventure-fx .k4fx-layer{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  display:block;
}

/* Canvases */
#k4-adventure-fx .k4fx-aurora{
  opacity: var(--k4fx-aurora-opacity);
  filter: blur(8px) saturate(108%);
  mix-blend-mode: screen;
}
#k4-adventure-fx .k4fx-mountains{
  opacity: .10;
  mix-blend-mode: soft-light;
}
#k4-adventure-fx .k4fx-topo{
  opacity: var(--k4fx-topo-opacity);
}

/* Compass layer */
#k4-adventure-fx .k4fx-compass{
  position:absolute;
  inset:0;
  opacity: var(--k4fx-compass-opacity);
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.20));
  z-index: var(--k4fx-z-hud);
}

/* Grain */
#k4-adventure-fx .k4fx-grain{
  opacity: var(--k4fx-grain-opacity);
  background-image:
    radial-gradient(rgba(255,255,255,.65) .55px, transparent .85px),
    radial-gradient(rgba(255,255,255,.30) .45px, transparent .8px);
  background-size: 4px 4px, 7px 7px;
  background-position: 0 0, 1px 2px;
  mix-blend-mode: soft-light;
  animation: k4fxGrain 14s steps(6) infinite;
}

/* Very subtle ambient glows */
#k4-adventure-fx::before,
#k4-adventure-fx::after{
  content:"";
  position:absolute;
  inset:-8%;
  pointer-events:none;
}
#k4-adventure-fx::before{
  background:
    radial-gradient(50% 34% at 12% 10%, rgba(255,107,0,.09), transparent 72%),
    radial-gradient(40% 28% at 88% 14%, rgba(255,184,0,.07), transparent 74%),
    radial-gradient(36% 24% at 50% 104%, rgba(255,255,255,.022), transparent 76%);
  opacity: .75;
  filter: blur(10px);
  animation: k4fxGlowShift 28s ease-in-out infinite alternate;
}
#k4-adventure-fx::after{
  background: linear-gradient(180deg, rgba(255,255,255,.010), rgba(255,255,255,0) 16%, rgba(255,255,255,0) 84%, rgba(255,255,255,.008));
  opacity: .6;
}

/* Body content: only elevate common content containers, not every node */
.k4-container,
.k4-nav,
main, header, footer,
.k4-filter-section .k4-container,
.k4-type-grid,
.k4-filter-bottom,
.k4-month-wrap,
.k4-card,
.k4-service-card,
.k4-collab-card,
.k4-why-card,
.k4-founder-content,
.k4-founder-photo-col,
.k4-founder-photo-wrap {
  position: relative;
  z-index: 47;
}

/* --------------------------------------------
   Section mini visuals (opt-in classes only)
   Add these classes on sections if you want them:
   .k4fx-mountain-bottom / .k4fx-forest-bottom / .k4fx-sep-center
--------------------------------------------- */
.k4fx-sep-center,
.k4fx-mountain-bottom,
.k4fx-forest-bottom { position: relative; overflow: hidden; }

.k4fx-sep-center::after{
  content:"";
  position:absolute;
  left:50%;
  bottom:0;
  width:min(280px, 42vw);
  height:1px;
  transform:translateX(-50%);
  pointer-events:none;
  background: linear-gradient(90deg,
    transparent,
    rgba(255,255,255,.04) 16%,
    rgba(255,107,0,.11) 40%,
    rgba(255,184,0,.14) 50%,
    rgba(255,107,0,.11) 60%,
    rgba(255,255,255,.04) 84%,
    transparent);
  filter: drop-shadow(0 0 5px rgba(255,184,0,.08));
  opacity: .75;
}

.k4fx-mountain-bottom::before,
.k4fx-forest-bottom::before{
  content:"";
  position:absolute;
  left:0; right:0; bottom:0;
  pointer-events:none;
  z-index:1;
  background-repeat:no-repeat;
  background-position:center bottom;
  background-size:cover;
}

.k4fx-mountain-bottom::before{
  height:58px;
  opacity:.70;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 100' preserveAspectRatio='none'><path d='M0,100 L0,76 L110,62 L188,73 L276,30 L365,60 L460,28 L575,70 L682,42 L785,68 L900,32 L1014,60 L1120,24 L1246,68 L1332,50 L1440,72 L1440,100 Z' fill='rgba(255,255,255,0.035)'/><path d='M0,100 L0,88 L105,80 L196,86 L286,60 L372,82 L474,54 L578,84 L680,66 L786,86 L898,60 L1010,84 L1120,62 L1248,90 L1330,76 L1440,88 L1440,100 Z' fill='rgba(0,0,0,0.12)'/><path d='M0,100 L0,76 L110,62 L188,73 L276,30 L365,60 L460,28 L575,70 L682,42 L785,68 L900,32 L1014,60 L1120,24 L1246,68 L1332,50 L1440,72' fill='none' stroke='rgba(255,184,0,0.06)' stroke-width='1'/></svg>");
}

.k4fx-forest-bottom::before{
  height:42px;
  opacity:.66;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 60' preserveAspectRatio='none'><rect x='0' y='40' width='1440' height='20' fill='rgba(0,0,0,0.14)'/><path d='M18 40 L30 18 L42 40 Z M54 40 L68 14 L82 40 Z M96 40 L106 22 L116 40 Z M136 40 L148 18 L160 40 Z M182 40 L196 14 L210 40 Z M226 40 L236 22 L246 40 Z M268 40 L282 12 L296 40 Z M320 40 L332 20 L344 40 Z M366 40 L380 14 L394 40 Z M410 40 L420 22 L430 40 Z M454 40 L468 12 L482 40 Z M504 40 L516 18 L528 40 Z M548 40 L562 14 L576 40 Z M594 40 L604 22 L614 40 Z M638 40 L652 12 L666 40 Z M688 40 L700 18 L712 40 Z M732 40 L746 14 L760 40 Z M778 40 L788 22 L798 40 Z M822 40 L836 12 L850 40 Z M872 40 L884 18 L896 40 Z M918 40 L932 14 L946 40 Z M964 40 L974 22 L984 40 Z M1008 40 L1022 12 L1036 40 Z M1056 40 L1068 18 L1080 40 Z M1102 40 L1116 14 L1130 40 Z M1148 40 L1158 22 L1168 40 Z M1192 40 L1206 12 L1220 40 Z M1240 40 L1252 18 L1264 40 Z M1286 40 L1300 14 L1314 40 Z M1332 40 L1342 22 L1352 40 Z' fill='rgba(255,255,255,0.03)'/><path d='M0 40 L1440 40' stroke='rgba(255,184,0,0.05)' stroke-width='1'/></svg>");
}

/* Premium filter cards polish (SAFE + visible) */
.k4-filter-section {
  position: relative;
}
.k4-filter-section::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  z-index:1;
  background:
    radial-gradient(420px 180px at 12% 10%, rgba(255,107,0,.08), transparent 70%),
    radial-gradient(360px 160px at 88% 15%, rgba(255,184,0,.06), transparent 72%),
    radial-gradient(300px 120px at 52% 100%, rgba(255,255,255,.02), transparent 74%);
  opacity:.85;
}
.k4-filter-section .k4-container{ z-index: 46; }

.k4-type-card{
  position: relative;
  isolation:isolate;
  overflow:hidden;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.08);
  background:
    linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.012)),
    rgba(12,17,22,.78);
  box-shadow: 0 8px 24px rgba(0,0,0,.14), inset 0 1px 0 rgba(255,255,255,.025);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: transform .24s cubic-bezier(.2,.8,.2,1), box-shadow .24s ease, border-color .24s ease;
}
.k4-type-card::before{
  content:"";
  position:absolute;
  inset:-20%;
  z-index:-1;
  opacity:.13;
  background: radial-gradient(circle at 50% 12%, var(--tglow, rgba(255,255,255,.15)), transparent 60%);
  filter: blur(10px);
  transition: opacity .25s ease;
}
.k4-type-card::after{
  content:"";
  position:absolute;
  top:0;
  left:18%;
  width:64%;
  height:1px;
  background:linear-gradient(90deg,transparent,rgba(255,255,255,.18),transparent);
  opacity:.5;
}
.k4-type-card:hover{
  transform: translateY(-3px);
  border-color: rgba(255,255,255,.14);
  box-shadow: 0 14px 28px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.03);
}
.k4-type-card:hover::before{ opacity:.22; }
.k4-type-card.k4-type-active,
.k4-type-card[aria-pressed="true"]{
  border-color: rgba(255,255,255,.16);
  box-shadow:
    0 14px 30px rgba(0,0,0,.20),
    0 0 0 1px rgba(255,255,255,.03) inset,
    0 0 20px color-mix(in srgb, var(--tglow, rgba(255,255,255,.15)) 38%, transparent);
}

.k4-tc-ring{
  position:absolute; inset:8px; border-radius:14px;
  border:1px solid rgba(255,255,255,.04); opacity:.9; pointer-events:none;
}
.k4-tc-icon-wrap{
  position:relative;
  width:52px; height:52px;
  display:grid; place-items:center;
  margin-bottom:10px;
  animation: none;
}
.k4-tc-icon-bg{
  position:absolute; inset:0; border-radius:50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255,255,255,.09), transparent 65%),
    var(--tg, linear-gradient(135deg,#334155,#1e293b));
  box-shadow:
    0 6px 16px rgba(0,0,0,.18),
    0 0 0 1px rgba(255,255,255,.04) inset,
    0 0 16px color-mix(in srgb, var(--tglow, rgba(255,255,255,.15)) 55%, transparent);
  transition: transform .22s ease, box-shadow .22s ease;
}
.k4-tc-icon{
  position:relative; z-index:2;
  font-size:24px; line-height:1;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.20));
  transition: transform .22s ease;
}
.k4-tc-label{
  position:relative; z-index:2;
  font-size:13px; line-height:1.2; font-weight:600;
  color: rgba(255,255,255,.94);
  text-wrap: balance;
}
.k4-tc-check{
  position:absolute;
  top:8px; right:8px;
  width:18px; height:18px;
  display:grid; place-items:center;
  border-radius:50%;
  font-size:11px; font-weight:700;
  color:#fff;
  background: rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.12);
  opacity:0; transform: scale(.85);
  transition: opacity .2s ease, transform .2s ease;
}
.k4-type-card.k4-type-active .k4-tc-check,
.k4-type-card[aria-pressed="true"] .k4-tc-check{
  opacity:1; transform:scale(1);
}
.k4-tc-shine{
  position:absolute;
  inset:-40% auto -40% -60%;
  width:50%;
  transform: rotate(15deg);
  background:linear-gradient(90deg,rgba(255,255,255,0),rgba(255,255,255,.055),rgba(255,255,255,0));
  opacity:0;
}
.k4-type-card:hover .k4-tc-shine{ opacity:1; animation:k4TcShine 1s ease-out 1; }
.k4-type-card:hover .k4-tc-icon-bg{ transform: translateY(-1px) scale(1.03); }
.k4-type-card:hover .k4-tc-icon{ transform: translateY(-1px) scale(1.03); }
.k4-type-card:hover .k4-tc-icon-wrap,
.k4-type-card.k4-type-active .k4-tc-icon-wrap,
.k4-type-card[aria-pressed="true"] .k4-tc-icon-wrap{
  animation: var(--tanim, k4BobSoft) 2.2s ease-in-out infinite;
}

/* Month picker polish */
.k4-month-wrap{
  border-radius:14px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(12,17,22,.74);
  box-shadow: 0 8px 20px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.02);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.k4-month-select{ background:transparent !important; color:#fff !important; }
.k4-month-icon, .k4-month-arrow{ opacity:.82; }

/* Shared subtle motion */
@keyframes k4fxGrain {
  0% { transform: translate(0,0); }
  20% { transform: translate(-1px,1px); }
  40% { transform: translate(1px,-1px); }
  60% { transform: translate(1px,1px); }
  80% { transform: translate(-1px,-1px); }
  100% { transform: translate(0,0); }
}
@keyframes k4fxGlowShift {
  0% { transform: translate3d(-.8%,-.8%,0) scale(1.015); }
  50% { transform: translate3d(.5%,1.0%,0) scale(1.03); }
  100% { transform: translate3d(-.5%,1.8%,0) scale(1.02); }
}
@keyframes k4TcShine {
  from { transform: translateX(-10%) rotate(15deg); }
  to   { transform: translateX(220%) rotate(15deg); }
}
@keyframes k4BobSoft {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
@keyframes k4Compass {
  0%,100% { transform: rotate(0deg); }
  25% { transform: rotate(7deg); }
  55% { transform: rotate(-5deg); }
  100% { transform: rotate(0deg); }
}
@keyframes k4Run {
  0%,100% { transform: translateX(0) translateY(0); }
  25% { transform: translateX(1px) translateY(-1px); }
  50% { transform: translateX(-1px) translateY(0); }
  75% { transform: translateX(1px) translateY(1px); }
}
@keyframes k4Bob {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@keyframes k4Pulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
@keyframes k4Spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes k4Shake {
  0%,100% { transform: rotate(0deg); }
  20% { transform: rotate(-3deg); }
  40% { transform: rotate(3deg); }
  60% { transform: rotate(-2deg); }
  80% { transform: rotate(2deg); }
}

/* Mobile responsiveness */
@media (max-width: 768px){
  :root{
    --k4fx-aurora-opacity: .11;
    --k4fx-topo-opacity: .10;
    --k4fx-compass-opacity: .14;
    --k4fx-grain-opacity: .017;
    --k4fx-compass-mobile-size: 74px;
  }
  #k4-adventure-fx .k4fx-aurora{ filter: blur(7px) saturate(104%); }
  #k4-adventure-fx .k4fx-mountains{ opacity:.07; }
  .k4fx-mountain-bottom::before{ height:44px; opacity:.60; }
  .k4fx-forest-bottom::before{ height:32px; opacity:.58; }
  .k4fx-sep-center::after{ width:min(210px, 52vw); opacity:.65; }
}
@media (max-width: 640px){
  .k4-type-card{ border-radius:16px; }
  .k4-tc-icon-wrap{ width:46px; height:46px; margin-bottom:8px; }
  .k4-tc-icon{ font-size:21px; }
  .k4-tc-label{ font-size:12px; }
}

@media (prefers-reduced-motion: reduce){
  #k4-adventure-fx .k4fx-grain,
  #k4-adventure-fx::before,
  .k4-type-card:hover .k4-tc-shine { animation: none !important; }
}


/* v6.4.1 compass micro-anim */
#k4-adventure-fx .k4fx-compass{animation:k4fxCompassPulse 6s ease-in-out infinite;}
@keyframes k4fxCompassPulse{0%,100%{opacity:var(--k4fx-compass-opacity);filter:drop-shadow(0 6px 14px rgba(0,0,0,.20));}50%{opacity:calc(var(--k4fx-compass-opacity) + .04);filter:drop-shadow(0 8px 18px rgba(255,184,0,.10));}}
@media (max-width:768px){#k4-adventure-fx .k4fx-compass{animation-duration:8s;}}
