/* Omnipilot — tools mega menu + motion polish. Loaded after site.css. */

/* ---------- Category menu ---------- */
.mn { margin-left: 14px; margin-right: auto; }
.mn, .mn *, .mn *::before, .mn *::after { box-sizing: border-box; }
.mn [hidden] { display: none !important; }
.mn ul { list-style: none; margin: 0; padding: 0; }
.mn-bar { display: flex; align-items: center; gap: 2px; }
.mn-item { position: relative; }
.mn-top {
  position: relative; display: inline-flex; align-items: center; gap: 5px;
  height: 38px; padding: 0 11px; border: 0; border-radius: 10px;
  background: transparent; color: var(--text-2);
  font: 600 14.5px/1 var(--font); white-space: nowrap; cursor: pointer;
  transition: color .2s var(--ease), background-color .2s var(--ease);
}
.mn-top::after {
  content: ""; position: absolute; left: 11px; right: 11px; bottom: 3px; height: 2px; border-radius: 2px;
  background: var(--brand); transform: scaleX(0); transform-origin: 50% 50%; transition: transform .28s var(--ease);
}
.mn-top:hover, .mn-item.open > .mn-top { color: var(--text); background: var(--brand-soft); }
.mn-top:hover::after, .mn-item.open > .mn-top::after, .mn-item.is-active > .mn-top::after { transform: scaleX(1); }
.mn-item.is-active > .mn-top { color: var(--text); }
.mn-top:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.mn-top-icon { width: 38px; padding: 0; justify-content: center; }
.mn-top-icon::after { display: none; }
.mn-chev { color: var(--text-3); transition: transform .3s var(--ease); }
.mn-item.open > .mn-top .mn-chev { transform: rotate(180deg); color: var(--brand); }

.mn-drop {
  position: absolute; z-index: 40; top: calc(100% + 10px); left: 0;
  display: grid; gap: 4px 22px; padding: 16px 16px 14px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 18px;
  box-shadow: 0 24px 60px -18px rgba(15, 17, 20, .35), 0 2px 8px rgba(15, 17, 20, .06);
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(-8px) scale(.98); transform-origin: 20% 0;
  transition: opacity .2s var(--ease), transform .26s var(--ease), visibility 0s linear .26s;
}
.mn-drop::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.mn-cols-1 { grid-template-columns: minmax(220px, 1fr); }
.mn-cols-2 { grid-template-columns: repeat(2, minmax(210px, max-content)); }
.mn-item:nth-last-child(-n+2) > .mn-drop { left: auto; right: 0; transform-origin: 80% 0; }
.mn-item.open > .mn-drop {
  opacity: 1; visibility: visible; pointer-events: auto; transform: none;
  transition: opacity .2s var(--ease), transform .26s var(--ease), visibility 0s;
}
.mn-sub-h {
  display: flex; align-items: center; gap: 8px; margin: 0 0 6px; padding: 0 8px;
  font: 700 11.5px/1.2 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3);
}
.mn-sub-ic { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--brand-soft); color: var(--brand); }
.mn-sub a, .mn-results a {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 9px;
  color: var(--text-2); font-size: 14.5px; font-weight: 500; line-height: 1.3; text-decoration: none; white-space: nowrap;
  transition: background-color .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}
