/* Shared by the homepage and every journal article. */
:root {
  --m: clamp(20px, 2.78vw, 40px);
  --nav-h: 56px;
  --f-display: "Marcellus", "Newsreader", Georgia, serif;
  --f-serif: "Newsreader", Georgia, serif;
  --f-sans: "Switzer", "Helvetica Neue", Helvetica, sans-serif;
  --t-small: 14px;
  --r-pill: 999px;
  --r-panel: 20px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-roll: cubic-bezier(.22, 1, .36, 1);
}
.nav, .menu { font-family: var(--f-sans); font-size: 16px; line-height: 1.45; letter-spacing: -.01em; }
:where(.nav, .menu) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.menu__links { margin: 0; padding: 0; list-style: none; }
.nav .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
html.nav-menu-open { overflow: hidden; }
/* ----- rolling label (RollingText) ---------------------------------- */
.roll { position: relative; display: inline-flex; overflow: hidden; vertical-align: top; }
.roll__row { display: inline-flex; white-space: pre; }
.roll__row + .roll__row { position: absolute; inset: 0; transform: translateY(100%); }
.roll__row > span {
  display: inline-block;
  transition: transform .4s var(--ease-roll) calc(var(--i) * 20ms);
}
.roll__row + .roll__row > span { transform: translateY(0); }
:is(a, button):is(:hover, :focus-visible) .roll__row > span { transform: translateY(-100%); }

/* ==========================================================================
   NAV
   ========================================================================== */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 40;
  height: var(--nav-h);
  display: grid;
  grid-template-columns: 1fr repeat(3, auto) 1fr;
  align-items: center;
  column-gap: clamp(40px, 12vw, 200px);
  padding-inline: var(--m);
  color: var(--nav-fg, var(--cream));
  transition: color .35s ease;
  pointer-events: none;
}
.nav > * { pointer-events: auto; }
.nav[data-tone="ink"] { --nav-fg: var(--ink); }
.nav[data-tone="cream"] { --nav-fg: var(--cream); }
.nav__logo {
  font-family: var(--f-display);
  font-size: 20px;
  letter-spacing: 0.02em;
  justify-self: start;
}
.nav__logo sup { font-size: 0.5em; vertical-align: 0.9em; margin-left: 1px; }
.nav__link { font-size: var(--t-small); font-weight: 500; padding-block: 12px; }
/* hover: a pill fills in behind the label (drawn with ::before so the nav layout never shifts) */
.nav__link { position: relative; isolation: isolate; transition: color .35s var(--ease-out); }
.nav__link::before {
  content: ""; position: absolute; z-index: -1; inset: 6px -14px;
  border-radius: var(--r-pill); background: var(--lime);
  opacity: 0; scale: .7 .5;
  transition: opacity .3s var(--ease-out), scale .45s var(--ease-out), background-color .35s ease;
}
.nav__link:is(:hover, :focus-visible)::before { opacity: 1; scale: 1; }
.nav .nav__link:is(:hover, :focus-visible) { color: var(--ink); } /* ink on lime 16.9:1 */
.nav__link:focus-visible { outline: none; }
.nav__cta { justify-self: end; }
.nav__menu-btn { display: none; }

@media (max-width: 809px) {
  .nav { grid-template-columns: 1fr auto; }
  .nav__link, .nav__cta { display: none; }
  .nav__menu-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; margin-right: -12px;
  }
  .nav__menu-btn span { display: block; width: 24px; height: 1.5px; background: currentColor; box-shadow: 0 7px 0 currentColor; transform: translateY(-4px); }
}

.menu {
  position: fixed; inset: 0; z-index: 60;
  background: var(--cobalt); color: var(--cream);
  padding: 96px var(--m) 40px;
  display: flex; flex-direction: column; justify-content: space-between;
  clip-path: inset(0 0 100% 0 round 0 0 var(--r-panel) var(--r-panel));
  visibility: hidden;
  transition: clip-path .7s var(--ease-out), visibility 0s linear .7s;
}
.menu[data-open="true"] { clip-path: inset(0 0 0 0 round 0); visibility: visible; transition: clip-path .7s var(--ease-out); }
.menu__close { position: absolute; top: 6px; right: calc(var(--m) - 12px); width: 44px; height: 44px; font-size: 28px; line-height: 1; }
.menu__links a { display: block; font-family: var(--f-serif); font-weight: 300; font-size: 56px; line-height: 1.1; letter-spacing: -0.03em; padding-block: 4px; }
.menu__foot { display: flex; justify-content: space-between; gap: 16px; font-size: var(--t-small); color: color-mix(in oklch, var(--cream) 70%, var(--cobalt)); }


.menu :focus-visible { outline: 2px solid var(--lime); outline-offset: 4px; }
@media (max-width: 809px) {
  .nav { background: var(--nav-bg, transparent); transition: color .35s ease, background-color .35s ease; }
  .menu__foot { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .nav, .nav *, .nav *::before, .menu, .menu * { transition-duration: .01ms !important; transition-delay: 0s !important; animation-duration: .01ms !important; }
}
