@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600&display=swap");

/* 출처: 사용자 제작 레퍼런스(environment_artist_portfolio.html) — 구조·타이포·간격 그대로 이식,
   이미지 자리(.visual/.card-visual/.hero-bg)만 실제 작업물 사진을 받도록 확장. */

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  overflow-x: clip; /* .reveal(아직 안 보인 상태에서 translateX 로 화면 밖에 밀려있는 요소)가
                        body 의 overflow-x:hidden 만으로는 안 막히고 문서 가로폭 계산에
                        영향을 줘서, 일부 모바일 브라우저에서 화면 비율이 미묘하게 틀어지는 걸 방지 */
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  letter-spacing: -0.02em;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; }
.wrap { width: min(var(--max), 100%); margin: 0 auto; padding-inline: var(--pad); }

/* ---- header / nav ---- */
header {
  position: fixed; left: 0; right: 0; top: 0; z-index: 50;
  border-bottom: 1px solid transparent;
  transition: 0.3s ease;
}
header.scrolled {
  background: rgba(16, 17, 15, 0.82);
  backdrop-filter: blur(18px);
  border-color: var(--line);
}
.nav { height: 78px; display: flex; align-items: center; justify-content: space-between; }
.brand { font-size: 15px; font-weight: 700; letter-spacing: -0.03em; }
.menu { display: flex; gap: 28px; font-size: 13px; color: var(--text-soft); }
.menu a { position: relative; }
.menu a::after {
  content: ""; position: absolute; left: 0; bottom: -7px; width: 100%; height: 1px;
  background: var(--text); transform: scaleX(0); transform-origin: left; transition: 0.25s;
}
.menu a:hover::after { transform: scaleX(1); }

