:root {
  color-scheme: dark;
  --gold: #e4bd65;
  --bright-gold: #ffe7a6;
  --marble: #f0eadb;
  --ink: #050403;
  --line: rgba(228, 189, 101, 0.55);
  --panel: rgba(5, 4, 3, 0.78);
  --panel-strong: rgba(5, 4, 3, 0.9);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--ink);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  background:
    linear-gradient(rgba(5, 4, 3, 0.28), rgba(5, 4, 3, 0.86)),
    url("https://infinitycodex.online/assets/homepage-background.png") center / cover fixed,
    var(--ink);
}

a {
  color: inherit;
}

.space-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0 48px;
}

.hero {
  min-height: min(74vh, 760px);
  display: grid;
  align-items: end;
  padding: clamp(28px, 6vw, 78px) 0;
}

.hero-copy,
.contact-hero {
  width: min(730px, 100%);
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.76);
}

.eyebrow,
.section-label {
  margin: 0 0 10px;
  color: var(--bright-gold);
  font: 700 12px/1.2 "Segoe UI", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  color: var(--bright-gold);
  font-size: clamp(44px, 8vw, 94px);
  line-height: 0.94;
}

h2 {
  color: var(--bright-gold);
  font-size: 25px;
  line-height: 1.08;
}

.lead,
.contact-hero p {
  max-width: 660px;
  color: #f2dba2;
  font: 18px/1.55 "Segoe UI", sans-serif;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.action {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--bright-gold);
  background: rgba(5, 4, 3, 0.74);
  font: 700 14px/1 "Segoe UI", sans-serif;
  text-decoration: none;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34);
}

.action.primary {
  color: #140d04;
  background: linear-gradient(180deg, #ffe9aa, #c78a2e);
}

.signal-grid,
.directory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.signal-card,
.directory-card,
.profile-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(18, 13, 6, 0.86), rgba(5, 4, 3, 0.78)),
    rgba(5, 4, 3, 0.72);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.42);
}

.signal-card {
  min-height: 132px;
  display: grid;
  align-content: end;
  padding: 18px;
  text-decoration: none;
}

.signal-card span {
  color: var(--bright-gold);
  font-size: 24px;
}

.signal-card strong {
  margin-top: 7px;
  color: #d8c48f;
  font: 600 13px/1.35 "Segoe UI", sans-serif;
}

.cookie-note {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid rgba(228, 189, 101, 0.38);
  border-radius: 8px;
  color: #d8c48f;
  background: rgba(5, 4, 3, 0.72);
  font: 13px/1.45 "Segoe UI", sans-serif;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.32);
}

.cookie-note strong {
  display: block;
  margin-bottom: 5px;
  color: var(--bright-gold);
}

.cookie-note p {
  margin: 0;
}

.top-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0 28px;
  font: 700 14px/1 "Segoe UI", sans-serif;
}

.top-nav a {
  padding: 10px 12px;
  border: 1px solid rgba(228, 189, 101, 0.36);
  border-radius: 6px;
  background: rgba(5, 4, 3, 0.72);
  text-decoration: none;
}

.contact-shell {
  padding-bottom: 70px;
}

.contact-hero {
  padding: 54px 0 28px;
}

.profile-card {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(260px, 1fr);
  gap: 22px;
  margin: 0 0 16px;
  padding: clamp(22px, 4vw, 34px);
}

.profile-card h2 {
  margin-bottom: 7px;
  font-size: clamp(32px, 5vw, 52px);
}

.role {
  color: #efd391;
  font: 700 15px/1.35 "Segoe UI", sans-serif;
  text-transform: uppercase;
}

.contact-lines {
  display: grid;
  gap: 10px;
}

.contact-lines p {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  margin: 0;
  color: #e8d4a1;
  font: 14px/1.35 "Segoe UI", sans-serif;
}

.contact-lines strong {
  color: var(--bright-gold);
}

.contact-record {
  margin: 0 0 16px;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(18, 13, 6, 0.9), rgba(5, 4, 3, 0.82)),
    rgba(5, 4, 3, 0.76);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.42);
}

.contact-record form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.contact-record label {
  display: grid;
  gap: 7px;
}

.contact-record label span {
  color: var(--bright-gold);
  font: 700 12px/1 "Segoe UI", sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.contact-record input,
.contact-record select,
.contact-record textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(228, 189, 101, 0.52);
  border-radius: 6px;
  color: #ffeeb7;
  background:
    linear-gradient(180deg, rgba(7, 6, 4, 0.94), rgba(22, 16, 8, 0.9));
  padding: 10px 12px;
  font: 14px/1.35 "Segoe UI", sans-serif;
}

.contact-record textarea {
  resize: vertical;
}

.contact-record .wide-field {
  grid-column: 1 / -1;
}

