/* ==========================================================================
   PiPO HRIS — LAYER 04 · NAVIGATION
   Announcement bar · header (transparent + sticky) · mega menus ·
   mobile drawer · secondary product nav · footer.
   Six top-level items. One primary CTA. Everything is a real <a href>.
   ========================================================================== */

/* ── 1. ANNOUNCEMENT BAR — optional, dismissible, never permanent ───────── */
.announce {
  background: var(--ink-soft);
  color: rgba(255,255,255,.72);
  font-size: .8rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.announce[hidden] { display: none; }
.announce__inner { display: flex; align-items: center; gap: 1rem; min-height: 42px; }
.announce__dot { width: 5px; height: 5px; border-radius: 50%; background: var(--emerald-400); flex: none; box-shadow: 0 0 0 3px rgba(19,185,129,.18); }
.announce__msg { flex: 1; }
.announce__msg a { color: #fff; border-bottom: 1px solid rgba(255,255,255,.3); padding-bottom: 1px; }
.announce__msg a:hover { border-bottom-color: var(--emerald-400); }
.announce__x {
  width: 30px; height: 30px; flex: none; margin-right: -6px;
  border: 0; background: transparent; color: rgba(255,255,255,.58);
  cursor: pointer; border-radius: var(--r-xs); line-height: 1;
  display: grid; place-items: center;
  transition: color var(--t-fast) var(--e-out), background var(--t-fast) var(--e-out);
}
.announce__x:hover { color: #fff; background: rgba(255,255,255,.08); }
@media (max-width: 640px) { .announce { font-size: .76rem; } .announce__inner { min-height: 40px; } }

/* ── 2. HEADER ──────────────────────────────────────────────────────────── */
.nav-root { position: sticky; top: 0; z-index: 90; margin-bottom: calc(-1 * var(--hdr-h)); }

.hdr {
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background var(--t-std) var(--e-out),
              border-color var(--t-std) var(--e-out),
              backdrop-filter var(--t-std) var(--e-out);
}
.hdr__inner {
  display: flex; align-items: center;
  gap: clamp(14px, 2vw, 34px);
  min-height: 76px;
  transition: min-height var(--t-std) var(--e-out);
}

/* Over a midnight hero: transparent, light type */
.nav-root[data-theme="dark"] .hdr { color: rgba(255,255,255,.82); }
.nav-root[data-theme="dark"] .hdr .nav__link { color: rgba(255,255,255,.82); }
.nav-root[data-theme="dark"] .hdr .nav__link:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-root[data-theme="dark"] .burger { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.58); }
.nav-root[data-theme="dark"] .burger i, .nav-root[data-theme="dark"] .burger i::before, .nav-root[data-theme="dark"] .burger i::after { background: #fff; }

/* Scrolled: solid, thin rule, slightly shorter */
.nav-root.is-stuck .hdr {
  background: rgba(11,26,22,.86);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom-color: rgba(255,255,255,.58);
}
.nav-root.is-stuck .hdr__inner { min-height: 64px; }

/* Light pages: solid cloud header from the start */
.nav-root[data-theme="light"] .hdr { background: rgba(246,247,244,.9); backdrop-filter: saturate(170%) blur(16px); -webkit-backdrop-filter: saturate(170%) blur(16px); }
.nav-root[data-theme="light"].is-stuck .hdr { background: rgba(246,247,244,.96); border-bottom-color: var(--line); }
.nav-root[data-theme="light"] .nav__link { color: var(--ink-2); }
.nav-root[data-theme="light"] .nav__link:hover { color: var(--ink); background: rgba(11,26,22,.05); }

/* Brand */
.brand { display: inline-flex; align-items: center; flex: none; padding: 4px 0; }
.brand img { height: 30px; width: auto; transition: height var(--t-std) var(--e-out); }
.nav-root.is-stuck .brand img { height: 27px; }
.brand__light { display: none; }
.nav-root[data-theme="dark"] .brand__dark { display: none; }
.nav-root[data-theme="dark"] .brand__light { display: block; }

/* ── 3. PRIMARY NAV ─────────────────────────────────────────────────────── */
.nav { display: flex; align-items: center; gap: 2px; margin-inline: auto; }
.nav__item { position: relative; }
.nav__link {
  display: inline-flex; align-items: center; gap: .38em;
  min-height: 44px; padding: 0 .82em;
  border-radius: var(--r-xs);
  font-size: .93rem; font-weight: 500; letter-spacing: -.008em;
  color: var(--ink-2); background: none; border: 0; cursor: pointer;
  transition: color var(--t-fast) var(--e-out), background var(--t-fast) var(--e-out);
  white-space: nowrap;
}
.nav__caret { width: 9px; height: 9px; opacity: .55; transition: transform var(--t-std) var(--e-out); }
.nav__item.is-open .nav__caret { transform: rotate(180deg); }

/* active section on inner pages — subtle, not shouted */
.nav__link[data-active]::after {
  content: ''; position: absolute; left: .82em; right: .82em; bottom: 9px;
  height: 2px; border-radius: 2px; background: var(--emerald-400);
}
.nav-root[data-theme="light"] .nav__link[data-active]::after { background: var(--emerald); }

.hdr__actions { display: flex; align-items: center; gap: .55rem; flex: none; }
.hdr__login {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 .85em;
  font-size: .9rem; font-weight: 500; border-radius: var(--r-xs);
  color: rgba(255,255,255,.78);
  transition: color var(--t-fast) var(--e-out), background var(--t-fast) var(--e-out);
}
.hdr__login:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-root[data-theme="light"] .hdr__login { color: var(--ink-3); }
.nav-root[data-theme="light"] .hdr__login:hover { color: var(--ink); background: rgba(11,26,22,.05); }

/* ── The calculators pill ────────────────────────────────────────────────
   The calculators are what brings people to the site, so they get their own
   slot beside the demo button instead of living only inside Resources. Gold
   rather than emerald: it reads as a matched pair with the demo button
   without competing with it for the primary action. */
.hdr__calc {
  display: inline-flex; align-items: center; gap: .5em;
  min-height: 44px; padding: 0 1.05em;
  font-size: .875rem; font-weight: 560; letter-spacing: -.005em;
  border-radius: var(--r-btn);
  border: 1px solid var(--gold-lt);
  color: var(--gold-lt);
  background: rgba(176,143,69,.12);
  white-space: nowrap;
  transition: background .22s var(--ease), color .22s var(--ease),
              border-color .22s var(--ease), transform .22s var(--ease);
}
.hdr__calc svg { width: 1.08em; height: 1.08em; flex: none; }
.hdr__calc:hover { background: var(--gold-lt); color: var(--plum-900); transform: translateY(-1.5px); }
.nav-root[data-theme="light"] .hdr__calc {
  color: var(--gold-ink); border-color: var(--gold-line); background: var(--gold-tint);
}
.nav-root[data-theme="light"] .hdr__calc:hover { background: #EFE3C8; border-color: var(--gold); color: var(--gold-ink); }

/* Drawer version — same gold, full-width button shape. */
.btn--calc { background: var(--gold-tint); color: var(--gold-ink); border-color: var(--gold-line); }
.btn--calc:hover { background: #EFE3C8; border-color: var(--gold); }

/* Switch to the drawer before labels can collide */
@media (max-width: 1140px) { .nav, .hdr__login { display: none; } }

/* The word "Free" is the first thing to go when the bar gets tight, then the
   label, leaving the gold calculator glyph — still a target, still gold. */
@media (max-width: 1240px) { .hdr__calc-free { display: none; } }
@media (max-width: 620px)  { .hdr__calc { padding: 0; width: 44px; justify-content: center; font-size: 0; gap: 0; }
                             .hdr__calc svg { width: 19px; height: 19px; } }

/* At 320px the logo, the calculators glyph, the demo button and the burger
   overran the bar by 35px. Everything gives a little rather than one thing
   being dropped — the calculators glyph earns its place on a phone. */
@media (max-width: 400px) {
  .hdr__calc { width: 36px; }
  .hdr__calc svg { width: 17px; height: 17px; }
  .btn__book { display: none; }          /* "Book a Demo" -> "Demo" */
}

/* ── 4. MEGA MENUS ──────────────────────────────────────────────────────── */
.mega {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--paper);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 30px 64px rgba(11,26,22,.14);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity var(--t-std) var(--e-out), transform var(--t-std) var(--e-out), visibility var(--t-std);
  z-index: 95;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
.mega.is-open { opacity: 1; visibility: visible; transform: none; }
.mega__inner {
  width: 100%; max-width: var(--maxw); margin-inline: auto;
  padding: clamp(28px, 3vw, 40px) var(--gutter) clamp(30px, 3.2vw, 44px);
  display: grid; gap: clamp(26px, 3vw, 48px);
}
.mega--cols3 .mega__inner { grid-template-columns: 1fr 1fr .92fr; }
.mega--cols4 .mega__inner { grid-template-columns: 1fr 1fr 1fr 1.06fr; }
.mega--cols2 .mega__inner { grid-template-columns: 1.4fr .9fr; max-width: 940px; }
@media (max-width: 1240px) {
  .mega--cols4 .mega__inner { grid-template-columns: 1fr 1fr 1fr; }
  .mega--cols4 .mega__feature { grid-column: 1 / -1; }
}

.mega__group + .mega__group { margin-top: clamp(20px, 2vw, 28px); }
.mega__label {
  font-family: var(--font-mono);
  font-size: .64rem; font-weight: 500; letter-spacing: .15em; text-transform: uppercase;
  color: var(--muted-2); margin-bottom: .75rem;
  padding-left: .7rem;
}
.mega__list { display: grid; gap: 1px; }

.mega__item {
  display: grid; grid-template-columns: 26px 1fr; gap: .8rem;
  padding: .62rem .7rem; border-radius: var(--r-xs);
  min-height: 44px; align-items: start;
  transition: background var(--t-fast) var(--e-out);
}
.mega__item:hover { background: var(--paper-2); }
.mega__item:hover .mega__title { color: var(--emerald-700); }
.mega__ico { width: 22px; height: 22px; margin-top: 2px; color: var(--muted); transition: color var(--t-fast) var(--e-out); }
.mega__ico svg { width: 18px; height: 18px; }
.mega__item:hover .mega__ico { color: var(--emerald); }
.mega__title {
  display: block; font-size: .92rem; font-weight: 600; letter-spacing: -.012em; color: var(--ink);
  transition: color var(--t-fast) var(--e-out);
}
.mega__desc { display: block; font-size: .8rem; line-height: 1.45; color: var(--muted); margin-top: 2px; }
.mega__item[aria-current] { background: var(--emerald-tint); }
.mega__item[aria-current] .mega__title { color: var(--emerald-700); }

.mega__overview {
  display: inline-flex; align-items: center; gap: .45em;
  margin-top: 1rem; padding-left: .7rem;
  font-size: .86rem; font-weight: 600; color: var(--emerald-700);
}
.mega__overview:hover { gap: .7em; }
.mega__overview svg { width: 13px; height: 13px; transition: transform var(--t-fast) var(--e-out); }

/* Featured panel */
.mega__feature {
  background: var(--ink); border-radius: var(--r-lg); padding: clamp(20px, 2vw, 26px);
  color: rgba(255,255,255,.72); display: flex; flex-direction: column;
  position: relative; overflow: hidden; isolation: isolate;
}
.mega__feature::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(420px 220px at 82% 4%, rgba(19,185,129,.28), transparent 66%),
              radial-gradient(300px 190px at 44% 70%, rgba(11,140,120,.14), transparent 68%),
              radial-gradient(320px 200px at 6% 96%, rgba(63,50,141,.12), transparent 68%);
}
.mega__feature h4, .mega__feature .mega__ft { color: #fff; font-size: 1.08rem; letter-spacing: -.022em; margin: .8rem 0 .45rem; }
.mega__feature p { font-size: .94rem; line-height: 1.55; }
.mega__feature .link-arrow { margin-top: auto; padding-top: 1.2rem; color: var(--emerald-300); }
.mega__viz { margin-top: 1.1rem; border-radius: var(--r-xs); overflow: hidden; border: 1px solid rgba(255,255,255,.12); }

/* Frontline — the one highlighted destination in the Products menu */
.mega__flagship {
  display: block; border-radius: var(--r); padding: 1rem 1.1rem;
  background: var(--emerald-tint); border: 1px solid rgba(8,127,91,.22);
  transition: border-color var(--t-fast) var(--e-out), background var(--t-fast) var(--e-out);
}
.mega__flagship:hover { border-color: var(--emerald); background: #DFF2EA; }
.mega__flagship .fl-top { display: flex; align-items: center; gap: .55rem; }
.mega__flagship .fl-top svg { width: 17px; height: 17px; color: var(--emerald); }
.mega__flagship b { font-size: .95rem; font-weight: 700; color: var(--ink); letter-spacing: -.015em; }
.mega__flagship .fl-line { display: block; font-size: .83rem; line-height: 1.5; color: var(--ink-3); margin-top: .45rem; }
.mega__flagship .fl-cta { display: inline-flex; align-items: center; gap: .4em; margin-top: .7rem; font-size: .82rem; font-weight: 600; color: var(--emerald-700); }
.mega__flagship .fl-cta svg { width: 12px; height: 12px; }

/* ── 5. MOBILE DRAWER ───────────────────────────────────────────────────── */
.burger {
  display: none; width: 44px; height: 44px; flex: none;
  border: 1px solid var(--line); border-radius: var(--r-xs);
  background: #fff; cursor: pointer;
  align-items: center; justify-content: center;
}
.burger i { display: block; width: 17px; height: 1.5px; background: var(--ink); position: relative; }
.burger i::before, .burger i::after { content: ''; position: absolute; left: 0; width: 17px; height: 1.5px; background: var(--ink); }
.burger i::before { top: -5.5px } .burger i::after { top: 5.5px }
@media (max-width: 1140px) { .burger { display: inline-flex; } }

.drawer {
  position: fixed; inset: 0; z-index: 120;
  background: var(--paper);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--t-slow) var(--e-out);
  visibility: hidden;
}
.drawer.is-open { transform: none; visibility: visible; }
.drawer__top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 14px var(--gutter);
  border-bottom: 1px solid var(--line);
  flex: none;
}
.drawer__x {
  width: 44px; height: 44px; flex: none;
  border: 1px solid var(--line); border-radius: var(--r-xs);
  background: #fff; cursor: pointer; color: var(--ink);
  display: grid; place-items: center;
}
.drawer__x svg { width: 17px; height: 17px; }
.drawer__body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px var(--gutter) 24px; }
.drawer__foot {
  flex: none; padding: 16px var(--gutter) calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: #fff;
  display: grid; gap: .6rem; grid-template-columns: 1fr auto;
}

.drawer__sec { border-bottom: 1px solid var(--line-soft); }
.drawer__trigger {
  width: 100%; min-height: 56px; padding: .6rem 0;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: none; border: 0; cursor: pointer;
  font-size: 1.05rem; font-weight: 600; color: var(--ink); letter-spacing: -.018em;
  text-align: left;
}
.drawer__plus { width: 22px; height: 22px; flex: none; position: relative; border: 1px solid var(--line); border-radius: 50%; }
.drawer__plus::before, .drawer__plus::after {
  content: ''; position: absolute; top: 50%; left: 50%; background: var(--ink-3); border-radius: 2px;
  transform: translate(-50%,-50%);
}
.drawer__plus::before { width: 9px; height: 1.5px; }
.drawer__plus::after  { width: 1.5px; height: 9px; transition: opacity var(--t-fast) var(--e-out); }
.drawer__sec.is-open .drawer__plus { background: var(--emerald); border-color: var(--emerald); }
.drawer__sec.is-open .drawer__plus::before { background: #fff; }
.drawer__sec.is-open .drawer__plus::after { opacity: 0; }

.drawer__panel { display: none; padding-bottom: 1rem; }
.drawer__sec.is-open .drawer__panel { display: block; }
.drawer__panel a {
  display: flex; align-items: center; min-height: 48px;
  font-size: .98rem; color: var(--ink-3);
  border-bottom: 1px solid var(--line-soft);
}
.drawer__panel a:last-child { border-bottom: 0; }
.drawer__panel a[aria-current] { color: var(--emerald-700); font-weight: 600; }
.drawer__all { color: var(--emerald-700) !important; font-weight: 600; }

.drawer__flagship {
  display: block; margin: .6rem 0 .3rem; padding: .85rem 1rem;
  border-radius: var(--r); background: var(--emerald-tint);
  border: 1px solid rgba(8,127,91,.22);
}
.drawer__flagship b { display: block; font-size: .96rem; font-weight: 700; color: var(--ink); }
.drawer__flagship span { display: block; font-size: .83rem; color: var(--ink-3); margin-top: .2rem; }

.drawer__meta { margin-top: 1.6rem; display: grid; gap: .3rem; }
.drawer__meta a { font-size: .88rem; color: var(--muted); min-height: 44px; display: flex; align-items: center; }

/* ── 6. SECONDARY PRODUCT NAV ───────────────────────────────────────────── */
.subnav {
  position: sticky; top: 64px; z-index: 60;
  background: rgba(246,247,244,.94);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.subnav__inner { display: flex; align-items: center; gap: 1.4rem; }
.subnav__name { font-weight: 700; font-size: .95rem; color: var(--ink); letter-spacing: -.02em; flex: none; }
.subnav__links { display: flex; gap: .2rem; overflow-x: auto; scrollbar-width: none; flex: 1; }
.subnav__links::-webkit-scrollbar { display: none; }
.subnav__links a {
  display: inline-flex; align-items: center; min-height: 52px; padding: 0 .85rem;
  font-size: .9rem; font-weight: 500; color: var(--muted);
  border-bottom: 2px solid transparent; white-space: nowrap;
  transition: color var(--t-fast) var(--e-out), border-color var(--t-fast) var(--e-out);
}
.subnav__links a:hover { color: var(--ink); }
.subnav__links a[aria-current] { color: var(--ink); border-bottom-color: var(--emerald); }
.subnav .btn { flex: none; }
@media (max-width: 760px) { .subnav__name, .subnav .btn { display: none; } }

/* ── 7. FOOTER ──────────────────────────────────────────────────────────── */
.ftr { background: var(--ground); color: rgba(255,255,255,.66); padding-block: clamp(44px, 4.4vw, 68px) 22px; }
.ftr__top { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: clamp(26px, 3vw, 56px); }
@media (max-width: 960px) { .ftr__top { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .ftr__top { grid-template-columns: 1fr; } }
@media (max-width: 1140px) { .ftr__top { grid-template-columns: 1fr 1fr 1fr; } }
@media (max-width: 720px)  { .ftr__top { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px)  { .ftr__top { grid-template-columns: 1fr; } }

.ftr h5, .ftr .ftr__k {
  font-family: var(--font-mono); font-size: .64rem; font-weight: 500;
  letter-spacing: .15em; text-transform: uppercase;
  color: rgba(255,255,255,.58); margin-bottom: 1rem;
}
.ftr__col a {
  display: flex; align-items: center; min-height: 34px;
  font-size: .885rem; color: rgba(255,255,255,.64);
  transition: color var(--t-fast) var(--e-out);
}
.ftr__col a:hover { color: var(--emerald-300); }

.ftr__brand img { height: 30px; width: auto; }
.ftr__brand p { font-size: .94rem; line-height: 1.6; margin-top: .9rem; max-width: 34ch; color: rgba(255,255,255,.62); }
.ftr__reach { display: grid; gap: .3rem; margin-top: 1.1rem; }
.ftr__reach a { font-size: .92rem; color: rgba(255,255,255,.82); display: inline-flex; align-items: center; min-height: 26px; width: fit-content; }
.ftr__reach a:hover { color: var(--emerald-300); }
.ftr__reach span { font-size: .83rem; line-height: 1.55; color: rgba(255,255,255,.58); max-width: 34ch; margin-top: .25rem; }
.ftr__all { margin-top: .45rem; color: var(--emerald-300) !important; font-weight: 600; }
.ftr__by { font-size: .79rem; line-height: 1.6; color: rgba(255,255,255,.58); max-width: 74ch; }
.ftr__by a { color: rgba(255,255,255,.66); border-bottom: 1px solid rgba(255,255,255,.2); }
.ftr__by a:hover { color: var(--emerald-300); border-bottom-color: var(--emerald-300); }
.ftr__rule { height: 2px; width: 34px; background: var(--gold); margin: 1.1rem 0 0; opacity: .95; }

.ftr__social { display: flex; gap: .5rem; margin-top: 1.1rem; }
.ftr__social a {
  width: 38px; height: 38px; border-radius: var(--r-xs);
  border: 1px solid rgba(255,255,255,.14);
  display: grid; place-items: center; color: rgba(255,255,255,.66);
  transition: all var(--t-fast) var(--e-out);
}
.ftr__social a:hover { color: #fff; border-color: rgba(255,255,255,.58); background: rgba(255,255,255,.06); }
.ftr__social svg { width: 16px; height: 16px; }

.ftr__contact {
  margin-top: clamp(34px, 3.6vw, 52px); padding-top: 28px;
  border-top: 1px solid rgba(255,255,255,.1);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 44px);
}
@media (max-width: 760px) { .ftr__contact { grid-template-columns: 1fr; } }
.ftr__contact p { font-size: .87rem; line-height: 1.6; color: rgba(255,255,255,.6); max-width: 32ch; }
.ftr__contact a { font-size: .9rem; }

.ftr__bot {
  margin-top: clamp(30px, 3vw, 44px); padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex; flex-wrap: wrap; gap: .8rem 1.8rem;
  align-items: center; justify-content: space-between;
  font-size: .79rem; color: rgba(255,255,255,.58);
}
.ftr__legal { display: flex; flex-wrap: wrap; gap: 1.3rem; }
.ftr__legal a { font-size: .79rem; color: rgba(255,255,255,.58); }
.ftr__legal a:hover { color: var(--emerald-300); }

/* ── 8. SCROLL LOCK ─────────────────────────────────────────────────────── */
body.is-locked { overflow: hidden; }

/* Products menu: the flagship column sits on the page ground, not a panel */
.mega__feature--plain { background: transparent; padding: 0; }
.mega__feature--plain::before { display: none; }
.ftr__contact a { display: block; min-height: 32px; line-height: 32px; }
