@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/inter-regular.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/inter-medium.woff2") format("woff2");
}

:root {
  --ink: #f4f7fb;
  --muted: #b7c2ce;
  --cyan: #3ee7ff;
  --violet: #8d74ff;
  --focus: #c4b5fd;
  color-scheme: dark;
}

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

html {
  background: #000;
  scroll-behavior: smooth;
  scrollbar-color: #3a3a42 #000;
  scrollbar-width: thin;
}

body {
  margin: 0;
  background: #000;
  color: var(--ink);
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(141, 116, 255, 0.45);
  color: #fff;
}

.skip {
  position: absolute;
  left: 1rem;
  top: 0;
  transform: translateY(-120%);
  z-index: 10;
  background: #fff;
  color: #000;
  padding: 0.6rem 0.85rem;
  font-size: 0.95rem;
  text-decoration: none;
}

.skip:focus {
  transform: none;
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at center, #000 28%, transparent 76%);
}

.grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(150, 190, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(150, 190, 255, 0.045) 1px, transparent 1px);
  background-size: 72px 72px;
  background-position: center;
}

#field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

main,
.scene {
  position: relative;
  z-index: 1;
}

.scene {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 4.5rem 1.35rem;
}

.hero {
  padding-top: calc(4.25rem + env(safe-area-inset-top));
}

#contact {
  padding-bottom: calc(4.5rem + env(safe-area-inset-bottom));
}

#contact:focus {
  outline: none;
}

.scene-inner {
  position: relative;
  z-index: 1;
  width: min(100%, 40rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.85s ease,
    transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

.scene.is-active .scene-inner,
.scene:focus-within .scene-inner {
  opacity: 1;
  transform: none;
}

.hero-glow {
  position: absolute;
  left: 50%;
  top: 44%;
  width: min(86vw, 560px);
  height: min(46vw, 300px);
  transform: translate(-50%, -58%);
  background:
    radial-gradient(ellipse at 38% 50%, rgba(62, 231, 255, 0.16), transparent 62%),
    radial-gradient(ellipse at 66% 50%, rgba(141, 116, 255, 0.16), transparent 64%);
  filter: blur(6px);
  pointer-events: none;
  z-index: 0;
  animation: breathe 8.5s ease-in-out infinite;
}

.mark {
  width: min(78vw, 300px);
  height: auto;
  display: block;
  overflow: visible;
}

.wordmark {
  margin: 1.35rem 0 0;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.46em;
  padding-left: 0.46em;
  text-transform: uppercase;
}

.scene h1,
.scene h2 {
  margin: 1.45rem 0 0;
  max-width: 14em;
  color: var(--ink);
  font-size: clamp(2rem, 6.4vw, 4.35rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.05;
  text-wrap: balance;
}

.lede {
  margin: 1.05rem 0 0;
  max-width: 28rem;
  color: var(--muted);
  font-size: clamp(1.02rem, 2.1vw, 1.28rem);
  line-height: 1.45;
  text-wrap: pretty;
}

.hero .wordmark,
.hero h1,
.hero .lede {
  animation: rise 0.95s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero .wordmark {
  animation-delay: 1.05s;
}

.hero h1 {
  animation-delay: 1.28s;
}

.hero .lede {
  animation-delay: 1.5s;
}

.spark {
  opacity: 0;
  animation: reveal 0.7s ease 0.12s forwards;
}

.ticks {
  opacity: 0;
  animation: reveal 0.9s ease 1.85s forwards;
}

.cue {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(1.35rem + env(safe-area-inset-bottom));
  margin: 0;
  text-align: center;
  color: #93a0ae;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  text-transform: uppercase;
  z-index: 1;
}

.cue span {
  display: inline-block;
  animation: bob 2.6s ease-in-out infinite;
}

body.has-scrolled .cue,
.hero:not(.is-active) .cue {
  opacity: 0;
}

.mail {
  display: inline-block;
  margin-top: 1.2rem;
  padding: 0.7rem 0.35rem;
  color: #e7fbff;
  font-size: clamp(1.12rem, 2.3vw, 1.5rem);
  letter-spacing: 0.01em;
  text-decoration: none;
  background-image: linear-gradient(90deg, var(--cyan), var(--violet));
  background-repeat: no-repeat;
  background-size: 100% 1px;
  background-position: 0 calc(100% - 0.55rem);
}

.mail:hover {
  color: #fff;
  background-size: 100% 2px;
}

.mail:focus-visible,
.skip:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes reveal {
  to {
    opacity: 1;
  }
}

@keyframes breathe {
  0%,
  100% {
    opacity: 0.55;
  }

  50% {
    opacity: 1;
  }
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.65;
  }

  50% {
    transform: translateY(6px);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .scene-inner,
  .hero .wordmark,
  .hero h1,
  .hero .lede,
  .spark,
  .ticks,
  .cue span {
    animation: none;
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero-glow,
  .cue {
    animation: none;
  }

  #field {
    display: none;
  }
}

@media (forced-colors: active) {
  .mail {
    text-decoration: underline;
  }
}

@media (max-width: 640px) {
  .scene h1,
  .scene h2 {
    max-width: 11em;
  }

  .wordmark {
    font-size: 0.72rem;
  }
}

/* Digital accents */
body {
  overflow-x: clip;
}

.circuit {
  display: block;
  width: min(10rem, 46vw);
  height: auto;
  margin: 0 auto 0.4rem;
  overflow: visible;
}

.circuit path {
  fill: none;
  stroke: url(#circuit-grad);
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0.85;
  transition: stroke-dashoffset 1.4s cubic-bezier(0.65, 0, 0.18, 1) 0.25s;
}

.circuit circle {
  fill: #e9fbff;
  opacity: 0;
  transition: opacity 0.4s ease 1.4s;
}

.circuit circle.node-a {
  fill: var(--cyan);
}

.circuit circle.node-b {
  fill: var(--violet);
}

.scene.is-active .circuit path {
  stroke-dashoffset: 0;
}

.scene.is-active .circuit circle {
  opacity: 1;
  animation: pulse 2.8s ease-in-out 1.8s infinite;
}

.scene.is-active .circuit circle.node-b {
  animation-delay: 2.5s;
}

.scene:not(.hero) .scene-inner::after {
  content: "";
  position: absolute;
  inset: -2.5rem 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(105deg, transparent 38%, rgba(62, 231, 255, 0.09) 47%, rgba(141, 116, 255, 0.09) 53%, transparent 62%),
    linear-gradient(rgba(150, 190, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(150, 190, 255, 0.05) 1px, transparent 1px);
  background-size: 250% 100%, 24px 24px, 24px 24px;
  background-position: 120% 0, center, center;
  background-repeat: no-repeat, repeat, repeat;
  mask-image: radial-gradient(ellipse at center, #000 10%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 10%, transparent 70%);
}

.scene.is-active:not(.hero) .scene-inner::after {
  animation: shimmer 2.4s ease 0.5s both;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.45;
  }

  50% {
    opacity: 1;
  }
}

@keyframes shimmer {
  from {
    background-position: 120% 0, center, center;
  }

  to {
    background-position: -20% 0, center, center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .circuit path {
    stroke-dashoffset: 0;
    transition: none;
  }

  .circuit circle {
    opacity: 1;
    transition: none;
    animation: none !important;
  }

  .scene:not(.hero) .scene-inner::after {
    animation: none !important;
  }
}
