/* The site's menu (js/menu.js): mockups behind ?menu=a|b|c&type=…. A bar fixed at the top over everything;
   WATERFALL in the chosen face (--wordmark), the rest in the site's mono. */

.site-menu {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  height: 54px;
  padding: 0 clamp(16px, 3vw, 36px);
  display: flex;
  align-items: center;
  gap: 28px;
  font: var(--menu-size, 10px)/1 var(--menu-face, var(--mono));
  letter-spacing: var(--menu-track, 0.2em);
  text-transform: uppercase;
  color: var(--fg);
  background: linear-gradient(rgba(13, 17, 23, 0.88), rgba(13, 17, 23, 0.55) 70%, rgba(13, 17, 23, 0));
  pointer-events: none;
}
.site-menu > * { pointer-events: auto; }

.site-menu button, .sm-index button {
  padding: 6px 0; border: 0; background: none; color: inherit;
  font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer;
}
.site-menu ul, .sm-index ol, .sm-index ul { list-style: none; }

/* the wordmark: hidden over the hero, which has its own */
.sm-word {
  font-family: var(--wordmark) !important;
  font-size: 26px !important;
  letter-spacing: 0.04em !important;
  text-transform: none !important;
  transition: opacity 0.4s ease;
}
body:not(.past-hero) .site-menu .sm-word { opacity: 0; pointer-events: none; }

/* the cartouche: WATERFALL on a paper slip with a ruled border, like the title label of a woodblock print */
.sm-cartouche .sm-word {
  padding: 5px 12px 4px !important;
  font-weight: 800;
  font-size: 21px !important;
  letter-spacing: 0.12em !important;
  color: #1c2230;
  background: #e6e0d2;
  outline: 1px solid #e6e0d2;
  outline-offset: 2px;
  box-shadow: inset 0 0 0 1px #1c2230;
}
.site-menu--b.sm-cartouche .sm-word { font-size: 24px !important; }

.sm-links { display: flex; gap: 22px; }
.sm-link, .sm-tool { white-space: nowrap; }   /* never wraps: narrower, The Journey loses its "The", then the MENU page takes over */
.sm-link { opacity: 0.62; transition: opacity 0.2s ease; border-bottom: 1px solid transparent !important; }
.sm-link:hover, .sm-link:focus-visible { opacity: 1; }
.is-current > .sm-link { opacity: 1; }
/* the current chapter's underline: a sine wave flowing left to right, like water (the user, 2026-11-03). A mask, so
   it takes the link's colour; one wavelength is 12 px, and the mask slides one wavelength per loop */
.sm-link { position: relative; }
.sm-link::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 5px;
  background: currentColor; opacity: 0; transition: opacity 0.3s ease;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='5'%3E%3Cpath d='M0 2.5 Q3 0.2 6 2.5 T12 2.5' fill='none' stroke='%23000' stroke-width='1.1'/%3E%3C/svg%3E") 0 0 / 12px 5px repeat-x;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='5'%3E%3Cpath d='M0 2.5 Q3 0.2 6 2.5 T12 2.5' fill='none' stroke='%23000' stroke-width='1.1'/%3E%3C/svg%3E") 0 0 / 12px 5px repeat-x;
  animation: sm-flow 1.4s linear infinite paused;
}
.is-current > .sm-link::after { opacity: 1; animation-play-state: running; }
@keyframes sm-flow { to { -webkit-mask-position: 12px 0; mask-position: 12px 0; } }
@media (prefers-reduced-motion: reduce) { .sm-link::after { animation: none; } }

/* The Journey's stops, under it */
.has-stops { position: relative; }
.sm-stops {
  position: absolute; top: calc(100% + 8px); left: -14px;
  visibility: hidden; opacity: 0;
  transition: opacity 0.3s ease 1s, visibility 0s linear 1.3s;   /* stays a second after the pointer leaves, then fades */
  width: 300px; padding: 12px 14px;
  columns: 2; column-gap: 22px;
  background: rgba(13, 17, 23, 0.95); border: 1px solid var(--rule);
  text-transform: none; letter-spacing: 0.04em; font-size: 11px;
}
.sm-item[data-id="information"] .sm-stops { width: auto; min-width: 170px; columns: 1; }   /* Information's four pages: one column (the user, 2026-11-11) */
.has-stops:hover .sm-stops, .has-stops:focus-within .sm-stops { visibility: visible; opacity: 1; transition-delay: 0s; }
.has-stops.is-closed .sm-stops { visibility: hidden; opacity: 0; transition: opacity 0.2s ease, visibility 0s linear 0.2s; }
.sm-stop { padding: 4px 0 !important; opacity: 0.7; text-align: left; }
.sm-stop:hover, .sm-stop:focus-visible { opacity: 1; }

.sm-tools { display: flex; gap: 20px; }
.sm-tool { color: inherit; text-decoration: none; opacity: 0.62; padding: 6px 0; }
.sm-tool:hover, .sm-tool:focus-visible { opacity: 1; }
.sm-more { display: none; }
/* the sound switch (js/sound-ui.js): the gramophone, still until the sound is on, and SOUND OFF / SOUND ON */
.sound-toggle { display: flex; align-items: center; gap: 7px; opacity: 0.62; transition: opacity 0.2s ease; }
.sound-toggle:hover, .sound-toggle:focus-visible, .sound-toggle.is-on, .sound-toggle.is-pending { opacity: 1; }
.sound-toggle .gramophone { width: 26px; height: 26px; margin: -6px 0; }
.sound-toggle-label { white-space: nowrap; }
@keyframes sound-wait { 50% { opacity: 0.45; } }

