/* MTS Gothic Webfont — woff2 파일을 이 CSS와 같은 폴더에 넣으세요 */
@font-face {
  font-family: "MTS Gothic";
  src: url("./fonts/MTSGothic-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "MTS Gothic";
  src: url("./fonts/MTSGothic-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --ink: #333333;
  --gray: #c9c9c9; /* 비활성 필터 */
  --gray-soft: #8a8a8a;
  --line: #333333;
  --media-bg: #d9d9d9;
  --pad: clamp(24px, 2vw, 30px); /* 좌우 여백 */
  --marq-gap: 200px; /* 제목이 다시 나올 때의 간격 */
  --sans: "MTS Gothic", "Apple SD Gothic Neo", sans-serif;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- header ---------- */
header {
  padding: 30px var(--pad) 0;
}
h1 {
  font-weight: 400;
  font-size: clamp(64px, 6vw, 80px);
  line-height: 1;
  margin-bottom: 12px;
  letter-spacing: -0.03em;
}
.subtitle {
  font-size: clamp(20px, 1.1vw, 24px);
  font-weight: 400;
}
.device-note {
  display: none;
  margin-top: 18px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--gray-soft);
  background: #f4f4f4;
  border-radius: 10px;
  padding: 13px 16px;
  text-align: center;
}
@media (max-width: 768px) {
  .device-note {
    display: block;
  }
}
img.logo-cover {
  width: 94px;
  position: absolute;
  top: 16px;
  right: 24px;
}
/* ---------- filter : 우측 정렬 대형 텍스트 ---------- */
.filter {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 30px;
  padding: 18px var(--pad) 12px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 5;
  margin-top: 120px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.filter.stuck {
  border-bottom-color: var(--line);
}
.filter button {
  font-family: var(--sans);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-weight: 400;
  font-size: clamp(64px, 6vw, 80px);
  line-height: 1.1;
  color: var(--gray);
  transition: color 0.18s ease;
  letter-spacing: -0.03em;
}
.filter button:hover {
  color: var(--ink);
}
.filter button.on {
  color: var(--ink);
}

/* ---------- class intro (필터 호버 시 팝업) ---------- */
#class-intro {
  position: absolute;
  top: calc(100% + 1px);
  right: var(--pad);
  width: min(650px, 70vw);
  z-index: 6;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.25s ease,
    visibility 0.25s;
  pointer-events: none;
}
#class-intro p {
  font-size: clamp(20px, 1.1vw, 24px);
  line-height: 1.5;
  padding: 20px 24px;
  margin: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  word-break: keep-all;
  overflow-wrap: anywhere;
}
#class-intro.show {
  opacity: 1;
  visibility: visible;
}

/* ---------- accordion ---------- */
#list {
  border-top: 1px solid var(--line);
  margin-bottom: 30px;
}
.row {
  border-bottom: 1px solid var(--line);
}
.row.hidden {
  display: none;
}

/* 제목은 화면 왼쪽 끝까지 뻗고, 여백이 아닌 화면 가장자리에서 잘립니다 */
.row-head {
  width: 100%;
  display: grid;
  cursor: pointer;
  text-align: left;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  background: none;
  border: none;
  font-family: var(--sans);
  color: var(--ink);
  padding: 20px 0 8px;
}

.work-title {
  font-weight: 400;
  font-size: clamp(64px, 6vw, 80px);
  line-height: 1.15;
  overflow: hidden;
  white-space: nowrap;
  min-width: 0;
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 93%, transparent);
  mask-image: linear-gradient(90deg, #000 0, #000 93%, transparent);
  letter-spacing: -0.03em;
}
.work-title .track {
  display: inline-block;
  padding-left: var(--pad); /* 정지 상태에서는 본문 여백에 맞춰 시작 */
  will-change: transform;
}
/* 넘치는 제목: 호버 시 왼쪽으로 흐르고, 200px 간격을 두고 뒤따라 다시 들어오는 루프.
   길이마다 속도를 일정하게 맞추기 위해 JS(Web Animations API)로 제어합니다. */
