:root {
  --cases-max-width: 1400px;
  --cases-radius: 20px;
  --cases-text: var(--text-main);
  --cases-muted: var(--text-muted);
  --cases-line: var(--border-main);
  --cases-shadow: var(--shadow-main);
}

.cases-page {
  background: var(--bg-main);
  color: var(--text-main);
}

.cases-wrap {
  max-width: var(--cases-max-width);
  margin: 0 auto;
  padding: 0 40px;
}

/* HERO */
.cases-hero {
  position: relative;
  min-height: 280px;
  padding: calc(var(--fixed-header-height, 130px) + 30px) 0 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
  background:
    linear-gradient(rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.35)),
    url('../images/hero_abstract_bg.png');
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.cases-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle 500px at var(--hero-mouse-x, 50%) var(--hero-mouse-y, 50%),
      rgba(255, 255, 255, 0.08) 0%,
      transparent 100%);
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.5s ease;
}

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

.cases-hero__inner {
  max-width: 1400px;
  width: 100%;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  position: relative;
  z-index: 1;
  box-sizing: border-box;
}

.cases-hero__icon {
  position: absolute;
  left: 160px;
  top: -20px;
  transform: translateY(-50%);
  width: 160px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
}

.cases-hero__icon img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.cases-hero__text {
  text-align: center;
}

.cases-hero__eyebrow {
  margin: 0 0 16px 0;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: #81d4fa;
  font-size: 1.1rem;
}

.cases-hero__title {
  margin: 0;
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  animation: casesNeonPulse 3s ease-in-out infinite alternate;
}

@keyframes casesNeonPulse {
  0% {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3), 0 0 20px rgba(56, 189, 248, 0.2);
  }

  100% {
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.6), 0 0 30px rgba(56, 189, 248, 0.5), 0 0 40px rgba(56, 189, 248, 0.3);
  }
}

.cases-section {
  padding: 34px 0 76px;
}

/* LAYOUT */
.cases-layout {
  display: grid;
  grid-template-columns: 210px 1fr;
  /* 좌측 필터 폭 줄임 */
  gap: 34px;
  align-items: start;
}

/* LEFT FILTER (Vertical Card Menu) */
.cases-side {
  position: sticky;
  top: calc(var(--fixed-header-height, 150px) + 16px);
  /* grid gap removed since we use a single card now, but keeping display flex/block works */
  display: block;
}

.side-menu-card {
  background: var(--bg-card);
  border-radius: 20px;
  box-shadow: var(--cases-shadow);
  overflow: hidden;
  border: 1px solid var(--cases-line);
}

.side-menu-header {
  background: linear-gradient(135deg, #0ea5e9 0%, #007bff 100%);
  padding: 22px 24px;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-align: center;
}

.side-menu-list {
  display: flex;
  flex-direction: column;
}

.side-menu-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--cases-line);
  padding: 18px 24px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.side-menu-item:last-child {
  border-bottom: none;
}

.side-menu-item:hover {
  background-color: rgba(255, 255, 255, 0.03);
  color: #38bdf8;
  font-weight: 700;
}

.side-menu-item.active {
  background-color: rgba(56, 189, 248, 0.05);
  color: #38bdf8;
  font-weight: 800;
  position: relative;
}

/* Active indicator strip on the left (optional, or just text color) */
.side-menu-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

/* RIGHT GRID */
.cases-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.case-card {
  border: 1px solid var(--cases-line);
  border-radius: var(--cases-radius);
  background: var(--bg-card);
  overflow: hidden;
  box-shadow: var(--cases-shadow);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.case-card:hover {
  transform: translateY(-8px);
  border-color: rgba(56, 189, 248, 0.3);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(56, 189, 248, 0.1);
}

.case-thumbnail {
  width: 100%;
  height: 170px;
  object-fit: cover;
  display: block;
  background: #f3f4f6;
}

.case-thumbnail--fallback {
  background:
    radial-gradient(520px 140px at 18% 20%, rgba(56, 189, 248, 0.15), transparent 65%),
    radial-gradient(420px 180px at 90% 10%, rgba(56, 189, 248, 0.10), transparent 70%),
    linear-gradient(135deg, #161b22 0%, #0a0c10 100%);
}

.case-content {
  padding: 16px 16px 18px;
}

.case-title {
  margin: 0 0 8px 0;
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--cases-text);
}

.case-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--cases-muted);
  font-weight: 700;
  margin-bottom: 10px;
}

