@charset "utf-8";

/* ==========================================================================
   🧭 Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  height: 72px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
}

.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  height: 100%;
}

/* === Logo === */
.logo { flex-shrink: 0; }
.logo a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.logo-img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  transition: transform var(--t-base);
}
.logo a:hover .logo-img {
  transform: rotate(-8deg);
}
.logo-text {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
/* Dev 모드: 보라 그대로 (또는 살짝 푸른 톤) */
body[data-mode="dev"] .logo-img {
  filter: hue-rotate(0deg);
}

/* Design 모드: 보라 → 핑크 변환 */
body[data-mode="design"] .logo-img {
  filter: hue-rotate(70deg) saturate(1.3);
}
/* === Mode Toggle (동적 인디케이터) === */
.mode-toggle {
  position: absolute;
  left:50%;
  transform:translateX(-50%);
  display: inline-flex;
  align-items: center;
  padding: 4px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-full);
  transition: background var(--t-base), border-color var(--t-base);
}

.mode-btn {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  border-radius: var(--r-full);
  transition: color var(--t-fast);
  white-space: nowrap;
}

.mode-btn .material-symbols-outlined {
  font-size: 16px;
  transition: transform var(--t-fast);
}

.mode-btn.active {
  color: white;
}

.mode-btn:hover:not(.active) {
  color: var(--text-primary);
}

.mode-btn:hover:not(.active) .material-symbols-outlined {
  transform: scale(1.1);
}

/* === 동적 인디케이터 (JS가 위치/너비 계산) === */
.mode-indicator {
  position: absolute;
  top: 4px;
  left: 0;
  height: calc(100% - 8px);
  background: var(--brand-primary);
  border-radius: var(--r-full);
  z-index: 1;
  /* JS가 transform / width 동적으로 설정 */
  transition:
    transform 0.45s cubic-bezier(0.65, 0, 0.35, 1),
    width 0.45s cubic-bezier(0.65, 0, 0.35, 1),
    background 0.4s var(--ease-out),
    box-shadow 0.4s var(--ease-out);
  /* 모드별 글로우 */
  box-shadow: 0 4px 14px var(--brand-soft);
}

/* Dev 모드 — 블루 글로우 */
body[data-mode="dev"] .mode-indicator {
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
}

/* Design 모드 — 핑크 글로우 */
body[data-mode="design"] .mode-indicator {
  box-shadow: 0 4px 16px rgba(236, 72, 153, 0.35);
}

/* 토글 박스 자체에도 모드별 살짝 색감 추가 */
body[data-mode="dev"] .mode-toggle {
  background: rgba(37, 99, 235, 0.06);
  border-color: rgba(37, 99, 235, 0.15);
}

body[data-mode="design"] .mode-toggle {
  background: rgba(236, 72, 153, 0.06);
  border-color: rgba(236, 72, 153, 0.15);
}

/* === Nav Links (데스크탑) === */
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--t-fast);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}

.nav-links .nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  background: var(--text-primary);
  color: white;
  border-radius: var(--r-full);
  transition: all var(--t-fast);
}

.nav-links .nav-cta:hover {
  background: var(--brand-primary);
  color: white;
  transform: translateY(-1px);
}

/* === Menu Btn (모바일만) === */
.menu-click { display: none; }

.menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  border-radius: 50%;
  background: var(--bg-tertiary);
  transition: all var(--t-fast);
  flex-shrink: 0;
}

.menu-btn .line {
  width: 16px;
  height: 1.5px;
  background: var(--text-primary);
  transition: all var(--t-fast);
}

.menu-btn:hover {
  background: var(--border-subtle);
}

/* ==========================================================================
   📋 Mobile Menu Modal
   ========================================================================== */
.menu-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  isolation: isolate;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base);
  display: none;
}

@media (max-width: 768px) {
  .menu-modal { display: block; }
}

