/* Messon Invest.
   The page never scrolls: wheel, touch and keys move a playhead. It arrives on white with the mark in metal,
   opens on a white room, turns black, then becomes the city and ends on the barcode.
   Without JavaScript the same content stacks as a plain page. */

:root {
  --white: #EDEAE4;
  --ink: #0E1115;
  --paper: #E4E3DF;
  --serif: 'Instrument Serif', 'Times New Roman', serif;
  --sans: 'Instrument Sans', 'Helvetica Neue', Arial, sans-serif;
  --pad: clamp(16px, 2.2vw, 32px);
  --text: #0E0F11;
  color-scheme: only light;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: #fff;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #fff;
  color: var(--text);
  font-family: var(--sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis: none;
}

::selection { background: var(--ink); color: #fff; }
h1, p { margin: 0; font-weight: inherit; }
a { color: inherit; }
:focus { outline: none; }
:focus-visible { outline: 1px solid currentColor; outline-offset: 6px; }

.sr {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- the film ---------- */

.film, .fallback {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.film { display: block; opacity: 0; transition: opacity .5s ease; }
.film.is-on { opacity: 1; }

/* Without WebGL: a white room, soft columns of light in a black one, and the pale morning of the finale. */
.fallback { display: none; }
.fallback i { position: absolute; inset: 0; }
.fallback__night {
  background:
    repeating-linear-gradient(90deg, rgba(150, 168, 196, 0) 0 5.2%, rgba(150, 168, 196, .16) 6.4%, rgba(150, 168, 196, 0) 7.6% 11%),
    radial-gradient(70% 55% at 50% 42%, #1a212c 0%, #0b0e13 58%, #05070a 100%);
  filter: blur(14px);
  inset: -4% !important;
}
.fallback__white { background: #fff; }
.fallback__pale { background: linear-gradient(180deg, #e9e8e4, var(--paper) 60%, #dcdbd6); opacity: 0; }
.no-gl .fallback { display: block; }
.no-gl .film { display: none; }

/* ---------- arrival ---------- */

.intro {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  color: #0E0F11;
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
}
.intro__l, .intro__r, .intro__mark { position: absolute; left: 0; top: 0; opacity: 0; white-space: nowrap; }
.intro__mark { fill: currentColor; }

.logo {
  position: fixed;
  z-index: 6;
  left: var(--pad);
  top: var(--pad);
  width: 22px; height: 22px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  cursor: pointer;
  opacity: 0;
}
.logo svg { display: block; width: 100%; height: 100%; fill: currentColor; }

/* ---------- type ---------- */

.hero { color: var(--text); }
.hero__name {
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 0.95;
  white-space: nowrap;
}
.hero__name .vis { display: inline-block; will-change: transform, opacity; }
.hero__name .ch { display: inline-block; will-change: transform, opacity; }
.hero__line {
  font-family: var(--sans);
  font-weight: 400;
  letter-spacing: -0.005em;
  line-height: 1.2;
  white-space: nowrap;
}
.hero__line .vis { display: inline-block; }

/* In the fog where the light lands: one sentence of what the company is. */
.thesis { color: var(--text); }
.thesis__head {
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  white-space: nowrap;
}
.thesis__head .vis { display: inline-block; }
.thesis__head .ch { display: inline-block; will-change: transform, opacity; }
.thesis__line {
  font-family: var(--sans);
  font-weight: 400;
  letter-spacing: -0.005em;
  line-height: 1.3;
}
.thesis__line .vis { display: inline-block; text-wrap: balance; }

.office { color: var(--text); }
.office__deg {
  font-family: var(--serif);
  text-transform: uppercase;
  letter-spacing: -0.005em;
  line-height: 1;
}
.office__deg .ch { display: inline-block; opacity: 0; }
.bl { display: inline-block; width: 0; height: 0; vertical-align: baseline; }
.office__place {
  font-family: var(--serif);
  font-style: italic;
  line-height: 1;
}
.office__place .vis { display: inline-block; opacity: 0; }
.office__mail {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.01em;
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  padding-bottom: 3px;
}
.office__mail:hover { background-size: 0 1px; background-position: 100% 100%; transition: background-size .5s cubic-bezier(.65, 0, .35, 1); }

.w { display: inline-block; white-space: nowrap; }
.sp { display: inline-block; width: 0.24em; }

/* ---------- reel and cue ---------- */

.reel {
  position: fixed;
  z-index: 5;
  right: var(--pad);
  bottom: var(--pad);
  display: flex;
  color: var(--text);
}
.reel button {
  appearance: none;
  -webkit-appearance: none;
  width: 22px; height: 24px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.reel button::before {
  content: '';
  width: 0; height: 8px;
  border-left: 1px solid currentColor;
  opacity: .55;
  transition: height .6s cubic-bezier(.22, 1, .36, 1), opacity .6s;
}
.reel button[aria-current="true"]::before { height: 16px; opacity: 1; }
.reel button:hover::before { opacity: 1; }

.cue {
  position: fixed;
  z-index: 5;
  left: 50%;
  bottom: calc(var(--pad) + 2px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text);
  opacity: 0;
  transition: opacity 1.2s ease;
  pointer-events: none;
}
.cue__label {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.02em;
  line-height: 1;
}
.cue__line {
  position: relative;
  width: 1px;
  height: 36px;
  overflow: hidden;
}
.cue__line::before { content: ''; position: absolute; inset: 0; background: currentColor; opacity: .16; }
.cue__line::after {
  content: '';
  position: absolute;
  left: 0; top: -40%;
  width: 1px; height: 40%;
  background: currentColor;
  animation: cue 2.4s cubic-bezier(.65, 0, .35, 1) infinite;
}
.cue.is-on { opacity: 1; }
/* the narrowest phones: the reel reaches the middle, so the cue sits above it */
@media (max-width: 359px) { .cue { bottom: calc(var(--pad) + 34px); } }
@keyframes cue { to { top: 100%; } }

/* Play: glides through the whole film to the address, where the mail then takes its place. */
.play {
  position: fixed;
  z-index: 6;
  left: var(--pad);
  bottom: calc(var(--pad) + 1px);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
}
.play__icon {
  width: 22px; height: 22px;
  border: 1px solid currentColor;
  border-radius: 50%;
  position: relative;
  opacity: .85;
  transition: transform .5s cubic-bezier(.22, 1, .36, 1);
}
.play__icon::before {
  content: '';
  position: absolute;
  left: 8px; top: 6px;
  border-left: 7px solid currentColor;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}
.play[data-state="pause"] .play__icon::before {
  left: 7px; top: 6px;
  width: 7px; height: 9px;
  border: 0;
  border-left: 2px solid currentColor;
  border-right: 2px solid currentColor;
  box-sizing: border-box;
}
.play:hover .play__icon { transform: scale(1.08); }

/* ---------- the code ---------- */

.code {
  position: fixed;
  z-index: 3;
  left: 0; top: 0;
  pointer-events: none;
  opacity: 0;
  forced-color-adjust: none;
}
.code rect { fill: var(--ink); }

/* ---------- JS mode ---------- */

.js, .js body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  touch-action: pinch-zoom;
}
.js .hero { position: fixed; inset: 0; z-index: 4; pointer-events: none; }
.js .hero > * { position: absolute; left: 0; top: 0; }
.js .hero__name .ch { opacity: 0; }
.js .hero__line .vis { opacity: 0; }
.js .thesis { position: fixed; inset: 0; z-index: 4; pointer-events: none; }
.js .thesis > * { position: absolute; left: 0; top: 0; }
.js .thesis__head .ch { opacity: 0; }
.js .thesis__line .vis { opacity: 0; }
.js .office { position: fixed; inset: 0; z-index: 4; pointer-events: none; }
.js .office.is-on { pointer-events: auto; }
.js .office > * { position: absolute; left: 0; top: 0; white-space: nowrap; }
.js .office__mail { opacity: 0; transition: opacity .8s ease; }
.js .office.is-on .office__mail, .js .office__mail:focus-visible { opacity: 1; }
.js:not(.ready) .hero, .js:not(.ready) .thesis, .js:not(.ready) .office, .js:not(.ready) .intro { visibility: hidden; }
.reduce .cue__line::after { animation: none; top: 30%; }

/* ---------- no JS: a plain stacked page ---------- */

html:not(.js) .film, html:not(.js) .intro, html:not(.js) .logo, html:not(.js) .play { display: none; }
html:not(.js) .hero { position: relative; z-index: 2; padding: 30vh var(--pad) 0; }
html:not(.js) .hero__name { font-size: clamp(48px, 11vw, 160px); white-space: normal; }
html:not(.js) .hero__line { font-size: clamp(14px, 3.6vw, 18px); margin-top: 18px; white-space: normal; }
html:not(.js) main { position: relative; z-index: 2; padding: 30vh var(--pad) 12vh; }
html:not(.js) .thesis__head { font-size: clamp(30px, 6vw, 72px); white-space: normal; }
html:not(.js) .thesis__line { font-size: clamp(14px, 3.6vw, 18px); margin-top: 14px; }
html:not(.js) .office { margin-top: 24vh; }
html:not(.js) .office__deg { font-size: clamp(80px, 22vw, 320px); }
html:not(.js) .office__place { font-size: clamp(28px, 4vw, 56px); margin: 12px 0 28px; }
html:not(.js) .reel, html:not(.js) .code, html:not(.js) .cue { display: none; }

@media (forced-colors: active) {
  .film, .fallback, .cue { display: none; }
  .code { background: #fff; }
  .code rect { fill: #000; }
}
