/* Approved V1 mark assembly */
.fafau-builder {
  position: relative;
  isolation: isolate;
  width: min(38vw, 510px);
  aspect-ratio: 5184 / 5166;
  filter: drop-shadow(0 28px 54px rgba(0, 0, 0, 0.26));
  perspective: 900px;
  transform-style: preserve-3d;
}

.fafau-builder::before,
.fafau-builder::after {
  position: absolute;
  border-radius: 50%;
  content: "";
  opacity: 0;
  pointer-events: none;
  will-change: opacity, transform;
}

.fafau-builder::before {
  z-index: 0;
  inset: 5%;
  background: radial-gradient(
    circle,
    rgba(208, 163, 58, 0.3) 0%,
    rgba(46, 154, 146, 0.18) 28%,
    rgba(46, 154, 146, 0.05) 48%,
    transparent 70%
  );
  animation: assemblyGlow 9s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.fafau-builder::after {
  z-index: 1;
  inset: 8%;
  background: radial-gradient(
    circle,
    transparent 48%,
    rgba(46, 154, 146, 0.28) 49%,
    transparent 50%,
    transparent 60%,
    rgba(208, 163, 58, 0.48) 61%,
    transparent 62%
  );
  animation: assemblyRing 9s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.fafau-layer {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  backface-visibility: hidden;
  transform-origin: center;
  will-change: opacity, transform;
}

.fafau-waves {
  animation: buildMoana 9s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.fafau-canoe {
  animation: buildVaka 9s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.fafau-binding {
  animation: buildFafau 9s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.fafau-fale {
  animation: buildFale 9s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.fafau-builder-caption {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: -12px;
  width: max-content;
  max-width: 92vw;
  margin: 0;
  color: rgba(244, 234, 211, 0.58);
  font: italic 16px Georgia, "Times New Roman", serif;
  opacity: 0;
  transform: translateX(-50%);
  animation: buildCaption 9s ease infinite;
}

.build-sequence {
  width: min(100%, 460px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin: 31px 0 0;
  padding: 17px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.build-sequence li {
  color: rgba(244, 234, 211, 0.32);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
  transition: color 0.28s, transform 0.28s;
}

.build-sequence li span {
  display: block;
  margin-bottom: 6px;
  color: rgba(208, 163, 58, 0.42);
  font: italic 11px Georgia, "Times New Roman", serif;
  letter-spacing: 0;
}

.build-sequence li.active {
  color: var(--cream);
  transform: translateY(-2px);
}

.build-sequence li.active span {
  color: var(--gold);
}

/* Keep the current section legible in the persistent navigation. */
.site-nav > a {
  position: relative;
}

.site-nav > a:not(.nav-cta)::after {
  position: absolute;
  right: 0;
  bottom: -9px;
  left: 0;
  height: 2px;
  border-radius: 999px;
  background: var(--gold);
  content: "";
  opacity: 0;
  transform: scaleX(0.35);
  transition: opacity 0.24s, transform 0.24s;
}

.site-nav > a:not(.nav-cta).active {
  color: var(--cream);
  opacity: 1;
}

.site-nav > a:not(.nav-cta).active::after {
  opacity: 1;
  transform: scaleX(1);
}

.site-nav > .nav-cta.active {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--navy);
}

@keyframes buildMoana {
  0%, 2% {
    opacity: 0;
    transform: translate3d(-62px, 82px, -90px) scale(0.64) rotateZ(-13deg);
  }
  12% {
    opacity: 0.92;
    transform: translate3d(-5px, -5px, 18px) scale(1.07) rotateZ(2deg);
  }
  24%, 90% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1) rotateZ(0);
  }
  96%, 100% {
    opacity: 0;
  }
}

@keyframes buildVaka {
  0%, 2% {
    opacity: 0;
    transform: translate3d(108px, 36px, 110px) scale(0.6) rotateY(-65deg) rotateZ(14deg);
  }
  13% {
    opacity: 0.92;
    transform: translate3d(-6px, -2px, 10px) scale(1.08) rotateY(8deg) rotateZ(-3deg);
  }
  25%, 90% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1) rotateY(0) rotateZ(0);
  }
  96%, 100% {
    opacity: 0;
  }
}

@keyframes buildFafau {
  0%, 2% {
    opacity: 0;
    transform: translate3d(0, 0, -280px) scale(0.18) rotateZ(-150deg);
  }
  14% {
    opacity: 0.94;
    transform: translate3d(0, 0, 20px) scale(1.12) rotateZ(7deg);
  }
  26%, 90% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1) rotateZ(0);
  }
  96%, 100% {
    opacity: 0;
  }
}

@keyframes buildFale {
  0%, 2% {
    opacity: 0;
    transform: translate3d(0, -122px, 90px) scale(0.68) rotateX(65deg) rotateZ(-5deg);
  }
  15% {
    opacity: 0.92;
    transform: translate3d(0, 7px, 14px) scale(1.06) rotateX(-6deg) rotateZ(2deg);
  }
  27%, 90% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1) rotateX(0) rotateZ(0);
  }
  96%, 100% {
    opacity: 0;
  }
}

