/**
 * Site Nav (prototype on the landing page, candidate to replace the Design System Site Header).
 * Top of the page: Home, Work, Notes, About with keyboard-shortcut badges, Contact on the right.
 * The bar stays open while scrolling (glass background, hairline once scrolled). Only on narrow screens the links fold into a "Menu" button top left; Contact stays top right.
 * State lives in data-state="open | folded" (assets/site-nav.js); .is-open = dropdown shown.
 */
:root {
  --nav-h: 64px;
  --nav-pad: var(--home-gutter, var(--space-24, 24px));
  --nav-ease: cubic-bezier(.22, 1, .36, 1);
  --nav-glass: rgb(245 244 241 / .72);
  --nav-blur: blur(28px) saturate(1.4);
}
.site-nav ~ main { padding-top: var(--nav-h); }   /* the nav is fixed, so the page starts below it */

.site-nav { position: fixed; inset: 0 0 auto 0; z-index: 20; pointer-events: none; }
/* background under the bar: paper glass, hairline appears once the page has scrolled */
.site-nav::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: var(--nav-h); pointer-events: none;
  background: var(--nav-glass); -webkit-backdrop-filter: var(--nav-blur); backdrop-filter: var(--nav-blur);
  border-bottom: 1px solid transparent; transition: border-color .3s;
}
.site-nav.is-scrolled::before { border-bottom-color: rgb(28 25 23 / .12); }
.site-nav__bar { display: flex; align-items: center; justify-content: space-between; height: var(--nav-h); padding-inline: var(--nav-pad); position: relative; }
.site-nav a, .site-nav button { pointer-events: auto; font: inherit; color: var(--color-fg-default); text-decoration: none; }

.site-nav kbd {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border: 1.5px solid currentColor; border-radius: 5px;
  font-family: var(--font-family-sans); font-size: var(--font-size-100); font-weight: var(--font-weight-medium); line-height: 1; text-transform: uppercase;
}
@media (pointer: coarse), (max-width: 767px) { .site-nav kbd { display: none; } }

/* links */
.site-nav__list { display: flex; align-items: center; gap: var(--space-32); list-style: none; margin: 0; padding: 0; }
.site-nav__list a { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: var(--font-size-400); font-weight: var(--font-weight-medium); transition: opacity .2s; }
.site-nav__list a:hover { opacity: .6; }
.site-nav__list a[aria-current="true"] > span { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1.5px; }
.site-nav__status { display: none; }

