/* The site nav: a thin frosted-glass rail on the left (js/rail.js).
   Icons at rest; the item nearest the pointer opens its label, a tag that
   floats out past the glass, and its neighbours swell a little on a spring (after ThreeUI's Animated Top Dock,
   Liquid Glass variant; threeui.com, Community, MIT License). The glass is
   light with dark ink over cream sections, smoky with cream text over dark
   ones (sections marked data-tone="dark"), and smoky throughout in dark
   mode. The frost and the rim are white light; every colour comes from the
   palette variables. On the home page it stays away through the doors and
   the hero. The icons are drawn for the café, in sets the studio picks
   (js/site/icons.js); open or closed is the lamp, lit while the café is
   open. Phones get it as a bottom bar of icons, like an app's tab bar. */

.rail {
  --h: 34px; --px: 9px; --ico: 15px; --r: 10px;
  position: fixed; z-index: 25; left: 12px; top: 50%; translate: 0 -50%;
  /* as wide as an icon: an open label floats out past the glass, as its own
     tag, instead of stretching the rail */
  width: calc(var(--ico) + 2 * var(--px) + 2px + 8px);
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 4px; border-radius: 17px;
  transition: opacity .5s ease, translate .55s cubic-bezier(.2, .7, .2, 1), scale .5s cubic-bezier(.2, .7, .2, 1), background .5s ease, color .5s ease, box-shadow .5s ease;
  /* smoky glass: the dark sections, and dark mode */
  color: color-mix(in srgb, var(--cream) 85%, transparent);
  background: linear-gradient(160deg, color-mix(in srgb, var(--espresso) 46%, rgba(255, 255, 255, .14)), color-mix(in srgb, var(--espresso) 62%, rgba(255, 255, 255, .04)));
  backdrop-filter: blur(26px) saturate(170%); -webkit-backdrop-filter: blur(26px) saturate(170%);
  box-shadow: 0 30px 64px -26px rgba(0, 0, 0, .8), inset 0 1px rgba(255, 255, 255, .32), inset 0 -1px rgba(255, 255, 255, .08), inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.rail::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; background: linear-gradient(168deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 30% 76%, rgba(255, 255, 255, .1)); }
/* arriving: hidden until the page says so (the home page, past the hero) */
.rail.is-away:not(:focus-within) { opacity: 0; translate: -24px -50%; pointer-events: none; }

.rail a, .rail span { color: inherit; text-decoration: none; }
.rail__i { --v: 0; position: relative; display: flex; width: max-content; align-items: center; height: var(--h); padding: 0 var(--px); border: 1px solid transparent; border-radius: var(--r); white-space: nowrap; transition: color .35s ease, background .4s ease, border-color .4s ease, box-shadow .4s ease; }
.rail__i:focus-visible { outline: none; }
.rail__i svg { flex: none; width: var(--ico); height: var(--ico); fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; opacity: .75; scale: calc(1 + var(--v) * .12); }
/* the label: closed to nothing, opened in full (a grid track from 0fr to
   1fr, so it never stops part way through a word) */
.rail__lbl { display: grid; grid-template-columns: 0fr; margin-left: 0; opacity: 0; transition: grid-template-columns .6s cubic-bezier(.25, 1.12, .4, 1), margin-left .6s cubic-bezier(.25, 1.12, .4, 1), opacity .3s ease; }
.rail__lbl > span { min-width: 0; overflow: hidden; font-size: .86rem; letter-spacing: .02em; }
.rail__i.is-open .rail__lbl { grid-template-columns: 1fr; margin-left: .6rem; opacity: 1; transition: grid-template-columns .6s cubic-bezier(.25, 1.12, .4, 1), margin-left .6s cubic-bezier(.25, 1.12, .4, 1), opacity .45s ease .1s; }
.rail__i.is-open .rail__lbl > span { padding-right: .2em; }
/* the sprout at the top: the logo, and a way home (no label) */
.rail .rail__mark { display: flex; align-items: center; height: calc(var(--h) + 6px); padding: 0 calc(var(--px) - 1px); color: var(--amber); }
.rail__mark .logo-mark { display: inline-block; height: calc(var(--ico) * 1.65); aspect-ratio: 1170 / 1894; background: currentColor; -webkit-mask: url('../assets/logo-mark.png') center / contain no-repeat; mask: url('../assets/logo-mark.png') center / contain no-repeat; filter: none; transition: scale .3s cubic-bezier(.3, 1.4, .5, 1); }
.rail__mark:hover .logo-mark { scale: 1.08; }
.rail__mark:focus-visible { outline: 1px solid currentColor; outline-offset: -2px; border-radius: var(--r); }
/* open or closed: a string-light bulb, lit while the café is open */
.rail__glass { fill: transparent; transition: fill .4s ease; }
.rail__fil { opacity: .8; }
.rail__i.is-status svg { opacity: .55; }
.rail__i.is-status.is-open-now svg { opacity: 1; filter: drop-shadow(0 0 2px var(--amber)) drop-shadow(0 0 7px color-mix(in srgb, var(--amber) 70%, transparent)); }
.rail__i.is-status.is-open-now .rail__glass { fill: color-mix(in srgb, var(--lamp) 45%, white); }
.rail__i.is-status.is-open-now .rail__fil { stroke: color-mix(in srgb, var(--amber) 75%, var(--brick)); opacity: 1; }
.rail__i.is-status.is-open-now .rail__fil--ink { fill: color-mix(in srgb, var(--amber) 75%, var(--brick)); stroke: none; }
/* the house's sets carry more detail than the first: a little bigger */
.rail[data-icons]:not([data-icons="A"]) { --ico: 19px; }
/* the icons wait for js/rail.js to draw them in the studio's set */
.rail:not([data-live]) .rail__i svg { visibility: hidden; }
.rail__i.is-status .rail__lbl > span { font-size: .78rem; }
.rail__hair { align-self: stretch; height: 1px; margin: 2px 6px; background: linear-gradient(90deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .26), rgba(255, 255, 255, .04)); }

