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

:root {
  --paper: #f7f6f2;
  --ink: #151515;
  --muted: #77756f;
  --line: #cfcac1;
  --dark: #181918;
  --light: #efeee9;
  --max: 1440px;

  /* 스크롤 시 전환되는 테마 기본값 */
  --page-bg: #121312;
  --page-text: #efeee9;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--page-bg);
  color: var(--page-text);
  font-family: "Inter", "Noto Sans KR", sans-serif;
  line-height: 1.55;
  word-break: keep-all;
  overflow-wrap: break-word;
  transition: background-color 0.85s cubic-bezier(0.16, 1, 0.3, 1),
              color 0.6s ease;
}

h1, h2, h3, h4, p, blockquote, dt, dd, li, label, strong {
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* 라이트 테마 모드 */
body[data-theme="light"] {
  --page-text: #151515;
  --ink: #151515;
  --muted: #77756f;
  --line: #cfcac1;
}

/* 다크 테마 모드 */
body[data-theme="dark"] {
  --page-text: #efeee9;
  --ink: #efeee9;
  --muted: #9e9d96;
  --line: rgba(255, 255, 255, 0.16);
}

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

img {
  display: block;
  width: 100%;
}

button, input, textarea {
  font: inherit;
  color: inherit;
}

/* 상단 스크롤 진행 바 */
.scroll-progress-bar {
  position: fixed;
  top: 72px;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--ink);
  z-index: 101;
  pointer-events: none;
  transition: width 0.08s ease-out, background-color 0.6s ease;
}

/* 상단 탑바 (배경 전환과 연동된 블러 틴트) */
.topbar {
  height: 72px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 246, 242, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: background-color 0.6s ease, border-color 0.6s ease, color 0.6s ease;
}

body[data-theme="dark"] .topbar {
  background: rgba(18, 19, 18, 0.85);
  border-bottom-color: rgba(255, 255, 255, 0.12);
  color: #efeee9;
}

body[data-theme="light"] .topbar {
  background: rgba(247, 246, 242, 0.88);
  border-bottom-color: rgba(0, 0, 0, 0.1);
  color: #151515;
}

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

.topbar nav {
  display: flex;
  gap: 28px;
  margin-left: auto;
}

.topbar nav a, .project-link {
  font-size: 12px;
  transition: opacity 0.2s ease;
}

.topbar nav a:hover, .project-link:hover {
  opacity: 0.7;
}

.project-link {
  margin-left: 38px;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
}

/* 히어로 섹션 */
.editorial-hero {
  position: relative;
  height: calc(100vh - 72px);
  min-height: 680px;
  overflow: hidden;
  color: #fff;
}

.editorial-hero > img {
  position: absolute;
  inset: 0;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.25), rgba(0,0,0,.15) 45%, rgba(0,0,0,.52));
}

.hero-kicker {
  position: absolute;
  top: 30px;
  left: 30px;
  font-size: 11px;
  letter-spacing: .1em;
}

.hero-copy {
  position: absolute;
  left: 30px;
  right: 30px;
  bottom: 92px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 50px;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(54px, 7.6vw, 118px);
  line-height: .98;
  letter-spacing: -.055em;
  font-weight: 500;
}

.hero-meta {
  width: 340px;
  font-size: 12px;
  line-height: 1.7;
}

.hero-meta p {
  margin: 0;
}

.hero-bottom {
  position: absolute;
  left: 30px;
  right: 30px;
  bottom: 26px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: .08em;
}

/* 공통 섹션 레이아웃 */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 120px 28px;
}

.section-label {
  font-size: 10px;
  letter-spacing: .14em;
  margin-bottom: 56px;
  color: var(--muted);
  transition: color 0.6s ease;
}

.section-label.light {
  color: #aaa9a4;
}

/* 01 SELECTED WORK (이미지 위주 섹션) */
.project {
  margin-bottom: 90px;
}