@keyframes buildCaption {
  0%, 28% {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
  40%, 90% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  96%, 100% {
    opacity: 0;
    transform: translate(-50%, -3px);
  }
}

@keyframes assemblyGlow {
  0%, 4% {
    opacity: 0;
    transform: scale(0.32);
  }
  16% {
    opacity: 0.82;
    transform: scale(0.94);
  }
  28%, 90% {
    opacity: 0.14;
    transform: scale(1.16);
  }
  96%, 100% {
    opacity: 0;
    transform: scale(1.28);
  }
}

@keyframes assemblyRing {
  0%, 4% {
    opacity: 0;
    transform: scale(0.5) rotate(-70deg);
  }
  17% {
    opacity: 0.9;
    transform: scale(1) rotate(120deg);
  }
  29%, 90% {
    opacity: 0.16;
    transform: scale(1.14) rotate(180deg);
  }
  96%, 100% {
    opacity: 0;
    transform: scale(1.24) rotate(210deg);
  }
}

/* Calm motion behind the approach number */
.approach-trace {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: min(72%, 330px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
}

.approach-trace::before,
.approach-trace::after,
.approach-trace i {
  position: absolute;
  content: "";
  border: 1px solid rgba(244, 234, 211, 0.12);
  border-radius: 34% 66% 42% 58%;
  animation: traceTurn 18s linear infinite;
}

.approach-trace::before {
  inset: 0;
}

.approach-trace::after {
  inset: 12%;
  border-color: rgba(208, 163, 58, 0.26);
  animation-direction: reverse;
  animation-duration: 14s;
}

.approach-trace i:nth-child(1) {
  inset: 24%;
  border-color: rgba(46, 154, 146, 0.38);
  animation-duration: 11s;
}

.approach-trace i:nth-child(2) {
  inset: -16%;
  border-color: rgba(244, 234, 211, 0.05);
  animation-direction: reverse;
  animation-duration: 26s;
}

.approach-trace i:nth-child(3) {
  display: none;
}

@keyframes traceTurn {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 800px) {
  html {
    scroll-padding-top: 148px;
  }

  .site-header,
  .site-header.scrolled {
    top: 8px;
    width: calc(100% - 16px);
    height: auto;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
    padding: 7px 9px 8px;
    border-color: var(--line);
    border-radius: 18px;
    background: rgba(3, 19, 31, 0.9);
    box-shadow: 0 14px 42px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(18px);
  }

  .brand {
    justify-self: center;
  }

  .brand-mark {
    width: 36px;
  }

  .brand-copy strong {
    font-size: 17px;
  }

  .brand-copy small {
    margin-top: 5px;
    font-size: 6px;
  }

  .menu-toggle {
    display: none;
  }

  .site-nav,
  .site-nav.open {
    position: static;
    inset: auto;
    width: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: center;
    gap: 4px;
    padding: 7px 0 0;
    border-top: 1px solid var(--line);
    background: transparent;
    transform: none;
    transition: none;
  }

  .site-nav > a:not(.nav-cta) {
    padding: 7px 2px;
    border: 0;
    border-radius: 999px;
    font: 700 9px / 1 Inter, system-ui, sans-serif;
    letter-spacing: 0.01em;
    text-align: center;
    opacity: 0.52;
  }

  .site-nav > a:not(.nav-cta)::after {
    display: none;
  }

  .site-nav > a:not(.nav-cta).active {
    background: rgba(208, 163, 58, 0.15);
    color: var(--gold-soft);
    opacity: 1;
  }

  .site-nav .nav-cta {
    grid-column: 1 / -1;
    display: block;
    margin: 1px 0 0;
    padding: 8px 12px;
    border-color: var(--gold);
    background: var(--gold);
    color: var(--navy);
    font: 750 10px / 1 Inter, system-ui, sans-serif;
    letter-spacing: 0.02em;
    text-align: center;
  }

  .hero {
    min-height: 100svh;
    grid-template-areas: "mobile-hero-stage";
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    overflow: clip;
    padding: 150px 0 36px;
  }

  .hero-content,
  .hero-visual {
    grid-area: mobile-hero-stage;
    align-self: center;
  }

  .hero-visual {
    min-height: calc(100svh - 186px);
    pointer-events: none;
  }

  .hero-content {
    position: relative;
    z-index: 2;
    isolation: isolate;
    width: min(100%, 620px);
    max-width: 620px;
    margin-inline: auto;
    padding: 27px 20px 25px;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .hero-content::before {
    position: absolute;
    z-index: 0;
    inset: -8% -5%;
    border-radius: 50%;
    background: radial-gradient(
      circle at 50% 50%,
      rgba(3, 19, 31, 0.92) 0%,
      rgba(3, 19, 31, 0.8) 50%,
      rgba(3, 19, 31, 0.5) 68%,
      rgba(3, 19, 31, 0.16) 82%,
      transparent 91%
    );
    content: "";
    filter: blur(5px);
    pointer-events: none;
  }

  .hero-content > * {
    position: relative;
    z-index: 1;
  }

  .fafau-builder {
    width: min(86vw, 390px);
  }

  .build-sequence {
    width: min(94vw, 420px);
    margin-top: 28px;
  }

  .approach-trace {
    width: 190px;
  }

  .approach-arrow,
  .approach-dots button {
    position: relative;
    z-index: 5;
    touch-action: manipulation;
  }
}

/* Mobile opening: let the mark assemble before the hero message takes over. */
@media (max-width: 800px) and (prefers-reduced-motion: no-preference) {
  .hero-visual {
    animation: mobileLogoStage 7.2s cubic-bezier(0.2, 0.72, 0.2, 1) both;
  }

  .hero-content {
    opacity: 0;
    pointer-events: none;
    animation: mobileCopyStage 7.2s cubic-bezier(0.2, 0.72, 0.2, 1) both;
  }

  .fafau-layer,
  .fafau-builder::before,
  .fafau-builder::after,
  .fafau-builder-caption {
    animation-duration: 9.6s;
    animation-iteration-count: 1;
    animation-fill-mode: both;
  }

  body.mobile-intro-complete .fafau-layer {
    animation: none;
    opacity: 1;
    filter: none;
    transform: none;
  }

  body.mobile-intro-complete .fafau-builder::before,
  body.mobile-intro-complete .fafau-builder::after {
    animation: none;
    opacity: 0.12;
    transform: scale(1.14) rotate(180deg);
  }

  body.mobile-intro-complete .fafau-builder-caption,
  body.mobile-intro-complete .build-sequence {
    visibility: hidden;
    opacity: 0;
  }
}

@keyframes mobileLogoStage {
  0%, 36% {
    opacity: 1;
    visibility: visible;
    filter: none;
    transform: none;
  }
  68%, 100% {
    opacity: 0.56;
    visibility: visible;
    filter: saturate(0.9);
    transform: scale(1.08);
  }
}

@keyframes mobileCopyStage {
  0%, 36% {
    opacity: 0;
    pointer-events: none;
    transform: translateY(18px);
  }
  68%, 100% {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }
}

@media (max-width: 390px) {
  .hero-content {
    padding: 24px 17px 22px;
  }

  .fafau-builder {
    width: min(92vw, 350px);
  }

  .fafau-builder-caption {
    bottom: -8px;
    font-size: 14px;
  }

  .build-sequence li {
    font-size: 7px;
    letter-spacing: 0.08em;
  }
}

@media (max-width: 800px) and (prefers-reduced-motion: reduce) {
  .hero-visual {
    opacity: 0.56;
    filter: saturate(0.9);
    transform: scale(1.08);
  }

  .hero .fafau-builder-caption,
  .build-sequence {
    visibility: hidden;
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fafau-builder::before,
  .fafau-builder::after {
    animation: none;
    opacity: 0.1;
    transform: scale(1.14);
  }

  .fafau-layer {
    opacity: 1;
    filter: none;
    transform: none;
  }

  .fafau-builder-caption {
    opacity: 1;
    transform: translateX(-50%);
  }

  .build-sequence li {
    color: var(--cream);
    transform: none;
  }

  .build-sequence li span {
    color: var(--gold);
  }

  .approach-trace::before,
  .approach-trace::after,
  .approach-trace i {
    animation: none;
  }
}