.rail__i[data-near="true"], .rail__i:focus-visible { z-index: 1; color: var(--cream); border-color: rgba(255, 255, 255, .2); background: linear-gradient(180deg, color-mix(in srgb, var(--bark) 70%, var(--espresso)), color-mix(in srgb, var(--espresso) 94%, transparent)); box-shadow: inset 0 1px rgba(255, 255, 255, .4), 0 8px 18px -10px rgba(0, 0, 0, .8); }
.rail__i.is-here { color: var(--ink); border-color: color-mix(in srgb, var(--cream) 60%, transparent); background: linear-gradient(180deg, color-mix(in srgb, var(--cream) 55%, white), var(--cream-deep)); box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--cream) 50%, transparent), inset 0 -1px rgba(0, 0, 0, .14); }
.rail__i.is-here svg { opacity: 1; }

/* light glass over the cream sections (not in dark mode) */
html:not([data-mode="dark"]) .rail.is-cream { color: color-mix(in srgb, var(--ink) 80%, transparent); background: linear-gradient(160deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, .22)); box-shadow: 0 26px 54px -26px color-mix(in srgb, var(--ink) 55%, transparent), inset 0 1px rgba(255, 255, 255, .8), inset 0 0 0 1px rgba(255, 255, 255, .4); }
html:not([data-mode="dark"]) .rail.is-cream::before { background: linear-gradient(168deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 30% 76%, rgba(255, 255, 255, .14)); }
html:not([data-mode="dark"]) .rail.is-cream .rail__mark { color: var(--brick); }
html:not([data-mode="dark"]) .rail.is-cream .rail__i[data-near="true"] { color: var(--ink); background: linear-gradient(180deg, rgba(255, 255, 255, .97), color-mix(in srgb, var(--cream) 88%, white)); border-color: rgba(255, 255, 255, .8); box-shadow: inset 0 1px #fff, 0 10px 22px -12px color-mix(in srgb, var(--ink) 55%, transparent); }
html:not([data-mode="dark"]) .rail.is-cream .rail__i.is-here { color: var(--cream); border-color: var(--ink); background: var(--ink); box-shadow: 0 10px 22px -12px color-mix(in srgb, var(--ink) 60%, transparent); }
html:not([data-mode="dark"]) .rail.is-cream .rail__hair { background: linear-gradient(90deg, color-mix(in srgb, var(--ink) 3%, transparent), color-mix(in srgb, var(--ink) 20%, transparent), color-mix(in srgb, var(--ink) 3%, transparent)); }

/* A page the studio has closed here (js/rail.js): its content waits for
   the settings, then gives way to a short note if it is closed. */
body[data-page]:not(.is-ready) main { visibility: hidden; }
/* a closed page: everything but the rail gives way to the note */
body.is-closed-page > :not(.closed-note, nav.rail, script, .staging-tag) { display: none !important; }
/* links to a closed page hide (js/rail.js) */
.page-off-menu [data-needs-page~="menu"], .page-off-gallery [data-needs-page~="gallery"], .page-off-order [data-needs-page~="order"] { display: none !important; }
.closed-note { background: var(--cream); display: grid; place-content: center; justify-items: center; gap: 0.4rem; min-height: 100svh; padding: 2rem; text-align: center; }
.closed-note__title { margin: 0; font: italic 500 clamp(1.8rem, 4vw, 2.6rem)/1.1 var(--serif); color: var(--ink); }
.closed-note__line { margin: 0 0 0.4rem; color: var(--ink-soft); }
.closed-note a { color: var(--brick); }

/* phones: a bar of icons along the bottom, like an app's tab bar. It starts
   roomy and settles smaller once you scroll down into the page, and comes
   back when you scroll up (js/site/rail-ui.js, .is-small). */
@media (max-width: 640px) {
  /* the lit one sits inside the bar with room all round: 6px from its
     edges, its corners following the bar's */
  .rail { --h: 44px; --px: 0px; --r: 19px; width: auto; left: 50%; top: auto; bottom: max(14px, env(safe-area-inset-bottom)); flex-direction: row; align-items: center; gap: 6px; padding: 6px; translate: -50% 0; border-radius: 25px; transform-origin: 50% 100%; }
  .rail[data-icons]:not([data-icons="A"]) { --ico: 21px; }
  .rail.is-small { scale: .8; }
  .rail.is-away:not(:focus-within) { translate: -50% 24px; }
  .rail__i { --v: 0 !important; justify-content: center; width: 48px; translate: none; }
  .rail__lbl, .rail__hair, .rail .rail__mark { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .rail, .rail.is-away:not(:focus-within) { transition: opacity .3s ease; translate: 0 -50%; }
  .rail__lbl, .rail__i.is-open .rail__lbl { transition: opacity .2s ease; }
}
@media (prefers-reduced-motion: reduce) and (max-width: 640px) { .rail, .rail.is-away:not(:focus-within) { translate: -50% 0; } }
