@font-face {
  font-family: "Bricolage";
  src: url("fonts/bricolage-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face {
  font-family: "YY Mono";
  src: url("fonts/YYMono-Regular.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "YY Mono";
  src: url("fonts/YYMono-SemiBold.otf") format("opentype");
  font-weight: 600;
  font-display: swap;
}

/* baeYYond's three inks. Ultra is the highlighter and the one accent: a stroke
   under a word, or a line in a picture. It never carries text on charcoal. */
:root {
  --charcoal: #0B0B0E;
  --gesso: #F2EEE6;
  --ultra: #2533D6;
  --gesso-80: rgba(242, 238, 230, .80);
  --gesso-64: rgba(242, 238, 230, .64);
  --pad: clamp(20px, 4.6vw, 76px);
  --mono: "YY Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --stroke: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 20' preserveAspectRatio='none'%3E%3Cpath fill='%232533D6' d='M0.9 4C30 4.7 66 3.7 97.7 2.3C99.3 7.3 98.9 12.9 97.1 17.9C66 18.6 32 17.4 1.7 16C-0.3 11-0.5 9 0.9 4Z'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.sheet-open { overflow: hidden; }

body {
  margin: 0;
  background: var(--gesso);
  color: var(--charcoal);
  font-family: "Bricolage", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: clamp(1.04rem, 0.45vw + 0.94rem, 1.24rem);
  line-height: 1.42;
  overflow-x: hidden;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  touch-action: pan-y;
}
.no-gl #scene, .no-gl #notes { display: none; }

/* The highlighter: an ink stroke under a word, the word set on it in gesso. */
.hl { position: relative; z-index: 0; margin: 0 0.08em; color: var(--gesso); white-space: nowrap; }
.hl::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0.04em -0.1em -0.02em;
  background: var(--stroke) center / 100% 100% no-repeat;
}

/* Sender and addressee. Each rides over a moving picture, so each carries its own ground. */
.mast {
  position: fixed;
  z-index: 4;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: clamp(14px, 2vw, 26px) var(--pad);
  pointer-events: none;
}
.mast .home { display: block; background: var(--charcoal); padding: 13px 16px; line-height: 0; }
.mast .home img { display: block; width: 150px; height: auto; }
.mast .for {
  background: var(--charcoal);
  color: var(--gesso);
  padding: 0.62em 0.9em 0.66em;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.2;
}

main { position: relative; z-index: 3; pointer-events: none; }
main a, main button { pointer-events: auto; }

/* Opening */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 16vh var(--pad) var(--pad);
}
.hero .copy { max-width: min(45vw, 43rem); }

h1, h2 { font-kerning: none; text-wrap: balance; }
h1 {
  margin: 0 0 0.42em;
  font-stretch: 86%;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: clamp(2.5rem, 4.7vw, 5.8rem);
  line-height: 0.96;
}
.lede { margin: 0 0 1.6em; max-width: 26em; font-weight: 450; }

.go, .ctl {
  display: inline-flex;
  align-items: center;
  min-height: 50px;
  padding: 0 1.4em;
  border: 0;
  background: var(--charcoal);
  color: var(--gesso);
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
}
.go:hover, .ctl:hover { text-decoration: underline; text-underline-offset: 0.28em; }
.go:focus-visible, .ctl:focus-visible, .note:focus-visible, .part:focus-visible {
  outline: 3px solid var(--gesso);
  outline-offset: 3px;
  box-shadow: 0 0 0 7px var(--charcoal);
}

/* Still: stops everything that moves by itself. Move starts it again. */
.hands {
  position: fixed;
  z-index: 4;
  right: var(--pad);
  bottom: clamp(16px, 2.4vw, 30px);
  display: none;
}
.gl .hands { display: block; }
.at-plan .hands, .sheet-open .hands { display: none; }
.ctl { min-height: 44px; padding: 0 1.1em; font-size: 0.82rem; background: var(--gesso); color: var(--charcoal); }
.ctl[aria-pressed="true"] { background: var(--charcoal); color: var(--gesso); }

/* Notes pinned to things in the scene. The ones that name a part are buttons. */
.note {
  position: fixed;
  left: 0; top: 0;
  z-index: 2;
  margin: 0;
  padding: 0.55em 0.9em 0.6em;
  border: 0;
  background: var(--charcoal);
  color: var(--gesso);
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.78rem;
  line-height: 1.3;
  text-align: left;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0s 0.35s;
  will-change: transform, opacity;
}
.note.on { opacity: 1; visibility: visible; transition: opacity 0.35s ease; }
.note::after {
  content: "";
  position: absolute;
  left: 0; top: 100%;
  width: 1px; height: var(--lead, 22px);
  background: var(--charcoal);
}
.note b { display: block; font-weight: 600; }
div.note { background: var(--gesso); color: var(--charcoal); }
div.note::after { background: var(--gesso); }
button.note { cursor: pointer; min-height: 44px; padding-right: 2.5em; }
button.note.on { pointer-events: auto; }
button.note::before {
  content: "";
  position: absolute;
  right: 0.9em; top: 50%;
  width: 0.72em; height: 0.72em;
  margin-top: -0.36em;
  background:
    linear-gradient(var(--gesso), var(--gesso)) center / 100% 2px no-repeat,
    linear-gradient(var(--gesso), var(--gesso)) center / 2px 100% no-repeat;
}
button.note:hover, button.note:focus-visible { background: var(--ultra); }

/* Each stage of the climb. Without the scene these are plain sections; with it,
   each is a stretch of scroll and its words hold still while the camera arrives.
   A waiting caption is only transparent, so it stays in the reading order. */
.beat { padding: 10vh var(--pad); }
.beat .copy { max-width: 27rem; }
.js .beat { min-height: 150vh; padding: 0; }
.js .beat .copy {
  position: fixed;
  left: var(--pad);
  bottom: clamp(40px, 9vh, 96px);
  padding: 26px 30px 12px;
  background: var(--charcoal);
  color: var(--gesso);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.35s ease, transform 0.55s var(--ease);
}
.js .beat.on .copy { opacity: 1; transform: none; }
.js.no-gl .beat { min-height: 0; padding: 10vh var(--pad); }
.js.no-gl .beat .copy {
  position: static;
  opacity: 1;
  transform: none;
  padding: 0;
  background: none;
  color: inherit;
}
h2 {
  margin: 0 0 0.45em;
  font-stretch: 90%;
  font-weight: 700;
  letter-spacing: -0.025em;
  font-size: clamp(1.7rem, 2.3vw, 2.8rem);
  line-height: 1.02;
}
.beat p { margin: 0 0 1em; font-weight: 420; }
.beat .say, .beat .pick { font-family: var(--mono); font-size: 0.8rem; line-height: 1.35; }
.beat .say { color: var(--gesso-64); }
.no-gl .beat .say { color: inherit; }
.no-gl .beat .pick { display: none; }

/* The plan, on solid ground at the end */
.plan {
  position: relative;
  background: var(--charcoal);
  color: var(--gesso);
  pointer-events: auto;
  padding: clamp(64px, 12vh, 140px) var(--pad) clamp(48px, 8vh, 96px);
}
.plan .inner { max-width: 62rem; }
.plan h2 { font-size: clamp(2.2rem, 3.8vw, 4.6rem); margin-bottom: 0.9em; }
.stages { list-style: none; margin: 0 0 2.2em; padding: 0; }
.stages li {
  display: grid;
  grid-template-columns: 9.5em 1fr 1.6fr;
  gap: 0.4em 2em;
  padding: 0.95em 0;
}
.stages .when { font-family: var(--mono); font-size: 0.82rem; padding-top: 0.3em; color: var(--gesso-80); }
.stages b { font-stretch: 92%; font-weight: 650; font-size: 1.2em; }
.way { margin: 0 0 4em; font-family: var(--mono); font-size: 0.86rem; color: var(--gesso-80); }
.plan h3 { margin: 0 0 0.7em; font-stretch: 90%; font-weight: 700; letter-spacing: -0.02em; font-size: clamp(1.5rem, 2vw, 2.3rem); line-height: 1.05; }
.parts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 3em; max-width: 54rem; }
.part {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1em;
  width: 100%;
  min-height: 48px;
  padding: 0.5em 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  font-size: 1.1em;
  text-align: left;
  cursor: pointer;
}
.part span { position: relative; z-index: 0; }
.part span::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -0.04em -0.3em;
  background: var(--stroke) center / 100% 100% no-repeat;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.part:hover span::before, .part:focus-visible span::before { opacity: 1; }
