* {
  box-sizing: border-box;
  font-family: "HN", "Pretendard", Arial, sans-serif;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #030305;
  color: #fff;
}

/* INTRO — Work Index #ov 문법 그대로: 상태는 클래스, 타이밍은 CSS, 순서는 컨트롤러 */
#ov {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: #05060a;
  font-family: "HN", "Pretendard", Arial, sans-serif;
  font-weight: 500; /* 화면 가운데의 선언과 제목은 65 Medium(Work Index · About 과 같은 규칙) */
  color: #fff;
  transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#ov.out {
  opacity: 0;
  pointer-events: none;
}

/* 배양 = 로딩 — 공통 파일 culture.js 가 #ov 안에 그린다(세 문장 뒤에서 흰 세포와 겹치는 글자가 반전되게) */
#t2 .dx {
  mix-blend-mode: difference;
}

/* 흰 세포와 겹치는 글자는 검게 반전된다(AI 강조색은 반전하지 않는다) */
#ov .st {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

#ov .st.on {
  opacity: 1;
  transition: opacity 0.8s ease 0.4s;
}

/* 타이틀 한 줄 */
/* 큰 제목 규칙(Work Index 장 제목 · About 큰 선언과 같다): 48px · 65 Medium · 자간 0.06em. 좁은 화면은 폭에 맞춰 줄어든다 */
#t1 h1 {
  margin: 0;
  font: inherit;
  font-weight: 500;
  font-size: min(48px, 4.4vw);
  font-size: round(down, min(48px, 4.4vw), 2px); /* 정수(짝수) px — 행간 1.5배도 정수가 된다 */
  line-height: 1.5;
  letter-spacing: 0.06em;
  word-spacing: 0;
  white-space: nowrap;
}

/* 세 문장 */
#t2 .ls {
  text-align: center;
  padding: 0 7vw;
}

/* 세 문장 규칙(Work Index 세 문장 · About 본문 선언과 같다): 24px · 65 Medium · 행간 48px · 자간 0.012em · 낱말 간격 0.2em.
   읽는 속도로 차오른다 — 세 줄이 회색(#5a5955)으로 함께 나타나고, 한 줄에 1.2초씩 왼쪽에서 오른쪽으로 흰색이 된다.
   민트 낱말(AI)은 처음부터 민트. 한 줄이 "글 · 민트 · 글" 조각으로 나뉘어 있어, 조각마다 차는 시간(--dur)과 시작(--del)을
   index.html 의 스크립트가 폭에 맞춰 넣는다(한 줄이 한 호흡으로 이어져 보이게).
   흰 세포와 겹치면 지금처럼 뒤집힌다: 읽힌 글자는 검정, 아직 안 읽힌 글자는 옅은 회색 */
#t2 i {
  display: block;
  font-style: normal;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0.012em;
  word-spacing: 0.2em;
  line-height: 48px;
  opacity: 0;
  transition: opacity 0.5s ease 0s;
}

#t2[lang="ko"] i {
  letter-spacing: 0;
  word-spacing: normal; /* 한글은 낱말 간격을 벌리지 않는다 */
}

#t2.on i {
  opacity: 1;
  transition: opacity 0.5s ease 0s; /* 세 줄이 차례로 뜨지 않고 함께 나타난다(차오르는 것이 순서를 알린다) */
}

#t2 .tint {
  color: #7fd4c8; /* 처음부터 민트 */
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  #t2.on .rd {
    /* 그림 폭 206%: 왼쪽 100%는 흰색, 오른쪽 100%는 회색, 그 사이 6%가 좁은 경계 */
    background: linear-gradient(90deg, #fff 48.54%, var(--unread, #363532) 51.46%) 100% 0 / 206% 100% no-repeat;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    -webkit-box-decoration-break: slice;
    box-decoration-break: slice;
    padding: 0.3em 0; /* 색은 글자 상자 안에만 칠해진다 — 글자 윗부분이 잘리지 않게 상자를 위아래로 넓힌다 */
    animation: mainRead var(--dur, 1.2s) linear var(--del, 1s) both;
  }
}

@keyframes mainRead {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: 0 0;
  }
}

/* 하단 한 줄 — 작은 이탤릭 세리프 */
#t2 .note {
  margin-top: 34px;
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 400;
  font-size: 17px;
  letter-spacing: 0.01em;
  color: #5a5955;
  opacity: 0;
  transition: opacity 0.5s ease 0s;
}

