:root {
  color-scheme: dark;
  background: #1d1d1b;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: #1d1d1b;
}

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100svh;
  overflow: hidden;
  place-items: center;
  padding: clamp(1.5rem, 6vw, 6rem);
}

.code-backdrop {
  position: absolute;
  z-index: -1;
  top: 25%;
  left: 64%;
  width: min(1540px, 128vw);
  overflow: hidden;
  color: rgb(255 255 255 / 46%);
  opacity: .13;
  pointer-events: none;
  user-select: none;
  transform: translate(-50%, -50%) perspective(900px) rotateX(56deg) rotateZ(-15deg) scale(1.22);
  transform-origin: center;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 24%, rgb(0 0 0 / 76%) 58%, transparent 91%);
  mask-image: radial-gradient(ellipse at center, #000 24%, rgb(0 0 0 / 76%) 58%, transparent 91%);
  animation: code-drift 18s ease-in-out infinite alternate;
}

.code-backdrop pre {
  margin: 0;
  white-space: pre;
}

.code-backdrop code {
  font: 500 clamp(.72rem, 1.15vw, .98rem)/1.75 Consolas, "Courier New", monospace;
  letter-spacing: .015em;
}

.code-purple {
  color: #b18cff;
}

.code-blue {
  color: #35bdf5;
}

.code-white {
  color: #fff;
}

.hero__content {
  position: absolute;
  top: 33.333%;
  left: 50%;
  display: grid;
  justify-items: center;
  gap: clamp(1.75rem, 4vh, 2.5rem);
  transform: translate(-50%, -50%);
}

.brand {
  position: relative;
  width: min(82vw, 480px);
  animation: reveal 900ms cubic-bezier(.2, .8, .2, 1) both;
}

.brand__logo {
  display: block;
  width: 100%;
  height: auto;
}

.brand__cursor {
  position: absolute;
  left: 85%;
  bottom: -3%;
  width: clamp(2px, 0.32vw, 2px);
  height: 18%;
  background: #fff;
  box-shadow: 0 0 10px rgb(255 255 255 / 35%);
  animation: blink 1s steps(1, end) infinite;
}

.contact {
  position: relative;
  padding: 0;
  border: 0;
  color: inherit;
  background: none;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 180ms ease;
}