/* pills: Menu and Contact */
.site-nav__menu, .site-nav__contact {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 16px 0 10px;
  border: 1.5px solid var(--color-fg-default); border-radius: 999px; background: var(--nav-glass); -webkit-backdrop-filter: var(--nav-blur); backdrop-filter: var(--nav-blur);
  font-weight: var(--font-weight-medium); cursor: pointer; transition: background-color .2s, color .2s;
}
.site-nav__menu { display: none; padding-left: 12px; }
@media (hover: hover) { .site-nav .site-nav__menu:hover, .site-nav .site-nav__contact:hover { background: var(--color-fg-default); color: var(--home-paper, #F5F4F1); } }   /* touch: no sticky hover after a tap */
.site-nav .site-nav__contact[aria-expanded="true"] { background: var(--color-fg-default); color: var(--home-paper, #F5F4F1); }
@media (max-width: 767px) { .site-nav__contact { padding-inline: 16px; } }

/* folded: narrow screens only. Menu opens a full-screen glass layer (after the reference): the page blurs away,
   the links come in one after the other, large and centred, with their shortcut badges. The bar (Menu, Contact) stays on top. */
.site-nav[data-state="folded"] .site-nav__menu { display: inline-flex; position: relative; z-index: 2; }
.site-nav[data-state="folded"] .site-nav__right { position: relative; z-index: 2; }
.site-nav[data-state="folded"] .site-nav__list {
  position: fixed; inset: 0; z-index: 1; display: grid; place-content: center; justify-items: start; gap: 28px;   /* one column, centred, links aligned left like the reference */
  padding: calc(var(--nav-h) + 24px) var(--nav-pad) 40px;
  background: rgb(245 244 241 / .55); -webkit-backdrop-filter: blur(24px) saturate(1.4); backdrop-filter: blur(24px) saturate(1.4);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .4s var(--nav-ease), visibility 0s .4s;
}
.site-nav[data-state="folded"].is-open .site-nav__list { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .4s var(--nav-ease), visibility 0s; }
.site-nav[data-state="folded"] .site-nav__list > li { opacity: 0; transform: translateY(14px); filter: blur(6px); transition: opacity .3s ease, transform .3s ease, filter .3s ease; }
.site-nav[data-state="folded"].is-open .site-nav__list > li {
  opacity: 1; transform: none; filter: none;
  transition: opacity .55s var(--nav-ease), transform .55s var(--nav-ease), filter .55s var(--nav-ease); transition-delay: calc(.12s + var(--i, 0) * .07s);
}
.site-nav[data-state="folded"] .site-nav__list a { gap: 16px; min-height: 52px; padding: 0 8px; border-radius: 12px; font-size: 28px; }
.site-nav[data-state="folded"] .site-nav__list a:hover { opacity: .6; }
.site-nav[data-state="folded"] .site-nav__list kbd { display: inline-grid; width: 30px; height: 30px; border-radius: 7px; font-size: var(--font-size-300); }
.site-nav[data-state="folded"] .site-nav__status { display: block; margin-top: 16px; color: var(--color-fg-muted); font-size: var(--font-size-300); }

/* the Menu icon: hamburger in a small box (like the kbd badges) that spins once on open and back on close, like the reference */
.site-nav__menu .burger { display: inline-grid; place-items: center; width: 22px; height: 22px; border: 1.5px solid currentColor; border-radius: 5px; }
.site-nav__menu .burger svg { display: block; transition: transform .7s cubic-bezier(.34, 1.25, .5, 1); }
.site-nav.is-open .site-nav__menu .burger svg { transform: rotate(360deg); }
html.nav-menu-open { overflow: hidden; }

@media (max-width: 767px) { :root { --nav-h: 60px; } }
@media (prefers-reduced-motion: reduce) { .site-nav__list, .site-nav__list > li, .site-nav__menu .burger svg { transition: none !important; } }

/* Contact menu: link-outs instead of scrolling to the footer */
.contact-pop {
  position: absolute; right: var(--nav-pad); top: calc(var(--nav-h) - 6px); width: min(380px, calc(100vw - 2 * var(--nav-pad)));
  padding: 8px; background: var(--color-bg-default, #fff); border: 1px solid var(--color-border-default, #d9d8d4); border-radius: 20px; box-shadow: var(--home-shadow-lift, 0 2px 4px rgba(43,43,47,.06), 0 24px 48px -16px rgba(43,43,47,.22));
  pointer-events: auto; opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .42s var(--nav-ease), transform .42s var(--nav-ease), visibility 0s .42s;
}
.contact-pop.is-open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.contact-pop__head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 12px; color: var(--color-fg-muted); font-size: var(--font-size-200); }
.site-nav .contact-pop__close { display: grid; place-items: center; width: 44px; height: 44px; border: 0; background: none; border-radius: 12px; color: var(--color-fg-muted); cursor: pointer; }
.site-nav .contact-pop__close:hover { background: rgb(28 25 23 / .06); color: var(--color-fg-default); }
.site-nav .contact-pop__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 64px; padding: 10px 12px; border: 0; border-radius: 12px; background: none; text-align: left; cursor: pointer; }
.site-nav .contact-pop__row:hover { background: rgb(28 25 23 / .06); }
.contact-pop__text { display: grid; gap: 2px; min-width: 0; }
.contact-pop__label { font-size: var(--font-size-200); line-height: var(--font-line-height-200); color: var(--color-fg-muted); }
.contact-pop__value { font-size: var(--font-size-400); line-height: var(--font-line-height-400); font-weight: var(--font-weight-medium); overflow-wrap: anywhere; }
.contact-pop__icon { flex: none; display: grid; place-items: center; color: var(--color-fg-default); }
.contact-pop .i-done { display: none; }
.contact-pop__row.is-copied .i-copy { display: none; }
.contact-pop__row.is-copied .i-done { display: block; }
@media (prefers-reduced-motion: reduce) { .contact-pop { transition: none; } }

/* "Open to work": plain text with a dot, left of Contact (no tag). Narrow screens show it in the dropdown instead. */
.site-nav__right { display: flex; align-items: center; gap: var(--space-24); }
.site-nav__open { display: inline-flex; align-items: center; gap: 8px; font-size: var(--font-size-300); line-height: var(--font-line-height-300); color: var(--color-fg-muted); white-space: nowrap; pointer-events: auto; }
.site-nav__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-feedback-success-accent, #22a35a); }
@media (max-width: 899px) { .site-nav__open { display: none; } }

/* reading progress on case pages: a thin rust line under the bar */
.site-nav__progress { position: absolute; left: 0; right: 0; top: calc(var(--nav-h) - 2px); height: 2px; pointer-events: none; }
.site-nav__progress span { display: block; height: 100%; background: var(--color-purple-600); transform: scaleX(var(--progress, 0)); transform-origin: left center; }
