@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap');

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  background: #f6f5f5;
  font-family: "JetBrains Mono", monospace;
  color: #333;
  display: flex;
  overflow: hidden;
}

/* Floating Header */
.floating-bar {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  border: 1px solid #333;
  width: 90%;
  height: 45px;
  background: #ffffff;
  display: flex;
  align-items: center;
  padding: 0 14px;
  z-index: 100;
  gap: 10px;
}

.home-link {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #222;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.15s ease-out;
}

.home-link:hover {
  background: #f0f0f0;
}

.logo-slot {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-slot svg {
  width: 100%;
  height: 100%;
}

.wordmark {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.slash-fill {
  flex: 1;
  display: flex;
  overflow: hidden;
  white-space: nowrap;
}

.slash-char {
  display: inline-block;
  font-size: 14px;
  color: #b3b3b3;
  margin-right: 10px;
  user-select: none;
}

/* Split Layout */
.layout-container {
  display: flex;
  width: 100%;
  height: 100%;
  padding-top: 85px;
}

/* Left Side: Interactive Area */
.interactive-panel {
  flex: 1;
  position: relative;
  background: transparent;
  border-right: 1px solid #ddd;
  overflow: hidden;
}

/* Right Side: Article Area */
.article-panel {
  flex: 1;
  padding: 40px 60px 100px 60px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.article-content {
  max-width: 650px;
  margin: 0 auto;
}

h1 {
  font-size: 32px;
  letter-spacing: -1px;
  margin-top: 10px;
}

h2 {
  font-size: 22px;
  margin-top: 40px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 10px;
}

p {
  font-size: 15px;
  line-height: 1.8;
  color: #444;
  margin-bottom: 20px;
}

/* ===== Scene layers ===== */
.scene-layer {
  position: absolute;
  inset: 0;
  transition: opacity 0.6s ease;
}

/* --- Scene 1: the watchers --- */
#scene1 {
  display: flex;
  align-items: center;
  justify-content: center;
}

.triangle-scene {
  position: relative;
  width: 100%;
  height: 100%;
}

.triangle {
  position: absolute;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  cursor: pointer;
}

.triangle-black {
  width: 40px;
  height: 40px;
  background: #111;
  transition: transform 0.1s ease-out;
}

.triangle-gold {
  width: 60px;
  height: 60px;
  background: #f1c40f;
  top: 50%;
  left: 70%;
  animation: pulseGlow 3s infinite ease-in-out;
}

@keyframes pulseGlow {

  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    filter: drop-shadow(0 0 5px rgba(241, 196, 15, 0.4));
  }

  50% {
    transform: translate(-50%, -50%) scale(1.1);
    filter: drop-shadow(0 0 25px rgba(241, 196, 15, 0.9));
  }
}

#tri1 {
  top: 20%;
  left: 20%;
}

#tri2 {
  top: 50%;
  left: 10%;
}

#tri3 {
  top: 80%;
  left: 20%;
}

/* --- Scene 2: conveyor --- */
#scene2 {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 60px 30px 40px 30px;
}

.intent-row {
  position: relative;
  width: 100%;
  height: 56px;
  margin-bottom: 18px;
  flex-shrink: 0;
}

.intent-main-tri {
  position: absolute;
  top: 10px;
  width: 32px;
  height: 32px;
  will-change: left;
}

.conveyor-system {
  display: flex;
  flex-direction: column;
  gap: 58px;
  width: 100%;
  padding: 10px 0;
}

