:root {
  --bg-color: #ffffff;
  --text-color: #1e293b;
  --primary-color: #2563eb;
  /* Royal Blue */
  --secondary-color: #4f46e5;
  /* Indigo */
  --glass-bg: rgba(255, 255, 255, 0.9);
  --glass-border: rgba(0, 0, 0, 0.05);
  --card-hover-bg: #ffffff;
  --font-main: 'Inter', sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  scroll-behavior: smooth;
}

body {
  display: flex;
  flex-direction: column;
  font-family: var(--font-main);
  background: var(--bg-color);
  color: var(--text-body);
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* Crisp text */
}

/* Typography */
/* Typography */
h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  color: var(--text-main);
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.025em;
  /* Tight tracking for modern look */
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s;
}

/* Header & Nav */
.glass-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 20px 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-color);
  letter-spacing: -0.5px;
}

nav a {
  color: #64748b;
  margin-left: 30px;
  font-weight: 500;
  font-size: 0.95rem;
}

nav a:hover,
nav a.active {
  color: var(--primary-color);
  /* text-shadow removed for clean look */
}

/* Hero Section */
.hero {
  position: relative;
  /* Reduced height to focus on sections below, removed 100vh constraint */
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 80px 20px;
  overflow: hidden;
}

#hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
}

.hero-content {
  z-index: 1;
  position: relative;
  /* Ensure z-index works */
  pointer-events: none;
  /* Let mouse pass through to iframe */
  max-width: 1400px;
  /* Greatly increased to prevent PC clipping */
  width: 100%;
  margin-bottom: 40px;
  padding: 0 20px;
}

.hero-content>* {
  pointer-events: auto;
  /* Restore interaction for text/buttons */
}

.gradient-text {
  font-size: clamp(2rem, 5vw, 5rem);
  /* Adjusted min size for better mobile fit */
  line-height: 1.2;
  white-space: normal;
  /* Allow wrapping */
  word-break: keep-all;
  /* Korean word break */
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 24px;
  font-weight: 800;
  letter-spacing: -1px;
  padding-bottom: 10px;
}

.hero p {
  font-size: 1.25rem;
  color: #475569;
  margin-bottom: 40px;
}

.hero-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  pointer-events: none;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0.6;
}

.scroll-text {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.scroll-mouse {
  width: 24px;
  height: 36px;
  border: 2px solid var(--text-light);
  border-radius: 12px;
  position: relative;
}

.scroll-wheel {
  width: 4px;
  height: 8px;
  background: var(--text-light);
  border-radius: 2px;
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
}

@keyframes bounce {

  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateX(-50%) translateY(0);
  }

  40% {
    transform: translateX(-50%) translateY(-10px);
  }

  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

/* Buttons */
button {
  font-family: var(--font-main);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  /* Fast, responsive */
}

.button-primary {
  padding: 14px 32px;
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 8px;
  /* Clean rounded rect */
  font-size: 1rem;
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
}

.button-primary.glow-effect:hover {
  box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.4);
  transform: translateY(-2px);
}

.button-secondary {
  padding: 14px 32px;
  background: #fff;
  color: var(--text-color);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
}

.button-secondary:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: #f8fafc;
}

.button-outline {
  padding: 12px 28px;
  background: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  border-radius: 8px;
  margin-top: 30px;
}

.button-outline:hover {
  background: rgba(0, 240, 255, 0.1);
}

/* Services Section */
.services-section {
  background-color: var(--bg-secondary);
  /* Slate-50 for contrast against white cards */
}

.section {
  padding: 100px 60px;
}

/* Section Header (Large) */
.section-header {
  text-align: center;
  margin-bottom: 60px;
  position: relative;
  z-index: 2;
}

.icon-large {
  font-size: 4rem;
  margin-bottom: 20px;
  display: inline-block;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.section-title-large {
  font-size: 3rem;
  color: #fff;
  /* Always white on these BGs */
  font-weight: 800;
  margin-bottom: 20px;
}

.section-desc-large {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
}

/* Fullscreen Sections */
.fullscreen-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 100px 20px;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  /* Parallax feel */
}

.section-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.85);
  /* Slate-900 overlay for legibility */
  z-index: 1;
}

.content-wrapper {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1200px;
}

/* Specific Backgrounds */
.bg-game {
  background-image: url('imgs/game_bg.png');
}

.bg-web {
  background-image: url('imgs/web_bg.png');
}

/* Tilt Effect for Cards in Sections */
.tilt-effect {
  transform: perspective(1000px) rotateX(0deg) rotateY(0deg);
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.tilt-effect:hover {
  transform: perspective(1000px) rotateX(5deg) rotateY(5deg) translateY(-10px);
}

.services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

.glass-card {
  background: #fff;
  border: 1px solid #f1f5f9;
  padding: 40px;
  border-radius: 16px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.glass-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(37, 99, 235, 0.2);
}

.glass-card .icon {
  font-size: 3rem;
  margin-bottom: 20px;
}

.glass-card h4 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: var(--text-color);
  font-weight: 700;
}

.glass-card p {
  color: var(--text-body);
  line-height: 1.6;
  word-break: keep-all;
}

