/* ============================================================
   3DMD — 다크 테크 테마 (기존 컬러 유지 + 타이포/디테일 개선)
   배경: 딥 네이비 + 그리드 / 포인트: 에메랄드, 시안
   Display: Gmarket Sans · Body: Pretendard · Label: IBM Plex Mono
   ============================================================ */

@font-face {
  font-family: "Gmarket Sans";
  font-weight: 700;
  font-display: swap;
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/GmarketSansBold.woff") format("woff");
}
@font-face {
  font-family: "Gmarket Sans";
  font-weight: 500;
  font-display: swap;
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/GmarketSansMedium.woff") format("woff");
}

:root {
  --bg: #0B0F19;
  --bg-deep: #020617;
  --card: #0F172A;
  --line: #1E293B;
  --line-soft: #334155;
  --text: #E2E8F0;
  --muted: #94A3B8;
  --steel: #64748B;
  --green: #34D399;
  --green-deep: #10B981;
  --cyan: #22D3EE;
  --kakao: #FEE500;
  --font-body: "Pretendard Variable", Pretendard, "Malgun Gothic", sans-serif;
  --font-display: "Gmarket Sans", "Pretendard Variable", sans-serif;
  --font-mono: "IBM Plex Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  background-image:
    linear-gradient(rgba(16, 185, 129, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 185, 129, .05) 1px, transparent 1px);
  background-size: 30px 30px;
  color: var(--text);
  line-height: 1.6;
  word-break: keep-all; /* 한글 단어 중간 줄바꿈 방지 */
}
a { text-decoration: none; color: inherit; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* ---------- 헤더 ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  min-height: 74px; padding: 16px 6%;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  background: rgba(11, 15, 25, .88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.logo {
  font-family: var(--font-display); font-weight: 700;
  font-size: 22px; letter-spacing: 1px; color: #A50062; /* 로고 이미지와 동일한 마젠타 */
  display: inline-flex; align-items: center; gap: 8px;
}
.cube { font-size: 14px; color: inherit; }
nav { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 14px; font-weight: 600; }
nav a:hover { color: var(--green); }
.admin-link {
  padding: 8px 14px; border-radius: 999px;
  background: #111827; color: var(--text); border: 1px solid var(--line-soft); font-size: 13px;
}
.admin-link:hover { border-color: var(--green); color: var(--green); }

/* ---------- 히어로 ---------- */
.hero { padding: 96px 6% 110px; display: flex; align-items: center; min-height: 640px; }
.hero-inner {
  width: 100%; max-width: 1240px; margin: 0 auto;
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 60px; align-items: center;
}
.badge, .section-head p, .contact-box > p:first-of-type, .admin-title p {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0 0 18px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  letter-spacing: 2px; color: var(--green); text-transform: uppercase;
}
.badge::before, .section-head p::before, .contact-box > p:first-of-type::before, .admin-title p::before {
  content: ""; width: 26px; height: 2px; background: var(--green); flex: none;
}
.hero-logo { display: block; height: 112px; width: auto; margin: 0 0 26px; }
.hero h1 {
  margin: 0; color: #fff;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(30px, 3.8vw, 48px); line-height: 1.35; letter-spacing: -1px;
  white-space: pre-line; /* 관리자에서 입력한 줄바꿈을 그대로 표시 */
}
.hero h1 span { color: var(--cyan); }
.hero-desc { max-width: 560px; margin: 22px 0 0; color: var(--muted); font-size: 17px; line-height: 1.85; }
.hero-actions { display: flex; gap: 12px; margin-top: 36px; flex-wrap: wrap; }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 50px; padding: 0 24px; border-radius: 8px;
  font-family: var(--font-body); font-weight: 700; font-size: 15px;
  border: 0; cursor: pointer; transition: background .18s, color .18s, border-color .18s;
}
.btn.primary { background: var(--green); color: #06110D; }
.btn.primary:hover { background: var(--green-deep); }
.btn.ghost { background: transparent; color: var(--text); border: 1.5px solid var(--line-soft); }
.btn.ghost:hover { border-color: var(--green); color: var(--green); }
.btn.dark { background: var(--card); color: var(--text); border: 1px solid var(--line); }
.btn.dark:hover { border-color: var(--line-soft); }
.btn.kakao { background: var(--kakao); color: #191919; }
.btn.kakao:hover { background: #F3DB00; }
.btn.full { width: 100%; margin-top: 20px; }

/* ---------- 히어로 비주얼: 레이어 프린팅 ---------- */
.hero-visual { display: flex; justify-content: center; }
.visual-card {
  position: relative; width: 100%; max-width: 440px; aspect-ratio: 4/4.4;
  background:
    repeating-linear-gradient(180deg, transparent 0 7px, rgba(52, 211, 153, .045) 7px 8px),
    radial-gradient(circle at 70% 15%, rgba(52, 211, 153, .16), transparent 40%),
    var(--card);
  border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 30px 90px rgba(16, 185, 129, .08);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 36px 28px 22px;
}
.layer-stack {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  width: 100%; flex: 1; justify-content: center;
}
.layer-stack span {
  display: block; height: 13px; border-radius: 3px;
  background: linear-gradient(90deg, rgba(52, 211, 153, .85), rgba(16, 185, 129, .55));
  box-shadow: 0 0 12px rgba(52, 211, 153, .12);
  animation: printLayer .45s cubic-bezier(.2, .7, .3, 1) both;
}
/* 화장품 용기 실루엣 — 위(캡)에서 아래(바닥)로, 최상단 레이어는 시안(출력 중) */
.layer-stack span:nth-child(1)  { width: 24%; background: var(--cyan); box-shadow: 0 0 16px rgba(34, 211, 238, .45); animation-delay: 1.32s; }
.layer-stack span:nth-child(2)  { width: 24%; animation-delay: 1.20s; }
.layer-stack span:nth-child(3)  { width: 14%; animation-delay: 1.08s; }
.layer-stack span:nth-child(4)  { width: 38%; animation-delay: .96s; }
.layer-stack span:nth-child(5)  { width: 52%; animation-delay: .84s; }
.layer-stack span:nth-child(6)  { width: 60%; animation-delay: .72s; }
.layer-stack span:nth-child(7)  { width: 63%; animation-delay: .60s; }
.layer-stack span:nth-child(8)  { width: 64%; animation-delay: .48s; }
.layer-stack span:nth-child(9)  { width: 64%; animation-delay: .36s; }
.layer-stack span:nth-child(10) { width: 63%; animation-delay: .24s; }
.layer-stack span:nth-child(11) { width: 60%; animation-delay: .12s; }
.layer-stack span:nth-child(12) { width: 66%; animation-delay: 0s; }
@keyframes printLayer {
  from { transform: scaleX(0); opacity: 0; }
  to   { transform: scaleX(1); opacity: 1; }
}
.visual-meta {
  width: 100%; display: flex; justify-content: center; text-align: center; gap: 12px;
  border-top: 1px solid var(--line); padding-top: 14px; margin-top: 24px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 1px; color: var(--steel);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .layer-stack span { animation: none; }
}

/* ---------- 섹션 공통 ---------- */
.section { max-width: 1240px; margin: 0 auto; padding: 90px 6%; }
.section-head { text-align: center; margin-bottom: 48px; }
.section-head.left { text-align: left; margin: 0 0 40px; }
.section-head p { justify-content: center; }
.section-head.left p { justify-content: flex-start; }
.section-head h2 {
  margin: 0; color: #fff;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(28px, 3.2vw, 38px); letter-spacing: -.5px;
}

/* ---------- 회사소개 ---------- */
.about-section { padding-bottom: 40px; }
.about-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: start; }
.about-intro { margin: 0; font-size: 17px; line-height: 2; color: #CBD5E1; white-space: pre-line; }
.about-info { list-style: none; margin: 30px 0 0; padding: 0; display: grid; gap: 12px; }
.about-info li { display: flex; gap: 14px; align-items: baseline; font-size: 15px; color: var(--text); }
.about-info li span {
  flex: none; min-width: 58px; text-align: center;
  padding: 4px 10px; border-radius: 6px;
  background: rgba(16, 185, 129, .10); border: 1px solid rgba(16, 185, 129, .28);
  color: var(--green); font-size: 12px; font-weight: 700;
}
.about-info a:hover { color: var(--green); }
.about-map img { width: 100%; display: block; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.map-placeholder {
  aspect-ratio: 16/10; border: 1px dashed var(--line-soft); border-radius: 16px;
  background: rgba(15, 23, 42, .5);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: var(--muted); text-align: center; padding: 20px;
}
.map-placeholder p { margin: 0; }
.map-caption {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 12px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  letter-spacing: 2px; color: var(--green);
}
.map-caption::before { content: ""; width: 26px; height: 2px; background: var(--green); flex: none; }

/* ---------- 스펙 카드 ---------- */
.specs {
  max-width: none;
  background: rgba(2, 6, 23, .55);
  border-top: 1px solid #111827; border-bottom: 1px solid #111827;
}
.spec-grid { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.spec-card {
  background: rgba(15, 23, 42, .7); border: 1px solid var(--line); border-radius: 16px;
  padding: 32px; transition: border-color .18s, transform .18s;
}
.spec-card:hover { border-color: rgba(52, 211, 153, .45); transform: translateY(-3px); }
.icon {
  width: 46px; height: 46px; display: flex; align-items: center; justify-content: center;
  font-size: 21px; color: var(--green);
  background: rgba(16, 185, 129, .08); border: 1px solid rgba(16, 185, 129, .22); border-radius: 10px;
  margin-bottom: 22px;
}
.icon.cyan { color: var(--cyan); background: rgba(34, 211, 238, .08); border-color: rgba(34, 211, 238, .22); }
.icon.purple { color: #C084FC; background: rgba(192, 132, 252, .08); border-color: rgba(192, 132, 252, .22); }
.spec-card h3 { margin: 0 0 10px; color: #fff; font-family: var(--font-display); font-weight: 500; font-size: 20px; }
.spec-card p { margin: 0; color: var(--muted); line-height: 1.75; font-size: 15px; }

/* ---------- 포트폴리오 ---------- */
.portfolio-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 34px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.tabs a {
  padding: 10px 16px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line);
  font-size: 14px; font-weight: 700; color: #CBD5E1;
  transition: background .15s, color .15s, border-color .15s;
}
.tabs a:hover { border-color: var(--green); color: var(--green); }
.tabs a.active { background: var(--green); border-color: var(--green); color: #06110D; }
.portfolio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 26px; }
.work-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  overflow: hidden; cursor: pointer;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.work-card:hover {
  transform: translateY(-4px); border-color: rgba(52, 211, 153, .55);
  box-shadow: 0 16px 40px rgba(2, 6, 23, .5);
}
.work-image { aspect-ratio: 16/11; background: var(--bg-deep); overflow: hidden; }
.work-image img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .9; transition: transform .45s, opacity .45s; }
.work-card:hover .work-image img { transform: scale(1.05); opacity: 1; }
.work-info { padding: 20px 22px 22px; }
.work-info span { font-size: 12px; font-weight: 800; letter-spacing: .5px; color: var(--green); }
.work-info h3 { margin: 8px 0 6px; color: #fff; font-size: 19px; font-weight: 700; }
.work-info p { margin: 0; color: var(--muted); line-height: 1.6; font-size: 14px; white-space: pre-line; }
.empty-card {
  text-align: center; border: 1px dashed var(--line-soft); border-radius: 16px;
  padding: 44px; color: var(--muted); background: rgba(15, 23, 42, .45); margin-bottom: 26px;
}
.empty-card a { color: var(--green); font-weight: 700; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 38px; }
.pagination button {
  min-width: 42px; height: 42px; padding: 0 13px; border-radius: 8px;
  background: var(--card); border: 1px solid var(--line); color: #CBD5E1;
  font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.pagination button:hover:not(:disabled) { border-color: var(--green); color: var(--green); }
.pagination button.active { background: var(--green); border-color: var(--green); color: #06110D; }
.pagination button:disabled { opacity: .35; cursor: default; }

/* ---------- 문의 ---------- */
.contact-section { padding: 50px 6% 110px; }
.contact-box {
  max-width: 980px; margin: 0 auto; padding: 70px 40px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(52, 211, 153, .10), transparent 55%),
    rgba(15, 23, 42, .75);
  border: 1px solid var(--line); border-radius: 20px;
}
.contact-box > p:first-of-type { justify-content: center; }
.contact-box h2 {
  margin: 0; color: #fff;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(26px, 3vw, 34px); letter-spacing: -.5px;
}
.contact-desc { max-width: 540px; margin: 18px auto 30px; color: var(--muted); line-height: 1.8; }
.contact-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.small { color: var(--steel); font-size: 13px; }

/* ---------- 푸터 ---------- */
.footer {
  padding: 26px 6%; background: var(--bg-deep); border-top: 1px solid #111827;
  color: var(--steel); font-size: 13px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.footer strong { color: var(--muted); font-family: var(--font-mono); font-weight: 600; }

/* ---------- 카카오 플로팅 ---------- */
.kakao-float {
  /* 푸터(사업자번호)를 가리지 않도록 바닥에서 띄움 */
  position: fixed; right: 24px; bottom: 92px; z-index: 90;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 50px; padding: 0 20px; border-radius: 999px;
  background: var(--kakao); color: #191919;
  font-weight: 800; font-size: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}
.kakao-float:hover { background: #F3DB00; }
.kakao-icon { font-size: 17px; }

/* ---------- 모달 ---------- */
.modal {
  display: none; position: fixed; inset: 0; z-index: 999;
  background: rgba(2, 6, 23, .93);
  align-items: center; justify-content: center; flex-direction: column;
  color: #fff; padding: 22px;
}
.modal img { max-width: 92%; max-height: 72vh; border-radius: 14px; border: 1px solid var(--line-soft); background: var(--card); }
.close { position: fixed; top: 16px; right: 26px; font-size: 42px; color: #fff; background: none; border: 0; cursor: pointer; }
.arrow {
  position: fixed; top: 47%; width: 54px; height: 54px; border-radius: 50%;
  border: 1px solid var(--line-soft); background: rgba(15, 23, 42, .85); color: #fff;
  font-size: 34px; cursor: pointer;
}
.arrow:hover { border-color: var(--green); color: var(--green); }
.arrow.left { left: 26px; }
.arrow.right { right: 26px; }
.modal-text { text-align: center; max-width: 720px; }
.modal-text h3 { font-family: var(--font-display); font-weight: 500; font-size: 22px; margin: 18px 0 8px; }
.modal-text p { color: var(--muted); white-space: pre-line; margin: 4px 0; }

/* ---------- 로그인 / 관리자 ---------- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 30px; }
.login-box, .admin-panel {
  background: rgba(15, 23, 42, .86); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, .25);
}
.login-box { width: min(430px, 100%); padding: 36px; }
.login-logo { display: inline-flex; margin-bottom: 20px; }
.login-box h1, .admin-panel h1, .admin-panel h2 {
  margin-top: 0; color: #fff;
  font-family: var(--font-display); font-weight: 700; letter-spacing: -.5px;
}
.admin-wrap { max-width: 980px; margin: 44px auto 110px; padding: 0 20px; }
.admin-panel { padding: 32px; margin-bottom: 22px; }
.admin-title { margin-bottom: 20px; }
label { display: block; margin: 18px 0 8px; color: var(--text); font-weight: 700; font-size: 14px; }
input, select, textarea {
  width: 100%; padding: 13px 14px; border-radius: 10px;
  border: 1px solid var(--line-soft); background: var(--bg-deep); color: var(--text);
  font-family: inherit; font-size: 15px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green); outline-offset: 0; border-color: var(--green); }
textarea { min-height: 110px; }
.success { padding: 13px; border-radius: 10px; background: rgba(16, 185, 129, .12); border: 1px solid rgba(16, 185, 129, .3); color: var(--green); }
.error { padding: 13px; border-radius: 10px; background: rgba(244, 63, 94, .12); border: 1px solid rgba(244, 63, 94, .3); color: #FB7185; }
.admin-list { display: grid; gap: 12px; }
.admin-item {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--bg-deep);
}
.admin-item-head { display: flex; align-items: center; gap: 14px; }
.admin-item-head img { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; background: #111827; }
.admin-item-head div { flex: 1; }
.admin-item strong { display: block; color: #fff; }
.admin-item span { color: var(--muted); font-size: 14px; }
.admin-item-images { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.admin-item-images .thumb { position: relative; }
.admin-item-images .thumb img { width: 84px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #111827; display: block; }
.thumb-del {
  position: absolute; top: -7px; right: -7px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #F43F5E; color: #fff; border: 0; cursor: pointer;
  font-size: 14px; line-height: 1; font-weight: 700; padding: 0;
}
.thumb-del:hover { background: #E11D48; }
.add-images-form { display: flex; gap: 10px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.add-images-form input[type="file"] { flex: 1; min-width: 200px; width: auto; padding: 9px 12px; }
.add-images-form .btn { min-height: 42px; padding: 0 18px; font-size: 14px; }
.edit-box { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.edit-box summary { cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 700; list-style: none; }
.edit-box summary::-webkit-details-marker { display: none; }
.edit-box summary::before { content: "▸ "; }
.edit-box[open] summary::before { content: "▾ "; }
.edit-box summary:hover { color: #fff; }
.edit-form label:first-of-type { margin-top: 12px; }
.edit-form textarea { min-height: 80px; }
.edit-form .btn { margin-top: 12px; }
.delete-form { margin: 0; }
button.delete {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 700; color: #FB7185;
}
button.delete:hover { text-decoration: underline; }
.map-preview { width: 100%; max-width: 340px; display: block; border: 1px solid var(--line-soft); border-radius: 10px; margin: 4px 0 8px; }
.hint { margin: 0 0 6px; color: var(--steel); font-size: 13px; }

/* ---------- 반응형 ---------- */
@media (max-width: 850px) {
  .hero { padding: 60px 6% 70px; min-height: auto; }
  .hero-logo { height: 84px; margin-bottom: 20px; }
  .hero-inner { grid-template-columns: 1fr; gap: 44px; }
  .about-grid { grid-template-columns: 1fr; }
  .portfolio-top { align-items: flex-start; flex-direction: column; }
  .tabs { justify-content: flex-start; }
  .spec-grid { grid-template-columns: 1fr; }
  .footer { display: block; }
  .footer strong { display: block; margin-bottom: 6px; }
  .arrow { top: auto; bottom: 96px; }
  .arrow.left { left: 34px; }
  .arrow.right { right: 34px; }
}
@media (max-width: 560px) {
  .header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .contact-box { padding: 50px 22px; }
  .admin-item-head { align-items: flex-start; }
  .admin-item-head img { width: 80px; height: 64px; }
  .kakao-float { right: 16px; bottom: 96px; }
}
