/* ===== 기본 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #ffffff;
  --bg-elevated: #f7f7f7;
  --text: #111111;
  --text-soft: #444444;
  --gray: #888888;
  --border: #e8e8e8;
  --thumb-bg: #f0f0f0;
  --chip-neutral: rgba(0,0,0,0.05);
  --font: 'Pretendard', 'Apple SD Gothic Neo', sans-serif;
}

body.dark {
  --bg: #0d0d0d;
  --bg-elevated: #1a1a1a;
  --text: #f0f0f0;
  --text-soft: #cfcfcf;
  --gray: #8a8a8a;
  --border: #2a2a2a;
  --thumb-bg: #1a1a1a;
  --chip-neutral: rgba(255,255,255,0.08);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s, color 0.3s;
}

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

[hidden] { display: none !important; }

/* ===== 네비게이션 ===== */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 60px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}

nav.scrolled { border-bottom-color: var(--border); }

.nav-logo {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

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

.nav-links {
  display: flex;
  gap: 36px;
  list-style: none;
}

.nav-links a {
  font-size: 14px;
  color: var(--gray);
  transition: color 0.2s;
}

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

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: transparent;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  transition: border-color 0.2s, background 0.2s;
}

.theme-toggle:hover { background: var(--bg-elevated); }

/* ===== Works 섹션 (홈) ===== */
.section { padding: 100px 60px; }

.section-works { padding-top: 32px; }

.section-works-first { padding-top: 32px; padding-bottom: 32px; }

/* 인트로 섹션: 네비게이션 높이(~64px) 아래에서 시작 */
.section-intro {
  padding-top: 120px;
  padding-bottom: 48px;
}

.intro-text {
  max-width: 62%;
  word-break: keep-all;
}

.intro-para {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-soft);
  margin: 0;
}

.intro-para + .intro-para { margin-top: 1.1em; }

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 40px;
}

.works-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.works-count {
  font-weight: 400;
  opacity: 0.45;
  text-transform: none;
  letter-spacing: 0;
}

.works-more {
  font-size: 13px;
  color: var(--gray);
  transition: color 0.2s;
}

.works-more:hover { color: var(--text); }

/* ===== 홈 프로젝트 그리드 ===== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px 20px;
}

.project-card { cursor: pointer; display: block; }

.project-thumb,
.big-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  margin-bottom: 16px;
  overflow: hidden;
  background: var(--thumb-bg);
  transition: opacity 0.25s;
}

.project-thumb img,
.big-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-card:hover .project-thumb,
.big-card:hover .big-thumb { opacity: 0.82; }

.project-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  line-height: 1.45;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.tag {
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  padding: 3px 9px;
  white-space: nowrap;
}

.tag-pcweb   { background: rgba(59,130,246,0.14);  color: #2563eb; }
.tag-mweb    { background: rgba(236,72,153,0.14);  color: #db2777; }
.tag-mapp    { background: rgba(139,92,246,0.14);  color: #7c3aed; }
.tag-aivideo  { background: rgba(16,185,129,0.14);  color: #059669; }
.tag-branding { background: rgba(245,158,11,0.14);  color: #d97706; }
.tag-work    { background: var(--chip-neutral); color: var(--text-soft); }
.tag-side    { background: var(--chip-neutral); color: var(--text-soft); }

body.dark .tag-pcweb    { color: #93c5fd; }
body.dark .tag-mweb     { color: #f9a8d4; }
body.dark .tag-mapp     { color: #c4b5fd; }
body.dark .tag-aivideo  { color: #6ee7b7; }
body.dark .tag-branding { color: #fcd34d; }

.project-period {
  font-size: 13px;
  color: var(--gray);
  line-height: 1.6;
}

/* ===== 카테고리 페이지 (큰 2열) ===== */
#view-category { padding: 140px 80px 100px; }

.category-head { margin-bottom: 64px; }

.category-title {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.category-count {
  font-size: 14px;
  color: var(--gray);
  margin-top: 10px;
}

.big-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 80px 56px;
}

.big-card { cursor: pointer; display: block; }

.big-name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  line-height: 1.45;
}

/* 이미지 없을 때 플레이스홀더 */
.project-thumb.no-image,
.big-thumb.no-image {
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-thumb.no-image::after,
.big-thumb.no-image::after {
  content: 'No image';
  font-size: 12px;
  color: var(--gray);
  letter-spacing: 0.05em;
}

/* ===== AI Video 카테고리 ===== */
.av-sections { display: flex; flex-direction: column; gap: 64px; }

.av-subheading {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.av-grid-169 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 60px 48px;
}

.av-grid-916 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
}

