/* =============================================
   RiCH ALiEN Games - Corporate Website
   Theme: Black / Purple / Calm Space
   v2 - Visual Upgrade
   ============================================= */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-primary: #09090f;
  --bg-secondary: #0c0b16;
  --bg-card: rgba(255,255,255,0.025);
  --bg-card-hover: rgba(255,255,255,0.05);
  --glass-bg: rgba(15,14,28,0.6);
  --glass-border: rgba(255,255,255,0.08);
  --purple-deep: #2d1b69;
  --purple-main: #7c3aed;
  --purple-light: #a78bfa;
  --purple-glow: rgba(124,58,237,0.25);
  --text-primary: #f0eef6;
  --text-secondary: rgba(240,238,246,0.6);
  --text-muted: rgba(240,238,246,0.35);
  --border-subtle: rgba(255,255,255,0.06);
  --font-en: 'Outfit', sans-serif;
  --font-kr: 'Noto Sans KR', sans-serif;
  --nav-height: 72px;
  --container-max: 1200px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-en);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body[data-lang="ko"] {
  font-family: var(--font-kr), var(--font-en);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Stars Background ---------- */
.stars-container {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.star {
  position: absolute;
  border-radius: 50%;
  background: #fff;
  animation: twinkle var(--duration) ease-in-out infinite;
  opacity: 0;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.1; transform: scale(0.8); }
  50% { opacity: var(--max-opacity); transform: scale(1); }
}

.planet {
  position: absolute;
  border-radius: 50%;
  filter: blur(1px);
  opacity: 0.15;
  animation: float 20s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  transition: background var(--transition), box-shadow var(--transition);
}

.nav.scrolled {
  background: rgba(9,9,15,0.85);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  box-shadow: 0 1px 0 var(--border-subtle), 0 4px 30px rgba(0,0,0,0.3);
}

.nav-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo img {
  height: 39px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition);
  letter-spacing: 0.02em;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--purple-main);
  border-radius: 1px;
  transition: width var(--transition);
}

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

.nav-link:hover,
.nav-link.active {
  color: var(--purple-light);
}

/* Language Toggle */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(124,58,237,0.12);
  border: 1px solid rgba(124,58,237,0.25);
  border-radius: 20px;
  padding: 6px 14px;
  color: var(--purple-light);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-en);
  letter-spacing: 0.05em;
}

.lang-toggle:hover {
  background: rgba(124,58,237,0.2);
  border-color: var(--purple-main);
}

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-hamburger span {
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition);
}

.nav-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: rgba(9,9,15,0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 24px;
  z-index: 999;
  flex-direction: column;
  gap: 0;
  border-bottom: 1px solid var(--border-subtle);
  transform: translateY(-10px);
  opacity: 0;
  transition: all var(--transition);
  pointer-events: none;
}

.mobile-menu.open {
  display: flex;
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}

.mobile-menu-link {
  padding: 16px 0;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  transition: color var(--transition);
}

.mobile-menu-link:hover { color: var(--purple-light); }

.mobile-lang {
  margin-top: 16px;
  align-self: flex-start;
}

/* ---------- Hero Section ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 1;
  overflow: hidden;
}

/* Multi-layered nebula glow */
.hero::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(124,58,237,0.2) 0%, rgba(124,58,237,0.05) 40%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: nebulaPulse 8s ease-in-out infinite;
}

.hero::after {
  content: '';
  position: absolute;
  top: 35%;
  left: 60%;
  transform: translate(-50%, -50%);
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(147,51,234,0.12) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: nebulaPulse 12s ease-in-out infinite reverse;
}

@keyframes nebulaPulse {
  0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 24px;
}

.hero-pre {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--purple-light);
  margin-bottom: 24px;
  opacity: 0;
  animation: heroFadeUp 1s 0.2s ease forwards;
}

.hero-tagline {
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #ffffff 0%, var(--purple-light) 50%, #c4b5fd 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: heroFadeUp 1s 0.4s ease forwards, gradientShift 8s ease-in-out infinite;
  opacity: 0;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-sub {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  font-weight: 300;
  margin-bottom: 44px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  opacity: 0;
  animation: heroFadeUp 1s 0.6s ease forwards;
}

.hero-cta {
  opacity: 0;
  animation: heroFadeUp 1s 0.8s ease forwards;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 36px;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  font-family: inherit;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--purple-main), #9333ea);
  color: #fff;
  box-shadow: 0 4px 24px rgba(124,58,237,0.3), inset 0 1px 0 rgba(255,255,255,0.1);
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.15) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.btn-primary:hover::before {
  transform: translateX(100%);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 40px rgba(124,58,237,0.5);
}

/* Scroll Indicator */
.hero-scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.scroll-arrow {
  width: 24px;
  height: 24px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: rotate(45deg) translateY(0); opacity: 0.3; }
  50% { transform: rotate(45deg) translateY(8px); opacity: 0.7; }
}

/* ---------- Section Transitions ---------- */
.section-fade {
  position: relative;
  z-index: 1;
  height: 120px;
  margin-top: -1px;
  pointer-events: none;
}

.section-fade--to-dark {
  background: linear-gradient(to bottom, var(--bg-secondary), var(--bg-primary));
}

.section-fade--to-light {
  background: linear-gradient(to bottom, var(--bg-primary), var(--bg-secondary));
}

/* ---------- Sections ---------- */
.section {
  position: relative;
  z-index: 1;
  padding: 120px 0;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.01em;
}

.section-divider {
  width: 56px;
  height: 3px;
  background: linear-gradient(90deg, var(--purple-main), var(--purple-light));
  margin: 16px auto 20px;
  border-radius: 2px;
  position: relative;
}

