/* =========================================================================
   ON3 — header extras (js/header.js): the three-line menu and the logo's
   hover / focus / press response.
   ========================================================================= */

/* ------------------------------------------------------------- menu button
   Immediately right of BOOK A SPACE. */
.hdr__menu {
  flex: none; display: inline-grid; place-content: center; gap: 5px; width: 44px; height: 44px; margin-right: -6px; padding: 0;
  border: 0; border-radius: 50%; background: none; cursor: pointer; color: var(--on-dark);
}
.hdr__menu span { display: block; width: 20px; height: 1.5px; border-radius: 2px; background: currentColor; transition: transform var(--t-fast) var(--ease); }
.hdr__menu:hover span:nth-child(2) { transform: translateX(-3px); }
.hdr__menu:focus-visible { box-shadow: var(--focus); }

.hdr__logo + .hdr__book { margin-left: auto; }   /* pages without the Brands slot */

/* On phones the bar holds the logo, Book, the menu and (once scrolled) Brands,
   so Book shortens to "Book" while Brands is up there. */
@media (max-width: 479px) {
  .hdr.has-brands .hdr__book-more { display: none; }
}

/* ------------------------------------------------------------- menu panel */
.menu {
  margin: 0 0 0 auto; padding: 0; border: 0; width: min(440px, 100%); max-width: 100%; height: 100%; max-height: 100%;
  background: var(--espresso); color: var(--on-dark); border-left: 1px solid var(--on-dark-faint);
  overflow-y: auto; overscroll-behavior: contain;
}
.menu[open] { display: flex; flex-direction: column; gap: var(--s4); padding: calc(10px + env(safe-area-inset-top)) max(18px, 1.6vw) calc(24px + env(safe-area-inset-bottom)); }
.menu::backdrop { background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
@media (prefers-reduced-motion: no-preference) {
  .menu[open] { animation: menu-in 480ms var(--ease); }
  @keyframes menu-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
}
.menu__head { display: flex; align-items: center; justify-content: space-between; min-height: 54px; }
.menu__title { font-family: var(--f-display); font-size: 0.625rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--on-dark-dim); }
.menu__close { position: relative; width: 44px; height: 44px; margin-right: -8px; border: 0; border-radius: 50%; background: none; cursor: pointer; color: var(--on-dark); }
.menu__close::before, .menu__close::after { content: ""; position: absolute; left: 12px; right: 12px; top: 50%; height: 1.5px; background: currentColor; }
.menu__close::before { transform: rotate(45deg); }
.menu__close::after { transform: rotate(-45deg); }
.menu__close:focus-visible { box-shadow: var(--focus); }

.menu__eyebrow { font-family: var(--f-display); font-weight: 400; font-size: 0.5625rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--amber); margin-bottom: var(--s2); }
/* The three spaces as one compact list: a row each, name over a one-line
   description, an arrow at the end. Record's two rooms are small links on
   its row rather than a card of their own. */
.menu__spaces { display: grid; }
.menu__spaces .menu__eyebrow { margin-bottom: 4px; }
.menu__space {
  position: relative; display: grid; gap: 2px; padding: 12px 28px 12px 0; border-bottom: 1px solid var(--on-dark-faint);
  color: inherit; text-decoration: none;
}
.menu__eyebrow + .menu__space { border-top: 1px solid var(--on-dark-faint); }
a.menu__space::after { content: "→"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); color: var(--on-dark-dim); transition: transform var(--t-fast) var(--ease); }
a.menu__space:hover::after { transform: translate(4px, -50%); color: var(--amber); }
.menu__space-name { font-family: var(--f-display); font-size: 0.875rem; letter-spacing: 0.1em; text-transform: uppercase; line-height: 1.3; }
a.menu__space:hover .menu__space-name { color: var(--amber); }
.menu__space-sub { font-size: 0.8125rem; line-height: 1.4; color: var(--on-dark-dim); }
.menu__space-links { display: flex; flex-wrap: wrap; gap: 0 18px; margin-top: -2px; }
.menu__space-links a {
  display: inline-flex; align-items: center; min-height: 36px;
  font-size: 0.8125rem; font-weight: 500; color: var(--amber); text-decoration: none;
}
.menu__space-links a::after { content: "→"; margin-left: 6px; transition: transform var(--t-fast) var(--ease); }
.menu__space-links a:hover::after { transform: translateX(3px); }

/* The spaces list ends on a line already, so this list starts without one. */
.menu__links { display: grid; }
.menu__links a {
  display: flex; align-items: center; justify-content: space-between; min-height: 56px; border-bottom: 1px solid var(--on-dark-faint);
  font-family: var(--f-display); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--on-dark); text-decoration: none;
}
.menu__links a::after { content: "→"; font-family: var(--f-body); color: var(--on-dark-dim); transition: transform var(--t-fast) var(--ease); }
.menu__links a:hover::after { transform: translateX(4px); color: var(--amber); }
.menu__book { margin-top: auto; min-height: 50px; }

