@import url('fonts.css');

:root {
  --lg-bg-color: transparent;
  --lg-highlight: rgba(255, 255, 255, 0.2);
  --lg-text: #ffffff;
  --lg-hover-glow: rgba(255, 255, 255, 0.1);
}

/* ========== RESET & BASE ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Paperlogy', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: #0a0a0a;
  color: #ffffff;
  overflow-x: hidden;
}

/* ========== BACKGROUND VIDEO ========== */
.bg-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
  opacity: 0.8;
}

/* ========== SIDEBAR ========== */
.sidebar {
  position: fixed;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100vh;
  background: rgba(20, 20, 30, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1000;
  transition: left 0.3s ease;
  overflow-y: auto;
  padding: 2rem 0;
}

.sidebar.active {
  left: 0;
}

.sidebar-logo {
  padding: 0 2rem 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 1rem;
}

.sidebar-logo img {
  width: 100%;
  height: auto;
}

.sidebar-menu-item {
  margin-bottom: 0.5rem;
}

.sidebar-menu-title {
  padding: 1rem 2rem;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
}

.sidebar-menu-link {
  display: block;
  padding: 1rem 2rem;
  color: #ffffff;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.3s ease;
}

.sidebar-menu-link:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-submenu {
  padding-left: 1rem;
}

.sidebar-submenu-link {
  display: block;
  padding: 0.75rem 2rem;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.sidebar-submenu-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

/* ========== MENU TOGGLE ========== */
.menu-toggle {
  position: fixed;
  top: 2rem;
  left: 2rem;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.3s ease;
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* ========== MAIN WRAPPER ========== */
.main-wrapper {
  min-height: 100vh;
  padding: 2rem;
  position: relative;
}

/* ========== FRAME ========== */
.frame {
  max-width: 1400px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

/* ========== SERVICES SECTION ========== */
.services-section {
  text-align: center;
  margin-bottom: 4rem;
}

.services-title {
  font-family: 'Paperlogy';
  font-weight: 700;
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: 1rem;
  color: #ffffff;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.services-desc {
  font-family: 'Paperlogy';
  font-weight: 400;
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 3rem;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  grid-column-gap: 20px;
  grid-row-gap: 20px;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem;
  min-height: 500px;
}

.div1 { grid-area: 1 / 1 / 2 / 2; }
.div2 { grid-area: 1 / 2 / 2 / 3; }
.div3 { grid-area: 1 / 3 / 2 / 4; }
.div4 { grid-area: 2 / 1 / 3 / 2; }
.div5 { grid-area: 2 / 2 / 3 / 3; }
.div6 { grid-area: 2 / 3 / 3 / 4; }

/* ========== LIQUID GLASS CONTAINER ========== */
.glass-container {
  position: relative;
  display: flex;
  font-weight: 600;
  color: var(--lg-text);
  cursor: pointer;
  background: transparent;
  border-radius: 24px;
  overflow: hidden;
  text-decoration: none;
  
  /* Enhanced shadow for depth */
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.3),
    0 4px 10px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  
  /* Liquid Glass Effect - SVG Displacement + Backdrop Filters */
  backdrop-filter: brightness(1.1) blur(2px) saturate(180%) url(#displacementFilter);
  -webkit-backdrop-filter: brightness(1.1) blur(2px) saturate(180%) url(#displacementFilter);
  
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 2.2);
  animation: float 4s ease-in-out infinite;
  
  /* Hardware acceleration */
  will-change: transform, box-shadow;
  transform: translateZ(0) scale(1);
}

/* Floating animation */
@keyframes float {
  0%, 100% {
    transform: translateY(0px) rotate(0deg) scale(1);
  }
  25% {
    transform: translateY(-6px) rotate(0.5deg) scale(1);
  }
  50% {
    transform: translateY(-3px) rotate(-0.5deg) scale(1);
  }
  75% {
    transform: translateY(-8px) rotate(0.3deg) scale(1);
  }
}

/* Different animation for each card */
.div1 {
  animation-delay: 0s;
  animation-duration: 4.2s;
}

.div2 {
  animation-delay: 0.5s;
  animation-duration: 3.8s;
}

.div3 {
  animation-delay: 1s;
  animation-duration: 4.5s;
}

.div4 {
  animation-delay: 1.5s;
  animation-duration: 3.6s;
}

.div5 {
  animation-delay: 2s;
  animation-duration: 4.1s;
}

.div6 {
  animation-delay: 2.5s;
  animation-duration: 3.9s;
}

/* Hover state - enhanced liquid glass effect */
.glass-container:hover {
  transform: translateY(-12px) scale(1.03) translateZ(0);
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.4),
    0 8px 20px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  animation-play-state: paused;
  
  /* Enhanced glass effect on hover */
  backdrop-filter: brightness(1.15) blur(3px) saturate(190%) url(#displacementFilter);
  -webkit-backdrop-filter: brightness(1.15) blur(3px) saturate(190%) url(#displacementFilter);
}

/* ========== LIQUID GLASS SPECULAR HIGHLIGHT ========== */

/* Specular Highlight (inset shadows) */
.glass-container::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 24px;
  overflow: hidden;
  
  /* Glass-like specular highlight */
  -webkit-box-shadow: inset 6px 6px 0px -6px rgba(255, 255, 255, 0.7), 
                      inset 0 0 8px 1px rgba(255, 255, 255, 0.7);
  box-shadow: inset 6px 6px 0px -6px rgba(255, 255, 255, 0.7), 
              inset 0 0 8px 1px rgba(255, 255, 255, 0.7);
  
  pointer-events: none;
}

/* Content Layer */
.glass-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1rem 1.25rem;
  width: 100%;
}

/* ========== ICON & CONTENT ========== */
.glass-content .icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #ffffff;
  flex-shrink: 0;
  
  /* 최소한의 배경 - 굴절 효과가 주인공 */
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 2.2);
}

.glass-container:hover .icon {
  transform: scale(1.12) rotate(-3deg);
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 
    0 6px 16px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.glass-content .icon svg {
  width: 22px;
  height: 22px;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.5));
  transition: filter 0.3s ease;
}