.menu-modal.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.menu-modal-inner {
  height: 100vh;
  padding: 100px clamp(20px, 5vw, 64px) 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.modal-nav {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.modal-nav li a {
  font-size: clamp(36px, 8vw, 64px);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  display: block;
  padding: 4px 0;
}

.modal-nav li a:hover {
  color: var(--brand-primary);
}

.modal-social {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.modal-social li a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-3) 0;
  border-top: 1px solid var(--border-subtle);
  font-size: 15px;
  color: var(--text-secondary);
}

.modal-social li:last-child a {
  border-bottom: 1px solid var(--border-subtle);
}

.modal-social li a:hover {
  color: var(--brand-primary);
}

.modal-social .ext {
  font-size: 12px;
  opacity: 0.5;
}

/* ==========================================================================
   🦸 Hero (간결!)
   ========================================================================== */
.hero {
  padding: clamp(60px, 10vh, 120px) 0 clamp(60px, 8vh, 100px);
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-tertiary);
  margin-bottom: var(--sp-4);
}

.hero-title {
  font-size: clamp(40px, 6vw, 80px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--text-primary);
  margin-bottom: var(--sp-4);
  max-width: 900px;
}

.hero-title .line {
  display: block;
  opacity: 0;
  transform: translateY(20px);
  animation: heroLineUp 0.8s var(--ease-out) forwards;
}

.hero-title .line-1 { animation-delay: 0.1s; }
.hero-title .line-2 { animation-delay: 0.25s; }

.hero-title em {
  font-style: normal;
  color: var(--brand-primary);
  transition: color var(--t-base);
}

@keyframes heroLineUp {
  to { opacity: 1; transform: translateY(0); }
}

.hero-desc {
  font-size: clamp(15px, 1.4vw, 18px);
  color: var(--text-secondary);
  max-width: 540px;
  line-height: 1.7;
  opacity: 0;
  animation: heroLineUp 0.8s var(--ease-out) 0.4s forwards;
}

/* ==========================================================================
   🎴 Works
   ========================================================================== */
.works {
  padding: var(--sp-7) 0 var(--sp-8);
}

.works-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  flex-wrap: wrap;
  gap: var(--sp-3);
  padding-bottom: var(--sp-5);
  margin-bottom: var(--sp-5);
  border-bottom: 1px solid var(--border-subtle);
}

.section-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: var(--sp-2);
}

.section-title {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--text-primary);
}

.works-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-tertiary);
  letter-spacing: 0.05em;
}

.works-count .visible-count {
  color: var(--text-primary);
  font-weight: 500;
}

/* ==========================================================================
   🔍 Filters (대분류 + 기술 태그)
   ========================================================================== */
.filters-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}

/* === 대분류 필터 === */
.filter-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-nav button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg-tertiary);
  border: 1px solid transparent;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  border-radius: var(--r-full);
  transition: all var(--t-fast);
}

.filter-nav button:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
  border-color: var(--border-default);
}

.filter-nav .active button {
  background: var(--text-primary);
  color: white;
  border-color: var(--text-primary);
}

.filter-nav .count {
  font-size: 10px;
  opacity: 0.7;
}

/* === 기술 태그 필터 === */
.tech-filter {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  padding-top: var(--sp-3);
  border-top: 1px dashed var(--border-subtle);
}

.tech-filter[hidden] { display: none; }

.tech-filter-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-tertiary);
  padding: 6px 0;
  flex-shrink: 0;
}

.tech-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  flex: 1;
}

.tech-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 11px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-full);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--t-fast);
  letter-spacing: 0.02em;
}

.tech-chip-btn:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: var(--brand-soft);
}

.tech-chip-btn.active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: white;
}

.tech-chip-btn .chip-count {
  font-size: 9.5px;
  opacity: 0.6;
}

.tech-chip-btn.active .chip-count {
  opacity: 0.85;
}

/* 모바일 */
@media (max-width: 640px) {
  .tech-filter {
    flex-direction: column;
    gap: 6px;
  }
  .filter-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    margin-left: -20px;
    margin-right: -20px;
    padding-left: 20px;
    padding-right: 20px;
  }
  .filter-nav button { white-space: nowrap; }
}

/* === Grid === */
.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: clamp(24px, 3vw, 40px);
}

/* === Card === */
.card {
  position: relative;
}

.card.hidden {
  display: none;
}

.card a {
  display: block;
  height: 100%;
}

.card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-tertiary);
  border-radius: var(--r-md);
  margin-bottom: var(--sp-3);
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform var(--t-slow);
}

.card:hover .card-media img {
  transform: scale(1.04);
}

.card-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 11px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--r-full);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-primary);
}

.card-body {
  position: relative;
  padding: 0 4px;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
}

