/* ============================================================
   Rankd site chrome: header, product header, phone drawer, footer.
   Loaded on EVERY marketing page: the agency pages (with site.css)
   and the product, blog and trainer pages (with brand.css,
   landing.css and blog.css). Everything here is namespaced .rk-*
   and carries its own tokens, so it never depends on site.css and
   never picks up the product pages' .site-header, .brand, .btn,
   .navdrop or element-level rules.
   Markup lives in partials/*.html. Behaviour lives in site.js.
   ============================================================ */

.rk-header, .rk-drawer, .rk-footer, .rk-skip {
  --rk-ink: #1d1830;
  --rk-ink-2: #474157;
  --rk-ink-3: #6b6579;
  --rk-paper: #fbf8f3;
  --rk-paper-2: #f4efe6;
  --rk-card: #fffdf9;
  --rk-line: #e6dfd3;
  --rk-line-2: #d6ccbc;
  --rk-violet: #7c3aed;
  --rk-violet-deep: #5b21b6;
  --rk-violet-soft: #efe8fd;
  --rk-green: #1f9d57;
  --rk-amber: #e3a008;
  --rk-coral: #e4572e;
  --rk-night: #1d1830;
  --rk-night-2: #282142;
  --rk-night-line: rgba(255, 255, 255, .12);
  --rk-night-text: #f3effa;
  --rk-night-muted: #b8b0cc;
  --rk-display: "Bricolage Grotesque", "Hanken Grotesk", system-ui, sans-serif;
  --rk-sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --rk-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --rk-maxw: 1240px;
  --rk-pad: clamp(16px, 3.2vw, 32px);
  --rk-bar: 68px;
  --rk-ease: cubic-bezier(.2, .7, .2, 1);
}

/* Scoped reset. Beats element rules like brand.css `a {}` and `h1..h4 {}`,
   and loses to every .rk-* rule below because it comes first. */
.rk-header *, .rk-drawer *, .rk-footer * {
  box-sizing: border-box; margin: 0; padding: 0;
  font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit;
}
.rk-header ul, .rk-drawer ul, .rk-footer ul { list-style: none; }
.rk-header a, .rk-drawer a, .rk-footer a { text-decoration: none; }
.rk-header img, .rk-drawer img, .rk-footer img { display: block; max-width: none; border: 0; }
.rk-header svg, .rk-drawer svg, .rk-footer svg { display: block; flex: none; }
.rk-header button, .rk-drawer button {
  background: none; border: 0; cursor: pointer; text-align: left; -webkit-appearance: none; appearance: none;
}
.rk-header :focus-visible, .rk-drawer :focus-visible {
  outline: 2px solid var(--rk-violet); outline-offset: 2px; border-radius: 6px;
}
.rk-footer :focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 4px; }

/* ---------- skip link ---------- */
.rk-skip {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--rk-ink); color: #fff; font: 700 14px/1 var(--rk-sans);
  padding: 12px 16px; border-radius: 8px; text-decoration: none; transition: top .15s;
}
.rk-skip:focus { top: 12px; outline: 2px solid var(--rk-violet); outline-offset: 2px; }

/* ============================================================
   HEADER
   ============================================================ */
.rk-header {
  position: sticky; top: 0; z-index: 80;
  font-family: var(--rk-sans); font-size: 15px; line-height: 1.3; color: var(--rk-ink);
  background: rgba(251, 248, 243, .92);
  -webkit-backdrop-filter: saturate(150%) blur(12px); backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--rk-line);
}
.rk-bar {
  display: flex; align-items: stretch; gap: 8px;
  height: var(--rk-bar); max-width: var(--rk-maxw); margin: 0 auto; padding: 0 var(--rk-pad);
}

/* logo lockup */
.rk-logo { display: flex; align-items: center; gap: 12px; flex: none; color: var(--rk-ink); }
.rk-logo img { height: 24px; width: 96px; }
.rk-logo-tag {
  font-family: var(--rk-mono); font-size: 10px; font-weight: 700; line-height: 1.25;
  letter-spacing: .12em; text-transform: uppercase; color: var(--rk-ink-2);
  padding-left: 12px; border-left: 1.5px solid var(--rk-line-2);
}
.rk-logo-tag b { display: block; font-weight: 700; color: var(--rk-violet); }

