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

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

.tile {
  position: absolute;
  inset: 0;
  overflow: hidden;
  /* Base marble: deep polished stone */
  background:
    radial-gradient(120% 120% at 30% 20%, #2a2a30 0%, #16161a 45%, #0c0c0f 100%);
}

/*
  The flow layer is oversized and gently rotated. The rotation is a
  rigid transform (no seam), so the horizontal gold/silver streaks
  inside read as diagonal marble veins — without the tile-edge seams
  that a diagonal repeating-gradient would create.
*/
.flows {
  position: absolute;
  top: -30%;
  left: -30%;
  width: 160%;
  height: 160%;
  transform: rotate(-12deg);
  transform-origin: center;
}

/*
  Each flow is a double-width strip. The gradient is purely HORIZONTAL
  (90deg) and periodic — both ends are transparent, so repeat-x has no
  visible seam. We slide the strip by exactly one tile (50% of its own
  width). Start and end frames are pixel-identical: a seamless, infinite
  left-to-right loop with no jump or restart.
*/
.flow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  will-change: transform;
  background-repeat: repeat-x;
  background-size: 50% 100%; /* one tile == one layer width */
  filter: blur(14px);
}

/* GOLD flows — two streaks per tile for fuller coverage */
.gold-1 {
  background-image:
    linear-gradient(90deg,
      rgba(255,215,120,0)    0%,
      rgba(255,201,84,0.35)  7%,
      rgba(255,238,175,0.85) 13%,
      rgba(214,162,44,0.40)  19%,
      rgba(255,215,120,0)    30%,
      rgba(230,180,70,0)     58%,
      rgba(255,228,150,0.55) 66%,
      rgba(200,150,55,0.30)  73%,
      rgba(255,215,120,0)    84%,
      rgba(255,215,120,0)    100%);
  opacity: 0.85;
  animation: drift 26s linear infinite;
}

.gold-2 {
  background-image:
    linear-gradient(90deg,
      rgba(230,180,70,0)    0%,
      rgba(255,228,150,0.5) 9%,
      rgba(190,140,50,0.30) 17%,
      rgba(230,180,70,0)    30%,
      rgba(230,180,70,0)    58%,
      rgba(255,232,160,0.5) 68%,
      rgba(190,140,50,0.28) 77%,
      rgba(230,180,70,0)    90%,
      rgba(230,180,70,0)    100%);
  opacity: 0.55;
  filter: blur(26px);
  animation: drift 40s linear infinite;
}

/* SILVER flows — interleaved so silver sits between the gold streaks */
.silver-1 {
  background-image:
    linear-gradient(90deg,
      rgba(220,225,235,0)    0%,
      rgba(220,225,235,0)    36%,
      rgba(200,206,220,0.4)  42%,
      rgba(255,255,255,0.85) 48%,
      rgba(170,178,196,0.4)  54%,
      rgba(220,225,235,0)    66%,
      rgba(220,225,235,0)    100%);
  opacity: 0.8;
  animation: drift 32s linear infinite;
}

.silver-2 {
  background-image:
    linear-gradient(90deg,
      rgba(200,208,222,0)    0%,
      rgba(238,242,250,0.5)  12%,
      rgba(150,158,176,0.28) 22%,
      rgba(200,208,222,0)    38%,
      rgba(200,208,222,0)    70%,
      rgba(238,242,250,0.5)  80%,
      rgba(150,158,176,0.28) 88%,
      rgba(200,208,222,0)    98%,
      rgba(200,208,222,0)    100%);
  opacity: 0.45;
  filter: blur(30px);
  animation: drift 48s linear infinite;
}

/* Slide one tile to the right -> seamless infinite left-to-right loop */
@keyframes drift {
  from { transform: translate3d(-50%, 0, 0); }
  to   { transform: translate3d(0, 0, 0); }
}

/* Glossy highlight — static sheen on top of the stone */
.gloss {
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  background:
    radial-gradient(60% 40% at 25% 15%, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0) 55%),
    radial-gradient(50% 50% at 80% 85%, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 60%);
}

/* Neural network overlay — sits on top of the marble */
#neural {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

/* Title block — sits above the marble and the network */
.masthead {
  position: fixed;
  top: clamp(0.75rem, 2.5vh, 2rem);
  left: 0;
  right: 0;
  z-index: 20;
  text-align: center;
  pointer-events: none;
  font-family: "Georgia", "Times New Roman", serif;
  padding: 0 1.5rem;
}

