/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700;900&display=swap');

/* CSS Variables */
:root {
  --primary: #39FF14;
  --primary-hover: #32CC11;
  --secondary: #6366F1;
  --secondary-hover: #4F46E5;
  --bg-light: #FFFFFF;
  --bg-dark: #0F0F0F;
  --bg-secondary-light: #F8F9FA;
  --bg-secondary-dark: #1A1A1A;
  --bg-card-light: #FFFFFF;
  --bg-card-dark: #1A1A1A;
  --text-light: #1A1A1A;
  --text-dark: #E0E0E0;
  --text-secondary-light: #666666;
  --text-secondary-dark: #A0A0A0;
  --border-light: #E0E0E0;
  --border-dark: #2A2A2A;
  --shadow-light: rgba(0, 0, 0, 0.08);
  --shadow-dark: rgba(0, 0, 0, 0.2);
  --nav-height: 60px;
}

/* Firefox-specific fixes */
@supports (-moz-appearance: none) {
  :root {
    --nav-height: 60px;
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Malgun Gothic UI', sans-serif;
  line-height: 1.6;
  color: var(--text-light);
  background-color: var(--bg-light);
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  padding-top: 60px;
  padding-top: var(--nav-height);
}

/* Dark Mode Styles */
@media (prefers-color-scheme: dark) {
  body {
    background-color: var(--bg-dark);
    color: var(--text-dark);
  }
  
  .card,
  .nav-menu,
  .project-card,
  .contact-card {
    background-color: var(--bg-card-dark);
    border-color: var(--border-dark);
    box-shadow: 0 2px 8px var(--shadow-dark);
  }
  
  .card:hover,
  .project-card:hover,
  .contact-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(57, 255, 20, 0.15);
  }
}

/* Light Mode Styles */
@media (prefers-color-scheme: light) {
  body {
    background-color: var(--bg-light);
    color: var(--text-light);
  }
  
  .card,
  .nav-menu,
  .project-card,
  .contact-card {
    background-color: var(--bg-card-light);
    border-color: var(--border-light);
    box-shadow: 0 2px 8px var(--shadow-light);
  }
  
  .card:hover,
  .project-card:hover,
  .contact-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(57, 255, 20, 0.15);
  }
}

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background-color: var(--bg-dark);
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  transition: background-color 0.3s ease;
}

@media (prefers-color-scheme: light) {
  .nav {
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  }
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.25rem;
  color: var(--bg-dark);
}

.nav-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-light);
}

@media (prefers-color-scheme: dark) {
  .nav-title {
    color: var(--text-dark);
  }
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 10;
}

.nav-toggle span {
  width: 100%;
  height: 2px;
  background-color: var(--primary);
  transition: all 0.3s linear;
  transform-origin: center;
}

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

.nav-link {
  color: var(--text-light);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

@media (prefers-color-scheme: dark) {
  .nav-link {
    color: var(--text-dark);
  }
}

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

/* Mobile Navigation */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }
  
  .nav-menu {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    gap: 0.5rem;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  }
  
  .nav-menu.active {
    transform: translateX(0);
  }
  
  .nav-link {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    text-align: center;
  }
}

/* Hero Section */
.hero {
  position: relative;
  min-height: calc(100vh - 60px);
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-dark) 0%, #1a1a2e 100%);
  overflow: hidden;
}

/* Firefox-specific height fix */
@supports (-moz-appearance: none) {
  .hero {
    min-height: calc(100vh - 60px);
  }
}

@media (prefers-color-scheme: light) {
  .hero {
    background: linear-gradient(135deg, var(--bg-secondary-light) 0%, #e8e8e8 100%);
  }
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 50%, rgba(57, 255, 20, 0.1) 0%, transparent 50%),
              radial-gradient(circle at 80% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
  animation: pulse 8s ease-in-out infinite;
  z-index: 0;
  pointer-events: none;
}

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

/* Firefox animation fix */
@supports (-moz-appearance: none) {
  .hero-bg {
    -moz-animation: pulse 8s ease-in-out infinite;
  }
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem 1rem;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  pointer-events: auto;
}

/* Firefox flexbox fix */
@supports (-moz-appearance: none) {
  .hero-content {
    -moz-box-orient: vertical;
    -moz-box-direction: normal;
  }
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: 0.75rem;
  color: var(--primary);
  opacity: 1;
  text-shadow: 0 0 30px rgba(57, 255, 20, 0.5);
}

@media (min-width: 480px) {
  .hero-title {
    font-size: 3rem;
  }
}

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

@media (min-width: 1024px) {
  .hero-title {
    font-size: 4rem;
  }
}

.hero-subtitle {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  opacity: 1;
  color: var(--text-light);
}

@media (prefers-color-scheme: dark) {
  .hero-subtitle {
    color: var(--text-dark);
  }
}

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

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

.hero-description {
  font-size: 1rem;
  margin-bottom: 2rem;
  opacity: 1;
  color: var(--text-light);
}

@media (prefers-color-scheme: dark) {
  .hero-description {
    color: var(--text-dark);
  }
}

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

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

.hero-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
  width: 100%;
  opacity: 1;
}