.contact::before {
  position: absolute;
  inset: -.5rem -.65rem;
  padding: 1px;
  border-radius: 5px;
  background: linear-gradient(110deg, #009fe3, #8254fc, #009fe3);
  background-size: 200% 100%;
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: scale(.96);
  transition: opacity 240ms ease, transform 240ms ease;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.contact:hover,
.contact:focus-visible {
  color: #999999;
}

.contact:hover::before,
.contact:focus-visible::before {
  opacity: 1;
  transform: scale(1);
  animation: contact-border-flow 3.2s linear infinite;
}

.contact:focus-visible {
  outline: none;
}

.copyright {
  position: absolute;
  bottom: clamp(1.25rem, 3vw, 2rem);
  left: 50%;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin: 0;
  color: rgb(255 255 255 / 24%);
  font: 400 0.625rem/1.5 Arial, sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transform: translateX(-50%);
  white-space: nowrap;
}

.contact-modal {
  width: min(92vw, 560px);
  max-height: min(90svh, 720px);
  padding: clamp(1.75rem, 5vw, 3rem);
  overflow: auto;
  border: 1px solid rgb(255 255 255 / 9%);
  border-radius: 18px;
  color: #f5f5f3;
  background: rgb(35 35 33 / 96%);
  box-shadow: 0 30px 90px rgb(0 0 0 / 48%);
  opacity: 0;
  transform: translateY(18px) scale(.985);
  transition:
    opacity 220ms ease,
    transform 220ms cubic-bezier(.2, .8, .2, 1),
    overlay 220ms allow-discrete,
    display 220ms allow-discrete;
}

.contact-modal[open] {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@starting-style {
  .contact-modal[open] {
    opacity: 0;
    transform: translateY(18px) scale(.985);
  }
}

.contact-modal::backdrop {
  background: rgb(10 10 9 / 68%);
  backdrop-filter: blur(7px);
  opacity: 0;
  transition:
    opacity 220ms ease,
    overlay 220ms allow-discrete,
    display 220ms allow-discrete;
}

.contact-modal[open]::backdrop {
  opacity: 1;
}

@starting-style {
  .contact-modal[open]::backdrop {
    opacity: 0;
  }
}

.contact-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
}

.contact-modal__eyebrow {
  margin: 0 0 .55rem;
  color: #8254fc;
  font: 600 .625rem/1.4 Arial, sans-serif;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.contact-modal h1 {
  margin: 0;
  font: 400 clamp(1.9rem, 5vw, 2.6rem)/1.1 Arial, sans-serif;
  letter-spacing: -.035em;
}

.contact-modal__close {
  position: relative;
  display: grid;
  width: 2rem;
  height: 2rem;
  padding: 0;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 50%;
  color: rgb(255 255 255 / 52%);
  background: transparent;
  cursor: pointer;
  font: 300 1.25rem/1 Arial, sans-serif;
  transition: border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.contact-modal__close::before {
  position: absolute;
  inset: -1px;
  padding: 2px;
  border-radius: 50%;
  background: linear-gradient(110deg, #009fe3, #8254fc, #009fe3);
  background-size: 200% 100%;
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: scale(.94);
  transition: opacity 240ms ease, transform 240ms ease;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.contact-modal__close:hover {
  border-color: transparent;
  color: #009fe3;
  transform: rotate(6deg);
}

.contact-modal__close:hover::before,
.contact-modal__close:focus-visible::before {
  opacity: 1;
  transform: scale(1);
  animation: contact-border-flow 3.2s linear infinite;
}

.contact-modal__intro {
  margin: 1rem 0 clamp(1.75rem, 5vw, 2.5rem);
  color: rgb(255 255 255 / 44%);
  font: 400 .84rem/1.6 Arial, sans-serif;
}

.contact-form {
  display: grid;
  gap: 1.5rem;
}

.contact-form__trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.field {
  position: relative;
  display: grid;
  padding-top: .85rem;
}

.field::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, #009fe3, #8254fc, #009fe3);
  background-size: 200% 100%;
  content: "";
  pointer-events: none;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 240ms ease;
}

.field:focus-within::after {
  transform: scaleX(1);
  animation: contact-border-flow 3.2s linear infinite;
}

.field > span {
  position: absolute;
  top: 1.35rem;
  left: 0;
  color: rgb(255 255 255 / 24%);
  cursor: text;
  font: 400 .86rem/1.4 Arial, sans-serif;
  letter-spacing: 0;
  pointer-events: none;
  /* text-transform: uppercase; */
  transform-origin: left center;
  transition: color 180ms ease, transform 180ms ease, top 180ms ease, letter-spacing 180ms ease;
}

.field input,
.field textarea {
  width: 100%;
  padding: .6rem 0 .7rem;
  border: 0;
  border-bottom: 1px solid rgb(255 255 255 / 12%);
  border-radius: 0;
  outline: 0;
  color: #fff;
  background: transparent;
  font: 400 .9rem/1.55 Arial, sans-serif;
  resize: vertical;
  transition: border-color 180ms ease;
}

.field textarea {
  min-height: 6.5rem;
  padding-top: .65rem;
}

.field input:focus,
.field textarea:focus {
  border-color: transparent;
}

.field input:focus + span,
.field input:not(:placeholder-shown) + span,
.field textarea:focus + span,
.field textarea:not(:placeholder-shown) + span {
  top: 0;
  color: #8254fc;
  font-weight: 600;
  letter-spacing: .14em;
  transform: scale(.72);
}

.contact-form__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: .35rem;
  padding: .95rem 1.1rem;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(100deg, #009fe3 0%, #8254fc 58%, #8254fc 100%);
  box-shadow: 0 10px 30px rgb(89 92 246 / 18%);
  cursor: pointer;
  font: 600 .66rem/1 Arial, sans-serif;
  letter-spacing: .16em;
  text-transform: uppercase;
  transition: filter 180ms ease, transform 180ms ease;
}

.contact-form__submit:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.contact-modal button:focus-visible {
  outline: 2px solid rgb(130 84 252 / 60%);
  outline-offset: 3px;
}

.contact-modal .contact-modal__close:focus-visible {
  border-color: transparent;
  outline: none;
}

.form-status {
  margin: 0 0 1.5rem;
  padding: .85rem 1rem;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 8px;
  font: 400 .75rem/1.5 Arial, sans-serif;
}

.form-status--success {
  color: #b8f3d1;
  background: rgb(52 211 153 / 8%);
}

.form-status--error {
  color: #ffc3c3;
  background: rgb(248 113 113 / 8%);
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes blink {
  0%,
  45% {
    opacity: 1;
  }

  46%,
  100% {
    opacity: 0;
  }
}

@keyframes contact-border-flow {
  from {
    background-position: 0% 50%;
  }

  to {
    background-position: 200% 50%;
  }
}

@keyframes code-drift {
  from {
    transform: translate(-50%, -51%) perspective(1900px) rotateX(56deg) rotateZ(-15deg) scale(1.22);
  }

  to {
    transform: translate(-50%, -49%) perspective(1900px) rotateX(56deg) rotateZ(-15deg) scale(1.22);
  }
}

@media (max-width: 600px) {
  .brand {
    width: 100%;
  }
  
  .brand__cursor {	
  width: clamp(1px, 0.32vw, 1px);
  }

  .hero {
    padding-inline: clamp(2rem, 10vw, 3.5rem);
  }

  .contact-modal {
    width: calc(100vw - 1.5rem);
    padding: 1.5rem;
    border-radius: 14px;
  }

  .copyright {
    gap: 1rem;
  }

  .code-backdrop {
    top: 25%;
    left: 58%;
    width: 165vw;
    opacity: .075;
    transform: translate(-50%, -50%) perspective(900px) rotateX(34deg) rotateZ(-13deg) scale(1.3);
    animation: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand {
    animation: none;
  }

  .brand__cursor {
    animation-duration: 1.8s;
  }

  .contact-modal,
  .contact-modal::backdrop,
  .contact-modal__close,
  .contact-form__submit {
    transition: none;
  }

  .contact::before {
    animation: none;
  }

  .code-backdrop {
    animation: none;
  }
}