.work-title .txt {
  padding-right: var(--marq-gap);
}

.toggle-icon {
  position: relative;
  display: inline-block;
  flex: none;
  width: clamp(16px, 1.6vw, 24px);
  height: clamp(16px, 1.6vw, 24px);
  margin-right: var(--pad);
  transition: transform 0.25s ease;
  margin-top: -8px;
}
.toggle-icon::before,
.toggle-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: currentColor;
  transform: translate(-50%, -50%);
}
.toggle-icon::before {
  width: 100%;
  height: 1.5px;
} /* 가로획 */
.toggle-icon::after {
  width: 1.5px;
  height: 100%;
} /* 세로획 */
.row.open .toggle-icon {
  transform: rotate(45deg);
}

.panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s ease;
}
.panel > div {
  overflow: hidden;
}
.row.open .panel {
  grid-template-rows: 1fr;
}
.row.open .row-head {
  border-bottom: 1px solid var(--line);
}
.panel-inner {
  padding: 6px var(--pad) 44px;
  display: grid;
  grid-template-columns: minmax(200px, 400px) 1fr; /* .meta와 동일한 컬럼 */
  column-gap: 30px;
}

/* 이름·카테고리 / 소개문 2단 ---------- */
.meta {
  display: contents; /* 자식(.who, .desc)을 바깥 그리드에 직접 배치 */
  font-size: clamp(20px, 1.1vw, 24px);
  line-height: 1.5;
}
.meta .who span {
  display: block;
}
.meta .who {
  grid-column: 1;
  margin: 10px 0 28px;
}
.meta .desc {
  grid-column: 2;
  margin: 10px 0 28px;
  max-width: none;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.media {
  grid-column: 2;
}
.visit {
  grid-column: 2;
  justify-self: start;
}
.media {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 14px;
  overflow: hidden;
  background: var(--media-bg);
  border: 1px solid #efefef;
}
.media iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
/* 웹 결과물 미리보기: 내부 스크롤·조작을 막는다(마우스 이벤트 통과) */
.media iframe.site {
  pointer-events: none;
  background: #fff;
}
/* iframe 위를 덮는 투명 링크 → 클릭하면 새 탭으로 원본 사이트 열기 */
.media .frame-link {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  cursor: pointer;
}
.media .fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--gray-soft);
  text-align: center;
  padding: 20px;
}
.media .shot {
  position: absolute;
  inset: 0;
  display: block;
  cursor: pointer;
}
.media .shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: opacity 0.25s ease;
}
.media .shot:hover img {
  opacity: 0.85;
}
.meta .who a {
  color: inherit;
  text-decoration: none;
}

footer {
  padding: 0 var(--pad) 80px;
  font-size: clamp(20px, 1.1vw, 24px);
  font-weight: 300;
  text-align: right;
}
.dh-devide {
  display: none;
}
@media (max-width: 768px) {
  .meta {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  img.logo-cover {
    width: 36px;
    position: absolute;
    top: 24px;
    right: 24px;
  }
  h1 {
    font-weight: 400;
    font-size: 32px;
    line-height: 1.3;
    margin-bottom: 12px;
    letter-spacing: -0.03em;
  }
  .subtitle {
    font-size: 16px;
    font-weight: 400;
  }
  .dh-devide {
    display: block;
  }
  .filter {
    display: flex;
    justify-content: flex-end;
    align-items: baseline;
    gap: 12px;
    padding: 18px var(--pad) 12px;
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 5;
    margin-top: 20px;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
  }
  .filter button {
    font-family: var(--sans);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-weight: 400;
    font-size: 32px;
    line-height: 1.1;
    color: var(--gray);
    transition: color 0.18s ease;
    letter-spacing: -0.03em;
  }
  .work-title {
    font-weight: 400;
    font-size: 32px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .panel,
  .toggle-icon,
  #class-intro {
    transition: none;
  }
}
