/* ===============================================
   KEST DESIGNS PORTAL - PIXEL DESIGN SYSTEM
   =============================================== */

/* CSS Variables */
:root {
  /* Colors */
  --primary-purple: #8b5cf6;
  --neon-pink: #e472ff;
  --dark-purple: #1e1b4b;
  --dark-blue: #0f0f23;
  --nav-bg: rgba(15, 15, 35, 0.8);
  --nav-border: rgba(255, 255, 255, 0.1);
  --text-white: #ffffff;
  --text-gray: #a1a1aa;
  
  /* Fonts */
  --font-pixel: 'Press Start 2P', monospace;
  --font-body: system-ui, -apple-system, sans-serif;
  
  /* Spacing */
  --nav-height: 80px;
  --section-padding: 4rem;
  --container-max: 1200px;
  
  /* Transitions */
  --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Reset and Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: linear-gradient(135deg, var(--dark-blue) 0%, var(--dark-purple) 100%);
  color: var(--text-white);
  overflow-x: hidden;
  line-height: 1.6;
}

/* Page Wrapper */
.page {
  min-height: 100vh;
}

/* ===============================================
   NAVIGATION
   =============================================== */

.nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--nav-border);
}

.nav-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 2rem;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.nav-block {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-link {
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-white);
  text-decoration: none;
  position: relative;
  padding: 0.5rem 0;
  transition: all var(--transition-smooth);
  text-shadow: 2px 2px 0 #000;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--neon-pink);
  transition: width var(--transition-smooth);
}

.nav-link:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link.active::after {
  width: 100%;
}

/* Logo */
.nav-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav-logo-main {
  font-family: var(--font-pixel);
  font-size: 2rem;
  color: var(--neon-pink);
  text-shadow: 4px 4px 0 #000;
  letter-spacing: 0.1em;
  line-height: 1;
}

.nav-logo-sub {
  font-family: var(--font-pixel);
  font-size: 0.8rem;
  color: var(--text-white);
  text-shadow: 2px 2px 0 #000;
  letter-spacing: 0.3em;
  margin-top: 0.2rem;
}

/* Mobile Navigation */
.nav-toggle {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  width: 24px;
  height: 3px;
  background: var(--text-white);
  margin: 2px 0;
  transition: var(--transition-smooth);
  box-shadow: 1px 1px 0 #000;
}

/* ===============================================
   HERO SECTION
   =============================================== */

.hero {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8rem 2rem 4rem;
  background: linear-gradient(135deg, var(--dark-blue) 0%, var(--dark-purple) 100%);
  overflow: hidden;
}

.hero-inner {
  max-width: 800px;
  text-align: center;
  z-index: 2;
  position: relative;
  animation: heroFadeIn 1s ease-out;
}

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

.hero-kicker {
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  color: var(--neon-pink);
  margin-bottom: 1.5rem;
  letter-spacing: 0.2em;
  text-shadow: 1px 1px 0 #000;
}

.hero-title {
  font-family: var(--font-pixel);
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.2;
  margin-bottom: 2rem;
  color: var(--text-white);
  text-shadow: 3px 3px 0 #000;
  letter-spacing: 0.05em;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-gray);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

/* Hero Background Effects */
.hero-bg-mist {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 30%, rgba(139, 92, 246, 0.3) 0%, transparent 50%),
              radial-gradient(circle at 80% 70%, rgba(228, 114, 255, 0.2) 0%, transparent 50%),
              radial-gradient(circle at 50% 50%, rgba(79, 70, 229, 0.2) 0%, transparent 50%);
  animation: mistMove 20s ease-in-out infinite alternate;
  z-index: 1;
}

@keyframes mistMove {
  0% {
    transform: scale(1) rotate(0deg);
    opacity: 0.5;
  }
  100% {
    transform: scale(1.1) rotate(5deg);
    opacity: 0.8;
  }
}

.hero-mountains {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: radial-gradient(ellipse at 20% 100%, rgba(30, 27, 75, 0.8) 0%, transparent 70%),
              radial-gradient(ellipse at 80% 100%, rgba(30, 27, 75, 0.9) 0%, transparent 70%),
              radial-gradient(ellipse at 50% 100%, rgba(15, 15, 35, 1) 0%, transparent 70%);
  z-index: 1;
}

/* ===============================================
   PROJECTS SECTION
   =============================================== */

.projects-section {
  padding: var(--section-padding) 2rem;
  max-width: var(--container-max);
  margin: 0 auto;
}

