/* ==========================================================================
   chrome — boot screen, top bar, menu
   ==========================================================================

   Same house rule as the rest of the studio's builds: hover and state changes
   animate transform, opacity and colour. Never padding, width, height or
   margin. The one exception on this site is `font-variation-settings`, which
   is not compositable and does relayout — but that IS the subject here, so it
   is spent deliberately and only where the reader is looking.
   ========================================================================== */

/* ── boot ──────────────────────────────────────────────────────────────── */

.boot {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
  background: var(--paper);
  padding: var(--gut);
}

.boot__inner {
  align-self: center;
  display: grid;
  justify-items: center;
  gap: 0.4rem;
}

.boot__rule {
  display: block;
  width: min(58vw, 620px);
  height: var(--rule);
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
}

/* The wordmark loads by gaining weight and width — the axes are the thing
   being loaded, so the progress indicator may as well be made of them. */
.boot__word {
  font-size: clamp(2.6rem, 11vw, 9rem);
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-variation-settings: "wght" 100, "wdth" 75;
}

.boot__deva {
  font-family: var(--f-deva);
  font-size: clamp(1rem, 3vw, 2rem);
  line-height: 1;
  color: var(--blue);
  font-variation-settings: "wght" 400, "wdth" 100;
  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.9rem, 2.2vh, 1.5rem) var(--gut);
  color: var(--ink);
  transition: color 0.45s var(--ease);
}

.bar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom,
    var(--paper) 0%, rgba(240, 239, 233, 0.9) 55%, rgba(240, 239, 233, 0) 100%);
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}

.bar.is-stuck::before { opacity: 1; }

/* The case section is near-black and full-bleed. Without this the bar goes
   dark-on-dark and simply vanishes for a whole screen. */
.bar.is-inverted { color: var(--on-ink); }
.bar.is-inverted .bar__rule { background: var(--on-ink); }
.bar.is-inverted .bar__state { color: var(--on-ink-3); }
.bar.is-inverted .menubtn__rules b { background: var(--on-ink); }
.bar.is-inverted::before {
  background: linear-gradient(to bottom,
    var(--ink) 0%, rgba(18, 18, 15, 0.9) 55%, rgba(18, 18, 15, 0) 100%);
}

/* The mark is the device: a name hanging from its own matra. */
.bar__mark {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 0.55em;
  padding-top: 0.4em;
}

.bar__rule {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: var(--rule);
  background: var(--ink);
  transform: scaleX(1);
  transform-origin: left;
  transition: transform 0.6s var(--ease), background-color 0.45s var(--ease);
}

.bar__mark:hover .bar__rule { transform: scaleX(0.55); }

.bar__name {
  font-size: 1.02rem;
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-variation-settings: "wght" 700, "wdth" 108;
}

.bar__deva {
  font-family: var(--f-deva);
  font-size: 0.86rem;
  line-height: 1;
  color: var(--blue);
  font-variation-settings: "wght" 500;
}

.bar__state { display: none; }
@media (min-width: 900px) { .bar__state { display: block; } }

.menubtn { display: inline-flex; align-items: center; gap: 0.75em; }

.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
   set 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.55s var(--ease);
}

.menubtn__label i:last-child { position: absolute; top: 100%; right: 0; }
body.menu-open .menubtn__label i { transform: translateY(-100%); }

/* Two rules that become one — the matra closing up. */
.menubtn__rules { display: grid; gap: 5px; width: 22px; }

.menubtn__rules b {
  display: block;
  height: var(--rule);
  background: var(--ink);
  transform-origin: right;
  transition: transform 0.55s var(--ease-back);
}

.menubtn__rules b:nth-child(2) { transform: scaleX(0.55); }
.menubtn:hover .menubtn__rules b:nth-child(2) { transform: scaleX(1); }

body.menu-open .menubtn__rules b:nth-child(1) { transform: translateY(3.5px) scaleX(1); }
body.menu-open .menubtn__rules b:nth-child(2) { transform: translateY(-3.5px) scaleX(1); }

/* ── 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; }

/* The sheet is a single plane that wipes down from the top — a sheet of
   paper being laid over the page, which is the only motion a print-led site
   should be using for a full-screen overlay. */
.menu__sheet {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--paper-2);
  border-bottom: var(--rule) solid var(--ink);
  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 auto;
  align-items: baseline;
  gap: 1rem;
  padding: clamp(0.5rem, 1.7vh, 0.95rem) 0;
  font-size: clamp(1.9rem, 7vw, 5.2rem);
  line-height: 1.02;
  text-transform: uppercase;
  font-variation-settings: "wght" 600, "wdth" 108;
  transform: translateY(115%);
  transition: color 0.4s var(--ease), font-variation-settings 0.45s var(--ease);
}

/* The label slides; the index number stays put. The anchor's own 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(--ease); }
.menu__list a:hover span { transform: translateX(0.5rem); }
.menu__list a:hover { color: var(--blue); font-variation-settings: "wght" 800, "wdth" 118; }

.menu__list a em {
  font-family: var(--f-mono);
  font-style: normal;
  font-size: var(--t-meta);
  letter-spacing: 0.14em;
  color: var(--ink-4);
  transition: color 0.4s var(--ease);
}

.menu__list a:hover em { color: var(--blue); }

.menu__deva {
  font-family: var(--f-deva);
  font-size: clamp(0.85rem, 1.5vw, 1.1rem);
  font-weight: 400;
  font-variation-settings: "wght" 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-4);
  transition: color 0.4s var(--ease);
}

.menu__list a:hover .menu__deva { color: var(--blue-2); }

@media (max-width: 620px) {
  .menu__list a { grid-template-columns: 2.6rem 1fr; }
  .menu__deva { display: none; }
}

.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;
}