.project-image {
  background: #2b2b2a;
  overflow: hidden;
}

.feature .project-image img {
  aspect-ratio: 16/9;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.feature:hover .project-image img {
  transform: scale(1.02);
}

.project-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  padding-top: 18px;
}

.project-info h2, .project-info h3 {
  margin: 5px 0 0;
  font-weight: 500;
  letter-spacing: -.035em;
}

.project-info h2 {
  font-size: 36px;
}

.project-info h3 {
  font-size: 28px;
}

.project-no {
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--muted);
}

.project-info dl {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 24px;
}

.project-info dl div {
  display: grid;
  grid-template-columns: 80px 1fr;
  font-size: 12px;
}

.project-info dt {
  color: var(--muted);
}

.project-info dd {
  margin: 0;
}

.project-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 90px;
}

.project-pair .project-image img {
  aspect-ratio: 4/5;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-pair .project:hover .project-image img {
  transform: scale(1.02);
}

.project.offset {
  margin-top: 160px;
}

.project-info.compact {
  display: block;
}

.project-info.compact p {
  font-size: 12px;
  color: var(--muted);
  margin: 10px 0 0;
}

.archive-link {
  text-align: right;
  font-size: 11px;
  letter-spacing: .08em;
  margin-top: 40px;
}

.archive-link a {
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
}

/* 02 DIRECTOR (흑백 사진 + 텍스트) */
.director {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 820px;
  background: transparent;
  color: inherit;
  transition: color 0.6s ease;
}

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

.director-copy {
  padding: 96px 8vw 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.director-copy h2, .approach h2, .risk h2, .focus h2, .process h2, .contact h2 {
  font-weight: 500;
  letter-spacing: -.05em;
  line-height: 1.08;
}

.director-copy h2 {
  font-size: clamp(42px, 5vw, 76px);
  margin: 0;
}

.director-meta {
  margin-top: 50px;
}

.director-meta strong {
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
}

.director-meta p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
  margin-top: 6px;
}

.bodycopy {
  margin-top: 38px;
  max-width: 620px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

blockquote {
  margin: 60px 0 0;
  padding: 0;
  border: 0;
  font-size: 24px;
  line-height: 1.5;
  color: var(--ink);
}

/* ========================================================
   텍스트 설명 섹션 고정 배경(Fixed Background Parallax)
   스크롤되어도 배경 이미지가 화면에 고정되어 머무르는 효과
   ======================================================== */
.fixed-bg-section {
  position: relative;
  width: 100%;
  color: #efeee9;
  background-attachment: fixed;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  overflow: hidden;
}

.fixed-bg-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 140px 28px;
  position: relative;
  z-index: 2;
}

.fixed-bg-section h2 {
  color: #ffffff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}

.fixed-bg-section p {
  color: #cfcdc7;
}

.fixed-bg-section .section-label {
  color: #aaa8a0;
}

/* 03 APPROACH — 고정 배경 1 (미니멀 콘크리트 건축 공간과 빛) */
#approach.fixed-bg-section {
  background-image: linear-gradient(
    180deg,
    rgba(14, 15, 14, 0.82) 0%,
    rgba(18, 19, 18, 0.76) 50%,
    rgba(14, 15, 14, 0.85) 100%
  ), url('assets/approach-bg.jpg');
}

.approach-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 90px;
}

.approach h2 {
  font-size: clamp(48px, 5.7vw, 82px);
  margin: 0;
}

.approach-copy {
  padding-top: 10px;
}

.approach-copy .lead {
  font-size: 24px;
  line-height: 1.45;
  color: #f7f6f2;
  margin-top: 0;
  font-weight: 500;
}

.approach-copy p {
  color: #cfcdc7;
  max-width: 520px;
  line-height: 1.7;
}

