/* ============================================================
   STUDIO 012 — 필름 아카이브 (film.html) + 첫 화면 '두 개의 아카이브'
   ============================================================ */
:root { --hole: #E9ECEF; --film-base: #120C07; --film-neg: #E2893A; --edge-ink: #E9A55B; --frame-h: clamp(170px, 26vw, 330px); }

/* ---------- 머리 ---------- */
.film-head { max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto;
  padding: calc(var(--header-h) + clamp(60px, 8vw, 120px)) var(--gutter) clamp(50px, 6vw, 90px);
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 28px var(--gutter); align-items: end; }
.film-head .kicker { grid-column: 1 / -1; margin: 0; font-family: var(--sans); font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--mute); }
.film-head .kicker::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 10px; vertical-align: 0;
  background: radial-gradient(circle, #FF6A3D, #9C2A12); box-shadow: 0 0 10px #FF5A2D; animation: safelight 3.2s ease-in-out infinite; }
@keyframes safelight { 50% { opacity: .45; box-shadow: 0 0 3px #FF5A2D; } }
.film-head h1 { margin: 0; font-weight: 300; font-size: clamp(34px, 5vw, 68px); line-height: 1.15; color: var(--title); letter-spacing: -.01em; }
.film-intro p { margin: 0 0 1em; max-width: 34em; }
.film-head .cam { grid-column: 1 / -1; margin: 10px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px var(--gutter);
  border-top: 1px solid var(--rule); padding-top: 16px; font-size: 12px; }
.film-head .cam dt, .roll .spec dt { font-family: var(--sans); font-size: 10px; letter-spacing: .1em; color: var(--mute); }
.film-head .cam dd, .roll .spec dd { margin: 0; color: var(--text); }
.view-toggle { grid-column: 1 / -1; display: flex; gap: 18px; font-family: var(--sans); font-size: 11px; letter-spacing: .1em; }
.view-toggle button { color: var(--mute); padding-bottom: 3px; border-bottom: 1px solid transparent; transition: color .3s, border-color .3s; }
.view-toggle button[aria-pressed="true"] { color: var(--title); border-color: var(--film-neg); }

/* ---------- 롤 ---------- */
.roll { margin: 0 0 clamp(80px, 10vw, 140px); }
.roll-head { max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto 26px; padding: 0 var(--gutter);
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 5fr) minmax(0, 4fr); gap: 16px var(--gutter); align-items: start; }
.roll-head .no { font-family: var(--sans); font-size: 10.5px; letter-spacing: .1em; color: var(--mute); }
.roll-head .no b { display: block; font-weight: 400; color: var(--edge-ink); letter-spacing: .2em; margin-bottom: 4px; }
.roll-head h2 { margin: 0 0 .5em; font-weight: 400; font-size: clamp(15px, 1.4vw, 19px); color: var(--title); }
.roll-head p { margin: 0; font-size: 12.5px; }
.roll .spec { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; font-size: 12px; }

/* 스트립 — 옆으로 스크롤 */
.strip-wrap { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; cursor: grab; padding: 0 var(--gutter) 14px; }
.strip-wrap:active { cursor: grabbing; }
.strip { display: inline-flex; align-items: stretch; background: var(--film-base); padding: 0 10px 0 0; position: relative;
  box-shadow: 0 24px 50px -40px rgba(0,0,0,.55); }
.strip .leader { width: clamp(70px, 9vw, 130px); flex: none; background: var(--film-base);
  clip-path: polygon(0 34%, 40% 34%, 52% 0, 100% 0, 100% 100%, 0 100%); }

.frame { margin: 0; flex: none; display: grid; grid-template-rows: auto var(--frame-h) auto; position: relative; padding: 0 5px; }
.frame figcaption { position: absolute; left: 9px; right: 9px; top: 100%; padding-top: 10px; font-size: 11px; color: var(--mute); line-height: 1.6; }

/* 가장자리 : 스프로킷 구멍 + 인쇄 글자 */
.edge { height: 19px; position: relative; display: flex; justify-content: space-between; align-items: center; padding: 0 6px;
  font-family: var(--sans); font-size: 8.5px; letter-spacing: .14em; color: var(--edge-ink); opacity: .85; white-space: nowrap; gap: 14px; }
.edge::before { content: ""; position: absolute; left: -6px; right: -6px; height: 5px;
  background: linear-gradient(90deg, transparent 0 6px, var(--hole) 6px 10px, transparent 10px) 0 0 / 15px 5px repeat-x; border-radius: 1px; opacity: .55; }
.edge.top::before { top: 3px; } .edge.bot::before { bottom: 3px; }
.edge span { position: relative; z-index: 1; padding-top: 9px; font-size: 7.5px; opacity: .8; }
.edge.bot span { padding: 0 0 9px; }

/* 컷 — 네거티브 → 현상 → 포지티브 */
.pic { position: relative; display: block; height: var(--frame-h); overflow: hidden; background: #2A1A0E; border-radius: 1px; }
.pic img { height: 100%; width: auto; max-width: none; transition: filter 1.9s cubic-bezier(.4,0,.2,1); filter: invert(1) contrast(.9) brightness(.95); }
.pic::after { content: ""; position: absolute; inset: 0; background: var(--film-neg); mix-blend-mode: multiply; transition: opacity 1.9s cubic-bezier(.4,0,.2,1); pointer-events: none; }
.pic::before { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255,60,30,.45) 50%, transparent 70%); background-size: 260% 100%; }
.frame.dev .pic img { filter: none; }
.frame.dev .pic::after { opacity: 0; }
.frame.dev .pic::before { animation: redlight 1.6s ease-out; }
@keyframes redlight { 0% { opacity: 1; background-position: 120% 0; } 100% { opacity: 0; background-position: -40% 0; } }
.view-neg .frame .pic img { filter: invert(1) contrast(.9) brightness(.95) !important; }
.view-neg .frame .pic::after { opacity: 1 !important; }
button.pic { cursor: zoom-in; padding: 0; }
button.pic:hover img { filter: none; }

/* 아직 찍히지 않은 롤 */
.frame.blank .pic { width: calc(var(--frame-h) * 1.5); background: linear-gradient(160deg, #3B2412, #1A0F07 70%); }
.frame.blank .glow { position: absolute; inset: 20% 25%; border-radius: 50%; background: radial-gradient(closest-side, rgba(233,165,91,.28), transparent);
  animation: unexposed 4.2s ease-in-out infinite; animation-delay: calc(var(--i, 0) * .3s); }
.frame.blank:nth-child(odd) .glow { animation-delay: -1.4s; }
@keyframes unexposed { 50% { opacity: .25; transform: scale(1.3); } }

@media (max-width: 760px) {
  .film-head, .roll-head { grid-template-columns: 1fr; }
}

/* ============ 첫 화면 : 두 개의 아카이브 ============ */
.archives { max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto; padding: clamp(70px, 9vw, 130px) var(--gutter) 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 2.4vw, 32px); }
.arc { position: relative; display: grid; grid-template-rows: auto 1fr auto; gap: 18px; min-height: clamp(300px, 34vw, 440px);
  padding: clamp(20px, 2.4vw, 32px); border: 1px solid var(--rule); overflow: hidden; transition: border-color .5s; }
.arc:hover { border-color: var(--rule-2); }
.arc .lbl { font-family: var(--sans); font-size: 10.5px; letter-spacing: .22em; color: var(--mute); text-transform: uppercase; display: flex; justify-content: space-between; }
.arc h3 { margin: 0; font-weight: 300; font-size: clamp(24px, 3vw, 40px); line-height: 1.2; color: var(--title); align-self: end; position: relative; z-index: 2; }
.arc h3 em { display: block; font-size: .42em; font-style: italic; color: var(--text); margin-top: .5em; }
.arc .go { font-family: var(--sans); font-size: 11px; letter-spacing: .1em; color: var(--title); position: relative; z-index: 2; }
.arc .go i { display: inline-block; width: 26px; height: 1px; background: var(--title); vertical-align: middle; margin-left: 10px; transform-origin: left; transition: width .6s var(--ease); }
.arc:hover .go i { width: 60px; }
/* 건축 : 겹친 표지가 펼쳐짐 */
.arc .stack { position: absolute; right: 8%; top: 18%; width: 46%; aspect-ratio: 4/3; }
.arc .stack img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) brightness(.85);
  transition: transform 1s cubic-bezier(.2,.8,.1,1), filter .8s; box-shadow: 0 20px 40px -24px rgba(0,0,0,.7); }
