@font-face {
  font-family: "Header Wornella";
  src: url("assets/Wornella-Medium.otf");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Header Parceh";
  src: url("assets/home-nov19/Parceh.otf");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Header Montreal";
  src: url("assets/NeueMontreal-Medium.otf");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Header Montreal";
  src: url("assets/NeueMontreal-Bold.otf");
  font-weight: 700;
  font-display: swap;
}
.portfolio-header {
  position: relative;
  z-index: 4;
  width: 100%;
  height: clamp(96px, 8.6928vw, 146px);
  background: #fff;
  color: #000;
  box-sizing: border-box;
}
.portfolio-header .portfolio-signature,
.portfolio-header .portfolio-year {
  position: absolute;
  top: clamp(16px, 1.5686vw, 28px);
  color: #000;
  font: 400 clamp(16px, 1.323vw, 23px)/normal "Header Parceh", Georgia, serif;   /* the homepage name's display serif */
  text-decoration: none;
}
.portfolio-header .portfolio-signature { left: 1.5686vw; }
.portfolio-header .portfolio-year { right: 4.5374vw; }
.portfolio-header nav {
  position: absolute;
  inset: clamp(26px, 2.5163vw, 44px) auto auto 39.6732%;
  display: flex;
  align-items: center;
  gap: clamp(10px, .794vw, 15px);
  margin: 0;
  transform: none;
  white-space: nowrap;
  font: 500 clamp(13px, 1.058vw, 18px)/normal "Header Montreal", Arial, sans-serif;
  letter-spacing: .02em;
}
.portfolio-header nav a {
  color: #4a4a4a;
  font: inherit;
  letter-spacing: inherit;
  text-decoration: none;
}
.portfolio-header nav a[aria-current="page"] {
  color: #000;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.portfolio-header a:focus-visible { outline: 1px solid #161616; outline-offset: 4px; }
@media (min-width: 681px) {
  body[data-project-header] > :is(.case-container, #fold-page, #case-page, #ultra-page) {
    margin-top: -6.86vw;
  }
}
@media (max-height: 620px) and (min-width: 681px) {
  .portfolio-header { height: 82px; }
}
@media (max-width: 680px) {
  .portfolio-header { height: 116px; }
  .portfolio-header .portfolio-signature,
  .portfolio-header .portfolio-year { top: 23px; font-size: 16px; }
  .portfolio-header .portfolio-signature { left: 20px; }
  .portfolio-header .portfolio-year { right: 20px; }
  .portfolio-header nav { inset: auto 0 20px; justify-content: center; gap: 18px; font-size: 14px; }
}

/* Reserve each label's bold width so the current-page style cannot shift the menu. */
.portfolio-header nav a { display: grid; }
.portfolio-header nav a::after {
  content: attr(data-nav-label);
  height: 0;
  visibility: hidden;
  overflow: hidden;
  font-weight: 700;
}

/* Site navigation: the same stacked, right-aligned menu as the homepage. */
@font-face {
  font-family: "Nav Montreal";
  src: url("assets/NeueMontreal-Regular.otf");
  font-weight: 400;
  font-display: swap;
}
.portfolio-header { height: auto; min-height: clamp(96px, 8.6928vw, 146px); }
.portfolio-header nav.site-nav {
  position: relative;
  inset: auto;
  z-index: 3;
  width: max-content;
  margin: 0 3% 0 auto;
  padding: 2.38vw 0 1.6vw;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .65vw;
  white-space: nowrap;
  font: 400 clamp(14px, 1.071vw, 24px)/1.4 "Nav Montreal", "Neue Montreal", Arial, sans-serif;
  letter-spacing: .0214vw;
}
.portfolio-header nav.site-nav a {
  --bink: #4a4a4a;
  position: relative;
  isolation: isolate;
  display: inline-block;
  color: var(--bink);
  font: inherit;
  font-weight: 400;
  text-decoration: none;
  white-space: nowrap;
}
.portfolio-header nav.site-nav a::after { content: none; }
.portfolio-header nav.site-nav a::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: var(--bink);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .4s cubic-bezier(.22, 1, .36, 1), opacity .4s ease;
  pointer-events: none;
}
.portfolio-header nav.site-nav a:is(:hover, :focus-visible)::before { transform: scaleX(1); }
.portfolio-header nav.site-nav a:focus-visible { outline: 2px solid var(--bink); outline-offset: 5px; }
@media (prefers-reduced-motion: reduce) {
  .portfolio-header nav.site-nav a::before { transition-duration: .01ms; }
}
/* Black pages: same menu, in white. */
body:is(.case-dark, .doormat-dark, .kitchen-dark) .portfolio-header { background: transparent; color: #fff; }
body:is(.case-dark, .doormat-dark, .kitchen-dark) .portfolio-header .portfolio-signature { color: #fff; }
body:is(.case-dark, .doormat-dark, .kitchen-dark) .portfolio-header nav.site-nav a { --bink: #fff; }
body:is(.case-dark, .doormat-dark, .kitchen-dark) .portfolio-header a:focus-visible { outline-color: #fff; }
@media (max-width: 680px) {
  .portfolio-header { min-height: 0; }
  .portfolio-header nav.site-nav { inset: auto; margin: 0 20px 0 auto; padding: 22px 0 20px; gap: 6px; font-size: 14px; justify-content: flex-start; }
}

/* Case-study menu that reappears, pinned top-right, whenever you scroll up (nav-reveal.js, on the
   pages that load it) — the same floating state as the homepage menu. */
.portfolio-header nav.site-nav.is-floating {
  position: fixed;
  top: 2.38vw;
  right: 3%;
  z-index: 60;
  margin: 0;
  padding: .7em .9em;
  border-radius: 10px;
  background: #ffffffe6;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transform: translateY(calc(-100% - 2.38vw - 8px));
  transition: transform .35s cubic-bezier(.3, 0, .2, 1);
}
.portfolio-header nav.site-nav.is-floating.is-shown { transform: none; }
body:is(.case-dark, .doormat-dark, .kitchen-dark) .portfolio-header nav.site-nav.is-floating { background: #000000cc; }   /* dark pages: dark panel, white menu */
@media (prefers-reduced-motion: reduce) { .portfolio-header nav.site-nav.is-floating { transition: none; } }

/* Case studies: the header floats over the top of the page (no white band), so the lead image can
   sit just under the name; case-top.js sets how far the page is pulled up. */
@media (min-width: 681px) {
  body[data-project-header] > .portfolio-header { position: absolute; inset: 0 0 auto; background: transparent; }
}

/* Case-study menu in one horizontal line at the top right, level with the name on the left
   (desktop; phones keep their own layout). The floating scroll-up panel is a single row too. */
@media (min-width: 681px) {
  .portfolio-header nav.site-nav {
    flex-direction: row;
    align-items: baseline;
    gap: clamp(18px, 1.9vw, 34px);
    padding: clamp(27px, 2.5vw, 45px) 0 0;
  }
  .portfolio-header nav.site-nav.is-floating { padding: .55em 1em; }
}

/* Desktop: the name sits on the same middle line as the menu. Both get the same line-height, and
   the name's box is placed so its centre lands on the centre of the menu's line (menu top padding
   + half its line, minus half the name's line). --sig-nudge is a small optical correction for
   Parceh, whose letters sit a touch higher in their box than Neue Montreal's. */
@media (min-width: 681px) {
  .portfolio-header {
    --nav-pad: clamp(27px, 2.5vw, 45px);
    --nav-size: clamp(14px, 1.071vw, 24px);
    --sig-size: clamp(16px, 1.323vw, 23px);
    --sig-nudge: 0px;
  }
  .portfolio-header .portfolio-signature {
    top: calc(var(--nav-pad) + var(--nav-size) * .7 - var(--sig-size) * .7 + var(--sig-nudge));
    font-size: var(--sig-size);
    line-height: 1.4;
  }
}