/* 04 CONSTRUCTION (RISK) — 고정 배경 2 (철골 구조와 시공 현장 디테일) */
.risk.fixed-bg-section {
  background-image: linear-gradient(
    180deg,
    rgba(12, 13, 12, 0.84) 0%,
    rgba(15, 16, 15, 0.80) 50%,
    rgba(12, 13, 12, 0.88) 100%
  ), url('assets/construction-bg.jpg');
}

.risk-intro {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 90px;
  margin-bottom: 70px;
}

.risk h2 {
  font-size: clamp(48px, 5.6vw, 80px);
  margin: 0;
}

.risk-intro > p {
  max-width: 480px;
  color: #cfcdc7;
  align-self: end;
  line-height: 1.7;
}

.risk-list {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.risk-row {
  display: grid;
  grid-template-columns: 190px 1fr 1fr;
  gap: 36px;
  padding: 30px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.risk-row span {
  font-size: 10px;
  letter-spacing: .1em;
  color: #9d9b94;
}

.risk-row strong {
  font-size: 20px;
  font-weight: 500;
  color: #ffffff;
}

.risk-row p {
  margin: 0;
  color: #cfcdc7;
  font-size: 13px;
  line-height: 1.6;
}

/* 05 FOCUS — 고정 배경 3 (정제된 미니멀 인테리어와 공간의 여백) */
.focus.fixed-bg-section {
  background-image: linear-gradient(
    180deg,
    rgba(14, 15, 14, 0.82) 0%,
    rgba(17, 18, 17, 0.76) 50%,
    rgba(14, 15, 14, 0.85) 100%
  ), url('assets/focus-bg.jpg');
}

.focus-copy {
  max-width: 900px;
  margin-left: auto;
}

.focus-copy > p:first-child {
  font-size: 10px;
  letter-spacing: .14em;
  color: #aaa8a0;
}

.focus h2 {
  font-size: clamp(56px, 7vw, 104px);
  margin: 18px 0 34px;
}

.focus .sub {
  max-width: 560px;
  color: #d1cfc7;
  font-size: 17px;
  line-height: 1.7;
}

/* 06 PROCESS — 고정 배경 4 (건축 도면과 청사진 제도 스케치) */
.process.fixed-bg-section {
  background-image: linear-gradient(
    180deg,
    rgba(12, 13, 12, 0.85) 0%,
    rgba(16, 17, 16, 0.80) 50%,
    rgba(12, 13, 12, 0.88) 100%
  ), url('assets/process-bg.jpg');
}

.process-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 60px;
}

.process h2 {
  font-size: clamp(48px, 5.6vw, 80px);
  margin: 0;
  width: min(800px, 100%);
}

.process ol {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.process li {
  display: grid;
  grid-template-columns: 80px 220px 1fr;
  padding: 24px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  align-items: baseline;
}

.process li span {
  font-size: 10px;
  color: #9d9b94;
}

.process li strong {
  font-size: 18px;
  font-weight: 500;
  color: #ffffff;
}

.process li p {
  margin: 0;
  color: #cfcdc7;
  font-size: 13px;
}

/* 07 ARCHIVE (이미지 그리드 섹션) */
.archive {
  background: transparent;
  color: inherit;
  padding: 120px 28px;
  transition: color 0.6s ease;
}

.archive-head {
  max-width: var(--max);
  margin: 0 auto 46px;
  display: flex;
  justify-content: space-between;
  gap: 40px;
  align-items: center;
}

.filters {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.filters button {
  border: 0;
  background: none;
  color: var(--muted);
  padding: 0 0 4px;
  font-size: 10px;
  cursor: pointer;
  letter-spacing: 0.08em;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.filters button.active {
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
}

.archive-grid {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px 18px;
}

.archive-grid a {
  display: block;
  text-decoration: none;
  color: inherit;
}

.archive-grid img {
  aspect-ratio: 16/10;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.archive-grid .archive-item:hover img,
.archive-grid > div:hover img {
  transform: scale(1.02);
}

.archive-grid span {
  display: block;
  font-size: 11px;
  margin-top: 10px;
  color: var(--muted);
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

.archive-grid .archive-item:hover span {
  color: #fff;
}

/* CONTACT SECTION */
.contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 100px;
  padding: 130px max(28px, calc((100vw - var(--max)) / 2 + 28px));
  transition: color 0.6s ease;
}

.contact-left h2 {
  font-size: clamp(52px, 6vw, 88px);
  margin: 0;
}

.contact-left > p {
  color: var(--muted);
  margin-top: 30px;
  line-height: 1.7;
}

.field {
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  transition: border-color 0.6s ease;
}

.field label {
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--muted);
  display: block;
}

.field input, .field textarea {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 10px 0 0;
  outline: none;
  font-size: 18px;
  color: var(--ink);
  resize: vertical;
  font-family: inherit;
}

.field.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.field.split label {
  display: block;
}

.contact button {
  margin-top: 28px;
  border: 0;
  border-bottom: 1px solid var(--ink);
  background: none;
  color: var(--ink);
  padding: 8px 0;
  font-size: 11px;
  cursor: pointer;
  letter-spacing: 0.08em;
  transition: opacity 0.2s ease, color 0.6s ease, border-color 0.6s ease;
}

.contact button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#formMsg {
  font-size: 12px;
  margin-top: 16px;
  line-height: 1.5;
  min-height: 18px;
  transition: all 0.3s ease;
}

#formMsg.loading {
  color: var(--muted);
}

#formMsg.success {
  color: #2e7d32;
  font-weight: 500;
}

#formMsg.error {
  color: #d32f2f;
  font-weight: 500;
}

