/* ---- Homepage chrome around the hero (the hero itself — the listening room — is css/room.css) ---- */

/* ---- Sticky name ---- */
.sticky-name {
  position: sticky;
  top: 0;
  height: var(--nav-h);
  margin-bottom: calc(-1 * var(--nav-h));
  z-index: calc(var(--z-nav) + 1);
  pointer-events: none;
  /* Palette rule: burgundy on the off-white sections, off-white over the dark hero
     (stickyName.js toggles .is-over-hero where the hero's edge passes the name). */
  color: var(--color-burgundy);
  transition: color 0.35s var(--ease-out);
}

.sticky-name.is-over-hero {
  color: var(--color-off-white);
}

.sticky-name__link {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  pointer-events: auto;
  transform-origin: 0 0;
  will-change: transform;
  visibility: hidden; /* until positioned by stickyName.js */
  /* the logo's own look is the shared .logo rule (base.css); only its size is set here */
  font-size: min(17vw, 30svh);
  line-height: 0.86;
}

.sticky-name.is-ready .sticky-name__link {
  visibility: visible;
}

/* Docked in the corner the logo is real 19px text (stickyName.js), not the large logo shrunk.
   The same Fraunces drawing, only optically adjusted for its size: the optical size axis at 96
   instead of the display end (144) gives the hairlines a touch more body, and a hair of extra
   tracking keeps the capitals from touching. Proportions within ~3 % of the large logo. */
.sticky-name.is-docked .logo {
  font-variation-settings: 'opsz' 96;
  letter-spacing: 0.005em;
}

/* "Come in, mind the records." — one small line centred over the logo on the first screen; the
   two read as one lockup. Placed, sized from the name and faded by stickyName.js. */
.sticky-name .sticky-name__hello {
  position: absolute;
  left: 50%;
  top: 40vh;
  transform: translateX(-50%);
  /* the tracking adds space after the last letter too: the same space before the first keeps the
     line optically centred over the name */
  padding-left: 0.34em;
  white-space: nowrap;
  text-align: center;
  color: inherit;
  font-weight: 400;
  letter-spacing: 0.34em;
  opacity: calc(var(--hello, 1) * 0.86);
  visibility: hidden;
}

.sticky-name.is-ready .sticky-name__hello {
  visibility: visible;
}

/* the role under the name ("Visual storyteller & designer"): placed by stickyName.js, fading
   with the line above */
.sticky-name .sticky-name__aside {
  position: absolute;
  left: 50%;
  top: 60vh;
  transform: translateX(-50%);
  padding-left: 0.28em;
  white-space: nowrap;
  color: inherit;
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  opacity: calc(var(--hello, 1) * 0.8);
  visibility: hidden;
}

.sticky-name .sticky-name__aside .dot {
  margin: 0 0.8em 0.22em 0.5em;
}

.sticky-name.is-ready .sticky-name__aside {
  visibility: visible;
}

/* the nav links wait until the logo has docked in the corner (html.logo-docked, stickyName.js) */
body[data-page='home'] :is(.nav__links, .nav__contact, .nav__toggle) {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s var(--ease-out);
}

html.logo-docked body[data-page='home'] :is(.nav__links, .nav__contact, .nav__toggle) {
  opacity: 1;
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  body[data-page='home'] :is(.nav__links, .nav__contact, .nav__toggle) {
    opacity: 1;
    pointer-events: auto;
  }
  .sticky-name :is(.sticky-name__hello, .sticky-name__aside) {
    display: none;
  }
}

/* The corner name (stickyName.js, compact from the start) replaces the small nav mark on the home page */
body[data-page='home'] .nav__mark {
  visibility: hidden;
}

/* ---- First visit: everything waits for the room photograph (listeningRoom.js removes .is-intro) ---- */
html.is-intro .nav,
html.is-intro .sticky-name__text,
html.is-intro .sticky-name__hello,
html.is-intro .sticky-name__aside,
html.is-intro .room__invite {
  opacity: 0;
}

@media (max-width: 700px) {
  .sticky-name__link {
    font-size: min(19vw, 26svh);
  }
  /* on a phone the room is cropped tall and the lockup has to sit over the pictures: a soft
     shadow keeps it legible over the pale mats (only while it is large over the room) */
  .sticky-name.is-over-hero:not(.is-compact) :is(.sticky-name__link, .sticky-name__hello, .sticky-name__aside) {
    text-shadow: 0 0 0.35em rgba(28, 6, 9, 0.55), 0 0.04em 0.9em rgba(28, 6, 9, 0.45);
  }
  /* the role crosses the pale mats on a phone: a soft wine backing keeps it readable */
  .sticky-name .sticky-name__aside {
    padding: 0.45em 0.9em 0.45em calc(0.9em + 0.28em);
    border-radius: 999px;
    background: rgba(28, 6, 9, 0.55);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: calc(var(--hello, 1) * 0.95);
  }
}
