/* ---------- Base ---------- */
:root {
  --sans: "Helvetica Neue", Helvetica, Arial, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --serif: "Crimson Text", "Noto Serif KR", Georgia, serif;
  --ink: #000;
  --accent: blue;
  --paper: #fff;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  background: var(--paper);
  animation: fadein 0.7s;
}

@keyframes fadein {
  from { opacity: 0; }
  to { opacity: 1; }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 22px;
  letter-spacing: 0.02em;
  color: var(--ink);
  background: var(--paper);
  word-break: keep-all;
}

img { max-width: 100%; height: auto; display: block; }
p { margin: 11.25px 0 0; }

a:link,
a:visited,
a:active { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent); }

.serif { font-family: var(--serif); font-size: 16px; font-weight: 400; }
.italic, i, em { font-style: italic; }
.small { vertical-align: 2px; font-size: 70%; font-weight: 700; }
.small span + span { margin-left: 1.3em; }

/* ---------- Header ---------- */
.header {
  position: fixed;
  top: 20px;
  left: 20px;
  right: 20px;
  z-index: 105;
}

.header .name { font-size: 18px; padding-right: 15px; }
.header .phone { padding-right: 15px; }

.main-nav { list-style: none; margin: 0; padding: 0; }
.main-nav > li { display: inline-block; padding-right: 15px; cursor: pointer; }
.main-nav > li:hover,
.main-nav > li.open { color: var(--accent); }

.main-nav .categories ul {
  display: none;
  position: absolute;
  left: 0;
  list-style: none;
  padding: 0;
  margin: 0;
  z-index: 100;
}
.main-nav .categories.open ul { display: block; }
.main-nav .categories ul li { display: inline-block; padding-right: 15px; }
.main-nav .categories ul a {
  font-size: 10px;
  font-weight: 700;
  line-height: 22px;
  color: #0a0a0b;
}
.main-nav .categories ul a:hover,
.main-nav .categories ul a.current { color: var(--accent); }

.post-nav { font-size: 110%; }
.post-nav a { padding-right: 12px; }

/* ---------- Project list ---------- */
.site { margin: 150px 20px 100px; }

.project { margin-bottom: 25px; width: 500px; max-width: 100%; }
.project > a { display: block; }
.project > a:hover { opacity: 0.85; }

/* 대표 이미지: 데스크톱에서는 제목에 마우스를 올릴 때만 화면 중앙에 뜬다 */
.backimg img {
  display: none;
  position: fixed;
  inset: 0;
  margin: auto;
  width: 100%;
  max-width: 60%;
  max-height: 80vh;
  object-fit: contain;
  z-index: -1;
  pointer-events: none;
}
.project > a:hover + .backimg img { display: block; }

.empty { font-family: var(--serif); font-style: italic; font-size: 16px; }

/* ---------- Information overlay ---------- */
.about-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99;
  overflow-y: auto;
  padding: 90px 20px 100px 180px;
  background: var(--paper);
}
body.about-open .about-overlay { display: block; }
body.about-open #about-switch { color: var(--accent); }

.about-overlay .about-text,
.about-overlay .about-content { max-width: 1000px; width: 60vw; }
.about-overlay .about-text { padding-bottom: 44px; }
.about-overlay p {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 33px;
  margin: 0 0 8.5px;
}
.about-overlay h3 {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 14px;
  line-height: 22px;
  margin: 0;
}

/* ---------- Project detail ---------- */
.post { margin: 70px 20px 0; }
.gallery img { width: 100%; margin-bottom: 20px; }
.gallery img:last-child { margin-bottom: 0; }

.text { margin: 100px 0 0 8%; width: 700px; max-width: 92%; }
.text .content { margin-top: 50px; }
.text .content p { font-family: var(--serif); font-size: 16px; }

.related-title { margin-bottom: 25px; }

/* ---------- Tablet / mobile ---------- */
@media (max-width: 1349px) {
  .backimg img { max-width: 90%; }
}

@media (max-width: 939px) {
  .header { position: relative; top: 0; left: 0; right: 0; margin: 10px 3% 0; }
  .site { margin: 50px 3% 60px; }
  .post { margin: 50px 3% 0; }
  .project { width: 100%; margin-bottom: 10px; }

  /* 모바일에서는 목록 텍스트를 숨기고 이미지를 바로 보여준다 */
  .mobilehide { display: none !important; }
  .backimg img {
    display: block;
    position: static;
    width: 100%;
    max-width: 100%;
    max-height: none;
    pointer-events: auto;
  }

  .about-overlay { padding: 110px 3% 60px; }
  .about-overlay .about-text,
  .about-overlay .about-content { width: auto; }
  .about-overlay p { font-size: 19px; line-height: 29px; }

  .text { margin-left: 0; max-width: 100%; }
}

@media (max-width: 539px) {
  .header .phone { display: none; }
}