#t2.on .note {
  opacity: 1;
  transition: opacity 1s ease 1.7s;
}

/* 하단 힌트 자리 = 로딩바. 로딩이 끝나면 SCROLL */
#ovh {
  position: fixed;
  left: 50%;
  bottom: calc(30px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 21;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-weight: 400; /* 푸터와 같다: 55 Roman 12px · 자간 0.01em · 사이트 공통 회색 */
  font-size: 12px;
  line-height: 1;
  font-family: "HN", "Pretendard", Arial, sans-serif;
  letter-spacing: 0.01em;
  color: #5a5955;
  transition: opacity 0.8s;
  pointer-events: none;
}

#ovh {
  opacity: 0;
}

#ovh.on {
  opacity: 1;
}

#track {
  width: 120px;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  display: none;
}

#bar {
  height: 100%;
  width: 0;
  background: rgba(255, 255, 255, 0.7);
}

#ovh {
  mix-blend-mode: difference;
}

#lbl {
  padding-left: 0;
  font-variant-numeric: tabular-nums;
}

#ovh.loading #lbl {
  padding-left: 0;
  font-size: 12px;
  letter-spacing: 0.01em;
  color: #5a5955;
}

#ovh.loading #lbl em {
  font-style: normal;
  color: #5a5955;
}

/* 영상 */
#stage {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: #000;
}

#stage video,
#stage .dummy {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#stage .dummy {
  display: none;
}

.scene video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 3장 영상. 파일이 없으면 숨고 더미 색이 보인다 */
.scene iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #05060a;
  pointer-events: none;
}

/* 4장은 웹 페이지(hairstyle_face.html — 같은 폴더의 파일을 주소로 연결) */
#sc4.on iframe {
  pointer-events: auto;
}

/* 그 장에서는 얼굴 둘레를 직접 움직일 수 있다. 스크롤·스와이프·위아래 키는 페이지가 메인으로 넘겨 준다 */
body.menuOpen #sc4 iframe {
  pointer-events: none;
}

#sc4 iframe.off {
  visibility: hidden;
  pointer-events: none !important;
}

/* 이름을 눌러 작품을 바꿀 때: 새 작품이 앞 작품 위로 서서히 나타난다 */
#sc4 iframe {
  transition: opacity 0.5s ease;
}
#sc4 iframe.in {
  opacity: 0;
  transition: none;
}

/* ③ 두 작품을 미리 받아 두고, 들어올 때마다 다른 쪽을 보인다 */
/* 더미 장면 — 영상이 아직 없거나 못 불러왔을 때의 바탕 (AI film 검정 / Mobility Lab 빨강). Graphic Archive 는 웹 페이지라 그 바탕과 같은 검정 */
.dummy {
  background: var(--c);
}

#demo {
  --c: #000;
}

#sc3 {
  --c: #c8322b;
}

#sc4 {
  --c: #05060a;
}

#demoTag {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(30px + env(safe-area-inset-bottom, 0px));
  font-weight: 700; /* 작은 이름표 규칙: 10px · 75 Bold · 자간 0 */
  font-size: 10px;
  line-height: 1;
  font-family: "HN", "Pretendard", Arial, sans-serif;
  letter-spacing: 0;
  color: #5a5955;
  display: none;
}

/* 네 모서리(로고·메뉴 버튼·하단 한 줄)는 공통 틀 frame.css. 여기에는 메인만의 것 */
/* 장면의 바깥 문(Mobility Lab ↗ · Graphic Archive ↗)은 상단 메뉴가 없는 좁은 화면에서만 보인다.
   넓은 화면에서는 같은 링크가 상단 7번 열에 늘 있고, 여기에 또 나오면 Colophon·Accessibility 와 겹친다 */
@media (min-width: 1024px) {
  #ctx .door {
    display: none !important;
  }
}

#ctx .door svg {
  width: 0.62em;
  height: 0.62em;
  margin-left: 0.22em;
  vertical-align: 0.02em;
}

/* 인트로 건너뛰기 — 키보드로 처음 닿는 곳. 포커스를 받을 때만 보인다 */
#skip {
  position: fixed;
  left: 50%;
  top: calc(16px + env(safe-area-inset-top, 0px));
  transform: translateX(-50%);
  z-index: 32;
  font-weight: 400; /* 푸터 규칙: 12px · 55 Roman · 자간 0.01em */
  font-size: 12px;
  line-height: 1;
  font-family: "HN", "Pretendard", Arial, sans-serif;
  letter-spacing: 0.01em;
  color: #fff;
  background: none;
  border: 0;
  padding: 16px 10px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: difference;
}

