/* ========================================
   Game Developer Portfolio - Styles
   ======================================== */

/* CSS Variables */
:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-light: #1a1a1a;
  --border: #262626;
  --text-primary: #fafafa;
  --text-secondary: #a3a3a3;
  --text-muted: #737373;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --transition-fast: 150ms ease;
  --transition-base: 300ms ease;
  --transition-slow: 500ms ease;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::selection {
  background-color: rgba(59, 130, 246, 0.3);
  color: var(--text-primary);
}

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

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

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

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
}

h1 {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  letter-spacing: -0.02em;
  line-height: 1;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.25rem;
}

p {
  color: var(--text-secondary);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Layout */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (min-width: 768px) {
  .container {
    padding: 0 2rem;
  }
}

main {
  flex: 1;
}

/* Section */
.section {
  padding: 6rem 0;
}

@media (min-width: 768px) {
  .section {
    padding: 8rem 0;
  }
}

.section-header {
  margin-bottom: 4rem;
}

@media (min-width: 768px) {
  .section-header {
    margin-bottom: 5rem;
  }
}

.section-number {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  display: block;
}

.section-border {
  border-top: 1px solid var(--border);
}

/* ========================================
   Header
   ======================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background-color: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(38, 38, 38, 0.5);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

@media (min-width: 768px) {
  .header-inner {
    height: 5rem;
  }
}

.logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: color var(--transition-fast);
}

.logo:hover {
  color: var(--accent);
}

.logo-accent {
  color: var(--accent);
}

.nav-list {
  display: none;
  align-items: center;
  gap: 2rem;
}

@media (min-width: 768px) {
  .nav-list {
    display: flex;
  }
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  transition: color var(--transition-fast);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--accent);
  transition: width var(--transition-base);
}

.nav-link:hover {
  color: var(--text-primary);
}

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

/* Mobile Menu Button */
.menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.menu-btn:hover {
  color: var(--text-primary);
}

@media (min-width: 768px) {
  .menu-btn {
    display: none;
  }
}

/* Mobile Navigation */
.mobile-nav {
  display: none;
  border-top: 1px solid var(--border);
  background-color: var(--bg);
  padding: 1rem 1.5rem;
}

.mobile-nav.active {
  display: block;
}

@media (min-width: 768px) {
  .mobile-nav {
    display: none !important;
  }
}

.mobile-nav-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mobile-nav-link {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.5rem 0;
  transition: color var(--transition-fast);
}

.mobile-nav-link:hover {
  color: var(--text-primary);
}

/* Header Spacer */
.header-spacer {
  height: 4rem;
}

@media (min-width: 768px) {
  .header-spacer {
    height: 5rem;
  }
}

/* ========================================
   Footer
   ======================================== */
.footer {
  border-top: 1px solid var(--border);
  background-color: rgba(20, 20, 20, 0.5);
}

/* Marquee */
.marquee {
  overflow: hidden;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.marquee-content {
  display: flex;
  animation: marquee 30s linear infinite;
  white-space: nowrap;
}

.marquee-text {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 0 1rem;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  padding: 3rem 0;
}

@media (min-width: 768px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
  }
}

.footer-copyright {
  color: var(--text-muted);
  font-size: 0.875rem;
  text-align: center;
}

@media (min-width: 768px) {
  .footer-copyright {
    text-align: left;
  }
}

.footer-copyright p {
  color: inherit;
}

.footer-copyright p + p {
  margin-top: 0.25rem;
}

.back-to-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.back-to-top:hover {
  color: var(--text-primary);
}

.social-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.social-link {
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.social-link:hover {
  color: var(--text-primary);
}

.social-link svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all var(--transition-base);
  border: none;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--accent);
  color: white;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--text-muted);
  background-color: var(--surface);
}

.btn svg {
  width: 1rem;
  height: 1rem;
}

/* External Link Button */
.external-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  transition: all var(--transition-base);
}

.external-link:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
  background-color: var(--surface);
}

.external-link svg {
  width: 1rem;
  height: 1rem;
}

.external-link .arrow {
  width: 0.75rem;
  height: 0.75rem;
  opacity: 0.5;
  transition: all var(--transition-fast);
}

.external-link:hover .arrow {
  opacity: 1;
  transform: translate(2px, -2px);
}

/* ========================================
   Tags & Badges
   ======================================== */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9999px;
}

.type-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  border: 1px solid;
}

.type-plugin {
  background-color: rgba(168, 85, 247, 0.1);
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.2);
}

.type-game {
  background-color: rgba(34, 197, 94, 0.1);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.2);
}

.type-tool {
  background-color: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.2);
}

/* Skill Badge */
.skill-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  transition: all var(--transition-base);
}

.skill-badge:hover {
  background-color: var(--surface-light);
  border-color: var(--text-muted);
}

.skill-badge svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.skill-badge span {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
  min-height: 80vh;
  display: flex;
  align-items: center;
  padding: 5rem 0;
}

.hero-content {
  max-width: 56rem;
}

.hero h1 {
  margin-bottom: 2rem;
}

.hero h1 span {
  color: var(--text-secondary);
}

.hero-description {
  font-size: 1.25rem;
  line-height: 1.75;
  max-width: 42rem;
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .hero-description {
    font-size: 1.5rem;
  }
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ========================================
   About Section
   ======================================== */
.about-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 768px) {
  .about-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
  }
}

