@font-face {
  font-family: "HelveticaNeueBd";
  src: url("/assets/fonts/HelveticaNeueLTStd-Bd.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SpaceGroteskBold";
  src: url("/assets/fonts/SpaceGrotesk-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

html,
body {
  width: 100%;
  height: 100%;
}

body.home-page {
  margin: 0;
  overflow: hidden;
}

body.home-page #app {
  display: block;
  width: 100%;
  height: 100%;
  padding: var(--page-margin);
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}

body.home-page #nav {
  position: fixed;
  top: var(--page-margin);
  left: var(--page-margin);
  right: var(--page-margin);
  width: auto;
  z-index: 30;
}

#home-main {
  position: fixed;
  top: var(--page-margin);
  right: var(--page-margin);
  bottom: var(--page-margin);
  left: var(--page-margin);
  width: auto;
  height: auto;
}

#lissajous-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

/* -----------------------------
   CUSTOM FIRST LOAD LOADER
------------------------------ */

#home-loader {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 200000;
  pointer-events: none;
  overflow: hidden;
}

#home-loader.is-hidden {
  display: none;
}

#home-loader-mark {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  display: inline-flex;
  align-items: flex-end;
  color: #000;
  white-space: nowrap;
  font-family: "SpaceGroteskBold", "HelveticaNeueBd", "HelveticaNeueHv", Helvetica, Arial, sans-serif;
  font-size: clamp(56px, 7vw, 96px);
  line-height: 0.82;
  letter-spacing: -0.05em;
  text-transform: none;
  opacity: 1;
}

#home-loader-mark.is-fading {
  opacity: 0;
  transition: opacity 760ms ease;
}

.loader-letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(8px);
}

.loader-letter.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 110ms linear,
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.loader-period {
  display: inline-block;
  width: 0.10em;
  height: 0.10em;
  margin-left: 0.05em;
  margin-bottom: 0.052em;
  background: currentColor;
  flex: 0 0 auto;
  opacity: 0;
  transform: translateY(8px);
}

.loader-period.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 110ms linear,
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

#home-loader-swipe {
  position: absolute;
  inset: auto 0 0 0;
  height: 0%;
  background: #000;
  z-index: 3;
}

#home-loader.is-swiping #home-loader-swipe {
  animation: homeLoaderSwipeUp 980ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes homeLoaderSwipeUp {
  from {
    height: 0%;
  }
  to {
    height: 100%;
  }
}

/* -----------------------------
   POST-LOADER REVEAL
------------------------------ */

body.home-reveal-sequence #lissajous-layer {
  opacity: 0;
  will-change: opacity;
}

body.home-reveal-sequence .reveal-burst-node {
  opacity: 0;
}

body.home-reveal-sequence.home-reveal-ready #lissajous-layer {
  opacity: 1;
  transition: opacity 2200ms ease;
  transition-delay: 120ms;
}

.nav-reveal-chunk {
  transition: opacity 700ms ease;
}

.nav-reveal-chunk.is-visible {
  opacity: 1 !important;
}

.wordmark-typed-char {
  display: inline-block;
  opacity: 1;
}

body.home-reveal-sequence .wordmark-typed-char {
  transform: translateY(8px);
}

.wordmark-typed-char.is-visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
  transition:
    opacity 110ms linear,
    transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.home-reveal-sequence #home-wordmark-desktop .wordmark-desktop-period,
body.home-reveal-sequence #home-wordmark-mobile .wordmark-mobile-period {
  transform: translateY(8px);
}

body.home-reveal-sequence #home-wordmark-desktop .wordmark-desktop-period.is-visible,
body.home-reveal-sequence #home-wordmark-mobile .wordmark-mobile-period.is-visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
  transition:
    opacity 110ms linear,
    transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* -----------------------------
   DESKTOP LANDING
------------------------------ */

#desktop-nav-links {
  display: inline-flex;
  align-items: center;
  gap: 0;
  position: relative;
  z-index: 40;
}

.desktop-nav-link,
.desktop-nav-slash {
  font-family: "HelveticaNeueRoman", Helvetica, Arial, sans-serif;
  font-size: 18px;
  line-height: 1;
  text-transform: uppercase;
  color: var(--fg);
  text-decoration: none;
}

.desktop-nav-link {
  opacity: 1;
  transition: color 220ms ease, opacity 220ms ease;
}

.desktop-nav-link:hover,
.desktop-nav-link:focus-visible {
  opacity: 1;
  outline: none;
}

html.dark-mode #desktop-nav-links .desktop-nav-link:hover,
html.dark-mode #desktop-nav-links .desktop-nav-link:focus-visible {
  color: rgba(255, 255, 255, 0.42);
}

html:not(.dark-mode) #desktop-nav-links .desktop-nav-link:hover,
html:not(.dark-mode) #desktop-nav-links .desktop-nav-link:focus-visible {
  color: rgba(0, 0, 0, 0.38);
}

.desktop-nav-link.is-current,
.desktop-nav-link[aria-current="page"] {
  opacity: 0.45;
}

.desktop-nav-slash {
  margin: 0 4px;
  user-select: none;
}