/* ---- hero ---- */
.hero {
  min-height: 100vh;
  display: grid; align-items: center;
  padding: 138px 0 72px;
  position: relative;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: 50% 35%;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(circle at 72% 30%, rgba(167, 177, 146, 0.22), transparent 28%),
    radial-gradient(circle at 38% 74%, rgba(80, 87, 71, 0.2), transparent 25%),
    linear-gradient(135deg, rgba(9, 10, 8, 0.38) 0%, rgba(13, 14, 12, 0.48) 48%, rgba(8, 9, 8, 0.62) 100%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1; opacity: 0.25; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
                     linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 55px 55px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}
.hero-grid {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 50px; align-items: center;
}
.hero-grid .hero-copy { transition-delay: 0.18s; } /* 이름이 먼저, 소개가 살짝 뒤따라오도록 */
.eyebrow {
  text-transform: uppercase;
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.14em; color: var(--accent); margin-bottom: 28px;
}
h1 {
  margin: 0;
  font-size: clamp(70px, 10vw, 164px);
  line-height: 0.84; letter-spacing: -0.075em;
  font-weight: 600;
}
.hero-copy { padding-bottom: 10px; }
.hero-copy h2 {
  margin: 0 0 28px;
  font-size: clamp(24px, 3vw, 46px);
  line-height: 1.18; letter-spacing: -0.055em; font-weight: 500;
}
.hero-meta {
  display: grid; gap: 13px; padding-top: 27px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
.hero-meta b { color: var(--text-soft); font-weight: 500; display: inline-block; min-width: 72px; }
.btn {
  margin-top: 34px; display: inline-flex; gap: 16px; align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35); padding-bottom: 9px;
  font-size: 13px; cursor: pointer; background: none; border-left: none; border-right: none; border-top: none; color: inherit; font-family: inherit;
}

/* ---- section shell ---- */
section { padding: 120px 0; border-bottom: 1px solid var(--line); }
.section-kicker {
  font-size: 12px; color: var(--accent); letter-spacing: 0.11em;
  font-family: var(--font-mono); text-transform: uppercase; margin-bottom: 24px;
}
.intro { display: grid; grid-template-columns: 0.62fr 1.38fr; gap: 70px; }
.intro h2, .about h2 {
  font-size: clamp(38px, 5.4vw, 84px); line-height: 1.08; letter-spacing: -0.06em;
  font-weight: 500; margin: 0 0 40px;
}
.intro p, .about p {
  max-width: 760px; font-size: 18px; line-height: 1.8; color: var(--muted-strong); margin: 0 0 14px;
}

/* ---- projects ---- */
.projects-head { display: flex; align-items: end; justify-content: space-between; margin-bottom: 42px; }
.projects-head h2 { font-size: clamp(26px, 6vw, 42px); margin: 0; font-weight: 500; letter-spacing: -0.05em; }
.projects-head span { font-size: 13px; color: var(--muted); }

.featured { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 42px; padding: 28px 0 80px; }
.visual {
  aspect-ratio: 16 / 10; border: 1px solid var(--line); overflow: hidden; position: relative;
  background-color: var(--panel-2); background-size: cover; background-position: 50%;
}
.visual::before, .card-visual::before {
  content: "";
  position: absolute; inset: 8%;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background:
    linear-gradient(90deg, transparent 30%, rgba(255, 255, 255, 0.045) 30% 31%, transparent 31% 68%, rgba(255, 255, 255, 0.04) 68% 69%, transparent 69%),
    linear-gradient(0deg, transparent 36%, rgba(255, 255, 255, 0.04) 36% 37%, transparent 37%);
  transform: perspective(900px) rotateY(-6deg);
  pointer-events: none;
}
.feature-info { display: flex; flex-direction: column; justify-content: flex-end; }
.index { font: 12px var(--font-mono); color: var(--accent); letter-spacing: 0.12em; }
.feature-info h3 {
  font-size: clamp(40px, 5vw, 74px); line-height: 1.03; letter-spacing: -0.065em;
  margin: 20px 0 22px; font-weight: 500;
}
.feature-info .desc { font-size: 16px; line-height: 1.8; color: var(--muted-strong); margin: 0 0 32px; }
.facts { display: grid; gap: 10px; font-size: 13px; color: var(--muted); }
.facts b { display: inline-block; min-width: 80px; color: var(--text-soft); font-weight: 500; }
.tags { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 28px; }
.kicker-featured { margin: 18px 0 0; }
.kicker-card { margin: 12px 0 0; }
.role-tag { font-size: 13px; color: var(--muted); margin: 0; }
.tag { border: 1px solid var(--line); padding: 8px 11px; font-size: 11px; color: var(--muted-strong); white-space: nowrap; }

.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.card { padding-top: 26px; border-top: 1px solid var(--line); text-decoration: none; display: block; }
.card-visual {
  aspect-ratio: 16 / 10; position: relative; overflow: hidden; margin: 20px 0 24px;
  background-color: var(--panel-2); background-size: cover; background-position: 50%;
}
.card h3 { font-size: clamp(22px, 5vw, 30px); margin: 0 0 12px; letter-spacing: -0.045em; font-weight: 500; color: var(--text); }
.card p { color: var(--muted); font-size: 14px; line-height: 1.75; max-width: 90%; }
.card-foot { display: flex; gap: 15px; flex-wrap: wrap; font-size: 11px; color: var(--muted-dim); margin-top: 20px; }

/* ---- about ---- */
.about { display: grid; grid-template-columns: 0.7fr 1.3fr; gap: 70px; }
.about-list { margin-top: 46px; border-top: 1px solid var(--line); }
.about-row {
  padding: 20px 0; border-bottom: 1px solid var(--line);
  display: grid; grid-template-columns: 140px 1fr; gap: 30px; font-size: 14px;
}
.about-row span:first-child { color: var(--muted-dim); }
.about-row span:last-child { color: var(--muted-strong); }

/* ---- contact ---- */
.contact { min-height: 68vh; display: flex; align-items: center; text-align: center; }
.contact .wrap { width: 100%; }
.contact h2 {
  font-size: clamp(48px, 7.4vw, 112px);
  letter-spacing: -0.07em; line-height: 1; margin: 0 0 32px; font-weight: 500;
}
.mail {
  display: inline-block; font: clamp(16px, 2vw, 25px) var(--font-mono);
  padding-bottom: 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.38);
}
footer { padding: 26px 0 38px; }
.footer-inner {
  display: flex; justify-content: space-between; gap: 30px;
  color: var(--muted-dim); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
}
.footer-links { display: flex; gap: 20px; }