.case-dot {
  opacity: 0.6;
}

.case-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  text-transform: uppercase;
  font-size: 0.75rem;
}

.case-description {
  color: var(--cases-muted);
  font-weight: 700;
  line-height: 1.65;
  display: -webkit-box;
  line-clamp: 3;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 3.2em;
}

.case-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 15px;
  padding: 12px 20px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #ffffff;
  background: var(--accent-blue);
  box-shadow: 0 4px 14px 0 var(--accent-blue-glow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  font-size: 0.9rem;
}

.case-link:hover {
  background-color: #0056b3;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 var(--accent-blue-glow);
  color: #ffffff;
}

/* Default: Hide toggle button on desktop */
.side-menu-toggle {
  display: none;
}

.cases-empty {
  margin-top: 18px;
  padding: 40px;
  border-radius: 20px;
  border: 1px dashed var(--cases-line);
  color: var(--text-muted);
  font-weight: 600;
  text-align: center;
  background: rgba(255, 255, 255, 0.01);
}

/* RESPONSIVE */
@media (max-width: 1000px) {
  .cases-hero {
    min-height: 330px !important;
    padding: calc(130px + 40px) 0 40px !important;
  }

  .cases-layout {
    grid-template-columns: 1fr;
  }

  .cases-side {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cases-grid {
    grid-template-columns: 1fr;
  }

  .cases-hero__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 0;
  }

  .cases-hero__title {
    font-size: 2.22rem;
  }

  .cases-hero__eyebrow {
    font-size: 0.98rem;
    line-height: 1.4;
    padding: 0 8px;
  }

  .cases-hero__text {
    padding: 0 6px;
  }

  .cases-hero__icon {
    display: none;
  }

  .cases-wrap {
    padding: 0;
  }

  .cases-section {
    padding-top: 0;
    padding-bottom: 0;
  }

  .case-card {
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
  }

  .side-menu-card {
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
  }

  .cases-empty {
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .side-menu-header {
    display: none;
  }

  /* Mobile Filter Menu (Collapsible) */
  .side-menu-toggle {
    display: flex;
    justify-content: flex-start;
    /* Align left */
    gap: 10px;
    /* Space between icon and text */
    align-items: center;
    width: 100%;
    padding: 16px 20px;
    background: var(--bg-card);
    border: none;
    border-bottom: 1px solid var(--border-main);
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.2s ease;
  }

  .side-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.03);
  }

  /* Remove rotation for hamburger icon, or change logic if needed. 
     For now, straightforward icon. */
  .side-menu-toggle i {
    font-size: 1.1rem;
    color: var(--accent-blue);
  }

  .side-menu-toggle.active {
    background: rgba(255, 255, 255, 0.05);
  }

  .side-menu-list {
    display: none;
    /* Hidden by default on mobile */
    flex-direction: column;
    width: 100%;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-main);
  }

  .side-menu-list.active {
    display: flex;
  }

  .side-menu-item {
    border-left: none;
    border-right: none;
    padding: 14px 20px;
    background: transparent;
  }

  /* Make items look like dropdown options */
  .side-menu-item.active {
    background: rgba(0, 123, 255, 0.1);
    color: var(--accent-blue);
    border-left: 4px solid var(--accent-blue);
    /* Re-add border logic for active state inside dropdown */
  }
}

@media (max-width: 680px) {
  .cases-hero {
    min-height: 330px !important;
    padding: 170px 0 40px !important;
  }
}

@media (max-width: 720px) {
  .cases-side {
    grid-template-columns: 1fr;
  }
}