/* main nav */
.rk-nav { display: flex; align-items: stretch; margin-left: clamp(16px, 2.6vw, 40px); }
.rk-item {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  height: 100%; padding: 0 12px; white-space: nowrap;
  font-family: var(--rk-sans); font-size: 15px; font-weight: 600; color: var(--rk-ink-2);
  transition: color .15s ease;
}
.rk-item::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px;
  background: var(--rk-violet); border-radius: 2px;
  transform: scaleX(0); transform-origin: left; transition: transform .22s var(--rk-ease);
}
.rk-item:hover, .rk-item[aria-expanded="true"] { color: var(--rk-ink); }
.rk-item:hover::after, .rk-item[aria-expanded="true"]::after { transform: scaleX(1); }
.rk-item[aria-current="page"], .rk-item[data-current="section"],
.rk-dd:has(.rk-menu [aria-current="page"], .rk-menu [data-current="section"]) > .rk-item { color: var(--rk-ink); }
.rk-item[aria-current="page"]::after, .rk-item[data-current="section"]::after,
.rk-dd:has(.rk-menu [aria-current="page"], .rk-menu [data-current="section"]) > .rk-item::after { transform: scaleX(1); }
.rk-item .rk-chev { width: 11px; height: 11px; opacity: .7; transition: transform .2s var(--rk-ease); }
.rk-item[aria-expanded="true"] .rk-chev { transform: rotate(180deg); }

/* the quieter Products and Log in triggers */
.rk-sep { align-self: center; width: 1px; height: 22px; background: var(--rk-line-2); margin: 0 8px; }
.rk-item--quiet {
  font-family: var(--rk-mono); font-size: 11.5px; font-weight: 500; letter-spacing: .08em;
  text-transform: uppercase; color: var(--rk-ink-3);
}
.rk-item--quiet::after { background: var(--rk-ink-3); }

/* right side */
.rk-actions { display: flex; align-items: stretch; gap: 4px; margin-left: auto; }
.rk-btn {
  align-self: center; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 10px; white-space: nowrap;
  background: var(--rk-violet); color: #fff;
  font-family: var(--rk-sans); font-size: 14.5px; font-weight: 700; line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 8px 18px -10px rgba(124, 58, 237, .9);
  transition: background .15s ease, transform .15s ease;
}
.rk-btn:hover { background: var(--rk-violet-deep); color: #fff; }
.rk-btn:active { transform: translateY(1px); }
.rk-btn svg { width: 15px; height: 15px; }
.rk-btn--ghost {
  background: transparent; color: var(--rk-ink); box-shadow: inset 0 0 0 1.5px var(--rk-line-2);
}
.rk-btn--ghost:hover { background: var(--rk-card); color: var(--rk-violet-deep); box-shadow: inset 0 0 0 1.5px var(--rk-violet); }
.rk-btn--block { display: flex; width: 100%; height: 50px; font-size: 16px; }

/* ---------- dropdowns (flush under the trigger) ---------- */
.rk-dd { position: relative; display: flex; }
.rk-menu {
  position: absolute; top: 100%; left: 0; z-index: 90;
  min-width: 290px; padding: 10px;
  background: var(--rk-card); color: var(--rk-ink);
  border: 1px solid var(--rk-line); border-top-color: transparent; border-radius: 0 0 16px 16px;
  box-shadow: 0 28px 56px -24px rgba(29, 24, 48, .38), 0 10px 20px -14px rgba(29, 24, 48, .18);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .16s ease, transform .2s var(--rk-ease), visibility 0s linear .2s;
}
.rk-menu--end { left: auto; right: 0; }
.rk-dd.is-open > .rk-menu {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity .16s ease, transform .2s var(--rk-ease), visibility 0s;
}
/* no JavaScript: plain hover and focus still work */
html:not(.rk-js) .rk-dd:hover > .rk-menu,
html:not(.rk-js) .rk-dd:focus-within > .rk-menu { opacity: 1; visibility: visible; transform: none; transition: none; }

.rk-mlabel {
  display: block; padding: 8px 12px 6px;
  font-family: var(--rk-mono); font-size: 10.5px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--rk-ink-3);
}
.rk-mlink {
  display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: var(--rk-ink); transition: background .12s ease;
}
.rk-mlink:hover { background: var(--rk-paper-2); }
.rk-mlink[aria-current="page"] { background: var(--rk-violet-soft); }
.rk-mtext { display: block; min-width: 0; }
.rk-mtitle { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 700; color: var(--rk-ink); }
.rk-mdesc { display: block; margin-top: 2px; font-size: 13px; font-weight: 500; color: var(--rk-ink-3); line-height: 1.35; }
.rk-mico {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  display: grid; place-items: center; background: var(--rk-paper-2); color: var(--rk-ink-2);
}
.rk-mico svg { width: 18px; height: 18px; }
.rk-tag {
  display: inline-flex; align-items: center; height: 19px; padding: 0 7px; border-radius: 5px;
  font-family: var(--rk-mono); font-size: 9.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; background: var(--rk-violet); color: #fff;
}
.rk-tag--soft { background: var(--rk-violet-soft); color: var(--rk-violet-deep); }
.rk-price {
  margin-left: auto; align-self: center; white-space: nowrap;
  font-family: var(--rk-mono); font-size: 12px; font-weight: 700; color: var(--rk-ink-2);
}
.rk-mlink [data-here] { display: none; }
.rk-mlink[aria-current="page"] [data-here] { display: inline-flex; }

