:root {
  --navy-950: #050812;
  --navy-900: #070b18;
  --navy-800: #0d1630;
  --navy-700: #17264a;
  --yellow: #f0ca45;
  --yellow-soft: rgba(240, 202, 69, 0.55);
  --blue-line: rgba(128, 159, 208, 0.17);
  --blue-faint: rgba(151, 180, 226, 0.07);
  --intro-duration: 1.65s;
  --logo-width: min(59vw, 760px, calc(92svh * 2.7));
}

* { box-sizing: border-box; }

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

body {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: none;
  background: var(--navy-900);
  color: #fff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.intro-active { overflow: hidden; }

body[data-page="project"] .intro {
  position: fixed;
  inset: 0;
  z-index: 30;
  transition: opacity .38s cubic-bezier(.22,.76,.24,1), transform .38s cubic-bezier(.22,.76,.24,1), visibility .38s linear;
}

body[data-page="project"] .intro.intro--complete {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(1.012);
}

.intro {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  min-height: min(320px, 100dvh);
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(ellipse at 50% 48%, rgba(37, 57, 102, 0.2), transparent 42%),
    radial-gradient(ellipse at 50% 125%, rgba(13, 31, 68, 0.28), transparent 48%),
    var(--navy-900);
}

.intro::before,
.intro::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
}

.intro::before {
  background:
    radial-gradient(ellipse at 50% 48%, transparent 0 18%, rgba(4, 7, 15, 0.12) 52%, rgba(2, 4, 9, 0.44) 100%),
    radial-gradient(circle at 24% 22%, rgba(103, 142, 209, 0.05), transparent 30%);
}

.intro::after {
  opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(240, 202, 69, 0.045), transparent);
  transform: translateX(-120%);
  animation: horizon-flash .9s .42s cubic-bezier(.2,.7,.2,1) forwards;
}

.atmosphere,
.terrain,
.terrain__contours,
.signal,
.field,
.nodes,
.logo-lockup,
.edge-mark { position: absolute; }

