:root {
  color-scheme: dark;
  --ink: #f5ffec;
  --muted: #98a995;
  --green: #88ff00;
  --green-soft: #35c800;
  --green-deep: #073f13;
  --black: #020604;
  --panel: rgba(4, 13, 8, 0.64);
  --line: rgba(151, 255, 74, 0.22);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--black);
  color: var(--ink);
}

button, input { font: inherit; }

.skip-link {
  position: fixed;
  z-index: 100;
  left: 1rem;
  top: 1rem;
  transform: translateY(-180%);
  padding: .75rem 1rem;
  border-radius: .5rem;
  background: var(--green);
  color: #041000;
  font-weight: 800;
  transition: transform .2s ease;
}

.skip-link:focus { transform: translateY(0); }

.gateway {
  position: relative;
  display: grid;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 40%, rgba(36, 104, 0, .14), transparent 31rem),
    linear-gradient(135deg, #000 0%, #030b06 44%, #000 100%);
}

.starfield, .aurora, .portal {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.starfield { z-index: -4; opacity: .75; }

.aurora {
  z-index: -3;
  opacity: .42;
  background:
    radial-gradient(ellipse at 10% 80%, rgba(27, 255, 0, .12), transparent 34%),
    radial-gradient(ellipse at 92% 15%, rgba(116, 255, 0, .11), transparent 28%);
  filter: blur(28px);
  animation: breathe 7s ease-in-out infinite alternate;
}

.portal {
  z-index: 20;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  background: #010301;
}

.portal span {
  position: absolute;
  width: min(42vw, 31rem);
  aspect-ratio: 1;
  border: 2px solid rgba(135, 255, 32, .88);
  box-shadow: 0 0 32px rgba(123, 255, 0, .82), inset 0 0 32px rgba(123, 255, 0, .55);
  transform: rotate(45deg) scale(.08);
}

.portal span:nth-child(2) { opacity: .54; animation-delay: .09s; }
.portal span:nth-child(3) { opacity: .26; animation-delay: .18s; }

.experience {
  display: grid;
  grid-template-columns: minmax(18rem, 1.08fr) minmax(20rem, .92fr);
  align-items: center;
  width: min(94rem, 100%);
  min-height: calc(100svh - 5rem);
  margin: auto;
  padding: clamp(2.5rem, 5vw, 5.5rem);
  gap: clamp(1.5rem, 5vw, 6rem);
}

.brand-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: min(70svh, 50rem);
  perspective: 1000px;
}

.brand-stage::before {
  content: "";
  position: absolute;
  width: min(72%, 34rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(86, 255, 0, .16);
  filter: blur(70px);
  animation: cube-bloom 3.4s 1.4s ease-out both;
}

.orbit {
  position: absolute;
  width: min(72%, 37rem);
  aspect-ratio: 1;
  border: 1px solid rgba(135, 255, 25, .14);
  border-radius: 50%;
  transform: rotateX(67deg) rotateZ(-13deg);
  animation: orbit 18s linear infinite;
}

.orbit::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 14px var(--green);
}

.orbit-two {
  width: min(58%, 30rem);
  opacity: .5;
  transform: rotateX(73deg) rotateZ(39deg);
  animation-duration: 13s;
  animation-direction: reverse;
}

.logo-shell {
  position: relative;
  width: min(100%, 38rem);
  aspect-ratio: 600 / 762;
  transform: translateZ(0);
  animation: hover 6s 3.2s ease-in-out infinite;
}

.logo-ghost, .logo-shards img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-ghost {
  opacity: 0;
  filter: drop-shadow(0 0 18px rgba(92, 255, 0, .33));
  animation: ghost-in 1s 2.8s ease-out forwards;
}

.logo-shards { position: absolute; inset: 0; }

.logo-shards img {
  opacity: 0;
  filter: drop-shadow(0 0 14px rgba(89, 255, 0, .55));
  transform: translate3d(var(--tx), var(--ty), var(--tz)) rotate(var(--rz)) scale(.7);
  animation: assemble 1.75s cubic-bezier(.14, .72, .16, 1) forwards;
  animation-delay: var(--delay);
}

