@font-face {
  font-family: "Melodrama";
  src: url("../fonts/Melodrama-Variable.woff2") format("woff2"),
    url("../fonts/Melodrama-Variable.woff") format("woff");
  font-weight: 300 700;
  font-display: swap;
}

@font-face {
  font-family: "Satoshi";
  src: url("../fonts/Satoshi-Variable.woff2") format("woff2"),
    url("../fonts/Satoshi-Variable.woff") format("woff");
  font-weight: 300 900;
  font-display: swap;
}

:root {
  --white: #f5f8ff;
  --blue: #58b8ff;
  --muted: rgba(200, 215, 236, 0.58);
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #010207;
}

body {
  position: relative;
  color: var(--white);
  font-family: "Satoshi", sans-serif;
  cursor: default;
  isolation: isolate;
  -webkit-font-smoothing: antialiased;
}

::selection {
  color: #f4f9ff;
  background: #1a4f86;
  text-shadow: none;
}

::-moz-selection {
  color: #f4f9ff;
  background: #1a4f86;
  text-shadow: none;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse 50% 34% at 50% 16%,
      rgba(37, 75, 124, 0.2),
      rgba(37, 75, 124, 0.08) 42%,
      transparent 78%
    ),
    radial-gradient(
      ellipse 85% 55% at 50% 100%,
      rgba(7, 37, 74, 0.28),
      rgba(7, 37, 74, 0.1) 48%,
      transparent 78%
    ),
    linear-gradient(180deg, #010206 0%, #02050a 55%, #010206 100%);
}

.atmosphere::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.028;
  background-image: radial-gradient(
    circle,
    rgba(152, 193, 230, 0.32) 0 0.45px,
    transparent 0.7px
  );
  background-size: 42px 42px;
  mask-image: radial-gradient(
    ellipse 80% 66% at 50% 40%,
    #000 0%,
    rgba(0, 0, 0, 0.4) 34%,
    transparent 76%
  );
}

#hex-field,
#globe {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#hex-field {
  z-index: 1;
}

#globe {
  z-index: 2;
}

.site-nav {
  position: fixed;
  z-index: 5;
  top: clamp(1.35rem, 3.2vh, 2.15rem);
  right: clamp(1.35rem, 3.5vw, 2.75rem);
  pointer-events: auto;
}

.site-links {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.65rem;
}

.site-links a {
  position: relative;
  color: rgba(199, 215, 233, 0.58);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 220ms ease, text-shadow 220ms ease;
}

.site-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.35em;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(121, 203, 255, 0.8), transparent);
  box-shadow: 0 0 8px rgba(65, 171, 244, 0.45);
  opacity: 0;
  transform: scaleX(0.4);
  transform-origin: left center;
  transition: opacity 220ms ease, transform 220ms ease;
}

.site-links a:hover,
.site-links a:focus-visible {
  color: rgba(239, 248, 255, 0.94);
  text-shadow: 0 0 14px rgba(94, 190, 255, 0.46);
  outline: none;
}

.site-links a:hover::after,
.site-links a:focus-visible::after {
  opacity: 1;
  transform: scaleX(1);
}

.menu-toggle {
  display: none;
}

.stage {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: center;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  padding: clamp(4.5rem, 11vh, 7.5rem) 1.5rem 0;
  pointer-events: none;
}

.brand-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1rem, 2.2vh, 1.45rem);
  width: min(900px, 94vw);
  text-align: center;
}

