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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans KR', sans-serif;
  background: #0a0a0f;
  color: #e0e0e8;
  line-height: 1.7;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 16px 0;
  transition: background 0.3s, box-shadow 0.3s, padding 0.3s;
}

.navbar.scrolled {
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 20px rgba(0, 0, 0, 0.4);
  padding: 10px 0;
}

.nav-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: #fff;
}

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

.nav-logo span {
  background: linear-gradient(135deg, #7c3aed, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 32px;
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: #a0a0b0;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: #fff;
}

/* Auth UI */
.nav-auth {
  display: flex;
  align-items: center;
  margin-left: 24px;
}

.btn-login {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e0e0e8;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-login:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-login svg {
  flex-shrink: 0;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(124, 58, 237, 0.4);
}

.user-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: #e0e0e8;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-logout {
  padding: 6px 14px;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #888;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.btn-logout:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-delete-account {
  padding: 6px 14px;
  border-radius: 50px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-delete-account:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
}

.delete-modal-content {
  max-width: 420px;
  text-align: center;
}

.delete-modal-desc {
  color: #888;
  font-size: 0.95rem;
  margin: 16px 0 28px;
  line-height: 1.6;
}

.delete-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn-cancel {
  padding: 12px 28px;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e0e0e8;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-cancel:hover {
  background: rgba(255, 255, 255, 0.14);
}

.btn-confirm-delete {
  padding: 12px 28px;
  border-radius: 50px;
  background: #dc2626;
  border: none;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-confirm-delete:hover {
  background: #b91c1c;
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 20%, rgba(124, 58, 237, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 60%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
  animation: heroPulse 8s ease-in-out infinite alternate;
}

@keyframes heroPulse {
  0% { opacity: 0.7; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.05); }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 900;
  line-height: 1.25;
  color: #fff;
  margin-bottom: 20px;
}

.gradient-text {
  background: linear-gradient(135deg, #7c3aed, #3b82f6, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: #a0a0b8;
  margin-bottom: 36px;
  font-weight: 300;
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 14px 36px;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, #7c3aed, #3b82f6);
  color: #fff;
  box-shadow: 0 4px 24px rgba(124, 58, 237, 0.35);
}

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

/* ===== Sections ===== */
.section {
  padding: 100px 0;
}

.section-title {
  text-align: center;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}

.section-desc {
  text-align: center;
  color: #8888a0;
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto 48px;
}

/* ===== Works Grid ===== */
.works-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.work-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.work-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(124, 58, 237, 0.15);
  border-color: rgba(124, 58, 237, 0.3);
}

.work-thumb {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.work-emoji {
  font-size: 3rem;
}

.work-info {
  padding: 20px;
}

.work-genre {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(124, 58, 237, 0.2);
  color: #a78bfa;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 8px;
}

.work-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.work-desc {
  font-size: 0.9rem;
  color: #8888a0;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: #14141f;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  max-width: 720px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 40px;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 2rem;
  color: #666;
  transition: color 0.2s;
  line-height: 1;
}

.modal-close:hover {
  color: #fff;
}

.modal-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-genre {
  display: inline-block;
  padding: 4px 14px;
  background: rgba(124, 58, 237, 0.2);
  color: #a78bfa;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 12px;
}

.modal-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
}

.modal-body {
  font-size: 1.05rem;
  line-height: 2;
  color: #c0c0d0;
}

.modal-body p {
  margin-bottom: 16px;
  text-indent: 1em;
}

/* ===== Features Grid ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.feature-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  transition: transform 0.3s, border-color 0.3s;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(124, 58, 237, 0.25);
}

.feature-icon {
  font-size: 2.4rem;
  margin-bottom: 16px;
}

.feature-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.feature-desc {
  font-size: 0.9rem;
  color: #8888a0;
  line-height: 1.6;
}

/* ===== CTA ===== */
.section-cta {
  text-align: center;
}

.cta-form {
  display: flex;
  gap: 12px;
  max-width: 480px;
  margin: 0 auto 16px;
}

.cta-input {
  flex: 1;
  padding: 14px 20px;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.cta-input::placeholder {
  color: #666;
}

.cta-input:focus {
  border-color: #7c3aed;
}

.cta-note {
  font-size: 0.85rem;
  color: #666;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: linear-gradient(135deg, #7c3aed, #3b82f6);
  color: #fff;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 500;
  z-index: 3000;
  opacity: 0;
  transition: transform 0.4s, opacity 0.4s;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 40px 0;
}

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

.footer-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1.3rem;
  font-weight: 900;
  color: #fff;
}

.footer-logo-img {
  height: 28px;
  width: auto;
}

.footer-logo span {
  background: linear-gradient(135deg, #7c3aed, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 0.9rem;
  color: #666;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: #a78bfa;
}

.footer-copy {
  font-size: 0.8rem;
  color: #444;
}

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

::-webkit-scrollbar-track {
  background: #0a0a0f;
}

::-webkit-scrollbar-thumb {
  background: #2a2a3e;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #3a3a52;
}

.modal-content::-webkit-scrollbar-track {
  background: #14141f;
}

/* ===== Legal Pages ===== */
.legal-page {
  padding-top: 140px;
}

.legal-updated {
  text-align: center;
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 48px;
}

.legal-content {
  max-width: 720px;
  margin: 0 auto;
}

.legal-content h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin: 32px 0 12px;
}

.legal-content p {
  color: #a0a0b8;
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 8px;
}

.legal-content strong {
  color: #c0c0d0;
}

/* ===== Nav Active Link ===== */
.nav-links a.active {
  color: #fff;
}

/* ===== Card Focus ===== */
.work-card:focus {
  outline: 2px solid #7c3aed;
  outline-offset: 2px;
}

/* ===== Stagger Animation Delay ===== */
.fade-up.stagger-1 { transition-delay: 0.1s; }
.fade-up.stagger-2 { transition-delay: 0.2s; }
.fade-up.stagger-3 { transition-delay: 0.3s; }
.fade-up.stagger-4 { transition-delay: 0.4s; }
.fade-up.stagger-5 { transition-delay: 0.5s; }

/* ===== Mobile Nav Overlay ===== */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

.nav-overlay.open {
  display: block;
}

/* ===== Scroll Animations ===== */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .works-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .nav-toggle {
    display: flex;
  }

  .nav-auth {
    margin-left: auto;
    margin-right: 12px;
  }

  .user-name {
    display: none;
  }

  .btn-login {
    padding: 8px 12px;
    font-size: 0;
  }

  .btn-login svg {
    margin: 0;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    width: 260px;
    height: 100vh;
    background: rgba(14, 14, 22, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    padding: 80px 32px 32px;
    gap: 24px;
    transform: translateX(100%);
    transition: transform 0.3s;
  }

  .nav-links.open {
    transform: translateX(0);
  }

  .nav-links a {
    font-size: 1.1rem;
  }

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

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

  .cta-form {
    flex-direction: column;
  }

  .cta-form .btn {
    width: 100%;
    text-align: center;
  }

  .modal-content {
    padding: 28px 20px;
  }
}