.glass-container:hover .icon svg {
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.6));
}

.glass-content .content {
  flex: 1;
  text-align: left;
}

.glass-content .content h3 {
  font-family: 'Paperlogy';
  font-weight: 700;
  font-size: 16px;
  color: #FFFFFF;
  margin-bottom: 4px;
  letter-spacing: -0.03em;
  
  text-shadow: 
    0 3px 12px rgba(0, 0, 0, 0.9),
    0 1px 4px rgba(0, 0, 0, 0.8),
    0 0 20px rgba(0, 0, 0, 0.6);
  
  transition: all 0.3s ease;
}

.glass-container:hover .content h3 {
  text-shadow: 
    0 4px 16px rgba(0, 0, 0, 1),
    0 2px 6px rgba(0, 0, 0, 0.9),
    0 0 24px rgba(0, 0, 0, 0.7);
}

.glass-content .content p {
  font-family: 'Paperlogy';
  font-weight: 400;
  font-size: 12px;
  color: #FFFFFF;
  opacity: 0.95;
  
  text-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.9),
    0 1px 3px rgba(0, 0, 0, 0.7),
    0 0 12px rgba(0, 0, 0, 0.5);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 992px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 18px;
    min-height: 450px;
  }
  
  .div1 { grid-area: 1 / 1 / 2 / 2; }
  .div2 { grid-area: 1 / 2 / 2 / 3; }
  .div3 { grid-area: 2 / 1 / 3 / 2; }
  .div4 { grid-area: 2 / 2 / 3 / 3; }
  .div5 { grid-area: 3 / 1 / 4 / 2; }
  .div6 { grid-area: 3 / 2 / 4 / 3; }
}

@media (max-width: 768px) {
  .services-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: auto;
  }
  
  .div1, .div2, .div3, .div4, .div5, .div6 {
    grid-area: auto;
  }
  
  .glass-container:hover {
    transform: translateY(-8px) scale(1.02) translateZ(0);
  }
  
  .glass-content .icon {
    width: 36px;
    height: 36px;
  }
  
  .glass-content .icon svg {
    width: 20px;
    height: 20px;
  }
  
  .glass-content .content h3 {
    font-size: 15px;
  }
  
  .glass-content .content p {
    font-size: 11px;
  }
  
  .frame {
    padding: 2rem 1rem;
  }
}

@media (max-width: 576px) {
  .main-wrapper {
    padding: 1rem;
  }
  
  .services-title {
    font-size: 2rem;
  }
  
  .services-desc {
    font-size: 0.9rem;
  }
  
  .glass-content {
    padding: 0.875rem 1rem;
    gap: 10px;
  }
}