.conveyor-line {
  position: relative;
  width: 130%;
  left: -15%;
  height: 46px;
  border-top: 2px solid #333;
  border-bottom: 2px solid #333;
  background-image: repeating-linear-gradient(90deg, #e9e8e8 0 18px, #dcdcdc 18px 20px);
  background-size: 400px 100%;
  animation: beltShift 20s linear infinite;
  overflow: visible;
  transform: rotate(-5deg);
}

.conveyor-line.reverse {
  animation-direction: reverse;
  transform: rotate(5deg);
}

@keyframes beltShift {
  from {
    background-position: 0 0;
  }

  to {
    background-position: -400px 0;
  }
}

.conveyor-gold {
  position: absolute;
  width: 18px;
  height: 18px;
  top: 13px;
  left: 0;
  background: #f1c40f;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  filter: drop-shadow(0 0 4px rgba(241, 196, 15, 0.5));
  will-change: transform;
}

.pile-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.pile-gold {
  position: absolute;
  width: 20px;
  height: 20px;
  background: #f1c40f;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  filter: drop-shadow(0 0 4px rgba(241, 196, 15, 0.5));
  transition: top 1.3s cubic-bezier(.22, .61, .36, 1), left 1.3s cubic-bezier(.22, .61, .36, 1);
}

.money-area {
  position: relative;
  width: 100%;
  height: 60px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 2;
  flex-shrink: 0;
}

.conveyor-gold {
  cursor: pointer;
}

.money-collection {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.collected-tri {
  position: absolute;
  width: 20px;
  height: 20px;
  background: #f1c40f;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  filter: drop-shadow(0 0 4px rgba(241, 196, 15, 0.5));
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.money-tri {
  width: 48px;
  height: 48px;
  position: relative;
  animation: moneySearch 3.2s ease-in-out infinite;
  transform-origin: 50% 80%;
}

@keyframes moneySearch {
  0% {
    transform: translateX(0) rotate(-8deg) scale(1);
  }

  25% {
    transform: translateX(-7px) rotate(5deg) scale(1.08);
  }

  50% {
    transform: translateX(0) rotate(-5deg) scale(1.12);
  }

  75% {
    transform: translateX(7px) rotate(8deg) scale(1.08);
  }

  100% {
    transform: translateX(0) rotate(-8deg) scale(1);
  }
}

.money-tri.kicking {
  animation: kickPunch 0.45s ease;
}

@keyframes kickPunch {
  0% {
    transform: rotate(-8deg) scale(1);
  }

  30% {
    transform: rotate(28deg) scale(1.2);
  }

  60% {
    transform: rotate(-18deg) scale(0.92);
  }

  100% {
    transform: rotate(-8deg) scale(1);
  }
}

.money-tri.collecting {
  animation: collectPulse 0.32s ease;
}

@keyframes collectPulse {
  0% {
    transform: scale(1) rotate(-6deg);
  }

  50% {
    transform: scale(1.18) rotate(6deg);
  }

  100% {
    transform: scale(1) rotate(-6deg);
  }
}

/* --- Scene 3: forum --- */
#scene3 {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 30px;
}

.forum-scene {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.forum-headline {
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  line-height: 1.4;
  padding-bottom: 14px;
  border-bottom: 1px solid #333;
  width: 100%;
  transition: color 0.5s ease, border-color 0.5s ease;
}

.forum-headline.barred {
  color: #c0392b;
  border-color: #c0392b;
}

.forum-artwork {
  margin: 28px 0;
  position: relative;
  z-index: 2;
}

.triangle-gold-forum {
  width: 72px;
  height: 72px;
  background: #f1c40f;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  filter: drop-shadow(0 0 8px rgba(241, 196, 15, 0.5));
  cursor: pointer;
  transition: transform 0.3s ease, filter 0.3s ease, background 0.3s ease;
  position: relative;
}

.triangle-gold-forum:hover {
  transform: scale(1.08);
  filter: drop-shadow(0 0 14px rgba(241, 196, 15, 0.8));
}

.triangle-gold-forum.barred {
  background: #e74c3c;
  filter: drop-shadow(0 0 8px rgba(231, 76, 60, 0.5));
  transform: scale(0.95);
  cursor: not-allowed;
}

.forum-crowd {
  position: relative;
  width: 100%;
  height: 220px;
  z-index: 1;
}

.crowd-tri {
  position: absolute;
  width: 34px;
  height: 34px;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  transition: transform 0.3s ease;
}

.crowd-tri.grumbling {
  animation: grumble 0.4s ease-in-out infinite alternate;
}

@keyframes grumble {
  0% {
    transform: translateX(0) rotate(0deg);
  }

  100% {
    transform: translateX(5px) rotate(7deg);
  }
}

.crowd-tri.fleeing {
  transition: transform 2.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 2.2s ease;
}

/* --- Scene 4: the market --- */
#scene4 {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
}

.market-scene {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.market-artwork {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.triangle-gold-market {
  width: 64px;
  height: 64px;
  background: #f1c40f;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  filter: drop-shadow(0 0 10px rgba(241, 196, 15, 0.5));
  position: relative;
}

.value-display {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  background: #fff;
  border: 1px solid #333;
  padding: 6px 14px;
  border-radius: 6px;
}

.market-input {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.market-input label {
  font-size: 13px;
  font-weight: 500;
  color: #555;
}

.market-input input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: #ddd;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.market-input input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: #111;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #333;
}

.market-input input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #111;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #333;
}

.market-btn {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  font-weight: 500;
  background: #111;
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

.market-btn:hover {
  background: #333;
}

.market-btn:active {
  transform: scale(0.97);
}

.market-divider {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: #333;
}

.divider-text {
  font-size: 11px;
  font-weight: 600;
  color: #555;
  letter-spacing: 1px;
}

.market-floor {
  position: relative;
  width: 100%;
  height: 180px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 32px;
  padding-bottom: 10px;
}

.market-bidder {
  width: 32px;
  height: 32px;
  background: #111;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  opacity: 0;
  transform: translateY(20px) scale(0.8);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.market-bidder.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* --- Scene 5: the craft --- */
#scene5 {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 30px;
}

.craft-scene {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.craft-label {
  font-size: 13px;
  font-weight: 500;
  color: #555;
  text-align: center;
}

.craft-triangle-container {
  position: relative;
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#craftTri {
  width: 100px;
  height: 100px;
  background: #f1c40f;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  cursor: pointer;
  transition: filter 0.3s ease, transform 0.2s ease;
  filter: drop-shadow(0 0 6px rgba(241, 196, 15, 0.4));
}

#craftTri:hover {
  transform: scale(1.06);
  filter: drop-shadow(0 0 14px rgba(241, 196, 15, 0.7));
}

#craftTri:active {
  transform: scale(0.95);
}

.craft-counter {
  font-size: 12px;
  color: #777;
  text-align: center;
  min-height: 18px;
}

.craft-drafts {
  position: relative;
  width: 100%;
  height: 100px;
}

.draft-tri {
  position: absolute;
  width: 24px;
  height: 24px;
  background: #ccc;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  opacity: 0.6;
  transition: opacity 0.5s ease, transform 0.8s ease;
}

.draft-tri.fading {
  opacity: 0;
  transform: translateY(-30px) rotate(45deg);
}

/* Speech Bubbles */
.speech-bubble {
  position: absolute;
  background: #fff;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: #111;
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
  z-index: 50;
  max-width: 170px;
  text-align: center;
}

.speech-bubble.active {
  opacity: 1;
  transform: translateY(0);
}

/* invisible scroll markers */
.scroll-marker {
  display: block;
  height: 1px;
}