/* Corners navigation: JB mark top-left; "Let's talk" and a menu button
   top-right that opens a full-screen overlay (js/nav.js). Fixed site-wide. */

.cn {
  /* lined up with the page content: 24px gutters (16px on phones); the
     wordmark has 4px of its own padding, so the bar starts 4px further out */
  --gut: 24px;
  position: fixed; z-index: 100; top: 14px; left: calc(var(--gut) - 4px); right: var(--gut);
  display: flex; justify-content: space-between; align-items: flex-start;
  pointer-events: none;
}
.cn > * { pointer-events: auto; }

/* the JB. wordmark: heavy, wide like the hero name, with an accent-coloured full stop */
.cn-home { display: flex; align-items: center; height: 48px; padding: 0 4px; border-radius: 6px; color: var(--ink); text-decoration: none; }
.cn-word { font: 900 34px/1 var(--font); font-variation-settings: "wdth" 112; letter-spacing: -.04em; }
.cn-word span { color: var(--accent); margin-left: .02em; display: inline-block; transition: transform .25s cubic-bezier(.2,.8,.2,1); }
.cn-home:hover .cn-word span { transform: translateX(4px); }

.cn-right { display: flex; gap: 8px; }
.cn-cta {
  display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 20px; border-radius: 6px;
  background: var(--accent); color: var(--deep); text-decoration: none;
  font: 800 12px/1 var(--font); font-variation-settings: "wdth" 110; letter-spacing: .12em; text-transform: uppercase;
  transition: transform .2s, box-shadow .2s;
}
.cn-cta:hover { transform: translateY(-1px); box-shadow: 0 8px 24px -8px color-mix(in srgb, var(--accent) 65%, transparent); }

/* dark translucent backing keeps it readable over light screenshots */
.cn-menu {
  width: 48px; height: 48px; padding: 0; border-radius: 6px; cursor: pointer;
  border: 1.5px solid color-mix(in srgb, var(--ink) 60%, transparent); background: color-mix(in srgb, var(--deep) 55%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  display: grid; place-content: center; gap: 6px; transition: border-color .2s;
}
.cn-menu span { display: block; width: 18px; height: 2px; background: var(--ink); transition: transform .3s, width .3s, margin .3s; }
.cn-menu span:last-child { width: 11px; margin-left: 7px; }
.cn-menu:hover { border-color: var(--accent); }
.cn-menu:hover span:last-child { width: 18px; margin-left: 0; }
.cn-menu:focus-visible, .cn-cta:focus-visible, .cn-home:focus-visible, .cn-overlay a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.cn-open .cn-menu span:first-child { transform: translateY(4px) rotate(45deg); }
.cn-open .cn-menu span:last-child { width: 18px; margin-left: 0; transform: translateY(-4px) rotate(-45deg); }

/* full-screen menu */
.cn-overlay {
  position: fixed; z-index: 99; inset: 0; display: flex; flex-direction: column; justify-content: center;
  padding: 0 clamp(20px, 8vw, 120px); color: var(--ink);
  background: color-mix(in srgb, var(--deep) 94%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; transition: opacity .35s;
}
.cn-overlay[hidden] { display: none; }
.cn-open .cn-overlay { opacity: 1; }
.cn-overlay nav { display: flex; flex-direction: column; }
.cn-overlay nav > a, .cn-group > a {
  display: flex; align-items: baseline; gap: 20px; width: max-content; color: inherit; text-decoration: none;
  font: 900 clamp(48px, 9vw, 140px)/1 var(--font); font-variation-settings: "wdth" 112; letter-spacing: -.03em; text-transform: uppercase;
  transition: color .35s ease, transform .5s cubic-bezier(.2,.8,.2,1), opacity .5s;   /* keeps the open fade-up too */
}
.cn-overlay nav > a:hover, .cn-group > a:hover { color: var(--accent); }
/* each item (and Contact's links) fades up in turn as the menu opens */
.cn-overlay nav > * { opacity: 0; transform: translateY(20px); transition: transform .5s cubic-bezier(.2,.8,.2,1), opacity .5s; }
.cn-open .cn-overlay nav > * { opacity: 1; transform: none; }
.cn-open .cn-overlay nav > :nth-child(2) { transition-delay: 0s, .06s, .06s; }   /* colour, transform, opacity: hover colour never waits */
.cn-open .cn-overlay nav > :nth-child(3) { transition-delay: .12s; }   /* the Contact group (its links have their own transition) */
/* Contact's children: the email address and LinkedIn, smaller, right under it */
.cn-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 32px; margin: 16px 0 0 4px;
  opacity: 0; transition: opacity .5s .3s; }
.cn-open .cn-sub { opacity: 1; }
.cn-sub a { display: inline-flex; align-items: center; gap: 10px; color: color-mix(in srgb, var(--ink) 70%, transparent); text-decoration: none;
  font: 600 clamp(17px, 1.6vw, 22px)/1.3 var(--font); transition: color .35s ease; }
.cn-sub a:hover { color: var(--accent); }
.cn-sub .ic { width: 22px; height: 22px; }

body.cn-open { overflow: hidden; }

@media (max-width: 760px) {
  .cn-cta { display: none; }
  .cn-word { font-size: 28px; }
  .cn-sub { flex-direction: column; align-items: flex-start; gap: 14px; }   /* LinkedIn under the email */
}
@media (prefers-reduced-motion: reduce) {
  .cn-overlay, .cn-overlay nav > *, .cn-sub { transition: none; }
}

@media (max-width: 860px) { .cn { --gut: 16px; } }