#home-wordmark-desktop {
  position: absolute;
  left: -6px;
  bottom: 0px;
  z-index: 20;
  display: inline-flex;
  align-items: flex-end;
  color: var(--fg);
  white-space: nowrap;
  pointer-events: none;
  font-family: "SpaceGroteskBold", "HelveticaNeueBd", "HelveticaNeueHv", Helvetica, Arial, sans-serif;
  font-size: clamp(150px, 16vw, 230px);
  line-height: 0.82;
  letter-spacing: -0.05em;
  text-transform: none;
}

#home-wordmark-desktop .wordmark-desktop-text {
  font-size: 1em;
  line-height: 1;
}

#home-wordmark-desktop .wordmark-desktop-period {
  display: inline-block;
  width: 0.10em;
  height: 0.10em;
  margin-left: 0.05em;
  margin-bottom: 0.16em;
  background: currentColor;
  flex: 0 0 auto;
}

#home-wordmark-mobile {
  display: none;
}

#dark-mode-button {
  position: fixed;
  top: 24px;
  right: 24px;
  width: 16px;
  height: 16px;
  border: none;
  padding: 0;
  margin: 0;
  background: rgba(0, 0, 0, 0.22);
  appearance: none;
  -webkit-appearance: none;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  transition: background 180ms ease;
  z-index: 40;
}

html.dark-mode #dark-mode-button {
  background: rgba(255, 255, 255, 0.26);
}

#dark-mode-button:hover,
#dark-mode-button:focus-visible {
  background: #000;
  outline: none;
}

html.dark-mode #dark-mode-button:hover,
html.dark-mode #dark-mode-button:focus-visible {
  background: #fff;
}

/* -----------------------------
   MOBILE MENU DEFAULT HIDDEN
------------------------------ */

#mobile-menu-button,
#mobile-menu-overlay {
  display: none;
}

/* -----------------------------
   MOBILE / TOUCH ONLY
------------------------------ */

@media (pointer: coarse) and (max-width: 900px) {
  body.home-page {
    --page-margin: 16px;
  }

  body.home-page #nav {
    top: 18px;
    left: 16px;
    right: 16px;
  }

  #home-main {
    top: 16px;
    right: 16px;
    bottom: 16px;
    left: 16px;
  }

  #desktop-nav-links,
  #home-wordmark-desktop {
    display: none;
  }

  #home-wordmark-mobile {
    position: absolute;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50.5%);
    z-index: 20;
    display: inline-flex;
    align-items: flex-end;
    color: var(--fg);
    white-space: nowrap;
    pointer-events: none;
    font-family: "SpaceGroteskBold", "HelveticaNeueBd", "HelveticaNeueHv", Helvetica, Arial, sans-serif;
    font-size: clamp(124px, 40vw, 200px);
    line-height: 0.82;
    letter-spacing: -0.035em;
    text-transform: none;
    width: max-content;
    max-width: calc(100vw - 18px);
  }

  #home-wordmark-mobile .wordmark-mobile-text {
    font-size: 1em;
    line-height: 1;
  }

  #home-wordmark-mobile .wordmark-mobile-period {
    display: inline-block;
    width: 0.10em;
    height: 0.10em;
    margin-left: 0.05em;
    margin-bottom: 0.16em;
    background: currentColor;
    flex: 0 0 auto;
  }

  #nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }

  #mobile-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    padding: 0;
    margin: 0;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
    border-radius: 0;
    box-shadow: none;
    z-index: 120;
    position: relative;
    top: -2px;
  }

  #mobile-menu-button::before {
    content: "";
    display: block;
    width: 30px;
    height: 30px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
    background-image: url("/assets/icons/dd_b.svg");
  }

  html.dark-mode #mobile-menu-button::before {
    background-image: url("/assets/icons/dd_w.svg");
  }

  #dark-mode-button {
    position: fixed;
    top: 24px;
    left: 16px;
    right: auto;
    bottom: auto;
    width: 22px;
    height: 22px;
    z-index: 100;
    pointer-events: auto;
  }

  #mobile-menu-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 110;
    pointer-events: none;
  }

  #mobile-menu-backdrop {
    position: absolute;
    inset: 0;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    background: rgba(0, 0, 0, 0);
    transition:
      backdrop-filter 420ms cubic-bezier(0.22, 1, 0.36, 1),
      -webkit-backdrop-filter 420ms cubic-bezier(0.22, 1, 0.36, 1),
      background 420ms cubic-bezier(0.22, 1, 0.36, 1),
      opacity 420ms cubic-bezier(0.22, 1, 0.36, 1);
    opacity: 0;
  }

  #mobile-menu-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50svh;
    min-height: 340px;
    max-height: 520px;
    background: var(--bg);
    color: var(--fg);
    transform: translateY(-104%);
    opacity: 1;
    transition:
      transform 620ms cubic-bezier(0.22, 1, 0.36, 1),
      opacity 420ms cubic-bezier(0.22, 1, 0.36, 1);
    box-sizing: border-box;
    padding: 34px 18px 0 38px;
    overflow: hidden;
  }

  #mobile-menu-top {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    column-gap: 16px;
    width: 100%;
    box-sizing: border-box;
  }

  .mobile-menu-top-control {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    height: 32px;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    color: var(--fg);
    font-family: "HelveticaNeueRoman", Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1;
    text-transform: uppercase;
    text-decoration: none;
    appearance: none;
    -webkit-appearance: none;
    border-radius: 0;
    box-shadow: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-menu-home {
    justify-self: start;
    position: relative;
    opacity: 0;
    transform: translateY(-12px);
    transition:
      opacity 760ms cubic-bezier(0.22, 1, 0.36, 1),
      transform 980ms cubic-bezier(0.22, 1, 0.36, 1),
      color 180ms ease;
  }

  #mobile-menu-close {
    justify-self: end;
    cursor: pointer;
    min-width: 44px;
    justify-content: flex-end;
  }

  #mobile-menu-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    margin-top: 10px;
  }

  .mobile-menu-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: var(--fg);
    font-family: "HelveticaNeueRoman", Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(-12px);
    transition:
      opacity 760ms cubic-bezier(0.22, 1, 0.36, 1),
      transform 980ms cubic-bezier(0.22, 1, 0.36, 1),
      color 180ms ease;
  }

  .mobile-menu-home[aria-current="page"] {
    color: rgba(255, 255, 255, 0.26);
  }

  html:not(.dark-mode) .mobile-menu-home[aria-current="page"] {
    color: rgba(0, 0, 0, 0.22);
  }

  .mobile-menu-home[aria-current="page"]::before {
    content: "";
    position: absolute;
    top: 50%;
    left: -20px;
    width: 8px;
    height: 8px;
    background: #000;
    transform: translateY(-50%);
    pointer-events: none;
  }

  html.dark-mode .mobile-menu-home[aria-current="page"]::before {
    background: #fff;
  }

  #mobile-menu-overlay.is-open {
    pointer-events: auto;
  }

  #mobile-menu-overlay.is-open #mobile-menu-backdrop {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(0, 0, 0, 0.18);
    opacity: 1;
  }

  #mobile-menu-overlay.is-open #mobile-menu-panel {
    transform: translateY(0);
  }

  #mobile-menu-overlay.is-open .mobile-menu-home,
  #mobile-menu-overlay.is-open #mobile-menu-list .mobile-menu-link {
    opacity: 1;
    transform: translateY(0);
  }

  #mobile-menu-overlay.is-open .mobile-menu-home {
    transition-delay: 260ms;
  }

  #mobile-menu-overlay.is-open #mobile-menu-list .mobile-menu-link:nth-child(1) {
    transition-delay: 420ms;
  }

  #mobile-menu-overlay.is-open #mobile-menu-list .mobile-menu-link:nth-child(2) {
    transition-delay: 600ms;
  }

  #mobile-menu-overlay.is-open #mobile-menu-list .mobile-menu-link:nth-child(3) {
    transition-delay: 780ms;
  }

  #mobile-menu-overlay.is-open #mobile-menu-list .mobile-menu-link:nth-child(4) {
    transition-delay: 960ms;
  }
}

