:root {
  --black: #0a0a0a;
  --white: #f5f5f0;
  --accent: #c8ff00;
  --accent2: #ff4d00;
  --gray: #141414;
  --gray2: #222;
  --muted: #a0a0a0;
  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'Noto Sans KR', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--black);
  color: var(--white);
  font-family: var(--font-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }

/* HERO SECTION */
.hero {
  padding: 100px 40px 60px;
  text-align: center;
  max-width: 1200px; margin: 0 auto;
}
.hero-tag {
  font-family: var(--font-display); color: var(--accent); font-size: 16px;
  letter-spacing: 0.15em; margin-bottom: 16px;
}
.hero h1 {
  font-size: 52px; font-weight: 900; letter-spacing: -0.03em; line-height: 1.2; margin-bottom: 24px;
}
.hero h1 span { color: var(--accent); }
.hero p {
  color: var(--muted); font-size: 18px; font-weight: 400; line-height: 1.6; max-width: 600px; margin: 0 auto;
}

/* FILTER WRAP */
.filter-container {
  max-width: 1200px; margin: 40px auto 48px; padding: 0 40px;
  display: flex; justify-content: center; flex-wrap: wrap; gap: 12px;
}
.filter-btn {
  background: var(--gray); color: var(--white); border: 1px solid rgba(255,255,255,0.08);
  padding: 12px 24px; border-radius: 50px; font-family: var(--font-body);
  font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.25s ease;
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active { background: var(--accent); color: var(--black); border-color: var(--accent); font-weight: 700; }

/* PORTFOLIO GRID */
.portfolio-section {
  max-width: 1200px; margin: 0 auto 120px; padding: 0 40px;
}
.portfolio-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px;
}

/* PORTFOLIO CARD */
.portfolio-card {
  background: var(--gray); border: 1px solid rgba(255,255,255,0.05);
  border-radius: 16px; overflow: hidden; cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s;
  display: flex; flex-direction: column;
}
.portfolio-card:hover {
  transform: translateY(-8px); border-color: rgba(200,255,0,0.3);
}
.card-img-wrap {
  width: 100%; height: 380px; overflow: hidden; background: #1a1a1a; position: relative;
}
.card-img {
  width: 100%; height: 100%; object-fit: cover; object-position: top center;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.portfolio-card:hover .card-img {
  transform: scale(1.05);
}
/* 세로 긴 이미지를 부드럽게 프리뷰해주는 오버레이 효과 */
.card-overlay {
  position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 60%, rgba(10,10,10,0.7));
  opacity: 1; transition: opacity 0.3s;
}
.card-info {
  padding: 24px; display: flex; flex-direction: column; gap: 10px; flex-grow: 1;
}
.card-tag {
  font-size: 11px; font-weight: 700; color: var(--accent); text-transform: uppercase;
  letter-spacing: 0.05em;
}
.card-title {
  font-size: 19px; font-weight: 700; letter-spacing: -0.01em; color: var(--white);
}
.card-desc {
  font-size: 13px; color: var(--muted); line-height: 1.5;
}

/* WIDE FULLVIEW MODAL */
.modal {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(5,5,5,0.95); backdrop-filter: blur(16px);
  display: none; align-items: center; justify-content: center;
  padding: 40px;
}
.modal.open { display: flex; }