#skip:focus-visible {
  opacity: 1;
  pointer-events: auto;
  outline: 1px solid #7fd4c8;
  outline-offset: -4px;
}

@media (max-width: 900px) {
  #t2 i {
    font-size: 20px; /* 모바일: 16px 은 읽기에 작았다 — 20px / 36px */
    line-height: 36px;
    text-wrap: balance; /* 접히는 줄의 길이를 고르게(끝에 낱말 하나만 떨어지지 않게) */
  }

  #t2 .note {
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #ov,
  #ov .st,
  #t2 i,
  #t2.on i,
  #t2 .tint,
  #t2.on .tint,
  #t2 .note,
  #t2.on .note {
    transition-duration: 0.01s !important;
    transition-delay: 0s !important;
  }

  #t2.on .rd {
    animation: none;
    background: none;
    -webkit-text-fill-color: currentColor; /* 움직임을 줄인 환경: 차오르지 않고 처음부터 흰색 */
  }
}

/* ── 영상 장면 2·3 (자리표시) ── */
.scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 2;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
}

.scene.on {
  opacity: 1;
}
/* 검은 막(#pre, 앞 한 줄)이 먼저 덮이는 전환: 떠나는 장면도 들어오는 장면도 막이 다 덮인 뒤(0.8초)에 한 번에 바뀐다.
   그 전에는 막만 짙어진다 — 서서히 바꾸면 막이 덮이는 사이로 다음 장면이나 맨 아래 깔린 첫 영상이 잠깐 비친다 */
.scene.late,
.scene.on.late {
  transition: opacity 0s linear 0.8s;
}

.stag {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  font-weight: 700; /* 작은 이름표 규칙: 10px · 75 Bold · 자간 0 */
  font-size: 10px;
  line-height: 1.6;
  font-family: "HN", "Pretendard", Arial, sans-serif;
  letter-spacing: 0;
  color: #5a5955;
  text-align: center;
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
  padding-left: 0;
  mix-blend-mode: difference;
}

.stag.on {
  opacity: 1;
}

#vtime {
  position: fixed;
  left: 50%;
  bottom: calc(30px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 30;
  font-weight: 400; /* 푸터 규칙: 12px · 55 Roman · 자간 0.01em · 회색 */
  font-size: 12px;
  line-height: 1;
  font-family: "HN", "Pretendard", Arial, sans-serif;
  letter-spacing: 0.01em;
  color: #5a5955;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transition: opacity 0.6s ease;
  mix-blend-mode: difference;
}

#vtime.on {
  opacity: 1;
}

/* ── 오른쪽 인디케이터 — About·Work Index 와 같은 점. 지금 장은 채워진 점, 나머지는 선만. 올리면 이름.
세 문장이 나올 때 나타난다 ── */
#ind {
  position: fixed;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 25;
  display: flex;
  flex-direction: column;
  gap: 22px;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
}

#ind.show {
  opacity: 1;
  transition: opacity 1.2s ease 1.6s;
  pointer-events: auto;
}

#ind button {
  position: relative;
  width: 7px;
  height: 7px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: none;
  cursor: pointer;
  transition:
    background 0.3s,
    border-color 0.3s;
}

#ind button::after {
  content: "";
  position: absolute;
  inset: -9px;
}

/* 점은 작아도 누르는 자리는 25px */
#ind button:hover {
  border-color: #fff;
}

#ind button.on {
  background: #fff;
  border-color: #fff;
}

#ind button span {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  pointer-events: none;
  font-weight: 700; /* 인디케이터 이름표: Work Index 기준 — 10px · 75 Bold · 자간 0 · 회색 / 지금 장은 흰색 */
  font-size: 10px;
  line-height: 1;
  font-family: "HN", "Pretendard", Arial, sans-serif;
  letter-spacing: 0;
  color: #5a5955;
  opacity: 0;
  transition: opacity 0.2s;
}

#ind button.on span {
  color: #fff;
  opacity: 1; /* 지금 장의 이름은 항상 보인다. 다른 장은 마우스를 올릴 때만 */
}

#ind button:hover span,
#ind button:focus-visible span {
  opacity: 1;
}

#ind button:focus-visible {
  outline: 1px solid #7fd4c8;
  outline-offset: 3px;
}