/* how far down the site the page is (a) */
.sm-progress {
  position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--fg); opacity: 0.45;
  transform-origin: left; transform: scaleX(0);
}

/* a: the bar */
.site-menu--a .sm-links { margin-left: auto; }

/* b: the masthead, WATERFALL in the middle */
/* WATERFALL on the screen's centre line, the chapters either side; sound and Contact held to the right edge */
.site-menu--b { display: grid; grid-template-columns: 1fr auto 1fr; }
.site-menu--b .sm-tools { position: absolute; top: 0; bottom: 0; right: clamp(16px, 3vw, 36px); align-items: center; }
.site-menu--b .sm-links:first-child { justify-self: end; }
.site-menu--b .sm-links:nth-child(3) { justify-self: start; }
.site-menu--b .sm-word { font-size: 30px !important; }
.site-menu--b .sm-tools { padding-left: 8px; border-left: 1px solid var(--rule); }

/* c: WATERFALL and MENU */
.site-menu--c .sm-tools { margin-left: auto; }
.site-menu--c .sm-more { display: block; }

/* the contents page (c; every layout on a phone) */
.sm-index {
  position: fixed; inset: 0; z-index: 60;
  display: none; overflow: auto;
  padding: 84px clamp(20px, 8vw, 120px) 60px;
  background: rgba(13, 17, 23, 0.97);
  color: var(--fg);
  font: 12px/1.4 var(--menu-face, var(--mono));
  /* always Shippori titles and Alegreya text here (the user's pick, 2026-10-06), whatever the bar uses */
  --menu-face: 'Alegreya Sans SC', var(--mono);
  --wordmark: 'Shippori Antique B1', var(--hero);
  letter-spacing: 0.08em;
}
.sm-index.is-open { display: block; }
html.sm-locked { overflow: hidden; }
.sm-close {
  position: absolute; top: 18px; right: clamp(16px, 3vw, 36px);
  font-size: 10px !important; letter-spacing: 0.2em !important; text-transform: uppercase !important; opacity: 0.7;
}
.sm-chapter-link { display: flex; align-items: baseline; gap: 20px; text-align: left; opacity: 0.82; }
.sm-chapter-link:hover, .sm-chapter-link:focus-visible, .is-current > .sm-chapter-link { opacity: 1; }
.sm-num { width: 34px; flex: none; font: 11px var(--menu-face, var(--mono)); letter-spacing: 0.2em; opacity: 0.5; }
.sm-title { font-family: var(--wordmark); font-size: clamp(30px, 5vw, 60px); line-height: 1.18; }
.sm-index-stops { columns: 3 170px; column-gap: 24px; margin: 6px 0 22px 54px; }
.sm-index-foot { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--rule); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; }

/* narrower, where centred the chapters would reach sound and Contact: those take their own column again (WATERFALL
   then sits a little left of the centre line) */
@media (max-width: 1340px) {
  .site-menu--b { grid-template-columns: 1fr auto 1fr auto; }
  .site-menu--b .sm-tools { position: static; }
}
/* narrower: The Journey loses its "The" and everything moves closer, rather than wrap */
@media (max-width: 1180px) {
  .sm-the { display: none; }
  .site-menu { gap: 20px; }
  .sm-links { gap: 16px; }
  .sm-tools { gap: 16px; }
}
/* narrower still (tablets, phones): every layout is WATERFALL, the sound switch and MENU (the contents page) */
@media (max-width: 1000px) {
  .site-menu, .site-menu--b { display: flex; }
  .site-menu .sm-links, .site-menu .sm-contact { display: none; }
  .site-menu .sm-tools, .site-menu--b .sm-tools { position: static; margin-left: auto; padding-left: 0; border-left: 0; }   /* the sound switch stays */
  .site-menu .sm-more { display: block; }
}
@media (max-width: 640px) {
  .site-menu, .site-menu--b { height: 48px; }
  /* the gramophone alone: still while off, turning while on, pulsing while it waits for a tap (its aria-label says which) */
  .sound-toggle-label { display: none; }
  .sound-toggle .gramophone { width: 32px; height: 32px; }
  .sound-toggle.is-pending { animation: sound-wait 1.6s ease-in-out infinite; }
  .site-menu .sm-word, .site-menu--b .sm-word { font-size: 22px !important; }
  .sm-index-stops { margin-left: 0; columns: 2; }
}

/* the mockup picker (js/menu.js mockupPicker): click between the layouts and faces */
.mockup-picker {
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 70;
  max-width: calc(100vw - 24px);
  padding: 8px 12px 10px;
  background: rgba(13, 17, 23, 0.92); border: 1px solid var(--rule);
  font: 10px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg);
}
.mockup-picker button { border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.mp-fold { display: block; margin: 0 0 6px auto; padding: 3px 8px !important; border: 1px solid var(--rule) !important; opacity: 0.75; }
.mp-fold:hover { opacity: 1; }
.mockup-picker.is-folded { left: 14px; transform: none; padding: 6px; }
.mockup-picker.is-folded .mp-body { display: none; }
.mockup-picker.is-folded .mp-fold { margin: 0; }
.mp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 4px; }
.mp-label { width: 96px; opacity: 0.5; }
.mp-btn { padding: 5px 8px !important; border: 1px solid var(--rule) !important; opacity: 0.7; }
.mp-btn:hover { opacity: 1; }
.mp-btn.is-on { opacity: 1; background: var(--fg) !important; color: var(--bg) !important; }
@media (max-width: 640px) { .mp-label { width: 100%; } }
.sm-stop-place { margin-left: 8px; opacity: 0.55; font-size: 10px; }