.card-tech {
  text-align: right;
  color: var(--brand-primary);
  transition: color var(--t-base);
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: var(--sp-2);
}

.card-arrow {
  display: inline-block;
  font-size: 16px;
  color: var(--text-tertiary);
  transition: all var(--t-base);
}

.card:hover .card-arrow {
  color: var(--brand-primary);
  transform: translateX(4px);
}

.card:hover .card-title {
  color: var(--brand-primary);
}

/* === Empty State === */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-8) var(--sp-4);
  text-align: center;
  background: var(--bg-secondary);
  border: 1px dashed var(--border-default);
  border-radius: var(--r-lg);
  margin-top: var(--sp-4);
}

.empty-state[hidden] { display: none; }

.empty-state .material-symbols-outlined {
  font-size: 40px;
  color: var(--text-muted);
  margin-bottom: var(--sp-3);
}

.empty-state h4 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* === Loader === */
.loader {
  display: none;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-5) 0;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.loader.active { display: flex; }

.loader-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border-default);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.end-message {
  display: none;
  text-align: center;
  padding: var(--sp-5) 0;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.end-message.active { display: block; }

.sentinel {
  height: 1px;
  width: 100%;
}

/* ==========================================================================
   🦶 Footer
   ========================================================================== */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: var(--sp-7) 0 var(--sp-3);
  margin-top: var(--sp-8);
}

.footer-headline {
  display: flex;
  justify-content: space-between;
  align-items: end;
  flex-wrap: wrap;
  gap: var(--sp-4);
  padding-bottom: var(--sp-6);
  margin-bottom: var(--sp-6);
  border-bottom: 1px solid var(--border-subtle);
}

.footer-headline h3 {
  font-size: clamp(28px, 4vw, 56px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

.footer-headline span { display: block; }

.footer-headline em {
  font-style: normal;
  color: var(--brand-primary);
  transition: color var(--t-base);
}

.footer-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 14px 24px;
  background: var(--text-primary);
  color: white;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--t-fast);
  flex-shrink: 0;
}

.footer-cta:hover {
  background: var(--brand-primary);
  transform: translateY(-2px);
}

.footer-cta .material-symbols-outlined {
  font-size: 16px;
  transition: transform var(--t-fast);
}

.footer-cta:hover .material-symbols-outlined {
  transform: translate(2px, -2px);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: var(--sp-5);
  margin-bottom: var(--sp-5);
}

.footer-col .footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--sp-2);
}

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

/* Design 모드: 보라 → 핑크 변환 */
body[data-mode="design"] .footer-brand img {
  filter: hue-rotate(70deg) saturate(1.3);
}

.footer-brand strong {
  font-size: 20px;
  font-weight: 700;
}

.footer-col p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.footer-col h5 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-tertiary);
  margin-bottom: var(--sp-3);
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col li a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-secondary);
}

.footer-col li a:hover {
  color: var(--brand-primary);
}

.footer-col .ext {
  font-size: 11px;
  opacity: 0.5;
  transition: transform var(--t-fast);
}

.footer-col li a:hover .ext {
  transform: translate(2px, -2px);
  opacity: 1;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
  letter-spacing: 0.05em;
}

/* ==========================================================================
   ⬆️ Back to Top
   ========================================================================== */
#back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 30;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 50%;
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: all var(--t-base);
}

#back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

#back-to-top:hover {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: white;
  transform: translateY(-2px);
}

#back-to-top .material-symbols-outlined {
  font-size: 18px;
}

/* === 카드 정렬 (data-order 속성 기반) === */
.card[data-order] {
  order: attr(data-order number, 999);
}
/* ==========================================================================
   📱 Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .menu-btn { display: flex; }
}

@media (max-width: 768px) {
  .site-header { height: 64px; }

  .mode-toggle { padding: 3px; }
  .mode-btn { padding: 6px 12px; font-size: 10px; }
  .mode-btn .material-symbols-outlined { font-size: 13px; }

  .works-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-4);
  }

  .filter-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    margin-left: -20px;
    margin-right: -20px;
    padding-left: 20px;
    padding-right: 20px;
  }
  .filter-nav button { white-space: nowrap; }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-col:first-child { grid-column: 1 / -1; }

  .footer-headline {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  #back-to-top {
    bottom: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}