/* 엿보는 녀석은 공통 파일 peek.css / peek.js (모든 페이지가 같이 쓴다) */
@media (max-width: 620px) {
  #ind {
    right: 10px;
    gap: 17px;
  }
  /* 폰: 지금 장의 이름표(AI FILM 등)는 숨기고 점만 — 가운데 글의 줄 끝과 겹친다(Work Index · About 모바일과 같은 규칙) */
  #ind button.on span,
  #ind button:hover span {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  #ind,
  #ind button,
  #ind button span {
    transition-duration: 0.01s !important;
    transition-delay: 0s !important;
  }
}

html.back #ov,
html.back #ovh {
  opacity: 0 !important;
  transition: none !important;
}

/* 돌아온 경우: 인트로 없이 보던 장으로 */
/* 흰 메뉴가 열리면 메인의 떠 있는 것들은 숨는다(메뉴 자체는 frame.css) */
body.menuOpen #vtime,
body.menuOpen #desc,
body.menuOpen #cap,
body.menuOpen #ind,
body.menuOpen #ovh {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ── Describe: 지금 장면을 한두 문장으로. 화면낭독기에는 항상, 화면에는 켰을 때만 ── */
#desc {
  position: fixed;
  left: 50%;
  bottom: calc(66px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 30;
  width: min(660px, calc(100% - 60px));
  margin: 0;
  text-align: center;
  font-weight: 500; /* 작은 문장 규칙(Work Index 왼쪽 요약과 같다): 14px/20px · 65 Medium */
  font-size: 14px;
  line-height: 20px;
  font-family: "HN", "Pretendard", Arial, sans-serif;
  letter-spacing: 0;
  word-spacing: 0;
  color: #fff;
  text-shadow: 0 0 22px rgba(5, 6, 10, 0.55);
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

#desc.on {
  opacity: 1;
}

body.light #desc {
  color: #05060a;
  text-shadow: none;
}

@media (max-width: 900px) {
  #desc {
    font-size: 14px;
  }
}

/* 장 캡션 — ④⑤가 시작될 때 방문당 한 번, 범례 문장 그대로. Describe 자리(가운데 아래)의 작은 한 줄 */
#cap {
  position: fixed;
  left: 50%;
  bottom: calc(66px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 30;
  margin: 0;
  font-weight: 400; /* 푸터 규칙: 12px · 55 Roman · 자간 0.01em (영상 위라 색은 흰색) */
  font-size: 12px;
  line-height: 1;
  font-family: "HN", "Pretendard", Arial, sans-serif;
  letter-spacing: 0.01em;
  color: #fff;
  white-space: nowrap;
  text-shadow: 0 0 18px rgba(5, 6, 10, 0.55);
  opacity: 0;
  transition: opacity 0.7s ease;
  pointer-events: none;
}

#cap.on {
  opacity: 1;
}

/* ③ Graphic Archive 장 제목 — 세 문장과 같은 규칙(24px · 65 Medium · 행간 48px, 대문자). 왼쪽 세로 가운데, 얼굴보다 위(겹쳐도 된다 — 얼굴은 재미).
링크 아님: 바깥으로 가는 길은 오른쪽 아래 작은 문과 메뉴가 맡는다. 포인터는 통과시켜 얼굴 둘레 움직임을 막지 않는다 */
#arcT {
  position: fixed;
  left: 30px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  margin: 0;
  pointer-events: none;
  /* Work Index 왼쪽 가운데 글(연도 + 그해 현황 세 줄)과 같은 규칙: 14px · 행간 20px · 대문자.
     지금 것은 흰색 75 Bold(연도 줄), 나머지는 #5a5955 65 Medium(현황 줄) */
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  font-family: "HN", "Pretendard", Arial, sans-serif;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff;
  opacity: 0;
  visibility: hidden; /* 보이지 않는 동안에는 키보드로도 닿지 않게 */
  transition: opacity 0.8s ease, visibility 0s linear 0.8s;
}

#arcT.on {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.8s ease 0.4s, visibility 0s;
}

/* 작품 이름 = 누르는 글. 지금 보는 것은 흰색(--c), 나머지는 흐리게 — 올리거나 초점이 가면 흰색 */
#arcT button {
  --c: #5a5955;
  display: block;
  max-width: min(600px, 42vw);
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  -webkit-appearance: none;
  appearance: none;
  font: inherit;
  letter-spacing: inherit;
  word-spacing: inherit;
  text-align: left;
  text-transform: inherit;
  color: var(--c);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#arcT.on button {
  pointer-events: auto;
}
#arcT button.on {
  --c: #fff;
  font-weight: 700;
  cursor: default;
}
#arcT button:hover,
#arcT button:focus-visible {
  --c: #fff;
}
#arcT button:focus-visible {
  outline: 1px solid #fff;
  outline-offset: 4px;
}

