@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

:root {
  --bg-color: #050508;
  --surface-color: rgba(25, 25, 30, 0.6);
  --border-color: rgba(255, 255, 255, 0.1);
  --text-main: #ffffff;
  --text-muted: #888899;

  /* Elemental Colors from the artwork */
  --fire-glow: #ff5500;
  --ice-glow: #00eeff;
  --water-glow: #0066ff;
  --sand-glow: #d4a373;

  --accent-color: var(--fire-glow);
}

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

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  margin: 0;
  overflow-x: hidden;
  /* Remove min-height: 100vh, align-items: center and justify-content: center to allow scrolling */
}

/* WebGL Canvas */
#webgl-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  /* Behind everything */
  pointer-events: none;
  /* Let clicks pass through if needed */
}

/* Scrollytelling structure */
.scroll-container {
  position: relative;
  width: 100%;
}

.scrollytelling-spacer {
  height: 300vh;
  /* 3 screens of scrolling for the 3D animation */
  width: 100%;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-bottom: 10vh;
}

.scroll-indicator {
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.2rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.mouse {
  width: 30px;
  height: 50px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  position: relative;
}

.mouse::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 8px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 2px;
  animation: scrollWheel 2s infinite ease-in-out;
}

@keyframes scrollWheel {
  0% {
    transform: translate(-50%, 0);
    opacity: 1;
  }

  100% {
    transform: translate(-50%, 15px);
    opacity: 0;
  }
}

@keyframes fadeInOut {

  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }
}

/* Content wrapper that appears after scrolling */
.content-wrapper {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 0;
  background: transparent;
}

/* Background effects */
.bg-glows {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -2;
  /* Behind the WebGL Canvas (-1) */
  pointer-events: none;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.4;
  animation: float 10s infinite alternate ease-in-out;
}

.glow.fire {
  top: -10%;
  right: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, var(--fire-glow) 0%, transparent 70%);
}

.glow.ice {
  bottom: -10%;
  left: -10%;
  width: 40vw;
  height: 40vw;
  background: radial-gradient(circle, var(--ice-glow) 0%, transparent 70%);
  animation-delay: -5s;
}

@keyframes float {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(5%, 5%) scale(1.1);
  }
}

/* Main Container */
.container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  width: 90%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

@media (max-width: 900px) {
  .container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
    padding: 3rem 0;
  }
}

/* Artwork Section */
.artwork-container {
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1000px;
}

.artwork {
  width: 100%;
  max-width: 500px;
  border-radius: 20px;
  animation: levitate 6s ease-in-out infinite;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.5));
}

@keyframes levitate {

  0%,
  100% {
    transform: translateY(0) rotateX(5deg) rotateY(-5deg);
  }

  50% {
    transform: translateY(-20px) rotateX(8deg) rotateY(-2deg);
  }
}

/* Form Section */
.content-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.title {
  font-size: 4rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #fff, #aaa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.title span {
  background: linear-gradient(135deg, var(--fire-glow), #ffaa00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 3rem;
  font-weight: 400;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  line-height: 1.6;
}

.newsletter-card {
  background: transparent;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

.newsletter-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--ice-glow), transparent);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.input-wrapper {
  position: relative;
}

.input-field {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  color: var(--text-main);
  font-size: 1rem;
  font-family: 'Outfit', sans-serif;
  transition: all 0.3s ease;
  outline: none;
}

.input-field:focus {
  border-color: var(--ice-glow);
  box-shadow: 0 0 15px rgba(0, 238, 255, 0.2);
}

.input-field::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.submit-btn {
  background: linear-gradient(135deg, var(--fire-glow), #ff2200);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 1.25rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
}

.submit-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: all 0.5s ease;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(255, 85, 0, 0.4);
}

.submit-btn:hover::after {
  left: 200%;
}

.submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Status Messages */
.status-message {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 400;
  display: none;
  animation: fadeIn 0.3s ease;
}

.status-message.show {
  display: block;
}

.status-message.success {
  background: rgba(0, 255, 100, 0.1);
  color: #00ff64;
  border: 1px solid rgba(0, 255, 100, 0.2);
}

.status-message.error {
  background: rgba(255, 50, 50, 0.1);
  color: #ff3232;
  border: 1px solid rgba(255, 50, 50, 0.2);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Floating Elements around artwork */
.floating-element {
  position: absolute;
  border-radius: 4px;
  animation: spinFloat 8s infinite linear;
}

.el-1 {
  width: 20px;
  height: 20px;
  background: var(--ice-glow);
  top: 10%;
  right: 20%;
  box-shadow: 0 0 15px var(--ice-glow);
}

.el-2 {
  width: 15px;
  height: 15px;
  background: var(--fire-glow);
  bottom: 20%;
  left: 10%;
  box-shadow: 0 0 15px var(--fire-glow);
  animation-duration: 6s;
  animation-direction: reverse;
}

.el-3 {
  width: 10px;
  height: 10px;
  background: var(--sand-glow);
  top: 40%;
  left: -5%;
  box-shadow: 0 0 10px var(--sand-glow);
  animation-duration: 10s;
}

@keyframes spinFloat {
  0% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-30px) rotate(180deg);
  }

  100% {
    transform: translateY(0) rotate(360deg);
  }
}

/* Animation Editor UI */
.animation-editor {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 400px;
  background: rgba(10, 10, 15, 0.9);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
}

.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.editor-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  color: var(--ice-glow);
}

#editor-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s;
}

#editor-close:hover {
  color: var(--fire-glow);
}

.editor-body {
  padding: 1rem;
  max-height: 80vh;
  overflow-y: auto;
}

.editor-section {
  margin-bottom: 1.5rem;
}