/* 홈 9:16 그리드: 6열 고정 (카테고리 상세는 av-grid-916 유지) */
.av-grid-916-home {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
}

.av-card { cursor: pointer; }
.av-card.pending { cursor: default; }

.av-thumb-169 {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: var(--thumb-bg);
  margin-bottom: 16px;
  transition: opacity 0.25s;
  position: relative;
}

.av-thumb-916 {
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 6px;
  overflow: hidden;
  background: var(--thumb-bg);
  margin-bottom: 12px;
  transition: opacity 0.25s;
  position: relative;
}

.av-thumb-169 img,
.av-thumb-916 img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.av-card:not(.pending):hover .av-thumb-169,
.av-card:not(.pending):hover .av-thumb-916 { opacity: 0.82; }

.badge-pending {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-soft);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 3px 10px;
  white-space: nowrap;
}

.av-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
  line-height: 1.4;
}

/* ===== Article 카테고리 (4열, project-card 재사용) ===== */
.article-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px 20px;
}

/* ===== Branding 카테고리 ===== */
.branding-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px 32px;
}

.branding-card { cursor: pointer; }

.branding-thumb {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 4px;
  overflow: hidden;
  background: var(--thumb-bg);
  margin-bottom: 14px;
  transition: opacity 0.25s;
}

.branding-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.branding-card:hover .branding-thumb { opacity: 0.82; }

.branding-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
  line-height: 1.4;
}

/* ===== 라이트박스 ===== */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  cursor: pointer;
}

.lb-img-wrap {
  position: relative;
  z-index: 1;
  max-width: min(90vw, 1400px);
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.lb-img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  display: block;
  user-select: none;
  border-radius: 4px;
}

.lb-close {
  position: absolute;
  top: 20px;
  right: 24px;
  z-index: 2;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.65);
  font-size: 26px;
  cursor: pointer;
  line-height: 1;
  padding: 8px;
  transition: color 0.2s;
}

.lb-close:hover { color: #fff; }

.lb-prev,
.lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 40px;
  cursor: pointer;
  padding: 14px 18px;
  border-radius: 8px;
  line-height: 1;
  transition: background 0.2s;
}

.lb-prev { left: 16px; }
.lb-next { right: 16px; }

.lb-prev:hover,
.lb-next:hover { background: rgba(255, 255, 255, 0.2); }

.lb-prev:disabled,
.lb-next:disabled { opacity: 0.25; cursor: default; }

.lb-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.08em;
}

/* 유튜브 iframe 영역 */
.lb-video-wrap {
  position: relative;
  z-index: 2;
  border-radius: 4px;
  overflow: hidden;
}
.lb-video-wrap[data-ratio="16/9"] {
  width: min(90vw, calc(85vh * 16 / 9));
  aspect-ratio: 16 / 9;
}
.lb-video-wrap[data-ratio="9/16"] {
  height: min(85vh, calc(55vw * 16 / 9));
  aspect-ratio: 9 / 16;
  width: auto;
}
.lb-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ===== About & Contact ===== */
.section-about-contact { background: var(--bg-elevated); }

.about-contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
}

.section-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 40px;
}

.about-text {
  font-size: 16px;
  line-height: 1.9;
  color: var(--text-soft);
  margin-bottom: 36px;
}

.about-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tag {
  font-size: 13px;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 5px 14px;
}

.contact-text {
  font-size: 15px;
  color: var(--gray);
  margin-bottom: 36px;
}