.contact-record button {
  justify-self: start;
  min-height: 46px;
  padding: 12px 18px;
  border: 1px solid rgba(255, 231, 166, 0.86);
  border-radius: 6px;
  color: #140d04;
  background: linear-gradient(180deg, #ffe9aa, #c78a2e);
  font: 800 14px/1 "Segoe UI", sans-serif;
  text-transform: uppercase;
}

.directory-card {
  min-height: 300px;
  padding: 22px;
}

.directory-card ul {
  display: grid;
  gap: 14px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.directory-card li {
  display: grid;
  gap: 5px;
}

.directory-card strong {
  color: var(--bright-gold);
  font-size: 16px;
}

.directory-card span {
  color: #ddc792;
  font: 14px/1.45 "Segoe UI", sans-serif;
}

@media (max-width: 860px) {
  .space-shell {
    width: min(100% - 22px, 680px);
  }

  .signal-grid,
  .directory-grid,
  .profile-card,
  .contact-record form {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding: 64px 0 30px;
  }

  .contact-lines p {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* Interactive Infinity Codex gateway */
body.landing-page {
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at center, rgba(12, 42, 48, 0.5), rgba(2, 2, 2, 0.96) 68%),
    #020202;
}

.codex-gateway {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.lattice-stage {
  position: relative;
  width: min(100vw, 150vh);
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: #020202;
  box-shadow: 0 0 90px rgba(0, 0, 0, 0.72);
}

.landing-art {
  position: absolute;
  inset: 0;
  background: url("./infinity-codex-landing-page.png") center / cover no-repeat;
}

.signal-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.signal-path {
  fill: none;
  stroke: var(--signal-color, #ffe7a6);
  stroke-width: 0.32;
  stroke-linecap: round;
  stroke-dasharray: 42;
  stroke-dashoffset: 42;
  opacity: 0;
  filter: url("#signalGlow");
}

.signal-path.preview {
  opacity: 0.52;
  stroke-dashoffset: 0;
}

.signal-path.pulse {
  animation: signalPulse 0.78s ease-out forwards;
}

.mirror-ripple {
  fill: url("#mirrorGlow");
  opacity: 0;
  transform-origin: center;
}

.mirror-ripple.active {
  animation: mirrorRipple 0.88s ease-out forwards;
}

.mirror-link {
  position: absolute;
  left: 50%;
  top: 48.3%;
  width: 17%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  color: var(--bright-gold);
  text-decoration: none;
  outline-offset: 6px;
}

.mirror-link::before {
  content: "";
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 236, 165, 0.24), rgba(0, 213, 255, 0.04) 48%, transparent 70%);
  opacity: 0;
  transition: opacity 180ms ease, transform 180ms ease;
}

.mirror-link:hover::before,
.mirror-link:focus-visible::before,
.mirror-link.active::before {
  opacity: 1;
  transform: scale(1.08);
}

.mirror-label {
  position: absolute;
  left: 50%;
  bottom: 108%;
  min-width: clamp(160px, 20vw, 320px);
  padding: 10px 14px;
  transform: translateX(-50%) translateY(8px);
  border: 1px solid rgba(255, 231, 166, 0.7);
  border-radius: 6px;
  color: #ffeeb7;
  background: rgba(5, 4, 3, 0.86);
  font: 700 clamp(11px, 1.2vw, 14px)/1.25 "Segoe UI", sans-serif;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.95);
  letter-spacing: 0.05em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.mirror-label.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.force-node {
  position: absolute;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  width: var(--size, 10.5%);
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid rgba(255, 231, 166, 0.0);
  border-radius: 50%;
  background: transparent;
  transform: translate(-50%, -50%);
  outline-offset: 5px;
}

.force-node::before {
  content: "";
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--force-color) 28%, transparent), transparent 64%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--force-color) 28%, transparent);
  opacity: 0;
  transition: opacity 160ms ease, transform 160ms ease;
}

.force-node img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  filter:
    drop-shadow(0 0 12px color-mix(in srgb, var(--force-color) 76%, transparent))
    drop-shadow(0 0 20px rgba(0, 0, 0, 0.8));
  transform: scale(0.92);
  transition: opacity 160ms ease, transform 160ms ease;
}

.force-node:hover::before,
.force-node:focus-visible::before,
.force-node.active::before,
.force-node:hover img,
.force-node:focus-visible img,
.force-node.active img {
  opacity: 1;
}

.force-node:hover img,
.force-node:focus-visible img,
.force-node.active img {
  transform: scale(1.04);
}

.cookie-note {
  position: absolute;
  left: clamp(10px, 2vw, 28px);
  right: auto;
  bottom: clamp(10px, 1.8vw, 24px);
  z-index: 4;
  width: min(420px, calc(100% - 20px));
  margin: 0;
  padding: 12px 14px;
  opacity: 0.9;
}

.fallback-nav {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.is-transitioning .landing-art {
  animation: centerManifest 0.92s ease-in forwards;
}

@keyframes signalPulse {
  0% {
    opacity: 0;
    stroke-dashoffset: 42;
  }
  18% {
    opacity: 0.95;
  }
  100% {
    opacity: 0;
    stroke-dashoffset: 0;
  }
}

@keyframes mirrorRipple {
  0% {
    opacity: 0;
    transform: scale(0.72);
  }
  30% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
    transform: scale(2.8);
  }
}

@keyframes centerManifest {
  0% {
    filter: brightness(1) contrast(1);
    transform: scale(1);
  }
  100% {
    filter: brightness(1.24) contrast(1.12);
    transform: scale(1.08);
  }
}

@media (max-width: 720px), (max-aspect-ratio: 1/1) {
  body.landing-page {
    overflow: hidden;
  }

  .codex-gateway {
    align-items: start;
  }

  .lattice-stage {
    position: fixed;
    left: 50%;
    top: 0;
    width: 150vh;
    height: 100vh;
    max-width: none;
    min-height: 100vh;
    transform: translateX(-50%);
    aspect-ratio: auto;
  }

  .cookie-note {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
  }

  .mirror-label {
    min-width: 210px;
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .signal-path,
  .mirror-ripple,
  .landing-art,
  .force-node img,
  .force-node::before,
  .mirror-label {
    animation: none !important;
    transition: none !important;
  }
}