/* 누를 수 있다는 표시 셋
   ① 지금 보는 이름 앞에 짧은 선 — '이것이 골라져 있다'. 다른 이름에 올리면 선이 그쪽으로 옮겨 간다
   ② 올린 이름은 흰색 + 밑줄
   ③ 눈짓(.wk): 흐린 이름이 잠깐 밝아졌다 돌아온다(index.html 의 wink) */
#arcT button::before {
  content: "";
  display: inline-block;
  width: 0;
  height: 1px;
  margin: 0 0 1px 0;
  vertical-align: middle;
  background: #fff;
  transition: width 0.25s ease, margin-right 0.25s ease;
}
#arcT button.on::before {
  width: 16px;
  margin-right: 8px;
}
#arcT .rd {
  transition: background-color 0.35s ease, color 0.35s ease;
}
#arcT button.wk {
  --c: rgba(255, 255, 255, 0.92);
}
@media (hover: hover) {
  #arcT button:not(.on):hover::before {
    width: 16px;
    margin-right: 8px;
  }
  #arcT:has(button:not(.on):hover) button.on::before {
    width: 0;
    margin-right: 0;
  }
  #arcT button:not(.on):hover {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #arcT button::before,
  #arcT .rd {
    transition: none;
  }
}

/* 왼쪽 제목은 차오르지 않고 그냥 나타난다(전체가 한 번에 떠오른다).
   글자의 크기 · 굵기 · 서체는 가운데 글(세 문장 · 장면 앞 한 줄)과 같고, 그리는 방식도 같게 맞춘다
   (방식이 다르면 같은 24px · 65 라도 화면에서 굵기가 달라 보인다 — 특히 Windows). 움직임은 없다 */
#arcT .rd {
  font-weight: inherit;
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  #arcT .rd {
    background: var(--c, #fff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    -webkit-box-decoration-break: slice;
    box-decoration-break: slice;
    padding: 0.3em 0;
  }
}

/* 900px 이하에서는 가운데 글(세 문장 · 장면 앞 한 줄)이 16px 이 된다 — 왼쪽 제목도 같은 크기로(전에는 620px 까지 24px 로 남아 가운데 글보다 컸다) */

/* 빨간 바탕의 작품(Love)이 걸려 있는 동안: 틀의 회색 글씨는 빨강 위에서 읽히지 않는다 — 흰색 60%로 */
body.onRed #copy,
body.onRed #fnav a,
body.onRed #ctx a,
body.onRed #ctx button,
body.onRed #ctx button span,
body.onRed #langTop button:not([aria-pressed="true"]) {
  color: rgba(255, 255, 255, 0.6);
}
body.onRed #since,
body.onRed #since * {
  color: rgba(255, 255, 255, 0.6) !important; /* 흐르는 숫자: 틀이 색을 따로 정해 두어 여기서 눌러 준다 */
}
body.onRed #fnav a:hover,
body.onRed #ctx a:hover,
body.onRed #ctx button:hover,
body.onRed #ctx button:hover span,
body.onRed #ctx button[aria-pressed="true"],
body.onRed #ctx button[aria-pressed="true"] span,
body.onRed #langTop button:hover {
  color: #fff;
}

/* 폰: 아래쪽의 작품 이름이 그림(헤어의 얼굴, 미선나무의 꽃) 위에 놓인다 — 그 자리만 아래로 갈수록 어둡게 깔아 글이 읽히게. 빨간 작품에는 깔지 않는다 */
@media (max-width: 620px) {
  #sc4::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 260px;
    z-index: 3;
    pointer-events: none;
    background: linear-gradient(to top, rgba(5, 6, 10, 0.88) 0, rgba(5, 6, 10, 0.88) 46%, rgba(5, 6, 10, 0));
    transition: opacity 0.5s ease;
  }
  body.onRed #sc4::after {
    opacity: 0;
  }
}