/* Services mega panel */
.rk-menu--mega { width: 660px; padding: 12px; display: grid; grid-template-columns: 250px 1fr; gap: 10px; }
.rk-feature {
  position: relative; display: flex; flex-direction: column; gap: 8px; overflow: hidden;
  padding: 18px 18px 16px; border-radius: 12px; background: var(--rk-night); color: var(--rk-night-text);
  transition: background .15s ease;
}
.rk-feature:hover { background: #251e3c; }
.rk-feature .rk-mtitle { color: #fff; font-family: var(--rk-display); font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.rk-feature .rk-mdesc { color: var(--rk-night-muted); font-size: 13.5px; }
.rk-feature .rk-tag { align-self: flex-start; background: var(--rk-green); }
.rk-feature-grid {
  display: grid; grid-template-columns: repeat(6, 9px); gap: 7px; margin-top: auto; padding-top: 14px;
}
.rk-feature-grid i { width: 9px; height: 9px; border-radius: 50%; background: var(--rk-green); opacity: .95; }
.rk-feature-grid i.m { background: var(--rk-amber); }
.rk-feature-grid i.l { background: var(--rk-coral); }
.rk-feature[aria-current="page"] { outline: 2px solid var(--rk-violet); outline-offset: -2px; }
.rk-mlist { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; align-content: start; }
.rk-mlist .rk-mlink { padding: 9px 10px; }
.rk-mfoot {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between;
  margin-top: 2px; padding: 10px 12px 4px; border-top: 1px solid var(--rk-line);
  font-size: 13px; color: var(--rk-ink-3);
}
.rk-mfoot a { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--rk-violet-deep); }
.rk-mfoot a:hover { color: var(--rk-violet); }
.rk-mfoot svg { width: 14px; height: 14px; }

/* Industries panel */
.rk-menu--trades { width: 360px; }

/* Products and Log in panels */
.rk-menu--products { width: 380px; }
.rk-menu--products .rk-mico { background: var(--rk-violet-soft); color: var(--rk-violet-deep); }
.rk-menu--products .rk-mlink + .rk-mlink .rk-mico { background: #e3f1f9; color: #0b6fa0; }
.rk-menu--login { width: 260px; }
.rk-mdesc.rk-mono { font-family: var(--rk-mono); font-size: 11px; letter-spacing: .02em; }

/* burger (phones and small tablets) */
.rk-burger {
  display: none; align-self: center; align-items: center; justify-content: center; gap: 8px;
  height: 44px; min-width: 44px; padding: 0 12px; border-radius: 10px;
  color: var(--rk-ink); box-shadow: inset 0 0 0 1.5px var(--rk-line-2);
  font-family: var(--rk-mono); font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.rk-burger:hover { box-shadow: inset 0 0 0 1.5px var(--rk-ink-3); }
.rk-burger svg { width: 18px; height: 18px; }

@media (max-width: 1279px) {
  .rk-logo-tag { display: none; }
  .rk-item { padding: 0 10px; }
  .rk-item::after { left: 10px; right: 10px; }
}
@media (max-width: 1119px) {
  .rk-nav, .rk-actions .rk-dd, .rk-actions .rk-login-link { display: none; }
  .rk-burger { display: inline-flex; }
  .rk-actions { gap: 8px; }
  .rk-btn { height: 44px; padding: 0 14px; font-size: 14px; }
}
@media (max-width: 479px) {
  .rk-bar { --rk-bar: 60px; gap: 6px; }
  .rk-logo img { height: 22px; width: 88px; }
  .rk-burger .rk-burger-txt { display: none; }
  .rk-btn { padding: 0 12px; font-size: 13.5px; }
  .rk-btn svg { display: none; }
}
@media (max-width: 350px) {
  .rk-actions > .rk-btn { display: none; }
}

/* ============================================================
   PHONE DRAWER
   ============================================================ */
.rk-drawer {
  position: fixed; inset: 0; z-index: 120; display: flex; justify-content: flex-end;
  font-family: var(--rk-sans); font-size: 16px; line-height: 1.35; color: var(--rk-ink);
}
.rk-drawer[hidden] { display: none; }
.rk-scrim { position: absolute; inset: 0; background: rgba(29, 24, 48, .5); opacity: 0; transition: opacity .25s ease; }
.rk-panel {
  position: relative; display: flex; flex-direction: column;
  width: min(100%, 440px); height: 100%; overflow-y: auto; overscroll-behavior: contain;
  background: var(--rk-paper); box-shadow: -30px 0 60px -30px rgba(29, 24, 48, .5);
  transform: translateX(100%); transition: transform .32s var(--rk-ease);
}
.rk-drawer.is-open .rk-scrim { opacity: 1; }
.rk-drawer.is-open .rk-panel { transform: none; }
.rk-panel-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  height: 64px; padding: 0 16px 0 20px; background: var(--rk-paper); border-bottom: 1px solid var(--rk-line);
}
.rk-panel-head .rk-logo img { height: 22px; width: 88px; }
.rk-close {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px;
  color: var(--rk-ink); box-shadow: inset 0 0 0 1.5px var(--rk-line-2);
}
.rk-close svg { width: 18px; height: 18px; }
.rk-dnav { padding: 8px 20px 0; }
.rk-dlink, .rk-acc {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-height: 56px; padding: 8px 0; border-bottom: 1px solid var(--rk-line);
  font-family: var(--rk-display); font-size: 21px; font-weight: 700; letter-spacing: -.015em; color: var(--rk-ink);
}
.rk-dlink[aria-current="page"] { color: var(--rk-violet-deep); }
.rk-acc svg { width: 18px; height: 18px; color: var(--rk-ink-3); transition: transform .2s var(--rk-ease); }
.rk-acc[aria-expanded="true"] svg { transform: rotate(45deg); color: var(--rk-violet); }
.rk-sub { padding: 6px 0 14px; border-bottom: 1px solid var(--rk-line); }
.rk-sub[hidden] { display: none; }
.rk-sub a {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 0 6px 2px;
  font-size: 16px; font-weight: 600; color: var(--rk-ink-2);
}
.rk-sub a:hover, .rk-sub a[aria-current="page"] { color: var(--rk-violet-deep); }
.rk-sub .rk-tag { margin-left: 2px; }
.rk-sub a.rk-sub-all { color: var(--rk-violet-deep); font-weight: 700; }
.rk-dsec { margin: 26px 20px 0; padding-top: 16px; border-top: 1.5px solid var(--rk-ink); }
.rk-dsec-label {
  display: block; margin-bottom: 6px;
  font-family: var(--rk-mono); font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--rk-ink-3);
}
.rk-dprod { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 0; border-bottom: 1px solid var(--rk-line); }
.rk-dprod .rk-mtitle { font-size: 16px; }
.rk-dprod .rk-mico { background: var(--rk-violet-soft); color: var(--rk-violet-deep); }
.rk-dprod + .rk-dprod .rk-mico { background: #e3f1f9; color: #0b6fa0; }
.rk-dprod .rk-mdesc { font-size: 13.5px; }
.rk-dprod[aria-current="page"] .rk-mtitle { color: var(--rk-violet-deep); }
.rk-dlogin { display: flex; align-items: center; justify-content: space-between; min-height: 48px; font-size: 15px; font-weight: 600; color: var(--rk-ink-2); border-bottom: 1px solid var(--rk-line); }
.rk-dlogin b { font-weight: 700; color: var(--rk-ink); }
.rk-dlogin svg { width: 15px; height: 15px; color: var(--rk-ink-3); }
.rk-dcta {
  position: sticky; bottom: 0; margin-top: auto; padding: 18px 20px calc(18px + env(safe-area-inset-bottom));
  background: linear-gradient(rgba(251, 248, 243, 0), var(--rk-paper) 28%);
}
.rk-dcta-note { margin-top: 10px; text-align: center; font-size: 13px; color: var(--rk-ink-3); }
.rk-dcta-note a { color: var(--rk-violet-deep); font-weight: 700; }
html.rk-locked, html.rk-locked body { overflow: hidden; }

/* ============================================================
   FOOTER
   ============================================================ */
.rk-footer {
  position: relative; overflow: hidden;
  background: var(--rk-night); color: var(--rk-night-muted);
  font-family: var(--rk-sans); font-size: 15px; line-height: 1.5;
}
.rk-footer::before { /* faint coordinate grid */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 88px 88px; background-position: -1px -1px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 85%); mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}
.rk-fwrap { position: relative; max-width: var(--rk-maxw); margin: 0 auto; padding: 0 var(--rk-pad); }
.rk-ftop {
  display: grid; grid-template-columns: minmax(250px, 1.35fr) repeat(4, minmax(0, 1fr)); gap: 40px 32px;
  padding: 72px 0 56px;
}
.rk-fbrand img { height: 26px; width: 104px; filter: brightness(0) invert(1); }
.rk-fline { margin-top: 18px; max-width: 290px; font-size: 15.5px; line-height: 1.55; color: var(--rk-night-text); }
.rk-fcontact { margin-top: 22px; display: grid; gap: 10px; }
.rk-fcontact a { display: inline-flex; align-items: center; gap: 10px; color: var(--rk-night-text); font-weight: 600; width: fit-content; }
.rk-fcontact a:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.rk-fcontact svg { width: 16px; height: 16px; color: #a78bfa; }
.rk-fh {
  margin-bottom: 14px;
  font-family: var(--rk-mono); font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: #a78bfa;
}
.rk-fcol a {
  display: block; padding: 5px 0; font-size: 14.5px; color: var(--rk-night-muted); transition: color .12s ease;
}
.rk-fcol a:hover, .rk-fcol a[aria-current="page"] { color: #fff; }
.rk-fcol .rk-fgap { margin-top: 12px; }
.rk-fcta { color: #fff !important; font-weight: 700; }
.rk-fbottom {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px;
  padding: 22px 0 28px; border-top: 1px solid var(--rk-night-line);
  font-size: 13.5px; color: var(--rk-night-muted);
}
.rk-flegal { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.rk-flegal a { color: var(--rk-night-muted); }
.rk-flegal a:hover { color: #fff; }
.rk-fcoord {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--rk-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--rk-night-muted);
}
.rk-scale { display: flex; align-items: flex-end; gap: 0; }
.rk-scale i { display: block; width: 22px; height: 5px; border: 1px solid var(--rk-night-muted); }
.rk-scale i:nth-child(odd) { background: var(--rk-night-muted); }

@media (max-width: 1023px) {
  .rk-ftop { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 56px 0 44px; }
  .rk-fbrand { grid-column: 1 / -1; }
}
@media (max-width: 479px) {
  .rk-ftop { gap: 34px 20px; }
  .rk-fbottom { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .rk-header *, .rk-drawer *, .rk-footer *, .rk-panel, .rk-scrim, .rk-menu { transition: none !important; animation: none !important; }
}
