/* 기본 변수 설정 */
:root {
  --bg-main: #0b0f19;
  --bg-darker: #060911;
  --bg-card: #131b2e;
  --bg-card-hover: #1a2540;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-blue: #38bdf8;
  --accent-violet: #818cf8;
  --accent-red: #ef4444;
  --border-color: rgba(56, 189, 248, 0.18);
  --max-width: 1120px;
}

/* 초기화 및 기본 설정 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.65;
  overflow-x: hidden;
  word-break: keep-all;
}

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

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

/* 상단 플로팅 메뉴바 */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 18px 0;
  transition: all 0.3s ease;
  background: rgba(11, 15, 25, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.navbar.scrolled {
  padding: 12px 0;
  background: rgba(6, 9, 17, 0.9);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

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

.logo {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  color: var(--accent-blue);
  filter: drop-shadow(0 0 8px var(--accent-blue));
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

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

.nav-btn {
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-violet));
  color: #060911;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.5);
}

/* 모바일 햄버거 버튼 */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.mobile-menu-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--text-main);
  transition: 0.3s;
}

/* 히어로 배너 */
.hero-section {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 0 80px;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.18) 0%, rgba(129, 140, 248, 0.08) 45%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent-blue);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 24px;
}

.text-gradient {
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 40px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  transition: all 0.25s ease;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-violet));
  color: #060911;
  box-shadow: 0 4px 20px rgba(56, 189, 248, 0.35);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(56, 189, 248, 0.55);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-blue);
}

/* 공통 섹션 스타일 */
.section {
  padding: 100px 0;
}

.bg-darker {
  background-color: var(--bg-darker);
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-tag {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent-blue);
  margin-bottom: 10px;
}

.section-title {
  font-size: clamp(1.75rem, 3.5vw, 2.4rem);
  font-weight: 800;
  margin-bottom: 14px;
}

.section-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* 원리 소개 3단 카드 */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 36px 28px;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-blue);
  box-shadow: 0 12px 30px rgba(56, 189, 248, 0.12);
}

.card-num {
  font-family: monospace;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-blue);
  margin-bottom: 16px;
}

.card-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 12px;
}

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

/* 스펙 그리드 */
.specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.spec-item {
  background: var(--bg-card);
  border-left: 4px solid var(--accent-blue);
  border-radius: 12px;
  padding: 24px 28px;
}

.spec-label {
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--accent-violet);
  letter-spacing: 1px;
}

.spec-name {
  font-size: 1.2rem;
  margin: 6px 0 10px;
}

.spec-detail {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* 부품 및 PCB 제작 갤러리 */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.gallery-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.gallery-item:hover {
  transform: translateY(-5px);
  border-color: var(--accent-blue);
}

.gallery-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #090d16;
}

.gallery-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery-item:hover .gallery-img-wrap img {
  transform: scale(1.05);
}

.gallery-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(6, 9, 17, 0.85);
  color: var(--accent-blue);
  border: 1px solid var(--border-color);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.gallery-info {
  padding: 22px 24px;
}

.gallery-info h4 {
  font-size: 1.15rem;
  margin-bottom: 6px;
}

.gallery-info p {
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* 유튜브 영상 섹션 */
.video-container {
  max-width: 900px;
  margin: 0 auto;
}

.video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 비율 유지 */
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  background: #000;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.video-cta {
  text-align: center;
  margin-top: 28px;
}

.video-notice {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.btn-youtube {
  background: var(--accent-red);
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.35);
}

.btn-youtube:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.55);
}

/* FAQ 및 주의사항 */
.faq-list {
  max-width: 840px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 26px 30px;
}

.faq-item h4 {
  font-size: 1.1rem;
  color: var(--accent-blue);
  margin-bottom: 10px;
}

.faq-item p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* 라이트박스 모달 */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 12, 0.92);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-img {
  max-width: 90%;
  max-height: 75vh;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.lightbox-caption {
  color: var(--text-main);
  font-size: 1.05rem;
  text-align: center;
  max-width: 680px;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 32px;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 2.5rem;
  cursor: pointer;
}

/* 푸터 */
.footer {
  background: #04060b;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding: 50px 0 30px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 30px;
}

.footer-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 6px;
}

.footer-links {
  display: flex;
  gap: 24px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--accent-blue);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 20px;
  text-align: center;
  color: #64748b;
  font-size: 0.85rem;
}

/* 스크롤 등장 애니메이션 */
.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* 모바일 반응형 미디어 쿼리 */
@media (max-width: 820px) {
  .grid-3,
  .specs-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(6, 9, 17, 0.98);
    border-bottom: 1px solid var(--border-color);
    flex-direction: column;
    padding: 24px;
    gap: 18px;
    display: none;
  }

  .nav-menu.open {
    display: flex;
  }

  .section {
    padding: 72px 0;
  }
}