.brand {
  position: relative;
  font-family: "Melodrama", serif;
  font-size: clamp(5.1rem, 12vw, 9.8rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 0.78;
  user-select: none;
  isolation: isolate;
}

.brand__letters {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: baseline;
  justify-content: center;
}

.brand__letters > span {
  display: inline-block;
  color: rgba(218, 235, 250, 0.2);
  -webkit-text-stroke: 0.9px rgba(247, 252, 255, 0.92);
  text-shadow:
    0 0 4px rgba(255, 255, 255, 0.92),
    0 0 14px rgba(207, 232, 255, 0.58),
    0 0 32px rgba(74, 163, 245, 0.35);
  opacity: 0.16;
  filter: blur(1.5px) brightness(1.35);
  transform: translateY(-0.18em) scaleY(1.08);
  will-change: transform, opacity, filter;
  animation:
    letter-land 1.65s cubic-bezier(0.16, 1, 0.3, 1)
      calc(0.38s + var(--i) * 0.105s) forwards,
    letter-breathe 5.5s ease-in-out calc(2.4s + var(--i) * 0.08s) infinite;
}

/* Vertical light shafts are the defining reveal in the IRIS² reference. */
.brand__letters > span::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 62%;
  width: clamp(10px, 1.4vw, 22px);
  height: clamp(80px, 16vh, 170px);
  background: linear-gradient(
    to top,
    rgba(235, 248, 255, 0.72),
    rgba(81, 180, 255, 0.24) 42%,
    transparent 100%
  );
  filter: blur(6px);
  opacity: 0;
  transform: translateX(-50%) scaleY(0.2);
  transform-origin: bottom;
  will-change: transform, opacity;
  animation: beam-drop 1.45s ease-out calc(0.12s + var(--i) * 0.105s) both;
}

.brand__rays {
  position: absolute;
  z-index: 1;
  inset: -85% -8% -25%;
  opacity: 0;
  background:
    linear-gradient(93deg, transparent 10%, rgba(65, 166, 255, 0.17) 31%, transparent 35%),
    linear-gradient(88deg, transparent 44%, rgba(157, 217, 255, 0.18) 48%, transparent 52%),
    linear-gradient(94deg, transparent 67%, rgba(65, 166, 255, 0.14) 72%, transparent 76%);
  filter: blur(8px);
  mask-image: linear-gradient(to bottom, #000 0%, #000 58%, transparent 92%);
  will-change: transform, opacity;
  animation: rays-arrive 2.1s ease 0.2s both, rays-breathe 5s ease-in-out 2.3s infinite;
}

.brand::after {
  content: "";
  position: absolute;
  z-index: 3;
  left: 0;
  top: auto;
  bottom: -0.17em;
  width: 100%;
  height: 1px;
  opacity: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(88, 184, 255, 0.05) 12%,
    rgba(255, 255, 255, 0.95) 50%,
    rgba(88, 184, 255, 0.05) 88%,
    transparent
  );
  box-shadow: 0 0 12px rgba(195, 232, 255, 0.75), 0 0 28px rgba(53, 154, 255, 0.38);
  transform: scaleX(0);
  transform-origin: center;
  will-change: transform, opacity;
  animation: iris-line 1.15s cubic-bezier(0.22, 1, 0.36, 1) 1.25s both;
}

.tagline {
  max-width: 35ch;
  color: var(--muted);
  font-size: clamp(0.94rem, 1.7vw, 1.13rem);
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0.005em;
  opacity: 0;
  transform: translateY(9px);
  will-change: transform, opacity;
  animation: copy-arrive 1.1s ease 1.75s forwards;
}

@keyframes beam-drop {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-25%) scaleY(0.15);
  }
  32% {
    opacity: 0.82;
  }
  76% {
    opacity: 0.28;
    transform: translateX(-50%) translateY(10%) scaleY(1);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(18%) scaleY(0.7);
  }
}

@keyframes letter-land {
  0% {
    opacity: 0.16;
    filter: blur(2px) brightness(1.5);
    transform: translateY(-0.18em) scaleY(1.08);
  }
  58% {
    opacity: 1;
    filter: blur(0.5px) brightness(1.8);
  }
  100% {
    opacity: 1;
    filter: blur(0) brightness(1);
    transform: translateY(0) scaleY(1);
  }
}