@media (min-width: 480px) {
  .hero-buttons {
    flex-direction: row;
    justify-content: center;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
}

@media (min-width: 480px) {
  .btn {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
  }
}

.btn-primary {
  background-color: var(--primary);
  color: var(--bg-dark);
  box-shadow: 0 4px 12px rgba(57, 255, 20, 0.3);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(57, 255, 20, 0.4);
}

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

.btn-secondary:hover {
  background-color: var(--primary);
  color: var(--bg-dark);
}

/* Section Styles */
.section {
  padding: 3rem 1rem;
}

@media (min-width: 480px) {
  .section {
    padding: 3.5rem 1.5rem;
  }
}

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

@media (min-width: 1024px) {
  .section {
    padding: 5rem 2rem;
  }
}

.section-alt {
  background-color: var(--bg-secondary-dark);
}

@media (prefers-color-scheme: light) {
  .section-alt {
    background-color: var(--bg-secondary-light);
  }
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
  color: var(--primary);
  text-shadow: 0 0 20px rgba(57, 255, 20, 0.4);
}

@media (min-width: 480px) {
  .section-title {
    font-size: 2.25rem;
  }
}

@media (min-width: 768px) {
  .section-title {
    font-size: 2.5rem;
  }
}

@media (min-width: 1024px) {
  .section-title {
    font-size: 2.75rem;
  }
}

.section-subtitle {
  text-align: center;
  font-size: 0.9rem;
  margin-bottom: 2rem;
  opacity: 0.7;
}

@media (min-width: 480px) {
  .section-subtitle {
    font-size: 1rem;
  }
}

@media (min-width: 768px) {
  .section-subtitle {
    font-size: 1.125rem;
    margin-bottom: 2.5rem;
  }
}

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

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

.tech-stack {
  margin-top: 2rem;
}

.tech-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--primary);
}

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

.tech-tag {
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, rgba(57, 255, 20, 0.1), rgba(99, 102, 241, 0.1));
  border: 1px solid var(--primary);
  border-radius: 20px;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--primary);
  transition: all 0.3s ease;
}

.tech-tag:hover {
  background: linear-gradient(135deg, rgba(57, 255, 20, 0.2), rgba(99, 102, 241, 0.2));
  transform: translateY(-2px);
}

/* Project Grid */
.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

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

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

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

/* Project Card */
.project-card {
  border: 1px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

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

.project-image {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--bg-secondary-dark), var(--bg-dark));
}

@media (min-width: 480px) {
  .project-image {
    height: 240px;
  }
}

@media (min-width: 768px) {
  .project-image {
    height: 280px;
  }
}

.project-thumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 1.5rem;
  transition: transform 0.3s ease;
}

.project-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.6));
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-card:hover .project-overlay {
  opacity: 1;
}

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

.project-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tag {
  padding: 0.25rem 0.75rem;
  background: linear-gradient(135deg, rgba(57, 255, 20, 0.1), rgba(99, 102, 241, 0.1));
  border: 1px solid rgba(57, 255, 20, 0.3);
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--primary);
}

.project-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--primary);
}

@media (min-width: 480px) {
  .project-title {
    font-size: 1.5rem;
  }
}

.project-description {
  font-size: 0.9rem;
  line-height: 1.6;
  opacity: 0.8;
  margin-bottom: 1.5rem;
  flex: 1;
}

@media (min-width: 480px) {
  .project-description {
    font-size: 1rem;
  }
}

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

.project-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  transition: color 0.3s ease;
}

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

.project-link svg {
  transition: transform 0.3s ease;
}

.project-link:hover svg {
  transform: translateX(3px);
}

/* Contact Section */
.contact-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 600px;
  margin: 0 auto;
}

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

.contact-card {
  flex: 1;
  text-align: center;
  padding: 2rem;
  border: 1px solid transparent;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.contact-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

@media (min-width: 480px) {
  .contact-icon {
    font-size: 3rem;
  }
}

.contact-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

@media (min-width: 480px) {
  .contact-title {
    font-size: 1.25rem;
  }
}

.contact-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.contact-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Footer */
.footer {
  padding: 2rem 1rem;
  background-color: var(--bg-secondary-dark);
  border-top: 1px solid var(--border-dark);
}

@media (prefers-color-scheme: light) {
  .footer {
    background-color: var(--bg-secondary-light);
    border-top-color: var(--border-light);
  }
}

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

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

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

.footer-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--primary);
}

.footer-text {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  opacity: 0.9;
}

.footer-copyright {
  font-size: 0.8rem;
  opacity: 0.6;
}

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

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

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

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

/* Print Styles */
@media print {
  .nav,
  .hero-bg,
  .btn {
    display: none;
  }
  
  body {
    background: white;
    color: black;
  }
}

/* Utility Classes */
@media (prefers-color-scheme: dark) {
  .card,
  .project-card,
  .contact-card {
    color: var(--text-dark);
  }
}

@media (prefers-color-scheme: light) {
  .card,
  .project-card,
  .contact-card {
    color: var(--text-light);
  }
}