.contact-form { margin-bottom: 36px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.contact-form input,
.contact-form textarea {
  font-family: var(--font);
  font-size: 14px;
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  resize: none;
}

.contact-form input:focus,
.contact-form textarea:focus { border-color: var(--text-soft); }

.contact-form textarea { margin-bottom: 10px; }

.form-submit {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  width: 100%;
  padding: 13px;
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.form-submit:hover  { opacity: 0.7; }
.form-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.form-feedback {
  font-size: 14px;
  margin-top: 12px;
  line-height: 1.5;
}
.form-success { color: #4a9e6b; }
.form-error   { color: #d95252; }

.contact-links {
  display: flex;
  gap: 24px;
}

.contact-links a {
  font-size: 14px;
  color: var(--gray);
  transition: color 0.2s;
}

.contact-links a:hover { color: var(--text); }

/* ===== 푸터 ===== */
footer {
  padding: 28px 60px;
  border-top: 1px solid var(--border);
  text-align: center;
}

footer p { font-size: 13px; color: var(--gray); }

/* ===== Career 페이지 ===== */
#view-career { padding: 0; }

.career-wrap {
  padding: 120px 80px 100px;
  max-width: 1100px;
}

.cr-section {
  margin-bottom: 80px;
}

.cr-section .section-label {
  margin-bottom: 32px;
}

.cr-list {
  display: flex;
  flex-direction: column;
}

.cr-entry {
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}

.cr-entry:first-child {
  border-top: 1px solid var(--border);
}

.cr-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 0;
}

.cr-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cr-company {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.cr-aka {
  font-size: 13px;
  font-weight: 400;
  color: var(--gray);
  margin-left: 6px;
}

.cr-type {
  font-size: 14px;
  color: var(--text-soft);
}

.cr-period {
  font-size: 13px;
  color: var(--gray);
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 2px;
}

.cr-bullets {
  list-style: none;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cr-bullets li {
  font-size: 14px;
  color: var(--text-soft);
  padding-left: 16px;
  position: relative;
}

.cr-bullets li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--gray);
}

/* 표 */
.cr-table-wrap {
  overflow-x: auto;
}

.cr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.cr-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--gray);
  padding: 10px 16px 10px 0;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.cr-table td {
  padding: 14px 16px 14px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-soft);
  vertical-align: top;
  line-height: 1.55;
}

.cr-table td:first-child {
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
}

.cr-table tbody tr:last-child td {
  border-bottom: none;
}

/* ===== 페이드인 ===== */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

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

/* ===== 모바일 ===== */
@media (max-width: 768px) {
  nav { padding: 16px 24px; }
  .nav-right { gap: 18px; }
  .nav-links { gap: 20px; }
  .section { padding: 80px 24px; }
  .section-intro { padding-top: 96px; padding-bottom: 48px; }
  .intro-text { max-width: 100%; }
  .section-works-first { padding-top: 48px; padding-bottom: 48px; }
  .project-grid { grid-template-columns: 1fr; gap: 24px; }
  #view-category { padding: 110px 24px 80px; }
  .category-title { font-size: 30px; }
  .big-grid { grid-template-columns: 1fr; gap: 48px; }
  .av-grid-169 { grid-template-columns: 1fr; gap: 40px; }
  .av-grid-916 { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }
  .av-grid-916-home { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .article-grid { grid-template-columns: 1fr; gap: 24px; }
  .branding-grid { grid-template-columns: repeat(2, 1fr); gap: 32px 20px; }
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
  .about-contact-grid { grid-template-columns: 1fr; gap: 60px; }
  .form-row { grid-template-columns: 1fr; }
  .career-wrap { padding: 100px 24px 80px; }
  .cr-header { flex-direction: column; gap: 4px; }
  .cr-period { padding-top: 0; }
  .cf-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== 커리어 피드 ===== */
.cf-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.cf-card { cursor: pointer; }
.cf-thumb {
  width: 100%;
  aspect-ratio: 1;
  background: var(--thumb-bg);
  border-radius: 4px;
  overflow: hidden;
  transition: opacity 0.2s;
}
.cf-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cf-card:hover .cf-thumb { opacity: 0.82; }

/* cf 모달 */
#cfModal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
#cfModal[hidden] { display: none; }
.cf-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); cursor: pointer; }
.cf-modal-wrap {
  position: relative; z-index: 1;
  background: var(--bg); border-radius: 12px;
  width: min(90vw, 760px); max-height: 88vh; overflow-y: auto;
}
.cf-close {
  position: absolute; top: 16px; right: 20px; z-index: 2;
  background: none; border: none; font-size: 20px;
  cursor: pointer; color: var(--gray); padding: 4px 8px; line-height: 1;
}
.cf-close:hover { color: var(--text); }
.cf-modal-images { position: relative; background: var(--thumb-bg); }
.cf-img-viewport { width: 100%; aspect-ratio: 1; overflow: hidden; }
.cf-modal-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cf-img-prev, .cf-img-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.8); border: none;
  font-size: 28px; cursor: pointer; padding: 8px 14px;
  border-radius: 6px; line-height: 1; color: var(--text);
}
.cf-img-prev { left: 10px; }
.cf-img-next { right: 10px; }
.cf-img-counter {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  font-size: 12px; color: var(--gray); background: rgba(255,255,255,0.75);
  padding: 2px 8px; border-radius: 100px;
}
.cf-modal-info { padding: 24px 28px; }
.cf-modal-date { font-size: 13px; color: var(--gray); margin-bottom: 8px; }
.cf-modal-title {
  font-size: 18px; font-weight: 600; letter-spacing: -0.02em;
  color: var(--text); margin-bottom: 16px; line-height: 1.4;
}
.cf-modal-text { font-size: 15px; color: var(--text-soft); line-height: 1.75; white-space: pre-line; }