/* 폰: 작품 이름 셋은 아래쪽 왼쪽에(로고 아래에 두면 로고·메뉴와 섞여 보인다). 맨 아래의 Graphic Archive 링크 위 */
@media (max-width: 620px) {
  #arcT {
    left: 20px;
    top: auto;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    transform: none;
    right: 44px; /* 오른쪽 인디케이터 점은 비운다 */
    line-height: 28px; /* 글자는 14px 그대로, 손가락으로 누르기 쉽게 줄 간격만 넓힌다 */
  }
  #arcT button {
    max-width: none;
  }
}

/* 빨간 작품(Love) 위에서는 회색이 읽히지 않는다 — 고르지 않은 이름은 흰색 60% */
body.onRed #arcT button:not(.on):not(:hover):not(:focus-visible):not(.wk) {
  --c: rgba(255, 255, 255, 0.6);
}

body.menuOpen #arcT {
  opacity: 0 !important;
}

@media (prefers-reduced-motion: reduce) {
  #arcT,
  #arcT.on {
    transition-duration: 0.01s;
    transition-delay: 0s;
  }
}

body.light #cap {
  color: #05060a;
  text-shadow: none;
}

/* Describe와 같은 처리 — 어떤 영상 위에서도 읽히게 */
@media (prefers-reduced-motion: reduce) {
  #desc,
  #cap {
    transition-duration: 0.01s !important;
    transition-delay: 0s !important;
  }
}

/* ── 장면 앞 한 줄 ── 영상(작품)이 나오기 전에 검은 화면에 문장이 먼저 나온다.
   세 문장과 같은 규칙(24px · 65 Medium · 행간 48px · 자간 0.012em · 낱말 간격 0.2em)이고, 같은 방식으로 한 번 차오른다. 민트 낱말은 처음부터 민트.
   장면(영상·작품) 위, 틀(로고·메뉴·하단) 아래에 깔린다. 문안과 시간은 index.html 의 PRE */
#pre {
  position: fixed;
  inset: 0;
  z-index: 24; /* 장면(2~4)과 인트로(20) 위, 오른쪽 점(25)과 틀(30) 아래 */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 7vw;
  text-align: center;
  background: #030305;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.8s ease, visibility 0s linear 0.8s; /* 영상의 페이드 아웃(막이 덮인다) · 페이드 인(막이 걷힌다) — index.html 의 FADE 와 같은 시간 */
  font-family: "HN", "Pretendard", Arial, sans-serif;
  font-weight: 500;
  font-size: 24px;
  line-height: 48px;
  letter-spacing: 0.012em;
  word-spacing: 0.2em;
  color: #fff;
}
#pre[lang="ko"] {
  letter-spacing: 0;
  word-spacing: normal;
}
#pre.on {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.8s ease, visibility 0s;
}
/* 세 문장(검은 화면)에서 첫 영상으로 넘어올 때는 막을 바로 덮는다 — 서서히 덮으면 그 사이로 영상이 잠깐 비친다 */
#pre.on.now {
  transition: none;
}
#pre p {
  margin: 0;
  text-wrap: balance;
}
#pre .tint {
  color: #7fd4c8;
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  #pre.on .rd {
    background: linear-gradient(90deg, #fff 48.54%, var(--unread, #363532) 51.46%) 100% 0 / 206% 100% no-repeat;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    -webkit-box-decoration-break: slice;
    box-decoration-break: slice;
    padding: 0.3em 0;
    animation: mainRead var(--dur, 1.2s) linear var(--del, 0.5s) both;
  }
}
@media (max-width: 900px) {
  #pre {
    font-size: 20px; /* 세 줄과 같다 */
    line-height: 36px;
  }
  #pre p {
    text-wrap: balance;
  }
}
@media (prefers-reduced-motion: reduce) {
  #pre.on .rd {
    animation: none;
    background: none;
    -webkit-text-fill-color: currentColor;
  }
}
/* 문장이 떠 있는 동안은 그 장의 글(왼쪽 제목 · 설명 · 영상 시간 · 진행선)을 잠깐 가린다 */
body:has(#pre.on) #arcT,
body:has(#pre.on) #desc,
body:has(#pre.on) #vtime,
body:has(#pre.on) #vbar {
  opacity: 0;
}

/* 첫 문장(DESIGN FOR UNDERSTANDING.): 폰에서는 두 줄, 24px.
   한 줄로 두면 폭에 맞춰 17px 까지 줄어 뒤에 나오는 세 줄(20px)보다 작아진다. 545px 는 한 줄 크기(4.4vw)가 24px 아래로 내려가는 폭 */
#t1 h1 br.m {
  display: none;
}
@media (max-width: 545px) {
  #t1 h1 {
    font-size: 24px;
    line-height: 34px;
    white-space: normal;
    text-align: center;
  }
  #t1 h1 br.m {
    display: inline;
  }
}

/* ── 한글(상단 오른쪽 KO) ── 한글 문장은 Pretendard Bold. 크기와 행간은 영어와 같다(24px / 48px, 900px 이하 16px / 32px, 설명 글 14px / 20px).
   서체 정의는 frame.css 의 "Pretendard KR Bold". 문장 안의 영문(AI)과 마침표도 같은 서체로 그려 굵기가 고르다.
   선명하게: 세로 자리는 스크립트가 기기 화소에 딱 맞춘다(반 화소에 걸리면 글자가 번진다).
   차오르는 동안과 다 찬 뒤를 같은 방식으로 그린다 — 다 찬 뒤 그리는 방식을 바꾸면 글자가 다시 그려지며 흔들려 보인다(예전의 .done 은 뺐다) */
/* (메인은 맨 위에서 모든 요소에 서체를 직접 지정하므로, 안쪽 요소까지 * 로 함께 바꾼다) */
#t2[lang="ko"],
#t2[lang="ko"] *,
#pre[lang="ko"],
#pre[lang="ko"] *,
#desc[lang="ko"] {
  font-family: "Pretendard KR Bold", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-weight: 700;
  letter-spacing: 0;
  word-spacing: normal;
}
/* 한글은 낱말 단위로만 줄이 바뀐다("바꿉 / 니다" 처럼 낱말 중간에서 끊기지 않게) */
#t2[lang="ko"] i,
#pre[lang="ko"] p {
  word-break: keep-all;
}

/* ── 조작 단추의 아이콘 · 영상 진행선 ── 넓은 화면에서는 글자만(아이콘·진행선은 숨김) */
#ctx .ico,
#vbar {
  display: none;
}

/* ── 모바일(620px 이하) 메인의 하단 ──
   · 조작 단추는 글자 대신 아이콘: 설명 · 멈춤 · 소리(오른쪽 한 줄, 누르는 자리 40px). About 은 뺀다(메뉴에 있다).
   · 영상 시간은 숫자 대신 화면 맨 아래의 가는 진행선.
   · 왼쪽 자리는 한 가지만: AI 필름에서는 ©Amoeba, Mobility Lab · Graphic Archive 에서는 그 사이트로 가는 문(↗).
   · 조작 단추는 보일 때(영상 장)만 자리를 차지한다 — 로딩·세 문장 화면에서는 "©Amoeba Day … since 1998" 이 한 줄로 나온다.
   · 가운데 글(Scroll · 로딩 숫자)은 About 처럼 하단 줄 위로, 설명 문장은 단추 줄 위로 */
@media (max-width: 620px) {
  #foot {
    align-items: center;
  }
  #foot #copy {
    flex: none;
    white-space: nowrap;
  }
  #foot #ctx:not(.on) {
    display: none;
  }
  #foot:has(#ctx.on) {
    bottom: calc(14px + env(safe-area-inset-bottom, 0px)); /* 단추(40px)의 가운데가 글자 줄 높이에 오게 */
  }
  #foot:has(#ctx.on) #copy em,
  #foot:has(#ctx.on .door:not([hidden])) #copy {
    display: none;
  }
  #foot #ctx {
    flex: 1;
    justify-content: flex-end;
    align-items: center;
    gap: 0;
    margin-right: -10px; /* 아이콘 그림의 오른쪽 끝이 화면 여백(20px)에 맞게 */
  }
  #ctx .abt,
  #vtime {
    display: none;
  }
  #ctx .door {
    margin: 0 auto 0 0;
    padding: 14px 6px 14px 0;
    color: #fff;
  }
  #ctx button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    margin: 0;
    color: #fff;
  }
  #ctx button[hidden] {
    display: none;
  }
  #ctx .ico {
    display: block;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  #ctx .tx {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap; /* 눈에는 안 보이고 화면낭독기에는 읽힌다 */
  }
  #ctx .ico .on,
  #ctx [aria-pressed="true"] .ico .off {
    display: none;
  }
  #ctx [aria-pressed="true"] .ico .on {
    display: inline;
  }
  #descBtn[aria-pressed="true"] .ico rect {
    fill: currentColor; /* 설명이 켜져 있으면 채워진다 */
  }
  #descBtn[aria-pressed="true"] .ico path {
    stroke: #05060a;
  }
  #ctx button:hover {
    color: #fff;
  }
  #vbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    height: 2px;
    background: rgba(255, 255, 255, 0.18);
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
  }
  #vbar.on {
    display: block;
    opacity: 1;
  }
  #vbar i {
    display: block;
    width: 0;
    height: 100%;
    background: #fff;
    transition: width 0.25s linear;
  }
  #ovh {
    bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  }
  #desc {
    bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    width: calc(100% - 44px);
  }
  body.light #vbar i {
    background: #05060a;
  }
  body.menuOpen #vbar {
    opacity: 0;
  }
}