.editor-section h4 {
  margin-bottom: 0.5rem;
  color: var(--ice-glow);
  font-size: 0.9rem;
  text-transform: uppercase;
}

.control-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  gap: 1rem;
}

.control-group label {
  font-size: 0.8rem;
  color: var(--text-muted);
  min-width: 100px;
}

.control-group input[type="range"] {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
  -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: var(--ice-glow);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 5px var(--ice-glow);
}

#editor-textarea {
  width: 100%;
  height: 150px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: #aaddff;
  font-family: monospace;
  font-size: 0.85rem;
  padding: 0.5rem;
  resize: vertical;
  outline: none;
}

#editor-textarea:focus {
  border-color: var(--ice-glow);
}

.editor-footer {
  padding: 1rem;
  display: flex;
  gap: 0.5rem;
  border-top: 1px solid var(--border-color);
}

.editor-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.editor-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

#editor-apply {
  background: rgba(0, 238, 255, 0.2);
  border-color: var(--ice-glow);
  color: var(--ice-glow);
}

#editor-apply:hover {
  background: rgba(0, 238, 255, 0.3);
}

/* Cinematic Texts */
.cinematic-texts {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  pointer-events: none;
  z-index: 5;
  display: flex;
  justify-content: center;
  align-items: center;
}

.cinematic-text {
  position: absolute;
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(2rem, 8vw, 4.5rem);
  font-weight: 900;
  color: white;
  text-transform: uppercase;
  letter-spacing: 1.2rem;
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 255, 255, 0.1);
  filter: blur(10px);
  width: 100%;
  padding: 0 10%;
  pointer-events: none;
  will-change: transform, opacity, filter;
  visibility: hidden;
}

.cinematic-text.left {
  text-align: left;
  left: 5%;
}

.cinematic-text.right {
  text-align: right;
  right: 5%;
}

.cinematic-text.top {
  text-align: center;
  top: 15%;
  align-self: flex-start;
}

.cinematic-text.center {
  text-align: center;
}

/* Color Accents */
.text-fire {
  background: linear-gradient(to bottom, #fffb00, #ff4d00, #ff0000);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
  font-weight: 900;
}

.text-ice {
  background: linear-gradient(to bottom, #00eeff, #0099ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient {
  background: linear-gradient(to right, #ff9d00, #00eeff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Scroll Indicator */
.scroll-indicator {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 999;
  /* Force it on top of everything */
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
  opacity: 1;
}

.scroll-indicator.hidden {
  opacity: 0;
  transform: translate(-50%, 20px);
}

.mouse {
  width: 26px;
  height: 42px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 15px;
  position: relative;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.wheel {
  width: 4px;
  height: 8px;
  background: #ffffff;
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 2px;
  animation: scroll-wheel 2s infinite;
  box-shadow: 0 0 5px #ffffff;
}

.arrow span {
  display: block;
  width: 10px;
  height: 10px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.8);
  border-right: 2px solid rgba(255, 255, 255, 0.8);
  transform: rotate(45deg);
  margin: -4px;
  animation: scroll-arrow 2s infinite;
}

.arrow span:nth-child(2) {
  animation-delay: 0.2s;
}

@keyframes scroll-wheel {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(0);
  }

  20% {
    opacity: 1;
  }

  80% {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }

  100% {
    opacity: 0;
  }
}

@keyframes scroll-arrow {
  0% {
    opacity: 0;
    transform: rotate(45deg) translate(-5px, -5px);
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: rotate(45deg) translate(5px, 5px);
  }
}

@media (max-width: 768px) {
  .container {
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 10vh;
    gap: 2rem;
  }

  .cube-placeholder {
    height: 35vh;
    width: 100%;
    order: 1;
  }

  .content-section {
    width: 100%;
    text-align: center;
    padding: 0 1rem;
    order: 2;
  }

  .title {
    font-size: 2.5rem;
  }

  .subtitle {
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 2rem;
    text-shadow: 0 0 15px rgba(0, 0, 0, 0.8), 0 0 5px rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 12px;
    backdrop-filter: blur(5px);
  }

  .cinematic-text {
    font-size: 1.8rem;
    letter-spacing: 0.2rem;
    text-align: center !important;
    left: 0 !important;
    right: 0 !important;
    padding: 0 5%;
    top: 45% !important;
    /* Center more vertically on mobile */
  }
}

@media (max-width: 950px) and (orientation: landscape) {
  .container {
    display: flex !important;
    flex-direction: row !important;
    padding: 0 !important;
    height: 100vh;
    width: 100vw !important;
    max-width: none !important;
    overflow: hidden;
    position: relative;
  }

  .cube-placeholder {
    height: 100vh !important;
    width: 50% !important;
    flex-shrink: 0;
  }

  .content-section {
    position: absolute !important;
    right: 0 !important;
    top: 0 !important;
    width: 50% !important;
    height: 100vh !important;
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 2rem !important;
    z-index: 10;
  }

  .title {
    font-size: 1.8rem !important;
    margin-bottom: 0.5rem !important;
  }

  .subtitle {
    font-size: 0.85rem !important;
    margin-bottom: 1.5rem !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8) !important;
  }

  .newsletter-card {
    padding: 1rem !important;
    width: 100% !important;
    max-width: 380px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  .form-group {
    flex-direction: column !important;
    /* Stack vertically if height is low but width is enough */
    gap: 0.8rem !important;
  }

  .cinematic-text {
    font-size: 1.3rem !important;
    width: 50% !important;
    left: 0 !important;
    right: auto !important;
  }

  .input-field {
    padding: 0.6rem !important;
    font-size: 0.9rem !important;
  }

  .submit-btn {
    padding: 0.6rem 1rem !important;
    font-size: 0.9rem !important;
  }
}