/* Modern Top-Border Gradient Accent */
.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.glass-card:hover::before {
  opacity: 1;
}

/* Portfolio Section */
/* Portfolio Section */
.portfolio-section {
  text-align: center;
  background: var(--bg-color);
  /* Clean White */
}

.section-desc {
  font-size: 1.2rem;
  color: var(--text-body);
  margin-bottom: 20px;
}

/* Footer */
footer {
  background: var(--text-main);
  /* Slate-900 */
  padding: 60px 60px;
  border-top: none;
  text-align: center;
}

.footer-content p {
  color: var(--text-light);
  /* Slate-400 */
  margin: 5px 0;
}

/* Slider Styles (Adapted for Dark Theme) */
.slider-container {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--glass-border);
}

.slider-wrapper {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  background: #000;
}

.slider-wrapper img {
  width: 100%;
  height: 500px;
  /* Fixed height for consistency */
  object-fit: cover;
  flex-shrink: 0;
  opacity: 0.8;
  /* Slightly dimmed images */
}

.placeholder-slide {
  width: 100%;
  height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
  color: #555;
  font-size: 1.5rem;
}

.prev-button,
.next-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.3s;
  backdrop-filter: blur(5px);
}

.prev-button:hover,
.next-button:hover {
  background: var(--primary-color);
  color: #000;
  border-color: var(--primary-color);
}

.prev-button {
  left: 20px;
}

.next-button {
  right: 20px;
}

/* Animations */
/* Sophisticated Animations */
.fade-in-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
  /* GSAP Power4.out feel */
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays handled via inline style or nth-child if needed */
.delay-100 {
  transition-delay: 0.1s;
}

.delay-200 {
  transition-delay: 0.2s;
}

.delay-300 {
  transition-delay: 0.3s;
}

/* Portfolio Page Styles */
.page-header {
  padding: 120px 20px 60px;
  text-align: center;
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-color) 100%);
}

.page-header p {
  font-size: 1.2rem;
  color: var(--text-body);
  margin-top: 20px;
}

.filter-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 60px;
  flex-wrap: wrap;
}

.filter-btn {
  background: transparent;
  border: 1px solid #cbd5e1;
  /* Slate-300 */
  color: var(--text-body);
  padding: 10px 24px;
  border-radius: 30px;
  cursor: pointer;
  font-family: var(--font-main);
  transition: all 0.2s ease;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
  box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

.portfolio-item {
  padding: 0;
  /* Override glass-card padding */
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.portfolio-img {
  width: 100%;
  /* Reduced height for more rectangular look */
  height: 160px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.placeholder-img {
  color: var(--text-light);
  font-size: 1.2rem;
}

.portfolio-info {
  padding: 15px 20px 20px;
  /* Reduced padding for compact look */
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.category-tag {
  font-size: 0.8rem;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
  font-weight: 600;
}

.portfolio-info h4 {
  font-size: 1.4rem;
  margin-bottom: 10px;
  color: var(--text-main);
}

.portfolio-info p {
  font-size: 0.95rem;
  color: var(--text-body);
  margin-bottom: 0;
  word-break: keep-all;
}

/* Responsive */
@media (max-width: 768px) {
  .glass-header {
    padding: 15px 20px;
    flex-direction: column;
    background: rgba(5, 5, 16, 0.95);
  }

  .logo {
    margin-bottom: 15px;
    font-size: 1.3rem;
  }

  nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  nav a {
    margin: 0 5px;
    font-size: 0.85rem;
  }

  .hero {
    padding-top: 120px;
    /* More space for stacked header */
    height: auto;
    min-height: 100vh;
  }

  .hero-content {
    padding: 0 10px;
  }

  .gradient-text {
    font-size: 2.2rem;
    margin-bottom: 15px;
  }

  .hero p {
    font-size: 1rem;
    margin-bottom: 30px;
  }

  .hero-buttons {
    flex-direction: column;
    width: 100%;
    gap: 15px;
  }

  .button-primary,
  .button-secondary {
    width: 100%;
    padding: 12px 20px;
  }

  .section {
    padding: 60px 20px;
  }

  .section-title {
    font-size: 2rem;
    margin-bottom: 40px;
  }

  .slider-container {
    margin-top: 40px;
  }

  .slider-wrapper img {
    height: 250px;
  }

  .glass-card {
    padding: 30px 20px;
  }
}

@media (max-width: 480px) {
  .gradient-text {
    font-size: 1.8rem;
  }

  nav a {
    font-size: 0.8rem;
    margin: 0 3px;
  }

  .prev-button,
  .next-button {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
}

/* Mobile Responsiveness for Fullscreen Sections */
@media (max-width: 768px) {
  .fullscreen-section {
    min-height: auto;
    /* Allow auto height on mobile */
    padding: 80px 20px;
    background-attachment: scroll;
    /* Fix for mobile parallax jitters */
  }

  .portfolio-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    /* Smaller cards on mobile */
    gap: 20px;
  }

  .section-title-large {
    font-size: 2rem;
  }

  .icon-large {
    font-size: 3rem;
  }
}