.about-card h3 {
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.about-card p {
  line-height: 1.75;
}

/* ========================================
   Projects Section
   ======================================== */
.projects-header {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 4rem;
}

@media (min-width: 768px) {
  .projects-header {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}

.view-all-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.view-all-link:hover {
  color: var(--text-primary);
}

.projects-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Project Card */
.project-card {
  display: block;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  overflow: hidden;
  transition: transform var(--transition-slow);
}

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

.project-card-image {
  position: relative;
  aspect-ratio: 16 / 9;
  background-color: var(--surface-light);
  overflow: hidden;
}

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

.project-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.project-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.project-card-placeholder svg {
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

.project-card-placeholder span {
  font-size: 0.875rem;
  opacity: 0.5;
}

.project-card-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
}

.project-card-content {
  padding: 1.5rem;
}

.project-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.project-card-title {
  font-size: 1.25rem;
  color: var(--text-primary);
  transition: color var(--transition-fast);
}

.project-card:hover .project-card-title {
  color: var(--accent);
}

.project-card-arrow {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-top: 0.25rem;
  transition: all var(--transition-fast);
}

.project-card:hover .project-card-arrow {
  color: var(--accent);
  transform: translate(4px, -4px);
}

.project-card-description {
  font-size: 0.875rem;
  line-height: 1.625;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.project-card-meta .tag {
  font-size: 0.75rem;
}

.project-card-duration {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ========================================
   Skills Section
   ======================================== */
.skills-description {
  max-width: 42rem;
  margin-bottom: 3rem;
}

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

@media (min-width: 768px) {
  .skills-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ========================================
   Contact Section
   ======================================== */
.contact-content {
  max-width: 42rem;
}

.contact-content h2 {
  margin-bottom: 1.5rem;
}

.contact-description {
  font-size: 1.125rem;
  line-height: 1.75;
  margin-bottom: 2.5rem;
}

.contact-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 640px) {
  .contact-buttons {
    flex-direction: row;
  }
}

/* ========================================
   Projects Index Page
   ======================================== */
.page-header {
  margin-bottom: 3rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  transition: color var(--transition-fast);
}

.back-link:hover {
  color: var(--text-secondary);
}

.back-link svg {
  width: 1rem;
  height: 1rem;
}

.page-header h1 {
  margin-bottom: 1.5rem;
}

.page-header p {
  font-size: 1.125rem;
  max-width: 42rem;
}

/* Filter Buttons */
.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 3rem;
}

.filter-btn {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all var(--transition-base);
  border: 1px solid var(--border);
  background-color: transparent;
  color: var(--text-secondary);
}

.filter-btn:hover {
  color: var(--text-primary);
  background-color: var(--surface);
}

.filter-btn.active {
  background-color: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* Coming Soon Badge */
.coming-soon {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  margin-top: 4rem;
}

.coming-soon-dot {
  width: 0.5rem;
  height: 0.5rem;
  background-color: #22c55e;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.coming-soon p {
  font-size: 0.875rem;
}

/* ========================================
   Project Detail Page
   ======================================== */
.project-hero {
  padding: 3rem 0 4rem;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 768px) {
  .project-hero {
    padding: 4rem 0 6rem;
  }
}

.project-hero-grid {
  display: grid;
  gap: 3rem;
}

@media (min-width: 1024px) {
  .project-hero-grid {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
  }
}

.project-hero-info .type-badge {
  margin-bottom: 1.5rem;
}

.project-hero-info h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 1.5rem;
}

.project-hero-description {
  font-size: 1.125rem;
  line-height: 1.75;
  margin-bottom: 2rem;
}

.project-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.project-meta-item label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.project-meta-item span {
  font-weight: 500;
  color: var(--text-primary);
}

.project-tech {
  margin-bottom: 2rem;
}

.project-tech label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.project-tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.project-hero-image {
  aspect-ratio: 16 / 9;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-hero-placeholder {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

.project-hero-placeholder svg {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 0.75rem;
  opacity: 0.3;
}

.project-hero-placeholder span {
  font-size: 0.875rem;
  opacity: 0.5;
}

/* Project Content */
.project-content {
  padding: 4rem 0 6rem;
}

.project-content-inner {
  max-width: 56rem;
  margin: 0 auto;
}

.prose h2 {
  font-size: 1.875rem;
  margin-top: 4rem;
  margin-bottom: 1.5rem;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  font-size: 1.25rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.prose p {
  margin-bottom: 1.5rem;
  line-height: 1.75;
}

.prose ul {
  list-style: disc;
  margin-left: 1.25rem;
  margin-bottom: 1.5rem;
}

.prose li {
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  line-height: 1.75;
}

.prose strong {
  color: var(--text-primary);
  font-weight: 500;
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.prose a:hover {
  color: var(--accent-hover);
}

/* Project Gallery */
.project-gallery {
  padding: 4rem 0 6rem;
  border-top: 1px solid var(--border);
  background-color: rgba(20, 20, 20, 0.3);
}

.project-gallery h2 {
  margin-bottom: 2.5rem;
}

.gallery-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.gallery-item {
  aspect-ratio: 16 / 9;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  opacity: 0.5;
}

/* Project Navigation */
.project-nav {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
}

.project-nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ========================================
   Animations
   ======================================== */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

.reveal-delay-1 { transition-delay: 100ms; }
.reveal-delay-2 { transition-delay: 200ms; }
.reveal-delay-3 { transition-delay: 300ms; }
.reveal-delay-4 { transition-delay: 400ms; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ========================================
   Utilities
   ======================================== */
.text-center { text-align: center; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mt-16 { margin-top: 4rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }
