/* Design:D 메인 화면 */

:root {
  --bg: #0a0909;
  --text: #fff;
  --tag: #555;
  --placeholder: #1a1a1a;
  /* 필터에 마우스를 올렸을 때만 보이는 알약 안쪽. 이 층만 작품 위에 멀티플라이된다. */
  --filter-pill: #555;
  /* 1440px 화면의 약 53px = 화면 폭의 약 3.7%(80px의 2/3). 좁은 화면에서는 최소 20px. */
  --side: max(20px, calc(100vw / 27));
  --header-offset: 110px;
  /* 필터를 지금 크기에서 같은 비율로 키우는 배율. 스크립트가 Conference 글자 끝에 맞춘다. */
  --filter-grow: 1.15;
  /* 맨 위 농도. 0부터 hold까지 이 농도를 유지한다. */
  --top-fade-top: 1;
  /* 맨 위 농도를 유지하는 길이. */
  --top-fade-hold: 5px;
  /* 위쪽 어두운 층의 높이. 예전 B+30px의 1/4. */
  --top-fade-h: 36px;
  /* 알약 버튼들의 가장 아래 경계. 스크립트가 다시 계산한다. */
  --top-fade-b: 46px;
  /* 상세 팝업. 뒤 페이지를 덮는 어두운 농도. */
  --work-dim: 0.75;
  --work-text: #0a0909;
  --detail-panel-bg: #ffffff;
  /* 알약 버튼 아래 끝(B)에서 흰 시트까지의 간격. */
  --detail-sheet-gap: 12px;
  /* 상세 시트 시작. B + 간격. B는 스크립트가 --top-fade-b로 다시 계산한다. */
  --detail-sheet-top: calc(var(--top-fade-b) + var(--detail-sheet-gap));
  /* 900px 이하에서 상세 이미지 폭. 넓은 화면은 5~8단 폭이다. */
  --detail-img-w: 70%;
  /* 상세 제목·부제 행간. */
  --detail-title-lh: 1.15;
  /* 상세 제목 크기. 700px 이하에서는 22px. */
  --work-title-size: 19px;
  /* 제목 글자 아래와 부제 글자 위 사이. */
  --detail-subtitle-gap: 6px;
  /* 좁은 화면에서 부제 아래와 첫 이미지 윗변 사이. */
  --detail-narrow-gap: 48px;
  /* 설명 행간. 글자 크기 × 이 값. */
  --detail-desc-lh: 1.7;
  /* 가로 슬라이드 칸 높이 ÷ 첫 세로 이미지의 화면 높이. 이미지 영역이 보이는 높이보다 길면 거기에 맞춘다. */
  --detail-slider-scale: 1;
  /* 가로 슬라이드에서 간격을 켰을 때 이미지(펼침면) 사이. */
  --detail-strip-gap: 12px;
  /* 상세 팝업이 열린 동안 로고 눈이 깜빡이는 간격. */
  --logo-blink-gap: 3s;
  /* 예전 위쪽 :D 축소. 팝업 로고는 하단 로고와 같은 크기를 쓴다. */
  --detail-logo-h: 1.2;
  /* 트림을 지원하지 않는 브라우저에서 제목 글자 윗선까지 끌어올리는 값. 스크립트가 다시 계산한다. */
  --detail-title-trim: 0px;
  /* 트림된 대문자 선보다 글자가 더 위로 나가는 길이. 보이는 윗선을 이미지에 맞춘다. */
  --detail-title-over: 0px;
  /* 10단 그리드. 시작은 Graphic 왼쪽, 끝은 메일 오른쪽. 스크립트가 다시 계산한다. */
  --detail-grid-x: 53px;
  --detail-col: 127px;
  --detail-gutter: 6px;
  --detail-grid-end: 1320px;
  --work-title-gap: 48px;
  --work-rule-color: rgba(10, 9, 9, 0.2);
  --work-rule-size: 1px;
  --work-meta-gap: 10px;
  /* 메타 글자. 14px에서 3px 줄인 값. */
  --work-meta-size: 11px;
  /* 메타 맨 위 글자 윗선. 제목과 같은 방식으로 스크립트가 다시 계산한다. */
  --detail-meta-trim: 0px;
  --detail-meta-over: 0px;
  /* 넓은 화면에서 메타 첫 글자를 설명 첫 줄까지 내리는 거리. */
  --detail-meta-shift: 0px;
  --work-after-meta: 56px;
  --work-body-size: 16px;
  --work-board-top: 62px;
  --work-board-bottom: 39px;
  --work-item-gap: 40px;
}

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

html,
body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

html {
  color-scheme: dark;
}

body {
  overflow: hidden;
  font-family: Pretendard, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  font-family: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.frame {
  width: calc(100% - (var(--side) * 2));
  margin-inline: auto;
}

/* 스크롤하면 맨 위가 어두워지는 층.
   필터·메일(z-index 31~32)보다 뒤, 작품보다 앞. 로고(40)보다 아래. */
.top-fade {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  height: var(--top-fade-h);
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(10, 9, 9, var(--top-fade-top)) 0,
    rgba(10, 9, 9, var(--top-fade-top)) var(--top-fade-hold),
    rgba(10, 9, 9, 0.70) calc(var(--top-fade-hold) + (var(--top-fade-h) - var(--top-fade-hold)) * 0.15),
    rgba(10, 9, 9, 0.50) calc(var(--top-fade-hold) + (var(--top-fade-h) - var(--top-fade-hold)) * 0.30),
    rgba(10, 9, 9, 0.33) calc(var(--top-fade-hold) + (var(--top-fade-h) - var(--top-fade-hold)) * 0.45),
    rgba(10, 9, 9, 0.20) calc(var(--top-fade-hold) + (var(--top-fade-h) - var(--top-fade-hold)) * 0.60),
    rgba(10, 9, 9, 0.10) calc(var(--top-fade-hold) + (var(--top-fade-h) - var(--top-fade-hold)) * 0.75),
    rgba(10, 9, 9, 0.04) calc(var(--top-fade-hold) + (var(--top-fade-h) - var(--top-fade-hold)) * 0.88),
    rgba(10, 9, 9, 0) calc(var(--top-fade-hold) + (var(--top-fade-h) - var(--top-fade-hold)))
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.top-fade.is-on {
  opacity: 1;
}

/* 상단 — 화면 위에 붙어 있다.
   position:fixed는 항상 새 층을 만들어서, 그 안에서는 멀티플라이가 작품까지 안 먹는다.
   그래서 헤더는 층을 만들지 않는 absolute로 두고, 작품 목록(main)만 스크롤한다. */
.header {
  position: absolute;
  top: 0;
  left: 0;
  /* 작품 목록의 스크롤바 칸만큼 안쪽으로. 그리드와 같은 폭이 된다. */
  right: var(--gutter, 0px);
  background: transparent;
  padding: 26px 0 18px;
  /* 빈 영역은 클릭이 카드로 통과. 필터와 메일만 받는다. */
  pointer-events: none;
}

.header-inner {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
  gap: calc(9px * 2 / 3 * var(--filter-grow));
  min-width: 0;
  pointer-events: auto;
}

.filter-end {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: calc(9px * 2 / 3 * var(--filter-grow));
  flex: none;
  min-width: 0;
}

.filters:not(.is-icon) .filter-end {
  flex: 1 1 auto;
  justify-content: space-between;
  gap: 24px;
}

.filter {
  position: relative;
  appearance: none;
  margin: 0;
  border: 0;
  border-radius: calc(999px * 2 / 3 * var(--filter-grow));
  background: transparent;
  color: #fff;
  font-weight: 600;
  font-size: calc(17px * 2 / 3 * var(--filter-grow));
  line-height: 1;
  padding: calc(7px * 2 / 3 * var(--filter-grow)) calc(13px * 2 / 3 * var(--filter-grow));
  cursor: pointer;
  pointer-events: auto;
  transition: color 0.15s ease;
}

.filter::before,
.filter::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.filter::before {
  z-index: 30;
  background: var(--filter-pill);
  mix-blend-mode: multiply;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.filter::after {
  z-index: 32;
  border: 0.75px solid #fff;
  /* 글자 바깥의 알약 영역도 이 층이 클릭을 받는다. 작품 카드보다 위. */
  pointer-events: auto;
}

.filter > span {
  position: relative;
  z-index: 31;
}

.filter:hover::before {
  opacity: 1;
}

.filter.is-on,
.filter.is-on:hover {
  color: #000;
}

.filter.is-on::before,
.filter.is-on:hover::before {
  background: #fff;
  mix-blend-mode: normal;
  opacity: 1;
}

.filter:focus {
  outline: none;
}

.filter:focus-visible {
  outline: 1px solid #fff;
  outline-offset: 2px;
}

.email {
  position: relative;
  z-index: 31;
  display: block;
  flex: none;
  color: #fff;
  font-weight: 400;
  font-size: calc(17px * 2 / 3 * var(--filter-grow));
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  pointer-events: auto;
}

.email-text {
  white-space: nowrap;
}

.email-mark {
  display: none;
  box-sizing: border-box;
  width: var(--email-mark, 28px);
  height: var(--email-mark, 28px);
  border: 0.75px solid #fff;
  border-radius: 50%;
  place-items: center;
}

.email-mark svg {
  width: 62%;
  height: 62%;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.email.is-icon .email-text {
  position: absolute;
  width: max-content;
  visibility: hidden;
  pointer-events: none;
}

.email.is-icon .email-mark {
  display: grid;
}

.email:hover {
  opacity: 0.72;
}

.email:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.kakao {
  display: none;
}

/* 작품 그리드
   열마다 세로로 쌓습니다. 칸 위치는 script.js가 정합니다.
   넓은 화면 4열, 900px 이하 2열, 700px 이하 1열. 열 간격 20px, 같은 열의 카드 간격 17px. */

main {
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  /* 스크롤은 이 영역에서 생긴다. 칸을 미리 비워 두어야 스크롤바가 사라져도 폭이 그대로다. */
  scrollbar-gutter: stable;
  padding-top: var(--header-offset);
  padding-bottom: 170px;
}

.grid {
  position: relative;
}

.card {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  min-width: 0;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 4px;
  color: var(--tag);
  font-weight: 300;
  font-size: 12px;
  line-height: 1.2;
}

.card-media {
  position: relative;
  display: block;
  width: 100%;
  background: var(--placeholder);
  overflow: hidden;
}

.card-media img,
.card-media video,
.card-shade,
.card-client {
  position: absolute;
  pointer-events: none;
}

.card-media img,
.card-media video {
  inset: 0;
  width: 100%;
  height: 100%;
}

.card-media img {
  object-fit: contain;
}

.card-media .card-hover-gif {
  object-fit: cover;
  opacity: 0;
}

.card-media video {
  object-fit: contain;
  background: transparent;
  opacity: 0;
}

.card.is-playing video,
.card.is-playing .card-hover-gif {
  opacity: 1;
}

.card-shade {
  left: 0;
  right: 0;
  bottom: 0;
  height: 62%;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.9) 0%,
    rgba(0, 0, 0, 0.5) 42%,
    rgba(0, 0, 0, 0) 100%
  );
  opacity: 0;
  transition: opacity 0.25s ease;
}

.card-client {
  left: 19px;
  right: 16px;
  bottom: 15px;
  color: #fff;
  font-weight: 300;
  font-size: 13px;
  line-height: 1.25;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.card:hover .card-shade,
.card:focus-within .card-shade,
.card:hover .card-client,
.card:focus-within .card-client {
  opacity: 1;
}

.card-hit {
  position: absolute;
  inset: 0;
  z-index: 2;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.card-hit:focus {
  outline: none;
}

.card-hit:focus-visible {
  outline: 1px solid #fff;
  outline-offset: 4px;
}

/* 로고
   화면 아래 가운데에 고정되고, 작품 위를 지나면 색이 반전됩니다.
   글자만 카카오톡 링크이고, 로고 칸의 빈 자리는 클릭이 통과합니다. */

.logo {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 24px;
  z-index: 40;
  height: 1.25em;
  pointer-events: none;
  user-select: none;
  mix-blend-mode: difference;
  color: #fff;
  font-family: Lexend, sans-serif;
  font-weight: 700;
  font-size: calc(98px * 2 / 3);
  line-height: 1.25;
  letter-spacing: -0.05em;
  visibility: hidden;
  transform-origin: 50% 50%;
  opacity: 1;
}

.logo.is-detail {
  transform: translateX(var(--detail-logo-x, 0px));
}

.logo.is-ready {
  visibility: visible;
}

.logo-measure {
  position: absolute;
  visibility: hidden;
  white-space: nowrap;
}

.logo-anchor {
  position: absolute;
  top: 0;
  left: 50%;
  white-space: nowrap;
  pointer-events: auto;
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.logo-anchor:focus {
  outline: none;
}

.logo-anchor:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 4px;
}

.logo-face,
.logo-colon,
.logo-d,
.logo-design {
  line-height: 1.25;
}

.logo-face {
  display: inline-block;
  vertical-align: top;
}

.logo-colon,
.logo-d {
  display: inline-block;
  vertical-align: top;
}

.logo-colon {
  transform-origin: center center;
}

.logo-design-clip {
  position: absolute;
  top: 0;
  right: 100%;
  height: 100%;
  overflow: hidden;
}

.logo-design {
  display: block;
  white-space: nowrap;
}

/* 작품 상세. 시트는 필터 아래(B+간격)에서 올라오고, 그 위는 어두워진 뒤 페이지가 비친다. */
.work-dim {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(10, 9, 9, var(--work-dim));
}

.work-sheet {
  position: fixed;
  z-index: 26;
  top: var(--detail-sheet-top);
  right: 0;
  bottom: 0;
  left: 0;
  background: #fff;
  color: var(--work-text);
  transform: translateY(100%);
  transition: transform 0.4s ease;
  overflow: hidden;
}

.work-layer.is-open .work-sheet {
  transform: translateY(0);
}

.work-pin,
.work-snap-top {
  display: none;
}

.work-title-col,
.work-meta-col {
  position: absolute;
  top: var(--work-board-top);
  bottom: 24px;
  overflow: hidden;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.work-title-col.is-scroll {
  overflow-x: hidden;
  overflow-y: auto;
}

.work-title-col::-webkit-scrollbar,
.work-meta-col::-webkit-scrollbar {
  display: none;
}

.work-title-col {
  left: calc(var(--detail-grid-x) + var(--detail-col) + var(--detail-gutter));
  width: calc(3 * var(--detail-col) + 2 * var(--detail-gutter));
}

.work-meta-col {
  left: var(--detail-grid-x);
  width: var(--detail-col);
  padding-top: var(--detail-meta-shift);
}

.work-head {
  margin: 0 0 var(--work-title-gap);
}

.work-rule,
.work-body {
  width: 100%;
  max-width: none;
}

.work-title,
.work-subtitle {
  /* 2단 시작~4단 끝. 단이 겹치면 이미지(5단) 앞에서 멈춘다. */
  width: min(
    calc(3 * var(--detail-col) + 2 * var(--detail-gutter)),
    calc(3 * var(--detail-col) + 3 * var(--detail-gutter))
  );
  max-width: none;
  white-space: pre-line;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.work-title {
  margin: 0;
  font-size: var(--work-title-size);
  font-weight: 700;
  line-height: var(--detail-title-lh);
  text-box-trim: trim-start;
  text-box-edge: cap alphabetic;
  margin-top: var(--detail-title-trim);
}

@supports (text-box-trim: trim-both) {
  .work-title {
    margin-top: var(--detail-title-over);
  }
}

.work-subtitle {
  margin: var(--detail-subtitle-gap) 0 0;
  font-size: 19px;
  font-weight: 400;
  line-height: var(--detail-title-lh);
}

.work-body {
  width: var(--work-body-width, calc(2.5 * var(--detail-col) + 2 * var(--detail-gutter)));
}

@media (min-width: 901px) {
  :root {
    --work-body-size: 14px;
    --detail-desc-lh: 1.6;
  }
}

.work-meta-group + .work-meta-group {
  margin-top: calc(var(--work-meta-gap) + var(--work-rule-size) + var(--work-meta-gap));
}

.work-rule {
  height: var(--work-rule-size);
  background: var(--work-rule-color);
}

.work-meta-label,
.work-meta-value {
  margin: 0;
  font-size: var(--work-meta-size);
  font-weight: 400;
  line-height: 1.4;
  overflow-wrap: break-word;
}

.work-meta-label {
  font-weight: 500;
}

.work-meta-col > .work-meta-group:first-child .work-meta-label {
  text-box-trim: trim-start;
  text-box-edge: cap alphabetic;
  margin-top: var(--detail-meta-trim);
}

@supports (text-box-trim: trim-both) {
  .work-meta-col > .work-meta-group:first-child .work-meta-label {
    margin-top: var(--detail-meta-over);
  }
}

.work-body p {
  margin: 0;
  min-height: calc(1em * var(--detail-desc-lh));
  font-size: var(--work-body-size);
  font-weight: 400;
  line-height: var(--detail-desc-lh);
  word-break: keep-all;
  overflow-wrap: break-word;
}

.work-board {
  position: absolute;
  top: var(--work-board-top);
  bottom: 0;
  left: calc(var(--detail-grid-x) + 4 * (var(--detail-col) + var(--detail-gutter)));
  width: calc(4 * var(--detail-col) + 3 * var(--detail-gutter) + 20px + 32px);
  padding-right: calc(20px + 32px);
  background: var(--detail-panel-bg);
  overflow-x: hidden;
  overflow-y: auto;
  overflow-anchor: none;
  overscroll-behavior: contain;
  scrollbar-width: none;
  scroll-snap-type: y proximity;
  scroll-padding-top: 0;
}

.work-board::-webkit-scrollbar {
  display: none;
}

.work-board-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--work-item-gap);
  /* 끝까지 내리면 마지막 이미지 아래 끝이 X 버튼 아래 끝과 같다.
     그 아래는 X 아래 끝에서 화면 아래 끝까지의 거리. */
  padding-bottom: var(--work-board-bottom);
}

.work-photo {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.leaflet-scroll {
  width: 100%;
  height: calc(var(--leaflet-scroll, 200vh) + var(--leaflet-paper, 0px));
}

/* 스크롤 자리는 이미지 칸에 두고, 그림만 시트 위로 꺼내 1~10단에 맞춘다.
   닫기 버튼(z-index 1)보다 아래. 필터·로고는 시트 밖이라 이 층보다 위. */
.leaflet-port {
  position: fixed;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.leaflet-stage {
  position: absolute;
  pointer-events: none;
}

.leaflet-fit {
  position: relative;
  flex: none;
  pointer-events: none;
}

.leaflet-sticky {
  position: sticky;
  top: var(--leaflet-pin, 0px);
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--leaflet-paper, auto);
}

.leaflet-scene {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 2400px;
  perspective-origin: 50% 50%;
  pointer-events: none;
}

.leaflet-book {
  position: relative;
  flex: none;
  width: 100%;
  aspect-ratio: var(--leaflet-aspect, 596 / 210);
  transform-style: preserve-3d;
}

.leaflet-half,
.leaflet-panel,
.leaflet-face {
  position: absolute;
  transform-style: preserve-3d;
}

.leaflet-half,
.leaflet-panel {
  top: 0;
  height: 100%;
}

.leaflet-panel {
  pointer-events: auto;
}

.leaflet-half-left,
.leaflet-p1 {
  transform-origin: right center;
}

.leaflet-half-right,
.leaflet-p4 {
  transform-origin: left center;
}

.leaflet-face {
  inset: 0;
  background-color: #f3f1ee;
  background-repeat: no-repeat;
  backface-visibility: hidden;
}

.leaflet-back {
  transform: rotateY(180deg);
}

.leaflet-shade {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transform: translateZ(0.5px);
  backface-visibility: hidden;
}

.leaflet-flat {
  display: none;
  width: 100%;
}

.leaflet-flat-photo {
  display: block;
  width: 100%;
  height: auto;
}

@media (prefers-reduced-motion: reduce) {
  .leaflet-scroll {
    height: auto;
  }

  .leaflet-sticky {
    position: static;
    display: block;
    height: auto;
  }

  .leaflet-scene {
    display: none;
  }

  .leaflet-flat {
    display: flex;
    flex-direction: column;
    gap: var(--work-item-gap);
  }
}

.work-slide {
  position: relative;
  width: 100%;
  scroll-snap-align: start;
}

.work-slide-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y;
}

.work-slide-frame.is-dragging {
  cursor: grabbing;
}

.work-slide-track {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: stretch;
  height: 100%;
  gap: 0;
}

.work-slide[data-strip-gap='1'] .work-slide-track {
  gap: var(--detail-strip-gap);
}

.work-slide-photo {
  display: block;
  flex: none;
  width: auto;
  height: 100%;
  max-width: none;
  margin: 0;
  border: 0;
  box-shadow: none;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.work-slide-next[hidden],
.work-slide-prev[hidden] {
  display: none;
}

.work-slide-next,
.work-slide-prev,
.work-close {
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 1px solid var(--work-text);
  background: #fff;
  color: var(--work-text);
  cursor: pointer;
}

.work-slide-next,
.work-slide-prev {
  background: rgba(60, 60, 60, 0.55);
  color: #e6e6e6;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.slide-controls {
  position: fixed;
  z-index: 1;
  inset: 0;
  pointer-events: none;
}

.work-slide-next,
.work-slide-prev {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  pointer-events: auto;
}

.work-slide-prev {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.work-slide-prev.is-on {
  opacity: 1;
  pointer-events: auto;
}

.work-slide-next.is-out,
.work-slide-prev.is-out {
  visibility: hidden;
  pointer-events: none;
}

.work-close {
  position: absolute;
  left: calc(var(--detail-grid-end) - 32px);
  bottom: var(--work-board-bottom);
  z-index: 1;
  width: 32px;
  height: 32px;
}

.work-close svg,
.work-slide-next svg,
.work-slide-prev svg {
  display: block;
  width: 16px;
  height: 16px;
}

.work-close path,
.work-slide-next path,
.work-slide-prev path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.work-close:focus,
.work-slide-next:focus,
.work-slide-prev:focus {
  outline: none;
}

.work-close:focus-visible,
.work-slide-next:focus-visible,
.work-slide-prev:focus-visible {
  outline: 1px solid var(--work-text);
  outline-offset: 3px;
}

body.is-work-open .top-fade {
  visibility: hidden;
}

body.is-work-open main {
  overflow: hidden;
}

@media (max-width: 900px) {
  .frame {
    width: calc(100% - 40px);
  }

  main {
    padding-bottom: 120px;
  }

  :root {
    --filter-grow: 1;
  }

  .work-photo,
  .work-slide {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .work-slide-photo {
    width: auto;
    height: 100%;
    margin: 0;
  }

  .logo {
    font-size: clamp(40px, 13vw, 64px);
  }

  .work-sheet {
    scroll-snap-type: y proximity;
    scroll-padding-top: 0;
    display: grid;
    grid-template-columns:
      var(--detail-grid-x)
      var(--detail-col)
      var(--detail-gutter)
      max(0px, calc(var(--detail-grid-end) - var(--detail-grid-x) - var(--detail-col) - var(--detail-gutter)));
    justify-content: start;
    align-content: start;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
  }

  .work-sheet::-webkit-scrollbar,
  .work-sheet *::-webkit-scrollbar {
    display: none;
  }

  .work-sheet * {
    scrollbar-width: none;
  }

  .work-copy,
  .work-title-col {
    display: contents;
  }

  .work-head {
    grid-column: 4;
    grid-row: 1;
    align-self: start;
    width: 100%;
    margin: 56px 0 var(--detail-narrow-gap);
  }

  .work-meta-col {
    display: flow-root;
    position: static;
    top: auto;
    bottom: auto;
    left: auto;
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    width: 100%;
    margin: 0;
    padding-top: 0;
    overflow: visible;
  }

  .work-body {
    grid-column: 4;
    grid-row: 3;
    align-self: start;
    width: 100%;
    max-width: none;
  }

  .work-title {
    margin-top: 0;
    text-box-trim: none;
  }

  .work-title,
  .work-subtitle,
  .work-rule {
    width: 100%;
    max-width: none;
  }

  .work-board {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    grid-column: 4;
    grid-row: 2;
    align-self: start;
    width: 100%;
    margin: 0;
    padding-right: 0;
    overflow: visible;
  }

  .work-board-inner {
    padding-bottom: var(--work-item-gap);
  }

  .work-close {
    top: 12px;
    right: auto;
    bottom: auto;
    left: calc(var(--detail-grid-end) - 32px);
  }
}

@media (max-width: 700px) {
  /* fixed는 쌓임 맥락을 만들어 difference가 작품까지 닿지 못한다.
     페이지 스크롤은 main만 하므로 absolute도 화면 위에 붙어 있는다. */
  .header {
    position: absolute;
    z-index: auto;
    top: 0;
    left: 0;
    right: 0;
    isolation: auto;
    background: transparent;
    pointer-events: none;
    padding-bottom: 12px;
    overflow: visible;
  }

  .header-inner {
    width: auto;
    max-width: none;
  }

  .filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    column-gap: calc(9px * 2 / 3 * var(--filter-grow));
    row-gap: calc(9px * 2 / 3 * var(--filter-grow) * 0.66);
    isolation: auto;
  }

  .filters .filter-end,
  .filters:not(.is-icon) .filter-end {
    display: contents;
  }

  .filter {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: calc(1.3 * ((17px + 14px) * 2 / 3 * var(--filter-grow)));
    position: relative;
    z-index: 30;
    background: rgba(60, 60, 60, 0.55);
    color: #e6e6e6;
    mix-blend-mode: normal;
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    white-space: nowrap;
    text-align: center;
  }

  .filter::before,
  .filter:hover::before {
    content: none;
    background: none;
    mix-blend-mode: normal;
    opacity: 0;
  }

  .filter::after {
    border: 0;
  }

  .filter > span {
    display: block;
    z-index: auto;
    max-width: 100%;
    color: #e6e6e6;
    white-space: nowrap;
    text-align: center;
  }

  .card:hover .card-shade,
  .card:focus-within .card-shade,
  .card:hover .card-client,
  .card:focus-within .card-client {
    opacity: 0;
  }

  .email {
    display: none;
  }

  .kakao {
    position: fixed;
    z-index: 45;
    right: 20px;
    bottom: 20px;
    display: grid;
    place-items: center;
    box-sizing: border-box;
    width: var(--email-mark, 28px);
    height: var(--email-mark, 28px);
    border: 0.75px solid #fff;
    border-radius: 50%;
    background: #0a0909;
    color: #fff;
    pointer-events: auto;
    text-decoration: none;
  }

  .kakao svg {
    width: 62%;
    height: 62%;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  body.is-work-open .kakao {
    visibility: hidden;
    pointer-events: none;
  }

  .work-sheet {
    top: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    grid-template-columns: minmax(0, 1fr);
    padding-left: 20px;
    padding-right: 20px;
    scroll-snap-type: none;
  }

  .work-sheet .work-copy,
  .work-sheet .work-title-col {
    display: block;
    position: static;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: 100%;
    height: auto;
    overflow: visible;
  }

  .work-sheet .work-copy {
    position: relative;
    z-index: 1;
  }

  .work-snap-top,
  .work-sheet .work-copy,
  .work-sheet .work-board {
    flex: none;
  }

  .work-snap-top {
    display: block;
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    scroll-snap-align: none;
    scroll-snap-stop: normal;
    scroll-margin: 0;
  }

  .work-photo,
  .work-slide,
  .work-body,
  .leaflet-scroll {
    scroll-snap-align: none;
    scroll-snap-stop: normal;
    scroll-margin: 0;
  }

  .leaflet-port,
  .leaflet-port * {
    pointer-events: none;
  }

  .work-board,
  .work-body {
    grid-column: 1;
    width: 100%;
    max-width: none;
    margin: 0;
  }

  .work-body {
    grid-row: 2;
  }

  .work-board {
    grid-row: 3;
  }

  .work-sheet .work-body {
    position: relative;
    z-index: 1;
  }

  .work-sheet .work-board {
    position: relative;
    top: auto;
    z-index: 0;
  }

  .work-sheet .work-body,
  .work-sheet .work-body p {
    font-size: var(--work-meta-size);
    line-height: 1.5;
    min-height: 0;
  }

  .leaflet-port,
  .leaflet-scroll,
  .leaflet-scroll * {
    pointer-events: none;
  }

  :root {
    --work-title-size: 22px;
  }

  .work-title {
    font-weight: 700;
  }

  .leaflet-port {
    display: none;
  }

  .work-layer.is-open .work-pin {
    display: block;
    position: fixed;
    top: 20px;
    left: 20px;
    right: auto;
    z-index: 27;
    width: fit-content;
    max-width: 70%;
    pointer-events: none;
    mix-blend-mode: difference;
    color: #fff;
  }

  .work-pin .work-head,
  .work-pin .work-meta-col {
    position: static;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: fit-content;
    max-width: 70vw;
    height: auto;
    margin: 0;
    padding: 0;
    overflow: visible;
    color: inherit;
    mix-blend-mode: normal;
    grid-column: auto;
    grid-row: auto;
  }

  .work-pin .work-meta-col {
    margin-top: 20px;
  }

  .work-pin .work-title,
  .work-pin .work-subtitle {
    width: auto;
    max-width: 70vw;
  }

  .work-close {
    display: none;
  }

  body.is-work-open .header {
    visibility: hidden;
  }

  body.is-work-open .logo,
  body.is-work-open .logo.is-detail {
    position: fixed;
    bottom: 20px;
  }

  .filters .filter.is-on,
  .filters .filter.is-on:hover {
    background: #fff;
    color: #000;
    mix-blend-mode: normal;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .filters .filter.is-on > span,
  .filters .filter.is-on:hover > span {
    color: #000;
  }
}

@media (prefers-reduced-motion: reduce) {
  .filter,
  .filter::before,
  .top-fade,
  .card-shade,
  .card-client,
  .work-sheet,
  .logo {
    transition: none;
  }
}