.logo-scan {
  position: absolute;
  inset: 3% 0;
  opacity: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(194, 255, 145, .8) 48%, #fff 50%, transparent 53%);
  mix-blend-mode: screen;
  filter: blur(1px);
  transform: translateY(-50%);
  animation: scan 1.3s 2.45s ease-in-out forwards;
}

.gate-panel {
  position: relative;
  opacity: 0;
  transform: translateY(1.4rem);
  padding: clamp(1.5rem, 3.5vw, 3rem);
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: linear-gradient(145deg, rgba(8, 20, 11, .82), rgba(2, 8, 4, .57));
  box-shadow: 0 28px 80px rgba(0, 0, 0, .45), inset 0 1px rgba(255, 255, 255, .04);
  backdrop-filter: blur(18px);
  animation: panel-in .8s 2.7s ease-out forwards;
}

.gate-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(120, 255, 22, .3), transparent) top / 45% 1px no-repeat;
}

.eyebrow {
  margin: 0 0 1.15rem;
  color: var(--green);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: .82rem;
  font-weight: 750;
  letter-spacing: .16em;
}

h1 {
  max-width: 10ch;
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 5.6rem);
  line-height: .91;
  letter-spacing: -.06em;
  text-wrap: balance;
}

.prompt {
  margin: clamp(1.5rem, 4vh, 2.5rem) 0 1.1rem;
  color: #dcebd8;
  font-size: clamp(1rem, 1.4vw, 1.18rem);
}

fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }

.code-entry {
  display: grid;
  grid-template-columns: minmax(3.4rem, 1fr) auto minmax(3.4rem, 1fr) auto minmax(3.4rem, 1fr) auto minmax(3.4rem, 1fr);
  align-items: center;
  margin-bottom: 1rem;
}

.code-entry span {
  margin: 0 .38rem;
  color: #4c6846;
  font-size: 1.4rem;
}

.code-entry input {
  width: 100%;
  min-height: 4.2rem;
  border: 1px solid rgba(145, 255, 69, .23);
  border-radius: .65rem;
  outline: none;
  background: rgba(0, 0, 0, .52);
  color: var(--ink);
  caret-color: var(--green);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: clamp(1.55rem, 3.1vw, 2.35rem);
  font-weight: 800;
  letter-spacing: .11em;
  text-align: center;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s ease;
}

.code-entry input:hover { border-color: rgba(145, 255, 69, .48); }

.code-entry input:focus {
  border-color: var(--green);
  background: rgba(22, 53, 9, .48);
  box-shadow: 0 0 0 3px rgba(130, 255, 30, .13), 0 0 26px rgba(100, 255, 0, .11);
  transform: translateY(-2px);
}

.enter-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 3.9rem;
  padding: .25rem .35rem .25rem 1.25rem;
  border: 1px solid var(--green);
  border-radius: 999px;
  background: transparent;
  color: var(--green);
  cursor: pointer;
  font-size: .92rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
  transition: background .25s ease, color .25s ease, box-shadow .25s ease, transform .25s ease;
}

.enter-button:hover, .enter-button:focus-visible {
  outline: none;
  background: var(--green);
  color: #061000;
  box-shadow: 0 0 28px rgba(128, 255, 18, .24);
  transform: translateY(-2px);
}

.button-arrow {
  display: grid;
  place-items: center;
  width: 3.15rem;
  height: 3.15rem;
  border-radius: 50%;
  background: var(--green);
  color: #051000;
  font-size: 1.25rem;
  transition: transform .25s ease, background .25s ease;
}

.enter-button:hover .button-arrow, .enter-button:focus-visible .button-arrow {
  background: #061000;
  color: var(--green);
  transform: rotate(45deg);
}

.status {
  min-height: 1.4em;
  margin: .85rem .25rem 0;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: .82rem;
  line-height: 1.45;
}