/* FOOTER */
footer {
  background: transparent;
  color: inherit;
  padding: 70px 28px 50px;
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr auto;
  gap: 36px;
  font-size: 11px;
  border-top: 1px solid var(--line);
  transition: border-color 0.6s ease, color 0.6s ease;
}

.footer-brand {
  font-size: 18px;
  color: var(--ink);
  font-weight: 600;
}

footer p {
  margin: 0 0 5px;
  color: var(--muted);
}

.footer-copy {
  align-self: end;
  color: var(--muted);
}

.mobile-contact {
  display: none;
}

/* 반응형 모바일 스타일 */
@media (max-width: 900px) {
  .topbar nav, .project-link {
    display: none;
  }
  .editorial-hero {
    min-height: 720px;
  }
  .hero-copy {
    display: block;
    bottom: 110px;
  }
  .hero-meta {
    width: auto;
    margin-top: 28px;
  }
  .hero-copy h1 {
    font-size: 15vw;
  }
  .project-info {
    grid-template-columns: 1fr;
  }
  .project-pair {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .project.offset {
    margin-top: 0;
  }
  .director, .approach-grid, .risk-intro, .contact {
    grid-template-columns: 1fr;
  }
  .director-image img {
    height: 480px;
  }
  .director-copy {
    padding: 70px 28px;
  }
  .fixed-bg-inner {
    padding: 90px 24px;
  }
  .risk-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .process-header {
    justify-content: flex-start;
  }
  .process li {
    grid-template-columns: 50px 1fr;
  }
  .process li p {
    grid-column: 2;
    margin-top: 4px;
  }
  .archive-grid {
    grid-template-columns: 1fr;
  }
  footer {
    grid-template-columns: 1fr;
  }
  .mobile-contact {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 120;
    display: grid;
    grid-template-columns: 1fr 1.5fr;
  }
  .mobile-contact a {
    padding: 15px;
    text-align: center;
    background: #eee;
    font-size: 11px;
    color: #151515;
  }
  .mobile-contact a:last-child {
    background: #111;
    color: white;
  }
  body {
    padding-bottom: 48px;
  }

  /* 모바일 브라우저의 background-attachment fixed 버그 방지 최적화 */
  @supports (-webkit-touch-callout: none) {
    .fixed-bg-section {
      background-attachment: scroll;
    }
  }
}
