/* Root Colors and Variables */
:root {
  --color-dark-plum: #1a1118;
  --color-darker: #2a1f24;
  --color-green: #4ADE80;
  --color-red: #E85D4A;
  --color-black: #0d0a0f;
  --color-tan: #B8A99A;
  --color-violet: #C77DFF;
  --color-cream: #E8D5C4;
  --color-amber: #F2A65A;

  --font-caveat: 'Caveat', cursive;
  --font-mono: 'Space Mono', monospace;
  --font-inter: 'Inter', sans-serif;

  --transition: 0.3s cubic-bezier(0.23, 1, 0.320, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 0;
}

body {
  background-color: var(--color-black);
  color: var(--color-cream);
  font-family: var(--font-inter);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

main {
  width: 100%;
  overflow-x: hidden;
}

/* Puzzle Sections */
.puzzle-section {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-dark-plum) 0%, var(--color-darker) 100%);
}

.section-content {
  position: relative;
  z-index: 2;
  max-width: 900px;
  width: 100%;
  text-align: center;
}

/* Diagonal Clip Paths */
.section-1 {
  clip-path: polygon(0 0, 100% 0, 100% 92%, 0 100%);
  background: linear-gradient(135deg, var(--color-black) 0%, var(--color-dark-plum) 100%);
}

.section-2 {
  clip-path: polygon(0 8%, 100% 0, 100% 100%, 0 92%);
  margin-top: -2vh;
}

.section-3 {
  clip-path: polygon(0 0, 100% 8%, 100% 100%, 0 92%);
  margin-top: -2vh;
  background: linear-gradient(135deg, var(--color-darker) 0%, var(--color-dark-plum) 100%);
}

.section-4 {
  clip-path: polygon(0 8%, 100% 0, 100% 92%, 0 100%);
  margin-top: -2vh;
}

.section-5 {
  clip-path: polygon(0 0, 100% 8%, 100% 100%, 0 92%);
  margin-top: -2vh;
  background: linear-gradient(135deg, var(--color-dark-plum) 0%, var(--color-darker) 100%);
}

.section-6 {
  clip-path: polygon(0 8%, 100% 0, 100% 100%, 0 92%);
  margin-top: -2vh;
}

.section-7 {
  clip-path: none;
  margin-top: -2vh;
  background: linear-gradient(135deg, var(--color-darker) 0%, var(--color-dark-plum) 100%);
}

/* Hero Title with Glitch Effect */
.glitch-title {
  font-family: var(--font-caveat);
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 700;
  line-height: 1;
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
  letter-spacing: -1px;
  color: var(--color-amber);
  animation: titleFadeIn 1s ease-out;
}

.glitch-title::before,
.glitch-title::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0.8;
  animation: glitch 2.5s infinite;
}

.glitch-title::before {
  animation-delay: -1.25s;
  color: var(--color-red);
  z-index: -1;
  text-shadow: -2px 0 var(--color-red);
}

.glitch-title::after {
  animation-delay: -2.5s;
  color: var(--color-green);
  z-index: -2;
  text-shadow: 2px 0 var(--color-green);
}

@keyframes glitch {
  0% {
    clip-path: rect(0, 900px, 0, 0);
  }
  20% {
    clip-path: rect(0, 900px, 0, 0);
  }
  25% {
    clip-path: rect(40px, 900px, 100px, 0);
  }
  40% {
    clip-path: rect(0, 900px, 0, 0);
  }
  45% {
    clip-path: rect(80px, 900px, 150px, 0);
  }
  60% {
    clip-path: rect(0, 900px, 0, 0);
  }
  65% {
    clip-path: rect(20px, 900px, 60px, 0);
  }
  100% {
    clip-path: rect(0, 900px, 0, 0);
  }
}

@keyframes titleFadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-subtitle {
  font-family: var(--font-caveat);
  font-size: 1.5rem;
  color: var(--color-cream);
  margin-bottom: 3rem;
  animation: subtitleFadeIn 1s ease-out 0.3s forwards;
  opacity: 0;
}

@keyframes subtitleFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.scroll-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  animation: bobbing 2s ease-in-out infinite 0.8s;
}

.scroll-indicator span {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--color-violet);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.scroll-indicator svg {
  width: 24px;
  height: 24px;
  fill: var(--color-violet);
}

@keyframes bobbing {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(10px); }
}

/* Section Headings */
.section-content h2 {
  font-family: var(--font-caveat);
  font-size: clamp(1.5rem, 4vw, 3.5rem);
  font-weight: 700;
  color: var(--color-amber);
  margin-bottom: 2rem;
  line-height: 1;
}

/* Pieces Grid */
.pieces-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.puzzle-piece {
  min-height: 180px;
  border: 2px solid var(--color-amber);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: linear-gradient(135deg, rgba(232, 93, 74, 0.1) 0%, rgba(74, 222, 128, 0.1) 100%);
  border-radius: 4px;
  transition: all var(--transition);
  transform: rotate(-3deg);
  animation: pieceSlide 0.6s ease-out forwards;
  opacity: 0;
}