.name {
  margin: 0;
  font-size: clamp(2rem, 6vw, 4.5rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.05;
  background: linear-gradient(100deg,
    #f6e7b8 0%, #c9a14a 22%, #ffffff 50%, #c9ccd6 72%, #e9d9a6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.45);
}

.tagline {
  margin: 0.6rem 0 0;
  font-size: clamp(0.85rem, 2vw, 1.25rem);
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(228, 232, 240, 0.82);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6);
}

/* Bottom navigation bar */
.navbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 2.8rem;
  z-index: 25;
  display: flex;
  justify-content: center;
  gap: clamp(0.6rem, 2vw, 1.4rem);
  padding: clamp(1rem, 3vh, 2rem) 1rem 0;
}

/* Small copyright banner at the very bottom */
.copyright {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0.45rem;
  z-index: 25;
  text-align: center;
  pointer-events: none;
  font-family: "Georgia", "Times New Roman", serif;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(228, 232, 240, 0.45);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}

.nav-btn {
  font-family: "Georgia", "Times New Roman", serif;
  font-size: clamp(0.85rem, 1.6vw, 1.05rem);
  letter-spacing: 0.12em;
  color: rgba(238, 240, 248, 0.92);
  padding: 0.7em 1.6em;
  border-radius: 999px;
  cursor: pointer;
  background: rgba(20, 20, 26, 0.35);
  border: 1px solid rgba(220, 200, 140, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 18px rgba(0, 0, 0, 0.35), inset 0 0 12px rgba(255, 255, 255, 0.04);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
}

.nav-btn:hover,
.nav-btn:focus-visible {
  transform: translateY(-2px);
  color: #fff;
  border-color: rgba(245, 225, 160, 0.85);
  box-shadow: 0 6px 26px rgba(0, 0, 0, 0.45),
              0 0 22px rgba(230, 200, 120, 0.35),
              inset 0 0 14px rgba(255, 255, 255, 0.08);
  outline: none;
}

/* Overlay that erupts from an output node */
.overlay[hidden] { display: none; }

.overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
}

.overlay__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 12, 0.42);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity 0.7s ease;
}

.overlay__panel {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8vh 1.5rem 16vh;
  opacity: 0;
  transform: scale(0.02);
  transform-origin: 80% 50%; /* overridden per-click to an output node */
  transition: transform 2s cubic-bezier(0.16, 0.84, 0.24, 1),
              opacity 1.4s ease;
}

.overlay.is-open .overlay__backdrop { opacity: 1; }
.overlay.is-open .overlay__panel { opacity: 1; transform: scale(1); }

.overlay__card {
  position: relative;
  max-width: 640px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: clamp(1.8rem, 4vw, 3rem);
  border-radius: 20px;
  color: rgba(235, 238, 246, 0.92);
  font-family: "Georgia", "Times New Roman", serif;
  background: rgba(18, 18, 24, 0.55);
  border: 1px solid rgba(220, 200, 140, 0.35);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55),
              inset 0 0 30px rgba(255, 255, 255, 0.04);
}

.overlay__close {
  position: absolute;
  top: 0.8rem;
  right: 1rem;
  width: 2.2rem;
  height: 2.2rem;
  font-size: 1.6rem;
  line-height: 1;
  color: rgba(235, 238, 246, 0.8);
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  transition: color 0.2s ease, background 0.2s ease;
}
.overlay__close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.overlay__content h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 600;
  letter-spacing: 0.03em;
  background: linear-gradient(100deg,
    #f6e7b8 0%, #c9a14a 28%, #ffffff 55%, #c9ccd6 78%, #e9d9a6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.overlay__content p { margin: 0 0 1rem; line-height: 1.65; }
.overlay__content ul { margin: 0 0 1rem; padding-left: 1.2rem; line-height: 1.7; }
.overlay__content li { margin-bottom: 0.4rem; }
.overlay__content a { color: #f0d68a; text-decoration: none; border-bottom: 1px solid rgba(240, 214, 138, 0.4); }
.overlay__content a:hover { color: #fff; }

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  .flow { animation: none; }
  .overlay__panel { transition: opacity 0.4s ease; transform: none; }
}