/* ---- 스크롤 리빌 ---- */
.reveal {
  opacity: 0; transform: translateY(44px);
  transition: opacity 0.8s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reveal.left { transform: translateX(-55px); }
.reveal.right { transform: translateX(55px); }
.reveal.visible { opacity: 1; transform: none; }

/* ================================================================
   아래는 레퍼런스에 없던 페이지(프로젝트 상세·404)용 확장 — 같은 톤앤매너로 신규 작성
   ================================================================ */

/* ---- project detail ---- */
.detail-hero { padding: 150px 0 60px; border-bottom: 1px solid var(--line); }
.back-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted); margin-bottom: 30px;
}
.back-link:hover { color: var(--text); }
.detail-hero .index { margin-bottom: 18px; }
.detail-hero h1 {
  font-size: clamp(40px, 6vw, 90px); line-height: 1; letter-spacing: -0.06em; font-weight: 500;
  margin: 0 0 30px;
}
.detail-facts {
  display: grid; grid-template-columns: repeat(3, minmax(160px, 1fr)); gap: 20px;
  padding-top: 24px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
.detail-facts b { display: block; color: var(--text-soft); font-weight: 500; margin-bottom: 6px; }
.detail-desc {
  max-width: 760px; font-size: 17px; line-height: 1.85; color: var(--muted-strong);
  padding: 40px 0 0;
}
.detail-gallery { padding: 70px 0 120px; display: flex; flex-direction: column; gap: 24px; }
.detail-gallery img {
  border: 1px solid var(--line);
}
.detail-gallery figcaption {
  font-size: 12px; color: var(--muted); margin-top: 10px; font-family: var(--font-mono); letter-spacing: 0.04em;
}
.detail-gallery figure { margin: 0; }

/* ---- admin ---- */
.admin-auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.admin-auth-box { width: min(380px, 100%); }
.admin-auth-box h1 { font-size: 32px; margin: 0 0 26px; font-weight: 500; letter-spacing: -0.04em; }
.admin-wrap { padding: 60px var(--pad) 100px; }
.admin-title { font-size: 34px; margin: 20px 0 30px; font-weight: 500; letter-spacing: -0.04em; }
.admin-error {
  color: var(--danger); background: rgba(226, 92, 92, 0.1); border: 1px solid rgba(226, 92, 92, 0.3);
  padding: 12px 16px; font-size: 13px; margin: 0 0 20px;
}

.admin-form { display: flex; flex-direction: column; gap: 18px; }
.admin-form label {
  display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--muted);
}
.admin-form input[type="text"], .admin-form input[type="password"], .admin-form textarea {
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  font-family: var(--font-body); font-size: 16px; padding: 10px 12px; border-radius: 2px;
  /* 16px 미만이면 iOS Safari 가 포커스할 때 화면을 자동 확대해버린다 */
}
.admin-form input[type="file"] { color: var(--muted); font-size: 13px; }
.admin-form textarea { resize: vertical; }
.admin-hint { color: var(--muted-dim); font-weight: 400; font-size: 11px; margin-left: 6px; }
.admin-checkbox { flex-direction: row !important; align-items: center; gap: 10px !important; }
.admin-submit { align-self: flex-start; }

.admin-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 24px; }
.admin-span-2 { grid-column: 1 / -1; }
.admin-form-actions { margin-top: 10px; }

.admin-current-thumb img, .admin-gallery-item img { border: 1px solid var(--line); width: 100%; display: block; aspect-ratio: 4 / 3; object-fit: cover; }
.admin-current-thumb { max-width: 320px; }
.admin-subtitle { font-size: 22px; font-weight: 500; margin: 60px 0 6px; letter-spacing: -0.03em; }
.admin-gallery-section { padding-bottom: 100px; }
.admin-gallery-existing {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; margin: 18px 0 28px;
}
.admin-gallery-item {
  display: flex; flex-direction: column; gap: 8px; font-size: 11px; color: var(--muted);
}
.admin-label-form { display: flex; gap: 6px; }
.admin-gallery-actions { display: flex; gap: 6px; }
.admin-gallery-actions .admin-btn { flex: 1; }
.admin-label-input {
  flex: 1; min-width: 0; background: var(--panel); border: 1px solid var(--line); color: var(--text);
  font-family: var(--font-body); font-size: 16px; padding: 6px 8px; /* iOS 자동 확대 방지 — 위와 동일 이유 */
}