@media (pointer: coarse) and (max-width: 600px) {
  #mobile-menu-button {
    width: 36px;
    height: 36px;
    padding: 0;
    top: -2px;
  }

  #mobile-menu-button::before {
    width: 30px;
    height: 30px;
    background-size: 100% 100%;
  }

  #home-wordmark-mobile {
    bottom: 12px;
    transform: translateX(-50.5%);
    font-size: clamp(116px, 44vw, 195px);
    max-width: calc(100vw - 14px);
  }

  #mobile-menu-panel {
    min-height: 320px;
    padding: 32px 16px 0 36px;
  }

  .mobile-menu-top-control,
  .mobile-menu-link {
    font-size: 15px;
  }

  #mobile-menu-list {
    gap: 22px;
    margin-top: 12px;
  }

  .mobile-menu-home[aria-current="page"]::before {
    left: -18px;
    width: 7px;
    height: 7px;
  }

  #dark-mode-button {
    top: 24px;
    left: 16px;
    width: 20px;
    height: 20px;
    z-index: 100;
  }
}

#home-intro-transition {
  position: fixed;
  inset: 0;
  background: var(--fg);
  z-index: 100000;
  pointer-events: none;
  clip-path: inset(100% 0 0 0);
  will-change: clip-path;
}

body.home-intro #home-intro-transition {
  clip-path: inset(0 0 0 0);
  animation: homeIntroSlideDown 700ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: 300ms;
}

@keyframes homeIntroSlideDown {
  from {
    clip-path: inset(0 0 0 0);
  }
  to {
    clip-path: inset(100% 0 0 0);
  }
}

#page-transition {
  position: fixed;
  inset: 0;
  background: var(--fg);
  z-index: 99999;
  pointer-events: none;
  clip-path: inset(100% 0 0 0);
  will-change: clip-path;
}

#page-transition.is-active {
  animation: fpExitSlideUp 700ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes fpExitSlideUp {
  from {
    clip-path: inset(100% 0 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}