/* Base, preloader, header, hero and showcase. */

@font-face {
  font-family: "JetBrains Mono";
  src: url("./assets/fonts/JetBrainsMono-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --black: #050505;
  --lime: #d2fc52;
  --ink: #080a04;
  --ink-soft: #3e4436;
  --text: #deded6;
  --muted: #a4a69e;
  --paper: #eef0e8;
  --ease: cubic-bezier(0.83, 0, 0.17, 1);
  --mono: "JetBrains Mono", monospace;
  --composition-scale: 1;
  --hero-composition-top: 0px;
  --content-scale: 1;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--black);
  scrollbar-width: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
}

html.model-loading {
  overflow: hidden;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--black);
  color: var(--text);
  font: 500 14px/1.6 var(--mono);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  border-radius: 0;
  background: none;
  padding: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p,
ul,
ol,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

[hidden] {
  display: none !important;
}

/* Scrambling text swaps one glyph per cell; ligatures such as => would merge two of them. */
[data-line] {
  font-variant-ligatures: none;
}

:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 5px;
}

/* ---------------------------------------------------------------------------------------------
   Preloader
   --------------------------------------------------------------------------------------------- */

.preloader {
  --load-progress: 0;
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--black);
  color: var(--lime);
  touch-action: none;
  opacity: 1;
}

.preloader[data-state="leaving"] {
  opacity: 0;
  transition: opacity 550ms ease;
}

.preloader-counter {
  display: flex;
  align-items: baseline;
  gap: 0.08em;
  font: 500 clamp(96px, 22vw, 360px) / 1 var(--mono);
  letter-spacing: -0.07em;
}

.preloader-number {
  min-width: 3ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.preloader-percent {
  font-size: 0.28em;
  letter-spacing: -0.04em;
}

.preloader-bar {
  position: absolute;
  left: 48px;
  right: 48px;
  bottom: 48px;
  height: 4px;
  background: #d2fc5229;
}

.preloader-bar span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--lime);
  transform: scaleX(var(--load-progress));
  transform-origin: left center;
}

.preloader-error {
  position: absolute;
  top: 68%;
  left: 0;
  right: 0;
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 0 20px;
  text-align: center;
  font: 500 14px/1.5 var(--mono);
}

.preloader-retry {
  border: 1px solid var(--lime);
  padding: 12px 20px;
  background: var(--lime);
  color: #000;
  font: 500 14px/1.5 var(--mono);
}

/* ---------------------------------------------------------------------------------------------
   Header
   --------------------------------------------------------------------------------------------- */

.site-header {
  position: fixed;
  top: 48px;
  left: 48px;
  right: 48px;
  z-index: 8;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  height: 56px;
  pointer-events: none;
}

.site-header > * {
  pointer-events: auto;
}

.site-logo {
  justify-self: start;
  display: block;
  width: 187px;
  height: 56px;
}

.site-logo img {
  width: 187px;
  height: 56px;
  transition: filter 250ms ease;
}

.site-logo.is-on-light img {
  filter: brightness(0);
}

.menu-button {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 320px;
  height: 56px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(40px);
  backdrop-filter: blur(40px);
  color: #fff;
  font: 500 14px/1.4 var(--mono);
  transition: background-color 250ms ease, color 250ms ease;
}

.menu-button:hover {
  background: rgba(255, 255, 255, 0.14);
}

.menu-button.is-on-light {
  background: #0505050d;
  color: #050505;
}

.menu-button.is-on-light:hover {
  background: #0505051a;
}

.site-header .is-on-light:focus-visible {
  outline-color: #050505;
}

.menu-icon {
  position: relative;
  display: block;
  width: 32px;
  height: 24px;
}

.menu-icon i {
  position: absolute;
  left: 0;
  width: 32px;
  height: 2px;
  background: currentColor;
}

.menu-icon i:first-child {
  top: 7px;
}

.menu-icon i:last-child {
  top: 17px;
}

.cta {
  --cta-fill: var(--lime);
  --cta-text: #050505;
  position: relative;
  grid-column: 2;
  display: flex;
  align-items: stretch;
  gap: 6px;
  height: 56px;
  color: var(--cta-text);
  font: 500 14px/1.4 var(--mono);
  text-transform: uppercase;
  white-space: nowrap;
}

.cta.is-on-light {
  --cta-fill: #050505;
  --cta-text: var(--lime);
}

.cta-plus,
.cta-label {
  display: grid;
  place-items: center;
  height: 56px;
  background: var(--cta-fill);
  transition: transform 700ms var(--ease), background-color 250ms ease, color 250ms ease;
}

.cta-plus {
  flex: none;
  width: 56px;
}

.cta-plus svg {
  width: 0.75em;
  height: 0.75em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: square;
}

.cta-plus-start {
  transform: rotate(-45deg) scale(0);
  transform-origin: left center;
}

.cta-label {
  padding: 0 16px;
  transform: translateX(-62px);
}

.cta-plus-end {
  position: absolute;
  top: 0;
  right: 0;
  transform-origin: right center;
}

.cta:hover .cta-plus-start,
.cta:focus-visible .cta-plus-start {
  transform: rotate(0deg) scale(1);
}

.cta:hover .cta-label,
.cta:focus-visible .cta-label {
  transform: translateX(0);
}

.cta:hover .cta-plus-end,
.cta:focus-visible .cta-plus-end {
  transform: rotate(-45deg) scale(0);
}

/* ---------------------------------------------------------------------------------------------
   Hero
   --------------------------------------------------------------------------------------------- */