.section-divider::after {
  content: '';
  position: absolute;
  inset: -4px -8px;
  background: linear-gradient(90deg, var(--purple-main), var(--purple-light));
  border-radius: 4px;
  filter: blur(8px);
  opacity: 0.4;
}

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.05rem;
  font-weight: 300;
  margin-bottom: 56px;
}

/* ---------- About Section ---------- */
.about {
  background: var(--bg-secondary);
  position: relative;
  overflow: hidden;
}

/* Nebula accent in about */
.about::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -200px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(124,58,237,0.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 56px;
}

/* Glassmorphism Cards */
.about-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 40px 28px;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  transform: translateY(40px);
  position: relative;
  overflow: hidden;
}

/* Animated gradient border on hover */
.about-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 20px;
  padding: 1px;
  background: linear-gradient(135deg, transparent 0%, rgba(124,58,237,0.3) 50%, transparent 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
}

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

/* Top glow accent */
.about-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--purple-light), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.about-card:hover::after {
  opacity: 0.5;
}

.about-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.about-card:hover {
  background: rgba(20,18,40,0.7);
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(124,58,237,0.08);
}

.about-card.visible:hover {
  transform: translateY(-6px);
}

.about-card-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 20px;
  color: var(--purple-light);
  background: rgba(124,58,237,0.08);
  border-radius: 14px;
  padding: 12px;
  transition: all var(--transition);
}

.about-card:hover .about-card-icon {
  background: rgba(124,58,237,0.15);
  transform: scale(1.05);
}

.about-card-icon svg {
  width: 100%;
  height: 100%;
}

.about-card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.about-card p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

.about-statement {
  margin-top: 72px;
  text-align: center;
  opacity: 0;
  transform: translateY(40px);
}

.about-statement.visible {
  opacity: 1;
  transform: translateY(0);
}

.about-statement blockquote {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding: 36px 44px;
  background: linear-gradient(135deg, rgba(124,58,237,0.06), rgba(45,27,105,0.1));
  backdrop-filter: blur(12px);
  border: 1px solid rgba(124,58,237,0.12);
  border-radius: 20px;
}

.about-statement blockquote::before {
  content: '\201C';
  position: absolute;
  top: 16px;
  left: 24px;
  font-size: 4rem;
  color: var(--purple-main);
  opacity: 0.2;
  font-family: Georgia, serif;
  line-height: 1;
}

.about-statement blockquote p {
  font-size: 1.08rem;
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.85;
}

/* ---------- Portfolio Section ---------- */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  margin-top: 16px;
}

.portfolio-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  transform: translateY(40px);
}

.portfolio-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.portfolio-card:hover {
  border-color: rgba(124,58,237,0.3);
  transform: translateY(-8px);
  box-shadow: 0 24px 64px rgba(124,58,237,0.12), 0 0 0 1px rgba(124,58,237,0.1);
}

.portfolio-card.visible:hover {
  transform: translateY(-8px);
}

.portfolio-thumb {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: var(--bg-secondary);
  overflow: hidden;
}

.portfolio-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-card:hover .portfolio-thumb img {
  transform: scale(1.08);
}

.portfolio-thumb-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.portfolio-info {
  padding: 24px;
}

.portfolio-info h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.portfolio-info p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.portfolio-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.portfolio-tag {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(124,58,237,0.1);
  color: var(--purple-light);
  font-weight: 500;
}

.portfolio-empty {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* ---------- Contact Section ---------- */
.contact {
  background: var(--bg-secondary);
  position: relative;
  overflow: hidden;
}

.contact::after {
  content: '';
  position: absolute;
  bottom: -200px;
  left: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(124,58,237,0.05) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 56px;
}

.contact-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 40px 28px;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  transform: translateY(40px);
  position: relative;
  overflow: hidden;
}

.contact-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 20px;
  padding: 1px;
  background: linear-gradient(135deg, transparent 0%, rgba(124,58,237,0.3) 50%, transparent 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
}

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

.contact-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.contact-card:hover {
  background: rgba(20,18,40,0.7);
  transform: translateY(-4px);
}

.contact-card.visible:hover {
  transform: translateY(-4px);
}

.contact-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  color: var(--purple-light);
  background: rgba(124,58,237,0.08);
  border-radius: 14px;
  padding: 10px;
  transition: all var(--transition);
}

.contact-card:hover .contact-icon {
  background: rgba(124,58,237,0.15);
}

.contact-icon svg {
  width: 100%;
  height: 100%;
}

.contact-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.contact-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.contact-link {
  color: var(--purple-light);
  transition: color var(--transition);
}

.contact-link:hover {
  color: #c4b5fd;
  text-decoration: underline;
}

.contact-card--link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.contact-card--link:hover {
  transform: translateY(-4px);
}

.contact-card--link.visible:hover {
  transform: translateY(-4px);
}

/* ---------- Footer ---------- */
.footer {
  position: relative;
  z-index: 1;
  padding: 48px 0;
  background: linear-gradient(to bottom, var(--bg-primary), #060610);
}

/* Horizon glow */
.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  max-width: 600px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(124,58,237,0.3), transparent);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.footer-logo img {
  height: 28px;
  opacity: 0.5;
}

.footer-info p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer-copy p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ---------- Scroll Animations ---------- */
[data-aos] {
  transition: opacity 0.7s ease, transform 0.7s ease;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --nav-height: 60px;
  }

  .nav-links {
    display: none;
  }

  .nav-hamburger {
    display: flex;
  }

  .section {
    padding: 80px 0;
  }

  .about-statement blockquote {
    padding: 24px;
  }

  .section-fade {
    height: 60px;
  }
}

@media (max-width: 480px) {
  .hero-tagline {
    font-size: 2.2rem;
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  .btn {
    padding: 12px 24px;
    font-size: 0.9rem;
  }
}