.mn-sub a::after, .mn-results a::after {
  content: "→"; margin-left: auto; padding-left: 10px; color: var(--brand); font-weight: 700;
  opacity: 0; transform: translateX(-6px); transition: opacity .18s var(--ease), transform .18s var(--ease);
}
.mn-sub a:hover, .mn-sub a:focus-visible, .mn-results a:hover, .mn-results a:focus-visible { background: var(--brand-soft); color: var(--text); transform: translateX(2px); outline: none; }
.mn-sub a:hover::after, .mn-sub a:focus-visible::after, .mn-results a:hover::after, .mn-results a:focus-visible::after { opacity: 1; transform: none; }
.mn a.is-current { color: var(--brand-strong, var(--brand)); font-weight: 650; background: var(--brand-soft); }
.mn-item.open .mn-sub { animation: mnIn .34s var(--ease) both; }
.mn-item.open .mn-sub:nth-child(2) { animation-delay: .05s; }
.mn-item.open .mn-sub:nth-child(3) { animation-delay: .1s; }
@keyframes mnIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* AI and workspace menus: feature cards */
.mn-spark { color: var(--brand); filter: drop-shadow(0 0 6px rgba(255, 90, 31, .45)); animation: sparkle 2.8s ease-in-out infinite; }
@keyframes sparkle { 0%, 100% { transform: scale(1) rotate(0); opacity: 1; } 50% { transform: scale(1.18) rotate(12deg); opacity: .85; } }
.mn-item-ai > .mn-top > span {
  background: linear-gradient(90deg, var(--brand) 0%, #ff8a3d 45%, #e1306c 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 700;
}
.mn-lock { display: inline-grid; place-items: center; color: var(--text-3); }
.mn-top, .mn-item { flex-shrink: 0; }
.mn-spark { flex: none; width: 15px; height: 15px; }
.mn-lock, .mn-lock svg { flex: none; width: 13px; height: 13px; }
.mn-drop-feat { grid-template-columns: repeat(2, minmax(300px, 340px)); }
.mn-drop-feat.mn-cols-1 { grid-template-columns: minmax(340px, 380px); }
.mn-feat {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; margin-bottom: 4px;
  border: 1px solid transparent; color: var(--text); text-decoration: none;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.mn-sub a.mn-feat::after { display: none; }
a.mn-feat:hover, a.mn-feat:focus-visible {
  background: var(--brand-soft); border-color: var(--brand-line); transform: translateY(-1px);
  box-shadow: 0 10px 24px -16px rgba(255, 90, 31, .6); outline: none;
}
a.mn-feat.is-current { border-color: var(--brand-line); background: var(--brand-soft); }
.mn-feat-ic {
  flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, rgba(255, 90, 31, .18), rgba(225, 48, 108, .14)); color: var(--brand);
  transition: transform .35s cubic-bezier(.34, 1.56, .64, 1);
}
a.mn-feat:hover .mn-feat-ic { transform: rotate(-8deg) scale(1.08); }
.mn-feat-txt { display: grid; gap: 2px; min-width: 0; white-space: normal; }
.mn-feat-txt b { font-size: 14.5px; font-weight: 650; line-height: 1.25; }
.mn-feat-txt small { font-size: 12.5px; line-height: 1.35; color: var(--text-3); }
.mn-badge { flex: none; margin-left: auto; padding: 3px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.mn-badge-live { color: #fff; background: linear-gradient(90deg, var(--brand), #e1306c); }
.mn-badge-soon { color: var(--text-3); background: var(--surface-3, rgba(20, 22, 26, .06)); border: 1px dashed var(--border-strong); }
.mn-feat.is-soon { cursor: default; opacity: .78; }
.mn-feat.is-soon .mn-feat-ic { background: var(--surface-2); color: var(--text-3); }
.mn-note {
  grid-column: 1 / -1; margin: 6px 4px 0; padding: 10px 12px; border-radius: 11px;
  background: var(--surface-2); color: var(--text-2); font-size: 13px; line-height: 1.45;
}

/* search dropdown */
.mn-drop-search { width: 340px; display: block; padding: 12px; }
.mn-search {
  display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 12px; margin-bottom: 8px;
  border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-3);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.mn-search:focus-within { border-color: var(--brand-line); box-shadow: 0 0 0 4px var(--brand-soft); background: var(--surface); }
.mn-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font: 500 15px var(--font); }
.mn-results { max-height: min(340px, 55vh); overflow: auto; }
.mn-empty { margin: 8px 10px; color: var(--text-3); }

/* burger (small screens only) */
.mn-burger {
  display: none; align-items: center; gap: 8px; height: 38px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text);
  font: 600 14px/1 var(--font); cursor: pointer; transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.mn-burger:hover, .mn.m-open .mn-burger { border-color: var(--brand-line); background: var(--brand-soft); }
.mn-burger-ic { position: relative; width: 16px; height: 12px; }
.mn-burger-ic i { position: absolute; left: 0; width: 16px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .3s var(--ease), opacity .2s var(--ease), top .3s var(--ease); }
.mn-burger-ic i:nth-child(1) { top: 0; } .mn-burger-ic i:nth-child(2) { top: 5px; } .mn-burger-ic i:nth-child(3) { top: 10px; }
.mn.m-open .mn-burger-ic i:nth-child(1) { top: 5px; transform: rotate(45deg); }
.mn.m-open .mn-burger-ic i:nth-child(2) { opacity: 0; }
.mn.m-open .mn-burger-ic i:nth-child(3) { top: 5px; transform: rotate(-45deg); }

/* laptops: keep the category bar, make the header buttons compact */
@media (min-width: 961px) and (max-width: 1280px) {
  .mn { margin-left: 8px; }
  .mn-top { padding: 0 7px; font-size: 13.5px; gap: 4px; }
  .mn-top::after { left: 7px; right: 7px; }
  .mn-chev { display: none; }
  .mn-top-icon { width: 34px; }
  .top-actions .lang-switch span { display: none; }
  .top-actions a[href*="/accounts/login/"] { font-size: 0; gap: 0; padding-left: 10px; padding-right: 10px; }
}
@media (max-width: 960px) {
  .mn { position: static; margin-left: 10px; }
  .mn-burger { display: inline-flex; }
  .mn-bar {
    position: absolute; z-index: 40; top: calc(100% + 6px); left: 10px; right: 10px;
    display: flex; flex-direction: column; align-items: stretch; max-height: calc(100vh - var(--topbar-h, 62px) - 20px); overflow: auto;
    padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
    box-shadow: 0 24px 60px -18px rgba(15, 17, 20, .35);
    opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-8px);
    transition: opacity .2s var(--ease), transform .26s var(--ease), visibility 0s linear .26s;
  }
  .mn.m-open .mn-bar { opacity: 1; visibility: visible; pointer-events: auto; transform: none; transition: opacity .2s var(--ease), transform .26s var(--ease), visibility 0s; }
  .mn-item { border-bottom: 1px solid var(--border); }
  .mn-item:last-child { border-bottom: 0; }
  .mn-top { width: 100%; height: 48px; justify-content: flex-start; gap: 8px; font-size: 15.5px; color: var(--text); }
  .mn-top .mn-chev { margin-left: auto; }
  .mn-top::after { display: none; }
  .mn-search-item { order: -1; border-bottom: 1px solid var(--border) !important; }
  .mn-search-item > .mn-top { display: none; }
  .mn-drop, .mn-item:nth-last-child(-n+2) > .mn-drop, .mn-drop-search {
    position: static; width: auto; display: none; padding: 2px 0 12px; border: 0; box-shadow: none; border-radius: 0;
    background: transparent; opacity: 1; visibility: visible; pointer-events: auto; transform: none; transition: none;
  }
  .mn-drop::before { display: none; }
  .mn-item.open > .mn-drop { display: grid; animation: mnIn .28s var(--ease) both; }
  .mn .mn-bar > .mn-search-item > .mn-drop-search { display: block; padding: 8px 0 10px; }
  .mn-results { display: none; max-height: 45vh; }
  .mn-search-item.searching .mn-results { display: block; }
  .mn-cols-2 { grid-template-columns: 1fr 1fr; gap: 4px 12px; }
  .mn-drop-feat, .mn-drop-feat.mn-cols-1 { grid-template-columns: 1fr; }
  .mn-sub a { white-space: normal; }
}
@media (max-width: 560px) {
  .mn-burger-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .mn-burger { width: 40px; padding: 0; justify-content: center; }
  .mn-badge { display: none; }
  .mn-cols-2 { grid-template-columns: 1fr; }
  .mn-sub a::after, .mn-results a::after { display: none; }
}

/* ---------- Header ---------- */
.topbar { transition: box-shadow .25s var(--ease), background-color .25s var(--ease), border-color .25s var(--ease); }
.topbar.is-scrolled { box-shadow: 0 10px 30px -18px rgba(15, 17, 20, .45); }

/* ---------- Tool tiles on the home page ---------- */
.tool-tile {
  transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s var(--ease), background-color .28s var(--ease);
  animation: tileIn .5s var(--ease) both;
  will-change: transform;
}
.tool-tile:hover, .tool-tile:focus-visible {
  transform: translateY(-5px);
  border-color: var(--brand-line);
  box-shadow: 0 18px 36px -20px rgba(255, 90, 31, .55), 0 4px 12px -6px rgba(15, 17, 20, .15);
}
.tool-tile:active { transform: translateY(-2px) scale(.985); }
.tool-tile .tt-ic { transition: transform .4s cubic-bezier(.34, 1.56, .64, 1), background-color .28s var(--ease); }
.tool-tile:hover .tt-ic, .tool-tile:focus-visible .tt-ic { transform: translateY(-2px) scale(1.12) rotate(-6deg); }
.tools-grid .tool-tile:nth-child(1) { animation-delay: .02s; } .tools-grid .tool-tile:nth-child(2) { animation-delay: .05s; }
.tools-grid .tool-tile:nth-child(3) { animation-delay: .08s; } .tools-grid .tool-tile:nth-child(4) { animation-delay: .11s; }
.tools-grid .tool-tile:nth-child(5) { animation-delay: .14s; } .tools-grid .tool-tile:nth-child(6) { animation-delay: .17s; }
.tools-grid .tool-tile:nth-child(7) { animation-delay: .20s; } .tools-grid .tool-tile:nth-child(8) { animation-delay: .23s; }
.tools-grid .tool-tile:nth-child(9) { animation-delay: .26s; } .tools-grid .tool-tile:nth-child(10) { animation-delay: .29s; }
.tools-grid .tool-tile:nth-child(11) { animation-delay: .32s; } .tools-grid .tool-tile:nth-child(12) { animation-delay: .35s; }
.tools-grid .tool-tile:nth-child(n+13) { animation-delay: .38s; }
@keyframes tileIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Tool pages ---------- */
.ft .card { animation: cardIn .45s var(--ease) both; }
.ft .emi-grid > .card:nth-child(2) { animation-delay: .07s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.ft .emi-big strong { display: inline-block; transition: color .2s var(--ease); }
.ft .emi-big strong.is-bump { animation: bump .32s var(--ease); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }
.ft-tab { transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .15s var(--ease); }
.ft-tab:active { transform: scale(.95); }
.seo-faq details { transition: background-color .2s var(--ease); }
.seo-faq details[open] > p { animation: cardIn .3s var(--ease) both; }

/* ---------- Buttons ---------- */
.btn { transition: transform .15s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease); }
.btn-primary:hover { box-shadow: 0 10px 22px -12px rgba(255, 90, 31, .75); transform: translateY(-1px); }
.btn:active { transform: scale(.97); }

/* ---------- Respect "reduce motion" ---------- */
@media (prefers-reduced-motion: reduce) {
  .mn-spark { animation: none !important; }
  .mn-drop, .mn-item.open > .mn-drop, .mn-item.open .mn-sub, .mn-bar, .tool-tile, .ft .card, .ft .emi-big strong.is-bump, .seo-faq details[open] > p { animation: none !important; transition: none !important; }
  .tool-tile:hover, .tool-tile:focus-visible, .btn-primary:hover, .mn-sub a:hover { transform: none; }
}