.atmosphere {
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.atmosphere__wash {
  position: absolute;
  width: min(58vmax, 860px);
  aspect-ratio: 1;
  border-radius: 48% 52% 62% 38% / 44% 38% 62% 56%;
  filter: blur(34px);
  opacity: 0;
  will-change: transform, opacity;
}

.atmosphere__wash--amber {
  top: -34%;
  left: -12%;
  background: radial-gradient(ellipse at 54% 58%, rgba(240, 202, 69, 0.1), rgba(240, 202, 69, 0.02) 42%, transparent 72%);
  transform: rotate(-18deg) scale(.8);
  animation: wash-drift-amber 16s .4s ease-out forwards;
}

.atmosphere__wash--blue {
  right: -16%;
  bottom: -42%;
  background: radial-gradient(ellipse at 42% 42%, rgba(65, 108, 184, 0.14), rgba(65, 108, 184, 0.03) 48%, transparent 74%);
  transform: rotate(22deg) scale(.82);
  animation: wash-drift-blue 18s .9s ease-out forwards;
}

.terrain { inset: -4%; z-index: -1; will-change: transform; transform: translate3d(calc(var(--pointer-x, 0) * -0.55px), calc(var(--pointer-y, 0) * -0.55px), 0); }

.terrain__contours { width: 100%; height: 100%; opacity: 0.8; }

.contour { fill: none; stroke: var(--blue-line); stroke-width: 1; stroke-linecap: round; vector-effect: non-scaling-stroke; stroke-dasharray: 10 18 96 22; }
.contour--one { opacity: .7; animation: terrain-drift 12s .3s ease-out both; }
.contour--two { opacity: .52; animation: terrain-drift-reverse 14s .65s ease-out both; }
.contour--three { opacity: .32; animation: terrain-drift 18s .5s ease-out both; }

.signal {
  z-index: 1;
  width: min(100vw, 1440px);
  height: 1px;
  opacity: 0;
  transform: translate3d(-34%, 0, 0);
  animation: signal-pass .75s .16s cubic-bezier(.16,.78,.23,1) forwards;
}

.signal::before,
.signal::after,
.signal__beam,
.signal__core {
  content: "";
  position: absolute;
  top: 0;
  height: 100%;
}

.signal::before { left: 0; width: 100%; background: linear-gradient(90deg, transparent 0%, rgba(124, 166, 230, .08) 42%, rgba(124, 166, 230, .24) 49%, rgba(240, 202, 69, .78) 50%, rgba(124, 166, 230, .24) 51%, rgba(124, 166, 230, .08) 58%, transparent 100%); filter: blur(1px); }
.signal__beam { left: 0; width: 100%; background: linear-gradient(90deg, transparent 0 47%, rgba(240, 202, 69, .86) 49.5%, #fff3af 50%, rgba(240, 202, 69, .86) 50.5%, transparent 53%); box-shadow: 0 0 20px rgba(240, 202, 69, .55); }
.signal__core { left: 50%; width: 1px; background: #fff7ce; box-shadow: 0 0 10px 2px rgba(240, 202, 69, .8); }

.field {
  z-index: 0;
  width: min(68vw, 900px, 92svh);
  aspect-ratio: 1;
  opacity: 0;
  will-change: transform, opacity;
  transform: scale(.36) translate3d(calc(var(--pointer-x, 0) * 0.7px), calc(var(--pointer-y, 0) * 0.7px), 0);
  animation: field-arrive 1.05s .18s cubic-bezier(.16,.73,.22,1) forwards;
}

.field__ring { position: absolute; inset: 0; border: 1px solid rgba(103, 142, 209, .18); border-radius: 50%; transform: scale(.3); }
.field__ring::after { content: ""; position: absolute; inset: 22%; border: 1px solid rgba(240, 202, 69, .18); border-radius: inherit; }
.field__ring--one { animation: ring-pulse 1.2s .12s ease-out forwards; }
.field__ring--two { inset: 13%; animation: ring-pulse 1.25s .24s ease-out forwards; }
.field__ring--three { inset: 25%; animation: ring-pulse 1.3s .36s ease-out forwards; }

.nodes { z-index: 2; width: min(62vw, 620px, 78svh); height: auto; opacity: 0; will-change: transform, opacity; transform: translate3d(calc(var(--pointer-x, 0) * 0.9px), calc(var(--pointer-y, 0) * 0.9px), 0); animation: nodes-fade .8s .62s ease-out forwards; }
.nodes__path { fill: none; stroke: rgba(240, 202, 69, .68); stroke-width: 1; stroke-dasharray: 5 11; stroke-linecap: round; animation: node-path 1.05s .5s cubic-bezier(.2,.8,.2,1) both; }
.nodes__dot { fill: var(--yellow); opacity: .85; transform-box: fill-box; transform-origin: center; animation: dot-pop .48s .62s cubic-bezier(.2,.8,.2,1) both; }
.nodes__dot--two { animation-delay: .7s; }
.nodes__dot--three { animation-delay: .78s; }
.nodes__dot--four { animation-delay: .86s; }

.logo-lockup {
  z-index: 3;
  display: grid;
  place-items: center;
  width: var(--logo-width);
  aspect-ratio: 2172 / 724;
  will-change: transform;
  transform: translate3d(calc(var(--pointer-x, 0) * 1px), calc(var(--pointer-y, 0) * 1px), 0) scale(.92);
  animation: logo-settle .72s .68s cubic-bezier(.17,.84,.25,1) forwards, logo-breathe 6s 1.5s ease-in-out infinite;
}

.logo-lockup__image,
.logo-lockup__aura,
.logo-lockup__scan { position: absolute; inset: 0; width: 100%; height: 100%; }

.logo-lockup__image {
  display: block;
  object-fit: contain;
  will-change: clip-path;
  filter: drop-shadow(0 22px 45px rgba(0, 0, 0, .28)) drop-shadow(0 0 20px rgba(240, 202, 69, .06));
  clip-path: inset(0 100% 0 0);
  animation: logo-reveal .7s .7s cubic-bezier(.16,.78,.19,1) forwards;
}

.logo-lockup__aura {
  inset: -18%;
  width: 136%;
  height: 136%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(240, 202, 69, .12), rgba(81, 128, 214, .06) 35%, transparent 68%);
  filter: blur(18px);
  will-change: transform, opacity;
  opacity: 0;
  animation: aura-arrive .72s .82s ease-out forwards, aura-breathe 5.8s 1.55s ease-in-out infinite;
}

.logo-lockup__scan {
  z-index: 1;
  width: 2px;
  background: linear-gradient(180deg, transparent, rgba(255, 245, 176, .95), transparent);
  box-shadow: 0 0 22px rgba(240, 202, 69, .7);
  opacity: 0;
  transform: translateX(-50%);
  animation: scan-logo .62s .72s cubic-bezier(.16,.75,.22,1) forwards;
}

.edge-mark { z-index: 4; top: 50%; width: 34px; height: 1px; background: var(--yellow); opacity: 0; box-shadow: 0 0 14px rgba(240, 202, 69, .55); }
.edge-mark--left { right: calc(50% + min(31vw, 390px)); transform: translate(-20px, -50%); animation: edge-in .5s .84s ease-out forwards; }
.edge-mark--right { left: calc(50% + min(31vw, 390px)); transform: translate(20px, -50%); animation: edge-in .5s .94s ease-out forwards; }

@keyframes terrain-drift { from { opacity: 0; transform: translate3d(-2%, -1%, 0); } to { opacity: 1; transform: translate3d(0, 0, 0); } }
@keyframes terrain-drift-reverse { from { opacity: 0; transform: translate3d(2%, 1%, 0); } to { opacity: 1; transform: translate3d(0, 0, 0); } }
@keyframes wash-drift-amber { from { opacity: 0; transform: translate3d(-6%, -3%, 0) rotate(-18deg) scale(.8); } 28% { opacity: .8; } to { opacity: .44; transform: translate3d(4%, 2%, 0) rotate(-7deg) scale(1.02); } }
@keyframes wash-drift-blue { from { opacity: 0; transform: translate3d(7%, 6%, 0) rotate(22deg) scale(.82); } 28% { opacity: .75; } to { opacity: .42; transform: translate3d(-4%, -4%, 0) rotate(11deg) scale(1.06); } }
@keyframes signal-pass { 0% { opacity: 0; transform: translate3d(-34%, 0, 0); } 18% { opacity: 1; } 76% { opacity: .95; } 100% { opacity: 0; transform: translate3d(34%, 0, 0); } }
@keyframes field-arrive { 0% { opacity: 0; transform: scale(.36); } 20% { opacity: .8; } 100% { opacity: .23; transform: scale(1); } }
@keyframes ring-pulse { 0% { opacity: 0; transform: scale(.3); } 28% { opacity: 1; } 100% { opacity: 0; transform: scale(1.35); } }
@keyframes node-path { from { stroke-dashoffset: 140; opacity: 0; } 35% { opacity: 1; } to { stroke-dashoffset: 0; opacity: .75; } }
@keyframes dot-pop { from { opacity: 0; transform: scale(0); } 55% { opacity: 1; transform: scale(1.35); } to { opacity: .75; transform: scale(1); } }
@keyframes nodes-fade { 0% { opacity: 0; } 30% { opacity: .85; } 100% { opacity: 0; } }
@keyframes logo-settle { from { transform: translate3d(calc(var(--pointer-x, 0) * 1px), calc(var(--pointer-y, 0) * 1px), 0) scale(.92); } to { transform: translate3d(calc(var(--pointer-x, 0) * 1px), calc(var(--pointer-y, 0) * 1px), 0) scale(1); } }
@keyframes logo-reveal { 0% { clip-path: inset(0 100% 0 0); } 100% { clip-path: inset(0 0 0 0); } }
@keyframes scan-logo { 0% { opacity: 0; left: 0; } 18% { opacity: 1; } 88% { opacity: .92; } 100% { opacity: 0; left: 100%; } }
@keyframes aura-arrive { from { opacity: 0; transform: scale(.7); } to { opacity: .85; transform: scale(1); } }
@keyframes aura-breathe { 0%, 100% { opacity: .45; transform: scale(.98); } 50% { opacity: .75; transform: scale(1.04); } }
@keyframes logo-breathe { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.045); } }
@keyframes edge-in { from { opacity: 0; transform: translate(-20px, -50%); } to { opacity: .7; transform: translate(0, -50%); } }
@keyframes horizon-flash { from { opacity: 0; transform: translateX(-120%); } 15% { opacity: 1; } to { opacity: 0; transform: translateX(120%); } }

@media (max-width: 700px), (pointer: coarse) {
  :root { --logo-width: min(90vw, 680px, calc(92svh * 2.7)); }
  .terrain__contours { opacity: .58; }
  .atmosphere__wash { filter: blur(18px); }
  .field { width: min(125vw, 88svh); }
  .nodes { width: min(92vw, 460px, 60svh); }
  .edge-mark { display: none; }
  .contour { stroke-width: 1.2; }
}

@media (update: slow), (prefers-reduced-data: reduce) {
  .atmosphere__wash,
  .nodes,
  .edge-mark,
  .intro::after { display: none; }
  .field { animation-duration: .8s; }
  .logo-lockup,
  .logo-lockup__aura { animation-iteration-count: 1; }
}

@media (max-height: 500px) {
  :root { --logo-width: min(76vw, 760px, calc(92svh * 2.7)); }
  .field { width: min(100vw, 86svh); }
  .nodes { display: none; }
  .terrain__contours { opacity: .48; }
  .atmosphere__wash { filter: blur(22px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .logo-lockup__image { clip-path: inset(0); }
  .logo-lockup { transform: scale(1); }
  .logo-lockup__aura { opacity: .35; }
  .nodes, .signal, .field, .edge-mark, .atmosphere__wash, .intro::after { opacity: 0; }

  body[data-page="project"] .intro.intro--complete {
    transform: none;
    transition: opacity .38s ease, visibility .38s linear;
  }
}