.projects-grid-title {
  font-family: var(--font-pixel);
  font-size: 0.8rem;
  color: var(--neon-pink);
  text-align: center;
  margin-bottom: 3rem;
  letter-spacing: 0.2em;
  text-shadow: 1px 1px 0 #000;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

/* Project Cards */
.project-card {
  position: relative;
  display: block;
  text-decoration: none;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  transition: all var(--transition-bounce);
  transform-style: preserve-3d;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.project-card-inner {
  position: relative;
  height: 300px;
  overflow: hidden;
}

.project-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 0.3s ease;
}

.project-card:hover .project-bg {
  transform: scale(1.05);
}

/* Project Background Images */
.bg-phasmophobia {
  background-image: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.7)), 
                    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 600"><rect width="800" height="600" fill="%231a1a2e"/><path d="M0 400 Q200 300 400 400 T800 400 V600 H0 Z" fill="%23000"/><circle cx="650" cy="100" r="60" fill="%23e472ff" opacity="0.6"/><path d="M100 200 L150 250 L100 300 L50 250 Z" fill="%23666"/></svg>');
}

.bg-satisfactory {
  background-image: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.7)), 
                    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 600"><rect width="800" height="600" fill="%23003333"/><circle cx="400" cy="300" r="80" fill="%23ff6b35" opacity="0.7"/><rect x="300" y="350" width="200" height="100" fill="%23666"/><polygon points="300,350 500,350 400,250" fill="%23444"/></svg>');
}

.bg-minecraft {
  background-image: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.7)), 
                    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 600"><rect width="800" height="600" fill="%23003d1a"/><rect x="100" y="100" width="600" height="400" fill="%23663333"/><circle cx="650" cy="150" r="40" fill="%23ffff00"/><rect x="200" y="300" width="60" height="60" fill="%238b4513"/><rect x="300" y="200" width="80" height="80" fill="%23444"/></svg>');
}

.project-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  color: white;
  text-align: center;
}

.project-title {
  font-family: var(--font-pixel);
  font-size: 1.2rem;
  line-height: 1.3;
  text-shadow: 3px 3px 0 #000;
  letter-spacing: 0.1em;
}

.project-pill {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(0,0,0,0.8);
  border: 1px solid rgba(255,255,255,0.3);
  padding: 0.5rem 1rem;
  border-radius: 20px;
}

.project-pill span {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  text-transform: uppercase;
  color: var(--text-white);
  text-shadow: 1px 1px 0 #000;
  letter-spacing: 0.1em;
}

.project-glow {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, var(--neon-pink), transparent);
  opacity: 0;
  transition: opacity var(--transition-smooth);
  pointer-events: none;
}

.project-card:hover .project-glow {
  opacity: 0.3;
}

/* ===============================================
   LOWER SECTIONS
   =============================================== */

.lower-section {
  padding: var(--section-padding) 2rem;
  max-width: 700px;
  margin: 0 auto;
  border-top: 1px solid var(--nav-border);
  position: relative;
}

.lower-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 100px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.1), transparent);
  pointer-events: none;
}

.section-title {
  font-family: var(--font-pixel);
  font-size: 1.5rem;
  color: var(--neon-pink);
  margin-bottom: 2rem;
  text-align: center;
  letter-spacing: 0.1em;
  text-shadow: 2px 2px 0 #000;
}

.section-text {
  font-size: 1.1rem;
  color: var(--text-gray);
  line-height: 1.8;
  text-align: center;
}

/* ===============================================
   FOOTER
   =============================================== */

.footer {
  padding: 3rem 2rem;
  text-align: center;
  border-top: 1px solid var(--nav-border);
  position: relative;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 50px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.1), transparent);
  pointer-events: none;
}

.footer-text {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--text-gray);
  letter-spacing: 0.1em;
}

/* ===============================================
   REVEAL ANIMATIONS
   =============================================== */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===============================================
   RESPONSIVE DESIGN
   =============================================== */

/* Tablet */
@media (max-width: 980px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  
  .nav-inner {
    padding: 0 1rem;
  }
  
  .nav-block {
    gap: 1rem;
  }
  
  .nav-link {
    font-size: 0.6rem;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
}

/* Mobile */
@media (max-width: 780px) {
  .nav-block {
    display: none;
  }
  
  .nav-toggle {
    display: flex;
  }
  
  .hero {
    padding: 6rem 1rem 3rem;
    min-height: 60vh;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .projects-section {
    padding: 3rem 1rem;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .lower-section {
    padding: 2rem 1rem;
  }
  
  .section-title {
    font-size: 1.2rem;
  }
  
  /* Mobile Navigation Open State */
  .nav.nav-mobile-open .nav-inner {
    flex-direction: column;
    height: auto;
    padding: 1rem;
  }
  
  .nav.nav-mobile-open .nav-block {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 1rem 0;
    gap: 1rem;
  }
  
  .nav.nav-mobile-open .nav-logo {
    position: static;
    transform: none;
    margin: 1rem 0;
  }
}

@media (max-width: 480px) {
  .nav-logo-main {
    font-size: 1.5rem;
  }
  
  .nav-logo-sub {
    font-size: 0.6rem;
  }
  
  .hero-title {
    font-size: 1.5rem;
  }
  
  .project-card-inner {
    height: 250px;
  }
  
  .project-title {
    font-size: 1rem;
  }
}