/* ── 모바일(620px 이하): 읽는 문장(세 줄 · 장면 앞 한 줄)은 왼쪽 정렬, 18px / 32px ──
   모바일 규칙은 사이트 공통 두 가지: 저절로 넘어가는 제목 = 24px / 34px 가운데, 그 밖의 글 = 18px / 32px 왼쪽.
   About · Work Index 모바일과 같은 규칙: 왼쪽 끝 24px, 오른쪽은 점(장 표시) 자리만큼 40px 비운다.
   시작 제목(DESIGN FOR UNDERSTANDING.)은 저절로 넘어가는 제목이라 가운데 그대로.
   문안의 | 자리(<br class="m">)는 모바일에서만 줄을 바꾼다 — 한글이 뜻 단위로 끊기게 */
#t2 br.m,
#pre br.m {
  display: none;
}
@media (max-width: 620px) {
  #t2 .ls {
    align-self: stretch;
    text-align: left;
    padding: 0 40px 0 24px;
  }
  #t2 i {
    font-size: 18px;
    line-height: 32px;
    text-wrap: wrap;
  }
  #pre {
    justify-content: flex-start;
    text-align: left;
    padding: 0 40px 0 24px;
    font-size: 18px;
    line-height: 32px;
  }
  #pre p {
    text-wrap: wrap;
  }
  #t2 br.m,
  #pre br.m {
    display: inline;
  }
}

/* ── Mobility 영상 위의 글 (#vtx) ── 영상 파일에는 글자가 없고, 여기서 재생 시간에 맞춰 사이트 글자로 띄운다(문안과 시간은 index.html 의 VTX).
   세 문장 · 장면 앞 한 줄과 같은 규칙: 24px · 65 Medium · 행간 48px · 자간 0.012em · 낱말 간격 0.2em · 화면 가운데.
   낱말은 한 번에 바뀌고, 문장(.rd)은 읽는 속도로 차오른다(index.css 의 mainRead). 영상(장면) 위, 검은 막(#pre) 아래에 깔린다. */
#vtx {
  position: fixed;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 7vw;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  font-family: "HN", "Pretendard", Arial, sans-serif;
  font-weight: 500;
  font-size: 24px;
  line-height: 48px;
  letter-spacing: 0.012em;
  word-spacing: 0.2em;
  color: #fff;
  --unread: rgba(255, 255, 255, 0.34); /* 아직 차오르지 않은 글자: 영상 위에서도 보이게 옅은 흰색 */
}
#vtx.on {
  opacity: 1;
}
#vtx p {
  margin: 0;
  text-wrap: balance;
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  #vtx .rd {
    background: linear-gradient(90deg, #fff 48.54%, var(--unread) 51.46%) 100% 0 / 206% 100% no-repeat;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    -webkit-box-decoration-break: slice;
    box-decoration-break: slice;
    padding: 0.3em 0;
    animation: mainRead var(--dur, 1.2s) linear 0s both;
  }
  #vtx.hold .rd {
    animation-play-state: paused; /* 영상이 멈추면 차오르는 것도 멈춘다 */
  }
}
body.menuOpen #vtx {
  opacity: 0 !important;
}
@media (max-width: 900px) {
  #vtx {
    font-size: 20px;
    line-height: 36px;
  }
}
/* 폰: 저절로 넘어가는 제목 규칙 — 24px / 34px 가운데 */
@media (max-width: 620px) {
  #vtx {
    padding: 0 40px;
    font-size: 24px;
    line-height: 34px;
    letter-spacing: 0.06em;
    word-spacing: normal;
  }
}
@media (prefers-reduced-motion: reduce) {
  #vtx .rd {
    animation: none;
    background: none;
    -webkit-text-fill-color: currentColor;
  }
}
