/* ===== AIMA Floating Navigation + Apps Menu — 2026-10-11 ===== */
.nav{
  position:sticky;
  top:12px;
  z-index:100;
  width:min(1540px,calc(100% - 32px));
  height:68px;
  margin:12px auto 0;
  padding:0 12px 0 14px;
  display:grid;
  grid-template-columns:1fr auto 1fr;
  align-items:center;
  border:1px solid rgba(15,20,32,.08);
  border-radius:22px;
  background:rgba(250,251,251,.78);
  box-shadow:
    0 14px 38px rgba(16,24,40,.055),
    inset 0 1px 0 rgba(255,255,255,.76);
  backdrop-filter:blur(26px) saturate(150%);
  -webkit-backdrop-filter:blur(26px) saturate(150%);
}
.nav::after{
  left:18%;
  right:18%;
  bottom:-1px;
  opacity:.16;
}
.brand{gap:10px}
.brand-mark{
  width:42px;
  height:42px;
  border-radius:13px;
}
.brand-word{
  font-size:13px;
  letter-spacing:.27em;
}
.nav-links{
  display:flex;
  align-items:center;
  gap:4px;
  padding:4px;
  border:1px solid rgba(15,20,32,.065);
  border-radius:999px;
  background:rgba(255,255,255,.42);
}
.nav-links a{
  min-height:34px;
  display:flex;
  align-items:center;
  padding:0 14px;
  border-radius:999px;
  color:#6f7886;
  font-size:8px;
  font-weight:850;
  letter-spacing:.085em;
  transition:background .2s ease,color .2s ease,transform .2s ease;
}
.nav-links a:hover{
  color:#17202c;
  background:rgba(255,255,255,.84);
  transform:translateY(-1px);
}
.nav-actions{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  justify-self:end;
  min-width:0;
}
.apps-menu-wrap{position:relative}
.apps-trigger{
  appearance:none;
  height:38px;
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:0 12px 0 10px;
  border:1px solid rgba(15,20,32,.09);
  border-radius:12px;
  background:rgba(255,255,255,.68);
  color:#26303e;
  box-shadow:0 7px 20px rgba(16,24,40,.035);
  cursor:pointer;
  font:800 8px/1 inherit;
  letter-spacing:.04em;
  transition:transform .2s ease,border-color .2s ease,background .2s ease,box-shadow .2s ease;
}
.apps-trigger:hover,
.apps-menu-wrap.is-open .apps-trigger{
  transform:translateY(-1px);
  border-color:rgba(61,84,132,.17);
  background:#fff;
  box-shadow:0 10px 28px rgba(16,24,40,.07);
}
.apps-trigger b{
  margin-left:1px;
  color:#7e8896;
  font-size:10px;
  font-weight:700;
  transition:transform .2s ease;
}
.apps-menu-wrap.is-open .apps-trigger b{transform:rotate(180deg)}
.apps-trigger-dot{
  width:18px;
  height:18px;
  display:grid;
  grid-template-columns:repeat(2,4px);
  grid-template-rows:repeat(2,4px);
  place-content:center;
  gap:2px;
  border-radius:6px;
  background:#171e2a;
}
.apps-trigger-dot i{
  width:4px;
  height:4px;
  border-radius:1.5px;
  background:#fff;
  opacity:.88;
}
.apps-menu{
  position:absolute;
  top:calc(100% + 12px);
  right:0;
  width:390px;
  padding:12px;
  border:1px solid rgba(15,20,32,.085);
  border-radius:22px;
  background:rgba(252,253,253,.965);
  box-shadow:0 28px 80px rgba(18,28,46,.16);
  backdrop-filter:blur(26px) saturate(150%);
  -webkit-backdrop-filter:blur(26px) saturate(150%);
  opacity:0;
  visibility:hidden;
  transform:translateY(-7px) scale(.985);
  transform-origin:top right;
  pointer-events:none;
  transition:opacity .2s ease,transform .22s cubic-bezier(.2,.75,.2,1),visibility .2s;
}
.apps-menu-wrap.is-open .apps-menu{
  opacity:1;
  visibility:visible;
  transform:none;
  pointer-events:auto;
}
.apps-menu-head{
  min-height:54px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:3px 7px 11px;
}
.apps-menu-head>div{display:flex;flex-direction:column;gap:3px}
.apps-menu-head small{
  color:#8a94a2;
  font-size:5px;
  font-weight:900;
  letter-spacing:.14em;
}
.apps-menu-head strong{
  color:#161d29;
  font-size:13px;
  letter-spacing:-.02em;
}
.apps-menu-head>span{
  color:#919aa5;
  font-size:6px;
  font-weight:800;
}
.apps-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:7px;
}
.app-link{
  min-height:82px;
  display:grid;
  grid-template-columns:34px 1fr 16px;
  gap:9px;
  align-items:center;
  padding:12px;
  border:1px solid rgba(15,20,32,.065);
  border-radius:15px;
  background:#f7f8fa;
  text-decoration:none;
  transition:transform .2s ease,border-color .2s ease,background .2s ease,box-shadow .2s ease;
}
.app-link:hover{
  transform:translateY(-2px);
  border-color:rgba(74,98,154,.15);
  background:#fff;
  box-shadow:0 12px 28px rgba(18,28,46,.075);
}
.app-link-icon{
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  border-radius:11px;
  color:#fff;
  background:linear-gradient(145deg,#192233,#354563);
  box-shadow:0 8px 18px rgba(25,34,51,.12);
  font:700 12px/1 Georgia,serif;
}
.app-trade .app-link-icon{background:linear-gradient(145deg,#566dff,#7b8dff)}
.app-bank .app-link-icon{background:linear-gradient(145deg,#315ea9,#5f8cdb)}
.app-control .app-link-icon{background:linear-gradient(145deg,#257f90,#54bdca)}
.app-link-copy{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:3px;
}
.app-link-copy b{
  color:#18202c;
  font-size:8px;
  line-height:1.1;
}
.app-link-copy small{
  color:#8a94a1;
  font-size:5.5px;
  line-height:1.35;
  white-space:nowrap;
}
.app-link em{
  color:#7d8794;
  font-size:9px;
  font-style:normal;
  transition:transform .2s ease,color .2s ease;
}
.app-link:hover em{
  color:#26303e;
  transform:translate(2px,-2px);
}
.apps-menu-foot{
  min-height:34px;
  display:flex;
  align-items:center;
  gap:7px;
  padding:10px 7px 0;
  color:#8b95a2;
  font-size:5.5px;
  font-weight:750;
}
.apps-menu-foot i{
  width:5px;
  height:5px;
  border-radius:50%;
  background:#47b987;
  box-shadow:0 0 10px rgba(71,185,135,.35);
}

/* Theme control is intentionally quieter than the apps menu */
.theme-switch{
  gap:2px;
  padding:3px;
  margin:0;
  border-color:rgba(15,20,32,.08);
  background:rgba(255,255,255,.60);
}
.theme-btn{
  width:32px;
  min-width:32px;
  height:31px;
  padding:0;
}
.theme-btn .theme-label{display:none}
.theme-btn .theme-icon{
  margin:0;
  font-size:11px;
}
.theme-btn.is-active{box-shadow:0 5px 15px rgba(15,20,32,.10)}

/* Mobile dropdown labels */
.mobile-nav-label{
  color:#9aa3ad;
  font-size:6px;
  font-weight:900;
  letter-spacing:.15em;
  padding:5px 4px 3px;
}
.mobile-nav-label-apps{
  margin-top:7px;
  padding-top:12px;
  border-top:1px solid rgba(15,20,32,.07);
}

/* Midnight */
html[data-theme="dark"] .nav{
  border-color:rgba(255,255,255,.075);
  background:rgba(8,13,24,.78);
  box-shadow:
    0 16px 45px rgba(0,0,0,.22),
    inset 0 1px 0 rgba(255,255,255,.035);
}
html[data-theme="dark"] .nav-links{
  border-color:rgba(255,255,255,.06);
  background:rgba(255,255,255,.025);
}
html[data-theme="dark"] .nav-links a{color:#8895a8}
html[data-theme="dark"] .nav-links a:hover{
  color:#f1f5fa;
  background:rgba(255,255,255,.055);
}
html[data-theme="dark"] .apps-trigger{
  border-color:rgba(255,255,255,.075);
  background:rgba(255,255,255,.035);
  color:#dce4ef;
  box-shadow:none;
}
html[data-theme="dark"] .apps-trigger:hover,
html[data-theme="dark"] .apps-menu-wrap.is-open .apps-trigger{
  border-color:rgba(122,143,202,.18);
  background:rgba(255,255,255,.065);
  box-shadow:0 10px 30px rgba(0,0,0,.18);
}
html[data-theme="dark"] .apps-trigger-dot{
  background:#eaf0f8;
}
html[data-theme="dark"] .apps-trigger-dot i{background:#121927}
html[data-theme="dark"] .apps-trigger b{color:#718096}
html[data-theme="dark"] .apps-menu{
  border-color:rgba(255,255,255,.075);
  background:rgba(11,17,29,.97);
  box-shadow:0 30px 90px rgba(0,0,0,.42);
}
html[data-theme="dark"] .apps-menu-head small,
html[data-theme="dark"] .apps-menu-head>span{color:#68778d}
html[data-theme="dark"] .apps-menu-head strong{color:#edf2f8}
html[data-theme="dark"] .app-link{
  border-color:rgba(255,255,255,.06);
  background:#111a2a;
}
html[data-theme="dark"] .app-link:hover{
  border-color:rgba(124,145,205,.15);
  background:#151f31;
  box-shadow:0 12px 30px rgba(0,0,0,.22);
}
html[data-theme="dark"] .app-link-copy b{color:#e8edf5}
html[data-theme="dark"] .app-link-copy small{color:#718096}
html[data-theme="dark"] .app-link em{color:#69788e}
html[data-theme="dark"] .app-link:hover em{color:#dce4ef}
html[data-theme="dark"] .apps-menu-foot{color:#6f7e92}
html[data-theme="dark"] .theme-switch{
  border-color:rgba(255,255,255,.07);
  background:rgba(255,255,255,.025);
}
html[data-theme="dark"] .mobile-nav-label{color:#647489}
html[data-theme="dark"] .mobile-nav-label-apps{border-color:rgba(255,255,255,.07)}

@media(max-width:1100px){
  .nav{
    width:calc(100% - 24px);
    grid-template-columns:auto 1fr auto;
  }
  .nav-links{justify-self:center}
  .nav-links a{padding:0 10px;font-size:7px}
  .apps-trigger>span:not(.apps-trigger-dot){display:none}
  .apps-trigger{padding:0 9px}
}
@media(max-width:980px){
  .nav{
    top:8px;
    width:calc(100% - 20px);
    height:64px;
    margin-top:8px;
    padding:0 9px 0 11px;
    grid-template-columns:1fr auto;
    border-radius:19px;
  }
  .nav-links{display:none}
  .apps-menu-wrap{display:none}
  .nav-actions{gap:4px}
  .menu{display:grid}
  .mobile-nav{
    top:calc(100% + 9px);
    border-radius:18px!important;
  }
}
@media(max-width:700px){
  .nav{
    width:calc(100% - 16px);
    height:60px;
    margin-top:7px;
    top:7px;
    border-radius:17px;
  }
  .brand-mark{width:36px;height:36px;border-radius:11px}
  .brand-word{font-size:11px}
  .theme-switch{margin:0 3px 0 0}
  .theme-btn{width:29px;min-width:29px;height:28px}
  .theme-btn .theme-icon{font-size:10px}
}

/* ===== Mobile Floating Section Rail — 2026-10-11 ===== */
.mobile-section-rail{
  display:none;
}

@media(max-width:980px){
  #products,#loop,#principles,#contact{scroll-margin-top:88px}

  .mobile-section-rail{
    position:fixed;
    right:8px;
    top:50%;
    z-index:92;
    display:flex;
    flex-direction:column;
    gap:7px;
    padding:8px 5px 8px 8px;
    border:1px solid rgba(15,20,32,.085);
    border-radius:20px;
    background:rgba(250,251,252,.62);
    box-shadow:0 16px 42px rgba(16,24,40,.10);
    backdrop-filter:blur(20px) saturate(155%);
    -webkit-backdrop-filter:blur(20px) saturate(155%);
    transform:translate(16px,-50%) scale(.96);
    opacity:0;
    pointer-events:none;
    transition:
      opacity .28s ease,
      transform .34s cubic-bezier(.2,.75,.2,1),
      background .28s ease,
      border-color .28s ease,
      box-shadow .28s ease;
  }
  .mobile-section-rail.is-visible{
    transform:translate(0,-50%) scale(1);
    opacity:1;
    pointer-events:auto;
  }
  .nav.menu-open ~ .mobile-section-rail{
    opacity:0!important;
    pointer-events:none!important;
    transform:translate(16px,-50%) scale(.96)!important;
  }

  .mobile-section-rail .rail-track{
    position:absolute;
    right:13px;
    top:20px;
    bottom:20px;
    width:1px;
    background:linear-gradient(180deg,transparent,rgba(68,87,123,.15) 15%,rgba(68,87,123,.15) 85%,transparent);
    pointer-events:none;
  }

  .mobile-section-rail a{
    position:relative;
    z-index:2;
    width:88px;
    min-height:35px;
    display:grid;
    grid-template-columns:20px 1fr 6px;
    align-items:center;
    gap:6px;
    padding:0 7px 0 6px;
    border:1px solid rgba(15,20,32,.065);
    border-radius:13px;
    background:rgba(255,255,255,.54);
    color:#737e8c;
    text-decoration:none;
    box-shadow:0 5px 14px rgba(16,24,40,.025);
    opacity:.66;
    transform:translateX(5px);
    transition:
      width .22s ease,
      opacity .22s ease,
      transform .22s ease,
      background .22s ease,
      border-color .22s ease,
      box-shadow .22s ease,
      color .22s ease;
  }

  .mobile-section-rail a i{
    width:20px;
    height:20px;
    display:grid;
    place-items:center;
    border-radius:7px;
    background:#eef1f5;
    color:#8c96a3;
    font-size:5px;
    line-height:1;
    font-weight:900;
    font-style:normal;
    letter-spacing:.03em;
    transition:background .22s ease,color .22s ease;
  }

  .mobile-section-rail a span{
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    font-size:7px;
    font-weight:850;
    letter-spacing:.025em;
  }

  .mobile-section-rail a b{
    width:5px;
    height:5px;
    justify-self:center;
    border-radius:50%;
    background:#c5ccd6;
    box-shadow:0 0 0 0 rgba(89,116,255,0);
    transition:background .22s ease,box-shadow .22s ease,transform .22s ease;
  }

  .mobile-section-rail a.is-active{
    width:98px;
    opacity:1;
    transform:translateX(-4px);
    color:#121923;
    border-color:rgba(77,101,158,.14);
    background:rgba(255,255,255,.94);
    box-shadow:0 11px 26px rgba(31,43,68,.10);
  }

  .mobile-section-rail a.is-active i{
    color:#fff;
    background:linear-gradient(145deg,#566eff,#788aff);
    box-shadow:0 6px 14px rgba(86,110,255,.22);
  }

  .mobile-section-rail a.is-active b{
    background:#5c75ff;
    box-shadow:0 0 0 4px rgba(92,117,255,.10),0 0 12px rgba(92,117,255,.30);
    transform:scale(1.08);
  }

  .mobile-section-rail a:active{
    transform:translateX(-2px) scale(.98);
  }

  html[data-theme="dark"] .mobile-section-rail{
    border-color:rgba(255,255,255,.075);
    background:rgba(9,15,26,.62);
    box-shadow:0 18px 48px rgba(0,0,0,.28);
  }

  html[data-theme="dark"] .mobile-section-rail .rail-track{
    background:linear-gradient(180deg,transparent,rgba(130,149,190,.13) 15%,rgba(130,149,190,.13) 85%,transparent);
  }

  html[data-theme="dark"] .mobile-section-rail a{
    border-color:rgba(255,255,255,.055);
    background:rgba(255,255,255,.028);
    color:#7d8ba0;
    box-shadow:none;
  }

  html[data-theme="dark"] .mobile-section-rail a i{
    background:#151f30;
    color:#748399;
  }

  html[data-theme="dark"] .mobile-section-rail a b{
    background:#445166;
  }

  html[data-theme="dark"] .mobile-section-rail a.is-active{
    color:#f1f5fa;
    border-color:rgba(119,140,203,.16);
    background:rgba(22,31,49,.94);
    box-shadow:0 13px 30px rgba(0,0,0,.26);
  }

  html[data-theme="dark"] .mobile-section-rail a.is-active i{
    background:linear-gradient(145deg,#6278ff,#8391ff);
    color:#fff;
  }

  html[data-theme="dark"] .mobile-section-rail a.is-active b{
    background:#7288ff;
    box-shadow:0 0 0 4px rgba(114,136,255,.10),0 0 14px rgba(114,136,255,.34);
  }
}

@media(max-width:430px){
  .mobile-section-rail{
    right:6px;
    padding:7px 4px 7px 7px;
    border-radius:17px;
  }
  .mobile-section-rail a{
    width:79px;
    min-height:33px;
    grid-template-columns:18px 1fr 5px;
    gap:5px;
    padding-left:5px;
    border-radius:12px;
  }
  .mobile-section-rail a.is-active{
    width:88px;
  }
  .mobile-section-rail a i{
    width:18px;
    height:18px;
    border-radius:6px;
    font-size:4.5px;
  }
  .mobile-section-rail a span{
    font-size:6.4px;
  }
}

@media(max-width:360px){
  .mobile-section-rail{
    right:4px;
  }
  .mobile-section-rail a{
    width:70px;
  }
  .mobile-section-rail a.is-active{
    width:79px;
  }
  .mobile-section-rail a span{
    font-size:5.8px;
  }
}

/* Rail visibility fallback: visible on mobile without JS dependency */
@media(max-width:980px){
  .mobile-section-rail{
    opacity:1!important;
    transform:translate(0,-50%) scale(1)!important;
    pointer-events:auto!important;
  }
  .nav.menu-open ~ .mobile-section-rail{
    opacity:0!important;
    pointer-events:none!important;
    transform:translate(16px,-50%) scale(.96)!important;
  }
}

/* ===== Mobile Rail V3: overlay only, no layout/overflow gap, idle auto-hide ===== */
html,
body{
  max-width:100%;
  overflow-x:hidden!important;
}

@media(max-width:980px){
  .mobile-section-rail,
  .mobile-section-rail.is-visible{
    position:fixed!important;
    right:max(6px,env(safe-area-inset-right))!important;
    left:auto!important;
    top:50%!important;
    bottom:auto!important;
    width:auto!important;
    max-width:110px!important;
    height:auto!important;
    max-height:calc(100dvh - 120px)!important;
    margin:0!important;
    box-sizing:border-box!important;
    contain:layout paint style;
    overflow:hidden;
    opacity:0!important;
    visibility:hidden!important;
    pointer-events:none!important;
    transform:translate3d(0,-50%,0) scale(.96)!important;
    will-change:opacity,transform;
    transition:
      opacity .22s ease,
      transform .26s cubic-bezier(.2,.75,.2,1),
      visibility 0s linear .26s!important;
  }

  .mobile-section-rail.is-moving{
    opacity:1!important;
    visibility:visible!important;
    pointer-events:auto!important;
    transform:translate3d(0,-50%,0) scale(1)!important;
    transition:
      opacity .18s ease,
      transform .24s cubic-bezier(.2,.75,.2,1),
      visibility 0s linear 0s!important;
  }

  .nav.menu-open ~ .mobile-section-rail,
  .nav.menu-open ~ .mobile-section-rail.is-moving{
    opacity:0!important;
    visibility:hidden!important;
    pointer-events:none!important;
    transform:translate3d(0,-50%,0) scale(.96)!important;
  }
}

@media(max-width:430px){
  .mobile-section-rail,
  .mobile-section-rail.is-visible{
    right:max(4px,env(safe-area-inset-right))!important;
    max-width:98px!important;
  }
}

/* AIMA Mail app */
.app-mail .app-link-icon{
  background:linear-gradient(145deg,#655bd8,#8f7bf2);
}
html[data-theme="dark"] .app-mail .app-link-icon{
  background:linear-gradient(145deg,#6157ce,#8c79ef);
}