.part em { font-style: normal; font-family: var(--mono); font-weight: 400; font-size: 0.76rem; color: var(--gesso-64); white-space: nowrap; }

/* The foot takes the other ground. */
.foot {
  position: relative;
  background: var(--gesso);
  color: var(--charcoal);
  pointer-events: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2em;
  padding: clamp(40px, 7vh, 80px) var(--pad);
}
.foot img { display: block; width: 190px; height: auto; margin-bottom: 1.1em; }
.foot p { margin: 0; font-family: var(--mono); font-size: 0.86rem; }
.foot .tag { font-family: inherit; font-stretch: 86%; font-weight: 700; letter-spacing: -0.03em; font-size: clamp(1.9rem, 3.2vw, 3.6rem); line-height: 1; }

/* What changes: one part of the business, the way its work moves today and the way it will. */
.sheet {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  padding: 0;
  background: var(--charcoal);
  color: var(--gesso);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.sheet::backdrop { background: var(--charcoal); }
.sheet-in {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 3.6vh, 44px);
  padding: clamp(18px, 2.4vw, 32px) var(--pad) clamp(22px, 4vh, 44px);
}
.sheet-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5em; }
.sheet .kicker { margin: 0 0 0.6em; font-family: var(--mono); font-size: 0.82rem; color: var(--gesso-64); }
.sheet h2 { margin: 0; font-size: clamp(2rem, 3.8vw, 4.4rem); }
.sheet h2:focus { outline: none; }
.lanes { display: grid; gap: clamp(26px, 5vh, 60px); flex: 1; align-content: center; }
.lane h3 { margin: 0 0 1.2em; font-family: var(--mono); font-weight: 400; font-size: 0.86rem; color: var(--gesso-64); }
.lane.after h3 { color: var(--gesso); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.step { position: relative; padding: 28px 1.5em 0 0; opacity: 0.66; transition: opacity 0.4s var(--ease); }
.step.on { opacity: 1; }
.step::before { content: ""; position: absolute; left: 0; top: 0; width: 13px; height: 13px; background: var(--charcoal); box-shadow: inset 0 0 0 2px var(--gesso); transition: background 0.3s ease; }
.step.on::before { background: var(--gesso); }
.step .seg { position: absolute; left: 13px; right: 0; top: 5px; height: 3px; background: rgba(242, 238, 230, 0.2); }
.step .seg i { position: absolute; inset: 0; background: var(--gesso); transform-origin: left center; transform: scaleX(0); transition: transform var(--hop, 0.6s) linear; }
.step.run .seg i { transform: scaleX(1); }
.sheet.reset .step, .sheet.reset .step::before, .sheet.reset .seg i, .sheet.reset .by { transition: none; }
.after .step .seg { top: 3px; height: 7px; }
.after .step .seg i { background: var(--ultra); }
.step:last-child .seg { display: none; }
.step .with { display: block; margin-bottom: 0.35em; font-family: var(--mono); font-size: 0.76rem; color: var(--gesso-64); }
.step .does { display: block; max-width: 15em; font-weight: 500; line-height: 1.22; }
.step .by { display: block; margin-top: 0.55em; font-family: var(--mono); font-size: 0.76rem; color: var(--gesso-64); opacity: 0; transition: opacity 0.3s ease; }
.step.on .by { opacity: 1; }
.lane .code { margin: 1.4em 0 0; font-family: var(--mono); font-size: 0.86rem; color: var(--gesso-80); opacity: 0; transition: opacity 0.5s ease; }
.lane.done .code { opacity: 1; }
.diff {
  margin: 0;
  max-width: 24em;
  font-stretch: 90%;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: clamp(1.45rem, 2.5vw, 2.9rem);
  line-height: 1.08;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.sheet.told .diff { opacity: 1; transform: none; }
.sheet-nav { display: flex; flex-wrap: wrap; gap: 10px; }

/* The words are there at once. Only the scene waits to be drawn. */
@keyframes rise { from { opacity: 0; transform: translateY(0.5em); } }
.hero h1, .hero .lede, .hero .go { animation: rise 0.9s var(--ease) both; }
.hero .lede { animation-delay: 0.1s; }
.hero .go { animation-delay: 0.2s; }
.js #scene, .js #notes { opacity: 0; transition: opacity 1.4s ease; }
.js.ready #scene, .js.ready #notes { opacity: 1; }

/* Check pictures only */
.held .hero .copy { visibility: hidden; }
.only-plan #journey { display: none; }
.pic #scene, .pic #notes, .pic .beat .copy, .pic .note, .pic .step, .pic .step::before, .pic .seg i, .pic .step .by, .pic .code, .pic .diff { transition: none !important; }
.pic .hero h1, .pic .hero .lede, .pic .hero .go { animation: none; }

@media (max-width: 760px) {
  .hero { align-items: flex-end; padding: 0; }
  .hero .copy { max-width: none; width: 100%; padding: 22px var(--pad) max(22px, env(safe-area-inset-bottom)); }
  .gl .hero .copy { background: var(--charcoal); color: var(--gesso); }
  .gl .hero .go { background: var(--gesso); color: var(--charcoal); }
  h1 { font-size: clamp(2.2rem, 10vw, 3.3rem); }
  .lede { margin-bottom: 1.2em; }
  .beat .copy { max-width: none; }
  .js .beat .copy {
    left: 0; right: 0; bottom: 0;
    padding: 20px var(--pad) max(16px, env(safe-area-inset-bottom));
  }
  .hands { top: 72px; bottom: auto; left: var(--pad); right: auto; }
  .stages li { grid-template-columns: 1fr; gap: 0.15em; }
  .parts { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .step { padding: 0 0 22px 30px; }
  .step .seg { left: 5px; right: auto; top: 13px; bottom: 0; width: 3px; height: auto; }
  .after .step .seg { left: 3px; top: 13px; width: 7px; height: auto; }
  .step .seg i { transform-origin: center top; transform: scaleY(0); }
  .step.run .seg i { transform: scaleY(1); }
  .step .does { max-width: none; }
  .lanes { align-content: start; }
}
/* Below this width the mark stands in for the lockup, as on baeYYond's own pages. */
@media (max-width: 559px) {
  .mast .home { padding: 10px 12px; }
  .mast .home img { width: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero h1, .hero .lede, .hero .go { animation: none; }
  .js #scene, .js #notes, .note, .note.on { transition: none; }
  .js .beat .copy { transition: none; transform: none; }
  .step, .step::before, .step .seg i, .step .by, .lane .code, .diff, .part span::before { transition: none; }
  .diff { transform: none; }
  .gl .hands { display: none; }
}
