@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #090909;
  --surface: #111111;
  --card: #1a1a1a;
  --card-hover: #222222;
  --border: #2a2a2a;
  --text: #f0f0f0;
  --text-muted: #888888;
  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --shadow: 0 4px 32px rgba(0, 0, 0, 0.5);
  --transition: all 0.25s ease;
}

[data-theme="light"] {
  --bg: #f5f5f5;
  --surface: #ebebeb;
  --card: #ffffff;
  --card-hover: #f9f9f9;
  --border: #e0e0e0;
  --text: #111111;
  --text-muted: #6b6b6b;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --shadow: 0 4px 32px rgba(0, 0, 0, 0.08);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* ─── Header ─── */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(9, 9, 9, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s ease, border-color 0.3s ease;
}

[data-theme="light"] .header {
  background: rgba(245, 245, 245, 0.9);
}

.header .container {
  display: flex;
  align-items: center;
  height: 64px;
  gap: 24px;
}

.logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

.nav {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 8px;
  transition: var(--transition);
}

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

.nav-link.active {
  color: var(--text);
  background: var(--card);
}

.theme-toggle {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

/* ─── Layout ─── */
main {
  flex: 1;
  padding-top: 64px;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ─── Home Hero ─── */
.hero {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 0;
}

.hero-content {
  text-align: center;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
}

.hero-title {
  font-size: clamp(3.5rem, 10vw, 6.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 52px;
  font-weight: 400;
}

.hero-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.hero-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  text-decoration: none;
  color: var(--text);
  text-align: left;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hero-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0;
  transition: var(--transition);
}

.hero-card:hover {
  border-color: var(--accent);
  background: var(--card-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.hero-card:hover::after {
  opacity: 1;
}

.hero-card-icon {
  width: 44px;
  height: 44px;
  background: rgba(129, 140, 248, 0.12);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  color: var(--accent);
}

[data-theme="light"] .hero-card-icon {
  background: rgba(99, 102, 241, 0.1);
}

.hero-card-icon svg {
  width: 22px;
  height: 22px;
}

.hero-card h2 {
  font-size: 1.1rem;
  font-weight: 600;
}

.hero-card p {
  color: var(--text-muted);
  font-size: 0.825rem;
  line-height: 1.5;
  flex: 1;
}

.hero-card-arrow {
  color: var(--accent);
  font-size: 1rem;
  margin-top: 10px;
  display: inline-block;
  transition: transform 0.2s ease;
}

.hero-card:hover .hero-card-arrow {
  transform: translateX(5px);
}

/* ─── Page Header (inner pages) ─── */
.page-hero {
  padding: 52px 0 36px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}

.page-hero h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.page-hero p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ─── Video Grid ─── */
.video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding-bottom: 80px;
}

.video-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: var(--transition);
  display: block;
}

.video-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.video-thumb {
  position: relative;
  padding-top: 56.25%;
  background: var(--surface);
  overflow: hidden;
}

.video-thumb img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.video-thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.video-card:hover .video-thumb-overlay {
  opacity: 1;
}

.play-btn {
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111;
}

.play-btn svg {
  width: 22px;
  height: 22px;
  margin-left: 3px;
}

.video-info {
  padding: 14px 16px 16px;
}

.video-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-artist {
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* ─── Empty state ─── */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 0;
  color: var(--text-muted);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state p {
  font-size: 0.9rem;
}

/* ─── Project Grid ─── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  padding-bottom: 80px;
}

.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.project-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.project-icon {
  width: 46px;
  height: 46px;
  background: rgba(129, 140, 248, 0.12);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

[data-theme="light"] .project-icon {
  background: rgba(99, 102, 241, 0.1);
}

.project-icon svg {
  width: 22px;
  height: 22px;
}

.project-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 3px;
}

.project-version {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.project-description {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.65;
  margin-bottom: 18px;
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.tag {
  background: rgba(129, 140, 248, 0.1);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

[data-theme="light"] .tag {
  background: rgba(99, 102, 241, 0.08);
}

.download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.1s ease;
}

.download-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.download-btn svg {
  width: 17px;
  height: 17px;
}

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

@media (max-width: 640px) {
  .hero-cards {
    grid-template-columns: 1fr;
  }

  .video-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

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

  .page-hero {
    padding: 36px 0 28px;
    margin-bottom: 32px;
  }

  .header .container {
    gap: 12px;
  }

  .nav-link {
    padding: 7px 10px;
    font-size: 0.82rem;
  }
}