.gate-panel.is-wrong {
  opacity: 1;
  transform: translateY(0);
  animation: shake .42s ease both;
}
.gate-panel.is-wrong .status { color: #d7ffbc; }
.gate-panel.is-ready .status { color: var(--green); }
.gate-panel.is-ready input {
  border-color: var(--green);
  background: rgba(47, 111, 9, .3);
  box-shadow: 0 0 20px rgba(117, 255, 18, .14);
}

footer {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  padding: 1.5rem clamp(1.5rem, 4vw, 4rem);
  color: #6f806d;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .15em;
}

.footer-signal { display: flex; align-items: center; gap: .55rem; }
.footer-signal i {
  width: .45rem;
  height: .45rem;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: signal 1.8s ease-in-out infinite;
}

.portal-open .experience, .portal-open footer {
  animation: world-away 1s cubic-bezier(.65, 0, .35, 1) forwards;
}

.portal-open .portal {
  visibility: visible;
  animation: portal-bg 1.1s ease forwards;
}

.portal-open .portal span { animation: portal-expand 1.05s cubic-bezier(.2, .8, .2, 1) forwards; }

.noscript-card {
  position: fixed;
  z-index: 200;
  inset: auto 1rem 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: #071009;
  text-align: center;
}

.noscript-card a { color: var(--green); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@keyframes assemble {
  0% { opacity: 0; transform: translate3d(var(--tx), var(--ty), var(--tz)) rotate(var(--rz)) scale(.7); }
  55% { opacity: .94; }
  100% { opacity: 1; transform: translate3d(0, 0, 0) rotate(0) scale(1); }
}
@keyframes ghost-in { to { opacity: .33; } }
@keyframes scan { 0% { opacity: 0; transform: translateY(-60%); } 20% { opacity: .75; } 100% { opacity: 0; transform: translateY(66%); } }
@keyframes panel-in { to { opacity: 1; transform: translateY(0); } }
@keyframes cube-bloom { 0% { opacity: 0; transform: scale(.4); } 55% { opacity: .9; } 100% { opacity: .35; transform: scale(1); } }
@keyframes hover { 0%, 100% { transform: translateY(0) rotateY(-2deg); } 50% { transform: translateY(-12px) rotateY(2deg); } }
@keyframes orbit { to { transform: rotateX(67deg) rotateZ(347deg); } }
@keyframes breathe { to { opacity: .72; transform: scale(1.08); } }
@keyframes signal { 50% { opacity: .35; transform: scale(.7); } }
@keyframes shake { 25% { transform: translateX(-7px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }
@keyframes world-away { to { opacity: 0; transform: scale(1.45); filter: blur(18px); } }
@keyframes portal-bg { to { opacity: 1; } }
@keyframes portal-expand { 0% { transform: rotate(45deg) scale(.06); } 100% { transform: rotate(225deg) scale(4.5); opacity: 0; } }

@media (max-width: 820px) {
  .experience {
    grid-template-columns: 1fr;
    align-content: center;
    min-height: 100svh;
    padding: 2rem 1.15rem 5rem;
    gap: .25rem;
  }

  .brand-stage { min-height: clamp(18rem, 42svh, 26rem); }
  .logo-shell { width: min(82vw, 21rem); }
  .orbit { width: min(74vw, 22rem); }
  .gate-panel { width: min(100%, 34rem); margin-inline: auto; padding: 1.35rem; }
  h1 { max-width: none; font-size: clamp(2.3rem, 12vw, 4.2rem); }
  .prompt { margin-top: 1.15rem; }
  .code-entry input { min-height: 3.75rem; }
  footer { padding: 1.1rem 1.25rem; }
}

@media (max-width: 390px) {
  .brand-stage { min-height: 16rem; }
  .code-entry span { margin-inline: .18rem; }
  .code-entry input { min-width: 0; font-size: 1.4rem; }
  footer span:first-child { display: none; }
  footer { justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; }
  .logo-ghost { opacity: .33; }
  .gate-panel { opacity: 1; transform: none; }
  .logo-shards img { opacity: 1; transform: none; }
}