.journey {
  position: relative;
  height: 920svh;
}

.hero {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  background: var(--black);
}

.composition {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 2;
  width: 1600px;
  height: 1000px;
  transform: translateX(-50%) scale(var(--composition-scale));
  transform-origin: center bottom;
  pointer-events: none;
}

#composition {
  top: var(--hero-composition-top);
  bottom: auto;
  transform-origin: center top;
}

.hero-heading {
  position: absolute;
  top: 490px;
  left: 50%;
  width: 1400px;
  transform: translate(-50%, -50%);
  text-align: center;
  font: 500 25.6px/1.45 var(--mono);
  color: #050505;
}

.hero-heading.is-gone {
  visibility: hidden;
}

.hero-row {
  display: block;
}

.hero-row-mobile {
  display: none;
}

.hero-strip {
  display: inline-block;
  padding: 0 7px;
  background: #d2fc52;
  white-space: pre;
  pointer-events: auto;
}

.model-frame {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--black);
}

.model-stage {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform-origin: top left;
  touch-action: pan-y;
}

.hero.is-revealing .model-frame,
.hero.is-revealing .model-stage {
  will-change: transform;
}

.model-stage[data-cursor="pointer"] {
  cursor: pointer;
}

.model-stage[data-cursor="grab"] {
  cursor: grab;
}

.model-stage[data-cursor="grabbing"] {
  cursor: grabbing;
}

#architecture {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 800ms ease;
}

.hero[data-ready="true"] #architecture {
  opacity: 1;
}

/* ---------------------------------------------------------------------------------------------
   Guide speech
   --------------------------------------------------------------------------------------------- */

.guide-speech {
  --pointer-x: 50%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  max-width: min(320px, 100% - 40px);
  padding: 11px 15px;
  background: var(--lime);
  color: #050505;
  font: 500 14px/1.5 var(--mono);
  text-align: center;
  pointer-events: none;
  opacity: 0;
  translate: 0 8px;
}

.guide-speech::before {
  content: "";
  position: absolute;
  top: -5px;
  left: var(--pointer-x);
  width: 10px;
  height: 10px;
  margin-left: -5px;
  background: var(--lime);
  transform: rotate(45deg);
}

.guide-speech-text {
  position: relative;
}

.guide-speech[data-state="hidden"] {
  visibility: hidden;
}

.guide-speech[data-state="visible"] {
  opacity: 1;
  translate: 0 0;
  transition: opacity 480ms cubic-bezier(0.22, 1, 0.36, 1), translate 480ms cubic-bezier(0.22, 1, 0.36, 1);
}

.guide-speech[data-state="leaving"] {
  opacity: 0;
  translate: 0 -6px;
  transition: opacity 340ms ease-in-out, translate 340ms ease-in-out;
}

/* ---------------------------------------------------------------------------------------------
   Showcase (laid out on the 1600 × 1000 artboard)
   --------------------------------------------------------------------------------------------- */

.showcase-background {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--lime);
}

.showcase-background::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, #fff 1.2px, transparent 1.5px);
  background-size: 12px 12px;
  opacity: 0.28;
  animation: showcase-drift 18s linear infinite paused;
}

.hero.is-revealing .showcase-background::after {
  animation-play-state: running;
}

@keyframes showcase-drift {
  to {
    background-position: 12px 12px;
  }
}

.showcase-layout {
  --showcase-copy: 0;
  color: var(--ink);
  font: 500 14px/1.6 var(--mono);
}

.showcase-copy {
  opacity: var(--showcase-copy);
  translate: 0 calc((1 - var(--showcase-copy)) * 24px);
}

.showcase-model-anchor {
  position: absolute;
  left: 580px;
  top: 280px;
  width: 440px;
  height: 440px;
}

.showcase-intro {
  position: absolute;
  left: 100px;
  top: 360px;
  width: 350px;
}

.showcase-eyebrow {
  margin-bottom: 16px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.showcase-title {
  font: 500 32px/1.25 var(--mono);
  letter-spacing: -0.04em;
}

.showcase-title [data-line] {
  display: block;
  width: fit-content;
  white-space: pre;
}

.showcase-description {
  position: absolute;
  left: 100px;
  bottom: 280px;
  width: 350px;
}

.showcase-facts {
  position: absolute;
  left: 1110px;
  top: 500px;
  width: 370px;
  transform: translateY(-50%);
}

.showcase-fact {
  padding: 18px 0 20px;
}

.showcase-fact + .showcase-fact {
  border-top: 1px solid #080a0424;
}

.showcase-fact h3 {
  width: fit-content;
  font: 500 22px/1.2 var(--mono);
  letter-spacing: -0.04em;
  white-space: pre;
}

.showcase-fact p {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.5;
}

.showcase-caption {
  position: absolute;
  left: 580px;
  top: 736px;
  width: 440px;
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  text-transform: uppercase;
}

.showcase-layout.is-visible .showcase-title [data-line],
.showcase-layout.is-visible .showcase-fact h3 {
  pointer-events: auto;
}

.mobile-showcase-details {
  display: none;
}

/* ---------------------------------------------------------------------------------------------
   Reduced motion
   --------------------------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .preloader[data-state="leaving"],
  #architecture,
  .cta-plus,
  .cta-label,
  .site-logo img,
  .menu-button,
  .guide-speech[data-state="visible"],
  .guide-speech[data-state="leaving"] {
    transition: none;
  }

  .showcase-background::after {
    animation: none;
  }
}