/* ------------------------------------------------------------- logo
   Raised and lit on hover / keyboard focus: a small lift, a soft warm glow and
   a shadow under it, plus a slight tilt toward the pointer (js/header.js sets
   --rx / --ry). Pressed: it sinks back briefly. Only the image moves, so the
   link's clickable box stays still. */
.hdr__logo { perspective: 500px; border-radius: 8px; }
.hdr__logo img {
  transform-origin: 50% 60%;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  filter: drop-shadow(0 0 0 rgba(224, 164, 88, 0)) drop-shadow(0 0 0 rgba(0, 0, 0, 0));
  transition: transform 0.5s var(--ease), filter 0.65s var(--ease);
}
.hdr__logo:hover img, .hdr__logo:focus-visible img {
  transform: translateY(-1.5px) scale(1.035) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  filter: drop-shadow(0 0 7px rgba(224, 164, 88, 0.5)) drop-shadow(0 4px 5px rgba(0, 0, 0, 0.55));
}
.hdr__logo:active img { transform: translateY(0.5px) scale(0.975); filter: drop-shadow(0 0 4px rgba(224, 164, 88, 0.35)) drop-shadow(0 1px 1px rgba(0, 0, 0, 0.5)); transition-duration: 0.08s; }
.hdr__logo:focus-visible { box-shadow: none; outline: 1px solid rgba(224, 164, 88, 0.6); outline-offset: 4px; }
@media (prefers-reduced-motion: reduce) {
  .hdr__logo:hover img, .hdr__logo:focus-visible img, .hdr__logo:active img { transform: none; }
}

/* ------------------------------------------------------------- tagline under the hero film */
.hero-copy {
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 14px 32px;
  padding: clamp(28px, 4vw, 56px) max(16px, 2.4vw) clamp(8px, 1.5vw, 16px);
}
/* One line at every width: the set line is ~15.2 times its font size wide in
   Michroma, so the size follows the space between the gutters (with a little
   slack) and stops at 4rem. It gets the full row; the line under it and the
   buttons share the row below. */
.hero-copy h1 {
  grid-column: 1 / -1; white-space: nowrap;
  font-family: var(--f-display); font-weight: 400; line-height: 1.08; letter-spacing: 0.02em;
  font-size: min(4rem, calc((100vw - 2 * max(16px, 2.4vw)) / 15.8));
}
.hero-copy p { grid-column: 1; max-width: 34em; font-size: clamp(0.9375rem, 0.85rem + 0.35vw, 1.1875rem); line-height: 1.5; color: var(--on-dark-dim); }
.hero-copy__actions { grid-column: 2; grid-row: 2; align-self: end; display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
@media (max-width: 799px) {
  .hero-copy { grid-template-columns: 1fr; }
  .hero-copy__actions { grid-column: 1; grid-row: auto; justify-content: flex-start; margin-top: 6px; }
}

/* Scroll light: js/hero-light.js sets --lit from 0 to 1 as the tagline rises from the
   bottom of the screen to just above the middle, and back down as it leaves. A light
   sweeps left to right through the letters (warm at its edge); the line under it comes
   up one word at a time a little behind (--lit-after), and the buttons fade up with it.
   Without the script, or with reduced motion, everything is simply lit. */
.hero-copy.is-lit-live h1 {
  --lit-on: var(--on-dark);
  color: transparent;
  background-image: linear-gradient(90deg,
    var(--lit-on) 0%, var(--lit-on) 34%, var(--lit-edge, var(--amber-soft, #f0c48a)) 45%,
    rgba(243, 234, 217, 0.14) 62%, rgba(243, 234, 217, 0.14) 100%);
  background-size: 260% 100%;
  background-position: calc((1 - var(--lit, 1)) * 100%) 0;
  -webkit-background-clip: text; background-clip: text;
}
/* The line under it lights one word at a time, a little behind the heading:
   js/hero-light.js wraps each word with its place (--i) and the count (--n), and a
   word comes up over about three words' worth of scroll (W) as --lit-after passes it. */
.hero-copy.is-lit-live p { --W: 3; }
.hero-copy .lw {
  opacity: calc(0.18 + 0.82 * clamp(0, (var(--lit-after, 1) * (var(--n) + var(--W)) - var(--i)) / var(--W), 1));
}
.hero-copy.is-lit-live .hero-copy__actions { opacity: calc(0.3 + 0.7 * var(--lit-after, 1)); }
