/* ═══════════════════════════════════════════════════════════
   KwoTit shared header + nav  (nav.css)
   Link this AFTER the page's own <style> so it wins.
   ═══════════════════════════════════════════════════════════ */

/* same cream colours as the landing page (light mode only) */
:root:not([data-theme="dark"]){ --paper:#FFFBEF; --paper-alt:#FEF6E0; }

/* logo: show the right one for light / dark */
.logo-light{ display:block; } .logo-dark{ display:none; }
[data-theme="dark"] .logo-light{ display:none; }
[data-theme="dark"] .logo-dark{ display:block; }

/* stronger copies for the header, so a page's own ".header-logo img" rule can't win */
.header .header-logo .logo-light{ display:block; }
.header .header-logo .logo-dark{ display:none; }
[data-theme="dark"] .header .header-logo .logo-light{ display:none; }
[data-theme="dark"] .header .header-logo .logo-dark{ display:block; }

/* footer logo is always the light-on-dark one, in both modes */
.footer img.logo-light{ display:block !important; }

/* the header bar itself (same as landing page) */
.header{
  position:fixed; top:0; left:0; right:0; z-index:1000;
  background:rgba(255,251,239,.88); backdrop-filter:blur(12px);
  border-bottom:1px solid var(--border);
}
[data-theme="dark"] .header{ background:rgba(20,21,27,.9); }
.header-inner{
  display:flex; justify-content:space-between; align-items:center;
  height:auto; padding:10px 24px; max-width:1200px; margin:0 auto;
}
.header-logo{ display:flex; align-items:center; text-decoration:none; }
.header-logo-img{ width:auto; height:34px; margin:0; }
.header-actions{ display:flex; align-items:center; gap:12px; }
.header-actions .theme-toggle{
  background:var(--card); border:2px solid var(--border); border-radius:999px;
  padding:8px 12px; cursor:pointer; color:var(--ink-soft); font-size:1rem; transition:var(--transition);
}
.header-actions .theme-toggle:hover{ border-color:var(--brand); color:var(--brand-dark); }
.hamburger{ display:none; background:none; border:none; font-size:1.4rem; cursor:pointer; color:var(--ink); padding:4px; }

/* ───────── NAV ───────── */
.header-nav{ display:flex; align-items:center; gap:4px; }
.nv-item{ position:relative; }

.nv-btn{
  display:flex; align-items:center; gap:6px;
  padding:9px 14px; border:0; border-radius:10px; background:none;
  font-family:var(--font-heading); font-weight:700; font-size:1rem;
  color:var(--ink-soft); cursor:pointer; transition:var(--transition);
}
.nv-btn:hover, .nv-item.open > .nv-btn{ color:var(--ink); background:var(--paper-alt); }
.nv-btn i{ font-size:.7rem; transition:transform .2s; }
.nv-item.open > .nv-btn i{ transform:rotate(180deg); }

.nv-panel{
  background:var(--card); border:1px solid var(--border); border-radius:18px;
  box-shadow:0 20px 40px rgba(23,24,31,.10); padding:10px; z-index:1100;
}

/* simple list menu (Company, Free Tools) */
.header-nav .nv-simple a{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:11px 14px; border-radius:10px;
  font-family:var(--font-body); font-weight:600; font-size:.95rem;
  color:var(--ink); text-decoration:none;
}
.header-nav .nv-simple a:hover{ background:var(--paper-alt); }
.nv-simple a i{ font-size:.75rem; color:var(--ink-soft); }

/* integrations grid */
.header-nav .nv-link{ display:flex; align-items:center; gap:12px; padding:10px; border-radius:12px; text-decoration:none; }
.header-nav .nv-link:hover{ background:var(--paper-alt); }
.nv-ico{ width:38px; height:38px; flex-shrink:0; border-radius:10px; display:flex; align-items:center; justify-content:center; font-size:1rem; }
.nv-link b{ display:block; font-family:var(--font-body); font-size:.9rem; color:var(--ink); }
.nv-link small{ display:block; font-size:.76rem; font-weight:500; color:var(--ink-soft); }

/* product menu */
.nv-cards{ display:flex; flex-direction:column; gap:12px; }
.header-nav .nv-card{
  display:flex; align-items:center; gap:18px; padding:20px; border-radius:16px;
  background:var(--mint-soft); border:1px solid transparent; text-decoration:none;
}
.header-nav .nv-card:hover{ background:var(--brand-bg); border-color:rgba(76,175,98,.25); }
.header-nav .nv-card.small{ padding:14px 20px; background:var(--paper-alt); }
.nv-card-ico{
  width:46px; height:46px; flex-shrink:0; display:flex; align-items:center; justify-content:center;
  border-radius:12px; background:#fff; border:1px solid var(--border); color:#17181F; font-size:1.2rem;
}
.nv-card b{ display:flex; align-items:center; gap:8px; font-family:var(--font-body); font-size:1.1rem; font-weight:800; color:var(--ink); }
.nv-card small{ display:block; margin-top:2px; font-size:.86rem; font-weight:500; line-height:1.4; color:var(--ink-soft); }
.nv-arrow{ margin-left:auto; color:var(--ink-soft); opacity:0; transform:translateX(-5px); transition:.2s; }
.nv-card:hover .nv-arrow{ opacity:1; transform:none; color:var(--brand-dark); }
.nv-badge{ font-size:.6rem; font-weight:800; letter-spacing:.05em; background:var(--brand); color:#fff; padding:2px 6px; border-radius:4px; }

.nv-preview{ background:var(--mint-soft); border:1px solid var(--border); border-radius:16px; padding:22px; }
.nv-mock{ background:#fff; border:1px solid var(--border); border-radius:12px; height:170px; margin-bottom:18px; overflow:hidden; display:flex; flex-direction:column; box-shadow:0 4px 12px rgba(0,0,0,.03); }
.nv-mock-bar{ height:24px; background:#F9F9F9; border-bottom:1px solid var(--border); display:flex; align-items:center; gap:5px; padding:0 10px; }
.nv-mock-bar span{ width:6px; height:6px; border-radius:50%; display:block; }
.nv-mock-body{ flex:1; display:flex; align-items:center; justify-content:center; background:var(--paper); }
.nv-mock-body span{ width:80%; background:#fff; border:1px solid var(--border); border-radius:8px; padding:12px; text-align:center; font-size:.8rem; font-weight:700; color:#17181F; box-shadow:var(--shadow); }
.nv-preview b{ display:block; margin-bottom:6px; font-family:var(--font-heading); font-size:1.15rem; font-weight:800; color:var(--ink); }
.nv-preview p{ font-size:.9rem; color:var(--ink-soft); margin:0; }

/* ✅ Sign Up / Dashboard button */
.header-nav .nav-cta{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  margin-left:10px; padding:10px 20px; border-radius:999px;
  background:var(--brand); color:#fff; border:2px solid var(--ink);
  box-shadow:2px 2px 0 var(--ink);
  font-family:var(--font-heading); font-weight:800; font-size:.95rem; line-height:1;
  text-decoration:none; white-space:nowrap; transition:var(--transition);
}
.header-nav a.nav-cta:hover{ background:#388A4C; color:#fff !important; transform:translate(-1px,-1px); box-shadow:4px 4px 0 var(--ink); }
.header-nav .nav-cta:active{ transform:none; box-shadow:1px 1px 0 var(--ink); }

/* ───── DESKTOP: menus open on hover ───── */
@media (min-width:901px){
  .nv-panel{
    position:absolute; top:calc(100% + 8px); left:0;
    opacity:0; visibility:hidden; transform:translateY(8px);
    transition:opacity .2s ease, transform .2s ease, visibility .2s;
  }
  .nv-panel::before{ content:""; position:absolute; left:0; right:0; top:-22px; height:22px; } /* invisible bridge */

  .nv-wide{ position:static; }
  .nv-wide > .nv-panel{ left:50%; transform:translate(-50%,8px); }

  .nv-product{ display:grid; grid-template-columns:1fr 1.1fr; gap:16px; width:min(800px, calc(100vw - 32px)); padding:16px; border-radius:24px; }
  .nv-grid{ display:grid; grid-template-columns:1fr 1fr; gap:4px; width:min(520px, calc(100vw - 32px)); }
  .nv-simple{ display:flex; flex-direction:column; width:240px; }

  .nv-item.open > .nv-panel{ opacity:1; visibility:visible; transform:translateY(0); }
  .nv-wide.open > .nv-panel{ transform:translate(-50%,0); }
}
@media (min-width:901px) and (hover:hover){
  .nv-item:hover > .nv-panel{ opacity:1; visibility:visible; transform:translateY(0); }
  .nv-wide:hover > .nv-panel{ transform:translate(-50%,0); }
  .nv-item:hover > .nv-btn{ color:var(--ink); background:var(--paper-alt); }
  .nv-item:hover > .nv-btn i{ transform:rotate(180deg); }
}

/* ───── PHONE + TABLET: tap-to-open list ───── */
@media (max-width:900px){
  .header .hamburger{ display:block; }
  .header-nav{
    display:none; flex-direction:column; align-items:stretch; gap:0;
    position:absolute; top:100%; left:0; right:0;
    padding:8px 24px 28px; background:var(--paper);
    border-bottom:1px solid var(--border);
    max-height:calc(100vh - 64px); max-height:calc(100dvh - 64px); overflow-y:auto;
  }
  .header-nav.open{ display:flex; }

  .nv-item{ border-bottom:1px solid var(--border); }
  .header-nav .nv-item > .nv-btn,
  .header-nav .nv-item.open > .nv-btn{
    width:100%; justify-content:space-between; padding:16px 0; border-radius:0; background:none;
    font-family:var(--font-body); font-size:1.05rem; font-weight:600; color:var(--ink);
  }
  .nv-panel{ display:none; background:none; border:0; box-shadow:none; border-radius:0; padding:0 0 8px 4px; }
  .nv-item.open > .nv-panel{ display:block; }

  .header-nav .nv-card, .header-nav .nv-card:hover, .header-nav .nv-card.small{ background:none; border:0; border-radius:0; padding:14px 0; }
  .header-nav .nv-simple a{ padding:13px 0; }
  .header-nav .nv-link{ padding:12px 0; }
  .nv-preview, .nv-arrow{ display:none; }

  .header-nav .nav-cta{ margin:18px 0 0; width:100%; padding:14px 20px; font-size:1.05rem; }
}