.arc .stack img:nth-child(1) { transform: rotate(-5deg) translate(-8%, 4%); }
.arc .stack img:nth-child(2) { transform: rotate(3deg) translate(4%, -2%); }
.arc:hover .stack img { filter: none; }
.arc:hover .stack img:nth-child(1) { transform: rotate(-11deg) translate(-34%, 10%); }
.arc:hover .stack img:nth-child(2) { transform: rotate(7deg) translate(22%, -6%); }
.arc:hover .stack img:nth-child(3) { transform: translateY(-8%) scale(1.04); }
/* 필름 : 스트립이 흐름 */
.arc .mini { position: absolute; left: 0; right: 0; top: 30%; height: 34%; background: var(--film-base); transform: rotate(-4deg) scale(1.1); overflow: hidden; }
.arc .mini::before, .arc .mini::after { content: ""; position: absolute; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, transparent 0 6px, var(--hole) 6px 10px, transparent 10px) 0 0 / 15px 4px repeat-x; z-index: 2; opacity: .55; }
.arc .mini::before { top: 4px; } .arc .mini::after { bottom: 4px; }
.arc .mini .run { position: absolute; top: 14%; bottom: 14%; left: 0; display: flex; gap: 10px; animation: filmrun 26s linear infinite; }
.arc:hover .mini .run { animation-duration: 9s; }
.arc .mini .run span { flex: none; height: 100%; aspect-ratio: 3/2; background: linear-gradient(160deg, #3B2412, #1A0F07 70%); position: relative; }
.arc .mini .run span img { width: 100%; height: 100%; object-fit: cover; filter: invert(1); mix-blend-mode: normal; transition: filter 1.4s; }
.arc:hover .mini .run span img { filter: none; }
@keyframes filmrun { to { transform: translateX(-50%); } }
@media (max-width: 760px) { .archives { grid-template-columns: 1fr; } }
