/* ==========================================================================
   chrome — boot, top bar, menu
   ========================================================================== */

/* ── boot ──────────────────────────────────────────────────────────────── */

.boot {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
  background: var(--ink);
  padding: var(--gut);
}

.boot__inner { align-self: center; display: grid; justify-items: center; gap: clamp(1rem, 3vh, 2rem); }
.boot__warp { width: min(34vw, 190px); height: auto; }

.boot__word {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(1.9rem, 6vw, 3.6rem);
  line-height: 1;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  opacity: 0;
}

.boot__bar {
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

/* ── top bar ───────────────────────────────────────────────────────────── */

.bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(0.85rem, 2.1vh, 1.4rem) var(--gut);
}

.bar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  /* Solid for the full height of the bar's own text, then falling away.
     A gentler ramp let section copy scroll up and read straight through the
     wordmark, which is worse than a hard edge would have been. */
  background: linear-gradient(to bottom,
    var(--ink) 0%, var(--ink) 46%,
    rgba(20, 22, 31, 0.88) 72%, rgba(20, 22, 31, 0) 100%);
  opacity: 0;
  transition: opacity 0.5s var(--throw);
}

.bar.is-stuck::before { opacity: 1; }

.bar__mark { display: inline-flex; align-items: baseline; gap: 0.6em; }

.bar__name {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 1.3rem;
  letter-spacing: 0.14em;
  line-height: 1;
}

.bar__sub { color: var(--thread-4); }
.bar__state { display: none; }
@media (min-width: 980px) { .bar__state { display: block; } }

.menubtn { display: inline-flex; align-items: center; }

.menubtn__label {
  position: relative;
  display: block;
  height: 1.45em;
  min-width: 5ch;
  overflow: hidden;
  text-align: right;
  font-family: var(--f-mono);
  font-size: var(--t-meta);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* 1.45 rather than 1 so the mask does not shear descenders, and a min-width
   from the longer word so the bar does not jump when they swap. */
.menubtn__label i {
  display: block;
  font-style: normal;
  line-height: 1.45;
  transition: transform 0.5s var(--throw);
}

.menubtn__label i:last-child { position: absolute; top: 100%; right: 0; }
body.menu-open .menubtn__label i { transform: translateY(-100%); }

/* ── menu ──────────────────────────────────────────────────────────────── */

.menu {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: grid;
  grid-template-rows: 1fr auto;
  align-content: center;
  padding: clamp(5rem, 13vh, 8rem) var(--gut) clamp(1.5rem, 4vh, 3rem);
  visibility: hidden;
}

body.menu-open .menu { visibility: visible; }

.menu__sheet {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--ink-2);
  border-bottom: 1px solid var(--madder);
  transform: scaleY(0);
  transform-origin: top;
}

.menu__nav { align-self: center; width: 100%; }
.menu__list { display: grid; }
.menu__list li { overflow: hidden; border-bottom: 1px solid var(--line); }

.menu__list a {
  display: grid;
  grid-template-columns: 4rem 1fr;
  align-items: baseline;
  gap: 1rem;
  padding: clamp(0.5rem, 1.7vh, 0.95rem) 0;
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(2rem, 7.5vw, 5.4rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  transform: translateY(115%);
  transition: color 0.4s var(--throw);
}

/* The label slides; the number stays. The anchor's transform belongs to the
   open/close stagger, so the hover shift lives on the span. */
.menu__list a span { display: inline-block; transition: transform 0.5s var(--throw); }
.menu__list a:hover span { transform: translateX(0.5rem); }
.menu__list a:hover { color: var(--madder); }

.menu__list a em {
  font-family: var(--f-mono);
  font-style: normal;
  font-size: var(--t-meta);
  letter-spacing: 0.14em;
  color: var(--thread-4);
  transition: color 0.4s var(--throw);
}

.menu__list a:hover em { color: var(--madder); }

@media (max-width: 620px) { .menu__list a { grid-template-columns: 2.6rem 1fr; } }

.menu__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  opacity: 0;
}