@keyframes letter-breathe {
  0%,
  100% {
    text-shadow:
      0 0 3px rgba(255, 255, 255, 0.88),
      0 0 14px rgba(207, 232, 255, 0.5),
      0 0 32px rgba(74, 163, 245, 0.3);
  }
  50% {
    text-shadow:
      0 0 5px rgba(255, 255, 255, 1),
      0 0 19px rgba(207, 232, 255, 0.65),
      0 0 42px rgba(74, 163, 245, 0.4);
  }
}

@keyframes iris-line {
  0% {
    opacity: 0;
    transform: scaleX(0);
  }
  42% {
    opacity: 1;
  }
  64% {
    opacity: 0.76;
    transform: scaleX(1);
  }
  84% {
    opacity: 0.22;
    transform: scaleX(1);
  }
  100% {
    opacity: 0;
    transform: scaleX(1);
  }
}

@keyframes rays-arrive {
  from {
    opacity: 0;
    transform: translateY(-8%);
  }
  to {
    opacity: 0.52;
    transform: translateY(0);
  }
}

@keyframes rays-breathe {
  0%,
  100% {
    opacity: 0.52;
  }
  50% {
    opacity: 0.74;
  }
}

@keyframes copy-arrive {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .site-nav {
    top: 1.25rem;
    right: 1.1rem;
  }

  .menu-toggle {
    display: flex;
    position: relative;
    z-index: 2;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 7px;
    width: 40px;
    height: 40px;
    padding: 0 9px;
    color: var(--white);
    background: rgba(4, 13, 24, 0.28);
    border: 1px solid rgba(132, 190, 231, 0.12);
    border-radius: 4px;
    backdrop-filter: blur(12px);
    cursor: pointer;
  }

  .menu-toggle span {
    display: block;
    height: 1.5px;
    background: rgba(230, 243, 252, 0.9);
    box-shadow: 0 0 7px rgba(93, 188, 255, 0.4);
    border-radius: 1px;
    transform-origin: center;
    transition:
      transform 320ms cubic-bezier(0.22, 1, 0.36, 1),
      width 280ms cubic-bezier(0.22, 1, 0.36, 1),
      opacity 200ms ease;
  }

  .menu-toggle span:first-child {
    width: 20px;
  }

  .menu-toggle span:last-child {
    width: 13px;
  }

  /* Equalize bars first, then settle into a clean X. */
  .site-nav.is-open .menu-toggle span:first-child {
    width: 18px;
    transform: translateY(4.25px) rotate(45deg);
  }

  .site-nav.is-open .menu-toggle span:last-child {
    width: 18px;
    transform: translateY(-4.25px) rotate(-45deg);
  }

  .site-links {
    position: absolute;
    top: calc(100% + 0.55rem);
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 156px;
    padding: 0.95rem 1rem;
    gap: 1rem;
    background: rgba(5, 16, 28, 0.92);
    border: 1px solid rgba(111, 182, 232, 0.16);
    border-radius: 4px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(16px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition:
      opacity 240ms ease,
      visibility 240ms ease,
      transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .site-nav.is-open .site-links {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  .site-links a {
    font-size: 0.7rem;
    opacity: 0;
    transform: translateY(-4px);
    transition:
      color 220ms ease,
      text-shadow 220ms ease,
      opacity 240ms ease,
      transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .site-nav.is-open .site-links a {
    opacity: 1;
    transform: translateY(0);
  }

  .site-nav.is-open .site-links a:nth-child(1) {
    transition-delay: 40ms;
  }

  .site-nav.is-open .site-links a:nth-child(2) {
    transition-delay: 90ms;
  }

  .site-links a::after {
    display: none;
  }

  .stage {
    padding-top: clamp(4rem, 10vh, 6rem);
  }

  .brand {
    font-size: clamp(4.5rem, 23vw, 6.5rem);
  }

  .tagline {
    max-width: 27ch;
  }
}

@media (max-height: 680px) {
  .stage {
    padding-top: 3.5rem;
  }

  .brand {
    font-size: clamp(4.2rem, 11vw, 7rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand__letters > span,
  .brand__letters > span::before,
  .brand__rays,
  .brand::after,
  .tagline,
  .menu-toggle span,
  .site-links {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