.modal-container {
  width: 100%; max-width: 1100px; height: 100%;
  display: grid; grid-template-columns: 1fr 400px;
  background: var(--gray); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px; overflow: hidden; position: relative;
  animation: modalUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-close {
  position: absolute; top: 24px; right: 24px; z-index: 10;
  width: 40px; height: 40px; border-radius: 50%; background: var(--black);
  border: 1px solid rgba(255,255,255,0.1); color: var(--white);
  font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.modal-close:hover { background: var(--accent); color: var(--black); border-color: var(--accent); }

/* 모달 좌측: 긴 상세페이지 스크롤 영역 */
.modal-viewer {
  height: 100%; overflow-y: auto; background: #0d0d0d;
  padding: 20px; display: flex; flex-direction: column; align-items: center;
  border-right: 1px solid rgba(255,255,255,0.05);
  /* 스크롤바 커스텀 */
  scrollbar-width: thin; scrollbar-color: var(--gray2) transparent;
}
.modal-viewer::-webkit-scrollbar { width: 6px; }
.modal-viewer::-webkit-scrollbar-thumb { background: var(--gray2); border-radius: 10px; }
.modal-viewer img { width: 100%; max-width: 800px; height: auto; display: block; border-radius: 8px; }

/* 모달 우측: 상세 설명 가이드 영역 */
.modal-sidebar {
  padding: 48px 36px; display: flex; flex-direction: column; justify-content: space-between;
  height: 100%; overflow-y: auto;
}
.m-meta-top { display: flex; flex-direction: column; gap: 16px; }
.m-tag {
  align-self: flex-start; font-size: 12px; font-weight: 700; background: rgba(200,255,0,0.1);
  color: var(--accent); padding: 4px 12px; border-radius: 4px; border: 1px solid rgba(200,255,0,0.2);
}
.m-title { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.3; }
.m-desc { font-size: 14px; color: var(--muted); line-height: 1.6; margin-top: 8px; }

.m-features {
  list-style: none; margin-top: 28px; display: flex; flex-direction: column; gap: 14px;
}
.m-features li {
  display: flex; gap: 10px; font-size: 13px; color: var(--white); line-height: 1.4;
}
.m-features li::before { content: '✓'; color: var(--accent); font-weight: bold; }

.m-actions { margin-top: auto; }
.btn-modal-cta {
  width: 100%; padding: 16px; background: var(--accent2); color: var(--white);
  border: none; border-radius: 12px; font-family: var(--font-body); font-size: 15px;
  font-weight: 700; cursor: pointer; transition: opacity 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-modal-cta:hover { opacity: 0.9; }

/* FOOTER */
footer {
  background: var(--gray); padding: 60px 40px; text-align: center;
  border-top: 1px solid rgba(255,255,255,0.05); font-size: 13px; color: var(--muted);
}
footer span { color: var(--accent); font-family: var(--font-display); font-size: 16px; }

/* ── MAIN TABS ── */
.main-tab-wrap {
  display: flex;
  border-bottom: 1px solid #222;
  padding: 0 48px;
  background: #0a0a0a;
  position: sticky;
  top: 59px;
  z-index: 100;
}
.main-tab {
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #666;
  padding: 18px 32px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  margin-bottom: -1px;
}
.main-tab:hover { color: #f5f5f0; }
.main-tab.active { color: #c8ff00; border-bottom-color: #c8ff00; }

/* ── WEBSITE PORTFOLIO ── */
.web-portfolio-section { padding: 60px 48px 100px; }
.web-s-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  border-bottom: 1px solid #222;
  padding-bottom: 24px;
  margin-bottom: 48px;
}
.web-s-label {
  font-size: 11px; font-weight: 700; letter-spacing: 4px;
  text-transform: uppercase; color: #c8ff00; margin-bottom: 8px;
}
.web-s-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(48px, 7vw, 88px); line-height: 1; color: #f5f5f0;
}
.web-s-count {
  font-family: 'Bebas Neue', sans-serif; font-size: 88px;
  color: transparent; -webkit-text-stroke: 1px #222; line-height: 1; user-select: none;
}
.web-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: #222; border: 1px solid #222;
}
.web-card {
  background: #0a0a0a; position: relative; overflow: hidden;
  transition: background 0.3s; text-decoration: none; color: inherit;
  display: flex; flex-direction: column;
}
.web-card:hover { background: #141414; }
.web-card-thumb {
  width: 100%; aspect-ratio: 16/10; overflow: hidden;
  position: relative; background: #141414;
}
.web-card-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s ease; display: block;
}
.web-card:hover .web-card-thumb img { transform: scale(1.04); }
.web-card-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0);
  transition: background 0.3s;
  display: flex; align-items: center; justify-content: center;
}
.web-card:hover .web-card-overlay { background: rgba(0,0,0,0.45); }
.web-card-link-icon {
  font-size: 32px; color: #c8ff00;
  opacity: 0; transform: scale(0.8);
  transition: opacity 0.3s, transform 0.3s;
}
.web-card:hover .web-card-link-icon { opacity: 1; transform: scale(1); }
.web-card-info {
  padding: 28px 28px 32px; flex: 1;
  display: flex; flex-direction: column; gap: 10px;
  border-top: 1px solid #222;
}
.web-card-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.web-card-tag {
  font-size: 10px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; padding: 5px 12px; border-radius: 2px;
  background: #222; color: #a0a0a0;
}
.web-card-tag.live { background: rgba(200,255,0,0.1); color: #c8ff00; border: 1px solid rgba(200,255,0,0.25); }
.web-card-tag.dev  { background: rgba(255,77,0,0.1);  color: #ff4d00; border: 1px solid rgba(255,77,0,0.25); }
.web-card-title { font-size: 20px; font-weight: 700; color: #f5f5f0; line-height: 1.3; }
.web-card-desc { font-size: 14px; color: #a0a0a0; line-height: 1.7; font-weight: 300; flex: 1; }
.web-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 16px; padding-top: 16px; border-top: 1px solid #222;
}
.web-card-type { font-size: 12px; color: #666; letter-spacing: 1px; }
.web-card-arrow { font-size: 20px; color: #c8ff00; }
.web-card.coming-soon { opacity: 0.4; pointer-events: none; }

/* 작업자 표시 */
.card-designer {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  font-size: 11px;
  color: #888;
}
.card-designer::before {
  content: '✏️';
  font-size: 10px;
}
.card-designer span {
  color: #f5a623;
  font-weight: 600;
}

/* 모달 작업자 */
.m-designer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding: 7px 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  font-size: 12px;
  color: #888;
}
.m-designer span {
  color: #f5a623;
  font-weight: 600;
}

@media (max-width: 768px) {
  .main-tab-wrap { padding: 0 20px; top: 60px; }
  .main-tab { padding: 14px 16px; font-size: 13px; }
  .web-portfolio-section { padding: 40px 20px 60px; }
  .web-grid { grid-template-columns: 1fr; }
  .web-s-count { display: none; }
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .portfolio-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .modal-container { grid-template-columns: 1fr; grid-template-rows: 1fr 320px; }
  .modal-sidebar { padding: 24px; }
  .modal-viewer { height: 100%; }
}
@media (max-width: 768px) {
  .hero h1 { font-size: 36px; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .modal { padding: 10px; }
  .modal-container { border-radius: 16px; }
}