.admin-head { display: flex; align-items: end; justify-content: space-between; margin-bottom: 30px; flex-wrap: wrap; gap: 16px; }
.admin-head-actions { display: flex; gap: 10px; align-items: center; }
.admin-inline-form { display: inline-flex; }

/* .btn(히어로/푸터용 큰 링크, margin-top:34px) 을 관리자 버튼에 그대로 재사용했더니
   삭제 버튼만 아래로 툭 떨어져 보이던 문제 — 관리자 전용 독립 버튼 스타일로 분리 */
.admin-btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: inherit; font-size: 12px; line-height: 1; cursor: pointer;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 2px; padding: 8px 13px;
  white-space: nowrap; /* .admin-col-tight 의 width:1% 는 th 에만 걸려서, 실제 셀 버튼에도
                           nowrap 을 안 주면 "대표로 지정" 처럼 긴 라벨이 줄바꿈되며 칸이 찌그러진다 */
}
.admin-btn:hover { border-color: var(--accent); color: var(--accent); }
.admin-btn-primary { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.admin-btn-primary:hover { color: var(--bg); opacity: 0.88; }
.admin-btn-danger { color: var(--danger); border-color: rgba(226, 92, 92, 0.35); }
.admin-btn-danger:hover { border-color: var(--danger); color: var(--danger); }
.admin-btn-small { padding: 6px 10px; font-size: 12px; }
.admin-btn[disabled] { opacity: 0.3; cursor: default; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th {
  text-align: left; color: var(--muted-dim); font-weight: 500; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.admin-table td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-order-cell { width: 34px; }
.admin-order-btn {
  display: block; width: 26px; height: 22px; margin: 1px 0;
  background: var(--panel); border: 1px solid var(--line); color: var(--muted);
  cursor: pointer; font-size: 12px; line-height: 1;
}
.admin-order-btn:hover { color: var(--text); border-color: var(--accent); }
.admin-thumb-cell { width: 90px; }
.admin-thumb-cell img { width: 76px; aspect-ratio: 16 / 10; object-fit: cover; border: 1px solid var(--line); }
.admin-sub { color: var(--muted-dim); font-size: 12px; margin-top: 3px; }
.admin-tag-featured { color: var(--accent); border-color: var(--accent); }
.admin-row-actions { display: flex; gap: 8px; white-space: nowrap; }
/* 제목 열만 늘어나고 나머지(순서·썸네일·대표·이미지수·버튼)는 내용 크기만큼만 —
   안 그러면 브라우저가 남는 폭을 여기 열들에 나눠줘서 버튼이 왼쪽에 쏠리고 오른쪽이 텅 비어 보인다. */
.admin-col-tight { width: 1%; white-space: nowrap; }

@media (max-width: 700px) {
  .admin-form-grid { grid-template-columns: 1fr; }
  .admin-table { display: block; overflow-x: auto; }
}

/* ---- 404 ---- */
.notfound { min-height: 70vh; display: flex; align-items: center; text-align: center; }
.notfound .wrap { width: 100%; }
.notfound h1 {
  font-size: clamp(40px, 6vw, 80px); letter-spacing: -0.05em; margin: 0 0 24px;
}

@media (max-width: 900px) {
  .menu { gap: 14px; }
  .hero-grid, .intro, .featured, .about { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding-top: 150px; }
  h1 { font-size: clamp(62px, 20vw, 120px); }
  .hero-copy { margin-top: 30px; }
  section { padding: 84px 0; }
  .card-grid { grid-template-columns: 1fr; }
  .detail-facts { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  /* "연락" 이 wrap 패딩 경계에 딱 붙어서 여백 없이 화면 끝에 닿는 느낌(=잘린 것처럼 보임) —
     nav 에만 여유 여백을 조금 더 준다 */
  .nav { height: 66px; padding-right: 6px; }
  .menu a:nth-child(2) { display: none; }
  .projects-head { align-items: start; flex-direction: column; gap: 10px; }
  .about-row { grid-template-columns: 1fr; gap: 7px; }
  .footer-inner { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* 슬라이드(이동)만 없애고 서서히 나타나는 opacity 전환은 유지 — 완전히 안 움직이면
     "안 보였다가 나타나는" 느낌 자체가 사라져버린다. 이동감만 제거하는 게 접근성 관례. */
  .reveal { transform: none; transition: opacity 0.6s ease; }
}