.puzzle-piece:nth-child(2n) {
  transform: rotate(3deg);
}

.puzzle-piece:hover {
  border-color: var(--color-green);
  box-shadow: 0 0 20px rgba(74, 222, 128, 0.3);
  transform: rotate(0deg) scale(1.05);
}

@keyframes pieceSlide {
  from {
    opacity: 0;
    transform: translate(20px, 20px) rotate(-3deg);
  }
  to {
    opacity: 1;
    transform: translate(0, 0) rotate(-3deg);
  }
}

.puzzle-piece:nth-child(2) { animation-delay: 0.2s; }
.puzzle-piece:nth-child(3) { animation-delay: 0.4s; }
.puzzle-piece:nth-child(4) { animation-delay: 0.6s; }

.piece-label {
  font-family: var(--font-caveat);
  font-size: 1.3rem;
  color: var(--color-cream);
  font-weight: 700;
}

/* Workshop Details */
.workshop-details {
  max-width: 700px;
  margin: 2rem auto;
}

.workshop-details p {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  line-height: 1.8;
}

.detail-box {
  background: linear-gradient(135deg, rgba(199, 125, 255, 0.1) 0%, rgba(78, 222, 128, 0.1) 100%);
  border: 1px solid var(--color-violet);
  padding: 2rem;
  border-radius: 4px;
  margin-top: 2rem;
}

.detail-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--color-violet);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.detail-box p {
  margin: 0;
  font-size: 1rem;
}

/* Process Steps */
.process-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.process-steps li {
  padding: 2rem;
  background: linear-gradient(135deg, rgba(232, 93, 74, 0.1) 0%, rgba(184, 169, 154, 0.1) 100%);
  border: 1px solid var(--color-tan);
  border-radius: 4px;
  position: relative;
  transition: all var(--transition);
  animation: stepFadeIn 0.6s ease-out forwards;
  opacity: 0;
}

.process-steps li:hover {
  border-color: var(--color-red);
  box-shadow: 0 0 15px rgba(232, 93, 74, 0.2);
  transform: translateY(-8px);
}

@keyframes stepFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.process-steps li:nth-child(1) { animation-delay: 0.1s; }
.process-steps li:nth-child(2) { animation-delay: 0.2s; }
.process-steps li:nth-child(3) { animation-delay: 0.3s; }
.process-steps li:nth-child(4) { animation-delay: 0.4s; }

.step-number {
  display: block;
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-green);
  margin-bottom: 0.5rem;
}

.step-title {
  display: block;
  font-family: var(--font-caveat);
  font-size: 1.5rem;
  color: var(--color-amber);
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.process-steps p {
  font-size: 0.95rem;
  color: var(--color-cream);
}

/* Glitch Text */
.glitch-text {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.glitch-word {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  position: relative;
  display: inline-block;
}

.glitch-word:nth-child(1) {
  color: var(--color-red);
  text-shadow: 2px 0 var(--color-green), -2px 0 var(--color-violet);
}

.glitch-word:nth-child(2) {
  color: var(--color-green);
  text-shadow: -2px 0 var(--color-red), 2px 0 var(--color-violet);
}

.glitch-word:nth-child(3) {
  color: var(--color-violet);
  text-shadow: 2px 0 var(--color-red), -2px 0 var(--color-green);
}

/* Completion Badge */
.completion-badge {
  display: inline-block;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--color-amber) 0%, var(--color-green) 100%);
  color: var(--color-black);
  font-family: var(--font-mono);
  font-weight: 700;
  border-radius: 4px;
  margin-top: 2rem;
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 212, 139, 0.7); }
  50% { box-shadow: 0 0 0 15px rgba(232, 212, 139, 0); }
}

/* About Section */
.about-text {
  max-width: 700px;
  margin: 0 auto;
}

.about-text p {
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

.contact-info {
  margin-top: 2rem;
  padding: 2rem;
  background: linear-gradient(135deg, rgba(78, 222, 128, 0.1) 0%, rgba(184, 169, 154, 0.1) 100%);
  border: 1px solid var(--color-tan);
  border-radius: 4px;
}

.contact-info p {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.contact-info strong {
  color: var(--color-amber);
}

/* Glitch Decorations */
.glitch-decoration {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  opacity: 0.05;
  pointer-events: none;
  z-index: 1;
}

.glitch-1,
.glitch-2,
.glitch-3,
.glitch-4,
.glitch-5,
.glitch-6 {
  animation: glitchBg 3s ease-in-out infinite;
}

@keyframes glitchBg {
  0%, 100% { opacity: 0.05; }
  50% { opacity: 0.1; }
}

/* Responsive */
@media (max-width: 768px) {
  .puzzle-section {
    padding: 2rem 1.5rem;
    min-height: 80vh;
  }

  .pieces-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .process-steps {
    grid-template-columns: 1fr;
  }

  .glitch-text {
    flex-direction: column;
    gap: 1rem;
  }

  .scroll-indicator {
    font-size: 0.9rem;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-black);
}

::-webkit-scrollbar-thumb {
  background: var(--color-amber);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-green);
}
